slice-machine-ui 2.18.1-beta.7 → 2.18.1-beta.8
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/{Zy4opMpDS8I-mxQ1kA3m2 → U9WVTg1pSTJVt94SbRE5Y}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/{248-43faecb386a16518.js → 248-a9c33f7fbe2da2f1.js} +1 -1
- package/out/_next/static/chunks/34-50c64778da33cff6.js +1 -0
- package/out/_next/static/chunks/429-aab52070cad2884b.js +3 -0
- package/out/_next/static/chunks/{489-234ed5471aa694b3.js → 489-a046ae0fa4f74435.js} +1 -1
- package/out/_next/static/chunks/{630-bb6e3db525588f16.js → 630-eae75e90b30f201a.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-64feff311539f17b.js → _app-1b4541325b4a29ab.js} +40 -40
- package/out/_next/static/chunks/pages/{changelog-ba55ed247c20dc21.js → changelog-3901f2fc937d9648.js} +1 -1
- package/out/_next/static/chunks/pages/changes-c58a60af39167147.js +1 -0
- package/out/_next/static/chunks/pages/{labs-78ac01d97ab02cd7.js → labs-dd04033db23a58f3.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-b127d948a17968d3.js → simulator-f237aaa755dc9a99.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-da423aa0da7bc11e.js → [variation]-c8c3e7ffb898261c.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-59b857edc9f72d5f.js → slices-0aaae79dcc7b8c55.js} +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/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/src/features/auth/LogoutButton.tsx +42 -36
- package/src/features/builder/fields/contentRelationship/ContentRelationshipFieldPicker.tsx +3 -3
- package/src/features/changes/StatusBadge.tsx +1 -9
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +3 -3
- package/src/features/customTypes/customTypesTable/CustomTypesTablePage.tsx +3 -3
- package/src/features/environments/actions/useSetEnvironment.ts +22 -0
- package/src/features/environments/useActiveEnvironment.ts +17 -9
- package/src/features/environments/useEnvironments.ts +11 -8
- package/src/features/errorBoundaries/AppStateErrorBoundary.tsx +108 -0
- package/src/{ErrorBoundary.tsx → features/errorBoundaries/DefaultErrorBoundary.tsx} +2 -2
- package/src/features/errorBoundaries/index.ts +2 -0
- package/src/features/labs/labsList/LabsPage.tsx +3 -3
- package/src/features/navigation/Navigation.tsx +7 -8
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +3 -3
- package/src/features/sync/AutoSyncProvider.tsx +2 -2
- package/src/features/sync/getUnSyncChanges.ts +1 -3
- package/src/legacy/components/AppLayout/index.tsx +10 -85
- package/src/legacy/components/ChangesEmptyState/UnauthenticatedView.tsx +31 -0
- package/src/legacy/components/ChangesEmptyState/index.ts +1 -1
- package/src/legacy/components/ChangesItems/ChangesItems.tsx +3 -3
- package/src/legacy/components/LoginModal/index.tsx +14 -6
- package/src/legacy/components/Navigation/ChangesItem.tsx +2 -6
- package/src/legacy/components/Navigation/Environment.tsx +2 -7
- package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +3 -8
- package/src/legacy/components/Simulator/index.tsx +3 -3
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -3
- package/src/modules/userContext/index.ts +5 -5
- package/src/modules/userContext/types.ts +2 -3
- package/src/pages/_app.tsx +93 -95
- package/src/pages/changes.tsx +4 -5
- package/src/queryClient.tsx +24 -0
- package/test/__testutils__/index.tsx +13 -10
- package/out/_next/static/chunks/157-fa8b348c960c8283.js +0 -3
- package/out/_next/static/chunks/34-8d9d9b2944824750.js +0 -1
- package/out/_next/static/chunks/pages/changes-4c23263cdc8e59c6.js +0 -1
- package/src/features/environments/actions/setEnvironment.ts +0 -18
- package/src/legacy/components/ChangesEmptyState/AuthErrorPage.tsx +0 -44
- /package/out/_next/static/{Zy4opMpDS8I-mxQ1kA3m2 → U9WVTg1pSTJVt94SbRE5Y}/_ssgManifest.js +0 -0
package/out/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/bc89f2cd4e4781f5.css" as="style"/><link rel="stylesheet" href="/_next/static/css/bc89f2cd4e4781f5.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-e0c07a2fe4908d81.js" defer=""></script><script src="/_next/static/chunks/framework-ab7ddb551c23d05a.js" defer=""></script><script src="/_next/static/chunks/main-c46f4dcf6e3174bd.js" defer=""></script><script src="/_next/static/chunks/pages/_app-1b4541325b4a29ab.js" defer=""></script><script src="/_next/static/chunks/pages/_error-fedd2c6ebd3d27b9.js" defer=""></script><script src="/_next/static/U9WVTg1pSTJVt94SbRE5Y/_buildManifest.js" defer=""></script><script src="/_next/static/U9WVTg1pSTJVt94SbRE5Y/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"U9WVTg1pSTJVt94SbRE5Y","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,d,n,u,h,k,j,l,
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,d,n,u,f,h,k,j,l,p,g,o,r,m,_,y){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,e,p,g,"static/chunks/pages/index-0d8cb369de720a35.js"],"/_error":["static/chunks/pages/_error-fedd2c6ebd3d27b9.js"],"/changelog":[c,t,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-3901f2fc937d9648.js"],"/changes":[c,i,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-fa4f2563cb5fd014.js",a,d,"static/css/d98ebc475f8423a3.css","static/chunks/pages/changes-c58a60af39167147.js"],"/custom-types":[s,e,p,g,"static/chunks/pages/custom-types-5acd56959b60346f.js"],"/custom-types/[customTypeId]":[c,n,u,f,h,s,t,b,k,o,a,e,j,l,r,m,"static/chunks/pages/custom-types/[customTypeId]-af9376721beb489e.js"],"/labs":["static/chunks/pages/labs-dd04033db23a58f3.js"],"/page-types/[pageTypeId]":[c,n,u,f,h,s,t,b,k,o,a,e,j,l,r,m,"static/chunks/pages/page-types/[pageTypeId]-a24665e91b882169.js"],"/slices":[c,i,_,s,b,y,a,d,l,"static/css/efa5152b7c0f35c0.css","static/chunks/pages/slices-0aaae79dcc7b8c55.js"],"/slices/[lib]/[sliceName]/[variation]":[c,i,n,u,f,h,_,s,t,b,k,y,"static/chunks/484-3e011e79c41f0342.js",a,j,d,"static/css/e8e03c0d4003d1eb.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c8c3e7ffb898261c.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[i,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/429-aab52070cad2884b.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-f237aaa755dc9a99.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/397-e6c340070a3bcb41.js","static/chunks/59b4e022-ef680789f7cc9b11.js","static/chunks/34-50c64778da33cff6.js","static/chunks/647-4379a741c8d85d9e.js","static/chunks/183-4ea255b867ff171b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/344-fdb3008f4bb3b0c1.js","static/chunks/658-8231c0b729e0124a.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/256-07f768a2b19b0a0e.js","static/chunks/630-eae75e90b30f201a.js","static/chunks/907-445266211c48b1a5.js","static/chunks/248-a9c33f7fbe2da2f1.js","static/css/4e475d945cf8a890.css","static/chunks/422-c9192a1dbdd2ae0e.js","static/chunks/489-a046ae0fa4f74435.js","static/css/56f2a6684a524374.css","static/chunks/52d4c156-89c6ec6efca0a0bb.js","static/chunks/500-d3989390f5e8da53.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[248],{72641:function(e,t,n){"use strict";n.d(t,{R$:function(){return i},Qj:function(){return x},T9:function(){return d},nf:function(){return h},u2:function(){return o},_T:function(){return u}});var l=n(52322),r=n(14226),a=n(6277),s=n(83478),c=n.n(s);let i=e=>{let{backgroundImage:t,style:n,...r}=e,s=void 0!==t;return(0,l.jsx)("article",{...r,className:(0,a.W)(c().root,{[c().withBackground]:s}),style:{backgroundImage:s?"url(".concat(t,")"):void 0,...n}})},o=e=>(0,l.jsx)("div",{...e,className:c().image}),d=e=>(0,l.jsx)("div",{...e,className:c().content}),u=e=>(0,l.jsx)(r.bL,{...e,variant:"h3"}),h=e=>(0,l.jsx)(r.bL,{...e,color:"grey11"}),x=e=>(0,l.jsx)("div",{...e,className:c().actions,color:"grey"})},38241:function(e,t,n){"use strict";n.d(t,{F:function(){return O}});var l=n(52322),r=n(14226),a=n(97729),s=n.n(a),c=n(2784),i=n(43388),o=n(17378),d=n(98564),u=n(62813),h=n(5632),x=n(56580),m=n(75289),p=n(77630),j=n(88932),g=n(94160),b=n(39204);async function f(e){let{id:t,label:n,repeatable:l,format:r,onSuccess:a}=e,s=d.$[r],c=(0,p.Ue)({id:t,label:n,repeatable:l,format:r});try{let{errors:e}=await (0,g.KA)({customType:c});if(e.length>0)throw e;g.Xe.track({event:"custom-type:created",id:c.id,name:n,format:r,type:l?"repeatable":"single",origin:"table"}),await a(c),j.Am.success((0,b.GX)({message:"".concat(s.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")}))}catch(t){let e="Internal Error: ".concat(s.name({start:!0,plural:!1})," not saved");console.error(e,t),j.Am.error(e)}}var v=n(59294),_=n(98250),S=n(68968),y=n(59532),C=n(7974),k=n(358),w=n(78254),L=n(54597),I=n(46999),R=n(63397);let B=e=>{let{selected:t,...n}=e;return(0,l.jsx)(m.kC,{sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:t?e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}:"none","&:hover":{boxShadow:e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}}},...n})},N=e=>{let{format:t}=e,[n,,r]=(0,R.U$)("repeatable"),a=d.$[t];return(0,l.jsxs)(m.xu,{mb:2,children:[(0,l.jsxs)(B,{selected:n.value,onClick:()=>r.setValue(!0),children:[(0,l.jsx)(m.Y8,{checked:n.value,onChange:()=>{},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(B,{selected:!n.value,onClick:()=>r.setValue(!1),children:[(0,l.jsx)(m.Y8,{checked:!n.value,onChange:()=>{},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},z=e=>{let{format:t,isCreating:n,isOpen:r,origin:a="table",onCreateChange:s,onOpenChange:i}=e,{createCustomTypeSuccess:o}=(0,L.Z)(),{completeStep:u}=(0,_.k)(),{customTypeIds:j,customTypeLabels:g}=(0,x.v9)(e=>({customTypeIds:(0,w.W6)(e),customTypeLabels:(0,w.YS)(e)})),b=d.$[t],[R,B]=(0,c.useState)(!0),{syncChanges:z}=(0,S.g)(),E=(0,h.useRouter)(),T=async e=>{let{id:n,label:l,repeatable:r}=e;s(!0),await f({format:t,id:n,label:l,origin:a,repeatable:r,onSuccess:async e=>{o(e);let t=(0,p.y6)(e),l=v.cd[t];B(!0),await E.push({pathname:l.getBuilderPagePathname(n)}),z(),"page"===t&&u("createPageType")}}),s(!1),i(!1)},G=(e,t,n)=>{n(R?{...t,label:e.target.value,id:(0,k.lV)(e.target.value)}:{...t,label:e.target.value})},D=(e,t)=>{t("id",e.target.value),B(!1)};return(0,l.jsx)(y.Z,{testId:"create-ct-modal",isOpen:r,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:()=>{i(!1),B(!0)},onSubmit:e=>{T(e)},isLoading:n,initialValues:{repeatable:!0,id:"",label:""},validate:e=>{let{id:t,label:n}=e,l={};return n&&n.length||(l.label="Cannot be empty."),!l.label&&g.includes(n)&&(l.label="".concat(b.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(n.toLowerCase())&&(l.label='Name "'.concat(n,'" is reserved for Slice Machine use.')),t&&t.length||(l.id="ID cannot be empty."),["update","insert"].includes(t.toLowerCase())&&(l.id='Id "'.concat(t,'" is reserved for Slice Machine use.')),l.id||!t||C.xo.exec(t)||(l.id="Invalid id: No special characters allowed."),!l.id&&t&&j.map(e=>e.toLowerCase()).includes(t)&&(l.id='ID "'.concat(t,'" exists already.')),Object.keys(l).length>0?l:void 0},content:{title:"Create a new ".concat(b.name({start:!1,plural:!1}))},children:e=>{let{errors:n,setValues:r,setFieldValue:a,values:s,touched:c}=e;return(0,l.jsxs)(m.xu,{children:[(0,l.jsx)(N,{format:t}),(0,l.jsx)(I.W,{name:"label",label:"".concat(b.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(b.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:e=>G(e,s,r)}),(0,l.jsx)(I.W,{name:"id",testId:"ct-id-input",label:"".concat(b.name({start:!0,plural:!1})," ID"),placeholder:b.inputPlaceholder,error:c.id?n.id:void 0,onChange:e=>D(e,a)})]})}})};var E=n(72641);let T=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc"}),(0,l.jsx)("path",{d:"m10.0912 8c-2.8118 0-5.0912 2.2794-5.0912 5.0912s2.2794 5.0912 5.0912 5.0912c1.8851 0 3.5303-1.0247 4.4098-2.5452.1553-.2684.2868-.5523.3916-.8489.092-.2604-.0444-.5461-.3048-.6381-.2603-.092-.546.0445-.638.3048-.0841.238-.1897.4659-.3144.6815-.7081 1.2241-2.0305 2.0459-3.5442 2.0459-2.2595 0-4.0912-1.8317-4.0912-4.0912s1.8317-4.0912 4.0912-4.0912c1.3566 0 2.5595.66 3.3043 1.6782h-1.7739c-.2761 0-.5.2239-.5.5 0 .2762.2239.5.5.5h2.6782c.2762 0 .5-.2238.5-.5v-2.6782c0-.2761-.2238-.5-.5-.5-.2761 0-.5.2239-.5.5v1.1032c-.9281-.9865-2.2462-1.6032-3.7086-1.6032z",fill:"#fff"})]}),G=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m8.0869 10.6818.5758-2.3031c.0556-.2226.2556-.3787.485-.3787.3253 0 .564.3057.4851.6213l-.5151 2.0605h2.6055l.5758-2.3031c.0557-.2226.2557-.3787.4851-.3787.3253 0 .564.3057.4851.6213l-.5152 2.0605h2.246c.2761 0 .5.2239.5.5 0 .2762-.2239.5-.5.5h-2.496l-.6591 2.6364h2.1551c.2761 0 .5.2238.5.5 0 .2761-.2239.5-.5.5h-2.4051l-.5757 2.3031c-.0557.2226-.2557.3787-.4851.3787-.3253 0-.564-.3057-.4851-.6213l.5152-2.0605h-2.6056l-.5758 2.3031c-.0556.2226-.2556.3787-.4851.3787-.3253 0-.5639-.3057-.485-.6213l.5151-2.0605h-1.9278c-.2761 0-.5-.2239-.5-.5 0-.2762.2239-.5.5-.5h2.1778l.6591-2.6364h-1.8369c-.2761 0-.5-.2238-.5-.5 0-.2761.2239-.5.5-.5zm2.7273 3.6364.659-2.6364h-2.6055l-.6591 2.6364z",fill:"#fff"})]});var D=n(60867),P=n(50477),W=n(94840),A=n(16442);let $=e=>{let{format:t,isCreatingCustomType:n,openCreateCustomTypeModal:a}=e,s=(0,h.useRouter)(),{customTypes:i,updateCustomTypes:o}=(0,P.xU)(t),u=i.sort((e,t)=>e.id.localeCompare(t.id)),m=v.cd[t],p=d.$[t];return(!function(e,t,n){let{storeCustomTypes:l}=(0,x.v9)(e=>({storeCustomTypes:(0,w.Ch)(e).filter(A.TG)}));(0,c.useEffect)(()=>{let r=l.filter(e=>{let{local:n}=e;return n.format===t});(r.length!==e.length||r.some(t=>{let n=e.find(e=>e.id===t.local.id);return!n||JSON.stringify(W.Dc.fromSM(t.local))!==JSON.stringify(n)}))&&n(r.map(e=>{let{local:t}=e;return W.Dc.fromSM(t)}))},[t,n,e,l])}(i,t,o),0===u.length)?(0,l.jsxs)(E.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:r.t.space[72]},children:[(0,l.jsx)(E.u2,{children:(0,l.jsx)(r.a_,{src:m.blankSlateImage,sizing:"cover"})}),(0,l.jsxs)(E.T9,{children:[(0,l.jsx)(E._T,{children:p.name({start:!0,plural:!0})}),(0,l.jsx)(E.nf,{children:p.blankSlateDescription}),(0,l.jsx)(E.Qj,{children:(0,l.jsx)(r.E,{onClick:a,loading:n,children:"Create"})})]})]}):(0,l.jsx)("div",{children:(0,l.jsxs)(r.bE,{columnLayout:"28px 1fr 1fr 1fr 42px",children:[(0,l.jsx)(r.bH,{children:(0,l.jsxs)(r.bI,{children:[(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.aX,{name:"notes",size:"medium"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Label"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"API ID"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Limit"})}),(0,l.jsx)(r.bG,{})]})}),(0,l.jsx)(r.bF,{children:u.map(e=>{let{repeatable:n,label:a,id:c}=e;return(0,l.jsxs)(r.bI,{onClick:()=>{s.push(v.cd[t].getBuilderPagePathname(c))},children:[(0,l.jsx)(r.bG,{children:n?(0,l.jsx)(T,{width:r.t.space[20]}):(0,l.jsx)(G,{width:r.t.space[20]})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{variant:"bold",noWrap:!0,children:a})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:c})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:n?"Reusable":"Single"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(D._,{isChangesLocal:!1,format:t,customType:e})})]},c)})})]})})},O=e=>{let{format:t}=e,n=d.$[t],[a,h]=(0,c.useState)(!1),[x,m]=(0,c.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s(),{children:(0,l.jsxs)("title",{children:[n.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,l.jsx)(o.S,{renderError:()=>(0,l.jsx)(u.LN,{children:(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.D,{alignItems:"center",justifyContent:"center",children:(0,l.jsx)(r.ax,{title:"Request failed",description:"An error occurred while fetching your ".concat(n.name({start:!1,plural:!0}),".")})})})}),children:(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.bg,{})})]}),children:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{"data-testid":"create-ct",loading:a,onClick:()=>{m(!0)},startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsxs)(r.D,{flexDirection:"column",children:[(0,l.jsx)($,{format:t,isCreatingCustomType:a,openCreateCustomTypeModal:()=>{m(!0)}}),(0,l.jsx)(z,{format:t,isCreating:a,isOpen:x,onCreateChange:h,onOpenChange:m})]})})]})})})]})}},30527:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},W:function(){return i}});var l=n(52322),r=n(2784),a=n(75289);let s=e=>{let{bg:t,background:n,sx:r,withRadius:s,radius:c,children:i}=e;return(0,l.jsx)(a.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,...r},children:i})},c=(0,r.createContext)("6px"),i=()=>(0,r.useContext)(c),o=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:i=null,borderFooter:o=!1,radius:d="6px",bodySx:u={},footerSx:h={},sx:x=null,bg:m,background:p,children:j,...g}=e;return(0,l.jsx)(c.Provider,{value:d,children:(0,l.jsxs)(a.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:d,...x},...g,children:[t||null,n||null,(0,l.jsxs)(s,{bg:m,background:p,sx:u,withRadius:!i,children:[r?(0,l.jsx)(r,{}):null,j||null]}),i?(0,l.jsx)(s,{bg:m,background:p,sx:{...o?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...h},radius:d,withRadius:!0,children:"object"==typeof i?i:(0,l.jsx)(i,{})}):null]})})}},7974:function(e,t,n){"use strict";n.d(t,{Sn:function(){return c},lS:function(){return l},nG:function(){return r},pq:function(){return i},rd:function(){return s},xo:function(){return a}});let l=["components","update","insert"],r=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,s="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",i="slice-machine-simulator"},83478:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[248],{72641:function(e,t,n){"use strict";n.d(t,{R$:function(){return i},Qj:function(){return x},T9:function(){return d},nf:function(){return h},u2:function(){return o},_T:function(){return u}});var l=n(52322),r=n(14226),a=n(6277),s=n(83478),c=n.n(s);let i=e=>{let{backgroundImage:t,style:n,...r}=e,s=void 0!==t;return(0,l.jsx)("article",{...r,className:(0,a.W)(c().root,{[c().withBackground]:s}),style:{backgroundImage:s?"url(".concat(t,")"):void 0,...n}})},o=e=>(0,l.jsx)("div",{...e,className:c().image}),d=e=>(0,l.jsx)("div",{...e,className:c().content}),u=e=>(0,l.jsx)(r.bL,{...e,variant:"h3"}),h=e=>(0,l.jsx)(r.bL,{...e,color:"grey11"}),x=e=>(0,l.jsx)("div",{...e,className:c().actions,color:"grey"})},38241:function(e,t,n){"use strict";n.d(t,{F:function(){return O}});var l=n(52322),r=n(14226),a=n(97729),s=n.n(a),c=n(2784),i=n(43388),o=n(98564),d=n(87446),u=n(58446),h=n(5632),x=n(56580),m=n(75289),p=n(77630),j=n(88932),g=n(94160),b=n(39204);async function f(e){let{id:t,label:n,repeatable:l,format:r,onSuccess:a}=e,s=o.$[r],c=(0,p.Ue)({id:t,label:n,repeatable:l,format:r});try{let{errors:e}=await (0,g.KA)({customType:c});if(e.length>0)throw e;g.Xe.track({event:"custom-type:created",id:c.id,name:n,format:r,type:l?"repeatable":"single",origin:"table"}),await a(c),j.Am.success((0,b.GX)({message:"".concat(s.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")}))}catch(t){let e="Internal Error: ".concat(s.name({start:!0,plural:!1})," not saved");console.error(e,t),j.Am.error(e)}}var v=n(59294),_=n(98250),y=n(68968),S=n(59532),C=n(7974),k=n(358),w=n(78254),L=n(54597),I=n(46999),R=n(63397);let B=e=>{let{selected:t,...n}=e;return(0,l.jsx)(m.kC,{sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:t?e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}:"none","&:hover":{boxShadow:e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}}},...n})},N=e=>{let{format:t}=e,[n,,r]=(0,R.U$)("repeatable"),a=o.$[t];return(0,l.jsxs)(m.xu,{mb:2,children:[(0,l.jsxs)(B,{selected:n.value,onClick:()=>r.setValue(!0),children:[(0,l.jsx)(m.Y8,{checked:n.value,onChange:()=>{},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(B,{selected:!n.value,onClick:()=>r.setValue(!1),children:[(0,l.jsx)(m.Y8,{checked:!n.value,onChange:()=>{},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},z=e=>{let{format:t,isCreating:n,isOpen:r,origin:a="table",onCreateChange:s,onOpenChange:i}=e,{createCustomTypeSuccess:d}=(0,L.Z)(),{completeStep:u}=(0,_.k)(),{customTypeIds:j,customTypeLabels:g}=(0,x.v9)(e=>({customTypeIds:(0,w.W6)(e),customTypeLabels:(0,w.YS)(e)})),b=o.$[t],[R,B]=(0,c.useState)(!0),{syncChanges:z}=(0,y.g)(),E=(0,h.useRouter)(),T=async e=>{let{id:n,label:l,repeatable:r}=e;s(!0),await f({format:t,id:n,label:l,origin:a,repeatable:r,onSuccess:async e=>{d(e);let t=(0,p.y6)(e),l=v.cd[t];B(!0),await E.push({pathname:l.getBuilderPagePathname(n)}),z(),"page"===t&&u("createPageType")}}),s(!1),i(!1)},G=(e,t,n)=>{n(R?{...t,label:e.target.value,id:(0,k.lV)(e.target.value)}:{...t,label:e.target.value})},D=(e,t)=>{t("id",e.target.value),B(!1)};return(0,l.jsx)(S.Z,{testId:"create-ct-modal",isOpen:r,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:()=>{i(!1),B(!0)},onSubmit:e=>{T(e)},isLoading:n,initialValues:{repeatable:!0,id:"",label:""},validate:e=>{let{id:t,label:n}=e,l={};return n&&n.length||(l.label="Cannot be empty."),!l.label&&g.includes(n)&&(l.label="".concat(b.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(n.toLowerCase())&&(l.label='Name "'.concat(n,'" is reserved for Slice Machine use.')),t&&t.length||(l.id="ID cannot be empty."),["update","insert"].includes(t.toLowerCase())&&(l.id='Id "'.concat(t,'" is reserved for Slice Machine use.')),l.id||!t||C.xo.exec(t)||(l.id="Invalid id: No special characters allowed."),!l.id&&t&&j.map(e=>e.toLowerCase()).includes(t)&&(l.id='ID "'.concat(t,'" exists already.')),Object.keys(l).length>0?l:void 0},content:{title:"Create a new ".concat(b.name({start:!1,plural:!1}))},children:e=>{let{errors:n,setValues:r,setFieldValue:a,values:s,touched:c}=e;return(0,l.jsxs)(m.xu,{children:[(0,l.jsx)(N,{format:t}),(0,l.jsx)(I.W,{name:"label",label:"".concat(b.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(b.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:e=>G(e,s,r)}),(0,l.jsx)(I.W,{name:"id",testId:"ct-id-input",label:"".concat(b.name({start:!0,plural:!1})," ID"),placeholder:b.inputPlaceholder,error:c.id?n.id:void 0,onChange:e=>D(e,a)})]})}})};var E=n(72641);let T=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc"}),(0,l.jsx)("path",{d:"m10.0912 8c-2.8118 0-5.0912 2.2794-5.0912 5.0912s2.2794 5.0912 5.0912 5.0912c1.8851 0 3.5303-1.0247 4.4098-2.5452.1553-.2684.2868-.5523.3916-.8489.092-.2604-.0444-.5461-.3048-.6381-.2603-.092-.546.0445-.638.3048-.0841.238-.1897.4659-.3144.6815-.7081 1.2241-2.0305 2.0459-3.5442 2.0459-2.2595 0-4.0912-1.8317-4.0912-4.0912s1.8317-4.0912 4.0912-4.0912c1.3566 0 2.5595.66 3.3043 1.6782h-1.7739c-.2761 0-.5.2239-.5.5 0 .2762.2239.5.5.5h2.6782c.2762 0 .5-.2238.5-.5v-2.6782c0-.2761-.2238-.5-.5-.5-.2761 0-.5.2239-.5.5v1.1032c-.9281-.9865-2.2462-1.6032-3.7086-1.6032z",fill:"#fff"})]}),G=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m8.0869 10.6818.5758-2.3031c.0556-.2226.2556-.3787.485-.3787.3253 0 .564.3057.4851.6213l-.5151 2.0605h2.6055l.5758-2.3031c.0557-.2226.2557-.3787.4851-.3787.3253 0 .564.3057.4851.6213l-.5152 2.0605h2.246c.2761 0 .5.2239.5.5 0 .2762-.2239.5-.5.5h-2.496l-.6591 2.6364h2.1551c.2761 0 .5.2238.5.5 0 .2761-.2239.5-.5.5h-2.4051l-.5757 2.3031c-.0557.2226-.2557.3787-.4851.3787-.3253 0-.564-.3057-.4851-.6213l.5152-2.0605h-2.6056l-.5758 2.3031c-.0556.2226-.2556.3787-.4851.3787-.3253 0-.5639-.3057-.485-.6213l.5151-2.0605h-1.9278c-.2761 0-.5-.2239-.5-.5 0-.2762.2239-.5.5-.5h2.1778l.6591-2.6364h-1.8369c-.2761 0-.5-.2238-.5-.5 0-.2761.2239-.5.5-.5zm2.7273 3.6364.659-2.6364h-2.6055l-.6591 2.6364z",fill:"#fff"})]});var D=n(60867),P=n(50477),W=n(94840),A=n(16442);let $=e=>{let{format:t,isCreatingCustomType:n,openCreateCustomTypeModal:a}=e,s=(0,h.useRouter)(),{customTypes:i,updateCustomTypes:d}=(0,P.xU)(t),u=i.sort((e,t)=>e.id.localeCompare(t.id)),m=v.cd[t],p=o.$[t];return(!function(e,t,n){let{storeCustomTypes:l}=(0,x.v9)(e=>({storeCustomTypes:(0,w.Ch)(e).filter(A.TG)}));(0,c.useEffect)(()=>{let r=l.filter(e=>{let{local:n}=e;return n.format===t});(r.length!==e.length||r.some(t=>{let n=e.find(e=>e.id===t.local.id);return!n||JSON.stringify(W.Dc.fromSM(t.local))!==JSON.stringify(n)}))&&n(r.map(e=>{let{local:t}=e;return W.Dc.fromSM(t)}))},[t,n,e,l])}(i,t,d),0===u.length)?(0,l.jsxs)(E.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:r.t.space[72]},children:[(0,l.jsx)(E.u2,{children:(0,l.jsx)(r.a_,{src:m.blankSlateImage,sizing:"cover"})}),(0,l.jsxs)(E.T9,{children:[(0,l.jsx)(E._T,{children:p.name({start:!0,plural:!0})}),(0,l.jsx)(E.nf,{children:p.blankSlateDescription}),(0,l.jsx)(E.Qj,{children:(0,l.jsx)(r.E,{onClick:a,loading:n,children:"Create"})})]})]}):(0,l.jsx)("div",{children:(0,l.jsxs)(r.bE,{columnLayout:"28px 1fr 1fr 1fr 42px",children:[(0,l.jsx)(r.bH,{children:(0,l.jsxs)(r.bI,{children:[(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.aX,{name:"notes",size:"medium"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Label"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"API ID"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Limit"})}),(0,l.jsx)(r.bG,{})]})}),(0,l.jsx)(r.bF,{children:u.map(e=>{let{repeatable:n,label:a,id:c}=e;return(0,l.jsxs)(r.bI,{onClick:()=>{s.push(v.cd[t].getBuilderPagePathname(c))},children:[(0,l.jsx)(r.bG,{children:n?(0,l.jsx)(T,{width:r.t.space[20]}):(0,l.jsx)(G,{width:r.t.space[20]})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{variant:"bold",noWrap:!0,children:a})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:c})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:n?"Reusable":"Single"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(D._,{isChangesLocal:!1,format:t,customType:e})})]},c)})})]})})},O=e=>{let{format:t}=e,n=o.$[t],[a,h]=(0,c.useState)(!1),[x,m]=(0,c.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s(),{children:(0,l.jsxs)("title",{children:[n.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,l.jsx)(d.h,{renderError:()=>(0,l.jsx)(u.LN,{children:(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.D,{alignItems:"center",justifyContent:"center",children:(0,l.jsx)(r.ax,{title:"Request failed",description:"An error occurred while fetching your ".concat(n.name({start:!1,plural:!0}),".")})})})}),children:(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.bg,{})})]}),children:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{"data-testid":"create-ct",loading:a,onClick:()=>{m(!0)},startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsxs)(r.D,{flexDirection:"column",children:[(0,l.jsx)($,{format:t,isCreatingCustomType:a,openCreateCustomTypeModal:()=>{m(!0)}}),(0,l.jsx)(z,{format:t,isCreating:a,isOpen:x,onCreateChange:h,onOpenChange:m})]})})]})})})]})}},30527:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},W:function(){return i}});var l=n(52322),r=n(2784),a=n(75289);let s=e=>{let{bg:t,background:n,sx:r,withRadius:s,radius:c,children:i}=e;return(0,l.jsx)(a.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,...r},children:i})},c=(0,r.createContext)("6px"),i=()=>(0,r.useContext)(c),o=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:i=null,borderFooter:o=!1,radius:d="6px",bodySx:u={},footerSx:h={},sx:x=null,bg:m,background:p,children:j,...g}=e;return(0,l.jsx)(c.Provider,{value:d,children:(0,l.jsxs)(a.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:d,...x},...g,children:[t||null,n||null,(0,l.jsxs)(s,{bg:m,background:p,sx:u,withRadius:!i,children:[r?(0,l.jsx)(r,{}):null,j||null]}),i?(0,l.jsx)(s,{bg:m,background:p,sx:{...o?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...h},radius:d,withRadius:!0,children:"object"==typeof i?i:(0,l.jsx)(i,{})}):null]})})}},7974:function(e,t,n){"use strict";n.d(t,{Sn:function(){return c},lS:function(){return l},nG:function(){return r},pq:function(){return i},rd:function(){return s},xo:function(){return a}});let l=["components","update","insert"],r=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,s="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",i="slice-machine-simulator"},83478:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34],{62434:function(e,t,n){"use strict";n.d(t,{Zb:function(){return c},T$:function(){return m},eW:function(){return _},ZB:function(){return u},Lm:function(){return C}});var o=n(52322),r=n(50002),i=n(14226),a=n(6277),l=n(2784),d=n(67968),s=n.n(d);let c=e=>{let{checked:t=!1,size:n="medium",variant:i="solid",interactive:d,disabled:c,onClick:u,href:m,component:_="a",replace:C,...h}=e,x={...h,className:(0,a.W)(s().root,s()["size-".concat(n)],s()[i],{[s().interactive]:e.interactive}),"data-state":!0===t?"checked":void 0,"data-disabled":!0===e.disabled?"":void 0};return!0===e.interactive&&void 0===e.href?(0,o.jsx)("div",{...x,onClick:t=>{if(!0===e.disabled||void 0===e.onClick)return;let n=t.target;(0,r.JY)(n)===t.currentTarget&&e.onClick(t)},tabIndex:!0===e.disabled?void 0:0}):!0===e.interactive?(0,l.createElement)(_,{...x,href:e.href,onClick:e=>{let t=e.target;(0,r.JY)(t)!==e.currentTarget&&e.preventDefault()},..."a"===_?{}:{replace:e.replace}}):(0,o.jsx)("div",{...x})},u=e=>{let{className:t,component:n="img",overlay:r,...i}=e;return(0,o.jsxs)("div",{className:s().media,children:[(0,l.createElement)(n,{...i,className:(0,a.W)(s()["mediaComponent-".concat(n)],t)}),r?(0,o.jsx)("div",{className:s().mediaOverlay,children:r}):void 0]})},m=e=>(0,o.jsx)("div",{...e,className:s().actions}),_=e=>{let{action:t,loading:n=!1,startIcon:r,subtitle:a,title:l,error:d=!1,...c}=e,u=d?"tomato11":"grey11";return(0,o.jsxs)("div",{...c,className:s().footer,children:[(r||n)&&(0,o.jsxs)("div",{className:s().startIconBox,children:[n&&(0,o.jsx)(i.bg,{color:"grey11"}),!n&&r&&(0,o.jsx)(i.aX,{name:r,size:"small",color:u})]}),(0,o.jsxs)("div",{className:s().footerTexts,children:[(0,o.jsx)(i.bL,{component:"span",noWrap:!0,variant:"bold",children:l}),(0,o.jsx)(i.bL,{color:u,component:"span",noWrap:!0,variant:"small",children:a})]}),t]})},C=e=>{let{children:t,...n}=e;return(0,o.jsx)("div",{...n,className:s().status,children:(0,o.jsx)(i.bL,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:t})})}},99195:function(e,t,n){"use strict";n.d(t,{O:function(){return l}});var o=n(52322),r=n(14226),i=n(56448),a=n(93671);let l=e=>{let{badgeColor:t,badgeTitle:n,tooltipContent:l}=function(e){let t=d[e.modelType];switch(e.modelStatus){case i.GJ.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(t," exists only locally. Upon sync, it will be pushed to your remote repository.")};case i.GJ.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(t," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case i.GJ.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(t," is in sync with the remote repository.")};case i.GJ.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(t," has been deleted locally.")};case i.GJ.Unknown:if(!e.isOnline)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (no internet connection)."};if(e.authStatus===a.t.UNAUTHENTICATED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};default:return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (unknown error)."}}}(e);return(0,o.jsx)(r.c3,{content:l,side:"bottom",children:(0,o.jsx)(r.m,{color:t,title:n})})},d={CustomType:"type",Slice:"slice"}},51507:function(e,t,n){"use strict";n.d(t,{b:function(){return h}});var o=n(52322),r=n(14226),i=n(39097),a=n.n(i),l=n(62434),d=n(63908),s=n(99195),c=n(27763);let u=e=>(0,o.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,o.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V12.4413C20 12.4512 19.9997 12.461 19.9991 12.4707C20.0072 12.6083 19.9586 12.7485 19.8536 12.8536C19.6583 13.0488 19.3417 13.0488 19.1464 12.8536L16.3536 10.0607C16.1583 9.8654 15.8417 9.8654 15.6464 10.0607L11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.35355 12.0607C9.15829 11.8654 8.84171 11.8654 8.64645 12.0607L5 15.7071V18.5C5 18.7761 5.22386 19 5.5 19H12.5C12.7761 19 13 19.2239 13 19.5C13 19.7761 12.7761 20 12.5 20H5.5C4.67157 20 4 19.3284 4 18.5V15.5003V15.4997V5.5ZM11.5 12.7929L14.9393 9.35355C15.5251 8.76777 16.4749 8.76777 17.0607 9.35355L19 11.2929V5.5C19 5.22386 18.7761 5 18.5 5H5.5C5.22386 5 5 5.22386 5 5.5V14.2929L7.93934 11.3536C8.52513 10.7678 9.47487 10.7678 10.0607 11.3536L11.5 12.7929ZM16.5 13C16.7761 13 17 13.2239 17 13.5V16H19.5C19.7761 16 20 16.2239 20 16.5C20 16.7761 19.7761 17 19.5 17H17V19.5C17 19.7761 16.7761 20 16.5 20C16.2239 20 16 19.7761 16 19.5V17H13.5C13.2239 17 13 16.7761 13 16.5C13 16.2239 13.2239 16 13.5 16H16V13.5C16 13.2239 16.2239 13 16.5 13Z",fill:"currentColor"})}),m=e=>({hash:e.hash}),_=e=>e?Object.entries(e).reduce((e,t)=>{let[n,o]=t;return o.hash?{...e,[n]:{...o,...m(o)}}:e},{}):{},C={build:e=>({...e,screenshots:_(e.screenshots)}),variation(e,t){if(e.model.variations.length)return t?e.model.variations.find(e=>e.id===t):e.model.variations[0]}},h=e=>{let t;let{action:n,isDeleted:i=!1,onUpdateScreenshot:m,selected:_=!1,slice:h,variant:p,variationId:b}=e,f=C.variation(h,b);if(!f)return null;let g=(0,d.d7)(h,f),j=!i&&!!m,y="outlined"===p,k=void 0!==b;return t="selection"===e.mode?{disabled:i,interactive:!0,onClick:()=>{e.onSelectedChange(!_)}}:i?{interactive:!1}:{component:a(),href:c.Y.getBuilderPagePathname({libraryName:h.href,sliceName:h.model.name,variationId:f.id}),interactive:!0,replace:e.replace},(0,o.jsxs)(l.Zb,{"aria-label":"".concat(h.model.name," ").concat(f.name," slice card"),checked:_,"data-testid":"shared-slice-card",...t,..."outlined"===p?{size:"small",variant:"outlined"}:{},children:[void 0!==g?(0,o.jsx)(l.ZB,{alt:"Preview image",overlay:j&&!y?(0,o.jsx)(r.D,{alignItems:"center",justifyContent:"center",children:(0,o.jsx)(x,{onClick:m})}):void 0,src:g}):(0,o.jsx)(l.ZB,{component:"div",children:(0,o.jsxs)(r.D,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,o.jsx)(r.bL,{color:"grey11",component:"span",children:"No screenshot available"}),j&&!y?(0,o.jsx)(x,{onClick:m}):void 0]})}),(0,o.jsx)(l.eW,{action:"checkbox"===n.type&&"selection"===e.mode?(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,o.jsx)(r.U,{checked:_,disabled:i,onCheckedChange:e.onSelectedChange})}):"menu"===n.type?(0,o.jsxs)(r.ar,{modal:!0,children:[(0,o.jsx)(r.av,{disabled:i,children:(0,o.jsx)(r.aZ,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,o.jsxs)(r.as,{align:"end","data-testid":"slice-action-icon-dropdown",children:[j&&y?(0,o.jsx)(r.at,{onSelect:m,startIcon:(0,o.jsx)(u,{}),children:"Update screenshot"}):void 0,(0,o.jsx)(r.at,{onSelect:n.onRename,startIcon:(0,o.jsx)(r.aX,{name:"edit"}),children:"Rename"}),!0===n.removeDisabled&&k?(0,o.jsx)(r.c3,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,o.jsx)(v,{disabled:!0,onSelect:n.onRemove})}):(0,o.jsx)(v,{disabled:!0===n.removeDisabled,onSelect:n.onRemove})]})]}):"remove"===n.type?(0,o.jsx)(r.aZ,{icon:"close",onClick:()=>!i&&n.onRemove(),hiddenLabel:"Remove slice"}):"status"===n.type?(0,o.jsx)(s.O,{authStatus:n.authStatus,isOnline:n.isOnline,modelStatus:n.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,o.jsx)(o.Fragment,{children:k?f.id:"".concat(h.model.variations.length," variation").concat(h.model.variations.length>1?"s":"")}),title:k?f.name:h.model.name}),j&&!k&&(0,d.cx)(h)>0?(0,o.jsx)(l.Lm,{children:"Missing screenshot"}):void 0]})},x=e=>(0,o.jsx)(r.E,{onClick:e.onClick,renderStartIcon:()=>(0,o.jsx)(u,{color:r.t.color.grey11}),color:"grey",children:"Update screenshot"}),v=e=>(0,o.jsx)(r.at,{...e,color:"tomato",startIcon:(0,o.jsx)(r.aX,{name:"delete"}),children:"Delete"})},27763:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});let o={getBuilderPagePathname:e=>"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}},30527:function(e,t,n){"use strict";n.d(t,{Z:function(){return s},W:function(){return d}});var o=n(52322),r=n(2784),i=n(75289);let a=e=>{let{bg:t,background:n,sx:r,withRadius:a,radius:l,children:d}=e;return(0,o.jsx)(i.xu,{sx:{p:4,bg:t||n,...a?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,...r},children:d})},l=(0,r.createContext)("6px"),d=()=>(0,r.useContext)(l),s=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:d=null,borderFooter:s=!1,radius:c="6px",bodySx:u={},footerSx:m={},sx:_=null,bg:C,background:h,children:x,...v}=e;return(0,o.jsx)(l.Provider,{value:c,children:(0,o.jsxs)(i.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:c,..._},...v,children:[t||null,n||null,(0,o.jsxs)(a,{bg:C,background:h,sx:u,withRadius:!d,children:[r?(0,o.jsx)(r,{}):null,x||null]}),d?(0,o.jsx)(a,{bg:C,background:h,sx:{...s?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...m},radius:c,withRadius:!0,children:"object"==typeof d?d:(0,o.jsx)(d,{})}):null]})})}},7974:function(e,t,n){"use strict";n.d(t,{Sn:function(){return l},lS:function(){return o},nG:function(){return r},pq:function(){return d},rd:function(){return a},xo:function(){return i}});let o=["components","update","insert"],r=["png","jpg","jpeg"],i=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,a="placeholders/What_are_Slices_mrvome",l="SM_HELP_VIDEOS/mock_data",d="slice-machine-simulator"},67968:function(e){e.exports={flex:"Card_flex__opby1",grid:"Card_grid__VAvIS",column:"Card_column__W4ACG Card_flex__opby1",root:"Card_root__YVuvU Card_column__W4ACG Card_flex__opby1","size-small":"Card_size-small__aIlxd","size-medium":"Card_size-medium__xegz0",solid:"Card_solid__GNGar",outlined:"Card_outlined__W_dxI",interactive:"Card_interactive__rXw5L",media:"Card_media__l0kHL Card_column__W4ACG Card_flex__opby1","mediaComponent-div":"Card_mediaComponent-div__Y2_PZ Card_grid__VAvIS","mediaComponent-img":"Card_mediaComponent-img__ezOTu",mediaOverlay:"Card_mediaOverlay__Aa__Q Card_grid__VAvIS",nonMedia:"Card_nonMedia__Fv3Mz Card_flex__opby1",actions:"Card_actions__XdhOt Card_nonMedia__Fv3Mz Card_flex__opby1",footer:"Card_footer__U0HS1 Card_nonMedia__Fv3Mz Card_flex__opby1",footerTexts:"Card_footerTexts__rTXup Card_column__W4ACG Card_flex__opby1",status:"Card_status__PNN2a Card_column__W4ACG Card_flex__opby1",startIconBox:"Card_startIconBox__1_L4u"}}}]);
|