@vibes.diy/vibe-db-explorer 2.0.8 → 2.0.10

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.
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
- export declare function DBExplorerPage({ importMap, base }: {
2
+ interface DBExplorerVibeApp {
3
+ readonly appSlug: string;
4
+ readonly userSlug: string;
5
+ readonly fsId?: string;
6
+ }
7
+ export declare function DBExplorerPage({ importMap, base, vibeApp }: {
3
8
  importMap: {
4
9
  imports: Record<string, string>;
5
10
  };
6
11
  base: string;
12
+ vibeApp: DBExplorerVibeApp;
7
13
  }): React.JSX.Element;
14
+ export {};
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
- export function DBExplorerPage({ importMap, base, }) {
2
+ export function DBExplorerPage({ importMap, base, vibeApp, }) {
3
3
  const mountCode = [
4
+ "import { registerDependencies } from '@vibes.diy/vibe-runtime';",
4
5
  "import { startDBExplorer } from '@vibes.diy/vibe-db-explorer/start';",
5
- `startDBExplorer(${JSON.stringify(base)});`,
6
+ `registerDependencies(${JSON.stringify(vibeApp)})`,
7
+ ` .then(() => startDBExplorer(${JSON.stringify(base)}));`,
6
8
  ].join("\n");
7
9
  return (React.createElement("html", { lang: "en" },
8
10
  React.createElement("head", null,
@@ -1 +1 @@
1
- {"version":3,"file":"db-explorer-page.js","sourceRoot":"","sources":["../jsr/db-explorer-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,IAAI,GAML;IACC,MAAM,SAAS,GAAG;QAChB,sEAAsE;QACtE,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI;KAC5C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,OAAO,CACL,8BAAM,IAAI,EAAC,IAAI;QACb;YACE,gCAAQ,IAAI,EAAC,WAAW,EAAC,uBAAuB,EAAE,EAA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ACR,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/vibe-db-explorer",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "sideEffects": false,
@@ -28,8 +28,8 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@adviser/cement": "~0.5.34",
31
- "@vibes.diy/base": "2.0.8",
32
- "@vibes.diy/vibe-runtime": "2.0.8",
31
+ "@vibes.diy/base": "2.0.10",
32
+ "@vibes.diy/vibe-runtime": "2.0.10",
33
33
  "ag-grid-community": "~35.2.1",
34
34
  "ag-grid-react": "~35.2.1",
35
35
  "react": "~19.2.5",
@@ -1,33 +1,21 @@
1
1
  import { useState, useEffect } from "react";
2
+ import { listDbNames } from "@vibes.diy/vibe-runtime";
2
3
  export function useIndexedDBList() {
3
4
  const [databases, setDatabases] = useState([]);
4
5
  const [loading, setLoading] = useState(true);
5
6
  useEffect(() => {
6
7
  let cancelled = false;
7
- async function discover() {
8
- try {
9
- if (typeof indexedDB.databases !== "function") {
10
- setLoading(false);
11
- return;
12
- }
13
- const allDbs = await indexedDB.databases();
14
- if (cancelled)
15
- return;
16
- const filtered = allDbs
17
- .map((db) => db.name)
18
- .filter((name) => typeof name === "string" && name.startsWith("fp.") && name !== "fp-keybag")
19
- .map((name) => name.slice(3))
20
- .sort();
21
- setDatabases(filtered);
22
- }
23
- catch {
24
- }
25
- finally {
26
- if (!cancelled)
27
- setLoading(false);
28
- }
29
- }
30
- discover();
8
+ listDbNames()
9
+ .then((names) => {
10
+ if (!cancelled)
11
+ setDatabases(names.sort());
12
+ })
13
+ .catch(() => {
14
+ })
15
+ .finally(() => {
16
+ if (!cancelled)
17
+ setLoading(false);
18
+ });
31
19
  return () => {
32
20
  cancelled = true;
33
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useIndexedDBList.js","sourceRoot":"","sources":["../../../jsr/src/hooks/useIndexedDB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