@lobb-js/studio 0.1.31
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/.env.example +1 -0
- package/.storybook/main.ts +31 -0
- package/.storybook/preview.ts +21 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/README.md +47 -0
- package/components.json +16 -0
- package/docker-entrypoint.sh +7 -0
- package/dockerfile +27 -0
- package/index.html +13 -0
- package/package.json +77 -0
- package/public/lobb.svg +15 -0
- package/src/Studio.svelte +150 -0
- package/src/app.css +121 -0
- package/src/components-export.ts +21 -0
- package/src/extensions/extension.types.ts +93 -0
- package/src/extensions/extensionUtils.ts +192 -0
- package/src/lib/Lobb.ts +241 -0
- package/src/lib/components/LlmButton.svelte +136 -0
- package/src/lib/components/alertView.svelte +20 -0
- package/src/lib/components/breadCrumbs.svelte +60 -0
- package/src/lib/components/combobox.svelte +92 -0
- package/src/lib/components/confirmationDialog/confirmationDialog.svelte +33 -0
- package/src/lib/components/confirmationDialog/store.svelte.ts +28 -0
- package/src/lib/components/createManyButton.svelte +107 -0
- package/src/lib/components/dataTable/childRecords.svelte +140 -0
- package/src/lib/components/dataTable/dataTable.svelte +223 -0
- package/src/lib/components/dataTable/fieldCell.svelte +74 -0
- package/src/lib/components/dataTable/filter.svelte +282 -0
- package/src/lib/components/dataTable/filterButton.svelte +39 -0
- package/src/lib/components/dataTable/footer.svelte +84 -0
- package/src/lib/components/dataTable/header.svelte +154 -0
- package/src/lib/components/dataTable/sort.svelte +171 -0
- package/src/lib/components/dataTable/sortButton.svelte +36 -0
- package/src/lib/components/dataTable/table.svelte +337 -0
- package/src/lib/components/dataTable/utils.ts +127 -0
- package/src/lib/components/detailView/create/children.svelte +68 -0
- package/src/lib/components/detailView/create/createDetailView.svelte +226 -0
- package/src/lib/components/detailView/create/createDetailViewButton.svelte +32 -0
- package/src/lib/components/detailView/create/createManyView.svelte +250 -0
- package/src/lib/components/detailView/create/subRecords.svelte +48 -0
- package/src/lib/components/detailView/detailViewForm.svelte +104 -0
- package/src/lib/components/detailView/fieldCustomInput.svelte +23 -0
- package/src/lib/components/detailView/fieldInput.svelte +287 -0
- package/src/lib/components/detailView/fieldInputReplacement.svelte +199 -0
- package/src/lib/components/detailView/store.svelte.ts +61 -0
- package/src/lib/components/detailView/update/children.svelte +94 -0
- package/src/lib/components/detailView/update/updateDetailView.svelte +175 -0
- package/src/lib/components/detailView/update/updateDetailViewButton.svelte +32 -0
- package/src/lib/components/detailView/utils.ts +177 -0
- package/src/lib/components/diffViewer.svelte +102 -0
- package/src/lib/components/drawer.svelte +28 -0
- package/src/lib/components/extensionsComponents.svelte +31 -0
- package/src/lib/components/foreingKeyInput.svelte +80 -0
- package/src/lib/components/header.svelte +45 -0
- package/src/lib/components/loadingTypesForMonacoEditor.ts +36 -0
- package/src/lib/components/miniSidebar.svelte +238 -0
- package/src/lib/components/monacoEditor.svelte +181 -0
- package/src/lib/components/rangeCalendarButton.svelte +257 -0
- package/src/lib/components/selectRecord.svelte +126 -0
- package/src/lib/components/setServerPage.svelte +48 -0
- package/src/lib/components/sidebar/index.ts +4 -0
- package/src/lib/components/sidebar/sidebar.svelte +149 -0
- package/src/lib/components/sidebar/sidebarElements.svelte +144 -0
- package/src/lib/components/sidebar/sidebarTrigger.svelte +33 -0
- package/src/lib/components/singletone.svelte +69 -0
- package/src/lib/components/ui/accordion/accordion-content.svelte +22 -0
- package/src/lib/components/ui/accordion/accordion-item.svelte +12 -0
- package/src/lib/components/ui/accordion/accordion-trigger.svelte +31 -0
- package/src/lib/components/ui/accordion/index.ts +17 -0
- package/src/lib/components/ui/alert/alert-description.svelte +16 -0
- package/src/lib/components/ui/alert/alert-title.svelte +24 -0
- package/src/lib/components/ui/alert/alert.svelte +39 -0
- package/src/lib/components/ui/alert/index.ts +14 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +13 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +17 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +26 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +16 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +20 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +19 -0
- package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +18 -0
- package/src/lib/components/ui/alert-dialog/index.ts +40 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +16 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +31 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +23 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +15 -0
- package/src/lib/components/ui/breadcrumb/index.ts +25 -0
- package/src/lib/components/ui/button/button.svelte +110 -0
- package/src/lib/components/ui/button/index.ts +17 -0
- package/src/lib/components/ui/checkbox/checkbox.svelte +35 -0
- package/src/lib/components/ui/checkbox/index.ts +6 -0
- package/src/lib/components/ui/command/command-dialog.svelte +35 -0
- package/src/lib/components/ui/command/command-empty.svelte +12 -0
- package/src/lib/components/ui/command/command-group.svelte +31 -0
- package/src/lib/components/ui/command/command-input.svelte +25 -0
- package/src/lib/components/ui/command/command-item.svelte +19 -0
- package/src/lib/components/ui/command/command-link-item.svelte +19 -0
- package/src/lib/components/ui/command/command-list.svelte +16 -0
- package/src/lib/components/ui/command/command-separator.svelte +12 -0
- package/src/lib/components/ui/command/command-shortcut.svelte +20 -0
- package/src/lib/components/ui/command/command.svelte +21 -0
- package/src/lib/components/ui/command/index.ts +40 -0
- package/src/lib/components/ui/dialog/dialog-content.svelte +38 -0
- package/src/lib/components/ui/dialog/dialog-description.svelte +16 -0
- package/src/lib/components/ui/dialog/dialog-footer.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +19 -0
- package/src/lib/components/ui/dialog/dialog-title.svelte +16 -0
- package/src/lib/components/ui/dialog/index.ts +37 -0
- package/src/lib/components/ui/input/index.ts +7 -0
- package/src/lib/components/ui/input/input.svelte +46 -0
- package/src/lib/components/ui/label/index.ts +7 -0
- package/src/lib/components/ui/label/label.svelte +19 -0
- package/src/lib/components/ui/popover/index.ts +17 -0
- package/src/lib/components/ui/popover/popover-content.svelte +28 -0
- package/src/lib/components/ui/range-calendar/index.ts +30 -0
- package/src/lib/components/ui/range-calendar/range-calendar-cell.svelte +19 -0
- package/src/lib/components/ui/range-calendar/range-calendar-day.svelte +35 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-body.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-head.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid-row.svelte +12 -0
- package/src/lib/components/ui/range-calendar/range-calendar-grid.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-head-cell.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-header.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-heading.svelte +16 -0
- package/src/lib/components/ui/range-calendar/range-calendar-months.svelte +20 -0
- package/src/lib/components/ui/range-calendar/range-calendar-next-button.svelte +27 -0
- package/src/lib/components/ui/range-calendar/range-calendar-prev-button.svelte +27 -0
- package/src/lib/components/ui/range-calendar/range-calendar.svelte +57 -0
- package/src/lib/components/ui/select/index.ts +34 -0
- package/src/lib/components/ui/select/select-content.svelte +38 -0
- package/src/lib/components/ui/select/select-group-heading.svelte +16 -0
- package/src/lib/components/ui/select/select-item.svelte +37 -0
- package/src/lib/components/ui/select/select-scroll-down-button.svelte +19 -0
- package/src/lib/components/ui/select/select-scroll-up-button.svelte +19 -0
- package/src/lib/components/ui/select/select-separator.svelte +13 -0
- package/src/lib/components/ui/select/select-trigger.svelte +24 -0
- package/src/lib/components/ui/separator/index.ts +7 -0
- package/src/lib/components/ui/separator/separator.svelte +22 -0
- package/src/lib/components/ui/skeleton/index.ts +7 -0
- package/src/lib/components/ui/skeleton/skeleton.svelte +22 -0
- package/src/lib/components/ui/sonner/index.ts +1 -0
- package/src/lib/components/ui/sonner/sonner.svelte +20 -0
- package/src/lib/components/ui/switch/index.ts +7 -0
- package/src/lib/components/ui/switch/switch.svelte +27 -0
- package/src/lib/components/ui/textarea/index.ts +7 -0
- package/src/lib/components/ui/textarea/textarea.svelte +22 -0
- package/src/lib/components/ui/tooltip/index.ts +18 -0
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +21 -0
- package/src/lib/components/workflowEditor.svelte +187 -0
- package/src/lib/eventSystem.ts +38 -0
- package/src/lib/index.ts +40 -0
- package/src/lib/store.svelte.ts +21 -0
- package/src/lib/store.types.ts +28 -0
- package/src/lib/utils.ts +84 -0
- package/src/main.ts +18 -0
- package/src/routes/collections/collection.svelte +46 -0
- package/src/routes/collections/collections.svelte +43 -0
- package/src/routes/data_model/dataModel.svelte +40 -0
- package/src/routes/data_model/flow.css +22 -0
- package/src/routes/data_model/flow.svelte +82 -0
- package/src/routes/data_model/syncManager.svelte +93 -0
- package/src/routes/data_model/utils.ts +35 -0
- package/src/routes/extensions/extension.svelte +16 -0
- package/src/routes/home.svelte +36 -0
- package/src/routes/workflows/workflows.svelte +135 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/detailView/detailViewForm.stories.svelte +79 -0
- package/src/stories/examples/Button.stories.svelte +31 -0
- package/src/stories/examples/Button.svelte +30 -0
- package/src/stories/examples/Header.stories.svelte +26 -0
- package/src/stories/examples/Header.svelte +45 -0
- package/src/stories/examples/Page.stories.svelte +29 -0
- package/src/stories/examples/Page.svelte +70 -0
- package/src/stories/examples/button.css +30 -0
- package/src/stories/examples/header.css +32 -0
- package/src/stories/examples/page.css +68 -0
- package/src/vite-env.d.ts +2 -0
- package/svelte.config.js +7 -0
- package/todo.md +24 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.json +14 -0
- package/tsconfig.node.json +24 -0
- package/vite-plugin-contextual-lib.js +66 -0
- package/vite.build.svelte.config.ts +18 -0
- package/vite.config.ts +84 -0
- package/vite.extension.config.ts +81 -0
- package/vite_utils.ts +28 -0
- package/vitest.shims.d.ts +1 -0
package/.env.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
LOBB_URL=http://localhost:3000
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StorybookConfig } from '@storybook/svelte-vite';
|
|
2
|
+
|
|
3
|
+
import { dirname } from "path"
|
|
4
|
+
|
|
5
|
+
import { fileURLToPath } from "url"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This function is used to resolve the absolute path of a package.
|
|
9
|
+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
10
|
+
*/
|
|
11
|
+
function getAbsolutePath(value: string): any {
|
|
12
|
+
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)))
|
|
13
|
+
}
|
|
14
|
+
const config: StorybookConfig = {
|
|
15
|
+
"stories": [
|
|
16
|
+
"../src/**/*.mdx",
|
|
17
|
+
"../src/**/*.stories.@(js|ts|svelte)"
|
|
18
|
+
],
|
|
19
|
+
"addons": [
|
|
20
|
+
getAbsolutePath('@storybook/addon-svelte-csf'),
|
|
21
|
+
getAbsolutePath('@chromatic-com/storybook'),
|
|
22
|
+
getAbsolutePath('@storybook/addon-docs'),
|
|
23
|
+
getAbsolutePath("@storybook/addon-a11y"),
|
|
24
|
+
getAbsolutePath("@storybook/addon-vitest")
|
|
25
|
+
],
|
|
26
|
+
"framework": {
|
|
27
|
+
"name": getAbsolutePath('@storybook/svelte-vite'),
|
|
28
|
+
"options": {}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export default config;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Preview } from '@storybook/svelte-vite'
|
|
2
|
+
|
|
3
|
+
const preview: Preview = {
|
|
4
|
+
parameters: {
|
|
5
|
+
controls: {
|
|
6
|
+
matchers: {
|
|
7
|
+
color: /(background|color)$/i,
|
|
8
|
+
date: /Date$/i,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
a11y: {
|
|
13
|
+
// 'todo' - show a11y violations in the test UI only
|
|
14
|
+
// 'error' - fail CI on a11y violations
|
|
15
|
+
// 'off' - skip a11y checks entirely
|
|
16
|
+
test: 'todo'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default preview;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
|
|
2
|
+
import { setProjectAnnotations } from '@storybook/svelte-vite';
|
|
3
|
+
import * as projectAnnotations from './preview';
|
|
4
|
+
|
|
5
|
+
// This is an important step to apply the right configuration when testing your stories.
|
|
6
|
+
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
|
|
7
|
+
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Svelte + TS + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Svelte and TypeScript in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
|
|
8
|
+
|
|
9
|
+
## Need an official Svelte framework?
|
|
10
|
+
|
|
11
|
+
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
|
|
12
|
+
|
|
13
|
+
## Technical considerations
|
|
14
|
+
|
|
15
|
+
**Why use this over SvelteKit?**
|
|
16
|
+
|
|
17
|
+
- It brings its own routing solution which might not be preferable for some users.
|
|
18
|
+
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
|
19
|
+
|
|
20
|
+
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
|
|
21
|
+
|
|
22
|
+
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
|
|
23
|
+
|
|
24
|
+
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
|
|
25
|
+
|
|
26
|
+
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
|
|
27
|
+
|
|
28
|
+
**Why include `.vscode/extensions.json`?**
|
|
29
|
+
|
|
30
|
+
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
|
|
31
|
+
|
|
32
|
+
**Why enable `allowJs` in the TS template?**
|
|
33
|
+
|
|
34
|
+
While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
|
|
35
|
+
|
|
36
|
+
**Why is HMR not preserving my local component state?**
|
|
37
|
+
|
|
38
|
+
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
|
|
39
|
+
|
|
40
|
+
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// store.ts
|
|
44
|
+
// An extremely simple external store
|
|
45
|
+
import { writable } from 'svelte/store'
|
|
46
|
+
export default writable(0)
|
|
47
|
+
```
|
package/components.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://shadcn-svelte.com/schema.json",
|
|
3
|
+
"tailwind": {
|
|
4
|
+
"css": "src/app.css",
|
|
5
|
+
"baseColor": "slate"
|
|
6
|
+
},
|
|
7
|
+
"aliases": {
|
|
8
|
+
"components": "$lib/components",
|
|
9
|
+
"utils": "$lib/utils",
|
|
10
|
+
"ui": "$lib/components/ui",
|
|
11
|
+
"hooks": "$lib/hooks",
|
|
12
|
+
"lib": "$lib"
|
|
13
|
+
},
|
|
14
|
+
"typescript": true,
|
|
15
|
+
"registry": "https://shadcn-svelte.com/registry"
|
|
16
|
+
}
|
package/dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Stage 1: Build
|
|
2
|
+
FROM node:22-alpine AS builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
COPY package*.json ./
|
|
7
|
+
RUN npm install
|
|
8
|
+
|
|
9
|
+
COPY . .
|
|
10
|
+
RUN npm run build
|
|
11
|
+
|
|
12
|
+
# Stage 2: Runtime
|
|
13
|
+
FROM node:22-alpine
|
|
14
|
+
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
|
|
17
|
+
RUN npm install -g sirv-cli
|
|
18
|
+
|
|
19
|
+
# Copy only built output
|
|
20
|
+
COPY --from=builder /app/dist ./dist
|
|
21
|
+
|
|
22
|
+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
23
|
+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
24
|
+
|
|
25
|
+
EXPOSE 3000
|
|
26
|
+
|
|
27
|
+
ENTRYPOINT ["sh", "/usr/local/bin/docker-entrypoint.sh"]
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/lobb.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Lobb Studio</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lobb-js/studio",
|
|
3
|
+
"version": "0.1.31",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./src/Studio.svelte",
|
|
10
|
+
"./vite-plugin": "./vite-plugin-contextual-lib.js",
|
|
11
|
+
"./components": "./src/components-export.ts"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"dev": "vite",
|
|
15
|
+
"build": "rm -rf dist && vite build --config vite.build.svelte.config.ts && vite build",
|
|
16
|
+
"preview": "vite preview",
|
|
17
|
+
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
|
|
18
|
+
"build_extension": "vite build --config vite.extension.config.ts",
|
|
19
|
+
"storybook": "storybook dev -p 6006",
|
|
20
|
+
"build-storybook": "storybook build",
|
|
21
|
+
"test": "vitest",
|
|
22
|
+
"test-storybook": "vitest --project=storybook"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@chromatic-com/storybook": "^4.1.2",
|
|
26
|
+
"@lucide/svelte": "^0.563.1",
|
|
27
|
+
"@storybook/addon-a11y": "^10.0.1",
|
|
28
|
+
"@storybook/addon-docs": "^10.0.1",
|
|
29
|
+
"@storybook/addon-svelte-csf": "^5.0.10",
|
|
30
|
+
"@storybook/addon-vitest": "^10.0.1",
|
|
31
|
+
"@storybook/svelte-vite": "^10.0.1",
|
|
32
|
+
"@sveltejs/vite-plugin-svelte": "6.2.1",
|
|
33
|
+
"@tsconfig/svelte": "^5.0.4",
|
|
34
|
+
"@types/lodash": "^4.17.17",
|
|
35
|
+
"@types/mustache": "^4.2.6",
|
|
36
|
+
"@types/node": "^22.14.1",
|
|
37
|
+
"@types/qs": "^6.9.18",
|
|
38
|
+
"@types/sortablejs": "^1.15.8",
|
|
39
|
+
"@vitest/browser-playwright": "^4.0.5",
|
|
40
|
+
"@vitest/coverage-v8": "^4.0.5",
|
|
41
|
+
"autoprefixer": "^10.4.20",
|
|
42
|
+
"bits-ui": "^1.6.0",
|
|
43
|
+
"browser-fs-access": "^0.35.0",
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"dts-bundle-generator": "^9.5.1",
|
|
46
|
+
"lucide-svelte": "^0.488.0",
|
|
47
|
+
"mode-watcher": "^0.5.1",
|
|
48
|
+
"monaco-editor": "^0.52.2",
|
|
49
|
+
"playwright": "^1.56.1",
|
|
50
|
+
"qs": "^6.14.0",
|
|
51
|
+
"sortablejs": "^1.15.6",
|
|
52
|
+
"storybook": "^10.0.1",
|
|
53
|
+
"svelte": "5.39.8",
|
|
54
|
+
"svelte-check": "^4.1.4",
|
|
55
|
+
"svelte-sonner": "^0.3.28",
|
|
56
|
+
"tailwind-merge": "^3.4.0",
|
|
57
|
+
"tailwind-variants": "^3.2.2",
|
|
58
|
+
"tailwindcss": "^4.1.18",
|
|
59
|
+
"tailwindcss-animate": "^1.0.7",
|
|
60
|
+
"tw-animate-css": "^1.4.0",
|
|
61
|
+
"typescript": "~5.7.2",
|
|
62
|
+
"vite": "6.3.3",
|
|
63
|
+
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
64
|
+
"vitest": "^4.0.5"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@andrewbranch/untar.js": "^1.0.3",
|
|
68
|
+
"@dagrejs/dagre": "^1.1.5",
|
|
69
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
70
|
+
"@wjfe/n-savant": "^0.3.0",
|
|
71
|
+
"@xyflow/svelte": "^1.2.0",
|
|
72
|
+
"fflate": "^0.8.2",
|
|
73
|
+
"json-stable-stringify": "^1.3.0",
|
|
74
|
+
"lodash": "^4.17.21",
|
|
75
|
+
"mustache": "^4.2.0"
|
|
76
|
+
}
|
|
77
|
+
}
|
package/public/lobb.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_2801_3)">
|
|
3
|
+
<mask id="path-1-outside-1_2801_3" maskUnits="userSpaceOnUse" x="7" y="1" width="20" height="28" fill="black">
|
|
4
|
+
<rect fill="white" x="7" y="1" width="20" height="28"/>
|
|
5
|
+
<path d="M25.1389 23.874L24.416 28H11.8439L12.5669 23.874H25.1389ZM17.9977 2.32685L13.5367 28H8.37029L12.8137 2.32685H17.9977Z"/>
|
|
6
|
+
</mask>
|
|
7
|
+
<path d="M25.1389 23.874L24.416 28H11.8439L12.5669 23.874H25.1389ZM17.9977 2.32685L13.5367 28H8.37029L12.8137 2.32685H17.9977Z" fill="black"/>
|
|
8
|
+
<path d="M25.1389 23.874L26.1239 24.0465L26.3294 22.874H25.1389V23.874ZM24.416 28V29H25.256L25.401 28.1726L24.416 28ZM11.8439 28L10.8589 27.8274L10.6535 29H11.8439V28ZM12.5669 23.874V22.874H11.7268L11.5819 23.7014L12.5669 23.874ZM17.9977 2.32685L18.983 2.49805L19.1865 1.32685H17.9977V2.32685ZM13.5367 28V29H14.3779L14.5219 28.1712L13.5367 28ZM8.37029 28L7.38494 27.8295L7.18234 29H8.37029V28ZM12.8137 2.32685V1.32685H11.9719L11.8284 2.15631L12.8137 2.32685ZM24.1539 23.7014L23.431 27.8274L25.401 28.1726L26.1239 24.0465L24.1539 23.7014ZM24.416 27H11.8439V29H24.416V27ZM12.8289 28.1726L13.5519 24.0465L11.5819 23.7014L10.8589 27.8274L12.8289 28.1726ZM12.5669 24.874H25.1389V22.874H12.5669V24.874ZM17.0125 2.15565L12.5514 27.8288L14.5219 28.1712L18.983 2.49805L17.0125 2.15565ZM13.5367 27H8.37029V29H13.5367V27ZM9.35564 28.1705L13.7991 2.49739L11.8284 2.15631L7.38494 27.8295L9.35564 28.1705ZM12.8137 3.32685H17.9977V1.32685H12.8137V3.32685Z" fill="white" mask="url(#path-1-outside-1_2801_3)"/>
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_2801_3">
|
|
12
|
+
<rect width="32" height="32" fill="white"/>
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Toaster } from "./lib/components/ui/sonner";
|
|
3
|
+
import { onMount, onDestroy } from "svelte";
|
|
4
|
+
import { ModeWatcher } from "mode-watcher";
|
|
5
|
+
import { ctx } from "$lib/store.svelte";
|
|
6
|
+
import { lobb } from "$lib/index";
|
|
7
|
+
import Header from "$lib/components/header.svelte";
|
|
8
|
+
import { LoaderCircle, ServerOff } from "lucide-svelte";
|
|
9
|
+
import Dialog from "$lib/components/confirmationDialog/confirmationDialog.svelte";
|
|
10
|
+
import MiniSidebar from "$lib/components/miniSidebar.svelte";
|
|
11
|
+
import SetServerPage from "$lib/components/setServerPage.svelte";
|
|
12
|
+
import * as Tooltip from "$lib/components/ui/tooltip";
|
|
13
|
+
import { Router, Route, Fallback, init as initRouter, } from "@wjfe/n-savant";
|
|
14
|
+
import {
|
|
15
|
+
executeExtensionsOnStartup,
|
|
16
|
+
loadExtensions,
|
|
17
|
+
} from "./extensions/extensionUtils";
|
|
18
|
+
import { mediaQueries } from "$lib/utils";
|
|
19
|
+
import Home from "./routes/home.svelte";
|
|
20
|
+
import DataModel from "./routes/data_model/dataModel.svelte";
|
|
21
|
+
import Collections from "./routes/collections/collections.svelte";
|
|
22
|
+
import Workflows from "./routes/workflows/workflows.svelte";
|
|
23
|
+
import Extension from "./routes/extensions/extension.svelte";
|
|
24
|
+
|
|
25
|
+
interface StudioProps {
|
|
26
|
+
extensions?: any[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const props: StudioProps = $props()
|
|
30
|
+
|
|
31
|
+
let error: string | null = $state(null);
|
|
32
|
+
let loaded = $state(false);
|
|
33
|
+
let isSmallScreen = $derived(!mediaQueries.sm.current);
|
|
34
|
+
let cleanupRouter: (() => void) | undefined;
|
|
35
|
+
|
|
36
|
+
onMount(async () => {
|
|
37
|
+
cleanupRouter = initRouter();
|
|
38
|
+
|
|
39
|
+
if (ctx.lobbUrl) {
|
|
40
|
+
try {
|
|
41
|
+
ctx.meta = await lobb.getMeta();
|
|
42
|
+
ctx.extensions = await loadExtensions(props.extensions);
|
|
43
|
+
await executeExtensionsOnStartup();
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error(err);
|
|
46
|
+
error = "CANT_CONNECT";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
loaded = true;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
onDestroy(() => {
|
|
53
|
+
if (cleanupRouter) {
|
|
54
|
+
cleanupRouter();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<ModeWatcher defaultMode="light" />
|
|
60
|
+
<Toaster position="top-right" class="z-50" />
|
|
61
|
+
{#if loaded}
|
|
62
|
+
{#if ctx.lobbUrl}
|
|
63
|
+
<Tooltip.Provider delayDuration={0} disableHoverableContent={true}>
|
|
64
|
+
<main
|
|
65
|
+
class="bg-muted h-screen w-screen"
|
|
66
|
+
style="display: grid; grid-template-columns: {isSmallScreen
|
|
67
|
+
? '1fr'
|
|
68
|
+
: '3.5rem 1fr'};"
|
|
69
|
+
>
|
|
70
|
+
<MiniSidebar />
|
|
71
|
+
<div class="second_grid">
|
|
72
|
+
<Header />
|
|
73
|
+
<Router id="root-router">
|
|
74
|
+
<Route key="home" path="/">
|
|
75
|
+
{#snippet children(params)}
|
|
76
|
+
<Home />
|
|
77
|
+
{/snippet}
|
|
78
|
+
</Route>
|
|
79
|
+
<Route
|
|
80
|
+
key="collections"
|
|
81
|
+
path="/collections/:collection?"
|
|
82
|
+
>
|
|
83
|
+
{#snippet children(params)}
|
|
84
|
+
<Collections
|
|
85
|
+
collectionName={params?.collection}
|
|
86
|
+
/>
|
|
87
|
+
{/snippet}
|
|
88
|
+
</Route>
|
|
89
|
+
<Route key="datamodel" path="/datamodel/*">
|
|
90
|
+
{#snippet children(params)}
|
|
91
|
+
<DataModel />
|
|
92
|
+
{/snippet}
|
|
93
|
+
</Route>
|
|
94
|
+
<Route key="workflows" path="/workflows/:workflow?">
|
|
95
|
+
{#snippet children(params)}
|
|
96
|
+
<Workflows workflowName={params?.workflow} />
|
|
97
|
+
{/snippet}
|
|
98
|
+
</Route>
|
|
99
|
+
<Route
|
|
100
|
+
key="extensions"
|
|
101
|
+
path="/extensions/:extension?/:page?/*"
|
|
102
|
+
>
|
|
103
|
+
{#snippet children(params)}
|
|
104
|
+
<Extension
|
|
105
|
+
extension={params?.extension}
|
|
106
|
+
page={params?.page}
|
|
107
|
+
/>
|
|
108
|
+
{/snippet}
|
|
109
|
+
</Route>
|
|
110
|
+
<Fallback>Not Found</Fallback>
|
|
111
|
+
</Router>
|
|
112
|
+
</div>
|
|
113
|
+
</main>
|
|
114
|
+
</Tooltip.Provider>
|
|
115
|
+
{:else}
|
|
116
|
+
<SetServerPage />
|
|
117
|
+
{/if}
|
|
118
|
+
{:else if !error}
|
|
119
|
+
<div
|
|
120
|
+
class="flex h-screen w-full flex-col items-center justify-center gap-4 text-muted-foreground"
|
|
121
|
+
>
|
|
122
|
+
<LoaderCircle class="animate-spin opacity-50" size="50" />
|
|
123
|
+
<div class="flex flex-col items-center justify-center">
|
|
124
|
+
<div>Loading the dashboard, please wait...</div>
|
|
125
|
+
<div class="text-xs">
|
|
126
|
+
Loading and importing all necessary data and components from the
|
|
127
|
+
lobb server.
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
{:else}
|
|
132
|
+
<div
|
|
133
|
+
class="flex h-full w-full flex-col items-center justify-center gap-4 text-muted-foreground"
|
|
134
|
+
>
|
|
135
|
+
<ServerOff class="opacity-50" size="50" />
|
|
136
|
+
<div class="flex flex-col items-center justify-center">
|
|
137
|
+
<div>Could not connect to the server</div>
|
|
138
|
+
<div class="text-xs">
|
|
139
|
+
Could not connect to the lobb server at this endpoint ({ctx.lobbUrl})
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
{/if}
|
|
144
|
+
|
|
145
|
+
<style>
|
|
146
|
+
.second_grid {
|
|
147
|
+
display: grid;
|
|
148
|
+
grid-template-rows: 2.5rem 1fr;
|
|
149
|
+
}
|
|
150
|
+
</style>
|
package/src/app.css
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@import "tw-animate-css";
|
|
4
|
+
|
|
5
|
+
@custom-variant dark (&:is(.dark *));
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--radius: 0.625rem;
|
|
9
|
+
--background: oklch(1 0 0);
|
|
10
|
+
--foreground: oklch(0.129 0.042 264.695);
|
|
11
|
+
--card: oklch(1 0 0);
|
|
12
|
+
--card-foreground: oklch(0.129 0.042 264.695);
|
|
13
|
+
--popover: oklch(1 0 0);
|
|
14
|
+
--popover-foreground: oklch(0.129 0.042 264.695);
|
|
15
|
+
--primary: oklch(0.208 0.042 265.755);
|
|
16
|
+
--primary-foreground: oklch(0.984 0.003 247.858);
|
|
17
|
+
--secondary: oklch(0.968 0.007 247.896);
|
|
18
|
+
--secondary-foreground: oklch(0.208 0.042 265.755);
|
|
19
|
+
--muted: oklch(0.968 0.007 247.896);
|
|
20
|
+
--muted-foreground: oklch(0.554 0.046 257.417);
|
|
21
|
+
--accent: oklch(0.968 0.007 247.896);
|
|
22
|
+
--accent-foreground: oklch(0.208 0.042 265.755);
|
|
23
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
24
|
+
--border: oklch(0.929 0.013 255.508);
|
|
25
|
+
--input: oklch(0.929 0.013 255.508);
|
|
26
|
+
--ring: oklch(0.704 0.04 256.788);
|
|
27
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
28
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
29
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
30
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
31
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
32
|
+
--sidebar: oklch(0.984 0.003 247.858);
|
|
33
|
+
--sidebar-foreground: oklch(0.129 0.042 264.695);
|
|
34
|
+
--sidebar-primary: oklch(0.208 0.042 265.755);
|
|
35
|
+
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
|
|
36
|
+
--sidebar-accent: oklch(0.968 0.007 247.896);
|
|
37
|
+
--sidebar-accent-foreground: oklch(0.208 0.042 265.755);
|
|
38
|
+
--sidebar-border: oklch(0.929 0.013 255.508);
|
|
39
|
+
--sidebar-ring: oklch(0.704 0.04 256.788);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dark {
|
|
43
|
+
--background: oklch(0.129 0.042 264.695);
|
|
44
|
+
--foreground: oklch(0.984 0.003 247.858);
|
|
45
|
+
--card: oklch(0.208 0.042 265.755);
|
|
46
|
+
--card-foreground: oklch(0.984 0.003 247.858);
|
|
47
|
+
--popover: oklch(0.208 0.042 265.755);
|
|
48
|
+
--popover-foreground: oklch(0.984 0.003 247.858);
|
|
49
|
+
--primary: oklch(0.929 0.013 255.508);
|
|
50
|
+
--primary-foreground: oklch(0.208 0.042 265.755);
|
|
51
|
+
--secondary: oklch(0.279 0.041 260.031);
|
|
52
|
+
--secondary-foreground: oklch(0.984 0.003 247.858);
|
|
53
|
+
--muted: oklch(0.279 0.041 260.031);
|
|
54
|
+
--muted-foreground: oklch(0.704 0.04 256.788);
|
|
55
|
+
--accent: oklch(0.279 0.041 260.031);
|
|
56
|
+
--accent-foreground: oklch(0.984 0.003 247.858);
|
|
57
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
58
|
+
--border: oklch(1 0 0 / 10%);
|
|
59
|
+
--input: oklch(1 0 0 / 15%);
|
|
60
|
+
--ring: oklch(0.551 0.027 264.364);
|
|
61
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
62
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
63
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
64
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
65
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
66
|
+
--sidebar: oklch(0.208 0.042 265.755);
|
|
67
|
+
--sidebar-foreground: oklch(0.984 0.003 247.858);
|
|
68
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
69
|
+
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
|
|
70
|
+
--sidebar-accent: oklch(0.279 0.041 260.031);
|
|
71
|
+
--sidebar-accent-foreground: oklch(0.984 0.003 247.858);
|
|
72
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
73
|
+
--sidebar-ring: oklch(0.551 0.027 264.364);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@theme inline {
|
|
77
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
78
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
79
|
+
--radius-lg: var(--radius);
|
|
80
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
81
|
+
--color-background: var(--background);
|
|
82
|
+
--color-foreground: var(--foreground);
|
|
83
|
+
--color-card: var(--card);
|
|
84
|
+
--color-card-foreground: var(--card-foreground);
|
|
85
|
+
--color-popover: var(--popover);
|
|
86
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
87
|
+
--color-primary: var(--primary);
|
|
88
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
89
|
+
--color-secondary: var(--secondary);
|
|
90
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
91
|
+
--color-muted: var(--muted);
|
|
92
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
93
|
+
--color-accent: var(--accent);
|
|
94
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
95
|
+
--color-destructive: var(--destructive);
|
|
96
|
+
--color-border: var(--border);
|
|
97
|
+
--color-input: var(--input);
|
|
98
|
+
--color-ring: var(--ring);
|
|
99
|
+
--color-chart-1: var(--chart-1);
|
|
100
|
+
--color-chart-2: var(--chart-2);
|
|
101
|
+
--color-chart-3: var(--chart-3);
|
|
102
|
+
--color-chart-4: var(--chart-4);
|
|
103
|
+
--color-chart-5: var(--chart-5);
|
|
104
|
+
--color-sidebar: var(--sidebar);
|
|
105
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
106
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
107
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
108
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
109
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
110
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
111
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@layer base {
|
|
115
|
+
* {
|
|
116
|
+
@apply border-border outline-ring/50;
|
|
117
|
+
}
|
|
118
|
+
body {
|
|
119
|
+
@apply bg-background text-foreground;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Re-export all Studio components for use in extensions and consuming apps
|
|
2
|
+
export { Button } from "$lib/components/ui/button";
|
|
3
|
+
export { Input } from "$lib/components/ui/input";
|
|
4
|
+
export { Separator } from "$lib/components/ui/separator";
|
|
5
|
+
export { Skeleton } from "$lib/components/ui/skeleton";
|
|
6
|
+
export { default as LlmButton } from "$lib/components/LlmButton.svelte";
|
|
7
|
+
export { default as Sidebar } from "$lib/components/sidebar/sidebar.svelte";
|
|
8
|
+
export { default as SidebarTrigger } from "$lib/components/sidebar/sidebarTrigger.svelte";
|
|
9
|
+
export { default as CreateDetailViewButton } from "$lib/components/detailView/create/createDetailViewButton.svelte";
|
|
10
|
+
export { default as UpdateDetailViewButton } from "$lib/components/detailView/update/updateDetailViewButton.svelte";
|
|
11
|
+
export * as Tooltip from "$lib/components/ui/tooltip";
|
|
12
|
+
export * as Breadcrumb from "$lib/components/ui/breadcrumb";
|
|
13
|
+
export { ContextMenu } from "bits-ui";
|
|
14
|
+
export * as Popover from "$lib/components/ui/popover";
|
|
15
|
+
export * as Icons from "lucide-svelte";
|
|
16
|
+
export { default as Table } from "$lib/components/dataTable/table.svelte";
|
|
17
|
+
export { default as RangeCalendarButton } from "$lib/components/rangeCalendarButton.svelte";
|
|
18
|
+
export { default as DataTable } from "$lib/components/dataTable/dataTable.svelte";
|
|
19
|
+
export { default as Drawer } from "$lib/components/drawer.svelte";
|
|
20
|
+
export { default as SelectRecord } from "$lib/components/selectRecord.svelte";
|
|
21
|
+
export { Switch } from "$lib/components/ui/switch";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Lobb } from "$lib/Lobb";
|
|
2
|
+
import type { CTX } from "../lib/store.types";
|
|
3
|
+
import type { Button } from "$lib/components/ui/button";
|
|
4
|
+
import type { Input } from "$lib/components/ui/input";
|
|
5
|
+
import type { Separator } from "$lib/components/ui/separator";
|
|
6
|
+
import type { Skeleton } from "$lib/components/ui/skeleton";
|
|
7
|
+
import type LlmButton from "$lib/components/LlmButton.svelte";
|
|
8
|
+
import type Sidebar from "$lib/components/sidebar/sidebar.svelte";
|
|
9
|
+
import type SidebarTrigger from "$lib/components/sidebar/sidebarTrigger.svelte";
|
|
10
|
+
import type CreateDetailViewButton from "$lib/components/detailView/create/createDetailViewButton.svelte";
|
|
11
|
+
import type UpdateDetailViewButton from "$lib/components/detailView/update/updateDetailViewButton.svelte";
|
|
12
|
+
import type { getFileFromUser, mediaQueries } from "$lib/utils";
|
|
13
|
+
import type Table from "$lib/components/dataTable/table.svelte";
|
|
14
|
+
import type { Location } from "@wjfe/n-savant";
|
|
15
|
+
import type RangeCalendarButton from "$lib/components/rangeCalendarButton.svelte";
|
|
16
|
+
import type DataTable from "$lib/components/dataTable/dataTable.svelte";
|
|
17
|
+
import type Drawer from "$lib/components/drawer.svelte";
|
|
18
|
+
import type SelectRecord from "$lib/components/selectRecord.svelte";
|
|
19
|
+
import * as Popover from "$lib/components/ui/popover";
|
|
20
|
+
import * as intlDate from "@internationalized/date";
|
|
21
|
+
import * as Icons from "lucide-svelte"
|
|
22
|
+
import { ContextMenu } from "bits-ui";
|
|
23
|
+
import * as Tooltip from "$lib/components/ui/tooltip";
|
|
24
|
+
import * as Breadcrumb from "$lib/components/ui/breadcrumb";
|
|
25
|
+
import { showDialog } from "$lib/components/confirmationDialog/store.svelte";
|
|
26
|
+
import { toast } from "svelte-sonner";
|
|
27
|
+
import type Drawer from "$lib/components/drawer.svelte";
|
|
28
|
+
import { Switch } from "$lib/components/ui/switch";
|
|
29
|
+
|
|
30
|
+
// extensions utils
|
|
31
|
+
export interface Components {
|
|
32
|
+
Button: typeof Button;
|
|
33
|
+
Input: typeof Input;
|
|
34
|
+
Separator: typeof Separator;
|
|
35
|
+
Skeleton: typeof Skeleton;
|
|
36
|
+
LlmButton: typeof LlmButton;
|
|
37
|
+
Sidebar: typeof Sidebar;
|
|
38
|
+
SidebarTrigger: typeof SidebarTrigger;
|
|
39
|
+
CreateDetailViewButton: typeof CreateDetailViewButton;
|
|
40
|
+
UpdateDetailViewButton: typeof UpdateDetailViewButton;
|
|
41
|
+
Tooltip: typeof Tooltip;
|
|
42
|
+
Breadcrumb: typeof Breadcrumb;
|
|
43
|
+
ContextMenu: typeof ContextMenu;
|
|
44
|
+
Popover: typeof Popover;
|
|
45
|
+
Icons: typeof Icons;
|
|
46
|
+
Table: typeof Table;
|
|
47
|
+
RangeCalendarButton: typeof RangeCalendarButton;
|
|
48
|
+
DataTable: typeof DataTable;
|
|
49
|
+
Drawer: typeof Drawer;
|
|
50
|
+
SelectRecord: typeof SelectRecord,
|
|
51
|
+
Switch: typeof Switch,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ExtensionUtils {
|
|
55
|
+
ctx: CTX;
|
|
56
|
+
lobb: Lobb;
|
|
57
|
+
location: Location;
|
|
58
|
+
toast: typeof toast;
|
|
59
|
+
showDialog: typeof showDialog;
|
|
60
|
+
getFileFromUser: typeof getFileFromUser;
|
|
61
|
+
components: Components;
|
|
62
|
+
mediaQueries: typeof mediaQueries;
|
|
63
|
+
intlDate: typeof intlDate;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// dashboard nav
|
|
67
|
+
interface DashboardNav {
|
|
68
|
+
label: string;
|
|
69
|
+
icon: any;
|
|
70
|
+
href?: string;
|
|
71
|
+
onclick?: () => void;
|
|
72
|
+
navs?: DashboardNav[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DashboardNavs {
|
|
76
|
+
top?: DashboardNav[];
|
|
77
|
+
middle?: DashboardNav[];
|
|
78
|
+
bottom?: DashboardNav[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// extension components base Props
|
|
82
|
+
export interface ExtensionProps {
|
|
83
|
+
utils: ExtensionUtils;
|
|
84
|
+
[key: string]: any;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// extension exported object
|
|
88
|
+
export interface Extension {
|
|
89
|
+
name: string;
|
|
90
|
+
onStartup?: (utils: ExtensionUtils) => Promise<void>;
|
|
91
|
+
components?: Record<string, any>;
|
|
92
|
+
dashboardNavs?: DashboardNavs;
|
|
93
|
+
}
|