@ultrst-armada/floks 1.13.14 → 1.13.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/floks",
4
- "version": "1.13.14",
5
- "sourceCommit": "53a16be6fd3a6c3340f62aea1aa6b1ebd15cfde3",
4
+ "version": "1.13.15",
5
+ "sourceCommit": "78b50d233b14611266debc548070d8cc12ed19dc",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "41841181433"
7
+ "workflowRunId": "41891252133"
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.14",
3
+ "version": "1.13.15",
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
- "@dinilmusick/gutts": "^1.4.3"
87
+ "@ultrst-armada/kloks": "^1.24.9",
88
+ "@dinilmusick/gutts": "^1.4.4"
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";
@@ -49,17 +49,17 @@ import {
49
49
  getAuthoringDepth,
50
50
  getAuthoringSubtreeIds
51
51
  } from "./chunk-TS7P3WWH.js";
52
+ import {
53
+ DockBar,
54
+ DockItem,
55
+ useDock
56
+ } from "./chunk-6VB74RCH.js";
52
57
  import {
53
58
  CanvasViewport,
54
59
  InfiniteCanvas,
55
60
  MiniMap,
56
61
  useCanvas
57
62
  } from "./chunk-34YRDZPJ.js";
58
- import {
59
- DockBar,
60
- DockItem,
61
- useDock
62
- } from "./chunk-6VB74RCH.js";
63
63
  import {
64
64
  MonacoEditor,
65
65
  skipoDarkTheme,
@@ -76,7 +76,7 @@
76
76
  "dependencies": {
77
77
  "@floks/ui": "workspace:*",
78
78
  "@ultrst-armada/frnlts": "^0.5.5",
79
- "@ultrst-armada/kloks": "^1.24.8"
79
+ "@ultrst-armada/kloks": "^1.24.9"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "@dnd-kit/core": "^6.0.0",
@@ -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,307 @@ var AuthLoadingScreen = ({
266
270
  );
267
271
 
268
272
  // src/components/auth/LoginModal.tsx
269
- import { useState as useState2 } from "react";
270
- import { ArrowRight as ArrowRight2, ShieldCheck, AlertCircle as AlertCircle2 } from "lucide-react";
271
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
272
- var LoginModal = ({
273
- appName = "Ecosystem App",
274
- onSuccess,
275
- defaultEmail = "",
276
- onGoogleSignIn,
277
- enableGoogleSignIn = true
278
- }) => {
279
- const [email, setEmail] = useState2(defaultEmail);
280
- const [password, setPassword] = useState2("");
281
- const [isRegister, setIsRegister] = useState2(false);
282
- const [name, setName] = useState2("");
283
- const [loading, setLoading] = useState2(false);
284
- const [googleLoading, setGoogleLoading] = useState2(false);
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
+ });
301
+ }
302
+ function useLuthAuth(config) {
303
+ const client = useMemo2(
304
+ () => createLuthAuthClientForApplication(config),
305
+ [config.ecosystemId, config.applicationId, config.luthUrl]
306
+ );
307
+ const [session, setSession] = useState2({ authenticated: false });
308
+ const [loading, setLoading] = useState2(true);
309
+ const [initializing, setInitializing] = useState2(true);
285
310
  const [error, setError] = useState2(null);
286
- const handleSubmit = async (e) => {
287
- e.preventDefault();
311
+ const refresh = useCallback(async (options = {}) => {
312
+ if (!options.silent) setLoading(true);
288
313
  setError(null);
314
+ try {
315
+ const next = await client.getSession();
316
+ setSession(next);
317
+ return next;
318
+ } catch (cause) {
319
+ const message = cause instanceof Error ? cause.message : "Unable to retrieve the Luth session.";
320
+ setError(message);
321
+ throw cause;
322
+ } finally {
323
+ if (!options.silent) setLoading(false);
324
+ setInitializing(false);
325
+ }
326
+ }, [client]);
327
+ useEffect2(() => {
328
+ void refresh().catch(() => void 0);
329
+ if (typeof window === "undefined") return;
330
+ const revalidate = () => {
331
+ void refresh({ silent: true }).catch(() => void 0);
332
+ };
333
+ window.addEventListener("focus", revalidate);
334
+ window.addEventListener("online", revalidate);
335
+ return () => {
336
+ window.removeEventListener("focus", revalidate);
337
+ window.removeEventListener("online", revalidate);
338
+ };
339
+ }, [refresh]);
340
+ const signIn = useCallback(async (credentials) => {
341
+ await client.signInWithEmail(credentials);
342
+ return refresh();
343
+ }, [client, refresh]);
344
+ const signUp = useCallback(async (input) => {
345
+ await client.signUpWithEmail(input);
346
+ return refresh();
347
+ }, [client, refresh]);
348
+ const signInWithGoogle = useCallback(
349
+ (callbackURL) => client.signInWithGoogle(callbackURL ? { callbackURL } : void 0),
350
+ [client]
351
+ );
352
+ const signOut = useCallback(async () => {
289
353
  setLoading(true);
354
+ setError(null);
290
355
  try {
291
- const endpoint = isRegister ? "/api/auth/register" : "/api/auth/login";
292
- const payload = isRegister ? { email, password, name } : { email, password };
293
- const res = await fetch(endpoint, {
294
- method: "POST",
295
- headers: { "Content-Type": "application/json" },
296
- body: JSON.stringify(payload)
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.");
356
+ await client.signOut();
357
+ setSession({ authenticated: false });
358
+ } catch (cause) {
359
+ const message = cause instanceof Error ? cause.message : "Luth sign-out failed.";
360
+ setError(message);
361
+ throw cause;
310
362
  } finally {
311
363
  setLoading(false);
312
364
  }
365
+ }, [client]);
366
+ return { client, session, user: session.user, loading, initializing, error, refresh, signIn, signUp, signInWithGoogle, signOut };
367
+ }
368
+ var LuthAuthPage = ({
369
+ ecosystemId,
370
+ applicationId,
371
+ luthUrl,
372
+ onAuthenticated,
373
+ onSuccess,
374
+ authenticatedContent,
375
+ unauthenticatedContent,
376
+ loadingContent,
377
+ ...presentation
378
+ }) => {
379
+ const auth = useLuthAuth({ ecosystemId, applicationId, luthUrl });
380
+ const onAuthenticatedRef = useRef(onAuthenticated);
381
+ const notifiedUserId = useRef(null);
382
+ useEffect2(() => {
383
+ onAuthenticatedRef.current = onAuthenticated;
384
+ }, [onAuthenticated]);
385
+ useEffect2(() => {
386
+ if (!auth.session.authenticated) {
387
+ notifiedUserId.current = null;
388
+ return;
389
+ }
390
+ if (auth.user && notifiedUserId.current !== auth.user.id) {
391
+ notifiedUserId.current = auth.user.id;
392
+ onAuthenticatedRef.current?.(auth.user);
393
+ }
394
+ }, [auth.session.authenticated, auth.user]);
395
+ const toResult = (session) => {
396
+ if (!session.authenticated || !session.user) return { success: false, error: "Luth did not establish an authenticated session." };
397
+ return { success: true, user: session.user };
313
398
  };
399
+ if (auth.initializing) return /* @__PURE__ */ jsx4(Fragment2, { children: loadingContent ?? /* @__PURE__ */ jsx4(AuthLoadingScreen, { label: "CONNECTING TO LUTH..." }) });
400
+ if (auth.session.authenticated && auth.user) {
401
+ if (typeof authenticatedContent === "function") return /* @__PURE__ */ jsx4(Fragment2, { children: authenticatedContent(auth) });
402
+ 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: [
403
+ /* @__PURE__ */ jsxs4("span", { className: "text-xs", children: [
404
+ "SIGNED IN AS ",
405
+ auth.user.email
406
+ ] }),
407
+ auth.error && /* @__PURE__ */ jsx4("p", { role: "alert", children: auth.error }),
408
+ /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => {
409
+ void auth.signOut();
410
+ }, className: "border px-4 py-2 text-xs", children: "SIGN OUT" })
411
+ ] });
412
+ }
413
+ if (unauthenticatedContent) return /* @__PURE__ */ jsx4(Fragment2, { children: unauthenticatedContent });
314
414
  return /* @__PURE__ */ jsx4(
315
- "div",
415
+ AuthPage,
316
416
  {
317
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-xs font-mono p-4",
318
- onWheel: (e) => e.stopPropagation(),
319
- onPointerDown: (e) => e.stopPropagation(),
320
- children: /* @__PURE__ */ jsxs4("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: [
321
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between pb-3 border-b border-[var(--skipo-border-color)]", children: [
322
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
323
- /* @__PURE__ */ jsx4("div", { className: "w-7 h-7 bg-[var(--skipo-accent)] text-black font-black flex items-center justify-center text-xs rounded", children: "\u25B2" }),
324
- /* @__PURE__ */ jsxs4("span", { className: "font-black text-sm tracking-wider uppercase text-[var(--skipo-text)]", children: [
325
- appName,
326
- " Authentication"
327
- ] })
328
- ] }),
329
- /* @__PURE__ */ jsxs4("span", { className: "text-[9px] px-2 py-0.5 border border-emerald-500/50 bg-emerald-500/10 text-emerald-300 font-bold rounded flex items-center gap-1", children: [
330
- /* @__PURE__ */ jsx4(ShieldCheck, { size: 10 }),
331
- " SYSTEM DB"
332
- ] })
333
- ] }),
334
- error && /* @__PURE__ */ jsxs4("div", { className: "p-3 border border-red-500/60 bg-red-500/10 text-red-300 text-xs rounded flex items-start gap-2", children: [
335
- /* @__PURE__ */ jsx4(AlertCircle2, { size: 14, className: "shrink-0 mt-0.5" }),
336
- /* @__PURE__ */ jsx4("span", { children: error })
337
- ] }),
338
- /* @__PURE__ */ jsxs4("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
339
- isRegister && /* @__PURE__ */ jsxs4("div", { children: [
340
- /* @__PURE__ */ jsx4("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Full Name *" }),
341
- /* @__PURE__ */ jsx4(
342
- BaseInput,
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
- ] })
417
+ ...presentation,
418
+ onLogin: async (email, password) => {
419
+ const value = toResult(await auth.signIn({ email, password }));
420
+ if (value.success) onSuccess?.(value);
421
+ return value;
422
+ },
423
+ onRegister: async ({ name, email, password }) => {
424
+ const value = toResult(await auth.signUp({ name, email, password }));
425
+ if (value.success) onSuccess?.(value);
426
+ return value;
427
+ },
428
+ authError: auth.error,
429
+ onGoogleSignIn: async () => {
430
+ try {
431
+ const value = await auth.signInWithGoogle();
432
+ const payload = value && typeof value === "object" ? value : {};
433
+ const redirectUrl = typeof payload.url === "string" ? payload.url : void 0;
434
+ if (redirectUrl && typeof window !== "undefined") {
435
+ window.location.assign(redirectUrl);
436
+ return { success: true, redirectUrl };
437
+ }
438
+ const session = await auth.refresh();
439
+ return toResult(session);
440
+ } catch (cause) {
441
+ return { success: false, error: cause instanceof Error ? cause.message : "Google sign-in failed." };
442
+ }
443
+ }
450
444
  }
451
445
  );
452
446
  };
453
447
 
454
- // src/components/auth/LuthAuthClient.ts
455
- import {
456
- resolveClientOrigin,
457
- resolveClientEnvironment
458
- } from "@dinilmusick/gutts/auth";
459
- import {
460
- LuthAuthClient,
461
- createLuthAuthClient
462
- } from "@dinilmusick/gutts/auth";
463
- import { LuthAuthError } from "@dinilmusick/gutts/auth";
464
- var resolveLuthOrigin = resolveClientOrigin;
465
- var resolveLuthEnvironment = resolveClientEnvironment;
448
+ // src/components/auth/LoginModal.tsx
449
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
450
+ var LoginModal = ({
451
+ ecosystemId,
452
+ applicationId,
453
+ luthUrl,
454
+ appName = "Ecosystem App",
455
+ onSuccess,
456
+ defaultEmail = "",
457
+ onClose
458
+ }) => {
459
+ const auth = useLuthAuth({ ecosystemId, applicationId, luthUrl });
460
+ const [email, setEmail] = useState3(defaultEmail);
461
+ const [password, setPassword] = useState3("");
462
+ const [isRegister, setIsRegister] = useState3(false);
463
+ const [name, setName] = useState3("");
464
+ const [googleLoading, setGoogleLoading] = useState3(false);
465
+ const [localError, setLocalError] = useState3(null);
466
+ const deliveredUserId = useRef2(null);
467
+ useEffect3(() => {
468
+ if (auth.session.authenticated && auth.user && deliveredUserId.current !== auth.user.id) {
469
+ deliveredUserId.current = auth.user.id;
470
+ onSuccess(auth.user);
471
+ }
472
+ }, [auth.session.authenticated, auth.user, onSuccess]);
473
+ const handleSubmit = async (event) => {
474
+ event.preventDefault();
475
+ setLocalError(null);
476
+ try {
477
+ if (isRegister) await auth.signUp({ name: name.trim(), email: email.trim(), password });
478
+ else await auth.signIn({ email: email.trim(), password });
479
+ } catch (cause) {
480
+ setLocalError(cause instanceof Error ? cause.message : "Authentication failed.");
481
+ }
482
+ };
483
+ const handleGoogleSignIn = async () => {
484
+ setGoogleLoading(true);
485
+ setLocalError(null);
486
+ try {
487
+ const result = await auth.signInWithGoogle();
488
+ const payload = result && typeof result === "object" ? result : {};
489
+ if (typeof payload.url === "string" && typeof window !== "undefined") {
490
+ window.location.assign(payload.url);
491
+ return;
492
+ }
493
+ await auth.refresh();
494
+ } catch (cause) {
495
+ setLocalError(cause instanceof Error ? cause.message : "Google sign-in failed.");
496
+ } finally {
497
+ setGoogleLoading(false);
498
+ }
499
+ };
500
+ const error = localError || auth.error;
501
+ if (auth.initializing) {
502
+ 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..." });
503
+ }
504
+ 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: [
505
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between pb-3 border-b border-[var(--skipo-border-color)]", children: [
506
+ /* @__PURE__ */ jsxs5("span", { className: "font-black text-sm tracking-wider uppercase", children: [
507
+ appName,
508
+ " Authentication"
509
+ ] }),
510
+ onClose && /* @__PURE__ */ jsx5("button", { type: "button", onClick: onClose, "aria-label": "Close authentication", className: "text-xs", children: "CLOSE" })
511
+ ] }),
512
+ 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: [
513
+ /* @__PURE__ */ jsx5(AlertCircle2, { size: 14, className: "shrink-0 mt-0.5" }),
514
+ /* @__PURE__ */ jsx5("span", { children: error })
515
+ ] }),
516
+ /* @__PURE__ */ jsxs5("form", { onSubmit: (event) => void handleSubmit(event), className: "space-y-3", children: [
517
+ isRegister && /* @__PURE__ */ jsxs5("div", { children: [
518
+ /* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Full Name *" }),
519
+ /* @__PURE__ */ jsx5(BaseInput, { type: "text", value: name, onChange: (event) => setName(event.target.value), required: true, placeholder: "Your name", autoComplete: "name" })
520
+ ] }),
521
+ /* @__PURE__ */ jsxs5("div", { children: [
522
+ /* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Email Address *" }),
523
+ /* @__PURE__ */ jsx5(BaseInput, { type: "email", value: email, onChange: (event) => setEmail(event.target.value), required: true, placeholder: "user@example.com", autoComplete: "username" })
524
+ ] }),
525
+ /* @__PURE__ */ jsxs5("div", { children: [
526
+ /* @__PURE__ */ jsx5("label", { className: "block text-[10px] font-black uppercase mb-1", children: "Password *" }),
527
+ /* @__PURE__ */ jsx5(BaseInput, { type: "password", value: password, onChange: (event) => setPassword(event.target.value), required: true, autoComplete: isRegister ? "new-password" : "current-password" })
528
+ ] }),
529
+ /* @__PURE__ */ jsxs5(BaseButton, { variant: "accent", size: "md", type: "submit", disabled: auth.loading || googleLoading, className: "w-full flex items-center justify-center gap-2", children: [
530
+ /* @__PURE__ */ jsx5("span", { children: auth.loading ? "AUTHENTICATING..." : isRegister ? "REGISTER & ENTER" : "SIGN IN" }),
531
+ /* @__PURE__ */ jsx5(ArrowRight2, { size: 14 })
532
+ ] })
533
+ ] }),
534
+ /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
535
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-[9px] text-[var(--skipo-text-muted)]", children: [
536
+ /* @__PURE__ */ jsx5("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" }),
537
+ " OR ",
538
+ /* @__PURE__ */ jsx5("span", { className: "h-px flex-1 bg-[var(--skipo-border-color)]" })
539
+ ] }),
540
+ /* @__PURE__ */ jsx5(GoogleSignInButton, { disabled: auth.loading || googleLoading, loading: googleLoading, onSignIn: handleGoogleSignIn })
541
+ ] }),
542
+ /* @__PURE__ */ jsxs5("div", { className: "pt-2 border-t border-[var(--skipo-border-color)]/60 flex items-center justify-between text-[11px]", children: [
543
+ /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => {
544
+ setIsRegister(!isRegister);
545
+ setLocalError(null);
546
+ }, className: "text-[var(--skipo-accent)] hover:underline cursor-pointer", children: isRegister ? "Already have an account? Sign In" : "Create new account" }),
547
+ /* @__PURE__ */ jsx5("span", { className: "text-[10px] text-[var(--skipo-text-muted)]", children: "SECURED BY LUTH" })
548
+ ] })
549
+ ] }) });
550
+ };
466
551
 
467
- // src/components/auth/luthAuthTypes.ts
468
- import { LuthAuthError as LuthAuthError2 } from "@dinilmusick/gutts";
552
+ // src/components/auth/LuthProtectedRoute.tsx
553
+ import { jsx as jsx6 } from "react/jsx-runtime";
554
+ var LuthProtectedRoute = ({
555
+ ecosystemId,
556
+ applicationId,
557
+ luthUrl,
558
+ children,
559
+ fallback,
560
+ loadingFallback,
561
+ ...presentation
562
+ }) => /* @__PURE__ */ jsx6(
563
+ LuthAuthPage,
564
+ {
565
+ ...presentation,
566
+ ecosystemId,
567
+ applicationId,
568
+ luthUrl,
569
+ authenticatedContent: children,
570
+ unauthenticatedContent: fallback,
571
+ loadingContent: loadingFallback
572
+ }
573
+ );
469
574
 
470
575
  export {
471
576
  GoogleIcon,
@@ -474,9 +579,15 @@ export {
474
579
  authPageDefinition,
475
580
  AuthPage,
476
581
  AuthLoadingScreen,
477
- LoginModal,
478
582
  resolveLuthOrigin,
479
583
  resolveLuthEnvironment,
584
+ DEFAULT_LUTH_URL,
480
585
  LuthAuthClient,
481
- createLuthAuthClient
586
+ createLuthAuthClient,
587
+ LuthAuthError,
588
+ createLuthAuthClientForApplication,
589
+ useLuthAuth,
590
+ LuthAuthPage,
591
+ LoginModal,
592
+ LuthProtectedRoute
482
593
  };
@@ -1,14 +1,12 @@
1
1
  import React__default from 'react';
2
- import { resolveClientEnvironment, resolveClientOrigin } from '@dinilmusick/gutts/auth';
3
- export { LuthAuthClient, createLuthAuthClient } from '@dinilmusick/gutts/auth';
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: any, token: string) => void;
99
+ onSuccess: (user: LuthUser) => void;
95
100
  defaultEmail?: string;
96
- onGoogleSignIn?: () => Promise<void> | void;
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,50 @@ declare const GoogleIcon: React__default.FC<{
111
116
  }>;
112
117
  declare const GoogleSignInButton: React__default.FC<GoogleSignInButtonProps>;
113
118
 
114
- declare const resolveLuthOrigin: typeof resolveClientOrigin;
115
- declare const resolveLuthEnvironment: typeof resolveClientEnvironment;
119
+ interface LuthAuthConfig {
120
+ ecosystemId: string;
121
+ applicationId: string;
122
+ luthUrl?: string;
123
+ }
124
+ interface UseLuthAuthResult {
125
+ client: LuthAuthClient;
126
+ session: LuthSessionResult;
127
+ user: LuthSessionResult['user'];
128
+ loading: boolean;
129
+ initializing: boolean;
130
+ error: string | null;
131
+ refresh: (options?: {
132
+ silent?: boolean;
133
+ }) => Promise<LuthSessionResult>;
134
+ signIn: (credentials: {
135
+ email: string;
136
+ password: string;
137
+ }) => Promise<LuthSessionResult>;
138
+ signUp: (input: {
139
+ name: string;
140
+ email: string;
141
+ password: string;
142
+ }) => Promise<LuthSessionResult>;
143
+ signInWithGoogle: (callbackURL?: string) => Promise<unknown>;
144
+ signOut: () => Promise<void>;
145
+ }
146
+ interface LuthAuthPageProps extends Omit<AuthPageProps, 'onLogin' | 'onRegister' | 'onGoogleSignIn' | 'onSuccess'>, LuthAuthConfig {
147
+ onAuthenticated?: (user: NonNullable<LuthSessionResult['user']>) => void;
148
+ onSuccess?: (result: AuthResult) => void;
149
+ authenticatedContent?: React__default.ReactNode | ((auth: UseLuthAuthResult) => React__default.ReactNode);
150
+ unauthenticatedContent?: React__default.ReactNode;
151
+ loadingContent?: React__default.ReactNode;
152
+ }
153
+ declare function createLuthAuthClientForApplication(input: LuthAuthConfig): LuthAuthClient;
154
+ declare function useLuthAuth(config: LuthAuthConfig): UseLuthAuthResult;
155
+ declare const LuthAuthPage: React__default.FC<LuthAuthPageProps>;
156
+
157
+ interface LuthProtectedRouteProps extends Omit<LuthAuthPageProps, 'authenticatedContent' | 'unauthenticatedContent' | 'loadingContent'> {
158
+ children: React__default.ReactNode | ((auth: UseLuthAuthResult) => React__default.ReactNode);
159
+ fallback?: React__default.ReactNode;
160
+ loadingFallback?: React__default.ReactNode;
161
+ }
162
+ /** Protects application content using the same canonical Luth session lifecycle as LuthAuthPage. */
163
+ declare const LuthProtectedRoute: React__default.FC<LuthProtectedRouteProps>;
116
164
 
117
- export { AUTH_PAGE_REQUIRED_SERVICES, AuthLoadingScreen, type AuthLoadingScreenProps, AuthPage, type AuthPageProps, type AuthResult, GoogleIcon, GoogleSignInButton, type GoogleSignInButtonProps, LoginModal, type LoginModalProps, authPageDefinition, resolveLuthEnvironment, resolveLuthOrigin };
165
+ 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
- } from "../../chunk-KTLNNJFX.js";
17
+ resolveLuthOrigin,
18
+ useLuthAuth
19
+ } from "../../chunk-RSJ4EGDE.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 '@dinilmusick/gutts/auth';
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
@@ -64,6 +64,45 @@ import {
64
64
  TilesMenu,
65
65
  tilesMenuDefinition
66
66
  } from "./chunk-DZTJJOLR.js";
67
+ import {
68
+ ActionButton,
69
+ Badge,
70
+ ButtonParent,
71
+ CardPanel,
72
+ CategoryCardTile,
73
+ ChannelStripTile,
74
+ ClipCardTile,
75
+ DangerButton,
76
+ GhostButton,
77
+ IconButton,
78
+ InspectorPanel,
79
+ ModalPanel,
80
+ PanelParent,
81
+ SelectInput,
82
+ SliderInput,
83
+ SpawnOptionTile,
84
+ SplitButton,
85
+ StatusDot,
86
+ TelemetryPill,
87
+ TextInput,
88
+ TileParent,
89
+ ToggleButton,
90
+ ToggleInput,
91
+ ToolbarPanel,
92
+ UIParent
93
+ } from "./chunk-Q324BMDJ.js";
94
+ import "./chunk-SLJBDDSN.js";
95
+ import {
96
+ DEFAULT_PALETTE_ID,
97
+ THEME_STORAGE_KEY,
98
+ ThemeProvider,
99
+ applyPaletteToDocument,
100
+ getActivePalette,
101
+ paletteToSkipoThemePack,
102
+ subscribeToPalette,
103
+ usePalette,
104
+ useTheme
105
+ } from "./chunk-ZQK5I5ZL.js";
67
106
  import {
68
107
  frnlBadge,
69
108
  frnlBottomBar,
@@ -76,7 +115,6 @@ import {
76
115
  frnlToggleDefinition,
77
116
  frnlTopBar
78
117
  } from "./chunk-G5CYPT3P.js";
79
- import "./chunk-SLJBDDSN.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
- } from "./chunk-KTLNNJFX.js";
223
+ resolveLuthOrigin,
224
+ useLuthAuth
225
+ } from "./chunk-RSJ4EGDE.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,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floks/ui",
3
- "version": "1.2.0",
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.24.9"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "lucide-react": ">=0.300.0",