@blocklet/pages-kit-inner-components 0.4.87 → 0.4.89

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.
@@ -1,4 +1,4 @@
1
- "use strict";var Ne=Object.create;var ge=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Ue=(e,s,o,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of Fe(s))!qe.call(e,d)&&d!==o&&ge(e,d,{get:()=>s[d],enumerable:!(l=Ee(s,d))||l.enumerable});return e};var We=(e,s,o)=>(o=e!=null?Ne(Ve(e)):{},Ue(s||!e||!e.__esModule?ge(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),B=require("./chunks/state-BjeG4kYg.js"),Me=require("@arcblock/ux/lib/Empty"),_=require("@arcblock/ux/lib/Locale/context"),ne=require("@blocklet/code-editor"),Ke=require("@mui/icons-material/AddRounded"),Le=require("@mui/icons-material/ArrowDownward"),$e=require("@mui/icons-material/ArrowUpward"),Je=require("@mui/icons-material/DeleteOutline"),r=require("@mui/material"),He=require("lodash/sortBy"),P=require("react"),ce=require("react-use"),Ye=require("@arcblock/ux/lib/Theme"),Ge=require("@emotion/css"),re=require("ahooks"),Qe=require("gradient-parser");require("lodash/without");const Xe=require("tinycolor2"),D=require("@mui/material/colors"),A=require("./uploader.js"),Ze=require("@iconify-icon/react"),et=require("lodash/isEmpty"),tt=require("lodash/set"),rt=require("yaml"),st=require("lodash/cloneDeep"),ot=require("@arcblock/ux/lib/Toast"),Z=require("@blocklet/pages-kit/components"),Pe=require("@mui/base"),z=require("@mui/icons-material"),ve=require("@mui/material/styles"),Y=require("@syncedstore/core"),lt=require("lodash/assign"),it=require("lodash/has"),nt=require("lodash/isNil"),ct=require("lodash/isObject"),at=require("lodash/keyBy"),ut=require("lodash/omit"),dt=require("lodash/pick"),pt=require("lodash/reduce"),F=require("material-ui-popup-state/hooks"),xt=require("react-error-boundary"),se=require("react-dnd"),O=e=>e&&e.__esModule?e:{default:e};function mt(e){if(e&&e.__esModule)return e;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(s,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return s.default=e,Object.freeze(s)}const G=O(Me),ft=O(Ke),ht=O(Le),bt=O($e),jt=O(Je),N=O(He),ke=O(Qe),yt=O(Xe),Ce=O(et),Te=O(tt),oe=mt(rt),gt=O(st),Se=O(ot),vt=O(lt),kt=O(it),ee=O(nt),St=O(ct),wt=O(at),It=O(ut),Pt=O(dt),Ct=O(pt);function Tt({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"warning",variant:"outlined",disabled:s,onClick:e,...l,children:t.jsx(jt.default,{fontSize:"small"})})}function Bt({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...l,children:t.jsx(bt.default,{fontSize:"small"})})}function Ot({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...l,children:t.jsx(ht.default,{fontSize:"small"})})}function Rt({label:e,value:s,onChange:o,disabled:l=!1,itemLabel:d="",emptyHeight:m=40,property:a,renderItem:b,...g}){const{t:f,locale:k}=_.useLocaleContext(),x=ce.useUpdate(),i=P.useCallback(h=>{o(B.transformValue(h,a.type))},[o,a.type]),c=P.useMemo(()=>Array.isArray(s)?s:[],[s]),n=P.useCallback(()=>{const h=[...c,""];i(h),x()},[c,i,x]),p=P.useCallback(()=>{if(!a||!a.subProperties)return n();const h={};N.default(Object.values(a.subProperties),"index").forEach(({data:R})=>{var V,q;if(!R.key)return;const E=((q=(V=R.locales)==null?void 0:V[k])==null?void 0:q.defaultValue)??"";h[R.key]=E});const T=[...c,h];i(T),x()},[c,i,x,a,k,n]),j=P.useCallback(h=>{try{const I=JSON.parse(h);Array.isArray(I)?i(I):console.error("JSON解析结果不是数组")}catch(I){console.error("JSON解析错误:",I)}},[i]),w=P.useCallback(h=>{const I=c.filter((T,R)=>R!==h);i(I),x()},[c,i,x]),u=P.useCallback(h=>{if(h<=0)return;const I=[...c],T=I[h];I[h]=I[h-1],I[h-1]=T,i(I),x()},[c,i,x]),v=P.useCallback(h=>{if(h>=c.length-1)return;const I=[...c],T=I[h];I[h]=I[h+1],I[h+1]=T,i(I),x()},[c,i,x]),y=P.useCallback((h,I)=>{const T=[...c];T[h]=I,i(T)},[c,i]),S=a&&a.subProperties&&Object.keys(a.subProperties).length>0,C=P.useMemo(()=>[{field:"index",headerName:"#",width:40,align:"center",renderCell:({index:h})=>t.jsx(r.Typography,{variant:"body1",sx:{bgcolor:"action.hover",borderRadius:"50%",width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:h+1})},{field:"content",headerName:"",renderCell:({row:h,index:I})=>b&&S?b({item:h,index:I,property:a,onChange:T=>y(I,T)}):t.jsx(r.TextField,{fullWidth:!0,size:"small",disabled:l,value:h,placeholder:d||`${f("item")} ${I+1}`,onChange:T=>y(I,T.target.value),...g})},{field:"actions",headerName:"",width:30,align:"center",renderCell:({index:h})=>t.jsxs(r.Stack,{direction:"column",spacing:.25,children:[t.jsx(Bt,{disabled:l||h===0,onClick:()=>u(h)}),t.jsx(Ot,{disabled:l||h===c.length-1,onClick:()=>v(h)}),t.jsx(Tt,{disabled:l,onClick:()=>w(h)})]})}],[b,S,a,y,d,f,l,g,w,u,v,c.length]);return S?t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),c.length>0?t.jsx(r.TableContainer,{component:r.Paper,variant:"outlined",sx:{borderRadius:1,mb:1},children:t.jsxs(r.Table,{size:"small",sx:{"& .MuiTableCell-root":{py:.25,px:1,whiteSpace:"nowrap"},"& .MuiTableCell-head":{backgroundColor:"action.hover",py:.25,px:1},borderCollapse:"collapse"},children:[t.jsx(r.TableHead,{sx:{display:"none"},children:t.jsx(r.TableRow,{children:C.map(h=>t.jsx(r.TableCell,{width:h.width,align:h.align||"left",sx:{fontWeight:"bold"},children:h.renderHeader?h.renderHeader():h.headerName},h.field))})}),t.jsx(r.TableBody,{children:c.map((h,I,T)=>t.jsx(r.TableRow,{sx:{borderBottom:I<T.length-1?"1px solid":"none",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:C.map(R=>t.jsx(r.TableCell,{width:R.width,align:R.align||"left",sx:{borderBottom:"none"},children:R.renderCell({row:h,index:I,onChange:E=>y(I,E)})},`${I}-${R.field}`))},I))})]})}):t.jsx(G.default,{style:{fontSize:12,height:m},children:f("maker.properties.arrayEmpty")}),t.jsx(r.Button,{fullWidth:!0,size:"small",variant:"outlined",disabled:l,startIcon:t.jsx(ft.default,{}),onClick:p,children:f("maker.properties.addArrayItem")})]}):t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,minHeight:150},children:t.jsx(ne.CodeEditor,{keyId:a.id,locale:k,language:"json",value:JSON.stringify(c,null,2),onChange:h=>j(h||"")},a.id)})]})}D.red[300],D.pink[300],D.purple[300],D.indigo[300],D.blue[300],D.cyan[300],D.teal[300],D.green[300],D.lime[300],D.yellow[300],D.amber[300],D.orange[300],D.brown[300],D.grey[300],D.blueGrey[300];const _t=P.forwardRef(function({showMarkdown:s,markdown:o,onMarkdownChange:l,showUploader:d,value:m,meta:a,onChange:b,...g},f){const[k,x]=P.useState("");P.useEffect(()=>{x(m||"")},[m,x]);const i=async()=>{if(k!==m){const n=B.getImageAbsoluteUrl(k);if(!n){b(k,void 0);return}const p=await A.getImageSize(n).catch(()=>A.getVideoSize(n)).catch(()=>{});b(k,{...p,filename:k})}};ce.useDebounce(()=>{k!==m&&b(k)},300,[k]),P.useImperativeHandle(f,()=>({submit:i}));const c={};return d&&(c.InputProps={sx:{pr:0},endAdornment:t.jsx(r.InputAdornment,{position:"end",sx:{mx:.5},children:t.jsx(A.UploaderButton,{onChange:async({response:n})=>{var u;const p=(u=n==null?void 0:n.data)==null?void 0:u.filename,j=B.getImageAbsoluteUrl(p)||"";let w={};j&&(w=await A.getImageSize(j).catch(()=>A.getVideoSize(j)).catch(()=>{})),b(p,{...w,filename:p})}})})}),t.jsx(r.TextField,{size:"small",fullWidth:!0,...g,label:t.jsxs(r.Stack,{direction:"row",spacing:1,alignItems:"center",children:[g.label,s&&t.jsxs(t.Fragment,{children:[" (",t.jsx(r.FormControlLabel,{checked:o,label:t.jsx(r.Box,{component:Ze.Icon,icon:"tabler:markdown",sx:{verticalAlign:"middle"}}),labelPlacement:"start",control:t.jsx(r.Switch,{size:"small"}),sx:{ml:.25,pr:1},onChange:(n,p)=>l==null?void 0:l(p)}),")"]})]}),InputLabelProps:{shrink:!0,...g.InputLabelProps},value:k,onChange:n=>x(n.target.value),...c,onKeyDown:n=>{n.keyCode!==229&&n.key==="Enter"&&i()}})}),Dt=P.lazy(()=>import("react-best-gradient-color-picker")),At=0,zt=100;function Nt(e){try{const o=ke.default.parse(e).map(d=>{const m=d.colorStops.map((a,b)=>{let{value:g}=a;if(typeof g!="string"&&!Array.isArray(g))throw new Error("Invalid color stop value type");let{type:f}=a;if(f!=="rgba"){const i=yt.default(g).toRgb();g=[`${i.r}`,`${i.g}`,`${i.b}`,`${i.a}`],f="rgba"}if(a.length)return{...a,value:g,type:f};const k=d.colorStops.length;let x;return b===0?x=At:b===k-1?x=zt:x=b/(k-1)*100,{...a,value:g,type:f,length:{value:`${x}`,type:"%"}}});return{...d,colorStops:m}});return ke.default.stringify(o).replace(/NaN/g,"100")}catch{return B.isColorString(e)?`${e}`.replace(/NaN/g,"100"):""}}function Et({color:e,sx:s={},...o}){B.isColorString(e);const l={};return B.isGradient(e)?l.backgroundImage=e:l.backgroundColor=e,t.jsx(r.Box,{sx:{...s,width:"100%",paddingBottom:"100%",cursor:"pointer",transition:"opacity 0.2s",border:"1px solid #ccc",borderRadius:.5,"&:hover":{opacity:.75},...l},...o})}const Ft=P.forwardRef(function({onSave:s},o){const l=re.useReactive({value:""}),{t:d}=_.useLocaleContext(),m={};l.value?B.isGradient(l.value)?m.backgroundImage=l.value:m.backgroundColor=l.value:m.border="1px solid #ccc";const[a,{setFalse:b,setTrue:g}]=re.useBoolean(!1),f=P.useCallback(()=>{b()},[b]),k=()=>{s({value:l.value},f)};return P.useImperativeHandle(o,()=>({open({value:x}={value:""}){l.value=Nt(x),g()},close(){f()}})),t.jsxs(r.Dialog,{disableEnforceFocus:!0,open:a,onClose:f,hideBackdrop:!0,children:[t.jsx(r.DialogTitle,{children:d("maker.configBackground")}),t.jsx(r.DialogContent,{sx:{width:600},children:t.jsxs(r.Box,{width:"100%",display:"flex",children:[t.jsx(r.Box,{flex:1,mr:1,sx:{...m,borderRadius:.5},children:!l.value&&t.jsx(G.default,{children:d("error.notConfig")})}),t.jsx(P.Suspense,{children:t.jsx(Dt,{disableDarkMode:!0,width:240,height:240,value:l.value,onChange:x=>{l.value=x},hidePresets:!0,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0})})]})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{variant:"outlined",size:"small",onClick:f,children:d("common.cancel")}),t.jsx(r.Button,{variant:"contained",size:"small",onClick:k,children:d("maker.save")})]})]})});Ye.styled(r.Box)`
1
+ "use strict";var Ne=Object.create;var ge=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Ve=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Ue=(e,s,o,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let d of Fe(s))!qe.call(e,d)&&d!==o&&ge(e,d,{get:()=>s[d],enumerable:!(l=Ee(s,d))||l.enumerable});return e};var We=(e,s,o)=>(o=e!=null?Ne(Ve(e)):{},Ue(s||!e||!e.__esModule?ge(o,"default",{value:e,enumerable:!0}):o,e));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),B=require("./chunks/state-BjeG4kYg.js"),Me=require("@arcblock/ux/lib/Empty"),_=require("@arcblock/ux/lib/Locale/context"),ne=require("@blocklet/code-editor"),Ke=require("@mui/icons-material/AddRounded"),Le=require("@mui/icons-material/ArrowDownward"),$e=require("@mui/icons-material/ArrowUpward"),Je=require("@mui/icons-material/DeleteOutline"),r=require("@mui/material"),He=require("lodash/sortBy"),P=require("react"),ce=require("react-use"),Ye=require("@arcblock/ux/lib/Theme"),Ge=require("@emotion/css"),re=require("ahooks"),Qe=require("gradient-parser");require("lodash/without");const Xe=require("tinycolor2"),D=require("@mui/material/colors"),A=require("./uploader.js"),Ze=require("@iconify-icon/react"),et=require("lodash/isEmpty"),tt=require("lodash/set"),rt=require("yaml"),st=require("lodash/cloneDeep"),ot=require("@arcblock/ux/lib/Toast"),Z=require("@blocklet/pages-kit/components"),Pe=require("@mui/base"),z=require("@mui/icons-material"),ve=require("@mui/material/styles"),Y=require("@syncedstore/core"),lt=require("lodash/assign"),it=require("lodash/has"),nt=require("lodash/isNil"),ct=require("lodash/isObject"),at=require("lodash/keyBy"),ut=require("lodash/omit"),dt=require("lodash/pick"),pt=require("lodash/reduce"),F=require("material-ui-popup-state/hooks"),xt=require("react-error-boundary"),se=require("react-dnd"),O=e=>e&&e.__esModule?e:{default:e};function mt(e){if(e&&e.__esModule)return e;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(s,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return s.default=e,Object.freeze(s)}const G=O(Me),ft=O(Ke),ht=O(Le),bt=O($e),jt=O(Je),N=O(He),ke=O(Qe),yt=O(Xe),Ce=O(et),Te=O(tt),oe=mt(rt),gt=O(st),Se=O(ot),vt=O(lt),kt=O(it),ee=O(nt),St=O(ct),wt=O(at),It=O(ut),Pt=O(dt),Ct=O(pt);function Tt({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"warning",variant:"outlined",disabled:s,onClick:e,...l,children:t.jsx(jt.default,{fontSize:"small"})})}function Bt({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...l,children:t.jsx(bt.default,{fontSize:"small"})})}function Ot({onClick:e,disabled:s,sx:o,...l}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...l,children:t.jsx(ht.default,{fontSize:"small"})})}function Rt({label:e,value:s,onChange:o,disabled:l=!1,itemLabel:d="",emptyHeight:m=40,property:u,renderItem:b,...g}){const{t:f,locale:k}=_.useLocaleContext(),x=ce.useUpdate(),i=P.useCallback(h=>{o(B.transformValue(h,u.type))},[o,u.type]),c=P.useMemo(()=>Array.isArray(s)?s:[],[s]),n=P.useCallback(()=>{const h=[...c,""];i(h),x()},[c,i,x]),p=P.useCallback(()=>{if(!u||!u.subProperties)return n();const h={};N.default(Object.values(u.subProperties),"index").forEach(({data:R})=>{var V,q;if(!R.key)return;const E=((q=(V=R.locales)==null?void 0:V[k])==null?void 0:q.defaultValue)??"";h[R.key]=E});const T=[...c,h];i(T),x()},[c,i,x,u,k,n]),j=P.useCallback(h=>{try{const I=JSON.parse(h);Array.isArray(I)?i(I):console.error("JSON解析结果不是数组")}catch(I){console.error("JSON解析错误:",I)}},[i]),w=P.useCallback(h=>{const I=c.filter((T,R)=>R!==h);i(I),x()},[c,i,x]),a=P.useCallback(h=>{if(h<=0)return;const I=[...c],T=I[h];I[h]=I[h-1],I[h-1]=T,i(I),x()},[c,i,x]),v=P.useCallback(h=>{if(h>=c.length-1)return;const I=[...c],T=I[h];I[h]=I[h+1],I[h+1]=T,i(I),x()},[c,i,x]),y=P.useCallback((h,I)=>{const T=[...c];T[h]=I,i(T)},[c,i]),S=u&&u.subProperties&&Object.keys(u.subProperties).length>0,C=P.useMemo(()=>[{field:"index",headerName:"#",width:40,align:"center",renderCell:({index:h})=>t.jsx(r.Typography,{variant:"body1",sx:{bgcolor:"action.hover",borderRadius:"50%",width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:h+1})},{field:"content",headerName:"",renderCell:({row:h,index:I})=>b&&S?b({item:h,index:I,property:u,onChange:T=>y(I,T)}):t.jsx(r.TextField,{fullWidth:!0,size:"small",disabled:l,value:h,placeholder:d||`${f("item")} ${I+1}`,onChange:T=>y(I,T.target.value),...g})},{field:"actions",headerName:"",width:30,align:"center",renderCell:({index:h})=>t.jsxs(r.Stack,{direction:"column",spacing:.25,children:[t.jsx(Bt,{disabled:l||h===0,onClick:()=>a(h)}),t.jsx(Ot,{disabled:l||h===c.length-1,onClick:()=>v(h)}),t.jsx(Tt,{disabled:l,onClick:()=>w(h)})]})}],[b,S,u,y,d,f,l,g,w,a,v,c.length]);return S?t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),c.length>0?t.jsx(r.TableContainer,{component:r.Paper,variant:"outlined",sx:{borderRadius:1,mb:1},children:t.jsxs(r.Table,{size:"small",sx:{"& .MuiTableCell-root":{py:.25,px:1,whiteSpace:"nowrap"},"& .MuiTableCell-head":{backgroundColor:"action.hover",py:.25,px:1},borderCollapse:"collapse"},children:[t.jsx(r.TableHead,{sx:{display:"none"},children:t.jsx(r.TableRow,{children:C.map(h=>t.jsx(r.TableCell,{width:h.width,align:h.align||"left",sx:{fontWeight:"bold"},children:h.renderHeader?h.renderHeader():h.headerName},h.field))})}),t.jsx(r.TableBody,{children:c.map((h,I,T)=>t.jsx(r.TableRow,{sx:{borderBottom:I<T.length-1?"1px solid":"none",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:C.map(R=>t.jsx(r.TableCell,{width:R.width,align:R.align||"left",sx:{borderBottom:"none"},children:R.renderCell({row:h,index:I,onChange:E=>y(I,E)})},`${I}-${R.field}`))},I))})]})}):t.jsx(G.default,{style:{fontSize:12,height:m},children:f("maker.properties.arrayEmpty")}),t.jsx(r.Button,{fullWidth:!0,size:"small",variant:"outlined",disabled:l,startIcon:t.jsx(ft.default,{}),onClick:p,children:f("maker.properties.addArrayItem")})]}):t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,minHeight:150},children:t.jsx(ne.CodeEditor,{keyId:u.id,locale:k,language:"json",value:JSON.stringify(c,null,2),onChange:h=>j(h||"")},u.id)})]})}D.red[300],D.pink[300],D.purple[300],D.indigo[300],D.blue[300],D.cyan[300],D.teal[300],D.green[300],D.lime[300],D.yellow[300],D.amber[300],D.orange[300],D.brown[300],D.grey[300],D.blueGrey[300];const _t=P.forwardRef(function({showMarkdown:s,markdown:o,onMarkdownChange:l,showUploader:d,value:m,meta:u,onChange:b,...g},f){const[k,x]=P.useState("");P.useEffect(()=>{x(m||"")},[m,x]);const i=async()=>{if(k!==m){const n=B.getImageAbsoluteUrl(k);if(!n){b(k,void 0);return}const p=await A.getImageSize(n).catch(()=>A.getVideoSize(n)).catch(()=>{});b(k,{...p,filename:k})}};ce.useDebounce(()=>{k!==m&&b(k)},300,[k]),P.useImperativeHandle(f,()=>({submit:i}));const c={};return d&&(c.InputProps={sx:{pr:0},endAdornment:t.jsx(r.InputAdornment,{position:"end",sx:{mx:.5},children:t.jsx(A.UploaderButton,{onChange:async({response:n})=>{var a;const p=(a=n==null?void 0:n.data)==null?void 0:a.filename,j=B.getImageAbsoluteUrl(p)||"";let w={};j&&(w=await A.getImageSize(j).catch(()=>A.getVideoSize(j)).catch(()=>{})),b(p,{...w,filename:p})}})})}),t.jsx(r.TextField,{size:"small",fullWidth:!0,...g,label:t.jsxs(r.Stack,{direction:"row",spacing:1,alignItems:"center",children:[g.label,s&&t.jsxs(t.Fragment,{children:[" (",t.jsx(r.FormControlLabel,{checked:o,label:t.jsx(r.Box,{component:Ze.Icon,icon:"tabler:markdown",sx:{verticalAlign:"middle"}}),labelPlacement:"start",control:t.jsx(r.Switch,{size:"small"}),sx:{ml:.25,pr:1},onChange:(n,p)=>l==null?void 0:l(p)}),")"]})]}),InputLabelProps:{shrink:!0,...g.InputLabelProps},value:k,onChange:n=>x(n.target.value),...c,onKeyDown:n=>{n.keyCode!==229&&n.key==="Enter"&&i()}})}),Dt=P.lazy(()=>import("react-best-gradient-color-picker")),At=0,zt=100;function Nt(e){try{const o=ke.default.parse(e).map(d=>{const m=d.colorStops.map((u,b)=>{let{value:g}=u;if(typeof g!="string"&&!Array.isArray(g))throw new Error("Invalid color stop value type");let{type:f}=u;if(f!=="rgba"){const i=yt.default(g).toRgb();g=[`${i.r}`,`${i.g}`,`${i.b}`,`${i.a}`],f="rgba"}if(u.length)return{...u,value:g,type:f};const k=d.colorStops.length;let x;return b===0?x=At:b===k-1?x=zt:x=b/(k-1)*100,{...u,value:g,type:f,length:{value:`${x}`,type:"%"}}});return{...d,colorStops:m}});return ke.default.stringify(o).replace(/NaN/g,"100")}catch{return B.isColorString(e)?`${e}`.replace(/NaN/g,"100"):""}}function Et({color:e,sx:s={},...o}){B.isColorString(e);const l={};return B.isGradient(e)?l.backgroundImage=e:l.backgroundColor=e,t.jsx(r.Box,{sx:{...s,width:"100%",paddingBottom:"100%",cursor:"pointer",transition:"opacity 0.2s",border:"1px solid #ccc",borderRadius:.5,"&:hover":{opacity:.75},...l},...o})}const Ft=P.forwardRef(function({onSave:s},o){const l=re.useReactive({value:""}),{t:d}=_.useLocaleContext(),m={};l.value?B.isGradient(l.value)?m.backgroundImage=l.value:m.backgroundColor=l.value:m.border="1px solid #ccc";const[u,{setFalse:b,setTrue:g}]=re.useBoolean(!1),f=P.useCallback(()=>{b()},[b]),k=()=>{s({value:l.value},f)};return P.useImperativeHandle(o,()=>({open({value:x}={value:""}){l.value=Nt(x),g()},close(){f()}})),t.jsxs(r.Dialog,{disableEnforceFocus:!0,open:u,onClose:f,hideBackdrop:!0,children:[t.jsx(r.DialogTitle,{children:d("maker.configBackground")}),t.jsx(r.DialogContent,{sx:{width:600},children:t.jsxs(r.Box,{width:"100%",display:"flex",children:[t.jsx(r.Box,{flex:1,mr:1,sx:{...m,borderRadius:.5},children:!l.value&&t.jsx(G.default,{children:d("error.notConfig")})}),t.jsx(P.Suspense,{children:t.jsx(Dt,{disableDarkMode:!0,width:240,height:240,value:l.value,onChange:x=>{l.value=x},hidePresets:!0,hideAdvancedSliders:!0,hideColorGuide:!0,hideInputType:!0})})]})}),t.jsxs(r.DialogActions,{children:[t.jsx(r.Button,{variant:"outlined",size:"small",onClick:f,children:d("common.cancel")}),t.jsx(r.Button,{variant:"contained",size:"small",onClick:k,children:d("maker.save")})]})]})});Ye.styled(r.Box)`
2
2
  .color-item {
3
3
  position: relative;
4
4
  }
@@ -18,7 +18,7 @@
18
18
  top: 0;
19
19
  right: 0;
20
20
  }
21
- `;function Vt({value:e,onChange:s,...o}){const l=P.useRef(null);return t.jsxs(t.Fragment,{children:[t.jsx(_t,{...o,value:e,onChange:s,InputProps:{endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(Et,{color:e??"",style:{width:"1.5rem",height:"1.5rem",padding:0},onClick:()=>{var d;(d=l.current)==null||d.open({value:e??""})}})})}}),t.jsx(Ft,{ref:l,onSave:({value:d},m)=>{s(d),m()}})]})}function qt({label:e,value:s,onChange:o,property:l,component:d,defaultLocale:m,allComponents:a,PropertyValueField:b,onUpload:g}){const{locale:f}=_.useLocaleContext(),k=P.useRef(null);if(!Ce.default(l.subProperties)){const i=N.default(Object.values(l.subProperties||{}),"index").filter(c=>c.data.visible!==!1&&c.data.key);return t.jsxs(r.Stack,{width:"100%",children:[t.jsx(r.FormLabel,{sx:{px:.25,py:.5},children:e}),t.jsx(r.Box,{children:t.jsx(r.Box,{sx:{position:"relative"},children:i.map((c,n)=>{const{data:p}=c,j=p.key??p.id,w=n===i.length-1;let u=null;try{s&&typeof s=="object"?u=s[j]:typeof s=="string"&&(u=(l.type==="yaml"?oe.parse(s||""):JSON.parse(s||"{}"))[j])}catch{}u==null&&(p.locales&&f&&p.locales[f]?u=p.locales[f].defaultValue:p.locales&&m&&p.locales[m]&&(u=p.locales[m].defaultValue));const v=S=>{try{let C={};if(typeof s=="string")try{C=l.type==="yaml"?oe.parse(s||""):JSON.parse(s||"{}")}catch{}else typeof s=="object"&&s!==null&&(C={...s});Te.default(C,j,S);const h=B.transformValue(C,l.type);o==null||o(h)}catch(C){console.error("Error updating property:",C)}},y=8;return t.jsxs(r.Box,{sx:{mb:w?0:1,display:"flex",flexDirection:"row"},children:[t.jsxs(r.Box,{sx:{position:"relative",width:24,flexShrink:0},children:[t.jsx(r.Box,{sx:{position:"absolute",left:y,top:0,height:16,width:0,borderLeft:"1px dashed",borderColor:"divider"}}),t.jsx(r.Box,{sx:{position:"absolute",left:y,top:16,width:12,height:0,borderTop:"1px dashed",borderColor:"divider"}}),!w&&t.jsx(r.Box,{sx:{position:"absolute",left:y,top:16,bottom:-8,width:0,borderLeft:"1px dashed",borderColor:"divider"}})]}),t.jsx(r.Box,{sx:{flexGrow:1},children:t.jsx(b,{component:d,property:p,value:u,onChange:v,size:"small",fullWidth:!0,defaultLocale:m,allComponents:a})})]},p.id)})})})]})}return t.jsx(r.Stack,{width:"100%",gap:2,children:t.jsxs(r.Stack,{sx:{width:"100%",position:"relative",pt:1,pb:"6px",px:"1px",minHeight:50,".monaco-editor,.overflow-guard":{borderRadius:1}},children:[t.jsx(r.FormLabel,{sx:{position:"absolute",left:0,top:0,transform:"translate(0px, -7px) scale(0.75)"},children:e}),t.jsx(ne.CodeEditor,{keyId:l.id,locale:f,language:l.type==="yaml"?"yaml":"json",value:typeof s=="string"?s:"",onChange:i=>{o==null||o(i)},onUpload:i=>{k.current=i,g&&g(i)}},l.id),t.jsx(r.Box,{component:"fieldset",sx:{pointerEvents:"none",position:"absolute",left:0,top:-5,width:"100%",height:"100%",border:1,borderColor:"rgba(0, 0, 0, 0.23)",borderRadius:1,px:1,py:0},children:t.jsx(r.Box,{component:"legend",sx:{fontSize:"0.75em"},children:t.jsx(r.Box,{component:"span",sx:{opacity:0},children:e})})})]})})}const Ut=["string","multiline","json","yaml","url","component","custom"];function we(e){return e.type?!Ut.includes(e.type):!1}function Be({disabled:e,list:s,renderItem:o,...l}){const d=P.useRef(null),m=P.useId(),a=re.useUpdate(),b=N.default(Object.entries(s),c=>c[1].index).map(c=>c[0]),g=P.useRef(b),f=P.useCallback(c=>{g.current=c,a()},[a]),k=P.useCallback(({index:c},{index:n})=>{const p=[...g.current];p.splice(n,0,...p.splice(c,1)),f(p)},[f]);P.useEffect(()=>{f(b)},[b.join("-")]);const[{isOver:x},i]=se.useDrop({accept:m,collect:c=>({isOver:c.isOver()}),canDrop:()=>!e,drop:()=>{var p;const c=()=>{g.current.forEach((j,w)=>{const u=s[j];u&&(u.index=w)})},n=(p=Y.getYjsValue(s))==null?void 0:p.doc;n?n.transact(()=>{c()}):c()}});return P.useEffect(()=>{x||f(b)},[x]),i(d),t.jsx(r.Box,{...l,ref:d,className:Ge.cx(x&&"isDragging"),children:g.current.map((c,n)=>t.jsx(Wt,{type:m,disabled:e,id:c,index:n,itemIndex:p=>g.current.indexOf(p),move:k,children:p=>{const j=s[c];return j?o(j.data,n,p):null}},c))})}function Wt({disabled:e,id:s,index:o,type:l,children:d,itemIndex:m,move:a}){const b=P.useRef(),[{isDragging:g},f,k]=se.useDrag({type:l,item:()=>({id:s}),canDrag:()=>!e,collect:i=>({isDragging:i.isDragging()})}),[,x]=se.useDrop({accept:l,canDrop:()=>!e,hover(i,c){var y;if(!b.current)return;const n=m(i.id),p=o;if(n===p)return;const j=(y=b.current)==null?void 0:y.getBoundingClientRect(),w=(j.bottom-j.top)/2,v=c.getClientOffset().y-j.top;n<p&&v<w||n>p&&v>w||a({id:i.id,index:n},{id:s,index:o})}});return typeof d=="function"?d({isDragging:g,drag:f,drop:i=>(b.current=i,x(i)),preview:k}):(f(x(k(b))),t.jsx(r.Box,{ref:b,children:d}))}function Mt({drop:e,preview:s,drag:o,disabled:l,isDragging:d,children:m,onDelete:a,onVisibilityChange:b,visible:g=!0,actions:f,alwaysShowActions:k=!1}){const{t:x}=_.useLocaleContext();return t.jsx(r.Box,{ref:e,sx:{":hover .hover-visible":{maxWidth:"100%"},opacity:g?1:.5},children:t.jsxs(r.Box,{sx:{position:"relative"},children:[t.jsx(r.Box,{ref:s,sx:{flex:1,borderRadius:.5,bgcolor:d?"action.hover":"background.paper",opacity:.9999},children:m}),!l&&t.jsx(r.Box,{className:k?"":"hover-visible",sx:{maxWidth:k?"100%":0,overflow:"hidden",position:"absolute",right:2,top:2,transition:"max-width 0.3s ease-in-out"},children:t.jsxs(r.Stack,{direction:"row",sx:{bgcolor:i=>r.alpha(i.palette.grey[200],.9),borderRadius:1,p:.5,[`.${r.buttonClasses.root}`]:{minWidth:24,width:24,height:24,p:0}},children:[f,b&&t.jsx(r.Tooltip,{title:x(g?"hideParameter":"showParameter"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:()=>b(!g),children:g?t.jsx(z.VisibilityOffRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}}):t.jsx(z.VisibilityRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),a&&t.jsx(r.Tooltip,{title:x("delete"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:a,children:t.jsx(z.DeleteOutlineRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),t.jsx(r.Tooltip,{title:x("dragSort"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{ref:o,children:t.jsx(z.DragIndicatorRounded,{sx:{color:"grey.500"}})})})]})})]})})}function Kt({label:e,value:s,onChange:o}){const[l,d]=P.useState(!1);return t.jsxs(r.Stack,{gap:1,children:[t.jsx(r.TextField,{label:e,size:"small",value:s,onChange:m=>o==null?void 0:o(m.target.value),InputProps:{endAdornment:t.jsx(A.UploaderButton,{onChange:({response:m})=>{var b;const a=(b=m==null?void 0:m.data)==null?void 0:b.filename;a&&(o==null||o(a))}})}}),s&&t.jsx(r.Box,{component:"img",sx:{objectFit:"contain",borderRadius:1,cursor:"pointer"},src:B.getImageAbsoluteUrl(s),alt:e,maxWidth:100,maxHeight:100,width:"100%",onClick:()=>d(!0)}),t.jsx(r.Dialog,{open:l,onClose:()=>d(!1),children:t.jsx(r.Box,{component:"img",sx:{objectFit:"contain"},src:B.getImageAbsoluteUrl(s),alt:e})})]})}function le(e,s=""){return Ct.default(e,(o,l,d)=>{const m=s?`${s}.${d}`:d;return St.default(l)?vt.default(o,le(l,m)):o[m]=l,o},{})}const Lt=[{value:"string",label:"Text"},{value:"multiline",label:"Text (Multiline)"},{value:"number",label:"Number"},{value:"decimal",label:"Decimal"},{value:"boolean",label:"Boolean"},{value:"color",label:"Color"},{value:"url",label:"URL (Upload)"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"array",label:"Array"},{value:"component",label:"Component"},{value:"custom",label:"Custom (Render by a Component)"}];function X(e,s,o){return!e||!o?!1:Object.values(e).some(({data:l})=>l.id!==s&&l.key===o)}function ie(e,s){var o;return!e||!s?!1:((o=e[s])==null?void 0:o.data.visible)??!0}function $t({componentId:e}){const{state:{components:s}}=B.useStore(),o=s[e],l=o==null?void 0:o.data;return l?t.jsx(r.Stack,{maxHeight:"100%",overflow:"auto",children:t.jsx(r.Box,{p:2,children:t.jsx(xt.ErrorBoundary,{FallbackComponent:B.ErrorView,resetKeys:[e],children:t.jsx(Jt,{value:l})})})}):null}function Jt({value:e}){var g,f,k;const{t:s}=_.useLocaleContext(),{localState:{currentLocale:o,componentDebugProps:l},state:{config:{defaultLocale:d}},localActions:{setComponentDebugProps:m}}=B.useStore(),a=Y.getYjsValue(e).doc,b=B.useAllComponents();return t.jsx(r.Stack,{height:"100%",children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(Oe,{config:e}),t.jsx(_e,{config:e,currentLocale:o,defaultLocale:d,allComponents:b,onUpdateConfig:x=>{a.transact(()=>{x(e)})}}),t.jsxs(r.Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("renderer")}),t.jsxs(r.TextField,{hiddenLabel:!0,size:"small",select:!0,SelectProps:{autoWidth:!0},value:((g=e.renderer)==null?void 0:g.type)||"react-component",onChange:x=>{a.transact(()=>{const i=x.target.value;e.renderer??(e.renderer={type:i}),e.renderer.type=i})},children:[t.jsx(r.MenuItem,{value:"react-component",children:"React Component"}),t.jsx(r.MenuItem,{value:"component",children:"Custom Component"})]})]}),((f=e.renderer)==null?void 0:f.type)==="component"&&t.jsx(er,{value:e}),((k=e.renderer)==null?void 0:k.type)==="react-component"&&t.jsx(Zt,{value:e}),t.jsx(ae,{config:e,currentLocale:o,defaultLocale:d,allComponents:b,onChange:({key:x,value:i})=>{m({[x]:i.value})},props:{...l}})]})})}function Oe({config:e}){const{t:s}=_.useLocaleContext();return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("basicInfo")}),t.jsx(r.TextField,{label:s("name"),size:"small",value:e.name||"",onChange:o=>e.name=o.target.value}),t.jsx(r.TextField,{label:s("description"),size:"small",multiline:!0,minRows:2,maxRows:10,inputProps:{maxLength:200},value:e.description||"",onChange:o=>e.description=o.target.value}),t.jsx(r.Autocomplete,{size:"small",options:[],multiple:!0,freeSolo:!0,value:e.tags??[],onChange:(o,l)=>e.tags=l,renderInput:o=>t.jsx(r.TextField,{label:s("tags"),...o})}),t.jsx(Kt,{label:s("previewImage"),value:e.previewImage||"",onChange:o=>e.previewImage=o})]})})}function Re({data:e,params:s,visible:o,config:l,currentLocale:d,defaultLocale:m,allComponents:a,onUpdateConfig:b}){var k,x,i,c,n,p;const{t:g}=_.useLocaleContext(),f=P.useMemo(()=>e.type==="json"||e.type==="yaml"||e.type==="array"?Qt:W,[e.type]);return t.jsx(Mt,{preview:s.preview,drop:s.drop,drag:s.drag,isDragging:s.isDragging,onDelete:()=>{b(j=>{if(j.properties){const u=Object.entries(j.properties).sort(([,y],[,S])=>y.index-S.index);delete j.properties[e.id],u.filter(([y])=>y!==e.id).forEach(([,y],S)=>{y.index=S})}})},visible:o,onVisibilityChange:j=>{b(w=>{const u=w.properties[e.id].data;u.visible=j})},alwaysShowActions:!0,children:t.jsxs(r.Stack,{direction:"column",gap:2,children:[t.jsx(r.TextField,{label:g("key"),size:"small",required:!0,sx:{width:"calc(100% - 80px - 8px)",flex:1,"& .MuiOutlinedInput-root":{borderColor:e.key?X(l.properties,e.id,e.key)?"warning.main":void 0:"error.main"},"& .MuiFormLabel-root":{color:e.key?X(l.properties,e.id,e.key)?"warning.main":"text.secondary":"error.main"},"& .MuiFormLabel-root.Mui-focused":{color:e.key?X(l.properties,e.id,e.key)?"warning.main":"primary.main":"error.main"}},value:e.key||"",onChange:j=>{b(w=>{const u=w.properties[e.id].data;u.key=j.target.value.trim()})},InputProps:{endAdornment:!e.key||e.key&&X(l.properties,e.id,e.key)?t.jsx(r.InputAdornment,{position:"end",sx:{width:16,ml:0},children:t.jsx(r.Tooltip,{title:e.key?g("duplicateKey"):g("requiredKey"),children:t.jsx(z.InfoRounded,{sx:{color:e.key?"warning.main":"error.main",fontSize:16}})})}):null}}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(r.TextField,{label:g("label"),size:"small",sx:{flex:1},value:(((x=(k=e.locales)==null?void 0:k[d])==null?void 0:x.name)??((c=(i=e.locales)==null?void 0:i[m])==null?void 0:c.name))||"",onChange:j=>{b(w=>{var v;const u=w.properties[e.id].data;u.locales??(u.locales={}),(v=u.locales)[d]??(v[d]={}),u.locales[d].name=j.target.value})}}),t.jsx(r.TextField,{label:g("type"),size:"small",select:!0,sx:{flex:1},value:e.type==="string"&&e.multiline?"multiline":e.type||"string",onChange:j=>{b(w=>{const u=w.properties[e.id].data;if(u.locales)for(const y of Object.keys(u.locales))u.locales[y].defaultValue=void 0;const v=j.target.value;v==="multiline"?(u.type="string",u.multiline=!0):(typeof u.multiline<"u"&&delete u.multiline,u.type=v)})},children:Lt.map(j=>t.jsx(r.MenuItem,{value:j.value,children:j.label},j.value))})]}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(f,{allComponents:a,defaultLocale:m,component:l,property:e,label:g("defaultValue"),size:"small",fullWidth:!0,value:(p=(n=e.locales)==null?void 0:n[d])==null?void 0:p.defaultValue,onChange:(j,w)=>{b(u=>{var y;const v=u.properties[e.id].data;if(w!=null&&w.forceUpdateProperty){const S=le(v),C=le(j);Object.keys(C).forEach(h=>{S[h]||Te.default(v,h,C[h])})}else v.locales??(v.locales={}),(y=v.locales)[d]??(y[d]={}),v.locales[d].defaultValue=j})}}),e.type==="custom"?t.jsx(r.Box,{children:t.jsx(Yt,{property:e,allComponents:a})}):null]})]})})}function Ht(e,s){const[o,l]=P.useState(0);return P.useEffect(()=>{const m=setTimeout(()=>{if(e.current){let a=e.current.parentElement,b=0;for(;a;)a.classList.contains("property-container")&&b++,a=a.parentElement;l(b)}},100);return()=>clearTimeout(m)},[e,s]),o}function _e({config:e,currentLocale:s,defaultLocale:o,allComponents:l,onUpdateConfig:d,useI18nEditor:m=!0}){const{t:a}=_.useLocaleContext(),b=F.usePopupState({variant:"dialog"}),g=e.properties&&N.default(Object.values(e.properties),"index");return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsxs(r.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:"space-between",children:[t.jsx(r.Typography,{variant:"subtitle1",children:a("properties")}),t.jsx(r.Box,{flex:1}),m&&t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...F.bindTrigger(b),children:t.jsx(z.TranslateRounded,{fontSize:"small"})})]}),e.properties&&Object.keys(e.properties).length>0?t.jsx(Be,{component:r.Stack,gap:2,list:e.properties,renderItem:(f,k,x)=>{const i=ie(e.properties,f.id);return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed",borderColor:"divider"},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Re,{data:f,params:x,visible:i,config:e,currentLocale:s,defaultLocale:o,allComponents:l,onUpdateConfig:d})})},f.id)}}):t.jsx(G.default,{style:{fontSize:12},children:a("maker.properties.noProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",onClick:()=>{d(f=>{var x;const k=B.nextId();f.properties??(f.properties={}),(x=f.properties)[k]??(x[k]={index:(g==null?void 0:g.length)||0,data:{id:k}})})},startIcon:t.jsx(z.AddRounded,{}),children:a("addObject",{object:a("property")})}),m&&t.jsx(De,{...F.bindDialog(b),component:e})]})})}function Yt({property:e,allComponents:s}){const o=F.usePopupState({variant:"popper"});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{sx:{minWidth:0},...F.bindTrigger(o),children:t.jsx(z.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Popper,{...F.bindPopper(o),children:t.jsx(Pe.ClickAwayListener,{onClickAway:o.close,children:t.jsx(r.Paper,{children:t.jsx(r.Box,{width:500,p:2,children:t.jsx(te,{value:e.componentId,onChange:(l,d)=>e.componentId=d,allComponents:s})})})})})]})}function Gt({value:e,valueImmutable:s,onChange:o,defaultLocale:l,allComponents:d}){var k;const[m,a]=P.useState(!1),{t:b,locale:g}=_.useLocaleContext(),f=typeof(e==null?void 0:e.componentId)=="string"?(k=d[e.componentId])==null?void 0:k.data:void 0;return f?t.jsxs(r.Box,{sx:{width:"100%",position:"relative"},children:[t.jsx(r.IconButton,{sx:{minWidth:0},disabled:!f,size:"small",onClick:()=>a(!m),color:m?"primary":"default",children:t.jsx(z.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,sx:{width:"100%",zIndex:10},children:t.jsxs(r.Paper,{elevation:1,sx:{mt:1,p:2,borderRadius:1,border:"1px solid",borderColor:"divider",width:"100%"},children:[t.jsx(r.Box,{width:"100%",mb:2,children:t.jsx(ae,{config:f,currentLocale:g,defaultLocale:l,allComponents:d,propertiesValue:e==null?void 0:e.properties,onChange:({id:x,value:i})=>{const c=gt.default(i.value),n=JSON.parse(JSON.stringify(e));s?o==null||o({...n,properties:{...n.properties,[x]:{value:c}}}):(n.properties=n.properties??{},n.properties[x]={value:c},o==null||o(n))}})}),t.jsx(r.Button,{size:"small",onClick:()=>a(!1),sx:{mt:1},children:b("close")})]})})]}):null}function De({type:e="properties",component:s,...o}){var x,i,c;const{t:l}=_.useLocaleContext(),{state:{components:d,supportedLocales:m,config:{defaultLocale:a}}}=B.useStore(),b=B.useAllComponents(),g=Y.getYjsValue(s).doc,f=e==="properties"?s.properties:e==="parameters"&&((x=s.renderer)==null?void 0:x.type)==="component"?(i=d[s.renderer.componentId])==null?void 0:i.data.properties:void 0,k=((c=s.renderer)==null?void 0:c.type)==="component"?s:void 0;return t.jsxs(r.Dialog,{...o,fullWidth:!0,maxWidth:"lg",children:[t.jsx(r.DialogTitle,{children:l("i18nEditorTitle")}),t.jsx(r.DialogContent,{children:f&&t.jsx(r.Stack,{children:t.jsxs(r.Table,{stickyHeader:!0,sx:{td:{verticalAlign:"top"}},children:[t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:m.map(({locale:n,name:p})=>t.jsxs(r.TableCell,{children:[p,a===n&&t.jsx(z.StarRounded,{sx:{fontSize:12,color:"text.secondary"}})]},n))})}),t.jsx(r.TableBody,{children:N.default(Object.values(f),"index").map(({data:n})=>t.jsx(r.TableRow,{children:m.map(({locale:p})=>{var j,w,u,v,y,S,C,h,I,T,R,E,V,q,Q,K,L,$,J,H,ue,de,pe,xe,me,fe;return t.jsx(r.TableCell,{children:t.jsx(r.Stack,{gap:1,children:e==="properties"?t.jsxs(t.Fragment,{children:[t.jsx(r.TextField,{size:"small",label:"Key",value:n.key||"",onChange:M=>{g.transact(()=>{n.key=M.target.value.trim()})}}),t.jsx(r.TextField,{size:"small",label:l("label"),value:(((w=(j=n.locales)==null?void 0:j[p])==null?void 0:w.name)??((v=(u=n.locales)==null?void 0:u[a])==null?void 0:v.name))||"",onChange:M=>{g.transact(()=>{var U;n.locales??(n.locales={}),(U=n.locales)[p]??(U[p]={}),n.locales[p].name=M.target.value})}}),t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:a,component:s,property:n,size:"small",fullWidth:!0,label:"Default Value",valueImmutable:ee.default((S=(y=n.locales)==null?void 0:y[p])==null?void 0:S.defaultValue),value:((h=(C=n.locales)==null?void 0:C[p])==null?void 0:h.defaultValue)??((T=(I=n.locales)==null?void 0:I[a])==null?void 0:T.defaultValue),onChange:M=>{g.transact(()=>{var U;n.locales??(n.locales={}),(U=n.locales)[p]??(U[p]={}),n.locales[p].defaultValue=M})}})})]}):e==="parameters"&&k?t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:a,component:s,property:n,size:"small",fullWidth:!0,valueImmutable:ee.default((q=(V=(E=(R=k.renderer.properties)==null?void 0:R[n.id])==null?void 0:E.locales)==null?void 0:V[p])==null?void 0:q.value),value:(($=(L=(K=(Q=k.renderer.properties)==null?void 0:Q[n.id])==null?void 0:K.locales)==null?void 0:L[p])==null?void 0:$.value)??((de=(ue=(H=(J=k.renderer.properties)==null?void 0:J[n.id])==null?void 0:H.locales)==null?void 0:ue[a])==null?void 0:de.value)??((xe=(pe=n.locales)==null?void 0:pe[p])==null?void 0:xe.defaultValue)??((fe=(me=n.locales)==null?void 0:me[a])==null?void 0:fe.defaultValue),onChange:M=>{g.transact(()=>{var U,he,be,je,ye;(U=k.renderer).properties??(U.properties={}),(he=k.renderer.properties)[be=n.id]??(he[be]={}),(je=k.renderer.properties[n.id]).locales??(je.locales={}),(ye=k.renderer.properties[n.id].locales)[p]??(ye[p]={}),k.renderer.properties[n.id].locales[p].value=M})}})}):null},n.id)},p)})},n.id))})]})})}),t.jsx(r.DialogActions,{children:t.jsx(r.Button,{onClick:n=>{var p;return(p=o.onClose)==null?void 0:p.call(o,n,"escapeKeyDown")},children:l("close")})})]})}const Ie=(e,s)=>o=>{const l=[o.palette.info.main,o.palette.primary.main,o.palette.secondary.main,o.palette.success.main,o.palette.warning.main],d=Math.min(l.length-1,e),m=l[d],a=ve.alpha(m,.5),b=ve.alpha(m,1);return{borderColor:`${a} !important`,borderLeft:"3px solid !important",borderLeftColor:a,color:b,...s}};function Qt({property:e,onChange:s,defaultLocale:o,allComponents:l}){const{t:d,locale:m}=_.useLocaleContext(),a=P.useRef(null),b=Ht(a,e),g=P.useCallback(()=>{if(!(e.type!=="json"&&e.type!=="yaml"&&e.type!=="array")&&e.subProperties)try{const f={};N.default(Object.values(e.subProperties),"index").filter(i=>i.data.visible!==!1&&i.data.key).forEach(({data:i})=>{var n,p,j,w;if(!i.key)return;let c=((p=(n=i.locales)==null?void 0:n[m])==null?void 0:p.defaultValue)??((w=(j=i.locales)==null?void 0:j[o])==null?void 0:w.defaultValue);if(i.type==="number")c=Number(c);else if(i.type==="boolean")c=c===!0||c==="true";else if((i.type==="json"||i.type==="yaml")&&typeof c=="string")try{i.type==="json"?c=JSON.parse(c):c=oe.parse(c)}catch(u){console.error("Error parsing nested value",c,u),c={}}f[i.key]=c});const x=B.transformValue(f,e.type);s==null||s(x)}catch(f){console.error("Error converting structure to text:",f)}},[e,m,o,s]);return e.type!=="json"&&e.type!=="yaml"&&e.type!=="array"?null:t.jsxs(r.Stack,{direction:"column",gap:1.5,sx:{width:"100%"},ref:a,children:[t.jsx(r.Divider,{sx:{mt:-1},children:t.jsx(r.Typography,{variant:"caption",color:"text.secondary",children:d("maker.properties.subProperties")})}),e.subProperties&&Object.keys(e.subProperties).length>0?t.jsx(Be,{component:r.Stack,gap:2,list:e.subProperties,renderItem:(f,k,x)=>{const i=f.visible!==!1;return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed","&":Ie(b)},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Re,{data:f,params:x,visible:i,config:{properties:e.subProperties},currentLocale:m,defaultLocale:o,allComponents:l,onUpdateConfig:c=>{try{const n={properties:e.subProperties||{}};c(n);const p={...e,subProperties:n.properties};s==null||s(p,{forceUpdateProperty:!0}),g()}catch(n){console.error("Error updating property:",n)}}})})},f.id)}}):t.jsx(G.default,{style:{fontSize:12,height:100},children:d("maker.properties.noSubProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",size:"small",startIcon:t.jsx(z.AddRounded,{}),onClick:()=>{try{const f=e.subProperties||{},k=B.nextId(),i={index:Object.values(f).length,data:{id:k,key:"",type:"string",visible:!0,locales:{[m]:{name:"",defaultValue:""}},subProperties:{}}},c={...e,subProperties:{...f,[k]:i}};s==null||s(c,{forceUpdateProperty:!0}),g()}catch(f){console.error("Error adding property:",f)}},sx:{"&":Ie(b,{})},children:d("maker.properties.addSubProperty")})]})}function W({component:e,property:s,value:o,onChange:l,valueImmutable:d,defaultLocale:m,allComponents:a,...b}){var c,n,p,j,w;const{locale:g}=_.useLocaleContext(),f=A.useUploader(),k=P.useRef(null),x=()=>{var v;const u=(v=f==null?void 0:f.current)==null?void 0:v.getUploader();u==null||u.open(),k.current&&u.onceUploadSuccess(({response:y})=>{var C,h;let S=((C=y==null?void 0:y.data)==null?void 0:C.filename)||"";S&&(S=`mediakit://${S}`,o&&!o.includes("mediakit://")&&(S+=" # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")),(h=k.current)==null||h.call(k,S)})},i=b.label??(((n=(c=s.locales)==null?void 0:c[g])==null?void 0:n.name)||((j=(p=s.locales)==null?void 0:p[m])==null?void 0:j.name)||s.key||s.id);if(s.type==="number")return t.jsx(Xt,{...b,label:i,NumberProps:{value:["number","string"].includes(typeof o)?o:null,onChange:(u,v)=>l==null?void 0:l(v)}});if(s.type==="decimal")return t.jsx(r.TextField,{...b,label:i,type:"text",value:o??"",onChange:u=>{const v=u.target.value;if(v===""||v==="-"){l==null||l(v);return}if(/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)){let S=v;/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(S)&&(S=Number(S)),l==null||l(S)}}});if(s.type==="boolean")return t.jsx(r.FormControlLabel,{label:i,labelPlacement:"start",control:t.jsx(r.Switch,{checked:o===!0,onChange:(u,v)=>l==null?void 0:l(v)})});if(s.type==="color")return t.jsx(Vt,{label:i,value:o,onChange:u=>{l==null||l(u)}});if(s.type==="json"||s.type==="yaml")return t.jsx(qt,{label:i,value:o,onChange:u=>{l==null||l(u)},property:s,component:e,defaultLocale:m,allComponents:a,PropertyValueField:W,onUpload:u=>{k.current=u,x()}});if(s.type==="custom"){const u=(w=a[s.componentId])==null?void 0:w.data;return u?t.jsx(r.Box,{width:"100%",children:t.jsx(Z.CustomComponentRenderer,{componentId:u.id,props:{label:i,value:o,onChange:l},locale:g,dev:{mode:"draft",components:a,defaultLocale:m}})}):t.jsx(r.TextField,{...b,label:i,disabled:!0,placeholder:"Click right button select a component"})}if(s.type==="component")return t.jsxs(r.Stack,{width:"100%",direction:"column",gap:1,children:[t.jsx(te,{allComponents:a,label:i,value:o==null?void 0:o.componentId,onChange:(u,v)=>{d||!o?l==null||l({...o&&JSON.parse(JSON.stringify(o)),componentId:v}):typeof o=="object"&&(o.componentId=v,l==null||l({...o&&JSON.parse(JSON.stringify(o)),componentId:v}))}}),(o==null?void 0:o.componentId)&&t.jsx(Gt,{value:o,valueImmutable:d,onChange:l,defaultLocale:m,allComponents:a})]});if(!s.type||["string","url"].includes(s.type)){const u=s.type==="string"?s.multiline:void 0,v=s.type==="url"?o==null?void 0:o.url:o;return t.jsx(r.TextField,{...b,label:i,value:typeof v=="string"?v:"",multiline:u,minRows:u?2:void 0,maxRows:u?10:void 0,onChange:y=>l==null?void 0:l(s.type==="url"?{...o,url:y.target.value,mediaKitUrl:y.target.value}:y.target.value),InputProps:s.type==="url"?{sx:{pr:0},endAdornment:t.jsxs(r.InputAdornment,{position:"end",children:[t.jsx(A.UploaderButton,{onChange:async({response:y})=>{var I,T,R;const S=((I=y==null?void 0:y.data)==null?void 0:I.url)||((T=y==null?void 0:y.data)==null?void 0:T.fileUrl);let C;S&&(C=await A.getImageSize(S).catch(()=>A.getVideoSize(S)).catch(()=>{}));let h=((R=y==null?void 0:y.data)==null?void 0:R.filename)||"";h&&(h=`mediakit://${h}`),l==null||l({url:S,mediaKitUrl:h,width:C==null?void 0:C.naturalWidth,height:C==null?void 0:C.naturalHeight})}}),t.jsx(r.Tooltip,{title:"If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.",children:t.jsx(z.InfoRounded,{sx:{cursor:"default"},fontSize:"small"})})]})}:void 0})}return s.type==="array"?t.jsx(Rt,{label:i,value:Array.isArray(o)?o:[],onChange:u=>l==null?void 0:l(u),property:s,renderItem:({item:u,index:v,onChange:y})=>s.subProperties&&Object.keys(s.subProperties).length>0?t.jsx(r.Stack,{gap:1,width:"100%",children:N.default(Object.values(s.subProperties),"index").filter(S=>S.data.visible!==!1).map(({data:S})=>S.key?t.jsx(W,{component:e,property:S,value:u[S.key],onChange:C=>{const h={...u,[S.key]:C};y(h)},size:"small",fullWidth:!0,defaultLocale:m,allComponents:a},S.id):null)},v):t.jsx(r.TextField,{size:b.size,fullWidth:!0,value:u,onChange:S=>y(S.target.value)})}):(console.error("Unsupported property type",s.type),null)}function Xt({NumberProps:e,...s}){const{getInputProps:o}=Pe.unstable_useNumberInput(e),l=o();return t.jsx(r.TextField,{...s,inputProps:l})}const Ae=`import React from '@blocklet/pages-kit/builtin/react'
21
+ `;function Vt({value:e,onChange:s,...o}){const l=P.useRef(null);return t.jsxs(t.Fragment,{children:[t.jsx(_t,{...o,value:e,onChange:s,InputProps:{endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(Et,{color:e??"",style:{width:"1.5rem",height:"1.5rem",padding:0},onClick:()=>{var d;(d=l.current)==null||d.open({value:e??""})}})})}}),t.jsx(Ft,{ref:l,onSave:({value:d},m)=>{s(d),m()}})]})}function qt({label:e,value:s,onChange:o,property:l,component:d,defaultLocale:m,allComponents:u,PropertyValueField:b,onUpload:g}){const{locale:f}=_.useLocaleContext(),k=P.useRef(null);if(!Ce.default(l.subProperties)){const i=N.default(Object.values(l.subProperties||{}),"index").filter(c=>c.data.visible!==!1&&c.data.key);return t.jsxs(r.Stack,{width:"100%",children:[t.jsx(r.FormLabel,{sx:{px:.25,py:.5},children:e}),t.jsx(r.Box,{children:t.jsx(r.Box,{sx:{position:"relative"},children:i.map((c,n)=>{const{data:p}=c,j=p.key??p.id,w=n===i.length-1;let a=null;try{s&&typeof s=="object"?a=s[j]:typeof s=="string"&&(a=(l.type==="yaml"?oe.parse(s||""):JSON.parse(s||"{}"))[j])}catch{}a==null&&(p.locales&&f&&p.locales[f]?a=p.locales[f].defaultValue:p.locales&&m&&p.locales[m]&&(a=p.locales[m].defaultValue));const v=S=>{try{let C={};if(typeof s=="string")try{C=l.type==="yaml"?oe.parse(s||""):JSON.parse(s||"{}")}catch{}else typeof s=="object"&&s!==null&&(C={...s});Te.default(C,j,S);const h=B.transformValue(C,l.type);o==null||o(h)}catch(C){console.error("Error updating property:",C)}},y=8;return t.jsxs(r.Box,{sx:{mb:w?0:1,display:"flex",flexDirection:"row"},children:[t.jsxs(r.Box,{sx:{position:"relative",width:24,flexShrink:0},children:[t.jsx(r.Box,{sx:{position:"absolute",left:y,top:0,height:16,width:0,borderLeft:"1px dashed",borderColor:"divider"}}),t.jsx(r.Box,{sx:{position:"absolute",left:y,top:16,width:12,height:0,borderTop:"1px dashed",borderColor:"divider"}}),!w&&t.jsx(r.Box,{sx:{position:"absolute",left:y,top:16,bottom:-8,width:0,borderLeft:"1px dashed",borderColor:"divider"}})]}),t.jsx(r.Box,{sx:{flexGrow:1},children:t.jsx(b,{component:d,property:p,value:a,onChange:v,size:"small",fullWidth:!0,defaultLocale:m,allComponents:u})})]},p.id)})})})]})}return t.jsx(r.Stack,{width:"100%",gap:2,children:t.jsxs(r.Stack,{sx:{width:"100%",position:"relative",pt:1,pb:"6px",px:"1px",minHeight:50,".monaco-editor,.overflow-guard":{borderRadius:1}},children:[t.jsx(r.FormLabel,{sx:{position:"absolute",left:0,top:0,transform:"translate(0px, -7px) scale(0.75)"},children:e}),t.jsx(ne.CodeEditor,{keyId:l.id,locale:f,language:l.type==="yaml"?"yaml":"json",value:typeof s=="string"?s:"",onChange:i=>{o==null||o(i)},onUpload:i=>{k.current=i,g&&g(i)}},l.id),t.jsx(r.Box,{component:"fieldset",sx:{pointerEvents:"none",position:"absolute",left:0,top:-5,width:"100%",height:"100%",border:1,borderColor:"rgba(0, 0, 0, 0.23)",borderRadius:1,px:1,py:0},children:t.jsx(r.Box,{component:"legend",sx:{fontSize:"0.75em"},children:t.jsx(r.Box,{component:"span",sx:{opacity:0},children:e})})})]})})}const Ut=["string","multiline","json","yaml","url","component","custom"];function we(e){return e.type?!Ut.includes(e.type):!1}function Be({disabled:e,list:s,renderItem:o,...l}){const d=P.useRef(null),m=P.useId(),u=re.useUpdate(),b=N.default(Object.entries(s),c=>c[1].index).map(c=>c[0]),g=P.useRef(b),f=P.useCallback(c=>{g.current=c,u()},[u]),k=P.useCallback(({index:c},{index:n})=>{const p=[...g.current];p.splice(n,0,...p.splice(c,1)),f(p)},[f]);P.useEffect(()=>{f(b)},[b.join("-")]);const[{isOver:x},i]=se.useDrop({accept:m,collect:c=>({isOver:c.isOver()}),canDrop:()=>!e,drop:()=>{var p;const c=()=>{g.current.forEach((j,w)=>{const a=s[j];a&&(a.index=w)})},n=(p=Y.getYjsValue(s))==null?void 0:p.doc;n?n.transact(()=>{c()}):c()}});return P.useEffect(()=>{x||f(b)},[x]),i(d),t.jsx(r.Box,{...l,ref:d,className:Ge.cx(x&&"isDragging"),children:g.current.map((c,n)=>t.jsx(Wt,{type:m,disabled:e,id:c,index:n,itemIndex:p=>g.current.indexOf(p),move:k,children:p=>{const j=s[c];return j?o(j.data,n,p):null}},c))})}function Wt({disabled:e,id:s,index:o,type:l,children:d,itemIndex:m,move:u}){const b=P.useRef(),[{isDragging:g},f,k]=se.useDrag({type:l,item:()=>({id:s}),canDrag:()=>!e,collect:i=>({isDragging:i.isDragging()})}),[,x]=se.useDrop({accept:l,canDrop:()=>!e,hover(i,c){var y;if(!b.current)return;const n=m(i.id),p=o;if(n===p)return;const j=(y=b.current)==null?void 0:y.getBoundingClientRect(),w=(j.bottom-j.top)/2,v=c.getClientOffset().y-j.top;n<p&&v<w||n>p&&v>w||u({id:i.id,index:n},{id:s,index:o})}});return typeof d=="function"?d({isDragging:g,drag:f,drop:i=>(b.current=i,x(i)),preview:k}):(f(x(k(b))),t.jsx(r.Box,{ref:b,children:d}))}function Mt({drop:e,preview:s,drag:o,disabled:l,isDragging:d,children:m,onDelete:u,onVisibilityChange:b,visible:g=!0,actions:f,alwaysShowActions:k=!1}){const{t:x}=_.useLocaleContext();return t.jsx(r.Box,{ref:e,sx:{":hover .hover-visible":{maxWidth:"100%"},opacity:g?1:.5},children:t.jsxs(r.Box,{sx:{position:"relative"},children:[t.jsx(r.Box,{ref:s,sx:{flex:1,borderRadius:.5,bgcolor:d?"action.hover":"background.paper",opacity:.9999},children:m}),!l&&t.jsx(r.Box,{className:k?"":"hover-visible",sx:{maxWidth:k?"100%":0,overflow:"hidden",position:"absolute",right:2,top:2,transition:"max-width 0.3s ease-in-out"},children:t.jsxs(r.Stack,{direction:"row",sx:{bgcolor:i=>r.alpha(i.palette.grey[200],.9),borderRadius:1,p:.5,[`.${r.buttonClasses.root}`]:{minWidth:24,width:24,height:24,p:0}},children:[f,b&&t.jsx(r.Tooltip,{title:x(g?"hideParameter":"showParameter"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:()=>b(!g),children:g?t.jsx(z.VisibilityOffRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}}):t.jsx(z.VisibilityRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),u&&t.jsx(r.Tooltip,{title:x("delete"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:u,children:t.jsx(z.DeleteOutlineRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),t.jsx(r.Tooltip,{title:x("dragSort"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{ref:o,children:t.jsx(z.DragIndicatorRounded,{sx:{color:"grey.500"}})})})]})})]})})}function Kt({label:e,value:s,onChange:o}){const[l,d]=P.useState(!1);return t.jsxs(r.Stack,{gap:1,children:[t.jsx(r.TextField,{label:e,size:"small",value:s,onChange:m=>o==null?void 0:o(m.target.value),InputProps:{endAdornment:t.jsx(A.UploaderButton,{onChange:({response:m})=>{var b;const u=(b=m==null?void 0:m.data)==null?void 0:b.filename;u&&(o==null||o(u))}})}}),s&&t.jsx(r.Box,{component:"img",sx:{objectFit:"contain",borderRadius:1,cursor:"pointer"},src:B.getImageAbsoluteUrl(s),alt:e,maxWidth:100,maxHeight:100,width:"100%",onClick:()=>d(!0)}),t.jsx(r.Dialog,{open:l,onClose:()=>d(!1),children:t.jsx(r.Box,{component:"img",sx:{objectFit:"contain"},src:B.getImageAbsoluteUrl(s),alt:e})})]})}function le(e,s=""){return Ct.default(e,(o,l,d)=>{const m=s?`${s}.${d}`:d;return St.default(l)?vt.default(o,le(l,m)):o[m]=l,o},{})}const Lt=[{value:"string",label:"Text"},{value:"multiline",label:"Text (Multiline)"},{value:"number",label:"Number"},{value:"decimal",label:"Decimal"},{value:"boolean",label:"Boolean"},{value:"color",label:"Color"},{value:"url",label:"URL (Upload)"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"array",label:"Array"},{value:"component",label:"Component"},{value:"custom",label:"Custom (Render by a Component)"}];function X(e,s,o){return!e||!o?!1:Object.values(e).some(({data:l})=>l.id!==s&&l.key===o)}function ie(e,s){var o;return!e||!s?!1:((o=e[s])==null?void 0:o.data.visible)??!0}function $t({componentId:e}){const{state:{components:s}}=B.useStore(),o=s[e],l=o==null?void 0:o.data;return l?t.jsx(r.Stack,{maxHeight:"100%",overflow:"auto",children:t.jsx(r.Box,{p:2,children:t.jsx(xt.ErrorBoundary,{FallbackComponent:B.ErrorView,resetKeys:[e],children:t.jsx(Jt,{value:l})})})}):null}function Jt({value:e}){var g,f,k;const{t:s}=_.useLocaleContext(),{localState:{currentLocale:o,componentDebugProps:l},state:{config:{defaultLocale:d}},localActions:{setComponentDebugProps:m}}=B.useStore(),u=Y.getYjsValue(e).doc,b=B.useAllComponents();return t.jsx(r.Stack,{height:"100%",children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(Oe,{config:e}),t.jsx(_e,{config:e,currentLocale:o,defaultLocale:d,allComponents:b,onUpdateConfig:x=>{u.transact(()=>{x(e)})}}),t.jsxs(r.Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("renderer")}),t.jsxs(r.TextField,{hiddenLabel:!0,size:"small",select:!0,SelectProps:{autoWidth:!0},value:((g=e.renderer)==null?void 0:g.type)||"react-component",onChange:x=>{u.transact(()=>{const i=x.target.value;e.renderer??(e.renderer={type:i}),e.renderer.type=i})},children:[t.jsx(r.MenuItem,{value:"react-component",children:"React Component"}),t.jsx(r.MenuItem,{value:"component",children:"Custom Component"})]})]}),((f=e.renderer)==null?void 0:f.type)==="component"&&t.jsx(er,{value:e}),((k=e.renderer)==null?void 0:k.type)==="react-component"&&t.jsx(Zt,{value:e}),t.jsx(ae,{config:e,currentLocale:o,defaultLocale:d,allComponents:b,onChange:({key:x,value:i})=>{m({[x]:i.value})},props:{...l}})]})})}function Oe({config:e}){const{t:s}=_.useLocaleContext();return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("basicInfo")}),t.jsx(r.TextField,{label:s("name"),size:"small",value:e.name||"",onChange:o=>e.name=o.target.value}),t.jsx(r.TextField,{label:s("description"),size:"small",multiline:!0,minRows:2,maxRows:10,inputProps:{maxLength:200},value:e.description||"",onChange:o=>e.description=o.target.value}),t.jsx(r.Autocomplete,{size:"small",options:[],multiple:!0,freeSolo:!0,value:e.tags??[],onChange:(o,l)=>e.tags=l,renderInput:o=>t.jsx(r.TextField,{label:s("tags"),...o})}),t.jsx(Kt,{label:s("previewImage"),value:e.previewImage||"",onChange:o=>e.previewImage=o})]})})}function Re({data:e,params:s,visible:o,config:l,currentLocale:d,defaultLocale:m,allComponents:u,onUpdateConfig:b}){var k,x,i,c,n,p;const{t:g}=_.useLocaleContext(),f=P.useMemo(()=>e.type==="json"||e.type==="yaml"||e.type==="array"?Qt:W,[e.type]);return t.jsx(Mt,{preview:s.preview,drop:s.drop,drag:s.drag,isDragging:s.isDragging,onDelete:()=>{b(j=>{if(j.properties){const a=Object.entries(j.properties).sort(([,y],[,S])=>y.index-S.index);delete j.properties[e.id],a.filter(([y])=>y!==e.id).forEach(([,y],S)=>{y.index=S})}})},visible:o,onVisibilityChange:j=>{b(w=>{const a=w.properties[e.id].data;a.visible=j})},alwaysShowActions:!0,children:t.jsxs(r.Stack,{direction:"column",gap:2,children:[t.jsx(r.TextField,{label:g("key"),size:"small",required:!0,sx:{width:"calc(100% - 80px - 8px)",flex:1,"& .MuiOutlinedInput-root":{borderColor:e.key?X(l.properties,e.id,e.key)?"warning.main":void 0:"error.main"},"& .MuiFormLabel-root":{color:e.key?X(l.properties,e.id,e.key)?"warning.main":"text.secondary":"error.main"},"& .MuiFormLabel-root.Mui-focused":{color:e.key?X(l.properties,e.id,e.key)?"warning.main":"primary.main":"error.main"}},value:e.key||"",onChange:j=>{b(w=>{const a=w.properties[e.id].data;a.key=j.target.value.trim()})},InputProps:{endAdornment:!e.key||e.key&&X(l.properties,e.id,e.key)?t.jsx(r.InputAdornment,{position:"end",sx:{width:16,ml:0},children:t.jsx(r.Tooltip,{title:e.key?g("duplicateKey"):g("requiredKey"),children:t.jsx(z.InfoRounded,{sx:{color:e.key?"warning.main":"error.main",fontSize:16}})})}):null}}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(r.TextField,{label:g("label"),size:"small",sx:{flex:1},value:(((x=(k=e.locales)==null?void 0:k[d])==null?void 0:x.name)??((c=(i=e.locales)==null?void 0:i[m])==null?void 0:c.name))||"",onChange:j=>{b(w=>{var v;const a=w.properties[e.id].data;a.locales??(a.locales={}),(v=a.locales)[d]??(v[d]={}),a.locales[d].name=j.target.value})}}),t.jsx(r.TextField,{label:g("type"),size:"small",select:!0,sx:{flex:1},value:e.type==="string"&&e.multiline?"multiline":e.type||"string",onChange:j=>{b(w=>{const a=w.properties[e.id].data;if(a.locales)for(const y of Object.keys(a.locales))a.locales[y].defaultValue=void 0;const v=j.target.value;v==="multiline"?(a.type="string",a.multiline=!0):(typeof a.multiline<"u"&&delete a.multiline,a.type=v)})},children:Lt.map(j=>t.jsx(r.MenuItem,{value:j.value,children:j.label},j.value))})]}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(f,{allComponents:u,defaultLocale:m,component:l,property:e,label:g("defaultValue"),size:"small",fullWidth:!0,value:(p=(n=e.locales)==null?void 0:n[d])==null?void 0:p.defaultValue,onChange:(j,w)=>{b(a=>{var y;const v=a.properties[e.id].data;if(w!=null&&w.forceUpdateProperty){const S=le(v),C=le(j);Object.keys(C).forEach(h=>{S[h]||Te.default(v,h,C[h])})}else v.locales??(v.locales={}),(y=v.locales)[d]??(y[d]={}),v.locales[d].defaultValue=j})}}),e.type==="custom"?t.jsx(r.Box,{children:t.jsx(Yt,{property:e,allComponents:u})}):null]})]})})}function Ht(e,s){const[o,l]=P.useState(0);return P.useEffect(()=>{const m=setTimeout(()=>{if(e.current){let u=e.current.parentElement,b=0;for(;u;)u.classList.contains("property-container")&&b++,u=u.parentElement;l(b)}},100);return()=>clearTimeout(m)},[e,s]),o}function _e({config:e,currentLocale:s,defaultLocale:o,allComponents:l,onUpdateConfig:d,useI18nEditor:m=!0}){const{t:u}=_.useLocaleContext(),b=F.usePopupState({variant:"dialog"}),g=e.properties&&N.default(Object.values(e.properties),"index");return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsxs(r.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:"space-between",children:[t.jsx(r.Typography,{variant:"subtitle1",children:u("properties")}),t.jsx(r.Box,{flex:1}),m&&t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...F.bindTrigger(b),children:t.jsx(z.TranslateRounded,{fontSize:"small"})})]}),e.properties&&Object.keys(e.properties).length>0?t.jsx(Be,{component:r.Stack,gap:2,list:e.properties,renderItem:(f,k,x)=>{const i=ie(e.properties,f.id);return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed",borderColor:"divider"},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Re,{data:f,params:x,visible:i,config:e,currentLocale:s,defaultLocale:o,allComponents:l,onUpdateConfig:d})})},f.id)}}):t.jsx(G.default,{style:{fontSize:12},children:u("maker.properties.noProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",onClick:()=>{d(f=>{var x;const k=B.nextId();f.properties??(f.properties={}),(x=f.properties)[k]??(x[k]={index:(g==null?void 0:g.length)||0,data:{id:k}})})},startIcon:t.jsx(z.AddRounded,{}),children:u("addObject",{object:u("property")})}),m&&t.jsx(De,{...F.bindDialog(b),component:e})]})})}function Yt({property:e,allComponents:s}){const o=F.usePopupState({variant:"popper"});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{sx:{minWidth:0},...F.bindTrigger(o),children:t.jsx(z.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Popper,{...F.bindPopper(o),children:t.jsx(Pe.ClickAwayListener,{onClickAway:o.close,children:t.jsx(r.Paper,{children:t.jsx(r.Box,{width:500,p:2,children:t.jsx(te,{value:e.componentId,onChange:(l,d)=>e.componentId=d,allComponents:s})})})})})]})}function Gt({value:e,valueImmutable:s,onChange:o,defaultLocale:l,allComponents:d}){var k;const[m,u]=P.useState(!1),{t:b,locale:g}=_.useLocaleContext(),f=typeof(e==null?void 0:e.componentId)=="string"?(k=d[e.componentId])==null?void 0:k.data:void 0;return f?t.jsxs(r.Box,{sx:{width:"100%",position:"relative"},children:[t.jsx(r.IconButton,{sx:{minWidth:0},disabled:!f,size:"small",onClick:()=>u(!m),color:m?"primary":"default",children:t.jsx(z.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,sx:{width:"100%",zIndex:10},children:t.jsxs(r.Paper,{elevation:1,sx:{mt:1,p:2,borderRadius:1,border:"1px solid",borderColor:"divider",width:"100%"},children:[t.jsx(r.Box,{width:"100%",mb:2,children:t.jsx(ae,{config:f,currentLocale:g,defaultLocale:l,allComponents:d,propertiesValue:e==null?void 0:e.properties,onChange:({id:x,value:i})=>{const c=gt.default(i.value),n=JSON.parse(JSON.stringify(e));s?o==null||o({...n,properties:{...n.properties,[x]:{value:c}}}):(n.properties=n.properties??{},n.properties[x]={value:c},o==null||o(n))}})}),t.jsx(r.Button,{size:"small",onClick:()=>u(!1),sx:{mt:1},children:b("close")})]})})]}):null}function De({type:e="properties",component:s,...o}){var x,i,c;const{t:l}=_.useLocaleContext(),{state:{components:d,supportedLocales:m,config:{defaultLocale:u}}}=B.useStore(),b=B.useAllComponents(),g=Y.getYjsValue(s).doc,f=e==="properties"?s.properties:e==="parameters"&&((x=s.renderer)==null?void 0:x.type)==="component"?(i=d[s.renderer.componentId])==null?void 0:i.data.properties:void 0,k=((c=s.renderer)==null?void 0:c.type)==="component"?s:void 0;return t.jsxs(r.Dialog,{...o,fullWidth:!0,maxWidth:"lg",children:[t.jsx(r.DialogTitle,{children:l("i18nEditorTitle")}),t.jsx(r.DialogContent,{children:f&&t.jsx(r.Stack,{children:t.jsxs(r.Table,{stickyHeader:!0,sx:{td:{verticalAlign:"top"}},children:[t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:m.map(({locale:n,name:p})=>t.jsxs(r.TableCell,{children:[p,u===n&&t.jsx(z.StarRounded,{sx:{fontSize:12,color:"text.secondary"}})]},n))})}),t.jsx(r.TableBody,{children:N.default(Object.values(f),"index").map(({data:n})=>t.jsx(r.TableRow,{children:m.map(({locale:p})=>{var j,w,a,v,y,S,C,h,I,T,R,E,V,q,Q,K,L,$,J,H,ue,de,pe,xe,me,fe;return t.jsx(r.TableCell,{children:t.jsx(r.Stack,{gap:1,children:e==="properties"?t.jsxs(t.Fragment,{children:[t.jsx(r.TextField,{size:"small",label:"Key",value:n.key||"",onChange:M=>{g.transact(()=>{n.key=M.target.value.trim()})}}),t.jsx(r.TextField,{size:"small",label:l("label"),value:(((w=(j=n.locales)==null?void 0:j[p])==null?void 0:w.name)??((v=(a=n.locales)==null?void 0:a[u])==null?void 0:v.name))||"",onChange:M=>{g.transact(()=>{var U;n.locales??(n.locales={}),(U=n.locales)[p]??(U[p]={}),n.locales[p].name=M.target.value})}}),t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:u,component:s,property:n,size:"small",fullWidth:!0,label:"Default Value",valueImmutable:ee.default((S=(y=n.locales)==null?void 0:y[p])==null?void 0:S.defaultValue),value:((h=(C=n.locales)==null?void 0:C[p])==null?void 0:h.defaultValue)??((T=(I=n.locales)==null?void 0:I[u])==null?void 0:T.defaultValue),onChange:M=>{g.transact(()=>{var U;n.locales??(n.locales={}),(U=n.locales)[p]??(U[p]={}),n.locales[p].defaultValue=M})}})})]}):e==="parameters"&&k?t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:u,component:s,property:n,size:"small",fullWidth:!0,valueImmutable:ee.default((q=(V=(E=(R=k.renderer.properties)==null?void 0:R[n.id])==null?void 0:E.locales)==null?void 0:V[p])==null?void 0:q.value),value:(($=(L=(K=(Q=k.renderer.properties)==null?void 0:Q[n.id])==null?void 0:K.locales)==null?void 0:L[p])==null?void 0:$.value)??((de=(ue=(H=(J=k.renderer.properties)==null?void 0:J[n.id])==null?void 0:H.locales)==null?void 0:ue[u])==null?void 0:de.value)??((xe=(pe=n.locales)==null?void 0:pe[p])==null?void 0:xe.defaultValue)??((fe=(me=n.locales)==null?void 0:me[u])==null?void 0:fe.defaultValue),onChange:M=>{g.transact(()=>{var U,he,be,je,ye;(U=k.renderer).properties??(U.properties={}),(he=k.renderer.properties)[be=n.id]??(he[be]={}),(je=k.renderer.properties[n.id]).locales??(je.locales={}),(ye=k.renderer.properties[n.id].locales)[p]??(ye[p]={}),k.renderer.properties[n.id].locales[p].value=M})}})}):null},n.id)},p)})},n.id))})]})})}),t.jsx(r.DialogActions,{children:t.jsx(r.Button,{onClick:n=>{var p;return(p=o.onClose)==null?void 0:p.call(o,n,"escapeKeyDown")},children:l("close")})})]})}const Ie=(e,s)=>o=>{const l=[o.palette.info.main,o.palette.primary.main,o.palette.secondary.main,o.palette.success.main,o.palette.warning.main],d=Math.min(l.length-1,e),m=l[d],u=ve.alpha(m,.5),b=ve.alpha(m,1);return{borderColor:`${u} !important`,borderLeft:"3px solid !important",borderLeftColor:u,color:b,...s}};function Qt({property:e,onChange:s,defaultLocale:o,allComponents:l}){const{t:d,locale:m}=_.useLocaleContext(),u=P.useRef(null),b=Ht(u,e),g=P.useCallback(()=>{if(!(e.type!=="json"&&e.type!=="yaml"&&e.type!=="array")&&e.subProperties)try{const f={};N.default(Object.values(e.subProperties),"index").filter(i=>i.data.visible!==!1&&i.data.key).forEach(({data:i})=>{var n,p,j,w;if(!i.key)return;let c=((p=(n=i.locales)==null?void 0:n[m])==null?void 0:p.defaultValue)??((w=(j=i.locales)==null?void 0:j[o])==null?void 0:w.defaultValue);if(i.type==="number")c=Number(c);else if(i.type==="boolean")c=c===!0||c==="true";else if((i.type==="json"||i.type==="yaml")&&typeof c=="string")try{i.type==="json"?c=JSON.parse(c):c=oe.parse(c)}catch(a){console.error("Error parsing nested value",c,a),c={}}f[i.key]=c});const x=B.transformValue(f,e.type);s==null||s(x)}catch(f){console.error("Error converting structure to text:",f)}},[e,m,o,s]);return e.type!=="json"&&e.type!=="yaml"&&e.type!=="array"?null:t.jsxs(r.Stack,{direction:"column",gap:1.5,sx:{width:"100%"},ref:u,children:[t.jsx(r.Divider,{sx:{mt:-1},children:t.jsx(r.Typography,{variant:"caption",color:"text.secondary",children:d("maker.properties.subProperties")})}),e.subProperties&&Object.keys(e.subProperties).length>0?t.jsx(Be,{component:r.Stack,gap:2,list:e.subProperties,renderItem:(f,k,x)=>{const i=f.visible!==!1;return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed","&":Ie(b)},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Re,{data:f,params:x,visible:i,config:{properties:e.subProperties},currentLocale:m,defaultLocale:o,allComponents:l,onUpdateConfig:c=>{try{const n={properties:e.subProperties||{}};c(n);const p={...e,subProperties:n.properties};s==null||s(p,{forceUpdateProperty:!0}),g()}catch(n){console.error("Error updating property:",n)}}})})},f.id)}}):t.jsx(G.default,{style:{fontSize:12,height:100},children:d("maker.properties.noSubProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",size:"small",startIcon:t.jsx(z.AddRounded,{}),onClick:()=>{try{const f=e.subProperties||{},k=B.nextId(),i={index:Object.values(f).length,data:{id:k,key:"",type:"string",visible:!0,locales:{[m]:{name:"",defaultValue:""}},subProperties:{}}},c={...e,subProperties:{...f,[k]:i}};s==null||s(c,{forceUpdateProperty:!0}),g()}catch(f){console.error("Error adding property:",f)}},sx:{"&":Ie(b,{})},children:d("maker.properties.addSubProperty")})]})}function W({component:e,property:s,value:o,onChange:l,valueImmutable:d,defaultLocale:m,allComponents:u,...b}){var c,n,p,j,w;const{locale:g}=_.useLocaleContext(),f=A.useUploader(),k=P.useRef(null),x=()=>{var v;const a=(v=f==null?void 0:f.current)==null?void 0:v.getUploader();a==null||a.open(),k.current&&a.onceUploadSuccess(({response:y})=>{var C,h;let S=((C=y==null?void 0:y.data)==null?void 0:C.filename)||"";S&&(S=`mediakit://${S}`,o&&!o.includes("mediakit://")&&(S+=" # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")),(h=k.current)==null||h.call(k,S)})},i=b.label??(((n=(c=s.locales)==null?void 0:c[g])==null?void 0:n.name)||((j=(p=s.locales)==null?void 0:p[m])==null?void 0:j.name)||s.key||s.id);if(s.type==="number")return t.jsx(Xt,{...b,label:i,NumberProps:{value:["number","string"].includes(typeof o)?o:null,onChange:(a,v)=>l==null?void 0:l(v)}});if(s.type==="decimal")return t.jsx(r.TextField,{...b,label:i,type:"text",value:o??"",onChange:a=>{const v=a.target.value;if(v===""||v==="-"){l==null||l(v);return}if(/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)){let S=v;/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(S)&&(S=Number(S)),l==null||l(S)}}});if(s.type==="boolean")return t.jsx(r.FormControlLabel,{label:i,labelPlacement:"start",control:t.jsx(r.Switch,{checked:o===!0,onChange:(a,v)=>l==null?void 0:l(v)})});if(s.type==="color")return t.jsx(Vt,{label:i,value:o,onChange:a=>{l==null||l(a)}});if(s.type==="json"||s.type==="yaml")return t.jsx(qt,{label:i,value:o,onChange:a=>{l==null||l(a)},property:s,component:e,defaultLocale:m,allComponents:u,PropertyValueField:W,onUpload:a=>{k.current=a,x()}});if(s.type==="custom"){const a=(w=u[s.componentId])==null?void 0:w.data;return a?t.jsx(r.Box,{width:"100%",children:t.jsx(Z.CustomComponentRenderer,{componentId:a.id,props:{label:i,value:o,onChange:l},locale:g,dev:{mode:"draft",components:u,defaultLocale:m}})}):t.jsx(r.TextField,{...b,label:i,disabled:!0,placeholder:"Click right button select a component"})}if(s.type==="component")return t.jsxs(r.Stack,{width:"100%",direction:"column",gap:1,children:[t.jsx(te,{allComponents:u,label:i,value:o==null?void 0:o.componentId,onChange:(a,v)=>{d||!o?l==null||l({...o&&JSON.parse(JSON.stringify(o)),componentId:v}):typeof o=="object"&&(o.componentId=v,l==null||l({...o&&JSON.parse(JSON.stringify(o)),componentId:v}))}}),(o==null?void 0:o.componentId)&&t.jsx(Gt,{value:o,valueImmutable:d,onChange:l,defaultLocale:m,allComponents:u})]});if(!s.type||["string","url","multiline"].includes(s.type)){let a=s.type==="string"?s.multiline:void 0;s.type==="multiline"&&(a=!0);const v=s.type==="url"?o==null?void 0:o.url:o;return t.jsx(r.TextField,{...b,label:i,value:typeof v=="string"?v:"",multiline:a,minRows:a?2:void 0,maxRows:a?10:void 0,onChange:y=>l==null?void 0:l(s.type==="url"?{...o,url:y.target.value,mediaKitUrl:y.target.value}:y.target.value),InputProps:s.type==="url"?{sx:{pr:0},endAdornment:t.jsxs(r.InputAdornment,{position:"end",children:[t.jsx(A.UploaderButton,{onChange:async({response:y})=>{var I,T,R;const S=((I=y==null?void 0:y.data)==null?void 0:I.url)||((T=y==null?void 0:y.data)==null?void 0:T.fileUrl);let C;S&&(C=await A.getImageSize(S).catch(()=>A.getVideoSize(S)).catch(()=>{}));let h=((R=y==null?void 0:y.data)==null?void 0:R.filename)||"";h&&(h=`mediakit://${h}`),l==null||l({url:S,mediaKitUrl:h,width:C==null?void 0:C.naturalWidth,height:C==null?void 0:C.naturalHeight})}}),t.jsx(r.Tooltip,{title:"If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.",children:t.jsx(z.InfoRounded,{sx:{cursor:"default"},fontSize:"small"})})]})}:void 0})}return s.type==="array"?t.jsx(Rt,{label:i,value:Array.isArray(o)?o:[],onChange:a=>l==null?void 0:l(a),property:s,renderItem:({item:a,index:v,onChange:y})=>s.subProperties&&Object.keys(s.subProperties).length>0?t.jsx(r.Stack,{gap:1,width:"100%",children:N.default(Object.values(s.subProperties),"index").filter(S=>S.data.visible!==!1).map(({data:S})=>S.key?t.jsx(W,{component:e,property:S,value:a[S.key],onChange:C=>{const h={...a,[S.key]:C};y(h)},size:"small",fullWidth:!0,defaultLocale:m,allComponents:u},S.id):null)},v):t.jsx(r.TextField,{size:b.size,fullWidth:!0,value:a,onChange:S=>y(S.target.value)})}):(console.error("Unsupported property type",s.type),null)}function Xt({NumberProps:e,...s}){const{getInputProps:o}=Pe.unstable_useNumberInput(e),l=o();return t.jsx(r.TextField,{...s,inputProps:l})}const Ae=`import React from '@blocklet/pages-kit/builtin/react'
22
22
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
23
23
 
24
24
  export default function () {
@@ -28,4 +28,4 @@ export default function () {
28
28
  </Box>
29
29
  )
30
30
  }`,ze=`console.log('hello')
31
- `;function Zt({value:e}){const{locale:s}=_.useLocaleContext(),o=ce.useUpdate(),l=Y.getYjsValue(e).doc;return P.useEffect(()=>{var d;(d=e.renderer)!=null&&d.script||(l.transact(()=>{e.renderer.script=e.renderer.type==="react-component"?Ae:ze}),o())},[e]),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(ne.CodeEditor,{keyId:e.id,locale:s,language:"typescript",value:e.renderer.script||"",onChange:d=>e.renderer.script=d,typeScriptNoValidation:!1},e.id)})}function er({value:e}){var k,x,i;const{t:s}=_.useLocaleContext(),o=Y.getYjsValue(e).doc,{state:{components:l,config:{defaultLocale:d},resources:m},localState:{currentLocale:a}}=B.useStore(),b=B.useAllComponents(),g=((k=l[e.renderer.componentId])==null?void 0:k.data)??((i=(x=m.components)==null?void 0:x[e.renderer.componentId])==null?void 0:i.component),f=F.usePopupState({variant:"dialog"});return t.jsxs(r.Stack,{gap:1,children:[t.jsx(te,{allComponents:b,excludes:[e.id],value:e.renderer.componentId,onChange:(c,n)=>e.renderer.componentId=n}),g&&t.jsxs(t.Fragment,{children:[t.jsxs(r.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle2",children:s("parameters")}),t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...F.bindTrigger(f),children:t.jsx(z.TranslateRounded,{fontSize:"small"})})]}),g.properties&&N.default(Object.values(g.properties),"index").map(({data:c})=>{var n,p,j,w,u,v,y,S,C,h,I,T,R,E,V,q;return t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:d,component:g,property:c,fullWidth:!0,size:"small",valueImmutable:ee.default((w=(j=(p=(n=e.renderer.properties)==null?void 0:n[c.id])==null?void 0:p.locales)==null?void 0:j[a])==null?void 0:w.value),value:((S=(y=(v=(u=e.renderer.properties)==null?void 0:u[c.id])==null?void 0:v.locales)==null?void 0:y[a])==null?void 0:S.value)??((T=(I=(h=(C=e.renderer.properties)==null?void 0:C[c.id])==null?void 0:h.locales)==null?void 0:I[d])==null?void 0:T.value)??((E=(R=c.locales)==null?void 0:R[a])==null?void 0:E.defaultValue)??((q=(V=c.locales)==null?void 0:V[d])==null?void 0:q.defaultValue),onChange:Q=>{o.transact(()=>{var K,L,$,J,H;(K=e.renderer).properties??(K.properties={}),(L=e.renderer.properties)[$=c.id]??(L[$]={}),(J=e.renderer.properties[c.id]).locales??(J.locales={}),(H=e.renderer.properties[c.id].locales)[a]??(H[a]={}),e.renderer.properties[c.id].locales[a].value=Q})}})},c.id)}),t.jsx(De,{...F.bindDialog(f),component:e,type:"parameters"})]})]})}function te({label:e,options:s,excludes:o,value:l,onChange:d,allComponents:m,...a}){var k;const{t:b}=_.useLocaleContext(),g=s??N.default(Object.values(It.default(m,...o??[])),"index").map(x=>x.data),f=(typeof l=="string"?(k=m[l])==null?void 0:k.data:void 0)??null;return t.jsx(r.Autocomplete,{...a,size:"small",options:g,autoHighlight:!0,isOptionEqualToValue:(x,i)=>x.id===i.id,getOptionKey:x=>x.id,getOptionLabel:x=>x.name||x.id,renderInput:x=>t.jsx(r.TextField,{label:e||b("component"),...x}),value:f,onChange:(x,i)=>{var n,p,j,w,u,v;let c={};i&&(c={blockletId:(n=m[i==null?void 0:i.id])==null?void 0:n.blockletId,blockletTitle:(p=m[i==null?void 0:i.id])==null?void 0:p.blockletTitle,componentName:((w=(j=m[i==null?void 0:i.id])==null?void 0:j.data)==null?void 0:w.name)||((v=(u=m[i==null?void 0:i.id])==null?void 0:u.data)==null?void 0:v.id)}),d==null||d(x,i==null?void 0:i.id,c)}})}function ae({config:e,allComponents:s,defaultLocale:o,propertiesValue:l,currentLocale:d,onChange:m,props:a}){const{t:b}=_.useLocaleContext(),[g,f]=P.useState(e==null?void 0:e.properties),[k,x]=P.useState(null);P.useEffect(()=>{(()=>{var w,u;((w=e==null?void 0:e.renderer)==null?void 0:w.type)==="react-component"&&Ce.default(e==null?void 0:e.properties)?Z.transpileAndLoadScript((u=e==null?void 0:e.renderer)==null?void 0:u.script).then(v=>{const y=Z.getPropertiesFromCode(v);f(y)}):f(e==null?void 0:e.properties)})()},[JSON.stringify(e)]);const i=P.useCallback(()=>!e||!g?{}:Object.values(g).reduce((j,{data:w})=>{var v,y,S,C,h;const u=w.key||w.id;return j[w.id]={key:u,value:(a==null?void 0:a[u])??((v=l==null?void 0:l[w.id])==null?void 0:v.value)??((S=(y=w.locales)==null?void 0:y[d])==null?void 0:S.defaultValue)??((h=(C=w.locales)==null?void 0:C[o])==null?void 0:h.defaultValue),id:w.id,type:w.type},j},{}),[JSON.stringify(g),e,l,d,o]),c=P.useMemo(()=>{if(!g)return{canUseProperties:[],visibleProperties:[],canUsePropertiesKeys:[]};const j=N.default(Object.values(g),"index"),w=j.filter(({data:y})=>y.key&&ie(g,y.id)),u=j.filter(({data:y})=>y.key&&y.type!=="component"),v=u.map(({data:y})=>y.key);return{canUseProperties:u,visibleProperties:w,canUsePropertiesKeys:v}},[JSON.stringify(g)]),n=i(),p=wt.default(n,"key");return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:b("maker.properties.parameters")}),!e||c.canUsePropertiesKeys.length===0?t.jsx(G.default,{style:{fontSize:12},children:b("maker.properties.noParameters")}):t.jsxs(t.Fragment,{children:[t.jsx(r.Stack,{gap:2,children:c.visibleProperties.map(({data:j})=>{var w,u;return t.jsx(r.Box,{children:t.jsx(W,{allComponents:s,defaultLocale:o,size:"small",fullWidth:!0,component:e,property:j,valueImmutable:ee.default((w=l==null?void 0:l[j.id])==null?void 0:w.value),value:(a==null?void 0:a[j.key||j.id])??((u=n[j.id])==null?void 0:u.value),onChange:v=>{m({path:["properties",j.id],id:j.id,value:{value:v},shouldSync:we(j),excludeKeys:[],key:j.key||j.id})}})},j.id)})}),t.jsx(r.Stack,{gap:2,sx:{width:"100%"},children:t.jsx(Z.CustomComponentRenderer,{componentId:(e==null?void 0:e.id)||"",renderType:"setting",locale:d,properties:n,dev:{mode:"draft",components:s,defaultLocale:o},props:{...Pt.default(a??{},c.canUsePropertiesKeys),onChange:j=>{const{canUsePropertiesKeys:w}=c;Object.keys(j).filter(v=>{var y;return j[v]!==((y=p==null?void 0:p[v])==null?void 0:y.value)}).filter(v=>{var y,S,C,h;return!(v==="locale"&&!kt.default(p[v],"locale")||((y=p[v])==null?void 0:y.type)==="component"||(((S=p[v])==null?void 0:S.type)==="yaml"||((C=p[v])==null?void 0:C.type)==="json")&&ie(g,(h=p[v])==null?void 0:h.id))}).reduce((v,y)=>v.then(()=>{const S=p[y],C=w.includes(y);if(S!=null&&S.id&&C)return m({path:["properties",S.id],id:S.id,value:{value:j[y]},shouldSync:we(S),excludeKeys:[],key:S.key||S.id}),Promise.resolve();const h=`propertyNotFound${y}`;if(k===h)return Promise.resolve();Se.default.close(k);const I=Se.default.warning(b("maker.properties.propertyNotFound",{key:y}),{key:h});return x(I),Promise.resolve()}),Promise.resolve())}}})})]})]})})}exports.BasicInfo=Oe;exports.CustomComponentAutocomplete=te;exports.CustomComponentSettings=$t;exports.DefaultReactComponentScriptTemplate=Ae;exports.DefaultWebComponentScriptTemplate=ze;exports.ParametersConfig=ae;exports.PropertiesConfig=_e;exports.PropertyValueField=W;
31
+ `;function Zt({value:e}){const{locale:s}=_.useLocaleContext(),o=ce.useUpdate(),l=Y.getYjsValue(e).doc;return P.useEffect(()=>{var d;(d=e.renderer)!=null&&d.script||(l.transact(()=>{e.renderer.script=e.renderer.type==="react-component"?Ae:ze}),o())},[e]),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,overflow:"hidden"},children:t.jsx(ne.CodeEditor,{keyId:e.id,locale:s,language:"typescript",value:e.renderer.script||"",onChange:d=>e.renderer.script=d,typeScriptNoValidation:!1},e.id)})}function er({value:e}){var k,x,i;const{t:s}=_.useLocaleContext(),o=Y.getYjsValue(e).doc,{state:{components:l,config:{defaultLocale:d},resources:m},localState:{currentLocale:u}}=B.useStore(),b=B.useAllComponents(),g=((k=l[e.renderer.componentId])==null?void 0:k.data)??((i=(x=m.components)==null?void 0:x[e.renderer.componentId])==null?void 0:i.component),f=F.usePopupState({variant:"dialog"});return t.jsxs(r.Stack,{gap:1,children:[t.jsx(te,{allComponents:b,excludes:[e.id],value:e.renderer.componentId,onChange:(c,n)=>e.renderer.componentId=n}),g&&t.jsxs(t.Fragment,{children:[t.jsxs(r.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle2",children:s("parameters")}),t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...F.bindTrigger(f),children:t.jsx(z.TranslateRounded,{fontSize:"small"})})]}),g.properties&&N.default(Object.values(g.properties),"index").map(({data:c})=>{var n,p,j,w,a,v,y,S,C,h,I,T,R,E,V,q;return t.jsx(r.Box,{children:t.jsx(W,{allComponents:b,defaultLocale:d,component:g,property:c,fullWidth:!0,size:"small",valueImmutable:ee.default((w=(j=(p=(n=e.renderer.properties)==null?void 0:n[c.id])==null?void 0:p.locales)==null?void 0:j[u])==null?void 0:w.value),value:((S=(y=(v=(a=e.renderer.properties)==null?void 0:a[c.id])==null?void 0:v.locales)==null?void 0:y[u])==null?void 0:S.value)??((T=(I=(h=(C=e.renderer.properties)==null?void 0:C[c.id])==null?void 0:h.locales)==null?void 0:I[d])==null?void 0:T.value)??((E=(R=c.locales)==null?void 0:R[u])==null?void 0:E.defaultValue)??((q=(V=c.locales)==null?void 0:V[d])==null?void 0:q.defaultValue),onChange:Q=>{o.transact(()=>{var K,L,$,J,H;(K=e.renderer).properties??(K.properties={}),(L=e.renderer.properties)[$=c.id]??(L[$]={}),(J=e.renderer.properties[c.id]).locales??(J.locales={}),(H=e.renderer.properties[c.id].locales)[u]??(H[u]={}),e.renderer.properties[c.id].locales[u].value=Q})}})},c.id)}),t.jsx(De,{...F.bindDialog(f),component:e,type:"parameters"})]})]})}function te({label:e,options:s,excludes:o,value:l,onChange:d,allComponents:m,...u}){var k;const{t:b}=_.useLocaleContext(),g=s??N.default(Object.values(It.default(m,...o??[])),"index").map(x=>x.data),f=(typeof l=="string"?(k=m[l])==null?void 0:k.data:void 0)??null;return t.jsx(r.Autocomplete,{...u,size:"small",options:g,autoHighlight:!0,isOptionEqualToValue:(x,i)=>x.id===i.id,getOptionKey:x=>x.id,getOptionLabel:x=>x.name||x.id,renderInput:x=>t.jsx(r.TextField,{label:e||b("component"),...x}),value:f,onChange:(x,i)=>{var n,p,j,w,a,v;let c={};i&&(c={blockletId:(n=m[i==null?void 0:i.id])==null?void 0:n.blockletId,blockletTitle:(p=m[i==null?void 0:i.id])==null?void 0:p.blockletTitle,componentName:((w=(j=m[i==null?void 0:i.id])==null?void 0:j.data)==null?void 0:w.name)||((v=(a=m[i==null?void 0:i.id])==null?void 0:a.data)==null?void 0:v.id)}),d==null||d(x,i==null?void 0:i.id,c)}})}function ae({config:e,allComponents:s,defaultLocale:o,propertiesValue:l,currentLocale:d,onChange:m,props:u}){const{t:b}=_.useLocaleContext(),[g,f]=P.useState(e==null?void 0:e.properties),[k,x]=P.useState(null);P.useEffect(()=>{(()=>{var w,a;((w=e==null?void 0:e.renderer)==null?void 0:w.type)==="react-component"&&Ce.default(e==null?void 0:e.properties)?Z.transpileAndLoadScript((a=e==null?void 0:e.renderer)==null?void 0:a.script).then(v=>{const y=Z.getPropertiesFromCode(v);f(y)}):f(e==null?void 0:e.properties)})()},[JSON.stringify(e)]);const i=P.useCallback(()=>!e||!g?{}:Object.values(g).reduce((j,{data:w})=>{var v,y,S,C,h;const a=w.key||w.id;return j[w.id]={key:a,value:(u==null?void 0:u[a])??((v=l==null?void 0:l[w.id])==null?void 0:v.value)??((S=(y=w.locales)==null?void 0:y[d])==null?void 0:S.defaultValue)??((h=(C=w.locales)==null?void 0:C[o])==null?void 0:h.defaultValue),id:w.id,type:w.type},j},{}),[JSON.stringify(g),e,l,d,o]),c=P.useMemo(()=>{if(!g)return{canUseProperties:[],visibleProperties:[],canUsePropertiesKeys:[]};const j=N.default(Object.values(g),"index"),w=j.filter(({data:y})=>y.key&&ie(g,y.id)),a=j.filter(({data:y})=>y.key&&y.type!=="component"),v=a.map(({data:y})=>y.key);return{canUseProperties:a,visibleProperties:w,canUsePropertiesKeys:v}},[JSON.stringify(g)]),n=i(),p=wt.default(n,"key");return t.jsx(A.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:b("maker.properties.parameters")}),!e||c.canUsePropertiesKeys.length===0?t.jsx(G.default,{style:{fontSize:12},children:b("maker.properties.noParameters")}):t.jsxs(t.Fragment,{children:[t.jsx(r.Stack,{gap:2,children:c.visibleProperties.map(({data:j})=>{var w,a;return t.jsx(r.Box,{children:t.jsx(W,{allComponents:s,defaultLocale:o,size:"small",fullWidth:!0,component:e,property:j,valueImmutable:ee.default((w=l==null?void 0:l[j.id])==null?void 0:w.value),value:(u==null?void 0:u[j.key||j.id])??((a=n[j.id])==null?void 0:a.value),onChange:v=>{m({path:["properties",j.id],id:j.id,value:{value:v},shouldSync:we(j),excludeKeys:[],key:j.key||j.id})}})},j.id)})}),t.jsx(r.Stack,{gap:2,sx:{width:"100%"},children:t.jsx(Z.CustomComponentRenderer,{componentId:(e==null?void 0:e.id)||"",renderType:"setting",locale:d,properties:n,dev:{mode:"draft",components:s,defaultLocale:o},props:{...Pt.default(u??{},c.canUsePropertiesKeys),onChange:j=>{const{canUsePropertiesKeys:w}=c;Object.keys(j).filter(v=>{var y;return j[v]!==((y=p==null?void 0:p[v])==null?void 0:y.value)}).filter(v=>{var y,S,C,h;return!(v==="locale"&&!kt.default(p[v],"locale")||((y=p[v])==null?void 0:y.type)==="component"||(((S=p[v])==null?void 0:S.type)==="yaml"||((C=p[v])==null?void 0:C.type)==="json")&&ie(g,(h=p[v])==null?void 0:h.id))}).reduce((v,y)=>v.then(()=>{const S=p[y],C=w.includes(y);if(S!=null&&S.id&&C)return m({path:["properties",S.id],id:S.id,value:{value:j[y]},shouldSync:we(S),excludeKeys:[],key:S.key||S.id}),Promise.resolve();const h=`propertyNotFound${y}`;if(k===h)return Promise.resolve();Se.default.close(k);const I=Se.default.warning(b("maker.properties.propertyNotFound",{key:y}),{key:h});return x(I),Promise.resolve()}),Promise.resolve())}}})})]})]})})}exports.BasicInfo=Oe;exports.CustomComponentAutocomplete=te;exports.CustomComponentSettings=$t;exports.DefaultReactComponentScriptTemplate=Ae;exports.DefaultWebComponentScriptTemplate=ze;exports.ParametersConfig=ae;exports.PropertiesConfig=_e;exports.PropertyValueField=W;
package/lib/es/setting.js CHANGED
@@ -72,23 +72,23 @@ function Ir({
72
72
  disabled: i = !1,
73
73
  itemLabel: u = "",
74
74
  emptyHeight: m = 40,
75
- property: c,
75
+ property: a,
76
76
  renderItem: b,
77
77
  ...g
78
78
  }) {
79
79
  const { t: f, locale: w } = D(), p = it(), l = A(
80
80
  (h) => {
81
- o(ge(h, c.type));
81
+ o(ge(h, a.type));
82
82
  },
83
- [o, c.type]
83
+ [o, a.type]
84
84
  ), s = ce(() => Array.isArray(r) ? r : [], [r]), n = A(() => {
85
85
  const h = [...s, ""];
86
86
  l(h), p();
87
87
  }, [s, l, p]), d = A(() => {
88
- if (!c || !c.subProperties)
88
+ if (!a || !a.subProperties)
89
89
  return n();
90
90
  const h = {};
91
- V(Object.values(c.subProperties), "index").forEach(({ data: N }) => {
91
+ V(Object.values(a.subProperties), "index").forEach(({ data: N }) => {
92
92
  var U, W;
93
93
  if (!N.key) return;
94
94
  const E = ((W = (U = N.locales) == null ? void 0 : U[w]) == null ? void 0 : W.defaultValue) ?? "";
@@ -96,7 +96,7 @@ function Ir({
96
96
  });
97
97
  const z = [...s, h];
98
98
  l(z), p();
99
- }, [s, l, p, c, w, n]), y = A(
99
+ }, [s, l, p, a, w, n]), y = A(
100
100
  (h) => {
101
101
  try {
102
102
  const I = JSON.parse(h);
@@ -112,7 +112,7 @@ function Ir({
112
112
  l(I), p();
113
113
  },
114
114
  [s, l, p]
115
- ), a = A(
115
+ ), c = A(
116
116
  (h) => {
117
117
  if (h <= 0) return;
118
118
  const I = [...s], z = I[h];
@@ -132,7 +132,7 @@ function Ir({
132
132
  z[h] = I, l(z);
133
133
  },
134
134
  [s, l]
135
- ), k = c && c.subProperties && Object.keys(c.subProperties).length > 0, O = ce(() => [
135
+ ), k = a && a.subProperties && Object.keys(a.subProperties).length > 0, O = ce(() => [
136
136
  {
137
137
  field: "index",
138
138
  headerName: "#",
@@ -162,7 +162,7 @@ function Ir({
162
162
  renderCell: ({ row: h, index: I }) => b && k ? b({
163
163
  item: h,
164
164
  index: I,
165
- property: c,
165
+ property: a,
166
166
  onChange: (z) => v(I, z)
167
167
  }) : /* @__PURE__ */ t(
168
168
  C,
@@ -184,7 +184,7 @@ function Ir({
184
184
  // 增加宽度以容纳更多按钮
185
185
  align: "center",
186
186
  renderCell: ({ index: h }) => /* @__PURE__ */ S(j, { direction: "column", spacing: 0.25, children: [
187
- /* @__PURE__ */ t(kr, { disabled: i || h === 0, onClick: () => a(h) }),
187
+ /* @__PURE__ */ t(kr, { disabled: i || h === 0, onClick: () => c(h) }),
188
188
  /* @__PURE__ */ t(
189
189
  Pr,
190
190
  {
@@ -198,14 +198,14 @@ function Ir({
198
198
  ], [
199
199
  b,
200
200
  k,
201
- c,
201
+ a,
202
202
  v,
203
203
  u,
204
204
  f,
205
205
  i,
206
206
  g,
207
207
  P,
208
- a,
208
+ c,
209
209
  x,
210
210
  s.length
211
211
  ]);
@@ -288,13 +288,13 @@ function Ir({
288
288
  /* @__PURE__ */ t(R, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
289
289
  we,
290
290
  {
291
- keyId: c.id,
291
+ keyId: a.id,
292
292
  locale: w,
293
293
  language: "json",
294
294
  value: JSON.stringify(s, null, 2),
295
295
  onChange: (h) => y(h || "")
296
296
  },
297
- c.id
297
+ a.id
298
298
  ) })
299
299
  ] });
300
300
  }
@@ -303,7 +303,7 @@ $t[300], _t[300], // lightBlue['300'],
303
303
  Ft[300], Jt[300], Mt[300], // lightGreen['300'],
304
304
  Ht[300], Yt[300], Gt[300], Lt[300], // deepOrange['300'],
305
305
  qt[300], Qt[300], Xt[300];
306
- const Sr = tt(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, showUploader: u, value: m, meta: c, onChange: b, ...g }, f) {
306
+ const Sr = tt(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, showUploader: u, value: m, meta: a, onChange: b, ...g }, f) {
307
307
  const [w, p] = J("");
308
308
  M(() => {
309
309
  p(m || "");
@@ -336,8 +336,8 @@ const Sr = tt(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, show
336
336
  Pe,
337
337
  {
338
338
  onChange: async ({ response: n }) => {
339
- var a;
340
- const d = (a = n == null ? void 0 : n.data) == null ? void 0 : a.filename, y = oe(d) || "";
339
+ var c;
340
+ const d = (c = n == null ? void 0 : n.data) == null ? void 0 : c.filename, y = oe(d) || "";
341
341
  let P = {};
342
342
  y && (P = await fe(y).catch(() => he(y)).catch(() => {
343
343
  })), b(d, {
@@ -384,25 +384,25 @@ const Sr = tt(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, show
384
384
  function zr(e) {
385
385
  try {
386
386
  const o = We.parse(e).map((u) => {
387
- const m = u.colorStops.map((c, b) => {
388
- let { value: g } = c;
387
+ const m = u.colorStops.map((a, b) => {
388
+ let { value: g } = a;
389
389
  if (typeof g != "string" && !Array.isArray(g))
390
390
  throw new Error("Invalid color stop value type");
391
- let { type: f } = c;
391
+ let { type: f } = a;
392
392
  if (f !== "rgba") {
393
393
  const l = Ut(g).toRgb();
394
394
  g = [`${l.r}`, `${l.g}`, `${l.b}`, `${l.a}`], f = "rgba";
395
395
  }
396
- if (c.length)
396
+ if (a.length)
397
397
  return {
398
- ...c,
398
+ ...a,
399
399
  value: g,
400
400
  type: f
401
401
  };
402
402
  const w = u.colorStops.length;
403
403
  let p;
404
404
  return b === 0 ? p = Rr : b === w - 1 ? p = jr : p = b / (w - 1) * 100, {
405
- ...c,
405
+ ...a,
406
406
  value: g,
407
407
  type: f,
408
408
  length: {
@@ -449,7 +449,7 @@ const Cr = tt(function({ onSave: r }, o) {
449
449
  value: ""
450
450
  }), { t: u } = D(), m = {};
451
451
  i.value ? Fe(i.value) ? m.backgroundImage = i.value : m.backgroundColor = i.value : m.border = "1px solid #ccc";
452
- const [c, { setFalse: b, setTrue: g }] = Vt(!1), f = A(() => {
452
+ const [a, { setFalse: b, setTrue: g }] = Vt(!1), f = A(() => {
453
453
  b();
454
454
  }, [b]), w = () => {
455
455
  r({ value: i.value }, f);
@@ -461,7 +461,7 @@ const Cr = tt(function({ onSave: r }, o) {
461
461
  close() {
462
462
  f();
463
463
  }
464
- })), /* @__PURE__ */ S(ke, { disableEnforceFocus: !0, open: c, onClose: f, hideBackdrop: !0, children: [
464
+ })), /* @__PURE__ */ S(ke, { disableEnforceFocus: !0, open: a, onClose: f, hideBackdrop: !0, children: [
465
465
  /* @__PURE__ */ t(Qe, { children: u("maker.configBackground") }),
466
466
  /* @__PURE__ */ t(Xe, { sx: { width: 600 }, children: /* @__PURE__ */ S(R, { width: "100%", display: "flex", children: [
467
467
  /* @__PURE__ */ t(
@@ -566,7 +566,7 @@ function Ar({
566
566
  property: i,
567
567
  component: u,
568
568
  defaultLocale: m,
569
- allComponents: c,
569
+ allComponents: a,
570
570
  PropertyValueField: b,
571
571
  onUpload: g
572
572
  }) {
@@ -579,12 +579,12 @@ function Ar({
579
579
  /* @__PURE__ */ t(le, { sx: { px: 0.25, py: 0.5 }, children: e }),
580
580
  /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(R, { sx: { position: "relative" }, children: l.map((s, n) => {
581
581
  const { data: d } = s, y = d.key ?? d.id, P = n === l.length - 1;
582
- let a = null;
582
+ let c = null;
583
583
  try {
584
- r && typeof r == "object" ? a = r[y] : typeof r == "string" && (a = (i.type === "yaml" ? be.parse(r || "") : JSON.parse(r || "{}"))[y]);
584
+ r && typeof r == "object" ? c = r[y] : typeof r == "string" && (c = (i.type === "yaml" ? be.parse(r || "") : JSON.parse(r || "{}"))[y]);
585
585
  } catch {
586
586
  }
587
- a == null && (d.locales && f && d.locales[f] ? a = d.locales[f].defaultValue : d.locales && m && d.locales[m] && (a = d.locales[m].defaultValue));
587
+ c == null && (d.locales && f && d.locales[f] ? c = d.locales[f].defaultValue : d.locales && m && d.locales[m] && (c = d.locales[m].defaultValue));
588
588
  const x = (k) => {
589
589
  try {
590
590
  let O = {};
@@ -674,12 +674,12 @@ function Ar({
674
674
  {
675
675
  component: u,
676
676
  property: d,
677
- value: a,
677
+ value: c,
678
678
  onChange: x,
679
679
  size: "small",
680
680
  fullWidth: !0,
681
681
  defaultLocale: m,
682
- allComponents: c
682
+ allComponents: a
683
683
  }
684
684
  ) })
685
685
  ]
@@ -764,11 +764,11 @@ function mt({
764
764
  renderItem: o,
765
765
  ...i
766
766
  }) {
767
- const u = $(null), m = Nt(), c = Et(), b = V(Object.entries(r), (s) => s[1].index).map((s) => s[0]), g = $(b), f = A(
767
+ const u = $(null), m = Nt(), a = Et(), b = V(Object.entries(r), (s) => s[1].index).map((s) => s[0]), g = $(b), f = A(
768
768
  (s) => {
769
- g.current = s, c();
769
+ g.current = s, a();
770
770
  },
771
- [c]
771
+ [a]
772
772
  ), w = A(
773
773
  ({ index: s }, { index: n }) => {
774
774
  const d = [...g.current];
@@ -789,8 +789,8 @@ function mt({
789
789
  var d;
790
790
  const s = () => {
791
791
  g.current.forEach((y, P) => {
792
- const a = r[y];
793
- a && (a.index = P);
792
+ const c = r[y];
793
+ c && (c.index = P);
794
794
  });
795
795
  }, n = (d = te(r)) == null ? void 0 : d.doc;
796
796
  n ? n.transact(() => {
@@ -824,7 +824,7 @@ function Vr({
824
824
  type: i,
825
825
  children: u,
826
826
  itemIndex: m,
827
- move: c
827
+ move: a
828
828
  }) {
829
829
  const b = $(), [{ isDragging: g }, f, w] = xr({
830
830
  type: i,
@@ -842,7 +842,7 @@ function Vr({
842
842
  if (n === d)
843
843
  return;
844
844
  const y = (v = b.current) == null ? void 0 : v.getBoundingClientRect(), P = (y.bottom - y.top) / 2, x = s.getClientOffset().y - y.top;
845
- n < d && x < P || n > d && x > P || c({ id: l.id, index: n }, { id: r, index: o });
845
+ n < d && x < P || n > d && x > P || a({ id: l.id, index: n }, { id: r, index: o });
846
846
  }
847
847
  });
848
848
  return typeof u == "function" ? u({
@@ -859,7 +859,7 @@ function Er({
859
859
  disabled: i,
860
860
  isDragging: u,
861
861
  children: m,
862
- onDelete: c,
862
+ onDelete: a,
863
863
  onVisibilityChange: b,
864
864
  visible: g = !0,
865
865
  actions: f,
@@ -919,7 +919,7 @@ function Er({
919
919
  children: [
920
920
  f,
921
921
  b && /* @__PURE__ */ t(X, { title: p(g ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: () => b(!g), children: g ? /* @__PURE__ */ t(nr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(sr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
922
- c && /* @__PURE__ */ t(X, { title: p("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: c, children: /* @__PURE__ */ t(cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
922
+ a && /* @__PURE__ */ t(X, { title: p("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: a, children: /* @__PURE__ */ t(cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
923
923
  /* @__PURE__ */ t(X, { title: p("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { ref: o, children: /* @__PURE__ */ t(ar, { sx: { color: "grey.500" } }) }) })
924
924
  ]
925
925
  }
@@ -950,8 +950,8 @@ function Ur({
950
950
  {
951
951
  onChange: ({ response: m }) => {
952
952
  var b;
953
- const c = (b = m == null ? void 0 : m.data) == null ? void 0 : b.filename;
954
- c && (o == null || o(c));
953
+ const a = (b = m == null ? void 0 : m.data) == null ? void 0 : b.filename;
954
+ a && (o == null || o(a));
955
955
  }
956
956
  }
957
957
  )
@@ -1019,7 +1019,7 @@ function Br({ value: e }) {
1019
1019
  config: { defaultLocale: u }
1020
1020
  },
1021
1021
  localActions: { setComponentDebugProps: m }
1022
- } = de(), c = te(e).doc, b = xe();
1022
+ } = de(), a = te(e).doc, b = xe();
1023
1023
  return /* @__PURE__ */ t(j, { height: "100%", children: /* @__PURE__ */ S(j, { gap: 2, children: [
1024
1024
  /* @__PURE__ */ t(Kr, { config: e }),
1025
1025
  /* @__PURE__ */ t(
@@ -1030,7 +1030,7 @@ function Br({ value: e }) {
1030
1030
  defaultLocale: u,
1031
1031
  allComponents: b,
1032
1032
  onUpdateConfig: (p) => {
1033
- c.transact(() => {
1033
+ a.transact(() => {
1034
1034
  p(e);
1035
1035
  });
1036
1036
  }
@@ -1047,7 +1047,7 @@ function Br({ value: e }) {
1047
1047
  SelectProps: { autoWidth: !0 },
1048
1048
  value: ((g = e.renderer) == null ? void 0 : g.type) || "react-component",
1049
1049
  onChange: (p) => {
1050
- c.transact(() => {
1050
+ a.transact(() => {
1051
1051
  const l = p.target.value;
1052
1052
  e.renderer ?? (e.renderer = { type: l }), e.renderer.type = l;
1053
1053
  });
@@ -1135,7 +1135,7 @@ function ft({
1135
1135
  config: i,
1136
1136
  currentLocale: u,
1137
1137
  defaultLocale: m,
1138
- allComponents: c,
1138
+ allComponents: a,
1139
1139
  onUpdateConfig: b
1140
1140
  }) {
1141
1141
  var w, p, l, s, n, d;
@@ -1150,8 +1150,8 @@ function ft({
1150
1150
  onDelete: () => {
1151
1151
  b((y) => {
1152
1152
  if (y.properties) {
1153
- const a = Object.entries(y.properties).sort(([, v], [, k]) => v.index - k.index);
1154
- delete y.properties[e.id], a.filter(([v]) => v !== e.id).forEach(([, v], k) => {
1153
+ const c = Object.entries(y.properties).sort(([, v], [, k]) => v.index - k.index);
1154
+ delete y.properties[e.id], c.filter(([v]) => v !== e.id).forEach(([, v], k) => {
1155
1155
  v.index = k;
1156
1156
  });
1157
1157
  }
@@ -1160,8 +1160,8 @@ function ft({
1160
1160
  visible: o,
1161
1161
  onVisibilityChange: (y) => {
1162
1162
  b((P) => {
1163
- const a = P.properties[e.id].data;
1164
- a.visible = y;
1163
+ const c = P.properties[e.id].data;
1164
+ c.visible = y;
1165
1165
  });
1166
1166
  },
1167
1167
  alwaysShowActions: !0,
@@ -1188,8 +1188,8 @@ function ft({
1188
1188
  value: e.key || "",
1189
1189
  onChange: (y) => {
1190
1190
  b((P) => {
1191
- const a = P.properties[e.id].data;
1192
- a.key = y.target.value.trim();
1191
+ const c = P.properties[e.id].data;
1192
+ c.key = y.target.value.trim();
1193
1193
  });
1194
1194
  },
1195
1195
  InputProps: {
@@ -1226,8 +1226,8 @@ function ft({
1226
1226
  onChange: (y) => {
1227
1227
  b((P) => {
1228
1228
  var x;
1229
- const a = P.properties[e.id].data;
1230
- a.locales ?? (a.locales = {}), (x = a.locales)[u] ?? (x[u] = {}), a.locales[u].name = y.target.value;
1229
+ const c = P.properties[e.id].data;
1230
+ c.locales ?? (c.locales = {}), (x = c.locales)[u] ?? (x[u] = {}), c.locales[u].name = y.target.value;
1231
1231
  });
1232
1232
  }
1233
1233
  }
@@ -1242,12 +1242,12 @@ function ft({
1242
1242
  value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
1243
1243
  onChange: (y) => {
1244
1244
  b((P) => {
1245
- const a = P.properties[e.id].data;
1246
- if (a.locales)
1247
- for (const v of Object.keys(a.locales))
1248
- a.locales[v].defaultValue = void 0;
1245
+ const c = P.properties[e.id].data;
1246
+ if (c.locales)
1247
+ for (const v of Object.keys(c.locales))
1248
+ c.locales[v].defaultValue = void 0;
1249
1249
  const x = y.target.value;
1250
- x === "multiline" ? (a.type = "string", a.multiline = !0) : (typeof a.multiline < "u" && delete a.multiline, a.type = x);
1250
+ x === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = x);
1251
1251
  });
1252
1252
  },
1253
1253
  children: Wr.map((y) => /* @__PURE__ */ t(me, { value: y.value, children: y.label }, y.value))
@@ -1258,7 +1258,7 @@ function ft({
1258
1258
  /* @__PURE__ */ t(
1259
1259
  f,
1260
1260
  {
1261
- allComponents: c,
1261
+ allComponents: a,
1262
1262
  defaultLocale: m,
1263
1263
  component: i,
1264
1264
  property: e,
@@ -1267,9 +1267,9 @@ function ft({
1267
1267
  fullWidth: !0,
1268
1268
  value: (d = (n = e.locales) == null ? void 0 : n[u]) == null ? void 0 : d.defaultValue,
1269
1269
  onChange: (y, P) => {
1270
- b((a) => {
1270
+ b((c) => {
1271
1271
  var v;
1272
- const x = a.properties[e.id].data;
1272
+ const x = c.properties[e.id].data;
1273
1273
  if (P != null && P.forceUpdateProperty) {
1274
1274
  const k = ye(x), O = ye(y);
1275
1275
  Object.keys(O).forEach((h) => {
@@ -1281,7 +1281,7 @@ function ft({
1281
1281
  }
1282
1282
  }
1283
1283
  ),
1284
- e.type === "custom" ? /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(Fr, { property: e, allComponents: c }) }) : null
1284
+ e.type === "custom" ? /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(Fr, { property: e, allComponents: a }) }) : null
1285
1285
  ] })
1286
1286
  ] })
1287
1287
  }
@@ -1292,9 +1292,9 @@ function $r(e, r) {
1292
1292
  return M(() => {
1293
1293
  const m = setTimeout(() => {
1294
1294
  if (e.current) {
1295
- let c = e.current.parentElement, b = 0;
1296
- for (; c; )
1297
- c.classList.contains("property-container") && b++, c = c.parentElement;
1295
+ let a = e.current.parentElement, b = 0;
1296
+ for (; a; )
1297
+ a.classList.contains("property-container") && b++, a = a.parentElement;
1298
1298
  i(b);
1299
1299
  }
1300
1300
  }, 100);
@@ -1309,10 +1309,10 @@ function _r({
1309
1309
  onUpdateConfig: u,
1310
1310
  useI18nEditor: m = !0
1311
1311
  }) {
1312
- const { t: c } = D(), b = Se({ variant: "dialog" }), g = e.properties && V(Object.values(e.properties), "index");
1312
+ const { t: a } = D(), b = Se({ variant: "dialog" }), g = e.properties && V(Object.values(e.properties), "index");
1313
1313
  return /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1314
1314
  /* @__PURE__ */ S(j, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
1315
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: c("properties") }),
1315
+ /* @__PURE__ */ t(F, { variant: "subtitle1", children: a("properties") }),
1316
1316
  /* @__PURE__ */ t(R, { flex: 1 }),
1317
1317
  m && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Oe(b), children: /* @__PURE__ */ t(st, { fontSize: "small" }) })
1318
1318
  ] }),
@@ -1353,7 +1353,7 @@ function _r({
1353
1353
  );
1354
1354
  }
1355
1355
  }
1356
- ) : /* @__PURE__ */ t(Z, { style: { fontSize: 12 }, children: c("maker.properties.noProperties") }),
1356
+ ) : /* @__PURE__ */ t(Z, { style: { fontSize: 12 }, children: a("maker.properties.noProperties") }),
1357
1357
  /* @__PURE__ */ t(
1358
1358
  T,
1359
1359
  {
@@ -1368,7 +1368,7 @@ function _r({
1368
1368
  });
1369
1369
  },
1370
1370
  startIcon: /* @__PURE__ */ t(ct, {}),
1371
- children: c("addObject", { object: c("property") })
1371
+ children: a("addObject", { object: a("property") })
1372
1372
  }
1373
1373
  ),
1374
1374
  m && /* @__PURE__ */ t(ht, { ...ut(b), component: e })
@@ -1399,7 +1399,7 @@ function Jr({
1399
1399
  allComponents: u
1400
1400
  }) {
1401
1401
  var w;
1402
- const [m, c] = J(!1), { t: b, locale: g } = D(), f = typeof (e == null ? void 0 : e.componentId) == "string" ? (w = u[e.componentId]) == null ? void 0 : w.data : void 0;
1402
+ const [m, a] = J(!1), { t: b, locale: g } = D(), f = typeof (e == null ? void 0 : e.componentId) == "string" ? (w = u[e.componentId]) == null ? void 0 : w.data : void 0;
1403
1403
  return f ? /* @__PURE__ */ S(R, { sx: { width: "100%", position: "relative" }, children: [
1404
1404
  /* @__PURE__ */ t(
1405
1405
  ue,
@@ -1407,7 +1407,7 @@ function Jr({
1407
1407
  sx: { minWidth: 0 },
1408
1408
  disabled: !f,
1409
1409
  size: "small",
1410
- onClick: () => c(!m),
1410
+ onClick: () => a(!m),
1411
1411
  color: m ? "primary" : "default",
1412
1412
  children: /* @__PURE__ */ t(dt, { fontSize: "small" })
1413
1413
  }
@@ -1439,7 +1439,7 @@ function Jr({
1439
1439
  }
1440
1440
  }
1441
1441
  ) }),
1442
- /* @__PURE__ */ t(T, { size: "small", onClick: () => c(!1), sx: { mt: 1 }, children: b("close") })
1442
+ /* @__PURE__ */ t(T, { size: "small", onClick: () => a(!1), sx: { mt: 1 }, children: b("close") })
1443
1443
  ]
1444
1444
  }
1445
1445
  ) })
@@ -1455,7 +1455,7 @@ function ht({
1455
1455
  state: {
1456
1456
  components: u,
1457
1457
  supportedLocales: m,
1458
- config: { defaultLocale: c }
1458
+ config: { defaultLocale: a }
1459
1459
  }
1460
1460
  } = de(), b = xe(), g = te(r).doc, f = e === "properties" ? r.properties : e === "parameters" && ((p = r.renderer) == null ? void 0 : p.type) === "component" ? (l = u[r.renderer.componentId]) == null ? void 0 : l.data.properties : void 0, w = ((s = r.renderer) == null ? void 0 : s.type) === "component" ? r : void 0;
1461
1461
  return /* @__PURE__ */ S(ke, { ...o, fullWidth: !0, maxWidth: "lg", children: [
@@ -1463,10 +1463,10 @@ function ht({
1463
1463
  /* @__PURE__ */ t(Xe, { children: f && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(He, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1464
1464
  /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(ne, { children: m.map(({ locale: n, name: d }) => /* @__PURE__ */ S(se, { children: [
1465
1465
  d,
1466
- c === n && /* @__PURE__ */ t(dr, { sx: { fontSize: 12, color: "text.secondary" } })
1466
+ a === n && /* @__PURE__ */ t(dr, { sx: { fontSize: 12, color: "text.secondary" } })
1467
1467
  ] }, n)) }) }),
1468
1468
  /* @__PURE__ */ t(Ge, { children: V(Object.values(f), "index").map(({ data: n }) => /* @__PURE__ */ t(ne, { children: m.map(({ locale: d }) => {
1469
- var y, P, a, x, v, k, O, h, I, z, N, E, U, W, re, Y, G, L, q, Q, je, ze, Ne, Ce, De, Ae;
1469
+ var y, P, c, x, v, k, O, h, I, z, N, E, U, W, re, Y, G, L, q, Q, je, ze, Ne, Ce, De, Ae;
1470
1470
  return /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(j, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S(H, { children: [
1471
1471
  /* @__PURE__ */ t(
1472
1472
  C,
@@ -1486,7 +1486,7 @@ function ht({
1486
1486
  {
1487
1487
  size: "small",
1488
1488
  label: i("label"),
1489
- value: (((P = (y = n.locales) == null ? void 0 : y[d]) == null ? void 0 : P.name) ?? ((x = (a = n.locales) == null ? void 0 : a[c]) == null ? void 0 : x.name)) || "",
1489
+ value: (((P = (y = n.locales) == null ? void 0 : y[d]) == null ? void 0 : P.name) ?? ((x = (c = n.locales) == null ? void 0 : c[a]) == null ? void 0 : x.name)) || "",
1490
1490
  onChange: (K) => {
1491
1491
  g.transact(() => {
1492
1492
  var B;
@@ -1499,14 +1499,14 @@ function ht({
1499
1499
  _,
1500
1500
  {
1501
1501
  allComponents: b,
1502
- defaultLocale: c,
1502
+ defaultLocale: a,
1503
1503
  component: r,
1504
1504
  property: n,
1505
1505
  size: "small",
1506
1506
  fullWidth: !0,
1507
1507
  label: "Default Value",
1508
1508
  valueImmutable: ae((k = (v = n.locales) == null ? void 0 : v[d]) == null ? void 0 : k.defaultValue),
1509
- value: ((h = (O = n.locales) == null ? void 0 : O[d]) == null ? void 0 : h.defaultValue) ?? ((z = (I = n.locales) == null ? void 0 : I[c]) == null ? void 0 : z.defaultValue),
1509
+ value: ((h = (O = n.locales) == null ? void 0 : O[d]) == null ? void 0 : h.defaultValue) ?? ((z = (I = n.locales) == null ? void 0 : I[a]) == null ? void 0 : z.defaultValue),
1510
1510
  onChange: (K) => {
1511
1511
  g.transact(() => {
1512
1512
  var B;
@@ -1519,7 +1519,7 @@ function ht({
1519
1519
  _,
1520
1520
  {
1521
1521
  allComponents: b,
1522
- defaultLocale: c,
1522
+ defaultLocale: a,
1523
1523
  component: r,
1524
1524
  property: n,
1525
1525
  size: "small",
@@ -1527,7 +1527,7 @@ function ht({
1527
1527
  valueImmutable: ae(
1528
1528
  (W = (U = (E = (N = w.renderer.properties) == null ? void 0 : N[n.id]) == null ? void 0 : E.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value
1529
1529
  ),
1530
- value: ((L = (G = (Y = (re = w.renderer.properties) == null ? void 0 : re[n.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[d]) == null ? void 0 : L.value) ?? ((ze = (je = (Q = (q = w.renderer.properties) == null ? void 0 : q[n.id]) == null ? void 0 : Q.locales) == null ? void 0 : je[c]) == null ? void 0 : ze.value) ?? ((Ce = (Ne = n.locales) == null ? void 0 : Ne[d]) == null ? void 0 : Ce.defaultValue) ?? ((Ae = (De = n.locales) == null ? void 0 : De[c]) == null ? void 0 : Ae.defaultValue),
1530
+ value: ((L = (G = (Y = (re = w.renderer.properties) == null ? void 0 : re[n.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[d]) == null ? void 0 : L.value) ?? ((ze = (je = (Q = (q = w.renderer.properties) == null ? void 0 : q[n.id]) == null ? void 0 : Q.locales) == null ? void 0 : je[a]) == null ? void 0 : ze.value) ?? ((Ce = (Ne = n.locales) == null ? void 0 : Ne[d]) == null ? void 0 : Ce.defaultValue) ?? ((Ae = (De = n.locales) == null ? void 0 : De[a]) == null ? void 0 : Ae.defaultValue),
1531
1531
  onChange: (K) => {
1532
1532
  g.transact(() => {
1533
1533
  var B, Te, Ve, Ee, Ue;
@@ -1551,13 +1551,13 @@ const _e = (e, r) => (o) => {
1551
1551
  o.palette.secondary.main,
1552
1552
  o.palette.success.main,
1553
1553
  o.palette.warning.main
1554
- ], u = Math.min(i.length - 1, e), m = i[u], c = Ke(m, 0.5), b = Ke(m, 1);
1554
+ ], u = Math.min(i.length - 1, e), m = i[u], a = Ke(m, 0.5), b = Ke(m, 1);
1555
1555
  return {
1556
1556
  // 保留原有的边框样式
1557
- borderColor: `${c} !important`,
1557
+ borderColor: `${a} !important`,
1558
1558
  borderLeft: "3px solid !important",
1559
1559
  // 稍粗的左侧边框
1560
- borderLeftColor: c,
1560
+ borderLeftColor: a,
1561
1561
  // 使用透明度适应深色/浅色模式
1562
1562
  color: b,
1563
1563
  ...r
@@ -1569,7 +1569,7 @@ function Mr({
1569
1569
  defaultLocale: o,
1570
1570
  allComponents: i
1571
1571
  }) {
1572
- const { t: u, locale: m } = D(), c = $(null), b = $r(c, e), g = A(() => {
1572
+ const { t: u, locale: m } = D(), a = $(null), b = $r(a, e), g = A(() => {
1573
1573
  if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
1574
1574
  try {
1575
1575
  const f = {};
@@ -1586,8 +1586,8 @@ function Mr({
1586
1586
  else if ((l.type === "json" || l.type === "yaml") && typeof s == "string")
1587
1587
  try {
1588
1588
  l.type === "json" ? s = JSON.parse(s) : s = be.parse(s);
1589
- } catch (a) {
1590
- console.error("Error parsing nested value", s, a), s = {};
1589
+ } catch (c) {
1590
+ console.error("Error parsing nested value", s, c), s = {};
1591
1591
  }
1592
1592
  f[l.key] = s;
1593
1593
  });
@@ -1597,7 +1597,7 @@ function Mr({
1597
1597
  console.error("Error converting structure to text:", f);
1598
1598
  }
1599
1599
  }, [e, m, o, r]);
1600
- return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: c, children: [
1600
+ return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: a, children: [
1601
1601
  /* @__PURE__ */ t(Ot, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
1602
1602
  e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(
1603
1603
  mt,
@@ -1706,14 +1706,14 @@ function _({
1706
1706
  onChange: i,
1707
1707
  valueImmutable: u,
1708
1708
  defaultLocale: m,
1709
- allComponents: c,
1709
+ allComponents: a,
1710
1710
  ...b
1711
1711
  }) {
1712
1712
  var s, n, d, y, P;
1713
1713
  const { locale: g } = D(), f = Zt(), w = $(null), p = () => {
1714
1714
  var x;
1715
- const a = (x = f == null ? void 0 : f.current) == null ? void 0 : x.getUploader();
1716
- a == null || a.open(), w.current && a.onceUploadSuccess(({ response: v }) => {
1715
+ const c = (x = f == null ? void 0 : f.current) == null ? void 0 : x.getUploader();
1716
+ c == null || c.open(), w.current && c.onceUploadSuccess(({ response: v }) => {
1717
1717
  var O, h;
1718
1718
  let k = ((O = v == null ? void 0 : v.data) == null ? void 0 : O.filename) || "";
1719
1719
  k && (k = `mediakit://${k}`, o && !o.includes("mediakit://") && (k += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (h = w.current) == null || h.call(w, k);
@@ -1727,7 +1727,7 @@ function _({
1727
1727
  label: l,
1728
1728
  NumberProps: {
1729
1729
  value: ["number", "string"].includes(typeof o) ? o : null,
1730
- onChange: (a, x) => i == null ? void 0 : i(x)
1730
+ onChange: (c, x) => i == null ? void 0 : i(x)
1731
1731
  }
1732
1732
  }
1733
1733
  );
@@ -1739,8 +1739,8 @@ function _({
1739
1739
  label: l,
1740
1740
  type: "text",
1741
1741
  value: o ?? "",
1742
- onChange: (a) => {
1743
- const x = a.target.value;
1742
+ onChange: (c) => {
1743
+ const x = c.target.value;
1744
1744
  if (x === "" || x === "-") {
1745
1745
  i == null || i(x);
1746
1746
  return;
@@ -1758,7 +1758,7 @@ function _({
1758
1758
  {
1759
1759
  label: l,
1760
1760
  labelPlacement: "start",
1761
- control: /* @__PURE__ */ t(qe, { checked: o === !0, onChange: (a, x) => i == null ? void 0 : i(x) })
1761
+ control: /* @__PURE__ */ t(qe, { checked: o === !0, onChange: (c, x) => i == null ? void 0 : i(x) })
1762
1762
  }
1763
1763
  );
1764
1764
  if (r.type === "color")
@@ -1767,8 +1767,8 @@ function _({
1767
1767
  {
1768
1768
  label: l,
1769
1769
  value: o,
1770
- onChange: (a) => {
1771
- i == null || i(a);
1770
+ onChange: (c) => {
1771
+ i == null || i(c);
1772
1772
  }
1773
1773
  }
1774
1774
  );
@@ -1778,30 +1778,30 @@ function _({
1778
1778
  {
1779
1779
  label: l,
1780
1780
  value: o,
1781
- onChange: (a) => {
1782
- i == null || i(a);
1781
+ onChange: (c) => {
1782
+ i == null || i(c);
1783
1783
  },
1784
1784
  property: r,
1785
1785
  component: e,
1786
1786
  defaultLocale: m,
1787
- allComponents: c,
1787
+ allComponents: a,
1788
1788
  PropertyValueField: _,
1789
- onUpload: (a) => {
1790
- w.current = a, p();
1789
+ onUpload: (c) => {
1790
+ w.current = c, p();
1791
1791
  }
1792
1792
  }
1793
1793
  );
1794
1794
  if (r.type === "custom") {
1795
- const a = (P = c[r.componentId]) == null ? void 0 : P.data;
1796
- return a ? /* @__PURE__ */ t(R, { width: "100%", children: /* @__PURE__ */ t(
1795
+ const c = (P = a[r.componentId]) == null ? void 0 : P.data;
1796
+ return c ? /* @__PURE__ */ t(R, { width: "100%", children: /* @__PURE__ */ t(
1797
1797
  nt,
1798
1798
  {
1799
- componentId: a.id,
1799
+ componentId: c.id,
1800
1800
  props: { label: l, value: o, onChange: i },
1801
1801
  locale: g,
1802
1802
  dev: {
1803
1803
  mode: "draft",
1804
- components: c,
1804
+ components: a,
1805
1805
  defaultLocale: m
1806
1806
  }
1807
1807
  }
@@ -1812,10 +1812,10 @@ function _({
1812
1812
  /* @__PURE__ */ t(
1813
1813
  Re,
1814
1814
  {
1815
- allComponents: c,
1815
+ allComponents: a,
1816
1816
  label: l,
1817
1817
  value: o == null ? void 0 : o.componentId,
1818
- onChange: (a, x) => {
1818
+ onChange: (c, x) => {
1819
1819
  u || !o ? i == null || i({ ...o && JSON.parse(JSON.stringify(o)), componentId: x }) : typeof o == "object" && (o.componentId = x, i == null || i({ ...o && JSON.parse(JSON.stringify(o)), componentId: x }));
1820
1820
  }
1821
1821
  }
@@ -1827,21 +1827,23 @@ function _({
1827
1827
  valueImmutable: u,
1828
1828
  onChange: i,
1829
1829
  defaultLocale: m,
1830
- allComponents: c
1830
+ allComponents: a
1831
1831
  }
1832
1832
  )
1833
1833
  ] });
1834
- if (!r.type || ["string", "url"].includes(r.type)) {
1835
- const a = r.type === "string" ? r.multiline : void 0, x = r.type === "url" ? o == null ? void 0 : o.url : o;
1834
+ if (!r.type || ["string", "url", "multiline"].includes(r.type)) {
1835
+ let c = r.type === "string" ? r.multiline : void 0;
1836
+ r.type === "multiline" && (c = !0);
1837
+ const x = r.type === "url" ? o == null ? void 0 : o.url : o;
1836
1838
  return /* @__PURE__ */ t(
1837
1839
  C,
1838
1840
  {
1839
1841
  ...b,
1840
1842
  label: l,
1841
1843
  value: typeof x == "string" ? x : "",
1842
- multiline: a,
1843
- minRows: a ? 2 : void 0,
1844
- maxRows: a ? 10 : void 0,
1844
+ multiline: c,
1845
+ minRows: c ? 2 : void 0,
1846
+ maxRows: c ? 10 : void 0,
1845
1847
  onChange: (v) => i == null ? void 0 : i(
1846
1848
  r.type === "url" ? { ...o, url: v.target.value, mediaKitUrl: v.target.value } : v.target.value
1847
1849
  ),
@@ -1878,25 +1880,25 @@ function _({
1878
1880
  {
1879
1881
  label: l,
1880
1882
  value: Array.isArray(o) ? o : [],
1881
- onChange: (a) => i == null ? void 0 : i(a),
1883
+ onChange: (c) => i == null ? void 0 : i(c),
1882
1884
  property: r,
1883
- renderItem: ({ item: a, index: x, onChange: v }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((k) => k.data.visible !== !1).map(({ data: k }) => k.key ? /* @__PURE__ */ t(
1885
+ renderItem: ({ item: c, index: x, onChange: v }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((k) => k.data.visible !== !1).map(({ data: k }) => k.key ? /* @__PURE__ */ t(
1884
1886
  _,
1885
1887
  {
1886
1888
  component: e,
1887
1889
  property: k,
1888
- value: a[k.key],
1890
+ value: c[k.key],
1889
1891
  onChange: (O) => {
1890
- const h = { ...a, [k.key]: O };
1892
+ const h = { ...c, [k.key]: O };
1891
1893
  v(h);
1892
1894
  },
1893
1895
  size: "small",
1894
1896
  fullWidth: !0,
1895
1897
  defaultLocale: m,
1896
- allComponents: c
1898
+ allComponents: a
1897
1899
  },
1898
1900
  k.id
1899
- ) : null) }, x) : /* @__PURE__ */ t(C, { size: b.size, fullWidth: !0, value: a, onChange: (k) => v(k.target.value) })
1901
+ ) : null) }, x) : /* @__PURE__ */ t(C, { size: b.size, fullWidth: !0, value: c, onChange: (k) => v(k.target.value) })
1900
1902
  }
1901
1903
  ) : (console.error("Unsupported property type", r.type), null);
1902
1904
  }
@@ -1948,7 +1950,7 @@ function qr({ value: e }) {
1948
1950
  config: { defaultLocale: u },
1949
1951
  resources: m
1950
1952
  },
1951
- localState: { currentLocale: c }
1953
+ localState: { currentLocale: a }
1952
1954
  } = de(), b = xe(), g = ((w = i[e.renderer.componentId]) == null ? void 0 : w.data) ?? ((l = (p = m.components) == null ? void 0 : p[e.renderer.componentId]) == null ? void 0 : l.component), f = Se({ variant: "dialog" });
1953
1955
  return /* @__PURE__ */ S(j, { gap: 1, children: [
1954
1956
  /* @__PURE__ */ t(
@@ -1966,7 +1968,7 @@ function qr({ value: e }) {
1966
1968
  /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Oe(f), children: /* @__PURE__ */ t(st, { fontSize: "small" }) })
1967
1969
  ] }),
1968
1970
  g.properties && V(Object.values(g.properties), "index").map(({ data: s }) => {
1969
- var n, d, y, P, a, x, v, k, O, h, I, z, N, E, U, W;
1971
+ var n, d, y, P, c, x, v, k, O, h, I, z, N, E, U, W;
1970
1972
  return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
1971
1973
  _,
1972
1974
  {
@@ -1976,12 +1978,12 @@ function qr({ value: e }) {
1976
1978
  property: s,
1977
1979
  fullWidth: !0,
1978
1980
  size: "small",
1979
- valueImmutable: ae((P = (y = (d = (n = e.renderer.properties) == null ? void 0 : n[s.id]) == null ? void 0 : d.locales) == null ? void 0 : y[c]) == null ? void 0 : P.value),
1980
- value: ((k = (v = (x = (a = e.renderer.properties) == null ? void 0 : a[s.id]) == null ? void 0 : x.locales) == null ? void 0 : v[c]) == null ? void 0 : k.value) ?? ((z = (I = (h = (O = e.renderer.properties) == null ? void 0 : O[s.id]) == null ? void 0 : h.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((E = (N = s.locales) == null ? void 0 : N[c]) == null ? void 0 : E.defaultValue) ?? ((W = (U = s.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
1981
+ valueImmutable: ae((P = (y = (d = (n = e.renderer.properties) == null ? void 0 : n[s.id]) == null ? void 0 : d.locales) == null ? void 0 : y[a]) == null ? void 0 : P.value),
1982
+ value: ((k = (v = (x = (c = e.renderer.properties) == null ? void 0 : c[s.id]) == null ? void 0 : x.locales) == null ? void 0 : v[a]) == null ? void 0 : k.value) ?? ((z = (I = (h = (O = e.renderer.properties) == null ? void 0 : O[s.id]) == null ? void 0 : h.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((E = (N = s.locales) == null ? void 0 : N[a]) == null ? void 0 : E.defaultValue) ?? ((W = (U = s.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
1981
1983
  onChange: (re) => {
1982
1984
  o.transact(() => {
1983
1985
  var Y, G, L, q, Q;
1984
- (Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[L = s.id] ?? (G[L] = {}), (q = e.renderer.properties[s.id]).locales ?? (q.locales = {}), (Q = e.renderer.properties[s.id].locales)[c] ?? (Q[c] = {}), e.renderer.properties[s.id].locales[c].value = re;
1986
+ (Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[L = s.id] ?? (G[L] = {}), (q = e.renderer.properties[s.id]).locales ?? (q.locales = {}), (Q = e.renderer.properties[s.id].locales)[a] ?? (Q[a] = {}), e.renderer.properties[s.id].locales[a].value = re;
1985
1987
  });
1986
1988
  }
1987
1989
  }
@@ -1998,14 +2000,14 @@ function Re({
1998
2000
  value: i,
1999
2001
  onChange: u,
2000
2002
  allComponents: m,
2001
- ...c
2003
+ ...a
2002
2004
  }) {
2003
2005
  var w;
2004
2006
  const { t: b } = D(), g = r ?? V(Object.values(hr(m, ...o ?? [])), "index").map((p) => p.data), f = (typeof i == "string" ? (w = m[i]) == null ? void 0 : w.data : void 0) ?? null;
2005
2007
  return /* @__PURE__ */ t(
2006
2008
  et,
2007
2009
  {
2008
- ...c,
2010
+ ...a,
2009
2011
  size: "small",
2010
2012
  options: g,
2011
2013
  autoHighlight: !0,
@@ -2015,12 +2017,12 @@ function Re({
2015
2017
  renderInput: (p) => /* @__PURE__ */ t(C, { label: e || b("component"), ...p }),
2016
2018
  value: f,
2017
2019
  onChange: (p, l) => {
2018
- var n, d, y, P, a, x;
2020
+ var n, d, y, P, c, x;
2019
2021
  let s = {};
2020
2022
  l && (s = {
2021
2023
  blockletId: (n = m[l == null ? void 0 : l.id]) == null ? void 0 : n.blockletId,
2022
2024
  blockletTitle: (d = m[l == null ? void 0 : l.id]) == null ? void 0 : d.blockletTitle,
2023
- componentName: ((P = (y = m[l == null ? void 0 : l.id]) == null ? void 0 : y.data) == null ? void 0 : P.name) || ((x = (a = m[l == null ? void 0 : l.id]) == null ? void 0 : a.data) == null ? void 0 : x.id)
2025
+ componentName: ((P = (y = m[l == null ? void 0 : l.id]) == null ? void 0 : y.data) == null ? void 0 : P.name) || ((x = (c = m[l == null ? void 0 : l.id]) == null ? void 0 : c.data) == null ? void 0 : x.id)
2024
2026
  }), u == null || u(p, l == null ? void 0 : l.id, s);
2025
2027
  }
2026
2028
  }
@@ -2033,13 +2035,13 @@ function bt({
2033
2035
  propertiesValue: i,
2034
2036
  currentLocale: u,
2035
2037
  onChange: m,
2036
- props: c
2038
+ props: a
2037
2039
  }) {
2038
2040
  const { t: b } = D(), [g, f] = J(e == null ? void 0 : e.properties), [w, p] = J(null);
2039
2041
  M(() => {
2040
2042
  (() => {
2041
- var P, a;
2042
- ((P = e == null ? void 0 : e.renderer) == null ? void 0 : P.type) === "react-component" && ot(e == null ? void 0 : e.properties) ? rr((a = e == null ? void 0 : e.renderer) == null ? void 0 : a.script).then((x) => {
2043
+ var P, c;
2044
+ ((P = e == null ? void 0 : e.renderer) == null ? void 0 : P.type) === "react-component" && ot(e == null ? void 0 : e.properties) ? rr((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((x) => {
2043
2045
  const v = ir(x);
2044
2046
  f(v);
2045
2047
  }) : f(e == null ? void 0 : e.properties);
@@ -2048,10 +2050,10 @@ function bt({
2048
2050
  const l = A(() => !e || !g ? {} : Object.values(g).reduce(
2049
2051
  (y, { data: P }) => {
2050
2052
  var x, v, k, O, h;
2051
- const a = P.key || P.id;
2053
+ const c = P.key || P.id;
2052
2054
  return y[P.id] = {
2053
- key: a,
2054
- value: (c == null ? void 0 : c[a]) ?? ((x = i == null ? void 0 : i[P.id]) == null ? void 0 : x.value) ?? ((k = (v = P.locales) == null ? void 0 : v[u]) == null ? void 0 : k.defaultValue) ?? ((h = (O = P.locales) == null ? void 0 : O[o]) == null ? void 0 : h.defaultValue),
2055
+ key: c,
2056
+ value: (a == null ? void 0 : a[c]) ?? ((x = i == null ? void 0 : i[P.id]) == null ? void 0 : x.value) ?? ((k = (v = P.locales) == null ? void 0 : v[u]) == null ? void 0 : k.defaultValue) ?? ((h = (O = P.locales) == null ? void 0 : O[o]) == null ? void 0 : h.defaultValue),
2055
2057
  id: P.id,
2056
2058
  type: P.type
2057
2059
  }, y;
@@ -2064,9 +2066,9 @@ function bt({
2064
2066
  visibleProperties: [],
2065
2067
  canUsePropertiesKeys: []
2066
2068
  };
2067
- const y = V(Object.values(g), "index"), P = y.filter(({ data: v }) => v.key && ve(g, v.id)), a = y.filter(({ data: v }) => v.key && v.type !== "component"), x = a.map(({ data: v }) => v.key);
2069
+ const y = V(Object.values(g), "index"), P = y.filter(({ data: v }) => v.key && ve(g, v.id)), c = y.filter(({ data: v }) => v.key && v.type !== "component"), x = c.map(({ data: v }) => v.key);
2068
2070
  return {
2069
- canUseProperties: a,
2071
+ canUseProperties: c,
2070
2072
  visibleProperties: P,
2071
2073
  canUsePropertiesKeys: x
2072
2074
  };
@@ -2075,7 +2077,7 @@ function bt({
2075
2077
  /* @__PURE__ */ t(F, { variant: "subtitle1", children: b("maker.properties.parameters") }),
2076
2078
  !e || s.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(Z, { style: { fontSize: 12 }, children: b("maker.properties.noParameters") }) : /* @__PURE__ */ S(H, { children: [
2077
2079
  /* @__PURE__ */ t(j, { gap: 2, children: s.visibleProperties.map(({ data: y }) => {
2078
- var P, a;
2080
+ var P, c;
2079
2081
  return /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(
2080
2082
  _,
2081
2083
  {
@@ -2086,7 +2088,7 @@ function bt({
2086
2088
  component: e,
2087
2089
  property: y,
2088
2090
  valueImmutable: ae((P = i == null ? void 0 : i[y.id]) == null ? void 0 : P.value),
2089
- value: (c == null ? void 0 : c[y.key || y.id]) ?? ((a = n[y.id]) == null ? void 0 : a.value),
2091
+ value: (a == null ? void 0 : a[y.key || y.id]) ?? ((c = n[y.id]) == null ? void 0 : c.value),
2090
2092
  onChange: (x) => {
2091
2093
  m({
2092
2094
  path: ["properties", y.id],
@@ -2109,7 +2111,7 @@ function bt({
2109
2111
  properties: n,
2110
2112
  dev: { mode: "draft", components: r, defaultLocale: o },
2111
2113
  props: {
2112
- ...br(c ?? {}, s.canUsePropertiesKeys),
2114
+ ...br(a ?? {}, s.canUsePropertiesKeys),
2113
2115
  onChange: (y) => {
2114
2116
  const { canUsePropertiesKeys: P } = s;
2115
2117
  Object.keys(y).filter((x) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit-inner-components",
3
- "version": "0.4.87",
3
+ "version": "0.4.89",
4
4
  "description": "Pages Kit inner components library",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -67,13 +67,13 @@
67
67
  "dependencies": {
68
68
  "@arcblock/did-auth": "^1.19.15",
69
69
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
70
- "@arcblock/did-connect": "^2.12.48",
71
- "@arcblock/react-hooks": "^2.12.48",
72
- "@arcblock/ux": "^2.12.48",
70
+ "@arcblock/did-connect": "^2.12.49",
71
+ "@arcblock/react-hooks": "^2.12.49",
72
+ "@arcblock/ux": "^2.12.49",
73
73
  "@blocklet/ai-kit": "^0.1.72",
74
74
  "@blocklet/ai-runtime": "^0.4.254",
75
75
  "@blocklet/code-editor": "^0.4.254",
76
- "@blocklet/crawler": "^2.1.247",
76
+ "@blocklet/crawler": "^2.1.252",
77
77
  "@blocklet/embed": "^0.2.3",
78
78
  "@blocklet/js-sdk": "^1.16.40",
79
79
  "@blocklet/logger": "1.16.36",
@@ -81,7 +81,7 @@
81
81
  "@blocklet/sdk": "^1.16.40",
82
82
  "@blocklet/studio-ui": "^0.4.254",
83
83
  "@blocklet/tracker": "^1.16.40",
84
- "@blocklet/ui-react": "^2.12.48",
84
+ "@blocklet/ui-react": "^2.12.49",
85
85
  "@blocklet/uploader": "^0.1.81",
86
86
  "@blocklet/uploader-server": "^0.1.92",
87
87
  "@emotion/cache": "^11.13.1",
@@ -202,8 +202,8 @@
202
202
  "yaml": "^2.5.0",
203
203
  "yjs": "^13.6.18",
204
204
  "zustand": "^4.5.5",
205
- "@blocklet/pages-kit": "^0.4.87",
206
- "@blocklet/pages-kit-block-studio": "^0.4.87"
205
+ "@blocklet/pages-kit": "^0.4.89",
206
+ "@blocklet/pages-kit-block-studio": "^0.4.89"
207
207
  },
208
208
  "devDependencies": {
209
209
  "@trivago/prettier-plugin-sort-imports": "^5.2.1",