@vuer-ai/vuer-uikit 0.0.103 → 0.0.105
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/dist/auth/context/auth-context.d.cts +3 -5
- package/dist/auth/context/auth-context.d.ts +3 -5
- package/dist/auth/handler/get-session.cjs +11 -0
- package/dist/auth/handler/get-session.d.cts +19 -0
- package/dist/auth/handler/get-session.d.ts +19 -0
- package/dist/auth/handler/get-session.mjs +2 -0
- package/dist/auth/handler/sign-in-handler.cjs +3 -3
- package/dist/auth/handler/sign-in-handler.d.cts +0 -1
- package/dist/auth/handler/sign-in-handler.d.ts +0 -1
- package/dist/auth/handler/sign-in-handler.mjs +2 -2
- package/dist/auth/handler/sign-out-handler.cjs +11 -0
- package/dist/auth/handler/sign-out-handler.d.cts +5 -0
- package/dist/auth/handler/sign-out-handler.d.ts +5 -0
- package/dist/auth/handler/sign-out-handler.mjs +2 -0
- package/dist/auth/hooks/use-vuer-auth.d.cts +0 -1
- package/dist/auth/hooks/use-vuer-auth.d.ts +0 -1
- package/dist/auth/hooks/use-vuer-method.cjs +5 -4
- package/dist/auth/hooks/use-vuer-method.d.cts +2 -3
- package/dist/auth/hooks/use-vuer-method.d.ts +2 -3
- package/dist/auth/hooks/use-vuer-method.mjs +4 -3
- package/dist/auth/index.cjs +9 -13
- package/dist/auth/index.d.cts +1 -2
- package/dist/auth/index.d.ts +1 -2
- package/dist/auth/index.mjs +6 -6
- package/dist/auth/localstorage-key.cjs +2 -6
- package/dist/auth/localstorage-key.d.cts +1 -2
- package/dist/auth/localstorage-key.d.ts +1 -2
- package/dist/auth/localstorage-key.mjs +1 -1
- package/dist/auth/types.cjs +0 -12
- package/dist/auth/types.d.cts +10 -3466
- package/dist/auth/types.d.ts +10 -3466
- package/dist/auth/types.mjs +1 -1
- package/dist/auth/vuer-auth-provider.cjs +4 -5
- package/dist/auth/vuer-auth-provider.mjs +3 -4
- package/dist/{chunk-WGVKFNG6.mjs → chunk-276VJZCV.mjs} +1 -2
- package/dist/chunk-4CPB3XHE.cjs +18 -0
- package/dist/chunk-5HS4PMUR.mjs +45 -0
- package/dist/{chunk-FBAOEFDU.mjs → chunk-AKVHFPXH.mjs} +7 -5
- package/dist/chunk-CGODCUQ5.mjs +16 -0
- package/dist/{chunk-JWUIZX35.mjs → chunk-HJAKKWNJ.mjs} +2 -2
- package/dist/{chunk-SHHQDSSI.cjs → chunk-L6ZZKK4B.cjs} +2 -2
- package/dist/{chunk-I2BVWNRP.cjs → chunk-M3XTCMOA.cjs} +19 -19
- package/dist/{chunk-LSKJOUAE.cjs → chunk-PB4UO2NR.cjs} +3 -4
- package/dist/{chunk-YLDDI6SZ.mjs → chunk-SLBFCX35.mjs} +19 -19
- package/dist/{chunk-6BD5MQ5R.cjs → chunk-SVWS4AL6.cjs} +0 -2
- package/dist/chunk-T2D6PSA6.cjs +47 -0
- package/dist/chunk-T57VFBIC.mjs +17 -0
- package/dist/chunk-WTYBTOLO.cjs +19 -0
- package/dist/{chunk-JLWAIMUZ.cjs → chunk-XFTKHT2M.cjs} +8 -6
- package/dist/{chunk-7KQXX7QB.mjs → chunk-XGM57WPN.mjs} +2 -3
- package/dist/dial/DialPanel.cjs +19 -19
- package/dist/dial/DialPanel.d.cts +2 -1
- package/dist/dial/DialPanel.d.ts +2 -1
- package/dist/dial/DialPanel.mjs +18 -18
- package/dist/dial/index.cjs +35 -35
- package/dist/dial/index.mjs +18 -18
- package/dist/dial/wrapped-inputs/ControlledInputs.cjs +23 -23
- package/dist/dial/wrapped-inputs/ControlledInputs.mjs +18 -18
- package/dist/dial/wrapped-inputs/DialInputs.cjs +32 -32
- package/dist/dial/wrapped-inputs/DialInputs.mjs +18 -18
- package/dist/dial/wrapped-inputs/DialPresetsInput.cjs +19 -19
- package/dist/dial/wrapped-inputs/DialPresetsInput.mjs +18 -18
- package/dist/dial/wrapped-inputs/DialVectorInput.cjs +19 -19
- package/dist/dial/wrapped-inputs/DialVectorInput.mjs +18 -18
- package/dist/dial/wrapped-inputs/index.cjs +39 -39
- package/dist/dial/wrapped-inputs/index.mjs +18 -18
- package/dist/index.cjs +100 -100
- package/dist/index.mjs +18 -18
- package/dist/ui/UIKitBadge.cjs +5 -5
- package/dist/ui/UIKitBadge.mjs +1 -1
- package/dist/ui/index.cjs +73 -73
- package/dist/ui/index.mjs +16 -16
- package/dist/ui/inputs/index.cjs +18 -18
- package/dist/ui/inputs/index.mjs +4 -4
- package/dist/ui/inputs/number-inputs/index.cjs +18 -18
- package/dist/ui/inputs/number-inputs/index.mjs +4 -4
- package/dist/ui/layouts/index.cjs +5 -5
- package/dist/ui/layouts/index.mjs +1 -1
- package/dist/ui/tree-view/index.cjs +9 -9
- package/dist/ui/tree-view/index.mjs +1 -1
- package/dist/ui/waterfall/index.cjs +4 -4
- package/dist/ui/waterfall/index.mjs +3 -3
- package/package.json +1 -1
- package/src/auth/context/auth-context.ts +3 -4
- package/src/auth/handler/get-session.ts +17 -0
- package/src/auth/handler/sign-in-handler.ts +1 -2
- package/src/auth/handler/sign-out-handler.ts +13 -0
- package/src/auth/hooks/use-vuer-method.ts +8 -6
- package/src/auth/localstorage-key.ts +0 -2
- package/src/auth/types.ts +9 -27
- package/src/auth/vuer-auth-provider.tsx +25 -8
- package/src/dial/DialPanel.tsx +16 -14
- package/dist/auth/handler/create-client.cjs +0 -12
- package/dist/auth/handler/create-client.d.cts +0 -7
- package/dist/auth/handler/create-client.d.ts +0 -7
- package/dist/auth/handler/create-client.mjs +0 -3
- package/dist/chunk-ACYOVCGH.mjs +0 -30
- package/dist/chunk-CHYXRETV.cjs +0 -23
- package/dist/chunk-G6U2K2GR.cjs +0 -32
- package/dist/chunk-HPK4YEVK.cjs +0 -27
- package/dist/chunk-PKSIXQJX.mjs +0 -20
- package/dist/chunk-PZMA33PL.mjs +0 -25
- package/src/auth/handler/create-client.ts +0 -23
- package/dist/{chunk-5SP25SO3.cjs → chunk-7RHQ6DVU.cjs} +2 -2
- package/dist/{chunk-YHY6SXVJ.mjs → chunk-K2OC2HWQ.mjs} +2 -2
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7RHQ6DVU_cjs = require('../../chunk-7RHQ6DVU.cjs');
|
|
4
4
|
require('../../chunk-WJL5HMO6.cjs');
|
|
5
5
|
require('../../chunk-RJ7I6ZQK.cjs');
|
|
6
|
+
require('../../chunk-YXFHJKNW.cjs');
|
|
6
7
|
require('../../chunk-5MNZYCN2.cjs');
|
|
7
8
|
require('../../chunk-Z6UDRPC2.cjs');
|
|
8
9
|
require('../../chunk-YJ6X6T5K.cjs');
|
|
9
10
|
require('../../chunk-G5NT42YF.cjs');
|
|
11
|
+
require('../../chunk-EEGQLTSQ.cjs');
|
|
10
12
|
require('../../chunk-VOTZLQ6J.cjs');
|
|
11
13
|
require('../../chunk-2J75MYQA.cjs');
|
|
12
14
|
require('../../chunk-UTS56UA5.cjs');
|
|
13
15
|
require('../../chunk-JWVH6R35.cjs');
|
|
14
16
|
require('../../chunk-MVAFOQ67.cjs');
|
|
15
17
|
require('../../chunk-TUYG6BYZ.cjs');
|
|
16
|
-
require('../../chunk-YXFHJKNW.cjs');
|
|
17
18
|
var chunkG2ZYONQO_cjs = require('../../chunk-G2ZYONQO.cjs');
|
|
18
19
|
require('../../chunk-5JPYU5A6.cjs');
|
|
19
20
|
require('../../chunk-HAVTMZR3.cjs');
|
|
20
|
-
require('../../chunk-EEGQLTSQ.cjs');
|
|
21
21
|
require('../../chunk-LFSCJLL2.cjs');
|
|
22
22
|
require('../../chunk-LQGXG373.cjs');
|
|
23
23
|
require('../../chunk-JMCH2AFN.cjs');
|
|
@@ -38,7 +38,7 @@ require('../../chunk-G4FJGNY5.cjs');
|
|
|
38
38
|
|
|
39
39
|
Object.defineProperty(exports, "Waterfall", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk7RHQ6DVU_cjs.Waterfall; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "TOTAL_DURATION", {
|
|
44
44
|
enumerable: true,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { Waterfall } from '../../chunk-
|
|
1
|
+
export { Waterfall } from '../../chunk-K2OC2HWQ.mjs';
|
|
2
2
|
import '../../chunk-JWKOW2OV.mjs';
|
|
3
3
|
import '../../chunk-VPQ5SSY3.mjs';
|
|
4
|
+
import '../../chunk-CO6EASQO.mjs';
|
|
4
5
|
import '../../chunk-IR334P7F.mjs';
|
|
5
6
|
import '../../chunk-CIPI2V54.mjs';
|
|
6
7
|
import '../../chunk-WPDU2YYR.mjs';
|
|
7
8
|
import '../../chunk-HVVT3D2T.mjs';
|
|
9
|
+
import '../../chunk-PC5DHSC4.mjs';
|
|
8
10
|
import '../../chunk-HTAFERCZ.mjs';
|
|
9
11
|
import '../../chunk-SA5WKLYB.mjs';
|
|
10
12
|
import '../../chunk-D5H4XX6Q.mjs';
|
|
11
13
|
import '../../chunk-JVV7W3TP.mjs';
|
|
12
14
|
import '../../chunk-OC4HRPZU.mjs';
|
|
13
15
|
import '../../chunk-N6DSPSMM.mjs';
|
|
14
|
-
import '../../chunk-CO6EASQO.mjs';
|
|
15
16
|
export { TOTAL_DURATION, borderColorClasses, colorClasses, formatDuration, leftWedgeClasses, rightWedgeClasses } from '../../chunk-4U232QAX.mjs';
|
|
16
17
|
import '../../chunk-SUEFWFPX.mjs';
|
|
17
18
|
import '../../chunk-VQPJ7TLB.mjs';
|
|
18
|
-
import '../../chunk-PC5DHSC4.mjs';
|
|
19
19
|
import '../../chunk-5MBEK77I.mjs';
|
|
20
20
|
import '../../chunk-LRSDE62T.mjs';
|
|
21
21
|
import '../../chunk-BNDRHLLZ.mjs';
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Refetch, UserSession } from "../types";
|
|
4
4
|
|
|
5
5
|
interface IAuthContext {
|
|
6
6
|
baseURL: string;
|
|
7
|
-
data:
|
|
7
|
+
data: UserSession | null;
|
|
8
8
|
isPending: boolean;
|
|
9
|
-
|
|
10
|
-
refetch: () => void;
|
|
9
|
+
refetch: Refetch;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
const AuthContext = createContext<IAuthContext>(null!);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { bearerToken } from "../localstorage-key";
|
|
2
|
+
import { UserSession } from "../types";
|
|
3
|
+
|
|
4
|
+
const getSession = async (baseURL: string) => {
|
|
5
|
+
const token = localStorage.getItem(bearerToken) || "";
|
|
6
|
+
const res = await fetch(`${baseURL}/api/auth/get-session`, {
|
|
7
|
+
headers: {
|
|
8
|
+
Authorization: `Bearer ${token}`,
|
|
9
|
+
},
|
|
10
|
+
credentials: "include",
|
|
11
|
+
});
|
|
12
|
+
const authJWT = res.headers.get("set-auth-jwt");
|
|
13
|
+
const data = (await res.json()) as UserSession;
|
|
14
|
+
return { ...data, session: { ...data.session, jwt: authJWT ?? "" } };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { getSession };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { bearerToken } from "../localstorage-key";
|
|
2
|
+
|
|
3
|
+
export const signOutHandler = async (baseURL: string) => {
|
|
4
|
+
const token = localStorage.getItem(bearerToken) || "";
|
|
5
|
+
const res = await fetch(`${baseURL}/api/auth/sign-out`, {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: {
|
|
8
|
+
Authorization: `Bearer ${token}`,
|
|
9
|
+
},
|
|
10
|
+
credentials: "include",
|
|
11
|
+
});
|
|
12
|
+
return (await res.json()) as { success: boolean };
|
|
13
|
+
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { useCallback, useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { signInHandler } from "../handler/sign-in-handler";
|
|
4
|
-
import {
|
|
4
|
+
import { SignInWithOutBaseURLParams, SignOut } from "../types";
|
|
5
5
|
import { useVuerAuth } from "./use-vuer-auth";
|
|
6
|
+
import { signOutHandler } from "../handler/sign-out-handler";
|
|
6
7
|
|
|
7
8
|
interface UseVuerAuth {
|
|
8
9
|
signIn: (p?: SignInWithOutBaseURLParams) => Promise<string> | void;
|
|
9
|
-
signOut:
|
|
10
|
+
signOut: SignOut;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const useVuerMethod = (): UseVuerAuth => {
|
|
13
|
-
const { refetch,
|
|
14
|
+
const { refetch, baseURL } = useVuerAuth();
|
|
14
15
|
|
|
15
|
-
const signOutHandle = useCallback(() => {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const signOutHandle = useCallback(async () => {
|
|
17
|
+
await signOutHandler(baseURL);
|
|
18
|
+
await refetch();
|
|
19
|
+
}, [baseURL, refetch]);
|
|
18
20
|
|
|
19
21
|
const signInHandle = useCallback(
|
|
20
22
|
(props?: SignInWithOutBaseURLParams) => {
|
package/src/auth/types.ts
CHANGED
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { customSessionClient } from "better-auth/client/plugins";
|
|
3
|
-
import { customSession } from "better-auth/plugins";
|
|
4
|
-
import { createAuthClient } from "better-auth/react";
|
|
5
|
-
|
|
6
|
-
export const auth = betterAuth({
|
|
7
|
-
plugins: [
|
|
8
|
-
customSession(async (session) => {
|
|
9
|
-
return {
|
|
10
|
-
...session,
|
|
11
|
-
session: { ...session.session, sessionToken: "" },
|
|
12
|
-
};
|
|
13
|
-
}),
|
|
14
|
-
],
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export const options = {
|
|
18
|
-
plugins: [customSessionClient<typeof auth>()],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type BetterAuth = ReturnType<typeof createAuthClient<typeof options>>;
|
|
1
|
+
import { Session, User } from "better-auth";
|
|
22
2
|
|
|
23
|
-
|
|
3
|
+
interface UserSession {
|
|
4
|
+
user: User;
|
|
5
|
+
session: Session & { sessionToken: string; jwt: string };
|
|
6
|
+
}
|
|
24
7
|
|
|
25
8
|
interface SignInWithPopup {
|
|
26
9
|
baseURL: string;
|
|
@@ -34,9 +17,9 @@ interface SignInWithRedirect {
|
|
|
34
17
|
callbackURL: string;
|
|
35
18
|
}
|
|
36
19
|
|
|
37
|
-
type Refetch =
|
|
20
|
+
type Refetch = () => Promise<UserSession | null>;
|
|
38
21
|
|
|
39
|
-
type SignOut =
|
|
22
|
+
type SignOut = () => Promise<void>;
|
|
40
23
|
|
|
41
24
|
type SignInParams = SignInWithPopup | SignInWithRedirect;
|
|
42
25
|
|
|
@@ -45,10 +28,9 @@ type SignInWithOutBaseURLParams =
|
|
|
45
28
|
| Omit<SignInWithRedirect, "baseURL">;
|
|
46
29
|
|
|
47
30
|
export type {
|
|
48
|
-
SignOut,
|
|
49
31
|
Refetch,
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
SignOut,
|
|
33
|
+
UserSession,
|
|
52
34
|
SignInParams,
|
|
53
35
|
SignInWithOutBaseURLParams,
|
|
54
36
|
SignInWithPopup,
|
|
@@ -1,33 +1,50 @@
|
|
|
1
|
-
import { PropsWithChildren, useEffect, useMemo,
|
|
1
|
+
import { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import { AuthContext } from "./context/auth-context";
|
|
4
|
-
import {
|
|
4
|
+
import { getSession } from "./handler/get-session";
|
|
5
5
|
import { bearerToken } from "./localstorage-key";
|
|
6
|
+
import { UserSession } from "./types";
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
8
9
|
baseURL: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function VuerAuthProvider({ children, baseURL }: PropsWithChildren<Props>) {
|
|
12
|
-
const
|
|
13
|
+
const [isPending, setIsPending] = useState<boolean>(true);
|
|
14
|
+
const [session, setSession] = useState<UserSession | null>(null);
|
|
13
15
|
|
|
14
|
-
const
|
|
16
|
+
const refetchHandle = useCallback(async () => {
|
|
17
|
+
setIsPending(true);
|
|
18
|
+
const data = await getSession(baseURL);
|
|
19
|
+
setSession(data);
|
|
20
|
+
setIsPending(false);
|
|
21
|
+
return data;
|
|
22
|
+
}, [baseURL]);
|
|
15
23
|
|
|
16
24
|
useEffect(() => {
|
|
17
25
|
const searchParams = new URLSearchParams(window.location.search);
|
|
18
26
|
const session = searchParams.get("token");
|
|
19
27
|
if (session) {
|
|
20
28
|
localStorage.setItem(bearerToken, encodeURIComponent(session));
|
|
21
|
-
|
|
29
|
+
refetchHandle().then(() => console.log("Sign in session"));
|
|
22
30
|
window.history.replaceState({}, "", window.location.pathname);
|
|
23
31
|
}
|
|
24
|
-
}, [
|
|
32
|
+
}, [refetchHandle]);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
refetchHandle().then(() => console.log("Init session"));
|
|
36
|
+
}, [refetchHandle]);
|
|
25
37
|
|
|
26
38
|
return (
|
|
27
39
|
<AuthContext.Provider
|
|
28
40
|
value={useMemo(() => {
|
|
29
|
-
return {
|
|
30
|
-
|
|
41
|
+
return {
|
|
42
|
+
baseURL,
|
|
43
|
+
isPending,
|
|
44
|
+
data: session,
|
|
45
|
+
refetch: refetchHandle,
|
|
46
|
+
};
|
|
47
|
+
}, [baseURL, session, isPending, refetchHandle])}
|
|
31
48
|
>
|
|
32
49
|
{children}
|
|
33
50
|
</AuthContext.Provider>
|
package/src/dial/DialPanel.tsx
CHANGED
|
@@ -19,9 +19,10 @@ import {
|
|
|
19
19
|
interface DialSchemaRendererProps {
|
|
20
20
|
schemas: DialSchema[];
|
|
21
21
|
groups?: DialGroupConfig[];
|
|
22
|
+
layout?: LabelPositionT;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups: groupConfigs }) => {
|
|
25
|
+
export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups: groupConfigs, layout }) => {
|
|
25
26
|
// Create a map of group configurations for easy lookup
|
|
26
27
|
const groupConfigMap: Record<string, DialGroupConfig> = {};
|
|
27
28
|
|
|
@@ -64,7 +65,8 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
64
65
|
// Render a single schema item as an input component
|
|
65
66
|
const renderSchemaInput = (schema: DialSchema) => {
|
|
66
67
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
67
|
-
|
|
68
|
+
// Use schema's label position if specified, otherwise fall back to panel's layout prop
|
|
69
|
+
const effectiveLabelPosition = (tags?.labelPosition as LabelPositionT) || layout;
|
|
68
70
|
const label = schema.label || (name.charAt(0).toUpperCase() + name.slice(1));
|
|
69
71
|
|
|
70
72
|
// Choose the right input component based on dtype
|
|
@@ -76,7 +78,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
76
78
|
name={name}
|
|
77
79
|
label={label}
|
|
78
80
|
step={step}
|
|
79
|
-
labelPosition={
|
|
81
|
+
labelPosition={effectiveLabelPosition}
|
|
80
82
|
/>
|
|
81
83
|
);
|
|
82
84
|
|
|
@@ -87,7 +89,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
87
89
|
name={name}
|
|
88
90
|
label={label}
|
|
89
91
|
step={step}
|
|
90
|
-
labelPosition={
|
|
92
|
+
labelPosition={effectiveLabelPosition}
|
|
91
93
|
/>
|
|
92
94
|
);
|
|
93
95
|
|
|
@@ -98,7 +100,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
98
100
|
name={name}
|
|
99
101
|
label={label}
|
|
100
102
|
step={step}
|
|
101
|
-
labelPosition={
|
|
103
|
+
labelPosition={effectiveLabelPosition}
|
|
102
104
|
/>
|
|
103
105
|
);
|
|
104
106
|
|
|
@@ -110,7 +112,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
110
112
|
|
|
111
113
|
case "boolean":
|
|
112
114
|
return (
|
|
113
|
-
<DialBooleanInput key={name} name={name} label={label} labelPosition={
|
|
115
|
+
<DialBooleanInput key={name} name={name} label={label} labelPosition={effectiveLabelPosition} />
|
|
114
116
|
);
|
|
115
117
|
|
|
116
118
|
case "number-slider":
|
|
@@ -123,7 +125,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
123
125
|
min={min}
|
|
124
126
|
max={max}
|
|
125
127
|
step={step}
|
|
126
|
-
labelPosition={
|
|
128
|
+
labelPosition={effectiveLabelPosition}
|
|
127
129
|
/>
|
|
128
130
|
);
|
|
129
131
|
|
|
@@ -135,7 +137,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
135
137
|
name={name}
|
|
136
138
|
label={label}
|
|
137
139
|
step={step || 1}
|
|
138
|
-
labelPosition={
|
|
140
|
+
labelPosition={effectiveLabelPosition}
|
|
139
141
|
/>
|
|
140
142
|
);
|
|
141
143
|
|
|
@@ -147,7 +149,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
147
149
|
name={name}
|
|
148
150
|
label={label}
|
|
149
151
|
step={step}
|
|
150
|
-
labelPosition={
|
|
152
|
+
labelPosition={effectiveLabelPosition}
|
|
151
153
|
/>
|
|
152
154
|
);
|
|
153
155
|
|
|
@@ -162,7 +164,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
162
164
|
min={min}
|
|
163
165
|
max={max}
|
|
164
166
|
step={step}
|
|
165
|
-
labelPosition={
|
|
167
|
+
labelPosition={effectiveLabelPosition}
|
|
166
168
|
/>
|
|
167
169
|
);
|
|
168
170
|
}
|
|
@@ -175,7 +177,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
175
177
|
name={name}
|
|
176
178
|
label={label}
|
|
177
179
|
options={options}
|
|
178
|
-
labelPosition={
|
|
180
|
+
labelPosition={effectiveLabelPosition}
|
|
179
181
|
/>
|
|
180
182
|
);
|
|
181
183
|
}
|
|
@@ -189,7 +191,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
189
191
|
min={min}
|
|
190
192
|
max={max}
|
|
191
193
|
step={step}
|
|
192
|
-
labelPosition={
|
|
194
|
+
labelPosition={effectiveLabelPosition}
|
|
193
195
|
/>
|
|
194
196
|
);
|
|
195
197
|
|
|
@@ -206,7 +208,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
206
208
|
name={name}
|
|
207
209
|
label={label}
|
|
208
210
|
options={options}
|
|
209
|
-
labelPosition={
|
|
211
|
+
labelPosition={effectiveLabelPosition}
|
|
210
212
|
/>
|
|
211
213
|
);
|
|
212
214
|
}
|
|
@@ -217,7 +219,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
217
219
|
name={name}
|
|
218
220
|
label={label}
|
|
219
221
|
placeholder={`Enter ${label.toLowerCase()}`}
|
|
220
|
-
labelPosition={
|
|
222
|
+
labelPosition={effectiveLabelPosition}
|
|
221
223
|
/>
|
|
222
224
|
);
|
|
223
225
|
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkHPK4YEVK_cjs = require('../../chunk-HPK4YEVK.cjs');
|
|
4
|
-
require('../../chunk-6BD5MQ5R.cjs');
|
|
5
|
-
require('../../chunk-CHYXRETV.cjs');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "createClient", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return chunkHPK4YEVK_cjs.createClient; }
|
|
12
|
-
});
|
package/dist/chunk-ACYOVCGH.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createClient } from './chunk-PZMA33PL.mjs';
|
|
2
|
-
import { AuthContext } from './chunk-TC3W4VRO.mjs';
|
|
3
|
-
import { bearerToken } from './chunk-WGVKFNG6.mjs';
|
|
4
|
-
import { useRef, useEffect, useMemo } from 'react';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function VuerAuthProvider({ children, baseURL }) {
|
|
8
|
-
const authClient = useRef(createClient(baseURL));
|
|
9
|
-
const { data, isPending, refetch } = authClient.current.useSession();
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
12
|
-
const session = searchParams.get("token");
|
|
13
|
-
if (session) {
|
|
14
|
-
localStorage.setItem(bearerToken, encodeURIComponent(session));
|
|
15
|
-
refetch();
|
|
16
|
-
window.history.replaceState({}, "", window.location.pathname);
|
|
17
|
-
}
|
|
18
|
-
}, [refetch]);
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
AuthContext.Provider,
|
|
21
|
-
{
|
|
22
|
-
value: useMemo(() => {
|
|
23
|
-
return { data, isPending, refetch, authClient: authClient.current, baseURL };
|
|
24
|
-
}, [baseURL, data, isPending, refetch]),
|
|
25
|
-
children
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { VuerAuthProvider };
|
package/dist/chunk-CHYXRETV.cjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var betterAuth = require('better-auth');
|
|
4
|
-
var plugins$1 = require('better-auth/client/plugins');
|
|
5
|
-
var plugins = require('better-auth/plugins');
|
|
6
|
-
|
|
7
|
-
// src/auth/types.ts
|
|
8
|
-
var auth = betterAuth.betterAuth({
|
|
9
|
-
plugins: [
|
|
10
|
-
plugins.customSession(async (session) => {
|
|
11
|
-
return {
|
|
12
|
-
...session,
|
|
13
|
-
session: { ...session.session, sessionToken: "" }
|
|
14
|
-
};
|
|
15
|
-
})
|
|
16
|
-
]
|
|
17
|
-
});
|
|
18
|
-
var options = {
|
|
19
|
-
plugins: [plugins$1.customSessionClient()]
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.auth = auth;
|
|
23
|
-
exports.options = options;
|
package/dist/chunk-G6U2K2GR.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkHPK4YEVK_cjs = require('./chunk-HPK4YEVK.cjs');
|
|
4
|
-
var chunkZULCZ5L6_cjs = require('./chunk-ZULCZ5L6.cjs');
|
|
5
|
-
var chunk6BD5MQ5R_cjs = require('./chunk-6BD5MQ5R.cjs');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function VuerAuthProvider({ children, baseURL }) {
|
|
10
|
-
const authClient = react.useRef(chunkHPK4YEVK_cjs.createClient(baseURL));
|
|
11
|
-
const { data, isPending, refetch } = authClient.current.useSession();
|
|
12
|
-
react.useEffect(() => {
|
|
13
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
14
|
-
const session = searchParams.get("token");
|
|
15
|
-
if (session) {
|
|
16
|
-
localStorage.setItem(chunk6BD5MQ5R_cjs.bearerToken, encodeURIComponent(session));
|
|
17
|
-
refetch();
|
|
18
|
-
window.history.replaceState({}, "", window.location.pathname);
|
|
19
|
-
}
|
|
20
|
-
}, [refetch]);
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
-
chunkZULCZ5L6_cjs.AuthContext.Provider,
|
|
23
|
-
{
|
|
24
|
-
value: react.useMemo(() => {
|
|
25
|
-
return { data, isPending, refetch, authClient: authClient.current, baseURL };
|
|
26
|
-
}, [baseURL, data, isPending, refetch]),
|
|
27
|
-
children
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.VuerAuthProvider = VuerAuthProvider;
|
package/dist/chunk-HPK4YEVK.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk6BD5MQ5R_cjs = require('./chunk-6BD5MQ5R.cjs');
|
|
4
|
-
var chunkCHYXRETV_cjs = require('./chunk-CHYXRETV.cjs');
|
|
5
|
-
var react = require('better-auth/react');
|
|
6
|
-
|
|
7
|
-
var createClient = (baseURL) => {
|
|
8
|
-
return react.createAuthClient({
|
|
9
|
-
...chunkCHYXRETV_cjs.options,
|
|
10
|
-
baseURL,
|
|
11
|
-
fetchOptions: {
|
|
12
|
-
auth: {
|
|
13
|
-
type: "Bearer",
|
|
14
|
-
token: () => localStorage.getItem(chunk6BD5MQ5R_cjs.bearerToken) || ""
|
|
15
|
-
// get the token from localStorage
|
|
16
|
-
},
|
|
17
|
-
onSuccess: (ctx) => {
|
|
18
|
-
const jwt = ctx.response.headers.get("set-auth-jwt");
|
|
19
|
-
if (jwt) {
|
|
20
|
-
localStorage.setItem(chunk6BD5MQ5R_cjs.jwtToken, jwt);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.createClient = createClient;
|
package/dist/chunk-PKSIXQJX.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { betterAuth } from 'better-auth';
|
|
2
|
-
import { customSessionClient } from 'better-auth/client/plugins';
|
|
3
|
-
import { customSession } from 'better-auth/plugins';
|
|
4
|
-
|
|
5
|
-
// src/auth/types.ts
|
|
6
|
-
var auth = betterAuth({
|
|
7
|
-
plugins: [
|
|
8
|
-
customSession(async (session) => {
|
|
9
|
-
return {
|
|
10
|
-
...session,
|
|
11
|
-
session: { ...session.session, sessionToken: "" }
|
|
12
|
-
};
|
|
13
|
-
})
|
|
14
|
-
]
|
|
15
|
-
});
|
|
16
|
-
var options = {
|
|
17
|
-
plugins: [customSessionClient()]
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { auth, options };
|
package/dist/chunk-PZMA33PL.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jwtToken, bearerToken } from './chunk-WGVKFNG6.mjs';
|
|
2
|
-
import { options } from './chunk-PKSIXQJX.mjs';
|
|
3
|
-
import { createAuthClient } from 'better-auth/react';
|
|
4
|
-
|
|
5
|
-
var createClient = (baseURL) => {
|
|
6
|
-
return createAuthClient({
|
|
7
|
-
...options,
|
|
8
|
-
baseURL,
|
|
9
|
-
fetchOptions: {
|
|
10
|
-
auth: {
|
|
11
|
-
type: "Bearer",
|
|
12
|
-
token: () => localStorage.getItem(bearerToken) || ""
|
|
13
|
-
// get the token from localStorage
|
|
14
|
-
},
|
|
15
|
-
onSuccess: (ctx) => {
|
|
16
|
-
const jwt = ctx.response.headers.get("set-auth-jwt");
|
|
17
|
-
if (jwt) {
|
|
18
|
-
localStorage.setItem(jwtToken, jwt);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export { createClient };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createAuthClient } from "better-auth/react";
|
|
2
|
-
|
|
3
|
-
import { bearerToken, jwtToken } from "../localstorage-key";
|
|
4
|
-
import { BetterAuth, options } from "../types";
|
|
5
|
-
|
|
6
|
-
export const createClient = (baseURL: string): BetterAuth => {
|
|
7
|
-
return createAuthClient({
|
|
8
|
-
...options,
|
|
9
|
-
baseURL: baseURL,
|
|
10
|
-
fetchOptions: {
|
|
11
|
-
auth: {
|
|
12
|
-
type: "Bearer",
|
|
13
|
-
token: () => localStorage.getItem(bearerToken) || "", // get the token from localStorage
|
|
14
|
-
},
|
|
15
|
-
onSuccess: (ctx) => {
|
|
16
|
-
const jwt = ctx.response.headers.get("set-auth-jwt");
|
|
17
|
-
if (jwt) {
|
|
18
|
-
localStorage.setItem(jwtToken, jwt);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
};
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkWJL5HMO6_cjs = require('./chunk-WJL5HMO6.cjs');
|
|
4
4
|
var chunkRJ7I6ZQK_cjs = require('./chunk-RJ7I6ZQK.cjs');
|
|
5
|
+
var chunkYXFHJKNW_cjs = require('./chunk-YXFHJKNW.cjs');
|
|
5
6
|
var chunk5MNZYCN2_cjs = require('./chunk-5MNZYCN2.cjs');
|
|
6
7
|
var chunkZ6UDRPC2_cjs = require('./chunk-Z6UDRPC2.cjs');
|
|
8
|
+
var chunkEEGQLTSQ_cjs = require('./chunk-EEGQLTSQ.cjs');
|
|
7
9
|
var chunk2J75MYQA_cjs = require('./chunk-2J75MYQA.cjs');
|
|
8
10
|
var chunkUTS56UA5_cjs = require('./chunk-UTS56UA5.cjs');
|
|
9
11
|
var chunkJWVH6R35_cjs = require('./chunk-JWVH6R35.cjs');
|
|
10
12
|
var chunkMVAFOQ67_cjs = require('./chunk-MVAFOQ67.cjs');
|
|
11
13
|
var chunkTUYG6BYZ_cjs = require('./chunk-TUYG6BYZ.cjs');
|
|
12
|
-
var chunkYXFHJKNW_cjs = require('./chunk-YXFHJKNW.cjs');
|
|
13
14
|
var chunkG2ZYONQO_cjs = require('./chunk-G2ZYONQO.cjs');
|
|
14
15
|
var chunk5JPYU5A6_cjs = require('./chunk-5JPYU5A6.cjs');
|
|
15
16
|
var chunkHAVTMZR3_cjs = require('./chunk-HAVTMZR3.cjs');
|
|
16
|
-
var chunkEEGQLTSQ_cjs = require('./chunk-EEGQLTSQ.cjs');
|
|
17
17
|
var chunkLFSCJLL2_cjs = require('./chunk-LFSCJLL2.cjs');
|
|
18
18
|
var chunkG5JZGNKY_cjs = require('./chunk-G5JZGNKY.cjs');
|
|
19
19
|
var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
|