slice-machine-ui 2.2.2-beta.8 → 2.2.2-beta.9
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/chunks/{18539003-4c4fdc1584f243b4.js → 18539003-e38c98b473d02623.js} +1 -1
- package/out/_next/static/chunks/{448-7a6843206737d199.js → 448-a070e845a4500277.js} +1 -1
- package/out/_next/static/chunks/574-a391e2fe8084b1c3.js +1 -0
- package/out/_next/static/chunks/59b4e022-8e544a511d670317.js +1 -0
- package/out/_next/static/chunks/f36c6662-1f3a854183168b10.js +1 -0
- package/out/_next/static/chunks/pages/{_app-0f7eec1bd89de90c.js → _app-6fdb10a504e07048.js} +136 -128
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-7009aed51761c5eb.js +1 -0
- package/out/_next/static/css/82c8c4f05b25d3af.css +1 -0
- package/out/_next/static/{8ioxR-A_Nfflu3QxG8paB → uy_u3vlXV2zWs0MNOVlac}/_buildManifest.js +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/settings.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +6 -6
- package/src/domain/fields.ts +223 -0
- package/src/features/builder/AddFieldDropdown.tsx +119 -0
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +9 -9
- package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +7 -9
- package/src/legacy/lib/builders/SliceBuilder/VariationsList/index.tsx +1 -0
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +4 -13
- package/src/legacy/lib/builders/common/Zone/index.jsx +26 -31
- package/src/legacy/lib/models/common/widgets/Boolean/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Color/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/ContentRelationship/index.ts +0 -2
- package/src/legacy/lib/models/common/widgets/Date/index.ts +0 -2
- package/src/legacy/lib/models/common/widgets/Embed/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/GeoPoint/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Group/ListItem/index.jsx +25 -19
- package/src/legacy/lib/models/common/widgets/Group/createGroupWidget.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Group/index.tsx +8 -8
- package/src/legacy/lib/models/common/widgets/Image/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Link/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/NestedGroup/index.tsx +7 -7
- package/src/legacy/lib/models/common/widgets/Number/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Select/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/StructuredText/index.ts +0 -2
- package/src/legacy/lib/models/common/widgets/Text/index.ts +0 -2
- package/src/legacy/lib/models/common/widgets/Timestamp/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/UID/index.ts +2 -4
- package/src/legacy/lib/models/common/widgets/Widget.ts +0 -2
- package/out/_next/static/chunks/574-dfeb0e6aa3079da1.js +0 -1
- package/out/_next/static/chunks/59b4e022-7a3b5554b806349f.js +0 -1
- package/out/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-b530a5e0ac9d0391.js +0 -1
- package/out/_next/static/css/ebf74ed654df9202.css +0 -1
- package/src/legacy/lib/builders/common/SelectFieldTypeModal/FieldTypeCard.jsx +0 -51
- package/src/legacy/lib/builders/common/SelectFieldTypeModal/index.jsx +0 -84
- /package/out/_next/static/{8ioxR-A_Nfflu3QxG8paB → uy_u3vlXV2zWs0MNOVlac}/_ssgManifest.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BooleanField } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlineToggleOff } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { createValidationSchema } from "../../../../forms";
|
|
@@ -18,9 +18,7 @@ import { removeProp } from "../../../../utils";
|
|
|
18
18
|
import { Widget } from "../Widget";
|
|
19
19
|
|
|
20
20
|
const Meta = {
|
|
21
|
-
icon:
|
|
22
|
-
title: "Boolean",
|
|
23
|
-
description: "An input that is either true or false",
|
|
21
|
+
icon: MdOutlineToggleOff,
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
const FormFields = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlineColorLens } from "react-icons/md";
|
|
3
3
|
|
|
4
4
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
5
|
import { Widget } from "../Widget";
|
|
@@ -12,9 +12,7 @@ import { Widget } from "../Widget";
|
|
|
12
12
|
} */
|
|
13
13
|
|
|
14
14
|
const Meta = {
|
|
15
|
-
icon:
|
|
16
|
-
title: "Color",
|
|
17
|
-
description: "A color picker",
|
|
15
|
+
icon: MdOutlineColorLens,
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -25,8 +25,6 @@ import Form, { FormFields } from "./Form";
|
|
|
25
25
|
|
|
26
26
|
const Meta = {
|
|
27
27
|
icon: MdSettingsEthernet,
|
|
28
|
-
title: "Content Relationship",
|
|
29
|
-
description: "Define content relations & internal links",
|
|
30
28
|
};
|
|
31
29
|
|
|
32
30
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Embed } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdCode } from "react-icons/md";
|
|
3
3
|
|
|
4
4
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
5
|
import { Widget } from "../Widget";
|
|
@@ -16,9 +16,7 @@ import { Widget } from "../Widget";
|
|
|
16
16
|
const { FormFields, schema } = createDefaultWidgetValues("Embed");
|
|
17
17
|
|
|
18
18
|
const Meta = {
|
|
19
|
-
icon:
|
|
20
|
-
title: "Embed",
|
|
21
|
-
description: "Embed videos, songs, tweets, slides, …",
|
|
19
|
+
icon: MdCode,
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
export const EmbedWidget: Widget<Embed, typeof schema> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GeoPoint } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlinePlace } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
@@ -36,9 +36,7 @@ const schema = yup.object().shape({
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
const Meta = {
|
|
39
|
-
icon:
|
|
40
|
-
title: "GeoPoint",
|
|
41
|
-
description: "A field for storing geo-coordinates",
|
|
39
|
+
icon: MdOutlinePlace,
|
|
42
40
|
};
|
|
43
41
|
|
|
44
42
|
export const GeoPointWidget: Widget<GeoPoint, typeof schema> = {
|
|
@@ -2,18 +2,19 @@ import { GroupFieldType } from "@prismicio/types-internal/lib/customtypes/widget
|
|
|
2
2
|
import { Fragment, useState } from "react";
|
|
3
3
|
import { DragDropContext, Droppable } from "react-beautiful-dnd";
|
|
4
4
|
import { flushSync } from "react-dom";
|
|
5
|
-
import { Box
|
|
5
|
+
import { Box } from "theme-ui";
|
|
6
6
|
|
|
7
7
|
import { telemetry } from "@/apiClient";
|
|
8
|
+
import { fields as allFields } from "@/domain/fields";
|
|
8
9
|
import {
|
|
9
10
|
addFieldToGroup,
|
|
10
11
|
deleteFieldFromGroup,
|
|
11
12
|
reorderFieldInGroup,
|
|
12
13
|
updateFieldInGroup,
|
|
13
14
|
} from "@/domain/group";
|
|
15
|
+
import { AddFieldDropdown } from "@/features/builder/AddFieldDropdown";
|
|
14
16
|
import ListItem from "@/legacy/components/ListItem";
|
|
15
17
|
import EditModal from "@/legacy/lib/builders/common/EditModal";
|
|
16
|
-
import SelectFieldTypeModal from "@/legacy/lib/builders/common/SelectFieldTypeModal";
|
|
17
18
|
import Hint from "@/legacy/lib/builders/common/Zone/Card/components/Hints";
|
|
18
19
|
import NewField from "@/legacy/lib/builders/common/Zone/Card/components/NewField";
|
|
19
20
|
import { findWidgetByConfigOrType } from "@/legacy/lib/builders/utils";
|
|
@@ -39,14 +40,12 @@ export const CustomListItem = ({
|
|
|
39
40
|
HintElement,
|
|
40
41
|
...rest
|
|
41
42
|
}) => {
|
|
42
|
-
const [selectMode, setSelectMode] = useState(false);
|
|
43
43
|
const [newFieldData, setNewFieldData] = useState(null);
|
|
44
44
|
const [editModalData, setEditModalData] = useState({ isOpen: false });
|
|
45
45
|
|
|
46
46
|
const onSelectFieldType = (widgetTypeName) => {
|
|
47
47
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
48
48
|
setNewFieldData({ widgetTypeName });
|
|
49
|
-
setSelectMode(false);
|
|
50
49
|
};
|
|
51
50
|
|
|
52
51
|
const onCancelNewField = () => {
|
|
@@ -171,15 +170,28 @@ export const CustomListItem = ({
|
|
|
171
170
|
{...rest}
|
|
172
171
|
HintElement={HintElement}
|
|
173
172
|
CustomEditElements={[
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
173
|
+
<AddFieldDropdown
|
|
174
|
+
key="add-field-dropdown"
|
|
175
|
+
disabled={newFieldData !== null}
|
|
176
|
+
onSelectField={onSelectFieldType}
|
|
177
|
+
fields={widgetsArray.filter(Boolean).map((widget) => {
|
|
178
|
+
const { TYPE_NAME, CUSTOM_NAME } = widget;
|
|
179
|
+
|
|
180
|
+
const field = allFields.find(
|
|
181
|
+
(f) =>
|
|
182
|
+
f.type === TYPE_NAME &&
|
|
183
|
+
(CUSTOM_NAME === undefined || f.variant === CUSTOM_NAME),
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
if (!field) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Field not found for widget: ${TYPE_NAME} - ${CUSTOM_NAME}`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return field;
|
|
193
|
+
})}
|
|
194
|
+
/>,
|
|
183
195
|
]}
|
|
184
196
|
children={
|
|
185
197
|
<Box sx={{ ml: 4 }}>
|
|
@@ -282,12 +294,6 @@ export const CustomListItem = ({
|
|
|
282
294
|
</Box>
|
|
283
295
|
}
|
|
284
296
|
/>
|
|
285
|
-
<SelectFieldTypeModal
|
|
286
|
-
data={{ isOpen: selectMode }}
|
|
287
|
-
close={() => setSelectMode(false)}
|
|
288
|
-
onSelect={onSelectFieldType}
|
|
289
|
-
widgetsArray={widgetsArray}
|
|
290
|
-
/>
|
|
291
297
|
<EditModal
|
|
292
298
|
data={editModalData}
|
|
293
299
|
close={closeEditModal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MdOutlineCreateNewFolder } from "react-icons/md";
|
|
2
2
|
import * as yup from "yup";
|
|
3
3
|
|
|
4
4
|
import { TabField } from "@/legacy/lib/models/common/CustomType";
|
|
@@ -12,9 +12,7 @@ import { type GroupListItemProps } from ".";
|
|
|
12
12
|
import Form, { FormFields } from "./Form";
|
|
13
13
|
|
|
14
14
|
const Meta = {
|
|
15
|
-
icon:
|
|
16
|
-
title: "Group",
|
|
17
|
-
description: "A repeatable set of fields",
|
|
15
|
+
icon: MdOutlineCreateNewFolder,
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
const createSchema = (typeRegex: RegExp) =>
|
|
@@ -11,21 +11,21 @@ import { createGroupWidget, type SchemaType } from "./createGroupWidget";
|
|
|
11
11
|
import { CustomListItem } from "./ListItem";
|
|
12
12
|
|
|
13
13
|
const widgetsArray = [
|
|
14
|
-
Widgets.NestedGroup,
|
|
15
|
-
Widgets.StructuredText,
|
|
16
14
|
Widgets.Image,
|
|
15
|
+
Widgets.Text,
|
|
16
|
+
Widgets.StructuredText,
|
|
17
17
|
Widgets.Link,
|
|
18
|
-
Widgets.LinkToMedia,
|
|
19
|
-
Widgets.ContentRelationship,
|
|
20
18
|
Widgets.Select,
|
|
21
19
|
Widgets.Boolean,
|
|
20
|
+
Widgets.Number,
|
|
21
|
+
Widgets.Color,
|
|
22
22
|
Widgets.Date,
|
|
23
|
-
Widgets.Timestamp,
|
|
24
23
|
Widgets.Embed,
|
|
25
|
-
Widgets.
|
|
24
|
+
Widgets.Timestamp,
|
|
26
25
|
Widgets.GeoPoint,
|
|
27
|
-
Widgets.
|
|
28
|
-
Widgets.
|
|
26
|
+
Widgets.ContentRelationship,
|
|
27
|
+
Widgets.LinkToMedia,
|
|
28
|
+
Widgets.NestedGroup,
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
export interface GroupListItemProps<F extends TabField> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlineImage } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { createValidationSchema } from "../../../../forms";
|
|
@@ -38,9 +38,7 @@ const schema = yup.object().shape({
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
const Meta = {
|
|
41
|
-
icon:
|
|
42
|
-
title: "Image",
|
|
43
|
-
description: "A responsive image field with constraints",
|
|
41
|
+
icon: MdOutlineImage,
|
|
44
42
|
};
|
|
45
43
|
|
|
46
44
|
export const ImageWidget: Widget<Image, typeof schema> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
-
import {
|
|
2
|
+
import { MdLink } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { Widget } from "../Widget";
|
|
@@ -51,9 +51,7 @@ import Form, { FormFields } from "./Form";
|
|
|
51
51
|
*/
|
|
52
52
|
|
|
53
53
|
const Meta = {
|
|
54
|
-
icon:
|
|
55
|
-
title: "Link",
|
|
56
|
-
description: "A link to web, media or Prismic document",
|
|
54
|
+
icon: MdLink,
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Link } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdAttachFile } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { linkConfigSchema } from "@/legacy/lib/models/common/widgets/Link";
|
|
@@ -8,9 +8,7 @@ import { Widget } from "../Widget";
|
|
|
8
8
|
import Form, { FormFields } from "./Form";
|
|
9
9
|
|
|
10
10
|
const Meta = {
|
|
11
|
-
icon:
|
|
12
|
-
title: "Link to media",
|
|
13
|
-
description: "A link to files, document and media",
|
|
11
|
+
icon: MdAttachFile,
|
|
14
12
|
};
|
|
15
13
|
|
|
16
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
@@ -5,20 +5,20 @@ import { CustomListItem } from "@/legacy/lib/models/common/widgets/Group/ListIte
|
|
|
5
5
|
import { NonGroupWidgets as Widgets } from "@/legacy/lib/models/common/widgets/nonGroupWidgets";
|
|
6
6
|
|
|
7
7
|
const widgetsArray = [
|
|
8
|
-
Widgets.StructuredText,
|
|
9
8
|
Widgets.Image,
|
|
9
|
+
Widgets.Text,
|
|
10
|
+
Widgets.StructuredText,
|
|
10
11
|
Widgets.Link,
|
|
11
|
-
Widgets.LinkToMedia,
|
|
12
|
-
Widgets.ContentRelationship,
|
|
13
12
|
Widgets.Select,
|
|
14
13
|
Widgets.Boolean,
|
|
14
|
+
Widgets.Number,
|
|
15
|
+
Widgets.Color,
|
|
15
16
|
Widgets.Date,
|
|
16
|
-
Widgets.Timestamp,
|
|
17
17
|
Widgets.Embed,
|
|
18
|
-
Widgets.
|
|
18
|
+
Widgets.Timestamp,
|
|
19
19
|
Widgets.GeoPoint,
|
|
20
|
-
Widgets.
|
|
21
|
-
Widgets.
|
|
20
|
+
Widgets.ContentRelationship,
|
|
21
|
+
Widgets.LinkToMedia,
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
const hintItemName = "subItem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Number as PrismicNumber } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlinePin } from "react-icons/md";
|
|
3
3
|
|
|
4
4
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
5
|
import { Widget } from "../Widget";
|
|
@@ -16,9 +16,7 @@ import { Widget } from "../Widget";
|
|
|
16
16
|
const { FormFields, schema } = createDefaultWidgetValues("Number");
|
|
17
17
|
|
|
18
18
|
const Meta = {
|
|
19
|
-
icon:
|
|
20
|
-
title: "Number",
|
|
21
|
-
description: "A number input field",
|
|
19
|
+
icon: MdOutlinePin,
|
|
22
20
|
};
|
|
23
21
|
|
|
24
22
|
export const NumberWidget: Widget<PrismicNumber, typeof schema> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Select } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdOutlineArrowDropDownCircle } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { createValidationSchema } from "../../../../forms";
|
|
@@ -19,9 +19,7 @@ import FormFields from "./FormFields";
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
const Meta = {
|
|
22
|
-
icon:
|
|
23
|
-
title: "Select",
|
|
24
|
-
description: "A dropdown field of options for content creators.",
|
|
22
|
+
icon: MdOutlineArrowDropDownCircle,
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
const schema = yup.object().shape({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Timestamp } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
|
-
import {
|
|
2
|
+
import { MdSchedule } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { createValidationSchema } from "../../../../forms";
|
|
@@ -27,9 +27,7 @@ const schema = yup.object().shape({
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const Meta = {
|
|
30
|
-
icon:
|
|
31
|
-
title: "Timestamp",
|
|
32
|
-
description: "A calendar date picker with time",
|
|
30
|
+
icon: MdSchedule,
|
|
33
31
|
};
|
|
34
32
|
|
|
35
33
|
export const TimestampWidget: Widget<Timestamp, typeof schema> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UID } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
2
|
-
import {
|
|
2
|
+
import { MdTag } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
5
|
import { createValidationSchema } from "../../../../forms";
|
|
@@ -35,9 +35,7 @@ const schema = yup.object().shape({
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const Meta = {
|
|
38
|
-
icon:
|
|
39
|
-
title: "UID",
|
|
40
|
-
description: "Unique Identifier",
|
|
38
|
+
icon: MdTag,
|
|
41
39
|
};
|
|
42
40
|
|
|
43
41
|
export const UIDWidget: Widget<UID, typeof schema> = {
|
|
@@ -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 f}});var i=n(62230),r=n(85244),o=n(98240),l=n(52322),a=n(7729),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"])}))},f=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]}))}},90104:function(e,t,n){"use strict";n.d(t,{X:function(){return o}});var i=n(52322),r=n(7729),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})]})}},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,f=e.codeClass,p=e.Header,m=(0,l.B7)().theme,x=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:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),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:x}})]})}},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,f=e.fieldName,p=e.fields,m=e.initialValues,x=e.isDisabled,h=s.error?i.ERROR:x||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:f,children:[u.label||f,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:f,name:f,type:"text",placeholder:u.placeholder||u.label||f},u.fieldLevelValidation&&m?{validate:function(e){return u.fieldLevelValidation&&u.fieldLevelValidation({value:e,fields:p,initialId:m.id})}}:null,n),{as:c.II,sx:d(h),disabled:x||u.disabled}))]})}},20180:function(e,t,n){"use strict";n.d(t,{kp:function(){return c},sP:function(){return u},w8:function(){return f},Hq:function(){return p.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,f=void 0===u||u,p=e.inputPlaceholder,m=e.buttonLabel,x=(0,a.useState)(n.value.length),h=x[0],v=x[1],g=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(function(){g.current=g.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(function(){var e=g.current.length;f&&e>h&&g.current[e-1].focus(),v(e)},[g.current.length,f,h]),(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:p,name:"".concat(c,".").concat(n),value:t,ref:function(e){return g.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]}))},f=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),f=d[0],p=d[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(u,{meta:{value:f},fieldName:t.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof n?n(l,f):n})},p=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),f=n(59326),p=n(75289),m=n(82004),x=n(26474),h=n(98240),v=n(33710),g=n(79401),b=function(e){var t=e.text,n=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),d=(0,a.useState)(null),u=d[0],f=d[1],m=function(){f(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)(p.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)(g.X,{children:(0,o.jsx)(v.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)(p.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)(p.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,h=e.deleteItem,v=e.enterEditMode,g=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,I=e.CustomEditElements,C=e.widget,k=e.draggableId,S=e.testId,w=e.isRepeatableCustomType,F=e.children,E=(0,f.B7)().theme,T=t.key,_=t.value,N=_.config,A=_.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:k,index:n,children:function(e){var s,f,k,_,M;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(m.Z,(0,r.Z)((0,i.Z)({"data-testid":S,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(x.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:u.Fm7,color:null===(s=E.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.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)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:E,text:(null==N?void 0:N.label)||T,sliceFieldName:b&&b(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(p.kC,{children:[I||null,Z||(0,o.jsx)(x.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=E.colors)||void 0===f?void 0:f.icons},onClick:function(){return v([T,t.value],g,n)}}),!(!0===w&&"UID"==A)&&(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=E.colors)||void 0===k?void 0:k.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(_=E.colors)||void 0===_?void 0:_.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(M=E.colors)||void 0===M?void 0:M.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),F]}))})}})})}},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,f=e.size,p=void 0===f?16:f,m=e.fitButton,x=e.active,h=e.useActive,v=e.activeSx,g=(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:p,height:p}:null,void 0!==h&&h&&(void 0===v?s:v)(void 0!==x&&x,void 0===u?null:u),void 0===t?null:t)},g),{children:(0,l.jsx)(d,{size:p})}))};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,f=e.initialValues,p=(0,r.Z)((0,l.U$)(t),3),m=p[0],x=p[1],h=p[2],v=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:v?(0,o.jsx)(v,{meta:x,field:m,helpers:h,fieldName:t,formField:n,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[n.type===d.h.INPUT?(0,o.jsx)(c.Hq,{meta:x,field:m,fields:u,formField:n,fieldName:t,initialValues:f}):null,n.type===d.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:x,label:n.label,fieldName:t,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};t.Z=u},1411:function(e,t,n){"use strict";n.d(t,{Z:function(){return B}});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),f=n(2784),p=n(92928),m=n(2978),x=n(98240),h=function(e){var t=e.children,n=(0,x.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}))};h.tabsRole="TabList";var v=function(e){var t=e.children,n=(0,x.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.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}))};v.tabsRole="Tab";var g=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,x=(0,f.useState)(u),g=x[0],b=x[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)(p.mQ,{defaultIndex:u,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(v,{children:e},e)})}),f.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===g?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(g),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),I=n(86163),C=n(5632),k=n(65186),S=n(25978),w=function(){var e=(0,C.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(k.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"),S.pq)},children:"Go to the Slice Simulator"})]})},F=n(58514),E=n(50535),T=n(69114),_=n(79474),N=n(67557),A=n(77033),M=n(63397),R=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)(M.J9,{initialValues:n,validationSchema:a,onSubmit:function(e,t){var n;s({newKey:e.id,value:Object.entries((0,x.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,A.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)(M.l0,{id:t,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:n}))})}})})},L=(0,f.memo)(R);s().setAppElement("#__next");var B=function(e){var t=e.close,n=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!n.isOpen)return null;var m=(0,o.Z)(n.field,2),x=m[0],h=m[1],v=(0,T.t)(F.C,h.config,h.type);if(!v)return(0,l.jsxs)("div",{children:[h.type," not found"]});var g=v.Meta.icon,C=v.FormFields,k=v.Form,S=v.schema,N=(0,i.Z)({},(0,I.f7)((0,E.B9)(C,"id")),v.prepareInitialValues?v.prepareInitialValues(h.config):h.config),A=function(){try{return{res:S.validateSync({type:h.type,config:N},{stripUnknown:!0})}}catch(e){return{err:e}}}(),M=A.res,R=A.err;R&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(R));var B={id:x,config:M?M.config:N},O=(0,o.Z)(C.id.validate.matches,2),V=O[0],q=O[1],z=u.object().shape({id:u.string().matches(V,q).min(3).max(35).required(),config:S.fields.config}),D="".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)(L,{apiId:x,formId:D,initialValues:B,validationSchema:z,FormFields:C,onSave:function(e){var n=e.newKey,r=e.value;s({apiId:x,newKey:n,value:(0,i.Z)({},h,r)}),t()},children:function(e){var n=e.values,s=n.id,c=n.config.label,u=e.isValid,m=e.isSubmitting,x=e.initialValues,h=k?(0,l.jsx)(k,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(C).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)(_.Z,{fieldName:(0,I.lm)(n),formField:i,fields:a,initialValues:x})},n)})},"field-model-tab-content"),v=["Field Model"],Z=[h];if("slice"===f){var S=(0,l.jsx)(d.xu,{children:(0,l.jsx)(w,{})},"mock-data-tab-content");v.push("Mock Data"),Z.push(S)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:v,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:p,text:c||s,WidgetIcon:g}),(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:D,type:"submit",disabled:!u&&m,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},14424:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var i=n(62230),r=n(85244),o=n(52322),l=n(37149),a=n.n(l),s=n(75289),c=n(2978),d=n(26950),u=n(28199),f=n(59326),p=function(e){var t=e.title,n=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)},"&:hover":{border:function(e){var t=e.colors;return"1px solid ".concat(t.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":t,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(t,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:t})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:n})]})]})};a().setAppElement("#__next");var m=function(e){var t=e.data,n=e.close,l=e.onSelect,a=e.widgetsArray;return t.isOpen?(0,o.jsx)(u.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var t=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t,borderBottom:function(e){var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:[(0,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:n})]})},children:(0,o.jsx)(d.k,{children:a.filter(function(e){return e}).map(function(e){var t=e.Meta,n=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},t),{onSelect:function(){return l(a||n)}}))},a||n)})})})}):null}},63928:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});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),f=n(59326),p=n(75289),m=n(51279),x={position:"relative",top:"3px"},h=function(e){var t,n,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),v=h[0],g=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){g(!0),setTimeout(function(){g(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.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)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":v?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[v?(0,o.jsx)(u.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:x}):(0,o.jsx)(c.LhG,{size:16,style:x}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},v=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()]}})})),f=u.data,p=u.error;if(p&&console.error(p),!f||p)return null;var m=f.snippets||[];return m[0]?(0,o.jsx)("div",{style:{display:t?"initial":"none"},children:(0,o.jsx)(h,{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(7729),s=n(63397),c=n(2784),d=n(75289),u=n(59326),f=n(35549),p=n(86163),m=n(58428),x=n(58514),h=n(55197),v=n(18978),g=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)(g.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(v.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,v=e.onCancelNewField,g=(0,c.useRef)(null),b=(0,u.B7)().theme,Z=(0,c.useState)(!0),I=Z[0],C=Z[1];(0,c.useEffect)(function(){g.current&&g.current.focus()},[g]);var k=x.C[t];if(!k)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 S=k.FormFields,w=k.Meta.icon,F={id:S.id,label:S.label},E=(0,r.Z)((0,i.Z)({},(0,p.f7)(F),"UID"===t?{id:"uid"}:{}),{widgetTypeName:t}),T=(0,p.gc)(F),_=function(e,t,n){n(I&&!F.id.disabled?(0,r.Z)((0,i.Z)({},t),{label:e.target.value,id:(0,h.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},t),{label:e.target.value}))},N=function(e,t){t("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:E,children:function(e){var t,o,c=e.errors,u=e.values,p=e.setValues,x=e.setFieldValue,h=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)(w,{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 _(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:g,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(F.label.disabled?f.$w.DISABLED:c.label?f.$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,x)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:F.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,f.tM)(F.id.disabled?f.$w.DISABLED:c.id?f.$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:v,color:"grey",children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:function(){h()},children:"Add"})]})]})})}})}},75843:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var i=n(62230),r=n(85244),o=n(17064),l=n(81541),a=n(52322),s=n(7729),c=n(13980),d=n(2784),u=n(65077),f=n(12189),p=n(85513),m=n(21112),x=n(14424),h=n(40023),v=n(75289),g=n(82004),b=n(1225),y=n(58514),j=n(69114),Z=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,f=e.onSave,p=e.showHints,m=e.newField,x=e.renderHintBase,I=e.isRepeatable,C=e.testId,k=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.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":C,sx:{paddingInline:"16px !important"},children:[t.map(function(e,t){var c=e.value,m=c.config,h=c.type,C=(0,j.t)(y.C,m,h);if(!C)return(0,a.jsx)(g.Z,{children:(0,a.jsxs)(v.xv,{children:['Field type "',h,'" not supported']})});var S={item:e,index:t,tabId:o,widget:C,showHints:p,key:e.key,enterSelectMode:s,renderFieldAccessor:d,enterEditMode:l,parentSnapshot:n,deleteItem:u,saveItem:f,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:k,testId:"list-item-".concat(e.key)},w=(0,a.jsx)(Z.Z,{item:e,show:p,isRepeatable:I,renderHintBase:x,hintItemName:C.hintItemName,Widgets:y.C,typeName:C.CUSTOM_NAME||C.TYPE_NAME});if(C.CustomListItem){var F=C.CustomListItem;return(0,a.jsx)(F,(0,r.Z)((0,i.Z)({},S),{HintElement:w}))}return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:w}))}),e.placeholder,m]}))}})})},C=n(8033),k=n(73539),S=n.n(k),w=function(e){var t=e.zoneType,n=e.heading,i=void 0===n?"Your ".concat(t," has no fields yet"):n,r=e.onActionClick,o=e.actionTestId;return(0,a.jsxs)("div",{className:S().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)."})]}),(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return r()},"data-testid":o,startIcon:"add",children:"Add a field"})]})},F=function(e){var t,n,c=e.zoneType,h=e.zoneTypeFormat,v=e.tabId,g=e.title,b=e.fields,y=e.poolOfFieldsToCheck,j=e.widgetsArray,Z=e.isRepeatable,k=e.onDeleteItem,S=e.onSaveNewField,F=e.onDragEnd,E=e.EditModal,T=e.onSave,_=e.dataTip,N=e.renderHintBase,A=e.renderFieldAccessor,M=e.testId,R=e.isRepeatableCustomType,L=e.emptyStateHeading,B=e.emptyStateActionTestId,O=Object.entries(y).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?j.filter(function(e){return"UID"!==e.TYPE_NAME}):j,V=(0,d.useState)(!1),q=V[0],z=V[1],D=(0,d.useState)({isOpen:!1}),P=D[0],H=D[1],J=(0,d.useState)({isOpen:!1}),W=J[0],G=J[1],U=(0,d.useState)(null),$=U[0],Y=U[1],K=function(e){H({isOpen:!0,field:e});var t=(0,o.Z)(e,2),n=t[0],i=t[1];f.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,m.T)(window.location.pathname)})},X=function(){G({isOpen:!0})},Q=function(){H({isOpen:!1})},ee=function(){return G({isOpen:!1})},et=function(e){Y({widgetTypeName:e,fields:b}),G({isOpen:!1})},en=function(){return Y(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:b.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:z,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(Z?"Repeatable":"Static","-field"),onClick:X,startIcon:"add",color:"grey",disabled:null!==$,children:"Add a field"})]}):void 0,children:g}),0!==b.length||$?b.length>0||$?(0,a.jsx)(u.xR,{children:(0,a.jsx)(I,{tabId:v,isRepeatable:Z,fields:b,showHints:q,dataTip:_,title:g,renderFieldAccessor:A,renderHintBase:N,enterEditMode:K,enterSelectMode:X,onDragEnd:F,onDeleteItem:k,onSave:T,testId:M,isRepeatableCustomType:R,newField:$&&(0,a.jsx)(C.Z,(0,r.Z)((0,i.Z)({},$),{fields:y||b,onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];S.apply(void 0,(0,l.Z)(t)),Y(null)},onCancelNewField:en}))})}):void 0:(0,a.jsx)(w,{zoneType:(t=c,n=h,"customType"===t?"page"===n?"page type":"custom type":t),heading:L,onActionClick:function(){return X()},actionTestId:B}),(0,a.jsx)(E,{data:P,close:Q,onSave:T,fields:y,zoneType:c}),(0,a.jsx)(x.Z,{data:W,close:ee,onSelect:et,widgetsArray:O})]})};F.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 E=F},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,f=d.max,p=d.required,m=d.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(u,l),max:(0,i.MJ)(f,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 f},gc:function(){return p},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},f=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},{})},p=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,f=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 p=s[f]();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&&p[i]){p=(t=p)[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,p))},{})).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),f=n(75289),p=n(26950),m=n(79474),x=n(86163),h=n(58428),v=n(77362),g=(0,s.Z)((0,o.Z)({},h.J),{repeat:(0,v.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)(p.k,{children:[Object.entries(g).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)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(r),formField:o,fields:n,initialValues:t})},r)}),(0,l.jsx)(p.J,{children:(0,l.jsx)(f.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,l.jsxs)(f.__,{variant:"label.border",sx:{mb:0},children:[(0,l.jsx)(f.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},y={icon:c.cC1,title:"Group",description:"A repeatable set of fields"};function j(e){var t,n=e.schemaTypeRegex,i=e.customListItem,r=e.customName,o=e.hintItemName;return{Meta:y,Form:b,FormFields:g,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),I=n(81541),C=n(59050),k=n(2784),S=n(40023),w=n(28316),F=n(12189),E=n(1225),T=n(1411),_=n(14424),N=n(63928),A=n(8033),M=n(69114),R=n(63987),L=n(50535),B=n(55197),O=n(21112),V=function(e){var t=e.tabId,n=e.widget,a=e.Widgets,c=e.widgetsArray,d=e.hintBase,p=(e.parentSnapshot,e.showHints),m=e.isRepeatable,x=e.item,h=e.draggableId,v=e.saveItem,g=e.HintElement,b=(0,Z.Z)(e,["tabId","widget","Widgets","widgetsArray","hintBase","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),y=(0,k.useState)(!1),j=y[0],V=y[1],q=(0,k.useState)(null),z=q[0],D=q[1],P=(0,k.useState)({isOpen:!1}),H=P[0],J=P[1],W=function(e){D({widgetTypeName:e}),V(!1)},G=function(){D(null)},U=function(){J({isOpen:!1})},$=function(e){var t,n,o,l,s=e.id,c=e.label,d=a[e.widgetTypeName].create(c),u=(t={group:R.Fl.fromSM(x.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);v({apiId:x.key,newKey:x.key,value:R.Fl.toSM(u)}),F.Xe.track({event:"field:added",id:s,name:c,type:d.type,isInAGroup:!0,contentType:(0,O.T)(window.location.pathname)})},Y=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:R.Fl.fromSM(x.value),previousFieldId:t,newFieldId:n,field:i.type===C.GroupFieldType?R.Fl.fromSM(i):i});v({apiId:x.key,newKey:x.key,value:R.Fl.toSM(r)})},K=function(e){if(!(0,L.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:R.Fl.fromSM(x.value),sourceIndex:i,destinationIndex:r});(0,w.flushSync)(function(){v({apiId:x.key,newKey:x.key,value:R.Fl.toSM(o)})})}}},X=function(e){var t,n,i,r,o=(t={group:R.Fl.fromSM(x.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);v({apiId:x.key,newKey:x.key,value:R.Fl.toSM(o)})},Q=function(e){J({isOpen:!0,field:e});var t=(0,u.Z)(e,2),n=t[0],i=t[1];F.Xe.track({event:"field:settings-opened",id:n,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,O.T)(window.location.pathname)})};return(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(E.Z,(0,s.Z)((0,o.Z)({item:x,widget:n,draggableId:h},b),{HintElement:g,CustomEditElements:[(0,l.jsx)(f.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return V(!0)},children:"Add Field"},"custom-edit-element-".concat(x.key)),],children:(0,l.jsx)(f.xu,{sx:{ml:4},children:(0,l.jsx)(S.Z5,{onDragEnd:K,children:(0,l.jsx)(S.bK,{droppableId:"".concat(t,"-").concat(x.key,"-zone"),children:function(e){return(0,l.jsxs)("ul",(0,s.Z)((0,o.Z)({ref:e.innerRef},e.droppableProps),{children:[x.value.config.fields.map(function(e,t){var n=e.value,i=n.config,r=n.type,c=(0,M.t)(a,i,r);if(!c)return null;var u={item:e,index:t,widget:c,key:e.key,enterEditMode:Q,deleteItem:X,saveItem:Y,showHints:p,renderFieldAccessor:function(t){return"item".concat((0,B.Ti)(e.key))},draggableId:"group-".concat(x.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(x.key,"-").concat(e.key)},f=(0,l.jsx)(N.Z,{item:e,show:p,isRepeatable:m,renderHintBase:function(e){var t=e.item;return"".concat(d).concat((0,B.Ti)(t.key))},hintItemName:c.hintItemName,Widgets:a,typeName:c.CUSTOM_NAME||c.TYPE_NAME});if(c.CustomListItem){var h=c.CustomListItem;return(0,l.jsx)(h,(0,s.Z)((0,o.Z)({},u),{HintElement:f}))}return(0,l.jsx)(E.Z,(0,s.Z)((0,o.Z)({},u),{HintElement:f}))}),e.placeholder,z&&(0,l.jsx)(A.Z,(0,s.Z)((0,o.Z)({},z),{fields:x.value.config.fields||[],onSave:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];$.apply(void 0,(0,I.Z)(t)),D(null)},onCancelNewField:G}))]}))}})})})})),(0,l.jsx)(_.Z,{data:{isOpen:j},close:function(){return V(!1)},onSelect:W,widgetsArray:c}),(0,l.jsx)(T.Z,{data:H,close:U,onSave:Y,fields:x.value.config.fields})]})},q=n(8799),z={icon:q.XGl,title:"Boolean",description:"An input that is either true or false"},D={label:h.J.label,id:h.J.id,placeholder_false:(0,v.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,v.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,v.Jg)("Default to true")},P=d.object().shape({type:d.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)(D,"id"))}),H={icon:c.jqW,title:"Color",description:"A color picker"},J=(0,L.zg)("Color"),W=J.TYPE_NAME,G=J.FormFields,U=J.schema,$=n(56580),Y=n(93290),K=n(7781),X=n(34543),Q=(0,s.Z)((0,o.Z)({},h.J),{allowTargetBlank:(0,v.Jg)("Allow target blank",!1,!1)}),ee=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(p.k,{children:Object.entries(Q).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},et={icon:X.eR7,title:"Link",description:"A link to web, media or Prismic document"},en=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),ei=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:en.optional()}),er=n(36131),eo={label:h.J.label,id:h.J.id,customtypes:{validate:function(){return d.array().of(d.string())}}},el=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)(p.k,{children:[Object.entries(eo).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)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(r),formField:o,fields:i,initialValues:t})},r)}),(0,l.jsx)(p.J,{children:(0,l.jsxs)(f.xu,{sx:{mt:2,alignItems:"center"},children:[(0,l.jsx)(f.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,l.jsx)(er.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"})})}})]})})]})},ea={icon:c.I2R,title:"Content Relationship",description:"Define content relations & internal links"},es=en.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()}),ec=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:es}),ed=(0,L.zg)("Date"),eu=ed.FormFields,ef=ed.schema,ep={icon:c.f$3,title:"Date",description:"A calendar date picker"},em=(0,L.zg)("Embed"),ex=em.FormFields,eh=em.schema,ev={icon:X.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"},eg={label:h.J.label,id:h.J.id},eb=d.object().shape({type:d.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:d.object().shape({label:d.string()}).required().default(void 0).noUnknown(!0)}),ey={icon:c.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"},ej=n(63397),eZ=n(20180),eI=n(26474),eC=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)(eI.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)(k.Fragment,{children:[(0,l.jsxs)(f.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,l.jsx)(q.jnY,{size:22}),(0,l.jsx)(f.xv,{mt:1,children:a})]}),i?(0,l.jsx)(f.Ct,{onClick:i,variant:"circle-right",children:(0,l.jsx)(c.B4e,{})}):null]})}})},ek=function(e){var t=e.onClick;return(0,l.jsx)(eI.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)(f.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,l.jsx)(q.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},eS=function(e){var t=e.prefix,n=e.required,i=e.display,r=(0,u.Z)((0,ej.U$)(t),2),o=(r[0],r[1]),a=void 0!==n&&n?"*":"";return i?(0,l.jsxs)(k.Fragment,{children:[(0,l.jsx)(ew,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,l.jsx)(eF,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,l.jsx)(eF,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},ew=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,ej.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"}))},eF=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,ej.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()}}}))},eE=function(){return d.number().nullable().transform(function(e,t){return""===t?null:e})},eT={label:h.J.label,id:h.J.id,constraint:{validate:function(){return d.object().defined().shape({width:eE(),height:eE()})}},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)}}))}}},e_={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"},eA=function(e){var t=e.initialValues,n=e.values,i=e.errors,r=e.fields,a=e.touched,c=(0,k.useState)(0),d=c[0],h=c[1],v=n.config,g=v.thumbnails,b=v.constraint;return(0,k.useEffect)(function(){h(g.length)},[g.length]),(0,l.jsxs)(p.k,{children:[Object.entries(eT).map(function(e){var n=(0,u.Z)(e,2),i=n[0],o=n[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(i),formField:o,fields:r,initialValues:t})},i)}),(0,l.jsxs)(p.J,{children:[(0,l.jsx)(f.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,l.jsx)(f.Zb,{p:3,children:(0,l.jsx)(ej.F2,{name:"config.thumbnails",render:function(t){var n=t.push,r=t.remove;return(0,l.jsxs)(k.Fragment,{children:[(0,l.jsxs)(f.kC,{mb:3,children:[(0,l.jsx)(eC,{active:0===d,text:eN(b,!0),sx:{mr:2},onClick:function(){return h(0)}}),g.map(function(e,t){return(0,l.jsx)(eC,{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 h(+t+1)}},"thumbnail-button-".concat(+t+1))}),(0,l.jsx)(ek,{onClick:function(){n(e_)}})]}),(0,l.jsx)(eS,(0,s.Z)((0,o.Z)({},e),{display:0===d,prefix:"config.constraint"})),g.map(function(t,n){return(0,k.createElement)(eS,(0,s.Z)((0,o.Z)({},e),{required:!0,key:"thumbnail-".concat(+n+1),display:d===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))})]})}})})]})]})},eM=d.object().shape({type:d.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)(eT,"id"))}),eR={icon:q.jnY,title:"Image",description:"A responsive image field with constraints"},eL=(0,o.Z)({},h.J),eB=function(e){var t=e.initialValues,n=e.fields;return(0,l.jsx)(p.k,{children:Object.entries(eL).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(r),formField:o,fields:n,initialValues:t})},r)})})},eO={icon:c.x2k,title:"Link to media",description:"A link to files, document and media"},eV=en.shape({select:d.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eq=d.object().shape({type:d.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eV.optional()}),ez=n(951),eD=(0,L.zg)("Number"),eP=eD.FormFields,eH=eD.schema,eJ={icon:ez.JUs,title:"Number",description:"A number input field"},eW=n(33413),eG=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eU=function(e,t){return t?e:void 0},e$=(0,s.Z)((0,o.Z)({},h.J),{default_value:{type:eW.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,ej.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:eU,label:eG}))}},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))}}}),eY={icon:c.dzP,title:"Select",description:"A dropdown field of options for content creators."},eK=d.object().shape({type:d.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)(e$,"id"))}),eX=n(47927),eQ=n(76635),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)(X.eR7,{}))},{value:"image",label:"image",icon:e0((0,l.jsx)(X.LFN,{}))},{value:"embed",label:"embed",icon:e0((0,l.jsx)(X.xqv,{}))},{value:"list-item",label:"list",icon:e0((0,l.jsx)(X.SnF,{}))},{value:"o-list-item",label:"o",icon:e0((0,l.jsx)(q.KyO,{}))},{value:"rtl",label:"rtl",icon:e0("rtl")},],e1=e2.map(function(e){return e.value}),e3=function(e){return!e1.find(function(t){return!e.includes(t)})},e4=function(e){var t=e.split(",");return e2.reduce(function(e,n){var i=n.value;return t.includes(i)?(0,I.Z)(e).concat([i]):e},[])};function e5(e,t){return(0,eX.has)("parent",e)&&(0,eQ.isObject)(e.parent)&&(0,eX.has)(t,e.parent)&&(0,eQ.isString)(e.parent[t])?e.parent[t]:null}function e8(e){return function(){return d.string().test({name:e,message:"Options cannot be empty",test:function(t,n){var i=e5(n,e),r=e5(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 e9,e7=(0,s.Z)((0,o.Z)({},h.J),{allowTargetBlank:(0,v.Jg)("Allow target blank for links"),single:{validate:e8("single")},multi:{validate:e8("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,h=c?e4(c):d&&e4(d)||e1,v=(0,k.useState)(!c),g=v[0],b=v[1],y=(0,k.useState)(h),j=y[0],Z=y[1];return(0,k.useEffect)(function(){var e=g?1:0;a(e6[e],j.join(",")),setTimeout(function(){a(e6[1-e],void 0)},100)},[g,j]),(0,l.jsxs)(p.k,{children:[Object.entries(e7).map(function(e){var t=(0,u.Z)(e,2),i=t[0],r=t[1];return(0,l.jsx)(p.J,{children:(0,l.jsx)(m.Z,{fieldName:(0,x.lm)(i),formField:r,fields:o,initialValues:n})},i)}),(0,l.jsxs)(p.J,{children:[(0,l.jsxs)(f.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,l.jsx)(f.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(e3(j))return Z([]);Z(e1)},children:e3(j)?"Unselect All":"Select all"})]}),e2.map(function(e){return(0,l.jsx)(eI.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,I.Z)(j).concat([e.value]))}},e.value)}),(null===(t=r.config)||void 0===t?void 0:t[g?"multi":"single"])?(0,l.jsx)(f.xu,{sx:{position:"absolute"},children:(0,l.jsx)(f.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[g?"multi":"single"]})}):null]}),(0,l.jsx)(p.J,{children:(0,l.jsx)(f.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,l.jsxs)(f.__,{variant:"label.border",children:[(0,l.jsx)(f.XZ,{checked:g,onChange:function(){return b(!g)}}),"Allow multiple paragraphs"]})})})]})},tt={icon:c.BAW,title:"Rich Text",description:"A rich text field with formatting options"},tn=d.object().shape({type:d.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)((0,o.Z)({},e7,{labels:{yupType:"array",validate:{}}}),"id"))}),ti=h.J,tr=d.object().shape({type:d.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)(ti,"id"))}),to={icon:c.SQS,title:"Key Text",description:"A simple text string field"},tl=h.J,ta=d.object().shape({type:d.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.B9)(tl,"id"))}),ts={icon:c.f$3,title:"Timestamp",description:"A calendar date picker with time"},tc={label:h.J.label,id:(0,s.Z)((0,o.Z)({},h.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:h.J.placeholder},td=d.object().shape({type:d.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,x.gc)((0,L.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:z,schema:P,FormFields:D},Color:{create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:G,TYPE_NAME:W,schema:U,Meta:H},ContentRelationship:{create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:ea,schema:ec,TYPE_NAME:"Link",FormFields:eo,CUSTOM_NAME:"ContentRelationship",Form:el,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:eu,TYPE_NAME:"Date",schema:ef,Meta:ep},Embed:{create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:ex,TYPE_NAME:"Embed",schema:eh,Meta:ev},GeoPoint:{create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:eg,TYPE_NAME:"GeoPoint",schema:eb,Meta:ey},Image:{Meta:eR,Form:eA,schema:eM,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:eT,TYPE_NAME:"Image"},Link:{Meta:et,FormFields:Q,schema:ei,Form:ee,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},LinkToMedia:{Meta:eO,FormFields:eL,schema:eq,Form:eB,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:eP,TYPE_NAME:"Number",schema:eH,Meta:eJ},Select:{FormFields:e$,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:eK,Meta:eY,TYPE_NAME:"Select"},StructuredText:{create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:e1.join(",")}}},FormFields:e7,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.izl,title:"UID",description:"Unique Identifier"},schema:td,TYPE_NAME:"UID",FormFields:tc}},tf=[tu.StructuredText,tu.Image,tu.Link,tu.LinkToMedia,tu.ContentRelationship,tu.Select,tu.Boolean,tu.Date,tu.Timestamp,tu.Embed,tu.Number,tu.GeoPoint,tu.Color,tu.Text,],tp="subItem",tm=j({schemaTypeRegex:/^NestedGroup$/,customListItem:function(e){return(0,l.jsx)(V,(0,o.Z)({Widgets:tu,widgetsArray:tf,hintBase:tp},e))},customName:"NestedGroup",hintItemName:tp}),tx=(0,s.Z)((0,o.Z)({},tu),{NestedGroup:tm}),th=[tx.NestedGroup,tx.StructuredText,tx.Image,tx.Link,tx.LinkToMedia,tx.ContentRelationship,tx.Select,tx.Boolean,tx.Date,tx.Timestamp,tx.Embed,tx.Number,tx.GeoPoint,tx.Color,tx.Text,],tv="item",tg=j({schemaTypeRegex:/^Group$/,customListItem:function(e){var t,n={eligible:(null==(t=(0,a.L)("slicemachine-nested-groups"))?void 0:t.value)==="on"}.eligible?th:th.filter(function(e){return"NestedGroup"!==e.CUSTOM_NAME});return(0,l.jsx)(V,(0,o.Z)({Widgets:tx,widgetsArray:n,hintBase:tv},e))},hintItemName:tv}),tb=(0,o.Z)({Group:tg,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"}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[898],{951:function(t,c,a){a.d(c,{$iz:function(){return u},CSE:function(){return h},IEK:function(){return i},JUs:function(){return e},Ypm:function(){return g},hOO:function(){return n},sQg:function(){return v}});var r=a(68281);function n(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M864 260H728l-32.4-90.8a32.07 32.07 0 0 0-30.2-21.2H358.6c-13.5 0-25.6 8.5-30.1 21.2L296 260H160c-44.2 0-80 35.8-80 80v456c0 44.2 35.8 80 80 80h704c44.2 0 80-35.8 80-80V340c0-44.2-35.8-80-80-80zM512 716c-88.4 0-160-71.6-160-160s71.6-160 160-160 160 71.6 160 160-71.6 160-160 160zm-96-160a96 96 0 1 0 192 0 96 96 0 1 0-192 0z"}}]})(t)}function h(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"}}]})(t)}function i(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M518.3 459a8 8 0 0 0-12.6 0l-112 141.7a7.98 7.98 0 0 0 6.3 12.9h73.9V856c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V613.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 459z"}},{tag:"path",attr:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0 1 52.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 0 1-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]})(t)}function u(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 0 0 0-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 0 0 9.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]})(t)}function v(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attr:{d:"M464 688a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]})(t)}function e(t){return(0,r.w_)({tag:"svg",attr:{t:"1569683604581",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M508 280h-63.3c-3.3 0-6 2.7-6 6v340.2H433L197.4 282.6c-1.1-1.6-3-2.6-4.9-2.6H126c-3.3 0-6 2.7-6 6v464c0 3.3 2.7 6 6 6h62.7c3.3 0 6-2.7 6-6V405.1h5.7l238.2 348.3c1.1 1.6 3 2.6 5 2.6H508c3.3 0 6-2.7 6-6V286c0-3.3-2.7-6-6-6zM886 693H582c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM733.8 630c52.9 0 95.2-17.2 126.2-51.7 29.4-32.9 44-75.8 44-128.8 0-53.1-14.6-96.5-44-129.3-30.9-34.8-73.2-52.2-126.2-52.2-53.7 0-95.9 17.5-126.3 52.8-29.2 33.1-43.4 75.9-43.4 128.7 0 52.4 14.3 95.2 43.5 128.3 30.6 34.7 73 52.2 126.2 52.2z m-71.5-263.7c16.9-20.6 40.3-30.9 71.4-30.9 31.5 0 54.8 9.6 71 29.1 16.4 20.3 24.9 48.6 24.9 84.9 0 36.3-8.4 64.1-24.8 83.9-16.5 19.4-40 29.2-71.1 29.2-31.2 0-55-10.3-71.4-30.4-16.3-20.1-24.5-47.3-24.5-82.6 0.1-35.8 8.2-63 24.5-83.2z"}}]})(t)}function g(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]})(t)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[917],{8799:function(t,a,r){r.d(a,{FQA:function(){return i},KyO:function(){return c},XGl:function(){return e},iTs:function(){return l},jnY:function(){return u},vcz:function(){return h}});var n=r(68281);function l(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z"}}]})(t)}function h(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.854 4.854a.5.5 0 1 0-.708-.708l-3.5 3.5a.5.5 0 0 0 0 .708l3.5 3.5a.5.5 0 0 0 .708-.708L2.707 8l3.147-3.146zm4.292 0a.5.5 0 0 1 .708-.708l3.5 3.5a.5.5 0 0 1 0 .708l-3.5 3.5a.5.5 0 0 1-.708-.708L13.293 8l-3.147-3.146z"}}]})(t)}function u(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"}},{tag:"path",attr:{d:"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"}}]})(t)}function c(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"}},{tag:"path",attr:{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"}}]})(t)}function i(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"}}]})(t)}function e(t){return(0,n.w_)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5 3a5 5 0 0 0 0 10h6a5 5 0 0 0 0-10H5zm6 9a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"}}]})(t)}}}]);
|