slice-machine-ui 2.2.2-beta.11 → 2.2.2-beta.13
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/{lnoCw12ueMqf698VD8pfN → SXscopj79mdAQoEN375M1}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/{18539003-7b839478e0b5720a.js → 18539003-afe9213a677bd9f0.js} +3 -3
- package/out/_next/static/chunks/{210-565d01ee9777d1a1.js → 326-2d6d04d623de16c6.js} +2 -2
- package/out/_next/static/chunks/{448-a0de8b21d55d4da3.js → 448-ae7b5e576a84b47d.js} +1 -1
- package/out/_next/static/chunks/574-a23212bd78e563de.js +1 -0
- package/out/_next/static/chunks/{695-603bd96af31f4302.js → 695-bfe7255199983590.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-f7a7229e62fc765c.js → _app-46a081f5e646caa5.js} +157 -154
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-a6ff1618238b3510.js → [customTypeId]-b714ad9814898d23.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-c300f963db847451.js → [pageTypeId]-aa881786f6e5aee2.js} +1 -1
- package/out/_next/static/css/447984631bacb88c.css +1 -0
- 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 +6 -6
- package/src/features/builder/AddFieldDropdown.tsx +3 -0
- package/src/features/onboarding/OnboardingProgressStepper.tsx +1 -1
- package/src/features/onboarding/OnboardingStepDialog/OnboardingStepDialogContent.tsx +1 -1
- package/src/features/onboarding/content.tsx +30 -46
- package/src/features/onboarding/types.ts +3 -3
- package/out/_next/static/chunks/574-319271e279f042bc.js +0 -1
- package/out/_next/static/css/82c8c4f05b25d3af.css +0 -1
- /package/out/_next/static/{lnoCw12ueMqf698VD8pfN → SXscopj79mdAQoEN375M1}/_ssgManifest.js +0 -0
|
@@ -8,9 +8,9 @@ import type {
|
|
|
8
8
|
|
|
9
9
|
export const onboardingSteps: OnboardingStep[] = [
|
|
10
10
|
{
|
|
11
|
-
id: "
|
|
12
|
-
title: "
|
|
13
|
-
description: "
|
|
11
|
+
id: "addSlice",
|
|
12
|
+
title: "Add Slices",
|
|
13
|
+
description: "Add slices to your page type.",
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
id: "codePage",
|
|
@@ -18,19 +18,19 @@ export const onboardingSteps: OnboardingStep[] = [
|
|
|
18
18
|
description: "Build your page's structure",
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
id: "
|
|
22
|
-
title: "
|
|
23
|
-
description: "
|
|
21
|
+
id: "pushModels",
|
|
22
|
+
title: "Push Your Page",
|
|
23
|
+
description: "Push to your Page Builder.",
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
|
-
id: "
|
|
27
|
-
title: "
|
|
28
|
-
description: "
|
|
26
|
+
id: "createContent",
|
|
27
|
+
title: "Create content",
|
|
28
|
+
description: "Create engaging content.",
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
id: "
|
|
32
|
-
title: "
|
|
33
|
-
description: "
|
|
31
|
+
id: "renderPage",
|
|
32
|
+
title: "Render your page",
|
|
33
|
+
description: "Render your page on localhost.",
|
|
34
34
|
},
|
|
35
35
|
];
|
|
36
36
|
|
|
@@ -44,18 +44,11 @@ export const getOnboardingStepsContent = ({
|
|
|
44
44
|
OnboardingStepType,
|
|
45
45
|
OnboardingStepContentDefinition
|
|
46
46
|
> => ({
|
|
47
|
-
|
|
47
|
+
addSlice: {
|
|
48
48
|
videoUrl:
|
|
49
49
|
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/ADD_SLICE.mp4",
|
|
50
50
|
content: () => (
|
|
51
|
-
<Text>
|
|
52
|
-
Commodo irure ipsum exercitation consequat enim velit amet commodo.
|
|
53
|
-
Excepteur proident Lorem sunt enim amet tempor qui Lorem non non Lorem.
|
|
54
|
-
Ex sint elit ea. Proident veniam dolor cupidatat amet aute consectetur.
|
|
55
|
-
Non ad consectetur irure adipisicing aliquip. Ipsum nulla velit mollit
|
|
56
|
-
magna aliqua eu veniam. Commodo elit labore veniam nulla dolor aliqua
|
|
57
|
-
esse proident pariatur nostrud.
|
|
58
|
-
</Text>
|
|
51
|
+
<Text>Use slice templates and add them to your page type.</Text>
|
|
59
52
|
),
|
|
60
53
|
},
|
|
61
54
|
codePage: {
|
|
@@ -63,52 +56,43 @@ export const getOnboardingStepsContent = ({
|
|
|
63
56
|
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/CODE_SNIP.mp4",
|
|
64
57
|
content: () => (
|
|
65
58
|
<Text>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
reprehenderit eu enim. Nulla irure est fugiat aliqua elit excepteur
|
|
69
|
-
labore ipsum occaecat eu minim duis non sit. Ea eu irure dolore duis
|
|
70
|
-
labore ad. Quis sunt eu commodo sit nisi ullamco qui aliqua nostrud
|
|
71
|
-
labore nostrud ut nostrud nostrud.
|
|
59
|
+
If you don't already have a page component, copy-paste the page snippets
|
|
60
|
+
provided in your page type to create one.
|
|
72
61
|
</Text>
|
|
73
62
|
),
|
|
74
63
|
},
|
|
75
|
-
|
|
64
|
+
pushModels: {
|
|
76
65
|
videoUrl:
|
|
77
66
|
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PUSH.mp4",
|
|
78
67
|
content: () => (
|
|
79
68
|
<Text>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
excepteur adipisicing officia excepteur et pariatur aliquip aliquip
|
|
84
|
-
laborum.
|
|
69
|
+
You have just created some models, but you can't use them yet. First,
|
|
70
|
+
you must push them to the Page Builder. The Page Builder is where you
|
|
71
|
+
create content. Go head — push your models.
|
|
85
72
|
</Text>
|
|
86
73
|
),
|
|
87
74
|
},
|
|
88
|
-
|
|
75
|
+
createContent: {
|
|
89
76
|
videoUrl:
|
|
90
77
|
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PREVIEW.mp4",
|
|
91
78
|
content: () => (
|
|
92
79
|
<Text>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
esse qui et reprehenderit aute est.
|
|
80
|
+
Open your{" "}
|
|
81
|
+
<Text href={repositoryUrl} underline>
|
|
82
|
+
Page Builder
|
|
83
|
+
</Text>
|
|
84
|
+
, create a page, add slices, save, and publish. Then, come back here.
|
|
99
85
|
</Text>
|
|
100
86
|
),
|
|
101
87
|
},
|
|
102
|
-
|
|
88
|
+
renderPage: {
|
|
103
89
|
videoUrl:
|
|
104
90
|
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/WRITE.mp4",
|
|
105
91
|
content: () => (
|
|
106
92
|
<Text>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</Text>
|
|
111
|
-
, create a page, add slices, save, and publish. Then, come back here.
|
|
93
|
+
To render the page, run your project in your terminal and visit the page
|
|
94
|
+
on localhost (e.g.{" "}
|
|
95
|
+
<Text component="code">localhost:3000/example-page</Text>).
|
|
112
96
|
</Text>
|
|
113
97
|
),
|
|
114
98
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
export const onboardingStepStatusesSchema = z.object({
|
|
4
|
-
createPage: z.boolean(),
|
|
5
|
-
codePage: z.boolean(),
|
|
6
4
|
addSlice: z.boolean(),
|
|
7
|
-
|
|
5
|
+
codePage: z.boolean(),
|
|
8
6
|
pushModels: z.boolean(),
|
|
7
|
+
createContent: z.boolean(),
|
|
8
|
+
renderPage: z.boolean(),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
export type OnboardingStepStatuses = z.infer<
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[574],{85513:function(e,t,n){"use strict";n.d(t,{aV:function(){return u},Bu:function(){return p}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(37577),s=n(6277),c=n(41350),d=n.n(c),u=function(e){var t=e.border,n=(0,o.Z)(e,["border"]);return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},n),{className:(0,s.Z)(d().root,(void 0===t||t)&&d()["root-border"])}))},p=function(e){var t=e.actions,n=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:d().header,children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:n}),s,Boolean(t)?(0,l.jsx)("div",{className:d().headerActions,children:t}):null]}))}},14866:function(e,t,n){"use strict";n.d(t,{J9:function(){return l},U:function(){return s},XU:function(){return d},fF:function(){return a}});var i=n(62230),r=n(85244),o=n(81541),l=[{name:"Image",description:"A responsive image.",icon:"image",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295520/DEV_TOOLS/SM_FIELDS/Type_Image_zyatxy.png",type:"Image"},{name:"Text",description:"A text string without formatting.",icon:"title",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295529/DEV_TOOLS/SM_FIELDS/Type_Key_Text_xrqf45.png",type:"Text"},{name:"Rich Text",description:"Text with formatting options.",icon:"textFields",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295530/DEV_TOOLS/SM_FIELDS/Type_Rich_Text_fxdyar.png",type:"StructuredText"},{name:"Boolean",description:"A true or false toggle.",icon:"toggleOff",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295526/DEV_TOOLS/SM_FIELDS/Type_Boolean_cbwg8k.png",type:"Boolean"},{name:"Number",description:"An integer or float.",icon:"pin",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_Number_o3olop.png",type:"Number"},{name:"Select",description:"A dropdown of options.",icon:"arrowDropDownCircle",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Select_bedjei.png",type:"Select"},{name:"Link",description:"A link to a website, asset, or document.",icon:"link",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295528/DEV_TOOLS/SM_FIELDS/Type_Link_bgslgy.png",type:"Link"},{name:"Link To Media",description:"A link to a media asset.",icon:"attachFile",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_LinkToMedia_m2p0ce.png",type:"Link",variant:"LinkToMedia"},{name:"Color",description:"A color in hex format.",icon:"colorLens",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295521/DEV_TOOLS/SM_FIELDS/Type_Color_nyoeit.png",type:"Color"},{name:"Date",description:"A date without time.",icon:"dateRange",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295525/DEV_TOOLS/SM_FIELDS/Type_Date_dsuaeq.png",type:"Date"},{name:"Timestamp",description:"A date and time.",icon:"schedule",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295524/DEV_TOOLS/SM_FIELDS/Type_Timestamp_fkr5iw.png",type:"Timestamp"},{name:"Embed",description:"A video, song, or oEmbed link.",icon:"code",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295523/DEV_TOOLS/SM_FIELDS/Type_Embed_wwssvd.png",type:"Embed"},{name:"Geopoint",description:"A geographical coordinate.",icon:"place",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_GeoPoint_lpq0sm.png",type:"GeoPoint"},{name:"Content Relationship",description:"A reference to a Prismic document.",icon:"settingsEthernet",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Content_RelationShip_s4z4nh.png",type:"Link",variant:"ContentRelationship"},],a={name:"UID",description:"Unique Identifier",icon:"tag",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_UID_hrwzug.png",type:"UID"},s={name:"Repeatable Group",description:"A set of fields that editors can repeat.",icon:"createNewFolder",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721314577/DEV_TOOLS/SM_FIELDS/Type_Group_uwwco0.png",type:"Group"},c=(0,r.Z)((0,i.Z)({},s),{variant:"NestedGroup"}),d=(0,o.Z)(l).concat([a],(0,o.Z)([s,c]))},90104:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});var i=n(52322),r=n(37577),o=function(e){var t,n=e.status;switch(n){case"pending":t={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":t={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":t={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[t.icon,(0,i.jsx)(r.xv,{color:"grey11",children:t.text})]})}},85905:function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var i=n(52322),r=n(37577),o=n(14866);function l(e){var t=e.disabled,n=e.onSelectField,l=e.fields,s=e.triggerDataTestId,c=l.filter(function(e){return o.J9.some(function(t){return t.name===e.name})||e.name===o.fF.name}),d=l.find(function(e){return e.name===o.U.name});return(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{disabled:t,children:(0,i.jsx)(r.zx,{startIcon:"add",color:"grey","data-testid":void 0===s?"add-field":s,children:"Add a field"})}),(0,i.jsxs)(r.AW,{align:"end",maxHeight:400,collisionPadding:8,children:[(0,i.jsx)(r.Ju,{children:"Single fields"}),c.map(function(e){return(0,i.jsx)(a,{field:e,onSelectField:n})}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Ju,{children:"Set of fields"}),(0,i.jsx)(a,{field:d,onSelectField:n})]})]})]})}function a(e){var t=e.field,n=e.onSelectField,o=t.type,l=t.variant,a=t.name,s=t.icon,c=t.description,d=t.thumbnail;return(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:s,size:"large"}),description:c,onSelect:function(){return n(null!=l?l:o)},renderTooltip:function(e){return(0,i.jsx)(r.u,{visible:!0,variant:"custom",content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Ee,{src:d,sx:{height:170,width:278,borderRadius:4}}),(0,i.jsx)(r.xv,{color:"white",children:"How it will look for content editors."})]}),side:"left",sideOffset:4,children:e})},children:a},"".concat(o).concat(l?"-".concat(l):""))}},51279:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var i=n(62230),r=n(52322),o=n(61183);n(2784);var l=n(59326),a=n(75289),s=function(e){return{subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"},]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],d=function(e){var t,n=e.children,s=e.lang,d=e.sx,u=e.codeStyle,p=e.codeClass,f=e.Header,m=(0,l.B7)().theme,h=s?o.Z.highlight(n,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(n,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:d,children:[f?(0,r.jsx)(f,{}):null,(0,r.jsx)("code",{className:"hljs".concat(p?" ".concat(p):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(t=m.colors)||void 0===t?void 0:t.textClear)},u),dangerouslySetInnerHTML:{__html:h}})]})}},26950:function(e,t,n){"use strict";n.d(t,{J:function(){return c},k:function(){return s}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322);n(2784);var a=n(75289),s=function(e){var t=e.children,n=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},n)},s),{children:t}))},c=function(e){var t=e.children,n=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===n?2:n)-1,"%"),mb:1},children:t})}},35549:function(e,t,n){"use strict";n.d(t,{$w:function(){return i},Hq:function(){return u},tM:function(){return d}});var i,r=n(62230),o=n(85244),l=n(52322),a=n(63397);n(2784);var s,c=n(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var d=function(e){var t={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},t),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},t),{border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}});case i.WARNING:return(0,o.Z)((0,r.Z)({},t),{border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}});default:return t}},u=function(e){var t=e.sx,n=e.field,s=e.meta,u=e.formField,p=e.fieldName,f=e.fields,m=e.initialValues,h=e.isDisabled,x=s.error?i.ERROR:h||u.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===t?{}:t,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:p,children:[u.label||p,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:p,name:p,type:"text",placeholder:u.placeholder||u.label||p},u.fieldLevelValidation&&m?{validate:function(e){return u.fieldLevelValidation&&u.fieldLevelValidation({value:e,fields:f,initialId:m.id})}}:null,n),{as:c.II,sx:d(x),disabled:h||u.disabled}))]})}},20180:function(e,t,n){"use strict";n.d(t,{kp:function(){return c},sP:function(){return u},w8:function(){return p},Hq:function(){return f.Hq}});var i=n(62230),r=n(85244),o=n(52322),l=n(63397),a=n(2784),s=n(75289),c=function(e){var t=e.field,n=e.meta,c=e.fieldName,d=e.label,u=e.focusOnNewEntry,p=void 0===u||u,f=e.inputPlaceholder,m=e.buttonLabel,h=(0,a.useState)(n.value.length),x=h[0],g=h[1],v=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(function(){v.current=v.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(function(){var e=v.current.length;p&&e>x&&v.current[e-1].focus(),g(e)},[v.current.length,p,x]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[d,n.touched&&n.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:n.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},t),{render:function(e){return(0,o.jsxs)("div",{children:[t.value&&t.value.length>0?t.value.map(function(t,n){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:f,name:"".concat(c,".").concat(n),value:t,ref:function(e){return v.current[n]=e},onChange:function(t){var i=t.target.value;return e.replace(n,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(n)},children:"-"})]},"".concat(c,"-").concat(+n+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(t.value.length,"")},children:m})]})}}))]})},d=n(98240),u=function(e){e.initialValues;var t=e.meta,n=e.label,a=e.fieldName,c=e.onChange,u=(0,d.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},u),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!t.value)},checked:t.value}),n]}))},p=function(e){var t=e.field,n=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,d=(0,a.useState)(i||t.defaultValue||!1),p=d[0],f=d[1];return(0,a.useEffect)(function(){c?s(c(l,p)):s(c)},[p,l,c]),(0,o.jsx)(u,{meta:{value:p},fieldName:t.name,onChange:function(e){return f(e)&&r&&r(e)},label:"function"==typeof n?n(l,p):n})},f=n(35549)},82004:function(e,t,n){"use strict";var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(2784),s=n(75289),c=(0,a.forwardRef)(function(e,t){var n=e.children,a=e.Component,c=void 0===a?s.kC:a,d=e.sx,u=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===d?{}:d),ref:t},u),{children:n}))});t.Z=c},1225:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var i=n(62230),r=n(85244),o=n(52322),l=n(5446),a=n(2784),s=n(40023),c=n(951),d=n(8799),u=n(18978),p=n(59326),f=n(75289),m=n(82004),h=n(26474),x=n(98240),g=n(33710),v=n(79401),b=function(e){var t=e.text,n=e.as,l=e.sx,s=(0,x.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),d=(0,a.useState)(null),u=d[0],p=d[1],m=function(){p(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return m(),window.addEventListener("resize",m),function(){window.removeEventListener("resize",m)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.xv,(0,r.Z)((0,i.Z)({"data-for":t,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:n,ref:c},s),{children:t})),u&&(0,o.jsx)(v.X,{children:(0,o.jsx)(g.Z,{id:t,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:t})})]})},y=function(e){var t,n,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(f.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(t=l.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=l.colors)||void 0===n?void 0:n.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(f.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var t=e.item,n=e.index,x=e.deleteItem,g=e.enterEditMode,v=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,S=e.CustomEditElements,I=e.widget,_=e.draggableId,E=e.testId,F=e.isRepeatableCustomType,T=e.children,k=(0,p.B7)().theme,C=t.key,w=t.value,N=w.config,M=w.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:_,index:n,children:function(e){var s,p,_,w,L;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(m.Z,(0,r.Z)((0,i.Z)({"data-testid":E,ref:e.innerRef},e.draggableProps),{Component:f.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(f.kC,{sx:{width:"100%"},children:[(0,o.jsx)(h.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:u.Fm7,color:null===(s=k.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(f.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,o.jsxs)(f.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:k,text:(null==N?void 0:N.label)||C,sliceFieldName:b&&b(C),WidgetIcon:I.Meta.icon}),(0,o.jsxs)(f.kC,{children:[S||null,Z||(0,o.jsx)(h.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(p=k.colors)||void 0===p?void 0:p.icons},onClick:function(){return g([C,t.value],v,n)}}),!(!0===F&&"UID"==M)&&(0,o.jsxs)(l.v2,{children:[(0,o.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,o.jsx)(d.FQA,{size:20,color:null===(_=k.colors)||void 0===_?void 0:_.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(w=k.colors)||void 0===w?void 0:w.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(L=k.colors)||void 0===L?void 0:L.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return x(C)},children:"Delete field"})})]})]})]}),j||null]})]}),T]}))})}})})}},26474:function(e,t,n){"use strict";var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(75289),s=function(e,t){return t?{border:function(e){var t=e.colors;return"1px solid ".concat(t.error)}}:e?{border:function(e){var t=e.colors;return"1px solid ".concat(t.primary)}}:{border:function(e){var t=e.colors;return"1px solid ".concat(t.borders)}}},c=function(e){var t=e.sx,n=e.onClick,c=e.label,d=e.Icon,u=e.error,p=e.size,f=void 0===p?16:p,m=e.fitButton,h=e.active,x=e.useActive,g=e.activeSx,v=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===n?function(){return null}:n,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==m&&m?{width:f,height:f}:null,void 0!==x&&x&&(void 0===g?s:g)(void 0!==h&&h,void 0===u?null:u),void 0===t?null:t)},v),{children:(0,l.jsx)(d,{size:f})}))};t.Z=c},79474:function(e,t,n){"use strict";var i=n(62230),r=n(17064),o=n(52322),l=n(63397),a=n(2784),s=n(75289),c=n(20180),d=n(33413),u=function(e){var t=e.fieldName,n=e.formField,u=e.fields,p=e.initialValues,f=(0,r.Z)((0,l.U$)(t),3),m=f[0],h=f[1],x=f[2],g=n.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},n.type===d.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:g?(0,o.jsx)(g,{meta:h,field:m,helpers:x,fieldName:t,formField:n,initialValues:p}):(0,o.jsxs)(a.Fragment,{children:[n.type===d.h.INPUT?(0,o.jsx)(c.Hq,{meta:h,field:m,fields:u,formField:n,fieldName:t,initialValues:p}):null,n.type===d.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:h,label:n.label,fieldName:t,initialValues:p,onChange:function(e){return x.setValue(e)}})]})})};t.Z=u},1411:function(e,t,n){"use strict";n.d(t,{Z:function(){return R}});var i=n(62230),r=n(85244),o=n(17064),l=n(52322),a=n(37149),s=n.n(a),c=n(59326),d=n(75289),u=n(65413),p=n(2784),f=n(92928),m=n(2978),h=n(98240),x=function(e){var t=e.children,n=(0,h.Z)(e,["children"]);return(0,l.jsx)(d.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},n),{children:t}))};x.tabsRole="TabList";var g=function(e){var t=e.children,n=(0,h.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(f.OK,(0,r.Z)((0,i.Z)({},n),{style:(0,i.Z)({margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0"},n.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:t}))};g.tabsRole="Tab";var v=function(e){var t=e.children,n=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,h=(0,p.useState)(u),v=h[0],b=h[1];return(0,l.jsx)(m.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:n,children:(0,l.jsxs)(f.mQ,{defaultIndex:u,onSelect:function(e){return b(e)},children:[(0,l.jsx)(x,{children:(o||[]).map(function(e){return(0,l.jsx)(g,{children:e},e)})}),p.Children.map(t,function(e,t){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:t===v?"block":"none"},children:(0,l.jsx)(f.x4,{children:e})})})]})})},b=(0,p.memo)(v),y=n(26950),j=function(e){var t,n,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,l.jsx)(d.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=n(28199),S=n(86163),I=n(5632),_=n(65186),E=n(25978),F=function(){var e=(0,I.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(_.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,l.jsx)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(t){t.preventDefault(),window.open("".concat(e.asPath,"/simulator"),E.pq)},children:"Go to the Slice Simulator"})]})},T=n(58514),k=n(50535),C=n(69114),w=n(79474),N=n(67557),M=n(77033),L=n(63397),A=function(e){var t=e.formId,n=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(L.J9,{initialValues:n,validationSchema:a,onSubmit:function(e,t){var n;s({newKey:e.id,value:Object.entries((0,h.Z)(e,["id"])).reduce(function(e,t){var n=(0,o.Z)(t,2),l=n[0],a=n[1];if((void 0===a?"undefined":(0,M.Z)(a))!==Boolean&&!a){var s,d=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==d)return(0,r.Z)((0,i.Z)({},e),(0,N.Z)({},l,d))}return(0,r.Z)((0,i.Z)({},e),(0,N.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(L.l0,{id:t,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:n}))})}})})},D=(0,p.memo)(A);s().setAppElement("#__next");var R=function(e){var t=e.close,n=e.data,a=e.fields,s=e.onSave,p=e.zoneType,f=(0,c.B7)().theme;if(!n.isOpen)return null;var m=(0,o.Z)(n.field,2),h=m[0],x=m[1],g=(0,C.t)(T.C,x.config,x.type);if(!g)return(0,l.jsxs)("div",{children:[x.type," not found"]});var v=g.Meta.icon,I=g.FormFields,_=g.Form,E=g.schema,N=(0,i.Z)({},(0,S.f7)((0,k.B9)(I,"id")),g.prepareInitialValues?g.prepareInitialValues(x.config):x.config),M=function(){try{return{res:E.validateSync({type:x.type,config:N},{stripUnknown:!0})}}catch(e){return{err:e}}}(),L=M.res,A=M.err;A&&(console.error("[EditModal] Failed to validate field of type ".concat(x.type,".\n Please update model.json accordingly.")),console.error(A));var R={id:h,config:L?L.config:N},O=(0,o.Z)(I.id.validate.matches,2),V=O[0],q=O[1],B=u.object().shape({id:u.string().matches(V,q).min(3).max(35).required(),config:E.fields.config}),z="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,l.jsx)(D,{apiId:h,formId:z,initialValues:R,validationSchema:B,FormFields:I,onSave:function(e){var n=e.newKey,r=e.value;s({apiId:h,newKey:n,value:(0,i.Z)({},x,r)}),t()},children:function(e){var n=e.values,s=n.id,c=n.config.label,u=e.isValid,m=e.isSubmitting,h=e.initialValues,x=_?(0,l.jsx)(_,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(I).map(function(e){var t=(0,o.Z)(e,2),n=t[0],i=t[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(w.Z,{fieldName:(0,S.lm)(n),formField:i,fields:a,initialValues:h})},n)})},"field-model-tab-content"),g=["Field Model"],Z=[x];if("slice"===p){var E=(0,l.jsx)(d.xu,{children:(0,l.jsx)(F,{})},"mock-data-tab-content");g.push("Mock Data"),Z.push(E)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:function(e){var n=e.radius;return(0,l.jsxs)(d.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n},children:[(0,l.jsx)(j,{theme:f,text:c||s,WidgetIcon:v}),(0,l.jsx)(d.x8,{onClick:t,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:t,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:z,type:"submit",disabled:!u&&m,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},63928:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var i=n(22710),r=n(99267),o=n(52322),l=n(2784),a=n(49857),s=n(7604),c=n(77245),d=n(8799),u=n(65186),p=n(59326),f=n(75289),m=n(51279),h={position:"relative",top:"3px"},x=function(e){var t,n,i,r=e.code,a=e.lang,s=(0,p.B7)().theme,x=(0,l.useState)(!1),g=x[0],v=x[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){v(!0),setTimeout(function(){v(!1)},1200)})};return r?(0,o.jsxs)(f.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(f.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.vcz,{size:26,color:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(m.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(f.xu,{children:(0,o.jsxs)(f.zx,{"aria-label":g?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[g?(0,o.jsx)(u.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:h}):(0,o.jsx)(c.LhG,{size:16,style:h}),(0,o.jsx)(f.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},g=function(e){var t=e.show,n=e.renderHintBase,l=e.item,c=e.hintItemName,d=n({item:l}),u=(0,a.ZP)(d,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:d.split("."),model:l.value,itemName:c})];case 1:return[2,e.sent()]}})})),p=u.data,f=u.error;if(f&&console.error(f),!p||f)return null;var m=p.snippets||[];return m[0]?(0,o.jsx)("div",{style:{display:t?"initial":"none"},children:(0,o.jsx)(x,{code:m[0].code,lang:m[0].language})}):null}},8033:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(37577),s=n(63397),c=n(2784),d=n(75289),u=n(59326),p=n(35549),f=n(86163),m=n(58428),h=n(58514),x=n(55197),g=n(18978),v=n(33710),b=n(79401),y=function(e){var t=e.error;return t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.X,{children:(0,l.jsx)(v.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(g.Zlu,{color:"tomato","data-tip":t,style:{position:"absolute",right:"8px"},size:16})]}):null},j=function(e){var t=e.innerRef,n=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(d.II,(0,r.Z)((0,i.Z)({},n),{ref:t}))},Z=function(e){var t=e.widgetTypeName,n=e.fields,o=e.onSave,g=e.onCancelNewField,v=(0,c.useRef)(null),b=(0,u.B7)().theme,Z=(0,c.useState)(!0),S=Z[0],I=Z[1];(0,c.useEffect)(function(){v.current&&v.current.focus()},[v]);var _=h.C[t];if(!_)return console.error('Widget of type "'.concat(t,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var E=_.FormFields,F=_.Meta.icon,T={id:E.id,label:E.label},k=(0,r.Z)((0,i.Z)({},(0,f.f7)(T),"UID"===t?{id:"uid"}:{}),{widgetTypeName:t}),C=(0,f.gc)(T),w=function(e,t,n){n(S&&!T.id.disabled?(0,r.Z)((0,i.Z)({},t),{label:e.target.value,id:(0,x.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},t),{label:e.target.value}))},N=function(e,t){t("id",e.target.value),I(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:C,initialValues:k,children:function(e){var t,o,c=e.errors,u=e.values,f=e.setValues,h=e.setFieldValue,x=e.submitForm;return(0,l.jsx)(s.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(d.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var t,n;return"1px solid ".concat((null===(t=e.colors)||void 0===t?void 0:null===(n=t.borders)||void 0===n?void 0:n.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(F,{style:{color:null===(t=b.colors)||void 0===t?void 0:t.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=b.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return w(e,u,f)},onKeyDown:function(e){"Enter"===e.key&&x()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:v,sx:(0,r.Z)((0,i.Z)({},(0,p.tM)(T.label.disabled?p.$w.DISABLED:c.label?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(y,{error:c.label})]}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return N(e,h)},onKeyDown:function(e){"Enter"===e.key&&x()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:T.id.disabled,validate:function(e){return(0,m.u)({value:e,fields:n,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,p.tM)(T.id.disabled?p.$w.DISABLED:c.id?p.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(y,{error:c.id})]}),(0,l.jsxs)(d.kC,{sx:{gap:2},children:[(0,l.jsx)(a.zx,{onClick:g,color:"grey",children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:function(){x()},children:"Add"})]})]})})}})}},75843:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var i=n(62230),r=n(85244),o=n(17064),l=n(81541),a=n(52322),s=n(37577),c=n(13980),d=n(2784),u=n(65077),p=n(12189),f=n(85513),m=n(14866),h=n(85905),x=n(21112),g=n(40023),v=n(75289),b=n(82004),y=n(1225),j=n(58514),Z=n(69114),S=n(63928),I=function(e){var t=e.fields,n=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,d=e.renderFieldAccessor,u=e.onDeleteItem,p=e.onSave,f=e.showHints,m=e.newField,h=e.renderHintBase,x=e.isRepeatable,I=e.testId,_=e.isRepeatableCustomType;return(0,a.jsx)(g.Z5,{onDragEnd:c,children:(0,a.jsx)(g.bK,{droppableId:n,children:function(e,n){return(0,a.jsxs)(v.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":I,sx:{paddingInline:"16px !important"},children:[t.map(function(e,t){var c=e.value,m=c.config,g=c.type,I=(0,Z.t)(j.C,m,g);if(!I)return(0,a.jsx)(b.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',g,'" not supported']})});var E={item:e,index:t,tabId:o,widget:I,showHints:f,key:e.key,enterSelectMode:s,renderFieldAccessor:d,enterEditMode:l,parentSnapshot:n,deleteItem:u,saveItem:p,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:_,testId:"list-item-".concat(e.key)},F=(0,a.jsx)(S.Z,{item:e,show:f,isRepeatable:x,renderHintBase:h,hintItemName:I.hintItemName,Widgets:j.C,typeName:I.CUSTOM_NAME||I.TYPE_NAME});if(I.CustomListItem){var T=I.CustomListItem;return(0,a.jsx)(T,(0,r.Z)((0,i.Z)({},E),{HintElement:F}))}return(0,a.jsx)(y.Z,(0,r.Z)((0,i.Z)({},E),{HintElement:F}))}),e.placeholder,m]}))}})})},_=n(8033),E=n(73539),F=n.n(E),T=function(e){var t=e.zoneType,n=e.heading,i=void 0===n?"Your ".concat(t," has no fields yet"):n,r=e.action;return(0,a.jsxs)("div",{className:F().root,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.xv,{variant:"bold",children:i}),(0,a.jsx)(s.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),r]})},k=function(e){var t,n,c=e.zoneType,g=e.zoneTypeFormat,v=e.tabId,b=e.title,y=e.fields,j=e.poolOfFieldsToCheck,Z=e.widgetsArray,S=e.isRepeatable,E=e.onDeleteItem,F=e.onSaveNewField,k=e.onDragEnd,C=e.EditModal,w=e.onSave,N=e.dataTip,M=e.renderHintBase,L=e.renderFieldAccessor,A=e.testId,D=e.isRepeatableCustomType,R=e.emptyStateHeading,O=Object.entries(j).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?Z.filter(function(e){return"UID"!==e.TYPE_NAME}):Z,V=(0,d.useState)(!1),q=V[0],B=V[1],z=(0,d.useState)({isOpen:!1}),P=z[0],H=z[1],J=(0,d.useState)(null),U=J[0],G=J[1],W=function(e){H({isOpen:!0,field:e});var t=(0,o.Z)(e,2),n=t[0],i=t[1];p.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,x.T)(window.location.pathname)})},$=function(){H({isOpen:!1})},Y=function(e){G({widgetTypeName:e,fields:y})},K=function(){return G(null)},X=(0,a.jsx)(h.S,{disabled:null!==U,onSelectField:Y,fields:O.filter(Boolean).map(function(e){var t=e.TYPE_NAME,n=e.CUSTOM_NAME;return m.XU.find(function(e){return e.type===t&&(void 0===n||e.variant===n)})}),triggerDataTestId:Boolean(S)?"add-field-in-items":void 0});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Bu,{actions:y.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:q,onCheckedChange:B,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),X]}):void 0,children:b}),0!==y.length||U?y.length>0||U?(0,a.jsx)(u.xR,{children:(0,a.jsx)(I,{tabId:v,isRepeatable:S,fields:y,showHints:q,dataTip:N,title:b,renderFieldAccessor:L,renderHintBase:M,enterEditMode:W,onDragEnd:k,onDeleteItem:E,onSave:w,testId:A,isRepeatableCustomType:D,newField:U&&(0,a.jsx)(_.Z,(0,r.Z)((0,i.Z)({},U),{fields:j||y,onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];F.apply(void 0,(0,l.Z)(t)),G(null)},onCancelNewField:K}))})}):void 0:(0,a.jsx)(T,{zoneType:(t=c,n=g,"customType"===t?"page"===n?"page type":"custom type":t),heading:R,action:X}),(0,a.jsx)(C,{data:P,close:$,onSave:w,fields:j,zoneType:c})]})};k.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var C=k},69114:function(e,t,n){"use strict";n.d(t,{t:function(){return r}});var i=n(59050),r=function(e,t,n){if("Link"===n)switch(null==t?void 0:t.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(n===i.GroupFieldType){var r;return null!==(r=e.Group)&&void 0!==r?r:e.NestedGroup}return e[n]}},58428:function(e,t,n){"use strict";n.d(t,{J:function(){return l},u:function(){return o}});var i=n(25978),r=n(77362),o=function(e){var t=e.value,n=e.fields,i=e.initialId;return t?n.find(function(e){return e.key===t})&&t!==i?'Field "'.concat(t,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},77362:function(e,t,n){"use strict";n.d(t,{II:function(){return c},Jg:function(){return o}});var i=n(86163),r=n(33413),o=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(t,s)},required:t,label:e,defaultValue:n,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,d=t||{},u=d.min,p=d.max,f=d.required,m=d.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(f,s),min:(0,i.MJ)(u,l),max:(0,i.MJ)(p,a),matches:m},defaultValue:o,fieldLevelValidation:n,yupType:"string",placeholder:c}}},86163:function(e,t,n){"use strict";n.d(t,{MJ:function(){return u},f7:function(){return p},gc:function(){return f},lm:function(){return d}});var i=n(67557),r=n(62230),o=n(85244),l=n(17064),a=n(81541),s=n(65413),c=n(33413),d=function(e){return"id"===e?"id":"config.".concat(e)},u=function(e,t){return Array.isArray(e)?e:"boolean"==typeof e&&e?t:null},p=function(e){return Object.entries(e).reduce(function(e,t){var n,a=(0,l.Z)(t,2),s=a[0],d=null===(n=a[1]).defaultValue?void 0:void 0!==n.defaultValue?n.defaultValue:n.type===c.h.CHECKBOX||(n.type===c.h.INPUT?"":n.type===c.h.SELECT?[]:void 0);return void 0!==d?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,d)):e},{})},f=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,t){var n=(0,l.Z)(t,2),c=n[0],d=n[1],u=d.validate,p=d.yupType;if(!u)return e;if("function"==typeof u)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,u(c,d)));var f=s[p]();return Object.entries(u).filter(function(e){return e&&e[1]}).forEach(function(e){var t,n=(0,l.Z)(e,2),i=n[0],r=n[1];if(r&&f[i]){f=(t=f)[i].apply(t,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,f))},{})).required().default(void 0).noUnknown(!0)}},33413:function(e,t,n){"use strict";var i,r;n.d(t,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},58514:function(e,t,n){"use strict";n.d(t,{C:function(){return tb}});var i,r,o=n(62230),l=n(52322),a=n(13002),s=n(85244),c=n(65186),d=n(65413),u=n(17064),p=n(75289),f=n(26950),m=n(79474),h=n(86163),x=n(58428),g=n(77362),v=(0,s.Z)((0,o.Z)({},x.J),{repeat:(0,g.Jg)("Repeatable",!1,!0)}),b=function(e){var t=e.initialValues,n=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,l.jsxs)(f.k,{children:[Object.entries(v).filter(function(e){return"repeat"!==(0,u.Z)(e,1)[0]}).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(r),formField:o,fields:n,initialValues:t})},r)}),(0,l.jsx)(f.J,{children:(0,l.jsx)(p.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,l.jsxs)(p.__,{variant:"label.border",sx:{mb:0},children:[(0,l.jsx)(p.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},y={icon:c.iy3};function j(e){var t,n=e.schemaTypeRegex,i=e.customListItem,r=e.customName,o=e.hintItemName;return{Meta:y,Form:b,FormFields:v,schema:d.object().shape({type:d.string().matches(n,{excludeEmptyString:!0}).required(),config:d.object().shape({fields:d.array(),label:d.string(),placeholder:d.string(),repeat:d.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:i,TYPE_NAME:"Group",CUSTOM_NAME:r,hintItemName:o}}var Z=n(98240),S=n(81541),I=n(59050),_=n(2784),E=n(40023),F=n(28316),T=n(12189),k=n(14866),C=n(85905),w=n(1225),N=n(1411),M=n(63928),L=n(8033),A=n(69114),D=n(63987),R=n(50535),O=n(55197),V=n(21112),q=function(e){var t=e.tabId,n=e.widget,a=e.Widgets,c=e.widgetsArray,d=e.hintBase,f=(e.parentSnapshot,e.showHints),m=e.isRepeatable,h=e.item,x=e.draggableId,g=e.saveItem,v=e.HintElement,b=(0,Z.Z)(e,["tabId","widget","Widgets","widgetsArray","hintBase","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),y=(0,_.useState)(null),j=y[0],q=y[1],B=(0,_.useState)({isOpen:!1}),z=B[0],P=B[1],H=function(e){q({widgetTypeName:e})},J=function(){q(null)},U=function(){P({isOpen:!1})},G=function(e){var t,n,o,l,s=e.id,c=e.label,d=a[e.widgetTypeName].create(c),u=(t={group:D.Fl.fromSM(h.value),fieldId:s,field:d},null!==(n=(i=l=structuredClone(t.group)).config)&&void 0!==n||(i.config={}),null!==(o=(r=l.config).fields)&&void 0!==o||(r.fields={}),l.config.fields[t.fieldId]=t.field,l);g({apiId:h.key,newKey:h.key,value:D.Fl.toSM(u)}),T.Xe.track({event:"field:added",id:s,name:c,type:d.type,isInAGroup:!0,contentType:(0,V.T)(window.location.pathname)})},W=function(e){var t=e.apiId,n=e.newKey,i=e.value,r=function(e){var t,n,i=structuredClone(e.group);if(!(null===(t=i.config)||void 0===t?void 0:t.fields)||!(null===(n=e.group.config)||void 0===n?void 0:n.fields))return i;for(var r in i.config.fields={},e.group.config.fields)r===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[r]=e.group.config.fields[r];return i}({group:D.Fl.fromSM(h.value),previousFieldId:t,newFieldId:n,field:i.type===I.GroupFieldType?D.Fl.fromSM(i):i});g({apiId:h.key,newKey:h.key,value:D.Fl.toSM(r)})},$=function(e){if(!(0,R.uS)(e)){var t=e.source,n=e.destination;if(n){var i=t.index,r=n.index,o=function(e){var t,n=structuredClone(e.group);if(!(null===(t=n.config)||void 0===t?void 0:t.fields))return n;var i=Object.entries(n.config.fields),r=(0,u.Z)(i.splice(e.sourceIndex,1),1)[0];return i.splice(e.destinationIndex,0,r),n.config.fields=Object.fromEntries(i),n}({group:D.Fl.fromSM(h.value),sourceIndex:i,destinationIndex:r});(0,F.flushSync)(function(){g({apiId:h.key,newKey:h.key,value:D.Fl.toSM(o)})})}}},Y=function(e){var t,n,i,r,o=(t={group:D.Fl.fromSM(h.value),fieldId:e},null===(n=(r=structuredClone(t.group)).config)||void 0===n||null===(i=n.fields)||void 0===i||delete i[t.fieldId],r);g({apiId:h.key,newKey:h.key,value:D.Fl.toSM(o)})},K=function(e){P({isOpen:!0,field:e});var t=(0,u.Z)(e,2),n=t[0],i=t[1];T.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,V.T)(window.location.pathname)})};return(0,l.jsxs)(_.Fragment,{children:[(0,l.jsx)(w.Z,(0,s.Z)((0,o.Z)({item:h,widget:n,draggableId:x},b),{HintElement:v,CustomEditElements:[(0,l.jsx)(C.S,{disabled:null!==j,onSelectField:H,fields:c.filter(Boolean).map(function(e){var t=e.TYPE_NAME,n=e.CUSTOM_NAME,i=k.XU.find(function(e){return e.type===t&&(void 0===n||e.variant===n)});if(!i)throw Error("Field not found for widget: ".concat(t," - ").concat(n));return i})},"add-field-dropdown"),],children:(0,l.jsx)(p.xu,{sx:{ml:4},children:(0,l.jsx)(E.Z5,{onDragEnd:$,children:(0,l.jsx)(E.bK,{droppableId:"".concat(t,"-").concat(h.key,"-zone"),children:function(e){return(0,l.jsxs)("ul",(0,s.Z)((0,o.Z)({ref:e.innerRef},e.droppableProps),{children:[h.value.config.fields.map(function(e,t){var n=e.value,i=n.config,r=n.type,c=(0,A.t)(a,i,r);if(!c)return null;var u={item:e,index:t,widget:c,key:e.key,enterEditMode:K,deleteItem:Y,saveItem:W,showHints:f,renderFieldAccessor:function(t){return"item".concat((0,O.Ti)(e.key))},draggableId:"group-".concat(h.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(h.key,"-").concat(e.key)},p=(0,l.jsx)(M.Z,{item:e,show:f,isRepeatable:m,renderHintBase:function(e){var t=e.item;return"".concat(d).concat((0,O.Ti)(t.key))},hintItemName:c.hintItemName,Widgets:a,typeName:c.CUSTOM_NAME||c.TYPE_NAME});if(c.CustomListItem){var x=c.CustomListItem;return(0,l.jsx)(x,(0,s.Z)((0,o.Z)({},u),{HintElement:p}))}return(0,l.jsx)(w.Z,(0,s.Z)((0,o.Z)({},u),{HintElement:p}))}),e.placeholder,j&&(0,l.jsx)(L.Z,(0,s.Z)((0,o.Z)({},j),{fields:h.value.config.fields||[],onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];G.apply(void 0,(0,S.Z)(t)),q(null)},onCancelNewField:J}))]}))}})})})})),(0,l.jsx)(N.Z,{data:z,close:U,onSave:W,fields:h.value.config.fields})]})},B={icon:c.hs8},z={label:x.J.label,id:x.J.id,placeholder_false:(0,g.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,g.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,g.Jg)("Default to true")},P=d.object().shape({type:d.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(z,"id"))}),H={icon:c.U8L},J=(0,R.zg)("Color"),U=J.TYPE_NAME,G=J.FormFields,W=J.schema,$=n(56580),Y=n(93290),K=n(7781),X=(0,s.Z)((0,o.Z)({},x.J),{allowTargetBlank:(0,g.Jg)("Allow target blank",!1,!1)}),Q=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(f.k,{children:Object.entries(X).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},ee={icon:c.$l_},et=d.object().shape({label:d.string().optional(),useAsTitle:d.boolean().optional(),placeholder:d.string().optional(),select:d.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:d.array(d.string()).strict().optional(),masks:d.array(d.string()).optional(),tags:d.array(d.string()).optional(),allowTargetBlank:d.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),en=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:et.optional()}),ei=n(36131),er={label:x.J.label,id:x.J.id,customtypes:{validate:function(){return d.array().of(d.string())}}},eo=function(e){var t=e.initialValues,n=e.values,i=e.fields,r=e.setFieldValue,a=(0,$.v9)(K.Ch).filter(Y.TG),c=a.map(function(e){return{value:e.local.id,label:e.local.label}}),d=n.config.customtypes?n.config.customtypes.map(function(e){var t=a.find(function(t){return t.local.id===e});return{value:null==t?void 0:t.local.id,label:null==t?void 0:t.local.label}}):null;return(0,l.jsxs)(f.k,{children:[Object.entries(er).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var n=(0,u.Z)(e,2),r=n[0],o=n[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(r),formField:o,fields:i,initialValues:t})},r)}),(0,l.jsx)(f.J,{children:(0,l.jsxs)(p.xu,{sx:{mt:2,alignItems:"center"},children:[(0,l.jsx)(p.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,l.jsx)(ei.ZP,{isMulti:!0,name:"origin",options:c,onChange:function(e){e&&r("config.customtypes",e.map(function(e){return e.value}))},value:d,theme:function(e){return(0,s.Z)((0,o.Z)({},e),{colors:(0,s.Z)((0,o.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},el={icon:c.I2R},ea=et.shape({label:d.string().max(35,"String is too long. Max: 35"),select:d.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:d.array(d.string()).strict().optional()}),es=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ea}),ec=(0,R.zg)("Date"),ed=ec.FormFields,eu=ec.schema,ep={icon:c.f$3},ef=(0,R.zg)("Embed"),em=ef.FormFields,eh=ef.schema,ex={icon:c.xoN},eg={label:x.J.label,id:x.J.id},ev=d.object().shape({type:d.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:d.object().shape({label:d.string()}).required().default(void 0).noUnknown(!0)}),eb={icon:c.lPv},ey=n(63397),ej=n(8799),eZ=n(20180),eS=n(26474),eI=function(e){var t=e.onClick,n=e.error,i=e.onDelete,r=e.active,a=e.text,s=e.sx;return(0,l.jsx)(eS.Z,{useActive:!0,fitButton:!0,error:n,onClick:t,active:r,sx:(0,o.Z)({position:"relative",width:"64px",height:"64px"},s),Icon:function(){return(0,l.jsxs)(_.Fragment,{children:[(0,l.jsxs)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,l.jsx)(ej.jnY,{size:22}),(0,l.jsx)(p.xv,{mt:1,children:a})]}),i?(0,l.jsx)(p.Ct,{onClick:i,variant:"circle-right",children:(0,l.jsx)(c.B4e,{})}):null]})}})},e_=function(e){var t=e.onClick;return(0,l.jsx)(eS.Z,{fitButton:!0,onClick:t,sx:{width:"64px",height:"64px",border:function(e){var t=e.colors;return"1px solid ".concat(String(null==t?void 0:t.borders))}},Icon:function(){return(0,l.jsx)(p.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,l.jsx)(ej.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},eE=function(e){var t=e.prefix,n=e.required,i=e.display,r=(0,u.Z)((0,ey.U$)(t),2),o=(r[0],r[1]),a=void 0!==n&&n?"*":"";return i?(0,l.jsxs)(_.Fragment,{children:[(0,l.jsx)(eF,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,l.jsx)(eT,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,l.jsx)(eT,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},eF=function(e){var t=e.name,n=e.label,i=e.placeholder,r=e.meta,a=e.isConstraint,c=(0,Z.Z)(e,["name","label","placeholder","meta","isConstraint"]),d=(0,u.Z)((0,ey.U$)(t),1)[0];return(0,l.jsx)(eZ.Hq,(0,s.Z)((0,o.Z)({},c),{fieldName:t,meta:r,formField:{label:n,placeholder:i},field:a?{value:"main",readOnly:!0}:{value:d.value},variant:a?"disabled":"primary"}))},eT=function(e){var t=e.name,n=e.label,i=e.placeholder,r=(0,Z.Z)(e,["name","label","placeholder"]),a=(0,u.Z)((0,ey.U$)(t),2),c=a[0],d=a[1];return(0,l.jsx)(eZ.Hq,(0,s.Z)((0,o.Z)({},r),{fieldName:t,formField:{label:n,placeholder:i},meta:d,field:{min:0,type:"number",value:c.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},ek=function(){return d.number().nullable().transform(function(e,t){return""===t?null:e})},eC={label:x.J.label,id:x.J.id,constraint:{validate:function(){return d.object().defined().shape({width:ek(),height:ek()})}},thumbnails:{validate:function(){return d.array().defined().of(d.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var t="number"==typeof e.width&&e.width,n="number"==typeof e.height&&e.height;return e.name&&(t||n)}}))}}},ew={name:"",width:"",height:""},eN=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||t||n?t||n?"".concat(t||"auto","x").concat(n||"auto"):"...":"auto"},eM=function(e){var t=e.initialValues,n=e.values,i=e.errors,r=e.fields,a=e.touched,c=(0,_.useState)(0),d=c[0],x=c[1],g=n.config,v=g.thumbnails,b=g.constraint;return(0,_.useEffect)(function(){x(v.length)},[v.length]),(0,l.jsxs)(f.k,{children:[Object.entries(eC).map(function(e){var n=(0,u.Z)(e,2),i=n[0],o=n[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(i),formField:o,fields:r,initialValues:t})},i)}),(0,l.jsxs)(f.J,{children:[(0,l.jsx)(p.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,l.jsx)(p.Zb,{p:3,children:(0,l.jsx)(ey.F2,{name:"config.thumbnails",render:function(t){var n=t.push,r=t.remove;return(0,l.jsxs)(_.Fragment,{children:[(0,l.jsxs)(p.kC,{mb:3,children:[(0,l.jsx)(eI,{active:0===d,text:eN(b,!0),sx:{mr:2},onClick:function(){return x(0)}}),v.map(function(e,t){return(0,l.jsx)(eI,{sx:{mr:3},active:d===+t+1,text:eN(e),error:!!i.thumbnails&&!!a.thumbnails&&!!a.thumbnails[t]&&!!i.thumbnails&&!!i.thumbnails[t],onDelete:function(){return r(t)},onClick:function(){return x(+t+1)}},"thumbnail-button-".concat(+t+1))}),(0,l.jsx)(e_,{onClick:function(){n(ew)}})]}),(0,l.jsx)(eE,(0,s.Z)((0,o.Z)({},e),{display:0===d,prefix:"config.constraint"})),v.map(function(t,n){return(0,_.createElement)(eE,(0,s.Z)((0,o.Z)({},e),{required:!0,key:"thumbnail-".concat(+n+1),display:d===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))})]})}})})]})]})},eL=d.object().shape({type:d.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(eC,"id"))}),eA={icon:c.Fwj},eD=(0,o.Z)({},x.J),eR=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(f.k,{children:Object.entries(eD).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},eO={icon:c._b$},eV=et.shape({select:d.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eq=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eV.optional()}),eB=(0,R.zg)("Number"),ez=eB.FormFields,eP=eB.schema,eH={icon:c.KZU},eJ=n(33413),eU=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eG=function(e,t){return t?e:void 0},eW=(0,s.Z)((0,o.Z)({},x.J),{default_value:{type:eJ.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return d.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(function(t){return t===e})}})},component:function(e){var t,n=null===(t=(0,ey.u6)().values.config)||void 0===t?void 0:t.options[0];return(0,l.jsx)(eZ.w8,(0,s.Z)((0,o.Z)({},e),{defaultValue:e.field.value,controlledValue:n,setControlledValue:e.helpers.setValue,buildControlledValue:eG,label:eU}))}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,l.jsx)(eZ.kp,(0,o.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),e$={icon:c.nwY},eY=d.object().shape({type:d.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(eW,"id"))}),eK=n(47927),eX=n(76635),eQ=n(34543),e0=function(e){return function(t){var n=t.size;return(0,l.jsx)("span",{style:{fontSize:n},children:e})}},e2=[{value:"paragraph",label:"P",icon:e0("p")},{value:"preformatted",label:"PRE",icon:e0("pre")},{value:"heading1",label:"H1",icon:e0("h1")},{value:"heading2",label:"H2",icon:e0("h2")},{value:"heading3",label:"H3",icon:e0("h3")},{value:"heading4",label:"H4",icon:e0("h4")},{value:"heading5",label:"H5",icon:e0("h5")},{value:"heading6",label:"H6",icon:e0("h6")},{value:"strong",label:"Strong",icon:e0((0,l.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:e0((0,l.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:e0((0,l.jsx)(eQ.eR7,{}))},{value:"image",label:"image",icon:e0((0,l.jsx)(eQ.LFN,{}))},{value:"embed",label:"embed",icon:e0((0,l.jsx)(eQ.xqv,{}))},{value:"list-item",label:"list",icon:e0((0,l.jsx)(eQ.SnF,{}))},{value:"o-list-item",label:"o",icon:e0((0,l.jsx)(ej.KyO,{}))},{value:"rtl",label:"rtl",icon:e0("rtl")},],e1=e2.map(function(e){return e.value}),e5=function(e){return!e1.find(function(t){return!e.includes(t)})},e3=function(e){var t=e.split(",");return e2.reduce(function(e,n){var i=n.value;return t.includes(i)?(0,S.Z)(e).concat([i]):e},[])};function e4(e,t){return(0,eK.has)("parent",e)&&(0,eX.isObject)(e.parent)&&(0,eK.has)(t,e.parent)&&(0,eX.isString)(e.parent[t])?e.parent[t]:null}function e7(e){return function(){return d.string().test({name:e,message:"Options cannot be empty",test:function(t,n){var i=e4(n,e),r=e4(n,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!e1.includes(e)})}})}}var e8,e9=(0,s.Z)((0,o.Z)({},x.J),{allowTargetBlank:(0,g.Jg)("Allow target blank for links"),single:{validate:e7("single")},multi:{validate:e7("multi")}}),e6=["config.single","config.multi"],te=function(e){var t,n=e.initialValues,i=e.values,r=e.errors,o=e.fields,a=e.setFieldValue,s=i.config,c=s.single,d=s.multi,x=c?e3(c):d&&e3(d)||e1,g=(0,_.useState)(!c),v=g[0],b=g[1],y=(0,_.useState)(x),j=y[0],Z=y[1];return(0,_.useEffect)(function(){var e=v?1:0;a(e6[e],j.join(",")),setTimeout(function(){a(e6[1-e],void 0)},100)},[v,j]),(0,l.jsxs)(f.k,{children:[Object.entries(e9).map(function(e){var t=(0,u.Z)(e,2),i=t[0],r=t[1];return(0,l.jsx)(f.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,h.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,l.jsxs)(f.J,{children:[(0,l.jsxs)(p.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,l.jsx)(p.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(e5(j))return Z([]);Z(e1)},children:e5(j)?"Unselect All":"Select all"})]}),e2.map(function(e){return(0,l.jsx)(eS.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:j.includes(e.value),onClick:function(){if(j.find(function(t){return t===e.value}))return Z(j.filter(function(t){return t!==e.value}));Z((0,S.Z)(j).concat([e.value]))}},e.value)}),(null===(t=r.config)||void 0===t?void 0:t[v?"multi":"single"])?(0,l.jsx)(p.xu,{sx:{position:"absolute"},children:(0,l.jsx)(p.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[v?"multi":"single"]})}):null]}),(0,l.jsx)(f.J,{children:(0,l.jsx)(p.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,l.jsxs)(p.__,{variant:"label.border",children:[(0,l.jsx)(p.XZ,{checked:v,onChange:function(){return b(!v)}}),"Allow multiple paragraphs"]})})})]})},tt={icon:c.BAW},tn=d.object().shape({type:d.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)((0,o.Z)({},e9,{labels:{yupType:"array",validate:{}}}),"id"))}),ti=x.J,tr=d.object().shape({type:d.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(ti,"id"))}),to={icon:c.SQS},tl=x.J,ta=d.object().shape({type:d.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(tl,"id"))}),ts={icon:c.k71},tc={label:x.J.label,id:(0,s.Z)((0,o.Z)({},x.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:x.J.placeholder},td=d.object().shape({type:d.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,h.gc)((0,R.B9)(tc,"id"))}),tu={Boolean:{TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:B,schema:P,FormFields:z},Color:{create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:G,TYPE_NAME:U,schema:W,Meta:H},ContentRelationship:{create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:el,schema:es,TYPE_NAME:"Link",FormFields:er,CUSTOM_NAME:"ContentRelationship",Form:eo,prepareInitialValues:function(e){var t=(0,$.v9)(K.Ch).filter(Y.TG);return(null==e?void 0:e.customtypes)?(0,s.Z)((0,o.Z)({},e),{customtypes:e.customtypes.filter(function(e){return t.find(function(t){return t.local.id===e})})}):e}},Date:{create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:ed,TYPE_NAME:"Date",schema:eu,Meta:ep},Embed:{create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:em,TYPE_NAME:"Embed",schema:eh,Meta:ex},GeoPoint:{create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:eg,TYPE_NAME:"GeoPoint",schema:ev,Meta:eb},Image:{Meta:eA,Form:eM,schema:eL,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:eC,TYPE_NAME:"Image"},Link:{Meta:ee,FormFields:X,schema:en,Form:Q,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},LinkToMedia:{Meta:eO,FormFields:eD,schema:eq,Form:eR,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},Number:{create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:ez,TYPE_NAME:"Number",schema:eP,Meta:eH},Select:{FormFields:eW,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:eY,Meta:e$,TYPE_NAME:"Select"},StructuredText:{create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:e1.join(",")}}},FormFields:e9,Meta:tt,schema:tn,TYPE_NAME:"StructuredText",Form:te},Text:{create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:to,schema:tr,TYPE_NAME:"Text",FormFields:ti},Timestamp:{create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:ta,FormFields:tl,TYPE_NAME:"Timestamp",Meta:ts},UID:{create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:c.XN7},schema:td,TYPE_NAME:"UID",FormFields:tc}},tp=[tu.Image,tu.Text,tu.StructuredText,tu.Link,tu.Select,tu.Boolean,tu.Number,tu.Color,tu.Date,tu.Embed,tu.Timestamp,tu.GeoPoint,tu.ContentRelationship,tu.LinkToMedia,],tf="subItem",tm=j({schemaTypeRegex:/^NestedGroup$/,customListItem:function(e){return(0,l.jsx)(q,(0,o.Z)({Widgets:tu,widgetsArray:tp,hintBase:tf},e))},customName:"NestedGroup",hintItemName:tf}),th=(0,s.Z)((0,o.Z)({},tu),{NestedGroup:tm}),tx=[th.Image,th.Text,th.StructuredText,th.Link,th.Select,th.Boolean,th.Number,th.Color,th.Date,th.Embed,th.Timestamp,th.GeoPoint,th.ContentRelationship,th.LinkToMedia,th.NestedGroup,],tg="item",tv=j({schemaTypeRegex:/^Group$/,customListItem:function(e){var t,n={eligible:(null==(t=(0,a.L)("slicemachine-nested-groups"))?void 0:t.value)==="on"}.eligible?tx:tx.filter(function(e){return"NestedGroup"!==e.CUSTOM_NAME});return(0,l.jsx)(q,(0,o.Z)({Widgets:th,widgetsArray:n,hintBase:tg},e))},hintItemName:tg}),tb=(0,o.Z)({Group:tv,NestedGroup:tm},tu)},50535:function(e,t,n){"use strict";n.d(t,{B9:function(){return s},Ss:function(){return d},uS:function(){return c},zg:function(){return u}});var i=n(98240),r=n(9849),o=n(65413),l=n(86163),a=n(58428),s=function(e,t){return e[t],(0,i.Z)(e,[t].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},d=function(e,t){return!e[t]&&(console.log('Could not find widget with type name "'.concat(t,'".')),!0)},u=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(t){return t===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},21112:function(e,t,n){"use strict";function i(e){if(e.startsWith("/slices/"))return"slice";if(e.startsWith("/custom-types/"))return"custom type";if(e.startsWith("/page-types/"))return"page type";throw Error("Did not detect a content type from: ".concat(e))}n.d(t,{T:function(){return i}})},41350:function(e){e.exports={flex:"List_flex__v0QQS",row:"List_row__sBVx1 List_flex__v0QQS",root:"List_root__f9klF List_flex__v0QQS","root-border":"List_root-border__2nh4p",child:"List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",header:"List_header__J5e8m List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS",headerActions:"List_headerActions__FqUvW List_row__sBVx1 List_flex__v0QQS",item:"List_item__t5SQz List_child__O_eM9 List_row__sBVx1 List_flex__v0QQS"}},73539:function(e){e.exports={root:"ZoneEmptyState_root__K6dwt"}}}]);
|