@decafhub/decaf-react-webapp 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/components/Error.d.ts +3 -1
- package/dist/components/Error.d.ts.map +1 -1
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3 -3
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.d.ts.map +1 -1
- package/dist/theme.d.ts.map +1 -1
- package/package.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.mjs","sources":["../src/components/Error.tsx","../src/utils.tsx","../src/style.ts","../src/theme.tsx","../src/components/Logo.tsx","../src/components/PageScroller.tsx","../src/components/Screenshotter.tsx","../src/components/ThemeSwitcher.tsx","../src/components/VersionSelector.tsx","../src/components/ZendeskWidget.tsx","../src/components/Layout.tsx","../src/components/PageAbout.tsx","../src/index.tsx"],"sourcesContent":["import { Button, Result, Typography } from 'antd';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nexport function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n\nexport function ErrorElement() {\n return (\n <Result\n status=\"500\"\n title={'Error'}\n subTitle={\n <>\n <Typography>\n Something went wrong. Please try again later. If the problem persists, please contact the administrator.\n </Typography>\n <Link to=\"/\">\n <Button style={{ marginTop: 20 }}>Back Home</Button>\n </Link>\n </>\n }\n />\n );\n}\n","import { useLayoutEffect, useState } from 'react';\n\n/**\n * This hook is used to calculate the max possible height of a table.\n * It is used to set the height of the table to make it scrollable\n * when the content is too large.\n * @param elementId the id of the element that contains the table.\n * @param bottomSpace extra space to be added to the bottom of the table container.\n * @returns the max height of the table.\n * @example\n * ```tsx\n * const maxHeight = useTableMaxHeight('table-container', 50);\n * return (\n * <Table\n {...tableProps}\n id={'table-container'}\n scroll={{\n x: 'max-content',\n y: maxHeight,\n }}\n />\n* );\n* ```\n**/\nexport function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number {\n const [maxHeight, setMaxHeight] = useState<string | number>(400);\n const w = document.getElementById(elementId);\n\n useLayoutEffect(() => {\n const calculate = () => {\n if (!w) {\n return;\n }\n const footerHeight = 50; // height of the footer with some padding\n let parentPaddingBottom = 80; // default padding bottom of the container element\n const closestContainer = w.parentElement; // get the closest container element\n if (closestContainer) {\n parentPaddingBottom = parseFloat(getComputedStyle(closestContainer, null).paddingBottom);\n parentPaddingBottom = isNaN(parentPaddingBottom) || parentPaddingBottom < 10 ? 80 : parentPaddingBottom;\n }\n const bottomMargin = parentPaddingBottom + footerHeight + (bottomSpace || 0);\n const boundingRect = w.getBoundingClientRect(); // get area and offset information.\n const max = window.innerHeight - boundingRect.top - bottomMargin; // this is the height of the our table content.\n setMaxHeight(max > 350 ? max : '100%');\n };\n\n calculate();\n w?.addEventListener('resize', calculate);\n window.addEventListener('resize', calculate);\n\n return () => {\n window.removeEventListener('resize', calculate);\n w?.removeEventListener('resize', calculate);\n };\n }, [elementId, w, bottomSpace]);\n\n return maxHeight;\n}\n\nexport function lightenDarkenColor(col: string, amt: number) {\n let usePound = false;\n\n if (col[0] === '#') {\n col = col.slice(1);\n usePound = true;\n }\n\n const num = parseInt(col, 16);\n\n let r = (num >> 16) + amt;\n\n if (r > 255) r = 255;\n else if (r < 0) r = 0;\n\n let b = ((num >> 8) & 0x00ff) + amt;\n\n if (b > 255) b = 255;\n else if (b < 0) b = 0;\n\n let g = (num & 0x0000ff) + amt;\n\n if (g > 255) g = 255;\n else if (g < 0) g = 0;\n\n return (usePound ? '#' : '') + String('000000' + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport { lightenDarkenColor } from './utils';\n\nfunction getBaseStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: 'Lato, sans-serif',\n margin: 0,\n },\n button: {\n boxShadow: 'none !important',\n },\n '.ant-table-body': {\n overflow: 'auto !important',\n },\n '#decaf-header': {\n position: 'fixed',\n zIndex: 999,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n zIndex: 999,\n\n button: {\n height: 34,\n },\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n backgroundColor: 'rgba(255,255,255,.25)',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n\nexport function getLightStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...(baseStyles as any),\n };\n}\n\nexport function getDarkStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...baseStyles,\n '*': {\n '&::-webkit-scrollbar': {\n width: 10,\n height: 10,\n },\n '&::-webkit-scrollbar-track': {\n background: theme.token?.colorBgBase,\n },\n '&::-webkit-scrollbar-thumb': {\n background: theme.token?.colorPrimary,\n },\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-table-thead > tr > th': {\n background: `${lightenDarkenColor(theme.token?.colorBgContainer || '', -5)} !important`,\n '&:hover': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-table-filter-dropdown': {\n 'input, .ant-table-filter-dropdown-search-input': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-dropdown-menu-item, .ant-dropdown-menu': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-tabs-tab-active': {\n '.ant-tabs-tab-btn': {\n color: `${theme.token?.colorWhite} !important`,\n },\n },\n };\n}\n","import { css, Global } from '@emotion/react';\nimport { ConfigProvider, theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React from 'react';\nimport { getDarkStyles, getLightStyles } from './style';\n\nconst MAIN_BLACK = '#10161d';\nconst INPUT_BG_COLOR = '#2c3d50';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: 'transparent',\n colorBorderSecondary: 'transparent',\n colorBorderBg: 'transparent',\n};\n\nexport const decafThemeLight: ThemeConfig = {\n hashed: true,\n algorithm: [theme.defaultAlgorithm],\n token: {\n borderRadius: 0,\n },\n};\n\nexport const decafThemeDark: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: MAIN_BLACK,\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Menu: {\n colorItemText: 'rgba(255, 255, 255, 0.5)',\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: MAIN_BLACK,\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n colorLink: '#a4bfff',\n colorLinkHover: '#7199fb',\n colorLinkActive: '#7199fb',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n\ninterface ThemeContextProps {\n theme: 'dark' | 'light';\n toggleTheme: () => void;\n}\nexport const ThemeContext = React.createContext<ThemeContextProps>({\n theme: 'dark',\n toggleTheme: () => {},\n});\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n themeConfig?: ThemeConfig;\n theme?: 'dark' | 'light';\n}\nexport function ThemeProvider(props: ThemeProviderProps) {\n const [value, setValue] = React.useState<'dark' | 'light'>(() => {\n const theme = props.theme || localStorage.getItem('decafAppTheme');\n if (theme === 'dark' || theme === 'light') {\n return theme;\n }\n return 'dark';\n });\n\n function setTheme() {\n const t = value === 'dark' ? 'light' : 'dark';\n setValue(t);\n localStorage.setItem('decafAppTheme', t);\n }\n\n let theme = value === 'light' ? decafThemeLight : decafThemeDark;\n theme = { ...theme, ...(props.themeConfig || {}) };\n theme = { ...theme, token: { ...theme.token, fontFamily: 'Lato, sans-serif' } };\n\n const globalStyles = value === 'light' ? getLightStyles(theme) : getDarkStyles(theme);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: value,\n toggleTheme: setTheme,\n }}\n >\n <ConfigProvider theme={theme}>\n <Global\n styles={css`\n @import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);\n `}\n />\n <Global styles={globalStyles} />\n\n {props.children}\n </ConfigProvider>\n </ThemeContext.Provider>\n );\n}\n\nexport const useDecafTheme = () => React.useContext(ThemeContext);\n","import React from 'react';\n\nexport default function Logo() {\n return (\n <svg\n version=\"1.1\"\n id=\"Layer_1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 649.6 767.9\"\n enableBackground={'new 0 0 649.6 767.9'}\n xmlSpace=\"preserve\"\n width={50}\n height={50}\n >\n <g>\n <path\n fill=\"#52CEF4\"\n d=\"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z\"\n />\n <path\n fill=\"#52CEF4\"\n d=\"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z\"\n />\n </g>\n </svg>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { BulbFilled } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\ninterface ThemeSwitcherProps {\n theme: 'dark' | 'light';\n onChange: () => void;\n}\nexport default function ThemeSwitcher(props: ThemeSwitcherProps) {\n return (\n <Button\n title={props.theme === 'dark' ? 'switch to light theme' : 'switch to dark theme'}\n type=\"text\"\n size=\"small\"\n icon={\n <BulbFilled\n style={{\n color: props.theme === 'dark' ? 'white' : 'black',\n }}\n />\n }\n onClick={() => props.onChange()}\n />\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\ntype VersionCode = 'production' | 'staging' | 'testing' | 'development' | 'preview' | 'release';\nexport type Version = {\n code: VersionCode;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction isPreviewVersion(version: string) {\n return version.startsWith('preview-') && version.length > 8;\n}\n\nfunction isReleaseVersion(version: string) {\n return version.startsWith('v') && version.length > 1;\n}\n\nfunction getAppVersionCode(version: string) {\n if (isPreviewVersion(version)) {\n return 'preview';\n } else if (isReleaseVersion(version)) {\n return 'release';\n } else {\n return version;\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href); // development, staging, preview-123, v1.0.0\n const appVersionCode = getAppVersionCode(appVersion); // development, staging, preview, release\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'preview',\n name: 'Preview Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n {\n code: 'release',\n name: 'Release Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n ];\n\n const currentVersion = versions.find((v) => v.code === appVersionCode);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions\n .filter((v) => v.show)\n .map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n {currentVersion.code !== 'production' && (\n <span style={{ marginRight: 5 }}>\n You are on <b>{currentVersion.name}</b>\n </span>\n )}\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme as anttheme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, Outlet, useLocation, useMatches } from 'react-router-dom';\nimport { useDecafTheme } from '../theme';\nimport Logo from './Logo';\nimport PageScroller from './PageScroller';\nimport ScreenShotter from './Screenshotter';\nimport ThemeSwitcher from './ThemeSwitcher';\nimport VersionSelector from './VersionSelector';\nimport ZendeskWidget from './ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n}\n\nfunction buildAntMenuFromDecafMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = buildAntMenuFromDecafMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = buildAntMenuFromDecafMenu(props.menu);\n const matches = useMatches();\n const location = useLocation();\n const matchedMenuItems = matches\n .map((match) => match.pathname)\n .filter((pathname) => (location.pathname !== '/' ? pathname !== '/' : true)); // WORKAROUND: the root path always matches. We don't want that.\n const { me } = useDecaf();\n const { token } = anttheme.useToken();\n const { theme, toggleTheme: setTheme } = useDecafTheme();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\" style={{ background: token.colorBgContainer }}>\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n <Logo />\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">\n <Outlet />\n </Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4} style={{ textAlign: 'center' }}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\">\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex', gap: 10 }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ThemeSwitcher theme={theme} onChange={setTheme} />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, RouteObject, RouterProvider } from 'react-router-dom';\nimport { ErrorElement, Page404 } from './components/Error';\nimport DecafLayout, { DecafMenuItem } from './components/Layout';\nimport PageAbout from './components/PageAbout';\nimport { decafThemeDark, decafThemeLight, ThemeProvider } from './theme';\nimport { useTableMaxHeight } from './utils';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n /**\n * The theme of the app.\n *\n * Defaults to `dark`.\n */\n theme?: 'dark' | 'light';\n /**\n * The theme config of the app.\n *\n * This will be merged with the default theme config (dark or light).\n *\n * See https://ant.design/docs/react/customize-theme\n */\n themeConfig?: ThemeConfig;\n /**\n * App routes.\n *\n * About page and 404 page will be added automatically.\n *\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n\n routes = [\n {\n element: <DecafLayout menu={menuWithAboutPage} appName={props.appName} />,\n path: '/',\n children: routes,\n errorElement: <ErrorElement />,\n },\n ];\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n return (\n <ThemeProvider themeConfig={props.themeConfig} theme={props.theme}>\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ThemeProvider>\n );\n}\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafThemeDark, decafThemeLight, useTableMaxHeight };\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","ErrorElement","Fragment","Typography","Link","to","Button","style","marginTop","useTableMaxHeight","elementId","bottomSpace","maxHeight","setMaxHeight","useState","w","document","getElementById","useLayoutEffect","parentPaddingBottom","closestContainer","parentElement","parseFloat","getComputedStyle","paddingBottom","isNaN","getBoundingClientRect","max","window","innerHeight","boundingRect","top","bottomMargin","calculate","addEventListener","removeEventListener","lightenDarkenColor","col","amt","usePound","slice","num","parseInt","r","b","g","String","toString","getBaseStyles","theme","_theme$token","_theme$token2","body","background","token","colorBgBase","fontFamily","margin","button","boxShadow","overflow","position","zIndex","right","left","paddingInline","paddingTop","bottom","colorBgContainer","paddingBlock","height","borderRadius","width","display","backgroundColor","INPUT_BG_COLOR","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","colorBorderBg","decafThemeLight","hashed","algorithm","defaultAlgorithm","decafThemeDark","components","Layout","colorBgHeader","MAIN_BLACK","boxShadowSecondary","Input","_extends","Select","Dropdown","DatePicker","colorBgElevated","InputNumber","Menu","colorItemText","colorPrimary","colorBgLayout","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","darkAlgorithm","ThemeContext","createContext","toggleTheme","ThemeProvider","props","value","setValue","localStorage","getItem","themeConfig","globalStyles","getLightStyles","getDarkStyles","_theme$token3","_theme$token4","color","_theme$token5","_theme$token6","_theme$token7","_theme$token8","_theme$token9","_theme$token10","_theme$token11","_theme$token12","Provider","t","setItem","ConfigProvider","Global","styles","css","_t","_","children","useDecafTheme","useContext","Logo","version","id","xmlns","xmlnsXlink","x","y","viewBox","enableBackground","xmlSpace","fill","d","PageScroller","type","size","onClick","scrollTo","behavior","icon","UpOutlined","scrollHeight","DownOutlined","ScreenShotter","async","handleScreenshot","footer","setProperty","dataUrl","toDataURL","link","download","href","click","remove","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","onChange","url","split","indexOfWebapps","parts","indexOf","join","appName","location","getAppNameFromUrl","appVersionCode","startsWith","length","isPreviewVersion","getAppVersionFromUrl","isReleaseVersion","versions","code","name","getCurrentAppPath","show","process","env","NODE_ENV","find","v","currentVersion","placement","arrow","menu","items","filter","map","key","label","className","alignItems","marginRight","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","me","publicConfig","useDecaf","open","setOpen","useEffect","zendesk","script","src","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","buildAntMenuFromDecafMenu","routes","result","forEach","route","item","NavLink","end","push","DecafLayout","menuItems","matches","useMatches","useLocation","matchedMenuItems","match","pathname","anttheme","useToken","setTheme","Header","justifyContent","gap","Title","level","border","flex","mode","selectedKeys","Content","Outlet","Footer","Row","justify","align","Col","span","textAlign","Text","target","rel","UserOutlined","username","VersionSelector","PageAbout","client","versionBarista","setVersionBarista","undefined","barista","get","then","data","Space","direction","Descriptions","column","bordered","Item","appDescription","appVersion","content","array","index","findIndex","DecafWebapp","defer","setAttribute","hostname","addTo","path","element","config","_props$config","aboutPageContent","menuWithAboutPage","InfoCircleOutlined","errorElement","router","createBrowserRouter","basename","_props$config2","basePath","controller","DecafWebappController","disableZendeskWidget","DecafApp","RouterProvider"],"mappings":"02BAIgBA,SAAAA,IACd,OAAOC,EAACC,cAAAC,EAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,UAE4BC,IAC1B,OACEN,EAAAC,cAACC,EAAM,CACLC,OAAO,MACPC,MAAO,QACPC,SACEL,EAAAC,cAAAD,EAAAO,SAAA,KACEP,EAAAC,cAACO,EAEY,KAAA,4GACbR,EAAAC,cAACQ,EAAI,CAACC,GAAG,KACPV,EAAAC,cAACU,EAAM,CAACC,MAAO,CAAEC,UAAW,KAAwB,gBAMhE,qOC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EAAMmJ,UACN,CACE,CACE1C,MAAO,QACPvN,GAAI,SACJgK,KAAM1K,EAACC,cAAA4U,EAAqB,QAGhC,MAGF3E,EAAS,CACP,CACEsE,QAASxU,EAAAC,cAACyQ,GAAW,CAAC9C,KAAMgH,EAAmBtI,QAAS9E,EAAM8E,UAC9DiI,KAAM,IACNlL,SAAU6G,EACV4E,aAAc9U,EAACC,cAAAK,EAAe,QAIlC,MAAYyU,EAAGC,EAAoB9E,EAAQ,CACzC+E,SAAU,OAAAzN,EAAAA,EAAMiN,aAAN,EAAAS,EAAcC,WAGVC,EAAG5N,EAAM4N,YAAcC,EAGvC,OAFAD,EAAWE,sBAAuB,EAGhCtV,EAAAC,cAACsH,EAAa,CAACM,YAAaL,EAAMK,YAAavE,MAAOkE,EAAMlE,OAC1DtD,EAACC,cAAAsV,EAAS,CAAAd,OAAQjN,EAAMiN,OAAQW,WAAYA,GAC1CpV,EAACC,cAAAuV,GAAeT,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.modern.mjs","sources":["../src/components/Error.tsx","../src/utils.tsx","../src/style.ts","../src/theme.tsx","../src/components/Logo.tsx","../src/components/PageScroller.tsx","../src/components/Screenshotter.tsx","../src/components/ThemeSwitcher.tsx","../src/components/VersionSelector.tsx","../src/components/ZendeskWidget.tsx","../src/components/Layout.tsx","../src/components/PageAbout.tsx","../src/index.tsx"],"sourcesContent":["import { LockFilled } from '@ant-design/icons';\nimport { Button, Result, Typography } from 'antd';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nfunction ErrorPageSubtitle({ message }: { message: string }) {\n return (\n <>\n <Typography>{message}</Typography>\n <Link to=\"/\">\n <Button style={{ marginTop: 20 }}>Home Page</Button>\n </Link>\n </>\n );\n}\n\nexport function Page401() {\n return (\n <Result\n icon={<LockFilled style={{ color: '#ff603b' }} />}\n title={'Authentication Error'}\n subTitle={<ErrorPageSubtitle message={'Your credentials are invalid. Please try to log in again.'} />}\n />\n );\n}\n\nexport function Page403() {\n return (\n <Result\n status=\"403\"\n title={'Access Denied'}\n subTitle={<ErrorPageSubtitle message={'You are not authorized to access this content.'} />}\n />\n );\n}\n\nexport function Page404() {\n return (\n <Result\n status=\"404\"\n title={'Page Not Found'}\n subTitle={<ErrorPageSubtitle message={'Sorry, the page you visited does not exist.'} />}\n />\n );\n}\n\nexport function PageError() {\n return (\n <Result\n status=\"500\"\n title={'Error'}\n subTitle={\n <ErrorPageSubtitle\n message={\n 'Something went wrong. Please try again later. If the problem persists, please contact the administrator.'\n }\n />\n }\n />\n );\n}\n","import { useLayoutEffect, useState } from 'react';\n\n/**\n * This hook is used to calculate the max possible height of a table.\n * It is used to set the height of the table to make it scrollable\n * when the content is too large.\n * @param elementId the id of the element that contains the table.\n * @param bottomSpace extra space to be added to the bottom of the table container.\n * @returns the max height of the table.\n * @example\n * ```tsx\n * const maxHeight = useTableMaxHeight('table-container', 50);\n * return (\n * <Table\n {...tableProps}\n id={'table-container'}\n scroll={{\n x: 'max-content',\n y: maxHeight,\n }}\n />\n* );\n* ```\n**/\nexport function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number {\n const [maxHeight, setMaxHeight] = useState<string | number>(400);\n const w = document.getElementById(elementId);\n\n useLayoutEffect(() => {\n const calculate = () => {\n if (!w) {\n return;\n }\n const footerHeight = 50; // height of the footer with some padding\n let parentPaddingBottom = 80; // default padding bottom of the container element\n const closestContainer = w.parentElement; // get the closest container element\n if (closestContainer) {\n parentPaddingBottom = parseFloat(getComputedStyle(closestContainer, null).paddingBottom);\n parentPaddingBottom = isNaN(parentPaddingBottom) || parentPaddingBottom < 10 ? 80 : parentPaddingBottom;\n }\n const bottomMargin = parentPaddingBottom + footerHeight + (bottomSpace || 0);\n const boundingRect = w.getBoundingClientRect(); // get area and offset information.\n const max = window.innerHeight - boundingRect.top - bottomMargin; // this is the height of the our table content.\n setMaxHeight(max > 350 ? max : '100%');\n };\n\n calculate();\n w?.addEventListener('resize', calculate);\n window.addEventListener('resize', calculate);\n\n return () => {\n window.removeEventListener('resize', calculate);\n w?.removeEventListener('resize', calculate);\n };\n }, [elementId, w, bottomSpace]);\n\n return maxHeight;\n}\n\nexport function lightenDarkenColor(col: string, amt: number) {\n let usePound = false;\n\n if (col[0] === '#') {\n col = col.slice(1);\n usePound = true;\n }\n\n const num = parseInt(col, 16);\n\n let r = (num >> 16) + amt;\n\n if (r > 255) r = 255;\n else if (r < 0) r = 0;\n\n let b = ((num >> 8) & 0x00ff) + amt;\n\n if (b > 255) b = 255;\n else if (b < 0) b = 0;\n\n let g = (num & 0x0000ff) + amt;\n\n if (g > 255) g = 255;\n else if (g < 0) g = 0;\n\n return (usePound ? '#' : '') + String('000000' + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport { lightenDarkenColor } from './utils';\n\nfunction getBaseStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: 'Inter, sans-serif',\n margin: 0,\n },\n button: {\n boxShadow: 'none !important',\n },\n '.ant-table-body': {\n overflow: 'auto !important',\n },\n '#decaf-header': {\n position: 'fixed',\n zIndex: 999,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.components?.Layout?.colorBgHeader,\n paddingBlock: 0,\n paddingInline: 0,\n zIndex: 999,\n\n button: {\n height: 34,\n },\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n backgroundColor: 'rgba(255,255,255,.25)',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n\nexport function getLightStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...(baseStyles as any),\n };\n}\n\nexport function getDarkStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...baseStyles,\n '*': {\n '&::-webkit-scrollbar': {\n width: 10,\n height: 10,\n },\n '&::-webkit-scrollbar-track': {\n background: theme.token?.colorBgContainer,\n },\n '&::-webkit-scrollbar-thumb': {\n background: theme.token?.colorPrimary,\n },\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-table-thead > tr > th': {\n background: `${lightenDarkenColor(theme.token?.colorBgContainer || '', -5)} !important`,\n '&:hover': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-table-filter-dropdown': {\n 'input, .ant-table-filter-dropdown-search-input': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-dropdown-menu-item, .ant-dropdown-menu': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-tabs-tab-active': {\n '.ant-tabs-tab-btn': {\n color: `${theme.token?.colorWhite} !important`,\n },\n },\n '.ant-radio-button-wrapper-checked': {\n backgroundColor: `${theme.components?.Button?.colorBgContainer} !important`,\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-picker-date-panel': {\n '.ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '&::before': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n },\n '.ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorPrimary} !important`,\n },\n },\n },\n };\n}\n","import { css, Global } from '@emotion/react';\nimport { ConfigProvider, theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React from 'react';\nimport { getDarkStyles, getLightStyles } from './style';\n\nconst MAIN_BLACK = '#10161d';\nconst INPUT_BG_COLOR = '#2c3d50';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: 'transparent',\n colorBorderSecondary: 'transparent',\n colorBorderBg: 'transparent',\n};\n\nexport const decafThemeLight: ThemeConfig = {\n hashed: true,\n algorithm: [theme.defaultAlgorithm],\n components: {\n Layout: {\n colorBgHeader: '#ededed',\n },\n },\n token: {\n borderRadius: 0,\n colorBgContainer: '#f8f8f8',\n colorBgBase: '#f8f8f8',\n colorBgLayout: '#f8f8f8',\n },\n};\n\nexport const decafThemeDark: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: MAIN_BLACK,\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Menu: {\n colorItemText: 'rgba(255, 255, 255, 0.5)',\n },\n },\n token: {\n fontFamily: 'Inter, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: MAIN_BLACK,\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n colorLink: '#a4bfff',\n colorLinkHover: '#7199fb',\n colorLinkActive: '#7199fb',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n\ninterface ThemeContextProps {\n theme: 'dark' | 'light';\n toggleTheme: () => void;\n}\nexport const ThemeContext = React.createContext<ThemeContextProps>({\n theme: 'dark',\n toggleTheme: () => {},\n});\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n themeConfig?: ThemeConfig;\n theme?: 'dark' | 'light';\n}\nexport function ThemeProvider(props: ThemeProviderProps) {\n const [value, setValue] = React.useState<'dark' | 'light'>(() => {\n const theme = props.theme || localStorage.getItem('decafAppTheme');\n if (theme === 'dark' || theme === 'light') {\n return theme;\n }\n return 'dark';\n });\n\n function setTheme() {\n const t = value === 'dark' ? 'light' : 'dark';\n setValue(t);\n localStorage.setItem('decafAppTheme', t);\n }\n\n let theme = value === 'light' ? decafThemeLight : decafThemeDark;\n theme = { ...theme, ...(props.themeConfig || {}) };\n theme = { ...theme, token: { ...theme.token, fontFamily: 'Inter, sans-serif' } };\n\n const globalStyles = value === 'light' ? getLightStyles(theme) : getDarkStyles(theme);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: value,\n toggleTheme: setTheme,\n }}\n >\n <ConfigProvider theme={theme}>\n <Global\n styles={css`\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n `}\n />\n <Global styles={globalStyles} />\n\n {props.children}\n </ConfigProvider>\n </ThemeContext.Provider>\n );\n}\n\nexport const useDecafTheme = () => React.useContext(ThemeContext);\n","import React from 'react';\n\nexport default function Logo() {\n return (\n <svg\n version=\"1.1\"\n id=\"Layer_1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 649.6 767.9\"\n enableBackground={'new 0 0 649.6 767.9'}\n xmlSpace=\"preserve\"\n width={50}\n height={50}\n >\n <g>\n <path\n fill=\"#52CEF4\"\n d=\"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z\"\n />\n <path\n fill=\"#52CEF4\"\n d=\"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z\"\n />\n </g>\n </svg>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { BulbFilled } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\ninterface ThemeSwitcherProps {\n theme: 'dark' | 'light';\n onChange: () => void;\n}\nexport default function ThemeSwitcher(props: ThemeSwitcherProps) {\n return (\n <Button\n title={props.theme === 'dark' ? 'switch to light theme' : 'switch to dark theme'}\n type=\"text\"\n size=\"small\"\n icon={\n <BulbFilled\n style={{\n color: props.theme === 'dark' ? 'white' : 'black',\n }}\n />\n }\n onClick={() => props.onChange()}\n />\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\ntype VersionCode = 'production' | 'staging' | 'testing' | 'development' | 'preview' | 'release';\nexport type Version = {\n code: VersionCode;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction isPreviewVersion(version: string) {\n return version.startsWith('preview-') && version.length > 8;\n}\n\nfunction isReleaseVersion(version: string) {\n return version.startsWith('v') && version.length > 1;\n}\n\nfunction getAppVersionCode(version: string) {\n if (isPreviewVersion(version)) {\n return 'preview';\n } else if (isReleaseVersion(version)) {\n return 'release';\n } else {\n return version;\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href); // development, staging, preview-123, v1.0.0\n const appVersionCode = getAppVersionCode(appVersion); // development, staging, preview, release\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'preview',\n name: 'Preview Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n {\n code: 'release',\n name: 'Release Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n ];\n\n const currentVersion = versions.find((v) => v.code === appVersionCode);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions\n .filter((v) => v.show)\n .map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n {currentVersion.code !== 'production' && (\n <span style={{ marginRight: 5 }}>\n You are on <b>{currentVersion.name}</b>\n </span>\n )}\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, Outlet, useLocation, useMatches } from 'react-router-dom';\nimport { useDecafTheme } from '../theme';\nimport Logo from './Logo';\nimport PageScroller from './PageScroller';\nimport ScreenShotter from './Screenshotter';\nimport ThemeSwitcher from './ThemeSwitcher';\nimport VersionSelector from './VersionSelector';\nimport ZendeskWidget from './ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n}\n\nfunction buildAntMenuFromDecafMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = buildAntMenuFromDecafMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = buildAntMenuFromDecafMenu(props.menu);\n const matches = useMatches();\n const location = useLocation();\n const matchedMenuItems = matches\n .map((match) => match.pathname)\n .filter((pathname) => (location.pathname !== '/' ? pathname !== '/' : true)); // WORKAROUND: the root path always matches. We don't want that.\n const { me } = useDecaf();\n const { theme, toggleTheme: setTheme } = useDecafTheme();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n <Logo />\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">\n <Outlet />\n </Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4} style={{ textAlign: 'center' }}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\">\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex', gap: 10 }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ThemeSwitcher theme={theme} onChange={setTheme} />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered style={{ maxWidth: 700, width: '100%' }}>\n <Descriptions.Item label=\"Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, RouteObject, RouterProvider } from 'react-router-dom';\nimport { Page401, Page403, Page404, PageError } from './components/Error';\nimport DecafLayout, { DecafMenuItem } from './components/Layout';\nimport PageAbout from './components/PageAbout';\nimport { decafThemeDark, decafThemeLight, ThemeProvider } from './theme';\nimport { useTableMaxHeight } from './utils';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n /**\n * The theme of the app.\n *\n * Defaults to `dark`.\n */\n theme?: 'dark' | 'light';\n /**\n * The theme config of the app.\n *\n * This will be merged with the default theme config (dark or light).\n *\n * See https://ant.design/docs/react/customize-theme\n */\n themeConfig?: ThemeConfig;\n /**\n * App routes.\n *\n * About page and 404 page will be added automatically.\n *\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n\n routes = [\n {\n element: <DecafLayout menu={menuWithAboutPage} appName={props.appName} />,\n path: '/',\n children: routes,\n errorElement: <PageError />,\n },\n ];\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n return (\n <ThemeProvider themeConfig={props.themeConfig} theme={props.theme}>\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ThemeProvider>\n );\n}\n\nexport {\n DecafWebapp,\n Global as GlobalStyle,\n css,\n styled,\n decafThemeDark,\n decafThemeLight,\n useTableMaxHeight,\n Page401,\n Page403,\n Page404,\n PageError,\n};\n"],"names":["ErrorPageSubtitle","message","React","createElement","Fragment","Typography","Link","to","Button","style","marginTop","Page401","Result","icon","LockFilled","color","title","subTitle","Page403","status","Page404","PageError","useTableMaxHeight","elementId","bottomSpace","maxHeight","setMaxHeight","useState","w","document","getElementById","useLayoutEffect","parentPaddingBottom","closestContainer","parentElement","parseFloat","getComputedStyle","paddingBottom","isNaN","getBoundingClientRect","max","window","innerHeight","boundingRect","top","bottomMargin","calculate","addEventListener","removeEventListener","lightenDarkenColor","col","amt","usePound","slice","num","parseInt","r","b","g","String","toString","getBaseStyles","theme","_theme$token","_theme$components","_theme$components$Lay","body","background","token","colorBgBase","fontFamily","margin","button","boxShadow","overflow","position","zIndex","right","left","paddingInline","paddingTop","bottom","components","Layout","colorBgHeader","paddingBlock","height","borderRadius","width","display","backgroundColor","MAIN_BLACK","INPUT_BG_COLOR","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","colorBorderBg","decafThemeLight","hashed","algorithm","defaultAlgorithm","colorBgContainer","colorBgLayout","decafThemeDark","boxShadowSecondary","Input","Select","_extends","Checkbox","Dropdown","DatePicker","colorBgElevated","InputNumber","Menu","colorItemText","colorPrimary","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","darkAlgorithm","ThemeContext","createContext","toggleTheme","ThemeProvider","props","value","setValue","localStorage","getItem","themeConfig","globalStyles","getLightStyles","baseStyles","_theme$token2","_theme$token3","_theme$token4","_theme$token5","_theme$token6","_theme$token7","_theme$token8","_theme$token9","_theme$token10","_theme$token11","_theme$components2","_theme$components2$Bu","_theme$token12","_theme$token13","_theme$token14","_theme$token15","getDarkStyles","Provider","t","setItem","ConfigProvider","Global","styles","css","_t","_","children","useDecafTheme","useContext","Logo","version","id","xmlns","xmlnsXlink","x","y","viewBox","enableBackground","xmlSpace","fill","d","PageScroller","type","size","onClick","scrollTo","behavior","UpOutlined","scrollHeight","DownOutlined","ScreenShotter","async","handleScreenshot","footer","setProperty","dataUrl","toDataURL","link","download","href","click","remove","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","onChange","url","split","indexOfWebapps","parts","indexOf","join","appName","location","getAppNameFromUrl","appVersionCode","startsWith","length","isPreviewVersion","getAppVersionFromUrl","isReleaseVersion","versions","code","name","getCurrentAppPath","show","process","env","NODE_ENV","find","v","currentVersion","placement","arrow","menu","items","filter","map","key","label","className","alignItems","marginRight","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","me","publicConfig","useDecaf","open","setOpen","useEffect","zendesk","script","src","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routes","forEach","route","item","NavLink","end","buildAntMenuFromDecafMenu","result","push","matches","useMatches","useLocation","matchedMenuItems","match","pathname","setTheme","Header","justifyContent","gap","Title","level","border","flex","mode","menuItems","selectedKeys","Content","Outlet","Footer","Row","justify","align","Col","span","textAlign","Text","target","rel","UserOutlined","username","VersionSelector","PageAbout","client","versionBarista","setVersionBarista","undefined","barista","get","then","data","Space","direction","Descriptions","column","bordered","maxWidth","Item","appDescription","appVersion","content","addTo","array","index","findIndex","DecafWebapp","defer","setAttribute","hostname","path","element","_props$config","config","aboutPageContent","menuWithAboutPage","InfoCircleOutlined","DecafLayout","errorElement","router","createBrowserRouter","basename","_props$config2","basePath","controller","DecafWebappController","disableZendeskWidget","DecafApp","RouterProvider"],"mappings":"03BAKA,SAASA,GAAkBC,QAAEA,IAC3B,OACEC,EAAAC,cAAAD,EAAAE,SAAA,KACEF,EAACC,cAAAE,EAAY,KAAAJ,GACbC,EAAAC,cAACG,EAAI,CAACC,GAAG,KACPL,EAAAC,cAACK,EAAM,CAACC,MAAO,CAAEC,UAAW,KAAI,cAIxC,CAEgBC,SAAAA,IACd,OACET,EAAAC,cAACS,EAAM,CACLC,KAAMX,EAAAC,cAACW,EAAU,CAACL,MAAO,CAAEM,MAAO,aAClCC,MAAO,uBACPC,SAAUf,EAAAC,cAACH,EAAiB,CAACC,QAAS,+DAG5C,UAEuBiB,IACrB,uBACGN,EAAM,CACLO,OAAO,MACPH,MAAO,g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AAMmF,UAC9D+H,KAAM,IACN/K,SAAU2G,EACV4E,aAAc1V,EAACC,cAAAkB,EAAY,QAI/B,MAAMwU,EAASC,EAAoB9E,EAAQ,CACzC+E,SAAU,OAAA7N,EAAAA,EAAMqN,aAAN,EAAAS,EAAcC,WAGpBC,EAAahO,EAAMgO,YAAcC,EAGvC,OAFAD,EAAWE,sBAAuB,EAGhClW,EAAAC,cAAC8H,GAAa,CAACM,YAAaL,EAAMK,YAAazE,MAAOoE,EAAMpE,OAC1D5D,EAACC,cAAAkW,EAAS,CAAAd,OAAQrN,EAAMqN,OAAQW,WAAYA,GAC1ChW,EAACC,cAAAmW,GAAeT,OAAQA,KAIhC"}
|
package/dist/index.module.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{UpOutlined as e,DownOutlined as t,CameraOutlined as n,BulbFilled as o,CaretUpOutlined as r,QuestionCircleOutlined as l,UserOutlined as a,InfoCircleOutlined as c}from"@ant-design/icons";import{useDecaf as i,DecafApp as d,DecafWebappController as m}from"@decafhub/decaf-react";import{Global as s,css as u}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import"antd/dist/reset.css";import p,{useState as f,useLayoutEffect as g,useEffect as h}from"react";import{Link as b,useMatches as w,useLocation as E,Outlet as v,NavLink as y,createBrowserRouter as k,RouterProvider as C}from"react-router-dom";import{Result as x,Typography as B,Button as z,theme as I,ConfigProvider as S,Dropdown as W,Layout as T,Menu as N,Row as L,Col as P,Space as D,Descriptions as j}from"antd";import A from"html2canvas";function V(){return p.createElement(x,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function F(){return p.createElement(x,{status:"500",title:"Error",subTitle:p.createElement(p.Fragment,null,p.createElement(B,null,"Something went wrong. Please try again later. If the problem persists, please contact the administrator."),p.createElement(b,{to:"/"},p.createElement(z,{style:{marginTop:20}},"Back Home")))})}function M(){return M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},M.apply(this,arguments)}function O(e,t){var n=f(400),o=n[0],r=n[1],l=document.getElementById(e);return g(function(){var e=function(){if(l){var e=80,n=l.parentElement;n&&(e=parseFloat(getComputedStyle(n,null).paddingBottom),e=isNaN(e)||e<10?80:e);var o=e+50+(t||0),a=l.getBoundingClientRect(),c=window.innerHeight-a.top-o;r(c>350?c:"100%")}};return e(),null==l||l.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==l||l.removeEventListener("resize",e)}},[e,l,t]),o}function R(e,t){var n=!1;"#"===e[0]&&(e=e.slice(1),n=!0);var o=parseInt(e,16),r=(o>>16)+t;r>255?r=255:r<0&&(r=0);var l=(o>>8&255)+t;l>255?l=255:l<0&&(l=0);var a=(255&o)+t;return a>255?a=255:a<0&&(a=0),(n?"#":"")+String("000000"+(a|l<<8|r<<16).toString(16)).slice(-6)}function H(e){var t,n;return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Lato, sans-serif",margin:0},button:{boxShadow:"none !important"},".ant-table-body":{overflow:"auto !important"},"#decaf-header":{position:"fixed",zIndex:999,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(n=e.token)?void 0:n.colorBgContainer,paddingBlock:0,paddingInline:0,zIndex:999,button:{height:34}},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block",backgroundColor:"rgba(255,255,255,.25)","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}var _,G="#10161d",K="#2c3d50",U={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},X={hashed:!0,algorithm:[I.defaultAlgorithm],token:{borderRadius:0}},Y={hashed:!0,components:{Layout:{colorBgHeader:G},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:K},Input:M({},U,{colorBgContainer:K}),Select:M({},U,{colorBgContainer:K}),Dropdown:M({},U),DatePicker:M({},U,{colorBgContainer:K,colorBgElevated:K}),InputNumber:M({},U,{colorBgContainer:K}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:G,colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff",colorLink:"#a4bfff",colorLinkHover:"#7199fb",colorLinkActive:"#7199fb"},algorithm:[I.darkAlgorithm]},Z=p.createContext({theme:"dark",toggleTheme:function(){}});function q(e){var t=p.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),n=t[0],o=t[1],r="light"===n?X:Y;r=M({},r,e.themeConfig||{}),r=M({},r,{token:M({},r.token,{fontFamily:"Lato, sans-serif"})});var l,a,c="light"===n?function(e){return M({},H(e))}(r):function(e){var t,n,o,r,l,a,c,i,d,m;return M({},H(e),{"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(t=e.token)?void 0:t.colorBgBase},"&::-webkit-scrollbar-thumb":{background:null==(n=e.token)?void 0:n.colorPrimary}},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:R((null==(l=e.token)?void 0:l.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(a=e.token)?void 0:a.colorBgContainer)+" !important"}},".ant-table-filter-dropdown":{"input, .ant-table-filter-dropdown-search-input":{background:(null==(c=e.token)?void 0:c.colorBgBase)+" !important"},".ant-dropdown-menu-item, .ant-dropdown-menu":{background:(null==(i=e.token)?void 0:i.colorBgContainer)+" !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":{color:(null==(d=e.token)?void 0:d.colorWhite)+" !important"},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:(null==(m=e.token)?void 0:m.colorWhite)+" !important"}}})}(r);return p.createElement(Z.Provider,{value:{theme:n,toggleTheme:function(){var e="dark"===n?"light":"dark";o(e),localStorage.setItem("decafAppTheme",e)}}},p.createElement(S,{theme:r},p.createElement(s,{styles:u(_||(l=["\n @import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);\n "],a||(a=l.slice(0)),l.raw=a,_=l))}),p.createElement(s,{styles:c}),e.children))}var J=function(){return p.useContext(Z)};function Q(){return p.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 649.6 767.9",enableBackground:"new 0 0 649.6 767.9",xmlSpace:"preserve",width:50,height:50},p.createElement("g",null,p.createElement("path",{fill:"#52CEF4",d:"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z"}),p.createElement("path",{fill:"#227EC3",d:"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z"}),p.createElement("path",{fill:"#409DD5",d:"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z"}),p.createElement("path",{fill:"#227EC3",d:"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z"}),p.createElement("path",{fill:"#227EC3",d:"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z"}),p.createElement("path",{fill:"#52CEF4",d:"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z"}),p.createElement("path",{fill:"#409DD5",d:"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z"})))}function $(){return p.createElement("div",null,p.createElement(z,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:p.createElement(e,null)}),p.createElement(z,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:p.createElement(t,null)}))}function ee(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(A(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?p.cloneElement(e.triggerNode,{onClick:t}):p.createElement(z,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:p.createElement(n,null),onClick:t})}function te(e){return p.createElement(z,{title:"dark"===e.theme?"switch to light theme":"switch to dark theme",type:"text",size:"small",icon:p.createElement(o,{style:{color:"dark"===e.theme?"white":"black"}}),onClick:function(){return e.onChange()}})}function ne(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function oe(){var e,t,n,o=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],l=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),a=function(e){return e.startsWith("preview-")&&e.length>8}(n=l)?"preview":function(e){return e.startsWith("v")&&e.length>1}(n)?"release":n,c=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+ne(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+ne(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+ne(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+ne(window.location.href),show:!0},{code:"preview",name:"Preview Version",color:"grey",url:"/",show:!1},{code:"release",name:"Release Version",color:"grey",url:"/",show:!1}],i=c.find(function(e){return e.code===a});return i?p.createElement(W,{placement:"top",arrow:!0,menu:{items:c.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:p.createElement("span",null,p.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},p.createElement(z,{type:"text",size:"small"},p.createElement("div",{style:{display:"flex",alignItems:"center"}},p.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),"production"!==i.code&&p.createElement("span",{style:{marginRight:5}},"You are on ",p.createElement("b",null,i.name)),p.createElement(r,null)))):null}var re="https://static.zdassets.com/ekr/snippet.js";function le(){var e=i(),t=e.me,n=e.publicConfig,o=f(!1),r=o[0],a=o[1];return h(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=re+"?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),a(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),a(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?p.createElement(z,{size:"small",icon:p.createElement(l,null),onClick:function(){r?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),a(!r)}},"Support"):null}function ae(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=p.createElement(y,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=p.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=ae(e.children||[])),t.push(n)}),t}function ce(e){var t=ae(e.menu),n=w(),o=E(),r=n.map(function(e){return e.pathname}).filter(function(e){return"/"===o.pathname||"/"!==e}),l=i().me,c=I.useToken().token,d=J(),m=d.theme,s=d.toggleTheme;return p.createElement(T,{style:{height:"100%"}},p.createElement(T.Header,{id:"decaf-header",style:{background:c.colorBgContainer}},p.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},p.createElement(b,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},p.createElement(Q,null),p.createElement(B.Title,{level:4,style:{margin:0}},e.appName)),p.createElement(N,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:r}))),p.createElement(T.Content,{id:"decaf-content"},p.createElement(v,null)),p.createElement(T.Footer,{id:"decaf-footer"},p.createElement(L,{justify:"space-between",align:"middle"},p.createElement(P,{span:10},p.createElement(le,null)),p.createElement(P,{span:4,style:{textAlign:"center"}},p.createElement(B.Text,{type:"secondary"},"Powered by"," ",p.createElement("b",null,p.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),p.createElement(P,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},p.createElement(z,{size:"small",icon:p.createElement(a,null)},l.username),p.createElement(oe,null),p.createElement(te,{theme:m,onChange:s}),p.createElement(ee,null),p.createElement($,null)))))}function ie(e){var t=i().client,n=f(void 0),o=n[0],r=n[1];return h(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),p.createElement(D,{direction:"vertical",size:"middle",style:{width:"100%"}},p.createElement(j,{title:"About",column:1,bordered:!0},p.createElement(j.Item,{label:"Web Application Name"},e.appName),p.createElement(j.Item,{label:"Web Application Description"},e.appDescription),p.createElement(j.Item,{label:"Web Application Version"},"v"+e.appVersion),p.createElement(j.Item,{label:"DECAF Barista Version"},"v"+o)),e.content)}function de(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}function me(e){var t,n;h(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var o=de(e.routes,[{path:"/about",element:p.createElement(ie,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:p.createElement(V,null)}],"path"),r=de(e.menuItems,[{label:"About",to:"/about",icon:p.createElement(c,null)}],"to");o=[{element:p.createElement(ce,{menu:r,appName:e.appName}),path:"/",children:o,errorElement:p.createElement(F,null)}];var l=k(o,{basename:null==(n=e.config)?void 0:n.basePath}),a=e.controller||m;return a.disableZendeskWidget=!0,p.createElement(q,{themeConfig:e.themeConfig,theme:e.theme},p.createElement(d,{config:e.config,controller:a},p.createElement(C,{router:l})))}export{me as DecafWebapp,Y as decafThemeDark,X as decafThemeLight,O as useTableMaxHeight};
|
|
1
|
+
import{LockFilled as e,UpOutlined as t,DownOutlined as n,CameraOutlined as o,BulbFilled as r,CaretUpOutlined as l,QuestionCircleOutlined as a,UserOutlined as c,InfoCircleOutlined as i}from"@ant-design/icons";import{useDecaf as d,DecafApp as m,DecafWebappController as s}from"@decafhub/decaf-react";import{Global as u,css as p}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import"antd/dist/reset.css";import f,{useState as g,useLayoutEffect as h,useEffect as b}from"react";import{Link as E,useMatches as w,useLocation as v,Outlet as y,NavLink as k,createBrowserRouter as C,RouterProvider as B}from"react-router-dom";import{Result as x,Typography as z,Button as I,theme as S,ConfigProvider as P,Dropdown as T,Layout as W,Menu as N,Row as A,Col as D,Space as L,Descriptions as j}from"antd";import V from"html2canvas";function F(e){return f.createElement(f.Fragment,null,f.createElement(z,null,e.message),f.createElement(E,{to:"/"},f.createElement(I,{style:{marginTop:20}},"Home Page")))}function H(){return f.createElement(x,{icon:f.createElement(e,{style:{color:"#ff603b"}}),title:"Authentication Error",subTitle:f.createElement(F,{message:"Your credentials are invalid. Please try to log in again."})})}function M(){return f.createElement(x,{status:"403",title:"Access Denied",subTitle:f.createElement(F,{message:"You are not authorized to access this content."})})}function O(){return f.createElement(x,{status:"404",title:"Page Not Found",subTitle:f.createElement(F,{message:"Sorry, the page you visited does not exist."})})}function R(){return f.createElement(x,{status:"500",title:"Error",subTitle:f.createElement(F,{message:"Something went wrong. Please try again later. If the problem persists, please contact the administrator."})})}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Y.apply(this,arguments)}function _(e,t){var n=g(400),o=n[0],r=n[1],l=document.getElementById(e);return h(function(){var e=function(){if(l){var e=80,n=l.parentElement;n&&(e=parseFloat(getComputedStyle(n,null).paddingBottom),e=isNaN(e)||e<10?80:e);var o=e+50+(t||0),a=l.getBoundingClientRect(),c=window.innerHeight-a.top-o;r(c>350?c:"100%")}};return e(),null==l||l.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==l||l.removeEventListener("resize",e)}},[e,l,t]),o}function G(e,t){var n=!1;"#"===e[0]&&(e=e.slice(1),n=!0);var o=parseInt(e,16),r=(o>>16)+t;r>255?r=255:r<0&&(r=0);var l=(o>>8&255)+t;l>255?l=255:l<0&&(l=0);var a=(255&o)+t;return a>255?a=255:a<0&&(a=0),(n?"#":"")+String("000000"+(a|l<<8|r<<16).toString(16)).slice(-6)}function K(e){var t,n,o;return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Inter, sans-serif",margin:0},button:{boxShadow:"none !important"},".ant-table-body":{overflow:"auto !important"},"#decaf-header":{position:"fixed",zIndex:999,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(n=e.components)||null==(o=n.Layout)?void 0:o.colorBgHeader,paddingBlock:0,paddingInline:0,zIndex:999,button:{height:34}},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block",backgroundColor:"rgba(255,255,255,.25)","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}var U,X="#10161d",Z="#2c3d50",q={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},J={hashed:!0,algorithm:[S.defaultAlgorithm],components:{Layout:{colorBgHeader:"#ededed"}},token:{borderRadius:0,colorBgContainer:"#f8f8f8",colorBgBase:"#f8f8f8",colorBgLayout:"#f8f8f8"}},Q={hashed:!0,components:{Layout:{colorBgHeader:X},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:Z},Input:Y({},q,{colorBgContainer:Z}),Select:Y({},q,{colorBgContainer:Z}),Checkbox:Y({},q,{colorBgContainer:Z}),Dropdown:Y({},q),DatePicker:Y({},q,{colorBgContainer:Z,colorBgElevated:Z}),InputNumber:Y({},q,{colorBgContainer:Z}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Inter, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:X,colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff",colorLink:"#a4bfff",colorLinkHover:"#7199fb",colorLinkActive:"#7199fb"},algorithm:[S.darkAlgorithm]},$=f.createContext({theme:"dark",toggleTheme:function(){}});function ee(e){var t=f.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),n=t[0],o=t[1],r="light"===n?J:Q;r=Y({},r,e.themeConfig||{}),r=Y({},r,{token:Y({},r.token,{fontFamily:"Inter, sans-serif"})});var l,a,c="light"===n?function(e){return Y({},K(e))}(r):function(e){var t,n,o,r,l,a,c,i,d,m,s,u,p,f,g,h;return Y({},K(e),{"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(t=e.token)?void 0:t.colorBgContainer},"&::-webkit-scrollbar-thumb":{background:null==(n=e.token)?void 0:n.colorPrimary}},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:G((null==(l=e.token)?void 0:l.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(a=e.token)?void 0:a.colorBgContainer)+" !important"}},".ant-table-filter-dropdown":{"input, .ant-table-filter-dropdown-search-input":{background:(null==(c=e.token)?void 0:c.colorBgBase)+" !important"},".ant-dropdown-menu-item, .ant-dropdown-menu":{background:(null==(i=e.token)?void 0:i.colorBgContainer)+" !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":{color:(null==(d=e.token)?void 0:d.colorWhite)+" !important"},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:(null==(m=e.token)?void 0:m.colorWhite)+" !important"}},".ant-radio-button-wrapper-checked":{backgroundColor:(null==(s=e.components)||null==(u=s.Button)?void 0:u.colorBgContainer)+" !important",color:(null==(p=e.token)?void 0:p.colorWhite)+" !important"},".ant-picker-date-panel":{".ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end":{"&::before":{background:(null==(f=e.token)?void 0:f.colorBgBase)+" !important"},".ant-picker-cell-inner":{background:(null==(g=e.token)?void 0:g.colorBgBase)+" !important"}},".ant-picker-cell-range-start, .ant-picker-cell-range-end":{".ant-picker-cell-inner":{background:(null==(h=e.token)?void 0:h.colorPrimary)+" !important"}}}})}(r);return f.createElement($.Provider,{value:{theme:n,toggleTheme:function(){var e="dark"===n?"light":"dark";o(e),localStorage.setItem("decafAppTheme",e)}}},f.createElement(P,{theme:r},f.createElement(u,{styles:p(U||(l=["\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n "],a||(a=l.slice(0)),l.raw=a,U=l))}),f.createElement(u,{styles:c}),e.children))}var te=function(){return f.useContext($)};function ne(){return f.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 649.6 767.9",enableBackground:"new 0 0 649.6 767.9",xmlSpace:"preserve",width:50,height:50},f.createElement("g",null,f.createElement("path",{fill:"#52CEF4",d:"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z"}),f.createElement("path",{fill:"#227EC3",d:"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z"}),f.createElement("path",{fill:"#409DD5",d:"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z"}),f.createElement("path",{fill:"#227EC3",d:"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z"}),f.createElement("path",{fill:"#227EC3",d:"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z"}),f.createElement("path",{fill:"#52CEF4",d:"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z"}),f.createElement("path",{fill:"#409DD5",d:"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z"})))}function oe(){return f.createElement("div",null,f.createElement(I,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:f.createElement(t,null)}),f.createElement(I,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:f.createElement(n,null)}))}function re(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(V(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?f.cloneElement(e.triggerNode,{onClick:t}):f.createElement(I,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:f.createElement(o,null),onClick:t})}function le(e){return f.createElement(I,{title:"dark"===e.theme?"switch to light theme":"switch to dark theme",type:"text",size:"small",icon:f.createElement(r,{style:{color:"dark"===e.theme?"white":"black"}}),onClick:function(){return e.onChange()}})}function ae(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function ce(){var e,t,n,o=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),a=function(e){return e.startsWith("preview-")&&e.length>8}(n=r)?"preview":function(e){return e.startsWith("v")&&e.length>1}(n)?"release":n,c=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+ae(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+ae(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+ae(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+ae(window.location.href),show:!0},{code:"preview",name:"Preview Version",color:"grey",url:"/",show:!1},{code:"release",name:"Release Version",color:"grey",url:"/",show:!1}],i=c.find(function(e){return e.code===a});return i?f.createElement(T,{placement:"top",arrow:!0,menu:{items:c.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:f.createElement("span",null,f.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},f.createElement(I,{type:"text",size:"small"},f.createElement("div",{style:{display:"flex",alignItems:"center"}},f.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),"production"!==i.code&&f.createElement("span",{style:{marginRight:5}},"You are on ",f.createElement("b",null,i.name)),f.createElement(l,null)))):null}var ie="https://static.zdassets.com/ekr/snippet.js";function de(){var e=d(),t=e.me,n=e.publicConfig,o=g(!1),r=o[0],l=o[1];return b(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=ie+"?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),l(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),l(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?f.createElement(I,{size:"small",icon:f.createElement(a,null),onClick:function(){r?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),l(!r)}},"Support"):null}function me(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=f.createElement(k,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=f.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=me(e.children||[])),t.push(n)}),t}function se(e){var t=me(e.menu),n=w(),o=v(),r=n.map(function(e){return e.pathname}).filter(function(e){return"/"===o.pathname||"/"!==e}),l=d().me,a=te(),i=a.theme,m=a.toggleTheme;return f.createElement(W,{style:{height:"100%"}},f.createElement(W.Header,{id:"decaf-header"},f.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},f.createElement(E,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},f.createElement(ne,null),f.createElement(z.Title,{level:4,style:{margin:0}},e.appName)),f.createElement(N,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:r}))),f.createElement(W.Content,{id:"decaf-content"},f.createElement(y,null)),f.createElement(W.Footer,{id:"decaf-footer"},f.createElement(A,{justify:"space-between",align:"middle"},f.createElement(D,{span:10},f.createElement(de,null)),f.createElement(D,{span:4,style:{textAlign:"center"}},f.createElement(z.Text,{type:"secondary"},"Powered by"," ",f.createElement("b",null,f.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),f.createElement(D,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},f.createElement(I,{size:"small",icon:f.createElement(c,null)},l.username),f.createElement(ce,null),f.createElement(le,{theme:i,onChange:m}),f.createElement(re,null),f.createElement(oe,null)))))}function ue(e){var t=d().client,n=g(void 0),o=n[0],r=n[1];return b(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),f.createElement(L,{direction:"vertical",size:"middle",style:{width:"100%"}},f.createElement(j,{title:"About",column:1,bordered:!0,style:{maxWidth:700,width:"100%"}},f.createElement(j.Item,{label:"Application Name"},e.appName),f.createElement(j.Item,{label:"Application Description"},e.appDescription),f.createElement(j.Item,{label:"Application Version"},"v"+e.appVersion),f.createElement(j.Item,{label:"DECAF Barista Version"},"v"+o)),e.content)}function pe(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}function fe(e){var t,n;b(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var o=pe(e.routes,[{path:"/about",element:f.createElement(ue,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:f.createElement(O,null)}],"path"),r=pe(e.menuItems,[{label:"About",to:"/about",icon:f.createElement(i,null)}],"to");o=[{element:f.createElement(se,{menu:r,appName:e.appName}),path:"/",children:o,errorElement:f.createElement(R,null)}];var l=C(o,{basename:null==(n=e.config)?void 0:n.basePath}),a=e.controller||s;return a.disableZendeskWidget=!0,f.createElement(ee,{themeConfig:e.themeConfig,theme:e.theme},f.createElement(m,{config:e.config,controller:a},f.createElement(B,{router:l})))}export{fe as DecafWebapp,H as Page401,M as Page403,O as Page404,R as PageError,Q as decafThemeDark,J as decafThemeLight,_ as useTableMaxHeight};
|
|
2
2
|
//# sourceMappingURL=index.module.js.map
|