slice-machine-ui 2.20.1 → 2.20.2-alpha.lg-import-slices.1

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.
Files changed (45) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/-rx3Dikh863L90KD25ytx/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/130-e1a16d2f94fb2b64.js +1 -0
  4. package/out/_next/static/chunks/422-10a9f299957417bb.js +1 -0
  5. package/out/_next/static/chunks/{429-aab52070cad2884b.js → 429-e5d7e39160de9f5e.js} +1 -1
  6. package/out/_next/static/chunks/489-c9535ef34da63d1a.js +1 -0
  7. package/out/_next/static/chunks/585-c89bb2471e85b9f8.js +1 -0
  8. package/out/_next/static/chunks/954-bedaaabf664584a0.js +1 -0
  9. package/out/_next/static/chunks/pages/{_app-e595114a0455ad49.js → _app-2566e110112a7719.js} +1 -1
  10. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-6d613b67e6967ae5.js → [customTypeId]-273e9a82c085b596.js} +1 -1
  11. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-40207b66190e3fcd.js → [pageTypeId]-3fa7667de1a790d9.js} +1 -1
  12. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-faeb6d2f77d97096.js → simulator-8c70298caf51bed0.js} +1 -1
  13. package/out/_next/static/chunks/pages/slices-76679cf064761d2b.js +1 -0
  14. package/out/changelog.html +1 -1
  15. package/out/changes.html +1 -1
  16. package/out/custom-types/[customTypeId].html +1 -1
  17. package/out/custom-types.html +1 -1
  18. package/out/index.html +1 -1
  19. package/out/labs.html +1 -1
  20. package/out/page-types/[pageTypeId].html +1 -1
  21. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  22. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  23. package/out/slices.html +1 -1
  24. package/package.json +5 -4
  25. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/ImportSlicesFromLibraryModal.tsx +336 -0
  26. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/SliceCard.tsx +48 -0
  27. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/hooks/useImportSlicesFromGithub.ts +91 -0
  28. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/index.tsx +1 -0
  29. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/types.ts +28 -0
  30. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/addSlices.ts +186 -0
  31. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/github.ts +657 -0
  32. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/mapWithConcurrency.ts +28 -0
  33. package/src/features/customTypes/customTypesBuilder/ImportSlicesFromLibraryModal/utils/sliceWithoutConflicts.ts +51 -0
  34. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +11 -0
  35. package/src/features/customTypes/customTypesBuilder/shared/getSubmitButtonLabel.ts +12 -0
  36. package/src/features/customTypes/customTypesBuilder/shared/useExistingSlices.ts +26 -0
  37. package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +14 -0
  38. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +51 -0
  39. package/src/pages/slices.tsx +30 -0
  40. package/out/_next/static/chunks/422-c9192a1dbdd2ae0e.js +0 -1
  41. package/out/_next/static/chunks/489-32281540712d98bb.js +0 -1
  42. package/out/_next/static/chunks/633-152bf078e5366a0c.js +0 -1
  43. package/out/_next/static/chunks/pages/slices-ec56b94b35794675.js +0 -1
  44. package/out/_next/static/gVA_PuOFwxA0imKtQowfq/_buildManifest.js +0 -1
  45. /package/out/_next/static/{gVA_PuOFwxA0imKtQowfq → -rx3Dikh863L90KD25ytx}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,t,n){var i=n(34311),o=n(23779),l=i(function(e,t,n){return e+(n?" ":"")+o(t)});e.exports=l},26688:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return n(31562)}])},34166:function(e,t,n){"use strict";n.d(t,{nZ:function(){return d},rT:function(){return u},tB:function(){return x}});var i=n(52322),o=n(11699),l=n(2784),r=n(30195),s=n(94160),a=n(76611),c=n(5683);function d(e){let{type:t,library:n,sliceId:i,variationId:o,langSmithUrl:l}=e,r=(0,c.iv)({type:t,library:n,sliceId:i,variationId:o}),s=JSON.stringify({langSmithUrl:l});localStorage.setItem(r,s)}function x(e){let{type:t,library:n,sliceId:i,variationId:o}=e,l=(0,c.iv)({type:t,library:n,sliceId:i,variationId:o});localStorage.removeItem(l)}function u(e){let{type:t,library:n,sliceId:d,variationId:x}=e,{key:u,value:m,done:h}=function(e){let{type:t,library:n,sliceId:i,variationId:o}=e,l=(0,c.iv)({type:t,library:n,sliceId:i,variationId:o}),[s,d]=(0,a.V)(l,void 0,{schema:r.z.object({langSmithUrl:r.z.string().url().optional()})});return{key:l,value:s,done:()=>d(void 0)}}({type:t,library:n,sliceId:d,variationId:x}),[p,f]=(0,l.useState)(),g=e=>()=>{m&&(f(u),s.Xe.track({event:"slice-generation-feedback",type:t,sliceId:d,variationId:x,feedback:e,langSmithUrl:m.langSmithUrl}),h())};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.be,{children:(0,i.jsx)(o.bQ,{anchor:(0,i.jsx)(o.D,{width:"100%",justifyContent:"center",position:"absolute",bottom:64}),icon:"check",title:"Thanks for your feedback!",seconds:2,open:!!p,onOpenChange:e=>{e||f(void 0)}},p)}),(0,i.jsx)(o.i,{children:m&&(0,i.jsxs)(o.D,{flexDirection:"row",justifyContent:"end",gap:8,alignItems:"center",children:[(0,i.jsx)(o.bL,{color:"grey11",children:"Did the AI get it right?"}),(0,i.jsxs)(o.D,{flexDirection:"row",gap:4,children:[(0,i.jsx)(o.c3,{side:"bottom",sideOffset:4,variant:"text",content:"Looks good",children:(0,i.jsx)(o.aZ,{variant:"solid",size:"small",icon:"thumbUp",onClick:g("up")})}),(0,i.jsx)(o.c3,{side:"bottom",sideOffset:4,variant:"text",content:"Needs improvement",children:(0,i.jsx)(o.aZ,{variant:"solid",size:"small",icon:"thumbDown",onClick:g("down")})})]})]})})]})}},33986:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var i=n(52322),o=n(2784),l=n(75289);let r=(e,t)=>e?"".concat(e,"-").concat(t):"",s=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:a,form:c,isLoading:d=!1,disabled:x=!1,onClick:u,sx:m={},iconSize:h=16,iconFill:p,variant:f="primary",...g}=e;return(0,i.jsx)(l.zx,{ref:t,sx:{...m,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:x||d,onClick:d?void 0:u,variant:f,...g,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.$j,{size:h,color:s(f),"data-testid":r(g["data-testid"],"spinner")}),o&&n]}):(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(o,{size:h,fill:p,"data-testid":r(g["data-testid"],"icon")}),n]})})})},46999:function(e,t,n){"use strict";n.d(t,{W:function(){return r}});var i=n(52322),o=n(63397);n(2784);var l=n(75289);let r=e=>{let{name:t,label:n,placeholder:r,error:s,testId:a,onChange:c}=e;return(0,i.jsxs)(l.xu,{mb:3,children:[(0,i.jsx)(l.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(o.gN,{name:t,type:"text",placeholder:r,as:l.II,autoComplete:"off",...c?{onChange:c}:null,...a?{"data-testid":a}:null}),s?(0,i.jsx)(l.xv,{"data-testid":a?"".concat(a,"-error"):"input-error",sx:{color:"error",mt:1},children:s}):null]})}},59532:function(e,t,n){"use strict";var i=n(52322),o=n(63397),l=n(37149),r=n.n(l),s=n(75289),a=n(33986),c=n(55862),d=n(30527);function x(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:t})}t.Z=function(e){let{children:t,close:n,isOpen:l,formId:u,validate:m,onSubmit:h,widthInPx:p,initialValues:f,content:{title:g},cardProps:j,omitFooter:v=!1,isLoading:b=!1,buttonLabel:y="Save",testId:S,actionMessage:C}=e;return r().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:g,style:{content:{width:null!=p?p:"900px"}},children:(0,i.jsx)(o.J9,{initialValues:f,validate:e=>m?m(e):void 0,onSubmit:e=>{h(e)},children:e=>{let{isValid:l,isSubmitting:r,values:c,errors:m,touched:h,setFieldValue:p,setValues:f}=e;return(0,i.jsx)(o.l0,{id:u,...null!=S?{"data-testid":S}:null,children:(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...j,Header:(0,i.jsxs)(x,{children:[(0,i.jsx)(s.X6,{sx:{fontSize:"20px"},children:g}),(0,i.jsx)(s.x8,{type:"button",onClick:n})]}),Footer:v?null:(0,i.jsxs)(s.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(s.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(s.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(s.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:r||b,children:"Cancel"}),(0,i.jsx)(a.z,{label:y,form:u,type:"submit",disabled:!l||r||b,isLoading:r||b,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:l,isSubmitting:r,values:c,errors:m,touched:h,setFieldValue:p,setValues:f})})})}})})}},31562:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(52322),o=n(11699),l=n(97729),r=n.n(l),s=n(5632),a=n(2784),c=n(56580),d=n(88932),x=n(65077),u=n(75289),m=n(43388),h=n(21446),p=n(27213),f=n(51507),g=n(27763),j=n(21442),v=n(58446),b=n(65186),y=n(59326),S=n(34166),C=n(80148);async function I(e){let{sliceName:t,sliceID:n,libraryID:i,sliceVariationIds:o,onSuccess:l}=e;try{let{errors:e}=await C.managerClient.slices.deleteSlice({libraryID:i,sliceID:n});if(e.length>0)throw e;o.forEach(e=>{(0,S.tB)({type:"model",library:i,sliceId:n,variationId:e})}),l(),d.Am.success("Successfully deleted slice “".concat(t,"”"))}catch(n){let e="An unexpected error happened while deleting slice “".concat(t,"”.");console.error(e,n),d.Am.error(e)}}var k=n(68968),w=n(33986),z=n(30527),N=n(55862),D=n(54597);let R=e=>{var t;let{isOpen:n,libName:o,sliceId:l,sliceName:r,sliceVariationIds:s,onClose:c}=e,[d,x]=(0,a.useState)(!1),{deleteSliceSuccess:m}=(0,D.Z)(),{syncChanges:h}=(0,k.g)(),{theme:p}=(0,y.B7)(),f=async()=>{x(!0),await I({libraryID:o,sliceID:l,sliceName:r,sliceVariationIds:s,onSuccess:()=>{m(l,o),h()}}),c(),x(!1)};return(0,i.jsx)(N.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:c,children:(0,i.jsx)(z.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},borderFooter:!0,Header:(0,i.jsxs)(u.kC,{sx:{position:"sticky",background:"gray",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(b.$vK,{size:20,color:null===(t=p.colors)||void 0===t?void 0:t.greyIcon}),(0,i.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(u.x8,{type:"button",onClick:c})]}),Footer:()=>(0,i.jsxs)(u.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(w.z,{label:"Cancel",variant:"secondary",onClick:c,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(w.z,{label:"Delete",variant:"danger",isLoading:d,sx:{minHeight:39,minWidth:78},onClick:()=>{f()}})]}),children:(0,i.jsxs)(u.nv,{children:["This action will immediately make the following changes:",(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(u.xv,{sx:{fontWeight:"bold"},children:[o,"/",r,"/"]})," ","directory."]}),(0,i.jsx)("li",{children:"Remove the Slice from all Slice Zones that use it."})]}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsx)("li",{children:"Remove the Slice from the list of available Slices to use in the Page Builder."})}),"You will need to manually remove the Slice from any Pages that currently use it."]})})})};var W=n(36887),_=n(94160),F=e=>{let{title:t,onCreateNew:n,onCreateFromImage:l,buttonText:r,documentationComponent:s,videoPublicIdUrl:a,...c}=e,d=(0,p.F)({menuType:"Dropdown"});return(0,i.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...c,children:[(0,i.jsx)(u.xu,{sx:e=>{var t;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:(0,i.jsx)(W.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:a,onPlay:()=>{_.Xe.track({event:"open-video-tutorials",video:a})}})}),(0,i.jsxs)(u.xu,{sx:e=>{var t;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,i.jsxs)(u.xu,{sx:e=>{var t;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.grey02)}},children:[(0,i.jsx)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:s})]}),(0,i.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsxs)(o.ar,{children:[(0,i.jsx)(o.av,{children:(0,i.jsx)(u.zx,{"data-testid":"empty-state-main-button",sx:{flexShrink:0,mr:4},children:r})}),(0,i.jsxs)(o.as,{align:"end",children:[(0,i.jsx)(o.at,{renderStartIcon:()=>d.fromImage.BackgroundIcon,onSelect:l,description:d.fromImage.description,children:d.fromImage.title}),(0,i.jsx)(o.at,{renderStartIcon:()=>d.fromScratch.BackgroundIcon,onSelect:n,description:d.fromScratch.description,children:d.fromScratch.title})]})]}),(0,i.jsx)(u.xv,{sx:{fontSize:"12px",color:"grey04",maxWidth:"280px"},children:"It will be stored locally and you will be able to push it to your repository"})]})]})]})},Z=n(6256),B=n(63908),O=n(26109);async function T(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,B.PQ)(t,n),{errors:o}=await C.managerClient.slices.renameSlice({libraryID:t.from,model:O.id.fromSM(e.model)});if(o.length>0)throw o;i(e),d.Am.success("Slice name updated")}catch(n){let e="An unexpected error happened while renaming “".concat(t.model.name,"”.");console.error(e,n),d.Am.error(e)}}var L=n(7723),P=n(59532),A=n(46999),E=n(63019);let X=e=>{var t,n;let{slice:o,isOpen:l,onClose:r}=e,{renameSliceSuccess:s}=(0,D.Z)(),{syncChanges:a}=(0,k.g)(),{localLibs:d,remoteLibs:x}=(0,c.v9)(e=>({localLibs:(0,L.Sd)(e),remoteLibs:(0,L.sT)(e)})),m=null!==(t=null==o?void 0:o.model.name)&&void 0!==t?t:"",h=async e=>{o&&(await T({slice:o,newSliceName:e.sliceName,onSuccess:e=>{s(e.from,e.model),a()}}),r())};return(0,i.jsx)(P.Z,{testId:"rename-slice-modal",isOpen:l,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(n=null==o?void 0:o.model.id)&&void 0!==n?n:""),close:r,buttonLabel:"Rename",onSubmit:e=>void h(e),initialValues:{sliceName:m},content:{title:"Rename a slice"},validate:e=>(0,E.h)(e,d,x),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(u.xu,{children:(0,i.jsx)(A.W,{name:"sliceName",label:"Slice Name","data-testid":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?n.sliceName:void 0,testId:"slice-name-input"})})}})};var H=n(21151),U=n(86652),V=n(39204),q=n(7974),M=()=>{var e,t,n,l;let b=(0,s.useRouter)(),{modalPayload:y,onOpenModal:S}=(0,j.H)(),{openLoginModal:I}=(0,D.Z)(),k=(0,p.F)({menuType:"Dropdown"}),{sliceFilterFn:w,defaultVariationSelector:z}=y,{remoteSlices:N,libraries:W}=(0,c.v9)(e=>({remoteSlices:(0,L.sT)(e),libraries:(0,L.Sd)(e)})),[_,B]=(0,a.useState)(!1),[O,T]=(0,a.useState)(!1),[P,A]=(0,a.useState)(!1),[E,M]=(0,a.useState)(!1),Q=W.filter(e=>e.isLocal),Y=W.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),G=(W||[]).map(e=>e.components).flat(),J=G.length,[K,$]=(0,a.useState)(),ee=()=>{T(!0)},et=()=>{A(!0)},en=async()=>{await C.managerClient.user.checkIsLoggedIn()?M(!0):I()},ei=()=>{M(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r(),{children:(0,i.jsx)("title",{children:"Slices - Slice Machine"})}),(0,i.jsxs)(v.LN,{children:[(0,i.jsxs)(v.wd,{children:[(0,i.jsx)(v.Cx,{children:(0,i.jsx)(m.g,{children:"Slices"})}),(null==Q?void 0:Q.length)!==0&&0!==J?(0,i.jsxs)(o.ar,{children:[(0,i.jsx)(o.av,{children:(0,i.jsx)(o.E,{color:"purple",startIcon:"add","data-testid":"add-new-slice-dropdown",children:"Add"})}),(0,i.jsxs)(o.as,{align:"end",children:[(0,i.jsx)(o.at,{renderStartIcon:()=>k.fromImage.BackgroundIcon,onSelect:()=>void en(),description:k.fromImage.description,children:k.fromImage.title}),(0,i.jsx)(o.at,{renderStartIcon:()=>k.fromScratch.BackgroundIcon,onSelect:()=>B(!0),description:k.fromScratch.description,children:k.fromScratch.title})]})]}):void 0]}),(0,i.jsxs)(v.RN,{children:[(0,i.jsx)(x.xR,{sx:{display:"flex",flexDirection:"column"},children:Y.length>0?(0,i.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===J?(0,i.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(F,{title:"What are slices?",onCreateNew:()=>{B(!0)},onCreateFromImage:()=>{en()},buttonText:"Create one",videoPublicIdUrl:q.rd,documentationComponent:(0,i.jsxs)(i.Fragment,{children:['Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone" that allows content creators to add, edit, and rearrange slices to compose dynamic layouts for any page design.'," ",(0,i.jsx)(u.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:e=>{var t;return{color:null==e?void 0:null===(t=e.colors)||void 0===t?void 0:t.primary}},children:"Learn more"}),"."]}),"data-testid":"slices-table-blank-slate"})}):Y.map(e=>{let{name:t,isLocal:n,components:o}=e;return(0,i.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(u.xv,{children:1===Y.length?"Your slices":t})}),!n&&(0,i.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,i.jsx)(H.Z,{elems:o,defineElementKey:e=>e.model.name,renderElem:e=>(0,i.jsx)(f.b,{action:{type:"menu",onRemove:()=>{$(e),ee()},onRename:()=>{$(e),et()}},mode:"navigation",onUpdateScreenshot:()=>{S({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"}),gridGap:"32px 16px"})]},t)})}):void 0}),(null==Q?void 0:Q.length)>0&&(0,i.jsx)(U.Z,{slices:w(G),defaultVariationSelector:z}),(null==Q?void 0:Q.length)>0&&_&&(0,i.jsx)(Z.c,{localLibraries:Q,location:"slices",remoteSlices:N,onSuccess:(e,t)=>{let n=e.variations[0].id,i=g.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});b.push(i),d.Am.success((0,V.kQ)({path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{B(!1)}}),(0,i.jsx)(X,{isOpen:P,slice:K,onClose:()=>{A(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(R,{isOpen:O,libName:null!==(e=null==K?void 0:K.from)&&void 0!==e?e:"",sliceId:null!==(t=null==K?void 0:K.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==K?void 0:K.model.name)&&void 0!==n?n:"",sliceVariationIds:(null!==(l=null==K?void 0:K.model.variations)&&void 0!==l?l:[]).map(e=>e.id),onClose:()=>{T(!1)}}),(0,i.jsx)(h.S,{open:E,location:"slices",onSuccess:e=>{let{library:t}=e;d.Am.success((0,i.jsx)(V.GX,{message:"Slice(s) added to slice zone and created at: ",path:t})),ei()},onClose:ei})]})]})]})}}},function(e){e.O(0,[898,789,797,397,66,344,444,882,633,593,888,774,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,n,u,f,d,h,k,j,l,p,g,o,r,m,_,y,I){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,t,g,o,"static/chunks/pages/index-0d8cb369de720a35.js"],"/_error":["static/chunks/pages/_error-fedd2c6ebd3d27b9.js"],"/changelog":[c,i,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-8514e0696e90a1b2.js"],"/changes":[c,b,"static/chunks/8eec4907-b712959d9f984b68.js",a,"static/chunks/125-00b909bdbab2ca15.js",e,u,"static/css/d98ebc475f8423a3.css","static/chunks/pages/changes-e66094f57453cf9c.js"],"/custom-types":[s,t,g,o,"static/chunks/pages/custom-types-5acd56959b60346f.js"],"/custom-types/[customTypeId]":[c,f,d,h,k,s,a,i,n,j,r,e,t,l,p,m,_,"static/chunks/pages/custom-types/[customTypeId]-6d613b67e6967ae5.js"],"/labs":["static/chunks/pages/labs-56fd818a63553497.js"],"/page-types/[pageTypeId]":[c,f,d,h,k,s,a,i,n,j,r,e,t,l,p,m,_,"static/chunks/pages/page-types/[pageTypeId]-40207b66190e3fcd.js"],"/slices":[c,b,y,s,a,n,I,e,p,u,"static/css/efa5152b7c0f35c0.css","static/chunks/pages/slices-ec56b94b35794675.js"],"/slices/[lib]/[sliceName]/[variation]":[c,b,f,d,h,k,y,s,a,i,n,j,I,"static/chunks/484-3e011e79c41f0342.js",e,l,u,"static/css/e8e03c0d4003d1eb.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-22ffa2561ac66557.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[b,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/429-aab52070cad2884b.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-faeb6d2f77d97096.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/397-e6c340070a3bcb41.js","static/chunks/59b4e022-ef680789f7cc9b11.js","static/chunks/66-d9d3bcb5d041cb6d.js","static/chunks/882-48d61b2fabee28d8.js","static/chunks/647-aa094286bc248d52.js","static/chunks/183-4ea255b867ff171b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/344-b64f09e670634ed1.js","static/chunks/593-7ffd1197c3405ef8.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/256-07f768a2b19b0a0e.js","static/chunks/630-2bf927bca082a191.js","static/chunks/633-152bf078e5366a0c.js","static/chunks/248-84a5987f0499b074.js","static/css/4e475d945cf8a890.css","static/chunks/422-c9192a1dbdd2ae0e.js","static/chunks/489-32281540712d98bb.js","static/css/56f2a6684a524374.css","static/chunks/52d4c156-89c6ec6efca0a0bb.js","static/chunks/444-d39213143f782fec.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();