@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
package/dist/auth/types.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkT2D6PSA6_cjs = require('../chunk-T2D6PSA6.cjs');
|
|
4
|
+
require('../chunk-WTYBTOLO.cjs');
|
|
5
5
|
require('../chunk-ZULCZ5L6.cjs');
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-CHYXRETV.cjs');
|
|
6
|
+
require('../chunk-SVWS4AL6.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
Object.defineProperty(exports, "VuerAuthProvider", {
|
|
12
11
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkT2D6PSA6_cjs.VuerAuthProvider; }
|
|
14
13
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { VuerAuthProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { VuerAuthProvider } from '../chunk-5HS4PMUR.mjs';
|
|
2
|
+
import '../chunk-T57VFBIC.mjs';
|
|
3
3
|
import '../chunk-TC3W4VRO.mjs';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-PKSIXQJX.mjs';
|
|
4
|
+
import '../chunk-276VJZCV.mjs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkSVWS4AL6_cjs = require('./chunk-SVWS4AL6.cjs');
|
|
4
|
+
|
|
5
|
+
// src/auth/handler/sign-out-handler.ts
|
|
6
|
+
var signOutHandler = async (baseURL) => {
|
|
7
|
+
const token = localStorage.getItem(chunkSVWS4AL6_cjs.bearerToken) || "";
|
|
8
|
+
const res = await fetch(`${baseURL}/api/auth/sign-out`, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${token}`
|
|
12
|
+
},
|
|
13
|
+
credentials: "include"
|
|
14
|
+
});
|
|
15
|
+
return await res.json();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
exports.signOutHandler = signOutHandler;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getSession } from './chunk-T57VFBIC.mjs';
|
|
2
|
+
import { AuthContext } from './chunk-TC3W4VRO.mjs';
|
|
3
|
+
import { bearerToken } from './chunk-276VJZCV.mjs';
|
|
4
|
+
import { useState, useCallback, useEffect, useMemo } from 'react';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function VuerAuthProvider({ children, baseURL }) {
|
|
8
|
+
const [isPending, setIsPending] = useState(true);
|
|
9
|
+
const [session, setSession] = useState(null);
|
|
10
|
+
const refetchHandle = useCallback(async () => {
|
|
11
|
+
setIsPending(true);
|
|
12
|
+
const data = await getSession(baseURL);
|
|
13
|
+
setSession(data);
|
|
14
|
+
setIsPending(false);
|
|
15
|
+
return data;
|
|
16
|
+
}, [baseURL]);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
19
|
+
const session2 = searchParams.get("token");
|
|
20
|
+
if (session2) {
|
|
21
|
+
localStorage.setItem(bearerToken, encodeURIComponent(session2));
|
|
22
|
+
refetchHandle().then(() => console.log("Sign in session"));
|
|
23
|
+
window.history.replaceState({}, "", window.location.pathname);
|
|
24
|
+
}
|
|
25
|
+
}, [refetchHandle]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
refetchHandle().then(() => console.log("Init session"));
|
|
28
|
+
}, [refetchHandle]);
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
AuthContext.Provider,
|
|
31
|
+
{
|
|
32
|
+
value: useMemo(() => {
|
|
33
|
+
return {
|
|
34
|
+
baseURL,
|
|
35
|
+
isPending,
|
|
36
|
+
data: session,
|
|
37
|
+
refetch: refetchHandle
|
|
38
|
+
};
|
|
39
|
+
}, [baseURL, session, isPending, refetchHandle]),
|
|
40
|
+
children
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { VuerAuthProvider };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { signInHandler } from './chunk-XGM57WPN.mjs';
|
|
2
|
+
import { signOutHandler } from './chunk-CGODCUQ5.mjs';
|
|
1
3
|
import { useVuerAuth } from './chunk-3IVDCAFM.mjs';
|
|
2
|
-
import { signInHandler } from './chunk-7KQXX7QB.mjs';
|
|
3
4
|
import { useCallback, useMemo } from 'react';
|
|
4
5
|
|
|
5
6
|
var useVuerMethod = () => {
|
|
6
|
-
const { refetch,
|
|
7
|
-
const signOutHandle = useCallback(() => {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const { refetch, baseURL } = useVuerAuth();
|
|
8
|
+
const signOutHandle = useCallback(async () => {
|
|
9
|
+
await signOutHandler(baseURL);
|
|
10
|
+
await refetch();
|
|
11
|
+
}, [baseURL, refetch]);
|
|
10
12
|
const signInHandle = useCallback(
|
|
11
13
|
(props) => {
|
|
12
14
|
return signInHandler({ ...props, baseURL }, refetch);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { bearerToken } from './chunk-276VJZCV.mjs';
|
|
2
|
+
|
|
3
|
+
// src/auth/handler/sign-out-handler.ts
|
|
4
|
+
var signOutHandler = async (baseURL) => {
|
|
5
|
+
const token = localStorage.getItem(bearerToken) || "";
|
|
6
|
+
const res = await fetch(`${baseURL}/api/auth/sign-out`, {
|
|
7
|
+
method: "POST",
|
|
8
|
+
headers: {
|
|
9
|
+
Authorization: `Bearer ${token}`
|
|
10
|
+
},
|
|
11
|
+
credentials: "include"
|
|
12
|
+
});
|
|
13
|
+
return await res.json();
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { signOutHandler };
|
|
@@ -2,9 +2,9 @@ import { cn } from './chunk-HMN4IKTG.mjs';
|
|
|
2
2
|
import { GitBranch } from 'lucide-react';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
var PACKAGE_VERSION = "0.0.
|
|
5
|
+
var PACKAGE_VERSION = "0.0.105" ;
|
|
6
6
|
var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
|
|
7
|
-
var GIT_HASH = "
|
|
7
|
+
var GIT_HASH = "da30884" ;
|
|
8
8
|
function PackageBadge({
|
|
9
9
|
className,
|
|
10
10
|
packageName,
|
|
@@ -4,9 +4,9 @@ var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
|
|
|
4
4
|
var lucideReact = require('lucide-react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
|
-
var PACKAGE_VERSION = "0.0.
|
|
7
|
+
var PACKAGE_VERSION = "0.0.105" ;
|
|
8
8
|
var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
|
|
9
|
-
var GIT_HASH = "
|
|
9
|
+
var GIT_HASH = "da30884" ;
|
|
10
10
|
function PackageBadge({
|
|
11
11
|
className,
|
|
12
12
|
packageName,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkNSUFTZNC_cjs = require('./chunk-NSUFTZNC.cjs');
|
|
3
4
|
var chunkHN3AMWUM_cjs = require('./chunk-HN3AMWUM.cjs');
|
|
5
|
+
var chunkD5WOPTKY_cjs = require('./chunk-D5WOPTKY.cjs');
|
|
6
|
+
var chunk2EG65KGO_cjs = require('./chunk-2EG65KGO.cjs');
|
|
4
7
|
var chunkAJQEHMYV_cjs = require('./chunk-AJQEHMYV.cjs');
|
|
5
8
|
var chunkPTCDBU72_cjs = require('./chunk-PTCDBU72.cjs');
|
|
6
9
|
var chunk64L2SNKA_cjs = require('./chunk-64L2SNKA.cjs');
|
|
7
10
|
var chunkEAXBNWXE_cjs = require('./chunk-EAXBNWXE.cjs');
|
|
8
|
-
var
|
|
11
|
+
var chunkJFIAWTRH_cjs = require('./chunk-JFIAWTRH.cjs');
|
|
9
12
|
var chunkAOV3ADTV_cjs = require('./chunk-AOV3ADTV.cjs');
|
|
10
13
|
var chunkA2UZY7Y2_cjs = require('./chunk-A2UZY7Y2.cjs');
|
|
11
|
-
var chunkD5WOPTKY_cjs = require('./chunk-D5WOPTKY.cjs');
|
|
12
|
-
var chunk2EG65KGO_cjs = require('./chunk-2EG65KGO.cjs');
|
|
13
|
-
var chunkJFIAWTRH_cjs = require('./chunk-JFIAWTRH.cjs');
|
|
14
14
|
var chunkZRRCYQ53_cjs = require('./chunk-ZRRCYQ53.cjs');
|
|
15
15
|
var chunk7GJVMFKJ_cjs = require('./chunk-7GJVMFKJ.cjs');
|
|
16
16
|
var chunk5XBMFADS_cjs = require('./chunk-5XBMFADS.cjs');
|
|
@@ -19,9 +19,9 @@ var chunkEKPJUR3U_cjs = require('./chunk-EKPJUR3U.cjs');
|
|
|
19
19
|
var chunkVJN3GGLZ_cjs = require('./chunk-VJN3GGLZ.cjs');
|
|
20
20
|
var chunkM4IHJGJE_cjs = require('./chunk-M4IHJGJE.cjs');
|
|
21
21
|
var chunkUASPJ57U_cjs = require('./chunk-UASPJ57U.cjs');
|
|
22
|
+
var chunkRMK6W774_cjs = require('./chunk-RMK6W774.cjs');
|
|
22
23
|
var chunkLQGXG373_cjs = require('./chunk-LQGXG373.cjs');
|
|
23
24
|
var chunk4PKPCOAF_cjs = require('./chunk-4PKPCOAF.cjs');
|
|
24
|
-
var chunkRMK6W774_cjs = require('./chunk-RMK6W774.cjs');
|
|
25
25
|
var jsxRuntime = require('react/jsx-runtime');
|
|
26
26
|
|
|
27
27
|
var DialInputWrapper = ({ label, children }) => {
|
|
@@ -560,7 +560,7 @@ var DialVectorInput2 = ({
|
|
|
560
560
|
] })
|
|
561
561
|
] });
|
|
562
562
|
};
|
|
563
|
-
var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
563
|
+
var DialPanel = ({ schemas, groups: groupConfigs, layout }) => {
|
|
564
564
|
const groupConfigMap = {};
|
|
565
565
|
if (groupConfigs) {
|
|
566
566
|
groupConfigs.forEach((config) => {
|
|
@@ -591,7 +591,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
591
591
|
});
|
|
592
592
|
const renderSchemaInput = (schema) => {
|
|
593
593
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
594
|
-
const
|
|
594
|
+
const effectiveLabelPosition = tags?.labelPosition || layout;
|
|
595
595
|
const label = schema.label || name.charAt(0).toUpperCase() + name.slice(1);
|
|
596
596
|
switch (dtype) {
|
|
597
597
|
case "vector3":
|
|
@@ -601,7 +601,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
601
601
|
name,
|
|
602
602
|
label,
|
|
603
603
|
step,
|
|
604
|
-
labelPosition
|
|
604
|
+
labelPosition: effectiveLabelPosition
|
|
605
605
|
},
|
|
606
606
|
name
|
|
607
607
|
);
|
|
@@ -612,7 +612,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
612
612
|
name,
|
|
613
613
|
label,
|
|
614
614
|
step,
|
|
615
|
-
labelPosition
|
|
615
|
+
labelPosition: effectiveLabelPosition
|
|
616
616
|
},
|
|
617
617
|
name
|
|
618
618
|
);
|
|
@@ -623,7 +623,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
623
623
|
name,
|
|
624
624
|
label,
|
|
625
625
|
step,
|
|
626
|
-
labelPosition
|
|
626
|
+
labelPosition: effectiveLabelPosition
|
|
627
627
|
},
|
|
628
628
|
name
|
|
629
629
|
);
|
|
@@ -632,7 +632,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
632
632
|
case "number-group":
|
|
633
633
|
return /* @__PURE__ */ jsxRuntime.jsx(DialVectorInput2, { name, label }, name);
|
|
634
634
|
case "boolean":
|
|
635
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DialBooleanInput, { name, label, labelPosition }, name);
|
|
635
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialBooleanInput, { name, label, labelPosition: effectiveLabelPosition }, name);
|
|
636
636
|
case "number-slider":
|
|
637
637
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
638
638
|
DialSliderInput,
|
|
@@ -642,7 +642,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
642
642
|
min,
|
|
643
643
|
max,
|
|
644
644
|
step,
|
|
645
|
-
labelPosition
|
|
645
|
+
labelPosition: effectiveLabelPosition
|
|
646
646
|
},
|
|
647
647
|
name
|
|
648
648
|
);
|
|
@@ -653,7 +653,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
653
653
|
name,
|
|
654
654
|
label,
|
|
655
655
|
step: step || 1,
|
|
656
|
-
labelPosition
|
|
656
|
+
labelPosition: effectiveLabelPosition
|
|
657
657
|
},
|
|
658
658
|
name
|
|
659
659
|
);
|
|
@@ -664,7 +664,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
664
664
|
name,
|
|
665
665
|
label,
|
|
666
666
|
step,
|
|
667
|
-
labelPosition
|
|
667
|
+
labelPosition: effectiveLabelPosition
|
|
668
668
|
},
|
|
669
669
|
name
|
|
670
670
|
);
|
|
@@ -678,7 +678,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
678
678
|
min,
|
|
679
679
|
max,
|
|
680
680
|
step,
|
|
681
|
-
labelPosition
|
|
681
|
+
labelPosition: effectiveLabelPosition
|
|
682
682
|
},
|
|
683
683
|
name
|
|
684
684
|
);
|
|
@@ -690,7 +690,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
690
690
|
name,
|
|
691
691
|
label,
|
|
692
692
|
options,
|
|
693
|
-
labelPosition
|
|
693
|
+
labelPosition: effectiveLabelPosition
|
|
694
694
|
},
|
|
695
695
|
name
|
|
696
696
|
);
|
|
@@ -703,7 +703,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
703
703
|
min,
|
|
704
704
|
max,
|
|
705
705
|
step,
|
|
706
|
-
labelPosition
|
|
706
|
+
labelPosition: effectiveLabelPosition
|
|
707
707
|
},
|
|
708
708
|
name
|
|
709
709
|
);
|
|
@@ -718,7 +718,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
718
718
|
name,
|
|
719
719
|
label,
|
|
720
720
|
options,
|
|
721
|
-
labelPosition
|
|
721
|
+
labelPosition: effectiveLabelPosition
|
|
722
722
|
},
|
|
723
723
|
name
|
|
724
724
|
);
|
|
@@ -729,7 +729,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
729
729
|
name,
|
|
730
730
|
label,
|
|
731
731
|
placeholder: `Enter ${label.toLowerCase()}`,
|
|
732
|
-
labelPosition
|
|
732
|
+
labelPosition: effectiveLabelPosition
|
|
733
733
|
},
|
|
734
734
|
name
|
|
735
735
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSVWS4AL6_cjs = require('./chunk-SVWS4AL6.cjs');
|
|
4
4
|
|
|
5
5
|
// src/auth/handler/sign-in-handler.ts
|
|
6
6
|
var signInHandler = (props, refetch) => {
|
|
@@ -34,14 +34,13 @@ var sigInWithPopup = async (props, refetch) => {
|
|
|
34
34
|
if (event.data.type === "AUTH_TOKEN") {
|
|
35
35
|
const token = event.data.token;
|
|
36
36
|
if (token) {
|
|
37
|
-
localStorage.setItem(
|
|
37
|
+
localStorage.setItem(chunkSVWS4AL6_cjs.bearerToken, token);
|
|
38
38
|
window.removeEventListener("message", handle);
|
|
39
39
|
resolve(token);
|
|
40
40
|
if (callbackURL) {
|
|
41
41
|
window.location.href = callbackURL;
|
|
42
|
-
} else {
|
|
43
|
-
refetch();
|
|
44
42
|
}
|
|
43
|
+
refetch();
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { TimeInput } from './chunk-JUSFLIU5.mjs';
|
|
1
2
|
import { Vec3Input } from './chunk-SYX6TMCQ.mjs';
|
|
3
|
+
import { EulerDegInput } from './chunk-24IUD6Q3.mjs';
|
|
4
|
+
import { EulerInput } from './chunk-ZNM6PNI6.mjs';
|
|
2
5
|
import { EulerRadInput } from './chunk-IXNXSECD.mjs';
|
|
3
6
|
import { InchInput } from './chunk-3TUONMQ6.mjs';
|
|
4
7
|
import { IntInput } from './chunk-4JGGLCXT.mjs';
|
|
5
8
|
import { QuaternionInput } from './chunk-VUMOJPEC.mjs';
|
|
6
|
-
import {
|
|
9
|
+
import { VectorInput } from './chunk-VEWWUO2N.mjs';
|
|
7
10
|
import { CmInput } from './chunk-PTGMHZFS.mjs';
|
|
8
11
|
import { DegInput } from './chunk-CGUQWS2I.mjs';
|
|
9
|
-
import { EulerDegInput } from './chunk-24IUD6Q3.mjs';
|
|
10
|
-
import { EulerInput } from './chunk-ZNM6PNI6.mjs';
|
|
11
|
-
import { VectorInput } from './chunk-VEWWUO2N.mjs';
|
|
12
12
|
import { ColorInput } from './chunk-EXQQRW7T.mjs';
|
|
13
13
|
import { PresetsInput } from './chunk-6XOTWZFC.mjs';
|
|
14
14
|
import { RadInput } from './chunk-IY36FZ5R.mjs';
|
|
@@ -17,9 +17,9 @@ import { Slider } from './chunk-Y6WGGVT2.mjs';
|
|
|
17
17
|
import { Switch } from './chunk-AZBJB6KC.mjs';
|
|
18
18
|
import { Label } from './chunk-42UBHC2D.mjs';
|
|
19
19
|
import { FormLayout } from './chunk-NRQJX772.mjs';
|
|
20
|
+
import { useDialSchema } from './chunk-3HEZVWRW.mjs';
|
|
20
21
|
import { InputRoot, InputSlot } from './chunk-LRSDE62T.mjs';
|
|
21
22
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-KJH46JR3.mjs';
|
|
22
|
-
import { useDialSchema } from './chunk-3HEZVWRW.mjs';
|
|
23
23
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
24
24
|
|
|
25
25
|
var DialInputWrapper = ({ label, children }) => {
|
|
@@ -558,7 +558,7 @@ var DialVectorInput2 = ({
|
|
|
558
558
|
] })
|
|
559
559
|
] });
|
|
560
560
|
};
|
|
561
|
-
var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
561
|
+
var DialPanel = ({ schemas, groups: groupConfigs, layout }) => {
|
|
562
562
|
const groupConfigMap = {};
|
|
563
563
|
if (groupConfigs) {
|
|
564
564
|
groupConfigs.forEach((config) => {
|
|
@@ -589,7 +589,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
589
589
|
});
|
|
590
590
|
const renderSchemaInput = (schema) => {
|
|
591
591
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
592
|
-
const
|
|
592
|
+
const effectiveLabelPosition = tags?.labelPosition || layout;
|
|
593
593
|
const label = schema.label || name.charAt(0).toUpperCase() + name.slice(1);
|
|
594
594
|
switch (dtype) {
|
|
595
595
|
case "vector3":
|
|
@@ -599,7 +599,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
599
599
|
name,
|
|
600
600
|
label,
|
|
601
601
|
step,
|
|
602
|
-
labelPosition
|
|
602
|
+
labelPosition: effectiveLabelPosition
|
|
603
603
|
},
|
|
604
604
|
name
|
|
605
605
|
);
|
|
@@ -610,7 +610,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
610
610
|
name,
|
|
611
611
|
label,
|
|
612
612
|
step,
|
|
613
|
-
labelPosition
|
|
613
|
+
labelPosition: effectiveLabelPosition
|
|
614
614
|
},
|
|
615
615
|
name
|
|
616
616
|
);
|
|
@@ -621,7 +621,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
621
621
|
name,
|
|
622
622
|
label,
|
|
623
623
|
step,
|
|
624
|
-
labelPosition
|
|
624
|
+
labelPosition: effectiveLabelPosition
|
|
625
625
|
},
|
|
626
626
|
name
|
|
627
627
|
);
|
|
@@ -630,7 +630,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
630
630
|
case "number-group":
|
|
631
631
|
return /* @__PURE__ */ jsx(DialVectorInput2, { name, label }, name);
|
|
632
632
|
case "boolean":
|
|
633
|
-
return /* @__PURE__ */ jsx(DialBooleanInput, { name, label, labelPosition }, name);
|
|
633
|
+
return /* @__PURE__ */ jsx(DialBooleanInput, { name, label, labelPosition: effectiveLabelPosition }, name);
|
|
634
634
|
case "number-slider":
|
|
635
635
|
return /* @__PURE__ */ jsx(
|
|
636
636
|
DialSliderInput,
|
|
@@ -640,7 +640,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
640
640
|
min,
|
|
641
641
|
max,
|
|
642
642
|
step,
|
|
643
|
-
labelPosition
|
|
643
|
+
labelPosition: effectiveLabelPosition
|
|
644
644
|
},
|
|
645
645
|
name
|
|
646
646
|
);
|
|
@@ -651,7 +651,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
651
651
|
name,
|
|
652
652
|
label,
|
|
653
653
|
step: step || 1,
|
|
654
|
-
labelPosition
|
|
654
|
+
labelPosition: effectiveLabelPosition
|
|
655
655
|
},
|
|
656
656
|
name
|
|
657
657
|
);
|
|
@@ -662,7 +662,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
662
662
|
name,
|
|
663
663
|
label,
|
|
664
664
|
step,
|
|
665
|
-
labelPosition
|
|
665
|
+
labelPosition: effectiveLabelPosition
|
|
666
666
|
},
|
|
667
667
|
name
|
|
668
668
|
);
|
|
@@ -676,7 +676,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
676
676
|
min,
|
|
677
677
|
max,
|
|
678
678
|
step,
|
|
679
|
-
labelPosition
|
|
679
|
+
labelPosition: effectiveLabelPosition
|
|
680
680
|
},
|
|
681
681
|
name
|
|
682
682
|
);
|
|
@@ -688,7 +688,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
688
688
|
name,
|
|
689
689
|
label,
|
|
690
690
|
options,
|
|
691
|
-
labelPosition
|
|
691
|
+
labelPosition: effectiveLabelPosition
|
|
692
692
|
},
|
|
693
693
|
name
|
|
694
694
|
);
|
|
@@ -701,7 +701,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
701
701
|
min,
|
|
702
702
|
max,
|
|
703
703
|
step,
|
|
704
|
-
labelPosition
|
|
704
|
+
labelPosition: effectiveLabelPosition
|
|
705
705
|
},
|
|
706
706
|
name
|
|
707
707
|
);
|
|
@@ -716,7 +716,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
716
716
|
name,
|
|
717
717
|
label,
|
|
718
718
|
options,
|
|
719
|
-
labelPosition
|
|
719
|
+
labelPosition: effectiveLabelPosition
|
|
720
720
|
},
|
|
721
721
|
name
|
|
722
722
|
);
|
|
@@ -727,7 +727,7 @@ var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
|
727
727
|
name,
|
|
728
728
|
label,
|
|
729
729
|
placeholder: `Enter ${label.toLowerCase()}`,
|
|
730
|
-
labelPosition
|
|
730
|
+
labelPosition: effectiveLabelPosition
|
|
731
731
|
},
|
|
732
732
|
name
|
|
733
733
|
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkWTYBTOLO_cjs = require('./chunk-WTYBTOLO.cjs');
|
|
4
|
+
var chunkZULCZ5L6_cjs = require('./chunk-ZULCZ5L6.cjs');
|
|
5
|
+
var chunkSVWS4AL6_cjs = require('./chunk-SVWS4AL6.cjs');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
function VuerAuthProvider({ children, baseURL }) {
|
|
10
|
+
const [isPending, setIsPending] = react.useState(true);
|
|
11
|
+
const [session, setSession] = react.useState(null);
|
|
12
|
+
const refetchHandle = react.useCallback(async () => {
|
|
13
|
+
setIsPending(true);
|
|
14
|
+
const data = await chunkWTYBTOLO_cjs.getSession(baseURL);
|
|
15
|
+
setSession(data);
|
|
16
|
+
setIsPending(false);
|
|
17
|
+
return data;
|
|
18
|
+
}, [baseURL]);
|
|
19
|
+
react.useEffect(() => {
|
|
20
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
21
|
+
const session2 = searchParams.get("token");
|
|
22
|
+
if (session2) {
|
|
23
|
+
localStorage.setItem(chunkSVWS4AL6_cjs.bearerToken, encodeURIComponent(session2));
|
|
24
|
+
refetchHandle().then(() => console.log("Sign in session"));
|
|
25
|
+
window.history.replaceState({}, "", window.location.pathname);
|
|
26
|
+
}
|
|
27
|
+
}, [refetchHandle]);
|
|
28
|
+
react.useEffect(() => {
|
|
29
|
+
refetchHandle().then(() => console.log("Init session"));
|
|
30
|
+
}, [refetchHandle]);
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
chunkZULCZ5L6_cjs.AuthContext.Provider,
|
|
33
|
+
{
|
|
34
|
+
value: react.useMemo(() => {
|
|
35
|
+
return {
|
|
36
|
+
baseURL,
|
|
37
|
+
isPending,
|
|
38
|
+
data: session,
|
|
39
|
+
refetch: refetchHandle
|
|
40
|
+
};
|
|
41
|
+
}, [baseURL, session, isPending, refetchHandle]),
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.VuerAuthProvider = VuerAuthProvider;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { bearerToken } from './chunk-276VJZCV.mjs';
|
|
2
|
+
|
|
3
|
+
// src/auth/handler/get-session.ts
|
|
4
|
+
var getSession = async (baseURL) => {
|
|
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();
|
|
14
|
+
return { ...data, session: { ...data.session, jwt: authJWT ?? "" } };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { getSession };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkSVWS4AL6_cjs = require('./chunk-SVWS4AL6.cjs');
|
|
4
|
+
|
|
5
|
+
// src/auth/handler/get-session.ts
|
|
6
|
+
var getSession = async (baseURL) => {
|
|
7
|
+
const token = localStorage.getItem(chunkSVWS4AL6_cjs.bearerToken) || "";
|
|
8
|
+
const res = await fetch(`${baseURL}/api/auth/get-session`, {
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: `Bearer ${token}`
|
|
11
|
+
},
|
|
12
|
+
credentials: "include"
|
|
13
|
+
});
|
|
14
|
+
const authJWT = res.headers.get("set-auth-jwt");
|
|
15
|
+
const data = await res.json();
|
|
16
|
+
return { ...data, session: { ...data.session, jwt: authJWT ?? "" } };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.getSession = getSession;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkPB4UO2NR_cjs = require('./chunk-PB4UO2NR.cjs');
|
|
4
|
+
var chunk4CPB3XHE_cjs = require('./chunk-4CPB3XHE.cjs');
|
|
3
5
|
var chunk4B44SRRP_cjs = require('./chunk-4B44SRRP.cjs');
|
|
4
|
-
var chunkLSKJOUAE_cjs = require('./chunk-LSKJOUAE.cjs');
|
|
5
6
|
var react = require('react');
|
|
6
7
|
|
|
7
8
|
var useVuerMethod = () => {
|
|
8
|
-
const { refetch,
|
|
9
|
-
const signOutHandle = react.useCallback(() => {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const { refetch, baseURL } = chunk4B44SRRP_cjs.useVuerAuth();
|
|
10
|
+
const signOutHandle = react.useCallback(async () => {
|
|
11
|
+
await chunk4CPB3XHE_cjs.signOutHandler(baseURL);
|
|
12
|
+
await refetch();
|
|
13
|
+
}, [baseURL, refetch]);
|
|
12
14
|
const signInHandle = react.useCallback(
|
|
13
15
|
(props) => {
|
|
14
|
-
return
|
|
16
|
+
return chunkPB4UO2NR_cjs.signInHandler({ ...props, baseURL }, refetch);
|
|
15
17
|
},
|
|
16
18
|
[baseURL, refetch]
|
|
17
19
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bearerToken } from './chunk-
|
|
1
|
+
import { bearerToken } from './chunk-276VJZCV.mjs';
|
|
2
2
|
|
|
3
3
|
// src/auth/handler/sign-in-handler.ts
|
|
4
4
|
var signInHandler = (props, refetch) => {
|
|
@@ -37,9 +37,8 @@ var sigInWithPopup = async (props, refetch) => {
|
|
|
37
37
|
resolve(token);
|
|
38
38
|
if (callbackURL) {
|
|
39
39
|
window.location.href = callbackURL;
|
|
40
|
-
} else {
|
|
41
|
-
refetch();
|
|
42
40
|
}
|
|
41
|
+
refetch();
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
};
|