@ultrst-armada/floks 1.13.19 → 1.13.20
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/.krusbl-release-attestation.json +3 -3
- package/package.json +3 -2
- package/packages/canvas-ui/dist/index.js +35 -35
- package/packages/canvas-ui/dist/predictive/index.js +1 -1
- package/packages/canvas-ui/package.json +1 -1
- package/packages/ui/dist/{chunk-Z2477Y5G.js → chunk-YQL4AGPU.js} +402 -151
- package/packages/ui/dist/components/workspace/GoogleDriveWorkspacePicker.d.ts +31 -0
- package/packages/ui/dist/components/workspace/GoogleDriveWorkspacePicker.test.d.ts +1 -0
- package/packages/ui/dist/components/workspace/WorkspaceCreateDialog.d.ts +23 -2
- package/packages/ui/dist/components/workspace/WorkspaceCreateDialog.google-drive.test.d.ts +1 -0
- package/packages/ui/dist/components/workspace/index.d.ts +1 -0
- package/packages/ui/dist/components/workspace/index.js +5 -1
- package/packages/ui/dist/index.js +5 -1
- package/packages/ui/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/floks",
|
|
4
|
-
"version": "1.13.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.13.20",
|
|
5
|
+
"sourceCommit": "638e891caf03a88c9a7f62d6f5e0f8bf88a61411",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "42500046876"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/floks",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -94,7 +94,8 @@
|
|
|
94
94
|
"d3-force": "^3.0.0",
|
|
95
95
|
"zod": "^3.24.1",
|
|
96
96
|
"zustand": "^5.0.3",
|
|
97
|
-
"@ultrst-armada/kloks": "^1.26.
|
|
97
|
+
"@ultrst-armada/kloks": "^1.26.2",
|
|
98
|
+
"@ultrst-armada/krnl": "^1.0.13",
|
|
98
99
|
"@dinilmusick/gutts": "^1.6.0"
|
|
99
100
|
},
|
|
100
101
|
"peerDependencies": {
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BIOME_CONFIGS,
|
|
3
|
-
COORD_SCALE,
|
|
4
|
-
CanvasBackground2D,
|
|
5
|
-
CanvasErrorBoundary,
|
|
6
|
-
ContainerNode2D,
|
|
7
|
-
EffectNode2D,
|
|
8
|
-
MagneticTraces2D,
|
|
9
|
-
ModuleNode2D,
|
|
10
|
-
NodeRenderer2D,
|
|
11
|
-
RotaryKnob,
|
|
12
|
-
TriggerNode2D,
|
|
13
|
-
Wire2D,
|
|
14
|
-
useCanvas2DCoordinates,
|
|
15
|
-
useCanvas2DMagnetic
|
|
16
|
-
} from "./chunk-XVAHT5WE.js";
|
|
17
1
|
import {
|
|
18
2
|
PredictiveGhostNodeCard,
|
|
19
3
|
PredictiveHudToolbar,
|
|
20
4
|
PredictiveLayer2D
|
|
21
5
|
} from "./chunk-RH5NINIT.js";
|
|
22
|
-
import {
|
|
23
|
-
NODE_CARD_WIDTH,
|
|
24
|
-
Node2DBase,
|
|
25
|
-
RecorderWaveformDisplay,
|
|
26
|
-
SOCKET_ROW_HEIGHT,
|
|
27
|
-
Socket2D,
|
|
28
|
-
getSocketLocalOffset,
|
|
29
|
-
getSocketScreenPosition,
|
|
30
|
-
renderSpriteIcon
|
|
31
|
-
} from "./chunk-U2SC3RMJ.js";
|
|
32
6
|
import {
|
|
33
7
|
Tile,
|
|
34
8
|
TileCreateButton,
|
|
@@ -50,21 +24,21 @@ import {
|
|
|
50
24
|
getAuthoringSubtreeIds
|
|
51
25
|
} from "./chunk-TS7P3WWH.js";
|
|
52
26
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
CanvasViewport,
|
|
28
|
+
InfiniteCanvas,
|
|
29
|
+
MiniMap,
|
|
30
|
+
useCanvas
|
|
31
|
+
} from "./chunk-34YRDZPJ.js";
|
|
57
32
|
import {
|
|
58
33
|
DockBar,
|
|
59
34
|
DockItem,
|
|
60
35
|
useDock
|
|
61
36
|
} from "./chunk-6VB74RCH.js";
|
|
62
37
|
import {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} from "./chunk-34YRDZPJ.js";
|
|
38
|
+
MonacoEditor,
|
|
39
|
+
skipoDarkTheme,
|
|
40
|
+
useMonaco
|
|
41
|
+
} from "./chunk-ZJXRL74D.js";
|
|
68
42
|
import {
|
|
69
43
|
FodModule
|
|
70
44
|
} from "./chunk-7CYX3B6O.js";
|
|
@@ -80,6 +54,32 @@ import {
|
|
|
80
54
|
import {
|
|
81
55
|
usePredictiveGraph2D
|
|
82
56
|
} from "./chunk-QRYNQ36L.js";
|
|
57
|
+
import {
|
|
58
|
+
BIOME_CONFIGS,
|
|
59
|
+
COORD_SCALE,
|
|
60
|
+
CanvasBackground2D,
|
|
61
|
+
CanvasErrorBoundary,
|
|
62
|
+
ContainerNode2D,
|
|
63
|
+
EffectNode2D,
|
|
64
|
+
MagneticTraces2D,
|
|
65
|
+
ModuleNode2D,
|
|
66
|
+
NodeRenderer2D,
|
|
67
|
+
RotaryKnob,
|
|
68
|
+
TriggerNode2D,
|
|
69
|
+
Wire2D,
|
|
70
|
+
useCanvas2DCoordinates,
|
|
71
|
+
useCanvas2DMagnetic
|
|
72
|
+
} from "./chunk-XVAHT5WE.js";
|
|
73
|
+
import {
|
|
74
|
+
NODE_CARD_WIDTH,
|
|
75
|
+
Node2DBase,
|
|
76
|
+
RecorderWaveformDisplay,
|
|
77
|
+
SOCKET_ROW_HEIGHT,
|
|
78
|
+
Socket2D,
|
|
79
|
+
getSocketLocalOffset,
|
|
80
|
+
getSocketScreenPosition,
|
|
81
|
+
renderSpriteIcon
|
|
82
|
+
} from "./chunk-U2SC3RMJ.js";
|
|
83
83
|
|
|
84
84
|
// src/node-graph-ui/widgets/MidpointWidgets.tsx
|
|
85
85
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
PredictiveHudToolbar,
|
|
4
4
|
PredictiveLayer2D
|
|
5
5
|
} from "../chunk-RH5NINIT.js";
|
|
6
|
-
import "../chunk-U2SC3RMJ.js";
|
|
7
6
|
import {
|
|
8
7
|
usePredictiveGraph2D
|
|
9
8
|
} from "../chunk-QRYNQ36L.js";
|
|
9
|
+
import "../chunk-U2SC3RMJ.js";
|
|
10
10
|
export {
|
|
11
11
|
PredictiveGhostNodeCard,
|
|
12
12
|
PredictiveHudToolbar,
|
|
@@ -440,9 +440,199 @@ var WorkspaceSecondaryClonesPanel = ({ workspace, onClonesUpdated, onClose }) =>
|
|
|
440
440
|
};
|
|
441
441
|
|
|
442
442
|
// src/components/workspace/WorkspaceCreateDialog.tsx
|
|
443
|
-
import { useEffect as
|
|
443
|
+
import { useEffect as useEffect4, useMemo, useState as useState6 } from "react";
|
|
444
444
|
import { HardDrive as HardDrive5, Loader2 } from "lucide-react";
|
|
445
|
+
|
|
446
|
+
// src/components/workspace/GoogleDriveWorkspacePicker.tsx
|
|
447
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useState as useState5 } from "react";
|
|
445
448
|
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
449
|
+
function getErrorCode(error) {
|
|
450
|
+
if (!error || typeof error !== "object") return "";
|
|
451
|
+
const candidate = error;
|
|
452
|
+
if (typeof candidate.code === "string") return candidate.code.toUpperCase();
|
|
453
|
+
if (error.name === "AbortError") return "GOOGLE_DRIVE_CANCELLED";
|
|
454
|
+
const status = candidate.status ?? candidate.response?.status;
|
|
455
|
+
return status === 401 ? "GOOGLE_DRIVE_AUTH_EXPIRED" : status === 403 ? "GOOGLE_DRIVE_ACCESS_DENIED" : "";
|
|
456
|
+
}
|
|
457
|
+
function describeGoogleDriveError(error) {
|
|
458
|
+
const code = getErrorCode(error);
|
|
459
|
+
if (code.includes("CANCEL") || code === "ACCESS_DENIED" || code === "OAUTH_ACCESS_DENIED") {
|
|
460
|
+
return "Google Drive authorization was cancelled or declined. No connection was added.";
|
|
461
|
+
}
|
|
462
|
+
if (code.includes("EXPIRED") || code === "UNAUTHENTICATED") {
|
|
463
|
+
return "Your Google Drive authorization has expired. Reconnect your Google account to continue.";
|
|
464
|
+
}
|
|
465
|
+
if (code.includes("DENIED") || code.includes("FORBIDDEN")) {
|
|
466
|
+
return "Google Drive access was not granted. Authorize Drive access and try again.";
|
|
467
|
+
}
|
|
468
|
+
if (code.includes("UNAVAILABLE") || code.includes("SERVICE_UNAVAILABLE")) {
|
|
469
|
+
return "Google Drive is currently unavailable. Check Drive access and try again.";
|
|
470
|
+
}
|
|
471
|
+
if (error instanceof Error && error.message) return error.message;
|
|
472
|
+
return "Unable to access Google Drive. Please try again.";
|
|
473
|
+
}
|
|
474
|
+
function GoogleDriveWorkspacePicker({
|
|
475
|
+
userId,
|
|
476
|
+
connection,
|
|
477
|
+
connectGoogleDrive,
|
|
478
|
+
listGoogleDriveFolders,
|
|
479
|
+
onConnected,
|
|
480
|
+
onSelectFolder,
|
|
481
|
+
selectedFolder
|
|
482
|
+
}) {
|
|
483
|
+
const [connecting, setConnecting] = useState5(false);
|
|
484
|
+
const [loading, setLoading] = useState5(false);
|
|
485
|
+
const [folders, setFolders] = useState5([]);
|
|
486
|
+
const [folderPath, setFolderPath] = useState5([]);
|
|
487
|
+
const [error, setError] = useState5(null);
|
|
488
|
+
const [status, setStatus] = useState5(null);
|
|
489
|
+
const loadFolders = useCallback2(async (connectionId, parentFolderId) => {
|
|
490
|
+
if (!listGoogleDriveFolders) {
|
|
491
|
+
setFolders([]);
|
|
492
|
+
setError("Google Drive folder browsing is not configured for this storage service.");
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
setLoading(true);
|
|
496
|
+
setError(null);
|
|
497
|
+
try {
|
|
498
|
+
const items = await listGoogleDriveFolders(connectionId, parentFolderId);
|
|
499
|
+
setFolders(Array.isArray(items) ? items.filter((item) => item && typeof item.id === "string" && typeof item.name === "string") : []);
|
|
500
|
+
} catch (reason) {
|
|
501
|
+
setFolders([]);
|
|
502
|
+
setError(describeGoogleDriveError(reason));
|
|
503
|
+
} finally {
|
|
504
|
+
setLoading(false);
|
|
505
|
+
}
|
|
506
|
+
}, [listGoogleDriveFolders]);
|
|
507
|
+
useEffect3(() => {
|
|
508
|
+
setFolderPath([]);
|
|
509
|
+
setFolders([]);
|
|
510
|
+
setError(null);
|
|
511
|
+
setStatus(null);
|
|
512
|
+
if (connection?.id) void loadFolders(connection.id);
|
|
513
|
+
}, [connection?.id, loadFolders]);
|
|
514
|
+
const handleConnect = async () => {
|
|
515
|
+
if (!connectGoogleDrive) {
|
|
516
|
+
setError("Google Drive authorization is not configured for this storage service.");
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
setConnecting(true);
|
|
520
|
+
setError(null);
|
|
521
|
+
setStatus(null);
|
|
522
|
+
try {
|
|
523
|
+
const connected = await connectGoogleDrive(userId);
|
|
524
|
+
if (!connected || typeof connected.id !== "string" || !connected.id || connected.id === "google_drive") {
|
|
525
|
+
throw new Error("The Google Drive authorization service returned an invalid connection.");
|
|
526
|
+
}
|
|
527
|
+
onConnected(connected);
|
|
528
|
+
setStatus("Google Drive connected. Choose a folder for this workspace.");
|
|
529
|
+
} catch (reason) {
|
|
530
|
+
const message = describeGoogleDriveError(reason);
|
|
531
|
+
if (getErrorCode(reason).includes("CANCEL")) setStatus(message);
|
|
532
|
+
else setError(message);
|
|
533
|
+
} finally {
|
|
534
|
+
setConnecting(false);
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
const openFolder = async (folder) => {
|
|
538
|
+
if (!connection) return;
|
|
539
|
+
setLoading(true);
|
|
540
|
+
setError(null);
|
|
541
|
+
try {
|
|
542
|
+
const items = await listGoogleDriveFolders?.(connection.id, folder.id);
|
|
543
|
+
setFolders(Array.isArray(items) ? items : []);
|
|
544
|
+
setFolderPath((current) => [...current, { id: folder.id, name: folder.name }]);
|
|
545
|
+
} catch (reason) {
|
|
546
|
+
setError(describeGoogleDriveError(reason));
|
|
547
|
+
} finally {
|
|
548
|
+
setLoading(false);
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
const goBack = async () => {
|
|
552
|
+
if (!connection || folderPath.length === 0) return;
|
|
553
|
+
const nextPath = folderPath.slice(0, -1);
|
|
554
|
+
const parentFolderId = nextPath[nextPath.length - 1]?.id;
|
|
555
|
+
setLoading(true);
|
|
556
|
+
setError(null);
|
|
557
|
+
try {
|
|
558
|
+
const items = await listGoogleDriveFolders?.(connection.id, parentFolderId);
|
|
559
|
+
setFolders(Array.isArray(items) ? items : []);
|
|
560
|
+
setFolderPath(nextPath);
|
|
561
|
+
} catch (reason) {
|
|
562
|
+
setError(describeGoogleDriveError(reason));
|
|
563
|
+
} finally {
|
|
564
|
+
setLoading(false);
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
const selectCurrentFolder = () => {
|
|
568
|
+
const current = folderPath[folderPath.length - 1];
|
|
569
|
+
if (!current) return;
|
|
570
|
+
onSelectFolder(current);
|
|
571
|
+
setStatus(`\u201C${current.name}\u201D selected as the workspace storage root.`);
|
|
572
|
+
};
|
|
573
|
+
if (!connection) {
|
|
574
|
+
return /* @__PURE__ */ jsxs6("section", { "aria-label": "Google Drive connection", className: "space-y-2 border p-3", children: [
|
|
575
|
+
/* @__PURE__ */ jsx6("p", { className: "text-xs", children: "Connect your Google account to browse and select a Drive folder. Google handles sign-in and authorization; Floks never asks for your Google password." }),
|
|
576
|
+
error && /* @__PURE__ */ jsx6("p", { role: "alert", className: "text-xs text-red-300", children: error }),
|
|
577
|
+
status && /* @__PURE__ */ jsx6("p", { role: "status", className: "text-xs", children: status }),
|
|
578
|
+
/* @__PURE__ */ jsx6(
|
|
579
|
+
"button",
|
|
580
|
+
{
|
|
581
|
+
type: "button",
|
|
582
|
+
onClick: handleConnect,
|
|
583
|
+
disabled: connecting,
|
|
584
|
+
className: "border px-3 py-2 text-xs font-bold disabled:opacity-50",
|
|
585
|
+
children: connecting ? "Connecting to Google\u2026" : "Connect Google Drive"
|
|
586
|
+
}
|
|
587
|
+
)
|
|
588
|
+
] });
|
|
589
|
+
}
|
|
590
|
+
return /* @__PURE__ */ jsxs6("section", { "aria-label": "Google Drive folder picker", className: "space-y-2 border p-3", children: [
|
|
591
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
592
|
+
/* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
|
|
593
|
+
/* @__PURE__ */ jsx6("p", { className: "text-xs font-bold", children: "Google Drive connected" }),
|
|
594
|
+
/* @__PURE__ */ jsx6("p", { className: "truncate text-[10px] opacity-70", children: connection.googleEmail || connection.label || connection.name || connection.id })
|
|
595
|
+
] }),
|
|
596
|
+
/* @__PURE__ */ jsx6(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
type: "button",
|
|
600
|
+
onClick: () => void loadFolders(connection.id, folderPath[folderPath.length - 1]?.id),
|
|
601
|
+
disabled: loading,
|
|
602
|
+
className: "border px-2 py-1 text-[10px] disabled:opacity-50",
|
|
603
|
+
children: loading ? "Loading\u2026" : "Refresh"
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
] }),
|
|
607
|
+
folderPath.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
608
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: goBack, disabled: loading, className: "border px-2 py-1 text-[10px] disabled:opacity-50", children: "Back" }),
|
|
609
|
+
/* @__PURE__ */ jsxs6("span", { className: "min-w-0 truncate text-[10px] opacity-70", children: [
|
|
610
|
+
"My Drive / ",
|
|
611
|
+
folderPath.map((entry) => entry.name).join(" / ")
|
|
612
|
+
] }),
|
|
613
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: selectCurrentFolder, disabled: loading, className: "ml-auto border px-2 py-1 text-[10px] font-bold disabled:opacity-50", children: "Use this folder" })
|
|
614
|
+
] }),
|
|
615
|
+
error && /* @__PURE__ */ jsx6("p", { role: "alert", className: "text-xs text-red-300", children: error }),
|
|
616
|
+
status && /* @__PURE__ */ jsx6("p", { role: "status", className: "text-xs", children: status }),
|
|
617
|
+
selectedFolder && /* @__PURE__ */ jsxs6("p", { className: "text-[10px]", children: [
|
|
618
|
+
"Selected workspace root: ",
|
|
619
|
+
/* @__PURE__ */ jsx6("strong", { children: selectedFolder.name })
|
|
620
|
+
] }),
|
|
621
|
+
loading ? /* @__PURE__ */ jsx6("p", { role: "status", className: "text-xs opacity-70", children: "Loading Google Drive folders\u2026" }) : folders.length === 0 ? /* @__PURE__ */ jsx6("p", { className: "text-xs opacity-70", children: "No folders are available at this location." }) : /* @__PURE__ */ jsx6("ul", { className: "max-h-48 space-y-1 overflow-y-auto", children: folders.map((folder) => /* @__PURE__ */ jsxs6("li", { className: "flex items-center justify-between gap-2 border-b py-1", children: [
|
|
622
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 truncate text-xs", children: folder.name }),
|
|
623
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex shrink-0 gap-1", children: [
|
|
624
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: () => void openFolder(folder), disabled: loading, className: "border px-2 py-1 text-[10px] disabled:opacity-50", children: "Open" }),
|
|
625
|
+
/* @__PURE__ */ jsx6("button", { type: "button", onClick: () => {
|
|
626
|
+
onSelectFolder(folder);
|
|
627
|
+
setStatus(`\u201C${folder.name}\u201D selected as the workspace storage root.`);
|
|
628
|
+
}, disabled: loading, className: "border px-2 py-1 text-[10px] font-bold disabled:opacity-50", children: "Select" })
|
|
629
|
+
] })
|
|
630
|
+
] }, folder.id)) })
|
|
631
|
+
] });
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// src/components/workspace/WorkspaceCreateDialog.tsx
|
|
635
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
446
636
|
var LOCAL_STORAGE_OPTION = {
|
|
447
637
|
id: "local_fs",
|
|
448
638
|
provider: "local_fs",
|
|
@@ -484,6 +674,17 @@ function buildWorkspaceCreateInput(name, description, option) {
|
|
|
484
674
|
googleRootFolderId: option.googleRootFolderId,
|
|
485
675
|
googleRootFolderName: option.googleRootFolderName
|
|
486
676
|
};
|
|
677
|
+
const storageConnection = !connectionId ? void 0 : provider === "google_drive" ? {
|
|
678
|
+
id: option.id,
|
|
679
|
+
provider,
|
|
680
|
+
label: option.label,
|
|
681
|
+
name: option.name,
|
|
682
|
+
role: option.role,
|
|
683
|
+
enabled: option.enabled,
|
|
684
|
+
googleEmail: option.googleEmail,
|
|
685
|
+
googleRootFolderId: option.googleRootFolderId,
|
|
686
|
+
googleRootFolderName: option.googleRootFolderName
|
|
687
|
+
} : option;
|
|
487
688
|
return {
|
|
488
689
|
name: name.trim(),
|
|
489
690
|
description: description.trim() || void 0,
|
|
@@ -498,7 +699,7 @@ function buildWorkspaceCreateInput(name, description, option) {
|
|
|
498
699
|
googleEmail: option.googleEmail,
|
|
499
700
|
googleRootFolderId: option.googleRootFolderId,
|
|
500
701
|
googleRootFolderName: option.googleRootFolderName,
|
|
501
|
-
storageConnection
|
|
702
|
+
storageConnection
|
|
502
703
|
};
|
|
503
704
|
}
|
|
504
705
|
async function fetchStorageConnections(userId) {
|
|
@@ -519,7 +720,7 @@ async function fetchStorageConnections(userId) {
|
|
|
519
720
|
}
|
|
520
721
|
async function fetchBackblazeAccounts(userId) {
|
|
521
722
|
try {
|
|
522
|
-
const response = await fetch("/api/
|
|
723
|
+
const response = await fetch("/api/storage/backblaze/accounts?userId=" + encodeURIComponent(userId));
|
|
523
724
|
const data = await response.json().catch(() => ({}));
|
|
524
725
|
return Array.isArray(data?.accounts) ? data.accounts : [];
|
|
525
726
|
} catch {
|
|
@@ -528,7 +729,7 @@ async function fetchBackblazeAccounts(userId) {
|
|
|
528
729
|
}
|
|
529
730
|
async function fetchBackblazeBuckets(accountId, userId) {
|
|
530
731
|
try {
|
|
531
|
-
const response = await fetch("/api/
|
|
732
|
+
const response = await fetch("/api/storage/backblaze/buckets", {
|
|
532
733
|
method: "POST",
|
|
533
734
|
headers: { "Content-Type": "application/json" },
|
|
534
735
|
body: JSON.stringify({ accountId, userId })
|
|
@@ -542,11 +743,8 @@ async function fetchBackblazeBuckets(accountId, userId) {
|
|
|
542
743
|
async function fetchDefaultStorageOptions(userId) {
|
|
543
744
|
const stored = await fetchStorageConnections(userId);
|
|
544
745
|
if (stored.length > 0) return stored;
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
fetch("/api/srkl/accounts?service=google_drive&userId=" + encodeURIComponent(userId)).then((response) => response.ok ? response.json() : {}).then((data) => Array.isArray(data?.accounts) ? data.accounts : []).catch(() => [])
|
|
548
|
-
]);
|
|
549
|
-
return [...backblaze, ...googleDrive].map((account) => {
|
|
746
|
+
const backblaze = await fetchBackblazeAccounts(userId);
|
|
747
|
+
return backblaze.map((account) => {
|
|
550
748
|
const credentials = account.credentials || {};
|
|
551
749
|
const value = (key, alternate) => {
|
|
552
750
|
const item = credentials[key] ?? (alternate ? credentials[alternate] : void 0);
|
|
@@ -558,10 +756,7 @@ async function fetchDefaultStorageOptions(userId) {
|
|
|
558
756
|
label: String(account.label || account.name || account.id),
|
|
559
757
|
b2BucketName: value("bucketName", "b2BucketName"),
|
|
560
758
|
b2Endpoint: value("endpoint", "b2Endpoint"),
|
|
561
|
-
b2Region: value("region", "b2Region")
|
|
562
|
-
googleEmail: value("email", "googleEmail"),
|
|
563
|
-
googleRootFolderId: value("rootFolderId", "googleRootFolderId"),
|
|
564
|
-
googleRootFolderName: value("rootFolderName", "googleRootFolderName")
|
|
759
|
+
b2Region: value("region", "b2Region")
|
|
565
760
|
};
|
|
566
761
|
});
|
|
567
762
|
}
|
|
@@ -570,38 +765,36 @@ var defaultWorkspaceStorageService = {
|
|
|
570
765
|
listBackblazeAccounts: fetchBackblazeAccounts,
|
|
571
766
|
listBackblazeBuckets: fetchBackblazeBuckets
|
|
572
767
|
};
|
|
573
|
-
function createKloksWorkspaceStorageService(invoker) {
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
return
|
|
768
|
+
function createKloksWorkspaceStorageService(invoker, googleDrive) {
|
|
769
|
+
const mapStorageConnection = (connection) => {
|
|
770
|
+
if (!connection || typeof connection.id !== "string" || typeof connection.provider !== "string") return null;
|
|
771
|
+
return {
|
|
772
|
+
id: connection.id,
|
|
773
|
+
provider: connection.provider,
|
|
774
|
+
label: String(connection.label || connection.name || connection.id),
|
|
775
|
+
role: connection.role,
|
|
776
|
+
enabled: connection.enabled,
|
|
777
|
+
localFolderName: connection.localFolderName,
|
|
778
|
+
localFolderKey: connection.localFolderKey,
|
|
779
|
+
localFolderPathHint: connection.localFolderPathHint,
|
|
780
|
+
b2BucketName: connection.b2BucketName,
|
|
781
|
+
b2Endpoint: connection.b2Endpoint,
|
|
782
|
+
b2Region: connection.b2Region,
|
|
783
|
+
googleEmail: connection.googleEmail,
|
|
784
|
+
googleRootFolderId: connection.googleRootFolderId,
|
|
785
|
+
googleRootFolderName: connection.googleRootFolderName
|
|
786
|
+
};
|
|
577
787
|
};
|
|
578
788
|
return {
|
|
579
|
-
listStorageConnections: async (
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
const value = (key, alternate) => {
|
|
584
|
-
const item = credentials[key] ?? (alternate ? credentials[alternate] : void 0);
|
|
585
|
-
return typeof item === "string" && item.length > 0 ? item : void 0;
|
|
586
|
-
};
|
|
587
|
-
return {
|
|
588
|
-
id: String(account.id),
|
|
589
|
-
provider: String(account.provider || account.serviceId || "backblaze_b2"),
|
|
590
|
-
label: String(account.name || account.label || account.id),
|
|
591
|
-
b2BucketName: value("bucketName", "b2BucketName"),
|
|
592
|
-
b2Endpoint: value("endpoint", "b2Endpoint"),
|
|
593
|
-
b2Region: value("region", "b2Region"),
|
|
594
|
-
googleEmail: value("email", "googleEmail"),
|
|
595
|
-
googleRootFolderId: value("rootFolderId", "googleRootFolderId"),
|
|
596
|
-
googleRootFolderName: value("rootFolderName", "googleRootFolderName")
|
|
597
|
-
};
|
|
598
|
-
});
|
|
789
|
+
listStorageConnections: async () => {
|
|
790
|
+
const result = await invoker.invoke("kloks.service.storage", "getConnections", {});
|
|
791
|
+
const storedConnections = Array.isArray(result) ? result : Array.isArray(result?.connections) ? result.connections : [];
|
|
792
|
+
return storedConnections.map(mapStorageConnection).filter((item) => Boolean(item));
|
|
599
793
|
},
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
794
|
+
...googleDrive ? {
|
|
795
|
+
connectGoogleDrive: googleDrive.connectGoogleDrive,
|
|
796
|
+
listGoogleDriveFolders: googleDrive.listGoogleDriveFolders
|
|
797
|
+
} : {}
|
|
605
798
|
};
|
|
606
799
|
}
|
|
607
800
|
function WorkspaceCreateDialog({
|
|
@@ -611,28 +804,31 @@ function WorkspaceCreateDialog({
|
|
|
611
804
|
appName = "app",
|
|
612
805
|
storageOptions,
|
|
613
806
|
storageService = defaultWorkspaceStorageService,
|
|
807
|
+
visibility,
|
|
614
808
|
onManageStorage,
|
|
615
809
|
onClose,
|
|
616
810
|
onSubmit
|
|
617
811
|
}) {
|
|
618
|
-
const [loadedOptions, setLoadedOptions] =
|
|
619
|
-
const [
|
|
620
|
-
const [
|
|
621
|
-
const [
|
|
622
|
-
const [
|
|
623
|
-
const [
|
|
624
|
-
const [
|
|
625
|
-
const [
|
|
626
|
-
const [
|
|
627
|
-
const [
|
|
628
|
-
const [
|
|
629
|
-
const [
|
|
630
|
-
const [
|
|
631
|
-
const [
|
|
632
|
-
const [
|
|
633
|
-
const [
|
|
812
|
+
const [loadedOptions, setLoadedOptions] = useState6([]);
|
|
813
|
+
const [connectedDriveOption, setConnectedDriveOption] = useState6(null);
|
|
814
|
+
const [googleDriveFolder, setGoogleDriveFolder] = useState6(null);
|
|
815
|
+
const [name, setName] = useState6("");
|
|
816
|
+
const [description, setDescription] = useState6("");
|
|
817
|
+
const [localFolderName, setLocalFolderName] = useState6("");
|
|
818
|
+
const [selectedStorageId, setSelectedStorageId] = useState6("local_fs");
|
|
819
|
+
const [defaultStorageApplied, setDefaultStorageApplied] = useState6(false);
|
|
820
|
+
const [backblazeMode, setBackblazeMode] = useState6(false);
|
|
821
|
+
const [backblazeAccounts, setBackblazeAccounts] = useState6([]);
|
|
822
|
+
const [backblazeAccountId, setBackblazeAccountId] = useState6("");
|
|
823
|
+
const [backblazeBuckets, setBackblazeBuckets] = useState6([]);
|
|
824
|
+
const [backblazeBucketName, setBackblazeBucketName] = useState6("");
|
|
825
|
+
const [loadingBackblazeAccounts, setLoadingBackblazeAccounts] = useState6(false);
|
|
826
|
+
const [loadingBackblazeBuckets, setLoadingBackblazeBuckets] = useState6(false);
|
|
827
|
+
const [loadingStorage, setLoadingStorage] = useState6(false);
|
|
828
|
+
const [submitting, setSubmitting] = useState6(false);
|
|
829
|
+
const [error, setError] = useState6(null);
|
|
634
830
|
const effectiveUserId = userId || currentUser?.id || "system";
|
|
635
|
-
|
|
831
|
+
useEffect4(() => {
|
|
636
832
|
if (!open) return;
|
|
637
833
|
setName("");
|
|
638
834
|
setDescription("");
|
|
@@ -645,8 +841,10 @@ function WorkspaceCreateDialog({
|
|
|
645
841
|
setBackblazeAccountId("");
|
|
646
842
|
setBackblazeBuckets([]);
|
|
647
843
|
setBackblazeBucketName("");
|
|
844
|
+
setConnectedDriveOption(null);
|
|
845
|
+
setGoogleDriveFolder(null);
|
|
648
846
|
}, [open]);
|
|
649
|
-
|
|
847
|
+
useEffect4(() => {
|
|
650
848
|
if (!open || storageOptions) return;
|
|
651
849
|
let active = true;
|
|
652
850
|
const listConnections = storageService.listStorageConnections;
|
|
@@ -670,32 +868,50 @@ function WorkspaceCreateDialog({
|
|
|
670
868
|
}, [open, effectiveUserId, storageOptions, storageService]);
|
|
671
869
|
const availableOptions = useMemo(() => {
|
|
672
870
|
const supplied = storageOptions ?? loadedOptions;
|
|
673
|
-
const
|
|
674
|
-
const
|
|
871
|
+
const providers = visibility?.availableStorageProviders;
|
|
872
|
+
const hidden = new Set(visibility?.hiddenStorageProviders || []);
|
|
873
|
+
const isVisible = (provider) => !hidden.has(provider) && (!providers || providers.includes(provider));
|
|
874
|
+
const enabled = supplied.filter(
|
|
875
|
+
(option) => option && option.enabled !== false && typeof option.id === "string" && isVisible(option.provider)
|
|
876
|
+
);
|
|
877
|
+
const local = enabled.find((option) => option.provider === "local_fs");
|
|
675
878
|
const external = enabled.filter((option) => option.provider !== "local_fs");
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
879
|
+
const driveConnections = [
|
|
880
|
+
...external.filter((option) => option.provider === "google_drive"),
|
|
881
|
+
...connectedDriveOption && connectedDriveOption.enabled !== false ? [connectedDriveOption] : []
|
|
882
|
+
].filter((option, index, items) => items.findIndex((candidate) => candidate.id === option.id) === index);
|
|
883
|
+
const connectDriveOption = isVisible("google_drive") && !driveConnections.some((option) => option.id === "google_drive") ? [{ id: "google_drive", provider: "google_drive", label: driveConnections.length ? "Connect another account" : "Connect Google Drive" }] : [];
|
|
884
|
+
return [
|
|
885
|
+
...local ? [local] : isVisible("local_fs") ? [LOCAL_STORAGE_OPTION] : [],
|
|
886
|
+
...external.filter((option) => option.provider !== "google_drive"),
|
|
887
|
+
...driveConnections,
|
|
888
|
+
...connectDriveOption
|
|
889
|
+
];
|
|
890
|
+
}, [storageOptions, loadedOptions, connectedDriveOption, visibility]);
|
|
891
|
+
useEffect4(() => {
|
|
679
892
|
if (!open || loadingStorage || defaultStorageApplied) return;
|
|
680
|
-
const primary = availableOptions.find((option) => option.role === "primary") || availableOptions.find((option) => option.provider !== "local_fs");
|
|
681
|
-
|
|
893
|
+
const primary = availableOptions.find((option) => option.role === "primary") || availableOptions.find((option) => option.provider !== "local_fs" && option.id !== "google_drive");
|
|
894
|
+
const preferred = primary || availableOptions[0];
|
|
895
|
+
if (preferred) setSelectedStorageId(preferred.id);
|
|
682
896
|
setDefaultStorageApplied(true);
|
|
683
897
|
}, [open, loadingStorage, availableOptions, defaultStorageApplied]);
|
|
684
|
-
|
|
898
|
+
useEffect4(() => {
|
|
685
899
|
if (!open) return;
|
|
686
900
|
const selectedStillExists = backblazeMode || availableOptions.some((option) => option.id === selectedStorageId);
|
|
687
901
|
if (!selectedStillExists) {
|
|
688
902
|
const primary = availableOptions.find((option) => option.role === "primary");
|
|
689
|
-
setSelectedStorageId(primary?.id || "
|
|
903
|
+
setSelectedStorageId(primary?.id || availableOptions[0]?.id || "");
|
|
690
904
|
}
|
|
691
905
|
}, [open, availableOptions, selectedStorageId, backblazeMode]);
|
|
692
906
|
if (!open) return null;
|
|
693
|
-
const selectedOption = availableOptions.find((option) => option.id === selectedStorageId) || LOCAL_STORAGE_OPTION;
|
|
907
|
+
const selectedOption = availableOptions.find((option) => option.id === selectedStorageId) || availableOptions[0] || LOCAL_STORAGE_OPTION;
|
|
908
|
+
const googleDriveConnection = selectedOption.provider === "google_drive" && selectedOption.id !== "google_drive" ? selectedOption : void 0;
|
|
909
|
+
const hiddenFields = new Set(visibility?.hiddenFields || []);
|
|
694
910
|
const userName = currentUser?.username || currentUser?.name || currentUser?.email?.split("@")[0] || "user";
|
|
695
911
|
const folderPreview = formatWorkspaceFolderPreview(appName, userName, name || "workspace");
|
|
696
912
|
const handleSelectBackblaze = async () => {
|
|
697
913
|
setBackblazeMode(true);
|
|
698
|
-
setSelectedStorageId("
|
|
914
|
+
setSelectedStorageId("backblaze_external");
|
|
699
915
|
setBackblazeAccountId("");
|
|
700
916
|
setBackblazeBuckets([]);
|
|
701
917
|
setBackblazeBucketName("");
|
|
@@ -709,7 +925,7 @@ function WorkspaceCreateDialog({
|
|
|
709
925
|
const accounts = await storageService.listBackblazeAccounts(effectiveUserId);
|
|
710
926
|
setBackblazeAccounts(Array.isArray(accounts) ? accounts : []);
|
|
711
927
|
} catch (reason) {
|
|
712
|
-
setError(reason instanceof Error ? reason.message : "Failed to load
|
|
928
|
+
setError(reason instanceof Error ? reason.message : "Failed to load Backblaze accounts.");
|
|
713
929
|
} finally {
|
|
714
930
|
setLoadingBackblazeAccounts(false);
|
|
715
931
|
}
|
|
@@ -736,7 +952,15 @@ function WorkspaceCreateDialog({
|
|
|
736
952
|
return;
|
|
737
953
|
}
|
|
738
954
|
if (backblazeMode && (!backblazeAccountId || !backblazeBucketName)) {
|
|
739
|
-
setError("Select
|
|
955
|
+
setError("Select a Backblaze account and bucket.");
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
if (!backblazeMode && !availableOptions.some((option) => option.id === selectedStorageId)) {
|
|
959
|
+
setError("No visible storage provider is available for this workspace.");
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
if (selectedOption.provider === "google_drive" && (!googleDriveConnection || !googleDriveFolder)) {
|
|
963
|
+
setError("Connect Google Drive and select a folder for this workspace.");
|
|
740
964
|
return;
|
|
741
965
|
}
|
|
742
966
|
if (loadingStorage || loadingBackblazeAccounts || loadingBackblazeBuckets || submitting) return;
|
|
@@ -747,14 +971,18 @@ function WorkspaceCreateDialog({
|
|
|
747
971
|
const option = backblazeMode ? {
|
|
748
972
|
id: backblazeAccountId,
|
|
749
973
|
provider: "backblaze_b2",
|
|
750
|
-
label: backblazeAccount?.name || "
|
|
974
|
+
label: backblazeAccount?.name || "Backblaze B2",
|
|
751
975
|
b2BucketName: backblazeBucketName,
|
|
752
976
|
bucketName: backblazeBucketName,
|
|
753
977
|
b2Endpoint: backblazeAccount?.credentials?.endpoint,
|
|
754
978
|
endpoint: backblazeAccount?.credentials?.endpoint,
|
|
755
979
|
b2Region: backblazeAccount?.credentials?.region,
|
|
756
980
|
region: backblazeAccount?.credentials?.region
|
|
757
|
-
} : selectedOption.provider === "local_fs" ? { ...selectedOption, localFolderName: localFolderName.trim() || selectedOption.localFolderName || name.trim() } : selectedOption
|
|
981
|
+
} : selectedOption.provider === "local_fs" ? { ...selectedOption, localFolderName: localFolderName.trim() || selectedOption.localFolderName || name.trim() } : selectedOption.provider === "google_drive" && googleDriveFolder ? {
|
|
982
|
+
...selectedOption,
|
|
983
|
+
googleRootFolderId: googleDriveFolder.id,
|
|
984
|
+
googleRootFolderName: googleDriveFolder.name
|
|
985
|
+
} : selectedOption;
|
|
758
986
|
await onSubmit(buildWorkspaceCreateInput(name, description, option));
|
|
759
987
|
onClose();
|
|
760
988
|
} catch (reason) {
|
|
@@ -768,7 +996,7 @@ function WorkspaceCreateDialog({
|
|
|
768
996
|
const border = "var(--skipo-border-color, var(--color-border, #383838))";
|
|
769
997
|
const accent = "var(--skipo-accent, var(--color-accent, #d4af37))";
|
|
770
998
|
const muted = "var(--skipo-text-muted, var(--color-text-muted, #999))";
|
|
771
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsx7("div", { className: "fixed inset-0 z-[70] flex items-center justify-center bg-black/75 p-4 backdrop-blur-sm", role: "presentation", children: /* @__PURE__ */ jsxs7(
|
|
772
1000
|
"form",
|
|
773
1001
|
{
|
|
774
1002
|
onSubmit: submit,
|
|
@@ -776,18 +1004,18 @@ function WorkspaceCreateDialog({
|
|
|
776
1004
|
className: "w-full max-w-xl max-h-[90vh] overflow-y-auto border-2 p-5 font-mono shadow-[7px_7px_0px_var(--skipo-border-color,var(--color-border,#383838))]",
|
|
777
1005
|
style: { backgroundColor: surface, borderColor: border },
|
|
778
1006
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-3 border-b pb-3", style: { borderColor: border }, children: [
|
|
1008
|
+
/* @__PURE__ */ jsxs7("div", { children: [
|
|
1009
|
+
/* @__PURE__ */ jsx7("h2", { className: "text-sm font-black uppercase", children: "Create Workspace" }),
|
|
1010
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-1 text-[10px]", style: { color: muted }, children: "Create an isolated workspace and select its persistent storage." })
|
|
783
1011
|
] }),
|
|
784
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ jsx7(HardDrive5, { size: 18, style: { color: accent } })
|
|
785
1013
|
] }),
|
|
786
|
-
error && /* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
1014
|
+
error && /* @__PURE__ */ jsx7("div", { role: "alert", className: "mt-3 border border-red-500 p-2 text-xs text-red-300", children: error }),
|
|
1015
|
+
/* @__PURE__ */ jsxs7("div", { className: "mt-4 space-y-3", children: [
|
|
1016
|
+
/* @__PURE__ */ jsxs7("label", { className: "block space-y-1", children: [
|
|
1017
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", children: "Workspace Name *" }),
|
|
1018
|
+
/* @__PURE__ */ jsx7(
|
|
791
1019
|
"input",
|
|
792
1020
|
{
|
|
793
1021
|
"aria-label": "Workspace name",
|
|
@@ -801,9 +1029,9 @@ function WorkspaceCreateDialog({
|
|
|
801
1029
|
}
|
|
802
1030
|
)
|
|
803
1031
|
] }),
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
/* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
1032
|
+
!hiddenFields.has("description") && /* @__PURE__ */ jsxs7("label", { className: "block space-y-1", children: [
|
|
1033
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", children: "Description" }),
|
|
1034
|
+
/* @__PURE__ */ jsx7(
|
|
807
1035
|
"textarea",
|
|
808
1036
|
{
|
|
809
1037
|
"aria-label": "Workspace description",
|
|
@@ -816,10 +1044,10 @@ function WorkspaceCreateDialog({
|
|
|
816
1044
|
}
|
|
817
1045
|
)
|
|
818
1046
|
] }),
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
|
|
1048
|
+
/* @__PURE__ */ jsx7("label", { htmlFor: "floks-workspace-storage", className: "block text-[10px] font-black uppercase", children: "Persistent Storage" }),
|
|
1049
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
|
|
1050
|
+
/* @__PURE__ */ jsx7(
|
|
823
1051
|
"select",
|
|
824
1052
|
{
|
|
825
1053
|
id: "floks-workspace-storage",
|
|
@@ -832,10 +1060,10 @@ function WorkspaceCreateDialog({
|
|
|
832
1060
|
disabled: loadingStorage || submitting,
|
|
833
1061
|
className: "h-10 min-w-0 flex-1 border px-2 text-xs",
|
|
834
1062
|
style: { backgroundColor: background, borderColor: border },
|
|
835
|
-
children: availableOptions.map((option) => /* @__PURE__ */
|
|
1063
|
+
children: availableOptions.map((option) => /* @__PURE__ */ jsx7("option", { value: option.id, children: providerLabel(option) + " \u2014 " + (option.label || option.name || option.id) }, option.id))
|
|
836
1064
|
}
|
|
837
1065
|
),
|
|
838
|
-
/* @__PURE__ */
|
|
1066
|
+
!hiddenFields.has("backblaze") && /* @__PURE__ */ jsx7(
|
|
839
1067
|
"button",
|
|
840
1068
|
{
|
|
841
1069
|
type: "button",
|
|
@@ -844,15 +1072,15 @@ function WorkspaceCreateDialog({
|
|
|
844
1072
|
"aria-pressed": backblazeMode,
|
|
845
1073
|
className: "shrink-0 border px-3 text-[10px] font-black uppercase disabled:opacity-50",
|
|
846
1074
|
style: { borderColor: backblazeMode ? accent : border, color: backblazeMode ? accent : void 0 },
|
|
847
|
-
children: "Backblaze B2
|
|
1075
|
+
children: "Backblaze B2"
|
|
848
1076
|
}
|
|
849
1077
|
),
|
|
850
|
-
onManageStorage && /* @__PURE__ */
|
|
1078
|
+
!hiddenFields.has("manageStorage") && onManageStorage && /* @__PURE__ */ jsx7("button", { type: "button", onClick: onManageStorage, className: "shrink-0 border px-3 text-[10px] font-black uppercase", style: { borderColor: border }, children: "Manage" })
|
|
851
1079
|
] }),
|
|
852
|
-
backblazeMode && /* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
1080
|
+
!hiddenFields.has("backblaze") && backblazeMode && /* @__PURE__ */ jsxs7("div", { className: "mt-3 space-y-2 border-t pt-3", style: { borderColor: border }, children: [
|
|
1081
|
+
/* @__PURE__ */ jsxs7("label", { className: "block space-y-1", children: [
|
|
1082
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", children: "Backblaze account" }),
|
|
1083
|
+
/* @__PURE__ */ jsxs7(
|
|
856
1084
|
"select",
|
|
857
1085
|
{
|
|
858
1086
|
"aria-label": "Backblaze account",
|
|
@@ -862,16 +1090,16 @@ function WorkspaceCreateDialog({
|
|
|
862
1090
|
className: "h-9 w-full border px-2 text-xs",
|
|
863
1091
|
style: { backgroundColor: background, borderColor: border },
|
|
864
1092
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
backblazeAccounts.map((account) => /* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ jsx7("option", { value: "", children: "Select Backblaze account" }),
|
|
1094
|
+
backblazeAccounts.map((account) => /* @__PURE__ */ jsx7("option", { value: account.id, children: account.name }, account.id))
|
|
867
1095
|
]
|
|
868
1096
|
}
|
|
869
1097
|
),
|
|
870
|
-
loadingBackblazeAccounts && /* @__PURE__ */
|
|
1098
|
+
loadingBackblazeAccounts && /* @__PURE__ */ jsx7("span", { className: "text-[10px]", style: { color: muted }, children: "Loading Backblaze accounts\u2026" })
|
|
871
1099
|
] }),
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ jsxs7("label", { className: "block space-y-1", children: [
|
|
1101
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", children: "Backblaze bucket" }),
|
|
1102
|
+
/* @__PURE__ */ jsxs7(
|
|
875
1103
|
"select",
|
|
876
1104
|
{
|
|
877
1105
|
"aria-label": "Backblaze bucket",
|
|
@@ -881,25 +1109,46 @@ function WorkspaceCreateDialog({
|
|
|
881
1109
|
className: "h-9 w-full border px-2 text-xs",
|
|
882
1110
|
style: { backgroundColor: background, borderColor: border },
|
|
883
1111
|
children: [
|
|
884
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx7("option", { value: "", children: "Select bucket" }),
|
|
885
1113
|
backblazeBuckets.map((bucket) => {
|
|
886
1114
|
const bucketName = bucket.bucketName || bucket.name || "";
|
|
887
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ jsx7("option", { value: bucketName, children: bucketName }, bucket.bucketId || bucket.id || bucketName);
|
|
888
1116
|
})
|
|
889
1117
|
]
|
|
890
1118
|
}
|
|
891
1119
|
),
|
|
892
|
-
loadingBackblazeBuckets && /* @__PURE__ */
|
|
1120
|
+
loadingBackblazeBuckets && /* @__PURE__ */ jsx7("span", { className: "text-[10px]", style: { color: muted }, children: "Loading buckets\u2026" })
|
|
893
1121
|
] })
|
|
894
1122
|
] }),
|
|
895
|
-
loadingStorage ? /* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
1123
|
+
loadingStorage ? /* @__PURE__ */ jsxs7("p", { className: "flex items-center gap-2 text-[10px]", style: { color: muted }, children: [
|
|
1124
|
+
/* @__PURE__ */ jsx7(Loader2, { size: 12, className: "animate-spin" }),
|
|
897
1125
|
" Loading storage connections\u2026"
|
|
898
|
-
] }) : availableOptions.length === 1 && availableOptions[0].provider === "local_fs" ? /* @__PURE__ */
|
|
1126
|
+
] }) : availableOptions.length === 1 && availableOptions[0].provider === "local_fs" ? /* @__PURE__ */ jsx7("p", { className: "text-[10px]", style: { color: muted }, children: "No external storage connection is available yet. Connect an external provider or choose an available connection." }) : /* @__PURE__ */ jsx7("p", { className: "text-[10px]", style: { color: muted }, children: "Cloud storage is selected from connections already authorized for this account." })
|
|
899
1127
|
] }),
|
|
900
|
-
selectedOption.provider === "
|
|
901
|
-
|
|
902
|
-
|
|
1128
|
+
selectedOption.provider === "google_drive" && /* @__PURE__ */ jsx7(
|
|
1129
|
+
GoogleDriveWorkspacePicker,
|
|
1130
|
+
{
|
|
1131
|
+
userId: effectiveUserId,
|
|
1132
|
+
connection: googleDriveConnection,
|
|
1133
|
+
connectGoogleDrive: storageService.connectGoogleDrive,
|
|
1134
|
+
listGoogleDriveFolders: storageService.listGoogleDriveFolders,
|
|
1135
|
+
selectedFolder: googleDriveFolder,
|
|
1136
|
+
onConnected: (connection) => {
|
|
1137
|
+
if (connection.provider !== "google_drive") {
|
|
1138
|
+
setError("The storage service returned a non-Google Drive connection.");
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1141
|
+
setConnectedDriveOption(connection);
|
|
1142
|
+
setSelectedStorageId(connection.id);
|
|
1143
|
+
setGoogleDriveFolder(null);
|
|
1144
|
+
setError(null);
|
|
1145
|
+
},
|
|
1146
|
+
onSelectFolder: setGoogleDriveFolder
|
|
1147
|
+
}
|
|
1148
|
+
),
|
|
1149
|
+
selectedOption.provider === "local_fs" && !hiddenFields.has("localFolderName") && /* @__PURE__ */ jsxs7("label", { className: "block space-y-1", children: [
|
|
1150
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", children: "Local Folder Name" }),
|
|
1151
|
+
/* @__PURE__ */ jsx7(
|
|
903
1152
|
"input",
|
|
904
1153
|
{
|
|
905
1154
|
"aria-label": "Local folder name",
|
|
@@ -911,17 +1160,17 @@ function WorkspaceCreateDialog({
|
|
|
911
1160
|
}
|
|
912
1161
|
)
|
|
913
1162
|
] }),
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
1163
|
+
!hiddenFields.has("canonicalFolderPreview") && /* @__PURE__ */ jsxs7("div", { className: "border p-3", style: { borderColor: border, backgroundColor: background }, children: [
|
|
1164
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1165
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[10px] font-black uppercase", style: { color: accent }, children: "Canonical Workspace Folder" }),
|
|
1166
|
+
/* @__PURE__ */ jsx7("span", { className: "text-[9px] uppercase", style: { color: muted }, children: "Ecosystem Standard" })
|
|
918
1167
|
] }),
|
|
919
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ jsx7("code", { className: "mt-1 block truncate text-xs font-bold text-emerald-400", children: folderPreview })
|
|
920
1169
|
] })
|
|
921
1170
|
] }),
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ jsxs7("div", { className: "mt-5 flex justify-end gap-2 border-t pt-3", style: { borderColor: border }, children: [
|
|
1172
|
+
/* @__PURE__ */ jsx7("button", { type: "button", onClick: onClose, disabled: submitting, className: "h-9 border px-3 text-xs", style: { borderColor: border }, children: "Cancel" }),
|
|
1173
|
+
/* @__PURE__ */ jsx7("button", { type: "submit", disabled: submitting || loadingStorage || loadingBackblazeAccounts || loadingBackblazeBuckets || !name.trim(), className: "h-9 px-4 text-xs font-black uppercase text-black disabled:opacity-50", style: { backgroundColor: accent }, children: submitting ? "Creating\u2026" : "Create Workspace" })
|
|
925
1174
|
] })
|
|
926
1175
|
]
|
|
927
1176
|
}
|
|
@@ -929,11 +1178,11 @@ function WorkspaceCreateDialog({
|
|
|
929
1178
|
}
|
|
930
1179
|
|
|
931
1180
|
// src/components/workspace/WorkspaceTilesMenu.tsx
|
|
932
|
-
import { useId, useMemo as useMemo2, useState as
|
|
1181
|
+
import { useId, useMemo as useMemo2, useState as useState7 } from "react";
|
|
933
1182
|
import { FolderOpen, HardDrive as HardDrive6, Cloud as Cloud5, LogOut } from "lucide-react";
|
|
934
1183
|
import { defineFrnlComponent } from "@ultrst-armada/frnlts";
|
|
935
1184
|
import { useFrnlComponent } from "@ultrst-armada/frnlts/react";
|
|
936
|
-
import { Fragment, jsx as
|
|
1185
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
937
1186
|
var WORKSPACE_TILES_MENU_REQUIRED_SERVICES = ["auth", "workspace", "storage", "srkl"];
|
|
938
1187
|
var workspaceTilesMenuDefinition = defineFrnlComponent({
|
|
939
1188
|
name: "workspaceTilesMenu",
|
|
@@ -964,7 +1213,7 @@ function WorkspaceTilesMenu({
|
|
|
964
1213
|
const effectiveUserId = userId || currentUser?.id || "system";
|
|
965
1214
|
const generated = useId().replace(/[:/]/g, "");
|
|
966
1215
|
const componentId = `workspaceTilesMenu.${generated}`;
|
|
967
|
-
const [creating, setCreating] =
|
|
1216
|
+
const [creating, setCreating] = useState7(false);
|
|
968
1217
|
const handlers = useMemo2(() => ({
|
|
969
1218
|
"workspaceTilesMenu.idle.select": (value) => onSelectWorkspace(value),
|
|
970
1219
|
"workspaceTilesMenu.idle.create": () => setCreating(true),
|
|
@@ -978,12 +1227,12 @@ function WorkspaceTilesMenu({
|
|
|
978
1227
|
properties: { activeWorkspaceId, workspaceCount: workspaces.length },
|
|
979
1228
|
handlers
|
|
980
1229
|
});
|
|
981
|
-
return /* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ jsxs8("section", { id: componentId, "data-frnl-component": "workspaceTilesMenu", "data-frnl-state": frnl.state, className: "space-y-3", children: [
|
|
1231
|
+
/* @__PURE__ */ jsx8("div", { className: "flex justify-end gap-2", children: onLogout && /* @__PURE__ */ jsxs8("button", { type: "button", onClick: () => frnl.events.logout(void 0), className: "h-8 px-3 border border-red-500/60 text-red-300 text-[10px] font-black flex items-center gap-1", children: [
|
|
1232
|
+
/* @__PURE__ */ jsx8(LogOut, { size: 12 }),
|
|
984
1233
|
" LOGOUT"
|
|
985
1234
|
] }) }),
|
|
986
|
-
/* @__PURE__ */
|
|
1235
|
+
/* @__PURE__ */ jsx8(
|
|
987
1236
|
TilesMenu,
|
|
988
1237
|
{
|
|
989
1238
|
id: componentId + ".tiles",
|
|
@@ -995,27 +1244,27 @@ function WorkspaceTilesMenu({
|
|
|
995
1244
|
createLabel: "NEW WORKSPACE",
|
|
996
1245
|
onSelect: (ws) => frnl.events.select(ws),
|
|
997
1246
|
onCreate: () => frnl.events.create(void 0),
|
|
998
|
-
renderTile: (ws, selected) => /* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
ws.storageProvider === "backblaze_b2" ? /* @__PURE__ */
|
|
1247
|
+
renderTile: (ws, selected) => /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1248
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 text-xs font-black uppercase", children: [
|
|
1249
|
+
ws.storageProvider === "backblaze_b2" ? /* @__PURE__ */ jsx8(Cloud5, { size: 14 }) : /* @__PURE__ */ jsx8(HardDrive6, { size: 14 }),
|
|
1001
1250
|
ws.title || ws.name || "Workspace"
|
|
1002
1251
|
] }),
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx8("p", { className: "mt-2 text-[11px] text-[var(--skipo-text-muted)]", children: ws.description }),
|
|
1253
|
+
/* @__PURE__ */ jsxs8("div", { className: `mt-2 text-[10px] ${selected || ws.id === activeWorkspaceId ? "text-[var(--skipo-accent)]" : "text-[var(--skipo-text-muted)]"}`, children: [
|
|
1254
|
+
/* @__PURE__ */ jsx8(FolderOpen, { size: 11, className: "inline mr-1" }),
|
|
1006
1255
|
ws.workspacePath ?? ws.b2BucketName ?? ws.localFolderName ?? ws.id
|
|
1007
1256
|
] })
|
|
1008
1257
|
] })
|
|
1009
1258
|
}
|
|
1010
1259
|
),
|
|
1011
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ jsx8(WorkspaceCreateDialog, { open: creating, userId: effectiveUserId, currentUser, appName, storageOptions, storageService, onManageStorage, onClose: () => setCreating(false), onSubmit: onCreateWorkspace })
|
|
1012
1261
|
] });
|
|
1013
1262
|
}
|
|
1014
1263
|
|
|
1015
1264
|
// src/components/workspace/WorkspaceGate.tsx
|
|
1016
1265
|
import { useMemo as useMemo3 } from "react";
|
|
1017
1266
|
import { LogOut as LogOut2, ArrowLeft } from "lucide-react";
|
|
1018
|
-
import { jsx as
|
|
1267
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1019
1268
|
var WorkspaceGate = ({
|
|
1020
1269
|
workspaces,
|
|
1021
1270
|
activeWorkspaceId,
|
|
@@ -1051,45 +1300,45 @@ var WorkspaceGate = ({
|
|
|
1051
1300
|
}));
|
|
1052
1301
|
}, [workspaces]);
|
|
1053
1302
|
const effectiveUserId = userId || currentUser?.id || "system";
|
|
1054
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ jsx9(
|
|
1055
1304
|
"div",
|
|
1056
1305
|
{
|
|
1057
1306
|
className: "min-h-screen h-screen w-screen bg-[var(--skipo-bg,#0b0e17)] text-[var(--skipo-text,#f8fafc)] font-mono p-6 sm:p-8 flex flex-col items-center justify-center overflow-auto",
|
|
1058
1307
|
style: { minHeight: "100vh", height: "100vh", width: "100vw" },
|
|
1059
|
-
children: /* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
-
/* @__PURE__ */
|
|
1308
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "w-full max-w-4xl my-auto", children: [
|
|
1309
|
+
/* @__PURE__ */ jsxs9("header", { className: "mb-6 flex items-center justify-between border-b border-[var(--skipo-border-color,#1e293b)] pb-4", children: [
|
|
1310
|
+
/* @__PURE__ */ jsxs9("div", { children: [
|
|
1311
|
+
/* @__PURE__ */ jsx9("h1", { className: "text-2xl font-black tracking-wider text-[var(--skipo-accent,#f59e0b)] uppercase", children: appName }),
|
|
1312
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--skipo-text-muted,#94a3b8)] font-mono tracking-tight mt-0.5", children: appSubtitle })
|
|
1064
1313
|
] }),
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
canClose && onClose && /* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
1315
|
+
canClose && onClose && /* @__PURE__ */ jsxs9(
|
|
1067
1316
|
"button",
|
|
1068
1317
|
{
|
|
1069
1318
|
type: "button",
|
|
1070
1319
|
onClick: onClose,
|
|
1071
1320
|
className: "h-8 px-3 border border-[var(--skipo-border-color,#1e293b)] hover:border-[var(--skipo-accent,#f59e0b)] text-[var(--skipo-text-muted)] hover:text-[var(--skipo-text)] text-[10px] font-black flex items-center gap-1.5 transition-colors",
|
|
1072
1321
|
children: [
|
|
1073
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ jsx9(ArrowLeft, { size: 13 }),
|
|
1074
1323
|
" BACK TO APP"
|
|
1075
1324
|
]
|
|
1076
1325
|
}
|
|
1077
1326
|
),
|
|
1078
|
-
onLogout && /* @__PURE__ */
|
|
1327
|
+
onLogout && /* @__PURE__ */ jsxs9(
|
|
1079
1328
|
"button",
|
|
1080
1329
|
{
|
|
1081
1330
|
type: "button",
|
|
1082
1331
|
onClick: onLogout,
|
|
1083
1332
|
className: "h-8 px-3 border border-red-500/60 hover:bg-red-950/20 text-red-300 text-[10px] font-black flex items-center gap-1.5 transition-colors",
|
|
1084
1333
|
children: [
|
|
1085
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ jsx9(LogOut2, { size: 12 }),
|
|
1086
1335
|
" LOGOUT"
|
|
1087
1336
|
]
|
|
1088
1337
|
}
|
|
1089
1338
|
)
|
|
1090
1339
|
] })
|
|
1091
1340
|
] }),
|
|
1092
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx9(
|
|
1093
1342
|
WorkspaceTilesMenu,
|
|
1094
1343
|
{
|
|
1095
1344
|
workspaces: normalizedWorkspaces,
|
|
@@ -1118,6 +1367,8 @@ export {
|
|
|
1118
1367
|
StorageOptionTiles,
|
|
1119
1368
|
WorkspaceStorageReadonlyPanel,
|
|
1120
1369
|
WorkspaceSecondaryClonesPanel,
|
|
1370
|
+
describeGoogleDriveError,
|
|
1371
|
+
GoogleDriveWorkspacePicker,
|
|
1121
1372
|
formatWorkspaceFolderPreview,
|
|
1122
1373
|
buildWorkspaceCreateInput,
|
|
1123
1374
|
defaultWorkspaceStorageService,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface GoogleDriveConnection {
|
|
3
|
+
id: string;
|
|
4
|
+
provider?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
googleEmail?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GoogleDriveFolder {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
mimeType?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GoogleDriveWorkspacePickerProps {
|
|
15
|
+
userId: string;
|
|
16
|
+
connection?: GoogleDriveConnection;
|
|
17
|
+
connectGoogleDrive?: (userId: string) => Promise<GoogleDriveConnection>;
|
|
18
|
+
listGoogleDriveFolders?: (connectionId: string, parentFolderId?: string) => Promise<GoogleDriveFolder[]>;
|
|
19
|
+
onConnected: (connection: GoogleDriveConnection) => void;
|
|
20
|
+
onSelectFolder: (folder: GoogleDriveFolder) => void;
|
|
21
|
+
selectedFolder?: GoogleDriveFolder | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function describeGoogleDriveError(error: unknown): string;
|
|
24
|
+
/**
|
|
25
|
+
* Presents the Google OAuth connection and folder-selection experience.
|
|
26
|
+
*
|
|
27
|
+
* OAuth, token exchange, refresh, and credential persistence deliberately remain
|
|
28
|
+
* behind the injected storage service. This component never collects Google
|
|
29
|
+
* credentials or handles OAuth client IDs, client secrets, or access tokens.
|
|
30
|
+
*/
|
|
31
|
+
export declare function GoogleDriveWorkspacePicker({ userId, connection, connectGoogleDrive, listGoogleDriveFolders, onConnected, onSelectFolder, selectedFolder, }: GoogleDriveWorkspacePickerProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type GoogleDriveFolder } from './GoogleDriveWorkspacePicker.js';
|
|
2
3
|
export type WorkspaceStorageProvider = 'local_fs' | 'backblaze_b2' | 'google_drive' | 'cloudflare_r2' | 'aws_s3' | 'supabase_storage' | (string & {});
|
|
3
4
|
export interface BackblazeBucket {
|
|
4
5
|
id?: string;
|
|
@@ -69,6 +70,17 @@ export interface WorkspaceStorageService {
|
|
|
69
70
|
listStorageConnections?: (userId: string) => Promise<WorkspaceStorageOption[]>;
|
|
70
71
|
listBackblazeAccounts?: (userId: string) => Promise<BackblazeAccount[]>;
|
|
71
72
|
listBackblazeBuckets?: (accountId: string, userId?: string) => Promise<BackblazeBucket[]>;
|
|
73
|
+
connectGoogleDrive?: (userId: string) => Promise<WorkspaceStorageOption>;
|
|
74
|
+
listGoogleDriveFolders?: (connectionId: string, parentFolderId?: string) => Promise<GoogleDriveFolder[]>;
|
|
75
|
+
}
|
|
76
|
+
export type WorkspaceCreateDialogHiddenField = 'description' | 'localFolderName' | 'manageStorage' | 'backblaze' | 'canonicalFolderPreview';
|
|
77
|
+
export interface WorkspaceCreateDialogVisibility {
|
|
78
|
+
/** Whitelist of storage providers to render. Unspecified means all providers. */
|
|
79
|
+
availableStorageProviders?: WorkspaceStorageProvider[];
|
|
80
|
+
/** Providers hidden even when included in availableStorageProviders. */
|
|
81
|
+
hiddenStorageProviders?: WorkspaceStorageProvider[];
|
|
82
|
+
/** Optional generic fields/sections to hide from the shared dialog. */
|
|
83
|
+
hiddenFields?: WorkspaceCreateDialogHiddenField[];
|
|
72
84
|
}
|
|
73
85
|
export interface WorkspaceCreateDialogProps {
|
|
74
86
|
open: boolean;
|
|
@@ -82,6 +94,7 @@ export interface WorkspaceCreateDialogProps {
|
|
|
82
94
|
appName?: string;
|
|
83
95
|
storageOptions?: WorkspaceStorageOption[];
|
|
84
96
|
storageService?: WorkspaceStorageService;
|
|
97
|
+
visibility?: WorkspaceCreateDialogVisibility;
|
|
85
98
|
onManageStorage?: () => void;
|
|
86
99
|
onClose: () => void;
|
|
87
100
|
onSubmit: (input: WorkspaceCreateInput) => Promise<void> | void;
|
|
@@ -92,5 +105,13 @@ export declare const defaultWorkspaceStorageService: WorkspaceStorageService;
|
|
|
92
105
|
export interface KloksServiceInvoker {
|
|
93
106
|
invoke: (serviceId: string, operation: string, input: Record<string, unknown>) => Promise<unknown>;
|
|
94
107
|
}
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Drive operations are intentionally supplied by the canonical Kloks storage
|
|
110
|
+
* service. Floks does not implement OAuth, exchange codes, or store Drive tokens.
|
|
111
|
+
*/
|
|
112
|
+
export interface KloksGoogleDriveWorkspaceApi {
|
|
113
|
+
connectGoogleDrive: (userId: string) => Promise<WorkspaceStorageOption>;
|
|
114
|
+
listGoogleDriveFolders: (connectionId: string, parentFolderId?: string) => Promise<GoogleDriveFolder[]>;
|
|
115
|
+
}
|
|
116
|
+
export declare function createKloksWorkspaceStorageService(invoker: KloksServiceInvoker, googleDrive?: KloksGoogleDriveWorkspaceApi): WorkspaceStorageService;
|
|
117
|
+
export declare function WorkspaceCreateDialog({ open, userId, currentUser, appName, storageOptions, storageService, visibility, onManageStorage, onClose, onSubmit, }: WorkspaceCreateDialogProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
GoogleDriveWorkspacePicker,
|
|
2
3
|
SrklBackblazeTile,
|
|
3
4
|
StorageOptionTiles,
|
|
4
5
|
StoragePresetTile,
|
|
@@ -11,12 +12,14 @@ import {
|
|
|
11
12
|
buildWorkspaceCreateInput,
|
|
12
13
|
createKloksWorkspaceStorageService,
|
|
13
14
|
defaultWorkspaceStorageService,
|
|
15
|
+
describeGoogleDriveError,
|
|
14
16
|
formatWorkspaceFolderPreview,
|
|
15
17
|
workspaceTilesMenuDefinition
|
|
16
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-YQL4AGPU.js";
|
|
17
19
|
import "../../chunk-DZTJJOLR.js";
|
|
18
20
|
import "../../chunk-B4XTM5TI.js";
|
|
19
21
|
export {
|
|
22
|
+
GoogleDriveWorkspacePicker,
|
|
20
23
|
SrklBackblazeTile,
|
|
21
24
|
StorageOptionTiles,
|
|
22
25
|
StoragePresetTile,
|
|
@@ -29,6 +32,7 @@ export {
|
|
|
29
32
|
buildWorkspaceCreateInput,
|
|
30
33
|
createKloksWorkspaceStorageService,
|
|
31
34
|
defaultWorkspaceStorageService,
|
|
35
|
+
describeGoogleDriveError,
|
|
32
36
|
formatWorkspaceFolderPreview,
|
|
33
37
|
workspaceTilesMenuDefinition
|
|
34
38
|
};
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
MusicalTimeline
|
|
8
8
|
} from "./chunk-HXTM3RSQ.js";
|
|
9
9
|
import {
|
|
10
|
+
GoogleDriveWorkspacePicker,
|
|
10
11
|
SrklBackblazeTile,
|
|
11
12
|
StorageOptionTiles,
|
|
12
13
|
StoragePresetTile,
|
|
@@ -19,9 +20,10 @@ import {
|
|
|
19
20
|
buildWorkspaceCreateInput,
|
|
20
21
|
createKloksWorkspaceStorageService,
|
|
21
22
|
defaultWorkspaceStorageService,
|
|
23
|
+
describeGoogleDriveError,
|
|
22
24
|
formatWorkspaceFolderPreview,
|
|
23
25
|
workspaceTilesMenuDefinition
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YQL4AGPU.js";
|
|
25
27
|
import {
|
|
26
28
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
27
29
|
AuthLoadingScreen,
|
|
@@ -325,6 +327,7 @@ export {
|
|
|
325
327
|
FrnlStoreProvider,
|
|
326
328
|
GRAPHS_MENU_REQUIRED_SERVICES,
|
|
327
329
|
GhostButton,
|
|
330
|
+
GoogleDriveWorkspacePicker,
|
|
328
331
|
GoogleIcon,
|
|
329
332
|
GoogleSignInButton,
|
|
330
333
|
GraphsMenu,
|
|
@@ -425,6 +428,7 @@ export {
|
|
|
425
428
|
createLuthAuthClientForApplication,
|
|
426
429
|
defaultWorkspaceStorageService,
|
|
427
430
|
depmThemeSocket,
|
|
431
|
+
describeGoogleDriveError,
|
|
428
432
|
floksFrnlFrontendApi,
|
|
429
433
|
floksFrnlStore,
|
|
430
434
|
formatWorkspaceFolderPreview,
|
package/packages/ui/package.json
CHANGED