slice-machine-ui 1.22.2-beta.1 → 1.22.2-beta.11
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/components/AppLayout/index.tsx +8 -4
- package/components/Navigation/ChangesListItem.tsx +1 -1
- package/components/Navigation/Environment.tsx +8 -7
- package/lib/builders/CustomTypeBuilder/SliceZone/index.tsx +1 -1
- package/lib/builders/SliceBuilder/Sidebar/index.tsx +1 -1
- package/lib/builders/SliceBuilder/SimulatorButton/index.tsx +2 -2
- package/lib/builders/common/Zone/components/EmptyState/index.tsx +1 -1
- package/lib/builders/common/Zone/index.jsx +1 -1
- package/out/404.html +1 -1
- package/out/_next/static/AT1eVZTlmZAgTtIdj6oNo/_buildManifest.js +1 -0
- package/out/_next/static/chunks/18539003-4460ccbfe3109578.js +97 -0
- package/out/_next/static/chunks/482-34cee2a2071c235f.js +1 -0
- package/out/_next/static/chunks/{505-fa47e200ac3a012d.js → 505-3f1cf09a086dcba8.js} +1 -1
- package/out/_next/static/chunks/550-c80fd46fb64d1eef.js +1 -0
- package/out/_next/static/chunks/{840-45aefe7b4d84745c.js → 840-163f8a1040e6820d.js} +1 -1
- package/out/_next/static/chunks/904-519dbf0f7e8c6243.js +1 -0
- package/out/_next/static/chunks/{958-0a6a103fac00582b.js → 958-8aca174b80cb0c35.js} +1 -1
- package/out/_next/static/chunks/pages/_app-26ba044deeac3828.js +458 -0
- package/out/_next/static/chunks/pages/{changelog-cfda9d30715b6e2a.js → changelog-4d0f2f1222e403fe.js} +1 -1
- package/out/_next/static/chunks/pages/{changes-a3cdb6251b224e4b.js → changes-52c9d917808d1461.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-dfad3c3553469739.js → labs-526bb7d60a1b90f4.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ef11594ce026b650.js +1 -0
- package/out/_next/static/chunks/pages/{slices-dc4f17b54c9a3eb5.js → slices-884a936a9a062a65.js} +1 -1
- package/out/_next/static/css/{7ef90ba762e84cee.css → 1bbf650dfd37ce69.css} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +7 -6
- package/src/components/BlankSlate/BlankSlate.css.ts +4 -1
- package/src/components/BlankSlate/BlankSlate.tsx +2 -7
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/HoverCard/HoverCard.css.ts +0 -9
- package/src/components/HoverCard/HoverCard.stories.tsx +3 -3
- package/src/components/HoverCard/HoverCard.tsx +1 -1
- package/src/components/List/List.stories.tsx +2 -2
- package/src/components/PageLayout/PageLayout.css.ts +6 -12
- package/src/components/PageLayout/PageLayout.tsx +6 -6
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +69 -30
- package/src/components/Window/Window.tsx +1 -1
- package/src/features/customTypes/EditDropdown.tsx +7 -5
- package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +2 -2
- package/src/features/environments/actions/getActiveEnvironment.ts +34 -0
- package/src/features/environments/actions/getEnvironments.ts +5 -2
- package/src/features/environments/actions/setEnvironment.ts +2 -2
- package/src/features/environments/useActiveEnvironment.ts +2 -33
- package/src/features/inAppGuide/InAppGuideDialog.tsx +1 -7
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +1 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +1 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceButton.tsx +1 -1
- package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +1 -1
- package/src/features/slices/sliceBuilder/FloatingBackButton.tsx +1 -1
- package/src/features/slices/sliceCards/SharedSliceCard.tsx +2 -2
- package/out/_next/static/ALrNHXPZGeRwEXHdmh5-C/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-9f66499125869c64.js +0 -97
- package/out/_next/static/chunks/482-7e97f91961588a90.js +0 -1
- package/out/_next/static/chunks/550-8557ad3750e1e581.js +0 -1
- package/out/_next/static/chunks/904-e7c8c1ba265177fb.js +0 -1
- package/out/_next/static/chunks/pages/_app-cae1327f33c96711.js +0 -447
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c228a7c42e87eb27.js +0 -1
- package/src/features/environments/actions/getActiveEnvironmentDomain.ts +0 -11
- /package/out/_next/static/{ALrNHXPZGeRwEXHdmh5-C → AT1eVZTlmZAgTtIdj6oNo}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Environment,
|
|
3
|
+
isInvalidActiveEnvironmentError,
|
|
4
|
+
} from "@slicemachine/manager/client";
|
|
5
|
+
|
|
6
|
+
import { managerClient } from "@src/managerClient";
|
|
7
|
+
|
|
8
|
+
type GetActiveEnvironmentReturnType =
|
|
9
|
+
| {
|
|
10
|
+
activeEnvironment: Environment;
|
|
11
|
+
error?: undefined;
|
|
12
|
+
}
|
|
13
|
+
| {
|
|
14
|
+
activeEnvironment?: undefined;
|
|
15
|
+
error: unknown;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export async function getActiveEnvironment(): Promise<GetActiveEnvironmentReturnType> {
|
|
19
|
+
try {
|
|
20
|
+
const { activeEnvironment } =
|
|
21
|
+
await managerClient.project.fetchActiveEnvironment();
|
|
22
|
+
|
|
23
|
+
return { activeEnvironment };
|
|
24
|
+
} catch (error) {
|
|
25
|
+
if (isInvalidActiveEnvironmentError(error)) {
|
|
26
|
+
// Reset to the production environment.
|
|
27
|
+
await managerClient.project.updateEnvironment({ environment: undefined });
|
|
28
|
+
|
|
29
|
+
return await getActiveEnvironment();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return { error };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -2,8 +2,11 @@ import { managerClient } from "@src/managerClient";
|
|
|
2
2
|
|
|
3
3
|
export async function getEnvironments() {
|
|
4
4
|
try {
|
|
5
|
-
|
|
5
|
+
const { environments } =
|
|
6
|
+
await managerClient.prismicRepository.fetchEnvironments();
|
|
7
|
+
|
|
8
|
+
return { environments };
|
|
6
9
|
} catch (error) {
|
|
7
|
-
|
|
10
|
+
return { error };
|
|
8
11
|
}
|
|
9
12
|
}
|
|
@@ -4,7 +4,7 @@ import { Environment } from "@slicemachine/manager/client";
|
|
|
4
4
|
import { getLegacySliceMachineState } from "@src/features/legacyState/actions/getLegacySliceMachineState";
|
|
5
5
|
import { managerClient } from "@src/managerClient";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { getActiveEnvironment } from "./getActiveEnvironment";
|
|
8
8
|
|
|
9
9
|
export async function setEnvironment(
|
|
10
10
|
environment: Pick<Environment, "domain">,
|
|
@@ -13,6 +13,6 @@ export async function setEnvironment(
|
|
|
13
13
|
environment: environment.domain,
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
revalidateData(
|
|
16
|
+
revalidateData(getActiveEnvironment, []);
|
|
17
17
|
revalidateData(getLegacySliceMachineState, []);
|
|
18
18
|
}
|
|
@@ -1,38 +1,7 @@
|
|
|
1
1
|
import { useRequest } from "@prismicio/editor-support/Suspense";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { useEnvironments } from "./useEnvironments";
|
|
3
|
+
import { getActiveEnvironment } from "./actions/getActiveEnvironment";
|
|
5
4
|
|
|
6
5
|
export function useActiveEnvironment() {
|
|
7
|
-
|
|
8
|
-
const { activeEnvironmentDomain, error: getActiveEnvironmentError } =
|
|
9
|
-
useRequest(getActiveEnvironmentDomain, []);
|
|
10
|
-
|
|
11
|
-
if (useEnvironmentsError !== undefined) {
|
|
12
|
-
return { error: useEnvironmentsError };
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (getActiveEnvironmentError !== undefined) {
|
|
16
|
-
return { error: getActiveEnvironmentError };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const activeEnvironment = environments?.find((environment) => {
|
|
20
|
-
if (activeEnvironmentDomain === undefined) {
|
|
21
|
-
return environment.kind === "prod";
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return environment.domain === activeEnvironmentDomain;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (!activeEnvironment) {
|
|
28
|
-
return {
|
|
29
|
-
error: new Error(
|
|
30
|
-
`The active environment (${
|
|
31
|
-
activeEnvironmentDomain ?? "Production"
|
|
32
|
-
}) does not match one of the repository's environments.`,
|
|
33
|
-
),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return { activeEnvironment };
|
|
6
|
+
return useRequest(getActiveEnvironment, []);
|
|
38
7
|
}
|
|
@@ -72,13 +72,7 @@ export const InAppGuideDialog: FC = () => {
|
|
|
72
72
|
{content.title}
|
|
73
73
|
</Text>
|
|
74
74
|
</Box>
|
|
75
|
-
<Video
|
|
76
|
-
src={content.videoUrl}
|
|
77
|
-
sizing="contain"
|
|
78
|
-
autoPlay
|
|
79
|
-
controls
|
|
80
|
-
loop
|
|
81
|
-
/>
|
|
75
|
+
<Video src={content.videoUrl} sizing="contain" autoPlay loop />
|
|
82
76
|
<Text>{content.description}</Text>
|
|
83
77
|
</Box>
|
|
84
78
|
|
|
@@ -89,7 +89,7 @@ export const ConvertLegacySliceAsNewVariationDialog: FC<DialogProps> = ({
|
|
|
89
89
|
</label>
|
|
90
90
|
<Select
|
|
91
91
|
size="medium"
|
|
92
|
-
|
|
92
|
+
color="grey"
|
|
93
93
|
startIcon="viewDay"
|
|
94
94
|
flexContent={true}
|
|
95
95
|
value={`${formik.values.libraryID}::${formik.values.sliceID}`}
|
|
@@ -52,7 +52,7 @@ const BackButton: FC<BackButtonProps> = ({ sourceCustomTypeId }) => {
|
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
53
53
|
const url = CUSTOM_TYPES_CONFIG[format!].getBuilderPagePathname(id);
|
|
54
54
|
return (
|
|
55
|
-
<ButtonGroup density="compact"
|
|
55
|
+
<ButtonGroup density="compact" color="dark">
|
|
56
56
|
<Button
|
|
57
57
|
onClick={() => {
|
|
58
58
|
void router.push(url);
|
|
@@ -163,7 +163,7 @@ export const SharedSliceCard: FC<SharedSliceCardProps> = (props) => {
|
|
|
163
163
|
) : action.type === "menu" ? (
|
|
164
164
|
<DropdownMenu modal>
|
|
165
165
|
<DropdownMenuTrigger disabled={disabled}>
|
|
166
|
-
<IconButton
|
|
166
|
+
<IconButton hiddenLabel="Slice actions" icon="moreVert" />
|
|
167
167
|
</DropdownMenuTrigger>
|
|
168
168
|
<DropdownMenuContent
|
|
169
169
|
align="end"
|
|
@@ -250,7 +250,7 @@ const UpdateScreenshotButton: FC<UpdateScreenshotButtonProps> = (props) => (
|
|
|
250
250
|
renderStartIcon={() => (
|
|
251
251
|
<AddPhotoAlternateIcon color={tokens.color.greyLight11} />
|
|
252
252
|
)}
|
|
253
|
-
|
|
253
|
+
color="grey"
|
|
254
254
|
>
|
|
255
255
|
Update screenshot
|
|
256
256
|
</Button>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,d,b,f,n){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[c,i,d,"static/chunks/pages/index-d8e3a2c0d712904f.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":["static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-cfda9d30715b6e2a.js"],"/changes":[a,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38d08f1e885b222d.js",s,e,"static/css/7d650bca12dc4061.css","static/chunks/pages/changes-a3cdb6251b224e4b.js"],"/custom-types":[c,i,d,"static/chunks/pages/custom-types-2f5664d9492b13fb.js"],"/custom-types/[customTypeId]":[b,s,c,t,f,n,"static/chunks/pages/custom-types/[customTypeId]-3a37eb3373bb8823.js"],"/labs":["static/chunks/pages/labs-dfad3c3553469739.js"],"/page-types/[pageTypeId]":[b,s,c,t,f,n,"static/chunks/pages/page-types/[pageTypeId]-733f3890c0466a05.js"],"/slices":[a,s,e,"static/css/cb33580e45d01b59.css","static/chunks/pages/slices-dc4f17b54c9a3eb5.js"],"/slices/[lib]/[sliceName]/[variation]":[a,s,e,t,"static/css/77abb01eee0e43a7.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c228a7c42e87eb27.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[a,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-9f66499125869c64.js","static/chunks/505-fa47e200ac3a012d.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-7b17cb59d0db03b5.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/958-0a6a103fac00582b.js","static/chunks/550-8557ad3750e1e581.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/80-7b8a97d0122ff74a.js","static/chunks/482-7e97f91961588a90.js","static/chunks/840-45aefe7b4d84745c.js","static/css/be1f49e49a5aa7eb.css","static/chunks/474-5a072e6fac61f703.js","static/chunks/904-e7c8c1ba265177fb.js","static/css/5da5d3cd7a87c3cf.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|