@chaibuilder/sdk 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-6fc9d7de.cjs → AddBlocks-48294c91.cjs} +1 -1
- package/dist/{AddBlocks-d5a8235d.js → AddBlocks-a2677462.js} +1 -1
- package/dist/{BrandingOptions-e77f91bc.js → BrandingOptions-a95cba65.js} +1 -1
- package/dist/{BrandingOptions-e44ef105.cjs → BrandingOptions-c2922757.cjs} +1 -1
- package/dist/{CanvasArea-50356121.js → CanvasArea-ab550e9c.js} +2 -2
- package/dist/{CanvasArea-a09ed911.cjs → CanvasArea-f1083634.cjs} +2 -2
- package/dist/{CurrentPage-0dd3a1fe.js → CurrentPage-12828412.js} +1 -1
- package/dist/{CurrentPage-19086054.cjs → CurrentPage-4d4a026f.cjs} +1 -1
- package/dist/{Layers-2dd7336a.cjs → Layers-7d1616f9.cjs} +1 -1
- package/dist/{Layers-e17bbf6a.js → Layers-c429fafe.js} +2 -2
- package/dist/{MarkAsGlobalBlock-d4fe0af6.cjs → MarkAsGlobalBlock-43d26539.cjs} +1 -1
- package/dist/{MarkAsGlobalBlock-3a58a10b.js → MarkAsGlobalBlock-e49bcdc9.js} +1 -1
- package/dist/{PagesPanel-68bb4554.js → PagesPanel-2435351c.js} +2 -2
- package/dist/{PagesPanel-fa54f8c4.cjs → PagesPanel-e89d30f7.cjs} +1 -1
- package/dist/{ProjectPanel-750e4a4f.cjs → ProjectPanel-b110dffd.cjs} +1 -1
- package/dist/{ProjectPanel-decfe6bb.js → ProjectPanel-e2860893.js} +2 -2
- package/dist/{Settings-27bb6012.js → Settings-17279d90.js} +1 -1
- package/dist/{Settings-c18e276b.cjs → Settings-632f6372.cjs} +1 -1
- package/dist/{SidePanels-839ecfae.js → SidePanels-95d3316d.js} +2 -2
- package/dist/{SidePanels-90ac74bf.cjs → SidePanels-b8fe9623.cjs} +1 -1
- package/dist/{Topbar-d3dc4a34.js → Topbar-8d1f6f53.js} +1 -1
- package/dist/{Topbar-57cd1611.cjs → Topbar-e7e27347.cjs} +1 -1
- package/dist/{add-page-modal-f49ebaf3.cjs → add-page-modal-79f99652.cjs} +1 -1
- package/dist/{add-page-modal-da3e0ad5.js → add-page-modal-b3c84063.js} +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/{delete-page-modal-6667ee2b.cjs → delete-page-modal-bfe98708.cjs} +1 -1
- package/dist/{delete-page-modal-3aa66051.js → delete-page-modal-f9e9eb48.js} +1 -1
- package/dist/{index-976ec896.cjs → index-2bda0975.cjs} +18 -18
- package/dist/{index-ca7c3430.js → index-397e45a0.js} +3 -3
- package/dist/lib.d.ts +1 -1
- package/dist/{page-viewer-5f00c933.cjs → page-viewer-1763df5e.cjs} +1 -1
- package/dist/{page-viewer-3e7a6d70.js → page-viewer-9c46bbbf.js} +2 -2
- package/dist/{project-general-setting-a23cc2c4.cjs → project-general-setting-08e5996d.cjs} +1 -1
- package/dist/{project-general-setting-c8aa9370.js → project-general-setting-a925e417.js} +1 -1
- package/dist/render.cjs +2 -2
- package/dist/render.d.ts +11 -1
- package/dist/render.js +119 -108
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +21 -1
- package/dist/server.js +47 -35
- package/dist/{single-page-detail-a4b59a16.cjs → single-page-detail-23bfb732.cjs} +1 -1
- package/dist/{single-page-detail-55638cb1.js → single-page-detail-60eae215.js} +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),c=require("react"),Y=require("@react-hookz/web"),t=require("lodash"),se=require("react-i18next"),u=require("@radix-ui/react-icons"),$=require("./tabs-860e37aa.cjs"),pe=require("@rjsf/core"),de=require("@rjsf/validator-ajv8"),v=require("./index-976ec896.cjs"),Z=require("@chaibuilder/blocks"),re=require("lucide-react"),oe=require("react-autosuggest"),ce=require("./useChaiExternalData-a90e8aac.cjs"),w=require("./useBuilderProp-5e57d0c8.cjs"),T=require("./accordion-0afd8143.cjs"),W=require("./link-86ac8848.cjs"),xe=require("jotai"),me=require("fuse.js"),P=require("./html-to-json-78bfa1f3.cjs"),U=require("./label-167415e5.cjs"),ge=require("./MODIFIERS-70fef873.cjs"),he=require("./input-42acea7e.cjs"),ye=require("./scroll-area-bb343b86.cjs"),k=require("./select-0e32300c.cjs");require("@radix-ui/react-tabs");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("redux-undo");require("sonner");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-accordion");require("react-icons-picker");require("./dialog-170eaad9.cjs");require("@radix-ui/react-dialog");require("./ImagesPanel-0db5c72f.cjs");require("react-quill");require("himalaya");require("@radix-ui/react-label");require("@radix-ui/react-select");function be(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(l,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return l.default=r,Object.freeze(l)}const F=be(c);function fe(r){const l=[],s={};function i(o,a){t.forEach(a,(d,p)=>{const n=o?`${o}.${p}`:p,m=t.isArray(d)?"list":typeof d;l.push(n),s[n]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(d)&&i(n,d)})}return i("",t.omit(r,["styles","_type","_id","_name","_bindings"])),{paths:l,pathsType:s}}const je=({data:r})=>{if(!r)return null;const l=typeof r;return e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(l==="object"?JSON.stringify(r):r,{length:40})})},K=({type:r,isDisabled:l=!1,placeholder:s,defaultValue:i="",data:o,onChange:a,dataType:d,appliedBindings:p})=>{const[n,m]=c.useState(i),{paths:g,pathsType:x}=fe(o),b=r==="PROP"?Z.getBlockComponent(o==null?void 0:o._type):{};c.useEffect(()=>{t.isEmpty(n)&&a("")},[n]),c.useEffect(()=>m(i),[i]);const h=()=>g.filter(j=>{const C=t.isEmpty(n)||t.includes(t.toLower(j),t.toLower(n));return r==="PATH"?C&&d===t.get(x,j,""):C&&!t.includes(p,j)&&t.get(b,`props.${t.first(t.split(j,"."))}.binding`)}),[f,R]=c.useState(()=>h());c.useEffect(()=>R(()=>h()),[d]);const H={autoComplete:"off",autoCorrect:"on",autoCapitalize:"off",spellCheck:!1,placeholder:s,value:n,disabled:l,onBlur:()=>{g.includes(n)?a(n):(m(""),a(""))},onChange:(j,{newValue:C})=>m(C),className:`chai-input w-full ${l?"cursor-not-allowed":""}`},I=j=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative","data-suggest":j,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 w-full h-full absolute opacity-0 z-20",children:j}),e.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[e.jsxRuntimeExports.jsx("div",{className:"leading-4 text-xs flex items-center text-gray-800",children:c.Children.toArray(t.map(t.split(j,"."),(C,A)=>e.jsxRuntimeExports.jsxs("span",{className:"flex items-end",children:[A>0&&e.jsxRuntimeExports.jsx(re.ChevronRight,{size:14,className:"h-full text-gray-400"}),t.startCase(C)]})))}),r==="PATH"&&e.jsxRuntimeExports.jsx(je,{data:t.get(o,j)})]}),r==="PROP"&&e.jsxRuntimeExports.jsx("div",{className:"bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(t.get(x,j,""))})]});return e.jsxRuntimeExports.jsx(oe,{suggestions:f,onSuggestionsFetchRequested:()=>R(()=>h()),onSuggestionsClearRequested:()=>R([]),onSuggestionSelected:j=>{if(j.type==="click"){const C=t.get(j.target,"childNodes[0].data","");g.includes(C)&&a(C)}else a(j.target.value)},getSuggestionValue:j=>j,renderSuggestion:I,shouldRenderSuggestions:()=>!0,inputProps:H,containerProps:{className:"w-full"},theme:{suggestion:"text-gray-500 border-b overflow-hidden text-ellipsis",suggestionHighlighted:"bg-blue-100 text-blue-800 font-normal cursor-pointer",suggestionsContainerOpen:"bg-white border border-gray-300 z-50 max-h-52 left-2 overflow-y-auto w-full rounded-md shadow-2xl text-sm font-light w-full"}})},ve=({item:r,onChange:l,onRemove:s,selectedBlock:i,dataProvider:o,appliedBindings:a})=>{const[d,p]=c.useState("string"),n=(m,g)=>{if(t.isEmpty(m))return"";{const x=t.get(g==="PROP"?i:o,m,"");if(t.isArray(x))return"list";const b=typeof x;return b==="string"?"text":b==="object"?"model":b}};return c.useEffect(()=>p(()=>n(r.key,"PROP")),[r.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 border border-gray-200 relative rounded-md p-2",children:[!t.isEmpty(d)&&!t.isEmpty(r.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(d)}),e.jsxRuntimeExports.jsx(K,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",defaultValue:r.key,onChange:m=>{const g=n(m,"PROP");l({target:{name:"key",value:m}}),d!==g&&l({target:{name:"value",value:""}}),p(g)},data:i,dataType:d,appliedBindings:a}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-x-1.5 w-full relative",children:[e.jsxRuntimeExports.jsx(K,{type:"PATH",isDisabled:t.isEmpty(r.key),placeholder:"Enter data path",defaultValue:r.value,onChange:m=>{const g=n(m,"PATH");l(d!==g?{target:{name:"value",value:""}}:{target:{name:"value",value:m}})},data:o,dataType:d,appliedBindings:a}),e.jsxRuntimeExports.jsx(re.TrashIcon,{onClick:s,className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]})]})},Re=({bindingData:r,onChange:l})=>{const s=v.useSelectedBlock(),[i]=ce.useChaiExternalData(),[o,a]=c.useState(t.map(r,(x,b)=>({key:b,value:x})));c.useEffect(()=>{a(t.map(r,(x,b)=>({key:b,value:x})))},[s==null?void 0:s._id]);const d=c.useMemo(()=>{if(t.isEmpty(o))return!1;const x=t.last(o);return t.isEmpty(x==null?void 0:x.key)||t.isEmpty(x==null?void 0:x.value)},[o]),p=()=>{a([...o,{key:"",value:""}])},n=x=>{const b=t.filter(o,(h,f)=>x!==f);g([...b])},m=(x,b)=>{const h=[...o];h[b][x.target.name]=x.target.value,g(h)},g=c.useCallback((x=[])=>{if(a(x),t.isEmpty(x)){l({});return}const b={};t.forEach(x,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),l(b)},[s]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsx("div",{className:"text-xs text-gray-400",children:"No data provider selected."})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(o,(x,b)=>e.jsxRuntimeExports.jsx(ve,{item:x,onChange:h=>m(h,b),onRemove:()=>n(b),selectedBlock:s,dataProvider:i,appliedBindings:t.map(o,"key")},x.key)),e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx("button",{onClick:p,disabled:d,className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${t.isEmpty(o)?"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 ":""} ${d?"cursor-not-allowed bg-gray-200 text-gray-400":t.isEmpty(o)?"":"bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,children:"+ Add Data Binding"})}),d&&e.jsxRuntimeExports.jsx(w.TooltipContent,{sideOffset:10,className:"text-[11px]",children:"Complete last added data binding to add more"})]})]})},Ee=Re,we=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),J=({createHistorySnapshot:r,properties:l,formData:s,onChange:i})=>{const[o]=v.useActiveLanguage(),a={type:"object",properties:{}},d={};return Object.keys(l).forEach(p=>{const n=l[p];if(t.includes(["slot","styles"],n.type))return;const m=t.get(n,"i18n",!1)?`${p}-${o}`:p;a.properties[m]=v.getBlockJSONFromSchemas(n,o),d[m]=v.getBlockJSONFromUISchemas(n,o)}),e.jsxRuntimeExports.jsx(pe,{widgets:{binding:we,richtext:W.RichTextEditorField,icon:W.IconPickerField,image:W.ImagePickerField},fields:{link:W.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:de,uiSchema:d,onBlur:r,schema:a,formData:s,onChange:i})};function Ce(){const r=v.useSelectedBlock(),{createSnapshot:l}=v.useCanvasHistory(),s=v.useUpdateBlocksPropsRealtime(),i=Z.getBlockComponent(r._type),o={...r},a=()=>l(),d=({formData:g},x)=>{if(x){const b=x.replace("root.","");s([r._id],{[b]:t.get(g,b)})}},p={_name:Z.SingleLineText({title:"Name",default:t.get(r,"_name",r._type)})},n=t.keys(t.get(o,"_bindings",{})),m=c.useMemo(()=>{const g=t.cloneDeep(t.get(i,"props",{}));return t.each(n,x=>{delete g[x]}),g},[i,n]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(J,{onChange:d,createHistorySnapshot:a,formData:o,properties:p}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Ee,{bindingData:t.get(o,"_bindings",{}),onChange:g=>{d({formData:{...o,_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(T.AccordionContent,{className:"pt-4",children:[t.isEmpty(n)?"":e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(n,t.capitalize).join(", ")})," ",n.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(J,{onChange:d,createHistorySnapshot:a,formData:o,properties:m})]})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const Q=new me(P.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function ke(){var I;const[r]=v.useSelectedStylingBlocks(),l=v.useSelectedBlock(),s=v.useAddClassesToBlocks(),i=v.useRemoveClassesFromBlocks(),[o]=v.useSelectedBlockIds(),[a,d]=c.useState(""),p=(I=t.first(r))==null?void 0:I.prop,n=t.reject((t.get(l,p,"").replace(ge.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const j=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");s(o,j,!0),d("")},[g,x]=c.useState([]),b=({value:j})=>{const C=j.trim().toLowerCase(),A=C.match(/.+:/g);let S=[];if(A&&A.length>0){const[V]=A,L=C.replace(V,"");S=Q.search(L).map(y=>({...y,item:{...y.item,name:V+y.item.name}}))}else S=Q.search(C);x(t.map(S,"item"))},h=()=>{x([])},f=j=>j.name,R=j=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:j.name}),H={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:j=>{j.key==="Enter"&&a.trim()!==""&&m()},onChange:(j,{newValue:C})=>d(C),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${g.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(U.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(oe,{suggestions:g,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:f,renderSuggestion:R,inputProps:H,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(w.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),F.Children.toArray(n.map(j=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[j,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>i(o,[j]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},j)))]})]})}const B=["px","%","em","rem","ch","vh","vw"],Se={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:B,property:"flexBasis"},{type:"range",label:"Order",property:"order"},{type:"dropdown",label:"Flex",property:"flexGrowShrink"},{type:"dropdown",label:"Grow",property:"flexGrow"},{type:"dropdown",label:"Shrink",property:"flexShrink"}]},Ne={heading:"Grid Child",items:[{type:"range",label:"Col Span",property:"gridColSpan"},{type:"range",label:"Col Start",property:"gridColStart"},{type:"range",label:"Col End",property:"gridColEnd"},{type:"range",label:"Row Span",property:"gridRowSpan"},{type:"range",label:"Row Start",property:"gridRowStart"},{type:"range",label:"Row End",property:"gridRowEnd"},{type:"range",label:"Order",property:"order"}]},Te=[{heading:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:B},{styleType:"accordion",heading:"Flex options",items:[{type:"dropdown",label:"Direction",property:"flexDirection"},{type:"dropdown",label:"Wrap",property:"flexWrap"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"Grid options",items:[{type:"range",label:"Columns",property:"gridColumns"},{type:"range",label:"Rows",property:"gridRows"},{type:"dropdown",label:"Auto Flow",property:"gridAutoFlow"},{type:"dropdown",label:"Auto Cols",property:"gridAutoColumns"},{type:"dropdown",label:"Auto Rows",property:"gridAutoRows"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",units:["px","rem"],options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"Visibility & Opacity",items:[{type:"dropdown",label:"Visibility",property:"visibility",units:B},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{heading:"Spacing",items:[{styleType:"multiple",label:"Margin",negative:!0,units:[...B,"auto"],options:[{key:"margin",label:"All"},{key:"marginX",label:"Left-Right"},{key:"marginY",label:"Top-Bottom"},{key:"marginTop",label:"Top"},{key:"marginRight",label:"Right"},{key:"marginBottom",label:"Bottom"},{key:"marginLeft",label:"Left"}]},{styleType:"multiple",label:"Padding",options:[{key:"padding",label:"All"},{key:"paddingX",label:"Left-Right"},{key:"paddingY",label:"Top-Bottom"},{key:"paddingTop",label:"Top"},{key:"paddingRight",label:"Right"},{key:"paddingBottom",label:"Bottom"},{key:"paddingLeft",label:"Left"}]},{styleType:"multiple",label:"Space Between",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{type:"arbitrary",label:"Width",units:B.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:B.concat("auto"),property:"height"},{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:B.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:B.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:B.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:B.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"Object options & aspect ratio",items:[{type:"dropdown",label:"Aspect",property:"aspectRatio"},{type:"dropdown",label:"Fit",property:"objectFit"},{type:"dropdown",label:"Position",property:"objectPosition"}]}]},{heading:"Position",items:[{type:"icons",label:"Position",property:"position"},{styleType:"accordion",heading:"Position options",items:[{styleType:"multiple",label:"Direction",options:[{key:"top",label:"Top"},{key:"right",label:"Right"},{key:"bottom",label:"Bottom"},{key:"left",label:"Left"}]},{styleType:"multiple",label:"Inset",options:[{key:"inset",label:"All"},{key:"insetX",label:"Left Right"},{key:"insetY",label:"Top Bottom"}]},{type:"arbitrary",label:"Z-Chai",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"Float & Clear",items:[{type:"icons",label:"Float",property:"float"},{type:"dropdown",label:"Clear",property:"clear"}]},{styleType:"accordion",heading:"Overflow & Overscroll",items:[{styleType:"multiple",type:"dropdown",label:"Overflow",options:[{key:"overflow",label:"All"},{key:"overflowX",label:"Left-Right"},{key:"overflowY",label:"Top-Bottom"}]},{styleType:"multiple",type:"dropdown",label:"Overscroll",options:[{key:"overscroll",label:"All"},{key:"overscrollX",label:"Left-Right"},{key:"overscrollY",label:"Top-Bottom"}]}]}]},{heading:"Typography",items:[{type:"dropdown",property:"fontFamily",label:"Font"},{type:"arbitrary",property:"fontSize",label:"Size",units:B},{type:"arbitrary",property:"lineHeight",label:"Height",units:B.concat("-")},{type:"range",property:"fontWeight",label:"Weight"},{type:"color",property:"textColor",label:"Color"},{styleType:"accordion",heading:"Alignments",items:[{type:"dropdown",property:"textAlign",label:"Align"},{type:"dropdown",property:"verticalAlign",label:"V. Align"}]},{styleType:"accordion",heading:"Spacing, decoration & more",items:[{type:"dropdown",property:"letterSpacing",label:"Spacing"},{type:"dropdown",property:"textDecoration",label:"Decoration"},{type:"range",property:"textDecorationThickness",label:"Thickness"},{type:"dropdown",property:"textTransform",label:"Transform"}]},{styleType:"accordion",heading:"White space & breaks",items:[{type:"dropdown",property:"whitespace",label:"Whitespace"},{type:"dropdown",property:"wordBreak",label:"Wordbreak"}]}]},{heading:"Background",items:[{type:"color",label:"Bg. Color",property:"backgroundColor"},{styleType:"accordion",heading:"Position, Size & more",items:[{type:"dropdown",label:"Attachment",property:"backgroundAttachment"},{type:"dropdown",label:"Clipping",property:"backgroundClip"},{type:"dropdown",label:"Origin",property:"backgroundOrigin"},{type:"dropdown",label:"Position",property:"backgroundPosition"},{type:"dropdown",label:"Repeat",property:"backgroundRepeat"},{type:"dropdown",label:"Size",property:"backgroundSize"}]},{type:"dropdown",label:"Gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"Gradient colors",items:[{type:"color",label:"From",property:"fromColor"},{type:"color",label:"Via",property:"viaColor"},{type:"color",label:"To",property:"toColor"}]}]},{heading:"Border & Outline",items:[{styleType:"multiple",type:"dropdown",label:"Width",options:[{key:"border",label:"All"},{key:"borderX",label:"Left Right"},{key:"borderY",label:"Top bottom"},{key:"borderTop",label:"Top"},{key:"borderRight",label:"Right"},{key:"borderBottom",label:"Bottom"},{key:"borderLeft",label:"Left"}]},{styleType:"multiple",type:"dropdown",label:"Corners",options:[{key:"borderRadius",label:"All"},{key:"borderRadiusTop",label:"Top"},{key:"borderRadiusRight",label:"Right"},{key:"borderRadiusBottom",label:"Bottom"},{key:"borderRadiusLeft",label:"Left"},{key:"borderRadiusTopLeft",label:"Top Left"},{key:"borderRadiusTopRight",label:"Top right"},{key:"borderRadiusBottomRight",label:"Bottom right"},{key:"borderRadiusBottomLeft",label:"Bottom left"}]},{type:"color",label:"Color",property:"borderColor"},{type:"dropdown",label:"Style",property:"borderStyle"},{styleType:"accordion",heading:"Divide options",items:[{styleType:"multiple",type:"range",label:"Width",options:[{key:"divideXWidth",label:"Left Right"},{key:"divideYWidth",label:"Top Bottom"}]},{type:"color",label:"Color",property:"divideColor"},{type:"dropdown",label:"Style",property:"divideStyle"}]},{styleType:"accordion",heading:"Outline styling",items:[{type:"range",label:"Width",property:"outlineWidth"},{type:"range",label:"Offset",property:"outlineOffset"},{type:"dropdown",label:"Style",property:"outlineStyle"}]},{styleType:"accordion",heading:"Ring options",items:[{type:"range",label:"Width",property:"ringWidth"},{type:"color",label:"Color",property:"ringColor"},{type:"range",label:"Offset",property:"ringOffsetWidth"},{type:"color",label:"Off. color",property:"ringOffsetColor"}]}]},{heading:"Effect & Animation",items:[{type:"range",label:"Shadow",property:"boxShadow"},{type:"color",label:"Color",property:"boxShadowColor"},{type:"dropdown",label:"Cursor",property:"cursor"},{styleType:"accordion",heading:"Blend & Cursor",items:[{type:"dropdown",label:"Mix Blend",property:"mixBlendMode"},{type:"dropdown",label:"Bg. Blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"Transform",items:[{type:"dropdown",label:"Origin",property:"transformOrigin"},{styleType:"multiple",label:"Scale",units:["-"],options:[{key:"scale",label:"All"},{key:"scaleX",label:"Left-Right"},{key:"scaleY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Skew",units:["deg"],options:[{key:"skewX",label:"Left-Right"},{key:"skewY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Translate",negative:!0,options:[{key:"translateX",label:"Left-Right"},{key:"translateY",label:"Top-Bottom"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"Rotate",property:"rotate"}]},{styleType:"accordion",heading:"Animation",items:[{type:"dropdown",label:"Animation",property:"animation"},{type:"dropdown",label:"Transition",property:"transition"},{type:"dropdown",label:"Easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"Duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"Delay",property:"delay"}]}]},{heading:"Classes",items:[{component:ke}]}],ne={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},O=c.createContext({canReset:!1,canChange:!0}),Ie=({children:r,canReset:l=!1,canChange:s=!0})=>e.jsxRuntimeExports.jsx(O.Provider,{value:{canReset:l,canChange:s},children:r}),le=({label:r,property:l,onChange:s})=>{const i=c.useMemo(()=>t.get(P.CLASSES_LIST,`${l}.classes`,[""]),[l]),o=q(l),a=c.useMemo(()=>t.get(o,"cls",""),[o]),{canChange:d}=c.useContext(O),p=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:r?"w-full rounded ":"grow",children:p?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(he.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(z,{rounded:r,onChange:n=>s(n,l),selected:a,options:i,disabled:!d})})};function z({selected:r,onChange:l,rounded:s=!1,options:i,disabled:o=!1}){const a=r.replace(/.*:/g,"").trim(),{undo:d,redo:p}=v.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!i.length||o,className:`${s?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:n=>l(n.target.value),onKeyDown:n=>{n.ctrlKey&&(n.key==="z"&&d(),n.key==="y"&&p())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),c.Children.toArray(i.map(n=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:n,children:n})))]})}const Ae=({property:r,onChange:l})=>{const{canReset:s,canChange:i}=c.useContext(O),o=q(r),a=c.useMemo(()=>t.get(o,"cls",""),[o]),d=c.useMemo(()=>t.get(P.CLASSES_LIST,`${r}.classes`,[""]),[r]),p=d.indexOf(a)>-1?d.indexOf(a):0,n=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:n?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:a}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!i&&(!s||p-1<0),onClick:()=>l(t.nth(d,p-1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!i&&(!s||p-1<0)?"text-gray-500":"text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(le,{label:!1,property:r,onChange:l})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!i&&(!s||p+1>=d.length),onClick:()=>l(t.nth(d,p+1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!i&&(!s||p+1>=d.length)?"text-gray-500":"text-white/60"})})})]})})},Be=({property:r,onChange:l})=>{const s=c.useMemo(()=>t.get(P.CLASSES_LIST,`${r}.classes`,[""]),[r]),{canChange:i}=c.useContext(O),o=q(r),a=c.useMemo(()=>t.get(o,"cls",""),[o]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(s,d=>e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!i,onClick:()=>l(d,r),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===d?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:c.createElement(t.get(ne,d,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:t.startCase(t.toLower(d))})]}))})},He={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ve=({property:r,onChange:l})=>{const s=q(r),i=c.useMemo(()=>t.get(s,"cls",""),[s]),{canChange:o}=c.useContext(O),[a,d]=c.useState([]),[p,n]=c.useState({color:"",shade:""}),m=i.split("-"),g=t.get(m,"1",""),x=t.get(m,"2",""),b=c.useCallback(f=>{["current","inherit","transparent","black","white"].includes(f)?(d([]),n({color:f})):(d(["50","100","200","300","400","500","600","700","800","900"]),n(R=>({...R,color:f,shade:R.shade?R.shade:"500"})))},[d,n]);c.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(g))return d([]);d(["50","100","200","300","400","500","600","700","800","900"])},[g]);const h=c.useCallback(f=>{n({color:g,shade:f})},[g]);return c.useEffect(()=>{n({color:"",shade:""})},[s]),c.useEffect(()=>{const R=`${t.get(He,r,"")}-${p.color}${p.shade?`-${p.shade}`:""}`;R.match(new RegExp(t.get(P.CLASSES_LIST,`${r}.regExp`,"")))&&l(R,r)},[p,l,r]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(z,{disabled:!o,rounded:!0,selected:g,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(z,{rounded:!0,selected:x,disabled:!g||!o,onChange:h,options:a})})]})},ee=(r,l)=>{r=r.toLowerCase();let s=r.trim().replace(/ |\+/g,"");if((s==="auto"||s==="none")&&l.includes(s))return{value:"",unit:s};const i=l.length?new RegExp(l.join("|"),"g"):/XXXXXX/g;s=s.replace(i,"");const o=r.match(i),a=o&&o.length>1,d=!t.isEmpty(s)&&Number.isNaN(Number(s));return a||d?{error:"Invalid value"}:o&&(o[0]==="auto"||o[0]==="none")?{value:o[0],unit:""}:{value:s,unit:o?o[0]:""}},De=r=>{const l=r.startsWith("-")?"-":"",s=r.split("-").pop();if(["auto","none"].includes(s))return{value:"",unit:s};if(s==="px")return{value:"1",unit:"px"};if(s==="screen")return{value:"100",unit:r.indexOf("w-")!==-1?"vw":"vh"};if(s==="full")return{value:"100",unit:"%"};if(t.includes(r,"skew-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"rotate-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"opacity-"))return{value:`${s/100}`,unit:"-"};if(t.includes(r,"duration-")||t.includes(r,"delay-"))return{value:`${s}`,unit:"ms"};if(t.includes(r,"translate-")&&!s.includes("/"))return{value:`${l}${`${s/4}`}`,unit:"rem"};if(t.includes(r,"scale-"))return{value:`${l}${`${s/100}`}`,unit:"-"};if(t.startsWith(r,"border")){const i=r.match(/border-?(x|y|t|r|b|l)?\d+/g);if(i)return{value:i[0].split("-").pop(),unit:"px"};if(r.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(r,"max-w-")){if(r==="max-w-screen-sm")return{value:"640",unit:"px"};if(r==="max-w-screen-md")return{value:"768",unit:"px"};if(r==="max-w-screen-lg")return{value:"1024",unit:"px"};if(r==="max-w-screen-xl")return{value:"1280",unit:"px"};if(r==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(s==="xs")return{value:"320",unit:"px"};if(s==="sm")return{value:"384",unit:"px"};if(s==="md")return{value:"448",unit:"px"};if(s==="lg")return{value:"512",unit:"px"};if(s==="xl")return{value:"576",unit:"px"};if(s==="2xl")return{value:"672",unit:"px"};if(s==="3xl")return{value:"768",unit:"px"};if(s==="4xl")return{value:"896",unit:"px"};if(s==="5xl")return{value:"1024",unit:"px"};if(s==="6xl")return{value:"1152",unit:"px"};if(s==="7xl")return{value:"1280",unit:"px"};if(s==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(r,"text-")){if(s==="xs")return{value:"12",unit:"px"};if(s==="sm")return{value:"14",unit:"px"};if(s==="base")return{value:"16",unit:"px"};if(s==="lg")return{value:"18",unit:"px"};if(s==="xl")return{value:"20",unit:"px"};if(s==="2xl")return{value:"24",unit:"px"};if(s==="3xl")return{value:"30",unit:"px"};if(s==="4xl")return{value:"36",unit:"px"};if(s==="5xl")return{value:"48",unit:"px"};if(s==="6xl")return{value:"60",unit:"px"};if(s==="7xl")return{value:"72",unit:"px"};if(s==="8xl")return{value:"96",unit:"px"};if(s==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(r,"leading-")){if(s==="none")return{value:"1",unit:"-"};if(s==="tight")return{value:"1.25",unit:"-"};if(s==="snug")return{value:"1.375",unit:"-"};if(s==="normal")return{value:"1.5",unit:"-"};if(s==="relaxed")return{value:"1.625",unit:"-"};if(s==="loose")return{value:"2",unit:"-"}}if(t.startsWith(r,"tracking-")){if(s==="tighter")return{value:"-0.05",unit:"em"};if(s==="tight")return{value:"-0.025",unit:"em"};if(s==="normal")return{value:"0",unit:"em"};if(s==="wide")return{value:"0.025",unit:"em"};if(s==="wider")return{value:"0.05",unit:"em"};if(s==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(s))return{value:r,unit:"class"};if(s.includes("/")){const[i,o]=t.map(s.split("/"),a=>parseInt(a,10));return{value:l+(i/o*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(s))?{value:`${l+parseFloat(s)*4}`,unit:"px"}:{value:s,unit:"class"}},Le=r=>{if(t.isEmpty(r))return{value:"",unit:""};const l=r.match(/\[.*\]/g);if(l===null)return $e(r);const s=t.get(l,"0","").replace(/\[|\]/g,""),i=r.startsWith("-")?"-":"",o=t.first(s.match(/\d+.\d+|\d+/g));return{value:`${i}${o}`,unit:s.replace(o,"")}},$e=r=>t.isEmpty(r)?{value:"",unit:""}:De(r),ie=c.createContext({setDragData:()=>{}}),Pe=({unit:r,currentValue:l,onDrag:s,onDragEnd:i,onDragStart:o,negative:a,cssProperty:d})=>{const{setDragData:p}=c.useContext(ie);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:n=>{const m={onDrag:s,onDragEnd:i,dragging:!0,dragStartY:n.pageY,dragStartValue:`${l}`,dragUnit:r,negative:a,cssProperty:d};o(m),p(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Me=({onSelect:r,current:l,units:s})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:s.map(i=>e.jsxRuntimeExports.jsx(w.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:l===i?"primary":void 0,size:"sm",onClick:o=>{o.stopPropagation(),r(i)},children:i},i))}),Oe=r=>{const[l,s]=c.useState(!1),[i,o]=c.useState(""),{currentClass:a,onChange:d,classPrefix:p,cssProperty:n,units:m,negative:g}=r,[x,b]=c.useState(n!=null&&n.toLowerCase().includes("width")?"%":m[0]),[h,f]=c.useState(!1),[R,H]=c.useState(""),[I,j]=c.useState(!1),[C,A]=c.useState(!1);c.useEffect(()=>{const{value:y,unit:E}=Le(a);if(E===""){o(y),b(n!=null&&n.toLowerCase().includes("width")?"%":m[0]);return}b(E),o(E==="class"||t.isEmpty(y)?"":y)},[a,n,m]);const S=Y.useThrottledCallback(y=>{d(y)},[d],200),V=Y.useThrottledCallback(y=>{d(y,!1)},[d],200),L=c.useCallback((y=!1)=>{const E=ee(`${i}`,m);if(t.get(E,"error",!1)){f(!0);return}const N=t.get(E,"unit")!==""?t.get(E,"unit"):x;if(N==="auto"||N==="none"){S(`${p}${N}`);return}if(t.get(E,"value")==="")return;const M=`${t.get(E,"value","").startsWith("-")?"-":""}${p}[${t.get(E,"value","").replace("-","")}${N==="-"?"":N}]`;y?V(M):S(M)},[S,V,i,x,p,m]),_=c.useCallback(y=>{const E=ee(`${i}`,m);if(t.get(E,"error",!1)){f(!0);return}if(y==="auto"||y==="none"){S(`${p}${y}`);return}if(t.get(E,"value")==="")return;const N=t.get(E,"unit")!==""?t.get(E,"unit"):y,M=`${t.get(E,"value","").startsWith("-")?"-":""}${p}[${t.get(E,"value","").replace("-","")}${N==="-"?"":N}]`;S(M)},[S,i,p,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:x==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${I?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(x)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:x==="class",onKeyPress:y=>{y.key==="Enter"&&L()},onKeyDown:y=>{if(y.keyCode!==38&&y.keyCode!==40)return;y.preventDefault(),A(!0);const E=t.parseInt(y.target.value);let N=t.isNaN(E)?0:E;y.keyCode===38&&(N+=1),y.keyCode===40&&(N-=1);const D=`${N}`,ue=`${D.startsWith("-")?"-":""}${p}[${D.replace("-","")}${x==="-"?"":x}]`;V(ue)},onKeyUp:y=>{C&&(y.preventDefault(),A(!1))},onBlur:()=>L(),onChange:y=>{f(!1),o(y.target.value)},onClick:y=>{var E;(E=y==null?void 0:y.target)==null||E.select(),s(!1)},value:I?R:i,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(w.Tooltip,{open:l,delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>s(!l),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:x}),m.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(w.TooltipPortal,{children:e.jsxRuntimeExports.jsx(w.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Me,{units:m,current:x,onSelect:y=>{s(!1),b(y),_(y)}})})})]})]}),["none","auto"].indexOf(x)!==-1||I?null:e.jsxRuntimeExports.jsx(Pe,{onDragStart:()=>j(!0),onDragEnd:y=>{if(H(()=>""),j(!1),t.isEmpty(y))return;const E=`${y}`,D=`${E.startsWith("-")?"-":""}${p}[${E.replace("-","")}${x==="-"?"":x}]`;S(D)},onDrag:y=>{if(t.isEmpty(y))return;H(y);const E=`${y}`,D=`${E.startsWith("-")?"-":""}${p}[${E.replace("-","")}${x==="-"?"":x}]`;V(D)},currentValue:i,unit:x,negative:g,cssProperty:n})]})})})},q=r=>{const l=v.useSelectedBlockCurrentClasses();return t.findLast(l,{property:r})},qe=(r,l)=>{const s={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return s[t.get(r,"mq","xs")]<=s[l]},_e={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},We=r=>`${r.toUpperCase()} ${te[r]?`(${te[r]} & up)`:""}`,G=r=>{const{type:l="icons",label:s,property:i,onEmitChange:o=()=>{},units:a,negative:d=!1}=r,[p]=v.useDarkMode(),[n]=v.useStylingState(),[,m]=v.useCanvasWidth(),g=q(i),x=v.useAddClassesToBlocks(),b=v.useRemoveClassesFromBlocks(),[h]=v.useSelectedBlockIds(),f=c.useMemo(()=>t.get(g,"fullCls",""),[g]),R=c.useCallback((S,V=!0)=>{const L={dark:p,mq:m,mod:n,cls:S,property:i,fullCls:""};(p||n!=="")&&(L.mq="xs");const _=P.generateFullClsName(L);x(h,[_],V)},[h,p,m,n,i,x]),H=c.useCallback(()=>{b(h,[f])},[h,f,b]),I=c.useMemo(()=>qe(g,m),[g,m]);c.useEffect(()=>{o(I,g)},[I,o,g]);const[,,j]=v.useCanvasWidth(),C=c.useCallback(S=>{j({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[S])},[j]),A=t.get(g,"dark",null)===p&&t.get(g,"mod",null)===n&&t.get(g,"mq",null)===m;return e.jsxRuntimeExports.jsx(Ie,{canChange:I,canReset:g&&A,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${g&&!A?"text-foreground":""}`,children:s})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[l==="arbitrary"?e.jsxRuntimeExports.jsx(Oe,{currentClass:t.get(g,"cls",""),classPrefix:t.get(_e,i,""),units:a||[],onChange:R,negative:d,cssProperty:i}):null,l==="icons"&&e.jsxRuntimeExports.jsx(Be,{property:i,onChange:R}),l==="range"&&e.jsxRuntimeExports.jsx(Ae,{property:i,onChange:R}),l==="color"&&e.jsxRuntimeExports.jsx(Ve,{property:i,onChange:R}),l==="dropdown"&&e.jsxRuntimeExports.jsx(le,{label:s,property:i,onChange:R})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${f?"visible":"invisible"}`,children:A?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>H(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.TrashIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):I&&g?e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[We(t.get(g,"mq")),p&&!g.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>C(t.get(g,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(g,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Fe=["px","%","em","rem","ch","vh","vw"],ae=({label:r,options:l,borderB:s=!1,borderT:i=!1,type:o="arbitrary",units:a=Fe,negative:d=!1})=>{const[p,n]=c.useState(l[0].key),m=v.useSelectedBlockCurrentClasses(),g=c.useCallback(x=>t.map(m,"property").includes(x),[m]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${s?"border-b":""} ${i?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[r&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:r}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:c.Children.toArray(l.map(({label:x,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>n(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[c.createElement("div",{className:g(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),c.createElement(t.get(ne,b,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:t.startCase(t.toLower(x))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(G,{type:o,units:[...a],label:"",property:p,negative:d})})]})},Xe=({heading:r,items:l})=>{const s=v.useSelectedBlockCurrentClasses(),i=c.useMemo(()=>{const o=p=>t.flatten(p.map(n=>n.styleType==="multiple"?t.map(n.options,"key"):n.property)),a=t.flatten(l.map(p=>p.styleType==="accordion"?o(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),d=t.map(s,"property");return t.intersection(a,d).length>0},[s,l]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r,i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:l.map(o=>o.styleType==="multiple"?e.jsxRuntimeExports.jsx(ae,{...o},o.label):e.jsxRuntimeExports.jsx(G,{...o},o.label))})]})},Ye=c.createContext({}),X=({section:r})=>{const l=v.useSelectedBlockCurrentClasses(),s=c.useCallback((a=[])=>{const d={};for(let n=0;n<l.length;n++)d[l[n].property]=l[n].cls;let p=!0;for(const n in a)if(!t.has(d,n)||d[n]!==a[n]){p=!1;break}return p},[l]),i=c.useMemo(()=>{if(l.length>0&&r.heading==="Classes")return!0;const a=n=>t.flatten(n.map(m=>m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),d=t.flatten(r.items.map(n=>n.styleType==="accordion"?a(n.items):n.styleType==="multiple"?t.flatten(t.map(n.options,"key")):n.property)),p=t.map(l,"property");return t.intersection(d,p).length>0},[l,r.heading,r.items]),o=c.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Ye.Provider,{value:o,children:e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),r.heading]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:c.Children.toArray(r.items.map(a=>t.has(a,"component")?c.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ae,{...a},a.label):a.styleType==="accordion"&&s(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(Xe,{...a},a.label):null:e.jsxRuntimeExports.jsx(G,{...a},a.label)))})]})})},Ze=({item:r,index:l,canDelete:s,onChange:i,onRemove:o})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${s?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:a=>i(a,l),value:r.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:a=>t.isEmpty(r.key)?{}:i(a,l),value:r.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:o,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),ze=({section:r})=>{var b;const{setSyncState:l}=v.useSavePage(),s=v.useSelectedBlock(),[i,o]=c.useState([]),[a]=v.useSelectedStylingBlocks(),d=v.useUpdateBlocksPropsRealtime(),p=`${t.get(a,"0.prop")}_attrs`;F.useEffect(()=>{const h=t.map(t.get(s,p),(f,R)=>({key:R,value:f}));t.isEmpty(h)?o([]):o(h)},[t.get(s,p)]);const n=()=>o([...i,{key:"",value:""}]),m=h=>{const f=t.filter(i,(R,H)=>h!==H);x(f)},g=(h,f)=>{const R=[...i];R[f][h.target.name]=h.target.value,x(R)},x=F.useCallback((h=[])=>{const f={};t.forEach(h,R=>{t.isEmpty(R.key)||t.set(f,R.key,R.value)}),d([t.get(s,"_id")],{[p]:f}),l("UNSAVED")},[s,l,d,p]);return e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,p))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(U.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(i)&&t.isEmpty((b=t.last(i))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(i)&&t.isEmpty((h=t.last(i))==null?void 0:h.key)||n()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(i)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),F.Children.toArray(t.map(i,(h,f)=>{const R=i.length>0&&f<i.length-1;return e.jsxRuntimeExports.jsx(Ze,{item:h,index:f,canDelete:R,onChange:g,onRemove:()=>m(f)})}))]})]})})]})};function Ue(){const[r,l]=v.useStylingState(),{flexChild:s,gridChild:i}=v.useSelectedBlocksDisplayChild(),[,o]=xe.useAtom(v.advanceStylingOpenAtom),{t:a}=se.useTranslation(),[d]=v.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:a("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>o(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(U.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(k.Select,{defaultValue:r,onValueChange:p=>l(p),children:[e.jsxRuntimeExports.jsx(k.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(k.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(k.SelectContent,{children:[e.jsxRuntimeExports.jsx(k.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(ye.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",className:"h-full w-full",children:[s&&e.jsxRuntimeExports.jsx(X,{section:Se}),i?e.jsxRuntimeExports.jsx(X,{section:Ne}):null,Te.map(p=>e.jsxRuntimeExports.jsx(X,{section:p},p.heading)),e.jsxRuntimeExports.jsx(ze,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const Ge={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Ke=()=>{const r=v.useSelectedBlock(),{t:l}=se.useTranslation(),[s,i]=c.useState(""),[o,a]=c.useState({onDrag:n=>n,onDragEnd:n=>n,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),d=Y.useThrottledCallback(n=>{const m=!t.get(o,"negative",!1),g=t.get(o,"cssProperty","");let x=parseFloat(o.dragStartValue);x=t.isNaN(x)?0:x;let b=Ge[o.dragUnit];(t.startsWith(g,"scale")||g==="opacity")&&(b=10);let f=(o.dragStartY-n.pageY)/b+x;m&&f<0&&(f=0),g==="opacity"&&f>1&&(f=1),o.onDrag(`${f}`),i(`${f}`)},[o],50),p=c.useCallback(()=>{setTimeout(()=>o.onDragEnd(`${s}`),100),a({onDrag:n=>n,onDragEnd:n=>n,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[o,s,a]);return t.isNull(r)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:l("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsxs(ie.Provider,{value:{setDragData:a},children:[o.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:d,onMouseUp:()=>p(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs($.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs($.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx($.TabsTrigger,{value:"settings",children:"Settings"}),e.jsxRuntimeExports.jsx($.TabsTrigger,{value:"styling",children:"Styling"})]}),e.jsxRuntimeExports.jsx($.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ce,{})}),e.jsxRuntimeExports.jsx($.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ue,{})})]})]})};exports.default=Ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),c=require("react"),Y=require("@react-hookz/web"),t=require("lodash"),se=require("react-i18next"),u=require("@radix-ui/react-icons"),$=require("./tabs-860e37aa.cjs"),pe=require("@rjsf/core"),de=require("@rjsf/validator-ajv8"),v=require("./index-2bda0975.cjs"),Z=require("@chaibuilder/blocks"),re=require("lucide-react"),oe=require("react-autosuggest"),ce=require("./useChaiExternalData-a90e8aac.cjs"),w=require("./useBuilderProp-5e57d0c8.cjs"),T=require("./accordion-0afd8143.cjs"),W=require("./link-86ac8848.cjs"),xe=require("jotai"),me=require("fuse.js"),P=require("./html-to-json-78bfa1f3.cjs"),U=require("./label-167415e5.cjs"),ge=require("./MODIFIERS-70fef873.cjs"),he=require("./input-42acea7e.cjs"),ye=require("./scroll-area-bb343b86.cjs"),k=require("./select-0e32300c.cjs");require("@radix-ui/react-tabs");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("redux-undo");require("sonner");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-accordion");require("react-icons-picker");require("./dialog-170eaad9.cjs");require("@radix-ui/react-dialog");require("./ImagesPanel-0db5c72f.cjs");require("react-quill");require("himalaya");require("@radix-ui/react-label");require("@radix-ui/react-select");function be(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(l,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}return l.default=r,Object.freeze(l)}const F=be(c);function fe(r){const l=[],s={};function i(o,a){t.forEach(a,(d,p)=>{const n=o?`${o}.${p}`:p,m=t.isArray(d)?"list":typeof d;l.push(n),s[n]=m==="string"?"text":m==="object"?"model":m,m==="object"&&!t.isArray(d)&&i(n,d)})}return i("",t.omit(r,["styles","_type","_id","_name","_bindings"])),{paths:l,pathsType:s}}const je=({data:r})=>{if(!r)return null;const l=typeof r;return e.jsxRuntimeExports.jsx("div",{className:"text-[10px] text-gray-800/50 leading-3 whitespace-nowrap overflow-hidden w-full",children:t.truncate(l==="object"?JSON.stringify(r):r,{length:40})})},K=({type:r,isDisabled:l=!1,placeholder:s,defaultValue:i="",data:o,onChange:a,dataType:d,appliedBindings:p})=>{const[n,m]=c.useState(i),{paths:g,pathsType:x}=fe(o),b=r==="PROP"?Z.getBlockComponent(o==null?void 0:o._type):{};c.useEffect(()=>{t.isEmpty(n)&&a("")},[n]),c.useEffect(()=>m(i),[i]);const h=()=>g.filter(j=>{const C=t.isEmpty(n)||t.includes(t.toLower(j),t.toLower(n));return r==="PATH"?C&&d===t.get(x,j,""):C&&!t.includes(p,j)&&t.get(b,`props.${t.first(t.split(j,"."))}.binding`)}),[f,R]=c.useState(()=>h());c.useEffect(()=>R(()=>h()),[d]);const H={autoComplete:"off",autoCorrect:"on",autoCapitalize:"off",spellCheck:!1,placeholder:s,value:n,disabled:l,onBlur:()=>{g.includes(n)?a(n):(m(""),a(""))},onChange:(j,{newValue:C})=>m(C),className:`chai-input w-full ${l?"cursor-not-allowed":""}`},I=j=>e.jsxRuntimeExports.jsxs("div",{className:"rounded-md px-1 py-1.5 flex items-center justify-between space-x-2 font-light relative","data-suggest":j,children:[e.jsxRuntimeExports.jsx("div",{className:"-mt-1 w-full h-full absolute opacity-0 z-20",children:j}),e.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[e.jsxRuntimeExports.jsx("div",{className:"leading-4 text-xs flex items-center text-gray-800",children:c.Children.toArray(t.map(t.split(j,"."),(C,A)=>e.jsxRuntimeExports.jsxs("span",{className:"flex items-end",children:[A>0&&e.jsxRuntimeExports.jsx(re.ChevronRight,{size:14,className:"h-full text-gray-400"}),t.startCase(C)]})))}),r==="PATH"&&e.jsxRuntimeExports.jsx(je,{data:t.get(o,j)})]}),r==="PROP"&&e.jsxRuntimeExports.jsx("div",{className:"bg-purple-100 text-purple-400 text-[9px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(t.get(x,j,""))})]});return e.jsxRuntimeExports.jsx(oe,{suggestions:f,onSuggestionsFetchRequested:()=>R(()=>h()),onSuggestionsClearRequested:()=>R([]),onSuggestionSelected:j=>{if(j.type==="click"){const C=t.get(j.target,"childNodes[0].data","");g.includes(C)&&a(C)}else a(j.target.value)},getSuggestionValue:j=>j,renderSuggestion:I,shouldRenderSuggestions:()=>!0,inputProps:H,containerProps:{className:"w-full"},theme:{suggestion:"text-gray-500 border-b overflow-hidden text-ellipsis",suggestionHighlighted:"bg-blue-100 text-blue-800 font-normal cursor-pointer",suggestionsContainerOpen:"bg-white border border-gray-300 z-50 max-h-52 left-2 overflow-y-auto w-full rounded-md shadow-2xl text-sm font-light w-full"}})},ve=({item:r,onChange:l,onRemove:s,selectedBlock:i,dataProvider:o,appliedBindings:a})=>{const[d,p]=c.useState("string"),n=(m,g)=>{if(t.isEmpty(m))return"";{const x=t.get(g==="PROP"?i:o,m,"");if(t.isArray(x))return"list";const b=typeof x;return b==="string"?"text":b==="object"?"model":b}};return c.useEffect(()=>p(()=>n(r.key,"PROP")),[r.key]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 border border-gray-200 relative rounded-md p-2",children:[!t.isEmpty(d)&&!t.isEmpty(r.key)&&e.jsxRuntimeExports.jsx("div",{className:"mt-px absolute right-2 top-4 text-purple-600 text-[10px] flex items-center font-medium h-4 px-2 rounded-full",children:t.startCase(d)}),e.jsxRuntimeExports.jsx(K,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",defaultValue:r.key,onChange:m=>{const g=n(m,"PROP");l({target:{name:"key",value:m}}),d!==g&&l({target:{name:"value",value:""}}),p(g)},data:i,dataType:d,appliedBindings:a}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-start justify-between gap-x-1.5 w-full relative",children:[e.jsxRuntimeExports.jsx(K,{type:"PATH",isDisabled:t.isEmpty(r.key),placeholder:"Enter data path",defaultValue:r.value,onChange:m=>{const g=n(m,"PATH");l(d!==g?{target:{name:"value",value:""}}:{target:{name:"value",value:m}})},data:o,dataType:d,appliedBindings:a}),e.jsxRuntimeExports.jsx(re.TrashIcon,{onClick:s,className:"h-6 w-6 mt-1 cursor-pointer rounded border hover:bg-red-400 hover:text-white border-red-400 p-1 text-red-400 hover:scale-105 duration-200"})]})]})},Re=({bindingData:r,onChange:l})=>{const s=v.useSelectedBlock(),[i]=ce.useChaiExternalData(),[o,a]=c.useState(t.map(r,(x,b)=>({key:b,value:x})));c.useEffect(()=>{a(t.map(r,(x,b)=>({key:b,value:x})))},[s==null?void 0:s._id]);const d=c.useMemo(()=>{if(t.isEmpty(o))return!1;const x=t.last(o);return t.isEmpty(x==null?void 0:x.key)||t.isEmpty(x==null?void 0:x.value)},[o]),p=()=>{a([...o,{key:"",value:""}])},n=x=>{const b=t.filter(o,(h,f)=>x!==f);g([...b])},m=(x,b)=>{const h=[...o];h[b][x.target.name]=x.target.value,g(h)},g=c.useCallback((x=[])=>{if(a(x),t.isEmpty(x)){l({});return}const b={};t.forEach(x,h=>{!t.isEmpty(h==null?void 0:h.key)&&!t.isEmpty(h==null?void 0:h.value)&&t.set(b,h.key,h.value)}),l(b)},[s]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"w-full flex items-center justify-center",children:e.jsxRuntimeExports.jsx("div",{className:"text-xs text-gray-400",children:"No data provider selected."})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(o,(x,b)=>e.jsxRuntimeExports.jsx(ve,{item:x,onChange:h=>m(h,b),onRemove:()=>n(b),selectedBlock:s,dataProvider:i,appliedBindings:t.map(o,"key")},x.key)),e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx("button",{onClick:p,disabled:d,className:`w-full px-5 py-1.5 text-xs rounded-md font-medium duration-200 ${t.isEmpty(o)?"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30 ":""} ${d?"cursor-not-allowed bg-gray-200 text-gray-400":t.isEmpty(o)?"":"bg-gray-700/20 text-gray-800 hover:bg-blue-700/30"}`,children:"+ Add Data Binding"})}),d&&e.jsxRuntimeExports.jsx(w.TooltipContent,{sideOffset:10,className:"text-[11px]",children:"Complete last added data binding to add more"})]})]})},Ee=Re,we=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),J=({createHistorySnapshot:r,properties:l,formData:s,onChange:i})=>{const[o]=v.useActiveLanguage(),a={type:"object",properties:{}},d={};return Object.keys(l).forEach(p=>{const n=l[p];if(t.includes(["slot","styles"],n.type))return;const m=t.get(n,"i18n",!1)?`${p}-${o}`:p;a.properties[m]=v.getBlockJSONFromSchemas(n,o),d[m]=v.getBlockJSONFromUISchemas(n,o)}),e.jsxRuntimeExports.jsx(pe,{widgets:{binding:we,richtext:W.RichTextEditorField,icon:W.IconPickerField,image:W.ImagePickerField},fields:{link:W.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!0,validator:de,uiSchema:d,onBlur:r,schema:a,formData:s,onChange:i})};function Ce(){const r=v.useSelectedBlock(),{createSnapshot:l}=v.useCanvasHistory(),s=v.useUpdateBlocksPropsRealtime(),i=Z.getBlockComponent(r._type),o={...r},a=()=>l(),d=({formData:g},x)=>{if(x){const b=x.replace("root.","");s([r._id],{[b]:t.get(g,b)})}},p={_name:Z.SingleLineText({title:"Name",default:t.get(r,"_name",r._type)})},n=t.keys(t.get(o,"_bindings",{})),m=c.useMemo(()=>{const g=t.cloneDeep(t.get(i,"props",{}));return t.each(n,x=>{delete g[x]}),g},[i,n]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(J,{onChange:d,createHistorySnapshot:a,formData:o,properties:p}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(r,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"pt-4 px-4",children:e.jsxRuntimeExports.jsx(Ee,{bindingData:t.get(o,"_bindings",{}),onChange:g=>{d({formData:{...o,_bindings:g}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline bg-gray-100 ml-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(T.AccordionContent,{className:"pt-4",children:[t.isEmpty(n)?"":e.jsxRuntimeExports.jsxs("div",{className:"text-xs mx-4 border rounded-sm p-1 mb-1 mt-0 border-orange-500 text-orange-500 bg-orange-100",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(n,t.capitalize).join(", ")})," ",n.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(J,{onChange:d,createHistorySnapshot:a,formData:o,properties:m})]})]})]}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const Q=new me(P.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function ke(){var I;const[r]=v.useSelectedStylingBlocks(),l=v.useSelectedBlock(),s=v.useAddClassesToBlocks(),i=v.useRemoveClassesFromBlocks(),[o]=v.useSelectedBlockIds(),[a,d]=c.useState(""),p=(I=t.first(r))==null?void 0:I.prop,n=t.reject((t.get(l,p,"").replace(ge.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),m=()=>{const j=a.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");s(o,j,!0),d("")},[g,x]=c.useState([]),b=({value:j})=>{const C=j.trim().toLowerCase(),A=C.match(/.+:/g);let S=[];if(A&&A.length>0){const[V]=A,L=C.replace(V,"");S=Q.search(L).map(y=>({...y,item:{...y.item,name:V+y.item.name}}))}else S=Q.search(C);x(t.map(S,"item"))},h=()=>{x([])},f=j=>j.name,R=j=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:j.name}),H={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:a,onKeyDown:j=>{j.key==="Enter"&&a.trim()!==""&&m()},onChange:(j,{newValue:C})=>d(C),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${g.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(U.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(oe,{suggestions:g,onSuggestionsFetchRequested:b,onSuggestionsClearRequested:h,getSuggestionValue:f,renderSuggestion:R,inputProps:H,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(w.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:m,disabled:a.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),F.Children.toArray(n.map(j=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[j,e.jsxRuntimeExports.jsx(u.Cross2Icon,{onClick:()=>i(o,[j]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},j)))]})]})}const B=["px","%","em","rem","ch","vh","vw"],Se={heading:"Flex Child",items:[{type:"arbitrary",label:"Basis",units:B,property:"flexBasis"},{type:"range",label:"Order",property:"order"},{type:"dropdown",label:"Flex",property:"flexGrowShrink"},{type:"dropdown",label:"Grow",property:"flexGrow"},{type:"dropdown",label:"Shrink",property:"flexShrink"}]},Ne={heading:"Grid Child",items:[{type:"range",label:"Col Span",property:"gridColSpan"},{type:"range",label:"Col Start",property:"gridColStart"},{type:"range",label:"Col End",property:"gridColEnd"},{type:"range",label:"Row Span",property:"gridRowSpan"},{type:"range",label:"Row Start",property:"gridRowStart"},{type:"range",label:"Row End",property:"gridRowEnd"},{type:"range",label:"Order",property:"order"}]},Te=[{heading:"Display",items:[{type:"dropdown",label:"Display",property:"display",units:B},{styleType:"accordion",heading:"Flex options",items:[{type:"dropdown",label:"Direction",property:"flexDirection"},{type:"dropdown",label:"Wrap",property:"flexWrap"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"Grid options",items:[{type:"range",label:"Columns",property:"gridColumns"},{type:"range",label:"Rows",property:"gridRows"},{type:"dropdown",label:"Auto Flow",property:"gridAutoFlow"},{type:"dropdown",label:"Auto Cols",property:"gridAutoColumns"},{type:"dropdown",label:"Auto Rows",property:"gridAutoRows"},{type:"dropdown",label:"Justify",property:"justifyContent"},{type:"dropdown",label:"Content",property:"alignContent"},{type:"dropdown",label:"Items",property:"alignItems"},{styleType:"multiple",label:"Gap",units:["px","rem"],options:[{key:"gap",label:"All"},{key:"gapX",label:"Left-Right"},{key:"gapY",label:"Top-Bottom"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"Visibility & Opacity",items:[{type:"dropdown",label:"Visibility",property:"visibility",units:B},{type:"arbitrary",label:"Opacity",property:"opacity",units:["-"]}]}]},{heading:"Spacing",items:[{styleType:"multiple",label:"Margin",negative:!0,units:[...B,"auto"],options:[{key:"margin",label:"All"},{key:"marginX",label:"Left-Right"},{key:"marginY",label:"Top-Bottom"},{key:"marginTop",label:"Top"},{key:"marginRight",label:"Right"},{key:"marginBottom",label:"Bottom"},{key:"marginLeft",label:"Left"}]},{styleType:"multiple",label:"Padding",options:[{key:"padding",label:"All"},{key:"paddingX",label:"Left-Right"},{key:"paddingY",label:"Top-Bottom"},{key:"paddingTop",label:"Top"},{key:"paddingRight",label:"Right"},{key:"paddingBottom",label:"Bottom"},{key:"paddingLeft",label:"Left"}]},{styleType:"multiple",label:"Space Between",options:[{key:"spaceX",label:"Left-Right"},{key:"spaceY",label:"Top-Bottom"}]}]},{heading:"Size",items:[{type:"arbitrary",label:"Width",units:B.concat("auto"),property:"width"},{type:"arbitrary",label:"Height",units:B.concat("auto"),property:"height"},{styleType:"accordion",heading:"Min width & height",items:[{type:"arbitrary",label:"Min Width",units:B.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"Min Height",units:B.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"Max width & height",items:[{type:"arbitrary",label:"Max Width",units:B.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"Max Height",units:B.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"Object options & aspect ratio",items:[{type:"dropdown",label:"Aspect",property:"aspectRatio"},{type:"dropdown",label:"Fit",property:"objectFit"},{type:"dropdown",label:"Position",property:"objectPosition"}]}]},{heading:"Position",items:[{type:"icons",label:"Position",property:"position"},{styleType:"accordion",heading:"Position options",items:[{styleType:"multiple",label:"Direction",options:[{key:"top",label:"Top"},{key:"right",label:"Right"},{key:"bottom",label:"Bottom"},{key:"left",label:"Left"}]},{styleType:"multiple",label:"Inset",options:[{key:"inset",label:"All"},{key:"insetX",label:"Left Right"},{key:"insetY",label:"Top Bottom"}]},{type:"arbitrary",label:"Z-Chai",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"Float & Clear",items:[{type:"icons",label:"Float",property:"float"},{type:"dropdown",label:"Clear",property:"clear"}]},{styleType:"accordion",heading:"Overflow & Overscroll",items:[{styleType:"multiple",type:"dropdown",label:"Overflow",options:[{key:"overflow",label:"All"},{key:"overflowX",label:"Left-Right"},{key:"overflowY",label:"Top-Bottom"}]},{styleType:"multiple",type:"dropdown",label:"Overscroll",options:[{key:"overscroll",label:"All"},{key:"overscrollX",label:"Left-Right"},{key:"overscrollY",label:"Top-Bottom"}]}]}]},{heading:"Typography",items:[{type:"dropdown",property:"fontFamily",label:"Font"},{type:"arbitrary",property:"fontSize",label:"Size",units:B},{type:"arbitrary",property:"lineHeight",label:"Height",units:B.concat("-")},{type:"range",property:"fontWeight",label:"Weight"},{type:"color",property:"textColor",label:"Color"},{styleType:"accordion",heading:"Alignments",items:[{type:"dropdown",property:"textAlign",label:"Align"},{type:"dropdown",property:"verticalAlign",label:"V. Align"}]},{styleType:"accordion",heading:"Spacing, decoration & more",items:[{type:"dropdown",property:"letterSpacing",label:"Spacing"},{type:"dropdown",property:"textDecoration",label:"Decoration"},{type:"range",property:"textDecorationThickness",label:"Thickness"},{type:"dropdown",property:"textTransform",label:"Transform"}]},{styleType:"accordion",heading:"White space & breaks",items:[{type:"dropdown",property:"whitespace",label:"Whitespace"},{type:"dropdown",property:"wordBreak",label:"Wordbreak"}]}]},{heading:"Background",items:[{type:"color",label:"Bg. Color",property:"backgroundColor"},{styleType:"accordion",heading:"Position, Size & more",items:[{type:"dropdown",label:"Attachment",property:"backgroundAttachment"},{type:"dropdown",label:"Clipping",property:"backgroundClip"},{type:"dropdown",label:"Origin",property:"backgroundOrigin"},{type:"dropdown",label:"Position",property:"backgroundPosition"},{type:"dropdown",label:"Repeat",property:"backgroundRepeat"},{type:"dropdown",label:"Size",property:"backgroundSize"}]},{type:"dropdown",label:"Gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"Gradient colors",items:[{type:"color",label:"From",property:"fromColor"},{type:"color",label:"Via",property:"viaColor"},{type:"color",label:"To",property:"toColor"}]}]},{heading:"Border & Outline",items:[{styleType:"multiple",type:"dropdown",label:"Width",options:[{key:"border",label:"All"},{key:"borderX",label:"Left Right"},{key:"borderY",label:"Top bottom"},{key:"borderTop",label:"Top"},{key:"borderRight",label:"Right"},{key:"borderBottom",label:"Bottom"},{key:"borderLeft",label:"Left"}]},{styleType:"multiple",type:"dropdown",label:"Corners",options:[{key:"borderRadius",label:"All"},{key:"borderRadiusTop",label:"Top"},{key:"borderRadiusRight",label:"Right"},{key:"borderRadiusBottom",label:"Bottom"},{key:"borderRadiusLeft",label:"Left"},{key:"borderRadiusTopLeft",label:"Top Left"},{key:"borderRadiusTopRight",label:"Top right"},{key:"borderRadiusBottomRight",label:"Bottom right"},{key:"borderRadiusBottomLeft",label:"Bottom left"}]},{type:"color",label:"Color",property:"borderColor"},{type:"dropdown",label:"Style",property:"borderStyle"},{styleType:"accordion",heading:"Divide options",items:[{styleType:"multiple",type:"range",label:"Width",options:[{key:"divideXWidth",label:"Left Right"},{key:"divideYWidth",label:"Top Bottom"}]},{type:"color",label:"Color",property:"divideColor"},{type:"dropdown",label:"Style",property:"divideStyle"}]},{styleType:"accordion",heading:"Outline styling",items:[{type:"range",label:"Width",property:"outlineWidth"},{type:"range",label:"Offset",property:"outlineOffset"},{type:"dropdown",label:"Style",property:"outlineStyle"}]},{styleType:"accordion",heading:"Ring options",items:[{type:"range",label:"Width",property:"ringWidth"},{type:"color",label:"Color",property:"ringColor"},{type:"range",label:"Offset",property:"ringOffsetWidth"},{type:"color",label:"Off. color",property:"ringOffsetColor"}]}]},{heading:"Effect & Animation",items:[{type:"range",label:"Shadow",property:"boxShadow"},{type:"color",label:"Color",property:"boxShadowColor"},{type:"dropdown",label:"Cursor",property:"cursor"},{styleType:"accordion",heading:"Blend & Cursor",items:[{type:"dropdown",label:"Mix Blend",property:"mixBlendMode"},{type:"dropdown",label:"Bg. Blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"Transform",items:[{type:"dropdown",label:"Origin",property:"transformOrigin"},{styleType:"multiple",label:"Scale",units:["-"],options:[{key:"scale",label:"All"},{key:"scaleX",label:"Left-Right"},{key:"scaleY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Skew",units:["deg"],options:[{key:"skewX",label:"Left-Right"},{key:"skewY",label:"Top-Bottom"}]},{styleType:"multiple",label:"Translate",negative:!0,options:[{key:"translateX",label:"Left-Right"},{key:"translateY",label:"Top-Bottom"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"Rotate",property:"rotate"}]},{styleType:"accordion",heading:"Animation",items:[{type:"dropdown",label:"Animation",property:"animation"},{type:"dropdown",label:"Transition",property:"transition"},{type:"dropdown",label:"Easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"Duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"Delay",property:"delay"}]}]},{heading:"Classes",items:[{component:ke}]}],ne={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:u.EyeOpenIcon,invisible:u.EyeClosedIcon,hidden:u.EyeClosedIcon,gap:u.BorderAllIcon,gapX:u.WidthIcon,gapY:u.HeightIcon,spaceX:u.WidthIcon,spaceY:u.HeightIcon,overscroll:u.BorderAllIcon,overscrollX:u.WidthIcon,overscrollY:u.HeightIcon,overflow:u.BorderAllIcon,overflowX:u.WidthIcon,overflowY:u.HeightIcon,top:u.ArrowUpIcon,right:u.ArrowRightIcon,bottom:u.ArrowDownIcon,left:u.ArrowLeftIcon,inset:u.BorderAllIcon,insetX:u.WidthIcon,insetY:u.HeightIcon,border:u.BorderAllIcon,borderX:u.WidthIcon,borderY:u.HeightIcon,borderTop:u.ArrowUpIcon,borderRight:u.ArrowRightIcon,borderBottom:u.ArrowDownIcon,borderLeft:u.ArrowLeftIcon,borderRadius:u.BorderAllIcon,borderRadiusX:u.WidthIcon,borderRadiusY:u.HeightIcon,borderRadiusTop:u.ArrowUpIcon,borderRadiusRight:u.ArrowRightIcon,borderRadiusBottom:u.ArrowDownIcon,borderRadiusLeft:u.ArrowLeftIcon,borderRadiusTopLeft:u.ArrowTopLeftIcon,borderRadiusTopRight:u.ArrowTopRightIcon,borderRadiusBottomRight:u.ArrowBottomRightIcon,borderRadiusBottomLeft:u.ArrowBottomLeftIcon,divideXWidth:u.WidthIcon,divideYWidth:u.HeightIcon,scale:u.BorderAllIcon,scaleX:u.WidthIcon,scaleY:u.HeightIcon,skewX:u.WidthIcon,skewY:u.HeightIcon,translateX:u.WidthIcon,translateY:u.HeightIcon,padding:u.BorderAllIcon,paddingX:u.WidthIcon,paddingY:u.HeightIcon,paddingTop:u.ArrowUpIcon,paddingRight:u.ArrowRightIcon,paddingBottom:u.ArrowDownIcon,paddingLeft:u.ArrowLeftIcon,margin:u.BorderAllIcon,marginX:u.WidthIcon,marginY:u.HeightIcon,marginTop:u.ArrowUpIcon,marginRight:u.ArrowRightIcon,marginBottom:u.ArrowDownIcon,marginLeft:u.ArrowLeftIcon,textLeft:u.AlignLeftIcon,textCenter:u.AlignCenterHorizontallyIcon,textRight:u.AlignRightIcon,textJustify:u.StretchHorizontallyIcon,italic:u.FontItalicIcon,underline:u.UnderlineIcon,overline:u.OverlineIcon,uppercase:u.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":u.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:u.Cross1Icon},O=c.createContext({canReset:!1,canChange:!0}),Ie=({children:r,canReset:l=!1,canChange:s=!0})=>e.jsxRuntimeExports.jsx(O.Provider,{value:{canReset:l,canChange:s},children:r}),le=({label:r,property:l,onChange:s})=>{const i=c.useMemo(()=>t.get(P.CLASSES_LIST,`${l}.classes`,[""]),[l]),o=q(l),a=c.useMemo(()=>t.get(o,"cls",""),[o]),{canChange:d}=c.useContext(O),p=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:r?"w-full rounded ":"grow",children:p?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(he.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(z,{rounded:r,onChange:n=>s(n,l),selected:a,options:i,disabled:!d})})};function z({selected:r,onChange:l,rounded:s=!1,options:i,disabled:o=!1}){const a=r.replace(/.*:/g,"").trim(),{undo:d,redo:p}=v.useCanvasHistory();return e.jsxRuntimeExports.jsxs("select",{disabled:!i.length||o,className:`${s?"rounded-md border border-border":"border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:n=>l(n.target.value),onKeyDown:n=>{n.ctrlKey&&(n.key==="z"&&d(),n.key==="y"&&p())},value:a,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),c.Children.toArray(i.map(n=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:n,children:n})))]})}const Ae=({property:r,onChange:l})=>{const{canReset:s,canChange:i}=c.useContext(O),o=q(r),a=c.useMemo(()=>t.get(o,"cls",""),[o]),d=c.useMemo(()=>t.get(P.CLASSES_LIST,`${r}.classes`,[""]),[r]),p=d.indexOf(a)>-1?d.indexOf(a):0,n=/\[.*\]/g.test(a);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:n?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:a}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!i&&(!s||p-1<0),onClick:()=>l(t.nth(d,p-1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.MinusIcon,{className:!i&&(!s||p-1<0)?"text-gray-500":"text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(le,{label:!1,property:r,onChange:l})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!i&&(!s||p+1>=d.length),onClick:()=>l(t.nth(d,p+1),r),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(u.PlusIcon,{className:!i&&(!s||p+1>=d.length)?"text-gray-500":"text-white/60"})})})]})})},Be=({property:r,onChange:l})=>{const s=c.useMemo(()=>t.get(P.CLASSES_LIST,`${r}.classes`,[""]),[r]),{canChange:i}=c.useContext(O),o=q(r),a=c.useMemo(()=>t.get(o,"cls",""),[o]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(s,d=>e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!i,onClick:()=>l(d,r),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${a===d?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:c.createElement(t.get(ne,d,u.BoxIcon))})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:t.startCase(t.toLower(d))})]}))})},He={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Ve=({property:r,onChange:l})=>{const s=q(r),i=c.useMemo(()=>t.get(s,"cls",""),[s]),{canChange:o}=c.useContext(O),[a,d]=c.useState([]),[p,n]=c.useState({color:"",shade:""}),m=i.split("-"),g=t.get(m,"1",""),x=t.get(m,"2",""),b=c.useCallback(f=>{["current","inherit","transparent","black","white"].includes(f)?(d([]),n({color:f})):(d(["50","100","200","300","400","500","600","700","800","900"]),n(R=>({...R,color:f,shade:R.shade?R.shade:"500"})))},[d,n]);c.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(g))return d([]);d(["50","100","200","300","400","500","600","700","800","900"])},[g]);const h=c.useCallback(f=>{n({color:g,shade:f})},[g]);return c.useEffect(()=>{n({color:"",shade:""})},[s]),c.useEffect(()=>{const R=`${t.get(He,r,"")}-${p.color}${p.shade?`-${p.shade}`:""}`;R.match(new RegExp(t.get(P.CLASSES_LIST,`${r}.regExp`,"")))&&l(R,r)},[p,l,r]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(z,{disabled:!o,rounded:!0,selected:g,onChange:b,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(z,{rounded:!0,selected:x,disabled:!g||!o,onChange:h,options:a})})]})},ee=(r,l)=>{r=r.toLowerCase();let s=r.trim().replace(/ |\+/g,"");if((s==="auto"||s==="none")&&l.includes(s))return{value:"",unit:s};const i=l.length?new RegExp(l.join("|"),"g"):/XXXXXX/g;s=s.replace(i,"");const o=r.match(i),a=o&&o.length>1,d=!t.isEmpty(s)&&Number.isNaN(Number(s));return a||d?{error:"Invalid value"}:o&&(o[0]==="auto"||o[0]==="none")?{value:o[0],unit:""}:{value:s,unit:o?o[0]:""}},De=r=>{const l=r.startsWith("-")?"-":"",s=r.split("-").pop();if(["auto","none"].includes(s))return{value:"",unit:s};if(s==="px")return{value:"1",unit:"px"};if(s==="screen")return{value:"100",unit:r.indexOf("w-")!==-1?"vw":"vh"};if(s==="full")return{value:"100",unit:"%"};if(t.includes(r,"skew-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"rotate-"))return{value:`${l}${s}`,unit:"deg"};if(t.includes(r,"opacity-"))return{value:`${s/100}`,unit:"-"};if(t.includes(r,"duration-")||t.includes(r,"delay-"))return{value:`${s}`,unit:"ms"};if(t.includes(r,"translate-")&&!s.includes("/"))return{value:`${l}${`${s/4}`}`,unit:"rem"};if(t.includes(r,"scale-"))return{value:`${l}${`${s/100}`}`,unit:"-"};if(t.startsWith(r,"border")){const i=r.match(/border-?(x|y|t|r|b|l)?\d+/g);if(i)return{value:i[0].split("-").pop(),unit:"px"};if(r.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(r,"max-w-")){if(r==="max-w-screen-sm")return{value:"640",unit:"px"};if(r==="max-w-screen-md")return{value:"768",unit:"px"};if(r==="max-w-screen-lg")return{value:"1024",unit:"px"};if(r==="max-w-screen-xl")return{value:"1280",unit:"px"};if(r==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(s==="xs")return{value:"320",unit:"px"};if(s==="sm")return{value:"384",unit:"px"};if(s==="md")return{value:"448",unit:"px"};if(s==="lg")return{value:"512",unit:"px"};if(s==="xl")return{value:"576",unit:"px"};if(s==="2xl")return{value:"672",unit:"px"};if(s==="3xl")return{value:"768",unit:"px"};if(s==="4xl")return{value:"896",unit:"px"};if(s==="5xl")return{value:"1024",unit:"px"};if(s==="6xl")return{value:"1152",unit:"px"};if(s==="7xl")return{value:"1280",unit:"px"};if(s==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(r,"text-")){if(s==="xs")return{value:"12",unit:"px"};if(s==="sm")return{value:"14",unit:"px"};if(s==="base")return{value:"16",unit:"px"};if(s==="lg")return{value:"18",unit:"px"};if(s==="xl")return{value:"20",unit:"px"};if(s==="2xl")return{value:"24",unit:"px"};if(s==="3xl")return{value:"30",unit:"px"};if(s==="4xl")return{value:"36",unit:"px"};if(s==="5xl")return{value:"48",unit:"px"};if(s==="6xl")return{value:"60",unit:"px"};if(s==="7xl")return{value:"72",unit:"px"};if(s==="8xl")return{value:"96",unit:"px"};if(s==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(r,"leading-")){if(s==="none")return{value:"1",unit:"-"};if(s==="tight")return{value:"1.25",unit:"-"};if(s==="snug")return{value:"1.375",unit:"-"};if(s==="normal")return{value:"1.5",unit:"-"};if(s==="relaxed")return{value:"1.625",unit:"-"};if(s==="loose")return{value:"2",unit:"-"}}if(t.startsWith(r,"tracking-")){if(s==="tighter")return{value:"-0.05",unit:"em"};if(s==="tight")return{value:"-0.025",unit:"em"};if(s==="normal")return{value:"0",unit:"em"};if(s==="wide")return{value:"0.025",unit:"em"};if(s==="wider")return{value:"0.05",unit:"em"};if(s==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(s))return{value:r,unit:"class"};if(s.includes("/")){const[i,o]=t.map(s.split("/"),a=>parseInt(a,10));return{value:l+(i/o*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(s))?{value:`${l+parseFloat(s)*4}`,unit:"px"}:{value:s,unit:"class"}},Le=r=>{if(t.isEmpty(r))return{value:"",unit:""};const l=r.match(/\[.*\]/g);if(l===null)return $e(r);const s=t.get(l,"0","").replace(/\[|\]/g,""),i=r.startsWith("-")?"-":"",o=t.first(s.match(/\d+.\d+|\d+/g));return{value:`${i}${o}`,unit:s.replace(o,"")}},$e=r=>t.isEmpty(r)?{value:"",unit:""}:De(r),ie=c.createContext({setDragData:()=>{}}),Pe=({unit:r,currentValue:l,onDrag:s,onDragEnd:i,onDragStart:o,negative:a,cssProperty:d})=>{const{setDragData:p}=c.useContext(ie);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:n=>{const m={onDrag:s,onDragEnd:i,dragging:!0,dragStartY:n.pageY,dragStartValue:`${l}`,dragUnit:r,negative:a,cssProperty:d};o(m),p(m)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(u.RowSpacingIcon,{})})},Me=({onSelect:r,current:l,units:s})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:s.map(i=>e.jsxRuntimeExports.jsx(w.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:l===i?"primary":void 0,size:"sm",onClick:o=>{o.stopPropagation(),r(i)},children:i},i))}),Oe=r=>{const[l,s]=c.useState(!1),[i,o]=c.useState(""),{currentClass:a,onChange:d,classPrefix:p,cssProperty:n,units:m,negative:g}=r,[x,b]=c.useState(n!=null&&n.toLowerCase().includes("width")?"%":m[0]),[h,f]=c.useState(!1),[R,H]=c.useState(""),[I,j]=c.useState(!1),[C,A]=c.useState(!1);c.useEffect(()=>{const{value:y,unit:E}=Le(a);if(E===""){o(y),b(n!=null&&n.toLowerCase().includes("width")?"%":m[0]);return}b(E),o(E==="class"||t.isEmpty(y)?"":y)},[a,n,m]);const S=Y.useThrottledCallback(y=>{d(y)},[d],200),V=Y.useThrottledCallback(y=>{d(y,!1)},[d],200),L=c.useCallback((y=!1)=>{const E=ee(`${i}`,m);if(t.get(E,"error",!1)){f(!0);return}const N=t.get(E,"unit")!==""?t.get(E,"unit"):x;if(N==="auto"||N==="none"){S(`${p}${N}`);return}if(t.get(E,"value")==="")return;const M=`${t.get(E,"value","").startsWith("-")?"-":""}${p}[${t.get(E,"value","").replace("-","")}${N==="-"?"":N}]`;y?V(M):S(M)},[S,V,i,x,p,m]),_=c.useCallback(y=>{const E=ee(`${i}`,m);if(t.get(E,"error",!1)){f(!0);return}if(y==="auto"||y==="none"){S(`${p}${y}`);return}if(t.get(E,"value")==="")return;const N=t.get(E,"unit")!==""?t.get(E,"unit"):y,M=`${t.get(E,"value","").startsWith("-")?"-":""}${p}[${t.get(E,"value","").replace("-","")}${N==="-"?"":N}]`;S(M)},[S,i,p,m]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:x==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:a}),e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${I?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(x)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:x==="class",onKeyPress:y=>{y.key==="Enter"&&L()},onKeyDown:y=>{if(y.keyCode!==38&&y.keyCode!==40)return;y.preventDefault(),A(!0);const E=t.parseInt(y.target.value);let N=t.isNaN(E)?0:E;y.keyCode===38&&(N+=1),y.keyCode===40&&(N-=1);const D=`${N}`,ue=`${D.startsWith("-")?"-":""}${p}[${D.replace("-","")}${x==="-"?"":x}]`;V(ue)},onKeyUp:y=>{C&&(y.preventDefault(),A(!1))},onBlur:()=>L(),onChange:y=>{f(!1),o(y.target.value)},onClick:y=>{var E;(E=y==null?void 0:y.target)==null||E.select(),s(!1)},value:I?R:i,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",h?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(w.Tooltip,{open:l,delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>s(!l),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${m.length===1?"px-2 font-semibold":""}`,children:x}),m.length>1?e.jsxRuntimeExports.jsx(u.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(w.TooltipPortal,{children:e.jsxRuntimeExports.jsx(w.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Me,{units:m,current:x,onSelect:y=>{s(!1),b(y),_(y)}})})})]})]}),["none","auto"].indexOf(x)!==-1||I?null:e.jsxRuntimeExports.jsx(Pe,{onDragStart:()=>j(!0),onDragEnd:y=>{if(H(()=>""),j(!1),t.isEmpty(y))return;const E=`${y}`,D=`${E.startsWith("-")?"-":""}${p}[${E.replace("-","")}${x==="-"?"":x}]`;S(D)},onDrag:y=>{if(t.isEmpty(y))return;H(y);const E=`${y}`,D=`${E.startsWith("-")?"-":""}${p}[${E.replace("-","")}${x==="-"?"":x}]`;V(D)},currentValue:i,unit:x,negative:g,cssProperty:n})]})})})},q=r=>{const l=v.useSelectedBlockCurrentClasses();return t.findLast(l,{property:r})},qe=(r,l)=>{const s={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return s[t.get(r,"mq","xs")]<=s[l]},_e={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},We=r=>`${r.toUpperCase()} ${te[r]?`(${te[r]} & up)`:""}`,G=r=>{const{type:l="icons",label:s,property:i,onEmitChange:o=()=>{},units:a,negative:d=!1}=r,[p]=v.useDarkMode(),[n]=v.useStylingState(),[,m]=v.useCanvasWidth(),g=q(i),x=v.useAddClassesToBlocks(),b=v.useRemoveClassesFromBlocks(),[h]=v.useSelectedBlockIds(),f=c.useMemo(()=>t.get(g,"fullCls",""),[g]),R=c.useCallback((S,V=!0)=>{const L={dark:p,mq:m,mod:n,cls:S,property:i,fullCls:""};(p||n!=="")&&(L.mq="xs");const _=P.generateFullClsName(L);x(h,[_],V)},[h,p,m,n,i,x]),H=c.useCallback(()=>{b(h,[f])},[h,f,b]),I=c.useMemo(()=>qe(g,m),[g,m]);c.useEffect(()=>{o(I,g)},[I,o,g]);const[,,j]=v.useCanvasWidth(),C=c.useCallback(S=>{j({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[S])},[j]),A=t.get(g,"dark",null)===p&&t.get(g,"mod",null)===n&&t.get(g,"mq",null)===m;return e.jsxRuntimeExports.jsx(Ie,{canChange:I,canReset:g&&A,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${g&&!A?"text-foreground":""}`,children:s})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[l==="arbitrary"?e.jsxRuntimeExports.jsx(Oe,{currentClass:t.get(g,"cls",""),classPrefix:t.get(_e,i,""),units:a||[],onChange:R,negative:d,cssProperty:i}):null,l==="icons"&&e.jsxRuntimeExports.jsx(Be,{property:i,onChange:R}),l==="range"&&e.jsxRuntimeExports.jsx(Ae,{property:i,onChange:R}),l==="color"&&e.jsxRuntimeExports.jsx(Ve,{property:i,onChange:R}),l==="dropdown"&&e.jsxRuntimeExports.jsx(le,{label:s,property:i,onChange:R})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${f?"visible":"invisible"}`,children:A?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>H(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(u.TrashIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):I&&g?e.jsxRuntimeExports.jsxs(w.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(u.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold ",children:[We(t.get(g,"mq")),p&&!g.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>C(t.get(g,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(g,"mq").toUpperCase()]})]})})})]}):null})]})]})})},Fe=["px","%","em","rem","ch","vh","vw"],ae=({label:r,options:l,borderB:s=!1,borderT:i=!1,type:o="arbitrary",units:a=Fe,negative:d=!1})=>{const[p,n]=c.useState(l[0].key),m=v.useSelectedBlockCurrentClasses(),g=c.useCallback(x=>t.map(m,"property").includes(x),[m]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${s?"border-b":""} ${i?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[r&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:r}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:c.Children.toArray(l.map(({label:x,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(w.Tooltip,{children:[e.jsxRuntimeExports.jsx(w.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>n(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===p?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[c.createElement("div",{className:g(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),c.createElement(t.get(ne,b,u.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(w.TooltipContent,{children:t.startCase(t.toLower(x))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(G,{type:o,units:[...a],label:"",property:p,negative:d})})]})},Xe=({heading:r,items:l})=>{const s=v.useSelectedBlockCurrentClasses(),i=c.useMemo(()=>{const o=p=>t.flatten(p.map(n=>n.styleType==="multiple"?t.map(n.options,"key"):n.property)),a=t.flatten(l.map(p=>p.styleType==="accordion"?o(p.items):p.styleType==="multiple"?t.map(p.options,"key"):p.property)),d=t.map(s,"property");return t.intersection(a,d).length>0},[s,l]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r,i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:l.map(o=>o.styleType==="multiple"?e.jsxRuntimeExports.jsx(ae,{...o},o.label):e.jsxRuntimeExports.jsx(G,{...o},o.label))})]})},Ye=c.createContext({}),X=({section:r})=>{const l=v.useSelectedBlockCurrentClasses(),s=c.useCallback((a=[])=>{const d={};for(let n=0;n<l.length;n++)d[l[n].property]=l[n].cls;let p=!0;for(const n in a)if(!t.has(d,n)||d[n]!==a[n]){p=!1;break}return p},[l]),i=c.useMemo(()=>{if(l.length>0&&r.heading==="Classes")return!0;const a=n=>t.flatten(n.map(m=>m.styleType==="multiple"?t.flatten(t.map(m.options,"key")):m.property)),d=t.flatten(r.items.map(n=>n.styleType==="accordion"?a(n.items):n.styleType==="multiple"?t.flatten(t.map(n.options,"key")):n.property)),p=t.map(l,"property");return t.intersection(d,p).length>0},[l,r.heading,r.items]),o=c.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(Ye.Provider,{value:o,children:e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),r.heading]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:c.Children.toArray(r.items.map(a=>t.has(a,"component")?c.createElement(a.component,{key:a.label}):t.has(a,"styleType")?a.styleType==="multiple"?e.jsxRuntimeExports.jsx(ae,{...a},a.label):a.styleType==="accordion"&&s(a==null?void 0:a.conditions)?e.jsxRuntimeExports.jsx(Xe,{...a},a.label):null:e.jsxRuntimeExports.jsx(G,{...a},a.label)))})]})})},Ze=({item:r,index:l,canDelete:s,onChange:i,onRemove:o})=>e.jsxRuntimeExports.jsxs("div",{className:`flex flex-col gap-1 border-gray-400 py-2 ${s?"border-b":""}`,children:[e.jsxRuntimeExports.jsx("input",{name:"key",onChange:a=>i(a,l),value:r.key,placeholder:"Key",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-1.5",children:[e.jsxRuntimeExports.jsx("input",{name:"value",onChange:a=>t.isEmpty(r.key)?{}:i(a,l),value:r.value,placeholder:"Value",className:"w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",autoComplete:"off",autoCapitalize:"off"}),e.jsxRuntimeExports.jsx(u.TrashIcon,{onClick:o,className:"h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"})]})]}),ze=({section:r})=>{var b;const{setSyncState:l}=v.useSavePage(),s=v.useSelectedBlock(),[i,o]=c.useState([]),[a]=v.useSelectedStylingBlocks(),d=v.useUpdateBlocksPropsRealtime(),p=`${t.get(a,"0.prop")}_attrs`;F.useEffect(()=>{const h=t.map(t.get(s,p),(f,R)=>({key:R,value:f}));t.isEmpty(h)?o([]):o(h)},[t.get(s,p)]);const n=()=>o([...i,{key:"",value:""}]),m=h=>{const f=t.filter(i,(R,H)=>h!==H);x(f)},g=(h,f)=>{const R=[...i];R[f][h.target.name]=h.target.value,x(R)},x=F.useCallback((h=[])=>{const f={};t.forEach(h,R=>{t.isEmpty(R.key)||t.set(f,R.key,R.value)}),d([t.get(s,"_id")],{[p]:f}),l("UNSAVED")},[s,l,d,p]);return e.jsxRuntimeExports.jsxs(T.AccordionItem,{value:r.heading,children:[e.jsxRuntimeExports.jsx(T.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,p))?"bg-gray-300":"bg-blue-500"}`}),"Attributes"]})}),e.jsxRuntimeExports.jsx(T.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px",children:[e.jsxRuntimeExports.jsxs(U.Label,{className:"mt-2 flex w-full items-center justify-between",children:["Add Custom attributes",e.jsxRuntimeExports.jsxs("div",{className:`flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!t.isEmpty(i)&&t.isEmpty((b=t.last(i))==null?void 0:b.key)?"cursor-not-allowed border-gray-400 text-gray-400":"cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,onClick:()=>{var h;!t.isEmpty(i)&&t.isEmpty((h=t.last(i))==null?void 0:h.key)||n()},children:[e.jsxRuntimeExports.jsx(u.PlusIcon,{width:12,height:12})," Add"]})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[t.isEmpty(i)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-12 items-center justify-center text-sm text-gray-400",children:"Click + Add to add attributes"}),F.Children.toArray(t.map(i,(h,f)=>{const R=i.length>0&&f<i.length-1;return e.jsxRuntimeExports.jsx(Ze,{item:h,index:f,canDelete:R,onChange:g,onRemove:()=>m(f)})}))]})]})})]})};function Ue(){const[r,l]=v.useStylingState(),{flexChild:s,gridChild:i}=v.useSelectedBlocksDisplayChild(),[,o]=xe.useAtom(v.advanceStylingOpenAtom),{t:a}=se.useTranslation(),[d]=v.useSelectedStylingBlocks();return t.isEmpty(d)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:a("no_styling_block_selected")}),e.jsxRuntimeExports.jsxs("p",{className:"text-xs ",children:["Hint: Styling allowed blocks are highlighted with"," ",e.jsxRuntimeExports.jsx("span",{className:"border border-orange-500 p-px",children:"orange"})," border"]})]})}):e.jsxRuntimeExports.jsxs("div",{onClick:()=>o(!1),className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx("div",{className:"flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(U.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(k.Select,{defaultValue:r,onValueChange:p=>l(p),children:[e.jsxRuntimeExports.jsx(k.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(k.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(k.SelectContent,{children:[e.jsxRuntimeExports.jsx(k.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(k.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),e.jsxRuntimeExports.jsxs(ye.ScrollArea,{className:"no-scrollbar -mx-1 h-full overflow-x-hidden",children:[e.jsxRuntimeExports.jsxs(T.Accordion,{type:"multiple",className:"h-full w-full",children:[s&&e.jsxRuntimeExports.jsx(X,{section:Se}),i?e.jsxRuntimeExports.jsx(X,{section:Ne}):null,Te.map(p=>e.jsxRuntimeExports.jsx(X,{section:p},p.heading)),e.jsxRuntimeExports.jsx(ze,{section:{heading:"Attributes"}})]}),e.jsxRuntimeExports.jsx("div",{className:"h-60"})]})]})}const Ge={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Ke=()=>{const r=v.useSelectedBlock(),{t:l}=se.useTranslation(),[s,i]=c.useState(""),[o,a]=c.useState({onDrag:n=>n,onDragEnd:n=>n,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),d=Y.useThrottledCallback(n=>{const m=!t.get(o,"negative",!1),g=t.get(o,"cssProperty","");let x=parseFloat(o.dragStartValue);x=t.isNaN(x)?0:x;let b=Ge[o.dragUnit];(t.startsWith(g,"scale")||g==="opacity")&&(b=10);let f=(o.dragStartY-n.pageY)/b+x;m&&f<0&&(f=0),g==="opacity"&&f>1&&(f=1),o.onDrag(`${f}`),i(`${f}`)},[o],50),p=c.useCallback(()=>{setTimeout(()=>o.onDragEnd(`${s}`),100),a({onDrag:n=>n,onDragEnd:n=>n,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[o,s,a]);return t.isNull(r)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(u.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:l("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsxs(ie.Provider,{value:{setDragData:a},children:[o.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:d,onMouseUp:()=>p(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "}):null,e.jsxRuntimeExports.jsxs($.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs($.TabsList,{className:"mx-1 grid grid-cols-2",children:[e.jsxRuntimeExports.jsx($.TabsTrigger,{value:"settings",children:"Settings"}),e.jsxRuntimeExports.jsx($.TabsTrigger,{value:"styling",children:"Styling"})]}),e.jsxRuntimeExports.jsx($.TabsContent,{value:"settings",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ce,{})}),e.jsxRuntimeExports.jsx($.TabsContent,{value:"styling",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Ue,{})})]})]})};exports.default=Ke;
|
|
@@ -5,7 +5,7 @@ import { useAtom as N } from "jotai";
|
|
|
5
5
|
import { filter as y, map as w, isNull as H, isEmpty as M, find as O, each as _, get as F } from "lodash";
|
|
6
6
|
import { B as u, u as k, S as P } from "./useBuilderProp-81a14920.js";
|
|
7
7
|
import { T as R, a as J, b as D, c as S } from "./tabs-85caa1e8.js";
|
|
8
|
-
import { u as U, p as $, a as q, b as G } from "./index-
|
|
8
|
+
import { u as U, p as $, a as q, b as G } from "./index-397e45a0.js";
|
|
9
9
|
import "react-i18next";
|
|
10
10
|
import { c as Q } from "./utils-ac68b2c8.js";
|
|
11
11
|
import { ListTreeIcon as T, DatabaseIcon as W } from "lucide-react";
|
|
@@ -101,7 +101,7 @@ const xe = ({ provider: a, onClose: x }) => {
|
|
|
101
101
|
/* @__PURE__ */ e.jsx(xe, { onClose: () => o(null), provider: h })
|
|
102
102
|
] })
|
|
103
103
|
] });
|
|
104
|
-
}, A = C(() => import("./Layers-
|
|
104
|
+
}, A = C(() => import("./Layers-c429fafe.js")), ue = C(() => import("./BrandingOptions-a95cba65.js")), fe = C(() => import("./ImagesPanel-38c44785.js"));
|
|
105
105
|
let z = null;
|
|
106
106
|
const ls = () => {
|
|
107
107
|
const a = k("sideBarComponents.top", []), x = k("sideBarComponents.bottom", []), [l, n] = N(q), [t, c] = m(l), [i, f] = m(null), h = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),S=require("@radix-ui/react-icons"),t=require("react"),C=require("jotai"),l=require("lodash"),a=require("./useBuilderProp-5e57d0c8.cjs"),j=require("./tabs-860e37aa.cjs"),g=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),S=require("@radix-ui/react-icons"),t=require("react"),C=require("jotai"),l=require("lodash"),a=require("./useBuilderProp-5e57d0c8.cjs"),j=require("./tabs-860e37aa.cjs"),g=require("./index-2bda0975.cjs");require("react-i18next");const T=require("./utils-3c452dd0.cjs"),N=require("lucide-react"),D=require("@chaibuilder/blocks"),E=require("./dialog-170eaad9.cjs"),y=require("./card-14e1d020.cjs"),p=require("./select-0e32300c.cjs"),A=require("react-json-view");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("@radix-ui/react-tabs");require("./_commonjsHelpers-87b0abe8.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("sonner");require("tailwind-merge");require("@radix-ui/react-dialog");require("@radix-ui/react-select");const z=({provider:r,onClose:h})=>{const[i,c]=t.useState(null);return t.useEffect(()=>{r&&(r.mockFn?r.mockFn:r.dataFn)().then(m=>c(m))},[r]),r?e.jsxRuntimeExports.jsx(E.Dialog,{onOpenChange:o=>o?"":h(),defaultOpen:!0,children:e.jsxRuntimeExports.jsxs(E.DialogContent,{children:[e.jsxRuntimeExports.jsxs(E.DialogHeader,{children:[e.jsxRuntimeExports.jsxs(E.DialogTitle,{children:["Data Provider: ",r.name]}),e.jsxRuntimeExports.jsx(E.DialogDescription,{children:r.description})]}),e.jsxRuntimeExports.jsx(A,{name:r.providerKey,enableClipboard:!1,displayObjectSize:!1,displayDataTypes:!1,src:i})]})}):null},B=()=>{const r=t.useMemo(()=>D.getChaiDataProviders(),[]),[h,i]=g.usePageDataProviders(),[,c]=C.useAtom(g.pageSyncStateAtom),[o,m]=t.useState(l.filter(r,s=>l.map(h,"providerKey").includes(s.providerKey))),[x,R]=t.useState(""),[f,u]=t.useState(null),b=l.filter(r.map(s=>l.map(o,"providerKey").includes(s.providerKey)?null:{value:s.providerKey,label:s.name}),s=>!l.isNull(s)),n=()=>{const s=l.find(r,{providerKey:x});m(d=>[...d,s]),i(d=>[...d,{providerKey:s.providerKey,args:{}}]),R(""),c("UNSAVED")},v=s=>{m(d=>l.filter(d,q=>q.providerKey!==s.providerKey)),i(d=>l.filter(d,q=>q.providerKey!==s.providerKey)),c("UNSAVED")},k=s=>u(s);return e.jsxRuntimeExports.jsxs("div",{className:"px-1",children:[e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("label",{children:e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Add data providers:"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxRuntimeExports.jsxs(p.Select,{value:x,onValueChange:s=>R(s),children:[e.jsxRuntimeExports.jsx(p.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(p.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(p.SelectContent,{children:[e.jsxRuntimeExports.jsx(p.SelectItem,{value:"",children:"Choose"}),b.map(s=>e.jsxRuntimeExports.jsx(p.SelectItem,{value:s.value,children:s.label},s.value))]})]}),e.jsxRuntimeExports.jsx(a.Button,{onClick:n,disabled:l.isEmpty(x),variant:"destructive",children:"+"})]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("div",{className:o.length?"block":"hidden",children:[e.jsxRuntimeExports.jsx("hr",{}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("p",{className:"text-gray-500 mb-1.5 text-xs",children:"Page data providers:"}),o.map(s=>e.jsxRuntimeExports.jsx(y.Card,{className:"mt-2 rounded-md",children:e.jsxRuntimeExports.jsxs(y.CardHeader,{className:"p-2",children:[e.jsxRuntimeExports.jsx(y.CardTitle,{children:s.name}),e.jsxRuntimeExports.jsx(y.CardDescription,{children:s.description}),e.jsxRuntimeExports.jsx("button",{onClick:()=>k(s),className:"text-left text-xs text-blue-500",children:"view data"}),e.jsxRuntimeExports.jsx("button",{onClick:()=>v(s),className:"text-left text-xs text-red-500",children:"remove"})]})})),e.jsxRuntimeExports.jsx(z,{onClose:()=>u(null),provider:f})]})]})},w=t.lazy(()=>Promise.resolve().then(()=>require("./Layers-7d1616f9.cjs"))),K=t.lazy(()=>Promise.resolve().then(()=>require("./BrandingOptions-c2922757.cjs"))),I=t.lazy(()=>Promise.resolve().then(()=>require("./ImagesPanel-0db5c72f.cjs")));let P=null;const L=()=>{const r=a.useBuilderProp("sideBarComponents.top",[]),h=a.useBuilderProp("sideBarComponents.bottom",[]),[i,c]=C.useAtom(g.activePanelAtom),[o,m]=t.useState(i),[x,R]=t.useState(null),f={layers:w,"branding-options":K,images:I};l.each(r,({name:n,panel:v})=>{f[n]=v});const u=n=>{clearTimeout(P),b(!1),i!=="layers"&&n==="layers"?P=setTimeout(()=>m("layers"),500):m(n),c(n)},[,b]=C.useAtom(g.addBlocksModalAtom);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex",children:[e.jsxRuntimeExports.jsxs("div",{className:"z-[100] flex h-full w-fit flex-col items-center justify-between border-b border-r border-border bg-background pt-2",children:[e.jsxRuntimeExports.jsxs("div",{className:"relative z-[100] flex w-14 flex-col items-center space-y-2",children:[e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>{b(!0),c("layers")},size:"sm",variant:i==="add-blocks"?"default":"outline",children:e.jsxRuntimeExports.jsx(S.PlusIcon,{className:"text-xl"})}),e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u("layers"),size:"sm",variant:i==="layers"?"default":"outline",children:e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"w-4"})}),e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u("branding-options"),size:"sm",variant:i==="branding-options"?"default":"outline",children:e.jsxRuntimeExports.jsx(S.Half2Icon,{className:"w-4 max-w-[40px] text-xs"})}),t.Children.toArray(r.map(({name:n,icon:v})=>e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsx(a.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(a.Button,{onClick:()=>u(n),size:"sm",className:"w-10",variant:i===n?"default":"outline",children:e.jsxRuntimeExports.jsx(v,{})})})))]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col items-center space-y-2",children:t.Children.toArray(h.map(n=>e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsx(a.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})]}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{u("layers")},className:"absolute inset-0 right-0 z-50 w-screen bg-black/20"+(i==="layers"?" hidden":"")}),e.jsxRuntimeExports.jsx("div",{className:`fixed left-14 z-[50] h-full w-96 border-r bg-background duration-500 ease-in-out ${i!=="layers"?"translate-x-0":"-translate-x-full"}`,children:e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 bg-white p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsx("div",{className:T.cn("relative h-full max-h-[93%] bg-background p-1",i==="layers"?"":"z-[100]"),onMouseEnter:()=>{x&&clearTimeout(x)},onMouseLeave:()=>{const n=setTimeout(()=>{x&&(u("layers"),clearTimeout(x))},1e3);R(n)},children:t.createElement(l.get(f,o,()=>e.jsxRuntimeExports.jsx("div",{})))})})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-60 border-r p-1",children:e.jsxRuntimeExports.jsx(t.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-2 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"h-6 w-1/2 bg-gray-300"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"}),e.jsxRuntimeExports.jsx("div",{className:"h-16 w-full bg-gray-200"})]}),children:e.jsxRuntimeExports.jsxs(j.Tabs,{defaultValue:"layers",className:"flex h-full w-full flex-col py-1",children:[e.jsxRuntimeExports.jsxs(j.TabsList,{className:"mx-1 h-10 grid grid-cols-2",children:[e.jsxRuntimeExports.jsxs(j.TabsTrigger,{value:"layers",children:[e.jsxRuntimeExports.jsx(N.ListTreeIcon,{className:"h-3 mr-2"})," Layers"]}),e.jsxRuntimeExports.jsxs(j.TabsTrigger,{value:"data-provider",children:[e.jsxRuntimeExports.jsx(N.DatabaseIcon,{className:"w-3 mr-2"}),"Data"]})]}),e.jsxRuntimeExports.jsx(j.TabsContent,{value:"layers",className:"no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",children:t.createElement(w)}),e.jsxRuntimeExports.jsx(j.TabsContent,{value:"data-provider",className:"flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(B,{})})]})})})]})};exports.default=L;
|
|
@@ -5,7 +5,7 @@ import { S as x, c as d, b as h, d as u, a as g, e as j, f as t } from "./select
|
|
|
5
5
|
import { u as i, d as f, e as v, f as S, S as c } from "./useBuilderProp-81a14920.js";
|
|
6
6
|
import { S as b } from "./separator-a80d065b.js";
|
|
7
7
|
import { T as N } from "./toggle-00c9d11e.js";
|
|
8
|
-
import { c as C } from "./index-
|
|
8
|
+
import { c as C } from "./index-397e45a0.js";
|
|
9
9
|
import { useTranslation as w } from "react-i18next";
|
|
10
10
|
import "@radix-ui/react-select";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),l=require("@radix-ui/react-icons"),r=require("./select-0e32300c.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./separator-a597dba7.cjs"),a=require("./toggle-b90fed97.cjs"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),i=require("react"),l=require("@radix-ui/react-icons"),r=require("./select-0e32300c.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),o=require("./separator-a597dba7.cjs"),a=require("./toggle-b90fed97.cjs"),c=require("./index-2bda0975.cjs"),p=require("react-i18next");require("@radix-ui/react-select");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-separator");require("@radix-ui/react-toggle");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const m=()=>s.useBuilderProp("languages",["en"]),j=()=>m().length===1?null:e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(r.Select,{children:[e.jsxRuntimeExports.jsx(r.SelectTrigger,{className:"w-[150px] border-0",children:e.jsxRuntimeExports.jsx(r.SelectValue,{placeholder:e.jsxRuntimeExports.jsxs("span",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(l.FontFamilyIcon,{className:"h-4 w-4"})," English(US)"]})})}),e.jsxRuntimeExports.jsx(r.SelectContent,{children:e.jsxRuntimeExports.jsxs(r.SelectGroup,{children:[e.jsxRuntimeExports.jsx(r.SelectLabel,{children:"Fruits"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"apple",children:"Apple"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"banana",children:"Banana"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"blueberry",children:"Blueberry"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"grapes",children:"Grapes"}),e.jsxRuntimeExports.jsx(r.SelectItem,{value:"pineapple",children:"Pineapple"})]})})]})}),d=()=>{const{savePage:x,syncState:t}=c.useSavePage(),{t:u}=p.useTranslation(),n=i.useMemo(()=>{switch(t){case"SAVING":return"animate-pulse bg-gray-500 text-gray-900";case"SAVED":return"bg-green-500 text-white hover:bg-green-600 hover:text-white";default:return"bg-gray-200 text-gray-500 hover:bg-gray-100"}},[t]);return e.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(a.Toggle,{onClick:()=>x(),className:`flex h-auto w-20 items-center gap-x-1 rounded-full p-1 px-2 ${n}`,size:"sm",variant:"outline",children:[e.jsxRuntimeExports.jsx("svg",{fill:"currentColor",width:"16",height:"16",viewBox:"0 0 0.32 0.32",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M.274.086a.02.02 0 0 1 0 .028l-.12.12a.02.02 0 0 1-.028 0l-.06-.06A.02.02 0 0 1 .094.146L.14.192.246.086a.02.02 0 0 1 .028 0Z"})}),t==="SAVING"?"Saving...":t==="SAVED"?u("Saved"):"Save"]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:t==="SAVING"?"Saving...":t==="SAVED"?"Saved":"Save changes"})})]})})},h=()=>{const x=s.useBuilderProp("topBarComponents.left",[]),t=s.useBuilderProp("topBarComponents.center",[]),u=s.useBuilderProp("topBarComponents.right",[]);return e.jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between px-2",children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2 font-bold",children:i.Children.toArray(x.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))})}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center space-x-2",children:i.Children.toArray(t.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(j,{}),e.jsxRuntimeExports.jsx(o.Separator,{orientation:"vertical"}),e.jsxRuntimeExports.jsx(d,{}),i.Children.toArray(u.map(n=>e.jsxRuntimeExports.jsx(i.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-10"}),children:e.jsxRuntimeExports.jsx(n,{})})))]})]})};exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-5e57d0c8.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-99b51245.cjs"),f=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),g=require("react"),R=require("lodash"),x=require("./useBuilderProp-5e57d0c8.cjs"),a=require("./dialog-170eaad9.cjs"),q=require("@chaibuilder/blocks"),b=require("./form-99b51245.cjs"),f=require("./index-2bda0975.cjs");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-icons");require("@radix-ui/react-toast");require("jotai");require("@radix-ui/react-dialog");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./link-86ac8848.cjs");require("react-icons-picker");require("react-dom");require("./ImagesPanel-0db5c72f.cjs");require("./tabs-860e37aa.cjs");require("@radix-ui/react-tabs");require("react-quill");require("react-i18next");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("lucide-react");require("sonner");const E=({closeModal:i})=>{var l,o;const s=f.useAddPage(),[r,m]=g.useState({name:"",slug:"",blocks:[],type:"STATIC",seoData:{}}),p=()=>{s.mutate(r,{onSuccess:()=>i()})},j=({formData:u},t)=>{m(h=>{var d,c;const n={[t]:u[t]};return t==="name"?n.slug=R.kebabCase((d=u[t])==null?void 0:d.replace(/\d/g,"")):t==="slug"&&(n.slug=(c=u[t])==null?void 0:c.replace(/\d/g,"").replace(/\s+/g,"").replace("--","-").replace("__","_")),{...h,...n}})},P={name:q.SingleLineText({title:"Page Name",default:r.name}),slug:q.SingleLineText({title:"Page Slug",default:r.slug})};return e.jsxRuntimeExports.jsxs(a.DialogContent,{children:[e.jsxRuntimeExports.jsx("div",{className:"px-1 font-bold",children:"Add Page"}),e.jsxRuntimeExports.jsx(b.Form,{formData:r,properties:P,onChange:j,disabled:s.isPending}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-end",children:e.jsxRuntimeExports.jsx(x.Button,{type:"submit",disabled:!r.name||!r.slug||((l=r.name)==null?void 0:l.length)<2||((o=r.slug)==null?void 0:o.length)<2||s.isPending,onClick:p,children:"Add Page"})})]})},S=()=>{const[i,s]=g.useState(!1);return e.jsxRuntimeExports.jsxs(a.Dialog,{open:i,onOpenChange:()=>s(!i),children:[e.jsxRuntimeExports.jsx(a.DialogTrigger,{children:e.jsxRuntimeExports.jsx(x.Button,{size:"sm",variant:"link",className:"text-blue-500",onClick:()=>s(!i),children:"+ New Page"})}),i&&e.jsxRuntimeExports.jsx(E,{closeModal:()=>s(!i)})]})};exports.default=S;
|
|
@@ -5,7 +5,7 @@ import { B as c } from "./useBuilderProp-81a14920.js";
|
|
|
5
5
|
import { D as b, b as C, a as A } from "./dialog-3d4e82ed.js";
|
|
6
6
|
import { SingleLineText as d } from "@chaibuilder/blocks";
|
|
7
7
|
import { F as D } from "./form-725e3191.js";
|
|
8
|
-
import { a0 as N } from "./index-
|
|
8
|
+
import { a0 as N } from "./index-397e45a0.js";
|
|
9
9
|
import "@radix-ui/react-slot";
|
|
10
10
|
import "class-variance-authority";
|
|
11
11
|
import "./utils-ac68b2c8.js";
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2bda0975.cjs"),s=require("./useBuilderProp-5e57d0c8.cjs"),u=require("react-i18next");require("./jsx-runtime-5c3ac4f7.cjs");require("react");require("./_commonjsHelpers-87b0abe8.cjs");require("clsx");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("jotai");require("i18next");require("flagged");require("react-dnd");require("lodash");require("@minoru/react-dnd-treeview");require("./utils-3c452dd0.cjs");require("tailwind-merge");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("@radix-ui/react-icons");require("lucide-react");require("sonner");require("@radix-ui/react-slot");require("class-variance-authority");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiBuilderStudio=e.ChaiBuilderStudio;exports.useActiveLanguage=e.useActiveLanguage;exports.useActiveModal=e.useActiveModal;exports.useActivePanel=e.useActivePanel;exports.useAddBlock=e.useAddBlock;exports.useAddBlockParent=e.useAddBlockParent;exports.useAddClassesToBlocks=e.useAddClassesToBlocks;exports.useAllBlocks=e.useAllBlocks;exports.useBlockContentByLanguage=e.useBlockContentByLanguage;exports.useBrandingOptions=e.useBrandingOptions;exports.useBuilderReset=e.useBuilderReset;exports.useBuildingBlocks=e.useBuildingBlocks;exports.useCanvasHistory=e.useCanvasHistory;exports.useCanvasWidth=e.useCanvasWidth;exports.useCanvasZoom=e.useCanvasZoom;exports.useCopyBlockIds=e.useCopyBlockIds;exports.useCurrentPage=e.useCurrentPage$1;exports.useCutBlockIds=e.useCutBlockIds;exports.useDarkMode=e.useDarkMode;exports.useDeveloperPreviewMode=e.useDeveloperPreviewMode;exports.useDuplicateBlocks=e.useDuplicateBlocks;exports.useFeatureSupport=e.useFeatureSupport;exports.useGetPageData=e.useGetPageData;exports.useHiddenBlockIds=e.useHiddenBlockIds;exports.useHighlightBlockId=e.useHighlightBlockId;exports.useLanguages=e.useLanguages;exports.useMarkAsGlobalBlock=e.useMarkAsGlobalBlock;exports.useMoveBlocks=e.useMoveBlocks;exports.usePasteBlocks=e.usePasteBlocks;exports.usePreviewMode=e.usePreviewMode;exports.usePrimaryLanguage=e.usePrimaryLanguage;exports.useProject=e.useProject$1;exports.useReadOnlyMode=e.useReadOnlyMode;exports.useRemoveBlocks=e.useRemoveBlocks;exports.useRemoveClassesFromBlocks=e.useRemoveClassesFromBlocks;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useSelectedBlockAllClasses=e.useSelectedBlockAllClasses;exports.useSelectedBlockCurrentClasses=e.useSelectedBlockCurrentClasses;exports.useSelectedBlockIds=e.useSelectedBlockIds;exports.useSelectedBlocksDisplayChild=e.useSelectedBlocksDisplayChild;exports.useSelectedBreakpoints=e.useSelectedBreakpoints;exports.useSelectedStylingBlocks=e.useSelectedStylingBlocks;exports.useSetAllBlocks=e.useSetAllBlocks;exports.useStylingBreakpoint=e.useStylingBreakpoint;exports.useStylingState=e.useStylingState;exports.useTranslations=e.useTranslations;exports.useTreeData=e.useTreeData;exports.useUILibraryBlocks=e.useUILibraryBlocks;exports.useUpdateBlocksProps=e.useUpdateBlocksProps;exports.useUpdateBlocksPropsRealtime=e.useUpdateBlocksPropsRealtime;exports.useBuilderProp=s.useBuilderProp;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>u.useTranslation});
|
package/dist/core.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare type ChaiBlock = {
|
|
|
35
35
|
_parent?: string | null | undefined;
|
|
36
36
|
_bindings?: Record<string, string>;
|
|
37
37
|
readonly _type: string;
|
|
38
|
-
} & Record<string,
|
|
38
|
+
} & Record<string, any>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* ChaiBuilder is the main entry point for the Chai Builder Studio.
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a5 as b, ap as j, H as x, a8 as G, ak as O, W as U, al as w, K as F, B as W, ao as Z, z as q, a6 as z, a9 as E, d as K, f as N, l as V, o as J, aa as Q, n as X, e as Y, ab as _, m as $, k as ss, ac as es, V as as, A as os, an as ts, a1 as rs, ad as us, q as is, s as ls, am as ps, ae as ms, a7 as cs, t as ds, L as Bs, c as ks, D as ns, ag as gs, N as Cs, i as Ss, O as vs, g as Ps, j as As, h as ys, ah as hs, M as Ms, af as Ds, ai as Is, Z as Ls, aj as fs, G as Rs } from "./index-
|
|
1
|
+
import { a5 as b, ap as j, H as x, a8 as G, ak as O, W as U, al as w, K as F, B as W, ao as Z, z as q, a6 as z, a9 as E, d as K, f as N, l as V, o as J, aa as Q, n as X, e as Y, ab as _, m as $, k as ss, ac as es, V as as, A as os, an as ts, a1 as rs, ad as us, q as is, s as ls, am as ps, ae as ms, a7 as cs, t as ds, L as Bs, c as ks, D as ns, ag as gs, N as Cs, i as Ss, O as vs, g as Ps, j as As, h as ys, ah as hs, M as Ms, af as Ds, ai as Is, Z as Ls, aj as fs, G as Rs } from "./index-397e45a0.js";
|
|
2
2
|
import { u as Ts } from "./useBuilderProp-81a14920.js";
|
|
3
3
|
import { useTranslation as js } from "react-i18next";
|
|
4
4
|
import "./jsx-runtime-944c88e2.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-5c3ac4f7.cjs"),l=require("./useBuilderProp-5e57d0c8.cjs"),r=require("./alert-dialog-4ce6ed22.cjs"),d=require("./index-2bda0975.cjs"),c=require("@radix-ui/react-icons");require("react");require("@radix-ui/react-slot");require("class-variance-authority");require("./utils-3c452dd0.cjs");require("clsx");require("tailwind-merge");require("@radix-ui/react-tooltip");require("@radix-ui/react-toast");require("jotai");require("lodash");require("@radix-ui/react-alert-dialog");require("./_commonjsHelpers-87b0abe8.cjs");require("@radix-ui/react-scroll-area");require("react-dom");require("@floating-ui/react-dom");require("i18next");require("react-i18next");require("flagged");require("react-dnd");require("@minoru/react-dnd-treeview");require("react-hotkeys-hook");require("flat-to-nested");require("./html-to-json-78bfa1f3.cjs");require("./MODIFIERS-70fef873.cjs");require("himalaya");require("redux-undo");require("@react-hookz/web");require("@chaibuilder/blocks");require("lucide-react");require("sonner");const x=({pageData:i,projectData:s})=>{const n={},t=d.useDeletePage(),u=i.uuid===s.homepage,o=()=>{t.mutate(i,{onSuccess:()=>{n({uuid:s.homepage,slug:"/home"})}})};return e.jsxRuntimeExports.jsxs(r.AlertDialog,{children:[e.jsxRuntimeExports.jsx(r.AlertDialogTrigger,{disabled:u,children:e.jsxRuntimeExports.jsx("div",{className:`flex h-full items-center justify-center rounded-md border px-2 py-2 font-medium hover:bg-red-400 hover:text-white ${u?"cursor-not-allowed border-red-200 text-red-200":"cursor-pointer border-red-400 text-red-400"}`,children:e.jsxRuntimeExports.jsx(c.TrashIcon,{})})}),e.jsxRuntimeExports.jsxs(r.AlertDialogContent,{children:[e.jsxRuntimeExports.jsxs(r.AlertDialogTitle,{children:["Are you sure you want to delete ",e.jsxRuntimeExports.jsx("i",{className:"text-red-500",children:i.name})," page?"]}),e.jsxRuntimeExports.jsx(r.AlertDialogDescription,{children:"This action cannot be undone. This will permanently delete your page."}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-3",children:[e.jsxRuntimeExports.jsx(r.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),e.jsxRuntimeExports.jsx(l.Button,{variant:"destructive",onClick:o,disabled:t.isPending,children:"Yes, Delete"})]})]})]})};exports.default=x;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-944c88e2.js";
|
|
2
2
|
import { B as l } from "./useBuilderProp-81a14920.js";
|
|
3
3
|
import { A as n, a as d, b as p, e as a, f as c, h as u } from "./alert-dialog-ee98f47e.js";
|
|
4
|
-
import { a4 as h } from "./index-
|
|
4
|
+
import { a4 as h } from "./index-397e45a0.js";
|
|
5
5
|
import { TrashIcon as x } from "@radix-ui/react-icons";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@radix-ui/react-slot";
|