slice-machine-ui 2.17.3-beta.8 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/by9lqJyIeSCZtBP_fLO45/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/04ad993f.d7f986af0f739cc9.js +28 -0
  4. package/out/_next/static/chunks/{248-6f20227ad4764216.js → 248-bdbfde18c5a04eae.js} +1 -1
  5. package/out/_next/static/chunks/{34-6c3125e6f01c62c7.js → 34-8d9d9b2944824750.js} +1 -1
  6. package/out/_next/static/chunks/489-6edb99e269996dd1.js +1 -0
  7. package/out/_next/static/chunks/50-586dc7ab5e584e76.js +1 -0
  8. package/out/_next/static/chunks/630-bb6e3db525588f16.js +1 -0
  9. package/out/_next/static/chunks/{647-7b9b5aa9468f9e4b.js → 647-4379a741c8d85d9e.js} +1 -1
  10. package/out/_next/static/chunks/907-445266211c48b1a5.js +1 -0
  11. package/out/_next/static/chunks/pages/{_app-87bfdef015dea569.js → _app-76c43bdc0320687e.js} +220 -222
  12. package/out/_next/static/chunks/pages/{changelog-98836c22c6a40c5d.js → changelog-21b960abba5abf71.js} +1 -1
  13. package/out/_next/static/chunks/pages/changes-bdfa50eadb1e5a42.js +1 -0
  14. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-4024560ca59ad2be.js → [customTypeId]-7102c23f96cd1768.js} +1 -1
  15. package/out/_next/static/chunks/pages/{labs-ad7f36c6f544c1a8.js → labs-d79597003a1ff74e.js} +1 -1
  16. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-0d2416da0958eb40.js → [pageTypeId]-d4bc920a5efffa0a.js} +1 -1
  17. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-b127d948a17968d3.js +1 -0
  18. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-98f85d5fb8d5c704.js +1 -0
  19. package/out/_next/static/chunks/pages/slices-046e5e978ffc3a42.js +1 -0
  20. package/out/_next/static/chunks/webpack-e0c07a2fe4908d81.js +1 -0
  21. package/out/_next/static/css/303dad78be1eb854.css +1 -0
  22. package/out/changelog.html +1 -1
  23. package/out/changes.html +1 -1
  24. package/out/custom-types/[customTypeId].html +1 -1
  25. package/out/custom-types.html +1 -1
  26. package/out/index.html +1 -1
  27. package/out/labs.html +1 -1
  28. package/out/page-types/[pageTypeId].html +1 -1
  29. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  30. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  31. package/out/slices.html +1 -1
  32. package/package.json +7 -8
  33. package/src/apiClient.ts +1 -1
  34. package/src/domain/fields.ts +7 -7
  35. package/src/features/auth/LogoutButton.tsx +37 -0
  36. package/src/features/builder/AddFieldDropdown.tsx +2 -2
  37. package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +8 -21
  38. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -12
  39. package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +5 -11
  40. package/src/features/environments/actions/getActiveEnvironment.ts +2 -8
  41. package/src/features/environments/useActiveEnvironment.ts +8 -1
  42. package/src/features/environments/useEnvironments.ts +8 -1
  43. package/src/features/navigation/Navigation.tsx +1 -7
  44. package/src/legacy/components/ChangesItems/ChangesItems.tsx +1 -8
  45. package/src/legacy/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -8
  46. package/src/legacy/components/ListItem/Header.tsx +18 -12
  47. package/src/legacy/components/ListItem/index.tsx +1 -0
  48. package/src/legacy/components/LoginModal/index.tsx +11 -3
  49. package/src/legacy/components/Navigation/SideNavEnvironmentSelector/SideNavEnvironmentSelector.tsx +3 -0
  50. package/src/legacy/components/Simulator/components/FailedConnect/index.tsx +51 -56
  51. package/src/legacy/components/ToasterContainer/index.tsx +3 -14
  52. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +1 -4
  53. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -5
  54. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +4 -16
  55. package/src/legacy/lib/builders/SliceBuilder/index.tsx +1 -6
  56. package/src/legacy/lib/builders/common/EditModal/index.jsx +3 -10
  57. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +5 -10
  58. package/src/legacy/lib/models/common/widgets/Boolean/index.ts +3 -0
  59. package/src/legacy/lib/models/common/widgets/Color/index.ts +3 -0
  60. package/src/legacy/lib/models/common/widgets/ContentRelationship/index.ts +3 -0
  61. package/src/legacy/lib/models/common/widgets/Date/index.ts +3 -0
  62. package/src/legacy/lib/models/common/widgets/Embed/index.ts +3 -0
  63. package/src/legacy/lib/models/common/widgets/GeoPoint/index.ts +3 -0
  64. package/src/legacy/lib/models/common/widgets/Group/createGroupWidget.ts +2 -0
  65. package/src/legacy/lib/models/common/widgets/Image/index.ts +3 -0
  66. package/src/legacy/lib/models/common/widgets/Link/index.ts +3 -0
  67. package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +2 -0
  68. package/src/legacy/lib/models/common/widgets/Number/index.ts +3 -0
  69. package/src/legacy/lib/models/common/widgets/Select/index.ts +3 -0
  70. package/src/legacy/lib/models/common/widgets/StructuredText/index.ts +3 -0
  71. package/src/legacy/lib/models/common/widgets/Table/index.ts +3 -0
  72. package/src/legacy/lib/models/common/widgets/Text/index.ts +3 -0
  73. package/src/legacy/lib/models/common/widgets/Timestamp/index.ts +3 -0
  74. package/src/legacy/lib/models/common/widgets/UID/index.ts +3 -0
  75. package/src/legacy/lib/models/common/widgets/Widget.ts +1 -0
  76. package/src/pages/slices.tsx +10 -38
  77. package/out/_next/static/KBrx-cAqXdE6ViRC7yyKz/_buildManifest.js +0 -1
  78. package/out/_next/static/chunks/33641354.3864aefb6106ae71.js +0 -28
  79. package/out/_next/static/chunks/44-a2056f993381ad0f.js +0 -1
  80. package/out/_next/static/chunks/489-6578dbeec3dcdace.js +0 -1
  81. package/out/_next/static/chunks/630-29c729ad2a291ef6.js +0 -1
  82. package/out/_next/static/chunks/907-590c914f55547b96.js +0 -1
  83. package/out/_next/static/chunks/pages/changes-db800bf4a08faa31.js +0 -1
  84. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js +0 -1
  85. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-0bc862dd7bd99611.js +0 -1
  86. package/out/_next/static/chunks/pages/slices-4b229ae47d0a37e2.js +0 -1
  87. package/out/_next/static/chunks/webpack-b3522fdebabf510a.js +0 -1
  88. package/out/_next/static/css/cc9b10286400c2b9.css +0 -1
  89. package/src/features/builder/useSectionsNamingExperiment.ts +0 -15
  90. package/src/utils/textConversion.ts +0 -11
  91. /package/out/_next/static/{KBrx-cAqXdE6ViRC7yyKz → by9lqJyIeSCZtBP_fLO45}/_ssgManifest.js +0 -0
@@ -1,71 +1,66 @@
1
1
  import { IoMdRefresh } from "react-icons/io";
2
2
  import { Image, Link, Text } from "theme-ui";
3
3
 
4
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
5
4
  import { Button } from "@/legacy/components/Button";
6
5
 
7
6
  import FullPage from "../FullPage";
8
7
 
9
- const FailedConnect = ({ onRetrigger }: { onRetrigger: () => void }) => {
10
- const sectionsNamingExperiment = useSectionsNamingExperiment();
11
-
12
- return (
13
- <FullPage>
14
- <Image src="/iframe-not-running.png" sx={{ width: "320px" }} />
8
+ const FailedConnect = ({ onRetrigger }: { onRetrigger: () => void }) => (
9
+ <FullPage>
10
+ <Image src="/iframe-not-running.png" sx={{ width: "320px" }} />
11
+ <Text
12
+ sx={{
13
+ color: "textClear",
14
+ mb: 2,
15
+ fontSize: "14px",
16
+ lineHeight: "24px",
17
+ fontWeight: "600",
18
+ }}
19
+ >
20
+ Slice Machine can't render your slice
21
+ </Text>
22
+ <Text
23
+ sx={{
24
+ color: "failedConnectText",
25
+ maxWidth: "400px",
26
+ textAlign: "center",
27
+ fontSize: "12px",
28
+ lineHeight: "22px",
29
+ }}
30
+ >
31
+ Ensure your website's development server is running by typing
32
+ <br />
15
33
  <Text
16
- sx={{
17
- color: "textClear",
18
- mb: 2,
19
- fontSize: "14px",
20
- lineHeight: "24px",
21
- fontWeight: "600",
22
- }}
34
+ as="code"
35
+ variant="styles.inlineCode"
36
+ sx={{ padding: "4px", borderRadius: "6px" }}
23
37
  >
24
- Slice Machine can't render your {sectionsNamingExperiment.value}
38
+ npm run dev
25
39
  </Text>
26
- <Text
40
+ &nbsp; in your terminal at the root of your website directory.
41
+ <br /> If that doesn't work, see the&nbsp;
42
+ <Link
43
+ target="_blank"
44
+ href="https://prismic.io/docs/slice-machine#simulate-slices"
27
45
  sx={{
28
- color: "failedConnectText",
29
- maxWidth: "400px",
30
- textAlign: "center",
31
- fontSize: "12px",
32
- lineHeight: "22px",
46
+ color: "link",
33
47
  }}
34
48
  >
35
- Ensure your website's development server is running by typing
36
- <br />
37
- <Text
38
- as="code"
39
- variant="styles.inlineCode"
40
- sx={{ padding: "4px", borderRadius: "6px" }}
41
- >
42
- npm run dev
43
- </Text>
44
- &nbsp; in your terminal at the root of your website directory.
45
- <br /> If that doesn't work, see the&nbsp;
46
- <Link
47
- target="_blank"
48
- href="https://prismic.io/docs/slice-machine#simulate-slices"
49
- sx={{
50
- color: "link",
51
- }}
52
- >
53
- troubleshooting instructions.
54
- </Link>
55
- </Text>
56
- <Button
57
- onClick={onRetrigger}
58
- label="Refresh"
59
- Icon={IoMdRefresh}
60
- iconSize={20}
61
- iconFill="#6F6E77"
62
- variant="secondaryMedium"
63
- sx={{
64
- mt: "16px",
65
- }}
66
- />
67
- </FullPage>
68
- );
69
- };
49
+ troubleshooting instructions.
50
+ </Link>
51
+ </Text>
52
+ <Button
53
+ onClick={onRetrigger}
54
+ label="Refresh"
55
+ Icon={IoMdRefresh}
56
+ iconSize={20}
57
+ iconFill="#6F6E77"
58
+ variant="secondaryMedium"
59
+ sx={{
60
+ mt: "16px",
61
+ }}
62
+ />
63
+ </FullPage>
64
+ );
70
65
 
71
66
  export default FailedConnect;
@@ -7,9 +7,6 @@ import {
7
7
  TypeOptions,
8
8
  } from "react-toastify";
9
9
 
10
- import { UseSectionsNamingExperimentReturnType } from "@/features/builder/useSectionsNamingExperiment";
11
- import { capitalizeFirstLetter } from "@/utils/textConversion";
12
-
13
10
  const getIconAccordingToasterType = ({
14
11
  type,
15
12
  }: {
@@ -70,14 +67,6 @@ export const ToastMessageWithPath: React.FC<{
70
67
 
71
68
  export const SliceToastMessage: React.FC<{
72
69
  path: string;
73
- sectionsNamingExperiment: UseSectionsNamingExperimentReturnType;
74
- }> = (props) => {
75
- return (
76
- <ToastMessageWithPath
77
- message={`${capitalizeFirstLetter(
78
- props.sectionsNamingExperiment.value,
79
- )} saved successfully at `}
80
- {...props}
81
- />
82
- );
83
- };
70
+ }> = (props) => (
71
+ <ToastMessageWithPath message="Slice saved successfully at " {...props} />
72
+ );
@@ -3,7 +3,6 @@ import { FC } from "react";
3
3
  import { Text } from "theme-ui";
4
4
 
5
5
  import { getState } from "@/apiClient";
6
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
7
6
  import { createSlicesTemplates } from "@/features/slicesTemplates/actions/createSlicesTemplates";
8
7
  import { SliceTemplate } from "@/features/slicesTemplates/useSlicesTemplates";
9
8
  import ModalFormCard from "@/legacy/components/ModalFormCard";
@@ -12,7 +11,6 @@ import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
12
11
  import { Slices } from "@/legacy/lib/models/common/Slice";
13
12
  import { managerClient } from "@/managerClient";
14
13
  import useSliceMachineActions from "@/modules/useSliceMachineActions";
15
- import { pluralize } from "@/utils/textConversion";
16
14
 
17
15
  import UpdateSliceZoneModalList from "./UpdateSliceZoneModalList";
18
16
 
@@ -38,7 +36,6 @@ export const SlicesTemplatesModal: FC<UpdateSliceModalProps> = ({
38
36
  location,
39
37
  }) => {
40
38
  const { createSliceSuccess } = useSliceMachineActions();
41
- const sectionsNamingExperiment = useSectionsNamingExperiment();
42
39
 
43
40
  return (
44
41
  <ModalFormCard
@@ -82,7 +79,7 @@ export const SlicesTemplatesModal: FC<UpdateSliceModalProps> = ({
82
79
  sliceKeys: [],
83
80
  }}
84
81
  content={{
85
- title: `Use template ${pluralize(sectionsNamingExperiment.value)}`,
82
+ title: "Use template slices",
86
83
  }}
87
84
  validate={(values) => {
88
85
  if (values.sliceKeys.length === 0) {
@@ -1,10 +1,8 @@
1
1
  import { SharedSlice } from "@prismicio/types-internal/lib/customtypes";
2
2
  import { Text } from "theme-ui";
3
3
 
4
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
5
4
  import ModalFormCard from "@/legacy/components/ModalFormCard";
6
5
  import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
7
- import { pluralize } from "@/utils/textConversion";
8
6
 
9
7
  import UpdateSliceZoneModalList from "./UpdateSliceZoneModalList";
10
8
 
@@ -25,8 +23,6 @@ const UpdateSliceZoneModal: React.FC<UpdateSliceModalProps> = ({
25
23
  onSubmit,
26
24
  availableSlices,
27
25
  }) => {
28
- const sectionsNamingExperiment = useSectionsNamingExperiment();
29
-
30
26
  return (
31
27
  <ModalFormCard
32
28
  isOpen
@@ -47,7 +43,7 @@ const UpdateSliceZoneModal: React.FC<UpdateSliceModalProps> = ({
47
43
  sliceKeys: [],
48
44
  }}
49
45
  content={{
50
- title: `Select existing ${pluralize(sectionsNamingExperiment.value)}`,
46
+ title: "Select existing slices",
51
47
  }}
52
48
  testId="update-slices-modal"
53
49
  validate={(values) => {
@@ -15,7 +15,6 @@ import { BaseStyles } from "theme-ui";
15
15
 
16
16
  import { telemetry } from "@/apiClient";
17
17
  import { ListHeader } from "@/components/List";
18
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
19
18
  import { CreateSliceFromImageModal } from "@/features/customTypes/customTypesBuilder/CreateSliceFromImageModal";
20
19
  import { useCustomTypeState } from "@/features/customTypes/customTypesBuilder/CustomTypeProvider";
21
20
  import { getSliceCreationOptions } from "@/features/customTypes/customTypesBuilder/sliceCreationOptions";
@@ -41,7 +40,6 @@ import {
41
40
  } from "@/modules/slices";
42
41
  import useSliceMachineActions from "@/modules/useSliceMachineActions";
43
42
  import type { SliceMachineStoreType } from "@/redux/type";
44
- import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
45
43
 
46
44
  import { DeleteSliceZoneModal } from "./DeleteSliceZoneModal";
47
45
  import { SlicesList } from "./List";
@@ -133,10 +131,8 @@ const SliceZone: React.FC<SliceZoneProps> = ({
133
131
  const { setCustomType } = useCustomTypeState();
134
132
  const { completeStep } = useOnboarding();
135
133
  const { openLoginModal } = useSliceMachineActions();
136
- const sectionsNamingExperiment = useSectionsNamingExperiment();
137
134
  const sliceCreationOptions = getSliceCreationOptions({
138
135
  menuType: "Dropdown",
139
- sectionsNamingExperiment,
140
136
  });
141
137
 
142
138
  const localLibraries: readonly LibraryUI[] = libraries.filter(
@@ -297,7 +293,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
297
293
  ) : undefined
298
294
  }
299
295
  >
300
- {pluralize(capitalizeFirstLetter(sectionsNamingExperiment.value))}
296
+ Slices
301
297
  </ListHeader>
302
298
 
303
299
  {sliceZone ? (
@@ -374,11 +370,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
374
370
  onSaveCallback: () => {
375
371
  toast.success(
376
372
  <ToastMessageWithPath
377
- message={`${capitalizeFirstLetter(
378
- sectionsNamingExperiment.value,
379
- )} template(s) added to ${
380
- sectionsNamingExperiment.value
381
- } zone and created at: `}
373
+ message="Slice template(s) added to slice zone and created at: "
382
374
  path={`${localLibraries[0].name}/`}
383
375
  />,
384
376
  );
@@ -414,7 +406,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
414
406
  onSaveCallback: () => {
415
407
  toast.success(
416
408
  <ToastMessageWithPath
417
- message={`New ${sectionsNamingExperiment.value} added to ${sectionsNamingExperiment.value} zone and created at: `}
409
+ message="New slice added to slice zone and created at: "
418
410
  path={`${localLibraries[0].name}/`}
419
411
  />,
420
412
  );
@@ -442,11 +434,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
442
434
  onSaveCallback: () => {
443
435
  toast.success(
444
436
  <ToastMessageWithPath
445
- message={`${capitalizeFirstLetter(
446
- sectionsNamingExperiment.value,
447
- )}(s) added to ${
448
- sectionsNamingExperiment.value
449
- } zone and created at: `}
437
+ message="Slice(s) added to slice zone and created at: "
450
438
  path={library}
451
439
  />,
452
440
  );
@@ -3,7 +3,6 @@ import { type FC } from "react";
3
3
 
4
4
  import { BreadcrumbItem } from "@/components/Breadcrumb";
5
5
  import { AutoSaveStatusIndicator } from "@/features/autoSave/AutoSaveStatusIndicator";
6
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
7
6
  import { FloatingBackButton } from "@/features/slices/sliceBuilder/FloatingBackButton";
8
7
  import { useSliceState } from "@/features/slices/sliceBuilder/SliceBuilderProvider";
9
8
  import {
@@ -15,7 +14,6 @@ import {
15
14
  AppLayoutHeader,
16
15
  } from "@/legacy/components/AppLayout";
17
16
  import SimulatorButton from "@/legacy/lib/builders/SliceBuilder/SimulatorButton";
18
- import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
19
17
 
20
18
  import FieldZones from "./FieldZones";
21
19
  import { VariationsList } from "./VariationsList";
@@ -23,7 +21,6 @@ import { VariationsList } from "./VariationsList";
23
21
  export const SliceBuilder: FC = () => {
24
22
  const { slice, actionQueueStatus } = useSliceState();
25
23
  const horizontalScroll = useMediaQuery({ max: "large" });
26
- const sectionsNamingExperiment = useSectionsNamingExperiment();
27
24
 
28
25
  const contentDisplayProps = horizontalScroll
29
26
  ? { gridTemplateRows: "304px 1fr" }
@@ -34,9 +31,7 @@ export const SliceBuilder: FC = () => {
34
31
  <AppLayoutHeader>
35
32
  <AppLayoutBackButton url="/slices" />
36
33
  <AppLayoutBreadcrumb>
37
- <BreadcrumbItem>
38
- {pluralize(capitalizeFirstLetter(sectionsNamingExperiment.value))}
39
- </BreadcrumbItem>
34
+ <BreadcrumbItem>Slices</BreadcrumbItem>
40
35
  <BreadcrumbItem active>{slice.model.name}</BreadcrumbItem>
41
36
  </AppLayoutBreadcrumb>
42
37
  <AppLayoutActions>
@@ -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={label || id}
222
+ text={widgetLabel}
230
223
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
231
224
  WidgetIcon={WidgetIcon}
232
225
  />
@@ -1,8 +1,6 @@
1
1
  import { Text } from "@prismicio/editor-ui";
2
2
  import { FC, ReactNode } from "react";
3
3
 
4
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
5
-
6
4
  import styles from "./ZoneEmptyState.module.css";
7
5
 
8
6
  type ZoneEmptyStateProps = {
@@ -12,14 +10,11 @@ type ZoneEmptyStateProps = {
12
10
  };
13
11
 
14
12
  export const ZoneEmptyState: FC<ZoneEmptyStateProps> = (props) => {
15
- const sectionsNamingExperiment = useSectionsNamingExperiment();
16
- const modifiedZoneType =
17
- props.zoneType === "slice"
18
- ? sectionsNamingExperiment.value
19
- : props.zoneType;
20
-
21
- const { heading = `Your ${modifiedZoneType} has no fields yet`, action } =
22
- props;
13
+ const {
14
+ zoneType,
15
+ heading = `Your ${zoneType} has no fields yet`,
16
+ action,
17
+ } = props;
23
18
 
24
19
  return (
25
20
  <div className={styles.root}>
@@ -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