slice-machine-ui 2.17.3-beta.9 → 2.18.1-alpha.dani-mcp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/404.html +1 -1
- package/out/_next/static/SYZmtCXDQQhzEqpdfRb9-/_buildManifest.js +1 -0
- package/out/_next/static/chunks/04ad993f.d7f986af0f739cc9.js +28 -0
- package/out/_next/static/chunks/248-43faecb386a16518.js +1 -0
- package/out/_next/static/chunks/{34-6c3125e6f01c62c7.js → 34-8d9d9b2944824750.js} +1 -1
- package/out/_next/static/chunks/422-c9192a1dbdd2ae0e.js +1 -0
- package/out/_next/static/chunks/489-234ed5471aa694b3.js +1 -0
- package/out/_next/static/chunks/50-586dc7ab5e584e76.js +1 -0
- package/out/_next/static/chunks/630-bb6e3db525588f16.js +1 -0
- package/out/_next/static/chunks/{647-7b9b5aa9468f9e4b.js → 647-4379a741c8d85d9e.js} +1 -1
- package/out/_next/static/chunks/{907-a42dc5698d5dc000.js → 907-445266211c48b1a5.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-13d39ac1e1c9aa27.js → _app-0d5ae0ab4cbc0245.js} +220 -222
- package/out/_next/static/chunks/pages/changelog-ba55ed247c20dc21.js +1 -0
- package/out/_next/static/chunks/pages/changes-4c23263cdc8e59c6.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-4024560ca59ad2be.js → [customTypeId]-816acb31b652239b.js} +1 -1
- package/out/_next/static/chunks/pages/labs-78ac01d97ab02cd7.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-0d2416da0958eb40.js → [pageTypeId]-669d5479e81b638b.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-0ecd552897e61e29.js → simulator-b127d948a17968d3.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-93e6cb0c4429ce10.js +1 -0
- package/out/_next/static/chunks/pages/slices-f6552e2fbc491c4d.js +1 -0
- package/out/_next/static/chunks/webpack-e0c07a2fe4908d81.js +1 -0
- package/out/_next/static/css/303dad78be1eb854.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/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 +7 -10
- package/src/apiClient.ts +1 -1
- package/src/domain/fields.ts +7 -7
- package/src/features/auth/LogoutButton.tsx +63 -0
- package/src/features/builder/AddFieldDropdown.tsx +2 -2
- package/src/features/environments/actions/getActiveEnvironment.ts +2 -8
- package/src/features/environments/useActiveEnvironment.ts +8 -1
- package/src/features/environments/useEnvironments.ts +8 -1
- package/src/features/navigation/Navigation.tsx +25 -1
- package/src/features/navigation/NavigationItem.tsx +9 -3
- package/src/features/sync/actions/pushChanges.ts +1 -0
- package/src/features/sync/getUnSyncChanges.ts +22 -4
- package/src/legacy/components/AppLayout/index.tsx +42 -2
- package/src/legacy/components/ChangesEmptyState/AuthErrorPage.tsx +2 -12
- package/src/legacy/components/ListItem/Header.tsx +18 -12
- package/src/legacy/components/ListItem/index.tsx +1 -0
- package/src/legacy/components/LoginModal/index.tsx +11 -3
- package/src/legacy/components/Navigation/Environment.tsx +2 -10
- package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +8 -0
- package/src/legacy/lib/builders/common/EditModal/index.jsx +3 -10
- package/src/legacy/lib/models/common/ModelStatus/index.ts +6 -1
- package/src/legacy/lib/models/common/widgets/Boolean/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Color/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/ContentRelationship/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Date/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Embed/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/GeoPoint/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Group/createGroupWidget.ts +2 -0
- package/src/legacy/lib/models/common/widgets/Image/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Link/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +2 -0
- package/src/legacy/lib/models/common/widgets/Number/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Select/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/StructuredText/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Table/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Text/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Timestamp/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/UID/index.ts +3 -0
- package/src/legacy/lib/models/common/widgets/Widget.ts +1 -0
- package/src/pages/changes.tsx +1 -4
- package/out/_next/static/UBLEqMkM94kXQpW0VSAQo/_buildManifest.js +0 -1
- package/out/_next/static/chunks/248-6f20227ad4764216.js +0 -1
- package/out/_next/static/chunks/33641354.3864aefb6106ae71.js +0 -28
- package/out/_next/static/chunks/385-b949173dfa03dd3e.js +0 -1
- package/out/_next/static/chunks/44-a2056f993381ad0f.js +0 -1
- package/out/_next/static/chunks/489-a42bd4eeb1350d97.js +0 -1
- package/out/_next/static/chunks/630-799c128fd87fa645.js +0 -1
- package/out/_next/static/chunks/pages/changelog-98836c22c6a40c5d.js +0 -1
- package/out/_next/static/chunks/pages/changes-2bd69f3877d60b26.js +0 -1
- package/out/_next/static/chunks/pages/labs-ad7f36c6f544c1a8.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8b6e7854cb3466d4.js +0 -1
- package/out/_next/static/chunks/pages/slices-fe1bb16ff3020762.js +0 -1
- package/out/_next/static/chunks/webpack-b3522fdebabf510a.js +0 -1
- package/out/_next/static/css/cc9b10286400c2b9.css +0 -1
- /package/out/_next/static/{UBLEqMkM94kXQpW0VSAQo → SYZmtCXDQQhzEqpdfRb9-}/_ssgManifest.js +0 -0
|
@@ -60,6 +60,7 @@ const EditModal = ({ close, data, fields, onSave, zoneType }) => {
|
|
|
60
60
|
FormFields,
|
|
61
61
|
Form: CustomForm,
|
|
62
62
|
schema: widgetSchema,
|
|
63
|
+
label: widgetLabel,
|
|
63
64
|
} = maybeWidget;
|
|
64
65
|
|
|
65
66
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -163,15 +164,7 @@ const EditModal = ({ close, data, fields, onSave, zoneType }) => {
|
|
|
163
164
|
>
|
|
164
165
|
{(props) => {
|
|
165
166
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-assignment
|
|
166
|
-
const {
|
|
167
|
-
values: {
|
|
168
|
-
id,
|
|
169
|
-
config: { label },
|
|
170
|
-
},
|
|
171
|
-
isValid,
|
|
172
|
-
isSubmitting,
|
|
173
|
-
initialValues,
|
|
174
|
-
} = props;
|
|
167
|
+
const { isValid, isSubmitting, initialValues } = props;
|
|
175
168
|
|
|
176
169
|
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
177
170
|
const fieldModelTabContent = CustomForm ? (
|
|
@@ -226,7 +219,7 @@ const EditModal = ({ close, data, fields, onSave, zoneType }) => {
|
|
|
226
219
|
<ItemHeader
|
|
227
220
|
theme={theme}
|
|
228
221
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/strict-boolean-expressions
|
|
229
|
-
text={
|
|
222
|
+
text={widgetLabel}
|
|
230
223
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
231
224
|
WidgetIcon={WidgetIcon}
|
|
232
225
|
/>
|
|
@@ -30,7 +30,12 @@ export type ChangesStatus =
|
|
|
30
30
|
| ModelStatus.New
|
|
31
31
|
| ModelStatus.Modified;
|
|
32
32
|
|
|
33
|
-
export type ChangedSlice = {
|
|
33
|
+
export type ChangedSlice = {
|
|
34
|
+
status: ChangesStatus;
|
|
35
|
+
slice: ComponentUI;
|
|
36
|
+
/** A map of variation IDs to remote screenshot URLs. */
|
|
37
|
+
variationImageUrlMap: Record<string, string>;
|
|
38
|
+
};
|
|
34
39
|
export type ChangedCustomType = {
|
|
35
40
|
status: ChangesStatus;
|
|
36
41
|
customType: CustomTypeSM;
|
|
@@ -2,6 +2,8 @@ import { BooleanField } from "@prismicio/types-internal/lib/customtypes/widgets/
|
|
|
2
2
|
import { MdOutlineToggleOff } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { booleanField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
7
9
|
import { CheckBox, Input } from "../../../../forms/fields";
|
|
@@ -68,4 +70,5 @@ export const BooleanWidget: Widget<BooleanField, typeof schema> = {
|
|
|
68
70
|
Meta,
|
|
69
71
|
schema,
|
|
70
72
|
FormFields,
|
|
73
|
+
label: booleanField.name,
|
|
71
74
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Color } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
2
|
import { MdOutlineColorLens } from "react-icons/md";
|
|
3
3
|
|
|
4
|
+
import { colorField } from "@/domain/fields";
|
|
5
|
+
|
|
4
6
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
7
|
import { Widget } from "../Widget";
|
|
6
8
|
|
|
@@ -31,4 +33,5 @@ export const ColorWidget: Widget<Color, typeof schema> = {
|
|
|
31
33
|
TYPE_NAME,
|
|
32
34
|
schema,
|
|
33
35
|
Meta,
|
|
36
|
+
label: colorField.name,
|
|
34
37
|
};
|
|
@@ -2,6 +2,8 @@ import { Link } from "@prismicio/types-internal/lib/customtypes/widgets/nestable
|
|
|
2
2
|
import { MdSettingsEthernet } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { contentRelationshipField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { linkConfigSchema } from "../Link";
|
|
6
8
|
import { Widget } from "../Widget";
|
|
7
9
|
import Form, { FormFields } from "./Form";
|
|
@@ -102,4 +104,5 @@ export const ContentRelationshipWidget: Widget<Link, typeof schema> = {
|
|
|
102
104
|
),
|
|
103
105
|
};
|
|
104
106
|
},
|
|
107
|
+
label: contentRelationshipField.name,
|
|
105
108
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Date } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
2
|
import { MdDateRange } from "react-icons/md";
|
|
3
3
|
|
|
4
|
+
import { dateField } from "@/domain/fields";
|
|
5
|
+
|
|
4
6
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
7
|
import { Widget } from "../Widget";
|
|
6
8
|
|
|
@@ -32,4 +34,5 @@ export const DateWidget: Widget<Date, typeof schema> = {
|
|
|
32
34
|
TYPE_NAME: "Date",
|
|
33
35
|
schema,
|
|
34
36
|
Meta,
|
|
37
|
+
label: dateField.name,
|
|
35
38
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Embed } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
2
|
import { MdCode } from "react-icons/md";
|
|
3
3
|
|
|
4
|
+
import { embedField } from "@/domain/fields";
|
|
5
|
+
|
|
4
6
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
7
|
import { Widget } from "../Widget";
|
|
6
8
|
|
|
@@ -32,4 +34,5 @@ export const EmbedWidget: Widget<Embed, typeof schema> = {
|
|
|
32
34
|
TYPE_NAME: "Embed",
|
|
33
35
|
schema,
|
|
34
36
|
Meta,
|
|
37
|
+
label: embedField.name,
|
|
35
38
|
};
|
|
@@ -2,6 +2,8 @@ import { GeoPoint } from "@prismicio/types-internal/lib/customtypes/widgets/nest
|
|
|
2
2
|
import { MdOutlinePlace } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { geoPointField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
6
8
|
import { Widget } from "../Widget";
|
|
7
9
|
|
|
@@ -52,4 +54,5 @@ export const GeoPointWidget: Widget<GeoPoint, typeof schema> = {
|
|
|
52
54
|
TYPE_NAME: "GeoPoint",
|
|
53
55
|
schema,
|
|
54
56
|
Meta,
|
|
57
|
+
label: geoPointField.name,
|
|
55
58
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MdOutlineCreateNewFolder } from "react-icons/md";
|
|
2
2
|
import * as yup from "yup";
|
|
3
3
|
|
|
4
|
+
import { groupField } from "@/domain/fields";
|
|
4
5
|
import { TabField } from "@/legacy/lib/models/common/CustomType";
|
|
5
6
|
import {
|
|
6
7
|
type GroupSM,
|
|
@@ -76,5 +77,6 @@ export function createGroupWidget({
|
|
|
76
77
|
TYPE_NAME: "Group",
|
|
77
78
|
CUSTOM_NAME: customName,
|
|
78
79
|
hintItemName,
|
|
80
|
+
label: groupField.name,
|
|
79
81
|
};
|
|
80
82
|
}
|
|
@@ -2,6 +2,8 @@ import { Image } from "@prismicio/types-internal/lib/customtypes/widgets/nestabl
|
|
|
2
2
|
import { MdOutlineImage } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { imageField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { removeProp } from "../../../../utils";
|
|
7
9
|
import { Widget } from "../Widget";
|
|
@@ -55,4 +57,5 @@ export const ImageWidget: Widget<Image, typeof schema> = {
|
|
|
55
57
|
}),
|
|
56
58
|
FormFields,
|
|
57
59
|
TYPE_NAME: "Image",
|
|
60
|
+
label: imageField.name,
|
|
58
61
|
};
|
|
@@ -2,6 +2,8 @@ import { Link } from "@prismicio/types-internal/lib/customtypes";
|
|
|
2
2
|
import { MdLink } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { linkField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { Widget } from "../Widget";
|
|
6
8
|
import Form, { FormFields } from "./Form";
|
|
7
9
|
|
|
@@ -115,4 +117,5 @@ export const LinkWidget: Widget<Link, typeof schema> = {
|
|
|
115
117
|
},
|
|
116
118
|
}),
|
|
117
119
|
TYPE_NAME: "Link",
|
|
120
|
+
label: linkField.name,
|
|
118
121
|
};
|
|
@@ -2,6 +2,7 @@ import { Link } from "@prismicio/types-internal/lib/customtypes/widgets/nestable
|
|
|
2
2
|
import { MdAttachFile } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { linkToMediaField } from "@/domain/fields";
|
|
5
6
|
import { linkConfigSchema } from "@/legacy/lib/models/common/widgets/Link";
|
|
6
7
|
|
|
7
8
|
import { Widget } from "../Widget";
|
|
@@ -45,4 +46,5 @@ export const LinkToMediaWidget: Widget<Link, typeof schema> = {
|
|
|
45
46
|
}),
|
|
46
47
|
TYPE_NAME: "Link",
|
|
47
48
|
CUSTOM_NAME: "LinkToMedia",
|
|
49
|
+
label: linkToMediaField.name,
|
|
48
50
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Number as PrismicNumber } from "@prismicio/types-internal/lib/customtypes/widgets/nestable";
|
|
2
2
|
import { MdOutlinePin } from "react-icons/md";
|
|
3
3
|
|
|
4
|
+
import { numberField } from "@/domain/fields";
|
|
5
|
+
|
|
4
6
|
import { createDefaultWidgetValues } from "../../../../utils";
|
|
5
7
|
import { Widget } from "../Widget";
|
|
6
8
|
|
|
@@ -32,4 +34,5 @@ export const NumberWidget: Widget<PrismicNumber, typeof schema> = {
|
|
|
32
34
|
TYPE_NAME: "Number",
|
|
33
35
|
schema,
|
|
34
36
|
Meta,
|
|
37
|
+
label: numberField.name,
|
|
35
38
|
};
|
|
@@ -2,6 +2,8 @@ import { Select } from "@prismicio/types-internal/lib/customtypes/widgets/nestab
|
|
|
2
2
|
import { MdOutlineArrowDropDownCircle } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { selectField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { removeProp } from "../../../../utils";
|
|
7
9
|
import { Widget } from "../Widget";
|
|
@@ -45,4 +47,5 @@ export const SelectWidget: Widget<Select, typeof schema> = {
|
|
|
45
47
|
schema,
|
|
46
48
|
Meta,
|
|
47
49
|
TYPE_NAME: "Select",
|
|
50
|
+
label: selectField.name,
|
|
48
51
|
};
|
|
@@ -2,6 +2,8 @@ import { RichText } from "@prismicio/types-internal/lib/customtypes/widgets/nest
|
|
|
2
2
|
import { MdTextFields } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { richTextField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { removeProp } from "../../../../utils";
|
|
7
9
|
import { Widget } from "../Widget";
|
|
@@ -55,4 +57,5 @@ export const StructuredTextWidget: Widget<RichText, typeof schema> = {
|
|
|
55
57
|
schema,
|
|
56
58
|
TYPE_NAME: "StructuredText",
|
|
57
59
|
Form,
|
|
60
|
+
label: richTextField.name,
|
|
58
61
|
};
|
|
@@ -3,6 +3,8 @@ import { Table } from "@prismicio/types-internal/lib/customtypes/widgets/nestabl
|
|
|
3
3
|
import { FaTable } from "react-icons/fa";
|
|
4
4
|
import * as yup from "yup";
|
|
5
5
|
|
|
6
|
+
import { tableField } from "@/domain/fields";
|
|
7
|
+
|
|
6
8
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
7
9
|
import { Widget } from "../Widget";
|
|
8
10
|
|
|
@@ -49,4 +51,5 @@ export const TableWidget: Widget<Table, typeof schema> = {
|
|
|
49
51
|
TYPE_NAME: "Table",
|
|
50
52
|
schema,
|
|
51
53
|
Meta,
|
|
54
|
+
label: tableField.name,
|
|
52
55
|
};
|
|
@@ -2,6 +2,8 @@ import { Text } from "@prismicio/types-internal/lib/customtypes/widgets/nestable
|
|
|
2
2
|
import { MdTitle } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { textField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
7
9
|
/**
|
|
@@ -45,4 +47,5 @@ export const TextWidget: Widget<Text, typeof schema> = {
|
|
|
45
47
|
TYPE_NAME: "Text",
|
|
46
48
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
47
49
|
FormFields,
|
|
50
|
+
label: textField.name,
|
|
48
51
|
};
|
|
@@ -2,6 +2,8 @@ import { Timestamp } from "@prismicio/types-internal/lib/customtypes/widgets/nes
|
|
|
2
2
|
import { MdSchedule } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { timestampField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
7
9
|
/** {
|
|
@@ -43,4 +45,5 @@ export const TimestampWidget: Widget<Timestamp, typeof schema> = {
|
|
|
43
45
|
FormFields,
|
|
44
46
|
TYPE_NAME: "Timestamp",
|
|
45
47
|
Meta,
|
|
48
|
+
label: timestampField.name,
|
|
46
49
|
};
|
|
@@ -2,6 +2,8 @@ import { UID } from "@prismicio/types-internal/lib/customtypes/widgets";
|
|
|
2
2
|
import { MdTag } from "react-icons/md";
|
|
3
3
|
import * as yup from "yup";
|
|
4
4
|
|
|
5
|
+
import { uidField } from "@/domain/fields";
|
|
6
|
+
|
|
5
7
|
import { createValidationSchema } from "../../../../forms";
|
|
6
8
|
import { DefaultFields } from "../../../../forms/defaults";
|
|
7
9
|
/**
|
|
@@ -50,4 +52,5 @@ export const UIDWidget: Widget<UID, typeof schema> = {
|
|
|
50
52
|
schema,
|
|
51
53
|
TYPE_NAME: "UID",
|
|
52
54
|
FormFields,
|
|
55
|
+
label: uidField.name,
|
|
53
56
|
};
|
|
@@ -24,6 +24,7 @@ interface WidgetBase<F extends TabField, S extends AnyObjectSchema> {
|
|
|
24
24
|
customTypes: LocalOnlyCustomType[],
|
|
25
25
|
initialValues: F["config"],
|
|
26
26
|
) => F["config"];
|
|
27
|
+
label: string;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export type Widget<F extends TabField, S extends AnyObjectSchema> = F extends
|
package/src/pages/changes.tsx
CHANGED
|
@@ -114,10 +114,7 @@ const Changes: React.FunctionComponent = () => {
|
|
|
114
114
|
if (!isOnline) {
|
|
115
115
|
return <OfflinePage />;
|
|
116
116
|
}
|
|
117
|
-
if (
|
|
118
|
-
authStatus === AuthStatus.UNAUTHORIZED ||
|
|
119
|
-
authStatus === AuthStatus.FORBIDDEN
|
|
120
|
-
) {
|
|
117
|
+
if (authStatus === AuthStatus.FORBIDDEN) {
|
|
121
118
|
return <AuthErrorPage authStatus={authStatus} />;
|
|
122
119
|
}
|
|
123
120
|
if (numberOfChanges === 0) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,b,f,d,n,u,h,l,k,j,p,g,o,r,m){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,e,p,g,"static/chunks/pages/index-0d8cb369de720a35.js"],"/_error":["static/chunks/pages/_error-fedd2c6ebd3d27b9.js"],"/changelog":[c,t,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-98836c22c6a40c5d.js"],"/changes":[c,i,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-fa4f2563cb5fd014.js",a,f,"static/css/d98ebc475f8423a3.css","static/chunks/pages/changes-2bd69f3877d60b26.js"],"/custom-types":[s,e,p,g,"static/chunks/pages/custom-types-5acd56959b60346f.js"],"/custom-types/[customTypeId]":[c,d,n,u,h,s,t,b,l,o,a,e,k,j,r,m,"static/chunks/pages/custom-types/[customTypeId]-4024560ca59ad2be.js"],"/labs":["static/chunks/pages/labs-ad7f36c6f544c1a8.js"],"/page-types/[pageTypeId]":[c,d,n,u,h,s,t,b,l,o,a,e,k,j,r,m,"static/chunks/pages/page-types/[pageTypeId]-0d2416da0958eb40.js"],"/slices":[c,i,s,b,a,f,j,"static/css/efa5152b7c0f35c0.css","static/chunks/pages/slices-fe1bb16ff3020762.js"],"/slices/[lib]/[sliceName]/[variation]":[c,i,d,n,u,h,s,t,b,l,a,k,f,"static/css/cdee5b195444f185.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8b6e7854cb3466d4.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[i,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/157-54b8336d20b41933.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-0ecd552897e61e29.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/397-e6c340070a3bcb41.js","static/chunks/59b4e022-ef680789f7cc9b11.js","static/chunks/34-6c3125e6f01c62c7.js","static/chunks/647-7b9b5aa9468f9e4b.js","static/chunks/183-4ea255b867ff171b.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/44-a2056f993381ad0f.js","static/chunks/658-8231c0b729e0124a.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-480e426e4b1cfef3.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/349-7118116b93278f73.js","static/chunks/630-799c128fd87fa645.js","static/chunks/907-a42dc5698d5dc000.js","static/chunks/248-6f20227ad4764216.js","static/css/4e475d945cf8a890.css","static/chunks/385-b949173dfa03dd3e.js","static/chunks/489-a42bd4eeb1350d97.js","static/css/56f2a6684a524374.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[248],{72641:function(e,t,n){"use strict";n.d(t,{R$:function(){return i},Qj:function(){return x},T9:function(){return d},nf:function(){return h},u2:function(){return o},_T:function(){return u}});var l=n(52322),r=n(56803),a=n(6277),s=n(83478),c=n.n(s);let i=e=>{let{backgroundImage:t,style:n,...r}=e,s=void 0!==t;return(0,l.jsx)("article",{...r,className:(0,a.W)(c().root,{[c().withBackground]:s}),style:{backgroundImage:s?"url(".concat(t,")"):void 0,...n}})},o=e=>(0,l.jsx)("div",{...e,className:c().image}),d=e=>(0,l.jsx)("div",{...e,className:c().content}),u=e=>(0,l.jsx)(r.bL,{...e,variant:"h3"}),h=e=>(0,l.jsx)(r.bL,{...e,color:"grey11"}),x=e=>(0,l.jsx)("div",{...e,className:c().actions,color:"grey"})},38241:function(e,t,n){"use strict";n.d(t,{F:function(){return O}});var l=n(52322),r=n(56803),a=n(97729),s=n.n(a),c=n(2784),i=n(43388),o=n(17378),d=n(98564),u=n(4790),h=n(5632),x=n(56580),m=n(75289),p=n(77630),j=n(88932),g=n(94160),b=n(39204);async function f(e){let{id:t,label:n,repeatable:l,format:r,onSuccess:a}=e,s=d.$[r],c=(0,p.Ue)({id:t,label:n,repeatable:l,format:r});try{let{errors:e}=await (0,g.KA)({customType:c});if(e.length>0)throw e;g.Xe.track({event:"custom-type:created",id:c.id,name:n,format:r,type:l?"repeatable":"single",origin:"table"}),await a(c),j.Am.success((0,b.GX)({message:"".concat(s.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(c.id,"/index.json")}))}catch(t){let e="Internal Error: ".concat(s.name({start:!0,plural:!1})," not saved");console.error(e,t),j.Am.error(e)}}var v=n(59294),_=n(98250),S=n(68968),y=n(59532),C=n(7974),k=n(358),w=n(78254),L=n(54597),I=n(46999),R=n(63397);let B=e=>{let{selected:t,...n}=e;return(0,l.jsx)(m.kC,{sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:t?e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}:"none","&:hover":{boxShadow:e=>{var t;return"0 0 0 2px ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.primary))}}},...n})},N=e=>{let{format:t}=e,[n,,r]=(0,R.U$)("repeatable"),a=d.$[t];return(0,l.jsxs)(m.xu,{mb:2,children:[(0,l.jsxs)(B,{selected:n.value,onClick:()=>r.setValue(!0),children:[(0,l.jsx)(m.Y8,{checked:n.value,onChange:()=>{},"data-testid":"repeatable-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Reusable type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintRepeatable})]})]}),(0,l.jsxs)(B,{selected:!n.value,onClick:()=>r.setValue(!1),children:[(0,l.jsx)(m.Y8,{checked:!n.value,onChange:()=>{},"data-testid":"single-type-radio-btn"}),(0,l.jsxs)(m.xu,{sx:{marginLeft:2},children:["Single type",(0,l.jsx)(m.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:a.hintSingle})]})]})]})},z=e=>{let{format:t,isCreating:n,isOpen:r,origin:a="table",onCreateChange:s,onOpenChange:i}=e,{createCustomTypeSuccess:o}=(0,L.Z)(),{completeStep:u}=(0,_.k)(),{customTypeIds:j,customTypeLabels:g}=(0,x.v9)(e=>({customTypeIds:(0,w.W6)(e),customTypeLabels:(0,w.YS)(e)})),b=d.$[t],[R,B]=(0,c.useState)(!0),{syncChanges:z}=(0,S.g)(),E=(0,h.useRouter)(),T=async e=>{let{id:n,label:l,repeatable:r}=e;s(!0),await f({format:t,id:n,label:l,origin:a,repeatable:r,onSuccess:async e=>{o(e);let t=(0,p.y6)(e),l=v.cd[t];B(!0),await E.push({pathname:l.getBuilderPagePathname(n)}),z(),"page"===t&&u("createPageType")}}),s(!1),i(!1)},G=(e,t,n)=>{n(R?{...t,label:e.target.value,id:(0,k.lV)(e.target.value)}:{...t,label:e.target.value})},D=(e,t)=>{t("id",e.target.value),B(!1)};return(0,l.jsx)(y.Z,{testId:"create-ct-modal",isOpen:r,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:()=>{i(!1),B(!0)},onSubmit:e=>{T(e)},isLoading:n,initialValues:{repeatable:!0,id:"",label:""},validate:e=>{let{id:t,label:n}=e,l={};return n&&n.length||(l.label="Cannot be empty."),!l.label&&g.includes(n)&&(l.label="".concat(b.name({start:!0,plural:!1})," name is already taken.")),["update","insert"].includes(n.toLowerCase())&&(l.label='Name "'.concat(n,'" is reserved for Slice Machine use.')),t&&t.length||(l.id="ID cannot be empty."),["update","insert"].includes(t.toLowerCase())&&(l.id='Id "'.concat(t,'" is reserved for Slice Machine use.')),l.id||!t||C.xo.exec(t)||(l.id="Invalid id: No special characters allowed."),!l.id&&t&&j.map(e=>e.toLowerCase()).includes(t)&&(l.id='ID "'.concat(t,'" exists already.')),Object.keys(l).length>0?l:void 0},content:{title:"Create a new ".concat(b.name({start:!1,plural:!1}))},children:e=>{let{errors:n,setValues:r,setFieldValue:a,values:s,touched:c}=e;return(0,l.jsxs)(m.xu,{children:[(0,l.jsx)(N,{format:t}),(0,l.jsx)(I.W,{name:"label",label:"".concat(b.name({start:!0,plural:!1})," Name"),testId:"ct-name-input",placeholder:"A display name for the ".concat(b.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:e=>G(e,s,r)}),(0,l.jsx)(I.W,{name:"id",testId:"ct-id-input",label:"".concat(b.name({start:!0,plural:!1})," ID"),placeholder:b.inputPlaceholder,error:c.id?n.id:void 0,onChange:e=>D(e,a)})]})}})};var E=n(72641);let T=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc"}),(0,l.jsx)("path",{d:"m10.0912 8c-2.8118 0-5.0912 2.2794-5.0912 5.0912s2.2794 5.0912 5.0912 5.0912c1.8851 0 3.5303-1.0247 4.4098-2.5452.1553-.2684.2868-.5523.3916-.8489.092-.2604-.0444-.5461-.3048-.6381-.2603-.092-.546.0445-.638.3048-.0841.238-.1897.4659-.3144.6815-.7081 1.2241-2.0305 2.0459-3.5442 2.0459-2.2595 0-4.0912-1.8317-4.0912-4.0912s1.8317-4.0912 4.0912-4.0912c1.3566 0 2.5595.66 3.3043 1.6782h-1.7739c-.2761 0-.5.2239-.5.5 0 .2762.2239.5.5.5h2.6782c.2762 0 .5-.2238.5-.5v-2.6782c0-.2761-.2238-.5-.5-.5-.2761 0-.5.2239-.5.5v1.1032c-.9281-.9865-2.2462-1.6032-3.7086-1.6032z",fill:"#fff"})]}),G=e=>(0,l.jsxs)("svg",{viewBox:"0 0 20 24",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,l.jsx)("path",{d:"m2 24h16c1.1046 0 2-.8954 2-2v-17l-5-5h-13c-1.10457 0-2 .89543-2 2v20c0 1.1046.89543 2 2 2z",fill:"#6e56cf",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m17 5h3l-5-5v3c0 1.10457.8954 2 2 2z",fill:"#9e8cfc",fillRule:"nonzero"}),(0,l.jsx)("path",{d:"m8.0869 10.6818.5758-2.3031c.0556-.2226.2556-.3787.485-.3787.3253 0 .564.3057.4851.6213l-.5151 2.0605h2.6055l.5758-2.3031c.0557-.2226.2557-.3787.4851-.3787.3253 0 .564.3057.4851.6213l-.5152 2.0605h2.246c.2761 0 .5.2239.5.5 0 .2762-.2239.5-.5.5h-2.496l-.6591 2.6364h2.1551c.2761 0 .5.2238.5.5 0 .2761-.2239.5-.5.5h-2.4051l-.5757 2.3031c-.0557.2226-.2557.3787-.4851.3787-.3253 0-.564-.3057-.4851-.6213l.5152-2.0605h-2.6056l-.5758 2.3031c-.0556.2226-.2556.3787-.4851.3787-.3253 0-.5639-.3057-.485-.6213l.5151-2.0605h-1.9278c-.2761 0-.5-.2239-.5-.5 0-.2762.2239-.5.5-.5h2.1778l.6591-2.6364h-1.8369c-.2761 0-.5-.2238-.5-.5 0-.2761.2239-.5.5-.5zm2.7273 3.6364.659-2.6364h-2.6055l-.6591 2.6364z",fill:"#fff"})]});var D=n(60867),P=n(50477),W=n(94840),A=n(16442);let $=e=>{let{format:t,isCreatingCustomType:n,openCreateCustomTypeModal:a}=e,s=(0,h.useRouter)(),{customTypes:i,updateCustomTypes:o}=(0,P.xU)(t),u=i.sort((e,t)=>e.id.localeCompare(t.id)),m=v.cd[t],p=d.$[t];return(!function(e,t,n){let{storeCustomTypes:l}=(0,x.v9)(e=>({storeCustomTypes:(0,w.Ch)(e).filter(A.TG)}));(0,c.useEffect)(()=>{let r=l.filter(e=>{let{local:n}=e;return n.format===t});(r.length!==e.length||r.some(t=>{let n=e.find(e=>e.id===t.local.id);return!n||JSON.stringify(W.Dc.fromSM(t.local))!==JSON.stringify(n)}))&&n(r.map(e=>{let{local:t}=e;return W.Dc.fromSM(t)}))},[t,n,e,l])}(i,t,o),0===u.length)?(0,l.jsxs)(E.R$,{"data-testid":"blank-slate",style:{alignSelf:"center",marginTop:r.t.space[72]},children:[(0,l.jsx)(E.u2,{children:(0,l.jsx)(r.a_,{src:m.blankSlateImage,sizing:"cover"})}),(0,l.jsxs)(E.T9,{children:[(0,l.jsx)(E._T,{children:p.name({start:!0,plural:!0})}),(0,l.jsx)(E.nf,{children:p.blankSlateDescription}),(0,l.jsx)(E.Qj,{children:(0,l.jsx)(r.E,{onClick:a,loading:n,children:"Create"})})]})]}):(0,l.jsx)("div",{children:(0,l.jsxs)(r.bE,{columnLayout:"28px 1fr 1fr 1fr 42px",children:[(0,l.jsx)(r.bH,{children:(0,l.jsxs)(r.bI,{children:[(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.aX,{name:"notes",size:"medium"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Label"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"API ID"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",variant:"small",children:"Limit"})}),(0,l.jsx)(r.bG,{})]})}),(0,l.jsx)(r.bF,{children:u.map(e=>{let{repeatable:n,label:a,id:c}=e;return(0,l.jsxs)(r.bI,{onClick:()=>{s.push(v.cd[t].getBuilderPagePathname(c))},children:[(0,l.jsx)(r.bG,{children:n?(0,l.jsx)(T,{width:r.t.space[20]}):(0,l.jsx)(G,{width:r.t.space[20]})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{variant:"bold",noWrap:!0,children:a})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:c})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(r.bL,{color:"grey11",noWrap:!0,children:n?"Reusable":"Single"})}),(0,l.jsx)(r.bG,{children:(0,l.jsx)(D._,{isChangesLocal:!1,format:t,customType:e})})]},c)})})]})})},O=e=>{let{format:t}=e,n=d.$[t],[a,h]=(0,c.useState)(!1),[x,m]=(0,c.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s(),{children:(0,l.jsxs)("title",{children:[n.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,l.jsx)(o.S,{renderError:()=>(0,l.jsx)(u.LN,{children:(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.D,{alignItems:"center",justifyContent:"center",children:(0,l.jsx)(r.ax,{title:"Request failed",description:"An error occurred while fetching your ".concat(n.name({start:!1,plural:!0}),".")})})})}),children:(0,l.jsx)(c.Suspense,{fallback:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsx)(r.bg,{})})]}),children:(0,l.jsxs)(u.LN,{children:[(0,l.jsxs)(u.wd,{children:[(0,l.jsx)(u.Cx,{children:(0,l.jsx)(i.g,{children:n.name({start:!0,plural:!0})})}),(0,l.jsx)(u.K2,{children:(0,l.jsx)(r.E,{"data-testid":"create-ct",loading:a,onClick:()=>{m(!0)},startIcon:"add",children:"Create"})})]}),(0,l.jsx)(u.RN,{children:(0,l.jsxs)(r.D,{flexDirection:"column",children:[(0,l.jsx)($,{format:t,isCreatingCustomType:a,openCreateCustomTypeModal:()=>{m(!0)}}),(0,l.jsx)(z,{format:t,isCreating:a,isOpen:x,onCreateChange:h,onOpenChange:m})]})})]})})})]})}},30527:function(e,t,n){"use strict";n.d(t,{Z:function(){return o},W:function(){return i}});var l=n(52322),r=n(2784),a=n(75289);let s=e=>{let{bg:t,background:n,sx:r,withRadius:s,radius:c,children:i}=e;return(0,l.jsx)(a.xu,{sx:{p:4,bg:t||n,...s?{borderBottomLeftRadius:c,borderBottomRightRadius:c}:null,...r},children:i})},c=(0,r.createContext)("6px"),i=()=>(0,r.useContext)(c),o=e=>{let{Header:t=null,SubHeader:n=null,Body:r=null,Footer:i=null,borderFooter:o=!1,radius:d="6px",bodySx:u={},footerSx:h={},sx:x=null,bg:m,background:p,children:j,...g}=e;return(0,l.jsx)(c.Provider,{value:d,children:(0,l.jsxs)(a.Zb,{sx:{border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))},borderRadius:d,...x},...g,children:[t||null,n||null,(0,l.jsxs)(s,{bg:m,background:p,sx:u,withRadius:!i,children:[r?(0,l.jsx)(r,{}):null,j||null]}),i?(0,l.jsx)(s,{bg:m,background:p,sx:{...o?{borderTop:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}}:null,...h},radius:d,withRadius:!0,children:"object"==typeof i?i:(0,l.jsx)(i,{})}):null]})})}},7974:function(e,t,n){"use strict";n.d(t,{Sn:function(){return c},lS:function(){return l},nG:function(){return r},pq:function(){return i},rd:function(){return s},xo:function(){return a}});let l=["components","update","insert"],r=["png","jpg","jpeg"],a=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,s="placeholders/What_are_Slices_mrvome",c="SM_HELP_VIDEOS/mock_data",i="slice-machine-simulator"},83478:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);
|