@blocklet/pages-kit-inner-components 0.5.56 → 0.6.0
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/lib/cjs/add-component.js +21 -23
- package/lib/cjs/chunks/{draft-data-CuZfaQ4s.js → draft-data-D44_IEV2.js} +1 -1
- package/lib/cjs/chunks/home-BYk01EUy.js +39 -0
- package/lib/cjs/chunks/index-BRgYwvuv.js +475 -0
- package/lib/cjs/chunks/publish-button-C8XPA4g_.js +1 -0
- package/lib/cjs/chunks/session-BRtsDvA-.js +1 -0
- package/lib/cjs/chunks/site-state-gSkcvhcV.js +57 -0
- package/lib/cjs/chunks/state-B6BF5wJ-.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +7 -7
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/cjs/theme.js +1 -1
- package/lib/es/add-component.js +385 -2356
- package/lib/es/chunks/{draft-data-CWM--ooz.js → draft-data-CafrGKeh.js} +1 -1
- package/lib/es/chunks/home-DW8SdyfO.js +594 -0
- package/lib/es/chunks/index-D5gXPe_7.js +2326 -0
- package/lib/es/chunks/publish-button-XSZrDaTQ.js +498 -0
- package/lib/es/chunks/session-C72Dq8zg.js +19 -0
- package/lib/es/chunks/site-state-W2H7XCSQ.js +2077 -0
- package/lib/es/chunks/state-0gvZF3k2.js +573 -0
- package/lib/es/components.js +1 -1
- package/lib/es/home.js +5 -5
- package/lib/es/project-html.js +131 -141
- package/lib/es/resources.js +106 -107
- package/lib/es/setting.js +1772 -1489
- package/lib/es/site-state.js +1 -1
- package/lib/es/theme.js +50 -51
- package/package.json +46 -47
- package/lib/cjs/chunks/array-BqHuYyfx.js +0 -475
- package/lib/cjs/chunks/config-string-4bVR9Vc8.js +0 -1
- package/lib/cjs/chunks/home-BMjMYgq3.js +0 -38
- package/lib/cjs/chunks/publish-button-CGfGqrov.js +0 -1
- package/lib/cjs/chunks/session-BA7Qrcia.js +0 -1
- package/lib/cjs/chunks/site-state-BtZ8o3J2.js +0 -57
- package/lib/cjs/chunks/state-BVdbNJCA.js +0 -1
- package/lib/es/chunks/array-c6HYTLze.js +0 -2224
- package/lib/es/chunks/config-string-WMpFf-7V.js +0 -88
- package/lib/es/chunks/home-PDsc59QG.js +0 -566
- package/lib/es/chunks/publish-button-Ds7OBvxV.js +0 -462
- package/lib/es/chunks/session-CVblGhSp.js +0 -21
- package/lib/es/chunks/site-state-D-moj9fA.js +0 -2125
- package/lib/es/chunks/state-l--dTdHq.js +0 -603
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./state-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./state-B6BF5wJ-.js");function n({children:e}){const r=t.useProjectId();return s.jsx(t.StoreProvider,{url:t.getWssURL(r??""),name:"root",waitingSynced:!0,children:s.jsx(o,{children:e})})}function o({children:e}){const{state:r}=t.useStore();return e({state:r})}exports.default=n;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),k=require("./state-B6BF5wJ-.js"),$=require("@arcblock/ux/lib/Locale/context"),te=require("@arcblock/ux/lib/Result"),M=require("@arcblock/ux/lib/Theme"),ne=require("@blocklet/pages-kit/builtin/page/header"),oe=require("@blocklet/pages-kit/contexts/color"),G=require("@blocklet/pages-kit/utils/data-source"),re=require("@blocklet/pages-kit/utils/route"),se=require("@blocklet/ui-react/lib/Header"),ae=require("@emotion/css"),B=require("@emotion/react"),y=require("@mui/material"),F=require("ahooks"),ie=require("isomorphic-dompurify"),ce=require("lodash/cloneDeep"),le=require("lodash/isEmpty"),ue=require("lodash/isEqual"),p=require("react"),de=require("react-helmet"),v=require("react-router-dom"),W=require("react-use"),S=require("ufo"),_=require("./index-BRgYwvuv.js"),pe=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const z=require("./session-BRtsDvA-.js"),R=t=>t&&t.__esModule?t:{default:t},K=R(te),ge=R(se),me=R(ie),L=R(ce),he=R(le),Y=R(ue),fe=R(pe),xe=M.styled(y.Box)`
|
|
2
|
+
display: contents;
|
|
3
|
+
& > div > div > .MuiContainer-root {
|
|
4
|
+
max-width: unset;
|
|
5
|
+
}
|
|
6
|
+
`;function je({meta:t,...n}){const c=M.useTheme();return e.jsx(xe,{children:e.jsx(fe.default,{...n,meta:t,theme:c||{}})})}function J(t){return e.jsx(y.Box,{...t,sx:[{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center"},...Array.isArray(t.sx)?t.sx:[t.sx]],children:e.jsx(y.CircularProgress,{size:30})})}function ye(t){return e.jsx(be,{...t})}const be=M.styled(y.Box)`
|
|
7
|
+
position: fixed;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 999999999999;
|
|
11
|
+
width: 80px;
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
opacity: 0.7;
|
|
15
|
+
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
`,Pe=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
18
|
+
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function ve({titleFontFamily:t,descriptionFontFamily:n}){const r=y.useTheme()?.typography?.fontFamily;p.useEffect(()=>{},[t,n]);const a=`${r}, ${Pe}`;return e.jsx(B.Global,{styles:B.css`
|
|
19
|
+
#app {
|
|
20
|
+
font-family: ${a};
|
|
21
|
+
|
|
22
|
+
.page-kit-section__title {
|
|
23
|
+
font-family: ${a};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.page-kit-section__description {
|
|
27
|
+
font-family: ${a};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`})}function V(t){return t!=null}function we(){const[t]=v.useSearchParams(),{session:n}=z.useSessionContext(),c=z.useIsRoleOrMultiTenant("owner","admin","pagesEditor","member"),r=p.useMemo(()=>{const o=t.get("mode");return _.STATE_MODES.includes(o)?o:"production"},[t]),a=r==="production"?r:n.user?c?r:"production":null;return a?e.jsx(Q,{mode:a}):null}function Q({mode:t}){if(t!=="draft"){const n=window.__PAGE_STATE__;return n?e.jsx(E,{mode:t,state:n}):e.jsx(Re,{mode:t,children:({state:c})=>e.jsx(E,{mode:t,state:c})})}return e.jsx(Se,{children:({state:n})=>e.jsx(E,{mode:t,state:n})})}const ke=p.lazy(()=>Promise.resolve().then(()=>require("./publish-button-C8XPA4g_.js"))),Se=p.lazy(()=>Promise.resolve().then(()=>require("./draft-data-D44_IEV2.js")));function Re({mode:t,children:n}){const r=document.querySelector('meta[property="pages:version"]')?.content,a=k.useProjectId(),o=p.useMemo(()=>{if(r==="{{pagesPublishedAt}}"){const l=localStorage.getItem(k.getProjectPageVersionKey(a??""));return Number(l)?Number(l):new Date().getTime()}return Number(r)},[r]),{loading:g,value:i}=W.useAsync(()=>_.getPages({mode:t,version:o}),[t,o]);return g?e.jsx(J,{}):i?n({state:i}):null}function E({mode:t,state:n}){const{t:c,locale:r}=$.useLocaleContext(),[a]=v.useSearchParams(),o=k.useProjectId(),g=k.useProjectSlug(),i=a.get("hiddenBadge")==="true",l=a.get("showPublish")==="true",{pageIds:h,pages:u,routeIds:d,routes:j,supportedLocales:b,config:{defaultLocale:P},resources:C}=n,x=k.getAllComponents(n),f=p.useMemo(()=>b?.some(m=>m.locale===r)?r:void 0,[r,b]),q=Object.values(j||{}).find(m=>m?.path==="/")||Object.values(u).find(m=>m?.slug==="/")?void 0:Object.values(u)[0],O=p.useMemo(()=>t==="production"?h.map(m=>{const s=u[m];return s&&{id:s.id,path:S.joinURL("/",g||o||"",s.slug)}}).filter(V):d.map(m=>{const s=j[m];return s?{id:s.id,path:S.joinURL("/",g||o||"",s.path,`?mode=${t}&showPublish=true`)}:null}).filter(V),[h,u,t,j,d,o,g]),T=([...m])=>(t!=="production"&&l&&m.unshift(e.jsx(p.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(ke,{ref:{current:null},mode:"production",state:n})})),m);return e.jsxs(_.Provider,{value:{pages:O},children:[e.jsxs(v.Routes,{children:[q&&e.jsx(v.Route,{index:!0,element:e.jsx(v.Navigate,{to:S.joinURL("/",f||"",q.slug)})}),d?.map(m=>{const s=j?.[m];if(!s||!s.displayTemplateId)return null;const A=u[s.displayTemplateId];if(!A)return null;let D=[];return s.params&&s.params.length>0&&(D=re.generateParamCombinations({basePath:s.path,params:s.params,routeId:s.id,paramsOptions:s.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]})?.map(H=>{const N=H.paramOptionIds.join("-");return e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",H.path),element:e.jsx(U,{mode:t,components:x,page:A,locale:f,defaultLocale:P,headerAddons:T,state:n,pageData:s.dataSource?.pathDataMappings?.[N]?.dataCache?.[f||P||"en"]})},N)})),D.push(e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",s.path),element:e.jsx(U,{mode:t,components:x,page:A,locale:f,defaultLocale:P,headerAddons:T,state:n,pageData:s.dataSource?.pathDataMappings?.[s.id]?.dataCache?.[f||P||"en"]})},s.id)),D}),h.map(m=>{const s=u[m];return s?e.jsx(v.Route,{path:S.joinURL(":projectIdOrSlug?",s.slug),element:e.jsx(I,{mode:t,components:x,page:s,locale:f,defaultLocale:P,headerAddons:T})},s.id):null}),C.pages&&Object.values(C.pages).map(({blockletId:m,page:s})=>e.jsx(v.Route,{path:S.joinURL("/",`@${m}`,s.slug),element:e.jsx(I,{mode:t,components:x,page:s,locale:f,defaultLocale:P,headerAddons:T})},s.id)),e.jsx(v.Route,{path:"*",element:e.jsx(y.Box,{sx:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(K.default,{status:404,extra:e.jsx(ee,{href:"/",children:c("common.back")}),sx:{bgcolor:"transparent",width:"100%",height:"100%"}})})})]}),t!=="production"&&!i&&e.jsx(ye,{sx:{bgcolor:"info.light"},children:t}),e.jsx(ve,{})]})}function U({mode:t,pageData:n,components:c,page:r,locale:a,defaultLocale:o,headerAddons:g,state:i}){const l=F.useReactive({page:null});p.useEffect(()=>{const u=r||null;u?l.page=L.default(u):l.page=null},[r,JSON.stringify(r),l]);const h=p.useRef(void 0);return p.useEffect(()=>{Y.default(n,h.current)||n&&l.page&&(G.setPageDataSource(l.page,i,a,n),h.current=L.default(n))},[l.page,n,a,i]),l.page?e.jsx(I,{mode:t,components:c,page:l.page,locale:a,defaultLocale:o,headerAddons:g}):null}function Ce({mode:t,state:n,path:c,pageData:r}){const{t:a,locale:o}=$.useLocaleContext(),{pages:g,supportedLocales:i,config:{defaultLocale:l},resources:h}=n,u=Object.values(g).find(x=>x?.slug===c),d=Object.values(h.pages||{}).find(x=>x.page.slug===c),j=p.useMemo(()=>i?.some(x=>x.locale===o)?o:void 0,[o,i]),b=F.useReactive({page:null});p.useEffect(()=>{const x=u||d?.page||null;x?b.page=L.default(x):b.page=null},[u,d]);const P=p.useRef(void 0);if(p.useEffect(()=>{Y.default(r,P.current)||r&&b.page&&(G.setPageDataSource(b.page,n,j,r),P.current=L.default(r))},[{}]),!u&&!d?.page)return e.jsx(y.Box,{sx:{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(K.default,{style:{background:"inherit"},status:404,extra:e.jsx(ee,{href:"/",children:a("common.back")})})});const C=k.getAllComponents(n);return b.page?e.jsx(I,{mode:t,components:C,page:b.page,locale:j,defaultLocale:l}):null}function I({mode:t,components:n,page:c,locale:r,defaultLocale:a,headerAddons:o}){const g=oe.useColorConvert(),i=c.locales?.[r]??c.locales?.[a]??{},l=i.title||window.blocklet?.appName,h=i.description||window.blocklet?.appDescription,u=k.autoResizeImage(k.getImageAbsoluteUrl(i.image),540),{logo:d,brand:j,description:b,...P}=ne.useHeaderState(),C=p.useMemo(()=>f=>{let w=o?.(f)??f;return w=P.addons?.(w)??w,w},[P.addons,o]),x=p.useMemo(()=>i.header?.translucent?Z:X,[i.header?.translucent]);return e.jsxs(_.PageProvider,{page:c,defaultLocale:a,currentLocale:r,children:[e.jsx(B.Global,{styles:B.css`
|
|
31
|
+
body {
|
|
32
|
+
background-color: ${g(!i.backgroundColor||i.backgroundColor==="transparent"?"background.default":i.backgroundColor)} !important;
|
|
33
|
+
}
|
|
34
|
+
`}),e.jsx(x,{hideNavMenu:!!i.header?.hideNavMenus,translucentTextColor:i.header?.translucentTextColor,...d?{logo:d}:{},...j?{brand:j}:{},...b?{description:b}:{},className:ae.cx(i.header?.sticky&&"sticky","page-header"),maxWidth:!1,addons:C}),e.jsx(v.ScrollRestoration,{}),e.jsxs(de.Helmet,{children:[e.jsx("title",{children:l}),e.jsx("meta",{name:"og:title",content:l}),e.jsx("meta",{name:"og:description",content:h}),e.jsx("meta",{name:"og:image",content:u}),e.jsx("meta",{name:"twitter:image:src",content:u}),e.jsx("meta",{name:"twitter:image",content:u}),e.jsx("meta",{property:"twitter:description",content:h}),e.jsx("meta",{property:"twitter:title",content:l}),e.jsx("meta",{name:"description",content:h})]}),e.jsx(y.Stack,{className:"PageView-root",sx:{flexGrow:1,"& .BlockBase-root:first-child":{pt:"0 !important"}},children:c.sectionIds.map(f=>{const w=c.sections[f];if(!w||w.visibility==="hidden")return null;const q=c.dataSource?.[f]?.[r],O=c.dataSource?.[f]?.[a]??{};return e.jsx(_.BlockRenderer,{id:f,type:w.component,mode:t,section:w,config:{...he.default(q)?O:q,locale:r,dev:t==="draft"?{mode:t,components:n,defaultLocale:a}:{mode:t,defaultLocale:a}},page:c},f)})}),!i.footer?.hidden&&e.jsx(je,{})]})}const X=M.styled(ge.default)`
|
|
35
|
+
&.sticky {
|
|
36
|
+
position: sticky;
|
|
37
|
+
top: 0;
|
|
38
|
+
}
|
|
39
|
+
`;function qe({logo:t}){const[n,c]=p.useState(),r=y.useMediaQuery(o=>o.breakpoints.down("sm")),{value:a}=W.useAsync(()=>{const o=new URL(r?window?.blocklet?.appLogo||"/.well-known/service/blocklet/logo":window?.blocklet?.appLogoRect||"/.well-known/service/blocklet/logo-rect",window.location.origin);o.searchParams.delete("imageFilter"),o.searchParams.delete("f");const g=o.toString();return new Promise(i=>{fetch(g).then(l=>{l.headers.get("content-type")?.includes("svg")&&l.text().then(u=>{c(u),i(null)}),i(l.url)})})},[r]);if(t)return t;if(n)return e.jsx(y.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:me.default.sanitize(n)}});if(a){const o=new URL(a);o.searchParams.set("imageFilter","convert"),o.searchParams.set("f","png"),o.searchParams.set("h","80");const g=o.toString();return e.jsx("img",{src:g,alt:"logo"})}return null}function Z({logo:t,translucentTextColor:n,...c}){const a=F.useScroll(document.getElementById("app"),d=>d.top<1200),o=y.useTheme(),g=Math.min(a?.top??0,800),i=p.useMemo(()=>{let d=Math.min(g/800,1),j="";return d>.1?(d=Math.max(d,.6),j=y.alpha(o.palette.text.primary,d)):j=n||"#EEEEEE",{backgroundOpacity:d,textColor:j,isReversed:d<.7}},[g,800,o.palette.text.primary,n]),{backgroundOpacity:l,textColor:h,isReversed:u}=i;return e.jsx(X,{logo:e.jsx(qe,{logo:t}),...c,sx:{position:"fixed !important",top:0,left:0,right:0,zIndex:o.zIndex.appBar,backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1,backgroundColor:y.alpha(o.palette.background.default,l),backdropFilter:l>=.6?"blur(10px)":"blur(0px)",transition:"backgroundColor 0.3s ease-in-out"},transition:"color 0.3s ease-in-out",".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${h} !important`},".header-logo":{color:`${h} !important`},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:`invert(${u?1:0})`,transition:"filter 0.3s ease-in-out"}}})}const ee=M.styled(y.Button)``;exports.Home=we;exports.HomeView=Q;exports.Loading=J;exports.PageRoutes=E;exports.PageView=I;exports.PageViewByPath=Ce;exports.PageViewWithDataSource=U;exports.TranslucentHeader=Z;
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
"use strict";var Ne=Object.create;var oe=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Me(t))!Re.call(e,i)&&i!==n&&oe(e,i,{get:()=>t[i],enumerable:!(r=Ie(t,i))||r.enumerable});return e};var We=(e,t,n)=>(n=e!=null?Ne(Pe(e)):{},Ee(t||!e||!e.__esModule?oe(n,"default",{value:e,enumerable:!0}):n,e));const o=require("react/jsx-runtime"),Te=require("@mui/icons-material"),u=require("@mui/material"),ze=require("lodash/isEmpty"),Ae=require("lodash/pick"),f=require("react"),qe=require("lodash/keyBy"),k=require("./state-B6BF5wJ-.js"),V=require("@blocklet/ai-runtime/components"),Le=require("@mui/utils"),Oe=require("react-error-boundary"),Ue=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),me=require("@blocklet/pages-kit/contexts/color"),w=require("@emotion/css"),Fe=require("react-syntax-highlighter/dist/esm/styles/prism"),$=require("@arcblock/ux/lib/Theme"),He=require("@arcblock/react-hooks/lib/useBrowser"),Ve=require("@arcblock/ux/lib/Colors"),Q=require("@blocklet/pages-kit/components"),ne=require("@blocklet/pages-kit/utils/style"),De=require("@mui/material/useMediaQuery"),Ye=require("lodash/omit"),xe=require("@iconify-icon/react"),Je=require("@arcblock/ux/lib/Screenshot"),Z=require("react-router-dom"),Ge=require("@arcblock/ux/lib/Button"),Ke=require("is-uri"),D=require("pathe"),T=require("ufo"),Xe=require("@blocklet/embed/message"),Qe=require("ahooks"),Ze=require("lodash/isEqual"),et=require("@blocklet/embed/react"),tt=require("@arcblock/ux/lib/Locale/context"),ot=require("react-twitter-embed"),re=require("react-use"),B=e=>e&&e.__esModule?e:{default:e},nt=B(ze),J=B(Ae),rt=B(f),G=B(qe),it=B(Ue),st=B(He),ie=B(Ve),pe=B(De),N=B(Ye),at=B(Je),lt=B(Ge),K=B(Ke),ct=B(Ze),he="{{CUSTOM_VALUE}}",dt=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],ut=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],mt=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:2.5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:2.5,md:10,lg:12.5,xl:15}}}],Y=(e,t,n)=>{const r=e.breakpoints.values[n];return`${t}${r?` (${r}px)`:""}`},xt=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:e=>Y(e,"Small","sm"),value:"sm",sx:{maxWidth:e=>e.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:e=>Y(e,"Normal","md"),value:"md",sx:{maxWidth:e=>e.breakpoints.values.md,width:"100%",mx:"auto"}},{title:e=>Y(e,"Large","lg"),value:"lg",sx:{maxWidth:e=>e.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:e=>Y(e,"Extra Large","xl"),value:"xl",sx:{maxWidth:e=>e.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:he,width:"100%",mx:"auto"}}],pt=G.default(dt,"value"),ht=G.default(ut,"value"),gt=G.default(mt,"value"),ft=G.default(xt,"value"),yt=new Map([["baseSectionPaddingY",pt],["maxWidth",ft],["paddingY",ht],["paddingX",gt]]);function ge(e){const{type:t,value:n,format:r="sx",defaultValue:i=null}=e,s=yt.get(t);if(!s)return i;const c=n.startsWith("custom:"),a=c?"custom":n;if(s?.[a]&&s?.[a]?.[r]){const l=s[a][r];if(c){const d=n.replace("custom:","");try{return JSON.parse(JSON.stringify(l||{}).replaceAll(he,d))}catch{}}return l}return i}const fe=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function bt(){return f.useContext(fe)}function wt({page:e,children:t,defaultLocale:n="en",currentLocale:r}){const i=f.useMemo(()=>e?JSON.parse(JSON.stringify(e)):null,[JSON.stringify(e)]),s=f.useCallback(()=>{if(!i)return{};const l=r||n;return i.locales?.[l]??{}},[i,n,r]),c=f.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((m,[h,p])=>{if(!p)return m;const b=`${h}Custom`;d.style[b];const y=ge({type:h,value:p,format:l});return y?{...m,...y}:m},{})},[s]),a=f.useMemo(()=>({page:i,getPageMeta:s,getPageMetaStyle:c}),[i,s,c]);return o.jsx(fe.Provider,{value:a,children:t})}function R({actions:e,center:t,className:n,align:r}){return e&&e?.length?o.jsx(u.Box,{className:w.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(t||r==="center")&&"justify-center",!t&&r==="right"&&"justify-end",!t&&r==="left"&&"justify-start",n),sx:{alignItems:"center"},children:e}):null}const jt="section",vt=u.styled(u.Box)`
|
|
2
|
+
overflow: hidden;
|
|
3
|
+
|
|
4
|
+
.section__title {
|
|
5
|
+
margin-top: 0;
|
|
6
|
+
font-weight: 700;
|
|
7
|
+
}
|
|
8
|
+
.section__title_non_big {
|
|
9
|
+
font-size: 32px;
|
|
10
|
+
@media (max-width: 600px) {
|
|
11
|
+
font-size: 24px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
&.base-info .section__tag {
|
|
15
|
+
margin-top: 0;
|
|
16
|
+
margin-bottom: 2vw;
|
|
17
|
+
background-color: ${({theme:e})=>e.palette.primary.main};
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
padding: 0 10px;
|
|
22
|
+
justify-content: flex-start;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
color: #fff;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
line-height: 20px;
|
|
29
|
+
}
|
|
30
|
+
.section__title {
|
|
31
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
32
|
+
a {
|
|
33
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
34
|
+
}
|
|
35
|
+
p {
|
|
36
|
+
margin-top: 0;
|
|
37
|
+
margin-bottom: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.section__description {
|
|
41
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
42
|
+
margin-bottom: 4vw;
|
|
43
|
+
margin-top: 0;
|
|
44
|
+
a {
|
|
45
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
46
|
+
}
|
|
47
|
+
p {
|
|
48
|
+
margin-top: 0;
|
|
49
|
+
margin-bottom: 0.5rem;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
@media (min-width: ${({theme:e})=>e.breakpoints.values[jt]}px) {
|
|
53
|
+
.section__tag {
|
|
54
|
+
margin-bottom: 32px;
|
|
55
|
+
}
|
|
56
|
+
.section__title {
|
|
57
|
+
margin-bottom: 32px;
|
|
58
|
+
}
|
|
59
|
+
.section__description {
|
|
60
|
+
margin-bottom: 40px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;function q({title:e,description:t,descriptionMarkdown:n,actions:r,className:i="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:x,center:m,logo:h,titleAppearance:p,descriptionAppearance:b,...y}){const j=me.useColorConvert();if(!e&&!t&&!r&&!x&&!d&&!c&&!a&&!h)return null;const g=Math.max(Math.min(5,l+1),1),v={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},S=l===0?"big":`h${g}`,_=l===0;return o.jsxs(vt,{className:w.cx("base-info","lg:text-left",m&&"!text-center",i),...y,children:[c&&o.jsx("div",{children:c}),(d||x)&&o.jsx("div",{className:w.cx("section__tag",s?.tag||s?.badge),children:d||x}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),e&&o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",mb:t?"2vw":0,...p?.color&&{color:`${j(p.color)} !important`}},className:w.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",_?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:S,children:e}),t&&(n?o.jsx(u.Box,{sx:{...b?.color&&{color:`${j(b.color)} !important`}},className:w.cx("section__description","text-gray-800","dark:text-gray-100",v[g],s.description,"page-kit-section__description"),children:o.jsx(it.default,{codeOptions:{showActionButton:!1,theme:Fe.materialDark},children:t})}):o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",...b?.color&&{color:`${j(b.color)} !important`}},className:w.cx("section__description","text-gray-800","dark:text-gray-100",v[g],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:t})),o.jsx(R,{actions:r,center:m,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const L=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function ye(e){if(e.type===f.Fragment){const n=(e.props.children||[]).filter(r=>f.isValidElement(r));return n.length===1?ye(n[0]):n.length>1}return Array.isArray(e)}const I="&>*";function ee({children:e,col:t,gap:n,className:r,align:i,sx:s,type:c,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=$.useTheme(),d=Number(Math.floor(100/t*100)/100),x={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},m=x[i]||x.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[t]||0);ye(e)||(p=0);const y=(t-1)*p/t;let j={...s,gap:`${p}rem`};const g={[I]:{width:"100%"}},v={},S={},_={};switch(g.gap="1rem",v.gap=`${p/2}rem`,t){case 3:case 4:v[I]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:g[I]={width:`calc(50% - ${p/2/2}rem)`},v[I]={width:`calc(50% - ${p/2/2}rem)`},S[I]={width:`calc(33.33% - ${p*2/3}rem)`};break}return j[I]={width:`calc(${d}% - ${y}rem)`},j[`@media (max-width: ${l.breakpoints.values.xl}px)`]=_,j[`@media (max-width: ${l.breakpoints.values.lg}px)`]=S,j[`@media (max-width: ${l.breakpoints.values.md}px)`]=v,j[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g,c==="wall"&&(j={...s,gap:`${p}rem`},j[I]={width:`calc(${d}% - ${y}rem)`},g[I]={width:`calc(45% - ${p/2/2}rem)`},j[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g),o.jsx(u.Box,{className:w.cx("flex flex-wrap flex-row h-full",m,r),sx:j,...a,children:e})}function kt(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}function _t(e=""){if(e.startsWith("data:image/svg+xml,"))return!0;const t=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return t.test(e)||n.test(e)}function z(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")||e?.endsWith(".webm")}function $t(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")?"video/mp4":e?.endsWith(".webm")?"video/webm":void 0}function St(e){let t={};return typeof e=="string"?ne.isGradient(e)?t.image=e:(t.image=k.getImageAbsoluteUrl(e),ne.isColorString(e)&&(t.color=e,t.image="")):t=e,t}function Bt(){const[e,t]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{t(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),e}function se(e,t,n,r,i){let s=null;const{color:c="",image:a}=St(t);if(a&&_t(a)){delete n.backgroundColor;const l=!(e.mobile.apple.device||kt())&&z(a),d=z(a)&&r?k.autoResizeImage(k.getImageAbsoluteUrl(r),1200,"quality"):"";l?s=o.jsx(u.Box,{component:"video",className:"section-bg",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:d,src:z(a)?a:k.autoResizeImage(a,1200,"quality"),sx:{width:"100%",position:"absolute",zIndex:-9999,right:0,left:0,top:0,height:"100%",objectFit:"cover"}},a):s=o.jsx(Q.ResponsiveImage,{src:z(a)&&r?d:a,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},i||a)}else a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`);return s}function Ct({autoWidth:e,children:t,...n}){return e?o.jsx(u.Box,{...n,sx:[{display:"flex"},...Array.isArray(n.sx)?n.sx:[n.sx]],children:t}):o.jsx(u.Container,{...n,children:t})}function O({dark:e=!1,children:t,className:n,sx:r={},boxed:i={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...r},x=pe.default(p=>p.breakpoints.down("md"));e&&(d.color=ie.default.common.white,d.backgroundColor=`${ie.default.grey[900]} !important`),i.show&&(d.display="flex");const m=f.useMemo(()=>!Number(l.boxMaxWidth)||x?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,x,a]),h=ge({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Nt,{component:"section",styles:{...d,...h},className:w.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:e}),...N.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Ct,{autoWidth:l?.autoWidth,className:w.cx("section-content h-full"),sx:m,children:i.show?o.jsx(be,{...c,boxed:i,children:t}):t})})}function be({background:e="",backgroundVideoPoster:t,children:n,sx:r={},boxed:i={show:!1},className:s="",styles:c={},...a}){const l={...c,...r},d=me.useColorConvert();let x=null;const m=pe.default(b=>b.breakpoints.up("sm")),h=st.default(),p=Bt();return e&&(x=se(h,typeof e=="string"?d(e):e,l,t,p)),i.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=m?"50px":"20px"),i?.border&&(l.border="1px solid #c0c0c0"),i?.background&&(x=se(h,typeof i?.background=="string"?d(i?.background):i?.background,l,i?.backgroundVideoPoster,p))),o.jsxs(u.Box,{...a,sx:{...l,...x?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:w.cx(s,i?.boxShadow&&"shadow-xl"),children:[x,n]})}const Nt=$.styled(be)`
|
|
64
|
+
&:nth-of-type(even) {
|
|
65
|
+
background: #f8f8f8;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media (max-width: 600px) {
|
|
69
|
+
.section__title {
|
|
70
|
+
font-size: 24px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.base-info {
|
|
74
|
+
> *:last-child {
|
|
75
|
+
margin-bottom: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;function we({icon:e,...t}){return o.jsx(xe.Icon,{icon:e,...t,ref:null})}function C(e,t){const n=J.default(e,t),r=N.default(e,t);return[n,r]}const je=["title","description","actions","badge","tag","prepend","append","logo"];function It({image:e,imageBorder:t,imageShadow:n,className:r,reverse:i=!1,fullSizeImage:s,...c}){const[a,l]=C(c,L),d=Object.keys(a).length>0&&Object.values(J.default(a,je)).filter(Boolean).length>0&&o.jsx(q,{...a}),x=f.isValidElement(e)?e:o.jsx(u.Box,{component:"img",src:e,alt:"",className:"block"}),m=["phone","macbook"].includes(t),h=e&&o.jsx(u.Box,{className:w.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a?.center?"flex justify-center items-center":""),sx:{border:t===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":m?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:m?o.jsx(at.default,{type:t,sx:{width:"100%"},children:x}):x});return o.jsx(O,{className:w.cx("section--block",r,s&&!i&&w.css`
|
|
80
|
+
.section-bg {
|
|
81
|
+
height: 80%;
|
|
82
|
+
}
|
|
83
|
+
`),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(ee,{col:e?2:1,className:s?w.css`
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
|
|
87
|
+
> .base-info,
|
|
88
|
+
> .section__image {
|
|
89
|
+
width: 100%;
|
|
90
|
+
|
|
91
|
+
> img,
|
|
92
|
+
> video {
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`:void 0,children:i?o.jsxs(o.Fragment,{children:[h,d]}):o.jsxs(o.Fragment,{children:[d,h]})})})}const U=["editing","height","locale","dev","sx"];function Mt(e){const{className:t,...n}=e;return o.jsx(Pt,{...n,className:w.cx("BlockBase-root",t)})}const Pt=$.styled(u.Box)`
|
|
97
|
+
position: relative;
|
|
98
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
99
|
+
`;function Rt({widget:e,reverse:t,projectId:n,assistantId:r,working:i,submitTitle:s,submitIcon:c,submitColor:a,placeholder:l,loadingIndicator:d,section:x,...m}){const[{editing:h},p]=C(m,U),[b,y]=C(p,L),j=n&&r?{projectId:n,gitRef:"main",assistantId:r,working:!0}:void 0,g={children:s,endIcon:c?o.jsx(we,{icon:c}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},v=[],S=l&&o.jsx(u.Typography,{variant:"caption",sx:{color:"text.disabled"},children:l}),_=d&&o.jsx(u.Typography,{variant:"caption",sx:{color:"text.disabled"},children:d});Object.keys(b).length>0&&Object.values(J.default(b,je)).filter(Boolean).length>0&&v.push(o.jsx(q,{...b},"base-info")),j&&(e==="form"?v.push(o.jsx(V.AIForm,{identifier:j,SubmitProps:g},"form")):e==="result"?v.push(o.jsx(V.AIFormResult,{identifier:j,placeholder:S,loadingIndicator:_},"result")):v.push(o.jsxs(u.Stack,{direction:"row",sx:{width:"100%",gap:2},children:[o.jsx(V.AIForm,{identifier:j,BoxProps:{flex:1},SubmitProps:g}),o.jsx(V.AIFormResult,{identifier:j,BoxProps:{flex:1},placeholder:S,loadingIndicator:_})]},"form-result"))),t&&v.reverse();const M=u.useTheme(),P=f.useMemo(()=>u.createTheme(Le.deepmerge(M,{palette:{primary:a?{main:a}:void 0}})),[a,M]);return o.jsx(Oe.ErrorBoundary,{fallbackRender:k.ErrorView,children:o.jsx(u.ThemeProvider,{theme:P,children:o.jsx(O,{...y,sx:h?{pointerEvents:"none"}:{},children:o.jsx(ee,{col:v.length,children:v})})})})}const ve=f.createContext({pages:[],project:void 0}),{Provider:Et,Consumer:Wo}=ve;function ke(){return f.useContext(ve)}function Wt({icon:e,className:t="",size:n="1rem",...r}){return o.jsx(Tt,{component:we,className:w.cx("css-icon",t),size:n,...r,icon:e})}const Tt=$.styled(u.Box)`
|
|
100
|
+
&.css-icon {
|
|
101
|
+
display: inline-block;
|
|
102
|
+
width: ${({size:e})=>e};
|
|
103
|
+
height: ${({size:e})=>e};
|
|
104
|
+
}
|
|
105
|
+
`;function zt({icon:e,className:t="",size:n="1rem",imageMeta:r,...i}){const s=k.autoResizeImage(k.getImageAbsoluteUrl(e),540),[c,a]=f.useState(!1),l=$.useTheme();return c?o.jsx(Wt,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:t,...i}):o.jsx(At,{className:w.cx("image-icon",t),size:n,...i,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:r?.naturalWidth,height:r?.naturalHeight,alt:r?.filename||"card-icon",loading:"lazy"})})}const At=$.styled(u.Box)`
|
|
106
|
+
display: inline-block;
|
|
107
|
+
width: ${({size:e})=>e};
|
|
108
|
+
height: ${({size:e})=>e};
|
|
109
|
+
.image-icon__image {
|
|
110
|
+
object-fit: contain;
|
|
111
|
+
height: 100%;
|
|
112
|
+
width: 100%;
|
|
113
|
+
}
|
|
114
|
+
`,te=e=>typeof e=="string"&&/^[\w-_]+:[\w-_]+$/.test(e);function X({icon:e,size:t="1rem",imageMeta:n,...r}){const i=window.isNaN(t)?t:`${t}px`;return te(e)?o.jsx(xe.Icon,{icon:e}):o.jsx(qt,{component:zt,imageMeta:n,className:"base-icon",icon:e,size:i,...r})}const qt=$.styled(u.Box)`
|
|
115
|
+
flex-shrink: 0;
|
|
116
|
+
`;function A({text:e,children:t,icon:n="",endIcon:r,color:i="primary",link:s="",href:c="",...a}){const l=n?o.jsx(X,{icon:n}):null,d=r?o.jsx(X,{icon:r}):null,x=s||c,m={...a};return x&&(m.href=x,K.default(x)&&(m.target=m.target||"_blank")),o.jsx(lt.default,{startIcon:l,endIcon:d,color:i,...m,children:e||t})}function _e({editing:e,text:t,...n}){const{pages:r=[]}=ke(),i=r.find(s=>s.id===(n.link||n.linkId));if(e)return o.jsx(A,{...N.default(n,["link","linkId"]),children:t});if(i){const s=i.path||"/";return o.jsx(Z.Link,{to:s,children:o.jsx(A,{...N.default(n,["link","linkId"]),children:t})})}return o.jsx(A,{...N.default(n,"linkId"),children:t})}function E({type:e="",icon:t="",size:n="3rem",className:r="",...i}){return o.jsx(X,{icon:t||e,size:n,className:w.cx("content-icon",r),...i,color:typeof i.color>"u"?"inherit":i.color})}function Lt({to:e,base:t,children:n,className:r,activeClassName:i="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:x=""}={},m=t?D.join("/",t):t||"";let h=s==="auto"?"_self":s,p=D.join(m,e);const b=c?K.default(p):!1;if(t)return p=D.join(m,x,e),o.jsx("a",{className:`no-underline ${r}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:n});if(K.default(e))s==="auto"&&(h="_blank"),p=e;else{T.isRelative(p)&&(p=D.join(window.location.pathname,p));const y=T.parseURL(`${window.location.origin}${p}`),j=d.some(g=>g.pathname===y.pathname);if(a||j)return o.jsx(Z.NavLink,{end:!0,to:T.withoutTrailingSlash(p),className:({isActive:g})=>w.cx(r,g?i:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${r}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[n,b&&o.jsx(E,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function F({prepend:e,append:t,children:n,className:r="",dark:i=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=ke(),d=l.find(h=>h.id===c.link),x=!n||rt.default.Children.toArray(n).every(h=>h===null);c.link&&(a={component:Lt,to:d?.path||c.link,useRouterLink:!0});const m=u.useTheme();return o.jsxs(Ot,{className:w.cx("base-card card",{dark:i,"border-transparent":!s},r),sx:{borderColor:m.palette.divider},...a,...N.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[e,!x&&o.jsx("div",{className:"card__body",children:n}),t]})}const Ot=$.styled(u.Box)`
|
|
117
|
+
&.base-card {
|
|
118
|
+
text-align: left;
|
|
119
|
+
border-width: 1px;
|
|
120
|
+
border-style: solid;
|
|
121
|
+
border-radius: 12px;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
&,
|
|
124
|
+
&:hover {
|
|
125
|
+
text-decoration: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
.card__body {
|
|
129
|
+
padding: 15px 15px;
|
|
130
|
+
}
|
|
131
|
+
`;function H({align:e="left",title:t,titleProps:n={},description:r,descriptionProps:i={}}){return o.jsxs(o.Fragment,{children:[t&&o.jsx(u.Typography,{className:w.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:e,...n,children:t}),r&&o.jsx(u.Typography,{className:w.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:e,...i,children:r})]})}function Ut({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...x}){const m=te(e),h=k.autoResizeImage(k.getImageAbsoluteUrl(e),540);return o.jsxs(Ft,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&e?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...r,alt:r.alt||i?.filename||"card-image",width:i?.naturalWidth,height:i?.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[t||n?o.jsx(H,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Ft=$.styled(F)`
|
|
132
|
+
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
133
|
+
&:hover {
|
|
134
|
+
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
135
|
+
}`:""}
|
|
136
|
+
|
|
137
|
+
.card__title {
|
|
138
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
139
|
+
a {
|
|
140
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.card__description {
|
|
144
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
145
|
+
a {
|
|
146
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.card__image__wrap {
|
|
151
|
+
padding-top: 61.8%;
|
|
152
|
+
width: 100%;
|
|
153
|
+
position: relative;
|
|
154
|
+
}
|
|
155
|
+
.card__image {
|
|
156
|
+
position: absolute;
|
|
157
|
+
top: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
bottom: 0;
|
|
160
|
+
right: 0;
|
|
161
|
+
width: 100%;
|
|
162
|
+
height: 100%;
|
|
163
|
+
object-position: top center;
|
|
164
|
+
}
|
|
165
|
+
`,ae="section";function le({title:e,image:t,imageMeta:n,description:r,actions:i,align:s,listType:c="",className:a="",...l}){return o.jsxs(Ht,{className:w.cx("card",`list-type-${c}`,a),align:s,...l,children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),e||r?o.jsx(H,{align:s,title:e,description:r}):null,i?.length?o.jsx(R,{align:s,actions:i,className:"mt-4"}):null]})}const Ht=$.styled(F)`
|
|
166
|
+
padding: 5vw 4vw;
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
/* min-height: 320px; */
|
|
169
|
+
color: inherit !important;
|
|
170
|
+
border-radius: 0.5rem;
|
|
171
|
+
/* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
|
|
172
|
+
@media (max-width: ${({theme:e})=>e.breakpoints.values[ae]}px) {
|
|
173
|
+
padding: 1.5rem 2rem;
|
|
174
|
+
}
|
|
175
|
+
@media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
|
|
176
|
+
height: auto;
|
|
177
|
+
min-height: unset;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
181
|
+
&:hover {
|
|
182
|
+
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
183
|
+
}`:""}
|
|
184
|
+
|
|
185
|
+
.card__title {
|
|
186
|
+
font-weight: 700;
|
|
187
|
+
margin-top: 24px;
|
|
188
|
+
margin-bottom: 12px;
|
|
189
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
190
|
+
a {
|
|
191
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.card__description {
|
|
195
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
196
|
+
a {
|
|
197
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
.card__body {
|
|
201
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
202
|
+
padding: 0;
|
|
203
|
+
${({align:e})=>`text-align:${e||"left"};`}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&.list-type-icon-title {
|
|
207
|
+
padding: 1.2rem;
|
|
208
|
+
.title-line {
|
|
209
|
+
display: flex;
|
|
210
|
+
}
|
|
211
|
+
.card__title {
|
|
212
|
+
margin: 0;
|
|
213
|
+
font-size: 1em;
|
|
214
|
+
}
|
|
215
|
+
.css-icon {
|
|
216
|
+
margin-right: 0.5rem;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@media (min-width: ${({theme:e})=>e.breakpoints.values[ae]}px) {
|
|
221
|
+
padding: 2rem 2rem;
|
|
222
|
+
text-align: left;
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
}
|
|
225
|
+
`;function Vt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...x}){const m=te(e),h=k.autoResizeImage(k.getImageAbsoluteUrl(e),540);return o.jsxs(Dt,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&e?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):h&&o.jsx(u.Box,{component:"img",className:"card__image",src:h,...r,alt:r.alt||i?.filename||"card-image",style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy",sx:[{width:i?.naturalWidth,height:i?.naturalHeight},...Array.isArray(r.sx)?r.sx:[r.sx]]})}),children:[t||n?o.jsx(H,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Dt=$.styled(F)`
|
|
226
|
+
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
227
|
+
&:hover {
|
|
228
|
+
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
229
|
+
}`:""}
|
|
230
|
+
|
|
231
|
+
border-radius: 0 !important;
|
|
232
|
+
|
|
233
|
+
.card__body {
|
|
234
|
+
${({align:e})=>`text-align:${e||"left"};`}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.card__image__wrap {
|
|
238
|
+
width: 100%;
|
|
239
|
+
height: 100%;
|
|
240
|
+
position: relative;
|
|
241
|
+
display: flex;
|
|
242
|
+
justify-content: center;
|
|
243
|
+
align-items: center;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.card__image {
|
|
247
|
+
max-height: 60px;
|
|
248
|
+
}
|
|
249
|
+
`,ce="section";function Yt({title:e,image:t,imageMeta:n,iconSize:r=100,description:i,actions:s,align:c,className:a="",...l}){return o.jsx(Jt,{className:w.cx("card",a),...l,children:o.jsxs(u.Box,{className:"flex items-center",children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:r,imageMeta:n}),o.jsxs(u.Box,{className:"flex-1 ml-4",children:[o.jsx(H,{align:c,title:e,description:i}),o.jsx(R,{align:c,actions:s,className:"mt-4"})]})]})})}const Jt=$.styled(F)`
|
|
250
|
+
padding: 5vw 4vw;
|
|
251
|
+
text-align: left;
|
|
252
|
+
box-sizing: border-box;
|
|
253
|
+
/* min-height: 320px; */
|
|
254
|
+
color: inherit !important;
|
|
255
|
+
border-radius: 0.5rem;
|
|
256
|
+
/* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
|
|
257
|
+
@media (max-width: ${({theme:e})=>e.breakpoints.values[ce]}px) {
|
|
258
|
+
padding: 1.5rem 2rem;
|
|
259
|
+
}
|
|
260
|
+
@media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
|
|
261
|
+
height: auto;
|
|
262
|
+
min-height: unset;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
266
|
+
&:hover {
|
|
267
|
+
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
268
|
+
}`:""}
|
|
269
|
+
|
|
270
|
+
.card__title {
|
|
271
|
+
font-weight: 700;
|
|
272
|
+
margin-bottom: 12px;
|
|
273
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
274
|
+
a {
|
|
275
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
.card__description {
|
|
279
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
280
|
+
a {
|
|
281
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
.card__body {
|
|
285
|
+
padding: 0;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&.list-type-icon-title {
|
|
289
|
+
padding: 1.2rem;
|
|
290
|
+
.title-line {
|
|
291
|
+
display: flex;
|
|
292
|
+
}
|
|
293
|
+
.card__title {
|
|
294
|
+
margin: 0;
|
|
295
|
+
font-size: 1em;
|
|
296
|
+
}
|
|
297
|
+
.css-icon {
|
|
298
|
+
margin-right: 0.5rem;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@media (min-width: ${({theme:e})=>e.breakpoints.values[ce]}px) {
|
|
303
|
+
padding: 2rem 2rem;
|
|
304
|
+
text-align: left;
|
|
305
|
+
box-sizing: border-box;
|
|
306
|
+
}
|
|
307
|
+
`;function Gt({title:e,titleProps:t={},description:n,descriptionProps:r={},image:i,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(Kt,{className:w.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[i&&o.jsx(E,{icon:i,color:"primary.main",imageMeta:s}),e||n?o.jsx(H,{align:a,title:e,titleProps:t,description:n,descriptionProps:r}):null]})}const Kt=$.styled(F)`
|
|
308
|
+
.card__title {
|
|
309
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
310
|
+
a {
|
|
311
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
.card__description {
|
|
315
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
316
|
+
a {
|
|
317
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
&.hover-style__default {
|
|
322
|
+
&.card-simple {
|
|
323
|
+
&:hover {
|
|
324
|
+
border-top-right-radius: 36px;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
.card__body {
|
|
328
|
+
&:hover {
|
|
329
|
+
&::before {
|
|
330
|
+
width: 42px;
|
|
331
|
+
height: 42px;
|
|
332
|
+
transform: translate(50%, -50%) rotate(45deg);
|
|
333
|
+
}
|
|
334
|
+
&::after {
|
|
335
|
+
transform: none;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
&.card-simple {
|
|
342
|
+
border-radius: 8px;
|
|
343
|
+
border-top-right-radius: 26px;
|
|
344
|
+
|
|
345
|
+
.card__body {
|
|
346
|
+
${({align:e})=>`text-align:${e||"left"};`}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
${e=>e.link?`
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
`:""}
|
|
352
|
+
/* cursor: pointer; */
|
|
353
|
+
/* &:hover {
|
|
354
|
+
border-top-right-radius: 36px;
|
|
355
|
+
} */
|
|
356
|
+
transition: all 180ms ease 0s;
|
|
357
|
+
overflow: visible;
|
|
358
|
+
.card__title {
|
|
359
|
+
margin: 12px 0;
|
|
360
|
+
}
|
|
361
|
+
.card__body {
|
|
362
|
+
position: relative;
|
|
363
|
+
padding: 20px 16px 18px;
|
|
364
|
+
overflow: hidden;
|
|
365
|
+
transition: all 180ms ease 0s;
|
|
366
|
+
/* &:hover {
|
|
367
|
+
&::before {
|
|
368
|
+
width: 42px;
|
|
369
|
+
height: 42px;
|
|
370
|
+
transform: translate(50%, -50%) rotate(45deg);
|
|
371
|
+
}
|
|
372
|
+
&::after {
|
|
373
|
+
transform: none;
|
|
374
|
+
}
|
|
375
|
+
} */
|
|
376
|
+
&::before,
|
|
377
|
+
&::after {
|
|
378
|
+
content: ${({border:e})=>e?'""':""};
|
|
379
|
+
transition: inherit;
|
|
380
|
+
position: absolute;
|
|
381
|
+
top: 0px;
|
|
382
|
+
right: 0px;
|
|
383
|
+
}
|
|
384
|
+
&::before {
|
|
385
|
+
z-index: 3;
|
|
386
|
+
background: #fff;
|
|
387
|
+
width: 30px;
|
|
388
|
+
height: 30px;
|
|
389
|
+
transform: translate(50%, -50%) rotate(45deg);
|
|
390
|
+
box-shadow: 0 1px 0 0 #e9eaec;
|
|
391
|
+
}
|
|
392
|
+
&::after {
|
|
393
|
+
z-index: 2;
|
|
394
|
+
width: 28px;
|
|
395
|
+
height: 28px;
|
|
396
|
+
border-bottom-left-radius: 6px;
|
|
397
|
+
background: #fcfcfd;
|
|
398
|
+
box-shadow: -1px 1px 0 0 #e9eaec;
|
|
399
|
+
transform: translate(8px, -8px);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
`;function Xt({type:e="default",...t}){const r={article:Ut,simple:Gt,news:Yt,default:le,wall:Vt}[e]||le;return o.jsx(r,{...e==="news"?t:N.default(t,"iconSize")})}function Qt({list:e=[],align:t="top",cards:n,listBorder:r=!0,listType:i="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:x=!1,textAlign:m="left",hoverStyle:h,...p}){return o.jsx(ee,{type:d,className:w.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:t,...p,children:n||e.map(b=>o.jsx(Xt,{borderColor:r,iconColor:a,type:d,listType:i,dark:x,...b,align:m,style:c===0&&e.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},b.id))})}const Zt=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],eo=$.styled(O)`
|
|
404
|
+
a .card {
|
|
405
|
+
color: #404040;
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
}
|
|
408
|
+
a:not(.MuiButton-root) {
|
|
409
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
410
|
+
&:hover,
|
|
411
|
+
&:active {
|
|
412
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
a:hover .card {
|
|
416
|
+
color: #404040;
|
|
417
|
+
}
|
|
418
|
+
`;function to({className:e,...t}){const[n,r]=C(t,L),[i,s]=C(r,Zt);return o.jsxs(eo,{className:w.cx("section--card-list",e),type:t.type,...s,children:[Object.keys(n).length>0&&o.jsx(q,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(Qt,{...i,dark:!!t.dark})]})}const oo=$.styled(to)`
|
|
419
|
+
.card__description {
|
|
420
|
+
white-space: pre-wrap;
|
|
421
|
+
}
|
|
422
|
+
.section__description {
|
|
423
|
+
}
|
|
424
|
+
.card {
|
|
425
|
+
/* background: inherit !important; */
|
|
426
|
+
}
|
|
427
|
+
&.dark .card-simple .card__body::before {
|
|
428
|
+
background: #212121 !important;
|
|
429
|
+
}
|
|
430
|
+
.card-simple .card__body::after {
|
|
431
|
+
background: inherit !important;
|
|
432
|
+
}
|
|
433
|
+
`;function no({section:e,...t}){const[{editing:n},r]=C(t,U),i=f.useMemo(()=>({...N.default(r,["listBorder","list","iconSize","imageSize"]),list:r.list?.map(s=>({...N.default(s,"icon","iconColor"),image:["news","simple","default"].includes(r.type)&&s.icon?s.icon:s.image,actions:s.actions?.map?.(c=>o.jsx(_e,{...c,editing:n},c.id)),border:r.listBorder,iconSize:r.iconSize,imageSize:r.imageSize,hoverStyle:r.hoverStyle}))}),[r]);return o.jsx(oo,{style:n?{pointerEvents:"none"}:{},...i})}function ro({properties:e,section:t,locale:n,dev:r}){return t?.config?.componentId?o.jsx(Q.CustomComponentRenderer,{instanceId:t.id,componentId:t.config.componentId,blockletId:t.config.blockletId,blockletTitle:t.config.blockletTitle,componentName:t.config.componentName,locale:n,properties:e,dev:r}):o.jsx(u.Box,{sx:{textAlign:"center",py:2},children:o.jsx(u.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Please select component to render"})})}function io({src:e,dataId:t,isEdit:n=!1,height:r="100%",onLoad:i=()=>{}}){return o.jsx(et.EmbedIframe,{isEdit:n,embedId:t,src:e,height:r,onLoad:()=>{i()}})}function so({dataId:e,src:t,actions:n,center:r,onLoad:i,...s}){const[c,a]=C(s,L);return o.jsxs(O,{...a,children:[Object.keys(c).length>0&&o.jsx(q,{center:r,...c}),o.jsx(io,{dataId:e,src:t,onLoad:i,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:r})]})}const ao={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function lo({section:e,id:t,src:n,...r}){const i=`${t}-${r.locale}`,[{editing:s},c]=C(r,U),a=f.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Xe.useMessage(i,"server"),x=Qe.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return f.useEffect(()=>{d&&d.onInit(()=>x.current)},[d]),f.useEffect(()=>{const m=JSON.parse(JSON.stringify(c.config)||"{}");ct.default(a.current,m)||(a.current=m,d?.send("config-set",m))},[d,c.config]),n?o.jsx(so,{...l,dataId:i,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(co,{children:'Please set the "src" attribute for this block'})}const co=$.styled("div")`
|
|
434
|
+
user-select: none;
|
|
435
|
+
color: #999;
|
|
436
|
+
padding: 8px;
|
|
437
|
+
height: 200px;
|
|
438
|
+
`,uo=12,mo=({gridSettings:e,section:t,index:n,columns:r,simulateMode:i="desktop",isBackground:s})=>{const c=e?.[i]??{},a=c[t.id],l=xo(c);return{i:t.id,static:t?.locked||s,...s?{x:0,y:0,w:r,h:1,isResizable:!1}:{x:a?.x??0,y:a?.y??n,w:a?.w??r,h:a?.h??1,isResizable:!0},minH:1,maxH:1,maxY:l}},xo=e=>Object.values(e).reduce((t,n)=>Math.max(t,n.y||0),0)||0,po=e=>{const{dev:t,id:n,section:r,onBlockRender:i}=e,s=t?.mode,c=u.useMediaQuery(g=>g.breakpoints.down("sm")),{t:a}=tt.useLocaleContext(),{sections:l,sectionIds:d,config:x}=r,{columns:m=uo,gridSettings:h}=x||{},p=f.useCallback((g,v=!1,S=0)=>{if(!i||!g||!g.component||g.visibility==="hidden")return null;const _=mo({gridSettings:h,section:g,index:S,columns:m,simulateMode:c?"mobile":"desktop",isBackground:v}),M=_?.x??0,P=_?.y??0,W=_?.w??m,Se=_?.h??1,Be=_?.maxY??0,Ce=!!r?.config?.backgroundSectionId;return o.jsx(u.Box,{className:v?"layout-block-background":"layout-block-section",sx:{...v?{gridColumn:"1 / -1",gridRow:`1 / ${Be+1}`,zIndex:0,width:"100%",height:"100%","& .BlockBase-root":{width:"100%",height:"100%"}}:{position:"relative",gridColumn:`${M+1} / span ${W}`,gridRow:`${P+(Ce?0:1)} / span ${Se}`,zIndex:1}},children:i({id:g.id,type:g.component,config:{},section:{...g},mode:s})},g.id)},[n,s,i,h,m,c]),{backgroundElements:b,contentElements:y}=f.useMemo(()=>{if(!d||!d.length||!l||!Object.keys(l).length)return{backgroundElements:[],contentElements:[]};const g=[],v=[];return d?.forEach((S,_)=>{const M=l[S];if(!M)return;const P=r?.config?.backgroundSectionId===S,W=p(M,P,_);W&&(P?g.push(W):v.push(W))}),{backgroundElements:g,contentElements:v}},[p,l,d]);return s==="draft"&&!b?.length&&!y?.length?o.jsxs(u.Box,{sx:{gridColumn:"1 / -1",gridRow:"1",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,border:g=>`2px dashed ${g.palette.divider}`,borderRadius:2,padding:4,color:"text.secondary",textAlign:"center",minHeight:"160px"},children:[o.jsx(u.Box,{sx:{fontSize:"48px",opacity:.5},children:"📐"}),o.jsx(u.Box,{sx:{fontSize:"16px",fontWeight:500,marginBottom:1},children:"Section Layout"}),o.jsx(u.Box,{sx:{opacity:.7,whiteSpace:"pre-line"},children:a("maker.layoutBlock.draftPlaceholder")}),o.jsx(u.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:.1,background:g=>`
|
|
439
|
+
repeating-linear-gradient(
|
|
440
|
+
90deg,
|
|
441
|
+
transparent,
|
|
442
|
+
transparent calc(100% / ${m} - 1px),
|
|
443
|
+
${g.palette.grey[400]} calc(100% / ${m} - 1px),
|
|
444
|
+
${g.palette.grey[400]} calc(100% / ${m})
|
|
445
|
+
)
|
|
446
|
+
`}})]}):o.jsxs(u.Box,{sx:{position:"relative",display:"grid",gridTemplateColumns:`repeat(${m}, 1fr)`,alignItems:"center",width:"100%",height:"100%"},children:[b,y]})},ho=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function go(e){if(/youtu\.?be/.test(e))for(const t of ho){const n=t.exec(e)?.[1];if(n)return n}}function fo(e){const t=go(e);if(t)return`https://youtube.com/embed/${t}`}function yo({src:e}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:e})}function bo(e){return o.jsx(u.Box,{sx:{maxHeight:400,overflow:"hidden auto"},children:o.jsx(ot.TwitterTimelineEmbed,{...e})})}function wo({url:e}){const t=f.useRef(null),n=495,[r,i]=f.useState(t.current?t.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[r,s]),o.jsx(u.Box,{component:"iframe",ref:t,title:"youtube",src:e,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{width:"100%",height:`${r}px`,display:"block"}})}const jo={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},vo=$.styled(It)`
|
|
447
|
+
.section__description {
|
|
448
|
+
}
|
|
449
|
+
`;function ko({hasImage:e,fullSizeImage:t,boxed:n,videoPoster:r,imageMeta:i,imageOptimization:s,imageSize:c,section:a,...l}){const[{editing:d},x]=C({...l,boxed:t?void 0:n},U);let m=_o(x.image,r,t,i,s,c);e||(m=null);let h=null;return x.actions&&(h=x.actions?.map?.((p,b)=>o.jsx(_e,{...p,editing:d},b))),o.jsx(vo,{...x,style:d?{pointerEvents:"none"}:{},image:m,fullSizeImage:e&&t,actions:h})}function _o(e,t,n,r,i,s){if(e){if(e.endsWith(".json"))return o.jsx(yo,{src:e});if(e.indexOf("twitter.com")!==-1)return o.jsx(bo,{sourceType:"url",url:e});const c=fo(e);if(c)return o.jsx(wo,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=r||{};if(z(e))return o.jsx("video",{width:a&&`${a}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:s||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:k.autoResizeImage(k.getImageAbsoluteUrl(t),n?1200:540,i),children:o.jsx("source",{src:k.getImageAbsoluteUrl(e),type:$t(e)})},e);const x=i==="quality"?1:.6;return o.jsx(Q.ResponsiveImage,{src:k.getImageAbsoluteUrl(e),sizesAttr:{sm:600*x,md:450*x,lg:540*x,...n&&{md:900*x,lg:1200*x}},width:a&&`${a}px`,height:l&&`${l}px`,alt:d??e,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const $o=["production","draft"];function So({mode:e,version:t}={}){const n=t&&typeof t=="number"?{mode:e,version:t}:{mode:e};return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(r=>r.data)}function Bo({mode:e,routes:t}){return k.api.post(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:e,routes:t}).then(n=>n.data)}function Co({locale:e,sort:t,page:n,limit:r,mode:i}={}){return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:e,sort:t,page:n,limit:r,mode:i}}).then(s=>s.data)}const No={style:"list",sort:"-updatedAt"},de=20;function Io({style:e,sort:t,section:n,...r}){const[{editing:i,locale:s},c]=C(r,U),[a,l]=C(c,L),[d,x]=f.useState(),m=f.useRef(!1),h=re.useUpdate(),p=Z.useNavigate(),b=f.useCallback(async()=>{if(!m.current){m.current=!0,h();try{const y=d?Math.floor(d.list.length/de)+1:1,{list:j,total:g}=await Co({locale:s,sort:t,page:y,limit:de});x(v=>({list:(v?.list??[]).concat(j),total:g}))}finally{m.current=!1,h()}}},[d,s,t,h]);return re.useMount(()=>{b()}),o.jsxs(O,{...l,sx:i?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(q,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(u.Grid,{container:!0,spacing:2,sx:{justifyContent:"center"},children:d?.list.map(y=>o.jsx(u.Grid,{size:{xs:12,sm:e==="card"?6:12,md:e==="card"?3:12},children:o.jsxs(Mo,{elevation:0,className:w.cx(e==="card"&&"style-card"),onClick:i?void 0:()=>p(y.slug),children:[!!y.image&&o.jsx(u.CardMedia,{component:"img",alt:"",image:k.autoResizeImage(k.getImageAbsoluteUrl(y.image),540),loading:"lazy"}),o.jsxs(u.CardContent,{children:[o.jsx(u.Typography,{variant:"h6",component:"div",className:ue,children:y.title||y.id}),o.jsx(u.Typography,{variant:"body2",className:ue,children:y.description})]})]})},y.id))}),o.jsx(u.Box,{sx:{textAlign:"center",mt:2},children:d.total>d.list.length?o.jsx(A,{variant:"outlined",color:"secondary",onClick:b,loading:m.current,children:"More"}):o.jsx(A,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(u.Box,{sx:{p:2,textAlign:"center"},children:o.jsx(u.CircularProgress,{size:24})})]})}const ue=w.css`
|
|
450
|
+
display: -webkit-box;
|
|
451
|
+
-webkit-box-orient: vertical;
|
|
452
|
+
-webkit-line-clamp: 2;
|
|
453
|
+
overflow: hidden;
|
|
454
|
+
text-overflow: ellipsis;
|
|
455
|
+
`,Mo=$.styled(u.Card)`
|
|
456
|
+
border: 1px solid #e0e0e0;
|
|
457
|
+
background-color: transparent;
|
|
458
|
+
cursor: pointer;
|
|
459
|
+
display: flex;
|
|
460
|
+
color: inherit;
|
|
461
|
+
|
|
462
|
+
> .MuiCardMedia-root {
|
|
463
|
+
width: 30vw;
|
|
464
|
+
max-height: 50vw;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
&.style-card {
|
|
468
|
+
display: block;
|
|
469
|
+
|
|
470
|
+
> .MuiCardMedia-root {
|
|
471
|
+
width: 100%;
|
|
472
|
+
max-height: 50vw;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
`,Po={iframe:lo,section:ko,"section-card-list":no,toc:Io,"ai-runtime":Rt,"custom-component":ro,"layout-block":po};function $e({id:e,type:t,mode:n,config:r,section:i,ignorePageMetaStyle:s,page:c,...a}){const l=Po[t],{getPageMetaStyle:d}=bt(),x=f.useMemo(()=>{const{height:p,...b}=r;return t==="layout-block"&&(b.onBlockRender=y=>{const j={...r?.dev,...y?.config?.dev},{defaultLocale:g}=j,v={...J.default(r,["locale","editing"]),...y?.config,dev:j},{locale:S}=v;let _=c?.dataSource?.[y?.id]?.[S];return nt.default(_)&&(_=c?.dataSource?.[y?.id]?.[g??"en"]),o.jsx($e,{...y,config:{...y?.section?.properties,..._,...v},page:c,ignorePageMetaStyle:!0})}),b},[r,t]),m=f.useMemo(()=>{const p={};return t!=="custom-component"&&(p.height=r.height),p.sx=s?void 0:d("sx"),p.id=`BlockBase-${e}`,p},[r.height,s,t,d]),h=l&&o.jsx(l,{mode:n,...x,id:e,section:i});return h?o.jsx(Mt,{...a,...m,children:h}):o.jsx(Ro,{type:t})}function Ro({type:e}){return o.jsx(u.Box,{sx:{p:2},children:o.jsxs(u.Alert,{icon:o.jsx(Te.ErrorOutline,{}),color:"error",children:["Unsupported Block `",e,"`"]})})}exports.BlockRenderer=$e;exports.IFrameBlockDefaultProps=ao;exports.PageProvider=wt;exports.Provider=Et;exports.STATE_MODES=$o;exports.SectionBlockDefaultProps=jo;exports.TocDefaultProps=No;exports.getPages=So;exports.publishPages=Bo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./state-B6BF5wJ-.js"),q=require("@arcblock/ux/lib/Locale/context"),Y=require("@arcblock/ux/lib/Toast"),Z=require("@blocklet/pages-kit/utils/route"),C=require("@mui/icons-material"),F=require("@mui/lab"),s=require("@mui/material"),ee=require("immer"),te=require("lodash/difference"),a=require("react"),se=require("react-use"),ne=require("./home-BYk01EUy.js"),H=require("./index-BRgYwvuv.js"),J=o=>o&&o.__esModule?o:{default:o},z=J(Y),V=J(te);function ie(o){const[x,g]=a.useState(!1);return e.jsx(F.LoadingButton,{...o,loading:o.loading||x,onClick:c=>{const m=o.onClick?.(c);m instanceof Promise&&(g(!0),m.finally(()=>{g(!1)}))}})}const oe=s.createSvgIcon(e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M7.75732 16.2426L16.2426 7.75736",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16.2426 16.2426L7.75732 7.75735",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Close");function re(){const[o,x]=a.useState(),g=a.useMemo(()=>o?e.jsx(s.Dialog,{...o}):null,[o]),c=a.useCallback(()=>{x(void 0)},[]),m=a.useCallback(({title:b,content:d,cancelText:P="Cancel",okText:f="Ok",onOk:y,onClose:u,okIcon:L,okColor:k="primary",cancelColor:h="primary",DialogContentProps:v,form:R,...I})=>{x({...I,open:!0,children:e.jsxs("form",{onSubmit:B=>B.preventDefault(),children:[b&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:B=>`1px solid ${B.palette.divider}`},children:[e.jsx(s.Box,{children:b}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{c(),u?.()},children:e.jsx(oe,{})})]}),d&&e.jsx(s.DialogContent,{...v,sx:{mt:-3,...v?.sx,bgcolor:"background.paper"},children:e.jsx(s.Box,{sx:{pt:3},children:d})}),e.jsxs(s.DialogActions,{sx:{bgcolor:"background.paper"},children:[e.jsx(s.Button,{variant:"outlined",color:h||"primary",onClick:u??c,children:P}),e.jsx(ie,{variant:"contained",color:k||"primary",startIcon:L,loadingPosition:L?"start":"center",onClick:async()=>{await y?.(),c()},type:"submit",children:f})]})]}),onClose:u??c})},[c]);return{dialog:g,showDialog:m,closeDialog:c}}const ae=({ref:o,mode:x,state:g})=>{const{t:c}=q.useLocaleContext(),[m,b]=a.useState(!1),{dialog:d,showDialog:P}=re(),f=N.useProjectId(),y=a.useCallback(L=>{let k=[];P({title:c("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(C.Warning,{}),children:c("maker.publishToProductionTip")}),e.jsx(s.Box,{sx:{maxHeight:"50vh",overflow:"auto",mt:2},children:e.jsx(ce,{state:g,toMode:x,onChange:h=>k=h,defaultRouteIds:L})})]}),okText:c("maker.publish"),cancelText:c("common.cancel"),onOk:async()=>{if(k?.length===0){const h=c("maker.publishSelectPagesMessage");throw z.default.error(h),new Error(h)}localStorage.setItem(N.getProjectPageVersionKey(f??""),String(new Date().getTime())),b(!0);try{await H.publishPages({mode:x,routes:k}),z.default.success(c("maker.publishSuccessMessage"))}catch(h){throw z.default.error(h.message),h}finally{b(!1)}}})},[x,g,c,f,P]);a.useImperativeHandle(o,()=>({openPublishDialog:y}));const u=a.useCallback(()=>{y()},[y]);return e.jsxs(e.Fragment,{children:[e.jsx(F.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:u,loading:m,disabled:m,children:c("maker.publish")}),d]})};function le({routePathInfo:o,checked:x,onClick:g,route:c}){const{t:m}=q.useLocaleContext(),b=!o.routeMetaData?.publishedAt||o.routeMetaData?.updatedAt&&new Date(o.routeMetaData?.updatedAt)>new Date(o.routeMetaData?.publishedAt);return e.jsx(s.ListItem,{sx:{pl:4,pr:3},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",minWidth:"auto"},children:[b&&e.jsx(s.Box,{className:"visible",title:m("maker.pages.needPublish"),sx:{mr:.35,color:"warning.main",display:"flex",alignItems:"center"},children:e.jsx(s.Tooltip,{title:m("maker.pages.needPublish"),children:e.jsx(C.Sync,{fontSize:"small",sx:{fontSize:"16px"}})})}),(!o.routeMetaData?.isPublic||!c.isPublic)&&e.jsx(s.Box,{className:"visible",sx:{color:"warning.main"},children:e.jsx(s.Tooltip,{title:m("maker.pages.notPublic"),children:e.jsx(C.VisibilityOff,{fontSize:"small",sx:{fontSize:"16px"}})})})]}),children:e.jsxs(s.ListItemButton,{onClick:g,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:x,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:o.path,slotProps:{primary:{fontSize:"0.8rem",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pr:1}}})]})})}function ce({state:o,toMode:x,onChange:g,defaultRouteIds:c}){const{t:m,locale:b}=q.useLocaleContext(),[d,P]=a.useState(!1),[f,y]=a.useState(()=>c?Object.fromEntries(c.filter(t=>!t.includes("-")).map(t=>[t,!0])):{}),[u,L]=a.useState({}),[k,h]=a.useState(()=>c?Object.fromEntries(c.filter(t=>t.includes("-")).map(t=>[t,!0])):{}),[v,R]=a.useState({}),{loading:I,error:B,value:w}=se.useAsync(()=>H.getPages({mode:x}),[x]);if(B)throw B;const j=a.useMemo(()=>o.routeIds||[],[o]),M=a.useMemo(()=>w?.pageIds||[],[w]),D=a.useMemo(()=>!j||!o.routes?[]:JSON.parse(JSON.stringify(j)).sort((n,i)=>{const r=o.routes?.[n],l=o.routes?.[i];return r?.publishedAt&&new Date(r.publishedAt).getTime()<new Date(r.updatedAt).getTime()?-1:l?.publishedAt&&new Date(l.publishedAt).getTime()<new Date(l.updatedAt).getTime()?1:new Date(r?.updatedAt??"").getTime()-new Date(l?.updatedAt??"").getTime()}),[o,j]),E=a.useMemo(()=>{if(!D)return[];if(!u)return D;const t=[...D].filter(n=>!u[n]);return Object.values(u).forEach(n=>{n.forEach(i=>{t.push(`${i.originalRouteId}-${i.paramOptionIds.join("-")}`)})}),t},[D,u]),O=a.useMemo(()=>!w||!M||!E?[]:V.default(M,E),[E,w,M]),T=a.useMemo(()=>j?[...j].concat(O):O,[j,O]),$=a.useCallback(()=>{const t={};D?.forEach(n=>{const i=o.routes?.[n];if(i&&i.params&&i.params.length>0&&i.paramsOptions&&i.paramsOptions.length>0){const r=Z.generateParamCombinations({basePath:i.path,params:i.params,routeId:i.id,paramsOptions:i.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});r.length>0&&(t[i.id]=r)}}),L(t)},[D,o.routes]);a.useEffect(()=>{$()},[$]),a.useEffect(()=>{R(t=>{const n={...t};return Object.keys(u).forEach(i=>{u[i]&&u[i]?.length>0&&n[i]===void 0&&(n[i]=!0)}),n})},[u]);const W=a.useRef(!0);a.useEffect(()=>{h(t=>{const n={...t};return Object.keys(u).length===0||(Object.keys(u).forEach(i=>{const r=u[i]||[],l=d||!!f[i];r.forEach(A=>{const p=`${i}-${A.paramOptionIds.join("-")}`;W.current?n[p]=l||t[p]||!1:n[p]=l})}),W.current=!1),n})},[f,u,d]);const U=(t,n)=>{n.stopPropagation(),R(i=>{const r={...i};return r[t]=!r[t],r})},_=a.useCallback(t=>{y(n=>{const i=ee.produce(n,r=>{d?(Object.assign(r,Object.fromEntries(T.map(l=>[l,!0]))),delete r[t]):r[t]?(delete r[t],O.includes(t)&&(j||[]).filter(l=>o.pages[l]?.slug===w?.pages[t]?.slug).forEach(l=>{delete r[l]})):(r[t]=!0,j&&j.includes(t)&&O.filter(l=>w?.pages[l]?.slug===o.pages[t]?.slug).forEach(l=>{r[l]=!0}))});return P(V.default(T,Object.keys(i)).length===0),i})},[d,T,O,o,w,j]),G=a.useCallback((t,n)=>{const i=`${t}-${n.paramOptionIds.join("-")}`;h(r=>{const l={...r};l[i]=!l[i];const A=u[t]?.every(p=>l[`${t}-${p.paramOptionIds.join("-")}`])??!1;return y(p=>{if(A&&!p[t])return{...p,[t]:!0};if(!A&&p[t]){const S={...p};return delete S[t],S}return p}),l})},[u]),Q=a.useCallback(()=>{P(t=>(t&&y({}),!t))},[]);return a.useEffect(()=>{const t=d?T:Object.keys(f),n=Object.entries(k).filter(([,r])=>r).map(([r])=>r).filter(r=>r!==void 0),i=Array.from(new Set([...t,...n]));g(d?null:i)},[d,f,k,T,g]),I?e.jsx(ne.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:700},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:Q,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:m("common.all")})]})}),D.map(t=>{const n=o.routes?.[t];if(!n)return null;const i=!1,r=u&&u[t]&&u[t]?.length>0,l=v[t]!==!1,A=u[t]||[],p=!n.publishedAt||n.updatedAt&&new Date(n.updatedAt).getTime()>new Date(n.publishedAt).getTime();return e.jsxs(s.Box,{children:[e.jsx(s.ListItem,{sx:{pr:4},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{sx:{display:"flex",alignItems:"center"},children:[p&&e.jsx(s.Tooltip,{title:m("maker.pages.needPublish"),children:e.jsx(C.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!n.isPublic&&e.jsx(s.Tooltip,{title:m("maker.pages.notPublic"),children:e.jsx(C.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),i,r&&e.jsx(s.Box,{onClick:S=>U(t,S),sx:{display:"inline-flex",alignItems:"center",mr:.35,cursor:"pointer",color:"info.main"},children:l?e.jsx(C.KeyboardArrowDown,{fontSize:"small",sx:{fontSize:"18px"}}):e.jsx(C.KeyboardArrowRight,{fontSize:"small",sx:{fontSize:"18px"}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>_(t),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d||!!f[t],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:n.path,slotProps:{primary:{noWrap:!0,textOverflow:"ellipsis"},secondary:{noWrap:!0,textOverflow:"ellipsis"}}})]})}),r&&e.jsx(s.Collapse,{in:l,children:e.jsx(s.Box,{children:A.map(S=>{const K=`${t}-${S.paramOptionIds.join("-")}`,X=k[K]||!1;return e.jsx(le,{routePathInfo:S,checked:d||X,onClick:()=>G(t,S),route:n},K)})})})]},t)}),O.map(t=>{const n=w?.pages[t];return n?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>_(t),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d||!!f[t],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:n.slug,secondary:n.locales?.[b]?.title,slotProps:{primary:{noWrap:!0,textOverflow:"ellipsis"},secondary:{noWrap:!0,textOverflow:"ellipsis"}}})]})},t):null})]})}exports.default=ae;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("@arcblock/did-connect/lib/Session"),i=require("react"),{SessionProvider:r,SessionContext:u,SessionConsumer:S,withSession:a}=o.createAuthServiceSessionContext();function n(){return i.useContext(u)}function c(...e){const{session:s}=n();return e.includes(s.user?.role)}function l(...e){const{session:s}=n(),t=c(...e);return window.blocklet?.tenantMode==="multiple"?!!s.user:t}exports.SessionProvider=r;exports.useIsRoleOrMultiTenant=l;exports.useSessionContext=n;
|