slice-machine-ui 2.17.3-beta.7 → 2.17.3-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.
Files changed (80) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/UBLEqMkM94kXQpW0VSAQo/_buildManifest.js +1 -0
  3. package/out/_next/static/chunks/248-6f20227ad4764216.js +1 -0
  4. package/out/_next/static/chunks/489-a42bd4eeb1350d97.js +1 -0
  5. package/out/_next/static/chunks/{630-29c729ad2a291ef6.js → 630-799c128fd87fa645.js} +1 -1
  6. package/out/_next/static/chunks/907-a42dc5698d5dc000.js +1 -0
  7. package/out/_next/static/chunks/pages/{_app-df4a4d1aaa9d7216.js → _app-13d39ac1e1c9aa27.js} +1 -1
  8. package/out/_next/static/chunks/pages/changelog-98836c22c6a40c5d.js +1 -0
  9. package/out/_next/static/chunks/pages/changes-2bd69f3877d60b26.js +1 -0
  10. package/out/_next/static/chunks/pages/labs-ad7f36c6f544c1a8.js +1 -0
  11. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-0ecd552897e61e29.js +1 -0
  12. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-8b6e7854cb3466d4.js +1 -0
  13. package/out/_next/static/chunks/pages/slices-fe1bb16ff3020762.js +1 -0
  14. package/out/changelog.html +1 -1
  15. package/out/changes.html +1 -1
  16. package/out/custom-types/[customTypeId].html +1 -1
  17. package/out/custom-types.html +1 -1
  18. package/out/index.html +1 -1
  19. package/out/labs.html +1 -1
  20. package/out/page-types/[pageTypeId].html +1 -1
  21. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  22. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  23. package/out/slices.html +1 -1
  24. package/package.json +3 -3
  25. package/src/features/changes/PushChangesButton.tsx +4 -67
  26. package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +8 -21
  27. package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +4 -12
  28. package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +5 -11
  29. package/src/features/navigation/Navigation.tsx +1 -19
  30. package/src/legacy/components/ChangesItems/ChangesItems.tsx +1 -8
  31. package/src/legacy/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -8
  32. package/src/legacy/components/Simulator/components/FailedConnect/index.tsx +51 -56
  33. package/src/legacy/components/ToasterContainer/index.tsx +3 -14
  34. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +1 -4
  35. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -5
  36. package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +4 -16
  37. package/src/legacy/lib/builders/SliceBuilder/index.tsx +1 -6
  38. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +5 -10
  39. package/src/pages/slices.tsx +10 -38
  40. package/out/_next/static/chunks/248-03446cd9e9f13730.js +0 -1
  41. package/out/_next/static/chunks/489-f1d584386a1ead7e.js +0 -1
  42. package/out/_next/static/chunks/907-590c914f55547b96.js +0 -1
  43. package/out/_next/static/chunks/pages/changelog-063c5e11dfc8fd55.js +0 -1
  44. package/out/_next/static/chunks/pages/changes-564336edb0ed18b0.js +0 -1
  45. package/out/_next/static/chunks/pages/labs-9630bfb1005be02b.js +0 -1
  46. package/out/_next/static/chunks/pages/settings-01f4aeb9112a1f87.js +0 -1
  47. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js +0 -1
  48. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-bd5e45632c419567.js +0 -1
  49. package/out/_next/static/chunks/pages/slices-a0aa3bbe2cf1689c.js +0 -1
  50. package/out/_next/static/css/e5f781f20e24a5ea.css +0 -1
  51. package/out/_next/static/i3RCInXoJzCEi4NnU8YGb/_buildManifest.js +0 -1
  52. package/out/settings.html +0 -1
  53. package/src/components/FieldSet/FieldSet.module.css +0 -84
  54. package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -16
  55. package/src/components/FieldSet/FieldSet.stories.tsx +0 -244
  56. package/src/components/FieldSet/FieldSet.tsx +0 -67
  57. package/src/components/FieldSet/index.ts +0 -9
  58. package/src/features/builder/useSectionsNamingExperiment.ts +0 -15
  59. package/src/features/settings/SettingsPage.tsx +0 -50
  60. package/src/features/settings/git/ConnectGitRepository.tsx +0 -112
  61. package/src/features/settings/git/ConnectGitRepositoryBlankSlate.tsx +0 -33
  62. package/src/features/settings/git/GitOwnerSelect.tsx +0 -71
  63. package/src/features/settings/git/GitProvider.ts +0 -40
  64. package/src/features/settings/git/GitProviderConnectButtons.tsx +0 -63
  65. package/src/features/settings/git/GitRepositoriesList.tsx +0 -76
  66. package/src/features/settings/git/GitRepositoriesSearch.tsx +0 -69
  67. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +0 -97
  68. package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +0 -62
  69. package/src/features/settings/git/useGitIntegrationExperiment.ts +0 -8
  70. package/src/features/settings/git/useGitOwners.ts +0 -12
  71. package/src/features/settings/git/useGitRepos.ts +0 -24
  72. package/src/features/settings/git/useLinkedGitRepos.ts +0 -41
  73. package/src/features/settings/git/useWriteAPIToken.ts +0 -23
  74. package/src/icons/BitbucketIcon.tsx +0 -19
  75. package/src/icons/GitHubIcon.tsx +0 -17
  76. package/src/icons/GitLabIcon.tsx +0 -19
  77. package/src/icons/SettingsIcon.tsx +0 -19
  78. package/src/pages/settings.tsx +0 -1
  79. package/src/utils/textConversion.ts +0 -11
  80. /package/out/_next/static/{i3RCInXoJzCEi4NnU8YGb → UBLEqMkM94kXQpW0VSAQo}/_ssgManifest.js +0 -0
@@ -22,15 +22,10 @@ import { toast } from "react-toastify";
22
22
 
23
23
  import { getState, telemetry } from "@/apiClient";
24
24
  import { addAiFeedback } from "@/features/aiFeedback";
25
- import {
26
- useSectionsNamingExperiment,
27
- UseSectionsNamingExperimentReturnType,
28
- } from "@/features/builder/useSectionsNamingExperiment";
29
25
  import { useOnboarding } from "@/features/onboarding/useOnboarding";
30
26
  import { useAutoSync } from "@/features/sync/AutoSyncProvider";
31
27
  import { managerClient } from "@/managerClient";
32
28
  import useSliceMachineActions from "@/modules/useSliceMachineActions";
33
- import { pluralize } from "@/utils/textConversion";
34
29
 
35
30
  import { Slice, SliceCard } from "./SliceCard";
36
31
 
@@ -58,7 +53,7 @@ export function CreateSliceFromImageModal(
58
53
  const { syncChanges } = useAutoSync();
59
54
  const { createSliceSuccess } = useSliceMachineActions();
60
55
  const { completeStep } = useOnboarding();
61
- const sectionsNamingExperiment = useSectionsNamingExperiment();
56
+
62
57
  /**
63
58
  * Keeps track of the current instance id.
64
59
  * When the modal is closed, the id is reset.
@@ -244,8 +239,7 @@ export function CreateSliceFromImageModal(
244
239
  <DialogHeader title="Generate from image" />
245
240
  <DialogContent gap={0}>
246
241
  <DialogDescription hidden>
247
- Upload images to generate {pluralize(sectionsNamingExperiment.value)}{" "}
248
- with AI
242
+ Upload images to generate slices with AI
249
243
  </DialogDescription>
250
244
  {slices.length === 0 ? (
251
245
  <Box padding={16} height="100%">
@@ -285,8 +279,7 @@ export function CreateSliceFromImageModal(
285
279
  loading={isCreatingSlices}
286
280
  onClick={onSubmit}
287
281
  >
288
- {getSubmitButtonLabel({ location, sectionsNamingExperiment })} (
289
- {readySlices.length})
282
+ {getSubmitButtonLabel(location)} ({readySlices.length})
290
283
  </DialogActionButton>
291
284
  </DialogActions>
292
285
  </DialogContent>
@@ -298,7 +291,6 @@ function UploadBlankSlate(props: {
298
291
  droppingFiles?: boolean;
299
292
  onFilesSelected: (files: File[]) => void;
300
293
  }) {
301
- const sectionsNamingExperiment = useSectionsNamingExperiment();
302
294
  const { droppingFiles = false, onFilesSelected } = props;
303
295
 
304
296
  return (
@@ -320,8 +312,7 @@ function UploadBlankSlate(props: {
320
312
  />
321
313
  <BlankSlateTitle>Upload your design images.</BlankSlateTitle>
322
314
  <BlankSlateDescription>
323
- Once uploaded, you can generate{" "}
324
- {pluralize(sectionsNamingExperiment.value)} automatically using AI.
315
+ Once uploaded, you can generate slices automatically using AI.
325
316
  </BlankSlateDescription>
326
317
  <BlankSlateActions>
327
318
  <FileUploadButton
@@ -469,19 +460,15 @@ async function addSlices(newSlices: NewSlice[]) {
469
460
  return { library, slices };
470
461
  }
471
462
 
472
- const getSubmitButtonLabel = ({
473
- location,
474
- sectionsNamingExperiment,
475
- }: {
476
- location: "custom_type" | "page_type" | "slices";
477
- sectionsNamingExperiment: UseSectionsNamingExperimentReturnType;
478
- }) => {
463
+ const getSubmitButtonLabel = (
464
+ location: "custom_type" | "page_type" | "slices",
465
+ ) => {
479
466
  switch (location) {
480
467
  case "custom_type":
481
468
  return "Add to type";
482
469
  case "page_type":
483
470
  return "Add to page";
484
471
  case "slices":
485
- return `Add to ${pluralize(sectionsNamingExperiment.value)}`;
472
+ return "Add to slices";
486
473
  }
487
474
  };
@@ -9,9 +9,6 @@ import {
9
9
  } from "@prismicio/editor-ui";
10
10
  import { FC } from "react";
11
11
 
12
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
13
- import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
14
-
15
12
  import { getSliceCreationOptions } from "./sliceCreationOptions";
16
13
 
17
14
  export type SliceZoneBlankSlateProps = {
@@ -31,10 +28,8 @@ export const SliceZoneBlankSlate: FC<SliceZoneBlankSlateProps> = ({
31
28
  projectHasAvailableSlices,
32
29
  isSlicesTemplatesSupported,
33
30
  }) => {
34
- const sectionsNamingExperiment = useSectionsNamingExperiment();
35
31
  const sliceCreationOptions = getSliceCreationOptions({
36
32
  menuType: "ActionList",
37
- sectionsNamingExperiment,
38
33
  });
39
34
 
40
35
  return (
@@ -45,14 +40,11 @@ export const SliceZoneBlankSlate: FC<SliceZoneBlankSlateProps> = ({
45
40
  name="add"
46
41
  size="large"
47
42
  />
48
- <BlankSlateTitle size="big">
49
- Add {pluralize(sectionsNamingExperiment.value)}
50
- </BlankSlateTitle>
43
+ <BlankSlateTitle size="big">Add slices</BlankSlateTitle>
51
44
  <BlankSlateDescription>
52
- {pluralize(capitalizeFirstLetter(sectionsNamingExperiment.value))} are
53
- website sections that you can reuse on different pages with different
54
- content. Each on different pages with different content. Each{" "}
55
- {sectionsNamingExperiment.value} has its own component in your code.
45
+ Slices are website sections that you can reuse on different pages with
46
+ different content. Each on different pages with different content. Each{" "}
47
+ slice has its own component in your code.
56
48
  </BlankSlateDescription>
57
49
  <BlankSlateActions>
58
50
  <ActionList>
@@ -1,15 +1,11 @@
1
1
  import { BackgroundIcon } from "@prismicio/editor-ui";
2
2
 
3
- import { UseSectionsNamingExperimentReturnType } from "@/features/builder/useSectionsNamingExperiment";
4
- import { pluralize } from "@/utils/textConversion";
5
-
6
3
  type SliceCreationOptionArgs = {
7
4
  menuType: "ActionList" | "Dropdown";
8
- sectionsNamingExperiment: UseSectionsNamingExperimentReturnType;
9
5
  };
10
6
 
11
7
  export const getSliceCreationOptions = (args: SliceCreationOptionArgs) => {
12
- const { menuType, sectionsNamingExperiment } = args;
8
+ const { menuType } = args;
13
9
 
14
10
  return {
15
11
  fromImage: {
@@ -24,7 +20,7 @@ export const getSliceCreationOptions = (args: SliceCreationOptionArgs) => {
24
20
  />
25
21
  ),
26
22
  title: "Generate from image",
27
- description: `Build a ${sectionsNamingExperiment.value} based on your design image.`,
23
+ description: "Build a slice based on your design image.",
28
24
  },
29
25
  fromScratch: {
30
26
  BackgroundIcon: (
@@ -38,7 +34,7 @@ export const getSliceCreationOptions = (args: SliceCreationOptionArgs) => {
38
34
  />
39
35
  ),
40
36
  title: "Start from scratch",
41
- description: `Build a custom ${sectionsNamingExperiment.value} your way.`,
37
+ description: "Build a custom slice your way.",
42
38
  },
43
39
  fromTemplate: {
44
40
  BackgroundIcon: (
@@ -65,10 +61,8 @@ export const getSliceCreationOptions = (args: SliceCreationOptionArgs) => {
65
61
  radius={6}
66
62
  />
67
63
  ),
68
- title: `Reuse an existing ${sectionsNamingExperiment.value}`,
69
- description: `Select from your created ${pluralize(
70
- sectionsNamingExperiment.value,
71
- )}`,
64
+ title: "Reuse an existing slice",
65
+ description: "Select from your created slices.",
72
66
  },
73
67
  };
74
68
  };
@@ -8,18 +8,14 @@ import { CUSTOM_TYPES_CONFIG } from "@/features/customTypes/customTypesConfig";
8
8
  import { CUSTOM_TYPES_MESSAGES } from "@/features/customTypes/customTypesMessages";
9
9
  import { RepositoryInfo } from "@/features/navigation/RepositoryInfo";
10
10
  import { OnboardingGuide } from "@/features/onboarding";
11
- import { useGitIntegrationExperiment } from "@/features/settings/git/useGitIntegrationExperiment";
12
11
  import { useAdapterName } from "@/hooks/useAdapterName";
13
12
  import { useMarketingContent } from "@/hooks/useMarketingContent";
14
13
  import { FolderIcon } from "@/icons/FolderIcon";
15
14
  import { LightningIcon } from "@/icons/Lightning";
16
15
  import { MenuBookIcon } from "@/icons/MenuBookIcon";
17
- import { SettingsIcon } from "@/icons/SettingsIcon";
18
- import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
19
16
 
20
17
  import { ChangesItem } from "../../legacy/components/Navigation/ChangesItem";
21
18
  import { Environment } from "../../legacy/components/Navigation/Environment";
22
- import { useSectionsNamingExperiment } from "../builder/useSectionsNamingExperiment";
23
19
  import { NavigationItem } from "./NavigationItem";
24
20
  import { SliceMachineVersion } from "./SliceMachineVersion";
25
21
  import { UpdateInfo } from "./UpdateInfo";
@@ -27,9 +23,7 @@ import { UpdateInfo } from "./UpdateInfo";
27
23
  export function Navigation() {
28
24
  const router = useRouter();
29
25
 
30
- const gitIntegrationExperiment = useGitIntegrationExperiment();
31
26
  const { documentationLink } = useMarketingContent();
32
- const sectionsNamingExperiment = useSectionsNamingExperiment();
33
27
  const adapter = useAdapterName();
34
28
 
35
29
  interface CustomTypeNavigationItemProps {
@@ -78,9 +72,7 @@ export function Navigation() {
78
72
  <CustomTypeNavigationItem type="custom" />
79
73
 
80
74
  <NavigationItem
81
- title={pluralize(
82
- capitalizeFirstLetter(sectionsNamingExperiment.value),
83
- )}
75
+ title="Slices"
84
76
  href="/slices"
85
77
  Icon={FolderIcon}
86
78
  active={router.asPath.startsWith("/slices")}
@@ -101,7 +93,6 @@ export function Navigation() {
101
93
  <OnboardingGuide />
102
94
  </Suspense>
103
95
  </ErrorBoundary>
104
-
105
96
  <NavigationItem
106
97
  title="Documentation"
107
98
  href={documentationLink}
@@ -115,15 +106,6 @@ export function Navigation() {
115
106
  }}
116
107
  />
117
108
 
118
- {gitIntegrationExperiment.eligible && (
119
- <NavigationItem
120
- title="Settings"
121
- href="/settings"
122
- Icon={SettingsIcon}
123
- active={router.asPath.startsWith("/settings")}
124
- />
125
- )}
126
-
127
109
  <NavigationItem
128
110
  title="Changelog"
129
111
  href="/changelog"
@@ -4,7 +4,6 @@ import { AiOutlineExclamationCircle } from "react-icons/ai";
4
4
 
5
5
  import { countMissingScreenshots } from "@/domain/slice";
6
6
  import { ErrorBoundary } from "@/ErrorBoundary";
7
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
8
7
  import { SharedSliceCard } from "@/features/slices/sliceCards/SharedSliceCard";
9
8
  import { ModelsStatuses } from "@/features/sync/getUnSyncChanges";
10
9
  import { useScreenshotChangesModal } from "@/hooks/useScreenshotChangesModal";
@@ -16,7 +15,6 @@ import { ComponentUI } from "@/legacy/lib/models/common/ComponentUI";
16
15
  import { LocalOrRemoteCustomType } from "@/legacy/lib/models/common/ModelData";
17
16
  import { ModelStatus } from "@/legacy/lib/models/common/ModelStatus";
18
17
  import { AuthStatus } from "@/modules/userContext/types";
19
- import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
20
18
 
21
19
  import { DevCollaborationExperiment } from "./DevCollaborationExperiment";
22
20
 
@@ -36,7 +34,6 @@ export const ChangesItems: React.FC<ChangesItemsProps> = ({
36
34
  isOnline,
37
35
  }) => {
38
36
  const { modalPayload, onOpenModal } = useScreenshotChangesModal();
39
- const sectionsNamingExperiment = useSectionsNamingExperiment();
40
37
 
41
38
  const { sliceFilterFn, defaultVariationSelector } = modalPayload;
42
39
 
@@ -71,11 +68,7 @@ export const ChangesItems: React.FC<ChangesItemsProps> = ({
71
68
  <Box padding={{ bottom: 8 }}>
72
69
  <ChangesSectionHeader>
73
70
  <Box>
74
- <Text variant="h5">
75
- {pluralize(
76
- capitalizeFirstLetter(sectionsNamingExperiment.value),
77
- )}
78
- </Text>
71
+ <Text variant="h5">Slices</Text>
79
72
  <Text variant="h5" sx={{ marginLeft: 8 }}>
80
73
  {unSyncedSlices.length}
81
74
  </Text>
@@ -4,7 +4,6 @@ import Select from "react-select";
4
4
  import { Box, Label } from "theme-ui";
5
5
 
6
6
  import { getState } from "@/apiClient";
7
- import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
8
7
  import { useOnboarding } from "@/features/onboarding/useOnboarding";
9
8
  import { createSlice } from "@/features/slices/actions/createSlice";
10
9
  import { useAutoSync } from "@/features/sync/AutoSyncProvider";
@@ -12,7 +11,6 @@ import ModalFormCard from "@/legacy/components/ModalFormCard";
12
11
  import { LibraryUI } from "@/legacy/lib/models/common/LibraryUI";
13
12
  import { SliceSM } from "@/legacy/lib/models/common/Slice";
14
13
  import useSliceMachineActions from "@/modules/useSliceMachineActions";
15
- import { capitalizeFirstLetter } from "@/utils/textConversion";
16
14
 
17
15
  import { InputBox } from "../components/InputBox";
18
16
  import { validateSliceModalValues } from "../formsValidator";
@@ -38,7 +36,6 @@ export const CreateSliceModal: FC<CreateSliceModalProps> = ({
38
36
  const [isCreatingSlice, setIsCreatingSlice] = useState(false);
39
37
  const { syncChanges } = useAutoSync();
40
38
  const { completeStep } = useOnboarding();
41
- const sectionsNamingExperiment = useSectionsNamingExperiment();
42
39
 
43
40
  const onSubmit = async (values: FormValues) => {
44
41
  const sliceName = values.sliceName;
@@ -82,17 +79,15 @@ export const CreateSliceModal: FC<CreateSliceModalProps> = ({
82
79
  validateSliceModalValues(values, localLibraries, remoteSlices)
83
80
  }
84
81
  content={{
85
- title: `Create a new ${sectionsNamingExperiment.value}`,
82
+ title: "Create a new slice",
86
83
  }}
87
84
  >
88
85
  {({ touched, values, setFieldValue, errors }) => (
89
86
  <Box>
90
87
  <InputBox
91
88
  name="sliceName"
92
- label={`${capitalizeFirstLetter(
93
- sectionsNamingExperiment.value,
94
- )} name`}
95
- placeholder={`Pascalised ${sectionsNamingExperiment.value} API ID (e.g. TextBlock)`}
89
+ label="Slice name"
90
+ placeholder="Pascalised slice API ID (e.g. TextBlock)"
96
91
  // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
97
92
  error={touched.sliceName ? errors.sliceName : undefined}
98
93
  testId="slice-name-input"
@@ -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>
@@ -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}>