slice-machine-ui 2.11.1-beta.3 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/DOTU5E3jlof3w29PM-wsH/_buildManifest.js +1 -0
- package/out/_next/static/chunks/150-902bd1ee3468dd05.js +1 -0
- package/out/_next/static/chunks/{372-299eb158f6414913.js → 372-718a5541f567e738.js} +1 -1
- package/out/_next/static/chunks/434-c7ad3ff97354e3b7.js +31 -0
- package/out/_next/static/chunks/574-a19734ace8217cf4.js +1 -0
- package/out/_next/static/chunks/764-14490100bc2b60a8.js +1 -0
- package/out/_next/static/chunks/pages/{_app-ad314ac731271d0d.js → _app-5af46a852a825cc3.js} +67 -67
- package/out/_next/static/chunks/pages/changelog-fd749acf98af82da.js +1 -0
- package/out/_next/static/chunks/pages/changes-abdcde22a1d96331.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-2eb64c9ea82fcd0a.js → [customTypeId]-d064c8b72874c0ba.js} +1 -1
- package/out/_next/static/chunks/pages/labs-41db727cff0af1a9.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-e5a5e6b345081e0a.js → [pageTypeId]-5bb8851689eb84cb.js} +1 -1
- package/out/_next/static/chunks/pages/{settings-88c3d839c41b306d.js → settings-4efa7c64dc4f2468.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-d44e3fd7658f7587.js → simulator-252ec274cf2c422e.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-5757936335b0f206.js +1 -0
- package/out/_next/static/chunks/pages/slices-f42c28ddc74a5b2b.js +1 -0
- package/out/_next/static/css/{8c9771ac3b3b0fa3.css → e3fef77c99e43ec1.css} +1 -1
- 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/settings.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 +4 -5
- package/src/features/customTypes/EditDropdown.tsx +1 -1
- package/src/features/onboarding/OnboardingGuide.tsx +3 -7
- package/src/features/onboarding/useSharedOnboardingExperiment.ts +1 -1
- package/src/legacy/components/ReviewModal/ReviewModal.tsx +0 -7
- package/src/pages/_app.tsx +5 -14
- package/out/_next/static/GFsaHCt3aSVCYk_oL77Fo/_buildManifest.js +0 -1
- package/out/_next/static/chunks/150-c34c5188f5824717.js +0 -1
- package/out/_next/static/chunks/349-6ad3cca7ea294292.js +0 -31
- package/out/_next/static/chunks/764-56074baae7e8fe3b.js +0 -1
- package/out/_next/static/chunks/882-567b4220cf2aade1.js +0 -1
- package/out/_next/static/chunks/pages/changelog-b2494ca2d17f3afe.js +0 -1
- package/out/_next/static/chunks/pages/changes-f78e766881db10ec.js +0 -1
- package/out/_next/static/chunks/pages/labs-b2e68f81bf4c9dae.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-39b77d9eff3edf0e.js +0 -1
- package/out/_next/static/chunks/pages/slices-d03df2b864fe5aa1.js +0 -1
- package/src/features/inAppGuide/InAppGuideContext.tsx +0 -51
- package/src/features/inAppGuide/InAppGuideDialog.tsx +0 -94
- package/src/features/inAppGuide/inAppGuideContent.tsx +0 -65
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingGuide.module.css +0 -21
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingGuide.module.css.d.ts +0 -8
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingProgressStepper.tsx +0 -98
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingProvider.tsx +0 -127
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingStepDialog/OnboardingStepDialog.tsx +0 -65
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingStepDialog/OnboardingStepDialogContent.tsx +0 -34
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingStepDialog/index.ts +0 -1
- package/src/features/onboarding/SliceMachineOnboardingGuide/OnboardingTutorial/OnboardingTutorial.tsx +0 -25
- package/src/features/onboarding/SliceMachineOnboardingGuide/SliceMachineOnboardingGuide.tsx +0 -74
- package/src/features/onboarding/SliceMachineOnboardingGuide/content.tsx +0 -94
- package/src/features/onboarding/SliceMachineOnboardingGuide/types.ts +0 -26
- package/src/features/onboarding/useOnboardingExperiment.ts +0 -6
- /package/out/_next/static/{GFsaHCt3aSVCYk_oL77Fo → DOTU5E3jlof3w29PM-wsH}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
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(79566)}])},28574:function(e,t,n){"use strict";n.d(t,{R$:function(){return a},Qj:function(){return h},T9:function(){return d},nf:function(){return x},u2:function(){return c},_T:function(){return u}});var i=n(52322),s=n(7729),r=n(6277),l=n(43217),o=n.n(l);let a=e=>{let{backgroundImage:t,style:n,...s}=e,l=void 0!==t;return(0,i.jsx)("article",{...s,className:(0,r.W)(o().root,{[o().withBackground]:l}),style:{backgroundImage:l?"url(".concat(t,")"):void 0,...n}})},c=e=>(0,i.jsx)("div",{...e,className:o().image}),d=e=>(0,i.jsx)("div",{...e,className:o().content}),u=e=>(0,i.jsx)(s.xvT,{...e,variant:"h3"}),x=e=>(0,i.jsx)(s.xvT,{...e,color:"grey11"}),h=e=>(0,i.jsx)("div",{...e,className:o().actions,color:"grey"})},68587:function(e,t,n){"use strict";n.d(t,{Q:function(){return l}});let i={GitHub:"gitHub"};var s=n(52322),r=n(70647);let l={gitHub:{connect:async()=>await o("gitHub"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}),name:"GitHub",supported:a("gitHub")},bitbucket:{connect:async()=>await o("bitbucket"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}),name:"Bitbucket",supported:a("bitbucket")},gitLab:{connect:async()=>await o("gitLab"),Icon:e=>(0,s.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}),name:"GitLab",supported:a("gitLab")}};async function o(e){if(!a(e))throw Error("Not implemented.");let t=await r.managerClient.git.getProviderAppInstallURL({provider:e});window.open(t,"git-provider-app-installation")}function a(e){return!!Object.values(i).includes(e)}},6407:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var i=n(18566),s=n(29806),r=n(70647);function l(){let[e]=(0,s.f)();return{linkedGitRepos:(0,i.QT)(o,[e.repositoryName]),linkRepo:async t=>{await r.managerClient.git.linkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,i.gw)(o,[e.repositoryName])},unlinkRepo:async t=>{await r.managerClient.git.unlinkRepo({prismic:{domain:e.repositoryName},git:t}),await (0,i.gw)(o,[e.repositoryName])}}}async function o(e){return await r.managerClient.git.fetchLinkedRepos({prismic:{domain:e}})}},29806:function(e,t,n){"use strict";n.d(t,{f:function(){return r}});var i=n(18566),s=n(70647);function r(){return[(0,i.QT)(l,[]),async e=>{await s.managerClient.project.writeSliceMachineConfig({config:e}),(0,i.VA)(l,[],e)}]}async function l(){return s.managerClient.project.getSliceMachineConfig()}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return a}});var i=n(52322),s=n(2784),r=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",o=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},a=(0,s.forwardRef)((e,t)=>{let{label:n,Icon:s,type:a,form:c,isLoading:d=!1,disabled:u=!1,onClick:x,sx:h={},iconSize:m=16,iconFill:g,variant:p="primary",...j}=e;return(0,i.jsx)(r.zx,{ref:t,sx:{...h,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:a,form:c,disabled:u||d,onClick:d?void 0:x,variant:p,...j,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$j,{size:m,color:o(p),"data-testid":l(j["data-testid"],"spinner")}),s&&n]}):(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(s,{size:m,fill:g,"data-testid":l(j["data-testid"],"icon")}),n]})})})},42849:function(e,t,n){"use strict";var i=n(52322),s=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:r,gridTemplateMinPx:l="320px",gridGap:o="16px",sx:a}=e;return(0,i.jsx)(s.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:o,pt:2,...a},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:n(e,t)},"".concat(r(e),"-").concat(t+1)):null)})}},79566:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ep}});var i=n(52322),s=n(7729),r=n(97729),l=n.n(r),o=n(5632),a=n(2784),c=n(88932),d=n(65077),u=n(93188),x=n(23335),h=n(28574);function m(e){let{isPostPush:t,documentsListEndpoint:n}=e,r=t?p:g;return(0,i.jsxs)(h.R$,{style:{alignSelf:"center",marginTop:s.rSc.space[72]},children:[(0,i.jsx)(h.u2,{children:(0,i.jsx)(s.Eep,{src:r.img,sizing:"cover"})}),(0,i.jsxs)(h.T9,{children:[(0,i.jsx)(h._T,{children:r.title}),(0,i.jsx)(h.nf,{children:r.description}),t&&(0,i.jsx)(h.Qj,{children:(0,i.jsx)(s.zxk,{onClick:()=>{u.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!"};var j=n(30988),f=n(68587),v=n(52677),y=n(6407);let C=e=>(0,i.jsx)(j.S,{renderError:S,children:(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)(T,{}),children:(0,i.jsx)(b,{...e})})}),b=e=>(0,v.M)().eligible?(0,i.jsx)(w,{...e}):(0,i.jsx)(k,{...e}),w=e=>{let{linkedGitRepos:t}=(0,y.G)();if(!(t.length>0))return(0,i.jsx)(k,{...e});{let e=f.Q[t[0].provider];return(0,i.jsx)(s.ua7,{content:"This project uses the Git workflow. Update Prismic by pushing your changes to ".concat(e.name,"."),side:"bottom",children:(0,i.jsx)(k,{disabled:!0})})}},k=(0,a.forwardRef)((e,t)=>(0,i.jsx)(s.zxk,{...e,ref:t,startIcon:"upload",children:"Push"}));function S(){return(0,i.jsx)(s.ua7,{content:"An error occurred while fetching the list of connected Git repositories.",side:"bottom",children:(0,i.jsx)(k,{disabled:!0})})}let T=()=>(0,i.jsx)(s.OdW,{height:32,width:71.32});var _=n(65856),D=n(6529),L=n(80546),R=n(65821),B=n(52762),O=n(85647),I=n(99579),N=n(16288),F=n(58161),H=n(41067);let E=e=>{let{authStatus:t}=e,{openLoginModal:n}=(0,H.Z)();return(0,i.jsxs)(s.xuv,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[t===F.t.FORBIDDEN?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xvT,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,i.jsx)(s.xvT,{align:"center",children:"Log in to connect to your repository."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xvT,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,i.jsx)(s.xvT,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,i.jsxs)(s.xvT,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,i.jsx)(s.xvT,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),t===F.t.FORBIDDEN&&(0,i.jsx)(s.zxk,{onClick:()=>n(),children:"Log in to Prismic"})]})};var z=n(91914),P=n(75289);let A=()=>(0,i.jsx)(P.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,i.jsxs)(P.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,i.jsx)(z.wQ1,{size:48}),(0,i.jsx)(P.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,i.jsx)(P.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})});var Z=n(951),G=n(3181),M=n(53850),W=n(76787);let X=e=>{let{children:t}=e;return(0,i.jsx)(P.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:t})};var U=n(39097),Q=n.n(U),Y=n(51159),V=n(63447),J=n(1744);let q=e=>{let{ct:t,status:n,authStatus:s,isOnline:r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.xu,{as:"td",style:{width:"40%"},children:(0,i.jsx)(P.xv,{sx:{fontWeight:500},children:t.label})}),(0,i.jsx)(P.xu,{as:"td",style:{width:"40%"},children:t.id}),(0,i.jsx)(P.xu,{as:"td",style:{width:"20%"},children:(0,i.jsx)(Y.O,{authStatus:s,isOnline:r,modelStatus:n,modelType:"CustomType"})})]})},K=e=>{let{customTypes:t,modelsStatuses:n,authStatus:s,isOnline:r}=e;return(0,i.jsxs)(P.xu,{as:"table","data-legacy-component":!0,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:"transparent small",children:[(0,i.jsx)(P.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,i.jsx)(P.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,i.jsx)(P.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,i.jsx)("tbody",{children:t.map(e=>(0,J.TG)(e)?(0,i.jsx)(Q(),{passHref:!0,href:V.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,i.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,i.jsx)(q,{ct:e.local,status:n.customTypes[e.local.id],authStatus:s,isOnline:r},e.local.id)})},e.local.id):(0,i.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,i.jsx)(q,{ct:e.remote,status:n.customTypes[e.remote.id],authStatus:s,isOnline:r},e.remote.id)},e.remote.id))})]})};var $=n(42849),ee=n(39283),et=n(5274),en=n(53085);function ei(){let e=(0,en.L)("slicemachine-dev-collaboration"),[t,n]=(0,a.useState)(!1),r=null==e?void 0:e.payload;return((0,a.useEffect)(()=>{(null==e?void 0:e.value)==="on"&&void 0!==r&&u.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,r]),(null==e?void 0:e.value)!=="on"||void 0===r)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.xuv,{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,i.jsxs)(s.xuv,{flexDirection:"column",gap:2,children:[(0,i.jsx)(s.xvT,{variant:"smallBold",children:r.cardTitle}),(0,i.jsx)(s.xvT,{color:"grey11",variant:"small",children:r.cardDescription})]}),(0,i.jsx)(s.zxk,{color:"grey",onClick:()=>{u.Xe.track({event:"dev-collab:set-up-workflow-opened"}),n(!0)},children:r.cardButtonLabel})]}),(0,i.jsxs)(s.VqE,{onOpenChange:e=>{e||n(!1)},open:t,size:{height:"auto",width:448},children:[(0,i.jsx)(s.fKu,{title:r.dialogTitle}),(0,i.jsx)(s.cZJ,{children:(0,i.jsxs)(s.xuv,{flexDirection:"column",children:[(0,i.jsx)(s.xuv,{flexDirection:"column",padding:16,children:(0,i.jsx)(s.xvT,{children:r.dialogDescription})}),(0,i.jsxs)(s.kXR,{children:[(0,i.jsx)(s.POh,{size:"medium"}),(0,i.jsx)(s._dX,{size:"medium",onClick:()=>{u.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(r.dialogButtonLink,"_blank"),n(!1)},children:r.dialogButtonLabel})]})]})})]})]})}let es=e=>{let{unSyncedCustomTypes:t,unSyncedSlices:n,modelsStatuses:r,authStatus:l,isOnline:o}=e,{modalPayload:c,onOpenModal:d}=(0,W.H)(),{sliceFilterFn:u,defaultVariationSelector:x}=c,h=n.filter(e=>r.slices[e.model.id]!==et.GJ.Deleted);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.xuv,{gap:16,alignItems:"flex-start",children:[(0,i.jsxs)(s.xuv,{flexDirection:"column",flexGrow:1,children:[t.length>0&&(0,i.jsxs)(s.xuv,{flexDirection:"column",children:[(0,i.jsx)(X,{children:(0,i.jsxs)(s.xuv,{children:[(0,i.jsx)(s.xvT,{variant:"h5",children:"Types"}),(0,i.jsx)(s.xvT,{variant:"h5",sx:{marginLeft:8},children:t.length})]})}),(0,i.jsx)(K,{customTypes:t,modelsStatuses:r,authStatus:l,isOnline:o})]}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.xuv,{padding:{bottom:8},children:(0,i.jsxs)(X,{children:[(0,i.jsxs)(s.xuv,{children:[(0,i.jsx)(s.xvT,{variant:"h5",children:"Slices"}),(0,i.jsx)(s.xvT,{variant:"h5",sx:{marginLeft:8},children:n.length})]}),(0,i.jsxs)(s.xuv,{children:[n.some(e=>(0,G.cx)(e)>0&&r.slices[e.model.id]!==et.GJ.Deleted)&&(0,i.jsxs)(s.xvT,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,i.jsx)(Z.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,i.jsxs)(s.zxk,{color:"dark",onClick:()=>d({sliceFilterFn:e=>e}),children:[(0,i.jsx)(Z.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,i.jsx)($.Z,{gridGap:"32px 16px",elems:n,gridTemplateMinPx:"305px",defineElementKey:e=>e.model.name,renderElem:e=>{let t=r.slices[e.model.id];return(0,i.jsx)(M.b,{action:{type:"status",authStatus:l,isOnline:o,modelStatus:t},isDeleted:t===et.GJ.Deleted,mode:"navigation",onUpdateScreenshot:()=>{d({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"})}}),(0,i.jsx)(ee.Z,{slices:u(h),defaultVariationSelector:x})]})]}),(0,i.jsx)(j.S,{children:(0,i.jsx)(a.Suspense,{children:(0,i.jsx)(ei,{})})})]})})};var er=n(56580),el=n(47861),eo=n(79797),ea=n(76805);let ec=e=>{let{isOpen:t,title:n,footer:s,explanations:r,onClose:l}=e;return(0,i.jsx)(eo.Z,{placement:"right",open:t,level:null,onClose:l,width:496,children:(0,i.jsx)(ea.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,i.jsxs)(P.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,i.jsx)(P.kC,{sx:{alignItems:"center"},children:(0,i.jsx)(P.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:n})}),(0,i.jsx)(P.x8,{type:"button",onClick:()=>l()})]}),Footer:()=>(0,i.jsx)(P.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:s}),children:r})})};var ed=n(40572);n(77507);let eu=e=>{let{ctName:t,numberOfDocuments:n,link:s,isOverLimit:r=!1}=e;return(0,i.jsxs)(P.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(t),children:[(0,i.jsxs)(P.kC,{sx:{flexDirection:"column"},children:[(0,i.jsx)(P.xv,{children:t}),(0,i.jsxs)(P.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[n," documents"]})]}),(0,i.jsx)(P.rU,{href:s,target:"_blank",variant:"cardSmall",sx:{color:r?"danger":"purple08"},children:"View documents"})]})},ex=e=>{let{pushChanges:t,modalData:n,onClose:s}=e,{remoteOnlyCustomTypes:r}=(0,er.v9)(e=>({remoteOnlyCustomTypes:(0,ed.Ch)(e).filter(J.yp)}));if((null==n?void 0:n.type)!=="HARD")return null;let l=n.details.customTypes.map(e=>{var t;let n=r.find(t=>(0,J.n5)(t)===e.id);return void 0===n?null:(0,i.jsx)(eu,{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,i.jsx)(ec,{isOpen:"HARD"===n.type,title:"Manual action required",onClose:s,footer:(0,i.jsx)(el.z,{label:"Try again",variant:"primary",onClick:()=>{t(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(P.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",n.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,i.jsxs)(P.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."]}),l]})})},eh=e=>{let{onToggle:t,isConfirmed:n,sx:s}=e;return(0,i.jsxs)(P.kC,{sx:{borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%",...s},children:[(0,i.jsx)(P.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,i.jsxs)(P.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,i.jsx)(P.XZ,{defaultChecked:n,onChange:t,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},em=e=>{let{pushChanges:t,modalData:n,onClose:s}=e,[r,l]=(0,a.useState)(!1),{remoteOnlyCustomTypes:o}=(0,er.v9)(e=>({remoteOnlyCustomTypes:(0,ed.Ch)(e).filter(J.yp)}));if((null==n?void 0:n.type)!=="SOFT")return null;let c=n.details.customTypes.map(e=>{var t;let n=o.find(t=>(0,J.n5)(t)===e.id);return void 0===n?null:(0,i.jsx)(eu,{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,i.jsx)(ec,{isOpen:"SOFT"===n.type,title:"Confirm deletion",onClose:s,footer:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eh,{onToggle:()=>{l(!r)},isConfirmed:r,sx:{mb:10}}),(0,i.jsx)(el.z,{label:"Push changes",variant:"primary",onClick:()=>{t(r)},disabled:!r,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(P.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,i.jsxs)(P.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]})})},eg=e=>"https://".concat(e,".prismic.io/documents/working");var ep=()=>{let{unSyncedSlices:e,unSyncedCustomTypes:t,changedCustomTypes:n,changedSlices:r,modelsStatuses:h}=(0,R.X)(),g=(0,O.L)(),p=(0,B.n)(),{pushChangesSuccess:j,refreshState:f}=(0,H.Z)(),[v,y]=(0,a.useState)(!1),[b,w]=(0,a.useState)(void 0),{autoSyncStatus:k}=(0,L.g)(),S=(0,o.useRouter)(),[T,z]=(0,a.useState)(!1),[P,Z]=(0,a.useState)(!1),{repositoryName:G}=(0,I.U)(),{completeStep:M}=(0,_.k)(),W=eg(G),X=e.length+t.length;(0,a.useEffect)(()=>{("synced"===k||"failed"===k||"syncing"===k)&&S.push("/")},[k,S]);let U=async e=>{try{y(!0),w(void 0);let t=await (0,D.t)({confirmDeleteDocuments:e,changedCustomTypes:n,changedSlices:r});if(void 0!==t)w(t);else{let e=await (0,u.y0)();f(e),j(),z(!0),Z(!0),M("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.")}y(!1)},Q=(0,a.useMemo)(()=>g?p===F.t.UNAUTHORIZED||p===F.t.FORBIDDEN?(0,i.jsx)(E,{authStatus:p}):0===X?(0,i.jsx)(m,{isPostPush:T,documentsListEndpoint:W}):(0,i.jsx)(es,{unSyncedSlices:e,unSyncedCustomTypes:t,modelsStatuses:h,authStatus:p,isOnline:g}):(0,i.jsx)(A,{}),[g,p,X,e,t,h,T,W]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Changes - Slice Machine"})}),(0,i.jsxs)(N.LN,{children:[(0,i.jsxs)(N.wd,{children:[(0,i.jsx)(N.Cx,{children:(0,i.jsx)(x.g,{children:"Changes"})}),(0,i.jsxs)(N.K2,{children:[(0,i.jsx)(C,{disabled:0===X||!g||p===F.t.UNAUTHORIZED||p===F.t.FORBIDDEN||v,loading:v,onClick:()=>{U(!1)}}),(0,i.jsx)(s.FNi,{anchor:(0,i.jsx)(s.xuv,{position:"fixed",top:32,right:32,width:322}),open:P,variant:"card",seconds:20,title:"Success! \uD83C\uDF89",subtitle:"Your changes have been pushed.",action:{title:"Create content in the Page Builder",onClick:()=>{u.Xe.track({event:"post-push:toast-cta-clicked"}),window.open(W,"_blank")}},cancel:{onClick:()=>Z(!1)},onOpenChange:Z})]})]}),(0,i.jsx)(N.RN,{children:(0,i.jsxs)(d.xR,{sx:{display:"flex",flexDirection:"column"},children:[Q,(0,i.jsx)(em,{pushChanges:e=>void U(e),modalData:b,onClose:()=>w(void 0)}),(0,i.jsx)(ex,{pushChanges:e=>void U(e),modalData:b,onClose:()=>w(void 0)})]})})]})]})}},43217: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,772,639,888,774,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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(84468)}])},61502:function(e,n,i){"use strict";i.d(n,{E:function(){return t}});var r=i(29806);function t(e){var n,i;let[t,a]=(0,r.f)(),s=async n=>{let i={...t,labs:{...t.labs}};n?i.labs[e]=n:e in i.labs&&delete i.labs[e],0===Object.keys(i.labs).length&&delete i.labs,await a(i)};return[{enabled:null!==(i=null==t?void 0:null===(n=t.labs)||void 0===n?void 0:n[e])&&void 0!==i&&i},s]}},29806:function(e,n,i){"use strict";i.d(n,{f:function(){return a}});var r=i(18566),t=i(70647);function a(){return[(0,r.QT)(s,[]),async e=>{await t.managerClient.project.writeSliceMachineConfig({config:e}),(0,r.VA)(s,[],e)}]}async function s(){return t.managerClient.project.getSliceMachineConfig()}},84468:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return g}});var r=i(52322),t=i(7729),a=i(97729),s=i.n(a),l=i(2784),c=i(23335),o=i(30988),d=i(16288),u=i(88932);let h=e=>{let{title:n,enabled:i,onToggle:a,children:s}=e;return(0,r.jsx)(t.Zbd,{variant:"outlined",children:(0,r.jsxs)(t.xuv,{gap:8,padding:16,children:[(0,r.jsx)(t.xuv,{padding:{top:6},children:(0,r.jsx)(t.JO$,{name:"viewDay",size:"medium",color:"grey11"})}),(0,r.jsxs)(t.xuv,{flexDirection:"column",flexGrow:1,children:[(0,r.jsx)(t.xvT,{variant:"h3",children:n}),(0,r.jsx)(t.xvT,{variant:"normal",children:s})]}),(0,r.jsx)(t.xuv,{width:128,justifyContent:"end",children:(0,r.jsx)(t.rsf,{size:"medium",checked:i,onCheckedChange:e=>a(e)})})]})})};var x=i(61502);let f=()=>{let[e,n]=function(e,n){let[i,r]=(0,x.E)(e);return[i,async e=>{try{await r(e),u.Am.success(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n))}catch(i){console.error(i),u.Am.error(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n))}}]}("legacySliceUpgrader","Legacy Slice Upgrader");return(0,r.jsxs)(t.xuv,{flexDirection:"column",gap:32,children:[(0,r.jsx)("header",{children:(0,r.jsx)(t.xvT,{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)(t.xuv,{flexDirection:"column",gap:16,children:(0,r.jsxs)(h,{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."]})})]})},g=()=>(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)(t.xuv,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(t.Iq8,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})}),children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(j,{withHeader:!0,children:(0,r.jsx)(t._3P,{})}),children:(0,r.jsx)(j,{withHeader:!0,children:(0,r.jsx)(f,{})})})})]}),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()}]);
|
package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-39b77d9eff3edf0e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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(40696)}])},44570:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(5632),r=n(56580),o=n(68916);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}:{}}},40696:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eL}});var i=n(52322),r=n(97729),o=n.n(r),a=n(5632),l=n(74217),s=n(2784),d=n(93188),c=n(80546),u=n(43874),m=n(41067);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:v,setNextAction:f}=(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),f(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()})},[f,y,g]),w=(0,s.useMemo)(()=>({actionQueueStatus:v,slice:o,setSlice:b,variation:j}),[v,o,b,j]);return(0,i.jsx)(h.Provider,{value:w,children:"function"==typeof t?t(w):t})}function v(){let e=(0,s.useContext)(h);if(!e)throw Error("SliceBuilderProvider not found");return e}var f=n(44570),x=n(7729),y=n(23335),g=n(6697),j=n(30988),b=n(18566),w=n(70647);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 k=n(63447),S=n(5813),I=n(10635);let T=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"})]}),E=()=>{let{source:e}=(0,S.l)(),t=function(e){let t=(0,k.Ag)(e.query);return void 0!==t&&(0,k.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.xuv,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(R,{sourceCustomTypeId:t})})})}):null},R=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=k.cd[e].getBuilderPagePathname(t);return(0,i.jsxs)(x.hE2,{density:"compact",color:"dark",children:[(0,i.jsxs)(x.zxk,{onClick:()=>{l.push(r)},renderStartIcon:()=>(0,i.jsx)(T,{}),children:["Return to ",n.label]}),(0,i.jsx)(x.zxk,{onClick:()=>{o(!1)},renderStartIcon:()=>(0,i.jsx)(I.T,{})})]})}};var A=n(16288),D=n(56580),_=n(33710),L=n(99044),O=n(29184),F=n(17186),z=n(17467);let N=e=>{let{children:t,open:n,onClose:r}=e;return(0,i.jsxs)(L.zs,{open:n,trigger:t,onClose:r,children:[(0,i.jsx)(L.Ev,{children:"Simulate your slices"}),(0,i.jsx)(L.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:F.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:()=>{d.Xe.track({event:"open-video-tutorials",video:F.Sn})}}),(0,i.jsx)(L.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(L.Rp,{children:"Got it"})]})};var V=e=>{let{disabled:t}=e,n=(0,a.useRouter)(),r=(0,s.useRef)(null),{setSeenSimulatorToolTip:o}=(0,m.Z)(),{hasSeenSimulatorTooltip:l}=(0,D.v9)(e=>({hasSeenSimulatorTooltip:(0,z.bv)(e)}));(0,s.useEffect)(()=>{let e=r.current;e&&!l&&setTimeout(()=>_.Z.show(e),5e3)},[l]);let d=()=>{if(o(),r.current){let{current:e}=r;_.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)(N,{open:!l,onClose:d,children:(0,i.jsx)(x.zxk,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:()=>{d(),window.open("".concat(n.asPath,"/simulator"),F.pq)},disabled:t,renderStartIcon:()=>(0,i.jsx)(O.z,{color:x.rSc.color.grey1,height:"24px",style:{transform:"scale(calc(4 / 3))"},width:"24px"}),children:"Simulate"})})})},P=n(88866),M=n(28316),Z=n(88932),K=n(80775),q=n(3181),X=n(64602),H=n(18183),B=n(2439),W=n(80410),G=n(67875),U=n(85357),J=n(99510),Y=n(50268);let Q=[G.C.Image,G.C.Text,G.C.StructuredText,G.C.Link,G.C.Select,G.C.Boolean,G.C.Number,G.C.Color,G.C.Date,G.C.Embed,G.C.Timestamp,G.C.GeoPoint,G.C.ContentRelationship,G.C.LinkToMedia],$=[G.C.Group,...Q];var ee=()=>{let{slice:e,setSlice:t,variation:n}=v(),[r,o]=(0,s.useState)(!1),a=!!(n.items&&Object.keys(n.items).length>0),l=i=>r=>{if(i===W.Rt.Items&&n.items&&Object.keys(n.items).length<=1){o(!0);return}t((0,q.AK)({slice:e,variationId:n.id,widgetArea:i,fieldId:r}))},d=(i,r)=>{let{apiId:o,newKey:a,value:l,isNewGroupField:s}=r;t((0,q.L4)({slice:e,variationId:n.id,widgetArea:i,previousFieldId:o,newFieldId:a,newField:l}),()=>{!0===s&&Z.Am.success("Group added")})},c=(i,r)=>{let{apiId:o,value:a}=r,{type:l}=a,s=$.find(e=>e.CUSTOM_NAME===l||e.TYPE_NAME===l);if(!s)throw Error("Unsupported Field Type: ".concat(l));try{s.schema.validateSync(a,{stripUnknown:!1})}catch(e){throw Error('Model is invalid for widget "'.concat(a.type,'".'))}t((0,q.xS)({slice:e,variationId:n.id,widgetArea:i,newFieldId:o,newField:a.type===P.GroupFieldType?B.Fl.fromSM(a):a}),()=>{Z.Am.success("".concat("Group"===l?"Group":"Field"," added"))}),(0,Y.V)({id:o,field:a})},u=e=>t=>""===t.apiId?c(e,{...t,apiId:t.newKey}):d(e,t),m=i=>r=>{if((0,U.uS)(r))return;let{source:o,destination:a}=r;if(!a)return;let l=(0,q.gR)({slice:e,variationId:n.id,widgetArea:i,sourceIndex:o.index,destinationIndex:a.index});(0,M.flushSync)(()=>t(l))};return(0,i.jsxs)(K.aV,{children:[(0,i.jsx)(H.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:X.Z,widgetsArray:$,onDeleteItem:l(W.Rt.Primary),onSave:u(W.Rt.Primary),onDragEnd:m(W.Rt.Primary),poolOfFieldsToCheck:n.primary||[],renderHintBase:e=>{let{item:t}=e;return"slice.primary".concat((0,J.Ti)(t.key))},renderFieldAccessor:e=>"slice.primary".concat((0,J.Ti)(e)),testId:"static-zone-content",isRepeatableCustomType:void 0,emptyStateHeading:void 0}),a?(0,i.jsx)(H.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:Q,fields:n.items,EditModal:X.Z,onDeleteItem:l(W.Rt.Items),onSave:u(W.Rt.Items),onDragEnd:m(W.Rt.Items),poolOfFieldsToCheck:n.items||[],renderHintBase:e=>{let{item:t}=e;return"item".concat((0,J.Ti)(t.key))},renderFieldAccessor:e=>"slice.items[i]".concat((0,J.Ti)(e)),testId:"slice-repeatable-zone",isRepeatableCustomType:void 0,emptyStateHeading:"No fields"}):null,(0,i.jsxs)(x.VqE,{size:"small",open:r,onOpenChange:e=>o(e),children:[(0,i.jsx)(x.fKu,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(x.cZJ,{children:[(0,i.jsx)(x.xuv,{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.kXR,{children:[(0,i.jsx)(x.POh,{}),(0,i.jsx)(x._dX,{color:"tomato",onClick:()=>{t((0,q.Oh)({slice:e,variationId:n.id})),o(!1)},children:"Delete"})]})]})]})]})},et=n(6277),en=n(25198),ei=n.n(en);let er=e=>{let{variant:t="dashed",color:n="currentColor",className:r}=e;return(0,i.jsx)("hr",{className:(0,et.W)(ei()["variant-".concat(t)],r),style:{color:x.rSc.color[n]}})};var eo=n(53850),ea=n(89513),el=n(76787);async function es(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;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=ea.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 ed=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}=v();return(0,i.jsxs)(x.VqE,{open:t,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.fKu,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(x.cZJ,{children:(0,i.jsxs)(x.xuv,{flexDirection:"column",children:[(0,i.jsxs)(x.xvT,{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)(ec,{children:"not"})," affect your documents until you ",(0,i.jsx)(ec,{children:"edit"})," ","them manually."]}),(0,i.jsxs)(x.kXR,{children:[(0,i.jsx)(x.POh,{size:"medium"}),(0,i.jsx)(x._dX,{size:"medium",color:"tomato",onClick:()=>{o&&(async()=>{c(!0);try{let e=await es({component:r,router:l,saveSliceSuccess:u,variation:o});h(e)}catch(e){}c(!1),n()})()},loading:d,children:"Delete"})]})]})})]})},ec=e=>(0,i.jsx)(x.xvT,{...e,color:"inherit",component:"span",variant:"bold"});var eu=n(30195);async function em(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 eh=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:f}=v(),{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.VqE,{open:t,onOpenChange:e=>!e&&n(),size:{width:448,height:"auto"},children:[(0,i.jsx)(x.fKu,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(x.cZJ,{children:(0,i.jsxs)(x.l09,{onSubmit:function(){if(!h&&o){d(!0);try{em({component:r,saveSliceSuccess:y,variation:o,variationName:c.trim()}).then(e=>{f(e)})}catch(e){}d(!1),n()}},children:[(0,i.jsxs)(x.xuv,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(x.xvT,{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.xuv,{flexDirection:"column",gap:4,children:(0,i.jsx)(x.ytj,{type:"text",label:"Variation name *",placeholder:"Variation name",error:h,value:c,onValueChange:function(e){u(e),p(function(e){let t=ep.safeParse(e,{errorMap:ev});if(t.error)return t.error.errors[0].message}(e))}})})]}),(0,i.jsxs)(x.kXR,{children:[(0,i.jsx)(x.POh,{size:"medium"}),(0,i.jsx)(x._dX,{size:"medium",loading:a,disabled:!!h,children:"Rename"})]})]})})]})})},ep=eu.z.string().min(1),ev=e=>e.code===eu.z.ZodIssueCode.too_small?{message:"This field is required"}:{message:"Invalid value"};var ef=n(39283),ex=n(63397),ey=n(96009),eg=n.n(ey),ej=n(36131),eb=n(75289),ew=n(76805);function eC(e){let{children:t}=e,n=(0,ew.W)();return(0,i.jsx)(eb.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 ek=e=>{let{children:t,FooterContent:n,HeaderContent:r,close:o,sx:a={}}=e;return(0,i.jsx)(ew.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:{border:"none",...a},Header:(0,i.jsxs)(eC,{children:[r,o?(0,i.jsx)(eb.x8,{onClick:o,type:"button"}):null]}),Footer:n?(0,i.jsxs)(eb.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(eb.xu,{sx:{ml:"auto"}}),n]}):null,children:t})},eS=n(11104);let eI=e=>{let{msg:t}=e;return(0,i.jsx)(eb.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,v]=(0,s.useState)(""),[f,y]=(0,s.useState)({value:o.id,label:o.name}),[g,j]=(0,s.useState)(!1);function b(){w(),n()}function w(){u(""),v(""),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:f});if(Object.keys(e).length)d(e);else{let e=a.find(e=>e.id===f.value);e&&(j(!0),await r(c,p,e),j(!1),b())}}return(0,s.useEffect)(()=>{w()},[o,t]),(0,i.jsx)(eS.Z,{isOpen:t,shouldCloseOnOverlayClick:!0,onRequestClose:()=>b(),contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(ex.J9,{initialValues:{id:c,name:p,origin:f},onSubmit:C,children:(0,i.jsx)(ex.l0,{id:"variation-add",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),C())},children:(0,i.jsx)(x.xuv,{children:(0,i.jsxs)(ek,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(eb.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(x.xuv,{gap:16,alignItems:"center",children:[(0,i.jsx)(x.zxk,{onClick:b,color:"grey",children:"Cancel"}),(0,i.jsx)(x.zxk,{loading:g,children:"Submit"})]}),close:b,children:[(0,i.jsxs)(x.xuv,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(eb.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",l.name?(0,i.jsx)(eI,{msg:l.name}):""]}),(0,i.jsx)(ex.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:eb.II,maxLength:30,value:p,onChange:e=>{var t;v(t=e.currentTarget.value),m&&u(eg()(t))}}),(0,i.jsx)(eb.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(x.xuv,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(eb.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",l.id?(0,i.jsx)(eI,{msg:l.id}):""]}),(0,i.jsx)(ex.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:eb.II,maxLength:30,value:c,onChange:e=>{var t;return t=e.currentTarget.value,void(h(!1),u(eg()(t)))}}),(0,i.jsx)(eb.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(x.xuv,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(eb.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(ej.ZP,{name:"origin",options:a.map(e=>({value:e.id,label:e.name})),onChange:e=>{e&&y(e)},defaultValue:f,maxMenuHeight:150,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})]})})})})})},eE=n(828),eR=n.n(eE);let eA=e=>{let{horizontalScroll:t=!1}=e,{slice:n,variation:r,setSlice:o}=v(),[l,c]=(0,s.useState)(),u=(0,el.H)(),{sliceFilterFn:h,defaultVariationSelector:p,onUploadSuccess:f}=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.xuv,{flexDirection:"column",gap:16,children:t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(er,{variant:"edgeFaded",color:"grey6"}),(0,i.jsxs)(x.xuv,{justifyContent:"space-between",children:[(0,i.jsxs)(x.xvT,{color:"grey11",children:[j," variation",1!==j&&"s"]}),(0,i.jsx)(x.zxk,{onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",color:"grey",children:"Add a variation"})]}),(0,i.jsx)("div",{className:eR().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.xuv,{flexDirection:"row",gap:16,children:(0,i.jsx)(eD,{screenshotChangesModal:u,setDialog:c,width:320})})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eD,{screenshotChangesModal:u,setDialog:c}),(0,i.jsx)("div",{style:{bottom:x.rSc.space[0],marginBottom:"-".concat(x.rSc.space[16]),position:"sticky"},children:(0,i.jsxs)(x.xuv,{backgroundColor:"grey2",flexDirection:"column",padding:{bottom:40,inline:24},children:[(0,i.jsx)(x.phe,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(x.zxk,{color:"grey",onClick:()=>{c({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},children:"Add a variation"})]})})]})}),(0,i.jsx)(ef.Z,{slices:h([n]),defaultVariationSelector:p,onUploadSuccess:f}),(0,i.jsx)(eh,{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)(ed,{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,q.Kp)({slice:n,id:e,name:t,copiedVariation:i});await (0,d.Ve)(r),g(r),o(r);let l=ea.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})]})},eD=e=>{let{screenshotChangesModal:t,setDialog:n,width:r}=e,{slice:o,variation:a,setSlice:l}=v(),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)(eo.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}=v(),n=(0,x.ach)({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)(V,{disabled:"done"!==t})]})]}),(0,i.jsxs)(A.RN,{children:[(0,i.jsxs)(x.xuv,{display:"grid",alignItems:"flex-start",gap:16,...n?{gridTemplateRows:"304px 1fr"}:{gridTemplateColumns:"320px 1fr"},children:[(0,i.jsx)(eA,{horizontalScroll:n}),(0,i.jsx)(ee,{})]}),(0,i.jsx)(E,{})]})]})};function eL(){let e=(0,a.useRouter)(),{slice:t,variation:n}=(0,f.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_,{})]})}})}},25198: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"}},828: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 v=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,v=e.ctrlKey,f=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(!f&&!v)return!1}else if(!f===o&&"meta"!==j&&"os"!==j||!v===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)},f=(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:[]),k=(0,i.useRef)(C);w?k.current=C:k.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),I=(0,i.useContext)(x).enabledScopes,T=(0,i.useContext)(f);return g(function(){if((null==S?void 0:S.enabled)!==!1&&(e=null==S?void 0:S.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),!(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(v(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}k.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),T&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return T.addHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))}),function(){r.removeEventListener("keyup",i),r.removeEventListener("keydown",n),T&&s(b,null==S?void 0:S.splitKey).forEach(function(e){return T.removeHotkey(d(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))})}}},[b,S,I]),a}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,349,772,882,639,888,774,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,t,n){var i=n(34311),o=n(23779),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(20713)}])},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var i=n(52322),o=n(2784),r=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},s=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:s,form:c,isLoading:d=!1,disabled:u=!1,onClick:m,sx:x={},iconSize:f=16,iconFill:p,variant:h="primary",...v}=e;return(0,i.jsx)(r.zx,{ref:t,sx:{...x,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...d?{cursor:"wait !important"}:{}},type:s,form:c,disabled:u||d,onClick:d?void 0:m,variant:h,...v,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.$j,{size:f,color:a(h),"data-testid":l(v["data-testid"],"spinner")}),o&&n]}):(0,i.jsxs)(i.Fragment,{children:[o&&(0,i.jsx)(o,{size:f,fill:p,"data-testid":l(v["data-testid"],"icon")}),n]})})})},17889:function(e,t,n){"use strict";n.d(t,{c:function(){return g}});var i=n(52322),o=n(2784),r=n(36131),l=n(75289),a=n(93188),s=n(65856),c=n(88932),d=n(3181),u=n(99510),m=n(70647);async function x(e){let{sliceName:t,libraryName:n,onSuccess:i}=e;try{let e=(0,d.fo)(t),{errors:o}=await m.managerClient.slices.createSlice({libraryID:n,model:e});if(o.length>0)throw o;a.Xe.track({event:"slice:created",id:(0,u.MP)(t),name:t,library:n}),await i(e)}catch(n){let e="An unexpected error happened while creating slice ".concat(t,".");console.error(e,n),c.Am.error(e)}}var f=n(80546),p=n(1490),h=n(41067),v=n(28801),y=n(99923);let g=e=>{let{onClose:t,onSuccess:n,localLibraries:c,remoteSlices:d}=e,{createSliceSuccess:u}=(0,h.Z)(),[m,g]=(0,o.useState)(!1),{syncChanges:b}=(0,f.g)(),{completeStep:j}=(0,s.k)(),k=async e=>{let t=e.sliceName,i=e.from;g(!0),await x({sliceName:t,libraryName:i,onSuccess:async e=>{u((await (0,a.y0)()).libraries),n(e,i),b(),j("createSlice")}})};return(0,i.jsx)(p.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:m,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:e=>{k(e)},initialValues:{sliceName:"",from:c[0].name},validate:e=>(0,y.h)(e,c,d),content:{title:"Create a new slice"},children:e=>{let{touched:t,values:n,setFieldValue:o,errors:a}=e;return(0,i.jsxs)(l.xu,{children:[(0,i.jsx)(v.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:t.sliceName?a.sliceName:void 0,testId:"slice-name-input"}),(0,i.jsx)(l.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,i.jsx)(r.ZP,{name:"from",options:c.map(e=>({value:e.name,label:e.name})),onChange:e=>e?void o("from",e.value):null,defaultValue:{value:n.from,label:n.from},styles:{option:e=>({...e,color:"#161618"})},theme:e=>({...e,colors:{...e.colors,primary:"#E9E8EA"}}),menuPortalTarget:document.body})]})}})}},28801: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:a,testId:s,onChange:c}=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",...c?{onChange:c}:null,...s?{"data-testid":s}:null}),a?(0,i.jsx)(r.xv,{"data-testid":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},99923:function(e,t,n){"use strict";n.d(t,{h:function(){return s}});var i=n(96009),o=n.n(i),r=n(74600),l=n.n(r),a=n(17186);function s(e,t,n){let{sliceName:i}=e;return i?a.lS.includes(i.toLowerCase())?{sliceName:'Name "'.concat(i,'" is reserved for Slice Machine use.')}:a.xo.exec(i)?l()(o()(i)).replace(/\s/gm,"")!==i.trim()?{sliceName:"Value has to be PascalCased."}:i.match(/^\d/)?{sliceName:"Value cannot start with a number."}:[...t.flatMap(e=>e.components.map(e=>e.model.name)),...n.map(e=>e.name)].includes(i)?{sliceName:"Slice name is already taken."}:void 0:{sliceName:"No special characters allowed."}:{sliceName:"Cannot be empty"}}},42849:function(e,t,n){"use strict";var i=n(52322),o=n(75289);t.Z=function(e){let{elems:t,renderElem:n,defineElementKey:r,gridTemplateMinPx:l="320px",gridGap:a="16px",sx:s}=e;return(0,i.jsx)(o.xu,{as:"section",sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(l,", 1fr))"),gridGap:a,pt:2,...s},children:t.map((e,t)=>e?(0,i.jsx)("span",{children:n(e,t)},"".concat(r(e),"-").concat(t+1)):null)})}},1490:function(e,t,n){"use strict";var i=n(52322),o=n(63397),r=n(37149),l=n.n(r),a=n(75289),s=n(47861),c=n(11104),d=n(76805);function u(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(a.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:m,validate:x,onSubmit:f,widthInPx:p,initialValues:h,content:{title:v},cardProps:y,omitFooter:g=!1,isLoading:b=!1,buttonLabel:j="Save",testId:k,actionMessage:w}=e;return l().setAppElement("#__next"),(0,i.jsx)(c.Z,{isOpen:r,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:v,style:{content:{width:null!=p?p:"900px"}},children:(0,i.jsx)(o.J9,{initialValues:h,validate:e=>x?x(e):void 0,onSubmit:e=>{f(e)},children:e=>{let{isValid:r,isSubmitting:l,values:c,errors:x,touched:f,setFieldValue:p,setValues:h}=e;return(0,i.jsx)(o.l0,{id:m,...null!=k?{"data-testid":k}: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)(a.X6,{sx:{fontSize:"20px"},children:v}),(0,i.jsx)(a.x8,{type:"button",onClick:n})]}),Footer:g?null:(0,i.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof w?w(e):w}),(0,i.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||b,children:"Cancel"}),(0,i.jsx)(s.z,{label:j,form:m,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:c,errors:x,touched:f,setFieldValue:p,setValues:h})})})}})})}},20713:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(52322),o=n(7729),r=n(97729),l=n.n(r),a=n(5632),s=n(2784),c=n(56580),d=n(88932),u=n(65077),m=n(75289),x=n(23335),f=n(53850),p=n(89513),h=n(76787),v=n(16288),y=n(65186),g=n(59326),b=n(70647);async function j(e){let{sliceName:t,sliceID:n,libraryID:i,onSuccess:o}=e;try{let{errors:e}=await b.managerClient.slices.deleteSlice({libraryID:i,sliceID:n});if(e.length>0)throw e;o(),d.Am.success("Successfully deleted slice “".concat(t,"”"))}catch(n){let e="An unexpected error happened while deleting slice “".concat(t,"”.");console.error(e,n),d.Am.error(e)}}var k=n(80546),w=n(47861),C=n(76805),S=n(11104),I=n(41067);let L=e=>{var t;let{sliceId:n,sliceName:o,libName:r,isOpen:l,onClose:a}=e,[c,d]=(0,s.useState)(!1),{deleteSliceSuccess:u}=(0,I.Z)(),{syncChanges:x}=(0,k.g)(),{theme:f}=(0,g.B7)(),p=async()=>{d(!0),await j({sliceID:n,sliceName:o,libraryID:r,onSuccess:()=>{u(n,r),x()}}),a(),d(!1)};return(0,i.jsx)(S.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:a,children:(0,i.jsx)(C.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)(m.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)(m.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(y.$vK,{size:20,color:null===(t=f.colors)||void 0===t?void 0:t.greyIcon}),(0,i.jsx)(m.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,i.jsx)(m.x8,{type:"button",onClick:a})]}),Footer:()=>(0,i.jsxs)(m.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(w.z,{label:"Cancel",variant:"secondary",onClick:a,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(w.z,{label:"Delete",variant:"danger",isLoading:c,sx:{minHeight:39,minWidth:78},onClick:()=>{p()}})]}),children:(0,i.jsxs)(m.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)(m.xv,{sx:{fontWeight:"bold"},children:[r,"/",o,"/"]})," ","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 N=n(36887),E=n(93188),A=e=>{let{title:t,onCreateNew:n,buttonText:o,documentationComponent:r,videoPublicIdUrl:l,...a}=e;return(0,i.jsxs)(m.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},...a,children:[(0,i.jsx)(m.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)(N.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:()=>{E.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,i.jsxs)(m.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)(m.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)(m.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:t}),(0,i.jsx)(m.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:r})]}),(0,i.jsxs)(m.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,i.jsx)(m.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)(m.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"})]})]})]})},R=n(17889),P=n(3181),O=n(80410);async function z(e){let{slice:t,newSliceName:n,onSuccess:i}=e;try{let e=(0,P.PQ)(t,n),{errors:o}=await b.managerClient.slices.renameSlice({libraryID:t.from,model:O.id.fromSM(e.model)});if(o.length>0)throw o;i(e),d.Am.success("Slice name updated")}catch(n){let e="An unexpected error happened while renaming “".concat(t.model.name,"”.");console.error(e,n),d.Am.error(e)}}var W=n(68916),_=n(1490),D=n(28801),T=n(99923);let Z=e=>{var t,n;let{slice:o,isOpen:r,onClose:l}=e,{renameSliceSuccess:a}=(0,I.Z)(),{syncChanges:s}=(0,k.g)(),{localLibs:d,remoteLibs:u}=(0,c.v9)(e=>({localLibs:(0,W.Sd)(e),remoteLibs:(0,W.sT)(e)})),x=null!==(t=null==o?void 0:o.model.name)&&void 0!==t?t:"",f=async e=>{o&&(await z({slice:o,newSliceName:e.sliceName,onSuccess:e=>{a(e.from,e.model),s()}}),l())};return(0,i.jsx)(_.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 f(e),initialValues:{sliceName:x},content:{title:"Rename a slice"},validate:e=>(0,T.h)(e,d,u),children:e=>{let{touched:t,errors:n}=e;return(0,i.jsx)(m.xu,{children:(0,i.jsx)(D.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 F=n(42849),K=n(39283),B=n(91133),H=n(17186),M=()=>{var e,t,n;let r=(0,a.useRouter)(),{modalPayload:y,onOpenModal:g}=(0,h.H)(),{sliceFilterFn:b,defaultVariationSelector:j}=y,{remoteSlices:k,libraries:w}=(0,c.v9)(e=>({remoteSlices:(0,W.sT)(e),libraries:(0,W.Sd)(e)})),[C,S]=(0,s.useState)(!1),[I,N]=(0,s.useState)(!1),[E,P]=(0,s.useState)(!1),O=w.filter(e=>e.isLocal),z=w.map(e=>(e.components=[...e.components].sort((e,t)=>e.model.name.localeCompare(t.model.name)),e)),_=(w||[]).map(e=>e.components).flat(),D=_.length,[T,M]=(0,s.useState)(),V=()=>{N(!0)},X=()=>{P(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsx)("title",{children:"Slices - Slice Machine"})}),(0,i.jsxs)(v.LN,{children:[(0,i.jsxs)(v.wd,{children:[(0,i.jsx)(v.Cx,{children:(0,i.jsx)(x.g,{children:"Slices"})}),(null==O?void 0:O.length)!==0&&0!==D?(0,i.jsx)(v.K2,{children:(0,i.jsx)(o.zxk,{"data-testid":"create-slice",onClick:()=>{S(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,i.jsxs)(v.RN,{children:[(0,i.jsx)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:z.length>0?(0,i.jsx)(m.kC,{sx:{flex:1,flexDirection:"column"},children:0===D?(0,i.jsx)(m.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(A,{title:"What are Slices?",onCreateNew:()=>{S(!0)},buttonText:"Create one",videoPublicIdUrl:H.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)(m.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"})}):z.map(e=>{let{name:t,isLocal:n,components:o}=e;return(0,i.jsxs)(m.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,i.jsxs)(m.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,i.jsx)(m.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,i.jsx)(m.xv,{children:t})}),!n&&(0,i.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,i.jsx)(F.Z,{elems:o,defineElementKey:e=>e.model.name,renderElem:e=>(0,i.jsx)(f.b,{action:{type:"menu",onRemove:()=>{M(e),V()},onRename:()=>{M(e),X()}},mode:"navigation",onUpdateScreenshot:()=>{g({sliceFilterFn:t=>t.filter(t=>t.model.id===e.model.id)})},slice:e,variant:"solid"}),gridGap:"32px 16px"})]},t)})}):void 0}),(null==O?void 0:O.length)>0&&(0,i.jsx)(K.Z,{slices:b(_),defaultVariationSelector:j}),(null==O?void 0:O.length)>0&&C&&(0,i.jsx)(R.c,{localLibraries:O,remoteSlices:k,onSuccess:(e,t)=>{let n=e.variations[0].id,i=p.Y.getBuilderPagePathname({libraryName:t,sliceName:e.name,variationId:n});r.push(i),d.Am.success((0,B.kQ)({path:"".concat(t,"/").concat(e.name,"/model.json")}))},onClose:()=>{S(!1)}}),(0,i.jsx)(Z,{isOpen:E,slice:T,onClose:()=>{P(!1)},"data-testid":"rename-slice-modal"}),(0,i.jsx)(L,{isOpen:I,libName:null!==(e=null==T?void 0:T.from)&&void 0!==e?e:"",sliceId:null!==(t=null==T?void 0:T.model.id)&&void 0!==t?t:"",sliceName:null!==(n=null==T?void 0:T.model.name)&&void 0!==n?n:"",onClose:()=>{N(!1)}})]})]})]})}},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 a(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,t){return void 0===t&&(t=","),e.split(t)}function c(e,t,n){void 0===t&&(t="+");var i=e.toLocaleLowerCase().split(t).map(function(e){return a(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")},s=i.filter(function(e){return!r.includes(e)});return o({},l,{keys:s,description:n})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&m([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&x([a(e.key),a(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){d.clear()});var d=new Set;function u(e){return Array.isArray(e)}function m(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 x(e){var t=Array.isArray(e)?e:[e];"meta"===e?d.clear():t.forEach(function(e){return d.delete(e.toLowerCase())})}function f(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 p=function(e,t,n){void 0===n&&(n=!1);var i,o=t.alt,r=t.meta,l=t.mod,s=t.shift,c=t.ctrl,m=t.keys,x=e.key,f=e.code,p=e.ctrlKey,h=e.metaKey,v=e.shiftKey,y=e.altKey,g=a(f),b=x.toLowerCase();if(!n){if(!y===o&&"alt"!==b||!v===s&&"shift"!==b)return!1;if(l){if(!h&&!p)return!1}else if(!h===r&&"meta"!==b&&"os"!==b||!p===c&&"ctrl"!==b&&"control"!==b)return!1}return!!(m&&1===m.length&&(m.includes(b)||m.includes(g)))||(m?(void 0===i&&(i=","),(u(m)?m:m.split(i)).every(function(e){return d.has(e.trim().toLowerCase())})):!m)},h=(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,k=n instanceof Array?n:o instanceof Array?o:void 0,w=(0,i.useCallback)(t,null!=k?k:[]),C=(0,i.useRef)(w);k?C.current=w:C.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,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)(h);return g(function(){if((null==S?void 0:S.enabled)!==!1&&(e=null==S?void 0:S.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),!(f(e,["input","textarea","select"])&&!f(e,null==S?void 0:S.enableOnFormTags)||null!=S&&null!=S.ignoreEventWhen&&S.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!=S&&S.enableOnContentEditable)&&s(j,null==S?void 0:S.splitKey).forEach(function(n){var i,o,r,l=c(n,null==S?void 0:S.combinationKey);if(p(e,l,null==S?void 0:S.ignoreModifiers)||null!=(r=l.keys)&&r.includes("*")){if(t&&d.current)return;if(("function"==typeof(i=null==S?void 0:S.preventDefault)&&i(e,l)||!0===i)&&e.preventDefault(),"function"==typeof(o=null==S?void 0:S.enabled)?!o(e,l):!0!==o&&void 0!==o){y(e);return}C.current(e,l),t||(d.current=!0)}})}},n=function(e){void 0!==e.key&&(m(a(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&&(x(a(e.code)),d.current=!1,null!=S&&S.keyup&&t(e,!0))},o=l.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",i),o.addEventListener("keydown",n),L&&s(j,null==S?void 0:S.splitKey).forEach(function(e){return L.addHotkey(c(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))}),function(){o.removeEventListener("keyup",i),o.removeEventListener("keydown",n),L&&s(j,null==S?void 0:S.splitKey).forEach(function(e){return L.removeHotkey(c(e,null==S?void 0:S.combinationKey,null==S?void 0:S.description))})}}},[j,S,I]),l}}},function(e){e.O(0,[898,789,50,772,639,888,774,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createContext,
|
|
3
|
-
Dispatch,
|
|
4
|
-
FC,
|
|
5
|
-
PropsWithChildren,
|
|
6
|
-
SetStateAction,
|
|
7
|
-
useContext,
|
|
8
|
-
useMemo,
|
|
9
|
-
} from "react";
|
|
10
|
-
|
|
11
|
-
import { useOnboardingExperiment } from "@/features/onboarding/useOnboardingExperiment";
|
|
12
|
-
import { usePersistedState } from "@/hooks/usePersistedState";
|
|
13
|
-
|
|
14
|
-
type InAppGuideContextValue = {
|
|
15
|
-
isInAppGuideOpen: boolean;
|
|
16
|
-
setIsInAppGuideOpen: Dispatch<SetStateAction<boolean>>;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const InAppGuideContext = createContext<
|
|
20
|
-
InAppGuideContextValue | undefined
|
|
21
|
-
>(undefined);
|
|
22
|
-
|
|
23
|
-
export const InAppGuideProvider: FC<PropsWithChildren> = (props) => {
|
|
24
|
-
const { children } = props;
|
|
25
|
-
const { eligible: isNewOnboardingEnabled } = useOnboardingExperiment();
|
|
26
|
-
const [isInAppGuideOpen, setIsInAppGuideOpen] = usePersistedState(
|
|
27
|
-
"isInAppGuideOpen",
|
|
28
|
-
true,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const memoizedValue = useMemo(() => {
|
|
32
|
-
if (isNewOnboardingEnabled) {
|
|
33
|
-
return { isInAppGuideOpen: false, setIsInAppGuideOpen: () => undefined };
|
|
34
|
-
}
|
|
35
|
-
return { isInAppGuideOpen, setIsInAppGuideOpen };
|
|
36
|
-
}, [isInAppGuideOpen, setIsInAppGuideOpen, isNewOnboardingEnabled]);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<InAppGuideContext.Provider value={memoizedValue}>
|
|
40
|
-
{children}
|
|
41
|
-
</InAppGuideContext.Provider>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const useInAppGuide = () => {
|
|
46
|
-
const context = useContext(InAppGuideContext);
|
|
47
|
-
if (context === undefined) {
|
|
48
|
-
throw new Error("useInAppGuide must be used within an InAppGuideProvider");
|
|
49
|
-
}
|
|
50
|
-
return context;
|
|
51
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Box,
|
|
3
|
-
Dialog,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogHeader,
|
|
6
|
-
IconButton,
|
|
7
|
-
ScrollArea,
|
|
8
|
-
Separator,
|
|
9
|
-
Text,
|
|
10
|
-
Video,
|
|
11
|
-
} from "@prismicio/editor-ui";
|
|
12
|
-
import { FC } from "react";
|
|
13
|
-
|
|
14
|
-
import { Count } from "@/components/Count";
|
|
15
|
-
import { useOnboardingExperiment } from "@/features/onboarding/useOnboardingExperiment";
|
|
16
|
-
import { useIsEmptyProject } from "@/hooks/useIsEmptyProject";
|
|
17
|
-
import { HelpIcon } from "@/icons/HelpIcon";
|
|
18
|
-
|
|
19
|
-
import { useInAppGuideContent } from "./inAppGuideContent";
|
|
20
|
-
import { useInAppGuide } from "./InAppGuideContext";
|
|
21
|
-
|
|
22
|
-
export const InAppGuideDialog: FC = () => {
|
|
23
|
-
const isEmptyProject = useIsEmptyProject();
|
|
24
|
-
const { isInAppGuideOpen, setIsInAppGuideOpen } = useInAppGuide();
|
|
25
|
-
const inAppGuideContent = useInAppGuideContent();
|
|
26
|
-
|
|
27
|
-
const { eligible: newOnboardingEnabled } = useOnboardingExperiment();
|
|
28
|
-
|
|
29
|
-
const trigger =
|
|
30
|
-
!isEmptyProject && !newOnboardingEnabled ? (
|
|
31
|
-
<Box position="fixed" right={16} bottom={16}>
|
|
32
|
-
<IconButton
|
|
33
|
-
color="purple"
|
|
34
|
-
icon={<HelpIcon />}
|
|
35
|
-
onClick={() => {
|
|
36
|
-
setIsInAppGuideOpen(!isInAppGuideOpen);
|
|
37
|
-
}}
|
|
38
|
-
radius="full"
|
|
39
|
-
variant="solid"
|
|
40
|
-
/>
|
|
41
|
-
</Box>
|
|
42
|
-
) : undefined;
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Dialog
|
|
46
|
-
trigger={trigger}
|
|
47
|
-
modal={false}
|
|
48
|
-
open={isInAppGuideOpen && !isEmptyProject}
|
|
49
|
-
onOpenChange={(open) => {
|
|
50
|
-
setIsInAppGuideOpen(open);
|
|
51
|
-
}}
|
|
52
|
-
position="bottomRight"
|
|
53
|
-
size={{
|
|
54
|
-
width: 360,
|
|
55
|
-
height: 456,
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
<DialogHeader title={inAppGuideContent.title} />
|
|
59
|
-
<DialogContent>
|
|
60
|
-
<ScrollArea>
|
|
61
|
-
<Box flexDirection="column" padding={{ inline: 16, block: 8 }}>
|
|
62
|
-
<Text>{inAppGuideContent.description}</Text>
|
|
63
|
-
</Box>
|
|
64
|
-
|
|
65
|
-
<Box>
|
|
66
|
-
<Separator />
|
|
67
|
-
</Box>
|
|
68
|
-
|
|
69
|
-
{inAppGuideContent.steps.map((content, index) => (
|
|
70
|
-
<Box key={index} flexDirection="column">
|
|
71
|
-
<Box flexDirection="column" padding={16} gap={8}>
|
|
72
|
-
<Box alignItems="center" gap={8}>
|
|
73
|
-
<Count>{index + 1}</Count>
|
|
74
|
-
<Text component="h3" variant="bold">
|
|
75
|
-
{content.title}
|
|
76
|
-
</Text>
|
|
77
|
-
</Box>
|
|
78
|
-
<Video src={content.videoUrl} sizing="contain" autoPlay loop />
|
|
79
|
-
<Text>{content.description}</Text>
|
|
80
|
-
</Box>
|
|
81
|
-
|
|
82
|
-
<Separator />
|
|
83
|
-
</Box>
|
|
84
|
-
))}
|
|
85
|
-
|
|
86
|
-
<Box flexDirection="column" padding={16} gap={4}>
|
|
87
|
-
<Text variant="bold">{inAppGuideContent.successTitle}</Text>
|
|
88
|
-
<Text>{inAppGuideContent.successDescription}</Text>
|
|
89
|
-
</Box>
|
|
90
|
-
</ScrollArea>
|
|
91
|
-
</DialogContent>
|
|
92
|
-
</Dialog>
|
|
93
|
-
);
|
|
94
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Text } from "@prismicio/editor-ui";
|
|
2
|
-
|
|
3
|
-
import { useRepositoryInformation } from "@/hooks/useRepositoryInformation";
|
|
4
|
-
|
|
5
|
-
export function useInAppGuideContent() {
|
|
6
|
-
const { repositoryUrl } = useRepositoryInformation();
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
title: "Build a page in 5 minutes",
|
|
10
|
-
description:
|
|
11
|
-
"Great, now that you have a page type, let's make it a live page!",
|
|
12
|
-
steps: [
|
|
13
|
-
{
|
|
14
|
-
title: "Add slices to your page type",
|
|
15
|
-
videoUrl:
|
|
16
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/ADD_SLICE.mp4",
|
|
17
|
-
description: "Use slice templates and add them to your page type.",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: "Code your page",
|
|
21
|
-
videoUrl:
|
|
22
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/CODE_SNIP.mp4",
|
|
23
|
-
description:
|
|
24
|
-
"If you don't already have a page component, copy-paste the page snippets provided in your page type to create one.",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
title: "Push to your Page Builder",
|
|
28
|
-
videoUrl:
|
|
29
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PUSH.mp4",
|
|
30
|
-
description:
|
|
31
|
-
"You have just created some models, but you can't use them yet. First, you must push them to the Page Builder. The Page Builder is where you create content. Go head — push your models.",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: "Create content",
|
|
35
|
-
videoUrl:
|
|
36
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/WRITE.mp4",
|
|
37
|
-
description: (
|
|
38
|
-
<>
|
|
39
|
-
Open your{" "}
|
|
40
|
-
<Text href={repositoryUrl} underline>
|
|
41
|
-
Page Builder
|
|
42
|
-
</Text>
|
|
43
|
-
, create a page, add slices, save, and publish. Then, come back
|
|
44
|
-
here.
|
|
45
|
-
</>
|
|
46
|
-
),
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
title: "Render your page",
|
|
50
|
-
videoUrl:
|
|
51
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PREVIEW.mp4",
|
|
52
|
-
description: (
|
|
53
|
-
<>
|
|
54
|
-
To render the page, run your project in your terminal and visit the
|
|
55
|
-
page on localhost (e.g.{" "}
|
|
56
|
-
<Text component="code">localhost:3000/example-page</Text>).
|
|
57
|
-
</>
|
|
58
|
-
),
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
successTitle: "Next",
|
|
62
|
-
successDescription:
|
|
63
|
-
"Create more slices and then go back to the Page Builder to build out your website.",
|
|
64
|
-
};
|
|
65
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.confettiCannon {
|
|
7
|
-
position: absolute;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.visible {
|
|
13
|
-
opacity: 1;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.invisible {
|
|
17
|
-
opacity: 0;
|
|
18
|
-
/* A delay of 2s gives room for a 3s confetti animation to happen and then
|
|
19
|
-
fade out while the it's ending */
|
|
20
|
-
transition: opacity 500ms linear 2s;
|
|
21
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button,
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuContent,
|
|
5
|
-
DropdownMenuItem,
|
|
6
|
-
DropdownMenuLabel,
|
|
7
|
-
DropdownMenuTrigger,
|
|
8
|
-
Icon,
|
|
9
|
-
Text,
|
|
10
|
-
} from "@prismicio/editor-ui";
|
|
11
|
-
import { useState } from "react";
|
|
12
|
-
|
|
13
|
-
import { telemetry } from "@/apiClient";
|
|
14
|
-
|
|
15
|
-
import { useOnboardingContext } from "./OnboardingProvider";
|
|
16
|
-
import { OnboardingStepDialog } from "./OnboardingStepDialog";
|
|
17
|
-
import type { OnboardingStep } from "./types";
|
|
18
|
-
|
|
19
|
-
const EndCtaIcon = () => <Icon name="playCircle" size="small" color="grey11" />;
|
|
20
|
-
|
|
21
|
-
interface OnboardingProgressStepperProps {
|
|
22
|
-
buttonSize?: "large" | "medium";
|
|
23
|
-
}
|
|
24
|
-
export function OnboardingProgressStepper(
|
|
25
|
-
props: OnboardingProgressStepperProps,
|
|
26
|
-
) {
|
|
27
|
-
const { buttonSize = "medium" } = props;
|
|
28
|
-
const { completedStepCount, steps, isStepComplete, isComplete } =
|
|
29
|
-
useOnboardingContext();
|
|
30
|
-
|
|
31
|
-
const [isListOpen, setListOpen] = useState(false);
|
|
32
|
-
const [isDialogOpen, setDialogOpen] = useState(false);
|
|
33
|
-
const [activeStep, setActiveStep] = useState(steps[0]);
|
|
34
|
-
|
|
35
|
-
const showStep = (step: OnboardingStep) => {
|
|
36
|
-
setActiveStep(step);
|
|
37
|
-
setDialogOpen(true);
|
|
38
|
-
void telemetry.track({
|
|
39
|
-
event: "onboarding:step-opened",
|
|
40
|
-
stepId: step.id,
|
|
41
|
-
stepTitle: step.title,
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<>
|
|
47
|
-
<OnboardingStepDialog
|
|
48
|
-
step={activeStep}
|
|
49
|
-
isOpen={isDialogOpen}
|
|
50
|
-
onClose={() => setDialogOpen(false)}
|
|
51
|
-
/>
|
|
52
|
-
<DropdownMenu open={isListOpen} onOpenChange={setListOpen}>
|
|
53
|
-
<DropdownMenuTrigger>
|
|
54
|
-
<Button
|
|
55
|
-
disabled={isComplete}
|
|
56
|
-
size={buttonSize}
|
|
57
|
-
color="grey"
|
|
58
|
-
sx={{ width: "100%" }}
|
|
59
|
-
renderEndIcon={EndCtaIcon}
|
|
60
|
-
{...{ onMouseEnter: () => setListOpen(true) }}
|
|
61
|
-
>
|
|
62
|
-
{completedStepCount > 0 ? "Continue" : "Start now"}
|
|
63
|
-
</Button>
|
|
64
|
-
</DropdownMenuTrigger>
|
|
65
|
-
{/* The sideOffset is used to align the list with the bottom of the onboarding card */}
|
|
66
|
-
<DropdownMenuContent align="center" sideOffset={-50} minWidth={256}>
|
|
67
|
-
<div onMouseLeave={() => setListOpen(false)}>
|
|
68
|
-
<DropdownMenuLabel>
|
|
69
|
-
<Text variant="small" color="grey11" sx={{ marginInline: 8 }}>
|
|
70
|
-
Progress
|
|
71
|
-
</Text>
|
|
72
|
-
</DropdownMenuLabel>
|
|
73
|
-
{steps.map((step, index) => {
|
|
74
|
-
const isCompleted = isStepComplete(step);
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<DropdownMenuItem
|
|
78
|
-
key={step.id}
|
|
79
|
-
onSelect={() => showStep(step)}
|
|
80
|
-
description={step.description}
|
|
81
|
-
completed={isCompleted}
|
|
82
|
-
readOnly={step.defaultCompleted}
|
|
83
|
-
endAdornment={
|
|
84
|
-
step.defaultCompleted !== true && (
|
|
85
|
-
<Icon name="chevronRight" size="small" color="grey11" />
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
>
|
|
89
|
-
{`${index + 1} ${step.title}`}
|
|
90
|
-
</DropdownMenuItem>
|
|
91
|
-
);
|
|
92
|
-
})}
|
|
93
|
-
</div>
|
|
94
|
-
</DropdownMenuContent>
|
|
95
|
-
</DropdownMenu>
|
|
96
|
-
</>
|
|
97
|
-
);
|
|
98
|
-
}
|