@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
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.js","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","useState","maxHeight","setMaxHeight","w","document","getElementById","useLayoutEffect","calculate","parentPaddingBottom","closestContainer","parentElement","parseFloat","getComputedStyle","paddingBottom","isNaN","getBoundingClientRect","max","window","innerHeight","boundingRect","top","bottomMargin","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","MAIN_BLACK","INPUT_BG_COLOR","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","colorBorderBg","decafThemeLight","hashed","algorithm","defaultAlgorithm","decafThemeDark","components","Layout","colorBgHeader","boxShadowSecondary","Input","Select","Dropdown","_extends","DatePicker","colorBgElevated","InputNumber","Menu","colorItemText","colorPrimary","colorBgLayout","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","darkAlgorithm","ThemeContext","createContext","toggleTheme","ThemeProvider","props","localStorage","getItem","value","_React$useState","setValue","themeConfig","globalStyles","baseStyles","getLightStyles","_theme$token3","_theme$token4","_theme$token5","_theme$token6","_theme$token7","_theme$token8","_theme$token9","_theme$token10","_theme$token11","_theme$token12","color","getDarkStyles","Provider","t","setItem","ConfigProvider","Global","styles","css","_templateObject","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","handleScreenshot","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","href","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","onChange","url","parts","split","indexOfWebapps","indexOf","join","VersionSelector","appName","location","appVersion","getAppVersionFromUrl","startsWith","length","isPreviewVersion","isReleaseVersion","versions","code","name","getCurrentAppPath","show","process","env","NODE_ENV","currentVersion","find","v","appVersionCode","placement","arrow","menu","items","filter","map","key","label","className","alignItems","marginRight","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","useDecaf","me","_useDecaf","publicConfig","open","_useState","setOpen","useEffect","zendesk","script","src","async","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","DecafLayout","menuItems","matches","useMatches","useLocation","matchedMenuItems","match","pathname","anttheme","useToken","_useDecafTheme","setTheme","Header","justifyContent","gap","Title","level","border","flex","mode","selectedKeys","Content","Outlet","Footer","Row","justify","align","Col","span","textAlign","Text","target","rel","UserOutlined","username","PageAbout","client","undefined","versionBarista","setVersionBarista","barista","get","then","data","Space","direction","Descriptions","column","bordered","Item","appDescription","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,GA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AOC,IAAM,qDACbpO,SAASoC,KAAKoM,YAAYL,GAEnB,WACLnO,SAASoC,KAAKgN,YAAYjB,EAC5B,CACF,EAAG,IAEH,IAAImB,EAASoE,GACXvN,EAAMmJ,OACN,CACE,CACEqE,KAAM,SACNC,QACEjV,EAACC,cAAAsT,GACC,CAAA1G,QAASrF,EAAMqF,QACfE,WAAY,OAAAvF,EAAAA,EAAM0N,aAAN,EAAAC,EAActH,eAC1ByG,eAAgB9M,EAAM8M,eACtBC,QAAS/M,EAAM4N,oBAIrB,CAAEJ,KAAM,IAAKC,QAASjV,EAAAC,cAACF,EAAO,QAEhC,QAGqBsV,EAAGN,GACxBvN,EAAM6J,UACN,CACE,CACE7C,MAAO,QACP9N,GAAI,SACJiK,KAAM3K,EAACC,cAAAqV,EAAqB,QAGhC,MAGF3E,EAAS,CACP,CACEsE,QAASjV,EAAAC,cAACmR,GAAW,CAACjD,KAAMkH,EAAmBxI,QAASrF,EAAMqF,UAC9DmI,KAAM,IACN1L,SAAUqH,EACV4E,aAAcvV,EAACC,cAAAK,EAAe,QAIlC,IAAYkV,EAAGC,EAAoB9E,EAAQ,CACzC+E,SAAU,OAAAlO,EAAAA,EAAM0N,aAAN,EAAAS,EAAcC,WAGVC,EAAGrO,EAAMqO,YAAcC,EAGvC,OAFAD,EAAWE,sBAAuB,EAGhC/V,EAAAC,cAACsH,EAAa,CAACO,YAAaN,EAAMM,YAAaxE,MAAOkE,EAAMlE,OAC1DtD,EAACC,cAAA+V,EAAS,CAAAd,OAAQ1N,EAAM0N,OAAQW,WAAYA,GAC1C7V,EAACC,cAAAgW,GAAeT,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.module.js","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","_ref","React","createElement","Fragment","Typography","message","Link","to","Button","style","marginTop","Page401","Result","icon","LockFilled","color","title","subTitle","Page403","status","Page404","PageError","useTableMaxHeight","elementId","bottomSpace","useState","maxHeight","setMaxHeight","w","document","getElementById","useLayoutEffect","calculate","parentPaddingBottom","closestContainer","parentElement","parseFloat","getComputedStyle","paddingBottom","isNaN","getBoundingClientRect","max","window","innerHeight","boundingRect","top","bottomMargin","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","_templateObject","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","_React$useState","localStorage","getItem","value","setValue","themeConfig","globalStyles","getLightStyles","_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","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","handleScreenshot","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","href","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","onChange","url","parts","split","indexOfWebapps","indexOf","join","VersionSelector","appName","location","appVersion","getAppVersionFromUrl","startsWith","length","isPreviewVersion","isReleaseVersion","versions","code","name","getCurrentAppPath","show","process","env","NODE_ENV","currentVersion","find","v","appVersionCode","placement","arrow","menu","items","filter","map","key","label","className","alignItems","marginRight","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","useDecaf","me","_useDecaf","publicConfig","open","_useState","setOpen","useEffect","zendesk","script","src","async","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","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","PageAbout","client","undefined","versionBarista","setVersionBarista","barista","get","then","data","Space","direction","Descriptions","column","bordered","maxWidth","Item","appDescription","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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A,KAIhC"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("antd"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd/dist/reset.css","react","react-router-dom","antd","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,0,e.react,e.reactRouterDom,e.antd,e.html2Canvas)}(this,function(e,t,n,o,a,r,l,c,i,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,f=/*#__PURE__*/u(a),m=/*#__PURE__*/u(l),p=/*#__PURE__*/u(d);function h(){return m.default.createElement(i.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function g(){return m.default.createElement(i.Result,{status:"500",title:"Error",subTitle:m.default.createElement(m.default.Fragment,null,m.default.createElement(i.Typography,null,"Something went wrong. Please try again later. If the problem persists, please contact the administrator."),m.default.createElement(c.Link,{to:"/"},m.default.createElement(i.Button,{style:{marginTop:20}},"Back Home")))})}function b(){return b=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},b.apply(this,arguments)}function w(e,t){var n=!1;"#"===e[0]&&(e=e.slice(1),n=!0);var o=parseInt(e,16),a=(o>>16)+t;a>255?a=255:a<0&&(a=0);var r=(o>>8&255)+t;r>255?r=255:r<0&&(r=0);var l=(255&o)+t;return l>255?l=255:l<0&&(l=0),(n?"#":"")+String("000000"+(l|r<<8|a<<16).toString(16)).slice(-6)}function E(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 v="#10161d",y="#2c3d50",k={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},C={hashed:!0,algorithm:[i.theme.defaultAlgorithm],token:{borderRadius:0}},B={hashed:!0,components:{Layout:{colorBgHeader:v},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:y},Input:b({},k,{colorBgContainer:y}),Select:b({},k,{colorBgContainer:y}),Dropdown:b({},k),DatePicker:b({},k,{colorBgContainer:y,colorBgElevated:y}),InputNumber:b({},k,{colorBgContainer:y}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:v,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.theme.darkAlgorithm]},x=m.default.createContext({theme:"dark",toggleTheme:function(){}});function z(e){var t=m.default.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),n=t[0],a=t[1],r="light"===n?C:B;r=b({},r,e.themeConfig||{}),r=b({},r,{token:b({},r.token,{fontFamily:"Lato, sans-serif"})});var l,c,d="light"===n?function(e){return b({},E(e))}(r):function(e){var t,n,o,a,r,l,c,i,d,u;return b({},E(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==(a=e.token)?void 0:a.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:w((null==(r=e.token)?void 0:r.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(l=e.token)?void 0:l.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==(u=e.token)?void 0:u.colorWhite)+" !important"}}})}(r);return m.default.createElement(x.Provider,{value:{theme:n,toggleTheme:function(){var e="dark"===n?"light":"dark";a(e),localStorage.setItem("decafAppTheme",e)}}},m.default.createElement(i.ConfigProvider,{theme:r},m.default.createElement(o.Global,{styles:o.css(s||(l=["\n @import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);\n "],c||(c=l.slice(0)),l.raw=c,s=l))}),m.default.createElement(o.Global,{styles:d}),e.children))}var D=function(){return m.default.useContext(x)};function S(){return m.default.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},m.default.createElement("g",null,m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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 T(){return m.default.createElement("div",null,m.default.createElement(i.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:m.default.createElement(t.UpOutlined,null)}),m.default.createElement(i.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:m.default.createElement(t.DownOutlined,null)}))}function I(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(p.default(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?m.default.cloneElement(e.triggerNode,{onClick:n}):m.default.createElement(i.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:m.default.createElement(t.CameraOutlined,null),onClick:n})}function L(e){return m.default.createElement(i.Button,{title:"dark"===e.theme?"switch to light theme":"switch to dark theme",type:"text",size:"small",icon:m.default.createElement(t.BulbFilled,{style:{color:"dark"===e.theme?"white":"black"}}),onClick:function(){return e.onChange()}})}function W(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function P(){var e,n,o,a=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=function(e){return e.startsWith("preview-")&&e.length>8}(o=r)?"preview":function(e){return e.startsWith("v")&&e.length>1}(o)?"release":o,c=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+a+"/development/"+W(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+a+"/testing/"+W(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+a+"/staging/"+W(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+a+"/production/"+W(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}],d=c.find(function(e){return e.code===l});return d?m.default.createElement(i.Dropdown,{placement:"top",arrow:!0,menu:{items:c.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:m.default.createElement("span",null,m.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},m.default.createElement(i.Button,{type:"text",size:"small"},m.default.createElement("div",{style:{display:"flex",alignItems:"center"}},m.default.createElement("i",{className:"dot "+(null==d?void 0:d.color),style:{marginRight:5}}),"production"!==d.code&&m.default.createElement("span",{style:{marginRight:5}},"You are on ",m.default.createElement("b",null,d.name)),m.default.createElement(t.CaretUpOutlined,null)))):null}var O="https://static.zdassets.com/ekr/snippet.js";function j(){var e=n.useDecaf(),o=e.me,a=e.publicConfig,r=l.useState(!1),c=r[0],d=r[1];return l.useEffect(function(){if(a.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=O+"?key="+a.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"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[a,o]),a.zendesk?m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function N(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=m.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=m.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=N(e.children||[])),t.push(n)}),t}function R(e){var o=N(e.menu),a=c.useMatches(),r=c.useLocation(),l=a.map(function(e){return e.pathname}).filter(function(e){return"/"===r.pathname||"/"!==e}),d=n.useDecaf().me,u=i.theme.useToken().token,s=D(),f=s.theme,p=s.toggleTheme;return m.default.createElement(i.Layout,{style:{height:"100%"}},m.default.createElement(i.Layout.Header,{id:"decaf-header",style:{background:u.colorBgContainer}},m.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},m.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},m.default.createElement(S,null),m.default.createElement(i.Typography.Title,{level:4,style:{margin:0}},e.appName)),m.default.createElement(i.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),m.default.createElement(i.Layout.Content,{id:"decaf-content"},m.default.createElement(c.Outlet,null)),m.default.createElement(i.Layout.Footer,{id:"decaf-footer"},m.default.createElement(i.Row,{justify:"space-between",align:"middle"},m.default.createElement(i.Col,{span:10},m.default.createElement(j,null)),m.default.createElement(i.Col,{span:4,style:{textAlign:"center"}},m.default.createElement(i.Typography.Text,{type:"secondary"},"Powered by"," ",m.default.createElement("b",null,m.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),m.default.createElement(i.Col,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.UserOutlined,null)},d.username),m.default.createElement(P,null),m.default.createElement(L,{theme:f,onChange:p}),m.default.createElement(I,null),m.default.createElement(T,null)))))}function A(e){var t=n.useDecaf().client,o=l.useState(void 0),a=o[0],r=o[1];return l.useEffect(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),m.default.createElement(i.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},m.default.createElement(i.Descriptions,{title:"About",column:1,bordered:!0},m.default.createElement(i.Descriptions.Item,{label:"Web Application Name"},e.appName),m.default.createElement(i.Descriptions.Item,{label:"Web Application Description"},e.appDescription),m.default.createElement(i.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),m.default.createElement(i.Descriptions.Item,{label:"DECAF Barista Version"},"v"+a)),e.content)}function V(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}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return f.default}}),e.DecafWebapp=function(e){var o,a;l.useEffect(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 r=V(e.routes,[{path:"/about",element:m.default.createElement(A,{appName:e.appName,appVersion:null==(o=e.config)?void 0:o.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:m.default.createElement(h,null)}],"path"),i=V(e.menuItems,[{label:"About",to:"/about",icon:m.default.createElement(t.InfoCircleOutlined,null)}],"to");r=[{element:m.default.createElement(R,{menu:i,appName:e.appName}),path:"/",children:r,errorElement:m.default.createElement(g,null)}];var d=c.createBrowserRouter(r,{basename:null==(a=e.config)?void 0:a.basePath}),u=e.controller||n.DecafWebappController;return u.disableZendeskWidget=!0,m.default.createElement(z,{themeConfig:e.themeConfig,theme:e.theme},m.default.createElement(n.DecafApp,{config:e.config,controller:u},m.default.createElement(c.RouterProvider,{router:d})))},e.decafThemeDark=B,e.decafThemeLight=C,e.useTableMaxHeight=function(e,t){var n=l.useState(400),o=n[0],a=n[1],r=document.getElementById(e);return l.useLayoutEffect(function(){var e=function(){if(r){var e=80,n=r.parentElement;n&&(e=parseFloat(getComputedStyle(n,null).paddingBottom),e=isNaN(e)||e<10?80:e);var o=e+50+(t||0),l=r.getBoundingClientRect(),c=window.innerHeight-l.top-o;a(c>350?c:"100%")}};return e(),null==r||r.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==r||r.removeEventListener("resize",e)}},[e,r,t]),o}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("antd"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd/dist/reset.css","react","react-router-dom","antd","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,0,e.react,e.reactRouterDom,e.antd,e.html2Canvas)}(this,function(e,t,n,o,r,a,l,c,i,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,f=/*#__PURE__*/u(r),m=/*#__PURE__*/u(l),p=/*#__PURE__*/u(d);function g(e){return m.default.createElement(m.default.Fragment,null,m.default.createElement(i.Typography,null,e.message),m.default.createElement(c.Link,{to:"/"},m.default.createElement(i.Button,{style:{marginTop:20}},"Home Page")))}function h(){return m.default.createElement(i.Result,{status:"404",title:"Page Not Found",subTitle:m.default.createElement(g,{message:"Sorry, the page you visited does not exist."})})}function b(){return m.default.createElement(i.Result,{status:"500",title:"Error",subTitle:m.default.createElement(g,{message:"Something went wrong. Please try again later. If the problem persists, please contact the administrator."})})}function E(){return E=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},E.apply(this,arguments)}function w(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 a=(o>>8&255)+t;a>255?a=255:a<0&&(a=0);var l=(255&o)+t;return l>255?l=255:l<0&&(l=0),(n?"#":"")+String("000000"+(l|a<<8|r<<16).toString(16)).slice(-6)}function v(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 y="#10161d",k="#2c3d50",C={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},B={hashed:!0,algorithm:[i.theme.defaultAlgorithm],components:{Layout:{colorBgHeader:"#ededed"}},token:{borderRadius:0,colorBgContainer:"#f8f8f8",colorBgBase:"#f8f8f8",colorBgLayout:"#f8f8f8"}},x={hashed:!0,components:{Layout:{colorBgHeader:y},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:k},Input:E({},C,{colorBgContainer:k}),Select:E({},C,{colorBgContainer:k}),Checkbox:E({},C,{colorBgContainer:k}),Dropdown:E({},C),DatePicker:E({},C,{colorBgContainer:k,colorBgElevated:k}),InputNumber:E({},C,{colorBgContainer:k}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Inter, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:y,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.theme.darkAlgorithm]},z=m.default.createContext({theme:"dark",toggleTheme:function(){}});function D(e){var t=m.default.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),n=t[0],r=t[1],a="light"===n?B:x;a=E({},a,e.themeConfig||{}),a=E({},a,{token:E({},a.token,{fontFamily:"Inter, sans-serif"})});var l,c,d="light"===n?function(e){return E({},v(e))}(a):function(e){var t,n,o,r,a,l,c,i,d,u,s,f,m,p,g,h;return E({},v(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:w((null==(a=e.token)?void 0:a.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(l=e.token)?void 0:l.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==(u=e.token)?void 0:u.colorWhite)+" !important"}},".ant-radio-button-wrapper-checked":{backgroundColor:(null==(s=e.components)||null==(f=s.Button)?void 0:f.colorBgContainer)+" !important",color:(null==(m=e.token)?void 0:m.colorWhite)+" !important"},".ant-picker-date-panel":{".ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end":{"&::before":{background:(null==(p=e.token)?void 0:p.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"}}}})}(a);return m.default.createElement(z.Provider,{value:{theme:n,toggleTheme:function(){var e="dark"===n?"light":"dark";r(e),localStorage.setItem("decafAppTheme",e)}}},m.default.createElement(i.ConfigProvider,{theme:a},m.default.createElement(o.Global,{styles:o.css(s||(l=["\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n "],c||(c=l.slice(0)),l.raw=c,s=l))}),m.default.createElement(o.Global,{styles:d}),e.children))}var I=function(){return m.default.useContext(z)};function P(){return m.default.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},m.default.createElement("g",null,m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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"}),m.default.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 T(){return m.default.createElement("div",null,m.default.createElement(i.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:m.default.createElement(t.UpOutlined,null)}),m.default.createElement(i.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:m.default.createElement(t.DownOutlined,null)}))}function S(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(p.default(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?m.default.cloneElement(e.triggerNode,{onClick:n}):m.default.createElement(i.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:m.default.createElement(t.CameraOutlined,null),onClick:n})}function L(e){return m.default.createElement(i.Button,{title:"dark"===e.theme?"switch to light theme":"switch to dark theme",type:"text",size:"small",icon:m.default.createElement(t.BulbFilled,{style:{color:"dark"===e.theme?"white":"black"}}),onClick:function(){return e.onChange()}})}function W(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){var e,n,o,r=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],a=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=function(e){return e.startsWith("preview-")&&e.length>8}(o=a)?"preview":function(e){return e.startsWith("v")&&e.length>1}(o)?"release":o,c=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+r+"/development/"+W(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+r+"/testing/"+W(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+r+"/staging/"+W(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+r+"/production/"+W(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}],d=c.find(function(e){return e.code===l});return d?m.default.createElement(i.Dropdown,{placement:"top",arrow:!0,menu:{items:c.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:m.default.createElement("span",null,m.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},m.default.createElement(i.Button,{type:"text",size:"small"},m.default.createElement("div",{style:{display:"flex",alignItems:"center"}},m.default.createElement("i",{className:"dot "+(null==d?void 0:d.color),style:{marginRight:5}}),"production"!==d.code&&m.default.createElement("span",{style:{marginRight:5}},"You are on ",m.default.createElement("b",null,d.name)),m.default.createElement(t.CaretUpOutlined,null)))):null}var j="https://static.zdassets.com/ekr/snippet.js";function N(){var e=n.useDecaf(),o=e.me,r=e.publicConfig,a=l.useState(!1),c=a[0],d=a[1];return l.useEffect(function(){if(r.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=j+"?key="+r.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"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[r,o]),r.zendesk?m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function R(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=m.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=m.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=R(e.children||[])),t.push(n)}),t}function A(e){var o=R(e.menu),r=c.useMatches(),a=c.useLocation(),l=r.map(function(e){return e.pathname}).filter(function(e){return"/"===a.pathname||"/"!==e}),d=n.useDecaf().me,u=I(),s=u.theme,f=u.toggleTheme;return m.default.createElement(i.Layout,{style:{height:"100%"}},m.default.createElement(i.Layout.Header,{id:"decaf-header"},m.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},m.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},m.default.createElement(P,null),m.default.createElement(i.Typography.Title,{level:4,style:{margin:0}},e.appName)),m.default.createElement(i.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),m.default.createElement(i.Layout.Content,{id:"decaf-content"},m.default.createElement(c.Outlet,null)),m.default.createElement(i.Layout.Footer,{id:"decaf-footer"},m.default.createElement(i.Row,{justify:"space-between",align:"middle"},m.default.createElement(i.Col,{span:10},m.default.createElement(N,null)),m.default.createElement(i.Col,{span:4,style:{textAlign:"center"}},m.default.createElement(i.Typography.Text,{type:"secondary"},"Powered by"," ",m.default.createElement("b",null,m.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),m.default.createElement(i.Col,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.UserOutlined,null)},d.username),m.default.createElement(O,null),m.default.createElement(L,{theme:s,onChange:f}),m.default.createElement(S,null),m.default.createElement(T,null)))))}function F(e){var t=n.useDecaf().client,o=l.useState(void 0),r=o[0],a=o[1];return l.useEffect(function(){t.barista.get("/version/").then(function(e){return a(e.data.version)})},[t]),m.default.createElement(i.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},m.default.createElement(i.Descriptions,{title:"About",column:1,bordered:!0,style:{maxWidth:700,width:"100%"}},m.default.createElement(i.Descriptions.Item,{label:"Application Name"},e.appName),m.default.createElement(i.Descriptions.Item,{label:"Application Description"},e.appDescription),m.default.createElement(i.Descriptions.Item,{label:"Application Version"},"v"+e.appVersion),m.default.createElement(i.Descriptions.Item,{label:"DECAF Barista Version"},"v"+r)),e.content)}function V(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}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return f.default}}),e.DecafWebapp=function(e){var o,r;l.useEffect(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 a=V(e.routes,[{path:"/about",element:m.default.createElement(F,{appName:e.appName,appVersion:null==(o=e.config)?void 0:o.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:m.default.createElement(h,null)}],"path"),i=V(e.menuItems,[{label:"About",to:"/about",icon:m.default.createElement(t.InfoCircleOutlined,null)}],"to");a=[{element:m.default.createElement(A,{menu:i,appName:e.appName}),path:"/",children:a,errorElement:m.default.createElement(b,null)}];var d=c.createBrowserRouter(a,{basename:null==(r=e.config)?void 0:r.basePath}),u=e.controller||n.DecafWebappController;return u.disableZendeskWidget=!0,m.default.createElement(D,{themeConfig:e.themeConfig,theme:e.theme},m.default.createElement(n.DecafApp,{config:e.config,controller:u},m.default.createElement(c.RouterProvider,{router:d})))},e.Page401=function(){return m.default.createElement(i.Result,{icon:m.default.createElement(t.LockFilled,{style:{color:"#ff603b"}}),title:"Authentication Error",subTitle:m.default.createElement(g,{message:"Your credentials are invalid. Please try to log in again."})})},e.Page403=function(){return m.default.createElement(i.Result,{status:"403",title:"Access Denied",subTitle:m.default.createElement(g,{message:"You are not authorized to access this content."})})},e.Page404=h,e.PageError=b,e.decafThemeDark=x,e.decafThemeLight=B,e.useTableMaxHeight=function(e,t){var n=l.useState(400),o=n[0],r=n[1],a=document.getElementById(e);return l.useLayoutEffect(function(){var e=function(){if(a){var e=80,n=a.parentElement;n&&(e=parseFloat(getComputedStyle(n,null).paddingBottom),e=isNaN(e)||e<10?80:e);var o=e+50+(t||0),l=a.getBoundingClientRect(),c=window.innerHeight-l.top-o;r(c>350?c:"100%")}};return e(),null==a||a.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==a||a.removeEventListener("resize",e)}},[e,a,t]),o}});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|