@blocklet/pages-kit-inner-components 0.4.159 → 0.5.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 +1 -1
- package/lib/cjs/chunks/{array-5NwrYcJ5.js → array-CjyMzwA7.js} +46 -20
- package/lib/cjs/chunks/home-BlT3oqu3.js +38 -0
- package/lib/cjs/chunks/{publish-button-ImPoBEP5.js → publish-button-BPa7uf5h.js} +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/es/add-component.js +1 -1
- package/lib/es/chunks/{array-BAy40Bak.js → array-D52_0LRy.js} +287 -261
- package/lib/es/chunks/{home-DOrhBil-.js → home-uXodXQ2c.js} +194 -194
- package/lib/es/chunks/{publish-button-CxEaqAku.js → publish-button-DMmhToxU.js} +2 -2
- package/lib/es/home.js +2 -2
- package/package.json +5 -5
- package/lib/cjs/chunks/home-WKpO7IF-.js +0 -38
package/lib/cjs/add-component.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var TI=Object.create;var gI=Object.defineProperty;var WI=Object.getOwnPropertyDescriptor;var xI=Object.getOwnPropertyNames;var YI=Object.getPrototypeOf,rI=Object.prototype.hasOwnProperty;var hI=(C,s,w,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of xI(s))!rI.call(C,o)&&o!==w&&gI(C,o,{get:()=>s[o],enumerable:!(i=WI(s,o))||i.enumerable});return C};var ZI=(C,s,w)=>(w=C!=null?TI(YI(C)):{},hI(s||!C||!C.__esModule?gI(w,"default",{value:C,enumerable:!0}):w,C));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const I=require("react/jsx-runtime"),H=require("./chunks/state-DytLDIZR.js"),QI=require("@arcblock/ux/lib/Empty"),T=require("@arcblock/ux/lib/Locale/context"),p=require("@iconify-icon/react"),kI=require("@mui/icons-material/Check"),A=require("@mui/material"),u=require("ahooks"),m=require("react"),h=require("./chunks/array-
|
|
1
|
+
"use strict";var TI=Object.create;var gI=Object.defineProperty;var WI=Object.getOwnPropertyDescriptor;var xI=Object.getOwnPropertyNames;var YI=Object.getPrototypeOf,rI=Object.prototype.hasOwnProperty;var hI=(C,s,w,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of xI(s))!rI.call(C,o)&&o!==w&&gI(C,o,{get:()=>s[o],enumerable:!(i=WI(s,o))||i.enumerable});return C};var ZI=(C,s,w)=>(w=C!=null?TI(YI(C)):{},hI(s||!C||!C.__esModule?gI(w,"default",{value:C,enumerable:!0}):w,C));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const I=require("react/jsx-runtime"),H=require("./chunks/state-DytLDIZR.js"),QI=require("@arcblock/ux/lib/Empty"),T=require("@arcblock/ux/lib/Locale/context"),p=require("@iconify-icon/react"),kI=require("@mui/icons-material/Check"),A=require("@mui/material"),u=require("ahooks"),m=require("react"),h=require("./chunks/array-CjyMzwA7.js"),G=require("@arcblock/ux/lib/Theme");require("@blocklet/pages-kit/builtin/color-picker");require("@blocklet/pages-kit/utils/style");const RI=require("@emotion/css");require("lodash/without");const X=require("@mui/material/colors"),f=require("./chunks/config-string-DV4-1k4s.js"),pI=require("lodash/cloneDeep"),r=require("@mui/icons-material"),AI=require("react-dnd");require("@arcblock/ux/lib/Tabs");require("lodash/pick");const UI=require("@mui/lab"),a=require("immer"),fI=require("./theme.js"),_=require("react-use"),mI=require("@arcblock/ux/lib/Toast"),GI=require("@mui/material/Tooltip"),VI=require("@mui/icons-material/KeyboardArrowLeft"),vI=require("@mui/material/Box"),_I=require("@mui/material/DialogTitle"),PI=require("@mui/material/IconButton"),qI=require("@mui/material/Dialog"),$I=require("@mui/material/useMediaQuery"),SI=require("@emotion/react"),IC=require("@mui/material/Alert"),CC=require("@mui/material/AlertTitle"),gC=require("react-error-boundary"),AC=require("ufo"),iC=require("@emotion/styled"),sC=require("@mui/material/Typography"),oC=require("joi"),P=require("@blocklet/ai-kit/api"),wC=require("@blocklet/js-sdk"),BI=require("@mui/x-date-pickers"),MC=require("@mui/x-date-pickers/AdapterDayjs"),LC=require("@mui/x-date-pickers/LocalizationProvider"),iI=require("circular-natal-horoscope-js/dist"),jC=require("dayjs"),JC=require("dayjs/plugin/timezone"),OC=require("dayjs/plugin/utc"),mC=require("fast-deep-equal"),SC=require("lodash/isNil"),BC=require("tz-lookup"),yC=require("@mui/icons-material/CheckCircleOutline"),DC=require("lodash/uniq"),eC=require("lodash/get"),bC=require("lodash/set"),NC=require("@blocklet/pages-kit/components"),F=C=>C&&C.__esModule?C:{default:C},yI=F(QI),KC=F(kI),DI=F(m),dC=F(pI),eI=F(mI),cC=F(GI),q=F(VI),Y=F(vI),$=F(_I),II=F(PI),zC=F(qI),FC=F($I),aC=F(IC),lC=F(CC),Q=F(iC),sI=F(sC),E=F(oC),Z=F(jC),tC=F(JC),HC=F(OC),EC=F(mC),uC=F(SC),bI=F(BC),nC=F(yC),oI=F(DC),XC=F(eC),TC=F(bC);X.red[300],X.pink[300],X.purple[300],X.indigo[300],X.blue[300],X.cyan[300],X.teal[300],X.green[300],X.lime[300],X.yellow[300],X.amber[300],X.orange[300],X.brown[300],X.grey[300],X.blueGrey[300];G.styled(A.Box)`
|
|
2
2
|
.color-item {
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var kt=Object.create;var ot=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Nt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var Bt=(t,e,
|
|
1
|
+
"use strict";var kt=Object.create;var ot=Object.defineProperty;var $t=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var Nt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var Bt=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of St(e))!Ct.call(t,r)&&r!==n&&ot(t,r,{get:()=>e[r],enumerable:!(i=$t(e,r))||i.enumerable});return t};var Pt=(t,e,n)=>(n=t!=null?kt(Nt(t)):{},Bt(e||!t||!t.__esModule?ot(n,"default",{value:t,enumerable:!0}):n,t));const o=require("react/jsx-runtime");require("@mui/icons-material");const x=require("@mui/material"),f=require("react"),It=require("lodash/keyBy"),j=require("./state-DytLDIZR.js"),F=require("@blocklet/ai-runtime/components"),Rt=require("@mui/utils"),Wt=require("lodash/pick"),Tt=require("react-error-boundary"),zt=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),mt=require("@blocklet/pages-kit/contexts/color"),g=require("@emotion/css"),Et=require("react-syntax-highlighter/dist/esm/styles/prism"),k=require("@arcblock/ux/lib/Theme"),qt=require("@arcblock/react-hooks/lib/useBrowser"),Lt=require("@arcblock/ux/lib/Colors"),J=require("@blocklet/pages-kit/components"),rt=require("@blocklet/pages-kit/utils/style"),At=require("@mui/material/useMediaQuery"),Ot=require("lodash/omit"),pt=require("@iconify-icon/react"),Ut=require("@arcblock/ux/lib/Screenshot"),G=require("react-router-dom"),Ft=require("@arcblock/ux/lib/Button"),Dt=require("is-uri"),D=require("pathe"),W=require("ufo"),Mt=require("@blocklet/embed/message"),Vt=require("ahooks"),Ht=require("lodash/isEqual"),Yt=require("@blocklet/embed/react"),Jt=require("react-twitter-embed"),nt=require("react-use"),$=t=>t&&t.__esModule?t:{default:t},Gt=$(f),V=$(It),K=$(Wt),Kt=$(zt),Xt=$(qt),it=$(Lt),xt=$(At),N=$(Ot),Qt=$(Ut),Zt=$(Ft),H=$(Dt),te=$(Ht),ht="{{CUSTOM_VALUE}}",ee=[{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}}}],oe=[{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}}}],re=[{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}}}],M=(t,e,n)=>{const i=t.breakpoints.values[n];return`${e}${i?` (${i}px)`:""}`},ne=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:t=>M(t,"Small","sm"),value:"sm",sx:{maxWidth:t=>t.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:t=>M(t,"Normal","md"),value:"md",sx:{maxWidth:t=>t.breakpoints.values.md,width:"100%",mx:"auto"}},{title:t=>M(t,"Large","lg"),value:"lg",sx:{maxWidth:t=>t.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:t=>M(t,"Extra Large","xl"),value:"xl",sx:{maxWidth:t=>t.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:ht,width:"100%",mx:"auto"}}],ie=V.default(ee,"value"),se=V.default(oe,"value"),ae=V.default(re,"value"),le=V.default(ne,"value"),ce=new Map([["baseSectionPaddingY",ie],["maxWidth",le],["paddingY",se],["paddingX",ae]]);function ft(t){var l;const{type:e,value:n,format:i="sx",defaultValue:r=null}=t,s=ce.get(e);if(!s)return r;const d=n.startsWith("custom:"),a=d?"custom":n;if(s!=null&&s[a]&&((l=s==null?void 0:s[a])!=null&&l[i])){const c=s[a][i];if(d){const u=n.replace("custom:","");try{return JSON.parse(JSON.stringify(c||{}).replaceAll(ht,u))}catch{}}return c}return r}const gt=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function de(){return f.useContext(gt)}function ue({page:t,children:e,defaultLocale:n="en",currentLocale:i}){const r=f.useMemo(()=>t?JSON.parse(JSON.stringify(t)):null,[JSON.stringify(t)]),s=f.useCallback(()=>{var c;if(!r)return{};const l=i||n;return((c=r.locales)==null?void 0:c[l])??{}},[r,n,i]),d=f.useCallback((l="sx")=>{const c=s();return!c||!c.style?{}:Object.entries(c.style||{}).reduce((m,[h,p])=>{if(!p)return m;const y=`${h}Custom`;c.style[y];const w=ft({type:h,value:p,format:l});return w?{...m,...w}:m},{})},[s]),a=f.useMemo(()=>({page:r,getPageMeta:s,getPageMetaStyle:d}),[r,s,d]);return o.jsx(gt.Provider,{value:a,children:e})}function R({actions:t,center:e,className:n,align:i}){return t&&(t!=null&&t.length)?o.jsx(x.Box,{className:g.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(e||i==="center")&&"justify-center",!e&&i==="right"&&"justify-end",!e&&i==="left"&&"justify-start",n),sx:{alignItems:"center"},children:t}):null}const me="section",pe=x.styled(x.Box)`
|
|
2
2
|
overflow: hidden;
|
|
3
3
|
|
|
4
4
|
.section__title {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
margin-bottom: 40px;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
`;function E({title:t,description:e,descriptionMarkdown:
|
|
63
|
+
`;function E({title:t,description:e,descriptionMarkdown:n,actions:i,className:r="",classes:s={},prepend:d,append:a,level:l=2,tag:c,badge:u,center:m,logo:h,titleAppearance:p,descriptionAppearance:y,...w}){const b=mt.useColorConvert();if(!t&&!e&&!i&&!u&&!c&&!d&&!a&&!h)return null;const v=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${v}`,I=l===0;return o.jsxs(pe,{className:g.cx("base-info","lg:text-left",m&&"!text-center",r),...w,children:[d&&o.jsx("div",{children:d}),(c||u)&&o.jsx("div",{className:g.cx("section__tag",(s==null?void 0:s.tag)||(s==null?void 0:s.badge)),children:c||u}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(x.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(p==null?void 0:p.color)&&{color:`${b(p.color)} !important`}},className:g.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",I?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:P,children:t}),e&&(n?o.jsx(x.Box,{sx:{...(y==null?void 0:y.color)&&{color:`${b(y.color)} !important`}},className:g.cx("section__description","text-gray-800","dark:text-gray-100",_[v],s.description,"page-kit-section__description"),children:o.jsx(Kt.default,{codeOptions:{showActionButton:!1,theme:Et.materialDark},children:e})}):o.jsx(x.Typography,{sx:{whiteSpace:"pre-wrap",...(y==null?void 0:y.color)&&{color:`${b(y.color)} !important`}},className:g.cx("section__description","text-gray-800","dark:text-gray-100",_[v],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(R,{actions:i,center:m,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const q=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function yt(t){if(t.type===f.Fragment){const n=(t.props.children||[]).filter(i=>f.isValidElement(i));return n.length===1?yt(n[0]):n.length>1}return Array.isArray(t)}const C="&>*";function X({children:t,col:e,gap:n,className:i,align:r,sx:s,type:d,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=k.useTheme(),c=Number(Math.floor(100/e*100)/100),u={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=u[r]||u.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[e]||0);yt(t)||(p=0);const w=(e-1)*p/e;let b={...s,gap:`${p}rem`};const v={[C]:{width:"100%"}},_={},P={},I={};switch(v.gap="1rem",_.gap=`${p/2}rem`,e){case 3:case 4:_[C]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:v[C]={width:`calc(50% - ${p/2/2}rem)`},_[C]={width:`calc(50% - ${p/2/2}rem)`},P[C]={width:`calc(33.33% - ${p*2/3}rem)`};break}return b[C]={width:`calc(${c}% - ${w}rem)`},b[`@media (max-width: ${l.breakpoints.values.xl}px)`]=I,b[`@media (max-width: ${l.breakpoints.values.lg}px)`]=P,b[`@media (max-width: ${l.breakpoints.values.md}px)`]=_,b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=v,d==="wall"&&(b={...s,gap:`${p}rem`},b[C]={width:`calc(${c}% - ${w}rem)`},v[C]={width:`calc(45% - ${p/2/2}rem)`},b[`@media (max-width: ${l.breakpoints.values.sm}px)`]=v),o.jsx(x.Box,{className:g.cx("flex flex-wrap flex-row h-full",m,i),sx:b,...a,children:t})}function xe(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function he(t=""){if(t.startsWith("data:image/svg+xml,"))return!0;const e=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return e.test(t)||n.test(t)}function T(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function fe(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function ge(t){let e={};return typeof t=="string"?rt.isGradient(t)?e.image=t:(e.image=j.getImageAbsoluteUrl(t),rt.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function ye(){const[t,e]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{e(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),t}function st(t,e,n,i,r){let s=null;const{color:d="",image:a}=ge(e);if(a&&he(a)){delete n.backgroundColor;const l=!(t.mobile.apple.device||xe())&&T(a),c=T(a)&&i?j.autoResizeImage(j.getImageAbsoluteUrl(i),1200,"quality"):"";l?s=o.jsx(x.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:c,src:T(a)?a:j.autoResizeImage(a,1200,"quality"),sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},a):s=o.jsx(J.ResponsiveImage,{src:T(a)&&i?c: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"}},r||a)}else a?n.backgroundImage=`${a} !important`:d&&(n.backgroundColor=`${d} !important`);return s}function be({autoWidth:t,children:e,...n}){return t?o.jsx(x.Box,{display:"flex",...n,children:e}):o.jsx(x.Container,{...n,children:e})}function L({dark:t=!1,children:e,className:n,sx:i={},boxed:r={show:!1},padding:s="normal",boxProps:d,type:a,...l}){const c={...i},u=xt.default(p=>p.breakpoints.down("md"));t&&(c.color=it.default.common.white,c.backgroundColor=`${it.default.grey[900]} !important`),r.show&&(c.display="flex");const m=f.useMemo(()=>!Number(l.boxMaxWidth)||u?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,u,a]),h=ft({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(we,{component:"section",styles:{...c,...h},className:g.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:t}),...N.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(be,{autoWidth:l==null?void 0:l.autoWidth,className:g.cx("section-content h-full"),sx:m,children:r.show?o.jsx(bt,{...d,boxed:r,children:e}):e})})}function bt({background:t="",backgroundVideoPoster:e,children:n,sx:i={},boxed:r={show:!1},className:s="",styles:d={},...a}){const l={...d,...i},c=mt.useColorConvert();let u=null;const m=xt.default(y=>y.breakpoints.up("sm")),h=Xt.default(),p=ye();return t&&(u=st(h,typeof t=="string"?c(t):t,l,e,p)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=m?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(u=st(h,typeof(r==null?void 0:r.background)=="string"?c(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,p))),o.jsxs(x.Box,{...a,sx:{...l,...u?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:g.cx(s,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[u,n]})}const we=k.styled(bt)`
|
|
64
64
|
&:nth-of-type(even) {
|
|
65
65
|
background: #f8f8f8;
|
|
66
66
|
}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
`;function Q({icon:t,...e}){return o.jsx(pt.Icon,{icon:t,...e,ref:null})}function S(t,e){const
|
|
79
|
+
`;function Q({icon:t,...e}){return o.jsx(pt.Icon,{icon:t,...e,ref:null})}function S(t,e){const n=K.default(t,e),i=N.default(t,e);return[n,i]}const wt=["title","description","actions","badge","tag","prepend","append","logo"];function je({image:t,imageBorder:e,imageShadow:n,className:i,reverse:r=!1,fullSizeImage:s,...d}){const[a,l]=S(d,q),c=Object.keys(a).length>0&&Object.values(K.default(a,wt)).filter(Boolean).length>0&&o.jsx(E,{...a}),u=f.isValidElement(t)?t:o.jsx(x.Box,{component:"img",src:t,alt:"",className:"block"}),m=["phone","macbook"].includes(e),h=t&&o.jsx(x.Box,{className:g.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a!=null&&a.center?"flex justify-center items-center":""),sx:{border:e===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":m?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:m?o.jsx(Qt.default,{type:e,sx:{width:"100%"},children:u}):u});return o.jsx(L,{className:g.cx("section--block",i,s&&!r&&g.css`
|
|
80
80
|
.section-bg {
|
|
81
81
|
height: 80%;
|
|
82
82
|
}
|
|
@@ -93,16 +93,16 @@
|
|
|
93
93
|
width: 100%;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`:void 0,children:
|
|
96
|
+
`:void 0,children:r?o.jsxs(o.Fragment,{children:[h,c]}):o.jsxs(o.Fragment,{children:[c,h]})})})}const A=["editing","height","locale","dev","sx"];function _e(t){const{className:e,...n}=t;return o.jsx(ve,{...n,className:g.cx("BlockBase-root",e)})}const ve=k.styled(x.Box)`
|
|
97
97
|
position: relative;
|
|
98
98
|
color: ${({theme:t})=>t.palette.text.primary};
|
|
99
|
-
`;function ke({widget:t,reverse:e,projectId:
|
|
99
|
+
`;function ke({widget:t,reverse:e,projectId:n,assistantId:i,working:r,submitTitle:s,submitIcon:d,submitColor:a,placeholder:l,loadingIndicator:c,section:u,...m}){const[{editing:h},p]=S(m,A),[y,w]=S(p,q),b=n&&i?{projectId:n,gitRef:"main",assistantId:i,working:!0}:void 0,v={children:s,endIcon:d?o.jsx(Q,{icon:d}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},_=[],P=l&&o.jsx(x.Typography,{variant:"caption",color:"text.disabled",children:l}),I=c&&o.jsx(x.Typography,{variant:"caption",color:"text.disabled",children:c});Object.keys(y).length>0&&Object.values(K.default(y,wt)).filter(Boolean).length>0&&_.push(o.jsx(E,{...y},"base-info")),b&&(t==="form"?_.push(o.jsx(F.AIForm,{identifier:b,SubmitProps:v},"form")):t==="result"?_.push(o.jsx(F.AIFormResult,{identifier:b,placeholder:P,loadingIndicator:I},"result")):_.push(o.jsxs(x.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(F.AIForm,{identifier:b,BoxProps:{flex:1},SubmitProps:v}),o.jsx(F.AIFormResult,{identifier:b,BoxProps:{flex:1},placeholder:P,loadingIndicator:I})]},"form-result"))),e&&_.reverse();const et=x.useTheme(),vt=f.useMemo(()=>x.createTheme(Rt.deepmerge(et,{palette:{primary:a?{main:a}:void 0}})),[a,et]);return o.jsx(Tt.ErrorBoundary,{fallbackRender:j.ErrorView,children:o.jsx(x.ThemeProvider,{theme:vt,children:o.jsx(L,{...w,sx:h?{pointerEvents:"none"}:{},children:o.jsx(X,{col:_.length,children:_})})})})}const jt=f.createContext({pages:[],project:void 0}),{Provider:$e,Consumer:vo}=jt;function _t(){return f.useContext(jt)}function Se({icon:t,className:e="",size:n="1rem",...i}){return o.jsx(Ne,{component:Q,className:g.cx("css-icon",e),size:n,...i,icon:t})}const Ne=k.styled(x.Box)`
|
|
100
100
|
&.css-icon {
|
|
101
101
|
display: inline-block;
|
|
102
102
|
width: ${({size:t})=>t};
|
|
103
103
|
height: ${({size:t})=>t};
|
|
104
104
|
}
|
|
105
|
-
`;function Ce({icon:t,className:e="",size:
|
|
105
|
+
`;function Ce({icon:t,className:e="",size:n="1rem",imageMeta:i,...r}){const s=j.autoResizeImage(j.getImageAbsoluteUrl(t),540),[d,a]=f.useState(!1),l=k.useTheme();return d?o.jsx(Se,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:e,...r}):o.jsx(Be,{className:g.cx("image-icon",e),size:n,...r,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:i==null?void 0:i.naturalWidth,height:i==null?void 0:i.naturalHeight,alt:(i==null?void 0:i.filename)||"card-icon",loading:"lazy"})})}const Be=k.styled(x.Box)`
|
|
106
106
|
display: inline-block;
|
|
107
107
|
width: ${({size:t})=>t};
|
|
108
108
|
height: ${({size:t})=>t};
|
|
@@ -111,9 +111,9 @@
|
|
|
111
111
|
height: 100%;
|
|
112
112
|
width: 100%;
|
|
113
113
|
}
|
|
114
|
-
`,Z=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function Y({icon:t,size:e="1rem",imageMeta:
|
|
114
|
+
`,Z=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function Y({icon:t,size:e="1rem",imageMeta:n,...i}){const r=window.isNaN(e)?e:`${e}px`;return Z(t)?o.jsx(pt.Icon,{icon:t}):o.jsx(Pe,{component:Ce,imageMeta:n,className:"base-icon",icon:t,size:r,...i})}const Pe=k.styled(x.Box)`
|
|
115
115
|
flex-shrink: 0;
|
|
116
|
-
`;function z({text:t,children:e,icon:
|
|
116
|
+
`;function z({text:t,children:e,icon:n="",endIcon:i,color:r="primary",link:s="",href:d="",...a}){const l=n?o.jsx(Y,{icon:n}):null,c=i?o.jsx(Y,{icon:i}):null,u=s||d,m={...a};return u&&(m.href=u,H.default(u)&&(m.target=m.target||"_blank")),o.jsx(Zt.default,{startIcon:l,endIcon:c,color:r,...m,children:t||e})}function tt({editing:t,text:e,...n}){const{pages:i=[]}=_t(),r=i.find(s=>s.id===(n.link||n.linkId));if(t)return o.jsx(z,{...N.default(n,["link","linkId"]),children:e});if(r){const s=r.path||"/";return o.jsx(G.Link,{to:s,children:o.jsx(z,{...N.default(n,["link","linkId"]),children:e})})}return o.jsx(z,{...N.default(n,"linkId"),children:e})}function B({type:t="",icon:e="",size:n="3rem",className:i="",...r}){return o.jsx(Y,{icon:e||t,size:n,className:g.cx("content-icon",i),...r})}B.propTypes={};B.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Ie({to:t,base:e,children:n,className:i,activeClassName:r="active",target:s="auto",autoExternalMark:d=!1,useRouterLink:a,...l}){const{pages:c=[],locale:u=""}={},m=e?D.join("/",e):e||"";let h=s==="auto"?"_self":s,p=D.join(m,t);const y=d?H.default(p):!1;if(e)return p=D.join(m,u,t),o.jsx("a",{className:`no-underline ${i}`,href:W.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:n});if(H.default(t))s==="auto"&&(h="_blank"),p=t;else{W.isRelative(p)&&(p=D.join(window.location.pathname,p));const w=W.parseURL(`${window.location.origin}${p}`),b=c.some(v=>v.pathname===w.pathname);if(a||b)return o.jsx(G.NavLink,{end:!0,to:W.withoutTrailingSlash(p),className:({isActive:v})=>g.cx(i,v?r:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${i}`,href:W.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[n,y&&o.jsx(B,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function O({prepend:t,append:e,children:n,className:i="",dark:r=!1,border:s=!0,...d}){let a={};const{pages:l=[]}=_t(),c=l.find(h=>h.id===d.link),u=!n||Gt.default.Children.toArray(n).every(h=>h===null);d.link&&(a={component:Ie,to:(c==null?void 0:c.path)||d.link,useRouterLink:!0});const m=r&&s;return o.jsxs(Re,{className:g.cx("base-card card",{"border-gray-200":s},{"dark:border-gray-500":m},{dark:r,"border-transparent":!s},i),...a,...N.default(d,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!u&&o.jsx("div",{className:"card__body",children:n}),e]})}const Re=k.styled(x.Box)`
|
|
117
117
|
&.base-card {
|
|
118
118
|
text-align: left;
|
|
119
119
|
border-width: 1px;
|
|
@@ -128,12 +128,25 @@
|
|
|
128
128
|
.card__body {
|
|
129
129
|
padding: 15px 15px;
|
|
130
130
|
}
|
|
131
|
-
`;function U({align:t="left",title:e,titleProps:
|
|
131
|
+
`;function U({align:t="left",title:e,titleProps:n={},description:i,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(x.Typography,{className:g.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...n,children:e}),i&&o.jsx(x.Typography,{className:g.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:i})]})}function We({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:d={},descriptionProps:a={},actions:l,align:c,...u}){const m=Z(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(Te,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&t?o.jsx(x.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(B,{icon:t,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(U,{align:c,title:e,titleProps:d,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:c,actions:l,className:"mt-4"}):null]})}const Te=k.styled(O)`
|
|
132
132
|
${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
|
|
133
133
|
&:hover {
|
|
134
134
|
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
135
135
|
}`:""}
|
|
136
136
|
|
|
137
|
+
.card__title {
|
|
138
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
139
|
+
a {
|
|
140
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.card__description {
|
|
144
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
145
|
+
a {
|
|
146
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
137
150
|
.card__image__wrap {
|
|
138
151
|
padding-top: 61.8%;
|
|
139
152
|
width: 100%;
|
|
@@ -149,7 +162,7 @@
|
|
|
149
162
|
height: 100%;
|
|
150
163
|
object-position: top center;
|
|
151
164
|
}
|
|
152
|
-
`,at="section";function lt({title:t,image:e,imageMeta:
|
|
165
|
+
`,at="section";function lt({title:t,image:e,imageMeta:n,description:i,actions:r,align:s,listType:d="",className:a="",...l}){return o.jsxs(ze,{className:g.cx("card",`list-type-${d}`,a),align:s,...l,children:[e&&o.jsx(B,{icon:e,color:"primary.main",size:d==="icon-title"?"1.2rem":"3rem",imageMeta:n}),t||i?o.jsx(U,{align:s,title:t,description:i}):null,r!=null&&r.length?o.jsx(R,{align:s,actions:r,className:"mt-4"}):null]})}const ze=k.styled(O)`
|
|
153
166
|
padding: 5vw 4vw;
|
|
154
167
|
box-sizing: border-box;
|
|
155
168
|
/* min-height: 320px; */
|
|
@@ -209,7 +222,7 @@
|
|
|
209
222
|
text-align: left;
|
|
210
223
|
box-sizing: border-box;
|
|
211
224
|
}
|
|
212
|
-
`;function Ee({image:t,title:e,description:
|
|
225
|
+
`;function Ee({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:d={},descriptionProps:a={},actions:l,align:c,...u}){const m=Z(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(qe,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&t?o.jsx(x.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(B,{icon:t,color:"primary.main"})}):h&&o.jsx(x.Box,{component:"img",className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(U,{align:c,title:e,titleProps:d,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:c,actions:l,className:"mt-4"}):null]})}const qe=k.styled(O)`
|
|
213
226
|
${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
|
|
214
227
|
&:hover {
|
|
215
228
|
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
@@ -233,7 +246,7 @@
|
|
|
233
246
|
.card__image {
|
|
234
247
|
max-height: 60px;
|
|
235
248
|
}
|
|
236
|
-
`,ct="section";function Le({title:t,image:e,imageMeta:
|
|
249
|
+
`,ct="section";function Le({title:t,image:e,imageMeta:n,iconSize:i=100,description:r,actions:s,align:d,className:a="",...l}){return o.jsx(Ae,{className:g.cx("card",a),...l,children:o.jsxs(x.Box,{className:"flex items-center",children:[e&&o.jsx(B,{icon:e,color:"primary.main",size:i,imageMeta:n}),o.jsxs(x.Box,{className:"flex-1 ml-4",children:[o.jsx(U,{align:d,title:t,description:r}),o.jsx(R,{align:d,actions:s,className:"mt-4"})]})]})})}const Ae=k.styled(O)`
|
|
237
250
|
padding: 5vw 4vw;
|
|
238
251
|
text-align: left;
|
|
239
252
|
box-sizing: border-box;
|
|
@@ -257,11 +270,13 @@
|
|
|
257
270
|
.card__title {
|
|
258
271
|
font-weight: 700;
|
|
259
272
|
margin-bottom: 12px;
|
|
273
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
260
274
|
a {
|
|
261
275
|
color: ${({theme:t})=>t.palette.primary.main};
|
|
262
276
|
}
|
|
263
277
|
}
|
|
264
278
|
.card__description {
|
|
279
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
265
280
|
a {
|
|
266
281
|
color: ${({theme:t})=>t.palette.primary.main};
|
|
267
282
|
}
|
|
@@ -289,8 +304,19 @@
|
|
|
289
304
|
text-align: left;
|
|
290
305
|
box-sizing: border-box;
|
|
291
306
|
}
|
|
292
|
-
`;function Oe({title:t,titleProps:e={},description:
|
|
293
|
-
|
|
307
|
+
`;function Oe({title:t,titleProps:e={},description:n,descriptionProps:i={},image:r,imageMeta:s,className:d="",align:a,hoverStyle:l,...c}){return o.jsxs(Ue,{className:g.cx("card-simple",d,`hover-style__${l}`),align:a,...c,children:[r&&o.jsx(B,{icon:r,color:"primary.main",imageMeta:s}),t||n?o.jsx(U,{align:a,title:t,titleProps:e,description:n,descriptionProps:i}):null]})}const Ue=k.styled(O)`
|
|
308
|
+
.card__title {
|
|
309
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
310
|
+
a {
|
|
311
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
.card__description {
|
|
315
|
+
color: ${({theme:t})=>t.palette.text.primary};
|
|
316
|
+
a {
|
|
317
|
+
color: ${({theme:t})=>t.palette.primary.main};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
294
320
|
|
|
295
321
|
&.hover-style__default {
|
|
296
322
|
&.card-simple {
|
|
@@ -374,7 +400,7 @@
|
|
|
374
400
|
}
|
|
375
401
|
}
|
|
376
402
|
}
|
|
377
|
-
`;function Fe({type:t="default",...e}){const i={article:We,simple:Oe,news:Le,default:lt,wall:Ee}[t]||lt;return o.jsx(i,{...t==="news"?e:N.default(e,"iconSize")})}function De({list:t=[],align:e="top",cards:
|
|
403
|
+
`;function Fe({type:t="default",...e}){const i={article:We,simple:Oe,news:Le,default:lt,wall:Ee}[t]||lt;return o.jsx(i,{...t==="news"?e:N.default(e,"iconSize")})}function De({list:t=[],align:e="top",cards:n,listBorder:i=!0,listType:r="",col:s=3,gap:d,iconColor:a,className:l="",type:c="default",dark:u=!1,textAlign:m="left",hoverStyle:h,...p}){return o.jsx(X,{type:c,className:g.cx("card-list py-1",l,"items-stretch"),col:s,gap:d,align:e,...p,children:n||t.map(y=>o.jsx(Fe,{borderColor:i,iconColor:a,type:c,listType:r,dark:u,...y,align:m,style:d===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},y.id))})}const Me=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],Ve=k.styled(L)`
|
|
378
404
|
a .card {
|
|
379
405
|
color: #404040;
|
|
380
406
|
cursor: pointer;
|
|
@@ -389,7 +415,7 @@
|
|
|
389
415
|
a:hover .card {
|
|
390
416
|
color: #404040;
|
|
391
417
|
}
|
|
392
|
-
`;function He({className:t,...e}){const[
|
|
418
|
+
`;function He({className:t,...e}){const[n,i]=S(e,q),[r,s]=S(i,Me);return o.jsxs(Ve,{className:g.cx("section--card-list",t),type:e.type,...s,children:[Object.keys(n).length>0&&o.jsx(E,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(De,{...r,dark:!!e.dark})]})}const Ye=k.styled(He)`
|
|
393
419
|
.card__description {
|
|
394
420
|
white-space: pre-wrap;
|
|
395
421
|
}
|
|
@@ -404,15 +430,15 @@
|
|
|
404
430
|
.card-simple .card__body::after {
|
|
405
431
|
background: inherit !important;
|
|
406
432
|
}
|
|
407
|
-
`;function Je({section:t,...e}){const[{editing:
|
|
433
|
+
`;function Je({section:t,...e}){const[{editing:n},i]=S(e,A),r=f.useMemo(()=>{var s;return{...N.default(i,["listBorder","list","iconSize","imageSize"]),list:(s=i.list)==null?void 0:s.map(d=>{var a,l;return{...N.default(d,"icon","iconColor"),image:["news","simple","default"].includes(i.type)&&d.icon?d.icon:d.image,actions:(l=(a=d.actions)==null?void 0:a.map)==null?void 0:l.call(a,c=>o.jsx(tt,{...c,editing:n},c.id)),border:i.listBorder,iconSize:i.iconSize,imageSize:i.imageSize,hoverStyle:i.hoverStyle}})}},[i]);return o.jsx(Ye,{style:n?{pointerEvents:"none"}:{},...r})}function Ge({properties:t,section:e,locale:n,dev:i}){var r;return(r=e==null?void 0:e.config)!=null&&r.componentId?o.jsx(J.CustomComponentRenderer,{instanceId:e.id,componentId:e.config.componentId,blockletId:e.config.blockletId,blockletTitle:e.config.blockletTitle,componentName:e.config.componentName,locale:n,properties:t,dev:i}):o.jsx(x.Box,{textAlign:"center",py:2,children:o.jsx(x.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function Ke({src:t,dataId:e,isEdit:n=!1,height:i="100%",onLoad:r=()=>{}}){return o.jsx(Yt.EmbedIframe,{isEdit:n,embedId:e,src:t,height:i,onLoad:()=>{r()}})}function Xe({dataId:t,src:e,actions:n,center:i,onLoad:r,...s}){const[d,a]=S(s,q);return o.jsxs(L,{...a,children:[Object.keys(d).length>0&&o.jsx(E,{center:i,...d}),o.jsx(Ke,{dataId:t,src:e,onLoad:r,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:i})]})}const Qe={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function Ze({section:t,id:e,src:n,...i}){const r=`${e}-${i.locale}`,[{editing:s},d]=S(i,A),a=f.useRef({}),l=JSON.parse(JSON.stringify(d)),{message:c}=Mt.useMessage(r,"server"),u=Vt.useLatest(JSON.parse(JSON.stringify(d.config)||"{}"));return f.useEffect(()=>{c&&c.onInit(()=>u.current)},[c]),f.useEffect(()=>{const m=JSON.parse(JSON.stringify(d.config)||"{}");te.default(a.current,m)||(a.current=m,c==null||c.send("config-set",m))},[c,d.config]),n?o.jsx(Xe,{...l,dataId:r,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(to,{children:'Please set the "src" attribute for this block'})}const to=k.styled("div")`
|
|
408
434
|
user-select: none;
|
|
409
435
|
color: #999;
|
|
410
436
|
padding: 8px;
|
|
411
437
|
height: 200px;
|
|
412
|
-
`,eo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function oo(t){var e;if(/youtu\.?be/.test(t))for(const
|
|
438
|
+
`,eo=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function oo(t){var e;if(/youtu\.?be/.test(t))for(const n of eo){const i=(e=n.exec(t))==null?void 0:e[1];if(i)return i}}function ro(t){const e=oo(t);if(e)return`https://youtube.com/embed/${e}`}function no({src:t}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function io(t){return o.jsx(x.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(Jt.TwitterTimelineEmbed,{...t})})}function so({url:t}){const e=f.useRef(null),n=495,[i,r]=f.useState(e.current?e.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const d=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*d))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const d=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*d)),function(){window.removeEventListener("resize",s)}},[i,s]),o.jsx(x.Box,{component:"iframe",ref:e,title:"youtube",width:"100%",height:`${i}px`,src:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{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},lo=k.styled(je)`
|
|
413
439
|
.section__description {
|
|
414
440
|
}
|
|
415
|
-
`;function co({hasImage:t,fullSizeImage:e,boxed:
|
|
441
|
+
`;function co({hasImage:t,fullSizeImage:e,boxed:n,videoPoster:i,imageMeta:r,imageOptimization:s,imageSize:d,section:a,...l}){var p,y;const[{editing:c},u]=S({...l,boxed:e?void 0:n},A);let m=uo(u.image,i,e,r,s,d);t||(m=null);let h=null;return u.actions&&(h=(y=(p=u.actions)==null?void 0:p.map)==null?void 0:y.call(p,(w,b)=>o.jsx(tt,{...w,editing:c},b))),o.jsx(lo,{...u,style:c?{pointerEvents:"none"}:{},image:m,fullSizeImage:t&&e,actions:h})}function uo(t,e,n,i,r,s){if(t){if(t.endsWith(".json"))return o.jsx(no,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(io,{sourceType:"url",url:t});const d=ro(t);if(d)return o.jsx(so,{url:d});const{naturalWidth:a,naturalHeight:l,filename:c}=i||{};if(T(t))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:j.autoResizeImage(j.getImageAbsoluteUrl(e),n?1200:540,r),children:o.jsx("source",{src:j.getImageAbsoluteUrl(t),type:fe(t)})},t);const u=r==="quality"?1:.6;return o.jsx(J.ResponsiveImage,{src:j.getImageAbsoluteUrl(t),sizesAttr:{sm:600*u,md:450*u,lg:540*u,...n&&{md:900*u,lg:1200*u}},width:a&&`${a}px`,height:l&&`${l}px`,alt:c??t,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const mo=["production","draft"];function po({mode:t,version:e}={}){const n=e&&typeof e=="number"?{mode:t,version:e}:{mode:t};return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(i=>i.data)}function xo({mode:t,routes:e}){return j.api.post(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,routes:e}).then(n=>n.data)}function ho({locale:t,sort:e,page:n,limit:i,mode:r}={}){return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:t,sort:e,page:n,limit:i,mode:r}}).then(s=>s.data)}const fo={style:"list",sort:"-updatedAt"},dt=20;function go({style:t,sort:e,section:n,...i}){const[{editing:r,locale:s},d]=S(i,A),[a,l]=S(d,q),[c,u]=f.useState(),m=f.useRef(!1),h=nt.useUpdate(),p=G.useNavigate(),y=f.useCallback(async()=>{if(!m.current){m.current=!0,h();try{const w=c?Math.floor(c.list.length/dt)+1:1,{list:b,total:v}=await ho({locale:s,sort:e,page:w,limit:dt});u(_=>({list:((_==null?void 0:_.list)??[]).concat(b),total:v}))}finally{m.current=!1,h()}}},[c,s,e,h]);return nt.useMount(()=>{y()}),o.jsxs(L,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(E,{...a}),c?o.jsxs(o.Fragment,{children:[o.jsx(x.Grid,{container:!0,spacing:2,justifyContent:"center",children:c==null?void 0:c.list.map(w=>o.jsx(x.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs(yo,{elevation:0,className:g.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>p(w.slug),children:[!!w.image&&o.jsx(x.CardMedia,{component:"img",alt:"",image:j.autoResizeImage(j.getImageAbsoluteUrl(w.image),540),loading:"lazy"}),o.jsxs(x.CardContent,{children:[o.jsx(x.Typography,{variant:"h6",component:"div",className:ut,children:w.title||w.id}),o.jsx(x.Typography,{variant:"body2",className:ut,children:w.description})]})]})},w.id))}),o.jsx(x.Box,{textAlign:"center",mt:2,children:c.total>c.list.length?o.jsx(z,{variant:"outlined",color:"secondary",onClick:y,loading:m.current,children:"More"}):o.jsx(z,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(x.Box,{p:2,textAlign:"center",children:o.jsx(x.CircularProgress,{size:24})})]})}const ut=g.css`
|
|
416
442
|
display: -webkit-box;
|
|
417
443
|
-webkit-box-orient: vertical;
|
|
418
444
|
-webkit-line-clamp: 2;
|
|
@@ -438,4 +464,4 @@
|
|
|
438
464
|
max-height: 50vw;
|
|
439
465
|
}
|
|
440
466
|
}
|
|
441
|
-
`,bo={iframe:Ze,section:co,"section-card-list":Je,toc:go,"ai-runtime":ke,"custom-component":Ge};function wo({id:t,type:e,mode:
|
|
467
|
+
`,bo={iframe:Ze,section:co,"section-card-list":Je,toc:go,"ai-runtime":ke,"custom-component":Ge};function wo({id:t,type:e,mode:n,config:i,section:r,...s}){const d=bo[e],{getPageMetaStyle:a}=de(),l=f.useMemo(()=>{const{height:m,...h}=i;return h},[i]),c=f.useMemo(()=>{const m={};return e!=="custom-component"&&(m.height=i.height),m.sx=a("sx"),m},[i.height,e,a]),u=d&&o.jsx(d,{mode:n,...l,id:t,section:r});return o.jsx(_e,{...s,...c,children:u})}function jo(t){return t!=null}exports.Action=tt;exports.BlockRenderer=wo;exports.IFrameBlockDefaultProps=Qe;exports.Icon=Q;exports.PageProvider=ue;exports.Provider=$e;exports.STATE_MODES=mo;exports.SectionBlockDefaultProps=ao;exports.TocDefaultProps=fo;exports.getPages=po;exports.nonNullable=jo;exports.publishPages=xo;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),E=require("./state-DytLDIZR.js"),Y=require("@arcblock/ux/lib/Locale/context"),le=require("@arcblock/ux/lib/Result"),ue=require("@blocklet/pages-kit/builtin/page/header"),de=require("@blocklet/pages-kit/contexts/color"),J=require("@blocklet/pages-kit/utils/data-source"),pe=require("@blocklet/pages-kit/utils/route"),ge=require("@blocklet/ui-react/lib/Header"),Z=require("@emotion/css"),N=require("@emotion/react"),me=require("@emotion/styled"),b=require("@mui/material"),G=require("ahooks"),fe=require("isomorphic-dompurify"),he=require("lodash/cloneDeep"),xe=require("lodash/isEmpty"),je=require("lodash/isEqual"),m=require("react"),ye=require("react-helmet"),P=require("react-router-dom"),ee=require("react-use"),M=require("ufo"),I=require("./array-CjyMzwA7.js"),W=require("@arcblock/ux/lib/Theme"),be=require("@blocklet/ui-react/lib/Footer");require("webfontloader");const ve=require("@arcblock/did-connect/lib/Session"),R=t=>t&&t.__esModule?t:{default:t},te=R(le),we=R(ge),ne=R(me),Pe=R(fe),V=R(he),Se=R(xe),oe=R(je),ke=R(be),Re=W.styled(ke.default,{shouldForwardProp:t=>!!t})`
|
|
2
|
+
& > div > .MuiContainer-root {
|
|
3
|
+
max-width: unset;
|
|
4
|
+
}
|
|
5
|
+
`;function Ce({meta:t,...o}){const s=W.useTheme();return e.jsx(Re,{...o,meta:t,theme:s||{}})}function se(t){return e.jsx(b.Box,{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center",...t,children:e.jsx(b.CircularProgress,{size:30})})}function qe(t){return e.jsx(_e,{...t})}const _e=W.styled(b.Box)`
|
|
6
|
+
position: fixed;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
z-index: 999999999999;
|
|
10
|
+
width: 80px;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
text-align: center;
|
|
13
|
+
opacity: 0.7;
|
|
14
|
+
transform: translateX(-23%) translateY(70%) rotate(-45deg);
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
`,Me=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
|
|
17
|
+
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`;function Ee({titleFontFamily:t,descriptionFontFamily:o}){var n;const s=b.useTheme(),r=(n=s==null?void 0:s.typography)==null?void 0:n.fontFamily;m.useEffect(()=>{},[t,o]);const c=`${r}, ${Me}`;return e.jsx(N.Global,{styles:N.css`
|
|
18
|
+
#app {
|
|
19
|
+
font-family: ${c};
|
|
20
|
+
|
|
21
|
+
.page-kit-section__title {
|
|
22
|
+
font-family: ${c};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.page-kit-section__description {
|
|
26
|
+
font-family: ${c};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`})}const{SessionProvider:Ae,SessionContext:Ie,SessionConsumer:Ne,withSession:Ve}=ve.createAuthServiceSessionContext();function $(){return m.useContext(Ie)}function Be(...t){var s;const{session:o}=$();return t.includes((s=o.user)==null?void 0:s.role)}function Te(...t){var r;const{session:o}=$(),s=Be(...t);return((r=window.blocklet)==null?void 0:r.tenantMode)==="multiple"?!!o.user:s}function Le(){const[t]=P.useSearchParams(),{session:o}=$(),s=Te("owner","admin","pagesEditor","member"),r=m.useMemo(()=>{const n=t.get("mode");return I.STATE_MODES.includes(n)?n:"production"},[t]),c=r==="production"?r:o.user?s?r:"production":null;return c?e.jsx(re,{mode:c}):null}function re({mode:t}){if(t!=="draft"){const o=window.__PAGE_STATE__;return o?e.jsx(A,{mode:t,state:o}):e.jsx(Oe,{mode:t,children:({state:s})=>e.jsx(A,{mode:t,state:s})})}return e.jsx(De,{children:({state:o})=>e.jsx(A,{mode:t,state:o})})}const De=m.lazy(()=>Promise.resolve().then(()=>require("./draft-data-QlwpWm4f.js")));function Oe({mode:t,children:o}){const s=document.querySelector('meta[property="pages:version"]'),r=s==null?void 0:s.content,c=E.useProjectId(),n=m.useMemo(()=>{if(r==="{{pagesPublishedAt}}"){const l=localStorage.getItem(E.getProjectPageVersionKey(c??""));return Number(l)?Number(l):new Date().getTime()}return Number(r)},[r]),{loading:g,value:a}=ee.useAsync(()=>I.getPages({mode:t,version:n}),[t,n]);return g?e.jsx(se,{}):a?o({state:a}):null}function A({mode:t,state:o}){const{t:s,locale:r}=Y.useLocaleContext(),[c]=P.useSearchParams(),n=c.get("hiddenBadge")==="true",g=c.get("showPublish")==="true",{pageIds:a,pages:l,routeIds:f,routes:d,supportedLocales:p,config:{defaultLocale:h},resources:v}=o,w=E.getAllComponents(o),j=m.useMemo(()=>p!=null&&p.some(u=>u.locale===r)?r:void 0,[r,p]),B=Object.values(d||{}).find(u=>(u==null?void 0:u.path)==="/")||Object.values(l).find(u=>(u==null?void 0:u.slug)==="/")?void 0:Object.values(l)[0],H=m.useMemo(()=>a.map(u=>{const i=l[u];return i&&{id:i.id,path:M.joinURL("/",j||"",i.slug,t!=="production"?`?mode=${t}`:"")}}).filter(I.nonNullable),[a,l,j,t]),C=([...u])=>(t!=="production"&&g&&u.unshift(e.jsx(m.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(He,{mode:"production",state:o})})),u);return e.jsxs(I.Provider,{value:{pages:H},children:[e.jsxs(P.Routes,{children:[B&&e.jsx(P.Route,{index:!0,element:e.jsx(P.Navigate,{to:M.joinURL("/",j||"",B.slug)})}),f==null?void 0:f.map(u=>{var T,L,S,x;const i=d==null?void 0:d[u];if(!i||!i.displayTemplateId)return null;const q=l[i.displayTemplateId];if(!q)return null;let _=[];if(i.params&&i.params.length>0){const k=pe.generateParamCombinations({basePath:i.path,params:i.params,routeId:i.id,paramsOptions:i.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});_=k==null?void 0:k.map(U=>{var O,K,Q,X;const D=U.paramOptionIds.join("-");return e.jsx(P.Route,{path:M.joinURL(":projectIdOrSlug?",U.path),element:e.jsx(z,{mode:t,components:w,page:q,locale:j,defaultLocale:h,headerAddons:C,state:o,pageData:(X=(Q=(K=(O=i.dataSource)==null?void 0:O.pathDataMappings)==null?void 0:K[D])==null?void 0:Q.dataCache)==null?void 0:X[j||h||"en"]})},D)})}return _.push(e.jsx(P.Route,{path:M.joinURL(":projectIdOrSlug?",i.path),element:e.jsx(z,{mode:t,components:w,page:q,locale:j,defaultLocale:h,headerAddons:C,state:o,pageData:(x=(S=(L=(T=i.dataSource)==null?void 0:T.pathDataMappings)==null?void 0:L[i.id])==null?void 0:S.dataCache)==null?void 0:x[j||h||"en"]})},i.id)),_}),a.map(u=>{const i=l[u];return i?e.jsx(P.Route,{path:M.joinURL(":projectIdOrSlug?",i.slug),element:e.jsx(F,{mode:t,components:w,page:i,locale:j,defaultLocale:h,headerAddons:C})},i.id):null}),v.pages&&Object.values(v.pages).map(({blockletId:u,page:i})=>e.jsx(P.Route,{path:M.joinURL("/",`@${u}`,i.slug),element:e.jsx(F,{mode:t,components:w,page:i,locale:j,defaultLocale:h,headerAddons:C})},i.id)),e.jsx(P.Route,{path:"*",element:e.jsx(b.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(te.default,{status:404,extra:e.jsx(ce,{href:"/",children:s("common.back")})})})})]}),t!=="production"&&!n&&e.jsx(qe,{sx:{bgcolor:"info.light"},children:t}),e.jsx(Ee,{})]})}function z({mode:t,pageData:o,components:s,page:r,locale:c,defaultLocale:n,headerAddons:g,state:a}){const l=G.useReactive({page:null});m.useEffect(()=>{const d=r||null;d?l.page=V.default(d):l.page=null},[r,l]);const f=m.useRef();return m.useEffect(()=>{oe.default(o,f.current)||o&&l.page&&(J.setPageDataSource(l.page,a,c,o),f.current=V.default(o))},[l.page,o,c,a]),l.page?e.jsx(F,{mode:t,components:s,page:l.page,locale:c,defaultLocale:n,headerAddons:g}):null}function Fe({mode:t,state:o,path:s,pageData:r}){const{t:c,locale:n}=Y.useLocaleContext(),{pages:g,supportedLocales:a,config:{defaultLocale:l},resources:f}=o,d=Object.values(g).find(y=>(y==null?void 0:y.slug)===s),p=Object.values(f.pages||{}).find(y=>y.page.slug===s),h=m.useMemo(()=>a!=null&&a.some(y=>y.locale===n)?n:void 0,[n,a]),v=G.useReactive({page:null});m.useEffect(()=>{const y=d||(p==null?void 0:p.page)||null;y?v.page=V.default(y):v.page=null},[d,p]);const w=m.useRef();if(m.useEffect(()=>{oe.default(r,w.current)||r&&v.page&&(J.setPageDataSource(v.page,o,h,r),w.current=V.default(r))},[{}]),!d&&!(p!=null&&p.page))return e.jsx(b.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:e.jsx(te.default,{style:{background:"inherit"},status:404,extra:e.jsx(ce,{href:"/",children:c("common.back")})})});const j=E.getAllComponents(o);return v.page?e.jsx(F,{mode:t,components:j,page:v.page,locale:h,defaultLocale:l}):null}function F({mode:t,components:o,page:s,locale:r,defaultLocale:c,headerAddons:n}){var B,H,C,u,i,q,_,T,L;const g=de.useColorConvert(),a=((B=s.locales)==null?void 0:B[r])??((H=s.locales)==null?void 0:H[c])??{},l=a.title||((C=window.blocklet)==null?void 0:C.appName),f=a.description||((u=window.blocklet)==null?void 0:u.appDescription),d=E.autoResizeImage(E.getImageAbsoluteUrl(a.image),540),{logo:p,brand:h,description:v,...w}=ue.useHeaderState(),j=m.useMemo(()=>S=>{var k;let x=(n==null?void 0:n(S))??S;return x=((k=w.addons)==null?void 0:k.call(w,x))??x,x},[w.addons,n]),y=(i=a.header)!=null&&i.translucent?ie:ae;return e.jsxs(I.PageProvider,{page:s,defaultLocale:c,currentLocale:r,children:[e.jsx(N.Global,{styles:N.css`
|
|
30
|
+
body {
|
|
31
|
+
background-color: ${g(!a.backgroundColor||a.backgroundColor==="transparent"?"background.default":a.backgroundColor)} !important;
|
|
32
|
+
}
|
|
33
|
+
`}),e.jsx(y,{hideNavMenu:!!((q=a.header)!=null&&q.hideNavMenus),translucentTextColor:(_=a.header)==null?void 0:_.translucentTextColor,...p?{logo:p}:{},...h?{brand:h}:{},...v?{description:v}:{},className:Z.cx(((T=a.header)==null?void 0:T.sticky)&&"sticky","page-header"),maxWidth:!1,addons:j}),e.jsx(P.ScrollRestoration,{}),e.jsxs(ye.Helmet,{children:[e.jsx("title",{children:l}),e.jsx("meta",{name:"og:title",content:l}),e.jsx("meta",{name:"og:description",content:f}),e.jsx("meta",{name:"og:image",content:d}),e.jsx("meta",{name:"twitter:image:src",content:d}),e.jsx("meta",{name:"twitter:image",content:d}),e.jsx("meta",{property:"twitter:description",content:f}),e.jsx("meta",{property:"twitter:title",content:l}),e.jsx("meta",{name:"description",content:f})]}),e.jsx(b.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:s.sectionIds.map(S=>{var D,O;const x=s.sections[S];if(!x||x.visibility==="hidden")return null;const k=(D=x.locales)==null?void 0:D[r],U=((O=x.locales)==null?void 0:O[c])??{};return e.jsx(I.BlockRenderer,{id:S,type:x.component,mode:t,section:x,config:{...Se.default(k)?U:k,locale:r,dev:t==="draft"?{mode:t,components:o,defaultLocale:c}:{mode:t}}},S)})}),!((L=a.footer)!=null&&L.hidden)&&e.jsx(Ce,{})]})}const He=m.lazy(()=>Promise.resolve().then(()=>require("./publish-button-BPa7uf5h.js"))),ae=ne.default(we.default)`
|
|
34
|
+
&.sticky {
|
|
35
|
+
position: sticky;
|
|
36
|
+
top: 0;
|
|
37
|
+
}
|
|
38
|
+
`;function Ue({logo:t}){const[o,s]=m.useState(),r=b.useMediaQuery(n=>n.breakpoints.down("sm")),{value:c}=ee.useAsync(()=>{var a,l;const n=new URL(r?((a=window==null?void 0:window.blocklet)==null?void 0:a.appLogo)||"/.well-known/service/blocklet/logo":((l=window==null?void 0:window.blocklet)==null?void 0:l.appLogoRect)||"/.well-known/service/blocklet/logo-rect",window.location.origin);n.searchParams.delete("imageFilter"),n.searchParams.delete("f");const g=n.toString();return new Promise(f=>{fetch(g).then(d=>{const p=d.headers.get("content-type");p!=null&&p.includes("svg")&&d.text().then(h=>{s(h),f(null)}),f(d.url)})})},[r]);if(t)return t;if(o)return e.jsx(b.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:Pe.default.sanitize(o)}});if(c){const n=new URL(c);n.searchParams.set("imageFilter","convert"),n.searchParams.set("f","png"),n.searchParams.set("h","80");const g=n.toString();return e.jsx("img",{src:g,alt:"logo"})}return null}function ie({logo:t,translucentTextColor:o,...s}){const{top:r=0}=G.useScroll(()=>document.getElementById("app"))||{},c=b.useTheme();let n=Math.min(r/800,1),g="";return n>.1?(n=Math.max(n,.6),g=b.alpha(c.palette.text.primary,n)):g=o||"#EEEEEE",e.jsx(ae,{logo:e.jsx(Ue,{logo:t}),...s,className:Z.cx(n<=.7&&"reverse-color"),style:{backgroundColor:b.alpha(c.palette.background.default,n),"--logo-invert":n<=.7?1-n/6:1-n},sx:{backdropFilter:n>=.6?"blur(10px)":"blur(0px)",transition:"all 0.3s ease",position:"fixed !important",left:0,top:0,right:0,bgcolor:"transparent","&.reverse-color":{".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${g} !important`}},"& .navmenu--horizontal":{bgcolor:"transparent !important"},".header-logo > div":{filter:"invert(var(--logo-invert))"},".header-logo":{color:g}}})}const ce=ne.default(b.Button)``;exports.Home=Le;exports.HomeView=re;exports.Loading=se;exports.PageRoutes=A;exports.PageView=F;exports.PageViewByPath=Fe;exports.PageViewWithDataSource=z;exports.TranslucentHeader=ie;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),F=require("./state-DytLDIZR.js"),$=require("@arcblock/ux/lib/Locale/context"),ee=require("@arcblock/ux/lib/Toast"),te=require("@blocklet/pages-kit/utils/route"),P=require("@mui/icons-material"),J=require("@mui/lab"),s=require("@mui/material"),se=require("immer"),ne=require("lodash/difference"),l=require("react"),ie=require("react-use"),re=require("./home-WKpO7IF-.js"),U=require("./array-5NwrYcJ5.js"),G=r=>r&&r.__esModule?r:{default:r},W=G(ee),H=G(ne);function oe(r){const[j,k]=l.useState(!1);return e.jsx(J.LoadingButton,{...r,loading:r.loading||j,onClick:u=>{var b;const p=(b=r.onClick)==null?void 0:b.call(r,u);p instanceof Promise&&(k(!0),p.finally(()=>{k(!1)}))}})}const ae=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 le(){const[r,j]=l.useState(),k=l.useMemo(()=>r?e.jsx(s.Dialog,{...r}):null,[r]),u=l.useCallback(()=>{j(void 0)},[]),p=l.useCallback(({title:b,content:d,cancelText:S="Cancel",okText:f="Ok",onOk:g,onClose:c,okIcon:O,okColor:w="primary",cancelColor:y="primary",DialogContentProps:A,form:M,...z})=>{j({...z,open:!0,children:e.jsxs("form",{onSubmit:R=>R.preventDefault(),children:[b&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:"1px solid #E5E7EB"},children:[e.jsx(s.Box,{children:b}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{u(),c==null||c()},children:e.jsx(ae,{})})]}),d&&e.jsx(s.DialogContent,{...A,sx:{mt:-3,...A==null?void 0:A.sx},children:e.jsx(s.Box,{pt:3,children:d})}),e.jsxs(s.DialogActions,{children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:c??u,children:S}),e.jsx(oe,{variant:"contained",color:w||"primary",startIcon:O,loadingPosition:O?"start":"center",onClick:async()=>{await(g==null?void 0:g()),u()},type:"submit",children:f})]})]}),onClose:c??u})},[u]);return{dialog:k,showDialog:p,closeDialog:u}}const ce=l.forwardRef(({mode:r,state:j},k)=>{const{t:u}=$.useLocaleContext(),[p,b]=l.useState(!1),{dialog:d,showDialog:S}=le(),f=F.useProjectId(),g=l.useCallback(O=>{let w=[];S({title:u("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(P.Warning,{}),children:u("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(de,{state:j,toMode:r,onChange:y=>w=y,defaultRouteIds:O})})]}),okText:u("maker.publish"),cancelText:u("common.cancel"),onOk:async()=>{if((w==null?void 0:w.length)===0){const y=u("maker.publishSelectPagesMessage");throw W.default.error(y),new Error(y)}localStorage.setItem(F.getProjectPageVersionKey(f??""),String(new Date().getTime())),b(!0);try{await U.publishPages({mode:r,routes:w}),W.default.success(u("maker.publishSuccessMessage"))}catch(y){throw W.default.error(y.message),y}finally{b(!1)}}})},[r,j,u,f,S]);l.useImperativeHandle(k,()=>({openPublishDialog:g}));const c=l.useCallback(()=>{g()},[g]);return e.jsxs(e.Fragment,{children:[e.jsx(J.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:c,loading:p,disabled:p,children:u("maker.publishToProduction")}),d]})});function ue({routePathInfo:r,checked:j,onClick:k,route:u}){var d,S,f,g,c;const{t:p}=$.useLocaleContext(),b=!((d=r.routeMetaData)!=null&&d.publishedAt)||((S=r.routeMetaData)==null?void 0:S.updatedAt)&&new Date((f=r.routeMetaData)==null?void 0:f.updatedAt)>new Date((g=r.routeMetaData)==null?void 0:g.publishedAt);return e.jsx(s.ListItem,{sx:{pl:4,pr:3},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{display:"flex",alignItems:"center",sx:{minWidth:"auto"},children:[b&&e.jsx(s.Box,{mr:.35,className:"visible",color:"warning.main",sx:{display:"flex",alignItems:"center"},title:p("maker.pages.needPublish"),children:e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(P.Sync,{fontSize:"small",sx:{fontSize:"16px"}})})}),(!((c=r.routeMetaData)!=null&&c.isPublic)||!u.isPublic)&&e.jsx(s.Box,{className:"visible",color:"warning.main",children:e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(P.VisibilityOff,{fontSize:"small",sx:{fontSize:"16px"}})})})]}),children:e.jsxs(s.ListItemButton,{onClick:k,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:j,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:r.path,primaryTypographyProps:{fontSize:"0.8rem",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pr:1}})]})})}function de({state:r,toMode:j,onChange:k,defaultRouteIds:u}){const{t:p,locale:b}=$.useLocaleContext(),[d,S]=l.useState(!1),[f,g]=l.useState(()=>u?Object.fromEntries(u.filter(t=>!t.includes("-")).map(t=>[t,!0])):{}),[c,O]=l.useState({}),[w,y]=l.useState(()=>u?Object.fromEntries(u.filter(t=>t.includes("-")).map(t=>[t,!0])):{}),[A,M]=l.useState({}),{loading:z,error:R,value:x}=ie.useAsync(()=>U.getPages({mode:j}),[j]);if(R)throw R;const T=l.useMemo(()=>r.routeIds||[],[r]),I=l.useMemo(()=>(x==null?void 0:x.pageIds)||[],[x]),D=l.useMemo(()=>!T||!r.routes?[]:JSON.parse(JSON.stringify(T)).sort((o,i)=>{var h,m;const n=(h=r.routes)==null?void 0:h[o],a=(m=r.routes)==null?void 0:m[i];return n!=null&&n.publishedAt&&new Date(n.publishedAt).getTime()<new Date(n.updatedAt).getTime()?-1:a!=null&&a.publishedAt&&new Date(a.publishedAt).getTime()<new Date(a.updatedAt).getTime()?1:new Date((n==null?void 0:n.updatedAt)??"").getTime()-new Date((a==null?void 0:a.updatedAt)??"").getTime()}),[r,T]),q=l.useMemo(()=>{if(!D)return[];if(!c)return D;const t=[...D].filter(o=>!c[o]);return Object.values(c).forEach(o=>{o.forEach(i=>{t.push(`${i.originalRouteId}-${i.paramOptionIds.join("-")}`)})}),t},[D,c]),L=l.useMemo(()=>!x||!I||!q?[]:H.default(I,q),[q,x,I]),C=l.useMemo(()=>T?[...T].concat(L):L,[T,L]),_=l.useCallback(()=>{const t={};D==null||D.forEach(o=>{var n;const i=(n=r.routes)==null?void 0:n[o];if(i&&i.params&&i.params.length>0&&i.paramsOptions&&i.paramsOptions.length>0){const a=te.generateParamCombinations({basePath:i.path,params:i.params,routeId:i.id,paramsOptions:i.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});a.length>0&&(t[i.id]=a)}}),O(t)},[D,r.routes]);l.useEffect(()=>{_()},[_]),l.useEffect(()=>{M(t=>{const o={...t};return Object.keys(c).forEach(i=>{var n;c[i]&&((n=c[i])==null?void 0:n.length)>0&&o[i]===void 0&&(o[i]=!0)}),o})},[c]);const K=l.useRef(!0);l.useEffect(()=>{y(t=>{const o={...t};return Object.keys(c).length===0||(Object.keys(c).forEach(i=>{const n=c[i]||[],a=d||!!f[i];n.forEach(h=>{const m=`${i}-${h.paramOptionIds.join("-")}`;K.current?o[m]=a||t[m]||!1:o[m]=a})}),K.current=!1),o})},[f,c,d]);const Q=(t,o)=>{o.stopPropagation(),M(i=>{const n={...i};return n[t]=!n[t],n})},N=l.useCallback(t=>{g(o=>{const i=se.produce(o,n=>{d?(Object.assign(n,Object.fromEntries(C.map(a=>[a,!0]))),delete n[t]):n[t]?(delete n[t],L.includes(t)&&(T||[]).filter(a=>{var h,m;return((h=r.pages[a])==null?void 0:h.slug)===((m=x==null?void 0:x.pages[t])==null?void 0:m.slug)}).forEach(a=>{delete n[a]})):(n[t]=!0,T&&T.includes(t)&&L.filter(a=>{var h,m;return((h=x==null?void 0:x.pages[a])==null?void 0:h.slug)===((m=r.pages[t])==null?void 0:m.slug)}).forEach(a=>{n[a]=!0}))});return S(H.default(C,Object.keys(i)).length===0),i})},[d,C,L,r,x,T]),X=l.useCallback((t,o)=>{const i=`${t}-${o.paramOptionIds.join("-")}`;y(n=>{var m;const a={...n};a[i]=!a[i];const h=((m=c[t])==null?void 0:m.every(B=>a[`${t}-${B.paramOptionIds.join("-")}`]))??!1;return g(B=>{if(h&&!B[t])return{...B,[t]:!0};if(!h&&B[t]){const v={...B};return delete v[t],v}return B}),a})},[c]),Y=l.useCallback(()=>{S(t=>(t&&g({}),!t))},[]);return l.useEffect(()=>{const t=d?C:Object.keys(f),o=Object.entries(w).filter(([,n])=>n).map(([n])=>n).filter(n=>n!==void 0),i=Array.from(new Set([...t,...o]));k(d?null:i)},[d,f,w,C,k]),z?e.jsx(re.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:700},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,bgcolor:"background.paper",zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:Y,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:p("common.all")})]})}),D.map(t=>{var B,v;const o=(B=r.routes)==null?void 0:B[t];if(!o)return null;const i=!1,n=c&&c[t]&&((v=c[t])==null?void 0:v.length)>0,a=A[t]!==!1,h=c[t]||[],m=!o.publishedAt||o.updatedAt&&new Date(o.updatedAt).getTime()>new Date(o.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:[m&&e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(P.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!o.isPublic&&e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(P.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),i,n&&e.jsx(s.Box,{onClick:E=>Q(t,E),sx:{display:"inline-flex",alignItems:"center",mr:.35,cursor:"pointer",color:"info.main"},children:a?e.jsx(P.KeyboardArrowDown,{fontSize:"small",sx:{fontSize:"18px"}}):e.jsx(P.KeyboardArrowRight,{fontSize:"small",sx:{fontSize:"18px"}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(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:o.path,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})}),n&&e.jsx(s.Collapse,{in:a,children:e.jsx(s.Box,{children:h.map(E=>{const V=`${t}-${E.paramOptionIds.join("-")}`,Z=w[V]||!1;return e.jsx(ue,{routePathInfo:E,checked:d||Z,onClick:()=>X(t,E),route:o},V)})})})]},t)}),L.map(t=>{var i,n;const o=x==null?void 0:x.pages[t];return o?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(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:o.slug,secondary:(n=(i=o.locales)==null?void 0:i[b])==null?void 0:n.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},t):null})]})}exports.default=ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),F=require("./state-DytLDIZR.js"),$=require("@arcblock/ux/lib/Locale/context"),ee=require("@arcblock/ux/lib/Toast"),te=require("@blocklet/pages-kit/utils/route"),P=require("@mui/icons-material"),J=require("@mui/lab"),s=require("@mui/material"),se=require("immer"),ne=require("lodash/difference"),l=require("react"),ie=require("react-use"),re=require("./home-BlT3oqu3.js"),U=require("./array-CjyMzwA7.js"),G=r=>r&&r.__esModule?r:{default:r},W=G(ee),H=G(ne);function oe(r){const[j,k]=l.useState(!1);return e.jsx(J.LoadingButton,{...r,loading:r.loading||j,onClick:u=>{var b;const p=(b=r.onClick)==null?void 0:b.call(r,u);p instanceof Promise&&(k(!0),p.finally(()=>{k(!1)}))}})}const ae=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 le(){const[r,j]=l.useState(),k=l.useMemo(()=>r?e.jsx(s.Dialog,{...r}):null,[r]),u=l.useCallback(()=>{j(void 0)},[]),p=l.useCallback(({title:b,content:d,cancelText:S="Cancel",okText:f="Ok",onOk:g,onClose:c,okIcon:O,okColor:w="primary",cancelColor:y="primary",DialogContentProps:A,form:M,...z})=>{j({...z,open:!0,children:e.jsxs("form",{onSubmit:R=>R.preventDefault(),children:[b&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:"1px solid #E5E7EB"},children:[e.jsx(s.Box,{children:b}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{u(),c==null||c()},children:e.jsx(ae,{})})]}),d&&e.jsx(s.DialogContent,{...A,sx:{mt:-3,...A==null?void 0:A.sx},children:e.jsx(s.Box,{pt:3,children:d})}),e.jsxs(s.DialogActions,{children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:c??u,children:S}),e.jsx(oe,{variant:"contained",color:w||"primary",startIcon:O,loadingPosition:O?"start":"center",onClick:async()=>{await(g==null?void 0:g()),u()},type:"submit",children:f})]})]}),onClose:c??u})},[u]);return{dialog:k,showDialog:p,closeDialog:u}}const ce=l.forwardRef(({mode:r,state:j},k)=>{const{t:u}=$.useLocaleContext(),[p,b]=l.useState(!1),{dialog:d,showDialog:S}=le(),f=F.useProjectId(),g=l.useCallback(O=>{let w=[];S({title:u("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(P.Warning,{}),children:u("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(de,{state:j,toMode:r,onChange:y=>w=y,defaultRouteIds:O})})]}),okText:u("maker.publish"),cancelText:u("common.cancel"),onOk:async()=>{if((w==null?void 0:w.length)===0){const y=u("maker.publishSelectPagesMessage");throw W.default.error(y),new Error(y)}localStorage.setItem(F.getProjectPageVersionKey(f??""),String(new Date().getTime())),b(!0);try{await U.publishPages({mode:r,routes:w}),W.default.success(u("maker.publishSuccessMessage"))}catch(y){throw W.default.error(y.message),y}finally{b(!1)}}})},[r,j,u,f,S]);l.useImperativeHandle(k,()=>({openPublishDialog:g}));const c=l.useCallback(()=>{g()},[g]);return e.jsxs(e.Fragment,{children:[e.jsx(J.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:c,loading:p,disabled:p,children:u("maker.publishToProduction")}),d]})});function ue({routePathInfo:r,checked:j,onClick:k,route:u}){var d,S,f,g,c;const{t:p}=$.useLocaleContext(),b=!((d=r.routeMetaData)!=null&&d.publishedAt)||((S=r.routeMetaData)==null?void 0:S.updatedAt)&&new Date((f=r.routeMetaData)==null?void 0:f.updatedAt)>new Date((g=r.routeMetaData)==null?void 0:g.publishedAt);return e.jsx(s.ListItem,{sx:{pl:4,pr:3},disablePadding:!0,secondaryAction:e.jsxs(s.Box,{display:"flex",alignItems:"center",sx:{minWidth:"auto"},children:[b&&e.jsx(s.Box,{mr:.35,className:"visible",color:"warning.main",sx:{display:"flex",alignItems:"center"},title:p("maker.pages.needPublish"),children:e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(P.Sync,{fontSize:"small",sx:{fontSize:"16px"}})})}),(!((c=r.routeMetaData)!=null&&c.isPublic)||!u.isPublic)&&e.jsx(s.Box,{className:"visible",color:"warning.main",children:e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(P.VisibilityOff,{fontSize:"small",sx:{fontSize:"16px"}})})})]}),children:e.jsxs(s.ListItemButton,{onClick:k,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:j,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:r.path,primaryTypographyProps:{fontSize:"0.8rem",fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pr:1}})]})})}function de({state:r,toMode:j,onChange:k,defaultRouteIds:u}){const{t:p,locale:b}=$.useLocaleContext(),[d,S]=l.useState(!1),[f,g]=l.useState(()=>u?Object.fromEntries(u.filter(t=>!t.includes("-")).map(t=>[t,!0])):{}),[c,O]=l.useState({}),[w,y]=l.useState(()=>u?Object.fromEntries(u.filter(t=>t.includes("-")).map(t=>[t,!0])):{}),[A,M]=l.useState({}),{loading:z,error:R,value:x}=ie.useAsync(()=>U.getPages({mode:j}),[j]);if(R)throw R;const T=l.useMemo(()=>r.routeIds||[],[r]),I=l.useMemo(()=>(x==null?void 0:x.pageIds)||[],[x]),D=l.useMemo(()=>!T||!r.routes?[]:JSON.parse(JSON.stringify(T)).sort((o,i)=>{var h,m;const n=(h=r.routes)==null?void 0:h[o],a=(m=r.routes)==null?void 0:m[i];return n!=null&&n.publishedAt&&new Date(n.publishedAt).getTime()<new Date(n.updatedAt).getTime()?-1:a!=null&&a.publishedAt&&new Date(a.publishedAt).getTime()<new Date(a.updatedAt).getTime()?1:new Date((n==null?void 0:n.updatedAt)??"").getTime()-new Date((a==null?void 0:a.updatedAt)??"").getTime()}),[r,T]),q=l.useMemo(()=>{if(!D)return[];if(!c)return D;const t=[...D].filter(o=>!c[o]);return Object.values(c).forEach(o=>{o.forEach(i=>{t.push(`${i.originalRouteId}-${i.paramOptionIds.join("-")}`)})}),t},[D,c]),L=l.useMemo(()=>!x||!I||!q?[]:H.default(I,q),[q,x,I]),C=l.useMemo(()=>T?[...T].concat(L):L,[T,L]),_=l.useCallback(()=>{const t={};D==null||D.forEach(o=>{var n;const i=(n=r.routes)==null?void 0:n[o];if(i&&i.params&&i.params.length>0&&i.paramsOptions&&i.paramsOptions.length>0){const a=te.generateParamCombinations({basePath:i.path,params:i.params,routeId:i.id,paramsOptions:i.paramsOptions,currentIndex:0,currentParams:[],currentOptionIds:[],result:[]});a.length>0&&(t[i.id]=a)}}),O(t)},[D,r.routes]);l.useEffect(()=>{_()},[_]),l.useEffect(()=>{M(t=>{const o={...t};return Object.keys(c).forEach(i=>{var n;c[i]&&((n=c[i])==null?void 0:n.length)>0&&o[i]===void 0&&(o[i]=!0)}),o})},[c]);const K=l.useRef(!0);l.useEffect(()=>{y(t=>{const o={...t};return Object.keys(c).length===0||(Object.keys(c).forEach(i=>{const n=c[i]||[],a=d||!!f[i];n.forEach(h=>{const m=`${i}-${h.paramOptionIds.join("-")}`;K.current?o[m]=a||t[m]||!1:o[m]=a})}),K.current=!1),o})},[f,c,d]);const Q=(t,o)=>{o.stopPropagation(),M(i=>{const n={...i};return n[t]=!n[t],n})},N=l.useCallback(t=>{g(o=>{const i=se.produce(o,n=>{d?(Object.assign(n,Object.fromEntries(C.map(a=>[a,!0]))),delete n[t]):n[t]?(delete n[t],L.includes(t)&&(T||[]).filter(a=>{var h,m;return((h=r.pages[a])==null?void 0:h.slug)===((m=x==null?void 0:x.pages[t])==null?void 0:m.slug)}).forEach(a=>{delete n[a]})):(n[t]=!0,T&&T.includes(t)&&L.filter(a=>{var h,m;return((h=x==null?void 0:x.pages[a])==null?void 0:h.slug)===((m=r.pages[t])==null?void 0:m.slug)}).forEach(a=>{n[a]=!0}))});return S(H.default(C,Object.keys(i)).length===0),i})},[d,C,L,r,x,T]),X=l.useCallback((t,o)=>{const i=`${t}-${o.paramOptionIds.join("-")}`;y(n=>{var m;const a={...n};a[i]=!a[i];const h=((m=c[t])==null?void 0:m.every(B=>a[`${t}-${B.paramOptionIds.join("-")}`]))??!1;return g(B=>{if(h&&!B[t])return{...B,[t]:!0};if(!h&&B[t]){const v={...B};return delete v[t],v}return B}),a})},[c]),Y=l.useCallback(()=>{S(t=>(t&&g({}),!t))},[]);return l.useEffect(()=>{const t=d?C:Object.keys(f),o=Object.entries(w).filter(([,n])=>n).map(([n])=>n).filter(n=>n!==void 0),i=Array.from(new Set([...t,...o]));k(d?null:i)},[d,f,w,C,k]),z?e.jsx(re.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:700},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,bgcolor:"background.paper",zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:Y,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:d,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:p("common.all")})]})}),D.map(t=>{var B,v;const o=(B=r.routes)==null?void 0:B[t];if(!o)return null;const i=!1,n=c&&c[t]&&((v=c[t])==null?void 0:v.length)>0,a=A[t]!==!1,h=c[t]||[],m=!o.publishedAt||o.updatedAt&&new Date(o.updatedAt).getTime()>new Date(o.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:[m&&e.jsx(s.Tooltip,{title:p("maker.pages.needPublish"),children:e.jsx(P.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!o.isPublic&&e.jsx(s.Tooltip,{title:p("maker.pages.notPublic"),children:e.jsx(P.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),i,n&&e.jsx(s.Box,{onClick:E=>Q(t,E),sx:{display:"inline-flex",alignItems:"center",mr:.35,cursor:"pointer",color:"info.main"},children:a?e.jsx(P.KeyboardArrowDown,{fontSize:"small",sx:{fontSize:"18px"}}):e.jsx(P.KeyboardArrowRight,{fontSize:"small",sx:{fontSize:"18px"}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(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:o.path,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})}),n&&e.jsx(s.Collapse,{in:a,children:e.jsx(s.Box,{children:h.map(E=>{const V=`${t}-${E.paramOptionIds.join("-")}`,Z=w[V]||!1;return e.jsx(ue,{routePathInfo:E,checked:d||Z,onClick:()=>X(t,E),route:o},V)})})})]},t)}),L.map(t=>{var i,n;const o=x==null?void 0:x.pages[t];return o?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>N(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:o.slug,secondary:(n=(i=o.locales)==null?void 0:i[b])==null?void 0:n.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},t):null})]})}exports.default=ce;
|
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-DytLDIZR.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");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("@emotion/styled");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/array-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("./chunks/state-DytLDIZR.js");require("@arcblock/ux/lib/Locale/context");require("@arcblock/ux/lib/Result");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("@emotion/styled");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/array-CjyMzwA7.js");const e=require("./chunks/home-BlT3oqu3.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 oC from "@mui/icons-material/Check";
|
|
|
7
7
|
import { Box as D, styled as lI, InputLabel as EI, TextField as h, IconButton as G, Autocomplete as tI, FormControl as wC, Select as sC, MenuItem as Q, ListItemText as nI, Typography as k, OutlinedInput as MC, useTheme as LC, CircularProgress as gI, InputAdornment as jC, Button as X, Grid as V, Stack as uI, Input as XI, CssBaseline as JC, Menu as OC, Dialog as wI, DialogTitle as sI, DialogContent as MI, DialogActions as LI, Tabs as mC, Tab as SC, Card as BC, CardMedia as yC, CardContent as DC, Skeleton as eC } from "@mui/material";
|
|
8
8
|
import { useRequest as bC, useReactive as v, useUpdate as WI, useThrottleFn as TI, useGetState as NC, useAsyncEffect as YI, useBoolean as xI } from "ahooks";
|
|
9
9
|
import rI, { useState as c, useEffect as t, useMemo as E, createContext as jI, useContext as KC, useRef as Z, useCallback as T, createElement as dC, forwardRef as JI, useImperativeHandle as OI } from "react";
|
|
10
|
-
import { I as zC, n as DI, A as cC, b as FC, T as aC, c as HC, B as lC } from "./chunks/array-
|
|
10
|
+
import { I as zC, n as DI, A as cC, b as FC, T as aC, c as HC, B as lC } from "./chunks/array-D52_0LRy.js";
|
|
11
11
|
import { styled as AI } from "@arcblock/ux/lib/Theme";
|
|
12
12
|
import "@blocklet/pages-kit/builtin/color-picker";
|
|
13
13
|
import "@blocklet/pages-kit/utils/style";
|