slice-machine-ui 2.17.3-beta.1 → 2.17.3-beta.10
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/Ahdv3H07Mjm1YmGHQ2jWC/_buildManifest.js +1 -0
- package/out/_next/static/chunks/04ad993f.d7f986af0f739cc9.js +28 -0
- package/out/_next/static/chunks/248-a2a655660e3f09b0.js +1 -0
- package/out/_next/static/chunks/34-8d9d9b2944824750.js +1 -0
- package/out/_next/static/chunks/489-feb8133b2c5a7773.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-445266211c48b1a5.js +1 -0
- package/out/_next/static/chunks/pages/{_app-20b580525c9dd4d8.js → _app-f232ce46126995c7.js} +219 -221
- package/out/_next/static/chunks/pages/changelog-3663cafded70979e.js +1 -0
- package/out/_next/static/chunks/pages/changes-dda121066bd037bc.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-a408f5a660e096a6.js → [customTypeId]-7102c23f96cd1768.js} +1 -1
- package/out/_next/static/chunks/pages/labs-a7ead234825f32c0.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-f5e851ebe35049a8.js → [pageTypeId]-d4bc920a5efffa0a.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-b127d948a17968d3.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-29476d3554e484bb.js +1 -0
- package/out/_next/static/chunks/pages/slices-742b0e644563ac91.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 +6 -6
- package/src/domain/fields.ts +7 -7
- package/src/features/builder/AddFieldDropdown.tsx +2 -2
- package/src/features/changes/PushChangesButton.tsx +4 -67
- package/src/features/customTypes/customTypesBuilder/CreateSliceFromImageModal/CreateSliceFromImageModal.tsx +8 -21
- package/src/features/customTypes/customTypesBuilder/SliceZoneBlankSlate.tsx +13 -25
- package/src/features/customTypes/customTypesBuilder/sliceCreationOptions.tsx +5 -11
- package/src/features/environments/actions/getActiveEnvironment.ts +20 -5
- package/src/features/navigation/Navigation.tsx +4 -24
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -10
- package/src/legacy/components/AppLayout/index.tsx +34 -2
- package/src/legacy/components/ChangesItems/ChangesItems.tsx +1 -8
- package/src/legacy/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -8
- package/src/legacy/components/ListItem/Header.tsx +18 -12
- package/src/legacy/components/ListItem/index.tsx +1 -0
- package/src/legacy/components/Navigation/Environment.tsx +11 -3
- package/src/legacy/components/Simulator/components/FailedConnect/index.tsx +51 -56
- package/src/legacy/components/ToasterContainer/index.tsx +3 -14
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/SlicesTemplatesModal.tsx +20 -28
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModal.tsx +1 -5
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/UpdateSliceZoneModalList.tsx +1 -6
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +13 -29
- package/src/legacy/lib/builders/SliceBuilder/index.tsx +1 -6
- package/src/legacy/lib/builders/common/EditModal/index.jsx +3 -10
- package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +5 -10
- 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/slices.tsx +19 -51
- package/out/_next/static/chunks/248-03446cd9e9f13730.js +0 -1
- package/out/_next/static/chunks/268-6a9214b97195af9c.js +0 -1
- package/out/_next/static/chunks/33641354.3864aefb6106ae71.js +0 -28
- package/out/_next/static/chunks/34-e684c5fd75cc9dd0.js +0 -1
- package/out/_next/static/chunks/44-a2056f993381ad0f.js +0 -1
- package/out/_next/static/chunks/630-29c729ad2a291ef6.js +0 -1
- package/out/_next/static/chunks/882-151468121d542ed6.js +0 -1
- package/out/_next/static/chunks/pages/changelog-063c5e11dfc8fd55.js +0 -1
- package/out/_next/static/chunks/pages/changes-564336edb0ed18b0.js +0 -1
- package/out/_next/static/chunks/pages/labs-9630bfb1005be02b.js +0 -1
- package/out/_next/static/chunks/pages/settings-01f4aeb9112a1f87.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5008e29008aa04f4.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-bd5e45632c419567.js +0 -1
- package/out/_next/static/chunks/pages/slices-4a60cd5f2c71327e.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/css/e5f781f20e24a5ea.css +0 -1
- package/out/_next/static/qsIV6OuRkZuXZ3EaJau1x/_buildManifest.js +0 -1
- package/out/settings.html +0 -1
- package/out/videoHighlights.png +0 -0
- package/public/videoHighlights.png +0 -0
- package/src/components/FieldSet/FieldSet.module.css +0 -84
- package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -16
- package/src/components/FieldSet/FieldSet.stories.tsx +0 -244
- package/src/components/FieldSet/FieldSet.tsx +0 -67
- package/src/components/FieldSet/index.ts +0 -9
- package/src/features/builder/useAiSliceGenerationExperiment.ts +0 -8
- package/src/features/builder/useSectionsNamingExperiment.ts +0 -15
- package/src/features/settings/SettingsPage.tsx +0 -50
- package/src/features/settings/git/ConnectGitRepository.tsx +0 -112
- package/src/features/settings/git/ConnectGitRepositoryBlankSlate.tsx +0 -33
- package/src/features/settings/git/GitOwnerSelect.tsx +0 -71
- package/src/features/settings/git/GitProvider.ts +0 -40
- package/src/features/settings/git/GitProviderConnectButtons.tsx +0 -63
- package/src/features/settings/git/GitRepositoriesList.tsx +0 -76
- package/src/features/settings/git/GitRepositoriesSearch.tsx +0 -69
- package/src/features/settings/git/GitRepositoryConnectDialog.tsx +0 -97
- package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +0 -62
- package/src/features/settings/git/useGitIntegrationExperiment.ts +0 -8
- package/src/features/settings/git/useGitOwners.ts +0 -12
- package/src/features/settings/git/useGitRepos.ts +0 -24
- package/src/features/settings/git/useLinkedGitRepos.ts +0 -41
- package/src/features/settings/git/useWriteAPIToken.ts +0 -23
- package/src/icons/BitbucketIcon.tsx +0 -19
- package/src/icons/GitHubIcon.tsx +0 -17
- package/src/icons/GitLabIcon.tsx +0 -19
- package/src/icons/SettingsIcon.tsx +0 -19
- package/src/legacy/lib/builders/CustomTypeBuilder/SliceZone/sliceTemplatesComingSoon.ts +0 -30
- package/src/pages/settings.tsx +0 -1
- package/src/utils/textConversion.ts +0 -11
- /package/out/_next/static/{qsIV6OuRkZuXZ3EaJau1x → Ahdv3H07Mjm1YmGHQ2jWC}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Box, Tooltip } from "@prismicio/editor-ui";
|
|
1
2
|
import * as CSS from "csstype";
|
|
2
3
|
import { IconType } from "react-icons";
|
|
3
4
|
import { Flex, Text, Theme } from "theme-ui";
|
|
@@ -9,6 +10,7 @@ interface ItemHeaderProps {
|
|
|
9
10
|
sliceFieldName: string | undefined;
|
|
10
11
|
theme: Theme;
|
|
11
12
|
WidgetIcon: IconType;
|
|
13
|
+
widgetIconTooltip: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
const ItemHeader: React.FC<ItemHeaderProps> = ({
|
|
@@ -16,20 +18,24 @@ const ItemHeader: React.FC<ItemHeaderProps> = ({
|
|
|
16
18
|
sliceFieldName,
|
|
17
19
|
theme,
|
|
18
20
|
WidgetIcon,
|
|
21
|
+
widgetIconTooltip,
|
|
19
22
|
}) => (
|
|
20
23
|
<Flex sx={{ alignItems: "center", position: "relative" }}>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
<Tooltip content={widgetIconTooltip} sideOffset={2} disableHoverableContent>
|
|
25
|
+
<Box margin={{ right: 8 }}>
|
|
26
|
+
<WidgetIcon
|
|
27
|
+
size={28}
|
|
28
|
+
style={{
|
|
29
|
+
color: theme.colors?.primary as CSS.Property.Color,
|
|
30
|
+
borderRadius: "4px",
|
|
31
|
+
padding: "4px",
|
|
32
|
+
border: "2px solid",
|
|
33
|
+
borderColor: theme.colors?.primary as CSS.Property.Color,
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
</Box>
|
|
38
|
+
</Tooltip>
|
|
33
39
|
<TextWithTooltip
|
|
34
40
|
text={text}
|
|
35
41
|
as="p"
|
|
@@ -114,6 +114,7 @@ function ListItem<F extends TabField, S extends AnyObjectSchema>({
|
|
|
114
114
|
renderFieldAccessor && renderFieldAccessor(key)
|
|
115
115
|
}
|
|
116
116
|
WidgetIcon={widget.Meta.icon}
|
|
117
|
+
widgetIconTooltip={widget.label}
|
|
117
118
|
/>
|
|
118
119
|
<Flex sx={{ flex: "0 0 auto" }}>
|
|
119
120
|
{shouldDisplayRepeatableBadge && (
|
|
@@ -21,7 +21,8 @@ import { SideNavEnvironmentSelector } from "./SideNavEnvironmentSelector/SideNav
|
|
|
21
21
|
|
|
22
22
|
export function Environment() {
|
|
23
23
|
const { environments, error: useEnvironmentsError } = useEnvironments();
|
|
24
|
-
const { activeEnvironment } =
|
|
24
|
+
const { activeEnvironment, error: activeEnvironmentError } =
|
|
25
|
+
useActiveEnvironment();
|
|
25
26
|
const { refreshState, openLoginModal } = useSliceMachineActions();
|
|
26
27
|
const { syncChanges } = useAutoSync();
|
|
27
28
|
const isOnline = useNetwork();
|
|
@@ -82,7 +83,10 @@ export function Environment() {
|
|
|
82
83
|
return <SideNavEnvironmentSelector variant="offline" />;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
if (
|
|
86
|
+
if (
|
|
87
|
+
useEnvironmentsError === undefined &&
|
|
88
|
+
activeEnvironmentError === undefined
|
|
89
|
+
) {
|
|
86
90
|
return (
|
|
87
91
|
<SideNavEnvironmentSelector
|
|
88
92
|
environments={environments}
|
|
@@ -110,5 +114,9 @@ export function Environment() {
|
|
|
110
114
|
);
|
|
111
115
|
}
|
|
112
116
|
|
|
113
|
-
|
|
117
|
+
if (useEnvironmentsError !== undefined) {
|
|
118
|
+
throw useEnvironmentsError;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
throw activeEnvironmentError;
|
|
114
122
|
}
|
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
38
|
+
npm run dev
|
|
25
39
|
</Text>
|
|
26
|
-
|
|
40
|
+
in your terminal at the root of your website directory.
|
|
41
|
+
<br /> If that doesn't work, see the
|
|
42
|
+
<Link
|
|
43
|
+
target="_blank"
|
|
44
|
+
href="https://prismic.io/docs/slice-machine#simulate-slices"
|
|
27
45
|
sx={{
|
|
28
|
-
color: "
|
|
29
|
-
maxWidth: "400px",
|
|
30
|
-
textAlign: "center",
|
|
31
|
-
fontSize: "12px",
|
|
32
|
-
lineHeight: "22px",
|
|
46
|
+
color: "link",
|
|
33
47
|
}}
|
|
34
48
|
>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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,9 +11,7 @@ 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
|
-
import { sliceTemplatesComingSoon } from "./sliceTemplatesComingSoon";
|
|
18
15
|
import UpdateSliceZoneModalList from "./UpdateSliceZoneModalList";
|
|
19
16
|
|
|
20
17
|
interface UpdateSliceModalProps {
|
|
@@ -39,7 +36,6 @@ export const SlicesTemplatesModal: FC<UpdateSliceModalProps> = ({
|
|
|
39
36
|
location,
|
|
40
37
|
}) => {
|
|
41
38
|
const { createSliceSuccess } = useSliceMachineActions();
|
|
42
|
-
const sectionsNamingExperiment = useSectionsNamingExperiment();
|
|
43
39
|
|
|
44
40
|
return (
|
|
45
41
|
<ModalFormCard
|
|
@@ -83,7 +79,7 @@ export const SlicesTemplatesModal: FC<UpdateSliceModalProps> = ({
|
|
|
83
79
|
sliceKeys: [],
|
|
84
80
|
}}
|
|
85
81
|
content={{
|
|
86
|
-
title:
|
|
82
|
+
title: "Use template slices",
|
|
87
83
|
}}
|
|
88
84
|
validate={(values) => {
|
|
89
85
|
if (values.sliceKeys.length === 0) {
|
|
@@ -101,29 +97,25 @@ export const SlicesTemplatesModal: FC<UpdateSliceModalProps> = ({
|
|
|
101
97
|
{({ values }) => (
|
|
102
98
|
<UpdateSliceZoneModalList
|
|
103
99
|
values={values}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}),
|
|
124
|
-
),
|
|
125
|
-
...sliceTemplatesComingSoon,
|
|
126
|
-
]}
|
|
100
|
+
availableSlices={availableSlicesTemplates.map(
|
|
101
|
+
(slice): ComponentUI => ({
|
|
102
|
+
extension: "",
|
|
103
|
+
fileName: "",
|
|
104
|
+
from: "",
|
|
105
|
+
href: "",
|
|
106
|
+
pathToSlice: "",
|
|
107
|
+
model: Slices.toSM(slice.model),
|
|
108
|
+
screenshots: Object.entries(slice.screenshots).reduce(
|
|
109
|
+
(acc, curr) => ({
|
|
110
|
+
...acc,
|
|
111
|
+
[curr[0]]: {
|
|
112
|
+
url: curr[1],
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
{},
|
|
116
|
+
),
|
|
117
|
+
}),
|
|
118
|
+
)}
|
|
127
119
|
/>
|
|
128
120
|
)}
|
|
129
121
|
</ModalFormCard>
|
|
@@ -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:
|
|
46
|
+
title: "Select existing slices",
|
|
51
47
|
}}
|
|
52
48
|
testId="update-slices-modal"
|
|
53
49
|
validate={(values) => {
|
|
@@ -9,8 +9,7 @@ import { SliceZoneFormValues } from "./UpdateSliceZoneModal";
|
|
|
9
9
|
const UpdateSliceZoneModalList: React.FC<{
|
|
10
10
|
availableSlices: ReadonlyArray<ComponentUI>;
|
|
11
11
|
values: SliceZoneFormValues;
|
|
12
|
-
|
|
13
|
-
}> = ({ availableSlices, values, placeholderSlices }) => (
|
|
12
|
+
}> = ({ availableSlices, values }) => (
|
|
14
13
|
<FieldArray
|
|
15
14
|
name="sliceKeys"
|
|
16
15
|
render={(arrayHelpers) => (
|
|
@@ -19,14 +18,10 @@ const UpdateSliceZoneModalList: React.FC<{
|
|
|
19
18
|
elems={availableSlices}
|
|
20
19
|
defineElementKey={(slice) => `${slice.from}-${slice.model.name}`}
|
|
21
20
|
renderElem={(slice) => {
|
|
22
|
-
const isComingSoon =
|
|
23
|
-
placeholderSlices?.some((s) => s.model.id === slice.model.id) ??
|
|
24
|
-
false;
|
|
25
21
|
const isInSliceZone = values.sliceKeys.includes(slice.model.id);
|
|
26
22
|
return (
|
|
27
23
|
<SharedSliceCard
|
|
28
24
|
action={{ type: "checkbox" }}
|
|
29
|
-
isComingSoon={isComingSoon}
|
|
30
25
|
mode="selection"
|
|
31
26
|
onSelectedChange={(selected) => {
|
|
32
27
|
if (selected) {
|
|
@@ -15,8 +15,6 @@ import { BaseStyles } from "theme-ui";
|
|
|
15
15
|
|
|
16
16
|
import { telemetry } from "@/apiClient";
|
|
17
17
|
import { ListHeader } from "@/components/List";
|
|
18
|
-
import { useAiSliceGenerationExperiment } from "@/features/builder/useAiSliceGenerationExperiment";
|
|
19
|
-
import { useSectionsNamingExperiment } from "@/features/builder/useSectionsNamingExperiment";
|
|
20
18
|
import { CreateSliceFromImageModal } from "@/features/customTypes/customTypesBuilder/CreateSliceFromImageModal";
|
|
21
19
|
import { useCustomTypeState } from "@/features/customTypes/customTypesBuilder/CustomTypeProvider";
|
|
22
20
|
import { getSliceCreationOptions } from "@/features/customTypes/customTypesBuilder/sliceCreationOptions";
|
|
@@ -42,7 +40,6 @@ import {
|
|
|
42
40
|
} from "@/modules/slices";
|
|
43
41
|
import useSliceMachineActions from "@/modules/useSliceMachineActions";
|
|
44
42
|
import type { SliceMachineStoreType } from "@/redux/type";
|
|
45
|
-
import { capitalizeFirstLetter, pluralize } from "@/utils/textConversion";
|
|
46
43
|
|
|
47
44
|
import { DeleteSliceZoneModal } from "./DeleteSliceZoneModal";
|
|
48
45
|
import { SlicesList } from "./List";
|
|
@@ -116,7 +113,6 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
116
113
|
sliceZone,
|
|
117
114
|
tabId,
|
|
118
115
|
}) => {
|
|
119
|
-
const aiSliceGenerationExperiment = useAiSliceGenerationExperiment();
|
|
120
116
|
const availableSlicesTemplates = useSlicesTemplates();
|
|
121
117
|
const [isSlicesTemplatesModalOpen, setIsSlicesTemplatesModalOpen] =
|
|
122
118
|
useState(false);
|
|
@@ -135,10 +131,8 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
135
131
|
const { setCustomType } = useCustomTypeState();
|
|
136
132
|
const { completeStep } = useOnboarding();
|
|
137
133
|
const { openLoginModal } = useSliceMachineActions();
|
|
138
|
-
const sectionsNamingExperiment = useSectionsNamingExperiment();
|
|
139
134
|
const sliceCreationOptions = getSliceCreationOptions({
|
|
140
135
|
menuType: "Dropdown",
|
|
141
|
-
sectionsNamingExperiment,
|
|
142
136
|
});
|
|
143
137
|
|
|
144
138
|
const localLibraries: readonly LibraryUI[] = libraries.filter(
|
|
@@ -236,17 +230,15 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
236
230
|
</DropdownMenuTrigger>
|
|
237
231
|
|
|
238
232
|
<DropdownMenuContent align="end">
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
</DropdownMenuItem>
|
|
249
|
-
)}
|
|
233
|
+
<DropdownMenuItem
|
|
234
|
+
renderStartIcon={() =>
|
|
235
|
+
sliceCreationOptions.fromImage.BackgroundIcon
|
|
236
|
+
}
|
|
237
|
+
onSelect={() => void openCreateSliceFromImageModal()}
|
|
238
|
+
description={sliceCreationOptions.fromImage.description}
|
|
239
|
+
>
|
|
240
|
+
{sliceCreationOptions.fromImage.title}
|
|
241
|
+
</DropdownMenuItem>
|
|
250
242
|
<DropdownMenuItem
|
|
251
243
|
renderStartIcon={() =>
|
|
252
244
|
sliceCreationOptions.fromScratch.BackgroundIcon
|
|
@@ -301,7 +293,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
301
293
|
) : undefined
|
|
302
294
|
}
|
|
303
295
|
>
|
|
304
|
-
|
|
296
|
+
Slices
|
|
305
297
|
</ListHeader>
|
|
306
298
|
|
|
307
299
|
{sliceZone ? (
|
|
@@ -378,11 +370,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
378
370
|
onSaveCallback: () => {
|
|
379
371
|
toast.success(
|
|
380
372
|
<ToastMessageWithPath
|
|
381
|
-
message=
|
|
382
|
-
sectionsNamingExperiment.value,
|
|
383
|
-
)} template(s) added to ${
|
|
384
|
-
sectionsNamingExperiment.value
|
|
385
|
-
} zone and created at: `}
|
|
373
|
+
message="Slice template(s) added to slice zone and created at: "
|
|
386
374
|
path={`${localLibraries[0].name}/`}
|
|
387
375
|
/>,
|
|
388
376
|
);
|
|
@@ -418,7 +406,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
418
406
|
onSaveCallback: () => {
|
|
419
407
|
toast.success(
|
|
420
408
|
<ToastMessageWithPath
|
|
421
|
-
message=
|
|
409
|
+
message="New slice added to slice zone and created at: "
|
|
422
410
|
path={`${localLibraries[0].name}/`}
|
|
423
411
|
/>,
|
|
424
412
|
);
|
|
@@ -446,11 +434,7 @@ const SliceZone: React.FC<SliceZoneProps> = ({
|
|
|
446
434
|
onSaveCallback: () => {
|
|
447
435
|
toast.success(
|
|
448
436
|
<ToastMessageWithPath
|
|
449
|
-
message=
|
|
450
|
-
sectionsNamingExperiment.value,
|
|
451
|
-
)}(s) added to ${
|
|
452
|
-
sectionsNamingExperiment.value
|
|
453
|
-
} zone and created at: `}
|
|
437
|
+
message="Slice(s) added to slice zone and created at: "
|
|
454
438
|
path={library}
|
|
455
439
|
/>,
|
|
456
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={
|
|
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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
};
|