@decafhub/decaf-react-webapp 0.0.5 → 0.0.7
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 +19 -0
- package/dist/Layout.d.ts.map +1 -1
- package/dist/components/Page404.d.ts +2 -0
- package/dist/components/Page404.d.ts.map +1 -0
- package/dist/components/PageAbout.d.ts +9 -0
- package/dist/components/PageAbout.d.ts.map +1 -0
- package/dist/components/PageScroller.d.ts +2 -0
- package/dist/components/PageScroller.d.ts.map +1 -0
- package/dist/components/Screenshotter.d.ts +6 -0
- package/dist/components/Screenshotter.d.ts.map +1 -0
- package/dist/components/VersionSelector.d.ts +9 -0
- package/dist/components/VersionSelector.d.ts.map +1 -0
- package/dist/components/ZendeskWidget.d.ts +8 -0
- package/dist/components/ZendeskWidget.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- 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 +1 -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 +4 -0
- package/dist/style.d.ts.map +1 -0
- package/dist/theme.d.ts.map +1 -1
- package/package.json +16 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.7](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.6...v0.0.7) (2022-12-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add screenshot and version selector components to the footer ([28e6f25](https://github.com/teloscube/decaf-react-webapp/commit/28e6f254348c72bebd951911a2828bab55b67e37))
|
|
9
|
+
* add zendesk widget to the footer ([f7055ac](https://github.com/teloscube/decaf-react-webapp/commit/f7055ac583801953a9bbb133d92bbcf8768a812d))
|
|
10
|
+
* init new footer design based on cafelatte ([b0df8e9](https://github.com/teloscube/decaf-react-webapp/commit/b0df8e95c439c5f5ee3d90863b0f45a9b9ebc4d1))
|
|
11
|
+
|
|
12
|
+
## [0.0.6](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.5...v0.0.6) (2022-12-01)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add 404 page ([d1f4cd1](https://github.com/teloscube/decaf-react-webapp/commit/d1f4cd1c9773cae742c3662eeaddacc1fa20e491))
|
|
18
|
+
* add about page initially ([ff72e02](https://github.com/teloscube/decaf-react-webapp/commit/ff72e024fa80cb882f0b81e0385a83c721a224d1))
|
|
19
|
+
* better coloring for inputs ([7f4b646](https://github.com/teloscube/decaf-react-webapp/commit/7f4b646747a467c2cc9fca3039e881c7ab880efe))
|
|
20
|
+
* get app description as prop ([3c1ec4d](https://github.com/teloscube/decaf-react-webapp/commit/3c1ec4ddaa8082a4a049b5464ea2877cc6d7dbd4))
|
|
21
|
+
|
|
3
22
|
## [0.0.5](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.4...v0.0.5) (2022-11-30)
|
|
4
23
|
|
|
5
24
|
|
package/dist/Layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,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,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,EAAE,CAwBnE;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAqD1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Page404.d.ts","sourceRoot":"","sources":["../../src/components/Page404.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,OAAO,gBAE9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AboutPageProps {
|
|
3
|
+
appName?: string;
|
|
4
|
+
appVersion?: string;
|
|
5
|
+
appDescription?: string;
|
|
6
|
+
content?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export default function PageAbout(props: AboutPageProps): JSX.Element;
|
|
9
|
+
//# sourceMappingURL=PageAbout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageAbout.d.ts","sourceRoot":"","sources":["../../src/components/PageAbout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AACD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,EAAE,cAAc,eAmBtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageScroller.d.ts","sourceRoot":"","sources":["../../src/components/PageScroller.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,YAAY,gBAmBnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Screenshotter.d.ts","sourceRoot":"","sources":["../../src/components/Screenshotter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AACD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAkC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VersionSelector.d.ts","sourceRoot":"","sources":["../../src/components/VersionSelector.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAgCF,MAAM,CAAC,OAAO,UAAU,eAAe,uBAkEtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZendeskWidget.d.ts","sourceRoot":"","sources":["../../src/components/ZendeskWidget.tsx"],"names":[],"mappings":"AAOA,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,MAAM;QACd,EAAE,EAAE,GAAG,CAAC;QACR,UAAU,EAAE,GAAG,CAAC;KACjB;CACF;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,uBAkEpC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,10 +12,24 @@ export interface DecafWebappProps {
|
|
|
12
12
|
config?: DecafAppConfig;
|
|
13
13
|
controller?: DecafAppController;
|
|
14
14
|
theme?: ThemeConfig;
|
|
15
|
+
/**
|
|
16
|
+
* App routes.<br />
|
|
17
|
+
* About page and 404 page will be added automatically.<br />
|
|
18
|
+
* See https://reactrouter.com/en/main/routers/create-browser-router#routes
|
|
19
|
+
*/
|
|
15
20
|
routes: DecafRoute[];
|
|
21
|
+
/**
|
|
22
|
+
* App menu.<br />
|
|
23
|
+
* About page will be added automatically.
|
|
24
|
+
*/
|
|
16
25
|
menuItems: DecafMenuItem[];
|
|
17
26
|
appName: string;
|
|
27
|
+
appDescription?: string;
|
|
18
28
|
appIcon?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* The extra content to show on the about page.
|
|
31
|
+
*/
|
|
32
|
+
aboutPageContent?: React.ReactNode;
|
|
19
33
|
}
|
|
20
34
|
declare function DecafWebapp(props: DecafWebappProps): JSX.Element;
|
|
21
35
|
export { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
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;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA+B,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAG5F,OAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,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,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAoCD,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAmD3C;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("@decafhub/decaf-react"),t=require("@emotion/react"),r=require("@emotion/styled"),n=require("antd");require("antd/dist/reset.css");var a=require("react"),o=require("react-router-dom");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=/*#__PURE__*/l(r),i=/*#__PURE__*/l(a);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}function u(e){var t=[];return e.forEach(function(e){var r={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?r.label=i.default.createElement(o.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?r.label=i.default.createElement("a",{href:e.href},e.label):e.children&&(r.label=e.label,r.children=u(e.children||[])),t.push(r)}),t}function f(e){var t=u(e.menu),r=o.useMatches().map(function(e){return e.pathname});return i.default.createElement(n.Layout,{style:{height:"100%"}},i.default.createElement(n.Layout.Header,{style:{paddingInline:0}},i.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},i.default.createElement(o.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,i.default.createElement(n.Typography.Title,{level:4,style:{margin:0}},e.appName)),i.default.createElement(n.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:r}))),i.default.createElement(n.Layout.Content,{style:{padding:"20px 50px"}},e.children))}var s={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},m={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none"},Input:d({},s),Select:d({},s),Dropdown:d({},s)},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",colorWhite:"#fff"},algorithm:[n.theme.darkAlgorithm]};function p(e,t){var r=[];return t.forEach(function(t){var n,a=d({},t);t.children?(a.element=null!=(n=t.element)?n:i.default.createElement(o.Outlet,null),a.children=p(e,t.children)):a.element=i.default.createElement(f,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),r.push(a)}),r}Object.defineProperty(exports,"GlobalStyle",{enumerable:!0,get:function(){return t.Global}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return t.css}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return c.default}}),exports.DecafWebapp=function(r){var a,l,c,d,u,f,s=p(r,r.routes),h=o.createBrowserRouter(s,{basename:null==(a=r.config)?void 0:a.basePath}),y=null!=(l=r.theme)?l:m;return i.default.createElement(n.ConfigProvider,{theme:y},i.default.createElement(t.Global,{styles:{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(c=y.token)?void 0:c.colorBgBase,fontFamily:null==(d=y.token)?void 0:d.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(u=y.token)?void 0:u.colorWhite)+" !important"},".ant-badge-count":{color:(null==(f=y.token)?void 0:f.colorWhite)+" !important"}}}),i.default.createElement(e.DecafApp,{config:r.config,controller:r.controller},i.default.createElement(o.RouterProvider,{router:h})))},exports.decafTheme=m;
|
|
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(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 p(){return u.default.createElement(l.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}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(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/"+b(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+b(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+b(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+b(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(g,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 r,i,c,d=x(o.routes,[{path:"/about",element:u.default.createElement(m,{appName:o.appName,appVersion:null==(r=o.config)?void 0:r.currentVersion,appDescription:o.appDescription,content:o.aboutPageContent})},{path:"*",element:u.default.createElement(p,null)}],"path");d=B(f({},o,{menuItems:x(o.menuItems,[{label:"About",to:"/about",icon:u.default.createElement(e.InfoCircleOutlined,null)}],"to")}),d);var s=a.createBrowserRouter(d,{basename:null==(i=o.config)?void 0:i.basePath}),g=null!=(c=o.theme)?c:C,b=o.controller||t.DecafWebappController;b.disableZendeskWidget=!0;var h=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:h}),u.default.createElement(t.DecafApp,{config:o.config,controller:b},u.default.createElement(a.RouterProvider,{router:s})))},exports.decafTheme=C;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/Layout.tsx","../src/theme.ts","../src/index.tsx"],"sourcesContent":["import { Layout, Menu, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\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\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\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header style={{ paddingInline: 0 }}>\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 style={{ padding: '20px 50px' }}>{props.children}</Layout.Content>\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\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\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 colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { DecafApp, DecafAppConfig, DecafAppController } 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 from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n routes: DecafRoute[];\n menuItems: DecafMenuItem[];\n appName: string;\n appIcon?: 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 DecafWebapp(props: DecafWebappProps) {\n const routes = buildRoutes(props, props.routes);\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n return (\n <ConfigProvider theme={theme}>\n <Global\n styles={{\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 }}\n />\n <DecafApp config={props.config} controller={props.controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n"],"names":["routes","forEach","route","key","to","label","icon","item","React","createElement","NavLink","end","href","children","routesToAntMenu","result","push","DecafLayout","props","menuItems","menu","matchedMenuItems","useMatches","map","match","pathname","Layout","style","height","Header","paddingInline","display","justifyContent","alignItems","Link","gap","appIcon","Typography","Title","level","margin","appName","Menu","backgroundColor","border","flex","mode","items","selectedKeys","Content","padding","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","Button","boxShadow","boxShadowSecondary","Input","_extends","Select","Dropdown","token","fontFamily","colorPrimary","colorBgBase","colorBgContainer","colorBgElevated","colorBgLayout","borderRadius","green","red","blue","yellow","colorWhite","algorithm","theme","darkAlgorithm","buildRoutes","_route$element","element","Outlet","_props$config","_props$theme","_theme$token","_theme$token2","_theme$token3","_theme$token4","router","createBrowserRouter","basename","config","basePath","ConfigProvider","Global","styles","src","body","background","button","color","DecafApp","controller","RouterProvider"],"mappings":"8hBAoBM,WAA0BA,GAC9B,MAA2B,GAuB3B,OArBAA,EAAOC,QAAQ,SAACC,GACd,MAAuB,CACrBC,IAAK,SAAgBD,EAAME,GAAKF,EAAMG,MACtCA,MAAOH,EAAMG,MACbC,KAAMJ,EAAMI,MAEV,UAAiBJ,EAAME,GACzBG,EAAKF,MACHG,EAAA,QAAAC,cAACC,EAAAA,QAAO,CAACN,GAAIF,EAAME,GAAIO,IAAkB,MAAbT,EAAME,IAC/BF,EAAMG,OAGF,YAAmBH,EAAMU,KAClCL,EAAKF,MAAQG,EAAAA,QAAAC,cAAA,IAAA,CAAGG,KAAMV,EAAMU,MAAOV,EAAMG,OAChCH,EAAMW,WACfN,EAAKF,MAAQH,EAAMG,MAClBE,EAAqBM,SAAWC,EAAgBZ,EAAMW,UAAY,KAErEE,EAAOC,KAAKT,EACd,IAGF,CAEwBU,SAAAA,EAAYC,GAClC,IAAeC,EAAGL,EAAgBI,EAAME,MAElCC,EADUC,eACiBC,IAAI,SAACC,UAAeA,EAACC,QAAQ,GAE9D,OACGjB,UAAAC,cAAAiB,EAAMA,OAAC,CAAAC,MAAO,CAAEC,OAAQ,SACvBpB,EAAC,QAAAC,cAAAiB,EAAAA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","sources":["../src/components/PageAbout.tsx","../src/components/Page404.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 { 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 { 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 { 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 PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\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 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":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","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","element","Outlet","addTo","array","index","findIndex","r","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","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":"0mBAUwBA,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,IAGFa,EAAAA,QAACC,cAAAC,EAAKA,OAACC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDN,EAAAA,QAACC,cAAAM,eAAa,CAAAC,MAAM,QAAQC,OAAQ,EAAGC,UAAQ,GAC7CV,EAAC,QAAAC,cAAAM,eAAaI,KAAK,CAAAC,MAAM,wBAAwB1B,EAAM2B,SACvDb,EAAAA,QAACC,cAAAM,EAAAA,aAAaI,KAAK,CAAAC,MAAM,+BAA+B1B,EAAM4B,gBAC9Dd,EAAA,QAAAC,cAACM,EAAYA,aAACI,KAAI,CAACC,MAAM,2BAAyB,IAAM1B,EAAM6B,YAC9Df,EAAAA,QAAAC,cAACM,eAAaI,KAAI,CAACC,MAAM,6BAA6BpB,IAEvDN,EAAM8B,QAGb,CC1BwBC,SAAAA,IACtB,OAAQjB,UAAAC,cAAAiB,EAAAA,OAAO,CAAAC,OAAO,MAAMX,MAAO,MAAOY,SAAU,+CACtD,CCDwBC,SAAAA,IACtB,OACErB,EAAA,QAAAC,cAAA,MAAA,KACED,EAAA,QAAAC,cAACqB,EAAMA,OACL,CAAAd,MAAM,gBACNe,KAAK,OACLnB,KAAK,QACLoB,QAAS,WAAMC,OAAAA,OAAOC,SAAS,CAAEC,IAAK,EAAGC,SAAU,UAAW,EAC9DC,KAAM7B,EAAC,QAAAC,cAAA6B,EAAUA,m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BAEb,+DAAgE,CAC9D9H,OAAqB,OAAhBgL,EAAK1F,EAAMD,YAAK,EAAX2F,EAAa9B,YAAU,eAEnC,mBAAoB,CAClBlJ,cAAUsF,EAAAA,EAAMD,cAAN4F,EAAa/B,2BAGzB,gBAAiB,CACfmC,SAAU,QACVC,OAAQ,KACRC,MAAO,EACPC,KAAM,EACN7F,cAAe,GAEjB,iBAAkB,CAChBA,cAAe,GACf8F,WAAY,OACZC,cAAe,QAEjB,gBAAiB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAY,SAAA7F,EAAMD,YAAN,EAAA6F,EAAalD,iBACzB4D,aAAc,EACdjG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACdxL,MAAO,GACPqI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDmDuBwF,CAAUvG,GAE/B,OACExI,EAAC,QAAAC,cAAA+O,EAAcA,eAAC,CAAAxG,MAAOA,GACrBxI,UAAAC,cAACgP,EAAAA,OAAM,CAACC,OAAQnB,IAChB/N,EAAC,QAAAC,cAAAkP,EAAAA,SAAS,CAAA/B,OAAQlO,EAAMkO,OAAQQ,WAAYA,GAC1C5N,EAAAA,QAACC,cAAAmP,EAAAA,gBAAe5B,OAAQA,KAIhC"}
|
package/dist/index.modern.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
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{Space as m,Descriptions as p,Result 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 T from"html2canvas";function j(){return j=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},j.apply(this,arguments)}function D(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(m,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(p,{title:"About",column:1,bordered:!0},C.createElement(p.Item,{label:"Web Application Name"},e.appName),C.createElement(p.Item,{label:"Web Application Description"},e.appDescription),C.createElement(p.Item,{label:"Web Application Version"},`v${e.appVersion}`),C.createElement(p.Item,{label:"DECAF Barista Version"},`v${n}`)),e.content)}function V(){return C.createElement(u,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function P(){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 A(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/${A(window.location.href)}`,show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:`/webapps/${e}/testing/${A(window.location.href)}`,show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:`/webapps/${e}/staging/${A(window.location.href)}`,show:!0},{code:"production",name:"Production Version",color:"green",url:`/webapps/${e}/production/${A(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 T(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(P,null)))))}const G={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},_={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:j({},G,{colorBgContainer:"#2c3d50"}),Select:j({},G,{colorBgContainer:"#2c3d50"}),Dropdown:j({},G,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:j({},G,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:j({},G,{colorBgContainer:"#2c3d50"}),Checkbox:j({},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=j({},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;let l=U(e.routes,[{path:"/about",element:C.createElement(D,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(V,null)}],"path");l=K(j({},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};
|
|
2
2
|
//# sourceMappingURL=index.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.mjs","sources":["../src/Layout.tsx","../src/theme.ts","../src/index.tsx"],"sourcesContent":["import { Layout, Menu, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\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\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\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header style={{ paddingInline: 0 }}>\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 style={{ padding: '20px 50px' }}>{props.children}</Layout.Content>\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\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\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 colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { DecafApp, DecafAppConfig, DecafAppController } 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 from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n routes: DecafRoute[];\n menuItems: DecafMenuItem[];\n appName: string;\n appIcon?: 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 DecafWebapp(props: DecafWebappProps) {\n const routes = buildRoutes(props, props.routes);\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n return (\n <ConfigProvider theme={theme}>\n <Global\n styles={{\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 }}\n />\n <DecafApp config={props.config} controller={props.controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n"],"names":["routes","forEach","route","item","key","to","label","icon","React","createElement","NavLink","end","href","children","routesToAntMenu","result","push","DecafLayout","props","menuItems","menu","matchedMenuItems","useMatches","map","match","pathname","Layout","style","height","Header","paddingInline","display","justifyContent","alignItems","Link","gap","appIcon","Typography","Title","level","margin","appName","Menu","backgroundColor","border","flex","mode","items","selectedKeys","Content","padding","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","Button","boxShadow","boxShadowSecondary","Input","_extends","Select","Dropdown","token","fontFamily","colorPrimary","colorBgBase","colorBgContainer","colorBgElevated","colorBgLayout","borderRadius","green","red","blue","yellow","colorWhite","algorithm","theme","darkAlgorithm","buildRoutes","element","_route$element","Outlet","DecafWebapp","createBrowserRouter","basename","_props$config","config","basePath","_props$theme","ConfigProvider","Global","styles","src","body","background","_theme$token","_theme$token2","button","color","_theme$token3","_theme$token4","DecafApp","controller","RouterProvider","router"],"mappings":"wqBAoBM,WAA0BA,GAC9B,QAA2B,GAuB3B,OArBAA,EAAOC,QAASC,IACd,MAAMC,EAAiB,CACrBC,IAAK,OAAQF,EAAQA,EAAMG,GAAKH,EAAMI,MACtCA,MAAOJ,EAAMI,MACbC,KAAML,EAAMK,MAEV,OAAQL,GAASA,EAAMG,GACzBF,EAAKG,MACHE,EAAAC,cAACC,EAAO,CAACL,GAAIH,EAAMG,GAAIM,IAAkB,MAAbT,EAAMG,IAC/BH,EAAMI,OAGF,SAAUJ,GAASA,EAAMU,KAClCT,EAAKG,MAAQE,EAAAC,cAAA,IAAA,CAAGG,KAAMV,EAAMU,MAAOV,EAAMI,OAChCJ,EAAMW,WACfV,EAAKG,MAAQJ,EAAMI,MAClBH,EAAqBU,SAAWC,EAAgBZ,EAAMW,UAAY,KAErEE,EAAOC,KAAKb,KAGPY,CACT,CAEwB,SAAWE,EAACC,GAClC,MAAMC,EAAYL,EAAgBI,EAAME,MAElCC,EADUC,IACiBC,IAAKC,GAAUA,EAAMC,U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,IAAAA,EADED,EAAMW,UACRV,EAAK+E,QAA2B1E,OAApB2E,EAAGjF,EAAMgF,SAAW1E,EAAAA,EAAAC,cAAC2E,EAAM,MACvCjF,EAAKU,SAAWoE,EAAY/D,EAAOhB,EAAMW,WAEzCV,EAAK+E,QACH1E,EAACC,cAAAQ,EAAY,CAAAG,KAAMF,EAAMC,UAAWsB,QAASvB,EAAMuB,QAASL,QAASlB,EAAMkB,SACxElC,EAAMgF,SAIbnE,EAAOC,KAAKb,EACd,GAEOY,CACT,CAEA,SAASsE,EAAYnE,mBACnB,MAAMlB,EAASiF,EAAY/D,EAAOA,EAAMlB,UACzBsF,EAAoBtF,EAAQ,CACzCuF,SAAU,OAAFC,EAAEtE,EAAMuE,aAAN,EAAAD,EAAcE,WAGpBX,EAAmB,OAAX7D,EAAAA,EAAM6D,OAAKY,EAAIrC,EAE7B,SACG7C,cAAAmF,EAAe,CAAAb,MAAOA,GACrBvE,EAACC,cAAAoF,EACC,CAAAC,OAAQ,CACN,aAAc,CACZ5B,WAAY,mBACZ6B,IAAK,gFAEPC,KAAM,CACJC,WAAY,SAAAlB,EAAMd,YAAN,EAAAiC,EAAa9B,YACzBF,WAAY,SAAAa,EAAMd,YAAN,EAAAkC,EAAajC,WACzB1B,OAAQ,GAGV4D,OAAQ,CACNzC,UAAW,mBAEb,+DAAgE,CAC9D0C,MAAU,GAAW,OAAXtB,EAAAA,EAAMd,YAAK,EAAXqC,EAAazB,yBAEzB,mBAAoB,CAClBwB,MAAU,UAAAE,EAAAxB,EAAMd,cAANsC,EAAa1B,4BAK7BrE,EAAAC,cAAC+F,EAAQ,CAACf,OAAQvE,EAAMuE,OAAQgB,WAAYvF,EAAMuF,YAChDjG,EAACC,cAAAiG,GAAeC,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.modern.mjs","sources":["../src/components/PageAbout.tsx","../src/components/Page404.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 { 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 { 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 { 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 PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\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 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":["PageAbout","props","client","useDecaf","versionBarista","setVersionBarista","useState","undefined","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","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","getAppNameFromUrl","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","async","handleScreenshot","getElementById","footer","setProperty","dataUrl","toDataURL","link","download","click","remove","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","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","_extends","element","Outlet","addTo","array","index","findIndex","r","DecafWebapp","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","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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as o,QuestionCircleOutlined as r,UserOutlined as l,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{Space as m,Descriptions as u,Result as p,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 j}from"react-router-dom";import P 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(e){var t=i().client,n=x(void 0),o=n[0],r=n[1];return B(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),C.createElement(m,{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"+o)),e.content)}function V(){return C.createElement(p,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function A(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:C.createElement(t,null)}))}function O(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function F(){var e,t,o=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+O(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+O(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+O(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+O(window.location.href),show:!0}],a=l.find(function(e){return e.code===r});return a?C.createElement(g,{placement:"top",arrow:!0,menu:{items:l.map(function(e){return{key:e.name,label:C.createElement("span",null,C.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){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==a?void 0:a.color),style:{marginRight:5}}),C.createElement(n,null)))):null}function L(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(P(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?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 R(){var e=i(),t=e.me,n=e.publicConfig,o=x(!1),l=o[0],a=o[1];return B(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),a(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),a(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?C.createElement(f,{size:"small",icon:C.createElement(r,null),onClick:function(){l?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),a(!l)}},"Support"):null}function H(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=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=H(e.children||[])),t.push(n)}),t}function G(e){var t=H(e.menu),n=z().map(function(e){return e.pathname}),o=i().me,r=b.useToken().token;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(R,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:r.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(l,null)},o.username),C.createElement(F,null),C.createElement(L,null),C.createElement(A,null)))))}var _={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},K={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:T({},_,{colorBgContainer:"#2c3d50"}),Select:T({},_,{colorBgContainer:"#2c3d50"}),Dropdown:T({},_,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:T({},_,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:T({},_,{colorBgContainer:"#2c3d50"}),Checkbox:T({},_,{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 U(e,t){var n=[];return t.forEach(function(t){var o,r=T({},t);t.children?(r.element=null!=(o=t.element)?o:C.createElement(j,null),r.children=U(e,t.children)):r.element=C.createElement(G,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(r)}),n}function Z(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}function q(e){var t,n,o,r=Z(e.routes,[{path:"/about",element:C.createElement(D,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(V,null)}],"path");r=U(T({},e,{menuItems:Z(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),r);var l=N(r,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:K,m=e.controller||d;m.disableZendeskWidget=!0;var u=function(e){var t,n,o,r,l;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==(r=e.token)?void 0:r.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==(l=e.token)?void 0:l.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:u}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:l})))}export{q as DecafWebapp,K as decafTheme};
|
|
2
2
|
//# sourceMappingURL=index.module.js.map
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.js","sources":["../src/Layout.tsx","../src/theme.ts","../src/index.tsx"],"sourcesContent":["import { Layout, Menu, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\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\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\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header style={{ paddingInline: 0 }}>\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 style={{ padding: '20px 50px' }}>{props.children}</Layout.Content>\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\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\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 colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { DecafApp, DecafAppConfig, DecafAppController } 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 from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n routes: DecafRoute[];\n menuItems: DecafMenuItem[];\n appName: string;\n appIcon?: 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 DecafWebapp(props: DecafWebappProps) {\n const routes = buildRoutes(props, props.routes);\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n return (\n <ConfigProvider theme={theme}>\n <Global\n styles={{\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 }}\n />\n <DecafApp config={props.config} controller={props.controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n"],"names":["routes","forEach","route","key","to","label","icon","item","React","createElement","NavLink","end","href","children","routesToAntMenu","result","push","DecafLayout","props","menuItems","menu","matchedMenuItems","useMatches","map","match","pathname","Layout","style","height","Header","paddingInline","display","justifyContent","alignItems","Link","gap","appIcon","Typography","Title","level","margin","appName","Menu","backgroundColor","border","flex","mode","items","selectedKeys","Content","padding","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","Button","boxShadow","boxShadowSecondary","Input","_extends","Select","Dropdown","token","fontFamily","colorPrimary","colorBgBase","colorBgContainer","colorBgElevated","colorBgLayout","borderRadius","green","red","blue","yellow","colorWhite","algorithm","theme","darkAlgorithm","buildRoutes","_route$element","element","Outlet","_props$config","_props$theme","_theme$token","_theme$token2","_theme$token3","_theme$token4","router","createBrowserRouter","basename","config","basePath","ConfigProvider","Global","styles","src","body","background","button","color","DecafApp","controller","RouterProvider"],"mappings":"wqBAoBM,WAA0BA,GAC9B,MAA2B,GAuB3B,OArBAA,EAAOC,QAAQ,SAACC,GACd,MAAuB,CACrBC,IAAK,SAAgBD,EAAME,GAAKF,EAAMG,MACtCA,MAAOH,EAAMG,MACbC,KAAMJ,EAAMI,MAEV,UAAiBJ,EAAME,GACzBG,EAAKF,MACHG,EAAAC,cAACC,EAAO,CAACN,GAAIF,EAAME,GAAIO,IAAkB,MAAbT,EAAME,IAC/BF,EAAMG,OAGF,YAAmBH,EAAMU,KAClCL,EAAKF,MAAQG,EAAAC,cAAA,IAAA,C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oB,CAClB0B,OAAqB,OAAXxB,EAAAA,EAAMd,YAAK,EAAXyB,EAAab,8BAK7BrE,EAAAC,cAAC+F,EAAQ,CAACV,OAAQ5E,EAAM4E,OAAQW,WAAYvF,EAAMuF,YAChDjG,EAACC,cAAAiG,GAAef,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.module.js","sources":["../src/components/PageAbout.tsx","../src/components/Page404.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 { 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 { 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 { 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 PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\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 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":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","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","element","Outlet","addTo","array","index","findIndex","r","DecafWebapp","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","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":"+gCAUwBA,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,IAAXD,OACRE,EAA4CC,OAA6BC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,WAAJA,KAAkCC,QAAQ,EACzG,EAAG,CAACZ,IAGFa,EAACC,cAAAC,GAAMC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDN,EAACC,cAAAM,EAAa,CAAAC,MAAM,QAAQC,OAAQ,EAAGC,UAAQ,GAC7CV,EAACC,cAAAM,EAAaI,KAAK,CAAAC,MAAM,wBAAwB1B,EAAM2B,SACvDb,EAACC,cAAAM,EAAaI,KAAK,CAAAC,MAAM,+BAA+B1B,EAAM4B,gBAC9Dd,EAAAC,cAACM,EAAaI,KAAI,CAACC,MAAM,2BAAyB,IAAM1B,EAAM6B,YAC9Df,EAAAC,cAACM,EAAaI,KAAI,CAACC,MAAM,6BAA6BpB,IAEvDN,EAAM8B,QAGb,CC1BwBC,SAAAA,IACtB,OAAQjB,EAAAC,cAAAiB,EAAO,CAAAC,OAAO,MAAMX,MAAO,MAAOY,SAAU,+CACtD,CCDwBC,SAAAA,IACtB,OACErB,EAAAC,cAAA,MAAA,KACED,EAAAC,cAACqB,EACC,CAAAd,MAAM,gBACNe,KAAK,OACLnB,KAAK,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AO,EACPC,KAAM,EACNL,WAAY,SAAA9F,EAAMD,YAAN,EAAA8F,EAAanD,iBACzB6D,aAAc,EACdlG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACdxL,MAAO,GACPqI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDmDuByF,CAAUxG,GAE/B,OACExI,EAACC,cAAAgP,EAAe,CAAAzG,MAAOA,GACrBxI,EAAAC,cAACiP,EAAM,CAACC,OAAQnB,IAChBhO,EAACC,cAAAmP,EAAS,CAAA/B,OAAQnO,EAAMmO,OAAQQ,WAAYA,GAC1C7N,EAACC,cAAAoP,GAAe5B,OAAQA,KAIhC"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd"),require("antd/dist/reset.css"),require("react"),require("react-router-dom")):"function"==typeof define&&define.amd?define(["exports","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd","antd/dist/reset.css","react","react-router-dom"],t):t((e||self).decafReactWebapp={},e.decafReact,e.react,e.styled,e.antd,0,e.react,e.reactRouterDom)}(this,function(e,t,n,a,o,r,l,c){function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/d(a),u=/*#__PURE__*/d(l);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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},f.apply(this,arguments)}function s(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(c.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=s(e.children||[])),t.push(n)}),t}function m(e){var t=s(e.menu),n=c.useMatches().map(function(e){return e.pathname});return u.default.createElement(o.Layout,{style:{height:"100%"}},u.default.createElement(o.Layout.Header,{style:{paddingInline:0}},u.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},u.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,u.default.createElement(o.Typography.Title,{level:4,style:{margin:0}},e.appName)),u.default.createElement(o.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),u.default.createElement(o.Layout.Content,{style:{padding:"20px 50px"}},e.children))}var p={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},h={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none"},Input:f({},p),Select:f({},p),Dropdown:f({},p)},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",colorWhite:"#fff"},algorithm:[o.theme.darkAlgorithm]};function y(e,t){var n=[];return t.forEach(function(t){var a,o=f({},t);t.children?(o.element=null!=(a=t.element)?a:u.default.createElement(c.Outlet,null),o.children=y(e,t.children)):o.element=u.default.createElement(m,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(o)}),n}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return n.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return n.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return i.default}}),e.DecafWebapp=function(e){var a,r,l,d,i,f,s=y(e,e.routes),m=c.createBrowserRouter(s,{basename:null==(a=e.config)?void 0:a.basePath}),p=null!=(r=e.theme)?r:h;return u.default.createElement(o.ConfigProvider,{theme:p},u.default.createElement(n.Global,{styles:{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(l=p.token)?void 0:l.colorBgBase,fontFamily:null==(d=p.token)?void 0:d.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(i=p.token)?void 0:i.colorWhite)+" !important"},".ant-badge-count":{color:(null==(f=p.token)?void 0:f.colorWhite)+" !important"}}}),u.default.createElement(t.DecafApp,{config:e.config,controller:e.controller},u.default.createElement(c.RouterProvider,{router:m})))},e.decafTheme=h});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd","antd/dist/reset.css","react","react-router-dom","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,e.antd,0,e.react,e.reactRouterDom,e.html2Canvas)}(this,function(e,t,n,o,l,a,r,i,c,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/u(l),f=/*#__PURE__*/u(i),m=/*#__PURE__*/u(d);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 g(e){var t=n.useDecaf().client,o=i.useState(void 0),l=o[0],r=o[1];return i.useEffect(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),f.default.createElement(a.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},f.default.createElement(a.Descriptions,{title:"About",column:1,bordered:!0},f.default.createElement(a.Descriptions.Item,{label:"Web Application Name"},e.appName),f.default.createElement(a.Descriptions.Item,{label:"Web Application Description"},e.appDescription),f.default.createElement(a.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),f.default.createElement(a.Descriptions.Item,{label:"DECAF Barista Version"},"v"+l)),e.content)}function b(){return f.default.createElement(a.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function h(){return f.default.createElement("div",null,f.default.createElement(a.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:f.default.createElement(t.UpOutlined,null)}),f.default.createElement(a.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:f.default.createElement(t.DownOutlined,null)}))}function y(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function E(){var e,n,o=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],l=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),r=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+y(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+y(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+y(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+y(window.location.href),show:!0}],i=r.find(function(e){return e.code===l});return i?f.default.createElement(a.Dropdown,{placement:"top",arrow:!0,menu:{items:r.map(function(e){return{key:e.name,label:f.default.createElement("span",null,f.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},f.default.createElement(a.Button,{type:"text",size:"small"},f.default.createElement("div",{style:{display:"flex",alignItems:"center"}},f.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),f.default.createElement(t.CaretUpOutlined,null)))):null}function w(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(m.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?f.default.cloneElement(e.triggerNode,{onClick:n}):f.default.createElement(a.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:f.default.createElement(t.CameraOutlined,null),onClick:n})}function v(){var e=n.useDecaf(),o=e.me,l=e.publicConfig,r=i.useState(!1),c=r[0],d=r[1];return i.useEffect(function(){if(l.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+l.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)}}},[l,o]),l.zendesk?f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function k(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=f.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=f.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=k(e.children||[])),t.push(n)}),t}function C(e){var o=k(e.menu),l=c.useMatches().map(function(e){return e.pathname}),r=n.useDecaf().me,i=a.theme.useToken().token;return f.default.createElement(a.Layout,{style:{height:"100%"}},f.default.createElement(a.Layout.Header,{id:"decaf-header"},f.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},f.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,f.default.createElement(a.Typography.Title,{level:4,style:{margin:0}},e.appName)),f.default.createElement(a.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),f.default.createElement(a.Layout.Content,{id:"decaf-content"},e.children),f.default.createElement(a.Layout.Footer,{id:"decaf-footer"},f.default.createElement(a.Row,{justify:"space-between",align:"middle"},f.default.createElement(a.Col,{span:10},f.default.createElement(v,null)),f.default.createElement(a.Col,{span:4},f.default.createElement(a.Typography.Text,{type:"secondary"},"Powered by"," ",f.default.createElement("b",null,f.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:i.colorText}},"Teloscube")))),f.default.createElement(a.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.UserOutlined,null)},r.username),f.default.createElement(E,null),f.default.createElement(w,null),f.default.createElement(h,null)))))}var B={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},x="#2c3d50",z={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:x},Input:p({},B,{colorBgContainer:x}),Select:p({},B,{colorBgContainer:x}),Dropdown:p({},B,{colorBgElevated:x,controlItemBgActive:x}),DatePicker:p({},B,{colorBgContainer:x,colorBgElevated:x}),InputNumber:p({},B,{colorBgContainer:x}),Checkbox:p({},B,{colorBgContainer:x})},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:[a.theme.darkAlgorithm]};function D(e,t){var n=[];return t.forEach(function(t){var o,l=p({},t);t.children?(l.element=null!=(o=t.element)?o:f.default.createElement(c.Outlet,null),l.children=D(e,t.children)):l.element=f.default.createElement(C,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},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(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return s.default}}),e.DecafWebapp=function(e){var l,r,i,d=I(e.routes,[{path:"/about",element:f.default.createElement(g,{appName:e.appName,appVersion:null==(l=e.config)?void 0:l.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:f.default.createElement(b,null)}],"path");d=D(p({},e,{menuItems:I(e.menuItems,[{label:"About",to:"/about",icon:f.default.createElement(t.InfoCircleOutlined,null)}],"to")}),d);var u=c.createBrowserRouter(d,{basename:null==(r=e.config)?void 0:r.basePath}),s=null!=(i=e.theme)?i:z,m=e.controller||n.DecafWebappController;m.disableZendeskWidget=!0;var h=function(e){var t,n,o,l,a;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==(a=e.token)?void 0:a.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"}}}}(s);return f.default.createElement(a.ConfigProvider,{theme:s},f.default.createElement(o.Global,{styles:h}),f.default.createElement(n.DecafApp,{config:e.config,controller:m},f.default.createElement(c.RouterProvider,{router:u})))},e.decafTheme=z});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/Layout.tsx","../src/theme.ts","../src/index.tsx"],"sourcesContent":["import { Layout, Menu, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\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\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\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header style={{ paddingInline: 0 }}>\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 style={{ padding: '20px 50px' }}>{props.children}</Layout.Content>\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\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\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 colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { DecafApp, DecafAppConfig, DecafAppController } 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 from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n routes: DecafRoute[];\n menuItems: DecafMenuItem[];\n appName: string;\n appIcon?: 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 DecafWebapp(props: DecafWebappProps) {\n const routes = buildRoutes(props, props.routes);\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n return (\n <ConfigProvider theme={theme}>\n <Global\n styles={{\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 }}\n />\n <DecafApp config={props.config} controller={props.controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n"],"names":["routes","forEach","route","key","to","label","icon","item","React","createElement","NavLink","end","href","children","routesToAntMenu","result","push","DecafLayout","props","menuItems","menu","matchedMenuItems","useMatches","map","match","pathname","Layout","style","height","Header","paddingInline","display","justifyContent","alignItems","Link","gap","appIcon","Typography","Title","level","margin","appName","Menu","backgroundColor","border","flex","mode","items","selectedKeys","Content","padding","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","Button","boxShadow","boxShadowSecondary","Input","_extends","Select","Dropdown","token","fontFamily","colorPrimary","colorBgBase","colorBgContainer","colorBgElevated","colorBgLayout","borderRadius","green","red","blue","yellow","colorWhite","algorithm","theme","darkAlgorithm","buildRoutes","_route$element","element","Outlet","_props$config","_props$theme","_theme$token","_theme$token2","_theme$token3","_theme$token4","router","createBrowserRouter","basename","config","basePath","ConfigProvider","Global","styles","src","body","background","button","color","DecafApp","controller","RouterProvider"],"mappings":"q7BAoBM,WAA0BA,GAC9B,MAA2B,GAuB3B,OArBAA,EAAOC,QAAQ,SAACC,GACd,MAAuB,CACrBC,IAAK,SAAgBD,EAAME,GAAKF,EAAMG,MACtCA,MAAOH,EAAMG,MACbC,KAAMJ,EAAMI,MAEV,UAAiBJ,EAAME,GACzBG,EAAKF,MACHG,EAAA,QAAAC,cAACC,EAAAA,QAAO,CAACN,GAAIF,EAAME,GAAIO,IAAkB,MAAbT,EAAME,IAC/BF,EAAMG,OAGF,YAAmBH,EAAMU,KAClCL,EAAKF,MAAQG,EAAAA,QAAAC,cAAA,IAAA,CAAGG,KAAMV,EAAMU,MAAOV,EAAMG,OAChCH,EAAMW,WACfN,EAAKF,MAAQH,EAAMG,MAClBE,EAAqBM,SAAWC,EAAgBZ,EAAMW,UAAY,KA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nC,mBAAoB,CAClB0B,OAAqB,OAAXxB,EAAAA,EAAMd,YAAK,EAAXyB,EAAab,8BAK7BrE,EAAA,QAAAC,cAAC+F,EAAAA,SAAQ,CAACV,OAAQ5E,EAAM4E,OAAQW,WAAYvF,EAAMuF,YAChDjG,UAACC,cAAAiG,EAAcA,gBAACf,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/components/PageAbout.tsx","../src/components/Page404.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 { 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 { 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 { 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 PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\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 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":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","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","INPUT_BG_COLOR","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","element","Outlet","addTo","array","index","findIndex","r","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","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":"yjCAUwBA,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,IAGFa,EAAAA,QAACC,cAAAC,EAAKA,OAACC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDN,EAAAA,QAACC,cAAAM,eAAa,CAAAC,MAAM,QAAQC,OAAQ,EAAGC,UAAQ,GAC7CV,EAAC,QAAAC,cAAAM,eAAaI,KAAK,CAAAC,MAAM,wBAAwB1B,EAAM2B,SACvDb,EAAAA,QAACC,cAAAM,EAAAA,aAAaI,KAAK,CAAAC,MAAM,+BAA+B1B,EAAM4B,gBAC9Dd,EAAA,QAAAC,cAACM,EAAYA,aAACI,KAAI,CAACC,MAAM,2BAAyB,IAAM1B,EAAM6B,YAC9Df,EAAAA,QAAAC,cAACM,eAAaI,KAAI,CAACC,MAAM,6BAA6BpB,IAEvDN,EAAM8B,QAGb,CC1BwBC,SAAAA,IACtB,OAAQjB,UAAAC,cAAAiB,EAAAA,OAAO,CAAAC,OAAO,MAAMX,MAAO,MAA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{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,CA8DlE"}
|
package/dist/theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAS9D,eAAO,MAAM,UAAU,EAAE,WAyDxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decafhub/decaf-react-webapp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"decafhub",
|
|
6
6
|
"react"
|
|
@@ -43,30 +43,31 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/react": "^11.10.5",
|
|
46
|
-
"@emotion/styled": "^11.10.5"
|
|
46
|
+
"@emotion/styled": "^11.10.5",
|
|
47
|
+
"html2canvas": "^1.4.1"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@ant-design/icons": "^4.8.0",
|
|
50
51
|
"@commitlint/cli": "^17.3.0",
|
|
51
52
|
"@commitlint/config-conventional": "^17.3.0",
|
|
52
53
|
"@decafhub/decaf-client": "^0.3.1",
|
|
53
|
-
"@decafhub/decaf-react": "^0.1.
|
|
54
|
+
"@decafhub/decaf-react": "^0.1.9",
|
|
54
55
|
"@testing-library/jest-dom": "^5.16.5",
|
|
55
56
|
"@testing-library/react": "^13.4.0",
|
|
56
|
-
"@types/jest": "^29.2.
|
|
57
|
+
"@types/jest": "^29.2.4",
|
|
57
58
|
"@types/js-cookie": "^3.0.2",
|
|
58
|
-
"@types/node": "^18.11.
|
|
59
|
-
"@types/react": "^18.0.
|
|
59
|
+
"@types/node": "^18.11.12",
|
|
60
|
+
"@types/react": "^18.0.26",
|
|
60
61
|
"@types/react-dom": "^18.0.9",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
62
|
-
"@typescript-eslint/parser": "^5.
|
|
63
|
-
"antd": "^5.0.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
|
63
|
+
"@typescript-eslint/parser": "^5.46.0",
|
|
64
|
+
"antd": "^5.0.5",
|
|
64
65
|
"cross-env": "^7.0.3",
|
|
65
|
-
"eslint": "^8.
|
|
66
|
+
"eslint": "^8.29.0",
|
|
66
67
|
"eslint-config-prettier": "^8.5.0",
|
|
67
68
|
"eslint-config-standard": "^17.0.0",
|
|
68
69
|
"eslint-plugin-import": "^2.26.0",
|
|
69
|
-
"eslint-plugin-n": "^15.
|
|
70
|
+
"eslint-plugin-n": "^15.6.0",
|
|
70
71
|
"eslint-plugin-prettier": "^4.2.1",
|
|
71
72
|
"eslint-plugin-promise": "^6.1.1",
|
|
72
73
|
"eslint-plugin-react": "^7.31.11",
|
|
@@ -77,16 +78,16 @@
|
|
|
77
78
|
"identity-obj-proxy": "^3.0.0",
|
|
78
79
|
"jest": "^29.3.1",
|
|
79
80
|
"jest-environment-jsdom": "^29.3.1",
|
|
80
|
-
"lint-staged": "^13.0
|
|
81
|
+
"lint-staged": "^13.1.0",
|
|
81
82
|
"microbundle": "^0.15.1",
|
|
82
83
|
"postcss": "^8.4.19",
|
|
83
|
-
"prettier": "^2.8.
|
|
84
|
+
"prettier": "^2.8.1",
|
|
84
85
|
"react": "^18.2.0",
|
|
85
86
|
"react-dom": "^18.2.0",
|
|
86
|
-
"react-router-dom": "^6.4.
|
|
87
|
+
"react-router-dom": "^6.4.5",
|
|
87
88
|
"ts-jest": "^29.0.3",
|
|
88
89
|
"typedoc": "^0.23.21",
|
|
89
|
-
"typescript": "^4.9.
|
|
90
|
+
"typescript": "^4.9.4"
|
|
90
91
|
},
|
|
91
92
|
"lint-staged": {
|
|
92
93
|
"src/**/*.{ts,tsx}": [
|