@blocklet/pages-kit-inner-components 0.6.20 → 0.6.21
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 +1 -1
- package/lib/cjs/chunks/{home-D6CNLMDa.js → home-DexBPRep.js} +2 -2
- package/lib/cjs/chunks/{index-D3fT0ax0.js → index-DmCIlIe9.js} +26 -26
- package/lib/cjs/chunks/{publish-button-FsuH_RMC.js → publish-button-WHYISygD.js} +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/es/add-component.js +1 -1
- package/lib/es/chunks/{home-Dmze9ay0.js → home-8A6Q8Ei8.js} +2 -2
- package/lib/es/chunks/{index-aeMNll_R.js → index-DrqhF7Qu.js} +189 -176
- package/lib/es/chunks/{publish-button-BPtL08Ue.js → publish-button-OwaU0V66.js} +2 -2
- package/lib/es/home.js +2 -2
- package/package.json +4 -4
package/lib/cjs/add-component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),v=require("./chunks/state-tEydRMV8.js"),Y=require("@arcblock/ux/lib/Empty"),N=require("@arcblock/ux/lib/Locale/context"),O=require("@iconify-icon/react"),K=require("@mui/icons-material/Check"),e=require("@mui/material"),D=require("ahooks"),u=require("react"),S=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),v=require("./chunks/state-tEydRMV8.js"),Y=require("@arcblock/ux/lib/Empty"),N=require("@arcblock/ux/lib/Locale/context"),O=require("@iconify-icon/react"),K=require("@mui/icons-material/Check"),e=require("@mui/material"),D=require("ahooks"),u=require("react"),S=require("./chunks/index-DmCIlIe9.js"),m=require("@arcblock/ux/lib/Theme");require("@blocklet/pages-kit/builtin/color-picker");require("@blocklet/pages-kit/utils/style");require("@emotion/css");require("lodash/without");const p=require("@mui/material/colors");require("@blocklet/pages-kit/builtin/uploader");require("react-use");require("lodash/cloneDeep");require("@mui/icons-material");require("react-dnd");require("@mui/lab");require("immer");require("lodash/omit");require("react-router-dom");require("@arcblock/ux/lib/Button");require("is-uri");require("@arcblock/ux/lib/Toast");require("@mui/material/Tooltip");require("@mui/icons-material/KeyboardArrowLeft");const J=require("@mui/material/Box");require("@mui/material/DialogTitle");require("@mui/material/IconButton");require("@mui/material/Dialog");require("@mui/material/useMediaQuery");const Z=require("@emotion/react");require("@mui/material/Alert");require("@mui/material/AlertTitle");require("react-error-boundary");require("ufo");require("lodash/isEmpty");require("yaml");require("@mui/material/Typography");require("joi");const A=require("@blocklet/ai-kit/api"),ee=require("@blocklet/js-sdk");require("@mui/x-date-pickers");require("@mui/x-date-pickers/AdapterDayjs");require("@mui/x-date-pickers/LocalizationProvider");require("circular-natal-horoscope-js/dist");const te=require("dayjs"),oe=require("dayjs/plugin/timezone"),re=require("dayjs/plugin/utc");require("fast-deep-equal");require("lodash/isNil");require("tz-lookup");require("@mui/icons-material/CheckCircleOutline");require("lodash/uniq");require("lodash/get");require("lodash/set");const G=require("@blocklet/pages-kit/utils/common"),ie=require("@blocklet/pages-kit/components"),_=o=>o&&o.__esModule?o:{default:o},$=_(Y),ne=_(K),se=_(J),W=_(te),ae=_(oe),le=_(re);p.red[300],p.pink[300],p.purple[300],p.indigo[300],p.blue[300],p.cyan[300],p.teal[300],p.green[300],p.lime[300],p.yellow[300],p.amber[300],p.orange[300],p.brown[300],p.grey[300],p.blueGrey[300];m.styled(e.Box)`
|
|
2
2
|
.color-item {
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),k=require("./state-tEydRMV8.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-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),k=require("./state-tEydRMV8.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-DmCIlIe9.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
2
|
display: contents;
|
|
3
3
|
& > div > div > .MuiContainer-root {
|
|
4
4
|
max-width: unset;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
font-family: ${a};
|
|
28
28
|
}
|
|
29
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-
|
|
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-WHYISygD.js"))),Se=p.lazy(()=>Promise.resolve().then(()=>require("./draft-data-BM4piqW0.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
31
|
body {
|
|
32
32
|
background-color: ${g(!i.backgroundColor||i.backgroundColor==="transparent"?"background.default":i.backgroundColor)} !important;
|
|
33
33
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var Ae=Object.create;var ae=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Le=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of We(t))!ze.call(e,i)&&i!==n&&ae(e,i,{get:()=>t[i],enumerable:!(r=Re(t,i))||r.enumerable});return e};var Te=(e,t,n)=>(n=e!=null?Ae(Ee(e)):{},Le(t||!e||!e.__esModule?ae(n,"default",{value:e,enumerable:!0}):n,e));const o=require("react/jsx-runtime"),qe=require("@mui/icons-material"),
|
|
1
|
+
"use strict";var Ae=Object.create;var ae=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var We=Object.getOwnPropertyNames;var Ee=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Le=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of We(t))!ze.call(e,i)&&i!==n&&ae(e,i,{get:()=>t[i],enumerable:!(r=Re(t,i))||r.enumerable});return e};var Te=(e,t,n)=>(n=e!=null?Ae(Ee(e)):{},Le(t||!e||!e.__esModule?ae(n,"default",{value:e,enumerable:!0}):n,e));const o=require("react/jsx-runtime"),qe=require("@mui/icons-material"),p=require("@mui/material"),Ue=require("lodash/isEmpty"),Oe=require("lodash/pick"),h=require("react"),Fe=require("lodash/keyBy"),_=require("@arcblock/ux/lib/Theme"),f=require("@emotion/css"),De=require("lodash/omit"),te=require("react-router-dom"),Ge=require("@arcblock/ux/lib/Button"),He=require("is-uri"),ye=require("@iconify-icon/react"),v=require("./state-tEydRMV8.js"),Ve=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),be=require("@blocklet/pages-kit/contexts/color"),Ye=require("react-syntax-highlighter/dist/esm/styles/prism"),Je=require("@arcblock/react-hooks/lib/useBrowser"),Ke=require("@arcblock/ux/lib/Colors"),oe=require("@blocklet/pages-kit/components"),le=require("@blocklet/pages-kit/utils/style"),Xe=require("@mui/material/useMediaQuery"),V=require("pathe"),U=require("ufo"),Qe=require("@blocklet/embed/message"),Ze=require("ahooks"),et=require("lodash/isEqual"),tt=require("@blocklet/embed/react"),ot=require("@arcblock/ux/lib/Locale/context"),nt=require("@arcblock/ux/lib/Screenshot"),rt=require("react-twitter-embed"),ce=require("react-use"),C=e=>e&&e.__esModule?e:{default:e},it=C(Ue),ne=C(Oe),st=C(h),W=C(Fe),M=C(De),at=C(Ge),Z=C(He),lt=C(Ve),ct=C(Je),de=C(Ke),we=C(Xe),dt=C(et),ut=C(nt),ve="{{CUSTOM_VALUE}}",mt=[{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}}}],pt=[{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}}}],xt=[{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)`:""}`},gt=[{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:ve,width:"100%",mx:"auto"}}],ht=[{title:"None",value:"none",sx:{gap:0},containerSx:{gap:0}},{title:"Small",value:"small",sx:{gap:{xs:1,md:2,lg:2,xl:3}}},{title:"Normal",value:"normal",sx:{gap:{xs:2,md:3.5,lg:3.5,xl:5}}},{title:"Large",value:"large",sx:{gap:{xs:3,md:5,lg:5,xl:6.5}}}],ft=[{title:"None",value:"none",sx:{p:0}},{title:"Small",value:"small",sx:{p:{xs:1,md:2,lg:2,xl:3}}},{title:"Normal",value:"normal",sx:{p:{xs:2.5,md:5,lg:5,xl:7.5}}},{title:"Large",value:"large",sx:{p:{xs:3,md:6,lg:6,xl:9}}}],yt=[{title:"Start",value:"start",sx:{alignContent:"start"}},{title:"End",value:"end",sx:{alignContent:"end"}},{title:"Center",value:"center",sx:{alignContent:"center"}},{title:"Space Between",value:"space-between",sx:{alignContent:"space-between"}},{title:"Space Around",value:"space-around",sx:{alignContent:"space-around"}},{title:"Space Evenly",value:"space-evenly",sx:{alignContent:"space-evenly"}}],bt=W.default(mt,"value"),wt=W.default(pt,"value"),vt=W.default(xt,"value"),jt=W.default(gt,"value"),kt=W.default(ht,"value"),_t=W.default(ft,"value"),$t=W.default(yt,"value"),Ct=new Map([["baseSectionPaddingY",bt],["maxWidth",jt],["paddingY",wt],["paddingX",vt],["layoutBlockGap",kt],["layoutBlockPadding",_t],["layoutBlockAlignContent",$t]]);function F(e){const{type:t,value:n,format:r="sx",defaultValue:i=null}=e,s=Ct.get(t);if(!s||typeof n!="string"||!n)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(ve,d))}catch{}}return l}return i}const je=h.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function St(){return h.useContext(je)}function Bt({page:e,children:t,defaultLocale:n="en",currentLocale:r}){const i=h.useMemo(()=>e?JSON.parse(JSON.stringify(e)):null,[JSON.stringify(e)]),s=h.useCallback(()=>{if(!i)return{};const l=r||n;return i.locales?.[l]??{}},[i,n,r]),c=h.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((u,[g,x])=>{if(!x)return u;const b=`${g}Custom`;d.style[b];const y=F({type:g,value:x,format:l});return y?{...u,...y}:u},{})},[s]),a=h.useMemo(()=>({page:i,getPageMeta:s,getPageMetaStyle:c}),[i,s,c]);return o.jsx(je.Provider,{value:a,children:t})}const J=["editing","height","locale","dev","sx"];function Nt(e){const{className:t,...n}=e;return o.jsx(Mt,{...n,className:f.cx("BlockBase-root",t)})}const Mt=_.styled(p.Box)`
|
|
2
2
|
position: relative;
|
|
3
3
|
color: ${({theme:e})=>e.palette.text.primary};
|
|
4
|
-
`,ke=h.createContext({pages:[],project:void 0}),{Provider:It,Consumer:Yo}=ke;function _e(){return h.useContext(ke)}function Pt({icon:e,...t}){return o.jsx(ye.Icon,{icon:e,...t,ref:null})}function At({icon:e,className:t="",size:n="1rem",...r}){return o.jsx(Rt,{component:Pt,className:f.cx("css-icon",t),size:n,...r,icon:e})}const Rt=_.styled(
|
|
4
|
+
`,ke=h.createContext({pages:[],project:void 0}),{Provider:It,Consumer:Yo}=ke;function _e(){return h.useContext(ke)}function Pt({icon:e,...t}){return o.jsx(ye.Icon,{icon:e,...t,ref:null})}function At({icon:e,className:t="",size:n="1rem",...r}){return o.jsx(Rt,{component:Pt,className:f.cx("css-icon",t),size:n,...r,icon:e})}const Rt=_.styled(p.Box)`
|
|
5
5
|
&.css-icon {
|
|
6
6
|
display: inline-block;
|
|
7
7
|
width: ${({size:e})=>e};
|
|
8
8
|
height: ${({size:e})=>e};
|
|
9
9
|
}
|
|
10
|
-
`;function Wt({icon:e,className:t="",size:n="1rem",imageMeta:r,...i}){const s=v.autoResizeImage(v.getImageAbsoluteUrl(e),540),[c,a]=h.useState(!1),l=_.useTheme();return c?o.jsx(At,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:t,...i}):o.jsx(Et,{className:f.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 Et=_.styled(
|
|
10
|
+
`;function Wt({icon:e,className:t="",size:n="1rem",imageMeta:r,...i}){const s=v.autoResizeImage(v.getImageAbsoluteUrl(e),540),[c,a]=h.useState(!1),l=_.useTheme();return c?o.jsx(At,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:t,...i}):o.jsx(Et,{className:f.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 Et=_.styled(p.Box)`
|
|
11
11
|
display: inline-block;
|
|
12
12
|
width: ${({size:e})=>e};
|
|
13
13
|
height: ${({size:e})=>e};
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
height: 100%;
|
|
17
17
|
width: 100%;
|
|
18
18
|
}
|
|
19
|
-
`,re=e=>typeof e=="string"&&/^[\w-_]+:[\w-_]+$/.test(e);function ee({icon:e,size:t="1rem",imageMeta:n,...r}){const i=window.isNaN(t)?t:`${t}px`;return re(e)?o.jsx(ye.Icon,{icon:e}):o.jsx(zt,{component:Wt,imageMeta:n,className:"base-icon",icon:e,size:i,...r})}const zt=_.styled(
|
|
19
|
+
`,re=e=>typeof e=="string"&&/^[\w-_]+:[\w-_]+$/.test(e);function ee({icon:e,size:t="1rem",imageMeta:n,...r}){const i=window.isNaN(t)?t:`${t}px`;return re(e)?o.jsx(ye.Icon,{icon:e}):o.jsx(zt,{component:Wt,imageMeta:n,className:"base-icon",icon:e,size:i,...r})}const zt=_.styled(p.Box)`
|
|
20
20
|
flex-shrink: 0;
|
|
21
|
-
`;function
|
|
21
|
+
`;function D({text:e,children:t,icon:n="",endIcon:r,color:i="primary",link:s="",href:c="",...a}){const l=n?o.jsx(ee,{icon:n}):null,d=r?o.jsx(ee,{icon:r}):null,m=s||c,u={...a};return m&&(u.href=m,Z.default(m)&&(u.target=u.target||"_blank")),o.jsx(at.default,{startIcon:l,endIcon:d,color:i,...u,children:e||t})}function $e({editing:e,text:t,...n}){const{pages:r=[]}=_e(),i=r.find(s=>s.id===(n.link||n.linkId));if(e)return o.jsx(D,{...M.default(n,["link","linkId"]),children:t});if(i){const s=i.path||"/";return o.jsx(te.Link,{to:s,children:o.jsx(D,{...M.default(n,["link","linkId"]),children:t})})}return o.jsx(D,{...M.default(n,"linkId"),children:t})}function z({actions:e,center:t,className:n,align:r}){return e&&e?.length?o.jsx(p.Box,{className:f.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 Lt="section",Tt=p.styled(p.Box)`
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
|
|
24
24
|
.section__title {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
margin-bottom: 40px;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
`;function K({title:e,description:t,descriptionMarkdown:n,actions:r,className:i="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:m,center:u,logo:g,titleAppearance:
|
|
83
|
+
`;function K({title:e,description:t,descriptionMarkdown:n,actions:r,className:i="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:m,center:u,logo:g,titleAppearance:x,descriptionAppearance:b,...y}){const w=be.useColorConvert();if(!e&&!t&&!r&&!m&&!d&&!c&&!a&&!g)return null;const j=Math.max(Math.min(5,l+1),1),$={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"},P=l===0?"big":`h${j}`,B=l===0;return o.jsxs(Tt,{className:f.cx("base-info","lg:text-left",u&&"!text-center",i),...y,children:[c&&o.jsx("div",{children:c}),(d||m)&&o.jsx("div",{className:f.cx("section__tag",s?.tag||s?.badge),children:d||m}),g&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:g,alt:"info",loading:"lazy"}),e&&o.jsx(p.Typography,{sx:{whiteSpace:"pre-wrap",mb:t?"2vw":0,...x?.color&&{color:`${w(x.color)} !important`}},className:f.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",B?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:P,children:e}),t&&(n?o.jsx(p.Box,{sx:{...b?.color&&{color:`${w(b.color)} !important`}},className:f.cx("section__description","text-gray-800","dark:text-gray-100",$[j],s.description,"page-kit-section__description"),children:o.jsx(lt.default,{codeOptions:{showActionButton:!1,theme:Ye.materialDark},children:t})}):o.jsx(p.Typography,{sx:{whiteSpace:"pre-wrap",...b?.color&&{color:`${w(b.color)} !important`}},className:f.cx("section__description","text-gray-800","dark:text-gray-100",$[j],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:t})),o.jsx(z,{actions:r,center:u,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const X=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function qt(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}function Ut(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 O(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")||e?.endsWith(".webm")}function Ot(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")?"video/mp4":e?.endsWith(".webm")?"video/webm":void 0}function Ft(e){let t={};return typeof e=="string"?le.isGradient(e)?t.image=e:(t.image=v.getImageAbsoluteUrl(e),le.isColorString(e)&&(t.color=e,t.image="")):t=e,t}function Dt(){const[e,t]=h.useState(Date.now());return h.useEffect(()=>{const n=()=>{t(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),e}function ue(e,t,n,r,i){let s=null;const{color:c="",image:a}=Ft(t);if(a&&Ut(a)){delete n.backgroundColor;const l=!(e.mobile.apple.device||qt())&&O(a),d=O(a)&&r?v.autoResizeImage(v.getImageAbsoluteUrl(r),1200,"quality"):"";l?s=o.jsx(p.Box,{component:"video",className:"section-bg",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:d,src:O(a)?a:v.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(oe.ResponsiveImage,{src:O(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 Gt({autoWidth:e,children:t,...n}){return e?o.jsx(p.Box,{...n,sx:[{display:"flex"},...Array.isArray(n.sx)?n.sx:[n.sx]],children:t}):o.jsx(p.Container,{...n,children:t})}function Q({dark:e=!1,children:t,className:n,sx:r={},boxed:i={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...r},m=we.default(x=>x.breakpoints.down("md"));e&&(d.color=de.default.common.white,d.backgroundColor=`${de.default.grey[900]} !important`),i.show&&(d.display="flex");const u=h.useMemo(()=>!Number(l.boxMaxWidth)||m?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,m,a]),g=F({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Ht,{component:"section",styles:{...d,...g},className:f.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:e}),...M.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Gt,{autoWidth:l?.autoWidth,className:f.cx("section-content h-full"),sx:u,children:i.show?o.jsx(Ce,{...c,boxed:i,children:t}):t})})}function Ce({background:e="",backgroundVideoPoster:t,children:n,sx:r={},boxed:i={show:!1},className:s="",styles:c={},...a}){const l={...c,...r},d=be.useColorConvert();let m=null;const u=we.default(b=>b.breakpoints.up("sm")),g=ct.default(),x=Dt();return e&&(m=ue(g,typeof e=="string"?d(e):e,l,t,x)),i.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=u?"50px":"20px"),i?.border&&(l.border="1px solid #c0c0c0"),i?.background&&(m=ue(g,typeof i?.background=="string"?d(i?.background):i?.background,l,i?.backgroundVideoPoster,x))),o.jsxs(p.Box,{...a,sx:{...l,...m?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:f.cx(s,i?.boxShadow&&"shadow-xl"),children:[m,n]})}const Ht=_.styled(Ce)`
|
|
84
84
|
&:nth-of-type(even) {
|
|
85
85
|
background: #f8f8f8;
|
|
86
86
|
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
`;function
|
|
99
|
+
`;function Se(e){if(e.type===h.Fragment){const n=(e.props.children||[]).filter(r=>h.isValidElement(r));return n.length===1?Se(n[0]):n.length>1}return Array.isArray(e)}const R="&>*";function Be({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),m={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"},u=m[i]||m.center;let x=n??({2:6,3:4,4:4,5:3,6:3}[t]||0);Se(e)||(x=0);const y=(t-1)*x/t;let w={...s,gap:`${x}rem`};const j={[R]:{width:"100%"}},$={},P={},B={};switch(j.gap="1rem",$.gap=`${x/2}rem`,t){case 3:case 4:$[R]={width:`calc(50% - ${x/2}rem)`};break;case 5:case 6:j[R]={width:`calc(50% - ${x/2/2}rem)`},$[R]={width:`calc(50% - ${x/2/2}rem)`},P[R]={width:`calc(33.33% - ${x*2/3}rem)`};break}return w[R]={width:`calc(${d}% - ${y}rem)`},w[`@media (max-width: ${l.breakpoints.values.xl}px)`]=B,w[`@media (max-width: ${l.breakpoints.values.lg}px)`]=P,w[`@media (max-width: ${l.breakpoints.values.md}px)`]=$,w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=j,c==="wall"&&(w={...s,gap:`${x}rem`},w[R]={width:`calc(${d}% - ${y}rem)`},j[R]={width:`calc(45% - ${x/2/2}rem)`},w[`@media (max-width: ${l.breakpoints.values.sm}px)`]=j),o.jsx(p.Box,{className:f.cx("flex flex-wrap flex-row h-full",u,r),sx:w,...a,children:e})}function L({type:e="",icon:t="",size:n="3rem",className:r="",...i}){return o.jsx(ee,{icon:t||e,size:n,className:f.cx("content-icon",r),...i,color:typeof i.color>"u"?"inherit":i.color})}function Vt({to:e,base:t,children:n,className:r,activeClassName:i="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:m=""}={},u=t?V.join("/",t):t||"";let g=s==="auto"?"_self":s,x=V.join(u,e);const b=c?Z.default(x):!1;if(t)return x=V.join(u,m,e),o.jsx("a",{className:`no-underline ${r}`,href:U.withoutTrailingSlash(x),rel:"noreferrer noopener",target:g,...l,children:n});if(Z.default(e))s==="auto"&&(g="_blank"),x=e;else{U.isRelative(x)&&(x=V.join(window.location.pathname,x));const y=U.parseURL(`${window.location.origin}${x}`),w=d.some(j=>j.pathname===y.pathname);if(a||w)return o.jsx(te.NavLink,{end:!0,to:U.withoutTrailingSlash(x),className:({isActive:j})=>f.cx(r,j?i:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${r}`,href:U.withoutTrailingSlash(x),rel:"noreferrer noopener",target:g,...l,children:[n,b&&o.jsx(L,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function G({prepend:e,append:t,children:n,className:r="",dark:i=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=_e(),d=l.find(g=>g.id===c.link),m=!n||st.default.Children.toArray(n).every(g=>g===null);c.link&&(a={component:Vt,to:d?.path||c.link,useRouterLink:!0});const u=p.useTheme();return o.jsxs(Yt,{className:f.cx("base-card card",{dark:i,"border-transparent":!s},r),sx:{borderColor:u.palette.divider},...a,...M.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[e,!m&&o.jsx("div",{className:"card__body",children:n}),t]})}const Yt=_.styled(p.Box)`
|
|
100
100
|
&.base-card {
|
|
101
101
|
text-align: left;
|
|
102
102
|
border-width: 1px;
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
.card__body {
|
|
112
112
|
padding: 15px 15px;
|
|
113
113
|
}
|
|
114
|
-
`;function
|
|
114
|
+
`;function H({align:e="left",title:t,titleProps:n={},description:r,descriptionProps:i={}}){return o.jsxs(o.Fragment,{children:[t&&o.jsx(p.Typography,{className:f.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:e,...n,children:t}),r&&o.jsx(p.Typography,{className:f.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:e,...i,children:r})]})}function Jt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const u=re(e),g=v.autoResizeImage(v.getImageAbsoluteUrl(e),540);return o.jsxs(Kt,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&e?o.jsx(p.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(L,{icon:e,color:"primary.main"})}):g&&o.jsx("img",{className:"card__image",src:g,...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(z,{align:d,actions:l,className:"mt-4"}):null]})}const Kt=_.styled(G)`
|
|
115
115
|
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
116
116
|
&:hover {
|
|
117
117
|
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
height: 100%;
|
|
146
146
|
object-position: top center;
|
|
147
147
|
}
|
|
148
|
-
`,me="section";function
|
|
148
|
+
`,me="section";function pe({title:e,image:t,imageMeta:n,description:r,actions:i,align:s,listType:c="",className:a="",...l}){return o.jsxs(Xt,{className:f.cx("card",`list-type-${c}`,a),align:s,...l,children:[t&&o.jsx(L,{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(z,{align:s,actions:i,className:"mt-4"}):null]})}const Xt=_.styled(G)`
|
|
149
149
|
padding: 5vw 4vw;
|
|
150
150
|
box-sizing: border-box;
|
|
151
151
|
/* min-height: 320px; */
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
text-align: left;
|
|
206
206
|
box-sizing: border-box;
|
|
207
207
|
}
|
|
208
|
-
`;function Qt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const u=re(e),g=v.autoResizeImage(v.getImageAbsoluteUrl(e),540);return o.jsxs(Zt,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&e?o.jsx(
|
|
208
|
+
`;function Qt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...m}){const u=re(e),g=v.autoResizeImage(v.getImageAbsoluteUrl(e),540);return o.jsxs(Zt,{className:"card-article",...m,prepend:o.jsx("div",{className:"card__image__wrap",children:u&&e?o.jsx(p.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(L,{icon:e,color:"primary.main"})}):g&&o.jsx(p.Box,{component:"img",className:"card__image",src:g,...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(z,{align:d,actions:l,className:"mt-4"}):null]})}const Zt=_.styled(G)`
|
|
209
209
|
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
210
210
|
&:hover {
|
|
211
211
|
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
.card__image {
|
|
230
230
|
max-height: 60px;
|
|
231
231
|
}
|
|
232
|
-
`,
|
|
232
|
+
`,xe="section";function eo({title:e,image:t,imageMeta:n,iconSize:r=100,description:i,actions:s,align:c,className:a="",...l}){return o.jsx(to,{className:f.cx("card",a),...l,children:o.jsxs(p.Box,{className:"flex items-center",children:[t&&o.jsx(L,{icon:t,color:"primary.main",size:r,imageMeta:n}),o.jsxs(p.Box,{className:"flex-1 ml-4",children:[o.jsx(H,{align:c,title:e,description:i}),o.jsx(z,{align:c,actions:s,className:"mt-4"})]})]})})}const to=_.styled(G)`
|
|
233
233
|
padding: 5vw 4vw;
|
|
234
234
|
text-align: left;
|
|
235
235
|
box-sizing: border-box;
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
color: inherit !important;
|
|
238
238
|
border-radius: 0.5rem;
|
|
239
239
|
/* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
|
|
240
|
-
@media (max-width: ${({theme:e})=>e.breakpoints.values[
|
|
240
|
+
@media (max-width: ${({theme:e})=>e.breakpoints.values[xe]}px) {
|
|
241
241
|
padding: 1.5rem 2rem;
|
|
242
242
|
}
|
|
243
243
|
@media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
|
|
@@ -282,12 +282,12 @@
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
@media (min-width: ${({theme:e})=>e.breakpoints.values[
|
|
285
|
+
@media (min-width: ${({theme:e})=>e.breakpoints.values[xe]}px) {
|
|
286
286
|
padding: 2rem 2rem;
|
|
287
287
|
text-align: left;
|
|
288
288
|
box-sizing: border-box;
|
|
289
289
|
}
|
|
290
|
-
`;function oo({title:e,titleProps:t={},description:n,descriptionProps:r={},image:i,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(no,{className:f.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[i&&o.jsx(
|
|
290
|
+
`;function oo({title:e,titleProps:t={},description:n,descriptionProps:r={},image:i,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(no,{className:f.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[i&&o.jsx(L,{icon:i,color:"primary.main",imageMeta:s}),e||n?o.jsx(H,{align:a,title:e,titleProps:t,description:n,descriptionProps:r}):null]})}const no=_.styled(G)`
|
|
291
291
|
.card__title {
|
|
292
292
|
color: ${({theme:e})=>e.palette.text.primary};
|
|
293
293
|
a {
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
`;function ro({type:e="default",...t}){const r={article:Jt,simple:oo,news:eo,default:
|
|
386
|
+
`;function ro({type:e="default",...t}){const r={article:Jt,simple:oo,news:eo,default:pe,wall:Qt}[e]||pe;return o.jsx(r,{...e==="news"?t:M.default(t,"iconSize")})}function io({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:m=!1,textAlign:u="left",hoverStyle:g,...x}){return o.jsx(Be,{type:d,className:f.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:t,...x,children:n||e.map(b=>o.jsx(ro,{borderColor:r,iconColor:a,type:d,listType:i,dark:m,...b,align:u,style:c===0&&e.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},b.id))})}const so=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"];function I(e,t){const n=ne.default(e,t),r=M.default(e,t);return[n,r]}const ao=_.styled(Q)`
|
|
387
387
|
a .card {
|
|
388
388
|
color: #404040;
|
|
389
389
|
cursor: pointer;
|
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
a:hover .card {
|
|
399
399
|
color: #404040;
|
|
400
400
|
}
|
|
401
|
-
`;function lo({className:e,...t}){const[n,r]=
|
|
401
|
+
`;function lo({className:e,...t}){const[n,r]=I(t,X),[i,s]=I(r,so);return o.jsxs(ao,{className:f.cx("section--card-list",e),type:t.type,...s,children:[Object.keys(n).length>0&&o.jsx(K,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(io,{...i,dark:!!t.dark})]})}const co=_.styled(lo)`
|
|
402
402
|
.card__description {
|
|
403
403
|
white-space: pre-wrap;
|
|
404
404
|
}
|
|
@@ -413,24 +413,24 @@
|
|
|
413
413
|
.card-simple .card__body::after {
|
|
414
414
|
background: inherit !important;
|
|
415
415
|
}
|
|
416
|
-
`;function uo({section:e,...t}){const[{editing:n},r]=
|
|
416
|
+
`;function uo({section:e,...t}){const[{editing:n},r]=I(t,J),i=h.useMemo(()=>({...M.default(r,["listBorder","list","iconSize","imageSize"]),list:r.list?.map(s=>({...M.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(co,{style:n?{pointerEvents:"none"}:{},...i})}function mo({properties:e,section:t,locale:n,dev:r}){return t?.config?.componentId?o.jsx(oe.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(p.Box,{sx:{textAlign:"center",py:2},children:o.jsx(p.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Please select component to render"})})}function po({src:e,dataId:t,isEdit:n=!1,height:r="100%",onLoad:i=()=>{}}){return o.jsx(tt.EmbedIframe,{isEdit:n,embedId:t,src:e,height:r,onLoad:()=>{i()}})}function xo({dataId:e,src:t,actions:n,center:r,onLoad:i,...s}){const[c,a]=I(s,X);return o.jsxs(Q,{...a,children:[Object.keys(c).length>0&&o.jsx(K,{center:r,...c}),o.jsx(po,{dataId:e,src:t,onLoad:i,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(z,{actions:n,center:r})]})}const go={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function ho({section:e,id:t,src:n,...r}){const i=`${t}-${r.locale}`,[{editing:s},c]=I(r,J),a=h.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Qe.useMessage(i,"server"),m=Ze.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return h.useEffect(()=>{d&&d.onInit(()=>m.current)},[d]),h.useEffect(()=>{const u=JSON.parse(JSON.stringify(c.config)||"{}");dt.default(a.current,u)||(a.current=u,d?.send("config-set",u))},[d,c.config]),n?o.jsx(xo,{...l,dataId:i,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(fo,{children:'Please set the "src" attribute for this block'})}const fo=_.styled("div")`
|
|
417
417
|
user-select: none;
|
|
418
418
|
color: #999;
|
|
419
419
|
padding: 8px;
|
|
420
420
|
height: 200px;
|
|
421
|
-
`,yo="none",bo="none",wo="transparent",ge="start",vo=12,jo=({gridSettings:e,section:t,index:n,columns:r,simulateMode:i="desktop",isBackground:s})=>{const c=e?.[i]??{},a=c[t.id],l=ko(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}},ko=e=>Object.values(e).reduce((t,n)=>Math.max(t,n.y||0),0)||0,_o=e=>{const{dev:t,id:n,section:r,onBlockRender:i}=e,s=t?.mode,c=
|
|
421
|
+
`,yo="none",bo="none",wo="transparent",ge="start",vo=12,jo=({gridSettings:e,section:t,index:n,columns:r,simulateMode:i="desktop",isBackground:s})=>{const c=e?.[i]??{},a=c[t.id],l=ko(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}},ko=e=>Object.values(e).reduce((t,n)=>Math.max(t,n.y||0),0)||0,_o=e=>{const{dev:t,id:n,section:r,onBlockRender:i}=e,s=t?.mode,c=p.useMediaQuery(k=>k.breakpoints.down("sm")),{t:a}=ot.useLocaleContext(),{sections:l,sectionIds:d,config:m}=r,{columns:u=vo,gridSettings:g,gap:x,padding:b,background:y,alignContent:w}=m||{},j=h.useMemo(()=>{const S=F({type:"layoutBlockGap",value:x??yo,format:"sx"}),E={...S,gap:Object.keys(S.gap).reduce((N,A)=>(N[A]=-S.gap[A],N),{})};return{item:S,container:E}},[x]),$=h.useMemo(()=>F({type:"layoutBlockPadding",value:b??bo,format:"sx"}),[b]),P=h.useMemo(()=>F({type:"layoutBlockAlignContent",value:w??ge,format:"sx"}),[w]),B=h.useCallback((k,S=!1,E=0)=>{if(!i||!k||!k.component||k.visibility==="hidden")return null;const N=jo({gridSettings:g,section:k,index:E,columns:u,simulateMode:c?"mobile":"desktop",isBackground:S}),A=N?.x??0,T=N?.y??0,q=N?.w??u,Me=N?.h??1,Ie=N?.maxY??0,Pe=!!r?.config?.backgroundSectionId;return o.jsx(p.Box,{className:S?"layout-block-background":"layout-block-section",sx:{...S?{gridColumn:"1 / -1",gridRow:`1 / ${Ie+1}`,zIndex:0,width:"100%",height:"100%","& .BlockBase-root":{width:"100%",height:"100%"}}:{position:"relative",gridColumn:`${A+1} / span ${q}`,gridRow:`${T+(Pe?0:1)} / span ${Me}`,zIndex:1,minWidth:0,minHeight:0,overflow:"hidden",...T>0?{mt:j?.item?.gap}:{},...A>0?{ml:j?.item?.gap}:{},"& > .BlockBase-root":{height:"100%",width:"100%",boxSizing:"border-box"}}},children:i({id:k.id,type:k.component,config:{},section:{...k},mode:s})},k.id)},[n,s,i,g,u,c,j]),{backgroundElements:ie,contentElements:se}=h.useMemo(()=>{if(!d||!d.length||!l||!Object.keys(l).length)return{backgroundElements:[],contentElements:[]};const k=[],S=[];return d?.forEach((E,N)=>{const A=l[E];if(!A)return;const T=r?.config?.backgroundSectionId===E,q=B(A,T,N);q&&(T?k.push(q):S.push(q))}),{backgroundElements:k,contentElements:S}},[B,l,d]);return s==="draft"&&!ie?.length&&!se?.length?o.jsxs(p.Box,{sx:{gridColumn:"1 / -1",gridRow:"1",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,border:k=>`2px dashed ${k.palette.divider}`,borderRadius:2,padding:4,color:"text.secondary",textAlign:"center",minHeight:"160px"},children:[o.jsx(p.Box,{sx:{fontSize:"48px",opacity:.5},children:"📐"}),o.jsx(p.Box,{sx:{fontSize:"16px",fontWeight:500,marginBottom:1},children:"Section Layout"}),o.jsx(p.Box,{sx:{opacity:.7,whiteSpace:"pre-line"},children:a("maker.layoutBlock.draftPlaceholder")}),o.jsx(p.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:.1,background:k=>`
|
|
422
422
|
repeating-linear-gradient(
|
|
423
423
|
90deg,
|
|
424
424
|
transparent,
|
|
425
425
|
transparent calc(100% / ${u} - 1px),
|
|
426
|
-
${
|
|
427
|
-
${
|
|
426
|
+
${k.palette.grey[400]} calc(100% / ${u} - 1px),
|
|
427
|
+
${k.palette.grey[400]} calc(100% / ${u})
|
|
428
428
|
)
|
|
429
|
-
`}})]}):o.jsxs(
|
|
429
|
+
`}})]}):o.jsxs(p.Box,{sx:{position:"relative",display:"grid",gridTemplateColumns:`repeat(${u}, minmax(0, 1fr))`,alignItems:"stretch",width:"100%",height:"100%",minWidth:0,bgcolor:y??wo,boxSizing:"border-box",overflow:"hidden",...$,alignContent:P?.alignContent??ge},children:[ie,se]})},$o=["title","description","actions","badge","tag","prepend","append","logo"];function Co({image:e,imageBorder:t,imageShadow:n,className:r,reverse:i=!1,fullSizeImage:s,...c}){const[a,l]=I(c,X),d=Object.keys(a).length>0&&Object.values(ne.default(a,$o)).filter(Boolean).length>0&&o.jsx(K,{...a}),m=h.isValidElement(e)?e:o.jsx(p.Box,{component:"img",src:e,alt:"",className:"block"}),u=["phone","macbook"].includes(t),g=e&&o.jsx(p.Box,{className:f.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":u?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:u?o.jsx(ut.default,{type:t,sx:{width:"100%"},children:m}):m});return o.jsx(Q,{className:f.cx("section--block",r,s&&!i&&f.css`
|
|
430
430
|
.section-bg {
|
|
431
431
|
height: 80%;
|
|
432
432
|
}
|
|
433
|
-
`),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(
|
|
433
|
+
`),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(Be,{col:e?2:1,className:s?f.css`
|
|
434
434
|
display: flex;
|
|
435
435
|
flex-direction: column;
|
|
436
436
|
|
|
@@ -443,16 +443,16 @@
|
|
|
443
443
|
width: 100%;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
`:void 0,children:i?o.jsxs(o.Fragment,{children:[g,d]}):o.jsxs(o.Fragment,{children:[d,g]})})})}const
|
|
446
|
+
`:void 0,children:i?o.jsxs(o.Fragment,{children:[g,d]}):o.jsxs(o.Fragment,{children:[d,g]})})})}const So=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function Bo(e){if(/youtu\.?be/.test(e))for(const t of So){const n=t.exec(e)?.[1];if(n)return n}}function No(e){const t=Bo(e);if(t)return`https://youtube.com/embed/${t}`}function Mo({src:e}){return h.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:e})}function Io(e){return o.jsx(p.Box,{sx:{maxHeight:400,overflow:"hidden auto"},children:o.jsx(rt.TwitterTimelineEmbed,{...e})})}function Po({url:e}){const t=h.useRef(null),n=495,[r,i]=h.useState(t.current?t.current.offsetWidth*.5625:n),s=h.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 h.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(p.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 Ao={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},Ro=_.styled(Co)`
|
|
447
447
|
.section__description {
|
|
448
448
|
}
|
|
449
|
-
`;function Wo({hasImage:e,fullSizeImage:t,boxed:n,videoPoster:r,imageMeta:i,imageOptimization:s,imageSize:c,section:a,...l}){const[{editing:d},m]=
|
|
449
|
+
`;function Wo({hasImage:e,fullSizeImage:t,boxed:n,videoPoster:r,imageMeta:i,imageOptimization:s,imageSize:c,section:a,...l}){const[{editing:d},m]=I({...l,boxed:t?void 0:n},J);let u=Eo(m.image,r,t,i,s,c);e||(u=null);let g=null;return m.actions&&(g=m.actions?.map?.((x,b)=>o.jsx($e,{...x,editing:d},b))),o.jsx(Ro,{...m,style:d?{pointerEvents:"none"}:{},image:u,fullSizeImage:e&&t,actions:g})}function Eo(e,t,n,r,i,s){if(e){if(e.endsWith(".json"))return o.jsx(Mo,{src:e});if(e.indexOf("twitter.com")!==-1)return o.jsx(Io,{sourceType:"url",url:e});const c=No(e);if(c)return o.jsx(Po,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=r||{};if(O(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:v.autoResizeImage(v.getImageAbsoluteUrl(t),n?1200:540,i),children:o.jsx("source",{src:v.getImageAbsoluteUrl(e),type:Ot(e)})},e);const m=i==="quality"?1:.6;return o.jsx(oe.ResponsiveImage,{src:v.getImageAbsoluteUrl(e),sizesAttr:{sm:600*m,md:450*m,lg:540*m,...n&&{md:900*m,lg:1200*m}},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 zo=["production","draft"];function Lo({mode:e,version:t}={}){const n=t&&typeof t=="number"?{mode:e,version:t}:{mode:e};return v.api.get(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(r=>r.data)}function To({mode:e,routes:t}){return v.api.post(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:e,routes:t}).then(n=>n.data)}function qo({locale:e,sort:t,page:n,limit:r,mode:i}={}){return v.api.get(`/api/${v.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:e,sort:t,page:n,limit:r,mode:i}}).then(s=>s.data)}const Uo={style:"list",sort:"-updatedAt"},he=20;function Oo({style:e,sort:t,section:n,...r}){const[{editing:i,locale:s},c]=I(r,J),[a,l]=I(c,X),[d,m]=h.useState(),u=h.useRef(!1),g=ce.useUpdate(),x=te.useNavigate(),b=h.useCallback(async()=>{if(!u.current){u.current=!0,g();try{const y=d?Math.floor(d.list.length/he)+1:1,{list:w,total:j}=await qo({locale:s,sort:t,page:y,limit:he});m($=>({list:($?.list??[]).concat(w),total:j}))}finally{u.current=!1,g()}}},[d,s,t,g]);return ce.useMount(()=>{b()}),o.jsxs(Q,{...l,sx:i?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(K,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(p.Grid,{container:!0,spacing:2,sx:{justifyContent:"center"},children:d?.list.map(y=>o.jsx(p.Grid,{size:{xs:12,sm:e==="card"?6:12,md:e==="card"?3:12},children:o.jsxs(Fo,{elevation:0,className:f.cx(e==="card"&&"style-card"),onClick:i?void 0:()=>x(y.slug),children:[!!y.image&&o.jsx(p.CardMedia,{component:"img",alt:"",image:v.autoResizeImage(v.getImageAbsoluteUrl(y.image),540),loading:"lazy"}),o.jsxs(p.CardContent,{children:[o.jsx(p.Typography,{variant:"h6",component:"div",className:fe,children:y.title||y.id}),o.jsx(p.Typography,{variant:"body2",className:fe,children:y.description})]})]})},y.id))}),o.jsx(p.Box,{sx:{textAlign:"center",mt:2},children:d.total>d.list.length?o.jsx(D,{variant:"outlined",color:"secondary",onClick:b,loading:u.current,children:"More"}):o.jsx(D,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(p.Box,{sx:{p:2,textAlign:"center"},children:o.jsx(p.CircularProgress,{size:24})})]})}const fe=f.css`
|
|
450
450
|
display: -webkit-box;
|
|
451
451
|
-webkit-box-orient: vertical;
|
|
452
452
|
-webkit-line-clamp: 2;
|
|
453
453
|
overflow: hidden;
|
|
454
454
|
text-overflow: ellipsis;
|
|
455
|
-
`,Fo=_.styled(
|
|
455
|
+
`,Fo=_.styled(p.Card)`
|
|
456
456
|
border: 1px solid #e0e0e0;
|
|
457
457
|
background-color: transparent;
|
|
458
458
|
cursor: pointer;
|
|
@@ -472,4 +472,4 @@
|
|
|
472
472
|
max-height: 50vw;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
`,Do={iframe:ho,section:Wo,"section-card-list":uo,toc:Oo,"custom-component":mo,"layout-block":_o};function Ne({id:e,type:t,mode:n,config:r,section:i,ignorePageMetaStyle:s,page:c,...a}){const l=Do[t],{getPageMetaStyle:d}=
|
|
475
|
+
`,Do={iframe:ho,section:Wo,"section-card-list":uo,toc:Oo,"custom-component":mo,"layout-block":_o};function Ne({id:e,type:t,mode:n,config:r,section:i,ignorePageMetaStyle:s,page:c,...a}){const l=Do[t],{getPageMetaStyle:d}=St(),m=h.useMemo(()=>{const{height:x,...b}=r;return t==="layout-block"&&(b.onBlockRender=y=>{const w={...r?.dev,...y?.config?.dev},{defaultLocale:j}=w,$={...ne.default(r,["locale","editing"]),...y?.config,dev:w},{locale:P}=$;let B=c?.dataSource?.[y?.id]?.[P];return it.default(B)&&(B=c?.dataSource?.[y?.id]?.[j??"en"]),o.jsx(Ne,{...y,config:{...y?.section?.properties,...B,...$},page:c,ignorePageMetaStyle:!0})}),b},[r,t]),u=h.useMemo(()=>{const x={};return t!=="custom-component"&&(x.height=r.height),x.sx=s?void 0:d("sx"),x.id=`BlockBase-${e}`,x},[r.height,s,t,d]),g=l&&o.jsx(l,{mode:n,...m,id:e,section:i});return g?o.jsx(Nt,{...a,...u,children:g}):o.jsx(Go,{type:t})}function Go({type:e}){return o.jsx(p.Box,{sx:{p:2},children:o.jsxs(p.Alert,{icon:o.jsx(qe.ErrorOutline,{}),color:"error",children:["Unsupported Block `",e,"`"]})})}exports.BlockRenderer=Ne;exports.IFrameBlockDefaultProps=go;exports.PageProvider=Bt;exports.Provider=It;exports.STATE_MODES=zo;exports.SectionBlockDefaultProps=Ao;exports.TocDefaultProps=Uo;exports.getPages=Lo;exports.publishPages=To;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./state-tEydRMV8.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-D6CNLMDa.js"),H=require("./index-D3fT0ax0.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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("./state-tEydRMV8.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-DexBPRep.js"),H=require("./index-DmCIlIe9.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;
|
package/lib/cjs/home.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("./chunks/state-tEydRMV8.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");require("@arcblock/ux/lib/Theme");require("@blocklet/pages-kit/builtin/page/header");require("@blocklet/pages-kit/contexts/color");require("@blocklet/pages-kit/utils/data-source");require("@blocklet/pages-kit/utils/route");require("@blocklet/ui-react/lib/Header");require("@emotion/css");require("@emotion/react");require("@mui/material");require("ahooks");require("isomorphic-dompurify");require("lodash/cloneDeep");require("lodash/isEmpty");require("lodash/isEqual");require("react");require("react-helmet");require("react-router-dom");require("react-use");require("ufo");require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("./chunks/state-tEydRMV8.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");require("@arcblock/ux/lib/Theme");require("@blocklet/pages-kit/builtin/page/header");require("@blocklet/pages-kit/contexts/color");require("@blocklet/pages-kit/utils/data-source");require("@blocklet/pages-kit/utils/route");require("@blocklet/ui-react/lib/Header");require("@emotion/css");require("@emotion/react");require("@mui/material");require("ahooks");require("isomorphic-dompurify");require("lodash/cloneDeep");require("lodash/isEmpty");require("lodash/isEqual");require("react");require("react-helmet");require("react-router-dom");require("react-use");require("ufo");require("./chunks/index-DmCIlIe9.js");const e=require("./chunks/home-DexBPRep.js");require("./chunks/session-BRtsDvA-.js");exports.HomeView=e.HomeView;exports.PageRoutes=e.PageRoutes;exports.PageView=e.PageView;exports.PageViewByPath=e.PageViewByPath;exports.PageViewWithDataSource=e.PageViewWithDataSource;exports.TranslucentHeader=e.TranslucentHeader;exports.default=e.Home;
|
package/lib/es/add-component.js
CHANGED
|
@@ -7,7 +7,7 @@ import te from "@mui/icons-material/Check";
|
|
|
7
7
|
import { Box as n, styled as H, Dialog as re, DialogTitle as ie, TextField as ne, IconButton as ae, DialogContent as se, Tabs as le, Tab as pe, Grid as N, Card as de, CardMedia as ce, CardContent as me, Typography as V, DialogActions as ue, Button as $, Skeleton as fe } from "@mui/material";
|
|
8
8
|
import { useReactive as Q } from "ahooks";
|
|
9
9
|
import { createContext as L, useMemo as M, useEffect as A, useRef as S } from "react";
|
|
10
|
-
import { b as be, T as he, I as ge, B as xe } from "./chunks/index-
|
|
10
|
+
import { b as be, T as he, I as ge, B as xe } from "./chunks/index-DrqhF7Qu.js";
|
|
11
11
|
import { styled as m } from "@arcblock/ux/lib/Theme";
|
|
12
12
|
import "@blocklet/pages-kit/builtin/color-picker";
|
|
13
13
|
import "@blocklet/pages-kit/utils/style";
|
|
@@ -21,7 +21,7 @@ import { Helmet as ke } from "react-helmet";
|
|
|
21
21
|
import { useSearchParams as ee, Routes as Se, Route as S, Navigate as Ce, ScrollRestoration as Ie } from "react-router-dom";
|
|
22
22
|
import { useAsync as te } from "react-use";
|
|
23
23
|
import { joinURL as w } from "ufo";
|
|
24
|
-
import { S as Te, P as je, a as Re, B as Oe, g as Ee } from "./index-
|
|
24
|
+
import { S as Te, P as je, a as Re, B as Oe, g as Ee } from "./index-DrqhF7Qu.js";
|
|
25
25
|
import Me from "@blocklet/ui-react/lib/Footer";
|
|
26
26
|
import "webfontloader";
|
|
27
27
|
import { u as Ae, a as Be } from "./session-C72Dq8zg.js";
|
|
@@ -114,7 +114,7 @@ function ze({ mode: t }) {
|
|
|
114
114
|
}
|
|
115
115
|
return /* @__PURE__ */ e(Ve, { children: ({ state: o }) => /* @__PURE__ */ e(F, { mode: t, state: o }) });
|
|
116
116
|
}
|
|
117
|
-
const Ue = X(() => import("./publish-button-
|
|
117
|
+
const Ue = X(() => import("./publish-button-OwaU0V66.js")), Ve = X(() => import("./draft-data-CpCuyq4R.js"));
|
|
118
118
|
function Ge({
|
|
119
119
|
mode: t,
|
|
120
120
|
children: o
|