slice-machine-ui 1.26.1-beta.26 → 1.26.1-beta.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/{18539003-8854ec97730b0755.js → 18539003-32a73014bab3a789.js} +16 -16
  3. package/out/_next/static/chunks/{188-9cdca9e923488afd.js → 188-2e42d5ebef697946.js} +1 -1
  4. package/out/_next/static/chunks/756-b11a3060cdc2f2d3.js +10 -0
  5. package/out/_next/static/chunks/{91-717d764a224ac07f.js → 91-67c244a4a034c8de.js} +1 -1
  6. package/out/_next/static/chunks/pages/{_app-69457d1552479991.js → _app-0fe871bb1059a05c.js} +62 -60
  7. package/out/_next/static/chunks/pages/{changelog-042822d12df57669.js → changelog-3f04a3d8747ae383.js} +1 -1
  8. package/out/_next/static/chunks/pages/{changes-194f6cf187fa6ee7.js → changes-ec62e7eb50d6f2be.js} +1 -1
  9. package/out/_next/static/chunks/pages/{labs-7a4fe64cb86b59e8.js → labs-830dde0b85d6dd01.js} +1 -1
  10. package/out/_next/static/chunks/pages/{settings-419384d4d43070c2.js → settings-f61144a9387fd6f1.js} +1 -1
  11. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ad66e6c755798ce7.js +1 -0
  12. package/out/_next/static/chunks/pages/{slices-98f88ac46b6ad58b.js → slices-d65be4ca817a766d.js} +1 -1
  13. package/out/_next/static/css/037ba37d121d4afe.css +1 -0
  14. package/out/_next/static/css/{172e1bc0b9586c22.css → e3ffbc7931a47375.css} +1 -1
  15. package/out/_next/static/{0OvHJU1Z36y0jgiKYEzEO → pyrbPWeWVLzRfJjG0dPXm}/_buildManifest.js +1 -1
  16. package/out/changelog.html +1 -1
  17. package/out/changes.html +1 -1
  18. package/out/custom-types/[customTypeId].html +1 -1
  19. package/out/custom-types.html +1 -1
  20. package/out/index.html +1 -1
  21. package/out/labs.html +1 -1
  22. package/out/page-types/[pageTypeId].html +1 -1
  23. package/out/settings.html +1 -1
  24. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  25. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  26. package/out/slices.html +1 -1
  27. package/package.json +9 -9
  28. package/src/hooks/useScreenshotChangesModal.ts +1 -1
  29. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css +10 -0
  30. package/src/legacy/lib/builders/SliceBuilder/VariationsList/VariationsList.module.css.d.ts +5 -0
  31. package/src/legacy/lib/builders/SliceBuilder/{Sidebar → VariationsList}/index.tsx +164 -76
  32. package/src/legacy/lib/builders/SliceBuilder/index.tsx +10 -5
  33. package/out/_next/static/chunks/756-61dc56b98d01e964.js +0 -10
  34. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-40a32a76b39d70e8.js +0 -1
  35. package/out/_next/static/css/cb5dbae3d23ccce1.css +0 -1
  36. /package/out/_next/static/{0OvHJU1Z36y0jgiKYEzEO → pyrbPWeWVLzRfJjG0dPXm}/_ssgManifest.js +0 -0
  37. /package/src/legacy/lib/builders/SliceBuilder/{Sidebar → VariationsList}/AddVariationModal.tsx +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{840:function(e,n,r){"use strict";r.d(n,{F:function(){return A}});var t=r(52322),s=r(22715),a=r(97729),i=r.n(a),l=r(2784),c=r(41730),o=r(8564),d=r(78656),u=r(76478),f=r(24448),h=r(5632),x=r(82032),p=r(67557),m=r(50002),j=r(6277);r(36332);var g=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfg9",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dffi _1ecs97dffn _1ecs97dfk8 _1ecs97dfle",children:n})})},C=(0,l.createContext)("body");function v(){return(0,l.useContext)(C)}var b=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dffi _1ecs97dffn _1ecs97d18 _1ecs97d8l",children:n})})},_=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dffi _1ecs97dffn",children:n})})},y=function(e){var n,r=e.children,s=e.onClick,a=v();return(0,t.jsx)("tr",{className:(0,j.W)("_1ecs97dffi _1ecs97dffn _1ecs97dfnk",(n={},(0,p.Z)(n,"_1ecs97dfkk",!!s),(0,p.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97dfnn _1ecs97dfzr _1ecs97dfgv _1ecs97dfzu","body"===a),n)),onClick:function(e){var n,r=e.target;if(s&&e.currentTarget.contains(r)){var t=(0,m.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&s(e)}},children:r})},S=function(e){var n=e.children,r=v();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfiz _1ecs97dffj _1ecs97dah2 _1ecs97daof _1ecs97dfko _1ecs97dfy1",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dffi _1ecs97dffk",children:n})})},w=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},k=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},L=r(67445),Z=r(54845),T=r(22710),H=r(99267),I=r(18566),R=r(56580),N=r(15354),V=r(52312),z=r(81038),M=r(28849);function E(e){return F.apply(this,arguments)}function F(){return(F=(0,T.Z)(function(e){var n,r,t;return(0,H.__generator)(this,function(s){switch(s.label){case 0:return[4,z.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=s.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var P=function(e){var n,r,a,i,c,o,u=e.format,f=e.isCreatingCustomType,p=e.openCreateCustomTypeModal,m=(0,h.useRouter)(),j=(r=(0,l.useCallback)(function(e){return(0,I.VA)(E,[u],e)},[u]),{customTypes:(0,I.QT)(E,[u]),updateCustomTypes:r}),C=j.customTypes,v=j.updateCustomTypes,T=C.sort(function(e,n){return e.id.localeCompare(n.id)}),H=L.cd[u],z=d.$[u];return(o=(0,R.v9)(function(e){return{storeCustomTypes:(0,M.Ch)(e).filter(V.TG)}}).storeCustomTypes,(0,l.useEffect)(function(){var e=o.filter(function(e){return e.local.format===u});(e.length!==C.length||e.some(function(e){var n=C.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(N.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&v(e.map(function(e){var n=e.local;return N.Dc.fromSM(n)}))},[u,v,C,o]),0===T.length)?(0,t.jsxs)(x.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(x.u2,{children:(0,t.jsx)(s.Ee,{src:H.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(x.T9,{children:[(0,t.jsx)(x._T,{children:z.name({start:!0,plural:!0})}),(0,t.jsx)(x.nf,{children:z.blankSlateDescription}),(0,t.jsx)(x.Qj,{children:(0,t.jsx)(s.zx,{onClick:p,loading:f,children:"Create"})})]})]}):(0,t.jsxs)(g,{children:[(0,t.jsx)(b,{children:(0,t.jsxs)(y,{children:[(0,t.jsx)(S,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(S,{children:"Label"}),(0,t.jsx)(S,{children:"API ID"}),(0,t.jsx)(S,{children:"Limit"}),(0,t.jsx)(S,{})]})}),(0,t.jsx)(_,{children:T.map(function(e){var n=e.repeatable,r=e.label,s=e.id;return(0,t.jsxs)(y,{onClick:function(){m.push(L.cd[u].getBuilderPagePathname(s))},children:[(0,t.jsx)(S,{children:n?(0,t.jsx)(w,{}):(0,t.jsx)(k,{})}),(0,t.jsx)(S,{children:r}),(0,t.jsx)(S,{children:s}),(0,t.jsx)(S,{children:n?"Reusable":"Single"}),(0,t.jsx)(S,{children:(0,t.jsx)(Z._,{isChangesLocal:!1,format:u,customType:e})})]},s)})})]})},A=function(e){var n=e.format,r=d.$[n],a=(0,l.useState)(!1),h=a[0],x=a[1],p=(0,l.useState)(!1),m=p[0],j=p[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(o.S,{renderError:function(){return(0,t.jsx)(u.LN,{children:(0,t.jsx)(u.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(l.Suspense,{fallback:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{"data-testid":"create-ct",loading:h,onClick:function(){j(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(P,{format:n,isCreatingCustomType:h,openCreateCustomTypeModal:function(){j(!0)}}),(0,t.jsx)(f.M,{format:n,isCreating:h,isOpen:m,onCreateChange:x,onOpenChange:j})]})})]})})})]})}},98898:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),s=r(85244),a=r(98240),i=r(52322);r(2784);var l=r(75289),c=function(e){var n=e.bg,r=e.background,s=e.sx,a=e.withRadius,c=e.radius,o=e.children;return(0,i.jsx)(l.xu,{sx:(0,t.Z)({p:4,bg:n||r},a?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,s),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,d=void 0===o?null:o,u=e.Body,f=void 0===u?null:u,h=e.Footer,x=void 0===h?null:h,p=e.borderFooter,m=e.radius,j=void 0===m?"6px":m,g=e.bodySx,C=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,a.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,i.jsxs)(l.Zb,(0,s.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:j},void 0===v?null:v)},S),{children:[r?(0,i.jsx)(r,{radius:j}):null,d?(0,i.jsx)(d,{radius:j}):null,(0,i.jsxs)(c,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[f?(0,i.jsx)(f,{}):null,y||null]}),x?(0,i.jsx)(c,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===C?{}:C),radius:j,withRadius:!0,children:"object"==typeof x?x:(0,i.jsx)(x,{})}):null]}))}},24448:function(e,n,r){"use strict";r.d(n,{M:function(){return I}});var t=r(22710),s=r(62230),a=r(85244),i=r(99267),l=r(52322),c=r(5632),o=r(2784),d=r(56580),u=r(75289),f=r(91061),h=r(88932),x=r(82770),p=r(6777),m=r(78656);function j(){return(j=(0,t.Z)(function(e){var n,r,t,s,a,l,c,o,d,u;return(0,i.__generator)(this,function(i){switch(i.label){case 0:n=e.id,r=e.label,t=e.repeatable,s=e.format,a=e.onSuccess,l=m.$[s],c=(0,f.Ue)({id:n,label:r,repeatable:t,format:s}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,(0,x.KA)(c)];case 2:if((o=i.sent().errors).length>0)throw o;return x.Xe.track({event:"custom-type:created",id:c.id,name:r,format:s,type:t?"repeatable":"single",origin:"table"}),[4,a(c)];case 3:return i.sent(),h.Am.success((0,p.GX)({message:"".concat(l.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")})),[3,5];case 4:return d=i.sent(),u="Internal Error: ".concat(l.name({start:!0,plural:!1})," not saved"),console.error(u,d),h.Am.error(u),[3,5];case 5:return[2]}})})).apply(this,arguments)}var g=r(67445),C=r(50950),v=r(6134),b=r(63094),_=r(17384),y=r(28849),S=r(90374),w=r(36960),k=r(17064),L=r(63397),Z=r(98240),T=function(e){var n=e.selected,r=(0,Z.Z)(e,["selected"]);return(0,l.jsx)(u.kC,(0,s.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},H=function(e){var n=e.format,r=(0,k.Z)((0,L.U$)("repeatable"),3),t=r[0],s=r[2],a=m.$[n];return(0,l.jsxs)(u.xu,{mb:2,children:[(0,l.jsxs)(T,{selected:t.value,onClick:function(){return s.setValue(!0)},children:[(0,l.jsx)(u.Y8,{checked:t.value,onChange:function(){},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(T,{selected:!t.value,onClick:function(){return s.setValue(!1)},children:[(0,l.jsx)(u.Y8,{checked:!t.value,onChange:function(){},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},I=function(e){var n,r=e.format,h=e.isCreating,x=e.isOpen,p=e.origin,k=void 0===p?"table":p,L=e.onCreateChange,Z=e.onOpenChange,T=(0,S.Z)().createCustomTypeSuccess,I=(0,d.v9)(function(e){return{customTypeIds:(0,y.W6)(e),customTypeLabels:(0,y.YS)(e)}}),R=I.customTypeIds,N=I.customTypeLabels,V=m.$[r],z=(0,o.useState)(!0),M=z[0],E=z[1],F=(0,C.g)().syncChanges,P=(0,c.useRouter)(),A=(n=(0,t.Z)(function(e){var n,s,a;return(0,i.__generator)(this,function(l){switch(l.label){case 0:var c;return n=e.id,s=e.label,a=e.repeatable,L(!0),[4,function(e){return j.apply(this,arguments)}({format:r,id:n,label:s,origin:k,repeatable:a,onSuccess:(c=(0,t.Z)(function(e){var r,t;return(0,i.__generator)(this,function(s){switch(s.label){case 0:return T(e),r=(0,f.y6)(e),t=g.cd[r],E(!0),[4,P.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return s.sent(),F(),[2]}})}),function(e){return c.apply(this,arguments)})})];case 1:return l.sent(),L(!1),Z(!1),[2]}})}),function(e){return n.apply(this,arguments)}),D=function(e,n,r){r(M?(0,a.Z)((0,s.Z)({},n),{label:e.target.value,id:(0,_.lV)(e.target.value)}):(0,a.Z)((0,s.Z)({},n),{label:e.target.value}))},O=function(e,n){n("id",e.target.value),E(!1)};return(0,l.jsx)(v.Z,{testId:"create-ct-modal",isOpen:x,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){Z(!1),E(!0)},onSubmit:function(e){A(e)},isLoading:h,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&N.includes(r)&&(t.label="".concat(V.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||b.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&R.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(V.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,s=e.setFieldValue,a=e.values,i=e.touched;return(0,l.jsxs)(u.xu,{children:[(0,l.jsx)(H,{format:r}),(0,l.jsx)(w.W,{name:"label",label:"".concat(V.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(V.name({start:!1,plural:!1})),error:i.label?n.label:void 0,onChange:function(e){return D(e,a,t)}}),(0,l.jsx)(w.W,{name:"id",testId:"ct-id-input",label:"".concat(V.name({start:!0,plural:!1})," ID"),placeholder:V.inputPlaceholder,error:i.id?n.id:void 0,onChange:function(e){return O(e,s)}})]})}})}},63094:function(e,n,r){"use strict";r.d(n,{Sn:function(){return l},lS:function(){return t},nG:function(){return s},pq:function(){return c},rd:function(){return i},xo:function(){return a}});var t=["components"],s=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,i="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",c="slice-machine-simulator"},36332:function(){}}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91],{840:function(e,n,r){"use strict";r.d(n,{F:function(){return A}});var t=r(52322),s=r(22715),a=r(97729),i=r.n(a),l=r(2784),c=r(41730),o=r(8564),d=r(78656),u=r(38562),f=r(24448),h=r(5632),x=r(82032),p=r(67557),m=r(50002),j=r(6277);r(36332);var g=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfg9",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dffi _1ecs97dffn _1ecs97dfk8 _1ecs97dfle",children:n})})},C=(0,l.createContext)("body");function v(){return(0,l.useContext)(C)}var b=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dffi _1ecs97dffn _1ecs97d18 _1ecs97d8l",children:n})})},_=function(e){var n=e.children;return(0,t.jsx)(C.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dffi _1ecs97dffn",children:n})})},y=function(e){var n,r=e.children,s=e.onClick,a=v();return(0,t.jsx)("tr",{className:(0,j.W)("_1ecs97dffi _1ecs97dffn _1ecs97dfnk",(n={},(0,p.Z)(n,"_1ecs97dfkk",!!s),(0,p.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97dfnn _1ecs97dfzr _1ecs97dfgv _1ecs97dfzu","body"===a),n)),onClick:function(e){var n,r=e.target;if(s&&e.currentTarget.contains(r)){var t=(0,m.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&s(e)}},children:r})},S=function(e){var n=e.children,r=v();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dffi _1ecs97dffn _1ecs97d3j4 _1ecs97d3qh _1ecs97dfiz _1ecs97dffj _1ecs97dah2 _1ecs97daof _1ecs97dfko _1ecs97dfy1",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dffi _1ecs97dffk",children:n})})},w=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},k=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},L=r(67445),Z=r(54845),T=r(22710),H=r(99267),I=r(18566),R=r(56580),N=r(15354),V=r(52312),z=r(81038),M=r(28849);function E(e){return F.apply(this,arguments)}function F(){return(F=(0,T.Z)(function(e){var n,r,t;return(0,H.__generator)(this,function(s){switch(s.label){case 0:return[4,z.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=s.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var P=function(e){var n,r,a,i,c,o,u=e.format,f=e.isCreatingCustomType,p=e.openCreateCustomTypeModal,m=(0,h.useRouter)(),j=(r=(0,l.useCallback)(function(e){return(0,I.VA)(E,[u],e)},[u]),{customTypes:(0,I.QT)(E,[u]),updateCustomTypes:r}),C=j.customTypes,v=j.updateCustomTypes,T=C.sort(function(e,n){return e.id.localeCompare(n.id)}),H=L.cd[u],z=d.$[u];return(o=(0,R.v9)(function(e){return{storeCustomTypes:(0,M.Ch)(e).filter(V.TG)}}).storeCustomTypes,(0,l.useEffect)(function(){var e=o.filter(function(e){return e.local.format===u});(e.length!==C.length||e.some(function(e){var n=C.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(N.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&v(e.map(function(e){var n=e.local;return N.Dc.fromSM(n)}))},[u,v,C,o]),0===T.length)?(0,t.jsxs)(x.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(x.u2,{children:(0,t.jsx)(s.Ee,{src:H.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(x.T9,{children:[(0,t.jsx)(x._T,{children:z.name({start:!0,plural:!0})}),(0,t.jsx)(x.nf,{children:z.blankSlateDescription}),(0,t.jsx)(x.Qj,{children:(0,t.jsx)(s.zx,{onClick:p,loading:f,children:"Create"})})]})]}):(0,t.jsxs)(g,{children:[(0,t.jsx)(b,{children:(0,t.jsxs)(y,{children:[(0,t.jsx)(S,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(S,{children:"Label"}),(0,t.jsx)(S,{children:"API ID"}),(0,t.jsx)(S,{children:"Limit"}),(0,t.jsx)(S,{})]})}),(0,t.jsx)(_,{children:T.map(function(e){var n=e.repeatable,r=e.label,s=e.id;return(0,t.jsxs)(y,{onClick:function(){m.push(L.cd[u].getBuilderPagePathname(s))},children:[(0,t.jsx)(S,{children:n?(0,t.jsx)(w,{}):(0,t.jsx)(k,{})}),(0,t.jsx)(S,{children:r}),(0,t.jsx)(S,{children:s}),(0,t.jsx)(S,{children:n?"Reusable":"Single"}),(0,t.jsx)(S,{children:(0,t.jsx)(Z._,{isChangesLocal:!1,format:u,customType:e})})]},s)})})]})},A=function(e){var n=e.format,r=d.$[n],a=(0,l.useState)(!1),h=a[0],x=a[1],p=(0,l.useState)(!1),m=p[0],j=p[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(o.S,{renderError:function(){return(0,t.jsx)(u.LN,{children:(0,t.jsx)(u.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(l.Suspense,{fallback:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(u.LN,{children:[(0,t.jsxs)(u.wd,{children:[(0,t.jsx)(u.Cx,{children:(0,t.jsx)(c.g,{children:r.name({start:!0,plural:!0})})}),(0,t.jsx)(u.K2,{children:(0,t.jsx)(s.zx,{"data-testid":"create-ct",loading:h,onClick:function(){j(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(u.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(P,{format:n,isCreatingCustomType:h,openCreateCustomTypeModal:function(){j(!0)}}),(0,t.jsx)(f.M,{format:n,isCreating:h,isOpen:m,onCreateChange:x,onOpenChange:j})]})})]})})})]})}},98898:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),s=r(85244),a=r(98240),i=r(52322);r(2784);var l=r(75289),c=function(e){var n=e.bg,r=e.background,s=e.sx,a=e.withRadius,c=e.radius,o=e.children;return(0,i.jsx)(l.xu,{sx:(0,t.Z)({p:4,bg:n||r},a?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,s),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,d=void 0===o?null:o,u=e.Body,f=void 0===u?null:u,h=e.Footer,x=void 0===h?null:h,p=e.borderFooter,m=e.radius,j=void 0===m?"6px":m,g=e.bodySx,C=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,a.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,i.jsxs)(l.Zb,(0,s.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:j},void 0===v?null:v)},S),{children:[r?(0,i.jsx)(r,{radius:j}):null,d?(0,i.jsx)(d,{radius:j}):null,(0,i.jsxs)(c,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[f?(0,i.jsx)(f,{}):null,y||null]}),x?(0,i.jsx)(c,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===C?{}:C),radius:j,withRadius:!0,children:"object"==typeof x?x:(0,i.jsx)(x,{})}):null]}))}},24448:function(e,n,r){"use strict";r.d(n,{M:function(){return I}});var t=r(22710),s=r(62230),a=r(85244),i=r(99267),l=r(52322),c=r(5632),o=r(2784),d=r(56580),u=r(75289),f=r(91061),h=r(88932),x=r(82770),p=r(6777),m=r(78656);function j(){return(j=(0,t.Z)(function(e){var n,r,t,s,a,l,c,o,d,u;return(0,i.__generator)(this,function(i){switch(i.label){case 0:n=e.id,r=e.label,t=e.repeatable,s=e.format,a=e.onSuccess,l=m.$[s],c=(0,f.Ue)({id:n,label:r,repeatable:t,format:s}),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,(0,x.KA)(c)];case 2:if((o=i.sent().errors).length>0)throw o;return x.Xe.track({event:"custom-type:created",id:c.id,name:r,format:s,type:t?"repeatable":"single",origin:"table"}),[4,a(c)];case 3:return i.sent(),h.Am.success((0,p.GX)({message:"".concat(l.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")})),[3,5];case 4:return d=i.sent(),u="Internal Error: ".concat(l.name({start:!0,plural:!1})," not saved"),console.error(u,d),h.Am.error(u),[3,5];case 5:return[2]}})})).apply(this,arguments)}var g=r(67445),C=r(50950),v=r(6134),b=r(63094),_=r(17384),y=r(28849),S=r(90374),w=r(36960),k=r(17064),L=r(63397),Z=r(98240),T=function(e){var n=e.selected,r=(0,Z.Z)(e,["selected"]);return(0,l.jsx)(u.kC,(0,s.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},H=function(e){var n=e.format,r=(0,k.Z)((0,L.U$)("repeatable"),3),t=r[0],s=r[2],a=m.$[n];return(0,l.jsxs)(u.xu,{mb:2,children:[(0,l.jsxs)(T,{selected:t.value,onClick:function(){return s.setValue(!0)},children:[(0,l.jsx)(u.Y8,{checked:t.value,onChange:function(){},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(T,{selected:!t.value,onClick:function(){return s.setValue(!1)},children:[(0,l.jsx)(u.Y8,{checked:!t.value,onChange:function(){},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(u.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(u.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},I=function(e){var n,r=e.format,h=e.isCreating,x=e.isOpen,p=e.origin,k=void 0===p?"table":p,L=e.onCreateChange,Z=e.onOpenChange,T=(0,S.Z)().createCustomTypeSuccess,I=(0,d.v9)(function(e){return{customTypeIds:(0,y.W6)(e),customTypeLabels:(0,y.YS)(e)}}),R=I.customTypeIds,N=I.customTypeLabels,V=m.$[r],z=(0,o.useState)(!0),M=z[0],E=z[1],F=(0,C.g)().syncChanges,P=(0,c.useRouter)(),A=(n=(0,t.Z)(function(e){var n,s,a;return(0,i.__generator)(this,function(l){switch(l.label){case 0:var c;return n=e.id,s=e.label,a=e.repeatable,L(!0),[4,function(e){return j.apply(this,arguments)}({format:r,id:n,label:s,origin:k,repeatable:a,onSuccess:(c=(0,t.Z)(function(e){var r,t;return(0,i.__generator)(this,function(s){switch(s.label){case 0:return T(e),r=(0,f.y6)(e),t=g.cd[r],E(!0),[4,P.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return s.sent(),F(),[2]}})}),function(e){return c.apply(this,arguments)})})];case 1:return l.sent(),L(!1),Z(!1),[2]}})}),function(e){return n.apply(this,arguments)}),D=function(e,n,r){r(M?(0,a.Z)((0,s.Z)({},n),{label:e.target.value,id:(0,_.lV)(e.target.value)}):(0,a.Z)((0,s.Z)({},n),{label:e.target.value}))},O=function(e,n){n("id",e.target.value),E(!1)};return(0,l.jsx)(v.Z,{testId:"create-ct-modal",isOpen:x,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){Z(!1),E(!0)},onSubmit:function(e){A(e)},isLoading:h,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&N.includes(r)&&(t.label="".concat(V.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||b.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&R.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(V.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,s=e.setFieldValue,a=e.values,i=e.touched;return(0,l.jsxs)(u.xu,{children:[(0,l.jsx)(H,{format:r}),(0,l.jsx)(w.W,{name:"label",label:"".concat(V.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(V.name({start:!1,plural:!1})),error:i.label?n.label:void 0,onChange:function(e){return D(e,a,t)}}),(0,l.jsx)(w.W,{name:"id",testId:"ct-id-input",label:"".concat(V.name({start:!0,plural:!1})," ID"),placeholder:V.inputPlaceholder,error:i.id?n.id:void 0,onChange:function(e){return O(e,s)}})]})}})}},63094:function(e,n,r){"use strict";r.d(n,{Sn:function(){return l},lS:function(){return t},nG:function(){return s},pq:function(){return c},rd:function(){return i},xo:function(){return a}});var t=["components"],s=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,i="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",c="slice-machine-simulator"},36332:function(){}}]);