@vuer-ai/vuer-uikit 0.0.108 → 0.0.112
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/SyncScroll/SyncScroll.cjs +1 -1
- package/dist/SyncScroll/SyncScroll.mjs +1 -1
- package/dist/SyncScroll/index.cjs +1 -1
- package/dist/SyncScroll/index.mjs +1 -1
- package/dist/auth/components/index.cjs +128 -0
- package/dist/auth/components/index.d.cts +2 -0
- package/dist/auth/components/index.d.ts +2 -0
- package/dist/auth/components/index.mjs +119 -0
- package/dist/auth/components/user-avatar/index.cjs +127 -0
- package/dist/auth/components/user-avatar/index.d.cts +8 -0
- package/dist/auth/components/user-avatar/index.d.ts +8 -0
- package/dist/auth/components/user-avatar/index.mjs +118 -0
- package/dist/auth/context/user-context.cjs +10 -0
- package/dist/auth/context/{auth-context.d.cts → user-context.d.cts} +3 -3
- package/dist/auth/context/{auth-context.d.ts → user-context.d.ts} +3 -3
- package/dist/auth/context/user-context.mjs +1 -0
- package/dist/auth/handler/fetch-auth.cjs +11 -0
- package/dist/auth/handler/fetch-auth.d.cts +3 -0
- package/dist/auth/handler/fetch-auth.d.ts +3 -0
- package/dist/auth/handler/fetch-auth.mjs +2 -0
- package/dist/auth/handler/fetch-server.cjs +11 -0
- package/dist/auth/handler/fetch-server.d.cts +3 -0
- package/dist/auth/handler/fetch-server.d.ts +3 -0
- package/dist/auth/handler/fetch-server.mjs +2 -0
- package/dist/auth/handler/get-session.cjs +4 -3
- package/dist/auth/handler/get-session.d.cts +1 -1
- package/dist/auth/handler/get-session.d.ts +1 -1
- package/dist/auth/handler/get-session.mjs +3 -2
- package/dist/auth/handler/get-sessions.cjs +12 -0
- package/dist/auth/handler/get-sessions.d.cts +19 -0
- package/dist/auth/handler/get-sessions.d.ts +19 -0
- package/dist/auth/handler/get-sessions.mjs +3 -0
- package/dist/auth/handler/sign-in-handler.cjs +3 -3
- package/dist/auth/handler/sign-in-handler.d.cts +2 -2
- package/dist/auth/handler/sign-in-handler.d.ts +2 -2
- package/dist/auth/handler/sign-in-handler.mjs +2 -2
- package/dist/auth/handler/sign-out-handler.cjs +4 -3
- package/dist/auth/handler/sign-out-handler.mjs +3 -2
- package/dist/auth/hooks/use-sign-in.cjs +14 -0
- package/dist/auth/hooks/use-sign-in.d.cts +9 -0
- package/dist/auth/hooks/use-sign-in.d.ts +9 -0
- package/dist/auth/hooks/use-sign-in.mjs +5 -0
- package/dist/auth/hooks/use-sign-out.cjs +15 -0
- package/dist/auth/hooks/use-sign-out.d.cts +6 -0
- package/dist/auth/hooks/use-sign-out.d.ts +6 -0
- package/dist/auth/hooks/use-sign-out.mjs +6 -0
- package/dist/auth/hooks/use-user.cjs +11 -0
- package/dist/auth/hooks/use-user.d.cts +8 -0
- package/dist/auth/hooks/use-user.d.ts +8 -0
- package/dist/auth/hooks/use-user.mjs +2 -0
- package/dist/auth/hooks/use-vuer-sessions.cjs +15 -0
- package/dist/auth/hooks/use-vuer-sessions.d.cts +9 -0
- package/dist/auth/hooks/use-vuer-sessions.d.ts +9 -0
- package/dist/auth/hooks/use-vuer-sessions.mjs +6 -0
- package/dist/auth/index.cjs +151 -15
- package/dist/auth/index.d.cts +10 -6
- package/dist/auth/index.d.ts +10 -6
- package/dist/auth/index.mjs +124 -8
- package/dist/auth/localstorage-key.cjs +6 -2
- package/dist/auth/localstorage-key.d.cts +2 -1
- package/dist/auth/localstorage-key.d.ts +2 -1
- package/dist/auth/localstorage-key.mjs +1 -1
- package/dist/auth/vuer-user-provider.cjs +14 -0
- package/dist/auth/{vuer-auth-provider.d.cts → vuer-user-provider.d.cts} +2 -2
- package/dist/auth/{vuer-auth-provider.d.ts → vuer-user-provider.d.ts} +2 -2
- package/dist/auth/vuer-user-provider.mjs +5 -0
- package/dist/{chunk-2EG65KGO.cjs → chunk-2MSGENAQ.cjs} +2 -2
- package/dist/{chunk-VUMOJPEC.mjs → chunk-2SFB7HHW.mjs} +1 -1
- package/dist/chunk-3WMO5QJJ.cjs +8 -0
- package/dist/{chunk-5XBMFADS.cjs → chunk-4GVFCQGI.cjs} +2 -2
- package/dist/chunk-4JZOPZHB.cjs +30 -0
- package/dist/{chunk-MIT3YWUC.cjs → chunk-4LQDOYQJ.cjs} +2 -2
- package/dist/{chunk-5MBEK77I.mjs → chunk-57MAUYQZ.mjs} +9 -2
- package/dist/chunk-5OHAV55L.mjs +24 -0
- package/dist/{chunk-EAXBNWXE.cjs → chunk-5VUM46YD.cjs} +2 -2
- package/dist/{chunk-64L2SNKA.cjs → chunk-6D66V6ON.cjs} +2 -2
- package/dist/chunk-6GJM7TPE.cjs +28 -0
- package/dist/{chunk-GOGJVFRN.cjs → chunk-6IXKC64S.cjs} +4 -4
- package/dist/{chunk-TPAV6PXI.mjs → chunk-7CDVPU65.mjs} +2 -2
- package/dist/chunk-7E5Y224I.cjs +14 -0
- package/dist/{chunk-D5WOPTKY.cjs → chunk-7NUXYKXU.cjs} +2 -2
- package/dist/chunk-7R5HY3IM.cjs +12 -0
- package/dist/{chunk-3VVQWVDE.mjs → chunk-7XXTMBF5.mjs} +1 -1
- package/dist/{chunk-CZ4GQOXG.mjs → chunk-AAFU2FII.mjs} +2 -2
- package/dist/{chunk-4THQPG6Y.mjs → chunk-ACETEVZD.mjs} +1 -1
- package/dist/{chunk-SYX6TMCQ.mjs → chunk-AGHIJQAR.mjs} +1 -1
- package/dist/chunk-APC2GIE7.cjs +58 -0
- package/dist/{chunk-JFJRNNPQ.cjs → chunk-AW6Q4IWT.cjs} +2 -2
- package/dist/{chunk-ACYZOKPT.mjs → chunk-BBWT5YO2.mjs} +2 -2
- package/dist/{chunk-6XOTWZFC.mjs → chunk-BCA45QEW.mjs} +2 -2
- package/dist/{chunk-LFSCJLL2.cjs → chunk-BDAKLXXX.cjs} +9 -2
- package/dist/chunk-BI4QZVVB.cjs +82 -0
- package/dist/{chunk-ZRRCYQ53.cjs → chunk-BTXD3NAG.cjs} +3 -3
- package/dist/{chunk-7RHQ6DVU.cjs → chunk-CGBEPOL4.cjs} +21 -9
- package/dist/{chunk-3OLRPUTL.mjs → chunk-DBMXQH73.mjs} +111 -142
- package/dist/{chunk-QZUTRJSP.mjs → chunk-DHMLQTQ6.mjs} +2 -2
- package/dist/{chunk-OLVOIUCE.mjs → chunk-DT2LGZ5H.mjs} +3 -3
- package/dist/{chunk-KBC7VNER.mjs → chunk-ECOYNCWG.mjs} +1 -1
- package/dist/{chunk-SVWS4AL6.cjs → chunk-F4Z5KATZ.cjs} +2 -0
- package/dist/{chunk-NRQJX772.mjs → chunk-FB5MYIVE.mjs} +1 -0
- package/dist/chunk-FRAD2Z2G.mjs +43 -0
- package/dist/chunk-FROQ45MN.mjs +6 -0
- package/dist/chunk-G6ATG2WV.mjs +28 -0
- package/dist/chunk-GBERXSLI.cjs +53 -0
- package/dist/{chunk-EXQQRW7T.mjs → chunk-GSQE4JVF.mjs} +1 -1
- package/dist/{chunk-5HS4PMUR.mjs → chunk-GUSUTH7D.mjs} +16 -11
- package/dist/{chunk-IXNXSECD.mjs → chunk-H2AJ2CLT.mjs} +1 -1
- package/dist/{chunk-SUEFWFPX.mjs → chunk-HFGRTWTD.mjs} +2 -2
- package/dist/chunk-HOMAESTR.mjs +12 -0
- package/dist/{chunk-T2D6PSA6.cjs → chunk-I2YVC4AE.cjs} +17 -12
- package/dist/{chunk-4JGGLCXT.mjs → chunk-JH5NAW2V.mjs} +1 -1
- package/dist/chunk-JTJKIRFA.mjs +56 -0
- package/dist/chunk-KIZEJMW4.cjs +15 -0
- package/dist/{chunk-JYIVDUDL.cjs → chunk-KOMVGDDW.cjs} +4 -4
- package/dist/{chunk-ZNM6PNI6.mjs → chunk-KS5A3G7B.mjs} +1 -1
- package/dist/{chunk-4WRTIOGZ.cjs → chunk-KT772L2I.cjs} +6 -6
- package/dist/{chunk-NSUFTZNC.cjs → chunk-L2YLNWCQ.cjs} +2 -2
- package/dist/chunk-L3YEIRJS.mjs +31 -0
- package/dist/chunk-L4CIN7FR.mjs +96 -0
- package/dist/{chunk-6QU4J3HY.cjs → chunk-LBRS745M.cjs} +9 -9
- package/dist/{chunk-M4IHJGJE.cjs → chunk-LI5W744D.cjs} +10 -2
- package/dist/{chunk-UASPJ57U.cjs → chunk-LPKVKTOK.cjs} +1 -0
- package/dist/{chunk-OYQJVHKA.cjs → chunk-LUCJKAJ5.cjs} +2 -2
- package/dist/chunk-LUVD54GO.cjs +47 -0
- package/dist/{chunk-5JPYU5A6.cjs → chunk-LV4XJY75.cjs} +11 -11
- package/dist/{chunk-AOV3ADTV.cjs → chunk-M45UXJWX.cjs} +2 -2
- package/dist/{chunk-7HOEFGEO.mjs → chunk-MGFG7EXC.mjs} +1 -1
- package/dist/chunk-MO5V43Z3.mjs +13 -0
- package/dist/chunk-MRMSCW3P.cjs +19 -0
- package/dist/{chunk-WRKB3W2J.cjs → chunk-MTZQ4C2U.cjs} +6 -6
- package/dist/{chunk-AJQEHMYV.cjs → chunk-NIEFMP5V.cjs} +2 -2
- package/dist/chunk-NJXBYRKZ.mjs +80 -0
- package/dist/{chunk-S7SGB2FD.mjs → chunk-O7FGA5N2.mjs} +4 -4
- package/dist/chunk-OOHCJIRV.cjs +26 -0
- package/dist/chunk-PFIP3ETQ.cjs +55 -0
- package/dist/{chunk-RIJUPORK.mjs → chunk-PJJSHHL6.mjs} +1 -1
- package/dist/{chunk-CGUQWS2I.mjs → chunk-PTBMSYQQ.mjs} +1 -1
- package/dist/chunk-PX2H7Z4D.mjs +26 -0
- package/dist/chunk-PXDT5GFJ.mjs +13 -0
- package/dist/{chunk-HN3AMWUM.cjs → chunk-Q5PJKBX7.cjs} +2 -2
- package/dist/chunk-Q76WU4DL.cjs +17 -0
- package/dist/{chunk-Y2H4A5AC.mjs → chunk-R2QXIDY2.mjs} +2 -2
- package/dist/{chunk-K2OC2HWQ.mjs → chunk-RFRBGVBZ.mjs} +19 -7
- package/dist/{chunk-7GJVMFKJ.cjs → chunk-ROY7233C.cjs} +4 -4
- package/dist/{chunk-HBIZQDDS.cjs → chunk-RQH7ZAWF.cjs} +2 -2
- package/dist/{chunk-PB4UO2NR.cjs → chunk-RSBVQ7SJ.cjs} +9 -10
- package/dist/{chunk-A2UZY7Y2.cjs → chunk-S5XJOGB4.cjs} +2 -2
- package/dist/chunk-SO2UTKSV.mjs +17 -0
- package/dist/{chunk-JFIAWTRH.cjs → chunk-SU57ZAZJ.cjs} +2 -2
- package/dist/{chunk-MG5TTPA7.mjs → chunk-SWJHOFZH.mjs} +6 -6
- package/dist/{chunk-PTCDBU72.cjs → chunk-TYZHIBYI.cjs} +2 -2
- package/dist/{chunk-IY36FZ5R.mjs → chunk-TZBOF3XO.mjs} +1 -1
- package/dist/{chunk-R2WPT5VM.mjs → chunk-UBYSTTD2.mjs} +2 -2
- package/dist/{chunk-276VJZCV.mjs → chunk-UT7B4TLZ.mjs} +2 -1
- package/dist/{chunk-XGM57WPN.mjs → chunk-V4KDK3BN.mjs} +8 -9
- package/dist/chunk-V5YUFNEB.mjs +53 -0
- package/dist/{chunk-VLOFKTSL.cjs → chunk-VEE2QBS5.cjs} +3 -3
- package/dist/{chunk-3IVDCAFM.mjs → chunk-VSFPXAGN.mjs} +4 -4
- package/dist/{chunk-LQGXG373.cjs → chunk-WB43VEZA.cjs} +21 -3
- package/dist/{chunk-42UBHC2D.mjs → chunk-WGWNYPXW.mjs} +10 -2
- package/dist/{chunk-24IUD6Q3.mjs → chunk-WQCVK4PG.mjs} +1 -1
- package/dist/chunk-X3H6FYAM.cjs +15 -0
- package/dist/{chunk-LRSDE62T.mjs → chunk-XMQULAAU.mjs} +21 -3
- package/dist/chunk-YWECB5GR.cjs +2 -0
- package/dist/chunk-YYLBP356.mjs +1 -0
- package/dist/{chunk-2PJO5UJL.cjs → chunk-YZINVGLW.cjs} +11 -11
- package/dist/{chunk-JUSFLIU5.mjs → chunk-Z4ZGX3NM.mjs} +1 -1
- package/dist/chunk-Z7BZFZEV.mjs +15 -0
- package/dist/{chunk-VEWWUO2N.mjs → chunk-ZDSN4IFT.mjs} +1 -1
- package/dist/{chunk-PTGMHZFS.mjs → chunk-ZEBAIL6F.mjs} +1 -1
- package/dist/{chunk-2WD4ZL27.cjs → chunk-ZGS3VGGN.cjs} +4 -4
- package/dist/{chunk-Y5SVZCPQ.cjs → chunk-ZJ5SNYAO.cjs} +7 -7
- package/dist/{chunk-3TUONMQ6.mjs → chunk-ZRMDDK6J.mjs} +1 -1
- package/dist/chunk-ZXIKMZPH.cjs +99 -0
- package/dist/{chunk-GZBZMYJM.cjs → chunk-ZXWBDK2V.cjs} +157 -189
- package/dist/{chunk-5PHGYFZ3.cjs → chunk-ZZEWMU7Y.cjs} +2 -2
- package/dist/dial/DialPanel.cjs +57 -55
- package/dist/dial/DialPanel.d.cts +1 -0
- package/dist/dial/DialPanel.d.ts +1 -0
- package/dist/dial/DialPanel.mjs +56 -54
- package/dist/dial/DialProvider.cjs +3 -3
- package/dist/dial/DialProvider.d.cts +3 -2
- package/dist/dial/DialProvider.d.ts +3 -2
- package/dist/dial/DialProvider.example.cjs +4 -4
- package/dist/dial/DialProvider.example.mjs +1 -1
- package/dist/dial/DialProvider.mjs +1 -1
- package/dist/dial/index.cjs +75 -73
- package/dist/dial/index.d.cts +1 -0
- package/dist/dial/index.d.ts +1 -0
- package/dist/dial/index.mjs +56 -54
- package/dist/dial/wrapped-inputs/ControlledInputs.cjs +61 -59
- package/dist/dial/wrapped-inputs/ControlledInputs.d.cts +10 -9
- package/dist/dial/wrapped-inputs/ControlledInputs.d.ts +10 -9
- package/dist/dial/wrapped-inputs/ControlledInputs.mjs +56 -54
- package/dist/dial/wrapped-inputs/DialInputs.cjs +70 -68
- package/dist/dial/wrapped-inputs/DialInputs.d.cts +1 -0
- package/dist/dial/wrapped-inputs/DialInputs.d.ts +1 -0
- package/dist/dial/wrapped-inputs/DialInputs.mjs +56 -54
- package/dist/dial/wrapped-inputs/DialPresetsInput.cjs +51 -55
- package/dist/dial/wrapped-inputs/DialPresetsInput.d.cts +3 -3
- package/dist/dial/wrapped-inputs/DialPresetsInput.d.ts +3 -3
- package/dist/dial/wrapped-inputs/DialPresetsInput.mjs +50 -54
- package/dist/dial/wrapped-inputs/DialVectorInput.cjs +57 -55
- package/dist/dial/wrapped-inputs/DialVectorInput.d.cts +1 -0
- package/dist/dial/wrapped-inputs/DialVectorInput.d.ts +1 -0
- package/dist/dial/wrapped-inputs/DialVectorInput.mjs +56 -54
- package/dist/dial/wrapped-inputs/index.cjs +80 -78
- package/dist/dial/wrapped-inputs/index.d.cts +1 -0
- package/dist/dial/wrapped-inputs/index.d.ts +1 -0
- package/dist/dial/wrapped-inputs/index.mjs +56 -54
- package/dist/highlight-cursor/enhanced-components.cjs +12 -12
- package/dist/highlight-cursor/enhanced-components.mjs +7 -7
- package/dist/highlight-cursor/index.cjs +16 -16
- package/dist/highlight-cursor/index.mjs +7 -7
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +243 -261
- package/dist/index.css +16 -16
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +56 -54
- package/dist/styles/theme.css +3 -3
- package/dist/ui/DialBadge.cjs +6 -6
- package/dist/ui/DialBadge.mjs +2 -2
- package/dist/ui/UIKitBadge.cjs +6 -6
- package/dist/ui/UIKitBadge.mjs +2 -2
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.mjs +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/button.cjs +4 -4
- package/dist/ui/button.mjs +2 -2
- package/dist/ui/card.cjs +9 -9
- package/dist/ui/card.mjs +2 -2
- package/dist/ui/checkbox.cjs +1 -1
- package/dist/ui/checkbox.mjs +1 -1
- package/dist/ui/collapsible.cjs +1 -1
- package/dist/ui/collapsible.mjs +1 -1
- package/dist/ui/drawer.cjs +1 -1
- package/dist/ui/drawer.mjs +1 -1
- package/dist/ui/dropdown.cjs +1 -1
- package/dist/ui/dropdown.mjs +1 -1
- package/dist/ui/index.cjs +185 -204
- package/dist/ui/index.d.cts +5 -2
- package/dist/ui/index.d.ts +5 -2
- package/dist/ui/index.mjs +48 -47
- package/dist/ui/inputs/color-input.cjs +4 -4
- package/dist/ui/inputs/color-input.mjs +3 -3
- package/dist/ui/inputs/index.cjs +42 -42
- package/dist/ui/inputs/index.mjs +21 -21
- package/dist/ui/inputs/input-numbers.cjs +4 -4
- package/dist/ui/inputs/input-numbers.mjs +3 -3
- package/dist/ui/inputs/input.cjs +5 -5
- package/dist/ui/inputs/input.d.cts +1 -1
- package/dist/ui/inputs/input.d.ts +1 -1
- package/dist/ui/inputs/input.mjs +2 -2
- package/dist/ui/inputs/number-inputs/CmInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/CmInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/DegInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/DegInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/EulerDegInput.cjs +7 -7
- package/dist/ui/inputs/number-inputs/EulerDegInput.mjs +6 -6
- package/dist/ui/inputs/number-inputs/EulerInput.cjs +6 -6
- package/dist/ui/inputs/number-inputs/EulerInput.mjs +5 -5
- package/dist/ui/inputs/number-inputs/EulerRadInput.cjs +6 -6
- package/dist/ui/inputs/number-inputs/EulerRadInput.mjs +5 -5
- package/dist/ui/inputs/number-inputs/InchInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/InchInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/IntInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/IntInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/KVectorInput.cjs +6 -6
- package/dist/ui/inputs/number-inputs/KVectorInput.mjs +5 -5
- package/dist/ui/inputs/number-inputs/QuaternionInput.cjs +6 -6
- package/dist/ui/inputs/number-inputs/QuaternionInput.mjs +5 -5
- package/dist/ui/inputs/number-inputs/RadInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/RadInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/TimeInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/TimeInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/Vec3Input.cjs +6 -6
- package/dist/ui/inputs/number-inputs/Vec3Input.mjs +5 -5
- package/dist/ui/inputs/number-inputs/VectorInput.cjs +5 -5
- package/dist/ui/inputs/number-inputs/VectorInput.mjs +4 -4
- package/dist/ui/inputs/number-inputs/index.cjs +29 -29
- package/dist/ui/inputs/number-inputs/index.mjs +16 -16
- package/dist/ui/inputs/presets-input.cjs +6 -6
- package/dist/ui/inputs/presets-input.mjs +5 -5
- package/dist/ui/inputs/presets-rad-input.cjs +7 -7
- package/dist/ui/inputs/presets-rad-input.mjs +6 -6
- package/dist/ui/inputs/text-input.cjs +4 -4
- package/dist/ui/inputs/text-input.mjs +3 -3
- package/dist/ui/label.cjs +3 -3
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.mjs +2 -2
- package/dist/ui/layout.cjs +3 -3
- package/dist/ui/layout.d.cts +3 -2
- package/dist/ui/layout.d.ts +3 -2
- package/dist/ui/layout.mjs +2 -2
- package/dist/ui/layouts/dock-layout/DockLayoutView.cjs +1 -1
- package/dist/ui/layouts/dock-layout/DockLayoutView.mjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/dock-layout/index.cjs +1 -1
- package/dist/ui/layouts/dock-layout/index.mjs +1 -1
- package/dist/ui/layouts/index.cjs +1 -1
- package/dist/ui/layouts/index.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.mjs +1 -1
- package/dist/ui/modal.cjs +1 -1
- package/dist/ui/modal.mjs +1 -1
- package/dist/ui/navigation.cjs +4 -4
- package/dist/ui/navigation.mjs +3 -3
- package/dist/ui/pagination.cjs +10 -10
- package/dist/ui/pagination.mjs +3 -3
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.mjs +1 -1
- package/dist/ui/progress.cjs +20 -0
- package/dist/ui/progress.d.cts +7 -0
- package/dist/ui/progress.d.ts +7 -0
- package/dist/ui/{panel.mjs → progress.mjs} +2 -2
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.mjs +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.mjs +1 -1
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +29 -29
- package/dist/ui/sidebar.mjs +5 -5
- package/dist/ui/simple-tree-view.cjs +1 -1
- package/dist/ui/simple-tree-view.mjs +1 -1
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.mjs +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.mjs +1 -1
- package/dist/ui/spinner.cjs +10 -0
- package/dist/ui/spinner.d.cts +7 -0
- package/dist/ui/spinner.d.ts +7 -0
- package/dist/ui/spinner.mjs +1 -0
- package/dist/ui/switch.cjs +1 -1
- package/dist/ui/switch.mjs +1 -1
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.mjs +1 -1
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.mjs +1 -1
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.mjs +1 -1
- package/dist/ui/theme/ThemeToggles.cjs +7 -7
- package/dist/ui/theme/ThemeToggles.mjs +4 -4
- package/dist/ui/theme/index.cjs +7 -7
- package/dist/ui/theme/index.mjs +4 -4
- package/dist/ui/toggle-buttons.cjs +1 -1
- package/dist/ui/toggle-buttons.mjs +1 -1
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.mjs +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.mjs +1 -1
- package/dist/ui/toolbar.cjs +5 -5
- package/dist/ui/toolbar.mjs +2 -2
- package/dist/ui/tooltip.cjs +6 -6
- package/dist/ui/tooltip.mjs +2 -2
- package/dist/ui/tree-view/TreeSearchBar.cjs +5 -5
- package/dist/ui/tree-view/TreeSearchBar.mjs +4 -4
- package/dist/ui/tree-view/TreeView.cjs +1 -1
- package/dist/ui/tree-view/TreeView.mjs +1 -1
- package/dist/ui/tree-view/index.cjs +14 -14
- package/dist/ui/tree-view/index.mjs +5 -5
- package/dist/ui/tree-view-legacy.cjs +8 -8
- package/dist/ui/tree-view-legacy.mjs +4 -4
- package/dist/ui/waterfall/CursorOverlay.cjs +1 -1
- package/dist/ui/waterfall/CursorOverlay.mjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.cjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.mjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.cjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.mjs +1 -1
- package/dist/ui/waterfall/Wedges.cjs +1 -1
- package/dist/ui/waterfall/Wedges.mjs +1 -1
- package/dist/ui/waterfall/index.cjs +8 -8
- package/dist/ui/waterfall/index.mjs +7 -7
- package/package.json +5 -4
- package/src/auth/components/index.ts +1 -0
- package/src/auth/components/user-avatar/index.tsx +94 -0
- package/src/auth/context/{auth-context.ts → user-context.ts} +4 -4
- package/src/auth/handler/fetch-auth.ts +10 -0
- package/src/auth/handler/fetch-server.ts +10 -0
- package/src/auth/handler/get-session.ts +11 -9
- package/src/auth/handler/get-sessions.ts +16 -0
- package/src/auth/handler/sign-in-handler.ts +10 -11
- package/src/auth/handler/sign-out-handler.ts +2 -6
- package/src/auth/hooks/use-sign-in.ts +33 -0
- package/src/auth/hooks/use-sign-out.ts +30 -0
- package/src/auth/hooks/{use-vuer-auth.ts → use-user.ts} +3 -3
- package/src/auth/hooks/use-vuer-sessions.ts +29 -0
- package/src/auth/index.ts +9 -3
- package/src/auth/localstorage-key.ts +2 -0
- package/src/auth/{vuer-auth-provider.tsx → vuer-user-provider.tsx} +14 -9
- package/src/dial/DialPanel.tsx +17 -7
- package/src/dial/DialProvider.tsx +67 -13
- package/src/dial/wrapped-inputs/ControlledInputs.tsx +79 -64
- package/src/dial/wrapped-inputs/DialInputs.tsx +29 -28
- package/src/dial/wrapped-inputs/DialPresetsInput.tsx +19 -27
- package/src/dial/wrapped-inputs/DialVectorInput.tsx +14 -9
- package/src/styles/theme.css +5 -3
- package/src/ui/button.tsx +2 -2
- package/src/ui/card.tsx +5 -5
- package/src/ui/index.ts +2 -1
- package/src/ui/inputs/input.tsx +21 -3
- package/src/ui/label.tsx +10 -2
- package/src/ui/layout.tsx +3 -1
- package/src/ui/progress.tsx +29 -0
- package/src/ui/spinner.tsx +67 -0
- package/src/ui/toolbar.tsx +21 -8
- package/src/ui/tooltip.tsx +11 -2
- package/src/ui/waterfall/index.tsx +15 -3
- package/dist/auth/context/auth-context.cjs +0 -10
- package/dist/auth/context/auth-context.mjs +0 -1
- package/dist/auth/hooks/use-vuer-auth.cjs +0 -11
- package/dist/auth/hooks/use-vuer-auth.d.cts +0 -8
- package/dist/auth/hooks/use-vuer-auth.d.ts +0 -8
- package/dist/auth/hooks/use-vuer-auth.mjs +0 -2
- package/dist/auth/hooks/use-vuer-method.cjs +0 -15
- package/dist/auth/hooks/use-vuer-method.d.cts +0 -10
- package/dist/auth/hooks/use-vuer-method.d.ts +0 -10
- package/dist/auth/hooks/use-vuer-method.mjs +0 -6
- package/dist/auth/vuer-auth-provider.cjs +0 -13
- package/dist/auth/vuer-auth-provider.mjs +0 -4
- package/dist/chunk-3HEZVWRW.mjs +0 -62
- package/dist/chunk-4B44SRRP.cjs +0 -12
- package/dist/chunk-4CPB3XHE.cjs +0 -18
- package/dist/chunk-AKVHFPXH.mjs +0 -26
- package/dist/chunk-C6L7YIGW.cjs +0 -117
- package/dist/chunk-CGODCUQ5.mjs +0 -16
- package/dist/chunk-G4Q5ALRW.mjs +0 -109
- package/dist/chunk-OPYMZDEZ.mjs +0 -28
- package/dist/chunk-RMK6W774.cjs +0 -65
- package/dist/chunk-T57VFBIC.mjs +0 -17
- package/dist/chunk-TC3W4VRO.mjs +0 -6
- package/dist/chunk-WTYBTOLO.cjs +0 -19
- package/dist/chunk-WZGZX3S2.cjs +0 -32
- package/dist/chunk-XFTKHT2M.cjs +0 -28
- package/dist/chunk-ZULCZ5L6.cjs +0 -8
- package/dist/ui/panel.cjs +0 -44
- package/dist/ui/panel.d.cts +0 -51
- package/dist/ui/panel.d.ts +0 -51
- package/src/auth/hooks/use-vuer-method.ts +0 -37
- package/src/ui/panel.tsx +0 -147
- /package/dist/{chunk-KFPS5CCR.cjs → chunk-NK7L5H2Y.cjs} +0 -0
- /package/dist/{chunk-G3EIVAVR.mjs → chunk-UXWS62ZO.mjs} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { signInHandler } from "../handler/sign-in-handler";
|
|
4
|
+
import { SignInWithOutBaseURLParams } from "../types";
|
|
5
|
+
import { useUser } from "./use-user";
|
|
6
|
+
|
|
7
|
+
const useSignIn = () => {
|
|
8
|
+
const { refetch, baseURL } = useUser();
|
|
9
|
+
|
|
10
|
+
const [isPending, setIsPending] = useState(false);
|
|
11
|
+
|
|
12
|
+
const signInHandle = useCallback(
|
|
13
|
+
async (props?: SignInWithOutBaseURLParams) => {
|
|
14
|
+
try {
|
|
15
|
+
setIsPending(true);
|
|
16
|
+
await signInHandler({ ...props, baseURL });
|
|
17
|
+
const result = await refetch();
|
|
18
|
+
setIsPending(false);
|
|
19
|
+
return result;
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(e);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[baseURL, refetch],
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
return { isPending, signIn: signInHandle };
|
|
30
|
+
}, [isPending, signInHandle]);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { useSignIn };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { useUser } from "./use-user";
|
|
4
|
+
import { signOutHandler } from "../handler/sign-out-handler";
|
|
5
|
+
|
|
6
|
+
const useSignOut = () => {
|
|
7
|
+
const { refetch, baseURL } = useUser();
|
|
8
|
+
|
|
9
|
+
const [isPending, setIsPending] = useState(false);
|
|
10
|
+
|
|
11
|
+
const signOutHandle = useCallback(async () => {
|
|
12
|
+
try {
|
|
13
|
+
setIsPending(true);
|
|
14
|
+
await signOutHandler(baseURL);
|
|
15
|
+
await refetch();
|
|
16
|
+
setIsPending(false);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
console.error(e);
|
|
19
|
+
}
|
|
20
|
+
}, [baseURL, refetch]);
|
|
21
|
+
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
return {
|
|
24
|
+
isPending,
|
|
25
|
+
signOut: signOutHandle,
|
|
26
|
+
};
|
|
27
|
+
}, [isPending, signOutHandle]);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { useSignOut };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { IUserContext, UserContext } from "../context/user-context";
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
const context = useContext(
|
|
5
|
+
export const useUser = (): IUserContext => {
|
|
6
|
+
const context = useContext(UserContext);
|
|
7
7
|
|
|
8
8
|
if (context === undefined) throw new Error("useSession must be used within a SessionContext");
|
|
9
9
|
return context;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { useUser } from "./use-user";
|
|
4
|
+
import { getSessions } from "../handler/get-sessions";
|
|
5
|
+
import { UserSession } from "../types";
|
|
6
|
+
|
|
7
|
+
export const useVuerSessions = () => {
|
|
8
|
+
const { baseURL } = useUser();
|
|
9
|
+
|
|
10
|
+
const [isPending, setIsPending] = useState(true);
|
|
11
|
+
const [sessions, setSessions] = useState<UserSession[]>([]);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setIsPending(true);
|
|
15
|
+
getSessions(baseURL)
|
|
16
|
+
.then((sessions) => {
|
|
17
|
+
console.log("sessions", sessions);
|
|
18
|
+
setSessions(sessions);
|
|
19
|
+
setIsPending(false);
|
|
20
|
+
})
|
|
21
|
+
.catch(() => {
|
|
22
|
+
setIsPending(false);
|
|
23
|
+
});
|
|
24
|
+
}, [baseURL]);
|
|
25
|
+
|
|
26
|
+
return useMemo(() => {
|
|
27
|
+
return { isPending, sessions };
|
|
28
|
+
}, [isPending, sessions]);
|
|
29
|
+
};
|
package/src/auth/index.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export * from "./hooks/use-
|
|
2
|
-
export * from "./hooks/use-
|
|
1
|
+
export * from "./hooks/use-user";
|
|
2
|
+
export * from "./hooks/use-sign-in";
|
|
3
|
+
export * from "./hooks/use-sign-out";
|
|
3
4
|
|
|
4
5
|
export * from "./localstorage-key";
|
|
5
6
|
|
|
6
|
-
export
|
|
7
|
+
export * from "./components";
|
|
8
|
+
|
|
9
|
+
export { fetchServer } from "./handler/fetch-server";
|
|
10
|
+
export { fetchAuth } from "./handler/fetch-auth";
|
|
11
|
+
|
|
12
|
+
export { VuerUserProvider } from "./vuer-user-provider";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { UserContext } from "./context/user-context";
|
|
4
4
|
import { getSession } from "./handler/get-session";
|
|
5
5
|
import { bearerToken } from "./localstorage-key";
|
|
6
6
|
import { UserSession } from "./types";
|
|
@@ -9,16 +9,21 @@ interface Props {
|
|
|
9
9
|
baseURL: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function
|
|
12
|
+
export function VuerUserProvider({ children, baseURL }: PropsWithChildren<Props>) {
|
|
13
13
|
const [isPending, setIsPending] = useState<boolean>(true);
|
|
14
14
|
const [session, setSession] = useState<UserSession | null>(null);
|
|
15
15
|
|
|
16
16
|
const refetchHandle = useCallback(async () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
try {
|
|
18
|
+
setIsPending(true);
|
|
19
|
+
const data = await getSession(baseURL);
|
|
20
|
+
setSession(data);
|
|
21
|
+
setIsPending(false);
|
|
22
|
+
return data;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error(e);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
22
27
|
}, [baseURL]);
|
|
23
28
|
|
|
24
29
|
useEffect(() => {
|
|
@@ -36,7 +41,7 @@ export function VuerAuthProvider({ children, baseURL }: PropsWithChildren<Props>
|
|
|
36
41
|
}, [refetchHandle]);
|
|
37
42
|
|
|
38
43
|
return (
|
|
39
|
-
<
|
|
44
|
+
<UserContext.Provider
|
|
40
45
|
value={useMemo(() => {
|
|
41
46
|
return {
|
|
42
47
|
baseURL,
|
|
@@ -47,6 +52,6 @@ export function VuerAuthProvider({ children, baseURL }: PropsWithChildren<Props>
|
|
|
47
52
|
}, [baseURL, session, isPending, refetchHandle])}
|
|
48
53
|
>
|
|
49
54
|
{children}
|
|
50
|
-
</
|
|
55
|
+
</UserContext.Provider>
|
|
51
56
|
);
|
|
52
57
|
}
|
package/src/dial/DialPanel.tsx
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DialGroupConfig, DialSchema, LabelPositionT } from "./DialProvider";
|
|
4
4
|
import {
|
|
5
5
|
DialBooleanInput,
|
|
6
6
|
DialColorInput,
|
|
7
7
|
DialEulerDegInput,
|
|
8
|
+
DialEulerRadInput,
|
|
8
9
|
DialIntInput,
|
|
9
10
|
DialNumberInput,
|
|
11
|
+
DialNumberRadInput,
|
|
12
|
+
DialPresetsInput,
|
|
10
13
|
DialSelectInput,
|
|
11
14
|
DialSliderInput,
|
|
12
15
|
DialTextInput,
|
|
13
16
|
DialVec3Input,
|
|
14
17
|
DialVectorInput,
|
|
15
|
-
DialPresetsInput,
|
|
16
|
-
DialEulerRadInput,
|
|
17
|
-
DialNumberRadInput,
|
|
18
18
|
} from "./wrapped-inputs";
|
|
19
|
+
|
|
19
20
|
interface DialSchemaRendererProps {
|
|
20
21
|
schemas: DialSchema[];
|
|
21
22
|
groups?: DialGroupConfig[];
|
|
22
23
|
labelLayout?: LabelPositionT;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
export const DialPanel: React.FC<DialSchemaRendererProps> = ({
|
|
26
|
+
export const DialPanel: React.FC<DialSchemaRendererProps> = ({
|
|
27
|
+
schemas,
|
|
28
|
+
groups: groupConfigs,
|
|
29
|
+
labelLayout,
|
|
30
|
+
}) => {
|
|
26
31
|
// Create a map of group configurations for easy lookup
|
|
27
32
|
const groupConfigMap: Record<string, DialGroupConfig> = {};
|
|
28
33
|
|
|
@@ -67,7 +72,7 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
67
72
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
68
73
|
// Use schema's label position if specified, otherwise fall back to panel's labelLayout prop
|
|
69
74
|
const effectiveLabelPosition = (tags?.labelPosition as LabelPositionT) || labelLayout;
|
|
70
|
-
const label = schema.label ||
|
|
75
|
+
const label = schema.label || name.charAt(0).toUpperCase() + name.slice(1);
|
|
71
76
|
|
|
72
77
|
// Choose the right input component based on dtype
|
|
73
78
|
switch (dtype) {
|
|
@@ -112,7 +117,12 @@ export const DialPanel: React.FC<DialSchemaRendererProps> = ({ schemas, groups:
|
|
|
112
117
|
|
|
113
118
|
case "boolean":
|
|
114
119
|
return (
|
|
115
|
-
<DialBooleanInput
|
|
120
|
+
<DialBooleanInput
|
|
121
|
+
key={name}
|
|
122
|
+
name={name}
|
|
123
|
+
label={label}
|
|
124
|
+
labelPosition={effectiveLabelPosition}
|
|
125
|
+
/>
|
|
116
126
|
);
|
|
117
127
|
|
|
118
128
|
case "number-slider":
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import React, { createContext, ReactNode, useCallback, useContext, useMemo, useState } from "react";
|
|
2
2
|
|
|
3
|
+
// Utility to check if an object is empty or nullish
|
|
4
|
+
function isEmptyObject(obj: unknown): boolean {
|
|
5
|
+
return obj == null || (typeof obj === "object" && Object.keys(obj).length === 0);
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
export type LabelPositionT = "left" | "top" | "inline" | undefined;
|
|
4
9
|
|
|
5
10
|
// Define specific value types for dial values
|
|
@@ -77,33 +82,82 @@ interface DialSchemaProviderProps {
|
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
// Provider component
|
|
80
|
-
export const DialProvider
|
|
85
|
+
export const DialProvider = ({
|
|
81
86
|
children,
|
|
82
87
|
schemas,
|
|
83
88
|
initialValues = {},
|
|
84
89
|
values: controlledValues,
|
|
85
90
|
onValueChange,
|
|
86
|
-
}) => {
|
|
91
|
+
}: DialSchemaProviderProps) => {
|
|
87
92
|
// Determine if component is controlled
|
|
88
|
-
const isControlled = controlledValues
|
|
93
|
+
const isControlled = !isEmptyObject(controlledValues);
|
|
89
94
|
|
|
90
95
|
// Initialize state with default values from schemas or provided initial values
|
|
91
|
-
const [internalValues, setInternalValues] = useState<Record<string, DialValue>>(() =>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
const [internalValues, setInternalValues] = useState<Record<string, DialValue>>(() =>
|
|
97
|
+
Object.fromEntries(
|
|
98
|
+
schemas.map((schema) => [schema.name, initialValues[schema.name] ?? schema.value]),
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
// Helper function to merge controlled values with schema defaults
|
|
103
|
+
const mergeWithSchemaDefaults = useCallback(
|
|
104
|
+
(inputValues: Record<string, DialValue>) => {
|
|
105
|
+
const result = { ...inputValues };
|
|
106
|
+
|
|
107
|
+
schemas.forEach((schema) => {
|
|
108
|
+
// If the input doesn't have this property or it's undefined/null, use schema default
|
|
109
|
+
if (result[schema.name] === undefined || result[schema.name] === null) {
|
|
110
|
+
if (schema.value !== undefined) {
|
|
111
|
+
result[schema.name] = schema.value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return result;
|
|
117
|
+
},
|
|
118
|
+
[schemas],
|
|
119
|
+
);
|
|
98
120
|
|
|
99
121
|
// Use controlled values if provided, otherwise use internal state
|
|
100
|
-
|
|
122
|
+
// Always merge with schema defaults to ensure missing properties get default values
|
|
123
|
+
const values =
|
|
124
|
+
isControlled && controlledValues ? mergeWithSchemaDefaults(controlledValues) : internalValues;
|
|
125
|
+
|
|
126
|
+
// Helper function to format numbers to avoid floating point precision issues
|
|
127
|
+
const formatNumber = useCallback((value: number): number => {
|
|
128
|
+
// Round to 6 decimal places to avoid floating point precision errors
|
|
129
|
+
return Math.round(value * 1000000) / 1000000;
|
|
130
|
+
}, []);
|
|
131
|
+
|
|
132
|
+
// Helper function to format values based on their type
|
|
133
|
+
const formatValue = useCallback(
|
|
134
|
+
(value: DialValue): DialValue => {
|
|
135
|
+
if (value === null || value === undefined) {
|
|
136
|
+
return value;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Format single numbers
|
|
140
|
+
if (typeof value === "number") {
|
|
141
|
+
return formatNumber(value);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Format number arrays (vectors, etc.)
|
|
145
|
+
if (Array.isArray(value) && value.every((v) => typeof v === "number")) {
|
|
146
|
+
return value.map((v) => formatNumber(v as number));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Return non-numeric values as-is
|
|
150
|
+
return value;
|
|
151
|
+
},
|
|
152
|
+
[formatNumber],
|
|
153
|
+
);
|
|
101
154
|
|
|
102
155
|
const getValue = useCallback(
|
|
103
156
|
(name: string) => {
|
|
104
|
-
|
|
157
|
+
const rawValue = values[name];
|
|
158
|
+
return formatValue(rawValue);
|
|
105
159
|
},
|
|
106
|
-
[values],
|
|
160
|
+
[values, formatValue],
|
|
107
161
|
);
|
|
108
162
|
|
|
109
163
|
const setValue = useCallback(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { PropsWithChildren, ReactElement, ReactNode, useCallback } from "react";
|
|
2
2
|
import { LabelPositionT, useDialSchema } from "../DialProvider";
|
|
3
3
|
import {
|
|
4
4
|
ColorInput,
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Input,
|
|
7
7
|
InputSlot,
|
|
8
8
|
Label,
|
|
9
|
+
type LayoutType,
|
|
9
10
|
Select,
|
|
10
11
|
SelectContent,
|
|
11
12
|
SelectItem,
|
|
@@ -15,56 +16,62 @@ import {
|
|
|
15
16
|
Switch,
|
|
16
17
|
} from "../../index"; // Base input component that connects to the dial store
|
|
17
18
|
|
|
18
|
-
// Base input component that connects to the dial store
|
|
19
|
-
interface DialInputProps {
|
|
20
|
-
name: string;
|
|
21
|
-
type?: string;
|
|
22
|
-
min?: number;
|
|
23
|
-
max?: number;
|
|
24
|
-
step?: number;
|
|
25
|
-
options?: any[];
|
|
26
|
-
label?: string;
|
|
27
|
-
labelPosition?: LabelPositionT;
|
|
28
|
-
size?: "sm" | "md" | "lg";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
// Helper component for wrapping inputs with labels
|
|
32
20
|
const DialInputWrapper: React.FC<{
|
|
33
21
|
label?: string;
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
labelPosition?: LabelPositionT;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}> = ({ label, labelPosition = "top", children }) => {
|
|
36
25
|
if (!label) {
|
|
37
26
|
return <>{children}</>;
|
|
38
27
|
}
|
|
39
28
|
|
|
40
29
|
return (
|
|
41
|
-
<FormLayout orientation=
|
|
30
|
+
<FormLayout orientation={`label-${labelPosition}` as LayoutType}>
|
|
42
31
|
<Label size="sm">{label}</Label>
|
|
43
|
-
{children}
|
|
32
|
+
{children as ReactElement}
|
|
44
33
|
</FormLayout>
|
|
45
34
|
);
|
|
46
35
|
};
|
|
47
36
|
|
|
48
|
-
export
|
|
37
|
+
export interface DialNumInputProps extends PropsWithChildren {
|
|
38
|
+
name: string;
|
|
39
|
+
type?: string;
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
step?: number;
|
|
43
|
+
options?: unknown[];
|
|
44
|
+
label?: string;
|
|
45
|
+
labelPosition?: LabelPositionT;
|
|
46
|
+
size?: "sm" | "md" | "lg";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Base input component that connects to the dial store
|
|
50
|
+
export const DialNumberInput: React.FC<DialNumInputProps> = ({
|
|
49
51
|
name,
|
|
50
52
|
min,
|
|
51
53
|
max,
|
|
52
54
|
step = 1,
|
|
53
55
|
label,
|
|
54
|
-
labelPosition,
|
|
56
|
+
labelPosition = "top",
|
|
55
57
|
size = "sm",
|
|
58
|
+
...props
|
|
56
59
|
}) => {
|
|
57
60
|
const { getValue, setValue } = useDialSchema();
|
|
58
61
|
const value = (getValue(name) ?? 0) as number;
|
|
59
62
|
|
|
63
|
+
const handleChange = useCallback(
|
|
64
|
+
(e: React.ChangeEvent<HTMLInputElement>) => setValue(name, parseFloat(e.target.value)),
|
|
65
|
+
[name],
|
|
66
|
+
);
|
|
67
|
+
|
|
60
68
|
const inputProps = {
|
|
61
69
|
type: "number" as const,
|
|
62
70
|
value,
|
|
63
71
|
min,
|
|
64
72
|
max,
|
|
65
73
|
step,
|
|
66
|
-
onChange:
|
|
67
|
-
setValue(name, parseFloat(e.target.value)),
|
|
74
|
+
onChange: handleChange,
|
|
68
75
|
size,
|
|
69
76
|
};
|
|
70
77
|
|
|
@@ -74,69 +81,82 @@ export const DialNumberInput: React.FC<DialInputProps> = ({
|
|
|
74
81
|
);
|
|
75
82
|
} else {
|
|
76
83
|
return (
|
|
77
|
-
<DialInputWrapper label={label}>
|
|
84
|
+
<DialInputWrapper label={label} labelPosition={labelPosition} {...props}>
|
|
78
85
|
<Input {...inputProps} />
|
|
79
86
|
</DialInputWrapper>
|
|
80
87
|
);
|
|
81
88
|
}
|
|
82
89
|
};
|
|
83
90
|
|
|
84
|
-
export const DialBooleanInput: React.FC<
|
|
91
|
+
export const DialBooleanInput: React.FC<DialNumInputProps> = ({
|
|
92
|
+
name,
|
|
93
|
+
label,
|
|
94
|
+
labelPosition,
|
|
95
|
+
...props
|
|
96
|
+
}) => {
|
|
85
97
|
const { getValue, setValue } = useDialSchema();
|
|
86
98
|
const value = (getValue(name) ?? false) as boolean;
|
|
87
99
|
|
|
100
|
+
const handleChange = useCallback((checked: boolean) => setValue(name, checked), [name]);
|
|
101
|
+
|
|
88
102
|
const switchProps = {
|
|
89
103
|
checked: value,
|
|
90
|
-
onCheckedChange:
|
|
104
|
+
onCheckedChange: handleChange,
|
|
91
105
|
};
|
|
92
106
|
|
|
93
|
-
if (!label) {
|
|
107
|
+
if (!label || labelPosition === "inline") {
|
|
94
108
|
return <Switch {...switchProps} />;
|
|
95
109
|
}
|
|
96
110
|
|
|
97
111
|
return (
|
|
98
|
-
<
|
|
99
|
-
<Label size="sm">{label}</Label>
|
|
112
|
+
<DialInputWrapper label={label} labelPosition={labelPosition} {...props}>
|
|
100
113
|
<Switch {...switchProps} />
|
|
101
|
-
</
|
|
114
|
+
</DialInputWrapper>
|
|
102
115
|
);
|
|
103
116
|
};
|
|
104
117
|
|
|
105
118
|
// Dial-wrapped ColorInput
|
|
106
|
-
export const DialColorInput: React.FC<
|
|
119
|
+
export const DialColorInput: React.FC<DialNumInputProps> = ({ name, label, ...props }) => {
|
|
107
120
|
const { getValue, setValue } = useDialSchema();
|
|
108
121
|
const value = (getValue(name) ?? "") as string;
|
|
109
122
|
|
|
110
|
-
const
|
|
111
|
-
|
|
123
|
+
const handleChange = useCallback(
|
|
124
|
+
(e: React.ChangeEvent<HTMLInputElement>) => setValue(name, e.target.value),
|
|
125
|
+
[name],
|
|
112
126
|
);
|
|
113
127
|
|
|
114
|
-
|
|
115
|
-
return inputComp;
|
|
116
|
-
}
|
|
128
|
+
const inputComp = <ColorInput value={value} onChange={handleChange} prefix={label} />;
|
|
117
129
|
|
|
118
|
-
return
|
|
130
|
+
return (
|
|
131
|
+
<DialInputWrapper label={label} {...props}>
|
|
132
|
+
{inputComp}
|
|
133
|
+
</DialInputWrapper>
|
|
134
|
+
);
|
|
119
135
|
};
|
|
120
136
|
|
|
121
|
-
export const DialSelectInput: React.FC<
|
|
137
|
+
export const DialSelectInput: React.FC<DialNumInputProps> = ({
|
|
122
138
|
name,
|
|
123
139
|
options = [],
|
|
124
140
|
label,
|
|
125
|
-
labelPosition,
|
|
126
141
|
size = "sm",
|
|
142
|
+
...props
|
|
127
143
|
}) => {
|
|
128
144
|
const { getValue, setValue } = useDialSchema();
|
|
129
145
|
const value = getValue(name);
|
|
130
146
|
|
|
147
|
+
console.log("dial schema:", name, value);
|
|
148
|
+
|
|
149
|
+
const handleValueChange = useCallback(
|
|
150
|
+
(val: string) => {
|
|
151
|
+
// Try to parse as number if possible
|
|
152
|
+
const parsed = !isNaN(Number(val)) ? Number(val) : val;
|
|
153
|
+
setValue(name, parsed);
|
|
154
|
+
},
|
|
155
|
+
[name],
|
|
156
|
+
);
|
|
157
|
+
|
|
131
158
|
const selectComponent = (
|
|
132
|
-
<Select
|
|
133
|
-
value={String(value)}
|
|
134
|
-
onValueChange={(val) => {
|
|
135
|
-
// Try to parse as number if possible
|
|
136
|
-
const parsed = !isNaN(Number(val)) ? Number(val) : val;
|
|
137
|
-
setValue(name, parsed);
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
159
|
+
<Select value={String(value)} onValueChange={handleValueChange}>
|
|
140
160
|
<SelectTrigger size={size}>
|
|
141
161
|
<SelectValue placeholder="Select an option" />
|
|
142
162
|
</SelectTrigger>
|
|
@@ -150,44 +170,39 @@ export const DialSelectInput: React.FC<DialInputProps> = ({
|
|
|
150
170
|
</Select>
|
|
151
171
|
);
|
|
152
172
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
173
|
+
return (
|
|
174
|
+
<DialInputWrapper label={label} {...props}>
|
|
175
|
+
{selectComponent}
|
|
176
|
+
</DialInputWrapper>
|
|
177
|
+
);
|
|
158
178
|
};
|
|
159
179
|
|
|
160
|
-
export const DialSliderInput: React.FC<
|
|
180
|
+
export const DialSliderInput: React.FC<DialNumInputProps> = ({
|
|
161
181
|
name,
|
|
162
182
|
min = 0,
|
|
163
183
|
max = 100,
|
|
164
184
|
step = 1,
|
|
165
185
|
label,
|
|
166
|
-
|
|
167
|
-
size = "sm",
|
|
186
|
+
...props
|
|
168
187
|
}) => {
|
|
169
188
|
const { getValue, setValue } = useDialSchema();
|
|
170
189
|
const value = (getValue(name) ?? min) as number;
|
|
171
190
|
|
|
191
|
+
const handleValueChange = useCallback(([val]: number[]) => setValue(name, val), [name]);
|
|
192
|
+
|
|
172
193
|
const sliderProps = {
|
|
173
194
|
value: [value],
|
|
174
|
-
onValueChange:
|
|
195
|
+
onValueChange: handleValueChange,
|
|
175
196
|
min,
|
|
176
197
|
max,
|
|
177
198
|
step,
|
|
178
199
|
className: "flex-1",
|
|
179
200
|
};
|
|
180
201
|
|
|
181
|
-
|
|
182
|
-
<
|
|
202
|
+
return (
|
|
203
|
+
<DialInputWrapper label={label} {...props}>
|
|
183
204
|
<Slider {...sliderProps} />
|
|
184
205
|
<span className="text-text-secondary w-12 text-right text-sm">{value}</span>
|
|
185
|
-
</
|
|
206
|
+
</DialInputWrapper>
|
|
186
207
|
);
|
|
187
|
-
|
|
188
|
-
if (!label) {
|
|
189
|
-
return sliderComponent;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return <DialInputWrapper label={label}>{sliderComponent}</DialInputWrapper>;
|
|
193
208
|
};
|