@lobb-js/studio 0.1.31 → 0.1.33

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.
Files changed (81) hide show
  1. package/package.json +24 -14
  2. package/src/{Studio.svelte → lib/components/Studio.svelte} +8 -8
  3. package/src/lib/components/dataTable/childRecords.svelte +1 -1
  4. package/src/lib/components/detailView/create/children.svelte +1 -1
  5. package/src/lib/components/detailView/create/createDetailView.svelte +1 -1
  6. package/src/lib/components/detailView/fieldInput.svelte +1 -1
  7. package/src/lib/components/detailView/update/children.svelte +1 -1
  8. package/src/lib/components/detailView/update/updateDetailView.svelte +1 -1
  9. package/src/lib/components/extensionsComponents.svelte +1 -2
  10. package/src/lib/components/miniSidebar.svelte +1 -1
  11. package/{vite-plugin-contextual-lib.js → vite-plugins/contextual-lib-alias.js} +2 -7
  12. package/vite-plugins/index.js +21 -0
  13. package/vite-plugins/studio-source-resolver.js +41 -0
  14. package/.env.example +0 -1
  15. package/.storybook/main.ts +0 -31
  16. package/.storybook/preview.ts +0 -21
  17. package/.storybook/vitest.setup.ts +0 -7
  18. package/components.json +0 -16
  19. package/docker-entrypoint.sh +0 -7
  20. package/dockerfile +0 -27
  21. package/index.html +0 -13
  22. package/public/lobb.svg +0 -15
  23. package/src/app.css +0 -121
  24. package/src/components-export.ts +0 -21
  25. package/src/extensions/extension.types.ts +0 -93
  26. package/src/extensions/extensionUtils.ts +0 -192
  27. package/src/lib/Lobb.ts +0 -241
  28. package/src/lib/eventSystem.ts +0 -38
  29. package/src/lib/index.ts +0 -40
  30. package/src/lib/store.svelte.ts +0 -21
  31. package/src/lib/store.types.ts +0 -28
  32. package/src/lib/utils.ts +0 -84
  33. package/src/main.ts +0 -18
  34. package/src/routes/collections/collection.svelte +0 -46
  35. package/src/routes/collections/collections.svelte +0 -43
  36. package/src/routes/data_model/dataModel.svelte +0 -40
  37. package/src/routes/data_model/flow.css +0 -22
  38. package/src/routes/data_model/flow.svelte +0 -82
  39. package/src/routes/data_model/syncManager.svelte +0 -93
  40. package/src/routes/data_model/utils.ts +0 -35
  41. package/src/routes/extensions/extension.svelte +0 -16
  42. package/src/routes/home.svelte +0 -36
  43. package/src/routes/workflows/workflows.svelte +0 -135
  44. package/src/stories/Configure.mdx +0 -364
  45. package/src/stories/assets/accessibility.png +0 -0
  46. package/src/stories/assets/accessibility.svg +0 -1
  47. package/src/stories/assets/addon-library.png +0 -0
  48. package/src/stories/assets/assets.png +0 -0
  49. package/src/stories/assets/avif-test-image.avif +0 -0
  50. package/src/stories/assets/context.png +0 -0
  51. package/src/stories/assets/discord.svg +0 -1
  52. package/src/stories/assets/docs.png +0 -0
  53. package/src/stories/assets/figma-plugin.png +0 -0
  54. package/src/stories/assets/github.svg +0 -1
  55. package/src/stories/assets/share.png +0 -0
  56. package/src/stories/assets/styling.png +0 -0
  57. package/src/stories/assets/testing.png +0 -0
  58. package/src/stories/assets/theming.png +0 -0
  59. package/src/stories/assets/tutorials.svg +0 -1
  60. package/src/stories/assets/youtube.svg +0 -1
  61. package/src/stories/detailView/detailViewForm.stories.svelte +0 -79
  62. package/src/stories/examples/Button.stories.svelte +0 -31
  63. package/src/stories/examples/Button.svelte +0 -30
  64. package/src/stories/examples/Header.stories.svelte +0 -26
  65. package/src/stories/examples/Header.svelte +0 -45
  66. package/src/stories/examples/Page.stories.svelte +0 -29
  67. package/src/stories/examples/Page.svelte +0 -70
  68. package/src/stories/examples/button.css +0 -30
  69. package/src/stories/examples/header.css +0 -32
  70. package/src/stories/examples/page.css +0 -68
  71. package/src/vite-env.d.ts +0 -2
  72. package/svelte.config.js +0 -7
  73. package/todo.md +0 -24
  74. package/tsconfig.app.json +0 -25
  75. package/tsconfig.json +0 -14
  76. package/tsconfig.node.json +0 -24
  77. package/vite.build.svelte.config.ts +0 -18
  78. package/vite.config.ts +0 -84
  79. package/vite.extension.config.ts +0 -81
  80. package/vite_utils.ts +0 -28
  81. package/vitest.shims.d.ts +0 -1
@@ -1,70 +0,0 @@
1
- <script lang="ts">
2
- import './page.css';
3
- import Header from './Header.svelte';
4
-
5
- let user = $state<{ name: string }>();
6
- </script>
7
-
8
- <article>
9
- <Header
10
- {user}
11
- onLogin={() => (user = { name: 'Jane Doe' })}
12
- onLogout={() => (user = undefined)}
13
- onCreateAccount={() => (user = { name: 'Jane Doe' })}
14
- />
15
-
16
- <section class="storybook-page">
17
- <h2>Pages in Storybook</h2>
18
- <p>
19
- We recommend building UIs with a
20
- <a
21
- href="https://blog.hichroma.com/component-driven-development-ce1109d56c8e"
22
- target="_blank"
23
- rel="noopener noreferrer"
24
- >
25
- <strong>component-driven</strong>
26
- </a>
27
- process starting with atomic components and ending with pages.
28
- </p>
29
- <p>
30
- Render pages with mock data. This makes it easy to build and review page states without
31
- needing to navigate to them in your app. Here are some handy patterns for managing page data
32
- in Storybook:
33
- </p>
34
- <ul>
35
- <li>
36
- Use a higher-level connected component. Storybook helps you compose such data from the
37
- "args" of child component stories
38
- </li>
39
- <li>
40
- Assemble data in the page component from your services. You can mock these services out
41
- using Storybook.
42
- </li>
43
- </ul>
44
- <p>
45
- Get a guided tutorial on component-driven development at
46
- <a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
47
- Storybook tutorials
48
- </a>
49
- . Read more in the
50
- <a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer">docs</a>
51
- .
52
- </p>
53
- <div class="tip-wrapper">
54
- <span class="tip">Tip</span>
55
- Adjust the width of the canvas with the
56
- <svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
57
- <g fill="none" fill-rule="evenodd">
58
- <path
59
- d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0
60
- 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0
61
- 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
62
- id="a"
63
- fill="#999"
64
- />
65
- </g>
66
- </svg>
67
- Viewports addon in the toolbar
68
- </div>
69
- </section>
70
- </article>
@@ -1,30 +0,0 @@
1
- .storybook-button {
2
- display: inline-block;
3
- cursor: pointer;
4
- border: 0;
5
- border-radius: 3em;
6
- font-weight: 700;
7
- line-height: 1;
8
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
9
- }
10
- .storybook-button--primary {
11
- background-color: #555ab9;
12
- color: white;
13
- }
14
- .storybook-button--secondary {
15
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
16
- background-color: transparent;
17
- color: #333;
18
- }
19
- .storybook-button--small {
20
- padding: 10px 16px;
21
- font-size: 12px;
22
- }
23
- .storybook-button--medium {
24
- padding: 11px 20px;
25
- font-size: 14px;
26
- }
27
- .storybook-button--large {
28
- padding: 12px 24px;
29
- font-size: 16px;
30
- }
@@ -1,32 +0,0 @@
1
- .storybook-header {
2
- display: flex;
3
- justify-content: space-between;
4
- align-items: center;
5
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
6
- padding: 15px 20px;
7
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
8
- }
9
-
10
- .storybook-header svg {
11
- display: inline-block;
12
- vertical-align: top;
13
- }
14
-
15
- .storybook-header h1 {
16
- display: inline-block;
17
- vertical-align: top;
18
- margin: 6px 0 6px 10px;
19
- font-weight: 700;
20
- font-size: 20px;
21
- line-height: 1;
22
- }
23
-
24
- .storybook-header button + button {
25
- margin-left: 10px;
26
- }
27
-
28
- .storybook-header .welcome {
29
- margin-right: 10px;
30
- color: #333;
31
- font-size: 14px;
32
- }
@@ -1,68 +0,0 @@
1
- .storybook-page {
2
- margin: 0 auto;
3
- padding: 48px 20px;
4
- max-width: 600px;
5
- color: #333;
6
- font-size: 14px;
7
- line-height: 24px;
8
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
9
- }
10
-
11
- .storybook-page h2 {
12
- display: inline-block;
13
- vertical-align: top;
14
- margin: 0 0 4px;
15
- font-weight: 700;
16
- font-size: 32px;
17
- line-height: 1;
18
- }
19
-
20
- .storybook-page p {
21
- margin: 1em 0;
22
- }
23
-
24
- .storybook-page a {
25
- color: inherit;
26
- }
27
-
28
- .storybook-page ul {
29
- margin: 1em 0;
30
- padding-left: 30px;
31
- }
32
-
33
- .storybook-page li {
34
- margin-bottom: 8px;
35
- }
36
-
37
- .storybook-page .tip {
38
- display: inline-block;
39
- vertical-align: top;
40
- margin-right: 10px;
41
- border-radius: 1em;
42
- background: #e7fdd8;
43
- padding: 4px 12px;
44
- color: #357a14;
45
- font-weight: 700;
46
- font-size: 11px;
47
- line-height: 12px;
48
- }
49
-
50
- .storybook-page .tip-wrapper {
51
- margin-top: 40px;
52
- margin-bottom: 40px;
53
- font-size: 13px;
54
- line-height: 20px;
55
- }
56
-
57
- .storybook-page .tip-wrapper svg {
58
- display: inline-block;
59
- vertical-align: top;
60
- margin-top: 3px;
61
- margin-right: 4px;
62
- width: 12px;
63
- height: 12px;
64
- }
65
-
66
- .storybook-page .tip-wrapper svg path {
67
- fill: #1ea7fd;
68
- }
package/src/vite-env.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /// <reference types="svelte" />
2
- /// <reference types="vite/client" />
package/svelte.config.js DELETED
@@ -1,7 +0,0 @@
1
- import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
-
3
- export default {
4
- // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
- // for more information about preprocessors
6
- preprocess: vitePreprocess(),
7
- }
package/todo.md DELETED
@@ -1,24 +0,0 @@
1
- # THE GOAL
2
-
3
- - instead of passing lobb components to the exntesions one by one and specifying it there .. you can just dynamically specify everything in a directory automatically. without adding each new or old component you forgot gradually
4
- - make the ui of lobb look a bit like the UI of zed text editor
5
-
6
- # high priority
7
-
8
- - when the screen gets smaller the sidebar in the collections page collapses and the main unselected part shows. thats not a good ui/ux. its better to do like the whatsup app. where it instead shows the sidebar as the main app and then you can click on pages and its going to slide from right to left
9
- - the mass delete doesnt show a notification when the operation isnt successfull
10
- - instead of removing the hash of generated js files that will be used by the imported extension views. its better to not remove it (because its a good way to not cache the js files when there is change to them). and just track those library files with their hashes in the build process and save them in a variable and update the import map you will add in the index.html accordangly. this way you dont need deal with the rist of using an outdated cached version of the `index-client.js` file for example
11
- - I think the best thing to do regarding the datatable compoenent is to unmount it and re-mounted again when a user navigates to another table. its the safest and a better thing todo for consistancies
12
- - try to make the extender vite extension work in dev mode too
13
- - you removed the hash part of the svelte libraries in order to be able to use them on the build version. check if you can use `?v=21212` instead to keep the ability of removing the cache. we need this to be mainly added for other components that use those svelte library internally whithin the app. the compiled extension components can add that easily by themselves
14
- - prepare the auth extension views in here to be properly ordered and organized for dynamic views and extensions that will be added dynamically from extensions
15
- - create e2e tests for the sort and the filters and the dataTable component because its not stable
16
- - make the row height in the tableData component smaller
17
-
18
-
19
- - added the ability to resize width of the columns and add specific width size based on the field type
20
- - make the cell hight smaller
21
- - sorting the id field doesnt work. check why
22
- - in order to have date and datetime field just add an addiotional property for the ui to treat them like that. you dont need to add another
23
- - think of the proper fonts
24
- - I need to show a meaningfull error message if the dashboard couldnt connect to the lobb server
package/tsconfig.app.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "useDefineForClassFields": true,
6
- "module": "ESNext",
7
- "resolveJsonModule": true,
8
- /**
9
- * Typecheck JS in `.svelte` and `.js` files by default.
10
- * Disable checkJs if you'd like to use dynamic types in JS.
11
- * Note that setting allowJs false does not prevent the use
12
- * of JS in `.svelte` files.
13
- */
14
- "allowJs": true,
15
- "checkJs": true,
16
- "isolatedModules": true,
17
- "moduleDetection": "force",
18
- "baseUrl": ".",
19
- "paths": {
20
- "$lib": ["./src/lib"],
21
- "$lib/*": ["./src/lib/*"]
22
- }
23
- },
24
- "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"]
25
- }
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- { "path": "./tsconfig.app.json" },
5
- { "path": "./tsconfig.node.json" }
6
- ],
7
- "compilerOptions": {
8
- "baseUrl": ".",
9
- "paths": {
10
- "$lib": ["./src/lib"],
11
- "$lib/*": ["./src/lib/*"]
12
- }
13
- }
14
- }
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
- "target": "ES2022",
5
- "lib": ["ES2023"],
6
- "module": "ESNext",
7
- "skipLibCheck": true,
8
-
9
- /* Bundler mode */
10
- "moduleResolution": "bundler",
11
- "allowImportingTsExtensions": true,
12
- "isolatedModules": true,
13
- "moduleDetection": "force",
14
- "noEmit": true,
15
-
16
- /* Linting */
17
- "strict": true,
18
- "noUnusedLocals": true,
19
- "noUnusedParameters": true,
20
- "noFallthroughCasesInSwitch": true,
21
- "noUncheckedSideEffectImports": true
22
- },
23
- "include": ["vite.config.ts"]
24
- }
@@ -1,18 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import { getSvelteExportedLibraries } from './vite_utils';
3
-
4
- const exports = await getSvelteExportedLibraries();
5
-
6
- // https://vite.dev/config/
7
- export default defineConfig({
8
- build: {
9
- outDir: 'dist/svelte',
10
- lib: {
11
- formats: ['es'],
12
- entry: exports,
13
- },
14
- rollupOptions: {
15
- treeshake: false,
16
- },
17
- },
18
- })
package/vite.config.ts DELETED
@@ -1,84 +0,0 @@
1
- import path from 'path';
2
- import { defineConfig, loadEnv } from 'vite'
3
- import { svelte } from '@sveltejs/vite-plugin-svelte'
4
- import { getSvelteExportedLibraries, getSvelteVersion } from './vite_utils';
5
- import tailwindcss from '@tailwindcss/vite'
6
-
7
- const importMap: any = {
8
- imports: {}
9
- };
10
-
11
- const svelteVersion = await getSvelteVersion()
12
- const svelteExports = await getSvelteExportedLibraries();
13
- const svelteExternals = Object.keys(svelteExports).map((item) => item.replaceAll("_", "/"));
14
-
15
- export default defineConfig(({ mode }) => {
16
- const env = loadEnv(mode, process.cwd(), '')
17
- return {
18
- build: {
19
- minify: true,
20
- emptyOutDir: false,
21
- rollupOptions: {
22
- external: svelteExternals,
23
- },
24
- },
25
- resolve: {
26
- alias: {
27
- $lib: path.resolve("./src/lib"),
28
- },
29
- },
30
- plugins: [
31
- tailwindcss(),
32
- svelte(),
33
- {
34
- name: 'insert-import-map',
35
- apply: 'serve',
36
- async transformIndexHtml(html) {
37
- for (let index = 0; index < svelteExternals.length; index++) {
38
- const svelteLibName = svelteExternals[index];
39
- const importValue = `/node_modules/.vite/deps/${svelteLibName.replaceAll("/", "_")}.js?v=${svelteVersion}`
40
- importMap.imports[svelteLibName] = importValue;
41
- }
42
-
43
- const importMapScript = `<script type="importmap">${JSON.stringify(importMap)}</script>`;
44
- return html.replace(
45
- /<\/head>/,
46
- `${importMapScript}</head>`
47
- );
48
- }
49
- },
50
- {
51
- name: 'create-svelte-import-map',
52
- apply: 'build',
53
- async configResolved(config) {
54
- for (let index = 0; index < svelteExternals.length; index++) {
55
- const svelteLibName = svelteExternals[index];
56
- const importValue = `/svelte/${svelteLibName.replaceAll("/", "_")}.js?v=${svelteVersion}`
57
- importMap.imports[svelteLibName] = importValue;
58
- }
59
- }
60
- },
61
- {
62
- name: 'insert-import-map',
63
- apply: 'build',
64
- transformIndexHtml(html) {
65
- const importMapScript = `<script type="importmap">${JSON.stringify(importMap)}</script>`;
66
- return html.replace(
67
- /<\/head>/,
68
- `${importMapScript}</head>`
69
- );
70
- }
71
- },
72
- {
73
- name: 'insert-APP_ENV',
74
- async transformIndexHtml(html) {
75
- const importMapScript = `<script>window.APP_ENV = {LOBB_URL: "${mode === 'development' ? env.LOBB_URL ?? "" : "%LOBB_URL%"}"}</script>`;
76
- return html.replace(
77
- /<\/head>/,
78
- `${importMapScript}</head>`
79
- );
80
- }
81
- },
82
- ],
83
- }
84
- })
@@ -1,81 +0,0 @@
1
- import path from "path";
2
- import fs from "fs";
3
- import { defineConfig } from "vite";
4
- import { svelte } from "@sveltejs/vite-plugin-svelte";
5
- import { getSvelteExportedLibraries } from "./vite_utils";
6
- import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
7
-
8
- const exports = await getSvelteExportedLibraries();
9
- const externals = Object.keys(exports).map((item) => item.replaceAll("_", "/"));
10
-
11
- const availableExtensions = fs.readdirSync("src/extensions").filter((name) => {
12
- const fullPath = path.join("src/extensions", name);
13
- return fs.statSync(fullPath).isDirectory();
14
- });
15
-
16
- if (availableExtensions.length > 1) {
17
- throw new Error(
18
- "The extensions directory should have only one extension when executing the npm `build_extension`",
19
- );
20
- }
21
-
22
- export default defineConfig({
23
- resolve: {
24
- alias: {
25
- $lib: path.resolve("./src/lib"),
26
- },
27
- },
28
- build: {
29
- minify: true,
30
- lib: {
31
- entry: `src/extensions/${availableExtensions[0]}/index.ts`,
32
- fileName: availableExtensions[0],
33
- formats: ["es"],
34
- },
35
- rollupOptions: {
36
- external: externals,
37
- output: {
38
- inlineDynamicImports: true,
39
- },
40
- },
41
- },
42
- plugins: [
43
- svelte(),
44
- cssInjectedByJsPlugin(),
45
- {
46
- name: "vite-plugin-generate-dashboard-json",
47
- apply: "build",
48
- closeBundle() {
49
- const distDir = path.resolve(__dirname, "dist");
50
- const extensionFilePath = path.join(
51
- distDir,
52
- `${availableExtensions[0]}.js`,
53
- );
54
- const outputJsonPath = path.join(__dirname, "../dashboard.json");
55
-
56
- if (!fs.existsSync(extensionFilePath)) {
57
- console.warn(
58
- `⚠️ ${availableExtensions[0]}.js not found in dist directory.`,
59
- );
60
- return;
61
- }
62
-
63
- if (!fs.existsSync(outputJsonPath)) {
64
- console.warn(
65
- `Couldn't find the dashboard.json file in the upper directory (it indicates that this lobb studio project is not inside an extension).`,
66
- );
67
- return;
68
- }
69
-
70
- const jsContent = fs.readFileSync(extensionFilePath, "utf-8");
71
- const json = {
72
- extension: jsContent,
73
- };
74
- fs.writeFileSync(outputJsonPath, JSON.stringify(json, null, 2));
75
- console.log(
76
- `✅ the dashboard.json of the (${availableExtensions[0]}) extension was overwritten successfully`,
77
- );
78
- },
79
- },
80
- ],
81
- });
package/vite_utils.ts DELETED
@@ -1,28 +0,0 @@
1
- import fs from 'fs/promises';
2
- import path from 'path';
3
-
4
- export async function getSvelteExportedLibraries() {
5
- const svelteLocation = 'node_modules/svelte';
6
- const sveltePackage = await fs.readFile(`${svelteLocation}/package.json`, 'utf-8');
7
- const metadata = JSON.parse(sveltePackage);
8
-
9
- const svelteExports: any = {};
10
- for (const [key, value] of Object.entries(metadata.exports)) {
11
- const svelteLibName = key.replace(".", 'svelte');
12
- const editedSvelteLibName = svelteLibName.replaceAll("/", '_');
13
- if (value.browser) {
14
- svelteExports[editedSvelteLibName] = path.resolve(svelteLocation, value.browser);
15
- } else if (value.default) {
16
- svelteExports[editedSvelteLibName] = path.resolve(svelteLocation, value.default);
17
- }
18
- }
19
-
20
- return svelteExports;
21
- }
22
-
23
- export async function getSvelteVersion() {
24
- const svelteLocation = 'node_modules/svelte';
25
- const sveltePackage = await fs.readFile(`${svelteLocation}/package.json`, 'utf-8');
26
- const metadata = JSON.parse(sveltePackage);
27
- return metadata.version;
28
- }
package/vitest.shims.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="@vitest/browser-playwright" />