@ultrst-armada/floks 1.13.14 → 1.13.16
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/README.md +40 -0
- package/package.json +3 -4
- package/packages/canvas-ui/dist/index.js +6 -6
- package/packages/canvas-ui/package.json +1 -1
- package/packages/ui/dist/{chunk-KTLNNJFX.js → chunk-3YYPBZS2.js} +302 -189
- package/packages/ui/dist/components/auth/index.d.ts +59 -10
- package/packages/ui/dist/components/auth/index.js +15 -3
- package/packages/ui/dist/index.d.ts +2 -3
- package/packages/ui/dist/index.js +62 -50
- package/packages/ui/package.json +4 -4
|
@@ -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.16",
|
|
5
|
+
"sourceCommit": "51924a39b469fc8531cf01a13532e786c4a3657a",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "42103187012"
|
|
8
8
|
}
|
package/README.md
CHANGED
|
@@ -10,3 +10,43 @@ Floks is the canonical concrete frontend element library built on FrnlTS. FrnlTS
|
|
|
10
10
|
- Shared runtime: Floks UI assets use the canonical FrnlTS Zustand store and Frnl semantic boundaries.
|
|
11
11
|
|
|
12
12
|
FrnlTS is consumed as the published @dinilmusick/frnlts package. Floks owns the concrete UI vocabulary; FrnlTS owns the semantic model.
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Canonical Luth authentication
|
|
16
|
+
|
|
17
|
+
Floks authentication is integrated with the public Kloks client facade. Applications configure their Luth ecosystem and application identity; Luth remains the sole identity and session authority.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { LuthAuthPage, LuthProtectedRoute } from '@ultrst-armada/floks/auth';
|
|
21
|
+
|
|
22
|
+
export function App() {
|
|
23
|
+
return (
|
|
24
|
+
<LuthProtectedRoute
|
|
25
|
+
ecosystemId="your-ecosystem"
|
|
26
|
+
applicationId="your-application"
|
|
27
|
+
appName="Your Application"
|
|
28
|
+
appSubtitle="Sign in to continue"
|
|
29
|
+
>
|
|
30
|
+
{({ user, signOut }) => (
|
|
31
|
+
<main>
|
|
32
|
+
<p>Signed in as {user?.email}</p>
|
|
33
|
+
<button onClick={() => void signOut()}>Sign out</button>
|
|
34
|
+
</main>
|
|
35
|
+
)}
|
|
36
|
+
</LuthProtectedRoute>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// For a standalone sign-in page:
|
|
41
|
+
export function SignInPage() {
|
|
42
|
+
return (
|
|
43
|
+
<LuthAuthPage
|
|
44
|
+
ecosystemId="your-ecosystem"
|
|
45
|
+
applicationId="your-application"
|
|
46
|
+
appName="Your Application"
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The integrated API provides email login, registration, Google sign-in, session hydration and restoration, focus/online revalidation, logout, error handling, and protected-route gating. Consumers do not receive or persist bearer tokens. The runtime dependency is `@ultrst-armada/kloks`; GutTS is consumed transitively through Kloks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultrst-armada/floks",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"d3-force": "^3.0.0",
|
|
85
85
|
"zod": "^3.24.1",
|
|
86
86
|
"zustand": "^5.0.3",
|
|
87
|
-
"@
|
|
87
|
+
"@ultrst-armada/kloks": "^1.25.0",
|
|
88
|
+
"@dinilmusick/gutts": "^1.5.0"
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
90
|
-
"@ultrst-armada/kloks": "^1.17.0",
|
|
91
91
|
"lucide-react": ">=0.300.0",
|
|
92
92
|
"react": "^18.0.0 || ^19.0.0",
|
|
93
93
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"@types/node": "^22.0.0",
|
|
99
99
|
"@types/react": "^19.0.0",
|
|
100
100
|
"@types/react-dom": "^19.0.0",
|
|
101
|
-
"@ultrst-armada/kloks": "^1.24.8",
|
|
102
101
|
"@ultrst-armada/frnlts": "^0.5.5",
|
|
103
102
|
"happy-dom": "^21.0.3",
|
|
104
103
|
"lucide-react": "^1.55.0",
|
|
@@ -14,12 +14,6 @@ import {
|
|
|
14
14
|
useCanvas2DCoordinates,
|
|
15
15
|
useCanvas2DMagnetic
|
|
16
16
|
} from "./chunk-XVAHT5WE.js";
|
|
17
|
-
import {
|
|
18
|
-
Tile,
|
|
19
|
-
TileCreateButton,
|
|
20
|
-
TileGrid,
|
|
21
|
-
useTileMenu
|
|
22
|
-
} from "./chunk-SA3JADUG.js";
|
|
23
17
|
import {
|
|
24
18
|
PredictiveGhostNodeCard,
|
|
25
19
|
PredictiveHudToolbar,
|
|
@@ -35,6 +29,12 @@ import {
|
|
|
35
29
|
getSocketScreenPosition,
|
|
36
30
|
renderSpriteIcon
|
|
37
31
|
} from "./chunk-U2SC3RMJ.js";
|
|
32
|
+
import {
|
|
33
|
+
Tile,
|
|
34
|
+
TileCreateButton,
|
|
35
|
+
TileGrid,
|
|
36
|
+
useTileMenu
|
|
37
|
+
} from "./chunk-SA3JADUG.js";
|
|
38
38
|
import {
|
|
39
39
|
AikoModule
|
|
40
40
|
} from "./chunk-OHAFLB3O.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-A2CDQISJ.js";
|
|
14
14
|
|
|
15
15
|
// src/components/auth/AuthPage.tsx
|
|
16
|
-
import React, { useId, useMemo, useState } from "react";
|
|
16
|
+
import React, { useEffect, useId, useMemo, useState } from "react";
|
|
17
17
|
import { LogIn, UserPlus, Eye, EyeOff, Shield, ArrowRight, AlertCircle } from "lucide-react";
|
|
18
18
|
|
|
19
19
|
// src/components/auth/GoogleSignInButton.tsx
|
|
@@ -92,7 +92,8 @@ var AuthPage = ({
|
|
|
92
92
|
onSuccess,
|
|
93
93
|
onGoogleSignIn,
|
|
94
94
|
enableGoogleSignIn = true,
|
|
95
|
-
onSwitchToAdmin
|
|
95
|
+
onSwitchToAdmin,
|
|
96
|
+
authError
|
|
96
97
|
}) => {
|
|
97
98
|
const store = useFloksFrnlStore();
|
|
98
99
|
const generated = useId().replace(/[:/]/g, "");
|
|
@@ -108,6 +109,9 @@ var AuthPage = ({
|
|
|
108
109
|
const [iconError, setIconError] = useState(false);
|
|
109
110
|
const iconSrc = typeof appIcon === "string" ? appIcon : "/src/frontend/assets/app-icon.svg";
|
|
110
111
|
const emailValid = email.trim() === "" || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.trim());
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
setError(authError ?? null);
|
|
114
|
+
}, [authError]);
|
|
111
115
|
const handlers = useMemo(() => ({
|
|
112
116
|
"AuthPage.idle.login": () => {
|
|
113
117
|
},
|
|
@@ -266,206 +270,309 @@ var AuthLoadingScreen = ({
|
|
|
266
270
|
);
|
|
267
271
|
|
|
268
272
|
// src/components/auth/LoginModal.tsx
|
|
269
|
-
import { useState as
|
|
270
|
-
import { ArrowRight as ArrowRight2,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
273
|
+
import { useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
|
|
274
|
+
import { ArrowRight as ArrowRight2, AlertCircle as AlertCircle2 } from "lucide-react";
|
|
275
|
+
|
|
276
|
+
// src/components/auth/LuthAuthPage.tsx
|
|
277
|
+
import { useCallback, useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
278
|
+
|
|
279
|
+
// src/components/auth/LuthAuthClient.ts
|
|
280
|
+
import {
|
|
281
|
+
resolveClientOrigin,
|
|
282
|
+
resolveClientEnvironment
|
|
283
|
+
} from "@ultrst-armada/kloks/auth";
|
|
284
|
+
import {
|
|
285
|
+
DEFAULT_LUTH_URL,
|
|
286
|
+
LuthAuthClient,
|
|
287
|
+
createLuthAuthClient
|
|
288
|
+
} from "@ultrst-armada/kloks/auth";
|
|
289
|
+
import { LuthAuthError } from "@ultrst-armada/kloks/auth";
|
|
290
|
+
var resolveLuthOrigin = resolveClientOrigin;
|
|
291
|
+
var resolveLuthEnvironment = resolveClientEnvironment;
|
|
292
|
+
|
|
293
|
+
// src/components/auth/LuthAuthPage.tsx
|
|
294
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
295
|
+
function createLuthAuthClientForApplication(input) {
|
|
296
|
+
return createLuthAuthClient({
|
|
297
|
+
ecosystemId: input.ecosystemId,
|
|
298
|
+
applicationId: input.applicationId,
|
|
299
|
+
...input.luthUrl ? { luthUrl: input.luthUrl } : {},
|
|
300
|
+
...input.origin ? { origin: input.origin } : {}
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
function useLuthAuth(config) {
|
|
304
|
+
const client = useMemo2(
|
|
305
|
+
() => createLuthAuthClientForApplication(config),
|
|
306
|
+
[config.ecosystemId, config.applicationId, config.luthUrl, config.origin]
|
|
307
|
+
);
|
|
308
|
+
const [session, setSession] = useState2({ authenticated: false });
|
|
309
|
+
const [loading, setLoading] = useState2(true);
|
|
310
|
+
const [initializing, setInitializing] = useState2(true);
|
|
285
311
|
const [error, setError] = useState2(null);
|
|
286
|
-
const
|
|
287
|
-
|
|
312
|
+
const refresh = useCallback(async (options = {}) => {
|
|
313
|
+
if (!options.silent) setLoading(true);
|
|
288
314
|
setError(null);
|
|
315
|
+
try {
|
|
316
|
+
const next = await client.getSession();
|
|
317
|
+
setSession(next);
|
|
318
|
+
return next;
|
|
319
|
+
} catch (cause) {
|
|
320
|
+
const message = cause instanceof Error ? cause.message : "Unable to retrieve the Luth session.";
|
|
321
|
+
setError(message);
|
|
322
|
+
throw cause;
|
|
323
|
+
} finally {
|
|
324
|
+
if (!options.silent) setLoading(false);
|
|
325
|
+
setInitializing(false);
|
|
326
|
+
}
|
|
327
|
+
}, [client]);
|
|
328
|
+
useEffect2(() => {
|
|
329
|
+
void refresh().catch(() => void 0);
|
|
330
|
+
if (typeof window === "undefined") return;
|
|
331
|
+
const revalidate = () => {
|
|
332
|
+
void refresh({ silent: true }).catch(() => void 0);
|
|
333
|
+
};
|
|
334
|
+
window.addEventListener("focus", revalidate);
|
|
335
|
+
window.addEventListener("online", revalidate);
|
|
336
|
+
return () => {
|
|
337
|
+
window.removeEventListener("focus", revalidate);
|
|
338
|
+
window.removeEventListener("online", revalidate);
|
|
339
|
+
};
|
|
340
|
+
}, [refresh]);
|
|
341
|
+
const signIn = useCallback(async (credentials) => {
|
|
342
|
+
await client.signInWithEmail(credentials);
|
|
343
|
+
return refresh();
|
|
344
|
+
}, [client, refresh]);
|
|
345
|
+
const signUp = useCallback(async (input) => {
|
|
346
|
+
await client.signUpWithEmail(input);
|
|
347
|
+
return refresh();
|
|
348
|
+
}, [client, refresh]);
|
|
349
|
+
const signInWithGoogle = useCallback(
|
|
350
|
+
(callbackURL) => client.signInWithGoogle(callbackURL ? { callbackURL } : void 0),
|
|
351
|
+
[client]
|
|
352
|
+
);
|
|
353
|
+
const signOut = useCallback(async () => {
|
|
289
354
|
setLoading(true);
|
|
355
|
+
setError(null);
|
|
290
356
|
try {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
});
|
|
298
|
-
const data = await res.json().catch(() => ({}));
|
|
299
|
-
if (!res.ok || !data.success || !data.user) {
|
|
300
|
-
throw new Error(data.error || "Authentication failed. Please verify credentials.");
|
|
301
|
-
}
|
|
302
|
-
const token = data.token || `usr_${Date.now()}`;
|
|
303
|
-
if (typeof window !== "undefined") {
|
|
304
|
-
localStorage.setItem("skipo_auth_token", token);
|
|
305
|
-
localStorage.setItem("skipo_user", JSON.stringify(data.user));
|
|
306
|
-
}
|
|
307
|
-
onSuccess(data.user, token);
|
|
308
|
-
} catch (err) {
|
|
309
|
-
setError(err.message || "Server error. Authentication failed.");
|
|
357
|
+
await client.signOut();
|
|
358
|
+
setSession({ authenticated: false });
|
|
359
|
+
} catch (cause) {
|
|
360
|
+
const message = cause instanceof Error ? cause.message : "Luth sign-out failed.";
|
|
361
|
+
setError(message);
|
|
362
|
+
throw cause;
|
|
310
363
|
} finally {
|
|
311
364
|
setLoading(false);
|
|
312
365
|
}
|
|
366
|
+
}, [client]);
|
|
367
|
+
return { client, session, user: session.user, loading, initializing, error, refresh, signIn, signUp, signInWithGoogle, signOut };
|
|
368
|
+
}
|
|
369
|
+
var LuthAuthPage = ({
|
|
370
|
+
ecosystemId,
|
|
371
|
+
applicationId,
|
|
372
|
+
luthUrl,
|
|
373
|
+
origin,
|
|
374
|
+
onAuthenticated,
|
|
375
|
+
onSuccess,
|
|
376
|
+
authenticatedContent,
|
|
377
|
+
unauthenticatedContent,
|
|
378
|
+
loadingContent,
|
|
379
|
+
...presentation
|
|
380
|
+
}) => {
|
|
381
|
+
const auth = useLuthAuth({ ecosystemId, applicationId, luthUrl, origin });
|
|
382
|
+
const onAuthenticatedRef = useRef(onAuthenticated);
|
|
383
|
+
const notifiedUserId = useRef(null);
|
|
384
|
+
useEffect2(() => {
|
|
385
|
+
onAuthenticatedRef.current = onAuthenticated;
|
|
386
|
+
}, [onAuthenticated]);
|
|
387
|
+
useEffect2(() => {
|
|
388
|
+
if (!auth.session.authenticated) {
|
|
389
|
+
notifiedUserId.current = null;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (auth.user && notifiedUserId.current !== auth.user.id) {
|
|
393
|
+
notifiedUserId.current = auth.user.id;
|
|
394
|
+
onAuthenticatedRef.current?.(auth.user);
|
|
395
|
+
}
|
|
396
|
+
}, [auth.session.authenticated, auth.user]);
|
|
397
|
+
const toResult = (session) => {
|
|
398
|
+
if (!session.authenticated || !session.user) return { success: false, error: "Luth did not establish an authenticated session." };
|
|
399
|
+
return { success: true, user: session.user };
|
|
313
400
|
};
|
|
401
|
+
if (auth.initializing) return /* @__PURE__ */ jsx4(Fragment2, { children: loadingContent ?? /* @__PURE__ */ jsx4(AuthLoadingScreen, { label: "CONNECTING TO LUTH..." }) });
|
|
402
|
+
if (auth.session.authenticated && auth.user) {
|
|
403
|
+
if (typeof authenticatedContent === "function") return /* @__PURE__ */ jsx4(Fragment2, { children: authenticatedContent(auth) });
|
|
404
|
+
return authenticatedContent ?? /* @__PURE__ */ jsxs4("div", { "data-frnl-component": "LuthAuthenticatedView", className: "min-h-screen flex flex-col items-center justify-center gap-4 bg-[var(--skipo-bg)] text-[var(--skipo-text)] font-mono", children: [
|
|
405
|
+
/* @__PURE__ */ jsxs4("span", { className: "text-xs", children: [
|
|
406
|
+
"SIGNED IN AS ",
|
|
407
|
+
auth.user.email
|
|
408
|
+
] }),
|
|
409
|
+
auth.error && /* @__PURE__ */ jsx4("p", { role: "alert", children: auth.error }),
|
|
410
|
+
/* @__PURE__ */ jsx4("button", { type: "button", onClick: () => {
|
|
411
|
+
void auth.signOut();
|
|
412
|
+
}, className: "border px-4 py-2 text-xs", children: "SIGN OUT" })
|
|
413
|
+
] });
|
|
414
|
+
}
|
|
415
|
+
if (unauthenticatedContent) return /* @__PURE__ */ jsx4(Fragment2, { children: unauthenticatedContent });
|
|
314
416
|
return /* @__PURE__ */ jsx4(
|
|
315
|
-
|
|
417
|
+
AuthPage,
|
|
316
418
|
{
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
type: "text",
|
|
345
|
-
value: name,
|
|
346
|
-
onChange: (e) => setName(e.target.value),
|
|
347
|
-
placeholder: "Developer Name",
|
|
348
|
-
required: isRegister
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
] }),
|
|
352
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
353
|
-
/* @__PURE__ */ jsx4("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Email Address *" }),
|
|
354
|
-
/* @__PURE__ */ jsx4(
|
|
355
|
-
BaseInput,
|
|
356
|
-
{
|
|
357
|
-
type: "email",
|
|
358
|
-
value: email,
|
|
359
|
-
onChange: (e) => setEmail(e.target.value),
|
|
360
|
-
placeholder: "user@example.com",
|
|
361
|
-
required: true
|
|
362
|
-
}
|
|
363
|
-
)
|
|
364
|
-
] }),
|
|
365
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
366
|
-
/* @__PURE__ */ jsx4("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Password *" }),
|
|
367
|
-
/* @__PURE__ */ jsx4(
|
|
368
|
-
BaseInput,
|
|
369
|
-
{
|
|
370
|
-
type: "password",
|
|
371
|
-
value: password,
|
|
372
|
-
onChange: (e) => setPassword(e.target.value),
|
|
373
|
-
placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
|
|
374
|
-
required: true
|
|
375
|
-
}
|
|
376
|
-
)
|
|
377
|
-
] }),
|
|
378
|
-
/* @__PURE__ */ jsx4("div", { className: "pt-2", children: /* @__PURE__ */ jsxs4(
|
|
379
|
-
BaseButton,
|
|
380
|
-
{
|
|
381
|
-
variant: "accent",
|
|
382
|
-
size: "md",
|
|
383
|
-
type: "submit",
|
|
384
|
-
disabled: loading,
|
|
385
|
-
className: "w-full flex items-center justify-center gap-2",
|
|
386
|
-
children: [
|
|
387
|
-
/* @__PURE__ */ jsx4("span", { children: loading ? "AUTHENTICATING..." : isRegister ? "REGISTER & ENTER" : "SIGN IN" }),
|
|
388
|
-
/* @__PURE__ */ jsx4(ArrowRight2, { size: 14 })
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
|
-
) })
|
|
392
|
-
] }),
|
|
393
|
-
enableGoogleSignIn !== false && /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
|
|
394
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 text-[9px] text-[var(--skipo-text-muted)]", children: [
|
|
395
|
-
/* @__PURE__ */ jsx4("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" }),
|
|
396
|
-
" OR ",
|
|
397
|
-
/* @__PURE__ */ jsx4("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" })
|
|
398
|
-
] }),
|
|
399
|
-
/* @__PURE__ */ jsx4(
|
|
400
|
-
GoogleSignInButton,
|
|
401
|
-
{
|
|
402
|
-
disabled: loading || googleLoading,
|
|
403
|
-
loading: googleLoading,
|
|
404
|
-
onSignIn: async () => {
|
|
405
|
-
setGoogleLoading(true);
|
|
406
|
-
setError(null);
|
|
407
|
-
try {
|
|
408
|
-
if (onGoogleSignIn) {
|
|
409
|
-
await onGoogleSignIn();
|
|
410
|
-
} else {
|
|
411
|
-
const res = await fetch("/api/auth/sign-in/social", {
|
|
412
|
-
method: "POST",
|
|
413
|
-
headers: { "Content-Type": "application/json" },
|
|
414
|
-
body: JSON.stringify({ provider: "google", callbackURL: window.location.origin })
|
|
415
|
-
});
|
|
416
|
-
if (res.ok) {
|
|
417
|
-
const data = await res.json().catch(() => ({}));
|
|
418
|
-
if (data.url) {
|
|
419
|
-
window.location.href = data.url;
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
throw new Error("Google sign-in endpoint unavailable.");
|
|
424
|
-
}
|
|
425
|
-
} catch (err) {
|
|
426
|
-
setError(err.message || "Google sign-in failed.");
|
|
427
|
-
} finally {
|
|
428
|
-
setGoogleLoading(false);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
)
|
|
433
|
-
] }),
|
|
434
|
-
/* @__PURE__ */ jsxs4("div", { className: "pt-2 border-t border-[var(--skipo-border-color)]/60 flex items-center justify-between text-[11px]", children: [
|
|
435
|
-
/* @__PURE__ */ jsx4(
|
|
436
|
-
"button",
|
|
437
|
-
{
|
|
438
|
-
type: "button",
|
|
439
|
-
onClick: () => {
|
|
440
|
-
setIsRegister(!isRegister);
|
|
441
|
-
setError(null);
|
|
442
|
-
},
|
|
443
|
-
className: "text-[var(--skipo-accent)] hover:underline cursor-pointer",
|
|
444
|
-
children: isRegister ? "Already have an account? Sign In" : "Create new account"
|
|
445
|
-
}
|
|
446
|
-
),
|
|
447
|
-
/* @__PURE__ */ jsx4("span", { className: "text-[10px] text-[var(--skipo-text-muted)]", children: "ULTRST Identity" })
|
|
448
|
-
] })
|
|
449
|
-
] })
|
|
419
|
+
...presentation,
|
|
420
|
+
onLogin: async (email, password) => {
|
|
421
|
+
const value = toResult(await auth.signIn({ email, password }));
|
|
422
|
+
if (value.success) onSuccess?.(value);
|
|
423
|
+
return value;
|
|
424
|
+
},
|
|
425
|
+
onRegister: async ({ name, email, password }) => {
|
|
426
|
+
const value = toResult(await auth.signUp({ name, email, password }));
|
|
427
|
+
if (value.success) onSuccess?.(value);
|
|
428
|
+
return value;
|
|
429
|
+
},
|
|
430
|
+
authError: auth.error,
|
|
431
|
+
onGoogleSignIn: async () => {
|
|
432
|
+
try {
|
|
433
|
+
const value = await auth.signInWithGoogle();
|
|
434
|
+
const payload = value && typeof value === "object" ? value : {};
|
|
435
|
+
const redirectUrl = typeof payload.url === "string" ? payload.url : void 0;
|
|
436
|
+
if (redirectUrl && typeof window !== "undefined") {
|
|
437
|
+
window.location.assign(redirectUrl);
|
|
438
|
+
return { success: true, redirectUrl };
|
|
439
|
+
}
|
|
440
|
+
const session = await auth.refresh();
|
|
441
|
+
return toResult(session);
|
|
442
|
+
} catch (cause) {
|
|
443
|
+
return { success: false, error: cause instanceof Error ? cause.message : "Google sign-in failed." };
|
|
444
|
+
}
|
|
445
|
+
}
|
|
450
446
|
}
|
|
451
447
|
);
|
|
452
448
|
};
|
|
453
449
|
|
|
454
|
-
// src/components/auth/
|
|
455
|
-
import {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
450
|
+
// src/components/auth/LoginModal.tsx
|
|
451
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
452
|
+
var LoginModal = ({
|
|
453
|
+
ecosystemId,
|
|
454
|
+
applicationId,
|
|
455
|
+
luthUrl,
|
|
456
|
+
appName = "Ecosystem App",
|
|
457
|
+
onSuccess,
|
|
458
|
+
defaultEmail = "",
|
|
459
|
+
onClose
|
|
460
|
+
}) => {
|
|
461
|
+
const auth = useLuthAuth({ ecosystemId, applicationId, luthUrl });
|
|
462
|
+
const [email, setEmail] = useState3(defaultEmail);
|
|
463
|
+
const [password, setPassword] = useState3("");
|
|
464
|
+
const [isRegister, setIsRegister] = useState3(false);
|
|
465
|
+
const [name, setName] = useState3("");
|
|
466
|
+
const [googleLoading, setGoogleLoading] = useState3(false);
|
|
467
|
+
const [localError, setLocalError] = useState3(null);
|
|
468
|
+
const deliveredUserId = useRef2(null);
|
|
469
|
+
useEffect3(() => {
|
|
470
|
+
if (auth.session.authenticated && auth.user && deliveredUserId.current !== auth.user.id) {
|
|
471
|
+
deliveredUserId.current = auth.user.id;
|
|
472
|
+
onSuccess(auth.user);
|
|
473
|
+
}
|
|
474
|
+
}, [auth.session.authenticated, auth.user, onSuccess]);
|
|
475
|
+
const handleSubmit = async (event) => {
|
|
476
|
+
event.preventDefault();
|
|
477
|
+
setLocalError(null);
|
|
478
|
+
try {
|
|
479
|
+
if (isRegister) await auth.signUp({ name: name.trim(), email: email.trim(), password });
|
|
480
|
+
else await auth.signIn({ email: email.trim(), password });
|
|
481
|
+
} catch (cause) {
|
|
482
|
+
setLocalError(cause instanceof Error ? cause.message : "Authentication failed.");
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
const handleGoogleSignIn = async () => {
|
|
486
|
+
setGoogleLoading(true);
|
|
487
|
+
setLocalError(null);
|
|
488
|
+
try {
|
|
489
|
+
const result = await auth.signInWithGoogle();
|
|
490
|
+
const payload = result && typeof result === "object" ? result : {};
|
|
491
|
+
if (typeof payload.url === "string" && typeof window !== "undefined") {
|
|
492
|
+
window.location.assign(payload.url);
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
await auth.refresh();
|
|
496
|
+
} catch (cause) {
|
|
497
|
+
setLocalError(cause instanceof Error ? cause.message : "Google sign-in failed.");
|
|
498
|
+
} finally {
|
|
499
|
+
setGoogleLoading(false);
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
const error = localError || auth.error;
|
|
503
|
+
if (auth.initializing) {
|
|
504
|
+
return /* @__PURE__ */ jsx5("div", { role: "status", "aria-live": "polite", className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 font-mono text-xs text-white", children: "CONNECTING TO LUTH..." });
|
|
505
|
+
}
|
|
506
|
+
return /* @__PURE__ */ jsx5("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-xs font-mono p-4", onWheel: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsxs5("div", { className: "w-full max-w-md p-6 border-2 border-[var(--skipo-border-color)] bg-[var(--skipo-surface)] text-[var(--skipo-text)] shadow-2xl rounded-lg space-y-4", children: [
|
|
507
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between pb-3 border-b border-[var(--skipo-border-color)]", children: [
|
|
508
|
+
/* @__PURE__ */ jsxs5("span", { className: "font-black text-sm tracking-wider uppercase", children: [
|
|
509
|
+
appName,
|
|
510
|
+
" Authentication"
|
|
511
|
+
] }),
|
|
512
|
+
onClose && /* @__PURE__ */ jsx5("button", { type: "button", onClick: onClose, "aria-label": "Close authentication", className: "text-xs", children: "CLOSE" })
|
|
513
|
+
] }),
|
|
514
|
+
error && /* @__PURE__ */ jsxs5("div", { role: "alert", className: "p-3 border border-red-500/60 bg-red-500/10 text-red-300 text-xs rounded flex items-start gap-2", children: [
|
|
515
|
+
/* @__PURE__ */ jsx5(AlertCircle2, { size: 14, className: "shrink-0 mt-0.5" }),
|
|
516
|
+
/* @__PURE__ */ jsx5("span", { children: error })
|
|
517
|
+
] }),
|
|
518
|
+
/* @__PURE__ */ jsxs5("form", { onSubmit: (event) => void handleSubmit(event), className: "space-y-3", children: [
|
|
519
|
+
isRegister && /* @__PURE__ */ jsxs5("div", { children: [
|
|
520
|
+
/* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Full Name *" }),
|
|
521
|
+
/* @__PURE__ */ jsx5(BaseInput, { type: "text", value: name, onChange: (event) => setName(event.target.value), required: true, placeholder: "Your name", autoComplete: "name" })
|
|
522
|
+
] }),
|
|
523
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
524
|
+
/* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Email Address *" }),
|
|
525
|
+
/* @__PURE__ */ jsx5(BaseInput, { type: "email", value: email, onChange: (event) => setEmail(event.target.value), required: true, placeholder: "user@example.com", autoComplete: "username" })
|
|
526
|
+
] }),
|
|
527
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
528
|
+
/* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Password *" }),
|
|
529
|
+
/* @__PURE__ */ jsx5(BaseInput, { type: "password", value: password, onChange: (event) => setPassword(event.target.value), required: true, autoComplete: isRegister ? "new-password" : "current-password" })
|
|
530
|
+
] }),
|
|
531
|
+
/* @__PURE__ */ jsxs5(BaseButton, { variant: "accent", size: "md", type: "submit", disabled: auth.loading || googleLoading, className: "w-full flex items-center justify-center gap-2", children: [
|
|
532
|
+
/* @__PURE__ */ jsx5("span", { children: auth.loading ? "AUTHENTICATING..." : isRegister ? "REGISTER & ENTER" : "SIGN IN" }),
|
|
533
|
+
/* @__PURE__ */ jsx5(ArrowRight2, { size: 14 })
|
|
534
|
+
] })
|
|
535
|
+
] }),
|
|
536
|
+
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
537
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-[9px] text-[var(--skipo-text-muted)]", children: [
|
|
538
|
+
/* @__PURE__ */ jsx5("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" }),
|
|
539
|
+
" OR ",
|
|
540
|
+
/* @__PURE__ */ jsx5("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" })
|
|
541
|
+
] }),
|
|
542
|
+
/* @__PURE__ */ jsx5(GoogleSignInButton, { disabled: auth.loading || googleLoading, loading: googleLoading, onSignIn: handleGoogleSignIn })
|
|
543
|
+
] }),
|
|
544
|
+
/* @__PURE__ */ jsxs5("div", { className: "pt-2 border-t border-[var(--skipo-border-color)]/60 flex items-center justify-between text-[11px]", children: [
|
|
545
|
+
/* @__PURE__ */ jsx5("button", { type: "button", onClick: () => {
|
|
546
|
+
setIsRegister(!isRegister);
|
|
547
|
+
setLocalError(null);
|
|
548
|
+
}, className: "text-[var(--skipo-accent)] hover:underline cursor-pointer", children: isRegister ? "Already have an account? Sign In" : "Create new account" }),
|
|
549
|
+
/* @__PURE__ */ jsx5("span", { className: "text-[10px] text-[var(--skipo-text-muted)]", children: "SECURED BY LUTH" })
|
|
550
|
+
] })
|
|
551
|
+
] }) });
|
|
552
|
+
};
|
|
466
553
|
|
|
467
|
-
// src/components/auth/
|
|
468
|
-
import {
|
|
554
|
+
// src/components/auth/LuthProtectedRoute.tsx
|
|
555
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
556
|
+
var LuthProtectedRoute = ({
|
|
557
|
+
ecosystemId,
|
|
558
|
+
applicationId,
|
|
559
|
+
luthUrl,
|
|
560
|
+
children,
|
|
561
|
+
fallback,
|
|
562
|
+
loadingFallback,
|
|
563
|
+
...presentation
|
|
564
|
+
}) => /* @__PURE__ */ jsx6(
|
|
565
|
+
LuthAuthPage,
|
|
566
|
+
{
|
|
567
|
+
...presentation,
|
|
568
|
+
ecosystemId,
|
|
569
|
+
applicationId,
|
|
570
|
+
luthUrl,
|
|
571
|
+
authenticatedContent: children,
|
|
572
|
+
unauthenticatedContent: fallback,
|
|
573
|
+
loadingContent: loadingFallback
|
|
574
|
+
}
|
|
575
|
+
);
|
|
469
576
|
|
|
470
577
|
export {
|
|
471
578
|
GoogleIcon,
|
|
@@ -474,9 +581,15 @@ export {
|
|
|
474
581
|
authPageDefinition,
|
|
475
582
|
AuthPage,
|
|
476
583
|
AuthLoadingScreen,
|
|
477
|
-
LoginModal,
|
|
478
584
|
resolveLuthOrigin,
|
|
479
585
|
resolveLuthEnvironment,
|
|
586
|
+
DEFAULT_LUTH_URL,
|
|
480
587
|
LuthAuthClient,
|
|
481
|
-
createLuthAuthClient
|
|
588
|
+
createLuthAuthClient,
|
|
589
|
+
LuthAuthError,
|
|
590
|
+
createLuthAuthClientForApplication,
|
|
591
|
+
useLuthAuth,
|
|
592
|
+
LuthAuthPage,
|
|
593
|
+
LoginModal,
|
|
594
|
+
LuthProtectedRoute
|
|
482
595
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { resolveClientEnvironment, resolveClientOrigin } from '@
|
|
3
|
-
export { LuthAuthClient, createLuthAuthClient } from '@
|
|
4
|
-
export { LuthSession, LuthUser } from '@dinilmusick/gutts';
|
|
2
|
+
import { resolveClientEnvironment, resolveClientOrigin, LuthUser, LuthSessionResult, LuthAuthClient } from '@ultrst-armada/kloks/auth';
|
|
3
|
+
export { DEFAULT_LUTH_URL, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createLuthAuthClient } from '@ultrst-armada/kloks/auth';
|
|
5
4
|
|
|
6
5
|
declare const AUTH_PAGE_REQUIRED_SERVICES: readonly ["auth"];
|
|
7
6
|
interface AuthResult {
|
|
8
7
|
success: boolean;
|
|
9
8
|
error?: string;
|
|
10
9
|
user?: unknown;
|
|
11
|
-
token?: string;
|
|
12
10
|
redirectUrl?: string;
|
|
13
11
|
}
|
|
14
12
|
interface AuthPageProps {
|
|
@@ -26,6 +24,7 @@ interface AuthPageProps {
|
|
|
26
24
|
onGoogleSignIn?: () => Promise<AuthResult>;
|
|
27
25
|
enableGoogleSignIn?: boolean;
|
|
28
26
|
onSwitchToAdmin?: () => void;
|
|
27
|
+
authError?: string | null;
|
|
29
28
|
}
|
|
30
29
|
declare const authPageDefinition: {
|
|
31
30
|
name: string;
|
|
@@ -89,13 +88,19 @@ interface AuthLoadingScreenProps {
|
|
|
89
88
|
}
|
|
90
89
|
declare const AuthLoadingScreen: React__default.FC<AuthLoadingScreenProps>;
|
|
91
90
|
|
|
91
|
+
declare const resolveLuthOrigin: typeof resolveClientOrigin;
|
|
92
|
+
declare const resolveLuthEnvironment: typeof resolveClientEnvironment;
|
|
93
|
+
|
|
92
94
|
interface LoginModalProps {
|
|
95
|
+
ecosystemId: string;
|
|
96
|
+
applicationId: string;
|
|
97
|
+
luthUrl?: string;
|
|
93
98
|
appName?: string;
|
|
94
|
-
onSuccess: (user:
|
|
99
|
+
onSuccess: (user: LuthUser) => void;
|
|
95
100
|
defaultEmail?: string;
|
|
96
|
-
|
|
97
|
-
enableGoogleSignIn?: boolean;
|
|
101
|
+
onClose?: () => void;
|
|
98
102
|
}
|
|
103
|
+
/** Modal UI backed exclusively by the canonical Luth session authority through Kloks. */
|
|
99
104
|
declare const LoginModal: React__default.FC<LoginModalProps>;
|
|
100
105
|
|
|
101
106
|
interface GoogleSignInButtonProps {
|
|
@@ -111,7 +116,51 @@ declare const GoogleIcon: React__default.FC<{
|
|
|
111
116
|
}>;
|
|
112
117
|
declare const GoogleSignInButton: React__default.FC<GoogleSignInButtonProps>;
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
119
|
+
interface LuthAuthConfig {
|
|
120
|
+
ecosystemId: string;
|
|
121
|
+
applicationId: string;
|
|
122
|
+
luthUrl?: string;
|
|
123
|
+
origin?: string;
|
|
124
|
+
}
|
|
125
|
+
interface UseLuthAuthResult {
|
|
126
|
+
client: LuthAuthClient;
|
|
127
|
+
session: LuthSessionResult;
|
|
128
|
+
user: LuthSessionResult['user'];
|
|
129
|
+
loading: boolean;
|
|
130
|
+
initializing: boolean;
|
|
131
|
+
error: string | null;
|
|
132
|
+
refresh: (options?: {
|
|
133
|
+
silent?: boolean;
|
|
134
|
+
}) => Promise<LuthSessionResult>;
|
|
135
|
+
signIn: (credentials: {
|
|
136
|
+
email: string;
|
|
137
|
+
password: string;
|
|
138
|
+
}) => Promise<LuthSessionResult>;
|
|
139
|
+
signUp: (input: {
|
|
140
|
+
name: string;
|
|
141
|
+
email: string;
|
|
142
|
+
password: string;
|
|
143
|
+
}) => Promise<LuthSessionResult>;
|
|
144
|
+
signInWithGoogle: (callbackURL?: string) => Promise<unknown>;
|
|
145
|
+
signOut: () => Promise<void>;
|
|
146
|
+
}
|
|
147
|
+
interface LuthAuthPageProps extends Omit<AuthPageProps, 'onLogin' | 'onRegister' | 'onGoogleSignIn' | 'onSuccess'>, LuthAuthConfig {
|
|
148
|
+
onAuthenticated?: (user: NonNullable<LuthSessionResult['user']>) => void;
|
|
149
|
+
onSuccess?: (result: AuthResult) => void;
|
|
150
|
+
authenticatedContent?: React__default.ReactNode | ((auth: UseLuthAuthResult) => React__default.ReactNode);
|
|
151
|
+
unauthenticatedContent?: React__default.ReactNode;
|
|
152
|
+
loadingContent?: React__default.ReactNode;
|
|
153
|
+
}
|
|
154
|
+
declare function createLuthAuthClientForApplication(input: LuthAuthConfig): LuthAuthClient;
|
|
155
|
+
declare function useLuthAuth(config: LuthAuthConfig): UseLuthAuthResult;
|
|
156
|
+
declare const LuthAuthPage: React__default.FC<LuthAuthPageProps>;
|
|
157
|
+
|
|
158
|
+
interface LuthProtectedRouteProps extends Omit<LuthAuthPageProps, 'authenticatedContent' | 'unauthenticatedContent' | 'loadingContent'> {
|
|
159
|
+
children: React__default.ReactNode | ((auth: UseLuthAuthResult) => React__default.ReactNode);
|
|
160
|
+
fallback?: React__default.ReactNode;
|
|
161
|
+
loadingFallback?: React__default.ReactNode;
|
|
162
|
+
}
|
|
163
|
+
/** Protects application content using the same canonical Luth session lifecycle as LuthAuthPage. */
|
|
164
|
+
declare const LuthProtectedRoute: React__default.FC<LuthProtectedRouteProps>;
|
|
116
165
|
|
|
117
|
-
export { AUTH_PAGE_REQUIRED_SERVICES, AuthLoadingScreen, type AuthLoadingScreenProps, AuthPage, type AuthPageProps, type AuthResult, GoogleIcon, GoogleSignInButton, type GoogleSignInButtonProps, LoginModal, type LoginModalProps, authPageDefinition, resolveLuthEnvironment, resolveLuthOrigin };
|
|
166
|
+
export { AUTH_PAGE_REQUIRED_SERVICES, AuthLoadingScreen, type AuthLoadingScreenProps, AuthPage, type AuthPageProps, type AuthResult, GoogleIcon, GoogleSignInButton, type GoogleSignInButtonProps, LoginModal, type LoginModalProps, type LuthAuthConfig, LuthAuthPage, type LuthAuthPageProps, LuthProtectedRoute, type LuthProtectedRouteProps, type UseLuthAuthResult, authPageDefinition, createLuthAuthClientForApplication, resolveLuthEnvironment, resolveLuthOrigin, useLuthAuth };
|
|
@@ -2,15 +2,21 @@ import {
|
|
|
2
2
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
3
3
|
AuthLoadingScreen,
|
|
4
4
|
AuthPage,
|
|
5
|
+
DEFAULT_LUTH_URL,
|
|
5
6
|
GoogleIcon,
|
|
6
7
|
GoogleSignInButton,
|
|
7
8
|
LoginModal,
|
|
8
9
|
LuthAuthClient,
|
|
10
|
+
LuthAuthError,
|
|
11
|
+
LuthAuthPage,
|
|
12
|
+
LuthProtectedRoute,
|
|
9
13
|
authPageDefinition,
|
|
10
14
|
createLuthAuthClient,
|
|
15
|
+
createLuthAuthClientForApplication,
|
|
11
16
|
resolveLuthEnvironment,
|
|
12
|
-
resolveLuthOrigin
|
|
13
|
-
|
|
17
|
+
resolveLuthOrigin,
|
|
18
|
+
useLuthAuth
|
|
19
|
+
} from "../../chunk-3YYPBZS2.js";
|
|
14
20
|
import "../../chunk-5QDNIDDN.js";
|
|
15
21
|
import "../../chunk-5ZMXFCD4.js";
|
|
16
22
|
import "../../chunk-C3L53YN4.js";
|
|
@@ -22,12 +28,18 @@ export {
|
|
|
22
28
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
23
29
|
AuthLoadingScreen,
|
|
24
30
|
AuthPage,
|
|
31
|
+
DEFAULT_LUTH_URL,
|
|
25
32
|
GoogleIcon,
|
|
26
33
|
GoogleSignInButton,
|
|
27
34
|
LoginModal,
|
|
28
35
|
LuthAuthClient,
|
|
36
|
+
LuthAuthError,
|
|
37
|
+
LuthAuthPage,
|
|
38
|
+
LuthProtectedRoute,
|
|
29
39
|
authPageDefinition,
|
|
30
40
|
createLuthAuthClient,
|
|
41
|
+
createLuthAuthClientForApplication,
|
|
31
42
|
resolveLuthEnvironment,
|
|
32
|
-
resolveLuthOrigin
|
|
43
|
+
resolveLuthOrigin,
|
|
44
|
+
useLuthAuth
|
|
33
45
|
};
|
|
@@ -7,8 +7,7 @@ export { AppShell, AppShellProps, BreadcrumbNav, BreadcrumbNavProps, HeaderBar,
|
|
|
7
7
|
export { ApiCallIndicator, ApiCallIndicatorProps, AutoSaveStatus, AutoSaveToggle, AutoSaveToggleProps, BottomStripContextValue, BottomStripProvider, BottomStripProviderProps, StatusLight, StatusLightProps, SystemMessage, SystemMessageDisplay, SystemMessageDisplayProps, SystemMessageType, useBottomStrip } from './components/bottom-strip/index.js';
|
|
8
8
|
export { B as BottomStrip, a as BottomStripProps } from './BottomStrip-DYhAUQR4.js';
|
|
9
9
|
export { AccountsSettingsSection, AccountsSettingsSectionProps, SettingsTab, SettingsTabProps, ThemeSettingsSection } from './components/settings/index.js';
|
|
10
|
-
export { AUTH_PAGE_REQUIRED_SERVICES, AuthLoadingScreen, AuthLoadingScreenProps, AuthPage, AuthPageProps, AuthResult, GoogleIcon, GoogleSignInButton, GoogleSignInButtonProps, LoginModal, LoginModalProps, authPageDefinition, resolveLuthEnvironment, resolveLuthOrigin } from './components/auth/index.js';
|
|
11
|
-
export { LuthSession, LuthUser } from '@dinilmusick/gutts';
|
|
10
|
+
export { AUTH_PAGE_REQUIRED_SERVICES, AuthLoadingScreen, AuthLoadingScreenProps, AuthPage, AuthPageProps, AuthResult, GoogleIcon, GoogleSignInButton, GoogleSignInButtonProps, LoginModal, LoginModalProps, LuthAuthConfig, LuthAuthPage, LuthAuthPageProps, LuthProtectedRoute, LuthProtectedRouteProps, UseLuthAuthResult, authPageDefinition, createLuthAuthClientForApplication, resolveLuthEnvironment, resolveLuthOrigin, useLuthAuth } from './components/auth/index.js';
|
|
12
11
|
export { FrnlTileRecord, TilesMenu, TilesMenuProps, tilesMenuDefinition } from './components/tiles/index.js';
|
|
13
12
|
export { GRAPHS_MENU_REQUIRED_SERVICES, GraphRecord, GraphsMenu, GraphsMenuProps } from './components/graph/index.js';
|
|
14
13
|
export { BackblazeAccount, BackblazeBucket, KloksServiceInvoker, SrklBackblazeAccount, SrklBackblazeTile, StorageOptionTiles, StoragePresetTile, StorageSelection, WORKSPACE_CREATE_DIALOG_REQUIRED_SERVICES, WORKSPACE_TILES_MENU_REQUIRED_SERVICES, WorkspaceCreateDialog, WorkspaceCreateDialogProps, WorkspaceCreateInput, WorkspaceGate, WorkspaceGateProps, WorkspaceRecord, WorkspaceSecondaryClone, WorkspaceSecondaryClonesPanel, WorkspaceStorageReadonlyPanel, WorkspaceStorageService, WorkspaceTilesMenu, WorkspaceTilesMenuProps, createKloksWorkspaceStorageService, defaultWorkspaceStorageService, workspaceTilesMenuDefinition } from './components/workspace/index.js';
|
|
@@ -18,7 +17,7 @@ export { ActionButton, Badge, BadgeProps, BadgeTone, ButtonParent, ButtonParentP
|
|
|
18
17
|
export { FrnlStoreProvider, FrnlStoreProviderProps, floksFrnlFrontendApi, floksFrnlStore, getFloksFrnlStore, useFloksFrnlStore } from './frnl/store.js';
|
|
19
18
|
export { FrnlComponentControl, FrnlComponentSnapshot, FrnlFrontendApi, FrnlFrontendSnapshot, FrnlInputContract, FrnlStore } from '@ultrst-armada/frnlts';
|
|
20
19
|
export { FrnlApiRequestLog, FrnlBadgeProps, FrnlBottomBarProps, FrnlBreadcrumbItem, FrnlButtonProps, FrnlButtonSize, FrnlButtonVariant, FrnlPageProps, FrnlPageTab, FrnlSelectOption, FrnlSelectProps, FrnlSliderProps, FrnlTabItem, FrnlTabWindowProps, FrnlTextInputProps, FrnlToggleProps, FrnlTopBarProps, FrnlTopBarTab, FrnlUserProfile, frnlBadge, frnlBottomBar, frnlButton, frnlButtonDefinition, frnlPage, frnlSelect, frnlSelectDefinition, frnlSlider, frnlTabWindow, frnlTextInput, frnlTextInputDefinition, frnlToggle, frnlToggleDefinition, frnlTopBar } from './frnl/index.js';
|
|
21
|
-
export { LuthAuthClient, createLuthAuthClient } from '@
|
|
20
|
+
export { DEFAULT_LUTH_URL, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createLuthAuthClient } from '@ultrst-armada/kloks/auth';
|
|
22
21
|
import 'zod';
|
|
23
22
|
import 'react';
|
|
24
23
|
import '@xyflow/react';
|
|
@@ -13,6 +13,16 @@ import {
|
|
|
13
13
|
defaultWorkspaceStorageService,
|
|
14
14
|
workspaceTilesMenuDefinition
|
|
15
15
|
} from "./chunk-QTAFR2V6.js";
|
|
16
|
+
import {
|
|
17
|
+
ConfirmDialog,
|
|
18
|
+
CopyableErrorAlert,
|
|
19
|
+
EmptyState,
|
|
20
|
+
LoadingOverlay,
|
|
21
|
+
SearchInput,
|
|
22
|
+
SearchableList,
|
|
23
|
+
StatusIndicator,
|
|
24
|
+
useSearchKeyboardNavigation
|
|
25
|
+
} from "./chunk-VEWPTZGO.js";
|
|
16
26
|
import {
|
|
17
27
|
DEFAULT_PANEL_GEOMETRY,
|
|
18
28
|
DrawerContainer,
|
|
@@ -27,16 +37,6 @@ import {
|
|
|
27
37
|
usePanelGeometry,
|
|
28
38
|
usePanelInteraction
|
|
29
39
|
} from "./chunk-TXKLROFC.js";
|
|
30
|
-
import {
|
|
31
|
-
ConfirmDialog,
|
|
32
|
-
CopyableErrorAlert,
|
|
33
|
-
EmptyState,
|
|
34
|
-
LoadingOverlay,
|
|
35
|
-
SearchInput,
|
|
36
|
-
SearchableList,
|
|
37
|
-
StatusIndicator,
|
|
38
|
-
useSearchKeyboardNavigation
|
|
39
|
-
} from "./chunk-VEWPTZGO.js";
|
|
40
40
|
import {
|
|
41
41
|
IconOnlyButton,
|
|
42
42
|
ModalContainer
|
|
@@ -76,7 +76,45 @@ import {
|
|
|
76
76
|
frnlToggleDefinition,
|
|
77
77
|
frnlTopBar
|
|
78
78
|
} from "./chunk-G5CYPT3P.js";
|
|
79
|
+
import {
|
|
80
|
+
ActionButton,
|
|
81
|
+
Badge,
|
|
82
|
+
ButtonParent,
|
|
83
|
+
CardPanel,
|
|
84
|
+
CategoryCardTile,
|
|
85
|
+
ChannelStripTile,
|
|
86
|
+
ClipCardTile,
|
|
87
|
+
DangerButton,
|
|
88
|
+
GhostButton,
|
|
89
|
+
IconButton,
|
|
90
|
+
InspectorPanel,
|
|
91
|
+
ModalPanel,
|
|
92
|
+
PanelParent,
|
|
93
|
+
SelectInput,
|
|
94
|
+
SliderInput,
|
|
95
|
+
SpawnOptionTile,
|
|
96
|
+
SplitButton,
|
|
97
|
+
StatusDot,
|
|
98
|
+
TelemetryPill,
|
|
99
|
+
TextInput,
|
|
100
|
+
TileParent,
|
|
101
|
+
ToggleButton,
|
|
102
|
+
ToggleInput,
|
|
103
|
+
ToolbarPanel,
|
|
104
|
+
UIParent
|
|
105
|
+
} from "./chunk-Q324BMDJ.js";
|
|
79
106
|
import "./chunk-SLJBDDSN.js";
|
|
107
|
+
import {
|
|
108
|
+
DEFAULT_PALETTE_ID,
|
|
109
|
+
THEME_STORAGE_KEY,
|
|
110
|
+
ThemeProvider,
|
|
111
|
+
applyPaletteToDocument,
|
|
112
|
+
getActivePalette,
|
|
113
|
+
paletteToSkipoThemePack,
|
|
114
|
+
subscribeToPalette,
|
|
115
|
+
usePalette,
|
|
116
|
+
useTheme
|
|
117
|
+
} from "./chunk-ZQK5I5ZL.js";
|
|
80
118
|
import {
|
|
81
119
|
BlockquoteStyleSchema,
|
|
82
120
|
CodeStyleSchema,
|
|
@@ -124,44 +162,6 @@ import {
|
|
|
124
162
|
useSkipoTheme,
|
|
125
163
|
validateThemePack
|
|
126
164
|
} from "./chunk-DZJ3NSCX.js";
|
|
127
|
-
import {
|
|
128
|
-
ActionButton,
|
|
129
|
-
Badge,
|
|
130
|
-
ButtonParent,
|
|
131
|
-
CardPanel,
|
|
132
|
-
CategoryCardTile,
|
|
133
|
-
ChannelStripTile,
|
|
134
|
-
ClipCardTile,
|
|
135
|
-
DangerButton,
|
|
136
|
-
GhostButton,
|
|
137
|
-
IconButton,
|
|
138
|
-
InspectorPanel,
|
|
139
|
-
ModalPanel,
|
|
140
|
-
PanelParent,
|
|
141
|
-
SelectInput,
|
|
142
|
-
SliderInput,
|
|
143
|
-
SpawnOptionTile,
|
|
144
|
-
SplitButton,
|
|
145
|
-
StatusDot,
|
|
146
|
-
TelemetryPill,
|
|
147
|
-
TextInput,
|
|
148
|
-
TileParent,
|
|
149
|
-
ToggleButton,
|
|
150
|
-
ToggleInput,
|
|
151
|
-
ToolbarPanel,
|
|
152
|
-
UIParent
|
|
153
|
-
} from "./chunk-Q324BMDJ.js";
|
|
154
|
-
import {
|
|
155
|
-
DEFAULT_PALETTE_ID,
|
|
156
|
-
THEME_STORAGE_KEY,
|
|
157
|
-
ThemeProvider,
|
|
158
|
-
applyPaletteToDocument,
|
|
159
|
-
getActivePalette,
|
|
160
|
-
paletteToSkipoThemePack,
|
|
161
|
-
subscribeToPalette,
|
|
162
|
-
usePalette,
|
|
163
|
-
useTheme
|
|
164
|
-
} from "./chunk-ZQK5I5ZL.js";
|
|
165
165
|
import {
|
|
166
166
|
BUILTIN_PALETTES
|
|
167
167
|
} from "./chunk-XXIH2HWI.js";
|
|
@@ -208,15 +208,21 @@ import {
|
|
|
208
208
|
AUTH_PAGE_REQUIRED_SERVICES,
|
|
209
209
|
AuthLoadingScreen,
|
|
210
210
|
AuthPage,
|
|
211
|
+
DEFAULT_LUTH_URL,
|
|
211
212
|
GoogleIcon,
|
|
212
213
|
GoogleSignInButton,
|
|
213
214
|
LoginModal,
|
|
214
215
|
LuthAuthClient,
|
|
216
|
+
LuthAuthError,
|
|
217
|
+
LuthAuthPage,
|
|
218
|
+
LuthProtectedRoute,
|
|
215
219
|
authPageDefinition,
|
|
216
220
|
createLuthAuthClient,
|
|
221
|
+
createLuthAuthClientForApplication,
|
|
217
222
|
resolveLuthEnvironment,
|
|
218
|
-
resolveLuthOrigin
|
|
219
|
-
|
|
223
|
+
resolveLuthOrigin,
|
|
224
|
+
useLuthAuth
|
|
225
|
+
} from "./chunk-3YYPBZS2.js";
|
|
220
226
|
import {
|
|
221
227
|
frnlButton,
|
|
222
228
|
frnlButtonDefinition,
|
|
@@ -287,6 +293,7 @@ export {
|
|
|
287
293
|
CredentialField,
|
|
288
294
|
DEFAULT_DARK_THEME_PACK,
|
|
289
295
|
DEFAULT_LIGHT_THEME_PACK,
|
|
296
|
+
DEFAULT_LUTH_URL,
|
|
290
297
|
DEFAULT_PALETTE_ID,
|
|
291
298
|
DEFAULT_PANEL_GEOMETRY,
|
|
292
299
|
DEPM_THEME_PACKS,
|
|
@@ -331,6 +338,9 @@ export {
|
|
|
331
338
|
LoadingOverlay,
|
|
332
339
|
LoginModal,
|
|
333
340
|
LuthAuthClient,
|
|
341
|
+
LuthAuthError,
|
|
342
|
+
LuthAuthPage,
|
|
343
|
+
LuthProtectedRoute,
|
|
334
344
|
MarkdownSectionStylesSchema,
|
|
335
345
|
ModalContainer,
|
|
336
346
|
ModalPanel,
|
|
@@ -399,6 +409,7 @@ export {
|
|
|
399
409
|
createAppThemeSocket,
|
|
400
410
|
createKloksWorkspaceStorageService,
|
|
401
411
|
createLuthAuthClient,
|
|
412
|
+
createLuthAuthClientForApplication,
|
|
402
413
|
defaultWorkspaceStorageService,
|
|
403
414
|
depmThemeSocket,
|
|
404
415
|
floksFrnlFrontendApi,
|
|
@@ -434,6 +445,7 @@ export {
|
|
|
434
445
|
tokensToCssVariables,
|
|
435
446
|
useBottomStrip,
|
|
436
447
|
useFloksFrnlStore,
|
|
448
|
+
useLuthAuth,
|
|
437
449
|
usePalette,
|
|
438
450
|
usePanelGeometry,
|
|
439
451
|
usePanelInteraction,
|
package/packages/ui/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floks/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Floks UI — Reusable React Component Library with Theme Engine, Base Primitives, Containers, Composite & Layout",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -97,17 +97,17 @@
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"scripts": {
|
|
100
|
-
"build": "tsup src/index.ts src/theme/index.ts src/palette/index.ts src/hierarchy/index.ts src/frnl/index.ts src/frnl/store.ts src/components/base/index.ts src/components/containers/index.ts src/components/composite/index.ts src/components/layout/index.ts src/components/bottom-strip/index.ts src/components/settings/index.ts src/components/auth/index.ts src/components/workspace/index.ts src/components/tiles/index.ts src/components/graph/index.ts src/components/ai/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react --external @ultrst-armada/frnlts",
|
|
100
|
+
"build": "tsup src/index.ts src/theme/index.ts src/palette/index.ts src/hierarchy/index.ts src/frnl/index.ts src/frnl/store.ts src/components/base/index.ts src/components/containers/index.ts src/components/composite/index.ts src/components/layout/index.ts src/components/bottom-strip/index.ts src/components/settings/index.ts src/components/auth/index.ts src/components/workspace/index.ts src/components/tiles/index.ts src/components/graph/index.ts src/components/ai/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react --external @ultrst-armada/frnlts --external @ultrst-armada/kloks",
|
|
101
101
|
"typecheck": "tsc --noEmit",
|
|
102
102
|
"clean": "rm -rf dist"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@dinilmusick/gutts": "^1.4.3",
|
|
106
105
|
"zod": "^3.24.1",
|
|
107
106
|
"@ultrst-armada/frnlts": "^0.5.5",
|
|
108
107
|
"zustand": "^5.0.3",
|
|
109
108
|
"@xyflow/react": "^12.8.6",
|
|
110
|
-
"d3-force": "^3.0.0"
|
|
109
|
+
"d3-force": "^3.0.0",
|
|
110
|
+
"@ultrst-armada/kloks": "^1.25.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"lucide-react": ">=0.300.0",
|