slice-machine-ui 2.2.1-alpha.aa-contributing.1 → 2.2.1-alpha.aa-sort-default-page-fields.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/{5Yr2AUgjGVYmkU4G3ZsNT → Bvi7OmxsRYqMRIaPnnr-g}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/{212-8e3e36f1dcc00ef3.js → 212-cbaa35389c0aacf1.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-ac06884f02867c44.js → _app-3ba2e92b70237d20.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/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 +3 -3
- package/src/domain/customType.ts +8 -8
- /package/out/_next/static/{5Yr2AUgjGVYmkU4G3ZsNT → Bvi7OmxsRYqMRIaPnnr-g}/_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/b3bb731ce567d63f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b3bb731ce567d63f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.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/b3bb731ce567d63f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/b3bb731ce567d63f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-207ecb3e9b995dd9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-3ba2e92b70237d20.js" defer=""></script><script src="/_next/static/chunks/pages/_error-6aa4c7b8478d35e3.js" defer=""></script><script src="/_next/static/Bvi7OmxsRYqMRIaPnnr-g/_buildManifest.js" defer=""></script><script src="/_next/static/Bvi7OmxsRYqMRIaPnnr-g/_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":"Bvi7OmxsRYqMRIaPnnr-g","runtimeConfig":{"sentryEnvironment":"alpha"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,d,b,u,f,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-785a0ab6e2a4fc27.js"],"/_error":["static/chunks/pages/_error-6aa4c7b8478d35e3.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-d309ea186a0e56bf.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-09e9e4a012d48a3a.js",c,d,"static/css/6279e95f6aff22d5.css","static/chunks/pages/changes-1bb1a7b784a22151.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-bac97f007a5ca743.js"],"/custom-types/[customTypeId]":[s,b,u,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-74be2c0ac9c854c7.js"],"/labs":["static/chunks/pages/labs-2e4f3a5f68e65b93.js"],"/page-types/[pageTypeId]":[s,b,u,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-d35c87b9aaec445a.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-25eb02893ed871b7.js"],"/slices":[s,t,n,c,d,"static/css/f01f60095c76c7fb.css","static/chunks/pages/slices-cc44eeccd58d23a9.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,b,u,f,h,e,n,i,l,c,k,d,"static/css/8d1871dce67a3b49.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-996e20b9b295a912.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-eda642ad962ef598.js","static/chunks/756-1e44fe84bedc262b.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-b47a72d5e94bd946.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/816-68d4db26c0adab2e.js","static/chunks/212-
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,d,b,u,f,h,l,k,j,p,g,o,r){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-785a0ab6e2a4fc27.js"],"/_error":["static/chunks/pages/_error-6aa4c7b8478d35e3.js"],"/changelog":[s,e,"static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-d309ea186a0e56bf.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-09e9e4a012d48a3a.js",c,d,"static/css/6279e95f6aff22d5.css","static/chunks/pages/changes-1bb1a7b784a22151.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-bac97f007a5ca743.js"],"/custom-types/[customTypeId]":[s,b,u,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-74be2c0ac9c854c7.js"],"/labs":["static/chunks/pages/labs-2e4f3a5f68e65b93.js"],"/page-types/[pageTypeId]":[s,b,u,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-d35c87b9aaec445a.js"],"/settings":["static/css/ca32882a5d2d8d88.css","static/chunks/pages/settings-25eb02893ed871b7.js"],"/slices":[s,t,n,c,d,"static/css/f01f60095c76c7fb.css","static/chunks/pages/slices-cc44eeccd58d23a9.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,b,u,f,h,e,n,i,l,c,k,d,"static/css/8d1871dce67a3b49.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-996e20b9b295a912.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-eda642ad962ef598.js","static/chunks/756-1e44fe84bedc262b.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-b47a72d5e94bd946.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-7a3b5554b806349f.js","static/chunks/816-68d4db26c0adab2e.js","static/chunks/212-cbaa35389c0aacf1.js","static/chunks/183-6ad1d7303abecd2b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-8d014b6d3cc35e30.js","static/chunks/152-c40fcb226b0df27f.js","static/chunks/f36c6662-03bb5e9d9aa0b0aa.js","static/chunks/4c744e84-e3161d754618373f.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-2c5b6c0367fcde86.js","static/chunks/696-b992b9e1ce75777e.js","static/chunks/574-6039c48fbc93b4a8.js","static/chunks/465-47a6d2a5f66f521e.js","static/css/609c46c5c573c3ed.css","static/chunks/66-d37d30551288858b.js","static/chunks/264-4bb6f3fb14863ef3.js","static/css/d0dd8015d7f5ea89.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[212],{9502:function(e,n,t){"use strict";t.d(n,{R$:function(){return f},Qj:function(){return v},T9:function(){return m},nf:function(){return h},u2:function(){return p},_T:function(){return y}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),a=t(52322),c=t(22715),l=t(6277),u=t(98484),d=t.n(u),f=function(e){var n=e.backgroundImage,t=e.style,c=(0,s.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,a.jsx)("article",(0,i.Z)((0,o.Z)({},c),{className:(0,l.W)(d().root,(0,r.Z)({},d().withBackground,u)),style:(0,o.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},p=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().image}))},m=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().content}))},y=function(e){return(0,a.jsx)(c.xv,(0,i.Z)((0,o.Z)({},e),{className:d().title}))},h=function(e){return(0,a.jsx)(c.xv,(0,i.Z)((0,o.Z)({},e),{className:d().desc,color:"grey11"}))},v=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().actions,color:"grey"}))}},65563:function(e,n,t){"use strict";t.d(n,{AK:function(){return Z},E3:function(){return m},EN:function(){return y},F$:function(){return x},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return _},gR:function(){return S},mf:function(){return h},vB:function(){return v},xS:function(){return b},y6:function(){return l}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),a=t(98863),c=t(88866);function l(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function u(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===c.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,a=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(l=null==(m=p[1])?void 0:m.config)&&void 0!==l?l:void 0)return e;var t,a,l,d,p,m,y=function(e,n){var t,r=u(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===c.SlicesFieldType})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},y,{type:c.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===c.SlicesFieldType});if(void 0===s)return e;var l=(0,a.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,l))})}function y(e){var n,t,s=e.customType,l=e.sectionId,u=e.sliceId,f=d(s,l);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===c.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==c.SlicesFieldType)return s;var y=(0,a.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},u);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},l,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:y})})))))})}function h(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=u(e)[0];if(r){var a=(0,s.Z)(r,1)[0];t=p(t,a)}return t}function v(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,a.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function b(e){var n=e.customType,t=e.sectionId,a=e.newField,l=e.newFieldId,u=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(u).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},l,a));if(void 0!==d){var y=(0,s.Z)(d,2),h=y[0],v=y[1];m[h]=v}return I({customType:n,sectionId:t,updatedSection:m})}function Z(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,a.ud)(n.json[t],r);return I({customType:n,sectionId:t,updatedSection:o})}function j(e){var n,t,r,o,i,a=e.customType,c=e.sectionId,l=e.previousFieldId,u=e.newFieldId,d=e.newField,f=(n={fields:a.json[c],previousFieldId:l,newFieldId:u,newField:d},t=n.fields,r=n.previousFieldId,o=n.newFieldId,i=n.newField,Object.entries(t).reduce(function(e,n){var t=(0,s.Z)(n,2),a=t[0],c=t[1];return a===r?e[o]=i:a!==o&&(e[a]=c),e},{}));return I({customType:a,sectionId:c,updatedSection:f})}function S(e){var n,t,r,o,i,a,l,u=e.customType,d=e.sectionId,p=e.sourceIndex,m=e.destinationIndex,y=u.json[d],h=f(u,d),v=(n={fields:Object.fromEntries(Object.entries(y).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),sourceIndex:p,destinationIndex:m},t=n.fields,r=n.sourceIndex,o=n.destinationIndex,i=Object.entries(t),a=(0,s.Z)(i.splice(r,1),1)[0],i.splice(o,0,a),Object.fromEntries(i));if(void 0!==h){var x=(0,s.Z)(h,2),g=x[0],b=x[1];v[g]=b}return I({customType:u,sectionId:d,updatedSection:v})}function I(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function _(e){var n,t,r=e.id,i=e.label,s=e.repeatable,a=e.format,c=(n=s,t=a,!1===n&&"page"===t?(0,o.Z)({},C,F):!1===n?T:"page"===t?(0,o.Z)({},w,F):k);return{format:a,id:r,json:c,label:i,repeatable:s,status:!0}}var T={Main:{}},C={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},k={Main:{uid:{config:{label:"UID"},type:"UID"}}},w={Main:(0,o.Z)({},k.Main,C.Main)},F={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},56471:function(e,n,t){"use strict";t.d(n,{_:function(){return N}});var r=t(22710),o=t(99267),i=t(52322),s=t(22715),a=t(5632),c=t(2784),l=t(65186),u=t(59326),d=t(75289),f=t(88932),p=t(7604),m=t(64837);function y(){return(y=(0,r.Z)(function(e){var n,t,r,i,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),f.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,s),f.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var h=t(61107),v=t(2978),x=t(28199),g=t(7342),b=function(e){var n,t=e.customType,s=e.format,a=e.onClose,f=e.onDeleteCustomTypeSuccess,p=m.$[s],b=(0,c.useState)(!1),Z=b[0],j=b[1],S=(0,g.Z)().deleteCustomTypeSuccess,I=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return j(!0),[4,function(e){return y.apply(this,arguments)}({customType:t,onSuccess:function(){return S(t.id)}})];case 1:return e.sent(),f(),[2]}})}),function(){return n.apply(this,arguments)}),_=(0,u.B7)().theme;return(0,i.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return a()},children:(0,i.jsx)(v.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,i.jsxs)(d.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(l.$vK,{size:20,color:null===(e=_.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(d.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",p.name({start:!1,plural:!1})]})]}),(0,i.jsx)(d.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,i.jsxs)(d.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(h.z,{label:"Cancel",variant:"secondary",onClick:function(){return a()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(h.z,{label:"Delete",variant:"danger",isLoading:Z,onClick:function(){I()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(d.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",p.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},Z=t(62230),j=t(85244),S=t(56580);function I(){return(I=(0,r.Z)(function(e){var n,t,r,i,s,a,c,l;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,j.Z)((0,Z.Z)({},n),{label:t}),[4,p.j.customTypes.renameCustomType({model:s})];case 2:if((a=o.sent().errors).length>0)throw a;return r(s),f.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=o.sent(),l="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(l,c),f.Am.error(l),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=t(35393),T=t(7781),C=t(4995),k=t(44570),w=function(e){var n,t,s,a=e.isChangesLocal,l=e.customType,u=e.format,f=e.onClose,p=e.setLocalCustomType,y=null!==(n=null==l?void 0:l.label)&&void 0!==n?n:"",h=null!==(t=null==l?void 0:l.id)&&void 0!==t?t:"",v=(0,g.Z)().renameCustomTypeSuccess,x=(0,_.g)().syncChanges,b=(0,c.useState)(!1),w=b[0],F=b[1],O=(s=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(F(!0),!(a&&p))return[3,1];return p((0,j.Z)((0,Z.Z)({},l),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return I.apply(this,arguments)}({model:l,newLabel:e.customTypeName,onSuccess:function(e){v(e),x()}})];case 2:n.sent(),n.label=3;case 3:return F(!1),f(),[2]}})}),function(e){return s.apply(this,arguments)}),B=(0,S.v9)(function(e){return{customTypeLabels:(0,T.YS)(e)}}).customTypeLabels,L=m.$[u];return(0,i.jsx)(C.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(h),buttonLabel:"Rename",close:f,onSubmit:function(e){O(e)},initialValues:{customTypeName:y},isLoading:w,content:{title:"Rename a ".concat(L.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&B.includes(n)&&y!==n&&(t.customTypeName="".concat(L.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(d.xu,{children:(0,i.jsx)(k.W,{name:"customTypeName",label:"".concat(L.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(L.name({start:!1,plural:!1})),error:n.customTypeName,testId:"custom-type-name-input"})})}})},F=t(12189),O=t(65563);function B(){return(B=(0,r.Z)(function(e,n){var t,r,i,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=m.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,O.mf)(e),[4,(0,F.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),f.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(a,s),f.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=t(99526),N=function(e){var n,t=e.format,l=e.customType,u=e.isChangesLocal,d=e.setLocalCustomType,f=(0,a.useRouter)(),p=(0,g.Z)().saveCustomTypeSuccess,m=(0,c.useState)(!1),y=m[0],h=m[1],v=(0,c.useState)(!1),x=v[0],Z=v[1],j=(0,c.useState)(!1),S=j[0],I=j[1],_=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return I(!0),[4,function(e,n){return B.apply(this,arguments)}(l,p)];case 1:return t.sent(),e=L.cd.custom.getBuilderPagePathname(l.id),f.asPath===e&&(n=L.cd.page.getBuilderPagePathname(l.id),f.replace(n)),I(!1),[2]}})}),function(){return n.apply(this,arguments)}),T=function(){var e,n=L.cd[null!==(e=l.format)&&void 0!==e?e:"custom"].tablePagePathname;f.asPath!==n?f.replace(n):h(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.h_,{modal:!0,children:[(0,i.jsx)(s.$F,{disabled:S,children:(0,i.jsx)(s.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:S,variant:"solid"})}),(0,i.jsxs)(s.AW,{align:"end",children:[(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"edit"}),onSelect:function(){Z(!0)},children:"Rename"}),"custom"===t&&!u&&(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"driveFileMove"}),onSelect:function(){_()},children:"Convert to page type"}),(0,i.jsx)(s.Xi,{color:"tomato",startIcon:(0,i.jsx)(s.I5,{name:"delete"}),onSelect:function(){h(!0)},children:"Remove"})]})]}),y?(0,i.jsx)(b,{format:t,customType:l,onClose:function(){return h(!1)},onDeleteCustomTypeSuccess:T}):null,x?(0,i.jsx)(w,{format:t,customType:l,isChangesLocal:u,onClose:function(){return Z(!1)},setLocalCustomType:d}):null]})}},61107:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),a=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,y=e.disabled,h=e.onClick,v=e.sx,x=e.iconSize,g=void 0===x?16:x,b=e.iconFill,Z=e.variant,j=void 0===Z?"primary":Z,S=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(c.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===v?{}:v),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==y&&y||m,onClick:m?void 0:h,variant:j},S),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$j,{size:g,color:u(j),"data-testid":l(S["data-testid"],"spinner")}),a&&t]}):(0,s.jsxs)(s.Fragment,{children:[a&&(0,s.jsx)(a,{size:g,fill:b,"data-testid":l(S["data-testid"],"icon")}),t]})}))})},44570:function(e,n,t){"use strict";t.d(n,{W:function(){return a}});var r=t(62230),o=t(52322),i=t(63397);t(2784);var s=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,l=e.testId,u=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:a,as:s.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-testid":l}:null)),c?(0,o.jsx)(s.xv,{"data-testid":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},4995:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(63397),a=t(37149),c=t.n(a),l=t(75289),u=t(61107),d=t(28199),f=t(2978);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,p=e.formId,m=e.validate,y=e.onSubmit,h=e.widthInPx,v=e.initialValues,x=e.content.title,g=e.cardProps,b=e.omitFooter,Z=void 0!==b&&b,j=e.isLoading,S=void 0!==j&&j,I=e.buttonLabel,_=void 0===I?"Save":I,T=e.testId,C=e.actionMessage;return c().setAppElement("#__next"),(0,i.jsx)(d.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=h?h:"900px"}},children:(0,i.jsx)(s.J9,{initialValues:v,validate:function(e){return m?m(e):void 0},onSubmit:function(e){y(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,d=e.values,m=e.errors,y=e.touched,h=e.setFieldValue,v=e.setValues;return(0,i.jsx)(s.l0,(0,o.Z)((0,r.Z)({id:p},null!=T?{"data-testid":T}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(l.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(l.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(l.x8,{type:"button",onClick:t})]})},Footer:Z?null:(0,i.jsxs)(l.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(l.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(l.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(l.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||S,children:"Cancel"}),(0,i.jsx)(u.z,{label:_,form:p,type:"submit",disabled:!a||c||S,isLoading:c||S,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:a,isSubmitting:c,values:d,errors:m,touched:y,setFieldValue:h,setValues:v})}))}))}})})}},98484:function(e){e.exports={column:"BlankSlate_column__ysDb2",root:"BlankSlate_root__DJ7wC BlankSlate_column__ysDb2",fadeIn:"BlankSlate_fadeIn__KMuKu",withBackground:"BlankSlate_withBackground___V5y5",image:"BlankSlate_image__rOe9w BlankSlate_column__ysDb2",content:"BlankSlate_content__wmOAI BlankSlate_column__ysDb2",title:"BlankSlate_title__5oTre",desc:"BlankSlate_desc__f6ZWf",actions:"BlankSlate_actions__6zYZr"}}}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[212],{9502:function(e,n,t){"use strict";t.d(n,{R$:function(){return f},Qj:function(){return v},T9:function(){return m},nf:function(){return h},u2:function(){return p},_T:function(){return y}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),a=t(52322),c=t(22715),l=t(6277),u=t(98484),d=t.n(u),f=function(e){var n=e.backgroundImage,t=e.style,c=(0,s.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,a.jsx)("article",(0,i.Z)((0,o.Z)({},c),{className:(0,l.W)(d().root,(0,r.Z)({},d().withBackground,u)),style:(0,o.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},p=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().image}))},m=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().content}))},y=function(e){return(0,a.jsx)(c.xv,(0,i.Z)((0,o.Z)({},e),{className:d().title}))},h=function(e){return(0,a.jsx)(c.xv,(0,i.Z)((0,o.Z)({},e),{className:d().desc,color:"grey11"}))},v=function(e){return(0,a.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:d().actions,color:"grey"}))}},65563:function(e,n,t){"use strict";t.d(n,{AK:function(){return Z},E3:function(){return m},EN:function(){return y},F$:function(){return x},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return _},gR:function(){return S},mf:function(){return h},vB:function(){return v},xS:function(){return b},y6:function(){return l}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),a=t(98863),c=t(88866);function l(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function u(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===c.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,a=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(l=null==(m=p[1])?void 0:m.config)&&void 0!==l?l:void 0)return e;var t,a,l,d,p,m,y=function(e,n){var t,r=u(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===c.SlicesFieldType})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},y,{type:c.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===c.SlicesFieldType});if(void 0===s)return e;var l=(0,a.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,l))})}function y(e){var n,t,s=e.customType,l=e.sectionId,u=e.sliceId,f=d(s,l);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===c.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==c.SlicesFieldType)return s;var y=(0,a.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},u);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},l,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:y})})))))})}function h(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=u(e)[0];if(r){var a=(0,s.Z)(r,1)[0];t=p(t,a)}return t}function v(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,a.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function b(e){var n=e.customType,t=e.sectionId,a=e.newField,l=e.newFieldId,u=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(u).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},l,a));if(void 0!==d){var y=(0,s.Z)(d,2),h=y[0],v=y[1];m[h]=v}return I({customType:n,sectionId:t,updatedSection:m})}function Z(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,a.ud)(n.json[t],r);return I({customType:n,sectionId:t,updatedSection:o})}function j(e){var n,t,r,o,i,a=e.customType,c=e.sectionId,l=e.previousFieldId,u=e.newFieldId,d=e.newField,f=(n={fields:a.json[c],previousFieldId:l,newFieldId:u,newField:d},t=n.fields,r=n.previousFieldId,o=n.newFieldId,i=n.newField,Object.entries(t).reduce(function(e,n){var t=(0,s.Z)(n,2),a=t[0],c=t[1];return a===r?e[o]=i:a!==o&&(e[a]=c),e},{}));return I({customType:a,sectionId:c,updatedSection:f})}function S(e){var n,t,r,o,i,a,l,u=e.customType,d=e.sectionId,p=e.sourceIndex,m=e.destinationIndex,y=u.json[d],h=f(u,d),v=(n={fields:Object.fromEntries(Object.entries(y).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),sourceIndex:p,destinationIndex:m},t=n.fields,r=n.sourceIndex,o=n.destinationIndex,i=Object.entries(t),a=(0,s.Z)(i.splice(r,1),1)[0],i.splice(o,0,a),Object.fromEntries(i));if(void 0!==h){var x=(0,s.Z)(h,2),g=x[0],b=x[1];v[g]=b}return I({customType:u,sectionId:d,updatedSection:v})}function I(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function _(e){var n,t,r=e.id,i=e.label,s=e.repeatable,a=e.format,c=(n=s,t=a,!1===n&&"page"===t?(0,o.Z)({},C,F):!1===n?T:"page"===t?(0,o.Z)({},w,F):k);return{format:a,id:r,json:c,label:i,repeatable:s,status:!0}}var T={Main:{}},C={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},k={Main:{uid:{config:{label:"UID"},type:"UID"}}},w={Main:(0,o.Z)({},k.Main,C.Main)},F={"SEO & Metadata":{meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"},meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"}}}},56471:function(e,n,t){"use strict";t.d(n,{_:function(){return N}});var r=t(22710),o=t(99267),i=t(52322),s=t(22715),a=t(5632),c=t(2784),l=t(65186),u=t(59326),d=t(75289),f=t(88932),p=t(7604),m=t(64837);function y(){return(y=(0,r.Z)(function(e){var n,t,r,i,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,p.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),f.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(a,s),f.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var h=t(61107),v=t(2978),x=t(28199),g=t(7342),b=function(e){var n,t=e.customType,s=e.format,a=e.onClose,f=e.onDeleteCustomTypeSuccess,p=m.$[s],b=(0,c.useState)(!1),Z=b[0],j=b[1],S=(0,g.Z)().deleteCustomTypeSuccess,I=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return j(!0),[4,function(e){return y.apply(this,arguments)}({customType:t,onSuccess:function(){return S(t.id)}})];case 1:return e.sent(),f(),[2]}})}),function(){return n.apply(this,arguments)}),_=(0,u.B7)().theme;return(0,i.jsx)(x.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return a()},children:(0,i.jsx)(v.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,i.jsxs)(d.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(l.$vK,{size:20,color:null===(e=_.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(d.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",p.name({start:!1,plural:!1})]})]}),(0,i.jsx)(d.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,i.jsxs)(d.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(h.z,{label:"Cancel",variant:"secondary",onClick:function(){return a()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(h.z,{label:"Delete",variant:"danger",isLoading:Z,onClick:function(){I()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(d.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",p.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},Z=t(62230),j=t(85244),S=t(56580);function I(){return(I=(0,r.Z)(function(e){var n,t,r,i,s,a,c,l;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=m.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,j.Z)((0,Z.Z)({},n),{label:t}),[4,p.j.customTypes.renameCustomType({model:s})];case 2:if((a=o.sent().errors).length>0)throw a;return r(s),f.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return c=o.sent(),l="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(l,c),f.Am.error(l),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=t(35393),T=t(7781),C=t(4995),k=t(44570),w=function(e){var n,t,s,a=e.isChangesLocal,l=e.customType,u=e.format,f=e.onClose,p=e.setLocalCustomType,y=null!==(n=null==l?void 0:l.label)&&void 0!==n?n:"",h=null!==(t=null==l?void 0:l.id)&&void 0!==t?t:"",v=(0,g.Z)().renameCustomTypeSuccess,x=(0,_.g)().syncChanges,b=(0,c.useState)(!1),w=b[0],F=b[1],O=(s=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(F(!0),!(a&&p))return[3,1];return p((0,j.Z)((0,Z.Z)({},l),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return I.apply(this,arguments)}({model:l,newLabel:e.customTypeName,onSuccess:function(e){v(e),x()}})];case 2:n.sent(),n.label=3;case 3:return F(!1),f(),[2]}})}),function(e){return s.apply(this,arguments)}),B=(0,S.v9)(function(e){return{customTypeLabels:(0,T.YS)(e)}}).customTypeLabels,L=m.$[u];return(0,i.jsx)(C.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(h),buttonLabel:"Rename",close:f,onSubmit:function(e){O(e)},initialValues:{customTypeName:y},isLoading:w,content:{title:"Rename a ".concat(L.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&B.includes(n)&&y!==n&&(t.customTypeName="".concat(L.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(d.xu,{children:(0,i.jsx)(k.W,{name:"customTypeName",label:"".concat(L.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(L.name({start:!1,plural:!1})),error:n.customTypeName,testId:"custom-type-name-input"})})}})},F=t(12189),O=t(65563);function B(){return(B=(0,r.Z)(function(e,n){var t,r,i,s,a;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=m.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,O.mf)(e),[4,(0,F.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),f.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),a="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(a,s),f.Am.error(a),[3,4];case 4:return[2]}})})).apply(this,arguments)}var L=t(99526),N=function(e){var n,t=e.format,l=e.customType,u=e.isChangesLocal,d=e.setLocalCustomType,f=(0,a.useRouter)(),p=(0,g.Z)().saveCustomTypeSuccess,m=(0,c.useState)(!1),y=m[0],h=m[1],v=(0,c.useState)(!1),x=v[0],Z=v[1],j=(0,c.useState)(!1),S=j[0],I=j[1],_=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return I(!0),[4,function(e,n){return B.apply(this,arguments)}(l,p)];case 1:return t.sent(),e=L.cd.custom.getBuilderPagePathname(l.id),f.asPath===e&&(n=L.cd.page.getBuilderPagePathname(l.id),f.replace(n)),I(!1),[2]}})}),function(){return n.apply(this,arguments)}),T=function(){var e,n=L.cd[null!==(e=l.format)&&void 0!==e?e:"custom"].tablePagePathname;f.asPath!==n?f.replace(n):h(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.h_,{modal:!0,children:[(0,i.jsx)(s.$F,{disabled:S,children:(0,i.jsx)(s.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:S,variant:"solid"})}),(0,i.jsxs)(s.AW,{align:"end",children:[(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"edit"}),onSelect:function(){Z(!0)},children:"Rename"}),"custom"===t&&!u&&(0,i.jsx)(s.Xi,{startIcon:(0,i.jsx)(s.I5,{name:"driveFileMove"}),onSelect:function(){_()},children:"Convert to page type"}),(0,i.jsx)(s.Xi,{color:"tomato",startIcon:(0,i.jsx)(s.I5,{name:"delete"}),onSelect:function(){h(!0)},children:"Remove"})]})]}),y?(0,i.jsx)(b,{format:t,customType:l,onClose:function(){return h(!1)},onDeleteCustomTypeSuccess:T}):null,x?(0,i.jsx)(w,{format:t,customType:l,isChangesLocal:u,onClose:function(){return Z(!1)},setLocalCustomType:d}):null]})}},61107:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),a=t(2784),c=t(75289),l=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,y=e.disabled,h=e.onClick,v=e.sx,x=e.iconSize,g=void 0===x?16:x,b=e.iconFill,Z=e.variant,j=void 0===Z?"primary":Z,S=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(c.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===v?{}:v),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==y&&y||m,onClick:m?void 0:h,variant:j},S),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.$j,{size:g,color:u(j),"data-testid":l(S["data-testid"],"spinner")}),a&&t]}):(0,s.jsxs)(s.Fragment,{children:[a&&(0,s.jsx)(a,{size:g,fill:b,"data-testid":l(S["data-testid"],"icon")}),t]})}))})},44570:function(e,n,t){"use strict";t.d(n,{W:function(){return a}});var r=t(62230),o=t(52322),i=t(63397);t(2784);var s=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,l=e.testId,u=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:a,as:s.II,autoComplete:"off"},u?{onChange:u}:null,l?{"data-testid":l}:null)),c?(0,o.jsx)(s.xv,{"data-testid":l?"".concat(l,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},4995:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(63397),a=t(37149),c=t.n(a),l=t(75289),u=t(61107),d=t(28199),f=t(2978);n.Z=function(e){var n=e.children,t=e.close,a=e.isOpen,p=e.formId,m=e.validate,y=e.onSubmit,h=e.widthInPx,v=e.initialValues,x=e.content.title,g=e.cardProps,b=e.omitFooter,Z=void 0!==b&&b,j=e.isLoading,S=void 0!==j&&j,I=e.buttonLabel,_=void 0===I?"Save":I,T=e.testId,C=e.actionMessage;return c().setAppElement("#__next"),(0,i.jsx)(d.Z,{isOpen:a,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=h?h:"900px"}},children:(0,i.jsx)(s.J9,{initialValues:v,validate:function(e){return m?m(e):void 0},onSubmit:function(e){y(e)},children:function(e){var a=e.isValid,c=e.isSubmitting,d=e.values,m=e.errors,y=e.touched,h=e.setFieldValue,v=e.setValues;return(0,i.jsx)(s.l0,(0,o.Z)((0,r.Z)({id:p},null!=T?{"data-testid":T}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(l.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(l.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(l.x8,{type:"button",onClick:t})]})},Footer:Z?null:(0,i.jsxs)(l.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(l.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(l.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(l.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||S,children:"Cancel"}),(0,i.jsx)(u.z,{label:_,form:p,type:"submit",disabled:!a||c||S,isLoading:c||S,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:a,isSubmitting:c,values:d,errors:m,touched:y,setFieldValue:h,setValues:v})}))}))}})})}},98484:function(e){e.exports={column:"BlankSlate_column__ysDb2",root:"BlankSlate_root__DJ7wC BlankSlate_column__ysDb2",fadeIn:"BlankSlate_fadeIn__KMuKu",withBackground:"BlankSlate_withBackground___V5y5",image:"BlankSlate_image__rOe9w BlankSlate_column__ysDb2",content:"BlankSlate_content__wmOAI BlankSlate_column__ysDb2",title:"BlankSlate_title__5oTre",desc:"BlankSlate_desc__f6ZWf",actions:"BlankSlate_actions__6zYZr"}}}]);
|