@blocklet/pages-kit-inner-components 0.6.7 → 0.6.8
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/components--WuwSB_H.js +57 -0
- package/lib/cjs/chunks/{draft-data-D44_IEV2.js → draft-data-CVjF01PQ.js} +1 -1
- package/lib/cjs/chunks/{home-BYk01EUy.js → home-BarvCpAK.js} +2 -2
- package/lib/cjs/chunks/index-DH8UBqWG.js +475 -0
- package/lib/cjs/chunks/{publish-button-C8XPA4g_.js → publish-button-CNo2gT6Q.js} +1 -1
- package/lib/cjs/chunks/site-state-C4Zpym9P.js +1 -0
- package/lib/cjs/chunks/state-DCxHc_MB.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +6 -9
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +2 -2
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +2 -2
- package/lib/es/chunks/components-B8AH-ivu.js +596 -0
- package/lib/es/chunks/{draft-data-CafrGKeh.js → draft-data-BiayOfQz.js} +1 -1
- package/lib/es/chunks/{home-DW8SdyfO.js → home-DBc-g4K0.js} +3 -3
- package/lib/es/chunks/{index-D5gXPe_7.js → index-DaF8ujCZ.js} +675 -763
- package/lib/es/chunks/{publish-button-XSZrDaTQ.js → publish-button-DiKDLFU8.js} +3 -3
- package/lib/es/chunks/site-state-sUwlP4XQ.js +1586 -0
- package/lib/es/chunks/{state-0gvZF3k2.js → state-C3hsEhCe.js} +117 -121
- package/lib/es/components.js +7 -7
- package/lib/es/home.js +3 -3
- package/lib/es/project-html.js +132 -121
- package/lib/es/resources.js +28 -29
- package/lib/es/setting.js +148 -145
- package/lib/es/site-state.js +16 -15
- package/package.json +3 -3
- package/lib/cjs/chunks/index-BRgYwvuv.js +0 -475
- package/lib/cjs/chunks/site-state-BlQzwACl.js +0 -57
- package/lib/cjs/chunks/state-B6BF5wJ-.js +0 -1
- package/lib/es/chunks/site-state-BdLTu3Od.js +0 -2123
package/lib/es/site-state.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./chunks/components-B8AH-ivu.js";
|
|
2
|
+
import { c as b, a as h, b as B, S as L, e as U, f as q, h as v, d as y, g as z, i as C, m as F, t as G, j as J } from "./chunks/site-state-sUwlP4XQ.js";
|
|
3
|
+
import { nextId as N } from "@blocklet/pages-kit/utils/common";
|
|
3
4
|
import "@blocklet/pages-kit/utils/page-model";
|
|
4
5
|
import "@blocklet/pages-kit/utils/property";
|
|
5
6
|
import "@blocklet/pages-kit/utils/route";
|
|
@@ -32,17 +33,17 @@ import "yjs";
|
|
|
32
33
|
export * from "@blocklet/pages-kit/types/state";
|
|
33
34
|
export {
|
|
34
35
|
b as PUBLISH_MODES,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
h as SITE_STATE_PATH,
|
|
37
|
+
B as STATE_MODES,
|
|
38
|
+
L as default,
|
|
39
|
+
U as downloadAsset,
|
|
40
|
+
q as downloadAssets,
|
|
41
|
+
v as fromPackage,
|
|
42
|
+
y as getDefaultState,
|
|
43
|
+
z as getResourceStates,
|
|
44
|
+
C as initPackResourceStates,
|
|
45
|
+
F as mergeState,
|
|
46
|
+
N as nextId,
|
|
47
|
+
G as toPackage,
|
|
48
|
+
J as triggerReloadAllProjectResource
|
|
48
49
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-inner-components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
4
4
|
"description": "Pages Kit inner components library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -203,8 +203,8 @@
|
|
|
203
203
|
"yaml": "^2.5.0",
|
|
204
204
|
"yjs": "^13.6.18",
|
|
205
205
|
"zustand": "^4.5.5",
|
|
206
|
-
"@blocklet/pages-kit
|
|
207
|
-
"@blocklet/pages-kit": "^0.6.
|
|
206
|
+
"@blocklet/pages-kit": "^0.6.8",
|
|
207
|
+
"@blocklet/pages-kit-block-studio": "^0.6.8"
|
|
208
208
|
},
|
|
209
209
|
"devDependencies": {
|
|
210
210
|
"@trivago/prettier-plugin-sort-imports": "^5.2.1",
|
|
@@ -1,475 +0,0 @@
|
|
|
1
|
-
"use strict";var Ne=Object.create;var oe=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Pe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Me(t))!Re.call(e,i)&&i!==n&&oe(e,i,{get:()=>t[i],enumerable:!(r=Ie(t,i))||r.enumerable});return e};var We=(e,t,n)=>(n=e!=null?Ne(Pe(e)):{},Ee(t||!e||!e.__esModule?oe(n,"default",{value:e,enumerable:!0}):n,e));const o=require("react/jsx-runtime"),Te=require("@mui/icons-material"),u=require("@mui/material"),ze=require("lodash/isEmpty"),Ae=require("lodash/pick"),f=require("react"),qe=require("lodash/keyBy"),k=require("./state-B6BF5wJ-.js"),V=require("@blocklet/ai-runtime/components"),Le=require("@mui/utils"),Oe=require("react-error-boundary"),Ue=require("@blocklet/pages-kit/builtin/markdown/markdown-renderer"),me=require("@blocklet/pages-kit/contexts/color"),w=require("@emotion/css"),Fe=require("react-syntax-highlighter/dist/esm/styles/prism"),$=require("@arcblock/ux/lib/Theme"),He=require("@arcblock/react-hooks/lib/useBrowser"),Ve=require("@arcblock/ux/lib/Colors"),Q=require("@blocklet/pages-kit/components"),ne=require("@blocklet/pages-kit/utils/style"),De=require("@mui/material/useMediaQuery"),Ye=require("lodash/omit"),xe=require("@iconify-icon/react"),Je=require("@arcblock/ux/lib/Screenshot"),Z=require("react-router-dom"),Ge=require("@arcblock/ux/lib/Button"),Ke=require("is-uri"),D=require("pathe"),T=require("ufo"),Xe=require("@blocklet/embed/message"),Qe=require("ahooks"),Ze=require("lodash/isEqual"),et=require("@blocklet/embed/react"),tt=require("@arcblock/ux/lib/Locale/context"),ot=require("react-twitter-embed"),re=require("react-use"),B=e=>e&&e.__esModule?e:{default:e},nt=B(ze),J=B(Ae),rt=B(f),G=B(qe),it=B(Ue),st=B(He),ie=B(Ve),pe=B(De),N=B(Ye),at=B(Je),lt=B(Ge),K=B(Ke),ct=B(Ze),he="{{CUSTOM_VALUE}}",dt=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],ut=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],mt=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:2.5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:2.5,md:10,lg:12.5,xl:15}}}],Y=(e,t,n)=>{const r=e.breakpoints.values[n];return`${t}${r?` (${r}px)`:""}`},xt=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:e=>Y(e,"Small","sm"),value:"sm",sx:{maxWidth:e=>e.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:e=>Y(e,"Normal","md"),value:"md",sx:{maxWidth:e=>e.breakpoints.values.md,width:"100%",mx:"auto"}},{title:e=>Y(e,"Large","lg"),value:"lg",sx:{maxWidth:e=>e.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:e=>Y(e,"Extra Large","xl"),value:"xl",sx:{maxWidth:e=>e.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:he,width:"100%",mx:"auto"}}],pt=G.default(dt,"value"),ht=G.default(ut,"value"),gt=G.default(mt,"value"),ft=G.default(xt,"value"),yt=new Map([["baseSectionPaddingY",pt],["maxWidth",ft],["paddingY",ht],["paddingX",gt]]);function ge(e){const{type:t,value:n,format:r="sx",defaultValue:i=null}=e,s=yt.get(t);if(!s)return i;const c=n.startsWith("custom:"),a=c?"custom":n;if(s?.[a]&&s?.[a]?.[r]){const l=s[a][r];if(c){const d=n.replace("custom:","");try{return JSON.parse(JSON.stringify(l||{}).replaceAll(he,d))}catch{}}return l}return i}const fe=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function bt(){return f.useContext(fe)}function wt({page:e,children:t,defaultLocale:n="en",currentLocale:r}){const i=f.useMemo(()=>e?JSON.parse(JSON.stringify(e)):null,[JSON.stringify(e)]),s=f.useCallback(()=>{if(!i)return{};const l=r||n;return i.locales?.[l]??{}},[i,n,r]),c=f.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((m,[h,p])=>{if(!p)return m;const b=`${h}Custom`;d.style[b];const y=ge({type:h,value:p,format:l});return y?{...m,...y}:m},{})},[s]),a=f.useMemo(()=>({page:i,getPageMeta:s,getPageMetaStyle:c}),[i,s,c]);return o.jsx(fe.Provider,{value:a,children:t})}function R({actions:e,center:t,className:n,align:r}){return e&&e?.length?o.jsx(u.Box,{className:w.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(t||r==="center")&&"justify-center",!t&&r==="right"&&"justify-end",!t&&r==="left"&&"justify-start",n),sx:{alignItems:"center"},children:e}):null}const jt="section",vt=u.styled(u.Box)`
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
|
|
4
|
-
.section__title {
|
|
5
|
-
margin-top: 0;
|
|
6
|
-
font-weight: 700;
|
|
7
|
-
}
|
|
8
|
-
.section__title_non_big {
|
|
9
|
-
font-size: 32px;
|
|
10
|
-
@media (max-width: 600px) {
|
|
11
|
-
font-size: 24px;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
&.base-info .section__tag {
|
|
15
|
-
margin-top: 0;
|
|
16
|
-
margin-bottom: 2vw;
|
|
17
|
-
background-color: ${({theme:e})=>e.palette.primary.main};
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
max-width: 100%;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
padding: 0 10px;
|
|
22
|
-
justify-content: flex-start;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
text-overflow: ellipsis;
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
color: #fff;
|
|
27
|
-
border-radius: 4px;
|
|
28
|
-
line-height: 20px;
|
|
29
|
-
}
|
|
30
|
-
.section__title {
|
|
31
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
32
|
-
a {
|
|
33
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
34
|
-
}
|
|
35
|
-
p {
|
|
36
|
-
margin-top: 0;
|
|
37
|
-
margin-bottom: 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
.section__description {
|
|
41
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
42
|
-
margin-bottom: 4vw;
|
|
43
|
-
margin-top: 0;
|
|
44
|
-
a {
|
|
45
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
46
|
-
}
|
|
47
|
-
p {
|
|
48
|
-
margin-top: 0;
|
|
49
|
-
margin-bottom: 0.5rem;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
@media (min-width: ${({theme:e})=>e.breakpoints.values[jt]}px) {
|
|
53
|
-
.section__tag {
|
|
54
|
-
margin-bottom: 32px;
|
|
55
|
-
}
|
|
56
|
-
.section__title {
|
|
57
|
-
margin-bottom: 32px;
|
|
58
|
-
}
|
|
59
|
-
.section__description {
|
|
60
|
-
margin-bottom: 40px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;function q({title:e,description:t,descriptionMarkdown:n,actions:r,className:i="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:x,center:m,logo:h,titleAppearance:p,descriptionAppearance:b,...y}){const j=me.useColorConvert();if(!e&&!t&&!r&&!x&&!d&&!c&&!a&&!h)return null;const g=Math.max(Math.min(5,l+1),1),v={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},S=l===0?"big":`h${g}`,_=l===0;return o.jsxs(vt,{className:w.cx("base-info","lg:text-left",m&&"!text-center",i),...y,children:[c&&o.jsx("div",{children:c}),(d||x)&&o.jsx("div",{className:w.cx("section__tag",s?.tag||s?.badge),children:d||x}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),e&&o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",mb:t?"2vw":0,...p?.color&&{color:`${j(p.color)} !important`}},className:w.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",_?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:S,children:e}),t&&(n?o.jsx(u.Box,{sx:{...b?.color&&{color:`${j(b.color)} !important`}},className:w.cx("section__description","text-gray-800","dark:text-gray-100",v[g],s.description,"page-kit-section__description"),children:o.jsx(it.default,{codeOptions:{showActionButton:!1,theme:Fe.materialDark},children:t})}):o.jsx(u.Typography,{sx:{whiteSpace:"pre-wrap",...b?.color&&{color:`${j(b.color)} !important`}},className:w.cx("section__description","text-gray-800","dark:text-gray-100",v[g],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:t})),o.jsx(R,{actions:r,center:m,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const L=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function ye(e){if(e.type===f.Fragment){const n=(e.props.children||[]).filter(r=>f.isValidElement(r));return n.length===1?ye(n[0]):n.length>1}return Array.isArray(e)}const I="&>*";function ee({children:e,col:t,gap:n,className:r,align:i,sx:s,type:c,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=$.useTheme(),d=Number(Math.floor(100/t*100)/100),x={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},m=x[i]||x.center;let p=n??({2:6,3:4,4:4,5:3,6:3}[t]||0);ye(e)||(p=0);const y=(t-1)*p/t;let j={...s,gap:`${p}rem`};const g={[I]:{width:"100%"}},v={},S={},_={};switch(g.gap="1rem",v.gap=`${p/2}rem`,t){case 3:case 4:v[I]={width:`calc(50% - ${p/2}rem)`};break;case 5:case 6:g[I]={width:`calc(50% - ${p/2/2}rem)`},v[I]={width:`calc(50% - ${p/2/2}rem)`},S[I]={width:`calc(33.33% - ${p*2/3}rem)`};break}return j[I]={width:`calc(${d}% - ${y}rem)`},j[`@media (max-width: ${l.breakpoints.values.xl}px)`]=_,j[`@media (max-width: ${l.breakpoints.values.lg}px)`]=S,j[`@media (max-width: ${l.breakpoints.values.md}px)`]=v,j[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g,c==="wall"&&(j={...s,gap:`${p}rem`},j[I]={width:`calc(${d}% - ${y}rem)`},g[I]={width:`calc(45% - ${p/2/2}rem)`},j[`@media (max-width: ${l.breakpoints.values.sm}px)`]=g),o.jsx(u.Box,{className:w.cx("flex flex-wrap flex-row h-full",m,r),sx:j,...a,children:e})}function kt(){const e=navigator.userAgent.toLowerCase();return e.includes("safari")&&!e.includes("chrome")}function _t(e=""){if(e.startsWith("data:image/svg+xml,"))return!0;const t=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return t.test(e)||n.test(e)}function z(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")||e?.endsWith(".webm")}function $t(e){return e?.endsWith(".mp4")||e?.endsWith(".m4v")?"video/mp4":e?.endsWith(".webm")?"video/webm":void 0}function St(e){let t={};return typeof e=="string"?ne.isGradient(e)?t.image=e:(t.image=k.getImageAbsoluteUrl(e),ne.isColorString(e)&&(t.color=e,t.image="")):t=e,t}function Bt(){const[e,t]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{t(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),e}function se(e,t,n,r,i){let s=null;const{color:c="",image:a}=St(t);if(a&&_t(a)){delete n.backgroundColor;const l=!(e.mobile.apple.device||kt())&&z(a),d=z(a)&&r?k.autoResizeImage(k.getImageAbsoluteUrl(r),1200,"quality"):"";l?s=o.jsx(u.Box,{component:"video",className:"section-bg",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:d,src:z(a)?a:k.autoResizeImage(a,1200,"quality"),sx:{width:"100%",position:"absolute",zIndex:-9999,right:0,left:0,top:0,height:"100%",objectFit:"cover"}},a):s=o.jsx(Q.ResponsiveImage,{src:z(a)&&r?d:a,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},i||a)}else a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`);return s}function Ct({autoWidth:e,children:t,...n}){return e?o.jsx(u.Box,{...n,sx:[{display:"flex"},...Array.isArray(n.sx)?n.sx:[n.sx]],children:t}):o.jsx(u.Container,{...n,children:t})}function O({dark:e=!1,children:t,className:n,sx:r={},boxed:i={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...r},x=pe.default(p=>p.breakpoints.down("md"));e&&(d.color=ie.default.common.white,d.backgroundColor=`${ie.default.grey[900]} !important`),i.show&&(d.display="flex");const m=f.useMemo(()=>!Number(l.boxMaxWidth)||x?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,x,a]),h=ge({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Nt,{component:"section",styles:{...d,...h},className:w.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:e}),...N.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Ct,{autoWidth:l?.autoWidth,className:w.cx("section-content h-full"),sx:m,children:i.show?o.jsx(be,{...c,boxed:i,children:t}):t})})}function be({background:e="",backgroundVideoPoster:t,children:n,sx:r={},boxed:i={show:!1},className:s="",styles:c={},...a}){const l={...c,...r},d=me.useColorConvert();let x=null;const m=pe.default(b=>b.breakpoints.up("sm")),h=st.default(),p=Bt();return e&&(x=se(h,typeof e=="string"?d(e):e,l,t,p)),i.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=m?"50px":"20px"),i?.border&&(l.border="1px solid #c0c0c0"),i?.background&&(x=se(h,typeof i?.background=="string"?d(i?.background):i?.background,l,i?.backgroundVideoPoster,p))),o.jsxs(u.Box,{...a,sx:{...l,...x?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:w.cx(s,i?.boxShadow&&"shadow-xl"),children:[x,n]})}const Nt=$.styled(be)`
|
|
64
|
-
&:nth-of-type(even) {
|
|
65
|
-
background: #f8f8f8;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@media (max-width: 600px) {
|
|
69
|
-
.section__title {
|
|
70
|
-
font-size: 24px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.base-info {
|
|
74
|
-
> *:last-child {
|
|
75
|
-
margin-bottom: 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
`;function we({icon:e,...t}){return o.jsx(xe.Icon,{icon:e,...t,ref:null})}function C(e,t){const n=J.default(e,t),r=N.default(e,t);return[n,r]}const je=["title","description","actions","badge","tag","prepend","append","logo"];function It({image:e,imageBorder:t,imageShadow:n,className:r,reverse:i=!1,fullSizeImage:s,...c}){const[a,l]=C(c,L),d=Object.keys(a).length>0&&Object.values(J.default(a,je)).filter(Boolean).length>0&&o.jsx(q,{...a}),x=f.isValidElement(e)?e:o.jsx(u.Box,{component:"img",src:e,alt:"",className:"block"}),m=["phone","macbook"].includes(t),h=e&&o.jsx(u.Box,{className:w.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a?.center?"flex justify-center items-center":""),sx:{border:t===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":m?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:m?o.jsx(at.default,{type:t,sx:{width:"100%"},children:x}):x});return o.jsx(O,{className:w.cx("section--block",r,s&&!i&&w.css`
|
|
80
|
-
.section-bg {
|
|
81
|
-
height: 80%;
|
|
82
|
-
}
|
|
83
|
-
`),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(ee,{col:e?2:1,className:s?w.css`
|
|
84
|
-
display: flex;
|
|
85
|
-
flex-direction: column;
|
|
86
|
-
|
|
87
|
-
> .base-info,
|
|
88
|
-
> .section__image {
|
|
89
|
-
width: 100%;
|
|
90
|
-
|
|
91
|
-
> img,
|
|
92
|
-
> video {
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
`:void 0,children:i?o.jsxs(o.Fragment,{children:[h,d]}):o.jsxs(o.Fragment,{children:[d,h]})})})}const U=["editing","height","locale","dev","sx"];function Mt(e){const{className:t,...n}=e;return o.jsx(Pt,{...n,className:w.cx("BlockBase-root",t)})}const Pt=$.styled(u.Box)`
|
|
97
|
-
position: relative;
|
|
98
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
99
|
-
`;function Rt({widget:e,reverse:t,projectId:n,assistantId:r,working:i,submitTitle:s,submitIcon:c,submitColor:a,placeholder:l,loadingIndicator:d,section:x,...m}){const[{editing:h},p]=C(m,U),[b,y]=C(p,L),j=n&&r?{projectId:n,gitRef:"main",assistantId:r,working:!0}:void 0,g={children:s,endIcon:c?o.jsx(we,{icon:c}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},v=[],S=l&&o.jsx(u.Typography,{variant:"caption",sx:{color:"text.disabled"},children:l}),_=d&&o.jsx(u.Typography,{variant:"caption",sx:{color:"text.disabled"},children:d});Object.keys(b).length>0&&Object.values(J.default(b,je)).filter(Boolean).length>0&&v.push(o.jsx(q,{...b},"base-info")),j&&(e==="form"?v.push(o.jsx(V.AIForm,{identifier:j,SubmitProps:g},"form")):e==="result"?v.push(o.jsx(V.AIFormResult,{identifier:j,placeholder:S,loadingIndicator:_},"result")):v.push(o.jsxs(u.Stack,{direction:"row",sx:{width:"100%",gap:2},children:[o.jsx(V.AIForm,{identifier:j,BoxProps:{flex:1},SubmitProps:g}),o.jsx(V.AIFormResult,{identifier:j,BoxProps:{flex:1},placeholder:S,loadingIndicator:_})]},"form-result"))),t&&v.reverse();const M=u.useTheme(),P=f.useMemo(()=>u.createTheme(Le.deepmerge(M,{palette:{primary:a?{main:a}:void 0}})),[a,M]);return o.jsx(Oe.ErrorBoundary,{fallbackRender:k.ErrorView,children:o.jsx(u.ThemeProvider,{theme:P,children:o.jsx(O,{...y,sx:h?{pointerEvents:"none"}:{},children:o.jsx(ee,{col:v.length,children:v})})})})}const ve=f.createContext({pages:[],project:void 0}),{Provider:Et,Consumer:Wo}=ve;function ke(){return f.useContext(ve)}function Wt({icon:e,className:t="",size:n="1rem",...r}){return o.jsx(Tt,{component:we,className:w.cx("css-icon",t),size:n,...r,icon:e})}const Tt=$.styled(u.Box)`
|
|
100
|
-
&.css-icon {
|
|
101
|
-
display: inline-block;
|
|
102
|
-
width: ${({size:e})=>e};
|
|
103
|
-
height: ${({size:e})=>e};
|
|
104
|
-
}
|
|
105
|
-
`;function zt({icon:e,className:t="",size:n="1rem",imageMeta:r,...i}){const s=k.autoResizeImage(k.getImageAbsoluteUrl(e),540),[c,a]=f.useState(!1),l=$.useTheme();return c?o.jsx(Wt,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:t,...i}):o.jsx(At,{className:w.cx("image-icon",t),size:n,...i,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:r?.naturalWidth,height:r?.naturalHeight,alt:r?.filename||"card-icon",loading:"lazy"})})}const At=$.styled(u.Box)`
|
|
106
|
-
display: inline-block;
|
|
107
|
-
width: ${({size:e})=>e};
|
|
108
|
-
height: ${({size:e})=>e};
|
|
109
|
-
.image-icon__image {
|
|
110
|
-
object-fit: contain;
|
|
111
|
-
height: 100%;
|
|
112
|
-
width: 100%;
|
|
113
|
-
}
|
|
114
|
-
`,te=e=>typeof e=="string"&&/^[\w-_]+:[\w-_]+$/.test(e);function X({icon:e,size:t="1rem",imageMeta:n,...r}){const i=window.isNaN(t)?t:`${t}px`;return te(e)?o.jsx(xe.Icon,{icon:e}):o.jsx(qt,{component:zt,imageMeta:n,className:"base-icon",icon:e,size:i,...r})}const qt=$.styled(u.Box)`
|
|
115
|
-
flex-shrink: 0;
|
|
116
|
-
`;function A({text:e,children:t,icon:n="",endIcon:r,color:i="primary",link:s="",href:c="",...a}){const l=n?o.jsx(X,{icon:n}):null,d=r?o.jsx(X,{icon:r}):null,x=s||c,m={...a};return x&&(m.href=x,K.default(x)&&(m.target=m.target||"_blank")),o.jsx(lt.default,{startIcon:l,endIcon:d,color:i,...m,children:e||t})}function _e({editing:e,text:t,...n}){const{pages:r=[]}=ke(),i=r.find(s=>s.id===(n.link||n.linkId));if(e)return o.jsx(A,{...N.default(n,["link","linkId"]),children:t});if(i){const s=i.path||"/";return o.jsx(Z.Link,{to:s,children:o.jsx(A,{...N.default(n,["link","linkId"]),children:t})})}return o.jsx(A,{...N.default(n,"linkId"),children:t})}function E({type:e="",icon:t="",size:n="3rem",className:r="",...i}){return o.jsx(X,{icon:t||e,size:n,className:w.cx("content-icon",r),...i,color:typeof i.color>"u"?"inherit":i.color})}function Lt({to:e,base:t,children:n,className:r,activeClassName:i="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:x=""}={},m=t?D.join("/",t):t||"";let h=s==="auto"?"_self":s,p=D.join(m,e);const b=c?K.default(p):!1;if(t)return p=D.join(m,x,e),o.jsx("a",{className:`no-underline ${r}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:n});if(K.default(e))s==="auto"&&(h="_blank"),p=e;else{T.isRelative(p)&&(p=D.join(window.location.pathname,p));const y=T.parseURL(`${window.location.origin}${p}`),j=d.some(g=>g.pathname===y.pathname);if(a||j)return o.jsx(Z.NavLink,{end:!0,to:T.withoutTrailingSlash(p),className:({isActive:g})=>w.cx(r,g?i:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${r}`,href:T.withoutTrailingSlash(p),rel:"noreferrer noopener",target:h,...l,children:[n,b&&o.jsx(E,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function F({prepend:e,append:t,children:n,className:r="",dark:i=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=ke(),d=l.find(h=>h.id===c.link),x=!n||rt.default.Children.toArray(n).every(h=>h===null);c.link&&(a={component:Lt,to:d?.path||c.link,useRouterLink:!0});const m=u.useTheme();return o.jsxs(Ot,{className:w.cx("base-card card",{dark:i,"border-transparent":!s},r),sx:{borderColor:m.palette.divider},...a,...N.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[e,!x&&o.jsx("div",{className:"card__body",children:n}),t]})}const Ot=$.styled(u.Box)`
|
|
117
|
-
&.base-card {
|
|
118
|
-
text-align: left;
|
|
119
|
-
border-width: 1px;
|
|
120
|
-
border-style: solid;
|
|
121
|
-
border-radius: 12px;
|
|
122
|
-
overflow: hidden;
|
|
123
|
-
&,
|
|
124
|
-
&:hover {
|
|
125
|
-
text-decoration: none;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
.card__body {
|
|
129
|
-
padding: 15px 15px;
|
|
130
|
-
}
|
|
131
|
-
`;function H({align:e="left",title:t,titleProps:n={},description:r,descriptionProps:i={}}){return o.jsxs(o.Fragment,{children:[t&&o.jsx(u.Typography,{className:w.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:e,...n,children:t}),r&&o.jsx(u.Typography,{className:w.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:e,...i,children:r})]})}function Ut({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...x}){const m=te(e),h=k.autoResizeImage(k.getImageAbsoluteUrl(e),540);return o.jsxs(Ft,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&e?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...r,alt:r.alt||i?.filename||"card-image",width:i?.naturalWidth,height:i?.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[t||n?o.jsx(H,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Ft=$.styled(F)`
|
|
132
|
-
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
133
|
-
&:hover {
|
|
134
|
-
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
135
|
-
}`:""}
|
|
136
|
-
|
|
137
|
-
.card__title {
|
|
138
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
139
|
-
a {
|
|
140
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
.card__description {
|
|
144
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
145
|
-
a {
|
|
146
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.card__image__wrap {
|
|
151
|
-
padding-top: 61.8%;
|
|
152
|
-
width: 100%;
|
|
153
|
-
position: relative;
|
|
154
|
-
}
|
|
155
|
-
.card__image {
|
|
156
|
-
position: absolute;
|
|
157
|
-
top: 0;
|
|
158
|
-
left: 0;
|
|
159
|
-
bottom: 0;
|
|
160
|
-
right: 0;
|
|
161
|
-
width: 100%;
|
|
162
|
-
height: 100%;
|
|
163
|
-
object-position: top center;
|
|
164
|
-
}
|
|
165
|
-
`,ae="section";function le({title:e,image:t,imageMeta:n,description:r,actions:i,align:s,listType:c="",className:a="",...l}){return o.jsxs(Ht,{className:w.cx("card",`list-type-${c}`,a),align:s,...l,children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),e||r?o.jsx(H,{align:s,title:e,description:r}):null,i?.length?o.jsx(R,{align:s,actions:i,className:"mt-4"}):null]})}const Ht=$.styled(F)`
|
|
166
|
-
padding: 5vw 4vw;
|
|
167
|
-
box-sizing: border-box;
|
|
168
|
-
/* min-height: 320px; */
|
|
169
|
-
color: inherit !important;
|
|
170
|
-
border-radius: 0.5rem;
|
|
171
|
-
/* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
|
|
172
|
-
@media (max-width: ${({theme:e})=>e.breakpoints.values[ae]}px) {
|
|
173
|
-
padding: 1.5rem 2rem;
|
|
174
|
-
}
|
|
175
|
-
@media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
|
|
176
|
-
height: auto;
|
|
177
|
-
min-height: unset;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
181
|
-
&:hover {
|
|
182
|
-
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
183
|
-
}`:""}
|
|
184
|
-
|
|
185
|
-
.card__title {
|
|
186
|
-
font-weight: 700;
|
|
187
|
-
margin-top: 24px;
|
|
188
|
-
margin-bottom: 12px;
|
|
189
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
190
|
-
a {
|
|
191
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
.card__description {
|
|
195
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
196
|
-
a {
|
|
197
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
.card__body {
|
|
201
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
202
|
-
padding: 0;
|
|
203
|
-
${({align:e})=>`text-align:${e||"left"};`}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
&.list-type-icon-title {
|
|
207
|
-
padding: 1.2rem;
|
|
208
|
-
.title-line {
|
|
209
|
-
display: flex;
|
|
210
|
-
}
|
|
211
|
-
.card__title {
|
|
212
|
-
margin: 0;
|
|
213
|
-
font-size: 1em;
|
|
214
|
-
}
|
|
215
|
-
.css-icon {
|
|
216
|
-
margin-right: 0.5rem;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
@media (min-width: ${({theme:e})=>e.breakpoints.values[ae]}px) {
|
|
221
|
-
padding: 2rem 2rem;
|
|
222
|
-
text-align: left;
|
|
223
|
-
box-sizing: border-box;
|
|
224
|
-
}
|
|
225
|
-
`;function Vt({image:e,title:t,description:n,imageProps:r={},imageMeta:i,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...x}){const m=te(e),h=k.autoResizeImage(k.getImageAbsoluteUrl(e),540);return o.jsxs(Dt,{className:"card-article",...x,prepend:o.jsx("div",{className:"card__image__wrap",children:m&&e?o.jsx(u.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(E,{icon:e,color:"primary.main"})}):h&&o.jsx(u.Box,{component:"img",className:"card__image",src:h,...r,alt:r.alt||i?.filename||"card-image",style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy",sx:[{width:i?.naturalWidth,height:i?.naturalHeight},...Array.isArray(r.sx)?r.sx:[r.sx]]})}),children:[t||n?o.jsx(H,{align:d,title:t,titleProps:c,description:n,descriptionProps:a}):null,l?.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Dt=$.styled(F)`
|
|
226
|
-
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
227
|
-
&:hover {
|
|
228
|
-
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
229
|
-
}`:""}
|
|
230
|
-
|
|
231
|
-
border-radius: 0 !important;
|
|
232
|
-
|
|
233
|
-
.card__body {
|
|
234
|
-
${({align:e})=>`text-align:${e||"left"};`}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.card__image__wrap {
|
|
238
|
-
width: 100%;
|
|
239
|
-
height: 100%;
|
|
240
|
-
position: relative;
|
|
241
|
-
display: flex;
|
|
242
|
-
justify-content: center;
|
|
243
|
-
align-items: center;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.card__image {
|
|
247
|
-
max-height: 60px;
|
|
248
|
-
}
|
|
249
|
-
`,ce="section";function Yt({title:e,image:t,imageMeta:n,iconSize:r=100,description:i,actions:s,align:c,className:a="",...l}){return o.jsx(Jt,{className:w.cx("card",a),...l,children:o.jsxs(u.Box,{className:"flex items-center",children:[t&&o.jsx(E,{icon:t,color:"primary.main",size:r,imageMeta:n}),o.jsxs(u.Box,{className:"flex-1 ml-4",children:[o.jsx(H,{align:c,title:e,description:i}),o.jsx(R,{align:c,actions:s,className:"mt-4"})]})]})})}const Jt=$.styled(F)`
|
|
250
|
-
padding: 5vw 4vw;
|
|
251
|
-
text-align: left;
|
|
252
|
-
box-sizing: border-box;
|
|
253
|
-
/* min-height: 320px; */
|
|
254
|
-
color: inherit !important;
|
|
255
|
-
border-radius: 0.5rem;
|
|
256
|
-
/* ${({dark:e,theme:t})=>`background-color:${e?t.palette.grey[900]:t.palette.common.white};`} */
|
|
257
|
-
@media (max-width: ${({theme:e})=>e.breakpoints.values[ce]}px) {
|
|
258
|
-
padding: 1.5rem 2rem;
|
|
259
|
-
}
|
|
260
|
-
@media (max-width: ${({theme:e})=>e.breakpoints.values.sm}px) {
|
|
261
|
-
height: auto;
|
|
262
|
-
min-height: unset;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
${e=>e.hoverStyle==="none"?"":e.link?`transition: box-shadow ease .3s;
|
|
266
|
-
&:hover {
|
|
267
|
-
box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
|
|
268
|
-
}`:""}
|
|
269
|
-
|
|
270
|
-
.card__title {
|
|
271
|
-
font-weight: 700;
|
|
272
|
-
margin-bottom: 12px;
|
|
273
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
274
|
-
a {
|
|
275
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
.card__description {
|
|
279
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
280
|
-
a {
|
|
281
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
.card__body {
|
|
285
|
-
padding: 0;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
&.list-type-icon-title {
|
|
289
|
-
padding: 1.2rem;
|
|
290
|
-
.title-line {
|
|
291
|
-
display: flex;
|
|
292
|
-
}
|
|
293
|
-
.card__title {
|
|
294
|
-
margin: 0;
|
|
295
|
-
font-size: 1em;
|
|
296
|
-
}
|
|
297
|
-
.css-icon {
|
|
298
|
-
margin-right: 0.5rem;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
@media (min-width: ${({theme:e})=>e.breakpoints.values[ce]}px) {
|
|
303
|
-
padding: 2rem 2rem;
|
|
304
|
-
text-align: left;
|
|
305
|
-
box-sizing: border-box;
|
|
306
|
-
}
|
|
307
|
-
`;function Gt({title:e,titleProps:t={},description:n,descriptionProps:r={},image:i,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(Kt,{className:w.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[i&&o.jsx(E,{icon:i,color:"primary.main",imageMeta:s}),e||n?o.jsx(H,{align:a,title:e,titleProps:t,description:n,descriptionProps:r}):null]})}const Kt=$.styled(F)`
|
|
308
|
-
.card__title {
|
|
309
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
310
|
-
a {
|
|
311
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
.card__description {
|
|
315
|
-
color: ${({theme:e})=>e.palette.text.primary};
|
|
316
|
-
a {
|
|
317
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
&.hover-style__default {
|
|
322
|
-
&.card-simple {
|
|
323
|
-
&:hover {
|
|
324
|
-
border-top-right-radius: 36px;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
.card__body {
|
|
328
|
-
&:hover {
|
|
329
|
-
&::before {
|
|
330
|
-
width: 42px;
|
|
331
|
-
height: 42px;
|
|
332
|
-
transform: translate(50%, -50%) rotate(45deg);
|
|
333
|
-
}
|
|
334
|
-
&::after {
|
|
335
|
-
transform: none;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
&.card-simple {
|
|
342
|
-
border-radius: 8px;
|
|
343
|
-
border-top-right-radius: 26px;
|
|
344
|
-
|
|
345
|
-
.card__body {
|
|
346
|
-
${({align:e})=>`text-align:${e||"left"};`}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
${e=>e.link?`
|
|
350
|
-
cursor: pointer;
|
|
351
|
-
`:""}
|
|
352
|
-
/* cursor: pointer; */
|
|
353
|
-
/* &:hover {
|
|
354
|
-
border-top-right-radius: 36px;
|
|
355
|
-
} */
|
|
356
|
-
transition: all 180ms ease 0s;
|
|
357
|
-
overflow: visible;
|
|
358
|
-
.card__title {
|
|
359
|
-
margin: 12px 0;
|
|
360
|
-
}
|
|
361
|
-
.card__body {
|
|
362
|
-
position: relative;
|
|
363
|
-
padding: 20px 16px 18px;
|
|
364
|
-
overflow: hidden;
|
|
365
|
-
transition: all 180ms ease 0s;
|
|
366
|
-
/* &:hover {
|
|
367
|
-
&::before {
|
|
368
|
-
width: 42px;
|
|
369
|
-
height: 42px;
|
|
370
|
-
transform: translate(50%, -50%) rotate(45deg);
|
|
371
|
-
}
|
|
372
|
-
&::after {
|
|
373
|
-
transform: none;
|
|
374
|
-
}
|
|
375
|
-
} */
|
|
376
|
-
&::before,
|
|
377
|
-
&::after {
|
|
378
|
-
content: ${({border:e})=>e?'""':""};
|
|
379
|
-
transition: inherit;
|
|
380
|
-
position: absolute;
|
|
381
|
-
top: 0px;
|
|
382
|
-
right: 0px;
|
|
383
|
-
}
|
|
384
|
-
&::before {
|
|
385
|
-
z-index: 3;
|
|
386
|
-
background: #fff;
|
|
387
|
-
width: 30px;
|
|
388
|
-
height: 30px;
|
|
389
|
-
transform: translate(50%, -50%) rotate(45deg);
|
|
390
|
-
box-shadow: 0 1px 0 0 #e9eaec;
|
|
391
|
-
}
|
|
392
|
-
&::after {
|
|
393
|
-
z-index: 2;
|
|
394
|
-
width: 28px;
|
|
395
|
-
height: 28px;
|
|
396
|
-
border-bottom-left-radius: 6px;
|
|
397
|
-
background: #fcfcfd;
|
|
398
|
-
box-shadow: -1px 1px 0 0 #e9eaec;
|
|
399
|
-
transform: translate(8px, -8px);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
`;function Xt({type:e="default",...t}){const r={article:Ut,simple:Gt,news:Yt,default:le,wall:Vt}[e]||le;return o.jsx(r,{...e==="news"?t:N.default(t,"iconSize")})}function Qt({list:e=[],align:t="top",cards:n,listBorder:r=!0,listType:i="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:x=!1,textAlign:m="left",hoverStyle:h,...p}){return o.jsx(ee,{type:d,className:w.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:t,...p,children:n||e.map(b=>o.jsx(Xt,{borderColor:r,iconColor:a,type:d,listType:i,dark:x,...b,align:m,style:c===0&&e.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},b.id))})}const Zt=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],eo=$.styled(O)`
|
|
404
|
-
a .card {
|
|
405
|
-
color: #404040;
|
|
406
|
-
cursor: pointer;
|
|
407
|
-
}
|
|
408
|
-
a:not(.MuiButton-root) {
|
|
409
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
410
|
-
&:hover,
|
|
411
|
-
&:active {
|
|
412
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
a:hover .card {
|
|
416
|
-
color: #404040;
|
|
417
|
-
}
|
|
418
|
-
`;function to({className:e,...t}){const[n,r]=C(t,L),[i,s]=C(r,Zt);return o.jsxs(eo,{className:w.cx("section--card-list",e),type:t.type,...s,children:[Object.keys(n).length>0&&o.jsx(q,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(Qt,{...i,dark:!!t.dark})]})}const oo=$.styled(to)`
|
|
419
|
-
.card__description {
|
|
420
|
-
white-space: pre-wrap;
|
|
421
|
-
}
|
|
422
|
-
.section__description {
|
|
423
|
-
}
|
|
424
|
-
.card {
|
|
425
|
-
/* background: inherit !important; */
|
|
426
|
-
}
|
|
427
|
-
&.dark .card-simple .card__body::before {
|
|
428
|
-
background: #212121 !important;
|
|
429
|
-
}
|
|
430
|
-
.card-simple .card__body::after {
|
|
431
|
-
background: inherit !important;
|
|
432
|
-
}
|
|
433
|
-
`;function no({section:e,...t}){const[{editing:n},r]=C(t,U),i=f.useMemo(()=>({...N.default(r,["listBorder","list","iconSize","imageSize"]),list:r.list?.map(s=>({...N.default(s,"icon","iconColor"),image:["news","simple","default"].includes(r.type)&&s.icon?s.icon:s.image,actions:s.actions?.map?.(c=>o.jsx(_e,{...c,editing:n},c.id)),border:r.listBorder,iconSize:r.iconSize,imageSize:r.imageSize,hoverStyle:r.hoverStyle}))}),[r]);return o.jsx(oo,{style:n?{pointerEvents:"none"}:{},...i})}function ro({properties:e,section:t,locale:n,dev:r}){return t?.config?.componentId?o.jsx(Q.CustomComponentRenderer,{instanceId:t.id,componentId:t.config.componentId,blockletId:t.config.blockletId,blockletTitle:t.config.blockletTitle,componentName:t.config.componentName,locale:n,properties:e,dev:r}):o.jsx(u.Box,{sx:{textAlign:"center",py:2},children:o.jsx(u.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Please select component to render"})})}function io({src:e,dataId:t,isEdit:n=!1,height:r="100%",onLoad:i=()=>{}}){return o.jsx(et.EmbedIframe,{isEdit:n,embedId:t,src:e,height:r,onLoad:()=>{i()}})}function so({dataId:e,src:t,actions:n,center:r,onLoad:i,...s}){const[c,a]=C(s,L);return o.jsxs(O,{...a,children:[Object.keys(c).length>0&&o.jsx(q,{center:r,...c}),o.jsx(io,{dataId:e,src:t,onLoad:i,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:r})]})}const ao={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function lo({section:e,id:t,src:n,...r}){const i=`${t}-${r.locale}`,[{editing:s},c]=C(r,U),a=f.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Xe.useMessage(i,"server"),x=Qe.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return f.useEffect(()=>{d&&d.onInit(()=>x.current)},[d]),f.useEffect(()=>{const m=JSON.parse(JSON.stringify(c.config)||"{}");ct.default(a.current,m)||(a.current=m,d?.send("config-set",m))},[d,c.config]),n?o.jsx(so,{...l,dataId:i,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(co,{children:'Please set the "src" attribute for this block'})}const co=$.styled("div")`
|
|
434
|
-
user-select: none;
|
|
435
|
-
color: #999;
|
|
436
|
-
padding: 8px;
|
|
437
|
-
height: 200px;
|
|
438
|
-
`,uo=12,mo=({gridSettings:e,section:t,index:n,columns:r,simulateMode:i="desktop",isBackground:s})=>{const c=e?.[i]??{},a=c[t.id],l=xo(c);return{i:t.id,static:t?.locked||s,...s?{x:0,y:0,w:r,h:1,isResizable:!1}:{x:a?.x??0,y:a?.y??n,w:a?.w??r,h:a?.h??1,isResizable:!0},minH:1,maxH:1,maxY:l}},xo=e=>Object.values(e).reduce((t,n)=>Math.max(t,n.y||0),0)||0,po=e=>{const{dev:t,id:n,section:r,onBlockRender:i}=e,s=t?.mode,c=u.useMediaQuery(g=>g.breakpoints.down("sm")),{t:a}=tt.useLocaleContext(),{sections:l,sectionIds:d,config:x}=r,{columns:m=uo,gridSettings:h}=x||{},p=f.useCallback((g,v=!1,S=0)=>{if(!i||!g||!g.component||g.visibility==="hidden")return null;const _=mo({gridSettings:h,section:g,index:S,columns:m,simulateMode:c?"mobile":"desktop",isBackground:v}),M=_?.x??0,P=_?.y??0,W=_?.w??m,Se=_?.h??1,Be=_?.maxY??0,Ce=!!r?.config?.backgroundSectionId;return o.jsx(u.Box,{className:v?"layout-block-background":"layout-block-section",sx:{...v?{gridColumn:"1 / -1",gridRow:`1 / ${Be+1}`,zIndex:0,width:"100%",height:"100%","& .BlockBase-root":{width:"100%",height:"100%"}}:{position:"relative",gridColumn:`${M+1} / span ${W}`,gridRow:`${P+(Ce?0:1)} / span ${Se}`,zIndex:1}},children:i({id:g.id,type:g.component,config:{},section:{...g},mode:s})},g.id)},[n,s,i,h,m,c]),{backgroundElements:b,contentElements:y}=f.useMemo(()=>{if(!d||!d.length||!l||!Object.keys(l).length)return{backgroundElements:[],contentElements:[]};const g=[],v=[];return d?.forEach((S,_)=>{const M=l[S];if(!M)return;const P=r?.config?.backgroundSectionId===S,W=p(M,P,_);W&&(P?g.push(W):v.push(W))}),{backgroundElements:g,contentElements:v}},[p,l,d]);return s==="draft"&&!b?.length&&!y?.length?o.jsxs(u.Box,{sx:{gridColumn:"1 / -1",gridRow:"1",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,border:g=>`2px dashed ${g.palette.divider}`,borderRadius:2,padding:4,color:"text.secondary",textAlign:"center",minHeight:"160px"},children:[o.jsx(u.Box,{sx:{fontSize:"48px",opacity:.5},children:"📐"}),o.jsx(u.Box,{sx:{fontSize:"16px",fontWeight:500,marginBottom:1},children:"Section Layout"}),o.jsx(u.Box,{sx:{opacity:.7,whiteSpace:"pre-line"},children:a("maker.layoutBlock.draftPlaceholder")}),o.jsx(u.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",opacity:.1,background:g=>`
|
|
439
|
-
repeating-linear-gradient(
|
|
440
|
-
90deg,
|
|
441
|
-
transparent,
|
|
442
|
-
transparent calc(100% / ${m} - 1px),
|
|
443
|
-
${g.palette.grey[400]} calc(100% / ${m} - 1px),
|
|
444
|
-
${g.palette.grey[400]} calc(100% / ${m})
|
|
445
|
-
)
|
|
446
|
-
`}})]}):o.jsxs(u.Box,{sx:{position:"relative",display:"grid",gridTemplateColumns:`repeat(${m}, 1fr)`,alignItems:"center",width:"100%",height:"100%"},children:[b,y]})},ho=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function go(e){if(/youtu\.?be/.test(e))for(const t of ho){const n=t.exec(e)?.[1];if(n)return n}}function fo(e){const t=go(e);if(t)return`https://youtube.com/embed/${t}`}function yo({src:e}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:e})}function bo(e){return o.jsx(u.Box,{sx:{maxHeight:400,overflow:"hidden auto"},children:o.jsx(ot.TwitterTimelineEmbed,{...e})})}function wo({url:e}){const t=f.useRef(null),n=495,[r,i]=f.useState(t.current?t.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=t.current?t.current.offsetWidth*.5625:n;return i(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[r,s]),o.jsx(u.Box,{component:"iframe",ref:t,title:"youtube",src:e,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{width:"100%",height:`${r}px`,display:"block"}})}const jo={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},vo=$.styled(It)`
|
|
447
|
-
.section__description {
|
|
448
|
-
}
|
|
449
|
-
`;function ko({hasImage:e,fullSizeImage:t,boxed:n,videoPoster:r,imageMeta:i,imageOptimization:s,imageSize:c,section:a,...l}){const[{editing:d},x]=C({...l,boxed:t?void 0:n},U);let m=_o(x.image,r,t,i,s,c);e||(m=null);let h=null;return x.actions&&(h=x.actions?.map?.((p,b)=>o.jsx(_e,{...p,editing:d},b))),o.jsx(vo,{...x,style:d?{pointerEvents:"none"}:{},image:m,fullSizeImage:e&&t,actions:h})}function _o(e,t,n,r,i,s){if(e){if(e.endsWith(".json"))return o.jsx(yo,{src:e});if(e.indexOf("twitter.com")!==-1)return o.jsx(bo,{sourceType:"url",url:e});const c=fo(e);if(c)return o.jsx(wo,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=r||{};if(z(e))return o.jsx("video",{width:a&&`${a}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:s||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:k.autoResizeImage(k.getImageAbsoluteUrl(t),n?1200:540,i),children:o.jsx("source",{src:k.getImageAbsoluteUrl(e),type:$t(e)})},e);const x=i==="quality"?1:.6;return o.jsx(Q.ResponsiveImage,{src:k.getImageAbsoluteUrl(e),sizesAttr:{sm:600*x,md:450*x,lg:540*x,...n&&{md:900*x,lg:1200*x}},width:a&&`${a}px`,height:l&&`${l}px`,alt:d??e,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const $o=["production","draft"];function So({mode:e,version:t}={}){const n=t&&typeof t=="number"?{mode:e,version:t}:{mode:e};return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(r=>r.data)}function Bo({mode:e,routes:t}){return k.api.post(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:e,routes:t}).then(n=>n.data)}function Co({locale:e,sort:t,page:n,limit:r,mode:i}={}){return k.api.get(`/api/${k.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:e,sort:t,page:n,limit:r,mode:i}}).then(s=>s.data)}const No={style:"list",sort:"-updatedAt"},de=20;function Io({style:e,sort:t,section:n,...r}){const[{editing:i,locale:s},c]=C(r,U),[a,l]=C(c,L),[d,x]=f.useState(),m=f.useRef(!1),h=re.useUpdate(),p=Z.useNavigate(),b=f.useCallback(async()=>{if(!m.current){m.current=!0,h();try{const y=d?Math.floor(d.list.length/de)+1:1,{list:j,total:g}=await Co({locale:s,sort:t,page:y,limit:de});x(v=>({list:(v?.list??[]).concat(j),total:g}))}finally{m.current=!1,h()}}},[d,s,t,h]);return re.useMount(()=>{b()}),o.jsxs(O,{...l,sx:i?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(q,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(u.Grid,{container:!0,spacing:2,sx:{justifyContent:"center"},children:d?.list.map(y=>o.jsx(u.Grid,{size:{xs:12,sm:e==="card"?6:12,md:e==="card"?3:12},children:o.jsxs(Mo,{elevation:0,className:w.cx(e==="card"&&"style-card"),onClick:i?void 0:()=>p(y.slug),children:[!!y.image&&o.jsx(u.CardMedia,{component:"img",alt:"",image:k.autoResizeImage(k.getImageAbsoluteUrl(y.image),540),loading:"lazy"}),o.jsxs(u.CardContent,{children:[o.jsx(u.Typography,{variant:"h6",component:"div",className:ue,children:y.title||y.id}),o.jsx(u.Typography,{variant:"body2",className:ue,children:y.description})]})]})},y.id))}),o.jsx(u.Box,{sx:{textAlign:"center",mt:2},children:d.total>d.list.length?o.jsx(A,{variant:"outlined",color:"secondary",onClick:b,loading:m.current,children:"More"}):o.jsx(A,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(u.Box,{sx:{p:2,textAlign:"center"},children:o.jsx(u.CircularProgress,{size:24})})]})}const ue=w.css`
|
|
450
|
-
display: -webkit-box;
|
|
451
|
-
-webkit-box-orient: vertical;
|
|
452
|
-
-webkit-line-clamp: 2;
|
|
453
|
-
overflow: hidden;
|
|
454
|
-
text-overflow: ellipsis;
|
|
455
|
-
`,Mo=$.styled(u.Card)`
|
|
456
|
-
border: 1px solid #e0e0e0;
|
|
457
|
-
background-color: transparent;
|
|
458
|
-
cursor: pointer;
|
|
459
|
-
display: flex;
|
|
460
|
-
color: inherit;
|
|
461
|
-
|
|
462
|
-
> .MuiCardMedia-root {
|
|
463
|
-
width: 30vw;
|
|
464
|
-
max-height: 50vw;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
&.style-card {
|
|
468
|
-
display: block;
|
|
469
|
-
|
|
470
|
-
> .MuiCardMedia-root {
|
|
471
|
-
width: 100%;
|
|
472
|
-
max-height: 50vw;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
`,Po={iframe:lo,section:ko,"section-card-list":no,toc:Io,"ai-runtime":Rt,"custom-component":ro,"layout-block":po};function $e({id:e,type:t,mode:n,config:r,section:i,ignorePageMetaStyle:s,page:c,...a}){const l=Po[t],{getPageMetaStyle:d}=bt(),x=f.useMemo(()=>{const{height:p,...b}=r;return t==="layout-block"&&(b.onBlockRender=y=>{const j={...r?.dev,...y?.config?.dev},{defaultLocale:g}=j,v={...J.default(r,["locale","editing"]),...y?.config,dev:j},{locale:S}=v;let _=c?.dataSource?.[y?.id]?.[S];return nt.default(_)&&(_=c?.dataSource?.[y?.id]?.[g??"en"]),o.jsx($e,{...y,config:{...y?.section?.properties,..._,...v},page:c,ignorePageMetaStyle:!0})}),b},[r,t]),m=f.useMemo(()=>{const p={};return t!=="custom-component"&&(p.height=r.height),p.sx=s?void 0:d("sx"),p.id=`BlockBase-${e}`,p},[r.height,s,t,d]),h=l&&o.jsx(l,{mode:n,...x,id:e,section:i});return h?o.jsx(Mt,{...a,...m,children:h}):o.jsx(Ro,{type:t})}function Ro({type:e}){return o.jsx(u.Box,{sx:{p:2},children:o.jsxs(u.Alert,{icon:o.jsx(Te.ErrorOutline,{}),color:"error",children:["Unsupported Block `",e,"`"]})})}exports.BlockRenderer=$e;exports.IFrameBlockDefaultProps=ao;exports.PageProvider=wt;exports.Provider=Et;exports.STATE_MODES=$o;exports.SectionBlockDefaultProps=jo;exports.TocDefaultProps=No;exports.getPages=So;exports.publishPages=Bo;
|