wcz-test 6.9.2 → 6.9.4
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/DialogsHooks-Bi8dZoyu.js +338 -0
- package/dist/DialogsHooks-Bi8dZoyu.js.map +1 -0
- package/dist/{RouterListItemButton-Cx7rXEfm.js → RouterListItemButton-CHS7rofI.js} +4 -4
- package/dist/{RouterListItemButton-Cx7rXEfm.js.map → RouterListItemButton-CHS7rofI.js.map} +1 -1
- package/dist/auth-client-B6cIXYDV.js +1417 -0
- package/dist/auth-client-B6cIXYDV.js.map +1 -0
- package/dist/client.d.ts +725 -0
- package/dist/client.js +1 -1
- package/dist/components.d.ts +134 -0
- package/dist/components.js +65 -66
- package/dist/components.js.map +1 -1
- package/dist/error-BhAKg8LX-X0sdNXNa.js +195 -0
- package/dist/error-BhAKg8LX-X0sdNXNa.js.map +1 -0
- package/dist/hooks.d.ts +192 -0
- package/dist/hooks.js +31 -31
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +74 -0
- package/dist/index.js +83 -84
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +476 -0
- package/dist/queries.d.ts +1956 -0
- package/dist/server-mxQ3s5dx-CC81W42s.js +644 -0
- package/dist/server-mxQ3s5dx-CC81W42s.js.map +1 -0
- package/dist/server.d.ts +41 -0
- package/dist/server.js +8659 -7
- package/dist/server.js.map +1 -1
- package/dist/utils.d.ts +11 -0
- package/dist/vite.d.ts +5 -0
- package/package.json +29 -29
- package/dist/DialogsHooks-BlUsVlfv.js +0 -39
- package/dist/DialogsHooks-BlUsVlfv.js.map +0 -1
- package/dist/auth-client-o9U0_qmf.js +0 -79
- package/dist/auth-client-o9U0_qmf.js.map +0 -1
- package/dist/components/core/AppTitle.d.ts +0 -2
- package/dist/components/core/Fullscreen.d.ts +0 -3
- package/dist/components/core/Layout.d.ts +0 -8
- package/dist/components/core/ToolbarAccount.d.ts +0 -2
- package/dist/components/core/TypographyWithIcon.d.ts +0 -7
- package/dist/components/core/navigation/NavigationList.d.ts +0 -22
- package/dist/components/core/navigation/NavigationListItem.d.ts +0 -16
- package/dist/components/core/navigation/NavigationRail.d.ts +0 -12
- package/dist/components/data-grid/ChipInputCell.d.ts +0 -9
- package/dist/components/data-grid/EditableColumnHeader.d.ts +0 -2
- package/dist/components/file/Dropzone.d.ts +0 -8
- package/dist/components/file/FileViewer.d.ts +0 -20
- package/dist/components/file/fileViewer/FileViewerGrid.d.ts +0 -17
- package/dist/components/file/fileViewer/FileViewerList.d.ts +0 -12
- package/dist/components/file/fileViewer/ImageViewer.d.ts +0 -6
- package/dist/components/file/fileViewer/common/ActionsMenu.d.ts +0 -15
- package/dist/components/form/FormAutocomplete.d.ts +0 -7
- package/dist/components/form/FormCheckbox.d.ts +0 -7
- package/dist/components/form/FormDatePicker.d.ts +0 -8
- package/dist/components/form/FormDateRangePicker.d.ts +0 -8
- package/dist/components/form/FormDateTimePicker.d.ts +0 -8
- package/dist/components/form/FormDateTimeRangePicker.d.ts +0 -8
- package/dist/components/form/FormNumberField.d.ts +0 -9
- package/dist/components/form/FormRadioGroup.d.ts +0 -13
- package/dist/components/form/FormSlider.d.ts +0 -7
- package/dist/components/form/FormSubmitButton.d.ts +0 -4
- package/dist/components/form/FormSwitch.d.ts +0 -7
- package/dist/components/form/FormTextField.d.ts +0 -7
- package/dist/components/form/FormTimePicker.d.ts +0 -8
- package/dist/components/form/FormTimeRangePicker.d.ts +0 -8
- package/dist/components/router/RouterButton.d.ts +0 -6
- package/dist/components/router/RouterError.d.ts +0 -7
- package/dist/components/router/RouterGridActionsCellItem.d.ts +0 -6
- package/dist/components/router/RouterIconButton.d.ts +0 -6
- package/dist/components/router/RouterLink.d.ts +0 -6
- package/dist/components/router/RouterListItemButton.d.ts +0 -6
- package/dist/components/router/RouterNotFound.d.ts +0 -1
- package/dist/components/router/RouterTab.d.ts +0 -6
- package/dist/contexts/DialogsContext.d.ts +0 -6
- package/dist/contexts/FileContext.d.ts +0 -13
- package/dist/env.d.ts +0 -10
- package/dist/exports/client.d.ts +0 -5
- package/dist/exports/components.d.ts +0 -14
- package/dist/exports/hooks.d.ts +0 -4
- package/dist/exports/index.d.ts +0 -3
- package/dist/exports/models.d.ts +0 -25
- package/dist/exports/queries.d.ts +0 -4
- package/dist/exports/server.d.ts +0 -3
- package/dist/exports/utils.d.ts +0 -3
- package/dist/exports/vite.d.ts +0 -1
- package/dist/hooks/DialogsHooks.d.ts +0 -42
- package/dist/hooks/FormHooks.d.ts +0 -52
- package/dist/hooks/ThemeHook.d.ts +0 -4
- package/dist/lib/auth/auth-client.d.ts +0 -688
- package/dist/lib/auth/auth.d.ts +0 -24
- package/dist/lib/db/index.d.ts +0 -4
- package/dist/lib/db/schemas/auth.d.ts +0 -606
- package/dist/lib/utils.d.ts +0 -50
- package/dist/lib/vite-plugin.d.ts +0 -2
- package/dist/models/Navigation.d.ts +0 -18
- package/dist/models/User.d.ts +0 -8
- package/dist/models/approval/Approval.d.ts +0 -177
- package/dist/models/approval/ApprovalEmployee.d.ts +0 -7
- package/dist/models/approval/ApprovalFlow.d.ts +0 -49
- package/dist/models/approval/ApprovalFlowStep.d.ts +0 -29
- package/dist/models/approval/ApprovalRequestType.d.ts +0 -5
- package/dist/models/approval/ApprovalStatus.d.ts +0 -9
- package/dist/models/approval/ApprovalStepResult.d.ts +0 -11
- package/dist/models/approval/StepApprovalOrder.d.ts +0 -6
- package/dist/models/email/Email.d.ts +0 -13
- package/dist/models/email/EmailAttachment.d.ts +0 -6
- package/dist/models/file/FileActions.d.ts +0 -6
- package/dist/models/file/FileMeta.d.ts +0 -15
- package/dist/models/peoplesoft/Department.d.ts +0 -58
- package/dist/models/peoplesoft/Employee.d.ts +0 -46
- package/dist/models/peoplesoft/EmployeeCategoryGroup.d.ts +0 -6
- package/dist/models/peoplesoft/EmployeeStatus.d.ts +0 -6
- package/dist/providers/DialogsProvider.d.ts +0 -6
- package/dist/providers/LayoutProvider.d.ts +0 -11
- package/dist/queries/Approval.d.ts +0 -585
- package/dist/queries/ApprovalHooks.d.ts +0 -315
- package/dist/queries/FileHooks.d.ts +0 -151
- package/dist/queries/PeopleSoftHooks.d.ts +0 -537
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/ChipInputCell.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterIconButton.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\";\r\nimport type { SxProps, Theme, TypographyProps } from \"@mui/material\";\r\n\r\ninterface TypographyWithIconProps extends TypographyProps {\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n}\r\n\r\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, ...props }) => {\r\n const iconSx: SxProps<Theme> = {\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n flexShrink: 0,\r\n lineHeight: 0,\r\n \"& > svg\": {\r\n display: \"block\",\r\n },\r\n };\r\n\r\n return (\r\n <Typography\r\n component=\"span\"\r\n sx={{\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n verticalAlign: \"middle\",\r\n ...sx,\r\n }}\r\n gap={1}\r\n {...props}\r\n >\r\n {startIcon && (\r\n <Stack component=\"span\" sx={iconSx}>\r\n {startIcon}\r\n </Stack>\r\n )}\r\n <Stack component=\"span\" sx={{ display: \"inline\", lineHeight: \"inherit\" }}>\r\n {children}\r\n </Stack>\r\n {endIcon && (\r\n <Stack component=\"span\" sx={iconSx}>\r\n {endIcon}\r\n </Stack>\r\n )}\r\n </Typography>\r\n );\r\n};","import { Box } from \"@mui/material\";\r\nimport { useEffect, useEffectEvent, useRef, useState } from \"react\";\r\nimport type { BoxProps } from \"@mui/material\";\r\nimport type { FC } from \"react\";\r\n\r\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\r\n const reference = useRef<HTMLDivElement | null>(null);\r\n const [height, setHeight] = useState<number>();\r\n\r\n const recompute = useEffectEvent(() => {\r\n if (!reference.current) return;\r\n const top = Math.ceil(reference.current.getBoundingClientRect().top);\r\n const avail = Math.max(0, window.innerHeight - top);\r\n setHeight(avail);\r\n });\r\n\r\n useEffect(() => {\r\n const element = reference.current;\r\n if (!element) return;\r\n\r\n recompute();\r\n\r\n window.addEventListener(\"resize\", recompute);\r\n\r\n const ro = new ResizeObserver(recompute);\r\n ro.observe(document.documentElement);\r\n ro.observe(document.body);\r\n ro.observe(element);\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", recompute);\r\n ro.disconnect();\r\n };\r\n }, []);\r\n\r\n return (\r\n <Box\r\n ref={reference}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n minHeight: 0,\r\n width: \"100%\",\r\n overflow: \"auto\",\r\n ...sx,\r\n }}\r\n height={height}\r\n {...props}\r\n >\r\n {children}\r\n </Box>\r\n );\r\n};","import CloudUpload from \"@mui/icons-material/CloudUpload\";\r\nimport { Paper, Typography, useTheme } from \"@mui/material\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport type { SxProps, Theme} from \"@mui/material\";\r\nimport type { CSSProperties, FC } from \"react\";\r\nimport type { DropzoneOptions} from \"react-dropzone\";\r\n\r\nconst baseStyle: CSSProperties = {\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n padding: \"20px\",\r\n borderWidth: 2,\r\n borderRadius: 2,\r\n borderStyle: \"dashed\",\r\n outline: \"none\",\r\n transition: \"border .24s ease-in-out\",\r\n cursor: \"pointer\",\r\n};\r\n\r\ninterface DropzoneProps extends DropzoneOptions {\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const Dropzone: FC<DropzoneProps> = ({ sx, ...props }) => {\r\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject, } = useDropzone(props);\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n\r\n const style = {\r\n ...baseStyle,\r\n ...(isFocused ? { borderColor: theme.palette.primary.main } : {}),\r\n ...(isDragAccept ? { borderColor: theme.palette.success.main } : {}),\r\n ...(isDragReject ? { borderColor: theme.palette.error.main } : {})\r\n };\r\n\r\n return (\r\n <Paper variant=\"outlined\" {...getRootProps({ style })} sx={sx}>\r\n <input {...getInputProps()} style={{ display: \"none\" }} />\r\n <CloudUpload />\r\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\r\n </Paper>\r\n );\r\n};","import { createContext, useContext } from \"react\";\r\nimport type { FileMeta } from \"../models/file/FileMeta\";\r\nimport type { FileActions } from \"~/models/file/FileActions\";\r\n\r\nexport interface FileContextValue {\r\n fileMetas: Array<FileMeta>;\r\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\r\n actions?: FileActions;\r\n setImageId: (imageId: string) => void;\r\n};\r\n\r\nexport const FileContext = createContext<FileContextValue | null>(null);\r\n\r\nexport const useFile = () => {\r\n const context = useContext(FileContext);\r\n if (!context) {\r\n throw new Error(\"FileViewer components must be used within FileViewer\");\r\n }\r\n return context;\r\n};","import Delete from \"@mui/icons-material/Delete\";\r\nimport FileDownload from \"@mui/icons-material/FileDownload\";\r\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport type { FC } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDialogs } from \"~/hooks/DialogsHooks\";\r\nimport { useDeleteFile, useDownloadFile } from \"~/queries/FileHooks\";\r\n\r\ninterface ActionsMenuProps {\r\n meta: FileMeta;\r\n menu: { mouseX: number; mouseY: number } | null;\r\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\r\n}\r\n\r\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\r\n const { t } = useTranslation();\r\n const { fileMetas, onDelete, actions } = useFile();\r\n const { confirm } = useDialogs();\r\n\r\n const handleMenuClose = () => { setMenu(null); };\r\n\r\n const { mutate: download, isPending: isDownloading } = useDownloadFile();\r\n const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();\r\n\r\n const handleOnDownload = () => {\r\n handleMenuClose();\r\n download(meta);\r\n };\r\n\r\n const handleOnDelete = async () => {\r\n if (!await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { fileName: meta.fileName })))\r\n return;\r\n\r\n deleteFile(meta);\r\n handleMenuClose();\r\n\r\n if (onDelete) {\r\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter(m => m.id !== meta.id);\r\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\r\n }\r\n };\r\n\r\n return (\r\n <Menu open={menu !== null} onClose={handleMenuClose} anchorReference=\"anchorPosition\" variant=\"menu\"\r\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}>\r\n <List disablePadding>\r\n {actions?.download !== false &&\r\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\r\n <ListItemIcon>\r\n <FileDownload />\r\n </ListItemIcon>\r\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\r\n </ListItemButton>\r\n }\r\n {actions?.delete !== false &&\r\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\r\n <ListItemIcon>\r\n <Delete />\r\n </ListItemIcon>\r\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\r\n </ListItemButton>\r\n }\r\n </List>\r\n </Menu>\r\n );\r\n};\r\n","import MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport { Box, IconButton, ImageListItem, ImageListItemBar, Stack, Tooltip } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport React, { Fragment, useEffect, useState } from \"react\";\r\nimport { useInView } from \"react-intersection-observer\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDownloadFile, useGetFileThumbnail, useOpenFile } from \"~/queries/FileHooks\";\r\n\r\nconst IMAGE_SIZE = 150;\r\n\r\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\r\n\r\nexport interface FileViewerGridProps {\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({ sx, size, itemBar }) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\r\n {fileMetas.map(fileMeta => (\r\n <GridFileViewerItem\r\n key={fileMeta.id}\r\n meta={fileMeta}\r\n size={size}\r\n itemBar={itemBar}\r\n />\r\n ))}\r\n </Stack>\r\n );\r\n};\r\n\r\ninterface GridFileViewerItemProps {\r\n meta: FileMeta;\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n}\r\n\r\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({ meta, size, itemBar }) => {\r\n const { setImageId, actions } = useFile();\r\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\r\n const { ref, inView } = useInView();\r\n\r\n useEffect(() => {\r\n setShowItemBar(itemBar === \"always\");\r\n }, [itemBar]);\r\n\r\n const { data: source } = useGetFileThumbnail({ meta }, { enabled: inView });\r\n\r\n const handleOnMouseEnter = () => setShowItemBar(true);\r\n const handleOnMouseLeave = () => itemBar !== \"always\" && setShowItemBar(false);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\r\n setTimeout(() => setShowItemBar(true));\r\n };\r\n\r\n const { mutate: openFile } = useOpenFile();\r\n const { mutate: download } = useDownloadFile();\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": { return setImageId(meta.id); }\r\n case \"application\": { return openFile(meta); }\r\n case \"video\": { return openFile(meta); }\r\n default: { return download(meta); }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ImageListItem sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }} onMouseEnter={handleOnMouseEnter} onMouseLeave={handleOnMouseLeave} ref={ref}>\r\n <Box\r\n component=\"img\"\r\n src={source}\r\n loading=\"lazy\"\r\n alt={\"thumbnail-\" + meta.id}\r\n onClick={onClick}\r\n sx={{ cursor: \"pointer\", objectFit: \"contain\", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\r\n />\r\n {(itemBar !== \"hidden\" && showItemBar) &&\r\n <ImageListItemBar\r\n title={\r\n <Tooltip title={meta.fileName}>\r\n <Box>\r\n {meta.fileName}\r\n </Box>\r\n </Tooltip>\r\n }\r\n actionIcon={\r\n (actions?.download !== false || actions.delete !== false) &&\r\n <IconButton sx={{ color: grey[100] }} onClick={openMenu}>\r\n <MoreVert />\r\n </IconButton>\r\n }\r\n />\r\n }\r\n </ImageListItem>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\r\n </Fragment>\r\n );\r\n};\r\n","import AttachFile from \"@mui/icons-material/AttachFile\";\r\nimport Image from \"@mui/icons-material/Image\";\r\nimport MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\r\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\r\nimport { Fragment, useState } from \"react\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { FC } from \"react\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDownloadFile, useOpenFile } from \"~/queries/FileHooks\";\r\n\r\nexport interface FileViewerListProps {\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <List dense sx={sx}>\r\n {fileMetas.map(fileMeta =>\r\n <ListFileViewerItem\r\n key={fileMeta.id}\r\n meta={fileMeta}\r\n />\r\n )}\r\n </List>\r\n );\r\n};\r\n\r\ninterface ListFileViewerItemProps {\r\n meta: FileMeta;\r\n}\r\n\r\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\r\n const { setImageId, actions } = useFile();\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n event.stopPropagation();\r\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\r\n };\r\n\r\n const { mutate: openFile } = useOpenFile();\r\n const { mutate: download } = useDownloadFile();\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": { return setImageId(meta.id); }\r\n case \"application\": { return openFile(meta); }\r\n case \"video\": { return openFile(meta); }\r\n default: { return download(meta); }\r\n }\r\n };\r\n\r\n const icon = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": {\r\n return <Image />;\r\n }\r\n case \"video\": {\r\n return <SmartDisplay />;\r\n }\r\n default: {\r\n return <AttachFile />;\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ListItemButton key={meta.id} onClick={onClick}>\r\n <ListItemIcon>\r\n {icon()}\r\n </ListItemIcon>\r\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\r\n {(actions?.download !== false || actions.delete !== false) &&\r\n <IconButton edge=\"end\" onClick={openMenu}>\r\n <MoreVert />\r\n </IconButton>\r\n }\r\n </ListItemButton>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\r\n </Fragment>\r\n );\r\n};\r\n","import Close from \"@mui/icons-material/Close\";\r\nimport { Box, Dialog, Fab } from \"@mui/material\";\r\nimport React, { useEffect } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useGetFile } from \"~/queries/FileHooks\";\r\n\r\ninterface ImageViewerProps {\r\n metaId: string;\r\n}\r\n\r\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\r\n const { fileMetas, setImageId } = useFile();\r\n\r\n const meta = fileMetas.find(m => m.id === metaId)!;\r\n\r\n const { data: source } = useGetFile({ meta });\r\n\r\n useEffect(() => {\r\n if (metaId)\r\n globalThis.addEventListener(\"keydown\", handleOnKeydown);\r\n\r\n return () => { globalThis.removeEventListener(\"keydown\", handleOnKeydown); };\r\n }, [metaId]);\r\n\r\n const handleOnKeydown = (event: KeyboardEvent) => {\r\n const images: Array<FileMeta> = fileMetas.filter(m => m.mediaType === \"image\");\r\n const imageIndex: number = images.findIndex(m => m.id === metaId);\r\n\r\n switch (event.key) {\r\n case \"ArrowLeft\": {\r\n return handleOnArrowLeft(images, imageIndex);\r\n }\r\n case \"ArrowRight\": {\r\n return handleOnArrowRight(images, imageIndex);\r\n }\r\n case \"Backspace\":\r\n case \"Escape\": {\r\n event.preventDefault();\r\n return onClose();\r\n }\r\n }\r\n };\r\n\r\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\r\n if (index > 0) {\r\n const previousFile: FileMeta = images[index - 1];\r\n setImageId(previousFile.id);\r\n }\r\n };\r\n\r\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\r\n if (index < images.length - 1) {\r\n const nextFile: FileMeta = images[index + 1];\r\n setImageId(nextFile.id);\r\n }\r\n };\r\n\r\n const onClose = () => setImageId(\"\");\r\n\r\n if (!metaId) return null;\r\n\r\n return (\r\n <Dialog open onClose={onClose} maxWidth=\"xl\">\r\n <Box component=\"img\" src={source} alt={metaId} sx={{ maxWidth: \"100vw\", maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" } }} />\r\n\r\n <Fab size=\"medium\" onClick={onClose} sx={{ position: \"fixed\", top: 8, right: 8 }}>\r\n <Close />\r\n </Fab>\r\n </Dialog>\r\n );\r\n};\r\n","import { useState } from \"react\";\r\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\r\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\r\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\r\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\r\nimport type { ComponentType, FC, ReactNode } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport type { FileActions } from \"~/models/file/FileActions\";\r\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\r\nimport { FileContext } from \"~/contexts/FileContext\";\r\nimport { useGetFileMetas } from \"~/queries/FileHooks\";\r\n\r\ninterface FileViewerComponent {\r\n Grid: ComponentType<FileViewerGridProps>;\r\n List: ComponentType<FileViewerListProps>;\r\n}\r\n\r\ninterface FileViewerProps {\r\n subId: string;\r\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\r\n actions?: FileActions;\r\n children: (component: FileViewerComponent) => ReactNode;\r\n}\r\n\r\nexport const FileViewer: FC<FileViewerProps> = ({ subId, onDelete, actions, children }) => {\r\n const { data: fileMetas = [] } = useGetFileMetas({ subId }, { enabled: !!subId });\r\n const [imageId, setImageId] = useState<string>(\"\");\r\n\r\n const components: FileViewerComponent = { Grid: FileViewerGrid, List: FileViewerList };\r\n\r\n if (fileMetas.length === 0) return null;\r\n\r\n return (\r\n <FileContext.Provider value={{ fileMetas, onDelete, actions, setImageId }}>\r\n {children(components)}\r\n <ImageViewer metaId={imageId} />\r\n </FileContext.Provider>\r\n );\r\n};\r\n","import { Chip, Stack } from \"@mui/material\";\r\nimport type { ChipProps} from \"@mui/material\";\r\nimport type { GridRenderCellParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\r\n\r\nconst isArray = (value: any) => Array.isArray(value);\r\n\r\ninterface ChipInputCellProps<T extends GridValidRowModel> {\r\n params: GridRenderCellParams<T>;\r\n slotProps?: ChipProps;\r\n getLabel?: (object: T) => string | number;\r\n}\r\n\r\nexport const ChipInputCell = <T extends GridValidRowModel>({ params, slotProps, getLabel }: ChipInputCellProps<T>) => {\r\n if (!params.value) return null;\r\n\r\n const getLabelValue = (value: any) => {\r\n if (getLabel) return getLabel(value);\r\n return value;\r\n };\r\n\r\n if (isArray(params.value))\r\n return (\r\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={{ overflowX: \"auto\", height: \"100%\", width: params.colDef.computedWidth }}>\r\n {params.value.map((value: any, index) =>\r\n <Chip key={`${index + 1}-chip-input-cell`} label={getLabelValue(value)} {...slotProps} />\r\n )}\r\n </Stack>\r\n );\r\n\r\n return <Chip label={getLabelValue(params.value)} {...slotProps} />;\r\n};","import Edit from \"@mui/icons-material/Edit\";\r\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\r\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\r\n\r\nexport const EditableColumnHeader = <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => {\r\n return <TypographyWithIcon endIcon={<Edit color=\"disabled\" fontSize=\"small\" />} variant=\"body2\" className=\"MuiDataGrid-columnHeaderTitle\">{colDef.headerName}</TypographyWithIcon>;\r\n};","import { Button } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { ButtonProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(function ButtonComponent(props, reference) {\r\n return <Button ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\r\n function GridActionsCellItemComponent(props, reference) {\r\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\r\n }\r\n) as React.ForwardRefExoticComponent<GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>>;\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { IconButton } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { IconButtonProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(function IconButtonComponent(props, reference) {\r\n return <IconButton ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Link } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { LinkProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(function LinkComponent(props, reference) {\r\n return <Link ref={reference} {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Tab } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { TabProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(function TabComponent(props, reference) {\r\n return <Tab ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Box, Divider, Typography } from \"@mui/material\";\r\nimport { useTranslation } from \"react-i18next\";\r\n\r\nexport function RouterNotFound() {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\r\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\r\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>404</Typography>\r\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\r\n <Typography variant=\"h5\" component=\"span\">{t(\"Layout.ThisPageCouldNotBeFound\")}</Typography>\r\n </Box>\r\n </Box>\r\n );\r\n}\r\n","import { Box, Divider, Typography } from \"@mui/material\";\r\nimport type { FC } from \"react\";\r\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\r\n\r\ninterface RouterErrorProps {\r\n error: ErrorComponentProps[\"error\"];\r\n}\r\n\r\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\r\n\r\n return (\r\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\r\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\r\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>{error.name || \"500\"}</Typography>\r\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\r\n <Typography variant=\"h5\" component=\"span\">{error.message}</Typography>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"names":["Component","CreatedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQO,MAAM,qBAAwD,CAAC,EAAE,WAAW,SAAS,UAAU,IAAI,GAAG,YAAY;AACrH,QAAM,SAAyB;AAAA,IAC3B,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EACb;AAGJ,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,IAAI;AAAA,QACA,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,GAAG;AAAA,MAAA;AAAA,MAEP,KAAK;AAAA,MACJ,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,iCACI,OAAA,EAAM,WAAU,QAAO,IAAI,QACvB,UAAA,WACL;AAAA,QAEJ,oBAAC,OAAA,EAAM,WAAU,QAAO,IAAI,EAAE,SAAS,UAAU,YAAY,UAAA,GACxD,SAAA,CACL;AAAA,QACC,WACG,oBAAC,OAAA,EAAM,WAAU,QAAO,IAAI,QACvB,UAAA,QAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIh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,UAAA,qBAAC,KAAA,EAAI,SAAQ,QAAO,YAAW,UAAS,IAAI,GAC1C,UAAA;AAAA,IAAA,oBAAC,YAAA,EAAW,SAAQ,MAAK,WAAU,QAAO,YAAY,KAAK,IAAI,EAAE,YAAY,EAAA,GAAM,UAAA,MAAM,QAAQ,OAAM;AAAA,IACvG,oBAAC,SAAA,EAAQ,aAAY,YAAW,UAAQ,MAAC,IAAI,EAAE,IAAI,EAAA,EAAE,CAAG;AAAA,wBACvD,YAAA,EAAW,SAAQ,MAAK,WAAU,QAAQ,gBAAM,QAAA,CAAQ;AAAA,EAAA,EAAA,CAC3D,EAAA,CACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components/core/TypographyWithIcon.tsx","../src/components/core/Fullscreen.tsx","../src/components/file/Dropzone.tsx","../src/contexts/FileContext.ts","../src/components/file/fileViewer/common/ActionsMenu.tsx","../src/components/file/fileViewer/FileViewerGrid.tsx","../src/components/file/fileViewer/FileViewerList.tsx","../src/components/file/fileViewer/ImageViewer.tsx","../src/components/file/FileViewer.tsx","../src/components/data-grid/ChipInputCell.tsx","../src/components/data-grid/EditableColumnHeader.tsx","../src/components/router/RouterButton.tsx","../src/components/router/RouterGridActionsCellItem.tsx","../src/components/router/RouterIconButton.tsx","../src/components/router/RouterLink.tsx","../src/components/router/RouterTab.tsx","../src/components/router/RouterNotFound.tsx","../src/components/router/RouterError.tsx"],"sourcesContent":["import { Stack, Typography } from \"@mui/material\";\r\nimport type { SxProps, Theme, TypographyProps } from \"@mui/material\";\r\n\r\ninterface TypographyWithIconProps extends TypographyProps {\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n}\r\n\r\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, ...props }) => {\r\n const iconSx: SxProps<Theme> = {\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n flexShrink: 0,\r\n lineHeight: 0,\r\n \"& > svg\": {\r\n display: \"block\",\r\n },\r\n };\r\n\r\n return (\r\n <Typography\r\n component=\"span\"\r\n sx={{\r\n display: \"inline-flex\",\r\n alignItems: \"center\",\r\n verticalAlign: \"middle\",\r\n ...sx,\r\n }}\r\n gap={1}\r\n {...props}\r\n >\r\n {startIcon && (\r\n <Stack component=\"span\" sx={iconSx}>\r\n {startIcon}\r\n </Stack>\r\n )}\r\n <Stack component=\"span\" sx={{ display: \"inline\", lineHeight: \"inherit\" }}>\r\n {children}\r\n </Stack>\r\n {endIcon && (\r\n <Stack component=\"span\" sx={iconSx}>\r\n {endIcon}\r\n </Stack>\r\n )}\r\n </Typography>\r\n );\r\n};","import { Box } from \"@mui/material\";\r\nimport { useEffect, useEffectEvent, useRef, useState } from \"react\";\r\nimport type { BoxProps } from \"@mui/material\";\r\nimport type { FC } from \"react\";\r\n\r\nexport const Fullscreen: FC<BoxProps> = ({ children, sx, ...props }) => {\r\n const reference = useRef<HTMLDivElement | null>(null);\r\n const [height, setHeight] = useState<number>();\r\n\r\n const recompute = useEffectEvent(() => {\r\n if (!reference.current) return;\r\n const top = Math.ceil(reference.current.getBoundingClientRect().top);\r\n const avail = Math.max(0, window.innerHeight - top);\r\n setHeight(avail);\r\n });\r\n\r\n useEffect(() => {\r\n const element = reference.current;\r\n if (!element) return;\r\n\r\n recompute();\r\n\r\n window.addEventListener(\"resize\", recompute);\r\n\r\n const ro = new ResizeObserver(recompute);\r\n ro.observe(document.documentElement);\r\n ro.observe(document.body);\r\n ro.observe(element);\r\n\r\n return () => {\r\n window.removeEventListener(\"resize\", recompute);\r\n ro.disconnect();\r\n };\r\n }, []);\r\n\r\n return (\r\n <Box\r\n ref={reference}\r\n sx={{\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n minHeight: 0,\r\n width: \"100%\",\r\n overflow: \"auto\",\r\n ...sx,\r\n }}\r\n height={height}\r\n {...props}\r\n >\r\n {children}\r\n </Box>\r\n );\r\n};","import CloudUpload from \"@mui/icons-material/CloudUpload\";\r\nimport { Paper, Typography, useTheme } from \"@mui/material\";\r\nimport { useDropzone } from \"react-dropzone\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport type { SxProps, Theme} from \"@mui/material\";\r\nimport type { CSSProperties, FC } from \"react\";\r\nimport type { DropzoneOptions} from \"react-dropzone\";\r\n\r\nconst baseStyle: CSSProperties = {\r\n flex: 1,\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n padding: \"20px\",\r\n borderWidth: 2,\r\n borderRadius: 2,\r\n borderStyle: \"dashed\",\r\n outline: \"none\",\r\n transition: \"border .24s ease-in-out\",\r\n cursor: \"pointer\",\r\n};\r\n\r\ninterface DropzoneProps extends DropzoneOptions {\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const Dropzone: FC<DropzoneProps> = ({ sx, ...props }) => {\r\n const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject, } = useDropzone(props);\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n\r\n const style = {\r\n ...baseStyle,\r\n ...(isFocused ? { borderColor: theme.palette.primary.main } : {}),\r\n ...(isDragAccept ? { borderColor: theme.palette.success.main } : {}),\r\n ...(isDragReject ? { borderColor: theme.palette.error.main } : {})\r\n };\r\n\r\n return (\r\n <Paper variant=\"outlined\" {...getRootProps({ style })} sx={sx}>\r\n <input {...getInputProps()} style={{ display: \"none\" }} />\r\n <CloudUpload />\r\n <Typography>{t(\"Layout.File.DragSomeFilesHereOrClickToSelectThem\")}</Typography>\r\n </Paper>\r\n );\r\n};","import { createContext, useContext } from \"react\";\r\nimport type { FileMeta } from \"../models/file/FileMeta\";\r\nimport type { FileActions } from \"~/models/file/FileActions\";\r\n\r\nexport interface FileContextValue {\r\n fileMetas: Array<FileMeta>;\r\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\r\n actions?: FileActions;\r\n setImageId: (imageId: string) => void;\r\n};\r\n\r\nexport const FileContext = createContext<FileContextValue | null>(null);\r\n\r\nexport const useFile = () => {\r\n const context = useContext(FileContext);\r\n if (!context) {\r\n throw new Error(\"FileViewer components must be used within FileViewer\");\r\n }\r\n return context;\r\n};","import Delete from \"@mui/icons-material/Delete\";\r\nimport FileDownload from \"@mui/icons-material/FileDownload\";\r\nimport { List, ListItemButton, ListItemIcon, ListItemText, Menu } from \"@mui/material\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport type { FC } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDialogs } from \"~/hooks/DialogsHooks\";\r\nimport { useDeleteFile, useDownloadFile } from \"~/queries/FileHooks\";\r\n\r\ninterface ActionsMenuProps {\r\n meta: FileMeta;\r\n menu: { mouseX: number; mouseY: number } | null;\r\n setMenu: (menu: { mouseX: number; mouseY: number } | null) => void;\r\n}\r\n\r\nexport const ActionsMenu: FC<ActionsMenuProps> = ({ meta, menu, setMenu }) => {\r\n const { t } = useTranslation();\r\n const { fileMetas, onDelete, actions } = useFile();\r\n const { confirm } = useDialogs();\r\n\r\n const handleMenuClose = () => { setMenu(null); };\r\n\r\n const { mutate: download, isPending: isDownloading } = useDownloadFile();\r\n const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();\r\n\r\n const handleOnDownload = () => {\r\n handleMenuClose();\r\n download(meta);\r\n };\r\n\r\n const handleOnDelete = async () => {\r\n if (!await confirm(t(\"Layout.File.AreYouSureYouWantToDelete\", { fileName: meta.fileName })))\r\n return;\r\n\r\n deleteFile(meta);\r\n handleMenuClose();\r\n\r\n if (onDelete) {\r\n const remainingFileMetas: Array<FileMeta> = fileMetas.filter(m => m.id !== meta.id);\r\n onDelete({ remainingFileMetas, deletedFileMeta: meta });\r\n }\r\n };\r\n\r\n return (\r\n <Menu open={menu !== null} onClose={handleMenuClose} anchorReference=\"anchorPosition\" variant=\"menu\"\r\n anchorPosition={menu === null ? undefined : { top: menu.mouseY, left: menu.mouseX }}>\r\n <List disablePadding>\r\n {actions?.download !== false &&\r\n <ListItemButton onClick={handleOnDownload} disabled={isDownloading}>\r\n <ListItemIcon>\r\n <FileDownload />\r\n </ListItemIcon>\r\n <ListItemText>{t(\"Layout.File.Download\")}</ListItemText>\r\n </ListItemButton>\r\n }\r\n {actions?.delete !== false &&\r\n <ListItemButton onClick={handleOnDelete} disabled={isDeleting}>\r\n <ListItemIcon>\r\n <Delete />\r\n </ListItemIcon>\r\n <ListItemText>{t(\"Layout.File.Delete\")}</ListItemText>\r\n </ListItemButton>\r\n }\r\n </List>\r\n </Menu>\r\n );\r\n};\r\n","import MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport { Box, IconButton, ImageListItem, ImageListItemBar, Stack, Tooltip } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport React, { Fragment, useEffect, useState } from \"react\";\r\nimport { useInView } from \"react-intersection-observer\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDownloadFile, useGetFileThumbnail, useOpenFile } from \"~/queries/FileHooks\";\r\n\r\nconst IMAGE_SIZE = 150;\r\n\r\ntype FileViewerGridItemBar = \"hidden\" | \"always\" | \"onMouseEnter\";\r\n\r\nexport interface FileViewerGridProps {\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerGrid: React.FC<FileViewerGridProps> = ({ sx, size, itemBar }) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <Stack direction=\"row\" spacing={1} sx={{ overflow: \"auto\", ...sx }}>\r\n {fileMetas.map(fileMeta => (\r\n <GridFileViewerItem\r\n key={fileMeta.id}\r\n meta={fileMeta}\r\n size={size}\r\n itemBar={itemBar}\r\n />\r\n ))}\r\n </Stack>\r\n );\r\n};\r\n\r\ninterface GridFileViewerItemProps {\r\n meta: FileMeta;\r\n size?: number;\r\n itemBar?: FileViewerGridItemBar;\r\n}\r\n\r\nexport const GridFileViewerItem: React.FC<GridFileViewerItemProps> = ({ meta, size, itemBar }) => {\r\n const { setImageId, actions } = useFile();\r\n const [showItemBar, setShowItemBar] = useState<boolean>(itemBar === \"always\");\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\r\n const { ref, inView } = useInView();\r\n\r\n useEffect(() => {\r\n setShowItemBar(itemBar === \"always\");\r\n }, [itemBar]);\r\n\r\n const { data: source } = useGetFileThumbnail({ meta }, { enabled: inView });\r\n\r\n const handleOnMouseEnter = () => setShowItemBar(true);\r\n const handleOnMouseLeave = () => itemBar !== \"always\" && setShowItemBar(false);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\r\n setTimeout(() => setShowItemBar(true));\r\n };\r\n\r\n const { mutate: openFile } = useOpenFile();\r\n const { mutate: download } = useDownloadFile();\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": { return setImageId(meta.id); }\r\n case \"application\": { return openFile(meta); }\r\n case \"video\": { return openFile(meta); }\r\n default: { return download(meta); }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ImageListItem sx={{ width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }} onMouseEnter={handleOnMouseEnter} onMouseLeave={handleOnMouseLeave} ref={ref}>\r\n <Box\r\n component=\"img\"\r\n src={source}\r\n loading=\"lazy\"\r\n alt={\"thumbnail-\" + meta.id}\r\n onClick={onClick}\r\n sx={{ cursor: \"pointer\", objectFit: \"contain\", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }}\r\n />\r\n {(itemBar !== \"hidden\" && showItemBar) &&\r\n <ImageListItemBar\r\n title={\r\n <Tooltip title={meta.fileName}>\r\n <Box>\r\n {meta.fileName}\r\n </Box>\r\n </Tooltip>\r\n }\r\n actionIcon={\r\n (actions?.download !== false || actions.delete !== false) &&\r\n <IconButton sx={{ color: grey[100] }} onClick={openMenu}>\r\n <MoreVert />\r\n </IconButton>\r\n }\r\n />\r\n }\r\n </ImageListItem>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\r\n </Fragment>\r\n );\r\n};\r\n","import AttachFile from \"@mui/icons-material/AttachFile\";\r\nimport Image from \"@mui/icons-material/Image\";\r\nimport MoreVert from \"@mui/icons-material/MoreVert\";\r\nimport SmartDisplay from \"@mui/icons-material/SmartDisplay\";\r\nimport { IconButton, List, ListItemButton, ListItemIcon, ListItemText } from \"@mui/material\";\r\nimport { Fragment, useState } from \"react\";\r\nimport { ActionsMenu } from \"./common/ActionsMenu\";\r\nimport type { FC } from \"react\";\r\nimport type { SxProps, Theme } from \"@mui/material\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useDownloadFile, useOpenFile } from \"~/queries/FileHooks\";\r\n\r\nexport interface FileViewerListProps {\r\n sx?: SxProps<Theme>;\r\n}\r\n\r\nexport const FileViewerList: FC<FileViewerListProps> = ({ sx }) => {\r\n const { fileMetas } = useFile();\r\n\r\n return (\r\n <List dense sx={sx}>\r\n {fileMetas.map(fileMeta =>\r\n <ListFileViewerItem\r\n key={fileMeta.id}\r\n meta={fileMeta}\r\n />\r\n )}\r\n </List>\r\n );\r\n};\r\n\r\ninterface ListFileViewerItemProps {\r\n meta: FileMeta;\r\n}\r\n\r\nexport const ListFileViewerItem: React.FC<ListFileViewerItemProps> = ({ meta }) => {\r\n const { setImageId, actions } = useFile();\r\n const [menu, setMenu] = useState<{ mouseX: number; mouseY: number; } | null>(null);\r\n\r\n const openMenu = (event: React.MouseEvent) => {\r\n event.stopPropagation();\r\n setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY, } : null);\r\n };\r\n\r\n const { mutate: openFile } = useOpenFile();\r\n const { mutate: download } = useDownloadFile();\r\n\r\n const onClick = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": { return setImageId(meta.id); }\r\n case \"application\": { return openFile(meta); }\r\n case \"video\": { return openFile(meta); }\r\n default: { return download(meta); }\r\n }\r\n };\r\n\r\n const icon = () => {\r\n switch (meta.mediaType) {\r\n case \"image\": {\r\n return <Image />;\r\n }\r\n case \"video\": {\r\n return <SmartDisplay />;\r\n }\r\n default: {\r\n return <AttachFile />;\r\n }\r\n }\r\n };\r\n\r\n return (\r\n <Fragment>\r\n <ListItemButton key={meta.id} onClick={onClick}>\r\n <ListItemIcon>\r\n {icon()}\r\n </ListItemIcon>\r\n <ListItemText primary={`${meta.fileName}.${meta.fileExtension}`} />\r\n {(actions?.download !== false || actions.delete !== false) &&\r\n <IconButton edge=\"end\" onClick={openMenu}>\r\n <MoreVert />\r\n </IconButton>\r\n }\r\n </ListItemButton>\r\n\r\n {(actions?.download !== false || actions.delete !== false) && <ActionsMenu meta={meta} menu={menu} setMenu={setMenu} />}\r\n </Fragment>\r\n );\r\n};\r\n","import Close from \"@mui/icons-material/Close\";\r\nimport { Box, Dialog, Fab } from \"@mui/material\";\r\nimport React, { useEffect } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { useFile } from \"~/contexts/FileContext\";\r\nimport { useGetFile } from \"~/queries/FileHooks\";\r\n\r\ninterface ImageViewerProps {\r\n metaId: string;\r\n}\r\n\r\nexport const ImageViewer: React.FC<ImageViewerProps> = ({ metaId }) => {\r\n const { fileMetas, setImageId } = useFile();\r\n\r\n const meta = fileMetas.find(m => m.id === metaId)!;\r\n\r\n const { data: source } = useGetFile({ meta });\r\n\r\n useEffect(() => {\r\n if (metaId)\r\n globalThis.addEventListener(\"keydown\", handleOnKeydown);\r\n\r\n return () => { globalThis.removeEventListener(\"keydown\", handleOnKeydown); };\r\n }, [metaId]);\r\n\r\n const handleOnKeydown = (event: KeyboardEvent) => {\r\n const images: Array<FileMeta> = fileMetas.filter(m => m.mediaType === \"image\");\r\n const imageIndex: number = images.findIndex(m => m.id === metaId);\r\n\r\n switch (event.key) {\r\n case \"ArrowLeft\": {\r\n return handleOnArrowLeft(images, imageIndex);\r\n }\r\n case \"ArrowRight\": {\r\n return handleOnArrowRight(images, imageIndex);\r\n }\r\n case \"Backspace\":\r\n case \"Escape\": {\r\n event.preventDefault();\r\n return onClose();\r\n }\r\n }\r\n };\r\n\r\n const handleOnArrowLeft = (images: Array<FileMeta>, index: number) => {\r\n if (index > 0) {\r\n const previousFile: FileMeta = images[index - 1];\r\n setImageId(previousFile.id);\r\n }\r\n };\r\n\r\n const handleOnArrowRight = (images: Array<FileMeta>, index: number) => {\r\n if (index < images.length - 1) {\r\n const nextFile: FileMeta = images[index + 1];\r\n setImageId(nextFile.id);\r\n }\r\n };\r\n\r\n const onClose = () => setImageId(\"\");\r\n\r\n if (!metaId) return null;\r\n\r\n return (\r\n <Dialog open onClose={onClose} maxWidth=\"xl\">\r\n <Box component=\"img\" src={source} alt={metaId} sx={{ maxWidth: \"100vw\", maxHeight: { xs: \"calc(100vh - 56px)\", sm: \"calc(100vh - 64px)\" } }} />\r\n\r\n <Fab size=\"medium\" onClick={onClose} sx={{ position: \"fixed\", top: 8, right: 8 }}>\r\n <Close />\r\n </Fab>\r\n </Dialog>\r\n );\r\n};\r\n","import { useState } from \"react\";\r\nimport { FileViewerGrid } from \"./fileViewer/FileViewerGrid\";\r\nimport { FileViewerList } from \"./fileViewer/FileViewerList\";\r\nimport { ImageViewer } from \"./fileViewer/ImageViewer\";\r\nimport type { FileViewerGridProps } from \"./fileViewer/FileViewerGrid\";\r\nimport type { ComponentType, FC, ReactNode } from \"react\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport type { FileActions } from \"~/models/file/FileActions\";\r\nimport type { FileViewerListProps } from \"./fileViewer/FileViewerList\";\r\nimport { FileContext } from \"~/contexts/FileContext\";\r\nimport { useGetFileMetas } from \"~/queries/FileHooks\";\r\n\r\ninterface FileViewerComponent {\r\n Grid: ComponentType<FileViewerGridProps>;\r\n List: ComponentType<FileViewerListProps>;\r\n}\r\n\r\ninterface FileViewerProps {\r\n subId: string;\r\n onDelete?: (params: { remainingFileMetas: Array<FileMeta>; deletedFileMeta: FileMeta }) => void;\r\n actions?: FileActions;\r\n children: (component: FileViewerComponent) => ReactNode;\r\n}\r\n\r\nexport const FileViewer: FC<FileViewerProps> = ({ subId, onDelete, actions, children }) => {\r\n const { data: fileMetas = [] } = useGetFileMetas({ subId }, { enabled: !!subId });\r\n const [imageId, setImageId] = useState<string>(\"\");\r\n\r\n const components: FileViewerComponent = { Grid: FileViewerGrid, List: FileViewerList };\r\n\r\n if (fileMetas.length === 0) return null;\r\n\r\n return (\r\n <FileContext.Provider value={{ fileMetas, onDelete, actions, setImageId }}>\r\n {children(components)}\r\n <ImageViewer metaId={imageId} />\r\n </FileContext.Provider>\r\n );\r\n};\r\n","import { Chip, Stack } from \"@mui/material\";\r\nimport type { ChipProps} from \"@mui/material\";\r\nimport type { GridRenderCellParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\r\n\r\nconst isArray = (value: any) => Array.isArray(value);\r\n\r\ninterface ChipInputCellProps<T extends GridValidRowModel> {\r\n params: GridRenderCellParams<T>;\r\n slotProps?: ChipProps;\r\n getLabel?: (object: T) => string | number;\r\n}\r\n\r\nexport const ChipInputCell = <T extends GridValidRowModel>({ params, slotProps, getLabel }: ChipInputCellProps<T>) => {\r\n if (!params.value) return null;\r\n\r\n const getLabelValue = (value: any) => {\r\n if (getLabel) return getLabel(value);\r\n return value;\r\n };\r\n\r\n if (isArray(params.value))\r\n return (\r\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={{ overflowX: \"auto\", height: \"100%\", width: params.colDef.computedWidth }}>\r\n {params.value.map((value: any, index) =>\r\n <Chip key={`${index + 1}-chip-input-cell`} label={getLabelValue(value)} {...slotProps} />\r\n )}\r\n </Stack>\r\n );\r\n\r\n return <Chip label={getLabelValue(params.value)} {...slotProps} />;\r\n};","import Edit from \"@mui/icons-material/Edit\";\r\nimport { TypographyWithIcon } from \"../core/TypographyWithIcon\";\r\nimport type { GridColumnHeaderParams, GridValidRowModel } from \"@mui/x-data-grid-premium\";\r\n\r\nexport const EditableColumnHeader = <T extends GridValidRowModel>({ colDef }: GridColumnHeaderParams<T>) => {\r\n return <TypographyWithIcon endIcon={<Edit color=\"disabled\" fontSize=\"small\" />} variant=\"body2\" className=\"MuiDataGrid-columnHeaderTitle\">{colDef.headerName}</TypographyWithIcon>;\r\n};","import { Button } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { ButtonProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, ButtonProps<\"a\">>(function ButtonComponent(props, reference) {\r\n return <Button ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterButton: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { GridActionsCellItem } from \"@mui/x-data-grid-premium\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { GridActionsCellItemProps } from \"@mui/x-data-grid-premium\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLButtonElement, GridActionsCellItemProps>(\r\n function GridActionsCellItemComponent(props, reference) {\r\n return <GridActionsCellItem ref={reference} component=\"a\" {...props} />;\r\n }\r\n) as React.ForwardRefExoticComponent<GridActionsCellItemProps & React.RefAttributes<HTMLButtonElement>>;\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterGridActionsCellItem: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { IconButton } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { IconButtonProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, IconButtonProps<\"a\">>(function IconButtonComponent(props, reference) {\r\n return <IconButton ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterIconButton: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Link } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { LinkProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, LinkProps>(function LinkComponent(props, reference) {\r\n return <Link ref={reference} {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterLink: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Tab } from \"@mui/material\";\r\nimport { createLink } from \"@tanstack/react-router\";\r\nimport React from \"react\";\r\nimport type { TabProps } from \"@mui/material\";\r\nimport type { LinkComponent } from \"@tanstack/react-router\";\r\n\r\nconst Component = React.forwardRef<HTMLAnchorElement, TabProps<\"a\">>(function TabComponent(props, reference) {\r\n return <Tab ref={reference} component=\"a\" {...props} />;\r\n});\r\n\r\nconst CreatedComponent = createLink(Component);\r\n\r\nexport const RouterTab: LinkComponent<typeof Component> = (props) => {\r\n return <CreatedComponent {...props} />;\r\n};","import { Box, Divider, Typography } from \"@mui/material\";\r\nimport { useTranslation } from \"react-i18next\";\r\n\r\nexport function RouterNotFound() {\r\n const { t } = useTranslation();\r\n\r\n return (\r\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\r\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\r\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>404</Typography>\r\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\r\n <Typography variant=\"h5\" component=\"span\">{t(\"Layout.ThisPageCouldNotBeFound\")}</Typography>\r\n </Box>\r\n </Box>\r\n );\r\n}\r\n","import { Box, Divider, Typography } from \"@mui/material\";\r\nimport type { FC } from \"react\";\r\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\r\n\r\ninterface RouterErrorProps {\r\n error: ErrorComponentProps[\"error\"];\r\n}\r\n\r\nexport const RouterError: FC<RouterErrorProps> = ({ error }) => {\r\n\r\n return (\r\n <Box height=\"100vh\" display=\"flex\" flexDirection=\"column\" alignItems=\"center\" justifyContent=\"center\" textAlign=\"center\" px={2} >\r\n <Box display=\"flex\" alignItems=\"center\" mb={4}>\r\n <Typography variant=\"h3\" component=\"span\" fontWeight={500} sx={{ lineHeight: 1 }}>{error.name || \"500\"}</Typography>\r\n <Divider orientation=\"vertical\" flexItem sx={{ mx: 3 }} />\r\n <Typography variant=\"h5\" component=\"span\">{error.message}</Typography>\r\n </Box>\r\n </Box>\r\n );\r\n};\r\n"],"names":["jsxs","jsx","Component","CreatedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQO,MAAM,qBAAwD,CAAC,EAAE,WAAW,SAAS,UAAU,IAAI,GAAG,YAAY;AACrH,QAAM,SAAyB;AAAA,IAC3B,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,MACP,SAAS;AAAA,IAAA;AAAA,EACb;AAGJ,SACIA,kCAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAU;AAAA,MACV,IAAI;AAAA,QACA,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,eAAe;AAAA,QACf,GAAG;AAAA,MAAA;AAAA,MAEP,KAAK;AAAA,MACJ,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,mD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is);
|
|
3
|
+
const env = new Proxy(_envShim, {
|
|
4
|
+
get(_, prop) {
|
|
5
|
+
return _getEnv()[prop] ?? _envShim[prop];
|
|
6
|
+
},
|
|
7
|
+
has(_, prop) {
|
|
8
|
+
return prop in _getEnv() || prop in _envShim;
|
|
9
|
+
},
|
|
10
|
+
set(_, prop, value) {
|
|
11
|
+
const env$1 = _getEnv(true);
|
|
12
|
+
env$1[prop] = value;
|
|
13
|
+
return true;
|
|
14
|
+
},
|
|
15
|
+
deleteProperty(_, prop) {
|
|
16
|
+
if (!prop) return false;
|
|
17
|
+
const env$1 = _getEnv(true);
|
|
18
|
+
delete env$1[prop];
|
|
19
|
+
return true;
|
|
20
|
+
},
|
|
21
|
+
ownKeys() {
|
|
22
|
+
const env$1 = _getEnv(true);
|
|
23
|
+
return Object.keys(env$1);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
typeof process !== "undefined" && process.env && process.env.NODE_ENV || "";
|
|
27
|
+
function getEnvVar(key, fallback) {
|
|
28
|
+
if (typeof process !== "undefined" && process.env) return process.env[key] ?? fallback;
|
|
29
|
+
if (typeof Deno !== "undefined") return Deno.env.get(key) ?? fallback;
|
|
30
|
+
if (typeof Bun !== "undefined") return Bun.env[key] ?? fallback;
|
|
31
|
+
return fallback;
|
|
32
|
+
}
|
|
33
|
+
const COLORS_2 = 1;
|
|
34
|
+
const COLORS_16 = 4;
|
|
35
|
+
const COLORS_256 = 8;
|
|
36
|
+
const COLORS_16m = 24;
|
|
37
|
+
const TERM_ENVS = {
|
|
38
|
+
eterm: COLORS_16,
|
|
39
|
+
cons25: COLORS_16,
|
|
40
|
+
console: COLORS_16,
|
|
41
|
+
cygwin: COLORS_16,
|
|
42
|
+
dtterm: COLORS_16,
|
|
43
|
+
gnome: COLORS_16,
|
|
44
|
+
hurd: COLORS_16,
|
|
45
|
+
jfbterm: COLORS_16,
|
|
46
|
+
konsole: COLORS_16,
|
|
47
|
+
kterm: COLORS_16,
|
|
48
|
+
mlterm: COLORS_16,
|
|
49
|
+
mosh: COLORS_16m,
|
|
50
|
+
putty: COLORS_16,
|
|
51
|
+
st: COLORS_16,
|
|
52
|
+
"rxvt-unicode-24bit": COLORS_16m,
|
|
53
|
+
terminator: COLORS_16m,
|
|
54
|
+
"xterm-kitty": COLORS_16m
|
|
55
|
+
};
|
|
56
|
+
const CI_ENVS_MAP = new Map(Object.entries({
|
|
57
|
+
APPVEYOR: COLORS_256,
|
|
58
|
+
BUILDKITE: COLORS_256,
|
|
59
|
+
CIRCLECI: COLORS_16m,
|
|
60
|
+
DRONE: COLORS_256,
|
|
61
|
+
GITEA_ACTIONS: COLORS_16m,
|
|
62
|
+
GITHUB_ACTIONS: COLORS_16m,
|
|
63
|
+
GITLAB_CI: COLORS_256,
|
|
64
|
+
TRAVIS: COLORS_256
|
|
65
|
+
}));
|
|
66
|
+
const TERM_ENVS_REG_EXP = [
|
|
67
|
+
/ansi/,
|
|
68
|
+
/color/,
|
|
69
|
+
/linux/,
|
|
70
|
+
/direct/,
|
|
71
|
+
/^con[0-9]*x[0-9]/,
|
|
72
|
+
/^rxvt/,
|
|
73
|
+
/^screen/,
|
|
74
|
+
/^xterm/,
|
|
75
|
+
/^vt100/,
|
|
76
|
+
/^vt220/
|
|
77
|
+
];
|
|
78
|
+
function getColorDepth() {
|
|
79
|
+
if (getEnvVar("FORCE_COLOR") !== void 0) switch (getEnvVar("FORCE_COLOR")) {
|
|
80
|
+
case "":
|
|
81
|
+
case "1":
|
|
82
|
+
case "true":
|
|
83
|
+
return COLORS_16;
|
|
84
|
+
case "2":
|
|
85
|
+
return COLORS_256;
|
|
86
|
+
case "3":
|
|
87
|
+
return COLORS_16m;
|
|
88
|
+
default:
|
|
89
|
+
return COLORS_2;
|
|
90
|
+
}
|
|
91
|
+
if (getEnvVar("NODE_DISABLE_COLORS") !== void 0 && getEnvVar("NODE_DISABLE_COLORS") !== "" || getEnvVar("NO_COLOR") !== void 0 && getEnvVar("NO_COLOR") !== "" || getEnvVar("TERM") === "dumb") return COLORS_2;
|
|
92
|
+
if (getEnvVar("TMUX")) return COLORS_16m;
|
|
93
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return COLORS_16;
|
|
94
|
+
if ("CI" in env) {
|
|
95
|
+
for (const { 0: envName, 1: colors } of CI_ENVS_MAP) if (envName in env) return colors;
|
|
96
|
+
if (getEnvVar("CI_NAME") === "codeship") return COLORS_256;
|
|
97
|
+
return COLORS_2;
|
|
98
|
+
}
|
|
99
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(getEnvVar("TEAMCITY_VERSION")) !== null ? COLORS_16 : COLORS_2;
|
|
100
|
+
switch (getEnvVar("TERM_PROGRAM")) {
|
|
101
|
+
case "iTerm.app":
|
|
102
|
+
if (!getEnvVar("TERM_PROGRAM_VERSION") || /^[0-2]\./.exec(getEnvVar("TERM_PROGRAM_VERSION")) !== null) return COLORS_256;
|
|
103
|
+
return COLORS_16m;
|
|
104
|
+
case "HyperTerm":
|
|
105
|
+
case "MacTerm":
|
|
106
|
+
return COLORS_16m;
|
|
107
|
+
case "Apple_Terminal":
|
|
108
|
+
return COLORS_256;
|
|
109
|
+
}
|
|
110
|
+
if (getEnvVar("COLORTERM") === "truecolor" || getEnvVar("COLORTERM") === "24bit") return COLORS_16m;
|
|
111
|
+
if (getEnvVar("TERM")) {
|
|
112
|
+
if (/truecolor/.exec(getEnvVar("TERM")) !== null) return COLORS_16m;
|
|
113
|
+
if (/^xterm-256/.exec(getEnvVar("TERM")) !== null) return COLORS_256;
|
|
114
|
+
const termEnv = getEnvVar("TERM").toLowerCase();
|
|
115
|
+
if (TERM_ENVS[termEnv]) return TERM_ENVS[termEnv];
|
|
116
|
+
if (TERM_ENVS_REG_EXP.some((term) => term.exec(termEnv) !== null)) return COLORS_16;
|
|
117
|
+
}
|
|
118
|
+
if (getEnvVar("COLORTERM")) return COLORS_16;
|
|
119
|
+
return COLORS_2;
|
|
120
|
+
}
|
|
121
|
+
const TTY_COLORS = {
|
|
122
|
+
reset: "\x1B[0m",
|
|
123
|
+
bright: "\x1B[1m",
|
|
124
|
+
dim: "\x1B[2m",
|
|
125
|
+
fg: {
|
|
126
|
+
red: "\x1B[31m",
|
|
127
|
+
green: "\x1B[32m",
|
|
128
|
+
yellow: "\x1B[33m",
|
|
129
|
+
blue: "\x1B[34m",
|
|
130
|
+
magenta: "\x1B[35m"
|
|
131
|
+
},
|
|
132
|
+
bg: {
|
|
133
|
+
black: "\x1B[40m"
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const levels = [
|
|
137
|
+
"info",
|
|
138
|
+
"success",
|
|
139
|
+
"warn",
|
|
140
|
+
"error",
|
|
141
|
+
"debug"
|
|
142
|
+
];
|
|
143
|
+
function shouldPublishLog(currentLogLevel, logLevel) {
|
|
144
|
+
return levels.indexOf(logLevel) <= levels.indexOf(currentLogLevel);
|
|
145
|
+
}
|
|
146
|
+
const levelColors = {
|
|
147
|
+
info: TTY_COLORS.fg.blue,
|
|
148
|
+
success: TTY_COLORS.fg.green,
|
|
149
|
+
warn: TTY_COLORS.fg.yellow,
|
|
150
|
+
error: TTY_COLORS.fg.red,
|
|
151
|
+
debug: TTY_COLORS.fg.magenta
|
|
152
|
+
};
|
|
153
|
+
const formatMessage = (level, message, colorsEnabled) => {
|
|
154
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
155
|
+
if (colorsEnabled) return `${TTY_COLORS.dim}${timestamp}${TTY_COLORS.reset} ${levelColors[level]}${level.toUpperCase()}${TTY_COLORS.reset} ${TTY_COLORS.bright}[Better Auth]:${TTY_COLORS.reset} ${message}`;
|
|
156
|
+
return `${timestamp} ${level.toUpperCase()} [Better Auth]: ${message}`;
|
|
157
|
+
};
|
|
158
|
+
const createLogger = (options) => {
|
|
159
|
+
const logLevel = options?.level ?? "error";
|
|
160
|
+
const colorsEnabled = getColorDepth() !== 1;
|
|
161
|
+
const LogFunc = (level, message, args = []) => {
|
|
162
|
+
if (!shouldPublishLog(logLevel, level)) return;
|
|
163
|
+
const formattedMessage = formatMessage(level, message, colorsEnabled);
|
|
164
|
+
{
|
|
165
|
+
if (level === "error") console.error(formattedMessage, ...args);
|
|
166
|
+
else if (level === "warn") console.warn(formattedMessage, ...args);
|
|
167
|
+
else console.log(formattedMessage, ...args);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
...Object.fromEntries(levels.map((level) => [level, (...[message, ...args]) => LogFunc(level, message, args)])),
|
|
173
|
+
get level() {
|
|
174
|
+
return logLevel;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
const logger = createLogger();
|
|
179
|
+
var BetterAuthError = class extends Error {
|
|
180
|
+
constructor(message, cause) {
|
|
181
|
+
super(message);
|
|
182
|
+
this.name = "BetterAuthError";
|
|
183
|
+
this.message = message;
|
|
184
|
+
this.cause = cause;
|
|
185
|
+
this.stack = "";
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
export {
|
|
189
|
+
BetterAuthError as B,
|
|
190
|
+
TTY_COLORS as T,
|
|
191
|
+
env as e,
|
|
192
|
+
getColorDepth as g,
|
|
193
|
+
logger as l
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=error-BhAKg8LX-X0sdNXNa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-BhAKg8LX-X0sdNXNa.js","sources":["../node_modules/@better-auth/core/dist/env-DwlNAN_D.mjs","../node_modules/@better-auth/core/dist/error-BhAKg8LX.mjs"],"sourcesContent":["//#region src/env/env-impl.ts\nconst _envShim = Object.create(null);\nconst _getEnv = (useShim) => globalThis.process?.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (useShim ? _envShim : globalThis);\nconst env = new Proxy(_envShim, {\n\tget(_, prop) {\n\t\treturn _getEnv()[prop] ?? _envShim[prop];\n\t},\n\thas(_, prop) {\n\t\treturn prop in _getEnv() || prop in _envShim;\n\t},\n\tset(_, prop, value) {\n\t\tconst env$1 = _getEnv(true);\n\t\tenv$1[prop] = value;\n\t\treturn true;\n\t},\n\tdeleteProperty(_, prop) {\n\t\tif (!prop) return false;\n\t\tconst env$1 = _getEnv(true);\n\t\tdelete env$1[prop];\n\t\treturn true;\n\t},\n\townKeys() {\n\t\tconst env$1 = _getEnv(true);\n\t\treturn Object.keys(env$1);\n\t}\n});\nfunction toBoolean(val) {\n\treturn val ? val !== \"false\" : false;\n}\nconst nodeENV = typeof process !== \"undefined\" && process.env && process.env.NODE_ENV || \"\";\n/** Detect if `NODE_ENV` environment variable is `production` */\nconst isProduction = nodeENV === \"production\";\n/** Detect if `NODE_ENV` environment variable is `dev` or `development` */\nconst isDevelopment = () => nodeENV === \"dev\" || nodeENV === \"development\";\n/** Detect if `NODE_ENV` environment variable is `test` */\nconst isTest = () => nodeENV === \"test\" || toBoolean(env.TEST);\n/**\n* Get environment variable with fallback\n*/\nfunction getEnvVar(key, fallback) {\n\tif (typeof process !== \"undefined\" && process.env) return process.env[key] ?? fallback;\n\tif (typeof Deno !== \"undefined\") return Deno.env.get(key) ?? fallback;\n\tif (typeof Bun !== \"undefined\") return Bun.env[key] ?? fallback;\n\treturn fallback;\n}\n/**\n* Get boolean environment variable\n*/\nfunction getBooleanEnvVar(key, fallback = true) {\n\tconst value = getEnvVar(key);\n\tif (!value) return fallback;\n\treturn value !== \"0\" && value.toLowerCase() !== \"false\" && value !== \"\";\n}\n/**\n* Common environment variables used in Better Auth\n*/\nconst ENV = Object.freeze({\n\tget BETTER_AUTH_SECRET() {\n\t\treturn getEnvVar(\"BETTER_AUTH_SECRET\");\n\t},\n\tget AUTH_SECRET() {\n\t\treturn getEnvVar(\"AUTH_SECRET\");\n\t},\n\tget BETTER_AUTH_TELEMETRY() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ID() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ID\");\n\t},\n\tget NODE_ENV() {\n\t\treturn getEnvVar(\"NODE_ENV\", \"development\");\n\t},\n\tget PACKAGE_VERSION() {\n\t\treturn getEnvVar(\"PACKAGE_VERSION\", \"0.0.0\");\n\t},\n\tget BETTER_AUTH_TELEMETRY_ENDPOINT() {\n\t\treturn getEnvVar(\"BETTER_AUTH_TELEMETRY_ENDPOINT\", \"https://telemetry.better-auth.com/v1/track\");\n\t}\n});\n\n//#endregion\n//#region src/env/color-depth.ts\nconst COLORS_2 = 1;\nconst COLORS_16 = 4;\nconst COLORS_256 = 8;\nconst COLORS_16m = 24;\nconst TERM_ENVS = {\n\teterm: COLORS_16,\n\tcons25: COLORS_16,\n\tconsole: COLORS_16,\n\tcygwin: COLORS_16,\n\tdtterm: COLORS_16,\n\tgnome: COLORS_16,\n\thurd: COLORS_16,\n\tjfbterm: COLORS_16,\n\tkonsole: COLORS_16,\n\tkterm: COLORS_16,\n\tmlterm: COLORS_16,\n\tmosh: COLORS_16m,\n\tputty: COLORS_16,\n\tst: COLORS_16,\n\t\"rxvt-unicode-24bit\": COLORS_16m,\n\tterminator: COLORS_16m,\n\t\"xterm-kitty\": COLORS_16m\n};\nconst CI_ENVS_MAP = new Map(Object.entries({\n\tAPPVEYOR: COLORS_256,\n\tBUILDKITE: COLORS_256,\n\tCIRCLECI: COLORS_16m,\n\tDRONE: COLORS_256,\n\tGITEA_ACTIONS: COLORS_16m,\n\tGITHUB_ACTIONS: COLORS_16m,\n\tGITLAB_CI: COLORS_256,\n\tTRAVIS: COLORS_256\n}));\nconst TERM_ENVS_REG_EXP = [\n\t/ansi/,\n\t/color/,\n\t/linux/,\n\t/direct/,\n\t/^con[0-9]*x[0-9]/,\n\t/^rxvt/,\n\t/^screen/,\n\t/^xterm/,\n\t/^vt100/,\n\t/^vt220/\n];\nfunction getColorDepth() {\n\tif (getEnvVar(\"FORCE_COLOR\") !== void 0) switch (getEnvVar(\"FORCE_COLOR\")) {\n\t\tcase \"\":\n\t\tcase \"1\":\n\t\tcase \"true\": return COLORS_16;\n\t\tcase \"2\": return COLORS_256;\n\t\tcase \"3\": return COLORS_16m;\n\t\tdefault: return COLORS_2;\n\t}\n\tif (getEnvVar(\"NODE_DISABLE_COLORS\") !== void 0 && getEnvVar(\"NODE_DISABLE_COLORS\") !== \"\" || getEnvVar(\"NO_COLOR\") !== void 0 && getEnvVar(\"NO_COLOR\") !== \"\" || getEnvVar(\"TERM\") === \"dumb\") return COLORS_2;\n\tif (getEnvVar(\"TMUX\")) return COLORS_16m;\n\tif (\"TF_BUILD\" in env && \"AGENT_NAME\" in env) return COLORS_16;\n\tif (\"CI\" in env) {\n\t\tfor (const { 0: envName, 1: colors } of CI_ENVS_MAP) if (envName in env) return colors;\n\t\tif (getEnvVar(\"CI_NAME\") === \"codeship\") return COLORS_256;\n\t\treturn COLORS_2;\n\t}\n\tif (\"TEAMCITY_VERSION\" in env) return /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.exec(getEnvVar(\"TEAMCITY_VERSION\")) !== null ? COLORS_16 : COLORS_2;\n\tswitch (getEnvVar(\"TERM_PROGRAM\")) {\n\t\tcase \"iTerm.app\":\n\t\t\tif (!getEnvVar(\"TERM_PROGRAM_VERSION\") || /^[0-2]\\./.exec(getEnvVar(\"TERM_PROGRAM_VERSION\")) !== null) return COLORS_256;\n\t\t\treturn COLORS_16m;\n\t\tcase \"HyperTerm\":\n\t\tcase \"MacTerm\": return COLORS_16m;\n\t\tcase \"Apple_Terminal\": return COLORS_256;\n\t}\n\tif (getEnvVar(\"COLORTERM\") === \"truecolor\" || getEnvVar(\"COLORTERM\") === \"24bit\") return COLORS_16m;\n\tif (getEnvVar(\"TERM\")) {\n\t\tif (/truecolor/.exec(getEnvVar(\"TERM\")) !== null) return COLORS_16m;\n\t\tif (/^xterm-256/.exec(getEnvVar(\"TERM\")) !== null) return COLORS_256;\n\t\tconst termEnv = getEnvVar(\"TERM\").toLowerCase();\n\t\tif (TERM_ENVS[termEnv]) return TERM_ENVS[termEnv];\n\t\tif (TERM_ENVS_REG_EXP.some((term) => term.exec(termEnv) !== null)) return COLORS_16;\n\t}\n\tif (getEnvVar(\"COLORTERM\")) return COLORS_16;\n\treturn COLORS_2;\n}\n\n//#endregion\n//#region src/env/logger.ts\nconst TTY_COLORS = {\n\treset: \"\\x1B[0m\",\n\tbright: \"\\x1B[1m\",\n\tdim: \"\\x1B[2m\",\n\tundim: \"\\x1B[22m\",\n\tunderscore: \"\\x1B[4m\",\n\tblink: \"\\x1B[5m\",\n\treverse: \"\\x1B[7m\",\n\thidden: \"\\x1B[8m\",\n\tfg: {\n\t\tblack: \"\\x1B[30m\",\n\t\tred: \"\\x1B[31m\",\n\t\tgreen: \"\\x1B[32m\",\n\t\tyellow: \"\\x1B[33m\",\n\t\tblue: \"\\x1B[34m\",\n\t\tmagenta: \"\\x1B[35m\",\n\t\tcyan: \"\\x1B[36m\",\n\t\twhite: \"\\x1B[37m\"\n\t},\n\tbg: {\n\t\tblack: \"\\x1B[40m\",\n\t\tred: \"\\x1B[41m\",\n\t\tgreen: \"\\x1B[42m\",\n\t\tyellow: \"\\x1B[43m\",\n\t\tblue: \"\\x1B[44m\",\n\t\tmagenta: \"\\x1B[45m\",\n\t\tcyan: \"\\x1B[46m\",\n\t\twhite: \"\\x1B[47m\"\n\t}\n};\nconst levels = [\n\t\"info\",\n\t\"success\",\n\t\"warn\",\n\t\"error\",\n\t\"debug\"\n];\nfunction shouldPublishLog(currentLogLevel, logLevel) {\n\treturn levels.indexOf(logLevel) <= levels.indexOf(currentLogLevel);\n}\nconst levelColors = {\n\tinfo: TTY_COLORS.fg.blue,\n\tsuccess: TTY_COLORS.fg.green,\n\twarn: TTY_COLORS.fg.yellow,\n\terror: TTY_COLORS.fg.red,\n\tdebug: TTY_COLORS.fg.magenta\n};\nconst formatMessage = (level, message, colorsEnabled) => {\n\tconst timestamp = (/* @__PURE__ */ new Date()).toISOString();\n\tif (colorsEnabled) return `${TTY_COLORS.dim}${timestamp}${TTY_COLORS.reset} ${levelColors[level]}${level.toUpperCase()}${TTY_COLORS.reset} ${TTY_COLORS.bright}[Better Auth]:${TTY_COLORS.reset} ${message}`;\n\treturn `${timestamp} ${level.toUpperCase()} [Better Auth]: ${message}`;\n};\nconst createLogger = (options) => {\n\tconst enabled = options?.disabled !== true;\n\tconst logLevel = options?.level ?? \"error\";\n\tconst colorsEnabled = options?.disableColors !== void 0 ? !options.disableColors : getColorDepth() !== 1;\n\tconst LogFunc = (level, message, args = []) => {\n\t\tif (!enabled || !shouldPublishLog(logLevel, level)) return;\n\t\tconst formattedMessage = formatMessage(level, message, colorsEnabled);\n\t\tif (!options || typeof options.log !== \"function\") {\n\t\t\tif (level === \"error\") console.error(formattedMessage, ...args);\n\t\t\telse if (level === \"warn\") console.warn(formattedMessage, ...args);\n\t\t\telse console.log(formattedMessage, ...args);\n\t\t\treturn;\n\t\t}\n\t\toptions.log(level === \"success\" ? \"info\" : level, message, ...args);\n\t};\n\treturn {\n\t\t...Object.fromEntries(levels.map((level) => [level, (...[message, ...args]) => LogFunc(level, message, args)])),\n\t\tget level() {\n\t\t\treturn logLevel;\n\t\t}\n\t};\n};\nconst logger = createLogger();\n\n//#endregion\nexport { shouldPublishLog as a, env as c, isDevelopment as d, isProduction as f, logger as i, getBooleanEnvVar as l, nodeENV as m, createLogger as n, getColorDepth as o, isTest as p, levels as r, ENV as s, TTY_COLORS as t, getEnvVar as u };","import { t as defineErrorCodes } from \"./utils-C5EN75oV.mjs\";\n\n//#region src/error/codes.ts\nconst BASE_ERROR_CODES = defineErrorCodes({\n\tUSER_NOT_FOUND: \"User not found\",\n\tFAILED_TO_CREATE_USER: \"Failed to create user\",\n\tFAILED_TO_CREATE_SESSION: \"Failed to create session\",\n\tFAILED_TO_UPDATE_USER: \"Failed to update user\",\n\tFAILED_TO_GET_SESSION: \"Failed to get session\",\n\tINVALID_PASSWORD: \"Invalid password\",\n\tINVALID_EMAIL: \"Invalid email\",\n\tINVALID_EMAIL_OR_PASSWORD: \"Invalid email or password\",\n\tSOCIAL_ACCOUNT_ALREADY_LINKED: \"Social account already linked\",\n\tPROVIDER_NOT_FOUND: \"Provider not found\",\n\tINVALID_TOKEN: \"Invalid token\",\n\tID_TOKEN_NOT_SUPPORTED: \"id_token not supported\",\n\tFAILED_TO_GET_USER_INFO: \"Failed to get user info\",\n\tUSER_EMAIL_NOT_FOUND: \"User email not found\",\n\tEMAIL_NOT_VERIFIED: \"Email not verified\",\n\tPASSWORD_TOO_SHORT: \"Password too short\",\n\tPASSWORD_TOO_LONG: \"Password too long\",\n\tUSER_ALREADY_EXISTS: \"User already exists.\",\n\tUSER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: \"User already exists. Use another email.\",\n\tEMAIL_CAN_NOT_BE_UPDATED: \"Email can not be updated\",\n\tCREDENTIAL_ACCOUNT_NOT_FOUND: \"Credential account not found\",\n\tSESSION_EXPIRED: \"Session expired. Re-authenticate to perform this action.\",\n\tFAILED_TO_UNLINK_LAST_ACCOUNT: \"You can't unlink your last account\",\n\tACCOUNT_NOT_FOUND: \"Account not found\",\n\tUSER_ALREADY_HAS_PASSWORD: \"User already has a password. Provide that to delete the account.\"\n});\n\n//#endregion\n//#region src/error/index.ts\nvar BetterAuthError = class extends Error {\n\tconstructor(message, cause) {\n\t\tsuper(message);\n\t\tthis.name = \"BetterAuthError\";\n\t\tthis.message = message;\n\t\tthis.cause = cause;\n\t\tthis.stack = \"\";\n\t}\n};\n\n//#endregion\nexport { BASE_ERROR_CODES as n, BetterAuthError as t };"],"names":[],"mappings":"AACA,MAAM,WAAW,uBAAO,OAAO,IAAI;AACnC,MAAM,UAAU,CAAC,YAAY,WAAW,SAAS,OAAO,WAAW,MAAM,IAAI,SAAQ,KAAM,WAAW,YAAY,UAAU,WAAW;AAClI,MAAC,MAAM,IAAI,MAAM,UAAU;AAAA,EAC/B,IAAI,GAAG,MAAM;AACZ,WAAO,QAAO,EAAG,IAAI,KAA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AE,GAAG,WAAW,KAAK,IAAI,WAAW,MAAM,iBAAiB,WAAW,KAAK,IAAI,OAAO;AAC1M,SAAO,GAAG,SAAS,IAAI,MAAM,aAAa,mBAAmB,OAAO;AACrE;AACA,MAAM,eAAe,CAAC,YAAY;AAEjC,QAAM,WAAW,SAAS,SAAS;AACnC,QAAM,gBAA6E,cAAa,MAAO;AACvG,QAAM,UAAU,CAAC,OAAO,SAAS,OAAO,CAAA,MAAO;AAC9C,QAAgB,CAAC,iBAAiB,UAAU,KAAK,EAAG;AACpD,UAAM,mBAAmB,cAAc,OAAO,SAAS,aAAa;AACjB;AAClD,UAAI,UAAU,QAAS,SAAQ,MAAM,kBAAkB,GAAG,IAAI;AAAA,eACrD,UAAU,OAAQ,SAAQ,KAAK,kBAAkB,GAAG,IAAI;AAAA,UAC5D,SAAQ,IAAI,kBAAkB,GAAG,IAAI;AAC1C;AAAA,IACD;AAAA,EAED;AACA,SAAO;AAAA,IACN,GAAG,OAAO,YAAY,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAY,OAAI,MAAM,QAAQ,OAAO,SAAS,IAAI,CAAC,CAAC,CAAC;AAAA,IAC9G,IAAI,QAAQ;AACX,aAAO;AAAA,IACR;AAAA,EACF;AACA;AACK,MAAC,SAAS,aAAY;AChNxB,IAAC,kBAAkB,cAAc,MAAM;AAAA,EACzC,YAAY,SAAS,OAAO;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,QAAQ;AACb,SAAK,QAAQ;AAAA,EACd;AACD;","x_google_ignoreList":[0,1]}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { AppFieldExtendedReactFormApi } from '@tanstack/react-form';
|
|
2
|
+
import { AutocompleteProps } from '@mui/material';
|
|
3
|
+
import { ButtonProps } from '@mui/material';
|
|
4
|
+
import { CheckboxProps } from '@mui/material';
|
|
5
|
+
import { DatePickerProps } from '@mui/x-date-pickers-pro';
|
|
6
|
+
import { DateRangePickerProps } from '@mui/x-date-pickers-pro';
|
|
7
|
+
import { DateTimePickerProps } from '@mui/x-date-pickers-pro';
|
|
8
|
+
import { DateTimeRangePickerProps } from '@mui/x-date-pickers-pro';
|
|
9
|
+
import { FC } from 'react';
|
|
10
|
+
import { FieldApi } from '@tanstack/form-core';
|
|
11
|
+
import { FormAsyncValidateOrFn } from '@tanstack/form-core';
|
|
12
|
+
import { FormOptions } from '@tanstack/form-core';
|
|
13
|
+
import { FormValidateOrFn } from '@tanstack/form-core';
|
|
14
|
+
import { InputAttributes } from 'react-number-format/types/types';
|
|
15
|
+
import { NumericFormatProps } from 'react-number-format/types/types';
|
|
16
|
+
import { PropsWithChildren } from 'react';
|
|
17
|
+
import { RadioGroupProps } from '@mui/material';
|
|
18
|
+
import { ReactFormExtendedApi } from '@tanstack/react-form';
|
|
19
|
+
import { ReactNode } from 'react';
|
|
20
|
+
import { SliderProps } from '@mui/material';
|
|
21
|
+
import { SwitchProps } from '@mui/material';
|
|
22
|
+
import { TextFieldProps } from '@mui/material';
|
|
23
|
+
import { TimePickerProps } from '@mui/x-date-pickers-pro';
|
|
24
|
+
import { TimeRangePickerProps } from '@mui/x-date-pickers-pro';
|
|
25
|
+
import { useInView } from 'react-intersection-observer';
|
|
26
|
+
import { WithFormProps } from '@tanstack/react-form';
|
|
27
|
+
|
|
28
|
+
declare interface AlertOptions {
|
|
29
|
+
title?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;
|
|
33
|
+
|
|
34
|
+
declare interface ConfirmOptions {
|
|
35
|
+
title?: ReactNode;
|
|
36
|
+
cancelText?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare type DialogComponent<TPayload, TResult> = React.ComponentType<DialogProps<TPayload, TResult>>;
|
|
40
|
+
|
|
41
|
+
declare interface DialogHook {
|
|
42
|
+
alert: OpenAlertDialog;
|
|
43
|
+
confirm: OpenConfirmDialog;
|
|
44
|
+
open: OpenDialog;
|
|
45
|
+
close: CloseDialog;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare interface DialogProps<TPayload = undefined, TResult = void> {
|
|
49
|
+
payload: TPayload;
|
|
50
|
+
open: boolean;
|
|
51
|
+
onClose: (result: TResult) => Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare interface FormAutocompleteProps extends Omit<AutocompleteProps<any, boolean, boolean, boolean>, FormOmittedProps> {
|
|
55
|
+
textFieldProps?: Omit<TextFieldProps, FormOmittedProps>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare interface FormCheckboxProps extends Omit<CheckboxProps, FormOmittedProps> {
|
|
59
|
+
label?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare interface FormDatePickerProps extends Omit<DatePickerProps, FormOmittedProps> {
|
|
63
|
+
textFieldProps?: TextFieldProps;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare interface FormDateRangePickerProps extends Omit<DateRangePickerProps, FormOmittedProps> {
|
|
67
|
+
textFieldProps?: TextFieldProps;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare interface FormDateTimePickerProps extends Omit<DateTimePickerProps, FormOmittedProps> {
|
|
71
|
+
textFieldProps?: TextFieldProps;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare interface FormDateTimeRangePickerProps extends Omit<DateTimeRangePickerProps, FormOmittedProps> {
|
|
75
|
+
textFieldProps?: TextFieldProps;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface FormNumberFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
79
|
+
defaultValue?: number | null;
|
|
80
|
+
options?: Omit<NumericFormatProps<InputAttributes>, "customInput" | "onValueChange" | keyof InputAttributes>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
declare type FormOmittedProps = "name" | "value" | "onChange" | "onBlur" | "error" | "helperText" | "renderInput" | "type" | "aria-label";
|
|
84
|
+
|
|
85
|
+
declare interface FormRadioGroupProps extends Omit<RadioGroupProps, FormOmittedProps> {
|
|
86
|
+
label?: string;
|
|
87
|
+
options: Array<Option_2>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare interface FormSliderProps extends Omit<SliderProps, FormOmittedProps> {
|
|
91
|
+
label?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare type FormSubmitButtonProps = Omit<ButtonProps, "loading" | "disabled" | "onClick" | "type">;
|
|
95
|
+
|
|
96
|
+
declare interface FormSwitchProps extends Omit<SwitchProps, FormOmittedProps> {
|
|
97
|
+
label?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare interface FormTextFieldProps extends Omit<TextFieldProps, FormOmittedProps> {
|
|
101
|
+
type?: "color" | "email" | "password" | "search" | "tel" | "text" | "url";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
declare interface FormTimePickerProps extends Omit<TimePickerProps, FormOmittedProps> {
|
|
105
|
+
textFieldProps?: TextFieldProps;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare interface FormTimeRangePickerProps extends Omit<TimeRangePickerProps, FormOmittedProps> {
|
|
109
|
+
textFieldProps?: TextFieldProps;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;
|
|
113
|
+
|
|
114
|
+
declare type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;
|
|
115
|
+
|
|
116
|
+
declare interface OpenDialog {
|
|
117
|
+
<TPayload extends undefined, TResult>(Component: DialogComponent<TPayload, TResult>, payload?: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;
|
|
118
|
+
<TPayload, TResult>(Component: DialogComponent<TPayload, TResult>, payload: TPayload, options?: OpenDialogOptions<TResult>): Promise<TResult>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare interface OpenDialogOptions<TResult> {
|
|
122
|
+
onClose?: (result: TResult) => Promise<void>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare interface Option_2 {
|
|
126
|
+
label: string;
|
|
127
|
+
value: string | number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export declare function useDialogs(): DialogHook;
|
|
131
|
+
|
|
132
|
+
export declare const useFieldContext: <TData>() => FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
133
|
+
|
|
134
|
+
export declare const useFormContext: () => ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
135
|
+
|
|
136
|
+
export { useInView }
|
|
137
|
+
|
|
138
|
+
export declare const useLayoutForm: <TFormData, TOnMount extends FormValidateOrFn<TFormData> | undefined, TOnChange extends FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
139
|
+
readonly TextField: FC<FormTextFieldProps>;
|
|
140
|
+
readonly NumberField: FC<FormNumberFieldProps>;
|
|
141
|
+
readonly Autocomplete: FC<FormAutocompleteProps>;
|
|
142
|
+
readonly Checkbox: FC<FormCheckboxProps>;
|
|
143
|
+
readonly Switch: FC<FormSwitchProps>;
|
|
144
|
+
readonly RadioGroup: FC<FormRadioGroupProps>;
|
|
145
|
+
readonly Slider: FC<FormSliderProps>;
|
|
146
|
+
readonly DatePicker: FC<FormDatePickerProps>;
|
|
147
|
+
readonly DateRangePicker: FC<FormDateRangePickerProps>;
|
|
148
|
+
readonly TimePicker: FC<FormTimePickerProps>;
|
|
149
|
+
readonly TimeRangePicker: FC<FormTimeRangePickerProps>;
|
|
150
|
+
readonly DateTimePicker: FC<FormDateTimePickerProps>;
|
|
151
|
+
readonly DateTimeRangePicker: FC<FormDateTimeRangePickerProps>;
|
|
152
|
+
}, {
|
|
153
|
+
readonly SubmitButton: FC<FormSubmitButtonProps>;
|
|
154
|
+
}>;
|
|
155
|
+
|
|
156
|
+
export declare const withLayoutForm: <TFormData, TOnMount extends FormValidateOrFn<TFormData> | undefined, TOnChange extends FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
157
|
+
readonly TextField: FC<FormTextFieldProps>;
|
|
158
|
+
readonly NumberField: FC<FormNumberFieldProps>;
|
|
159
|
+
readonly Autocomplete: FC<FormAutocompleteProps>;
|
|
160
|
+
readonly Checkbox: FC<FormCheckboxProps>;
|
|
161
|
+
readonly Switch: FC<FormSwitchProps>;
|
|
162
|
+
readonly RadioGroup: FC<FormRadioGroupProps>;
|
|
163
|
+
readonly Slider: FC<FormSliderProps>;
|
|
164
|
+
readonly DatePicker: FC<FormDatePickerProps>;
|
|
165
|
+
readonly DateRangePicker: FC<FormDateRangePickerProps>;
|
|
166
|
+
readonly TimePicker: FC<FormTimePickerProps>;
|
|
167
|
+
readonly TimeRangePicker: FC<FormTimeRangePickerProps>;
|
|
168
|
+
readonly DateTimePicker: FC<FormDateTimePickerProps>;
|
|
169
|
+
readonly DateTimeRangePicker: FC<FormDateTimeRangePickerProps>;
|
|
170
|
+
}, {
|
|
171
|
+
readonly SubmitButton: FC<FormSubmitButtonProps>;
|
|
172
|
+
}, TRenderProps>) => (props: PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
173
|
+
form: AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
174
|
+
readonly TextField: FC<FormTextFieldProps>;
|
|
175
|
+
readonly NumberField: FC<FormNumberFieldProps>;
|
|
176
|
+
readonly Autocomplete: FC<FormAutocompleteProps>;
|
|
177
|
+
readonly Checkbox: FC<FormCheckboxProps>;
|
|
178
|
+
readonly Switch: FC<FormSwitchProps>;
|
|
179
|
+
readonly RadioGroup: FC<FormRadioGroupProps>;
|
|
180
|
+
readonly Slider: FC<FormSliderProps>;
|
|
181
|
+
readonly DatePicker: FC<FormDatePickerProps>;
|
|
182
|
+
readonly DateRangePicker: FC<FormDateRangePickerProps>;
|
|
183
|
+
readonly TimePicker: FC<FormTimePickerProps>;
|
|
184
|
+
readonly TimeRangePicker: FC<FormTimeRangePickerProps>;
|
|
185
|
+
readonly DateTimePicker: FC<FormDateTimePickerProps>;
|
|
186
|
+
readonly DateTimeRangePicker: FC<FormDateTimeRangePickerProps>;
|
|
187
|
+
}, {
|
|
188
|
+
readonly SubmitButton: FC<FormSubmitButtonProps>;
|
|
189
|
+
}>;
|
|
190
|
+
}>) => ReactNode;
|
|
191
|
+
|
|
192
|
+
export { }
|