slice-machine-ui 2.18.1-beta.2 → 2.18.1-beta.3
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/out/404.html +1 -1
- package/out/_next/static/{8rE0j20nAXuVaaz6f5oYY → 3CkSC2gDewlCqET0rgfAp}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/248-a0f75ea6d214b7bb.js +1 -0
- package/out/_next/static/chunks/422-c9192a1dbdd2ae0e.js +1 -0
- package/out/_next/static/chunks/489-cc596f7f75c0f276.js +1 -0
- package/out/_next/static/chunks/pages/{_app-31c13d1f090506ca.js → _app-072c48920e55dbad.js} +2 -2
- package/out/_next/static/chunks/pages/changelog-885b62071995472b.js +1 -0
- package/out/_next/static/chunks/pages/changes-59ed9aa810ee25d8.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-7102c23f96cd1768.js → [customTypeId]-816acb31b652239b.js} +1 -1
- package/out/_next/static/chunks/pages/labs-7b37be457758b99e.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-d4bc920a5efffa0a.js → [pageTypeId]-669d5479e81b638b.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-aada88bbe87e7761.js +1 -0
- package/out/_next/static/chunks/pages/slices-1e5cccae3acd7718.js +1 -0
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -6
- package/out/_next/static/chunks/248-bdbfde18c5a04eae.js +0 -1
- package/out/_next/static/chunks/385-b949173dfa03dd3e.js +0 -1
- package/out/_next/static/chunks/489-6edb99e269996dd1.js +0 -1
- package/out/_next/static/chunks/pages/changelog-21b960abba5abf71.js +0 -1
- package/out/_next/static/chunks/pages/changes-7919746009a45ad8.js +0 -1
- package/out/_next/static/chunks/pages/labs-d79597003a1ff74e.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-98f85d5fb8d5c704.js +0 -1
- package/out/_next/static/chunks/pages/slices-046e5e978ffc3a42.js +0 -1
- /package/out/_next/static/{8rE0j20nAXuVaaz6f5oYY → 3CkSC2gDewlCqET0rgfAp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477],{37782:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changelog",function(){return r(93081)}])},38193:function(e,n,r){"use strict";r.d(n,{Z:function(){return l}});var t=r(52322),i=r(61183);r(2784);var s=r(59326),o=r(75289);i.Z.registerLanguage("svelte",e=>({subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"}]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10}]}]}));let a=["javascript","bash","xml","html","json"];var l=e=>{var n;let{children:r,lang:l,sx:c,codeStyle:x,codeClass:d,Header:p}=e,{theme:g}=(0,s.B7)(),u=l?i.Z.highlight(r,{language:"vue"===l?"html":l}).value:i.Z.highlightAuto(r,a).value;return(0,t.jsxs)(o.kC,{as:"pre",sx:c,children:[p?(0,t.jsx)(p,{}):null,(0,t.jsx)("code",{className:"hljs".concat(d?" ".concat(d):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=g.colors)||void 0===n?void 0:n.textClear),...x},dangerouslySetInnerHTML:{__html:u}})]})}},93081:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return O}});var t,i,s=r(52322),o=r(97729),a=r.n(o),l=r(14226),c=r(2784),x=r(56580),d=r(65077),p=r(18566),g=r(80148);async function u(){return await g.managerClient.versions.getAllStableSliceMachineVersionsWithKind()}function h(){return(0,p.QT)(u,[])}var v=r(69300),f=r(9149),m=r(75289);async function j(){return await g.managerClient.versions.getLatestNonBreakingSliceMachineVersion()}var b=r(85606),k=r(59082),C=r(12170);let y=e=>{let{type:n,hasUpToDateVersions:r}=e;return(0,s.jsx)(m.xv,{sx:{padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase",...(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},...n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},...n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}},children:n})},S=e=>{let{isSelected:n,onClick:r,versionNumber:t,tags:i,hasUpToDateVersions:o}=e;return(0,s.jsxs)(m.kC,{sx:{p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center",...n?{color:"purple",bg:(0,C.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}},onClick:r,children:[(0,s.jsx)(m.xv,{children:t}),(0,s.jsx)(m.kC,{sx:{gap:"8px"},children:i.map(e=>(0,s.jsx)(y,{type:e,hasUpToDateVersions:o},e))})]})};(t=i||(i={})).Latest="LATEST",t.LatestNonBreaking="LATEST-NON-BREAKING",t.Current="CURRENT";let T=e=>{var n;let{selectedVersion:r,selectVersion:t}=e,i=h(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),c=(0,p.QT)(j,[]),x=(0,b.d)(),d=null===(n=i[0])||void 0===n?void 0:n.version;return(0,s.jsxs)(m.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:l.t.color.grey6,flexDirection:"column",paddingRight:"48px"},children:[(0,s.jsxs)(m.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:l.t.color.grey6,paddingBottom:"28px"},children:[(0,s.jsx)(m.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,s.jsx)(m.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,s.jsx)(m.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:i.map((e,n)=>(0,s.jsx)(S,{isSelected:(null==r?void 0:r.version)===e.version,onClick:()=>t(e),versionNumber:e.version,tags:function(e){let n=[];return e===d?n.push("LATEST"):e===c&&n.push("LATEST-NON-BREAKING"),e===x&&n.push("CURRENT"),n}(e.version),hasUpToDateVersions:!o&&!a},"versionBadge-".concat(e.version,"-").concat(n)))})]})};var N=r(951);async function w(e){return await g.managerClient.versions.getSliceMachineReleaseNotesForVersion({version:e})}var E=r(19870);let L=e=>{let{releaseNotes:n}=e;return(0,s.jsx)(m.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:E.TU.parse(n)}})};var R=r(32554),_=r(38193);let z=e=>{let{selectedVersion:n,packageManager:r}=e,t=h(),i=(0,R.p)(),{sliceMachineUpdateAvailable:o,adapterUpdateAvailable:a}=(0,k.P)(),l=n.version===t[0].version,c=function(e,n){let r=n.join(" ");switch(e){case"bun":return"bun add --development ".concat(r);case"npm":return"npm install --save-dev ".concat(r);case"pnpm":case"pnpm@6":return"pnpm add --save-dev ".concat(r);case"yarn":case"yarn@berry":return"yarn add --dev ".concat(r)}}(r,function(e){let{sliceMachineVersionToInstall:n,isLatestSliceMachineVersion:r,adapterName:t}=e,i=["slice-machine-ui@".concat(n)];return r&&i.push("".concat(t,"@latest")),i}({sliceMachineVersionToInstall:l?"latest":n.version,isLatestSliceMachineVersion:l,adapterName:i}));return(0,s.jsxs)(s.Fragment,{children:[a&&!o&&l&&(0,s.jsxs)(m.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,s.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,s.jsxs)(m.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,s.jsx)(m.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,s.jsxs)(m.kC,{sx:{gap:"8px"},children:[(0,s.jsx)(_.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:c}),(0,s.jsx)(m.zx,{variant:"secondary",onClick:()=>void navigator.clipboard.writeText(c),children:"Copy"})]})]})]})},H=e=>{let{versionKind:n}=e,r={fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase",..."MAJOR"===n?{color:"purple",bg:(0,C.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"}};return(0,s.jsx)(m.xv,{sx:r,children:n})},B=()=>(0,s.jsxs)(m.kC,{sx:{paddingLeft:"32px"},children:["Could not fetch release notes."," ",(0,s.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]}),M=e=>{var n;let{selectedVersion:r,packageManager:t}=e,i=(n=r.version,(0,p.QT)(w,[n]));return(0,s.jsxs)(m.kC,{sx:{flexDirection:"column"},children:[(0,s.jsxs)(m.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:l.t.color.grey6,justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(m.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(r.version)}),!!r.kind&&(0,s.jsx)(H,{versionKind:r.kind})]}),(0,s.jsxs)(m.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null==i?void 0:i.includes("# Breaking Change"))&&(0,s.jsxs)(m.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,s.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,s.jsx)(z,{selectedVersion:r,packageManager:t}),void 0!==i?(0,s.jsx)(L,{releaseNotes:i}):(0,s.jsx)(B,{})]})]})};function A(){let{packageManager:e}=(0,x.v9)(e=>({packageManager:(0,f.Ak)(e)})),n=h(),r=n[0],[t,i]=(0,c.useState)(null!=r?r:void 0);(0,c.useEffect)(()=>{i(r)},[r]);let o=0===n.length||!t;return(0,s.jsx)(v.LN,{children:(0,s.jsx)(v.RN,{children:(0,s.jsxs)(d.xR,{sx:{display:"flex",minWidth:0},children:[(0,s.jsx)(T,{selectedVersion:t,selectVersion:e=>i(e)}),o?(0,s.jsx)(B,{}):(0,s.jsx)(l.ay,{renderError:()=>(0,s.jsx)(B,{}),children:(0,s.jsx)(c.Suspense,{fallback:(0,s.jsx)(l.bg,{}),children:(0,s.jsx)(M,{selectedVersion:t,packageManager:e})})})]})})})}function O(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a(),{children:(0,s.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,s.jsx)(A,{})]})}}},function(e){e.O(0,[898,183,870,888,774,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return n(45031)}])},72641:function(e,t,n){"use strict";n.d(t,{R$:function(){return o},Qj:function(){return x},T9:function(){return d},nf:function(){return u},u2:function(){return c},_T:function(){return h}});var s=n(52322),i=n(14226),l=n(6277),r=n(83478),a=n.n(r);let o=e=>{let{backgroundImage:t,style:n,...i}=e,r=void 0!==t;return(0,s.jsx)("article",{...i,className:(0,l.W)(a().root,{[a().withBackground]:r}),style:{backgroundImage:r?"url(".concat(t,")"):void 0,...n}})},c=e=>(0,s.jsx)("div",{...e,className:a().image}),d=e=>(0,s.jsx)("div",{...e,className:a().content}),h=e=>(0,s.jsx)(i.bL,{...e,variant:"h3"}),u=e=>(0,s.jsx)(i.bL,{...e,color:"grey11"}),x=e=>(0,s.jsx)("div",{...e,className:a().actions,color:"grey"})},33986:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var s=n(52322),i=n(2784),l=n(75289);let r=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},o=(0,i.forwardRef)((e,t)=>{let{label:n,Icon:i,type:o,form:c,isLoading:d=!1,disabled:h=!1,onClick:u,sx:x={},iconSize:m=16,iconFill:g,variant:p="primary",...j}=e;return(0,s.jsx)(l.zx,{ref:t,sx:{...x,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:o,form:c,disabled:h||d,onClick:d?void 0:u,variant:p,...j,children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.$j,{size:m,color:a(p),"data-testid":r(j["data-testid"],"spinner")}),i&&n]}):(0,s.jsxs)(s.Fragment,{children:[i&&(0,s.jsx)(i,{size:m,fill:g,"data-testid":r(j["data-testid"],"icon")}),n]})})})},21151:function(e,t,n){"use strict";var s=n(52322),i=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:l,gridTemplateMinPx:r="320px",gridGap:a="16px",sx:o}=e;return(0,s.jsx)(i.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(r,", 1fr))"),gridGap:a,pt:2,...o},children:t.map((e,t)=>e?(0,s.jsx)("span",{children:n(e,t)},"".concat(l(e),"-").concat(t+1)):null)})}},45031:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ea}});var s=n(52322),i=n(14226),l=n(97729),r=n.n(l),a=n(5632),o=n(2784),c=n(88932),d=n(65077),h=n(94160),u=n(43388),x=n(72641);function m(e){let{isPostPush:t,documentsListEndpoint:n}=e,l=t?p:g;return(0,s.jsxs)(x.R$,{style:{alignSelf:"center",marginTop:i.t.space[72]},children:[(0,s.jsx)(x.u2,{children:(0,s.jsx)(i.a_,{src:l.img,sizing:"cover"})}),(0,s.jsxs)(x.T9,{children:[(0,s.jsx)(x._T,{children:l.title}),(0,s.jsx)(x.nf,{children:l.description}),t&&(0,s.jsx)(x.Qj,{children:(0,s.jsx)(i.E,{onClick:()=>{h.Xe.track({event:"post-push:empty-state-cta-clicked"}),window.open(n,"_blank")},size:"large",children:"Create content in the Page Builder"})})]})]})}let g={img:"/blank-slate-changes-uptodate.png",title:"Everything is up-to-date",description:"No changes are staged. Saved updates will appear here, ready to be pushed to the Page Builder."},p={img:"/blank-slate-push-success.png",title:"Success! Your changes have been pushed to the Page Builder.",description:"Add content to your website to bring it to life!"},j=(0,o.forwardRef)((e,t)=>(0,s.jsx)(i.E,{...e,ref:t,startIcon:"upload",children:"Push"}));var f=n(98250),v=n(98033),b=n(68968),y=n(13434),k=n(19468),w=n(978),C=n(30613),D=n(69300),S=n(93671),_=n(54597);let T=e=>{let{authStatus:t}=e,{openLoginModal:n}=(0,_.Z)();return(0,s.jsxs)(i.D,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[t===S.t.FORBIDDEN&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.bL,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,s.jsx)(i.bL,{align:"center",children:"Log in to connect to your repository."})]}),(0,s.jsxs)(i.bL,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(i.bL,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),t===S.t.FORBIDDEN&&(0,s.jsx)(i.E,{onClick:()=>n(),children:"Log in to Prismic"})]})};var B=n(91914),L=n(75289);let O=()=>(0,s.jsx)(L.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(L.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(B.wQ1,{size:48}),(0,s.jsx)(L.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,s.jsx)(L.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})});var I=n(951),E=n(63908),F=n(17378),N=n(51507),R=n(21442);let z=e=>{let{children:t}=e;return(0,s.jsx)(L.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:t})};var P=n(39097),A=n.n(P),W=n(99195),H=n(59294),X=n(16442);let Z=e=>{let{ct:t,status:n,authStatus:i,isOnline:l}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(L.xv,{sx:{fontWeight:500},children:t.label})}),(0,s.jsx)(L.xu,{as:"td",style:{width:"40%"},children:t.id}),(0,s.jsx)(L.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(W.O,{authStatus:i,isOnline:l,modelStatus:n,modelType:"CustomType"})})]})},G=e=>{let{customTypes:t,modelsStatuses:n,authStatus:i,isOnline:l}=e;return(0,s.jsxs)(L.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(L.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(L.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(L.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:t.map(e=>(0,X.TG)(e)?(0,s.jsx)(A(),{passHref:!0,href:H.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,s.jsx)(Z,{ct:e.local,status:n.customTypes[e.local.id],authStatus:i,isOnline:l},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(Z,{ct:e.remote,status:n.customTypes[e.remote.id],authStatus:i,isOnline:l},e.remote.id)},e.remote.id))})]})};var M=n(21151),Y=n(68105),U=n(56448),Q=n(96317);function J(){let e=(0,Q.L)("slicemachine-dev-collaboration"),[t,n]=(0,o.useState)(!1),l=null==e?void 0:e.payload;return((0,o.useEffect)(()=>{(null==e?void 0:e.value)==="on"&&void 0!==l&&h.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,l]),(null==e?void 0:e.value)!=="on"||void 0===l)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i.D,{alignItems:"flex-start",border:{bottom:!0,left:!0,right:!0,top:!0},borderRadius:6,borderStyle:"dashed",flexDirection:"column",flexShrink:0,gap:8,padding:16,width:320,children:[(0,s.jsxs)(i.D,{flexDirection:"column",gap:2,children:[(0,s.jsx)(i.bL,{variant:"smallBold",children:l.cardTitle}),(0,s.jsx)(i.bL,{color:"grey11",variant:"small",children:l.cardDescription})]}),(0,s.jsx)(i.E,{color:"grey",onClick:()=>{h.Xe.track({event:"dev-collab:set-up-workflow-opened"}),n(!0)},children:l.cardButtonLabel})]}),(0,s.jsxs)(i.ae,{onOpenChange:e=>{e||n(!1)},open:t,size:{height:"auto",width:448},children:[(0,s.jsx)(i.al,{title:l.dialogTitle}),(0,s.jsx)(i.aj,{children:(0,s.jsxs)(i.D,{flexDirection:"column",children:[(0,s.jsx)(i.D,{flexDirection:"column",padding:16,children:(0,s.jsx)(i.bL,{children:l.dialogDescription})}),(0,s.jsxs)(i.ah,{children:[(0,s.jsx)(i.ai,{size:"medium"}),(0,s.jsx)(i.af,{size:"medium",onClick:()=>{h.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(l.dialogButtonLink,"_blank"),n(!1)},children:l.dialogButtonLabel})]})]})})]})]})}let $=e=>{let{unSyncedCustomTypes:t,unSyncedSlices:n,modelsStatuses:l,authStatus:r,isOnline:a}=e,{modalPayload:c,onOpenModal:d}=(0,R.H)(),{sliceFilterFn:h,defaultVariationSelector:u}=c,x=n.filter(e=>l.slices[e.model.id]!==U.GJ.Deleted);return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(i.D,{gap:16,alignItems:"flex-start",children:[(0,s.jsxs)(i.D,{flexDirection:"column",flexGrow:1,children:[t.length>0&&(0,s.jsxs)(i.D,{flexDirection:"column",children:[(0,s.jsx)(z,{children:(0,s.jsxs)(i.D,{children:[(0,s.jsx)(i.bL,{variant:"h5",children:"Types"}),(0,s.jsx)(i.bL,{variant:"h5",sx:{marginLeft:8},children:t.length})]})}),(0,s.jsx)(G,{customTypes:t,modelsStatuses:l,authStatus:r,isOnline:a})]}),n.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.D,{padding:{bottom:8},children:(0,s.jsxs)(z,{children:[(0,s.jsxs)(i.D,{children:[(0,s.jsx)(i.bL,{variant:"h5",children:"Slices"}),(0,s.jsx)(i.bL,{variant:"h5",sx:{marginLeft:8},children:n.length})]}),(0,s.jsxs)(i.D,{children:[n.some(e=>(0,E.cx)(e)>0&&l.slices[e.model.id]!==U.GJ.Deleted)&&(0,s.jsxs)(i.bL,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,s.jsx)(I.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsx)(i.E,{color:"dark",startIcon:"photoCamera",onClick:()=>d({sliceFilterFn:e=>e}),children:"Update all screenshots"})]})]})}),(0,s.jsx)(M.Z,{gridGap:"32px 16px",elems:n,gridTemplateMinPx:"305px",defineElementKey:e=>e.model.name,renderElem:e=>{let t=l.slices[e.model.id];return(0,s.jsx)(N.b,{action:{type:"status",authStatus:r,isOnline:a,modelStatus:t},isDeleted:t===U.GJ.Deleted,mode:"navigation",onUpdateScreenshot:()=>{d({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"})}}),(0,s.jsx)(Y.Z,{slices:h(x),defaultVariationSelector:u})]})]}),(0,s.jsx)(F.S,{children:(0,s.jsx)(o.Suspense,{children:(0,s.jsx)(J,{})})})]})})};var q=n(56580),K=n(33986),V=n(79797),ee=n(30527);let et=e=>{let{isOpen:t,title:n,footer:i,explanations:l,onClose:r}=e;return(0,s.jsx)(V.Z,{placement:"right",open:t,level:null,onClose:r,width:496,children:(0,s.jsx)(ee.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:(0,s.jsxs)(L.kC,{sx:{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,s.jsx)(L.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(L.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:n})}),(0,s.jsx)(L.x8,{type:"button",onClick:()=>r()})]}),Footer:()=>(0,s.jsx)(L.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i}),children:l})})};var en=n(78254);n(98564);let es=e=>{let{ctName:t,numberOfDocuments:n,link:i,isOverLimit:l=!1}=e;return(0,s.jsxs)(L.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(t),children:[(0,s.jsxs)(L.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(L.xv,{children:t}),(0,s.jsxs)(L.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[n," documents"]})]}),(0,s.jsx)(L.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:l?"danger":"purple08"},children:"View documents"})]})},ei=e=>{let{pushChanges:t,modalData:n,onClose:i}=e,{remoteOnlyCustomTypes:l}=(0,q.v9)(e=>({remoteOnlyCustomTypes:(0,en.Ch)(e).filter(X.yp)}));if((null==n?void 0:n.type)!=="HARD")return null;let r=n.details.customTypes.map(e=>{var t;let n=l.find(t=>(0,X.n5)(t)===e.id);return void 0===n?null:(0,s.jsx)(es,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(et,{isOpen:"HARD"===n.type,title:"Manual action required",onClose:i,footer:(0,s.jsx)(K.z,{label:"Try again",variant:"primary",onClick:()=>{t(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(L.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",n.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(L.xv,{sx:{mb:24},children:[n.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),r]})})},el=e=>{let{onToggle:t,isConfirmed:n,sx:i}=e;return(0,s.jsxs)(L.kC,{sx:{borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%",...i},children:[(0,s.jsx)(L.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(L.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(L.XZ,{defaultChecked:n,onChange:t,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},er=e=>{let{pushChanges:t,modalData:n,onClose:i}=e,[l,r]=(0,o.useState)(!1),{remoteOnlyCustomTypes:a}=(0,q.v9)(e=>({remoteOnlyCustomTypes:(0,en.Ch)(e).filter(X.yp)}));if((null==n?void 0:n.type)!=="SOFT")return null;let c=n.details.customTypes.map(e=>{var t;let n=a.find(t=>(0,X.n5)(t)===e.id);return void 0===n?null:(0,s.jsx)(es,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(et,{isOpen:"SOFT"===n.type,title:"Confirm deletion",onClose:i,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el,{onToggle:()=>{r(!l)},isConfirmed:l,sx:{mb:10}}),(0,s.jsx)(K.z,{label:"Push changes",variant:"primary",onClick:()=>{t(l)},disabled:!l,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(L.xv,{sx:{mb:24},children:[n.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),c]})})};var ea=()=>{let{unSyncedSlices:e,unSyncedCustomTypes:t,changedCustomTypes:n,changedSlices:l,modelsStatuses:x}=(0,y.X)(),g=(0,w.L)(),p=(0,k.n)(),{pushChangesSuccess:B,refreshState:L}=(0,_.Z)(),[I,E]=(0,o.useState)(!1),[F,N]=(0,o.useState)(void 0),{autoSyncStatus:R}=(0,b.g)(),z=(0,a.useRouter)(),[P,A]=(0,o.useState)(!1),[W,H]=(0,o.useState)(!1),{repositoryUrl:X}=(0,C.U)(),{completeStep:Z}=(0,f.k)(),G=e.length+t.length;(0,o.useEffect)(()=>{("synced"===R||"failed"===R||"syncing"===R)&&z.push("/")},[R,z]);let M=async e=>{try{E(!0),N(void 0);let t=await (0,v.t)({confirmDeleteDocuments:e,changedCustomTypes:n,changedSlices:l});if(void 0!==t)N(t);else{let e=await (0,h.y0)();L(e),B(),A(!0),H(!0),Z("reviewAndPush")}}catch(e){console.error("Something went wrong when manually pushing your changes",e),c.Am.error("Something went wrong when pushing your changes. Check your terminal logs.")}E(!1)},Y=(0,o.useMemo)(()=>g?p===S.t.FORBIDDEN?(0,s.jsx)(T,{authStatus:p}):0===G?(0,s.jsx)(m,{isPostPush:P,documentsListEndpoint:X}):(0,s.jsx)($,{unSyncedSlices:e,unSyncedCustomTypes:t,modelsStatuses:x,authStatus:p,isOnline:g}):(0,s.jsx)(O,{}),[g,p,G,e,t,x,P,X]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(D.LN,{children:[(0,s.jsxs)(D.wd,{children:[(0,s.jsx)(D.Cx,{children:(0,s.jsx)(u.g,{children:"Changes"})}),(0,s.jsxs)(D.K2,{children:[(0,s.jsx)(j,{disabled:0===G||!g||p===S.t.UNAUTHORIZED||p===S.t.FORBIDDEN||I,loading:I,onClick:()=>{M(!1)}}),(0,s.jsx)(i.bQ,{anchor:(0,s.jsx)(i.D,{position:"fixed",top:32,right:32,width:322}),open:W,variant:"card",seconds:20,title:"Success! \uD83C\uDF89",subtitle:"Your changes have been pushed.",action:{title:"Create content in the Page Builder",onClick:()=>{h.Xe.track({event:"post-push:toast-cta-clicked"}),window.open(X,"_blank")}},cancel:{onClick:()=>H(!1)},onOpenChange:H})]})]}),(0,s.jsx)(D.RN,{children:(0,s.jsxs)(d.xR,{sx:{display:"flex",flexDirection:"column"},children:[Y,(0,s.jsx)(er,{pushChanges:e=>void M(e),modalData:F,onClose:()=>N(void 0)}),(0,s.jsx)(ei,{pushChanges:e=>void M(e),modalData:F,onClose:()=>N(void 0)})]})})]})]})}},83478:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}},function(e){e.O(0,[898,789,123,918,34,658,888,774,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(60802)}])},60802:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,50,349,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{95759:function(n,u,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/custom-types/[customTypeId]",function(){return t(60802)}])},60802:function(n,u,t){"use strict";t.r(u),t.d(u,{default:function(){return _.H}});var _=t(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,50,349,422,34,647,630,907,489,888,774,179],function(){return n(n.s=95759)}),_N_E=n.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{41535:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return i(69560)}])},84879:function(e,n,i){"use strict";i.d(n,{E:function(){return s}});var r=i(18566),a=i(80148);async function l(){return a.managerClient.project.getSliceMachineConfig()}function s(e){var n,i;let[s,t]=[(0,r.QT)(l,[]),async e=>{await a.managerClient.project.writeSliceMachineConfig({config:e}),(0,r.VA)(l,[],e)}],c=async n=>{let i={...s,labs:{...s.labs}};n?i.labs[e]=n:e in i.labs&&delete i.labs[e],0===Object.keys(i.labs).length&&delete i.labs,await t(i)};return[{enabled:null!==(i=null==s?void 0:null===(n=s.labs)||void 0===n?void 0:n[e])&&void 0!==i&&i},c]}},69560:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return x}});var r=i(52322),a=i(14226),l=i(97729),s=i.n(l),t=i(2784),c=i(43388),o=i(17378),d=i(69300),h=i(88932);let u=e=>{let{title:n,enabled:i,onToggle:l,children:s}=e;return(0,r.jsx)(a.G,{variant:"outlined",children:(0,r.jsxs)(a.D,{gap:8,padding:16,children:[(0,r.jsx)(a.D,{padding:{top:6},children:(0,r.jsx)(a.aX,{name:"viewDay",size:"medium",color:"grey11"})}),(0,r.jsxs)(a.D,{flexDirection:"column",flexGrow:1,children:[(0,r.jsx)(a.bL,{variant:"h3",children:n}),(0,r.jsx)(a.bL,{variant:"normal",children:s})]}),(0,r.jsx)(a.D,{width:128,justifyContent:"end",children:(0,r.jsx)(a.bC,{size:"medium",checked:i,onCheckedChange:e=>l(e)})})]})})};var b=i(84879);let g=()=>{let[e,n]=function(e,n){let[i,r]=(0,b.E)(e);return[i,async e=>{try{await r(e),h.Am.success(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n))}catch(i){console.error(i),h.Am.error(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n))}}]}("legacySliceUpgrader","Legacy Slice Upgrader");return(0,r.jsxs)(a.D,{flexDirection:"column",gap:32,children:[(0,r.jsx)("header",{children:(0,r.jsx)(a.bL,{variant:"normal",children:"Slice Machine Labs gives you early access to new features before they're widely released. Experimental features are works-in-progress and potentially unstable, so you may find some bugs and breaking changes along the way."})}),(0,r.jsx)(a.D,{flexDirection:"column",gap:16,children:(0,r.jsxs)(u,{title:"Legacy Slice Upgrader",enabled:e.enabled,onToggle:e=>void n(e),children:["The Legacy Slice Upgrader allows you to convert old slices (legacy and composite slices) to slices managed by Slice Machine (shared slices). This feature is experimental, and we strongly recommend that you test it with a"," ",(0,r.jsx)("a",{href:"https://prismic.io/docs/environments",target:"_blank",children:"Prismic environment"})," ","or you'll be at risk of losing past content."]})})]})},x=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s(),{children:(0,r.jsx)("title",{children:"Labs - Slice Machine"})}),(0,r.jsx)(o.S,{renderError:()=>(0,r.jsx)(j,{children:(0,r.jsx)(a.D,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(a.ax,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})}),children:(0,r.jsx)(t.Suspense,{fallback:(0,r.jsx)(j,{withHeader:!0,children:(0,r.jsx)(a.bg,{})}),children:(0,r.jsx)(j,{withHeader:!0,children:(0,r.jsx)(g,{})})})})]}),j=e=>{let{children:n,withHeader:i=!1}=e;return(0,r.jsxs)(d.LN,{children:[i?(0,r.jsx)(d.wd,{children:(0,r.jsx)(d.Cx,{children:(0,r.jsx)(c.g,{children:"Labs"})})}):null,(0,r.jsx)(d.RN,{children:n})]})}}},function(e){e.O(0,[888,774,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(89173)}])},89173:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,50,349,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[936],{61367:function(n,u,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page-types/[pageTypeId]",function(){return e(89173)}])},89173:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return t.H}});var t=e(19489)}},function(n){n.O(0,[898,917,525,461,139,397,183,50,349,422,34,647,630,907,489,888,774,179],function(){return n(n.s=61367)}),_N_E=n.O()}]);
|
package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-aada88bbe87e7761.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[136],{31314:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]",function(){return n(92578)}])},50477:function(e,t,n){"use strict";n.d(t,{NG:function(){return s},xU:function(){return a}});var i=n(18566),r=n(2784),o=n(80148);function a(e){let t=(0,r.useCallback)(t=>(0,i.VA)(l,[e],t),[e]);return{customTypes:(0,i.QT)(l,[e]),updateCustomTypes:t}}async function l(e){let{errors:t,models:n}=await o.managerClient.customTypes.readAllCustomTypes(e?{format:e}:void 0);if(t.length>0)throw t;return n.map(e=>{let{model:t}=e;return t})}function s(e){(0,i.gw)(l,[]),(0,i.gw)(l,[e])}},44309:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(5632),r=n(56580),o=n(7723);let a=(e,t,n)=>{var i;let r=null===(i=(0,o.Sd)(e))||void 0===i?void 0:i.find(e=>e.name.replace(/\//g,"--")===t);return null==r?void 0:r.components.find(e=>e.model.name===n)};var l=()=>{let e=(0,i.useRouter)(),{slice:t}=(0,r.v9)(t=>({slice:a(t,e.query.lib,e.query.sliceName)}));if(!t)return{};let n=t.model.variations.find(t=>t.id===e.query.variation);return n?{slice:t,variation:n}:{}}},92578:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eF}});var i=n(52322),r=n(97729),o=n.n(r),a=n(5632),l=n(74217),s=n(2784),d=n(94160),c=n(68968),u=n(23710),m=n(54597);let h=(0,s.createContext)(void 0);function p(e){let{children:t,initialSlice:n}=e,r=(0,a.useRouter)(),[o,p]=(0,s.useState)(n),{actionQueueStatus:f,setNextAction:v}=(0,u.c)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),{saveSliceSuccess:x}=(0,m.Z)(),y=(0,l.R9)(x),{syncChanges:g}=(0,c.g)(),j=(0,s.useMemo)(()=>{let e=r.query.variation,t=o.model.variations.find(t=>t.id===e);if(t)return t;throw Error("Variation not found")},[o,r]),b=(0,s.useCallback)((e,t)=>{p(e),v(async()=>{let{errors:n}=await (0,d.Ve)(e);if(n.length>0)throw n;let{errors:i,mocks:r}=await (0,d.pL)({libraryID:e.from,sliceID:e.model.id});if(i.length>0)throw i;y({...e,mocks:r}),g(),null==t||t()})},[v,y,g]),w=(0,s.useMemo)(()=>({actionQueueStatus:f,slice:o,setSlice:b,variation:j}),[f,o,b,j]);return(0,i.jsx)(h.Provider,{value:w,children:"function"==typeof t?t(w):t})}function f(){let e=(0,s.useContext)(h);if(!e)throw Error("SliceBuilderProvider not found");return e}var v=n(44309),x=n(14226),y=n(43388),g=n(23094),j=n(17378),b=n(18566),w=n(80148);async function C(e){let{errors:t,model:n}=await w.managerClient.customTypes.readCustomType({id:e});if(t.length>0)throw t;return n}var I=n(59294),S=n(14101),k=n(81229);let D=e=>(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("path",{d:"M9.5 12L6 9.5L9.5 7V9.5V12Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M6 9.5H11C14.3 9.5 17 12.2 17 15.5V17.5M6 9.5L9.5 12V9.5V7L6 9.5Z",stroke:"currentColor",strokeLinecap:"round"})]}),T=()=>{let{source:e}=(0,S.l)(),t=function(e){let t=(0,I.Ag)(e.query);return void 0!==t&&(0,I.ne)(e.asPath,t)?t:void 0}(e);return void 0!==t?(0,i.jsx)(j.S,{children:(0,i.jsx)(s.Suspense,{children:(0,i.jsx)(x.D,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(E,{sourceCustomTypeId:t})})})}):null},E=e=>{let{sourceCustomTypeId:t}=e,n=(0,b.QT)(C,[t]),[r,o]=(0,s.useState)(!0),l=(0,a.useRouter)();if(void 0===n||!r)return null;{let{format:e,id:t}=n,r=I.cd[e].getBuilderPagePathname(t);return(0,i.jsxs)(x.F,{density:"compact",color:"dark",children:[(0,i.jsxs)(x.E,{onClick:()=>{l.push(r)},renderStartIcon:()=>(0,i.jsx)(D,{}),children:["Return to ",n.label]}),(0,i.jsx)(x.E,{onClick:()=>{o(!1)},renderStartIcon:()=>(0,i.jsx)(k.T,{})})]})}};var A=n(69300),R=n(56580),L=n(33710),_=n(77057),F=n(39180),O=n(7974),N=n(79384);let V=e=>{let{children:t,open:n,onClose:r}=e;return(0,i.jsxs)(_.zs,{open:n,trigger:t,onClose:r,children:[(0,i.jsx)(_.Ev,{children:"Simulate your slices"}),(0,i.jsx)(_.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:O.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:()=>{d.Xe.track({event:"open-video-tutorials",video:O.Sn})}}),(0,i.jsx)(_.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(_.Rp,{children:"Got it"})]})};var M=e=>{let{disabled:t}=e,n=(0,a.useRouter)(),r=(0,s.useRef)(null),{setSeenSimulatorToolTip:o}=(0,m.Z)(),{hasSeenSimulatorTooltip:l}=(0,R.v9)(e=>({hasSeenSimulatorTooltip:(0,N.bv)(e)}));(0,s.useEffect)(()=>{let e=r.current;e&&!l&&setTimeout(()=>L.Z.show(e),5e3)},[l]);let d=()=>{if(o(),r.current){let{current:e}=r;L.Z.hide(e)}};return(0,i.jsx)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:r,children:(0,i.jsx)(V,{open:!l,onClose:d,children:(0,i.jsx)(x.E,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:()=>{d(),window.open("".concat(n.asPath,"/simulator"),O.pq)},disabled:t,renderStartIcon:()=>(0,i.jsx)(F.z,{color:x.t.color.grey1,height:"24px",style:{transform:"scale(calc(4 / 3))"},width:"24px"}),children:"Simulate"})})})},z=n(88866),P=n(28316),Z=n(88932),K=n(35289),H=n(63908),q=n(34166),B=n(3285),W=n(40141),X=n(49219),G=n(26109),U=n(45440),Q=n(16086),Y=n(358),J=n(5495),$=n(39302);let ee=[U.C.Image,U.C.Text,U.C.StructuredText,U.C.Link,U.C.Select,U.C.Boolean,U.C.Number,U.C.Color,U.C.Date,U.C.Table,U.C.Embed,U.C.Timestamp,U.C.GeoPoint,U.C.ContentRelationship,U.C.LinkToMedia];var et=()=>{let{slice:e,setSlice:t,variation:n}=f(),[r,o]=(0,s.useState)(!1),a=[U.C.Group,...ee],l=!!(n.items&&Object.keys(n.items).length>0),d=i=>r=>{if(i===G.Rt.Items&&n.items&&Object.keys(n.items).length<=1){o(!0);return}t((0,H.AK)({slice:e,variationId:n.id,widgetArea:i,fieldId:r}))},c=(i,r)=>{let{apiId:o,newKey:a,value:l,inGroupFieldAction:s}=r;t((0,H.L4)({slice:e,variationId:n.id,widgetArea:i,previousFieldId:o,newFieldId:a,newField:l}),()=>{"add"===s&&Z.Am.success("Field added")}),s||(0,$.Z)({previousId:o,id:a,field:l})},u=(i,r)=>{let{apiId:o,value:l}=r,{type:s}=l,d=a.find(e=>e.CUSTOM_NAME===s||e.TYPE_NAME===s);if(!d)throw Error("Unsupported Field Type: ".concat(s));try{d.schema.validateSync(l,{stripUnknown:!1})}catch(e){throw Error('Model is invalid for widget "'.concat(l.type,'".'))}t((0,H.xS)({slice:e,variationId:n.id,widgetArea:i,newFieldId:o,newField:l.type===z.GroupFieldType?X.Fl.fromSM(l):l}),()=>{Z.Am.success("".concat("Group"===s?"Group":"Field"," added"))}),(0,J.V)({id:o,field:l})},m=e=>t=>""===t.apiId?u(e,{...t,apiId:t.newKey}):c(e,t),h=i=>r=>{if((0,Q.uS)(r))return;let{source:o,destination:a}=r;if(!a)return;let l=(0,H.gR)({slice:e,variationId:n.id,widgetArea:i,sourceIndex:o.index,destinationIndex:a.index});(0,P.flushSync)(()=>t(l))};return(0,i.jsxs)(x.D,{flexDirection:"column",gap:18,children:[(0,i.jsxs)(K.aV,{children:[(0,i.jsx)(W.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,title:"Fields",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:n.primary,EditModal:B.Z,widgetsArray:a,onDeleteItem:d(G.Rt.Primary),onSave:m(G.Rt.Primary),onDragEnd:h(G.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:e=>{let{item:t}=e;return"slice.primary".concat((0,Y.Ti)(t.key))},renderFieldAccessor:e=>"slice.primary".concat((0,Y.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:void 0,emptyStateHeading:void 0}),l?(0,i.jsx)(W.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:ee,fields:n.items,EditModal:B.Z,onDeleteItem:d(G.Rt.Items),onSave:m(G.Rt.Items),onDragEnd:h(G.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:e=>{let{item:t}=e;return"item".concat((0,Y.Ti)(t.key))},renderFieldAccessor:e=>"slice.items[i]".concat((0,Y.Ti)(e)),testId:"slice-repeatable-zone",isRepeatableCustomType:void 0,emptyStateHeading:"No fields"}):null,(0,i.jsxs)(x.ae,{size:"small",open:r,onOpenChange:e=>o(e),children:[(0,i.jsx)(x.al,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(x.aj,{children:[(0,i.jsx)(x.D,{padding:24,gap:12,flexDirection:"column",children:e.model.variations.length>1?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",e.model.name," slice ",n.name," variation."]}),(0,i.jsx)("div",{children:"Other variations will be left untouched. To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",e.model.name,"."]}),(0,i.jsx)("div",{children:"To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]})}),(0,i.jsxs)(x.ah,{children:[(0,i.jsx)(x.ai,{}),(0,i.jsx)(x.af,{color:"tomato",onClick:()=>{t((0,H.Oh)({slice:e,variationId:n.id})),o(!1)},children:"Delete"})]})]})]})]}),(0,i.jsx)(q.rT,{type:"model",library:e.from,sliceId:e.model.id,variationId:n.id})]})},en=n(6277),ei=n(34887),er=n.n(ei);let eo=e=>{let{variant:t="dashed",color:n="currentColor",className:r}=e;return(0,i.jsx)("hr",{className:(0,en.W)(er()["variant-".concat(t)],r),style:{color:x.t.color[n]}})};var ea=n(51507),el=n(27763),es=n(21442);async function ed(e){try{let{errors:t}=await (0,d.Ve)(e.component);if(t.length>0)throw t;let{errors:n}=await (0,d.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id});if(n.length>0)throw n;(0,q.tB)({type:"model",library:e.component.from,sliceId:e.component.model.id,variationId:e.variation.id});let{slice:i,errors:r}=await (0,d.X$)(e.component.from,e.component.model.id);if(r.length>0)throw r;if(!i)throw Error("Could not read variation `".concat(e.variation.name,"`"));let{mocks:o}=await (0,d.pL)({libraryID:e.component.from,sliceID:e.component.model.id}),a=el.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:i.name,variationId:i.variations[0].id});await e.router.replace(a);let l={...e.component,model:i,mocks:o};return e.saveSliceSuccess(l),l}catch(n){let t="Could not delete variation `".concat(e.variation.name,"`");throw console.error(t,n),Z.Am.error(t),n}}let ec=e=>{let{isOpen:t,onClose:n,slice:r,variation:o}=e,l=(0,a.useRouter)(),[d,c]=(0,s.useState)(!1),{saveSliceSuccess:u}=(0,m.Z)(),{setSlice:h}=f();return(0,i.jsxs)(x.ae,{open:t,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.al,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(x.aj,{children:(0,i.jsxs)(x.D,{flexDirection:"column",children:[(0,i.jsxs)(x.bL,{color:"grey11",sx:{marginBlock:16,marginInline:16},children:["This action will remove the variation from the slice model and delete associated files. When you push your changes, the variation will disappear from your repository. This update will"," ",(0,i.jsx)(eu,{children:"not"})," affect your documents until you ",(0,i.jsx)(eu,{children:"edit"})," ","them manually."]}),(0,i.jsxs)(x.ah,{children:[(0,i.jsx)(x.ai,{size:"medium"}),(0,i.jsx)(x.af,{size:"medium",color:"tomato",onClick:()=>{o&&(async()=>{c(!0);try{let e=await ed({component:r,router:l,saveSliceSuccess:u,variation:o});h(e)}catch(e){}c(!1),n()})()},loading:d,children:"Delete"})]})]})})]})},eu=e=>(0,i.jsx)(x.bL,{...e,color:"inherit",component:"span",variant:"bold"});var em=n(30195);async function eh(e){try{let{errors:t}=await (0,d.Ve)(e.component);if(t.length>0)throw t;let{errors:n}=await (0,d.eH)(e.component,{...e.variation,name:e.variationName});if(n.length>0)throw n;let{slice:i,errors:r}=await (0,d.X$)(e.component.from,e.component.model.id);if(r.length>0)throw r;if(!i)throw Error("Could not read variation `".concat(e.variation.name,"`"));let{mocks:o}=await (0,d.pL)({libraryID:e.component.from,sliceID:e.component.model.id}),a={...e.component,model:i,mocks:o};return e.saveSliceSuccess(a),a}catch(n){let t="Could not rename variation `".concat(e.variation.name,"`");throw console.error(t,n),Z.Am.error(t),n}}let ep=e=>{let{isOpen:t,onClose:n,slice:r,variation:o}=e,[a,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[h,p]=(0,s.useState)(),{setSlice:v}=f(),{saveSliceSuccess:y}=(0,m.Z)();return(0,l.pQ)(t,()=>{if(t&&(null==o?void 0:o.name)!==c){var e;u(null!==(e=null==o?void 0:o.name)&&void 0!==e?e:""),p(void 0)}}),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(x.ae,{open:t,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.al,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(x.aj,{children:(0,i.jsxs)(x.aJ,{onSubmit:function(){if(!h&&o){d(!0);try{eh({component:r,saveSliceSuccess:y,variation:o,variationName:c.trim()}).then(e=>{v(e)})}catch(e){}d(!1),n()}},children:[(0,i.jsxs)(x.D,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(x.bL,{variant:"normal",color:"grey11",children:"This action will rename the variation in the slice model. When you push your changes, the variation will be renamed in your repository."}),(0,i.jsx)(x.D,{flexDirection:"column",gap:4,children:(0,i.jsx)(x.aM,{type:"text",label:"Variation name *",placeholder:"Variation name",error:h,value:c,onValueChange:function(e){u(e),p(function(e){let t=ef.safeParse(e,{errorMap:ev});if(t.error)return t.error.errors[0].message}(e))}})})]}),(0,i.jsxs)(x.ah,{children:[(0,i.jsx)(x.ai,{size:"medium"}),(0,i.jsx)(x.af,{type:"submit",size:"medium",loading:a,disabled:!!h,children:"Rename"})]})]})})]})})},ef=em.z.string().min(1),ev=e=>e.code===em.z.ZodIssueCode.too_small?{message:"This field is required"}:{message:"Invalid value"};var ex=n(68105),ey=n(63397),eg=n(96009),ej=n.n(eg),eb=n(36131),ew=n(75289),eC=n(30527);function eI(e){let{children:t}=e,n=(0,eC.W)();return(0,i.jsx)(ew.kC,{sx:{p:3,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})}var eS=e=>{let{children:t,FooterContent:n,HeaderContent:r,close:o,sx:a={}}=e;return(0,i.jsx)(eC.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:{border:"none",...a},Header:(0,i.jsxs)(eI,{children:[r,o?(0,i.jsx)(ew.x8,{onClick:o,type:"button"}):null]}),Footer:n?(0,i.jsxs)(ew.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(ew.xu,{sx:{ml:"auto"}}),n]}):null,children:t})},ek=n(55862);let eD=e=>{let{msg:t}=e;return(0,i.jsx)(ew.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:t||"Error!"})};var eT=e=>{let{isOpen:t,onClose:n,onSubmit:r,initialVariation:o,variations:a}=e,[l,d]=(0,s.useState)({}),[c,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(!0),[p,f]=(0,s.useState)(""),[v,y]=(0,s.useState)({value:o.id,label:o.name}),[g,j]=(0,s.useState)(!1);function b(){w(),n()}function w(){u(""),f(""),d({}),h(!0),y({value:o.id,label:o.name})}async function C(){let e=function(e){let{id:t,name:n,origin:i}=e,r=t&&t.length?null:{id:"Required!"},o=a.find(e=>e.id===t)?{id:"This id already exists!"}:null,l=n&&n.length?null:{name:"Required!"},s=i.value.length&&a.find(e=>e.id===i.value)?null:{id:"You must select an existing variation!"},d=t&&t.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(t)&&{id:"No special characters allowed"};return{...r,...o,...l,...s,...d}}({id:c,name:p,origin:v});if(Object.keys(e).length)d(e);else{let e=a.find(e=>e.id===v.value);e&&(j(!0),await r(c,p,e),j(!1),b())}}return(0,s.useEffect)(()=>{w()},[o,t]),(0,i.jsx)(ek.Z,{isOpen:t,shouldCloseOnOverlayClick:!0,onRequestClose:()=>b(),contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(ey.J9,{initialValues:{id:c,name:p,origin:v},onSubmit:C,children:(0,i.jsx)(ey.l0,{id:"variation-add",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),C())},children:(0,i.jsx)(x.D,{children:(0,i.jsxs)(eS,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(ew.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(x.D,{gap:16,alignItems:"center",children:[(0,i.jsx)(x.E,{onClick:b,color:"grey",children:"Cancel"}),(0,i.jsx)(x.E,{type:"submit",loading:g,children:"Submit"})]}),close:b,children:[(0,i.jsxs)(x.D,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(ew.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",l.name?(0,i.jsx)(eD,{msg:l.name}):""]}),(0,i.jsx)(ey.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:ew.II,maxLength:30,value:p,onChange:e=>{var t;f(t=e.currentTarget.value),m&&u(ej()(t))}}),(0,i.jsx)(ew.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(x.D,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(ew.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",l.id?(0,i.jsx)(eD,{msg:l.id}):""]}),(0,i.jsx)(ey.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. gridWithIcon",as:ew.II,maxLength:30,value:c,onChange:e=>{var t;return t=e.currentTarget.value,void(h(!1),u(ej()(t)))}}),(0,i.jsx)(ew.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(x.D,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(ew.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(eb.ZP,{name:"origin",options:a.map(e=>({value:e.id,label:e.name})),onChange:e=>{e&&y(e)},defaultValue:v,maxMenuHeight:150,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})]})})})})})},eE=n(20136),eA=n.n(eE);let eR=e=>{let{horizontalScroll:t=!1}=e,{slice:n,variation:r,setSlice:o}=f(),[l,c]=(0,s.useState)(),u=(0,es.H)(),{sliceFilterFn:h,defaultVariationSelector:p,onUploadSuccess:v}=u.modalPayload,y=(0,a.useRouter)(),{saveSliceSuccess:g}=(0,m.Z)(),j=n.model.variations.length;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x.D,{flexDirection:"column",gap:16,children:t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eo,{variant:"edgeFaded",color:"grey6"}),(0,i.jsxs)(x.D,{justifyContent:"space-between",children:[(0,i.jsxs)(x.bL,{color:"grey11",children:[j," variation",1!==j&&"s"]}),(0,i.jsx)(x.E,{onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",color:"grey",children:"Add a variation"})]}),(0,i.jsx)("div",{className:eA().hideScrollbar,style:{height:"240px",position:"relative",marginRight:"-32px",overflowX:"scroll",scrollSnapType:"x mandatory"},children:(0,i.jsx)("div",{style:{position:"absolute",paddingRight:"32px"},children:(0,i.jsx)(x.D,{flexDirection:"row",gap:16,children:(0,i.jsx)(eL,{screenshotChangesModal:u,setDialog:c,width:320})})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eL,{screenshotChangesModal:u,setDialog:c}),(0,i.jsx)("div",{style:{bottom:x.t.space[0],marginBottom:"-".concat(x.t.space[16]),position:"sticky"},children:(0,i.jsxs)(x.D,{backgroundColor:"grey2",flexDirection:"column",padding:{bottom:40,inline:24},children:[(0,i.jsx)(x.aS,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(x.E,{color:"grey",onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},children:"Add a variation"})]})})]})}),(0,i.jsx)(ex.Z,{slices:h([n]),defaultVariationSelector:p,onUploadSuccess:v}),(0,i.jsx)(ep,{isOpen:(null==l?void 0:l.type)==="RENAME_VARIATION",onClose:()=>{c(void 0)},slice:n,variation:null==l?void 0:l.variation}),(0,i.jsx)(ec,{isOpen:(null==l?void 0:l.type)==="DELETE_VARIATION",onClose:()=>{c(void 0)},slice:n,variation:null==l?void 0:l.variation}),(0,i.jsx)(eT,{initialVariation:r,isOpen:(null==l?void 0:l.type)==="ADD_VARIATION",onClose:()=>{c(void 0)},onSubmit:async(e,t,i)=>{try{let{slice:r,variation:a}=(0,H.Kp)({slice:n,id:e,name:t,copiedVariation:i});await (0,d.Ve)(r),g(r),o(r);let l=el.Y.getBuilderPagePathname({libraryName:r.href,sliceName:r.model.name,variationId:a.id});y.replace(l)}catch(n){let e="Could not add variation `".concat(t,"`");console.error(e,n),Z.Am.error(e)}},variations:n.model.variations})]})},eL=e=>{let{screenshotChangesModal:t,setDialog:n,width:r}=e,{slice:o,variation:a,setSlice:l}=f(),s={scrollSnapAlign:"start"};return(0,i.jsx)(i.Fragment,{children:o.model.variations.map(e=>(0,i.jsx)("div",{style:void 0!==r?{...s,width:r}:s,children:(0,i.jsx)(ea.b,{action:{type:"menu",onRename:()=>{n({type:"RENAME_VARIATION",variation:e})},onRemove:()=>{n({type:"DELETE_VARIATION",variation:e})},removeDisabled:o.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:()=>{t.onOpenModal({sliceFilterFn:e=>e,defaultVariationSelector:{sliceID:o.model.id,variationID:e.id},onUploadSuccess:e=>{l(e)}})},replace:!0,selected:e.id===a.id,slice:o,variant:"outlined",variationId:e.id},e.id)},e.id))})};var e_=()=>{let{slice:e,actionQueueStatus:t}=f(),n=(0,x.cj)({max:"large"});return(0,i.jsxs)(A.LN,{children:[(0,i.jsxs)(A.wd,{children:[(0,i.jsx)(A.Xq,{url:"/slices"}),(0,i.jsxs)(A.Cx,{children:[(0,i.jsx)(y.g,{children:"Slices"}),(0,i.jsx)(y.g,{active:!0,children:e.model.name})]}),(0,i.jsxs)(A.K2,{children:[(0,i.jsx)(g.X,{status:t}),(0,i.jsx)(M,{disabled:"done"!==t})]})]}),(0,i.jsxs)(A.RN,{children:[(0,i.jsxs)(x.D,{display:"grid",alignItems:"flex-start",gap:16,...n?{gridTemplateRows:"304px 1fr"}:{gridTemplateColumns:"320px 1fr"},children:[(0,i.jsx)(eR,{horizontalScroll:n}),(0,i.jsx)(et,{})]}),(0,i.jsx)(T,{})]})]})};function eF(){let e=(0,a.useRouter)(),{slice:t,variation:n}=(0,v.Z)();return void 0===t||void 0===n?(e.replace("/"),null):(0,i.jsx)(p,{initialSlice:t,children:e=>{let{slice:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:(0,i.jsxs)("title",{children:[t.model.name," - Slice Machine"]})}),(0,i.jsx)(e_,{})]})}})}},34887:function(e){e.exports={base:"Divider_base__4eT6E","variant-dashed":"Divider_variant-dashed__4Lvrj Divider_base__4eT6E","variant-edgeFaded":"Divider_variant-edgeFaded__049V2 Divider_base__4eT6E"}},20136:function(e){e.exports={hideScrollbar:"VariationsList_hideScrollbar__cHCIS"}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return j}});var i=n(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(52322);var o=["shift","alt","meta","mod","ctrl"],a={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,t){return void 0===t&&(t=","),e.split(t)}function d(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return l(e)}),a={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},s=i.filter(function(e){return!o.includes(e)});return r({},a,{keys:s,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&m([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&h([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){c.clear()});var c=new Set;function u(e){return Array.isArray(e)}function m(e){var t=Array.isArray(e)?e:[e];c.has("meta")&&c.forEach(function(e){return!o.includes(e)&&c.delete(e.toLowerCase())}),t.forEach(function(e){return c.add(e.toLowerCase())})}function h(e){var t=Array.isArray(e)?e:[e];"meta"===e?c.clear():t.forEach(function(e){return c.delete(e.toLowerCase())})}function p(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var f=function(e,t,n){void 0===n&&(n=!1);var i,r=t.alt,o=t.meta,a=t.mod,s=t.shift,d=t.ctrl,m=t.keys,h=e.key,p=e.code,f=e.ctrlKey,v=e.metaKey,x=e.shiftKey,y=e.altKey,g=l(p),j=h.toLowerCase();if(!n){if(!y===r&&"alt"!==j||!x===s&&"shift"!==j)return!1;if(a){if(!v&&!f)return!1}else if(!v===o&&"meta"!==j&&"os"!==j||!f===d&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===i&&(i=","),(u(m)?m:m.split(i)).every(function(e){return c.has(e.trim().toLowerCase())})):!m)},v=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function j(e,t,n,r){var o,a=(0,i.useRef)(null),c=(0,i.useRef)(!1),j=n instanceof Array?r instanceof Array?void 0:r:n,b=u(e)?e.join(null==j?void 0:j.splitKey):e,w=n instanceof Array?n:r instanceof Array?r:void 0,C=(0,i.useCallback)(t,null!=w?w:[]),I=(0,i.useRef)(C);w?I.current=C:I.current=t;var S=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,r){return i&&e(t[r],n[r])},!0):t===n}((o=(0,i.useRef)(void 0)).current,j)&&(o.current=j),o.current),k=(0,i.useContext)(x).enabledScopes,D=(0,i.useContext)(v);return g(function(){if((null==S?void 0:S.enabled)!==!1&&(e=null==S?void 0:S.scopes,0===k.length&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!e||k.some(function(t){return e.includes(t)})||k.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(p(e,["input","textarea","select"])&&!p(e,null==S?void 0:S.enableOnFormTags)||null!=S&&null!=S.ignoreEventWhen&&S.ignoreEventWhen(e))){if(null!==a.current&&document.activeElement!==a.current&&!a.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=S&&S.enableOnContentEditable)&&s(b,null==S?void 0:S.splitKey).forEach(function(n){var i,r,o,a=d(n,null==S?void 0:S.combinationKey);if(f(e,a,null==S?void 0:S.ignoreModifiers)||null!=(o=a.keys)&&o.includes("*")){if(t&&c.current)return;if(("function"==typeof(i=null==S?void 0:S.preventDefault)&&i(e,a)||!0===i)&&e.preventDefault(),"function"==typeof(r=null==S?void 0:S.enabled)?!r(e,a):!0!==r&&void 0!==r){y(e);return}I.current(e,a),t||(c.current=!0)}})}},n=function(e){void 0!==e.key&&(m(l(e.code)),((null==S?void 0:S.keydown)===void 0&&(null==S?void 0:S.keyup)!==!0||null!=S&&S.keydown)&&t(e))},i=function(e){void 0!==e.key&&(h(l(e.code)),c.current=!1,null!=S&&S.keyup&&t(e,!0))},r=a.current||(null==j?void 0:j.document)||document;return r.addEventListener("keyup",i),r.addEventListener("keydown",n),D&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return D.addHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))}),function(){r.removeEventListener("keyup",i),r.removeEventListener("keydown",n),D&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return D.removeHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))})}}},[b,S,k]),a}}},function(e){e.O(0,[898,789,917,525,461,139,397,183,50,349,34,630,658,888,774,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,t,n){var i=n(34311),o=n(23779),r=i(function(e,t,n){return e+(n?" ":"")+o(t)});e.exports=r},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 f},tB:function(){return u}});var i=n(52322),o=n(14226),r=n(2784),l=n(30195),s=n(94160),c=n(76611),a=n(5683);function d(e){let{type:t,library:n,sliceId:i,variationId:o,langSmithUrl:r}=e,l=(0,a.i)({type:t,library:n,sliceId:i,variationId:o}),s=JSON.stringify({langSmithUrl:r});localStorage.setItem(l,s)}function u(e){let{type:t,library:n,sliceId:i,variationId:o}=e,r=(0,a.i)({type:t,library:n,sliceId:i,variationId:o});localStorage.removeItem(r)}function f(e){let{type:t,library:n,sliceId:d,variationId:u}=e,{key:f,value:m,done:x}=function(e){let{type:t,library:n,sliceId:i,variationId:o}=e,r=(0,a.i)({type:t,library:n,sliceId:i,variationId:o}),[s,d]=(0,c.V)(r,void 0,{schema:l.z.object({langSmithUrl:l.z.string().url().optional()})});return{key:r,value:s,done:()=>d(void 0)}}({type:t,library:n,sliceId:d,variationId:u}),[h,p]=(0,r.useState)(),v=e=>()=>{m&&(p(f),s.Xe.track({event:"slice-generation-feedback",type:t,sliceId:d,variationId:u,feedback:e,langSmithUrl:m.langSmithUrl}),x())};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:!!h,onOpenChange:e=>{e||p(void 0)}},h)}),(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:v("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:v("down")})})]})]})})]})}},76611:function(e,t,n){"use strict";n.d(t,{V:function(){return o}});var i=n(2784);function o(e,t,n){let{schema:o}=null!=n?n:{},r=()=>{try{let n=localStorage.getItem(e);if(null==n)return t;if(!o)return JSON.parse(n);return o.parse(JSON.parse(n))}catch(e){return t}},[l,s]=(0,i.useState)(r),[c,a]=(0,i.useState)(e);return c!==e&&(a(e),s(r())),[l,(0,i.useCallback)(n=>{s(i=>{let o;if(void 0===(o="function"==typeof n?n(i):n)){try{localStorage.removeItem(e)}catch(e){return i}return t}try{localStorage.setItem(e,JSON.stringify(o))}catch(e){return i}return o})},[e,t])]}},33986:function(e,t,n){"use strict";n.d(t,{z:function(){return c}});var i=n(52322),o=n(2784),r=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",s=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},c=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:c,form:a,isLoading:d=!1,disabled:u=!1,onClick:f,sx:m={},iconSize:x=16,iconFill:h,variant:p="primary",...v}=e;return(0,i.jsx)(r.zx,{ref:t,sx:{...m,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:c,form:a,disabled:u||d,onClick:d?void 0:f,variant:p,...v,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$j,{size:x,color:s(p),"data-testid":l(v["data-testid"],"spinner")}),o&&n]}):(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(o,{size:x,fill:h,"data-testid":l(v["data-testid"],"icon")}),n]})})})},46999:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var i=n(52322),o=n(63397);n(2784);var r=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:s,testId:c,onChange:a}=e;return(0,i.jsxs)(r.xu,{mb:3,children:[(0,i.jsx)(r.__,{htmlFor:t,mb:2,children:n}),(0,i.jsx)(o.gN,{name:t,type:"text",placeholder:l,as:r.II,autoComplete:"off",...a?{onChange:a}:null,...c?{"data-testid":c}:null}),s?(0,i.jsx)(r.xv,{"data-testid":c?"".concat(c,"-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),r=n(37149),l=n.n(r),s=n(75289),c=n(33986),a=n(55862),d=n(30527);function u(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:r,formId:f,validate:m,onSubmit:x,widthInPx:h,initialValues:p,content:{title:v},cardProps:y,omitFooter:g=!1,isLoading:b=!1,buttonLabel:j="Save",testId:S,actionMessage:k}=e;return l().setAppElement("#__next"),(0,i.jsx)(a.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:v,style:{content:{width:null!=h?h:"900px"}},children:(0,i.jsx)(o.J9,{initialValues:p,validate:e=>m?m(e):void 0,onSubmit:e=>{x(e)},children:e=>{let{isValid:r,isSubmitting:l,values:a,errors:m,touched:x,setFieldValue:h,setValues:p}=e;return(0,i.jsx)(o.l0,{id:f,...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"},...y,Header:(0,i.jsxs)(u,{children:[(0,i.jsx)(s.X6,{sx:{fontSize:"20px"},children:v}),(0,i.jsx)(s.x8,{type:"button",onClick:n})]}),Footer:g?null:(0,i.jsxs)(s.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(s.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof k?k(e):k}),(0,i.jsxs)(s.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(s.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||b,children:"Cancel"}),(0,i.jsx)(c.z,{label:j,form:f,type:"submit",disabled:!r||l||b,isLoading:l||b,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:r,isSubmitting:l,values:a,errors:m,touched:x,setFieldValue:h,setValues:p})})})}})})}},31562:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return V}});var i=n(52322),o=n(14226),r=n(97729),l=n.n(r),s=n(5632),c=n(2784),a=n(56580),d=n(88932),u=n(65077),f=n(75289),m=n(43388),x=n(91589),h=n(27213),p=n(51507),v=n(27763),y=n(21442),g=n(69300),b=n(65186),j=n(59326),S=n(34166),k=n(80148);async function w(e){let{sliceName:t,sliceID:n,libraryID:i,sliceVariationIds:o,onSuccess:r}=e;try{let{errors:e}=await k.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})}),r(),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 C=n(68968),I=n(33986),L=n(30527),E=n(55862),O=n(54597);let R=e=>{var t;let{isOpen:n,libName:o,sliceId:r,sliceName:l,sliceVariationIds:s,onClose:a}=e,[d,u]=(0,c.useState)(!1),{deleteSliceSuccess:m}=(0,O.Z)(),{syncChanges:x}=(0,C.g)(),{theme:h}=(0,j.B7)(),p=async()=>{u(!0),await w({libraryID:o,sliceID:r,sliceName:l,sliceVariationIds:s,onSuccess:()=>{m(r,o),x()}}),a(),u(!1)};return(0,i.jsx)(E.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:a,children:(0,i.jsx)(L.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)(f.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)(f.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(b.$vK,{size:20,color:null===(t=h.colors)||void 0===t?void 0:t.greyIcon}),(0,i.jsx)(f.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(f.x8,{type:"button",onClick:a})]}),Footer:()=>(0,i.jsxs)(f.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)(I.z,{label:"Cancel",variant:"secondary",onClick:a,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(I.z,{label:"Delete",variant:"danger",isLoading:d,sx:{minHeight:39,minWidth:78},onClick:()=>{p()}})]}),children:(0,i.jsxs)(f.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)(f.xv,{sx:{fontWeight:"bold"},children:[o,"/",l,"/"]})," ","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 A=n(36887),N=n(94160),z=e=>{let{title:t,onCreateNew:n,buttonText:o,documentationComponent:r,videoPublicIdUrl:l,...s}=e;return(0,i.jsxs)(f.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...s,children:[(0,i.jsx)(f.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)(A.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:()=>{N.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,i.jsxs)(f.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)(f.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)(f.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(f.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:r})]}),(0,i.jsxs)(f.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsx)(f.zx,{onClick:n,"data-testid":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:o}),(0,i.jsx)(f.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"})]})]})]})},D=n(6256),W=n(63908),P=n(26109);async function _(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,W.PQ)(t,n),{errors:o}=await k.managerClient.slices.renameSlice({libraryID:t.from,model:P.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 F=n(7723),Z=n(59532),T=n(46999),B=n(63019);let K=e=>{var t,n;let{slice:o,isOpen:r,onClose:l}=e,{renameSliceSuccess:s}=(0,O.Z)(),{syncChanges:c}=(0,C.g)(),{localLibs:d,remoteLibs:u}=(0,a.v9)(e=>({localLibs:(0,F.Sd)(e),remoteLibs:(0,F.sT)(e)})),m=null!==(t=null==o?void 0:o.model.name)&&void 0!==t?t:"",x=async e=>{o&&(await _({slice:o,newSliceName:e.sliceName,onSuccess:e=>{s(e.from,e.model),c()}}),l())};return(0,i.jsx)(Z.Z,{testId:"rename-slice-modal",isOpen:r,widthInPx:"530px",formId:"rename-slice-modal-".concat(null!==(n=null==o?void 0:o.model.id)&&void 0!==n?n:""),close:l,buttonLabel:"Rename",onSubmit:e=>void x(e),initialValues:{sliceName:m},content:{title:"Rename a slice"},validate:e=>(0,B.h)(e,d,u),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(f.xu,{children:(0,i.jsx)(T.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),X=n(68105),U=n(39204),M=n(7974),V=()=>{var e,t,n,r;let b=(0,s.useRouter)(),{modalPayload:j,onOpenModal:S}=(0,y.H)(),{openLoginModal:w}=(0,O.Z)(),C=(0,h.F)({menuType:"Dropdown"}),{sliceFilterFn:I,defaultVariationSelector:L}=j,{remoteSlices:E,libraries:A}=(0,a.v9)(e=>({remoteSlices:(0,F.sT)(e),libraries:(0,F.Sd)(e)})),[N,W]=(0,c.useState)(!1),[P,_]=(0,c.useState)(!1),[Z,T]=(0,c.useState)(!1),[B,V]=(0,c.useState)(!1),J=A.filter(e=>e.isLocal),q=A.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),Q=(A||[]).map(e=>e.components).flat(),Y=Q.length,[G,$]=(0,c.useState)(),ee=()=>{_(!0)},et=()=>{T(!0)},en=async()=>{await k.managerClient.user.checkIsLoggedIn()?V(!0):w()},ei=()=>{V(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Slices - Slice Machine"})}),(0,i.jsxs)(g.LN,{children:[(0,i.jsxs)(g.wd,{children:[(0,i.jsx)(g.Cx,{children:(0,i.jsx)(m.g,{children:"Slices"})}),(null==J?void 0:J.length)!==0&&0!==Y?(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:()=>C.fromImage.BackgroundIcon,onSelect:()=>void en(),description:C.fromImage.description,children:C.fromImage.title}),(0,i.jsx)(o.at,{renderStartIcon:()=>C.fromScratch.BackgroundIcon,onSelect:()=>W(!0),description:C.fromScratch.description,children:C.fromScratch.title})]})]}):void 0]}),(0,i.jsxs)(g.RN,{children:[(0,i.jsx)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:q.length>0?(0,i.jsx)(f.kC,{sx:{flex:1,flexDirection:"column"},children:0===Y?(0,i.jsx)(f.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(z,{title:"What are slices?",onCreateNew:()=>{W(!0)},buttonText:"Create one",videoPublicIdUrl:M.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)(f.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"})}):q.map(e=>{let{name:t,isLocal:n,components:o}=e;return(0,i.jsxs)(f.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(f.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(f.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(f.xv,{children:1===q.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)(p.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==J?void 0:J.length)>0&&(0,i.jsx)(X.Z,{slices:I(Q),defaultVariationSelector:L}),(null==J?void 0:J.length)>0&&N&&(0,i.jsx)(D.c,{localLibraries:J,location:"slices",remoteSlices:E,onSuccess:(e,t)=>{let n=e.variations[0].id,i=v.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});b.push(i),d.Am.success((0,U.kQ)({path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{W(!1)}}),(0,i.jsx)(K,{isOpen:Z,slice:G,onClose:()=>{T(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(R,{isOpen:P,libName:null!==(e=null==G?void 0:G.from)&&void 0!==e?e:"",sliceId:null!==(t=null==G?void 0:G.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==G?void 0:G.model.name)&&void 0!==n?n:"",sliceVariationIds:(null!==(r=null==G?void 0:G.model.variations)&&void 0!==r?r:[]).map(e=>e.id),onClose:()=>{_(!1)}}),(0,i.jsx)(x.S,{open:B,location:"slices",onSuccess:e=>{let{library:t}=e;d.Am.success((0,i.jsx)(U.GX,{message:"Slice(s) added to slice zone and created at: ",path:t})),ei()},onClose:ei})]})]})]})}},5683:function(e,t,n){"use strict";n.d(t,{i:function(){return r},v:function(){return o}});let i=e=>"slice-machine_".concat(e),o=i("staticFieldsInfoDialogDismissed");function r(e){let{type:t,library:n,sliceId:o,variationId:r}=e;return i(["ai-feedback",t,n,o,r].join("#"))}},76473:function(e,t,n){"use strict";n.d(t,{y1:function(){return b}});var i=n(2784);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n(52322);var r=["shift","alt","meta","mod","ctrl"],l={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function s(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,t){return void 0===t&&(t=","),e.split(t)}function a(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return s(e)}),l={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod")},c=i.filter(function(e){return!r.includes(e)});return o({},l,{keys:c,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){d.clear()});var d=new Set;function u(e){return Array.isArray(e)}function f(e){var t=Array.isArray(e)?e:[e];d.has("meta")&&d.forEach(function(e){return!r.includes(e)&&d.delete(e.toLowerCase())}),t.forEach(function(e){return d.add(e.toLowerCase())})}function m(e){var t=Array.isArray(e)?e:[e];"meta"===e?d.clear():t.forEach(function(e){return d.delete(e.toLowerCase())})}function x(e,t){var n=e.target;void 0===t&&(t=!1);var i=n&&n.tagName;return u(t)?!!(i&&t&&t.some(function(e){return e.toLowerCase()===i.toLowerCase()})):!!(i&&t&&!0===t)}var h=function(e,t,n){void 0===n&&(n=!1);var i,o=t.alt,r=t.meta,l=t.mod,c=t.shift,a=t.ctrl,f=t.keys,m=e.key,x=e.code,h=e.ctrlKey,p=e.metaKey,v=e.shiftKey,y=e.altKey,g=s(x),b=m.toLowerCase();if(!n){if(!y===o&&"alt"!==b||!v===c&&"shift"!==b)return!1;if(l){if(!p&&!h)return!1}else if(!p===r&&"meta"!==b&&"os"!==b||!h===a&&"ctrl"!==b&&"control"!==b)return!1}return!!(f&&1===f.length&&(f.includes(b)||f.includes(g)))||(f?(void 0===i&&(i=","),(u(f)?f:f.split(i)).every(function(e){return d.has(e.trim().toLowerCase())})):!f)},p=(0,i.createContext)(void 0),v=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,t,n,o){var r,l=(0,i.useRef)(null),d=(0,i.useRef)(!1),b=n instanceof Array?o instanceof Array?void 0:o:n,j=u(e)?e.join(null==b?void 0:b.splitKey):e,S=n instanceof Array?n:o instanceof Array?o:void 0,k=(0,i.useCallback)(t,null!=S?S:[]),w=(0,i.useRef)(k);S?w.current=k:w.current=t;var C=(!function e(t,n){return t&&n&&"object"==typeof t&&"object"==typeof n?Object.keys(t).length===Object.keys(n).length&&Object.keys(t).reduce(function(i,o){return i&&e(t[o],n[o])},!0):t===n}((r=(0,i.useRef)(void 0)).current,b)&&(r.current=b),r.current),I=(0,i.useContext)(v).enabledScopes,L=(0,i.useContext)(p);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=null==C?void 0:C.scopes,0===I.length&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!e||I.some(function(t){return e.includes(t)})||I.includes("*")))){var e,t=function(e,t){var n;if(void 0===t&&(t=!1),!(x(e,["input","textarea","select"])&&!x(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){y(e);return}(null==(n=e.target)||!n.isContentEditable||null!=C&&C.enableOnContentEditable)&&c(j,null==C?void 0:C.splitKey).forEach(function(n){var i,o,r,l=a(n,null==C?void 0:C.combinationKey);if(h(e,l,null==C?void 0:C.ignoreModifiers)||null!=(r=l.keys)&&r.includes("*")){if(t&&d.current)return;if(("function"==typeof(i=null==C?void 0:C.preventDefault)&&i(e,l)||!0===i)&&e.preventDefault(),"function"==typeof(o=null==C?void 0:C.enabled)?!o(e,l):!0!==o&&void 0!==o){y(e);return}w.current(e,l),t||(d.current=!0)}})}},n=function(e){void 0!==e.key&&(f(s(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},i=function(e){void 0!==e.key&&(m(s(e.code)),d.current=!1,null!=C&&C.keyup&&t(e,!0))},o=l.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",i),o.addEventListener("keydown",n),L&&c(j,null==C?void 0:C.splitKey).forEach(function(e){return L.addHotkey(a(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){o.removeEventListener("keyup",i),o.removeEventListener("keydown",n),L&&c(j,null==C?void 0:C.splitKey).forEach(function(e){return L.removeHotkey(a(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[j,C,I]),l}}},function(e){e.O(0,[898,789,397,50,34,658,907,888,774,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
package/out/changelog.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/870-a72b74312773efea.js" defer=""></script><script src="/_next/static/chunks/pages/changelog-885b62071995472b.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changelog","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/changes.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/d98ebc475f8423a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d98ebc475f8423a3.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/d98ebc475f8423a3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d98ebc475f8423a3.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/8eec4907-b712959d9f984b68.js" defer=""></script><script src="/_next/static/chunks/918-fa4f2563cb5fd014.js" defer=""></script><script src="/_next/static/chunks/34-8d9d9b2944824750.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/pages/changes-59ed9aa810ee25d8.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changes","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/349-7118116b93278f73.js" defer=""></script><script src="/_next/static/chunks/422-c9192a1dbdd2ae0e.js" defer=""></script><script src="/_next/static/chunks/34-8d9d9b2944824750.js" defer=""></script><script src="/_next/static/chunks/647-4379a741c8d85d9e.js" defer=""></script><script src="/_next/static/chunks/630-bb6e3db525588f16.js" defer=""></script><script src="/_next/static/chunks/907-445266211c48b1a5.js" defer=""></script><script src="/_next/static/chunks/489-cc596f7f75c0f276.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types/%5BcustomTypeId%5D-816acb31b652239b.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types/[customTypeId]","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/custom-types.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/647-4379a741c8d85d9e.js" defer=""></script><script src="/_next/static/chunks/248-a0f75ea6d214b7bb.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types-5acd56959b60346f.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/4e475d945cf8a890.css" as="style"/><link rel="stylesheet" href="/_next/static/css/4e475d945cf8a890.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/647-4379a741c8d85d9e.js" defer=""></script><script src="/_next/static/chunks/248-a0f75ea6d214b7bb.js" defer=""></script><script src="/_next/static/chunks/pages/index-0d8cb369de720a35.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/labs.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/pages/labs-7b37be457758b99e.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/labs","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/56f2a6684a524374.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56f2a6684a524374.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/349-7118116b93278f73.js" defer=""></script><script src="/_next/static/chunks/422-c9192a1dbdd2ae0e.js" defer=""></script><script src="/_next/static/chunks/34-8d9d9b2944824750.js" defer=""></script><script src="/_next/static/chunks/647-4379a741c8d85d9e.js" defer=""></script><script src="/_next/static/chunks/630-bb6e3db525588f16.js" defer=""></script><script src="/_next/static/chunks/907-445266211c48b1a5.js" defer=""></script><script src="/_next/static/chunks/489-cc596f7f75c0f276.js" defer=""></script><script src="/_next/static/chunks/pages/page-types/%5BpageTypeId%5D-669d5479e81b638b.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/page-types/[pageTypeId]","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/72585f70-28b4d7d5384b3703.js" defer=""></script><script src="/_next/static/chunks/157-54b8336d20b41933.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D/simulator-b127d948a17968d3.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]/simulator","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/cdee5b195444f185.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cdee5b195444f185.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/cdee5b195444f185.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cdee5b195444f185.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/f36c6662-1f3a854183168b10.js" defer=""></script><script src="/_next/static/chunks/4c744e84-480e426e4b1cfef3.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-09fb3b997ad1eb70.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/183-4ea255b867ff171b.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/349-7118116b93278f73.js" defer=""></script><script src="/_next/static/chunks/34-8d9d9b2944824750.js" defer=""></script><script src="/_next/static/chunks/630-bb6e3db525588f16.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D-aada88bbe87e7761.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/slices.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/efa5152b7c0f35c0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/efa5152b7c0f35c0.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/303dad78be1eb854.css" as="style"/><link rel="stylesheet" href="/_next/static/css/303dad78be1eb854.css" data-n-g=""/><link rel="preload" href="/_next/static/css/efa5152b7c0f35c0.css" as="style"/><link rel="stylesheet" href="/_next/static/css/efa5152b7c0f35c0.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-072c48920e55dbad.js" defer=""></script><script src="/_next/static/chunks/59b4e022-ef680789f7cc9b11.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/397-e6c340070a3bcb41.js" defer=""></script><script src="/_next/static/chunks/50-586dc7ab5e584e76.js" defer=""></script><script src="/_next/static/chunks/34-8d9d9b2944824750.js" defer=""></script><script src="/_next/static/chunks/658-8231c0b729e0124a.js" defer=""></script><script src="/_next/static/chunks/907-445266211c48b1a5.js" defer=""></script><script src="/_next/static/chunks/pages/slices-1e5cccae3acd7718.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_buildManifest.js" defer=""></script><script src="/_next/static/3CkSC2gDewlCqET0rgfAp/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices","query":{},"buildId":"3CkSC2gDewlCqET0rgfAp","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slice-machine-ui",
|
|
3
|
-
"version": "2.18.1-beta.
|
|
3
|
+
"version": "2.18.1-beta.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A visual builder for your Slice Models with all the tools you need to generate data models and mock CMS content locally.",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"start-slicemachine": "./bin/start-slicemachine.cjs"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@slicemachine/manager": "0.25.3-beta.
|
|
39
|
-
"start-slicemachine": "0.12.61-beta.
|
|
38
|
+
"@slicemachine/manager": "0.25.3-beta.3",
|
|
39
|
+
"start-slicemachine": "0.12.61-beta.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@emotion/react": "11.11.1",
|
|
@@ -49,9 +49,6 @@
|
|
|
49
49
|
"@prismicio/mocks": "2.14.0",
|
|
50
50
|
"@prismicio/simulator": "0.1.4",
|
|
51
51
|
"@prismicio/types-internal": "3.11.2",
|
|
52
|
-
"@radix-ui/react-hover-card": "1.0.6",
|
|
53
|
-
"@radix-ui/react-tabs": "1.0.4",
|
|
54
|
-
"@radix-ui/react-visually-hidden": "1.1.1",
|
|
55
52
|
"@reach/menu-button": "0.18.0",
|
|
56
53
|
"@sentry/nextjs": "7.43.0",
|
|
57
54
|
"@storybook/addon-essentials": "7.0.10",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[248],{72641:function(e,t,n){"use strict";n.d(t,{R$:function(){return i},Qj:function(){return x},T9:function(){return d},nf:function(){return h},u2:function(){return o},_T:function(){return u}});var l=n(52322),r=n(14226),a=n(6277),s=n(83478),c=n.n(s);let i=e=>{let{backgroundImage:t,style:n,...r}=e,s=void 0!==t;return(0,l.jsx)("article",{...r,className:(0,a.W)(c().root,{[c().withBackground]:s}),style:{backgroundImage:s?"url(".concat(t,")"):void 0,...n}})},o=e=>(0,l.jsx)("div",{...e,className:c().image}),d=e=>(0,l.jsx)("div",{...e,className:c().content}),u=e=>(0,l.jsx)(r.bL,{...e,variant:"h3"}),h=e=>(0,l.jsx)(r.bL,{...e,color:"grey11"}),x=e=>(0,l.jsx)("div",{...e,className:c().actions,color:"grey"})},38241:function(e,t,n){"use strict";n.d(t,{F:function(){return O}});var l=n(52322),r=n(14226),a=n(97729),s=n.n(a),c=n(2784),i=n(43388),o=n(17378),d=n(98564),u=n(2993),h=n(5632),x=n(56580),m=n(75289),p=n(77630),j=n(88932),g=n(94160),b=n(39204);async function f(e){let{id:t,label:n,repeatable:l,format:r,onSuccess:a}=e,s=d.$[r],c=(0,p.Ue)({id:t,label:n,repeatable:l,format:r});try{let{errors:e}=await (0,g.KA)({customType:c});if(e.length>0)throw e;g.Xe.track({event:"custom-type:created",id:c.id,name:n,format:r,type:l?"repeatable":"single",origin:"table"}),await a(c),j.Am.success((0,b.GX)({message:"".concat(s.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")}))}catch(t){let e="Internal Error: ".concat(s.name({start:!0,plural:!1})," not saved");console.error(e,t),j.Am.error(e)}}var v=n(59294),_=n(98250),S=n(68968),y=n(59532),C=n(7974),k=n(358),w=n(78254),L=n(54597),I=n(46999),R=n(63397);let B=e=>{let{selected:t,...n}=e;return(0,l.jsx)(m.kC,{sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:t?e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}:"none","&:hover":{boxShadow:e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}}},...n})},N=e=>{let{format:t}=e,[n,,r]=(0,R.U$)("repeatable"),a=d.$[t];return(0,l.jsxs)(m.xu,{mb:2,children:[(0,l.jsxs)(B,{selected:n.value,onClick:()=>r.setValue(!0),children:[(0,l.jsx)(m.Y8,{checked:n.value,onChange:()=>{},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(B,{selected:!n.value,onClick:()=>r.setValue(!1),children:[(0,l.jsx)(m.Y8,{checked:!n.value,onChange:()=>{},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},z=e=>{let{format:t,isCreating:n,isOpen:r,origin:a="table",onCreateChange:s,onOpenChange:i}=e,{createCustomTypeSuccess:o}=(0,L.Z)(),{completeStep:u}=(0,_.k)(),{customTypeIds:j,customTypeLabels:g}=(0,x.v9)(e=>({customTypeIds:(0,w.W6)(e),customTypeLabels:(0,w.YS)(e)})),b=d.$[t],[R,B]=(0,c.useState)(!0),{syncChanges:z}=(0,S.g)(),E=(0,h.useRouter)(),T=async e=>{let{id:n,label:l,repeatable:r}=e;s(!0),await f({format:t,id:n,label:l,origin:a,repeatable:r,onSuccess:async e=>{o(e);let t=(0,p.y6)(e),l=v.cd[t];B(!0),await E.push({pathname:l.getBuilderPagePathname(n)}),z(),"page"===t&&u("createPageType")}}),s(!1),i(!1)},G=(e,t,n)=>{n(R?{...t,label:e.target.value,id:(0,k.lV)(e.target.value)}:{...t,label:e.target.value})},D=(e,t)=>{t("id",e.target.value),B(!1)};return(0,l.jsx)(y.Z,{testId:"create-ct-modal",isOpen:r,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:()=>{i(!1),B(!0)},onSubmit:e=>{T(e)},isLoading:n,initialValues:{repeatable:!0,id:"",label:""},validate:e=>{let{id:t,label:n}=e,l={};return n&&n.length||(l.label="Cannot be empty."),!l.label&&g.includes(n)&&(l.label="".concat(b.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(n.toLowerCase())&&(l.label='Name "'.concat(n,'" is reserved for Slice Machine use.')),t&&t.length||(l.id="ID cannot be empty."),["update","insert"].includes(t.toLowerCase())&&(l.id='Id "'.concat(t,'" is reserved for Slice Machine use.')),l.id||!t||C.xo.exec(t)||(l.id="Invalid id: No special characters allowed."),!l.id&&t&&j.map(e=>e.toLowerCase()).includes(t)&&(l.id='ID "'.concat(t,'" exists already.')),Object.keys(l).length>0?l:void 0},content:{title:"Create a new ".concat(b.name({start:!1,plural:!1}))},children:e=>{let{errors:n,setValues:r,setFieldValue:a,values:s,touched:c}=e;return(0,l.jsxs)(m.xu,{children:[(0,l.jsx)(N,{format:t}),(0,l.jsx)(I.W,{name:"label",label:"".concat(b.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(b.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:e=>G(e,s,r)}),(0,l.jsx)(I.W,{name:"id",testId:"ct-id-input",label:"".concat(b.name({start:!0,plural:!1})," ID"),placeholder:b.inputPlaceholder,error:c.id?n.id:void 0,onChange:e=>D(e,a)})]})}})};var E=n(72641);let T=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc"}),(0,l.jsx)("path",{d:"m10.0912 8c-2.8118 0-5.0912 2.2794-5.0912 5.0912s2.2794 5.0912 5.0912 5.0912c1.8851 0 3.5303-1.0247 4.4098-2.5452.1553-.2684.2868-.5523.3916-.8489.092-.2604-.0444-.5461-.3048-.6381-.2603-.092-.546.0445-.638.3048-.0841.238-.1897.4659-.3144.6815-.7081 1.2241-2.0305 2.0459-3.5442 2.0459-2.2595 0-4.0912-1.8317-4.0912-4.0912s1.8317-4.0912 4.0912-4.0912c1.3566 0 2.5595.66 3.3043 1.6782h-1.7739c-.2761 0-.5.2239-.5.5 0 .2762.2239.5.5.5h2.6782c.2762 0 .5-.2238.5-.5v-2.6782c0-.2761-.2238-.5-.5-.5-.2761 0-.5.2239-.5.5v1.1032c-.9281-.9865-2.2462-1.6032-3.7086-1.6032z",fill:"#fff"})]}),G=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m8.0869 10.6818.5758-2.3031c.0556-.2226.2556-.3787.485-.3787.3253 0 .564.3057.4851.6213l-.5151 2.0605h2.6055l.5758-2.3031c.0557-.2226.2557-.3787.4851-.3787.3253 0 .564.3057.4851.6213l-.5152 2.0605h2.246c.2761 0 .5.2239.5.5 0 .2762-.2239.5-.5.5h-2.496l-.6591 2.6364h2.1551c.2761 0 .5.2238.5.5 0 .2761-.2239.5-.5.5h-2.4051l-.5757 2.3031c-.0557.2226-.2557.3787-.4851.3787-.3253 0-.564-.3057-.4851-.6213l.5152-2.0605h-2.6056l-.5758 2.3031c-.0556.2226-.2556.3787-.4851.3787-.3253 0-.5639-.3057-.485-.6213l.5151-2.0605h-1.9278c-.2761 0-.5-.2239-.5-.5 0-.2762.2239-.5.5-.5h2.1778l.6591-2.6364h-1.8369c-.2761 0-.5-.2238-.5-.5 0-.2761.2239-.5.5-.5zm2.7273 3.6364.659-2.6364h-2.6055l-.6591 2.6364z",fill:"#fff"})]});var D=n(60867),P=n(50477),W=n(94840),A=n(16442);let $=e=>{let{format:t,isCreatingCustomType:n,openCreateCustomTypeModal:a}=e,s=(0,h.useRouter)(),{customTypes:i,updateCustomTypes:o}=(0,P.xU)(t),u=i.sort((e,t)=>e.id.localeCompare(t.id)),m=v.cd[t],p=d.$[t];return(!function(e,t,n){let{storeCustomTypes:l}=(0,x.v9)(e=>({storeCustomTypes:(0,w.Ch)(e).filter(A.TG)}));(0,c.useEffect)(()=>{let r=l.filter(e=>{let{local:n}=e;return n.format===t});(r.length!==e.length||r.some(t=>{let n=e.find(e=>e.id===t.local.id);return!n||JSON.stringify(W.Dc.fromSM(t.local))!==JSON.stringify(n)}))&&n(r.map(e=>{let{local:t}=e;return W.Dc.fromSM(t)}))},[t,n,e,l])}(i,t,o),0===u.length)?(0,l.jsxs)(E.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:r.t.space[72]},children:[(0,l.jsx)(E.u2,{children:(0,l.jsx)(r.a_,{src:m.blankSlateImage,sizing:"cover"})}),(0,l.jsxs)(E.T9,{children:[(0,l.jsx)(E._T,{children:p.name({start:!0,plural:!0})}),(0,l.jsx)(E.nf,{children:p.blankSlateDescription}),(0,l.jsx)(E.Qj,{children:(0,l.jsx)(r.E,{onClick:a,loading:n,children:"Create"})})]})]}):(0,l.jsx)("div",{children:(0,l.jsxs)(r.bE,{columnLayout:"28px 1fr 1fr 1fr 42px",children:[(0,l.jsx)(r.bH,{children:(0,l.jsxs)(r.bI,{children:[(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.aX,{name:"notes",size:"medium"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Label"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"API ID"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Limit"})}),(0,l.jsx)(r.bG,{})]})}),(0,l.jsx)(r.bF,{children:u.map(e=>{let{repeatable:n,label:a,id:c}=e;return(0,l.jsxs)(r.bI,{onClick:()=>{s.push(v.cd[t].getBuilderPagePathname(c))},children:[(0,l.jsx)(r.bG,{children:n?(0,l.jsx)(T,{width:r.t.space[20]}):(0,l.jsx)(G,{width:r.t.space[20]})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{variant:"bold",noWrap:!0,children:a})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:c})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:n?"Reusable":"Single"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(D._,{isChangesLocal:!1,format:t,customType:e})})]},c)})})]})})},O=e=>{let{format:t}=e,n=d.$[t],[a,h]=(0,c.useState)(!1),[x,m]=(0,c.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s(),{children:(0,l.jsxs)("title",{children:[n.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,l.jsx)(o.S,{renderError:()=>(0,l.jsx)(u.LN,{children:(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.D,{alignItems:"center",justifyContent:"center",children:(0,l.jsx)(r.ax,{title:"Request failed",description:"An error occurred while fetching your ".concat(n.name({start:!1,plural:!0}),".")})})})}),children:(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.bg,{})})]}),children:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{"data-testid":"create-ct",loading:a,onClick:()=>{m(!0)},startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsxs)(r.D,{flexDirection:"column",children:[(0,l.jsx)($,{format:t,isCreatingCustomType:a,openCreateCustomTypeModal:()=>{m(!0)}}),(0,l.jsx)(z,{format:t,isCreating:a,isOpen:x,onCreateChange:h,onOpenChange:m})]})})]})})})]})}},30527:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},W:function(){return i}});var l=n(52322),r=n(2784),a=n(75289);let s=e=>{let{bg:t,background:n,sx:r,withRadius:s,radius:c,children:i}=e;return(0,l.jsx)(a.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,...r},children:i})},c=(0,r.createContext)("6px"),i=()=>(0,r.useContext)(c),o=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:i=null,borderFooter:o=!1,radius:d="6px",bodySx:u={},footerSx:h={},sx:x=null,bg:m,background:p,children:j,...g}=e;return(0,l.jsx)(c.Provider,{value:d,children:(0,l.jsxs)(a.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:d,...x},...g,children:[t||null,n||null,(0,l.jsxs)(s,{bg:m,background:p,sx:u,withRadius:!i,children:[r?(0,l.jsx)(r,{}):null,j||null]}),i?(0,l.jsx)(s,{bg:m,background:p,sx:{...o?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...h},radius:d,withRadius:!0,children:"object"==typeof i?i:(0,l.jsx)(i,{})}):null]})})}},7974:function(e,t,n){"use strict";n.d(t,{Sn:function(){return c},lS:function(){return l},nG:function(){return r},pq:function(){return i},rd:function(){return s},xo:function(){return a}});let l=["components","update","insert"],r=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,s="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",i="slice-machine-simulator"},83478:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);
|