@lobb-js/studio 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@
14
14
  loadExtensions,
15
15
  } from "../extensions/extensionUtils";
16
16
  import extensionMap from 'virtual:lobb-studio-extensions';
17
+ import studioPackageJson from "../../../package.json";
17
18
  import { mediaQueries } from "../utils";
18
19
  import Home from "./routes/home.svelte";
19
20
  import DataModel from "./routes/data_model/dataModel.svelte";
@@ -32,6 +33,7 @@
32
33
  extensions: {},
33
34
  meta: null,
34
35
  currentUrl: new URL(window.location.href),
36
+ studioVersion: studioPackageJson.version,
35
37
  });
36
38
 
37
39
  const lobb = createLobb(lobbUrl ?? "");
@@ -1,10 +1,8 @@
1
- <script>
1
+ <script lang="ts">
2
2
  import Button from "../../components/ui/button/button.svelte";
3
- import { getStudioContext } from "../../context";
4
3
  import { location } from "@wjfe/n-savant";
5
-
6
- const { ctx } = getStudioContext();
7
4
  import { ArrowRight } from "lucide-svelte";
5
+ import HomeFooter from "./homeFooter.svelte";
8
6
  </script>
9
7
 
10
8
  <div class="flex flex-col">
@@ -29,12 +27,5 @@
29
27
  </Button>
30
28
  </div>
31
29
  </div>
32
- <div class="flex justify-end p-2 text-xs text-muted-foreground/50">
33
- <div class="flex flex-col text-end">
34
- {#if ctx.studioVersion}
35
- <div>studio: v{ctx.studioVersion}</div>
36
- {/if}
37
- <div>core: v{ctx.meta.version}</div>
38
- </div>
39
- </div>
30
+ <HomeFooter />
40
31
  </div>
@@ -1,18 +1,5 @@
1
- export default Home;
2
- type Home = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string;
8
- };
9
- declare const Home: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
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> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
16
3
  $$bindings?: Bindings;
17
4
  } & Exports;
18
5
  (internal: unknown, props: {
@@ -24,3 +11,8 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
24
11
  };
25
12
  z_$$bindings?: Bindings;
26
13
  }
14
+ declare const Home: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type Home = InstanceType<typeof Home>;
18
+ export default Home;
@@ -0,0 +1,51 @@
1
+ <script lang="ts">
2
+ import { getStudioContext } from "../../context";
3
+ import { onMount } from "svelte";
4
+ import TimeAgo from "javascript-time-ago";
5
+ import en from "javascript-time-ago/locale/en";
6
+
7
+ TimeAgo.addDefaultLocale(en);
8
+ const timeAgo = new TimeAgo("en-US");
9
+
10
+ const { ctx } = getStudioContext();
11
+
12
+ let releaseDates: Record<string, string | null> = $state({});
13
+
14
+ async function fetchReleaseDate(pkg: string, version: string): Promise<string | null> {
15
+ try {
16
+ const res = await fetch(`https://registry.npmjs.org/${pkg}`);
17
+ if (!res.ok) return null;
18
+ const data = await res.json();
19
+ return data.time?.[version] ?? null;
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+
25
+ onMount(async () => {
26
+ const [coreDate, studioDate] = await Promise.all([
27
+ fetchReleaseDate("@lobb-js/core", ctx.meta.version),
28
+ ctx.studioVersion ? fetchReleaseDate("@lobb-js/studio", ctx.studioVersion) : Promise.resolve(null),
29
+ ]);
30
+ releaseDates = { core: coreDate, studio: studioDate };
31
+ });
32
+ </script>
33
+
34
+ <div class="flex justify-end p-2 text-xs text-muted-foreground/50">
35
+ <div class="flex flex-col text-end gap-0.5">
36
+ {#if ctx.studioVersion}
37
+ <div>
38
+ studio: v{ctx.studioVersion}
39
+ {#if releaseDates.studio}
40
+ <span>({timeAgo.format(new Date(releaseDates.studio!))})</span>
41
+ {/if}
42
+ </div>
43
+ {/if}
44
+ <div>
45
+ core: v{ctx.meta.version}
46
+ {#if releaseDates.core}
47
+ <span>({timeAgo.format(new Date(releaseDates.core!))})</span>
48
+ {/if}
49
+ </div>
50
+ </div>
51
+ </div>
@@ -0,0 +1,3 @@
1
+ declare const HomeFooter: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type HomeFooter = ReturnType<typeof HomeFooter>;
3
+ export default HomeFooter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobb-js/studio",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -77,12 +77,6 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@andrewbranch/untar.js": "^1.0.3",
80
- "@internationalized/date": "^3.12.0",
81
- "@tiptap/core": "^3.0.0",
82
- "@tiptap/extension-link": "^3.0.0",
83
- "@tiptap/extension-underline": "^3.0.0",
84
- "@tiptap/pm": "^3.0.0",
85
- "@tiptap/starter-kit": "^3.0.0",
86
80
  "@codemirror/lang-javascript": "^6.2.4",
87
81
  "@codemirror/lang-sql": "^6.10.0",
88
82
  "@codemirror/merge": "^6.11.2",
@@ -90,15 +84,22 @@
90
84
  "@codemirror/theme-one-dark": "^6.1.3",
91
85
  "@codemirror/view": "^6.39.12",
92
86
  "@dagrejs/dagre": "^1.1.5",
87
+ "@internationalized/date": "^3.12.0",
93
88
  "@lobb-js/sdk": "^0.1.5",
94
89
  "@lucide/svelte": "^0.563.1",
95
90
  "@tailwindcss/vite": "^4.1.18",
91
+ "@tiptap/core": "^3.0.0",
92
+ "@tiptap/extension-link": "^3.0.0",
93
+ "@tiptap/extension-underline": "^3.0.0",
94
+ "@tiptap/pm": "^3.0.0",
95
+ "@tiptap/starter-kit": "^3.0.0",
96
96
  "@wjfe/n-savant": "^0.3.0",
97
97
  "@xyflow/svelte": "^1.2.0",
98
98
  "bits-ui": "^1.8.0",
99
99
  "clsx": "^2.1.1",
100
100
  "codemirror": "^6.0.2",
101
101
  "fflate": "^0.8.2",
102
+ "javascript-time-ago": "^2.6.4",
102
103
  "json-stable-stringify": "^1.3.0",
103
104
  "lodash": "^4.17.21",
104
105
  "lucide-svelte": "^0.488.0",
@@ -14,6 +14,7 @@
14
14
  loadExtensions,
15
15
  } from "../extensions/extensionUtils";
16
16
  import extensionMap from 'virtual:lobb-studio-extensions';
17
+ import studioPackageJson from "../../../package.json";
17
18
  import { mediaQueries } from "../utils";
18
19
  import Home from "./routes/home.svelte";
19
20
  import DataModel from "./routes/data_model/dataModel.svelte";
@@ -32,6 +33,7 @@
32
33
  extensions: {},
33
34
  meta: null,
34
35
  currentUrl: new URL(window.location.href),
36
+ studioVersion: studioPackageJson.version,
35
37
  });
36
38
 
37
39
  const lobb = createLobb(lobbUrl ?? "");
@@ -1,10 +1,8 @@
1
- <script>
1
+ <script lang="ts">
2
2
  import Button from "../../components/ui/button/button.svelte";
3
- import { getStudioContext } from "../../context";
4
3
  import { location } from "@wjfe/n-savant";
5
-
6
- const { ctx } = getStudioContext();
7
4
  import { ArrowRight } from "lucide-svelte";
5
+ import HomeFooter from "./homeFooter.svelte";
8
6
  </script>
9
7
 
10
8
  <div class="flex flex-col">
@@ -29,12 +27,5 @@
29
27
  </Button>
30
28
  </div>
31
29
  </div>
32
- <div class="flex justify-end p-2 text-xs text-muted-foreground/50">
33
- <div class="flex flex-col text-end">
34
- {#if ctx.studioVersion}
35
- <div>studio: v{ctx.studioVersion}</div>
36
- {/if}
37
- <div>core: v{ctx.meta.version}</div>
38
- </div>
39
- </div>
30
+ <HomeFooter />
40
31
  </div>
@@ -0,0 +1,51 @@
1
+ <script lang="ts">
2
+ import { getStudioContext } from "../../context";
3
+ import { onMount } from "svelte";
4
+ import TimeAgo from "javascript-time-ago";
5
+ import en from "javascript-time-ago/locale/en";
6
+
7
+ TimeAgo.addDefaultLocale(en);
8
+ const timeAgo = new TimeAgo("en-US");
9
+
10
+ const { ctx } = getStudioContext();
11
+
12
+ let releaseDates: Record<string, string | null> = $state({});
13
+
14
+ async function fetchReleaseDate(pkg: string, version: string): Promise<string | null> {
15
+ try {
16
+ const res = await fetch(`https://registry.npmjs.org/${pkg}`);
17
+ if (!res.ok) return null;
18
+ const data = await res.json();
19
+ return data.time?.[version] ?? null;
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+
25
+ onMount(async () => {
26
+ const [coreDate, studioDate] = await Promise.all([
27
+ fetchReleaseDate("@lobb-js/core", ctx.meta.version),
28
+ ctx.studioVersion ? fetchReleaseDate("@lobb-js/studio", ctx.studioVersion) : Promise.resolve(null),
29
+ ]);
30
+ releaseDates = { core: coreDate, studio: studioDate };
31
+ });
32
+ </script>
33
+
34
+ <div class="flex justify-end p-2 text-xs text-muted-foreground/50">
35
+ <div class="flex flex-col text-end gap-0.5">
36
+ {#if ctx.studioVersion}
37
+ <div>
38
+ studio: v{ctx.studioVersion}
39
+ {#if releaseDates.studio}
40
+ <span>({timeAgo.format(new Date(releaseDates.studio!))})</span>
41
+ {/if}
42
+ </div>
43
+ {/if}
44
+ <div>
45
+ core: v{ctx.meta.version}
46
+ {#if releaseDates.core}
47
+ <span>({timeAgo.format(new Date(releaseDates.core!))})</span>
48
+ {/if}
49
+ </div>
50
+ </div>
51
+ </div>