@decafhub/decaf-react-webapp 0.0.8 → 0.0.9
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 +17 -0
- package/dist/components/Error.d.ts +3 -0
- package/dist/components/Error.d.ts.map +1 -0
- package/dist/{Layout.d.ts → components/Layout.d.ts} +0 -3
- package/dist/components/Layout.d.ts.map +1 -0
- package/dist/components/Logo.d.ts +2 -0
- package/dist/components/Logo.d.ts.map +1 -0
- package/dist/components/VersionSelector.d.ts +3 -1
- package/dist/components/VersionSelector.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- 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 -1
- 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 +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/utils.d.ts +23 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/Layout.d.ts.map +0 -1
- package/dist/components/Page404.d.ts +0 -2
- package/dist/components/Page404.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.9](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.8...v0.0.9) (2022-12-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add error element to routes ([15d7cdc](https://github.com/teloscube/decaf-react-webapp/commit/15d7cdc5d0f67bf4a4bfe9ca7d6f3597a9888c2e))
|
|
9
|
+
* handle preview and release versions on version selector ([8c1dcaa](https://github.com/teloscube/decaf-react-webapp/commit/8c1dcaac8cd6b226c486932f44411ee1220424cf))
|
|
10
|
+
* implement and export useTableMaxHeight hook ([a8b2a86](https://github.com/teloscube/decaf-react-webapp/commit/a8b2a869bc54d6c58f2273502411c47469d58368))
|
|
11
|
+
* use decaf logo instead of client's logo ([b5ca0d6](https://github.com/teloscube/decaf-react-webapp/commit/b5ca0d69c1522eb64348781978f151a5414a6fd6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* active colors on menu and tabs look washed out ([c26b794](https://github.com/teloscube/decaf-react-webapp/commit/c26b794bef70db18f9c19828fadee710058c59d0))
|
|
17
|
+
* font is not loading from google ([4f56f5e](https://github.com/teloscube/decaf-react-webapp/commit/4f56f5ebc80bc4fadc43333c821240ff713441ce))
|
|
18
|
+
* header overlaps drawers ([2bc7bd5](https://github.com/teloscube/decaf-react-webapp/commit/2bc7bd53bde384953d2ec0fdc916bcdf3ead60a3))
|
|
19
|
+
|
|
3
20
|
## [0.0.8](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.7...v0.0.8) (2022-12-14)
|
|
4
21
|
|
|
5
22
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/components/Error.tsx"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,gBAEtB;AAED,wBAAgB,YAAY,gBAiB3B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ItemType } from 'antd/es/menu/hooks/useItems';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
interface BaseDecafMenuItem {
|
|
4
3
|
label: any;
|
|
@@ -13,10 +12,8 @@ export type DecafMenuItem = BaseDecafMenuItem & ({
|
|
|
13
12
|
export interface DecafLayoutProps {
|
|
14
13
|
menu: DecafMenuItem[];
|
|
15
14
|
appName: string;
|
|
16
|
-
appIcon?: React.ReactNode;
|
|
17
15
|
children: React.ReactNode;
|
|
18
16
|
}
|
|
19
|
-
export declare function routesToAntMenu(routes: DecafMenuItem[]): ItemType[];
|
|
20
17
|
export default function DecafLayout(props: DecafLayoutProps): JSX.Element;
|
|
21
18
|
export {};
|
|
22
19
|
//# sourceMappingURL=Layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/components/Layout.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,iBAAiB;IACzB,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,CAAC;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA4BD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAoD1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../src/components/Logo.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,IAAI,gBAsE3B"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
type VersionCode = 'production' | 'staging' | 'testing' | 'development' | 'preview' | 'release';
|
|
1
2
|
export type Version = {
|
|
2
|
-
code:
|
|
3
|
+
code: VersionCode;
|
|
3
4
|
name: string;
|
|
4
5
|
color: string;
|
|
5
6
|
url: string;
|
|
6
7
|
show: boolean;
|
|
7
8
|
};
|
|
8
9
|
export default function VersionSelector(): JSX.Element | null;
|
|
10
|
+
export {};
|
|
9
11
|
//# sourceMappingURL=VersionSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionSelector.d.ts","sourceRoot":"","sources":["../../src/components/VersionSelector.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"VersionSelector.d.ts","sourceRoot":"","sources":["../../src/components/VersionSelector.tsx"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAChG,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAkDF,MAAM,CAAC,OAAO,UAAU,eAAe,uBAyFtC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ import 'antd/dist/reset.css';
|
|
|
5
5
|
import { ThemeConfig } from 'antd/es/config-provider/context';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { RouteObject } from 'react-router-dom';
|
|
8
|
-
import { DecafMenuItem } from './Layout';
|
|
8
|
+
import { DecafMenuItem } from './components/Layout';
|
|
9
9
|
import { decafTheme } from './theme';
|
|
10
|
+
import { useTableMaxHeight } from './utils';
|
|
10
11
|
export type DecafRoute = RouteObject;
|
|
11
12
|
export interface DecafWebappProps {
|
|
12
13
|
config?: DecafAppConfig;
|
|
@@ -25,12 +26,11 @@ export interface DecafWebappProps {
|
|
|
25
26
|
menuItems: DecafMenuItem[];
|
|
26
27
|
appName: string;
|
|
27
28
|
appDescription?: string;
|
|
28
|
-
appIcon?: React.ReactNode;
|
|
29
29
|
/**
|
|
30
30
|
* The extra content to show on the about page.
|
|
31
31
|
*/
|
|
32
32
|
aboutPageContent?: React.ReactNode;
|
|
33
33
|
}
|
|
34
34
|
declare function DecafWebapp(props: DecafWebappProps): JSX.Element;
|
|
35
|
-
export { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };
|
|
35
|
+
export { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme, useTableMaxHeight };
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,kBAAkB,EAAyB,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAA+B,WAAW,EAAkB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,kBAAkB,EAAyB,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAA+B,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAE5F,OAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAqCD,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAqE3C;AACD,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("@ant-design/icons"),t=require("@decafhub/decaf-react"),n=require("@emotion/react"),o=require("@emotion/styled"),l=require("antd");require("antd/dist/reset.css");var r=require("react"),a=require("react-router-dom"),i=require("html2canvas");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=/*#__PURE__*/c(o),u=/*#__PURE__*/c(r),s=/*#__PURE__*/c(i);function f(){return f=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},f.apply(this,arguments)}function m(){return u.default.createElement(l.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function p(e){var n=t.useDecaf().client,o=r.useState(void 0),a=o[0],i=o[1];return r.useEffect(function(){n.barista.get("/version/").then(function(e){return i(e.data.version)})},[n]),u.default.createElement(l.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},u.default.createElement(l.Descriptions,{title:"About",column:1,bordered:!0},u.default.createElement(l.Descriptions.Item,{label:"Web Application Name"},e.appName),u.default.createElement(l.Descriptions.Item,{label:"Web Application Description"},e.appDescription),u.default.createElement(l.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),u.default.createElement(l.Descriptions.Item,{label:"DECAF Barista Version"},"v"+a)),e.content)}function b(){return u.default.createElement("div",null,u.default.createElement(l.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:u.default.createElement(e.UpOutlined,null)}),u.default.createElement(l.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:u.default.createElement(e.DownOutlined,null)}))}function g(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function h(){var t,n,o=-1===(n=(t=window.location.href.split("/")).indexOf("webapps"))?"":t[n+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),a=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+g(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+g(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+g(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+g(window.location.href),show:!0}],i=a.find(function(e){return e.code===r});return i?u.default.createElement(l.Dropdown,{placement:"top",arrow:!0,menu:{items:a.map(function(e){return{key:e.name,label:u.default.createElement("span",null,u.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},u.default.createElement(l.Button,{type:"text",size:"small"},u.default.createElement("div",{style:{display:"flex",alignItems:"center"}},u.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),u.default.createElement(e.CaretUpOutlined,null)))):null}function y(t){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(s.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 t.triggerNode?u.default.cloneElement(t.triggerNode,{onClick:n}):u.default.createElement(l.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:u.default.createElement(e.CameraOutlined,null),onClick:n})}function E(){var n=t.useDecaf(),o=n.me,a=n.publicConfig,i=r.useState(!1),c=i[0],d=i[1];return r.useEffect(function(){if(a.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?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?u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function w(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=u.default.createElement(a.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=u.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=w(e.children||[])),t.push(n)}),t}function v(n){var o=w(n.menu),r=a.useMatches().map(function(e){return e.pathname}),i=t.useDecaf().me,c=l.theme.useToken().token;return u.default.createElement(l.Layout,{style:{height:"100%"}},u.default.createElement(l.Layout.Header,{id:"decaf-header"},u.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},u.default.createElement(a.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},n.appIcon,u.default.createElement(l.Typography.Title,{level:4,style:{margin:0}},n.appName)),u.default.createElement(l.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:r}))),u.default.createElement(l.Layout.Content,{id:"decaf-content"},n.children),u.default.createElement(l.Layout.Footer,{id:"decaf-footer"},u.default.createElement(l.Row,{justify:"space-between",align:"middle"},u.default.createElement(l.Col,{span:10},u.default.createElement(E,null)),u.default.createElement(l.Col,{span:4},u.default.createElement(l.Typography.Text,{type:"secondary"},"Powered by"," ",u.default.createElement("b",null,u.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:c.colorText}},"Teloscube")))),u.default.createElement(l.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.UserOutlined,null)},i.username),u.default.createElement(h,null),u.default.createElement(y,null),u.default.createElement(b,null)))))}var k={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},C={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:f({},k,{colorBgContainer:"#2c3d50"}),Select:f({},k,{colorBgContainer:"#2c3d50"}),Dropdown:f({},k,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:f({},k,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:f({},k,{colorBgContainer:"#2c3d50"}),Checkbox:f({},k,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[l.theme.darkAlgorithm]};function B(e,t){var n=[];return t.forEach(function(t){var o,l=f({},t);t.children?(l.element=null!=(o=t.element)?o:u.default.createElement(a.Outlet,null),l.children=B(e,t.children)):l.element=u.default.createElement(v,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(l)}),n}function x(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(exports,"GlobalStyle",{enumerable:!0,get:function(){return n.Global}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return n.css}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return d.default}}),exports.DecafWebapp=function(o){var i,c,d;r.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 s=x(o.routes,[{path:"/about",element:u.default.createElement(p,{appName:o.appName,appVersion:null==(i=o.config)?void 0:i.currentVersion,appDescription:o.appDescription,content:o.aboutPageContent})},{path:"*",element:u.default.createElement(m,null)}],"path");s=B(f({},o,{menuItems:x(o.menuItems,[{label:"About",to:"/about",icon:u.default.createElement(e.InfoCircleOutlined,null)}],"to")}),s);var b=a.createBrowserRouter(s,{basename:null==(c=o.config)?void 0:c.basePath}),g=null!=(d=o.theme)?d:C,h=o.controller||t.DecafWebappController;h.disableZendeskWidget=!0;var y=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".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==(l=e.token)?void 0:l.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,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==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(g);return u.default.createElement(l.ConfigProvider,{theme:g},u.default.createElement(n.Global,{styles:y}),u.default.createElement(t.DecafApp,{config:o.config,controller:h},u.default.createElement(a.RouterProvider,{router:b})))},exports.decafTheme=C;
|
|
1
|
+
var e=require("@ant-design/icons"),t=require("@decafhub/decaf-react"),n=require("@emotion/react"),o=require("@emotion/styled"),l=require("antd");require("antd/dist/reset.css");var r=require("react"),a=require("react-router-dom"),c=require("html2canvas");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=/*#__PURE__*/i(o),u=/*#__PURE__*/i(r),s=/*#__PURE__*/i(c);function f(){return f=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},f.apply(this,arguments)}function m(){return u.default.createElement(l.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function p(){return u.default.createElement(l.Result,{status:"500",title:"Error",subTitle:u.default.createElement(u.default.Fragment,null,u.default.createElement(l.Typography,null,"Something went wrong. Please try again later. If the problem persists, please contact the administrator."),u.default.createElement(a.Link,{to:"/"},u.default.createElement(l.Button,{style:{marginTop:20}},"Back Home")))})}function g(){return u.default.createElement("div",null,u.default.createElement(l.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:u.default.createElement(e.UpOutlined,null)}),u.default.createElement(l.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:u.default.createElement(e.DownOutlined,null)}))}function b(t){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(s.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 t.triggerNode?u.default.cloneElement(t.triggerNode,{onClick:n}):u.default.createElement(l.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:u.default.createElement(e.CameraOutlined,null),onClick:n})}function h(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function E(){var t,n,o,r=-1===(n=(t=window.location.href.split("/")).indexOf("webapps"))?"":t[n+1],a=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),c=function(e){return e.startsWith("preview-")&&e.length>8}(o=a)?"preview":function(e){return e.startsWith("v")&&e.length>1}(o)?"release":o,i=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+r+"/development/"+h(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+r+"/testing/"+h(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+r+"/staging/"+h(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+r+"/production/"+h(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=i.find(function(e){return e.code===c});return d?u.default.createElement(l.Dropdown,{placement:"top",arrow:!0,menu:{items:i.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:u.default.createElement("span",null,u.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},u.default.createElement(l.Button,{type:"text",size:"small"},u.default.createElement("div",{style:{display:"flex",alignItems:"center"}},u.default.createElement("i",{className:"dot "+(null==d?void 0:d.color),style:{marginRight:5}}),"production"!==d.code&&u.default.createElement("span",{style:{marginRight:5}},"You are on ",u.default.createElement("b",null,d.name)),u.default.createElement(e.CaretUpOutlined,null)))):null}function w(){var n=t.useDecaf(),o=n.me,a=n.publicConfig,c=r.useState(!1),i=c[0],d=c[1];return r.useEffect(function(){if(a.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?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?u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.QuestionCircleOutlined,null),onClick:function(){i?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!i)}},"Support"):null}function y(){return u.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},u.default.createElement("g",null,u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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 v(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=u.default.createElement(a.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=u.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=v(e.children||[])),t.push(n)}),t}function k(n){var o=v(n.menu),r=a.useMatches().map(function(e){return e.pathname}),c=t.useDecaf().me;return u.default.createElement(l.Layout,{style:{height:"100%"}},u.default.createElement(l.Layout.Header,{id:"decaf-header"},u.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},u.default.createElement(a.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},u.default.createElement(y,null),u.default.createElement(l.Typography.Title,{level:4,style:{margin:0}},n.appName)),u.default.createElement(l.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:r}))),u.default.createElement(l.Layout.Content,{id:"decaf-content"},n.children),u.default.createElement(l.Layout.Footer,{id:"decaf-footer"},u.default.createElement(l.Row,{justify:"space-between",align:"middle"},u.default.createElement(l.Col,{span:10},u.default.createElement(w,null)),u.default.createElement(l.Col,{span:4,style:{textAlign:"center"}},u.default.createElement(l.Typography.Text,{type:"secondary"},"Powered by"," ",u.default.createElement("b",null,u.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),u.default.createElement(l.Col,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.UserOutlined,null)},c.username),u.default.createElement(E,null),u.default.createElement(b,null),u.default.createElement(g,null)))))}function C(e){var n=t.useDecaf().client,o=r.useState(void 0),a=o[0],c=o[1];return r.useEffect(function(){n.barista.get("/version/").then(function(e){return c(e.data.version)})},[n]),u.default.createElement(l.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},u.default.createElement(l.Descriptions,{title:"About",column:1,bordered:!0},u.default.createElement(l.Descriptions.Item,{label:"Web Application Name"},e.appName),u.default.createElement(l.Descriptions.Item,{label:"Web Application Description"},e.appDescription),u.default.createElement(l.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),u.default.createElement(l.Descriptions.Item,{label:"DECAF Barista Version"},"v"+a)),e.content)}var x,B={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},z={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:f({},B,{colorBgContainer:"#2c3d50"}),Select:f({},B,{colorBgContainer:"#2c3d50"}),Dropdown:f({},B,{colorBgElevated:"#10161d",controlItemBgActive:"#10161d"}),DatePicker:f({},B,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:f({},B,{colorBgContainer:"#2c3d50"}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",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:[l.theme.darkAlgorithm]};function D(e,t){var n=[];return t.forEach(function(t){var o,l=f({},t);t.children?(l.element=null!=(o=t.element)?o:u.default.createElement(a.Outlet,null),l.children=D(e,t.children),l.errorElement=t.errorElement||u.default.createElement(p,null)):l.element=u.default.createElement(k,{menu:e.menuItems,appName:e.appName},t.element),n.push(l)}),n}function I(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(exports,"GlobalStyle",{enumerable:!0,get:function(){return n.Global}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return n.css}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return d.default}}),exports.DecafWebapp=function(o){var c,i,d;r.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 s=I(o.routes,[{path:"/about",element:u.default.createElement(C,{appName:o.appName,appVersion:null==(c=o.config)?void 0:c.currentVersion,appDescription:o.appDescription,content:o.aboutPageContent})},{path:"*",element:u.default.createElement(m,null)}],"path");s=D(f({},o,{menuItems:I(o.menuItems,[{label:"About",to:"/about",icon:u.default.createElement(e.InfoCircleOutlined,null)}],"to")}),s);var p=a.createBrowserRouter(s,{basename:null==(i=o.config)?void 0:i.basePath}),g=null!=(d=o.theme)?d:z,b=o.controller||t.DecafWebappController;b.disableZendeskWidget=!0;var h,E,w=function(e){var t,n,o,l,r,a;return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Lato, sans-serif",margin:0},"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(n=e.token)?void 0:n.colorBgBase},"&::-webkit-scrollbar-thumb":{background:null==(o=e.token)?void 0:o.colorPrimary}},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(l=e.token)?void 0:l.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:"#0c1014 !important","&:hover":{background:"#10161d !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":{color:"#fff !important"},".ant-tabs-tab":{color:"rgba(255, 255, 255, 0.5) !important"},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:"#fff !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==(a=e.token)?void 0:a.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"}}}}(g);return u.default.createElement(l.ConfigProvider,{theme:g},u.default.createElement(n.Global,{styles:n.css(x||(h=["\n @import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);\n "],E||(E=h.slice(0)),h.raw=E,x=h))}),u.default.createElement(n.Global,{styles:w}),u.default.createElement(t.DecafApp,{config:o.config,controller:b},u.default.createElement(a.RouterProvider,{router:p})))},exports.decafTheme=z,exports.useTableMaxHeight=function(e){var t=r.useState(400),n=t[0],o=t[1],l=document.getElementById(e);return r.useLayoutEffect(function(){var e=function(){if(l){var e=70,t=l.parentElement;t&&(e=parseFloat(getComputedStyle(t,null).paddingBottom),e=isNaN(e)||e<10?50:e);var n=e+40,r=l.getBoundingClientRect(),a=window.innerHeight-r.top-n;o(a>350?a:"100%")}};return e(),null==l||l.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==l||l.removeEventListener("resize",e)}},[e,l]),n};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/Page404.tsx","../src/components/PageAbout.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\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 { 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 { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\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 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);\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 const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.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 <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\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 { 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, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/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 appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(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 = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\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 {props.appIcon}\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\">{props.children}</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}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\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 colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\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 Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\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 },\n\n algorithm: [theme.darkAlgorithm],\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 { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport Page404 from './components/Page404';\nimport PageAbout from './components/PageAbout';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\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 appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\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 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 routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\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 // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\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 },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\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"],"names":["Page404","React","createElement","Result","status","title","subTitle","PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","Space","direction","size","style","width","Descriptions","column","bordered","Item","label","appName","appDescription","appVersion","content","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","_extends","element","Outlet","addTo","array","concat","index","findIndex","r","defer","setAttribute","hostname","path","_props$config","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"0mBAGwBA,SAAAA,IACtB,OAAQC,UAAAC,cAAAC,EAAAA,OAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,CCKwBC,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,EAAAA,WAAXD,OACRE,EAA4CC,EAAQA,cAAqBC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAAA,UAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,WAAJA,KAAkCC,QAAQ,EACzG,EAAG,CAACZ,IAGFR,EAAAA,QAACC,cAAAoB,EAAKA,OAACC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDzB,EAAAA,QAACC,cAA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,WAAY,SAAAjG,EAAMD,YAAN,EAAAiG,EAAatD,iBACzBgE,aAAc,EACdrG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACdnL,MAAO,GACPgI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDgEuB4F,CAAU3G,GAE/B,OACEtJ,EAAAA,QAACC,cAAAiQ,EAAcA,eAAC,CAAA5G,MAAOA,GACrBtJ,EAAA,QAAAC,cAACkQ,EAAMA,OAAA,CAACC,OAAQnB,IAChBjP,EAAC,QAAAC,cAAAoQ,EAAQA,SAAC,CAAAhC,OAAQ9N,EAAM8N,OAAQS,WAAYA,GAC1C9O,EAAAA,QAACC,cAAAqQ,EAAcA,gBAAC9B,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Error.tsx","../src/components/PageScroller.tsx","../src/components/Screenshotter.tsx","../src/components/VersionSelector.tsx","../src/components/ZendeskWidget.tsx","../src/components/Logo.tsx","../src/components/Layout.tsx","../src/components/PageAbout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts","../src/utils.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 { 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 { 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 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 { 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, useMatches } from 'react-router-dom';\nimport PageScroller from './PageScroller';\nimport ScreenShotter from './Screenshotter';\nimport VersionSelector from './VersionSelector';\nimport ZendeskWidget from './ZendeskWidget';\nimport Logo from './Logo';\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 children: React.ReactNode;\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 matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\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\">{props.children}</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 <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 { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport const MAIN_BLACK = '#10161d';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: MAIN_BLACK,\n colorBorderSecondary: MAIN_BLACK,\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: 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 colorBgElevated: MAIN_BLACK,\n controlItemBgActive: MAIN_BLACK,\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","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 { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { ErrorElement, Page404 } from './components/Error';\nimport DecafLayout, { DecafMenuItem } from './components/Layout';\nimport PageAbout from './components/PageAbout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\nimport { useTableMaxHeight } from './utils';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\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 buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n item.errorElement = route.errorElement || <ErrorElement />;\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\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 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 routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\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 <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme, useTableMaxHeight };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport { MAIN_BLACK } from './theme';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: 'Lato, sans-serif',\n margin: 0,\n },\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 // antd overrides\n button: {\n boxShadow: 'none !important',\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: `#0c1014 !important`,\n '&:hover': {\n background: `${MAIN_BLACK} !important`,\n },\n },\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected': {\n color: '#fff !important',\n },\n '.ant-tabs-tab': {\n color: 'rgba(255, 255, 255, 0.5) !important',\n },\n '.ant-tabs-tab-active': {\n '.ant-tabs-tab-btn': {\n color: '#fff !important',\n },\n },\n '.ant-table-body': {\n overflow: 'auto !important',\n },\n // end antd overrides\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","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 * @returns the max height of the table.\n * @example\n * ```tsx\n * const maxHeight = useTableMaxHeight('table-container');\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): 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 = 40; // height of the footer with some padding\n let parentPaddingBottom = 70; // 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 ? 50 : parentPaddingBottom;\n }\n const bottomMargin = parentPaddingBottom + footerHeight;\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]);\n\n return maxHeight;\n}\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","ErrorElement","Fragment","Typography","Link","to","Button","style","marginTop","PageScroller","type","size","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","ScreenShotter","props","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","href","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","version","appName","location","appVersion","getAppVersionFromUrl","startsWith","length","isPreviewVersion","isReleaseVersion","versions","code","name","color","getCurrentAppPath","show","process","env","NODE_ENV","currentVersion","find","v","appVersionCode","Dropdown","placement","arrow","menu","items","filter","map","key","label","className","display","alignItems","marginRight","CaretUpOutlined","ZendeskWidget","useDecaf","me","_useDecaf","publicConfig","useState","open","_useState","setOpen","useEffect","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","Logo","xmlns","xmlnsXlink","x","y","viewBox","enableBackground","xmlSpace","width","height","fill","d","buildAntMenuFromDecafMenu","routes","result","forEach","route","item","NavLink","end","children","push","DecafLayout","useMatches","match","pathname","Layout","Header","paddingInline","justifyContent","gap","Title","level","margin","Menu","backgroundColor","border","flex","mode","menuItems","selectedKeys","matchedMenuItems","Content","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","MAIN_BLACK","_templateObject","colorBorder","colorBorderSecondary","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","BORDER_COLORS_TRANSPARENT","Select","_extends","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","colorItemText","token","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","algorithm","theme","darkAlgorithm","_route$element","element","Outlet","buildRoutes","errorElement","addTo","array","index","findIndex","r","defer","setAttribute","hostname","path","config","_props$config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","decafTheme","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","getStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","_theme$token6","background","button","overflow","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","ConfigProvider","Global","styles","css","DecafApp","RouterProvider","elementId","maxHeight","setMaxHeight","w","useLayoutEffect","closestContainer","parentElement","parentPaddingBottom","parseFloat","getComputedStyle","isNaN","bottomMargin","boundingRect","getBoundingClientRect","max","innerHeight","calculate","addEventListener","removeEventListener"],"mappings":"0mBAIgBA,SAAAA,IACd,OAAOC,UAACC,cAAAC,EAAAA,OAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,UAE4BC,IAC1B,OACEN,UAAAC,cAACC,EAAAA,OAAM,CACLC,OAAO,MACPC,MAAO,QACPC,SACEL,EAAAA,QAAAC,cAAAD,EAAA,QAAAO,SAAA,KACEP,EAAA,QAAAC,cAACO,EAAUA,WAEE,KAAA,4GAC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ChBvQ,EAAC,QAAAC,cAAA6R,EAAAA,SAAS,CAAArC,OAAQ5N,EAAM4N,OAAQW,WAAYA,GAC1CpQ,EAAC,QAAAC,cAAA8R,EAAAA,gBAAelC,OAAQA,KAIhC,0DE1HkCmC,GAChC,MAAkC7L,EAAAA,SAA0B,KAArD8L,EAAS5L,EAAA,GAAE6L,EAAY7L,EAAA,GACvB8L,EAAG3Q,SAASO,eAAeiQ,GA8BlC,OA5BAI,kBAAgB,WACd,MAAkB,WAChB,GAAKD,EAAL,CAGA,MAC0B,GACpBE,EAAmBF,EAAEG,cACvBD,IACFE,EAAsBC,WAAWC,iBAAiBJ,EAAkB,MAAMd,eAC1EgB,EAAsBG,MAAMH,IAAwBA,EAAsB,GAAK,GAAKA,GAEtF,IAAkBI,EAAGJ,EAPA,GAQfK,EAAeT,EAAEU,wBACdC,EAAG5R,OAAO6R,YAAcH,EAAaxR,IAAMuR,EACpDT,EAAaY,EAAM,IAAMA,EAAM,OAX9B,CAYH,EAMA,OAJAE,IACC,MAADb,GAAAA,EAAGc,iBAAiB,SAAUD,GAC9B9R,OAAO+R,iBAAiB,SAAUD,GAE3B,WACL9R,OAAOgS,oBAAoB,SAAUF,GACrCb,MAAAA,GAAAA,EAAGe,oBAAoB,SAAUF,EACnC,CACF,EAAG,CAAChB,EAAWG,IAGjBF,CAAA"}
|
package/dist/index.modern.mjs
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import{UpOutlined as e,DownOutlined as t,CaretUpOutlined as n,CameraOutlined as o,QuestionCircleOutlined as l,UserOutlined as r,InfoCircleOutlined as a}from"@ant-design/icons";import{useDecaf as i,DecafApp as c,DecafWebappController as d}from"@decafhub/decaf-react";import{Global as s}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Result as m,Space as p,Descriptions as u,Button as f,Dropdown as g,theme as b,Layout as h,Typography as E,Menu as w,Row as y,Col as v,ConfigProvider as k}from"antd";import"antd/dist/reset.css";import C,{useState as x,useEffect as B}from"react";import{useMatches as z,Link as I,NavLink as W,createBrowserRouter as N,RouterProvider as S,Outlet as $}from"react-router-dom";import j from"html2canvas";function T(){return T=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},T.apply(this,arguments)}function D(){return C.createElement(m,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function V(e){const{client:t}=i(),[n,o]=x(void 0);return B(()=>{t.barista.get("/version/").then(({data:e})=>o(e.version))},[t]),C.createElement(p,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(u,{title:"About",column:1,bordered:!0},C.createElement(u.Item,{label:"Web Application Name"},e.appName),C.createElement(u.Item,{label:"Web Application Description"},e.appDescription),C.createElement(u.Item,{label:"Web Application Version"},`v${e.appVersion}`),C.createElement(u.Item,{label:"DECAF Barista Version"},`v${n}`)),e.content)}function A(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:()=>window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"}),icon:C.createElement(t,null)}))}function P(e){const t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){const e=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+1]}(),t=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),o=[{code:"development",name:"Development Version",color:"red",url:`/webapps/${e}/development/${P(window.location.href)}`,show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:`/webapps/${e}/testing/${P(window.location.href)}`,show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:`/webapps/${e}/staging/${P(window.location.href)}`,show:!0},{code:"production",name:"Production Version",color:"green",url:`/webapps/${e}/production/${P(window.location.href)}`,show:!0}],l=o.find(e=>e.code===t);return l?C.createElement(g,{placement:"top",arrow:!0,menu:{items:o.map(e=>({key:e.name,label:C.createElement("span",null,C.createElement("i",{className:`dot ${e.color}`})," ",e.name),onClick:()=>{window.location.href=e.url}}))}},C.createElement(f,{type:"text",size:"small"},C.createElement("div",{style:{display:"flex",alignItems:"center"}},C.createElement("i",{className:`dot ${null==l?void 0:l.color}`,style:{marginRight:5}}),C.createElement(n,null)))):null}function F(e){async function t(){const e=document.getElementById("decaf-footer");null==e||e.style.setProperty("display","none");const t=(await j(document.body)).toDataURL("image/png");null==e||e.style.setProperty("display","block");const n=document.createElement("a");n.download="screenshot.png",n.href=t,n.click(),n.remove()}return e.triggerNode?C.cloneElement(e.triggerNode,{onClick:t}):C.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:C.createElement(o,null),onClick:t})}function L(){const{me:e,publicConfig:t}=i(),[n,o]=x(!1);return B(()=>{if(!t.zendesk||"undefined"==typeof document)return;const n=document.createElement("script");return n.src="https://static.zdassets.com/ekr/snippet.js?key="+t.zendesk,n.async=!0,n.id="ze-snippet",n.onload=()=>{window.zE("webWidget","hide"),window.zE("webWidget:on","open",()=>{window.zE("webWidget","show"),o(!0)}),window.zE("webWidget:on","close",()=>{window.zE("webWidget","hide"),o(!1)})},document.body.appendChild(n),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":e.fullname}},{id:"email",prefill:{"*":e.email}}]}},()=>{document.body.removeChild(n)}},[t,e]),t.zendesk?C.createElement(f,{size:"small",icon:C.createElement(l,null),onClick:function(){n?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),o(!n)}},"Support"):null}function R(e){const t=[];return e.forEach(e=>{const n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=C.createElement(W,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=C.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=R(e.children||[])),t.push(n)}),t}function H(e){const t=R(e.menu),n=z().map(e=>e.pathname),{me:o}=i(),{token:l}=b.useToken();return C.createElement(h,{style:{height:"100%"}},C.createElement(h.Header,{id:"decaf-header"},C.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},C.createElement(I,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,C.createElement(E.Title,{level:4,style:{margin:0}},e.appName)),C.createElement(w,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),C.createElement(h.Content,{id:"decaf-content"},e.children),C.createElement(h.Footer,{id:"decaf-footer"},C.createElement(y,{justify:"space-between",align:"middle"},C.createElement(v,{span:10},C.createElement(L,null)),C.createElement(v,{span:4},C.createElement(E.Text,{type:"secondary"},"Powered by"," ",C.createElement("b",null,C.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:l.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(r,null)},o.username),C.createElement(O,null),C.createElement(F,null),C.createElement(A,null)))))}const G={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},_={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:T({},G,{colorBgContainer:"#2c3d50"}),Select:T({},G,{colorBgContainer:"#2c3d50"}),Dropdown:T({},G,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:T({},G,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:T({},G,{colorBgContainer:"#2c3d50"}),Checkbox:T({},G,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[b.darkAlgorithm]};function K(e,t){const n=[];return t.forEach(t=>{const o=T({},t);var l;t.children?(o.element=null!=(l=t.element)?l:C.createElement($,null),o.children=K(e,t.children)):o.element=C.createElement(H,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(o)}),n}function U(e,t,n){const o=[...e];return t.forEach(e=>{const t=o.findIndex(t=>t[n]===e[n]);t>=0?o[t]=e:o.push(e)}),o}function Z(e){var t,n,o;B(()=>{const 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),()=>{document.body.removeChild(e)}},[]);let l=U(e.routes,[{path:"/about",element:C.createElement(V,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(D,null)}],"path");l=K(T({},e,{menuItems:U(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),l);const r=N(l,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:_,m=e.controller||d;m.disableZendeskWidget=!0;const p=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".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==(l=e.token)?void 0:l.colorWhite} !important`},"#decaf-header":{position:"fixed",zIndex:1030,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==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(i);return C.createElement(k,{theme:i},C.createElement(s,{styles:p}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:r})))}export{Z as DecafWebapp,_ as decafTheme};
|
|
1
|
+
import{UpOutlined as e,DownOutlined as t,CameraOutlined as n,CaretUpOutlined as o,QuestionCircleOutlined as r,UserOutlined as l,InfoCircleOutlined as c}from"@ant-design/icons";import{useDecaf as a,DecafApp as i,DecafWebappController as s}from"@decafhub/decaf-react";import{Global as d,css as m}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Result as p,Typography as u,Button as f,Dropdown as g,Layout as b,Menu as h,Row as E,Col as w,Space as y,Descriptions as v,theme as k,ConfigProvider as C}from"antd";import"antd/dist/reset.css";import x,{useState as z,useEffect as B,useLayoutEffect as I}from"react";import{Link as S,useMatches as W,NavLink as N,createBrowserRouter as D,RouterProvider as L,Outlet as $}from"react-router-dom";import j from"html2canvas";function P(){return P=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},P.apply(this,arguments)}function T(){return x.createElement(p,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function V(){return x.createElement(p,{status:"500",title:"Error",subTitle:x.createElement(x.Fragment,null,x.createElement(u,null,"Something went wrong. Please try again later. If the problem persists, please contact the administrator."),x.createElement(S,{to:"/"},x.createElement(f,{style:{marginTop:20}},"Back Home")))})}function A(){return x.createElement("div",null,x.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),icon:x.createElement(e,null)}),x.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:()=>window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"}),icon:x.createElement(t,null)}))}function F(e){async function t(){const e=document.getElementById("decaf-footer");null==e||e.style.setProperty("display","none");const t=(await j(document.body)).toDataURL("image/png");null==e||e.style.setProperty("display","block");const n=document.createElement("a");n.download="screenshot.png",n.href=t,n.click(),n.remove()}return e.triggerNode?x.cloneElement(e.triggerNode,{onClick:t}):x.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:x.createElement(n,null),onClick:t})}function M(e){const t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){const e=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+1]}(),t=function(e){return e.startsWith("preview-")&&e.length>8}(n=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}())?"preview":function(e){return e.startsWith("v")&&e.length>1}(n)?"release":n;var n;const r=[{code:"development",name:"Development Version",color:"red",url:`/webapps/${e}/development/${M(window.location.href)}`,show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:`/webapps/${e}/testing/${M(window.location.href)}`,show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:`/webapps/${e}/staging/${M(window.location.href)}`,show:!0},{code:"production",name:"Production Version",color:"green",url:`/webapps/${e}/production/${M(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}],l=r.find(e=>e.code===t);return l?x.createElement(g,{placement:"top",arrow:!0,menu:{items:r.filter(e=>e.show).map(e=>({key:e.name,label:x.createElement("span",null,x.createElement("i",{className:`dot ${e.color}`})," ",e.name),onClick:()=>{window.location.href=e.url}}))}},x.createElement(f,{type:"text",size:"small"},x.createElement("div",{style:{display:"flex",alignItems:"center"}},x.createElement("i",{className:`dot ${null==l?void 0:l.color}`,style:{marginRight:5}}),"production"!==l.code&&x.createElement("span",{style:{marginRight:5}},"You are on ",x.createElement("b",null,l.name)),x.createElement(o,null)))):null}function R(){const{me:e,publicConfig:t}=a(),[n,o]=z(!1);return B(()=>{if(!t.zendesk||"undefined"==typeof document)return;const n=document.createElement("script");return n.src="https://static.zdassets.com/ekr/snippet.js?key="+t.zendesk,n.async=!0,n.id="ze-snippet",n.onload=()=>{window.zE("webWidget","hide"),window.zE("webWidget:on","open",()=>{window.zE("webWidget","show"),o(!0)}),window.zE("webWidget:on","close",()=>{window.zE("webWidget","hide"),o(!1)})},document.body.appendChild(n),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":e.fullname}},{id:"email",prefill:{"*":e.email}}]}},()=>{document.body.removeChild(n)}},[t,e]),t.zendesk?x.createElement(f,{size:"small",icon:x.createElement(r,null),onClick:function(){n?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),o(!n)}},"Support"):null}function H(){return x.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},x.createElement("g",null,x.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"}),x.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"}),x.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"}),x.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"}),x.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"}),x.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"}),x.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 _(e){const t=[];return e.forEach(e=>{const n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=x.createElement(N,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=x.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=_(e.children||[])),t.push(n)}),t}function G(e){const t=_(e.menu),n=W().map(e=>e.pathname),{me:o}=a();return x.createElement(b,{style:{height:"100%"}},x.createElement(b.Header,{id:"decaf-header"},x.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},x.createElement(S,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},x.createElement(H,null),x.createElement(u.Title,{level:4,style:{margin:0}},e.appName)),x.createElement(h,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),x.createElement(b.Content,{id:"decaf-content"},e.children),x.createElement(b.Footer,{id:"decaf-footer"},x.createElement(E,{justify:"space-between",align:"middle"},x.createElement(w,{span:10},x.createElement(R,null)),x.createElement(w,{span:4,style:{textAlign:"center"}},x.createElement(u.Text,{type:"secondary"},"Powered by"," ",x.createElement("b",null,x.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),x.createElement(w,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},x.createElement(f,{size:"small",icon:x.createElement(l,null)},o.username),x.createElement(O,null),x.createElement(F,null),x.createElement(A,null)))))}function K(e){const{client:t}=a(),[n,o]=z(void 0);return B(()=>{t.barista.get("/version/").then(({data:e})=>o(e.version))},[t]),x.createElement(y,{direction:"vertical",size:"middle",style:{width:"100%"}},x.createElement(v,{title:"About",column:1,bordered:!0},x.createElement(v.Item,{label:"Web Application Name"},e.appName),x.createElement(v.Item,{label:"Web Application Description"},e.appDescription),x.createElement(v.Item,{label:"Web Application Version"},`v${e.appVersion}`),x.createElement(v.Item,{label:"DECAF Barista Version"},`v${n}`)),e.content)}const U={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},X={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:P({},U,{colorBgContainer:"#2c3d50"}),Select:P({},U,{colorBgContainer:"#2c3d50"}),Dropdown:P({},U,{colorBgElevated:"#10161d",controlItemBgActive:"#10161d"}),DatePicker:P({},U,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:P({},U,{colorBgContainer:"#2c3d50"}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",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:[k.darkAlgorithm]};function Y(e){const[t,n]=z(400),o=document.getElementById(e);return I(()=>{const e=()=>{if(!o)return;let e=70;const t=o.parentElement;t&&(e=parseFloat(getComputedStyle(t,null).paddingBottom),e=isNaN(e)||e<10?50:e);const r=e+40,l=o.getBoundingClientRect(),c=window.innerHeight-l.top-r;n(c>350?c:"100%")};return e(),null==o||o.addEventListener("resize",e),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),null==o||o.removeEventListener("resize",e)}},[e,o]),t}let Z,q=e=>e;function J(e,t){const n=[];return t.forEach(t=>{const o=P({},t);var r;t.children?(o.element=null!=(r=t.element)?r:x.createElement($,null),o.children=J(e,t.children),o.errorElement=t.errorElement||x.createElement(V,null)):o.element=x.createElement(G,{menu:e.menuItems,appName:e.appName},t.element),n.push(o)}),n}function Q(e,t,n){const o=[...e];return t.forEach(e=>{const t=o.findIndex(t=>t[n]===e[n]);t>=0?o[t]=e:o.push(e)}),o}function ee(e){var t,n,o;B(()=>{const 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),()=>{document.body.removeChild(e)}},[]);let r=Q(e.routes,[{path:"/about",element:x.createElement(K,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:x.createElement(T,null)}],"path");r=J(P({},e,{menuItems:Q(e.menuItems,[{label:"About",to:"/about",icon:x.createElement(c,null)}],"to")}),r);const l=D(r,{basename:null==(n=e.config)?void 0:n.basePath}),a=null!=(o=e.theme)?o:X,p=e.controller||s;p.disableZendeskWidget=!0;const u=function(e){var t,n,o,r,l,c;return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Lato, sans-serif",margin:0},"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(n=e.token)?void 0:n.colorBgBase},"&::-webkit-scrollbar-thumb":{background:null==(o=e.token)?void 0:o.colorPrimary}},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:`${null==(r=e.token)?void 0:r.colorWhite} !important`},".ant-badge-count":{color:`${null==(l=e.token)?void 0:l.colorWhite} !important`},".ant-table-thead > tr > th":{background:"#0c1014 !important","&:hover":{background:"#10161d !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":{color:"#fff !important"},".ant-tabs-tab":{color:"rgba(255, 255, 255, 0.5) !important"},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:"#fff !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==(c=e.token)?void 0:c.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"}}}}(a);return x.createElement(C,{theme:a},x.createElement(d,{styles:m(Z||(Z=q`
|
|
2
|
+
@import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);
|
|
3
|
+
`))}),x.createElement(d,{styles:u}),x.createElement(i,{config:e.config,controller:p},x.createElement(L,{router:l})))}export{ee as DecafWebapp,X as decafTheme,Y as useTableMaxHeight};
|
|
2
4
|
//# sourceMappingURL=index.modern.mjs.map
|