@lobb-js/studio 0.28.6 → 0.29.1
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 +1 -0
- package/dist/actions.d.ts +2 -0
- package/dist/components/Studio.svelte +46 -47
- package/dist/components/StudioRoot.svelte +19 -0
- package/dist/components/StudioRoot.svelte.d.ts +6 -0
- package/dist/components/breadCrumbs.svelte +5 -4
- package/dist/components/codeEditor.svelte +1 -1
- package/dist/components/combobox.svelte +3 -3
- package/dist/components/confirmationDialog/confirmationDialog.svelte +1 -1
- package/dist/components/dataTable/dataTable.svelte +108 -101
- package/dist/components/dataTable/dataTable.svelte.d.ts +5 -20
- package/dist/components/dataTable/dataTableTabs.svelte +4 -2
- package/dist/components/dataTable/dataTableTabs.svelte.d.ts +2 -0
- package/dist/components/dataTable/filter.svelte +1 -1
- package/dist/components/dataTable/filterButton.svelte +1 -1
- package/dist/components/dataTable/header.svelte +30 -47
- package/dist/components/dataTable/header.svelte.d.ts +4 -2
- package/dist/components/dataTable/listViewChildren.svelte +4 -6
- package/dist/components/dataTable/listViewChildren.svelte.d.ts +0 -1
- package/dist/components/dataTable/sort.svelte +1 -1
- package/dist/components/dataTable/sortButton.svelte +2 -2
- package/dist/components/dataTable/table.svelte +8 -10
- package/dist/components/dataTable/table.svelte.d.ts +0 -1
- package/dist/components/dataTableDrawer/dataTableDrawer.svelte +4 -1
- package/dist/components/dataTableDrawer/dataTableDrawer.svelte.d.ts +2 -0
- package/dist/components/detailView/create/children.svelte +2 -2
- package/dist/components/detailView/create/createDetailView.svelte +81 -88
- package/dist/components/detailView/create/createDetailView.svelte.d.ts +2 -2
- package/dist/components/detailView/create/createDetailViewButton.svelte +2 -2
- package/dist/components/detailView/create/createDetailViewButton.svelte.d.ts +1 -1
- package/dist/components/detailView/create/createManyView.svelte +12 -10
- package/dist/components/detailView/detailView.svelte +81 -0
- package/dist/components/detailView/detailView.svelte.d.ts +8 -0
- package/dist/components/detailView/fieldInput.svelte +11 -11
- package/dist/components/detailView/fieldInputReplacement.svelte +8 -8
- package/dist/components/detailView/passwordInput.svelte +1 -1
- package/dist/components/detailView/update/detailViewChildren.svelte +15 -26
- package/dist/components/detailView/update/detailViewChildren.svelte.d.ts +3 -8
- package/dist/components/detailView/update/updateDetailView.svelte +90 -69
- package/dist/components/detailView/update/updateDetailView.svelte.d.ts +2 -2
- package/dist/components/detailView/update/updateDetailViewButton.svelte +3 -2
- package/dist/components/detailView/update/updateDetailViewButton.svelte.d.ts +1 -1
- package/dist/components/detailView/utils.d.ts +17 -0
- package/dist/components/diffViewer.svelte +1 -1
- package/dist/components/extensionsComponents.svelte +3 -1
- package/dist/components/foreingKeyInput.svelte +2 -2
- package/dist/components/importButton.svelte +12 -9
- package/dist/components/landing.svelte +7 -0
- package/dist/components/landing.svelte.d.ts +6 -14
- package/dist/components/miniSidebar.svelte +90 -19
- package/dist/components/miniSidebar.svelte.d.ts +2 -17
- package/dist/components/polymorphicInput.svelte +1 -1
- package/dist/components/rangeCalendarButton.svelte +13 -13
- package/dist/components/richTextEditor.svelte +1 -1
- package/dist/components/routes/collections/collection.svelte +3 -3
- package/dist/components/routes/collections/collections.svelte +34 -12
- package/dist/components/routes/data_model/dataModel.svelte +6 -28
- package/dist/components/routes/data_model/dataModel.svelte.d.ts +17 -2
- package/dist/components/routes/extensions/extension.svelte +1 -1
- package/dist/components/routes/extensions/publicExtension.svelte +19 -0
- package/dist/components/routes/extensions/publicExtension.svelte.d.ts +13 -0
- package/dist/components/routes/home.svelte +3 -3
- package/dist/components/routes/workflows/workflows.svelte +9 -9
- package/dist/components/selectRecord.svelte +2 -21
- package/dist/components/setServerPage.svelte +1 -1
- package/dist/components/sidebar/sidebar.svelte +1 -1
- package/dist/components/sidebar/sidebarElements.svelte +4 -4
- package/dist/components/singletone.svelte +4 -6
- package/dist/components/ui/alert-dialog/alert-dialog-action.svelte +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog-cancel.svelte +1 -1
- package/dist/components/ui/button/button.svelte +2 -3
- package/dist/components/ui/command/command-dialog.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +1 -1
- package/dist/components/ui/select/select-separator.svelte +1 -1
- package/dist/components/workflowEditor.svelte +5 -5
- package/dist/eventSystem.d.ts +1 -1
- package/dist/eventSystem.js +7 -5
- package/dist/extensions/extension.types.d.ts +38 -14
- package/dist/extensions/extensionUtils.js +4 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/store.types.d.ts +2 -2
- package/dist/studioLifecycle.svelte.d.ts +2 -0
- package/dist/studioLifecycle.svelte.js +15 -0
- package/package.json +3 -4
- package/src/app.css +3 -0
- package/src/lib/actions.ts +2 -0
- package/src/lib/components/Studio.svelte +46 -47
- package/src/lib/components/StudioRoot.svelte +19 -0
- package/src/lib/components/breadCrumbs.svelte +5 -4
- package/src/lib/components/codeEditor.svelte +1 -1
- package/src/lib/components/combobox.svelte +3 -3
- package/src/lib/components/confirmationDialog/confirmationDialog.svelte +1 -1
- package/src/lib/components/dataTable/dataTable.svelte +108 -101
- package/src/lib/components/dataTable/dataTableTabs.svelte +4 -2
- package/src/lib/components/dataTable/filter.svelte +1 -1
- package/src/lib/components/dataTable/filterButton.svelte +1 -1
- package/src/lib/components/dataTable/header.svelte +30 -47
- package/src/lib/components/dataTable/listViewChildren.svelte +4 -6
- package/src/lib/components/dataTable/sort.svelte +1 -1
- package/src/lib/components/dataTable/sortButton.svelte +2 -2
- package/src/lib/components/dataTable/table.svelte +8 -10
- package/src/lib/components/dataTableDrawer/dataTableDrawer.svelte +4 -1
- package/src/lib/components/detailView/create/children.svelte +2 -2
- package/src/lib/components/detailView/create/createDetailView.svelte +81 -88
- package/src/lib/components/detailView/create/createDetailViewButton.svelte +2 -2
- package/src/lib/components/detailView/create/createManyView.svelte +12 -10
- package/src/lib/components/detailView/detailView.svelte +81 -0
- package/src/lib/components/detailView/fieldInput.svelte +11 -11
- package/src/lib/components/detailView/fieldInputReplacement.svelte +8 -8
- package/src/lib/components/detailView/passwordInput.svelte +1 -1
- package/src/lib/components/detailView/update/detailViewChildren.svelte +15 -26
- package/src/lib/components/detailView/update/updateDetailView.svelte +90 -69
- package/src/lib/components/detailView/update/updateDetailViewButton.svelte +3 -2
- package/src/lib/components/detailView/utils.ts +13 -0
- package/src/lib/components/diffViewer.svelte +1 -1
- package/src/lib/components/extensionsComponents.svelte +3 -1
- package/src/lib/components/foreingKeyInput.svelte +2 -2
- package/src/lib/components/importButton.svelte +12 -9
- package/src/lib/components/landing.svelte +7 -0
- package/src/lib/components/miniSidebar.svelte +90 -19
- package/src/lib/components/polymorphicInput.svelte +1 -1
- package/src/lib/components/rangeCalendarButton.svelte +13 -13
- package/src/lib/components/richTextEditor.svelte +1 -1
- package/src/lib/components/routes/collections/collection.svelte +3 -3
- package/src/lib/components/routes/collections/collections.svelte +34 -12
- package/src/lib/components/routes/data_model/dataModel.svelte +6 -28
- package/src/lib/components/routes/extensions/extension.svelte +1 -1
- package/src/lib/components/routes/extensions/publicExtension.svelte +19 -0
- package/src/lib/components/routes/home.svelte +3 -3
- package/src/lib/components/routes/workflows/workflows.svelte +9 -9
- package/src/lib/components/selectRecord.svelte +2 -21
- package/src/lib/components/setServerPage.svelte +1 -1
- package/src/lib/components/sidebar/sidebar.svelte +1 -1
- package/src/lib/components/sidebar/sidebarElements.svelte +4 -4
- package/src/lib/components/singletone.svelte +4 -6
- package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +1 -1
- package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +1 -1
- package/src/lib/components/ui/button/button.svelte +2 -3
- package/src/lib/components/ui/command/command-dialog.svelte +1 -1
- package/src/lib/components/ui/range-calendar/range-calendar-day.svelte +1 -1
- package/src/lib/components/ui/range-calendar/range-calendar-next-button.svelte +1 -1
- package/src/lib/components/ui/range-calendar/range-calendar-prev-button.svelte +1 -1
- package/src/lib/components/ui/select/select-separator.svelte +1 -1
- package/src/lib/components/workflowEditor.svelte +5 -5
- package/src/lib/eventSystem.ts +8 -7
- package/src/lib/extensions/extension.types.ts +39 -6
- package/src/lib/extensions/extensionUtils.ts +4 -2
- package/src/lib/index.ts +3 -1
- package/src/lib/store.types.ts +2 -2
- package/src/lib/studioLifecycle.svelte.ts +17 -0
- package/vite-plugins/index.js +2 -4
- package/vite-plugins/utils.js +15 -0
- package/vite-plugins/{workspace-optimize.js → workspace-fs-allow.js} +4 -18
- package/dist/components/routes/data_model/syncManager.svelte +0 -94
- package/dist/components/routes/data_model/syncManager.svelte.d.ts +0 -3
- package/src/lib/components/routes/data_model/syncManager.svelte +0 -94
- package/vite-plugins/contextual-lib-alias.js +0 -67
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
export declare let collapseMiniSideBar: () => void;
|
|
2
2
|
export declare let expandMiniSideBar: () => void;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
$$bindings?: Bindings;
|
|
6
|
-
} & Exports;
|
|
7
|
-
(internal: unknown, props: {
|
|
8
|
-
$$events?: Events;
|
|
9
|
-
$$slots?: Slots;
|
|
10
|
-
}): Exports & {
|
|
11
|
-
$set?: any;
|
|
12
|
-
$on?: any;
|
|
13
|
-
};
|
|
14
|
-
z_$$bindings?: Bindings;
|
|
15
|
-
}
|
|
16
|
-
declare const MiniSidebar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
}, {}, {}, string>;
|
|
19
|
-
type MiniSidebar = InstanceType<typeof MiniSidebar>;
|
|
3
|
+
declare const MiniSidebar: import("svelte").Component<Record<string, never>, {}, "">;
|
|
4
|
+
type MiniSidebar = ReturnType<typeof MiniSidebar>;
|
|
20
5
|
export default MiniSidebar;
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
}
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
|
-
<div class="flex h-9 w-full items-center gap-1.5 rounded-md border pl-1.5 pr-9 text-xs bg-muted
|
|
73
|
+
<div class="flex h-9 w-full items-center gap-1.5 rounded-md border pl-1.5 pr-9 text-xs bg-muted-soft {destructive ? 'border-destructive bg-destructive/10' : ''}">
|
|
74
74
|
<!-- Collection picker -->
|
|
75
75
|
<Popover.Root bind:open={collectionPopoverOpen}>
|
|
76
76
|
<Popover.Trigger>
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
today,
|
|
12
12
|
} from "@internationalized/date";
|
|
13
13
|
import { cn } from "../utils.js";
|
|
14
|
-
import { buttonVariants } from "
|
|
15
|
-
import { RangeCalendar } from "
|
|
16
|
-
import * as Popover from "
|
|
14
|
+
import { buttonVariants } from "./ui/button/index.js";
|
|
15
|
+
import { RangeCalendar } from "./ui/range-calendar/index.js";
|
|
16
|
+
import * as Popover from "./ui/popover/index.js";
|
|
17
17
|
import Input from "./ui/input/input.svelte";
|
|
18
18
|
|
|
19
19
|
interface Props {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
class="flex flex-col overflow-hidden text-muted-foreground"
|
|
60
60
|
>
|
|
61
61
|
<button
|
|
62
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
62
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
63
63
|
onclick={() => {
|
|
64
64
|
const currentDate = today(getLocalTimeZone());
|
|
65
65
|
value = {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
Today
|
|
72
72
|
</button>
|
|
73
73
|
<button
|
|
74
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
74
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
75
75
|
onclick={() => {
|
|
76
76
|
const currentDate = today(getLocalTimeZone());
|
|
77
77
|
value = {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
Yesterday
|
|
84
84
|
</button>
|
|
85
85
|
<button
|
|
86
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
86
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
87
87
|
onclick={() => {
|
|
88
88
|
const currentDate = today(getLocalTimeZone());
|
|
89
89
|
const weekStart = startOfWeek(currentDate, "en-US");
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
This week (Sun - Today)
|
|
97
97
|
</button>
|
|
98
98
|
<button
|
|
99
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
99
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
100
100
|
onclick={() => {
|
|
101
101
|
const currentDate = today(getLocalTimeZone());
|
|
102
102
|
const thisWeekStart = startOfWeek(
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
Last week (Sun - Sat)
|
|
120
120
|
</button>
|
|
121
121
|
<button
|
|
122
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
122
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
123
123
|
onclick={() => {
|
|
124
124
|
const currentDate = today(getLocalTimeZone());
|
|
125
125
|
value = {
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
Last 7 days
|
|
132
132
|
</button>
|
|
133
133
|
<button
|
|
134
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
134
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
135
135
|
onclick={() => {
|
|
136
136
|
const currentDate = today(getLocalTimeZone());
|
|
137
137
|
value = {
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
Last 30 days
|
|
144
144
|
</button>
|
|
145
145
|
<button
|
|
146
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
146
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
147
147
|
onclick={() => {
|
|
148
148
|
const currentDate = today(getLocalTimeZone());
|
|
149
149
|
value = {
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
Last 90 days
|
|
156
156
|
</button>
|
|
157
157
|
<button
|
|
158
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
158
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
159
159
|
onclick={() => {
|
|
160
160
|
const currentDate = today(getLocalTimeZone());
|
|
161
161
|
value = {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
Last 12 months
|
|
168
168
|
</button>
|
|
169
169
|
<button
|
|
170
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
170
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
171
171
|
onclick={() => {
|
|
172
172
|
const currentDate = today(getLocalTimeZone());
|
|
173
173
|
const lastYearStart = currentDate
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
Last Calendar year
|
|
186
186
|
</button>
|
|
187
187
|
<button
|
|
188
|
-
class="text-start text-sm py-2 px-2 hover:bg-muted
|
|
188
|
+
class="text-start text-sm py-2 px-2 hover:bg-muted-soft hover:text-primary"
|
|
189
189
|
onclick={() => {
|
|
190
190
|
const currentDate = today(getLocalTimeZone());
|
|
191
191
|
const yearStart = currentDate.set({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { CircleSlash2, Zap } from "lucide-svelte";
|
|
3
|
-
import DataTable from "
|
|
4
|
-
import SidebarTrigger from "
|
|
3
|
+
import DataTable from "../../dataTable/dataTable.svelte";
|
|
4
|
+
import SidebarTrigger from "../../sidebar/sidebarTrigger.svelte";
|
|
5
5
|
import { getStudioContext } from "../../../context";
|
|
6
|
-
import Singletone from "
|
|
6
|
+
import Singletone from "../../singletone.svelte";
|
|
7
7
|
|
|
8
8
|
const { ctx } = getStudioContext();
|
|
9
9
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { SideBarData, SideBarNode } from "
|
|
3
|
-
import Sidebar from "
|
|
2
|
+
import type { SideBarData, SideBarNode } from "../../sidebar/sidebarElements.svelte";
|
|
3
|
+
import Sidebar from "../../sidebar/sidebar.svelte";
|
|
4
4
|
import { getStudioContext } from "../../../context";
|
|
5
|
+
import { emitEvent } from "../../../eventSystem";
|
|
5
6
|
import Collection from "./collection.svelte";
|
|
7
|
+
import { onMount } from "svelte";
|
|
6
8
|
|
|
7
|
-
const { ctx } = getStudioContext();
|
|
9
|
+
const { lobb, ctx } = getStudioContext();
|
|
8
10
|
import { Table, Cpu, LibraryBig } from "lucide-svelte";
|
|
9
11
|
import * as Icons from "lucide-svelte";
|
|
10
12
|
|
|
@@ -15,21 +17,40 @@
|
|
|
15
17
|
|
|
16
18
|
let { collectionName } = $props();
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
// Start empty so unreadable collections never flash. Populated after the
|
|
21
|
+
// auth.canAccess checks resolve below.
|
|
22
|
+
let collectionsList = $state<SideBarData>([]);
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
onMount(async () => {
|
|
21
25
|
const collections = ctx.meta.collections;
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
// 1. Determine which collections the current user can read.
|
|
28
|
+
// Virtual collections (identifiers only — no rows) are excluded.
|
|
29
|
+
const allNames = Object.keys(collections).filter(
|
|
30
|
+
(name) => !collections[name].virtual,
|
|
31
|
+
);
|
|
32
|
+
const visibleNames = (
|
|
33
|
+
await Promise.all(
|
|
34
|
+
allNames.map(async (name) => {
|
|
35
|
+
const res = await emitEvent(
|
|
36
|
+
{ lobb, ctx },
|
|
37
|
+
"auth.canAccess",
|
|
38
|
+
{ collection: name, action: "read" },
|
|
39
|
+
);
|
|
40
|
+
return res === true ? name : null;
|
|
41
|
+
}),
|
|
42
|
+
)
|
|
43
|
+
).filter((n): n is string => n !== null);
|
|
24
44
|
|
|
25
|
-
|
|
45
|
+
// 2. Group the visible collections by their category/owner.
|
|
46
|
+
const groups = new Map<string, SideBarNode[]>();
|
|
47
|
+
for (const name of visibleNames) {
|
|
48
|
+
const value = collections[name];
|
|
26
49
|
let groupKey: string = (value as any).category ?? (value as any).owner;
|
|
27
50
|
if (groupKey === "__project") groupKey = "project";
|
|
28
51
|
else if (groupKey === "__core") groupKey = "core";
|
|
29
52
|
|
|
30
|
-
if (!groups.has(groupKey))
|
|
31
|
-
groups.set(groupKey, []);
|
|
32
|
-
}
|
|
53
|
+
if (!groups.has(groupKey)) groups.set(groupKey, []);
|
|
33
54
|
groups.get(groupKey)!.push({
|
|
34
55
|
type: "element",
|
|
35
56
|
name,
|
|
@@ -38,6 +59,7 @@
|
|
|
38
59
|
});
|
|
39
60
|
}
|
|
40
61
|
|
|
62
|
+
// 3. Build the sidebar tree and put `core` last.
|
|
41
63
|
const result: SideBarData = [];
|
|
42
64
|
for (const [groupKey, children] of groups) {
|
|
43
65
|
const extensionIconName = ctx.meta.extensions?.[groupKey]?.icon;
|
|
@@ -51,12 +73,12 @@
|
|
|
51
73
|
});
|
|
52
74
|
}
|
|
53
75
|
|
|
54
|
-
|
|
76
|
+
collectionsList = result.sort((a, b) => {
|
|
55
77
|
if ((a as any).name === "core") return 1;
|
|
56
78
|
if ((b as any).name === "core") return -1;
|
|
57
79
|
return 0;
|
|
58
80
|
});
|
|
59
|
-
}
|
|
81
|
+
});
|
|
60
82
|
</script>
|
|
61
83
|
|
|
62
84
|
<Sidebar title="Collections" data={collectionsList}>
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { SvelteFlowProvider } from "@xyflow/svelte";
|
|
3
3
|
import Flow from "./flow.svelte";
|
|
4
|
-
import Sidebar from "../../../components/sidebar/sidebar.svelte";
|
|
5
|
-
import { location } from "@wjfe/n-savant";
|
|
6
|
-
import SyncManager from "./syncManager.svelte";
|
|
7
|
-
import SidebarTrigger from "../../../components/sidebar/sidebarTrigger.svelte";
|
|
8
|
-
|
|
9
|
-
const currentPage = $derived(location.url.pathname.replace("/studio", "").split("/")[2]);
|
|
10
4
|
</script>
|
|
11
5
|
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{ type: "element", name: "graph", href: "/studio/datamodel/graph" },
|
|
17
|
-
{ type: "element", name: "query_editor", href: "/studio/datamodel/query_editor" },
|
|
18
|
-
]}
|
|
19
|
-
>
|
|
20
|
-
<div class="relative h-full w-full">
|
|
21
|
-
{#if currentPage === "graph"}
|
|
22
|
-
<SvelteFlowProvider>
|
|
23
|
-
<div style:width="100%" style:height="100%">
|
|
24
|
-
<Flow />
|
|
25
|
-
</div>
|
|
26
|
-
</SvelteFlowProvider>
|
|
27
|
-
{:else if currentPage === "query_editor"}
|
|
28
|
-
<SyncManager />
|
|
29
|
-
{/if}
|
|
30
|
-
<div class="absolute top-0 left-0 p-2.5">
|
|
31
|
-
<SidebarTrigger />
|
|
6
|
+
<div class="relative h-full w-full">
|
|
7
|
+
<SvelteFlowProvider>
|
|
8
|
+
<div style:width="100%" style:height="100%">
|
|
9
|
+
<Flow />
|
|
32
10
|
</div>
|
|
33
|
-
</
|
|
34
|
-
</
|
|
11
|
+
</SvelteFlowProvider>
|
|
12
|
+
</div>
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const DataModel: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type DataModel = InstanceType<typeof DataModel>;
|
|
3
18
|
export default DataModel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import ExtensionsComponents from "
|
|
2
|
+
import ExtensionsComponents from "../../extensionsComponents.svelte";
|
|
3
3
|
import { getExtensionUtils } from "../../../extensions/extensionUtils";
|
|
4
4
|
import { getStudioContext } from "../../../context";
|
|
5
5
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ExtensionsComponents from "../../extensionsComponents.svelte";
|
|
3
|
+
import { getExtensionUtils } from "../../../extensions/extensionUtils";
|
|
4
|
+
import { getStudioContext } from "../../../context";
|
|
5
|
+
|
|
6
|
+
let { extension, page } = $props();
|
|
7
|
+
|
|
8
|
+
const { lobb, ctx } = getStudioContext();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="grid h-full w-full overflow-auto bg-background">
|
|
12
|
+
{#key extension && page}
|
|
13
|
+
<ExtensionsComponents
|
|
14
|
+
name="publicPages.{page}"
|
|
15
|
+
utils={getExtensionUtils(lobb, ctx)}
|
|
16
|
+
filterByExtensions={[extension]}
|
|
17
|
+
/>
|
|
18
|
+
{/key}
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default PublicExtension;
|
|
2
|
+
type PublicExtension = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const PublicExtension: import("svelte").Component<{
|
|
7
|
+
extension: any;
|
|
8
|
+
page: any;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type $$ComponentProps = {
|
|
11
|
+
extension: any;
|
|
12
|
+
page: any;
|
|
13
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Button from "
|
|
3
|
-
import {
|
|
2
|
+
import Button from "../ui/button/button.svelte";
|
|
3
|
+
import { goto } from "$app/navigation";
|
|
4
4
|
import { ArrowRight } from "lucide-svelte";
|
|
5
5
|
import HomeFooter from "./homeFooter.svelte";
|
|
6
6
|
</script>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
Icon={ArrowRight}
|
|
22
22
|
variant="outline"
|
|
23
23
|
class="h-7 px-3 text-xs font-normal"
|
|
24
|
-
onclick={() =>
|
|
24
|
+
onclick={() => goto("/studio/collections")}
|
|
25
25
|
>
|
|
26
26
|
Go to collections
|
|
27
27
|
</Button>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { SideBarData, SideBarNode } from "
|
|
2
|
+
import type { SideBarData, SideBarNode } from "../../sidebar/sidebarElements.svelte";
|
|
3
3
|
import WorkflowEditor, {
|
|
4
4
|
type WorkflowEntry,
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../workflowEditor.svelte";
|
|
6
6
|
import { getStudioContext } from "../../../context";
|
|
7
7
|
|
|
8
8
|
const { lobb, ctx } = getStudioContext();
|
|
9
|
-
import Sidebar from "
|
|
10
|
-
import Button from "
|
|
11
|
-
import {
|
|
9
|
+
import Sidebar from "../../sidebar/sidebar.svelte";
|
|
10
|
+
import Button from "../../ui/button/button.svelte";
|
|
11
|
+
import { goto } from "$app/navigation";
|
|
12
12
|
import { CircleSlash2, Plus, Trash2 } from "lucide-svelte";
|
|
13
13
|
import { onMount } from "svelte";
|
|
14
14
|
import { showDialog } from "../../../actions";
|
|
15
|
-
import SidebarTrigger from "
|
|
15
|
+
import SidebarTrigger from "../../sidebar/sidebarTrigger.svelte";
|
|
16
16
|
|
|
17
17
|
let { workflowName } = $props();
|
|
18
18
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
const item: SideBarNode = {
|
|
40
40
|
type: "element",
|
|
41
41
|
name: workflow.name,
|
|
42
|
-
onclick: () =>
|
|
42
|
+
onclick: () => goto(`/studio/workflows/${workflow.name}`),
|
|
43
43
|
meta: { id: workflow.id },
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
await lobb.deleteOne("core_workflows", workflowId);
|
|
94
94
|
getSidebarData();
|
|
95
95
|
if (workflowEntry && workflowName === workflowEntry.name) {
|
|
96
|
-
|
|
96
|
+
goto("/studio/workflows");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
<Button
|
|
106
106
|
class="h-7 px-3 text-xs font-normal w-full"
|
|
107
107
|
variant="outline"
|
|
108
|
-
onclick={() =>
|
|
108
|
+
onclick={() => goto("/studio/workflows/new")}
|
|
109
109
|
Icon={Plus}
|
|
110
110
|
>
|
|
111
111
|
Create a Workflow
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import Button, { type ButtonProps } from "./ui/button/button.svelte";
|
|
4
4
|
import DataTable from "./dataTable/dataTable.svelte";
|
|
5
5
|
import { getCollectionPrimaryField } from "./dataTable/utils";
|
|
6
|
-
import { emitEvent } from "../eventSystem";
|
|
7
6
|
import { getStudioContext } from "../context";
|
|
8
7
|
import Drawer from "./drawer.svelte";
|
|
9
8
|
|
|
@@ -36,26 +35,8 @@
|
|
|
36
35
|
|
|
37
36
|
let openDrawer = $state(false);
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const eventResult = await emitEvent(
|
|
42
|
-
{ lobb, ctx },
|
|
43
|
-
"studio.collections.preForeignKeySelect",
|
|
44
|
-
{
|
|
45
|
-
parentCollectionName,
|
|
46
|
-
collectionName,
|
|
47
|
-
fieldName,
|
|
48
|
-
entry,
|
|
49
|
-
},
|
|
50
|
-
);
|
|
51
|
-
if (eventResult.filter) {
|
|
52
|
-
additionalFilter = eventResult.filter;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
openDrawer = true;
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error(error);
|
|
58
|
-
}
|
|
38
|
+
function handleButtonClick() {
|
|
39
|
+
openDrawer = true;
|
|
59
40
|
}
|
|
60
41
|
|
|
61
42
|
async function onSelectHandler(entry: any) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { toast } from "svelte-sonner";
|
|
3
3
|
import Button from "./ui/button/button.svelte";
|
|
4
4
|
import { getStudioContext } from "../context";
|
|
5
|
-
import { Input } from "
|
|
5
|
+
import { Input } from "./ui/input";
|
|
6
6
|
|
|
7
7
|
const { ctx } = getStudioContext();
|
|
8
8
|
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
{#if showSearch}
|
|
108
108
|
<div class="p-2">
|
|
109
109
|
<div
|
|
110
|
-
class="flex items-center px-4 py-1 text-muted-foreground bg-muted
|
|
110
|
+
class="flex items-center px-4 py-1 text-muted-foreground bg-muted-soft border rounded-md"
|
|
111
111
|
>
|
|
112
112
|
<input
|
|
113
113
|
type="text"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import type { Snippet } from "svelte";
|
|
31
31
|
import SidebarElements from "./sidebarElements.svelte";
|
|
32
32
|
import Button from "../ui/button/button.svelte";
|
|
33
|
-
import {
|
|
33
|
+
import { page } from "$app/state";
|
|
34
34
|
|
|
35
35
|
let {
|
|
36
36
|
data = $bindable(),
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
{#each data as node, index}
|
|
59
59
|
{#if node.type === "directory"}
|
|
60
60
|
<button
|
|
61
|
-
class="flex items-center justify-between p-2 gap-2 text-muted-foreground rounded-md hover:bg-muted
|
|
61
|
+
class="flex items-center justify-between p-2 gap-2 text-muted-foreground rounded-md hover:bg-muted-soft cursor-pointer"
|
|
62
62
|
onclick={() => toggleDir(index)}
|
|
63
63
|
>
|
|
64
64
|
<div class="flex items-center gap-2">
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
</div>
|
|
84
84
|
</div>
|
|
85
85
|
{:else}
|
|
86
|
-
{@const isselected =
|
|
86
|
+
{@const isselected = page.url.pathname === node.href}
|
|
87
87
|
<Button
|
|
88
88
|
onclick={() => handleElementClick(node)}
|
|
89
89
|
href={node.href}
|
|
90
90
|
variant="ghost"
|
|
91
91
|
class="
|
|
92
|
-
flex items-center justify-between p-2 gap-2 hover:bg-muted
|
|
92
|
+
flex items-center justify-between p-2 gap-2 hover:bg-muted-soft text-muted-foreground
|
|
93
93
|
rounded-md {isselected ? 'bg-muted' : ''}
|
|
94
94
|
"
|
|
95
95
|
title={node.name}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Save } from "lucide-svelte";
|
|
3
|
-
import
|
|
4
|
-
import { getCollectionFields } from "./detailView/utils";
|
|
3
|
+
import DetailView from "./detailView/detailView.svelte";
|
|
5
4
|
import SidebarTrigger from "./sidebar/sidebarTrigger.svelte";
|
|
6
5
|
import Button from "./ui/button/button.svelte";
|
|
7
6
|
import { onMount } from "svelte";
|
|
@@ -9,7 +8,7 @@
|
|
|
9
8
|
import { toast } from "svelte-sonner";
|
|
10
9
|
import Skeleton from "./ui/skeleton/skeleton.svelte";
|
|
11
10
|
|
|
12
|
-
const { lobb
|
|
11
|
+
const { lobb } = getStudioContext();
|
|
13
12
|
|
|
14
13
|
interface Props {
|
|
15
14
|
collectionName: string;
|
|
@@ -17,9 +16,8 @@
|
|
|
17
16
|
|
|
18
17
|
let { collectionName }: Props = $props();
|
|
19
18
|
|
|
20
|
-
let entry = $state({});
|
|
19
|
+
let entry = $state<Record<string, any>>({});
|
|
21
20
|
let loading = $state(true);
|
|
22
|
-
const formFields = getCollectionFields(ctx, collectionName);
|
|
23
21
|
|
|
24
22
|
onMount(async () => {
|
|
25
23
|
const result = await fetch(`${lobb.lobbUrl}/api/collections/${collectionName}/singleton`, {
|
|
@@ -60,7 +58,7 @@
|
|
|
60
58
|
</div>
|
|
61
59
|
{:else}
|
|
62
60
|
<div class="flex-1 overflow-y-auto max-w-xl">
|
|
63
|
-
<
|
|
61
|
+
<DetailView {collectionName} bind:entry />
|
|
64
62
|
</div>
|
|
65
63
|
{/if}
|
|
66
64
|
</div>
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
<script lang="ts">
|
|
50
50
|
import { cn } from "../../../utils.js";
|
|
51
51
|
import { LoaderCircle } from "lucide-svelte";
|
|
52
|
-
import { Link, location } from "@wjfe/n-savant";
|
|
53
52
|
|
|
54
53
|
let {
|
|
55
54
|
class: className,
|
|
@@ -94,9 +93,9 @@
|
|
|
94
93
|
{/snippet}
|
|
95
94
|
|
|
96
95
|
{#if href}
|
|
97
|
-
<
|
|
96
|
+
<a {href} class={cn(buttonVariants({ variant, size }), className)}>
|
|
98
97
|
{@render innerPart()}
|
|
99
|
-
</
|
|
98
|
+
</a>
|
|
100
99
|
{:else}
|
|
101
100
|
<button
|
|
102
101
|
bind:this={ref}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
-
import { buttonVariants } from "
|
|
3
|
+
import { buttonVariants } from "../button/index.js";
|
|
4
4
|
import { cn } from "../../../utils.js";
|
|
5
5
|
|
|
6
6
|
let {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronRight from "@lucide/svelte/icons/chevron-right";
|
|
4
|
-
import { buttonVariants } from "
|
|
4
|
+
import { buttonVariants } from "../button/index.js";
|
|
5
5
|
import { cn } from "../../../utils.js";
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronLeft from "@lucide/svelte/icons/chevron-left";
|
|
4
|
-
import { buttonVariants } from "
|
|
4
|
+
import { buttonVariants } from "../button/index.js";
|
|
5
5
|
import { cn } from "../../../utils.js";
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|