slice-machine-ui 2.2.2-beta.8 → 2.3.0

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 (95) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/chunks/{18539003-4c4fdc1584f243b4.js → 18539003-afe9213a677bd9f0.js} +3 -3
  3. package/out/_next/static/chunks/212-b6a2b8d9d16ef3c5.js +1 -0
  4. package/out/_next/static/chunks/{210-565d01ee9777d1a1.js → 326-2d6d04d623de16c6.js} +2 -2
  5. package/out/_next/static/chunks/448-ae7b5e576a84b47d.js +1 -0
  6. package/out/_next/static/chunks/465-d5dd75edd8e6bb65.js +1 -0
  7. package/out/_next/static/chunks/574-a23212bd78e563de.js +1 -0
  8. package/out/_next/static/chunks/59b4e022-8e544a511d670317.js +1 -0
  9. package/out/_next/static/chunks/{756-0b198fb40a3e6ae2.js → 695-bfe7255199983590.js} +6 -4
  10. package/out/_next/static/chunks/816-17afd84d2642f4c4.js +1 -0
  11. package/out/_next/static/chunks/f36c6662-1f3a854183168b10.js +1 -0
  12. package/out/_next/static/chunks/pages/_app-07a2573662865a6b.js +547 -0
  13. package/out/_next/static/chunks/pages/changelog-1d15a7ef498f499a.js +1 -0
  14. package/out/_next/static/chunks/pages/changes-0af2a1a5244418f9.js +1 -0
  15. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-a6ff1618238b3510.js → [customTypeId]-b714ad9814898d23.js} +1 -1
  16. package/out/_next/static/chunks/pages/index-2610e550d79c5bb1.js +1 -0
  17. package/out/_next/static/chunks/pages/labs-240ba57bfdabe998.js +1 -0
  18. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-c300f963db847451.js → [pageTypeId]-aa881786f6e5aee2.js} +1 -1
  19. package/out/_next/static/chunks/pages/settings-039476a9a63d25a1.js +1 -0
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-cfc19e3e799745bb.js +1 -0
  21. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-58e6cb0f278ea03c.js +1 -0
  22. package/out/_next/static/chunks/pages/slices-9894ce968d74baf6.js +1 -0
  23. package/out/_next/static/css/447984631bacb88c.css +1 -0
  24. package/out/_next/static/yi8ItcVBmEtxCSvLChc0b/_buildManifest.js +1 -0
  25. package/out/changelog.html +1 -1
  26. package/out/changes.html +1 -1
  27. package/out/custom-types/[customTypeId].html +1 -1
  28. package/out/custom-types.html +1 -1
  29. package/out/index.html +1 -1
  30. package/out/labs.html +1 -1
  31. package/out/page-types/[pageTypeId].html +1 -1
  32. package/out/settings.html +1 -1
  33. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  34. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  35. package/out/slices.html +1 -1
  36. package/package.json +9 -9
  37. package/src/domain/fields.ts +223 -0
  38. package/src/features/builder/AddFieldDropdown.tsx +122 -0
  39. package/src/features/onboarding/OnboardingGuide.tsx +45 -0
  40. package/src/features/onboarding/OnboardingProgressStepper.tsx +71 -0
  41. package/src/features/onboarding/OnboardingProvider.tsx +82 -0
  42. package/src/features/onboarding/OnboardingStepDialog/OnboardingStepDialog.tsx +46 -0
  43. package/src/features/onboarding/OnboardingStepDialog/OnboardingStepDialogContent.tsx +38 -0
  44. package/src/features/onboarding/OnboardingStepDialog/index.ts +1 -0
  45. package/src/features/onboarding/content.tsx +99 -0
  46. package/src/features/onboarding/types.ts +32 -0
  47. package/src/features/onboarding/useOnboardingExperiment.ts +6 -0
  48. package/src/hooks/usePersistedState.ts +20 -3
  49. package/src/legacy/components/Navigation/index.tsx +2 -0
  50. package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +9 -9
  51. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +7 -9
  52. package/src/legacy/lib/builders/SliceBuilder/VariationsList/index.tsx +1 -0
  53. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +4 -13
  54. package/src/legacy/lib/builders/common/Zone/index.jsx +26 -31
  55. package/src/legacy/lib/models/common/widgets/Boolean/index.ts +2 -4
  56. package/src/legacy/lib/models/common/widgets/Color/index.ts +2 -4
  57. package/src/legacy/lib/models/common/widgets/ContentRelationship/index.ts +0 -2
  58. package/src/legacy/lib/models/common/widgets/Date/index.ts +0 -2
  59. package/src/legacy/lib/models/common/widgets/Embed/index.ts +2 -4
  60. package/src/legacy/lib/models/common/widgets/GeoPoint/index.ts +2 -4
  61. package/src/legacy/lib/models/common/widgets/Group/ListItem/index.jsx +25 -19
  62. package/src/legacy/lib/models/common/widgets/Group/createGroupWidget.ts +2 -4
  63. package/src/legacy/lib/models/common/widgets/Group/index.tsx +8 -8
  64. package/src/legacy/lib/models/common/widgets/Image/index.ts +2 -4
  65. package/src/legacy/lib/models/common/widgets/Link/index.ts +2 -4
  66. package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +2 -4
  67. package/src/legacy/lib/models/common/widgets/NestedGroup/index.tsx +7 -7
  68. package/src/legacy/lib/models/common/widgets/Number/index.ts +2 -4
  69. package/src/legacy/lib/models/common/widgets/Select/index.ts +2 -4
  70. package/src/legacy/lib/models/common/widgets/StructuredText/index.ts +0 -2
  71. package/src/legacy/lib/models/common/widgets/Text/index.ts +0 -2
  72. package/src/legacy/lib/models/common/widgets/Timestamp/index.ts +2 -4
  73. package/src/legacy/lib/models/common/widgets/UID/index.ts +2 -4
  74. package/src/legacy/lib/models/common/widgets/Widget.ts +0 -2
  75. package/out/_next/static/8ioxR-A_Nfflu3QxG8paB/_buildManifest.js +0 -1
  76. package/out/_next/static/chunks/212-58a99ab312f8a03b.js +0 -1
  77. package/out/_next/static/chunks/448-7a6843206737d199.js +0 -1
  78. package/out/_next/static/chunks/465-695ac5fedef986eb.js +0 -1
  79. package/out/_next/static/chunks/574-dfeb0e6aa3079da1.js +0 -1
  80. package/out/_next/static/chunks/59b4e022-7a3b5554b806349f.js +0 -1
  81. package/out/_next/static/chunks/816-96fc9a79308019c7.js +0 -1
  82. package/out/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js +0 -1
  83. package/out/_next/static/chunks/pages/_app-0f7eec1bd89de90c.js +0 -536
  84. package/out/_next/static/chunks/pages/changelog-f0cd26a9ae095e9e.js +0 -1
  85. package/out/_next/static/chunks/pages/changes-1a57f90433a0b5e2.js +0 -1
  86. package/out/_next/static/chunks/pages/index-a0530bd55c7e1872.js +0 -1
  87. package/out/_next/static/chunks/pages/labs-7b0abeef69494aec.js +0 -1
  88. package/out/_next/static/chunks/pages/settings-f82286dde10f624c.js +0 -1
  89. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-453f946e8879c829.js +0 -1
  90. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-b530a5e0ac9d0391.js +0 -1
  91. package/out/_next/static/chunks/pages/slices-7411822d74f1f6c1.js +0 -1
  92. package/out/_next/static/css/ebf74ed654df9202.css +0 -1
  93. package/src/legacy/lib/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -51
  94. package/src/legacy/lib/builders/common/SelectFieldTypeModal/index.jsx +0 -84
  95. /package/out/_next/static/{8ioxR-A_Nfflu3QxG8paB → yi8ItcVBmEtxCSvLChc0b}/_ssgManifest.js +0 -0
@@ -0,0 +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(37577),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(37577),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"}}}]);