slice-machine-ui 1.23.2-beta.10 → 1.23.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/ChangesEmptyState/OfflinePage.tsx +1 -1
- package/components/ChangesItems/ChangesItems.tsx +6 -2
- package/components/CustomTypeTable/changesPage.tsx +12 -7
- package/components/DeleteSliceModal/index.tsx +3 -0
- package/components/Forms/CreateCustomTypeModal/CreateCustomTypeModal.tsx +4 -0
- package/components/Forms/CreateSliceModal/CreateSliceModal.tsx +3 -1
- package/components/Forms/RenameCustomTypeModal/RenameCustomTypeModal.tsx +6 -1
- package/components/Forms/RenameSliceModal/RenameSliceModal.tsx +3 -0
- package/components/LoginModal/index.tsx +40 -2
- package/components/Navigation/ChangesItem.tsx +117 -0
- package/components/Navigation/Environment.tsx +51 -4
- package/components/Navigation/index.css.ts +1 -2
- package/components/Navigation/index.test.tsx +5 -85
- package/components/Navigation/index.tsx +3 -8
- package/lib/builders/SliceBuilder/index.tsx +3 -3
- package/lib/models/common/ModelStatus/index.ts +25 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/25-3aa4d4b24167d340.js +1 -0
- package/out/_next/static/chunks/{318-99b5914b60bf1d17.js → 318-19dbcae10cdb6408.js} +1 -1
- package/out/_next/static/chunks/727-de03055e40815a3a.js +1 -0
- package/out/_next/static/chunks/{799-b616401fe0dafdeb.js → 799-0af1215eb2b3c17e.js} +1 -1
- package/out/_next/static/chunks/904-40686b0426716111.js +1 -0
- package/out/_next/static/chunks/pages/{_app-5ec41fc53c1f6405.js → _app-bca191df4ac7078e.js} +24 -24
- package/out/_next/static/chunks/pages/{changelog-02cd80dad6f40878.js → changelog-cb1df3a70b20f1b8.js} +1 -1
- package/out/_next/static/chunks/pages/changes-ccfd715c2bdc4f83.js +1 -0
- package/out/_next/static/chunks/pages/{labs-39b50541a4c370bf.js → labs-2adfb5127f9c4081.js} +1 -1
- package/out/_next/static/chunks/pages/{settings-879686e3a8759dc3.js → settings-94bcd7422e8b237d.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-c498e9c80cae8cce.js → simulator-aaf65fbec8f5839c.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-90bb2ea76d2abf42.js +1 -0
- package/out/_next/static/chunks/pages/slices-e0ce615c38e8338d.js +1 -0
- package/out/_next/static/css/{3c26dbbbd8f4be12.css → 39e089aad1742a3a.css} +1 -1
- package/out/_next/static/{Dz7wwTNVdXvoAjySXz7mE → dS_xZnzzna6Y6uwcTgf90}/_buildManifest.js +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/settings.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 +3 -3
- package/pages/_app.tsx +34 -32
- package/pages/changes.tsx +27 -41
- package/src/components/SideNav/SideNav.css.ts +1 -1
- package/src/components/SideNav/SideNav.tsx +9 -5
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +31 -11
- package/src/features/autoSave/AutoSaveStatusIndicator.tsx +4 -4
- package/src/features/customTypes/customTypesBuilder/CustomTypeProvider.tsx +11 -10
- package/src/features/customTypes/customTypesBuilder/CustomTypesBuilderPage.tsx +2 -2
- package/src/features/environments/actions/setEnvironment.ts +3 -3
- package/src/features/slices/sliceBuilder/SliceBuilderProvider.tsx +12 -10
- package/src/features/sync/AutoSyncProvider.tsx +252 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css +17 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.module.css.d.ts +5 -0
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +58 -0
- package/src/features/sync/fetchUnSyncChanges.ts +40 -0
- package/src/features/sync/getUnSyncChanges.ts +144 -0
- package/src/features/sync/useUnSyncChanges.ts +32 -0
- package/src/hooks/useActionQueue.tsx +177 -0
- package/src/hooks/useAuthStatus.ts +12 -0
- package/src/icons/SyncFailed.tsx +30 -0
- package/src/icons/Synced.tsx +19 -0
- package/src/icons/Syncing.tsx +23 -0
- package/test/__testutils__/index.tsx +8 -5
- package/components/Navigation/ChangesListItem.tsx +0 -74
- package/components/Navigation/ChangesRightElement.tsx +0 -33
- package/out/_next/static/chunks/25-01f422cea8066349.js +0 -1
- package/out/_next/static/chunks/727-f8fefdd3e50cab2a.js +0 -1
- package/out/_next/static/chunks/904-4653b7a849f4db94.js +0 -1
- package/out/_next/static/chunks/pages/changes-8e9da8fbb809aad3.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-9b893c62b2f2fe4a.js +0 -1
- package/out/_next/static/chunks/pages/slices-4522d604117d8c66.js +0 -1
- package/src/features/autoSave/useAutoSave.tsx +0 -177
- package/src/features/legacyState/actions/getLegacySliceMachineState.ts +0 -53
- package/src/features/legacyState/useLegacySliceMachineState.ts +0 -7
- package/src/hooks/useModelStatus.ts +0 -78
- package/src/hooks/useUnSyncChanges.ts +0 -88
- package/test/components/LoginModal.test.tsx +0 -67
- package/test/src/hooks/useModelStatus.test.ts +0 -115
- /package/out/_next/static/{Dz7wwTNVdXvoAjySXz7mE → dS_xZnzzna6Y6uwcTgf90}/_ssgManifest.js +0 -0
- /package/src/features/{changes → sync}/actions/pushChanges.ts +0 -0
- /package/src/features/{changes → sync}/actions/trackPushChangesSuccess.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useSelector } from "react-redux";
|
|
3
|
+
|
|
4
|
+
import { selectAllCustomTypes } from "@src/modules/availableCustomTypes";
|
|
5
|
+
import { getFrontendSlices, getLibraries } from "@src/modules/slices";
|
|
6
|
+
import { SliceMachineStoreType } from "@src/redux/type";
|
|
7
|
+
import { useAuthStatus } from "@src/hooks/useAuthStatus";
|
|
8
|
+
|
|
9
|
+
import { useNetwork } from "../../hooks/useNetwork";
|
|
10
|
+
import { UnSyncedChanges, getUnSyncedChanges } from "./getUnSyncChanges";
|
|
11
|
+
|
|
12
|
+
export const useUnSyncChanges = (): UnSyncedChanges => {
|
|
13
|
+
const { customTypes, slices, libraries } = useSelector(
|
|
14
|
+
(store: SliceMachineStoreType) => ({
|
|
15
|
+
customTypes: selectAllCustomTypes(store),
|
|
16
|
+
slices: getFrontendSlices(store),
|
|
17
|
+
libraries: getLibraries(store),
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
const isOnline = useNetwork();
|
|
21
|
+
const authStatus = useAuthStatus();
|
|
22
|
+
|
|
23
|
+
const unSyncedChange = getUnSyncedChanges({
|
|
24
|
+
authStatus,
|
|
25
|
+
customTypes,
|
|
26
|
+
isOnline,
|
|
27
|
+
libraries,
|
|
28
|
+
slices,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return useMemo(() => unSyncedChange, [unSyncedChange]);
|
|
32
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCallback,
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
SetStateAction,
|
|
6
|
+
Dispatch,
|
|
7
|
+
useMemo,
|
|
8
|
+
} from "react";
|
|
9
|
+
import { uniqueId } from "lodash";
|
|
10
|
+
import { toast } from "react-toastify";
|
|
11
|
+
import { Box, Button, Text } from "@prismicio/editor-ui";
|
|
12
|
+
|
|
13
|
+
export type ActionQueueStatus = "pending" | "done" | "failed";
|
|
14
|
+
|
|
15
|
+
type UseActionQueueArgs = {
|
|
16
|
+
actionQueueStatusDelay?: number;
|
|
17
|
+
errorMessage: string;
|
|
18
|
+
retryDelay?: number;
|
|
19
|
+
retryMessage?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type UseActionQueueReturnType = {
|
|
23
|
+
actionQueueStatus: ActionQueueStatus;
|
|
24
|
+
setNextAction: (nextAction: NextAction) => void;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type ActionQueueStack = {
|
|
28
|
+
pendingAction: NextAction | undefined;
|
|
29
|
+
nextAction: NextAction | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type NextAction = () => Promise<unknown>;
|
|
33
|
+
|
|
34
|
+
export const useActionQueue = (
|
|
35
|
+
args: UseActionQueueArgs,
|
|
36
|
+
): UseActionQueueReturnType => {
|
|
37
|
+
const {
|
|
38
|
+
actionQueueStatusDelay = 300,
|
|
39
|
+
errorMessage,
|
|
40
|
+
retryDelay = 1000,
|
|
41
|
+
retryMessage = "Retry",
|
|
42
|
+
} = args;
|
|
43
|
+
|
|
44
|
+
const [actionQueueStack, setActionQueueStack] = useState<ActionQueueStack>({
|
|
45
|
+
pendingAction: undefined,
|
|
46
|
+
nextAction: undefined,
|
|
47
|
+
});
|
|
48
|
+
const [actionQueueStatusActual, setActionQueueStatusActual] =
|
|
49
|
+
useState<ActionQueueStatus>("done");
|
|
50
|
+
const [actionQueueStatusDelayed, setActionQueueStatusDelayed] =
|
|
51
|
+
useState<ActionQueueStatus>(actionQueueStatusActual);
|
|
52
|
+
|
|
53
|
+
const setNextAction = useCallback((nextAction: NextAction) => {
|
|
54
|
+
setActionQueueStack((prevState) => ({
|
|
55
|
+
...prevState,
|
|
56
|
+
nextAction,
|
|
57
|
+
}));
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
const executeAction = useCallback(
|
|
61
|
+
async (nextAction?: NextAction) => {
|
|
62
|
+
if (nextAction) {
|
|
63
|
+
setActionQueueStatusActual("pending");
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
await nextAction();
|
|
67
|
+
|
|
68
|
+
setActionQueueStatusActual("done");
|
|
69
|
+
} catch (error) {
|
|
70
|
+
setActionQueueStatusActual("failed");
|
|
71
|
+
console.error(errorMessage, error);
|
|
72
|
+
|
|
73
|
+
toastError({
|
|
74
|
+
errorMessage,
|
|
75
|
+
retryDelay,
|
|
76
|
+
retryMessage,
|
|
77
|
+
setActionQueueStatusActual,
|
|
78
|
+
setActionQueueStack,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[errorMessage, retryDelay, retryMessage],
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (actionQueueStatusActual === "done" && actionQueueStack.nextAction) {
|
|
88
|
+
void executeAction(actionQueueStack.nextAction);
|
|
89
|
+
|
|
90
|
+
setActionQueueStack({
|
|
91
|
+
pendingAction: actionQueueStack.nextAction,
|
|
92
|
+
nextAction: undefined,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}, [actionQueueStatusActual, actionQueueStack, executeAction]);
|
|
96
|
+
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (actionQueueStatusActual === "pending") {
|
|
99
|
+
setActionQueueStatusDelayed("pending");
|
|
100
|
+
} else {
|
|
101
|
+
const delayedTimeout = setTimeout(() => {
|
|
102
|
+
setActionQueueStatusDelayed(actionQueueStatusActual);
|
|
103
|
+
}, actionQueueStatusDelay);
|
|
104
|
+
|
|
105
|
+
return () => {
|
|
106
|
+
clearTimeout(delayedTimeout);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return;
|
|
111
|
+
}, [actionQueueStatusActual, actionQueueStatusDelay]);
|
|
112
|
+
|
|
113
|
+
return useMemo(
|
|
114
|
+
() => ({
|
|
115
|
+
actionQueueStatus: actionQueueStatusDelayed,
|
|
116
|
+
setNextAction,
|
|
117
|
+
}),
|
|
118
|
+
[actionQueueStatusDelayed, setNextAction],
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type ToastErrorArgs = {
|
|
123
|
+
errorMessage: string;
|
|
124
|
+
retryDelay: number;
|
|
125
|
+
retryMessage: string;
|
|
126
|
+
setActionQueueStatusActual: Dispatch<SetStateAction<ActionQueueStatus>>;
|
|
127
|
+
setActionQueueStack: Dispatch<SetStateAction<ActionQueueStack>>;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
function toastError(args: ToastErrorArgs) {
|
|
131
|
+
const {
|
|
132
|
+
errorMessage,
|
|
133
|
+
retryDelay,
|
|
134
|
+
retryMessage,
|
|
135
|
+
setActionQueueStatusActual,
|
|
136
|
+
setActionQueueStack,
|
|
137
|
+
} = args;
|
|
138
|
+
const toastId = uniqueId();
|
|
139
|
+
|
|
140
|
+
toast.error(
|
|
141
|
+
() => (
|
|
142
|
+
<Box gap={8} alignItems="center">
|
|
143
|
+
<Text color="grey1" variant="small">
|
|
144
|
+
{errorMessage}
|
|
145
|
+
</Text>
|
|
146
|
+
<Button
|
|
147
|
+
size="small"
|
|
148
|
+
color="grey"
|
|
149
|
+
onClick={() => {
|
|
150
|
+
toast.dismiss(toastId);
|
|
151
|
+
|
|
152
|
+
// Ensure saving is directly propagated before waiting for the retry
|
|
153
|
+
setActionQueueStatusActual("pending");
|
|
154
|
+
|
|
155
|
+
setTimeout(() => {
|
|
156
|
+
// By setting the status to done, the effect will be triggered
|
|
157
|
+
// with the latest action to process.
|
|
158
|
+
setActionQueueStatusActual("done");
|
|
159
|
+
setActionQueueStack((prevState) => ({
|
|
160
|
+
nextAction: prevState.nextAction ?? prevState.pendingAction,
|
|
161
|
+
pendingAction: undefined,
|
|
162
|
+
}));
|
|
163
|
+
}, retryDelay);
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
{retryMessage}
|
|
167
|
+
</Button>
|
|
168
|
+
</Box>
|
|
169
|
+
),
|
|
170
|
+
{
|
|
171
|
+
autoClose: false,
|
|
172
|
+
closeOnClick: false,
|
|
173
|
+
draggable: false,
|
|
174
|
+
toastId,
|
|
175
|
+
},
|
|
176
|
+
);
|
|
177
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useSelector } from "react-redux";
|
|
2
|
+
|
|
3
|
+
import { getAuthStatus } from "@src/modules/environment";
|
|
4
|
+
import { SliceMachineStoreType } from "@src/redux/type";
|
|
5
|
+
|
|
6
|
+
export function useAuthStatus() {
|
|
7
|
+
const { authStatus } = useSelector((store: SliceMachineStoreType) => ({
|
|
8
|
+
authStatus: getAuthStatus(store),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
return authStatus;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const SyncFailed: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="20"
|
|
6
|
+
height="20"
|
|
7
|
+
viewBox="0 0 20 20"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<g clipPath="url(#clip0_11119_1080440)">
|
|
13
|
+
<path
|
|
14
|
+
d="M4.43868 8.23554L5.06668 7.9405L5.01013 7.24895C5.00343 7.16706 5 7.08404 5 7C5 5.34315 6.34315 4 8 4C9.20763 4 10.2507 4.71358 10.7266 5.7464L11.1628 6.69299L12.0905 6.21805C12.3622 6.07893 12.6704 6 13 6C14.1046 6 15 6.89543 15 8C15 8.03818 14.9989 8.07605 14.9969 8.1136L14.9552 8.86338L15.6636 9.11245C16.4434 9.38659 17 10.1296 17 11C17 12.1046 16.1046 13 15 13V14C16.6569 14 18 12.6569 18 11C18 9.69203 17.163 8.57956 15.9953 8.16905C15.9984 8.1131 16 8.05673 16 8C16 6.34315 14.6569 5 13 5C12.5961 5 12.2108 5.07982 11.8591 5.22454C11.7827 5.25599 11.7079 5.29049 11.6348 5.32791C11.5887 5.22784 11.5386 5.13 11.4847 5.03459C10.7981 3.81994 9.4948 3 8 3C5.79086 3 4 4.79086 4 7C4 7.11127 4.00454 7.22148 4.01346 7.33046C2.82373 7.88942 2 9.09851 2 10.5C2 12.2632 3.30385 13.7219 5 13.9646V12.95C3.85888 12.7184 3 11.7095 3 10.5C3 9.50045 3.58659 8.63588 4.43868 8.23554Z"
|
|
15
|
+
fill="#6F6E77"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
fillRule="evenodd"
|
|
19
|
+
clipRule="evenodd"
|
|
20
|
+
d="M7.32913 10.1715C7.13387 10.3667 7.13387 10.6833 7.32913 10.8786L9.45048 12.9999L7.32906 15.1213C7.1338 15.3166 7.1338 15.6332 7.32906 15.8285C7.52432 16.0237 7.8409 16.0237 8.03616 15.8285L10.1576 13.707L12.2789 15.8283C12.4741 16.0236 12.7907 16.0236 12.986 15.8283C13.1812 15.6331 13.1812 15.3165 12.986 15.1212L10.8647 12.9999L12.9859 10.8787C13.1812 10.6834 13.1812 10.3669 12.9859 10.1716C12.7906 9.97634 12.4741 9.97634 12.2788 10.1716L10.1576 12.2928L8.03624 10.1715C7.84098 9.97621 7.5244 9.97621 7.32913 10.1715Z"
|
|
21
|
+
fill="#6F6E77"
|
|
22
|
+
/>
|
|
23
|
+
</g>
|
|
24
|
+
<defs>
|
|
25
|
+
<clipPath id="clip0_11119_1080440">
|
|
26
|
+
<rect width="20" height="20" fill="white" />
|
|
27
|
+
</clipPath>
|
|
28
|
+
</defs>
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const Synced: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="20"
|
|
6
|
+
height="20"
|
|
7
|
+
viewBox="0 0 20 20"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M15.5 6L8 15.5L4.5 11"
|
|
14
|
+
stroke="#6F6E77"
|
|
15
|
+
strokeLinecap="round"
|
|
16
|
+
strokeLinejoin="round"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const Syncing: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="20"
|
|
6
|
+
height="20"
|
|
7
|
+
viewBox="0 0 20 20"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M4.43868 8.23554L5.06668 7.9405L5.01013 7.24895C5.00343 7.16706 5 7.08404 5 7C5 5.34315 6.34315 4 8 4C9.20763 4 10.2507 4.71358 10.7266 5.7464L11.1628 6.69299L12.0905 6.21805C12.3622 6.07893 12.6704 6 13 6C14.1046 6 15 6.89543 15 8C15 8.03818 14.9989 8.07605 14.9969 8.1136L14.9552 8.86338L15.6636 9.11245C16.4434 9.38659 17 10.1296 17 11C17 12.1046 16.1046 13 15 13V14C16.6569 14 18 12.6569 18 11C18 9.69203 17.163 8.57956 15.9953 8.16905C15.9984 8.1131 16 8.05673 16 8C16 6.34315 14.6569 5 13 5C12.5961 5 12.2108 5.07982 11.8591 5.22454C11.7827 5.25599 11.7079 5.29049 11.6348 5.32791C11.5887 5.22784 11.5386 5.13 11.4847 5.03459C10.7981 3.81994 9.4948 3 8 3C5.79086 3 4 4.79086 4 7C4 7.11127 4.00454 7.22148 4.01346 7.33046C2.82373 7.88942 2 9.09851 2 10.5C2 12.2632 3.30385 13.7219 5 13.9646V12.95C3.85888 12.7184 3 11.7095 3 10.5C3 9.50045 3.58659 8.63588 4.43868 8.23554Z"
|
|
14
|
+
fill="#6F6E77"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
d="M10 9.79289L13.3536 13.1464L12.6464 13.8536L10.5 11.7071V17.5H9.5V11.7071L7.35355 13.8536L6.64645 13.1464L10 9.79289Z"
|
|
20
|
+
fill="#6F6E77"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { render as rtlRender, RenderOptions } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
3
|
import { Store, AnyAction } from "redux";
|
|
4
|
+
import { ErrorBoundary } from "@prismicio/editor-ui";
|
|
4
5
|
|
|
5
6
|
import { Provider } from "react-redux";
|
|
6
7
|
import type { SliceMachineStoreType } from "../../src/redux/type";
|
|
@@ -41,11 +42,13 @@ function render(
|
|
|
41
42
|
children: any;
|
|
42
43
|
}) {
|
|
43
44
|
return (
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
<ErrorBoundary>
|
|
46
|
+
<ThemeUIThemeProvider theme={theme}>
|
|
47
|
+
<BaseStyles>
|
|
48
|
+
<Provider store={store}>{children}</Provider>
|
|
49
|
+
</BaseStyles>
|
|
50
|
+
</ThemeUIThemeProvider>
|
|
51
|
+
</ErrorBoundary>
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
54
|
return {
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { type FC } from "react";
|
|
2
|
-
import Link from "next/link";
|
|
3
|
-
import { useRouter } from "next/router";
|
|
4
|
-
|
|
5
|
-
import { SideNavLink, SideNavListItem } from "@src/components/SideNav";
|
|
6
|
-
import { RadarIcon } from "@src/icons/RadarIcon";
|
|
7
|
-
import {
|
|
8
|
-
HoverCard,
|
|
9
|
-
HoverCardCloseButton,
|
|
10
|
-
HoverCardDescription,
|
|
11
|
-
HoverCardMedia,
|
|
12
|
-
HoverCardTitle,
|
|
13
|
-
} from "@src/components/HoverCard";
|
|
14
|
-
import useSliceMachineActions from "@src/modules/useSliceMachineActions";
|
|
15
|
-
|
|
16
|
-
import { ChangesRightElement } from "./ChangesRightElement";
|
|
17
|
-
|
|
18
|
-
export const ChangesListItem: FC = () => {
|
|
19
|
-
const { setSeenChangesToolTip } = useSliceMachineActions();
|
|
20
|
-
const open = useOpenChangesHoverCard();
|
|
21
|
-
const router = useRouter();
|
|
22
|
-
|
|
23
|
-
const onClose = () => {
|
|
24
|
-
setSeenChangesToolTip();
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<HoverCard
|
|
29
|
-
open={open}
|
|
30
|
-
openDelay={3000}
|
|
31
|
-
onClose={onClose}
|
|
32
|
-
side="right"
|
|
33
|
-
sideOffset={24}
|
|
34
|
-
collisionPadding={280}
|
|
35
|
-
trigger={
|
|
36
|
-
<SideNavListItem>
|
|
37
|
-
<SideNavLink
|
|
38
|
-
title="Changes"
|
|
39
|
-
href="/changes"
|
|
40
|
-
active={router.asPath.startsWith("/changes")}
|
|
41
|
-
component={Link}
|
|
42
|
-
Icon={RadarIcon}
|
|
43
|
-
RightElement={<ChangesRightElement />}
|
|
44
|
-
/>
|
|
45
|
-
</SideNavListItem>
|
|
46
|
-
}
|
|
47
|
-
>
|
|
48
|
-
<HoverCardTitle>Push your changes</HoverCardTitle>
|
|
49
|
-
<HoverCardMedia component="image" src="/push.png" />
|
|
50
|
-
<HoverCardDescription>
|
|
51
|
-
When you click Save, your changes are saved locally. Then, you can push
|
|
52
|
-
your models to Prismic from the Changes page.
|
|
53
|
-
</HoverCardDescription>
|
|
54
|
-
<HoverCardCloseButton>Got it</HoverCardCloseButton>
|
|
55
|
-
</HoverCard>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// TODO(DT-1925): Reactivate this feature
|
|
60
|
-
const useOpenChangesHoverCard = () => {
|
|
61
|
-
// const { hasSeenChangesToolTip, hasSeenSimulatorToolTip } = useSelector(
|
|
62
|
-
// (store: SliceMachineStoreType) => ({
|
|
63
|
-
// hasSeenChangesToolTip: userHasSeenChangesToolTip(store),
|
|
64
|
-
// hasSeenSimulatorToolTip: userHasSeenSimulatorToolTip(store),
|
|
65
|
-
// }),
|
|
66
|
-
// );
|
|
67
|
-
|
|
68
|
-
// return (
|
|
69
|
-
// !hasSeenChangesToolTip &&
|
|
70
|
-
// hasSeenSimulatorToolTip
|
|
71
|
-
// );
|
|
72
|
-
|
|
73
|
-
return false;
|
|
74
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
|
|
3
|
-
import { useUnSyncChanges } from "@src/hooks/useUnSyncChanges";
|
|
4
|
-
import { RightElement } from "@src/components/SideNav/SideNav";
|
|
5
|
-
import { AuthStatus } from "@src/modules/userContext/types";
|
|
6
|
-
import { useNetwork } from "@src/hooks/useNetwork";
|
|
7
|
-
|
|
8
|
-
export const ChangesRightElement: FC = () => {
|
|
9
|
-
const isOnline = useNetwork();
|
|
10
|
-
const { unSyncedSlices, unSyncedCustomTypes, authStatus } =
|
|
11
|
-
useUnSyncChanges();
|
|
12
|
-
const numberOfChanges = unSyncedSlices.length + unSyncedCustomTypes.length;
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
!isOnline ||
|
|
16
|
-
authStatus === AuthStatus.UNAUTHORIZED ||
|
|
17
|
-
authStatus === AuthStatus.FORBIDDEN
|
|
18
|
-
) {
|
|
19
|
-
return <RightElement>Logged out</RightElement>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (numberOfChanges === 0) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const formattedNumberOfChanges = numberOfChanges > 9 ? "+9" : numberOfChanges;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<RightElement type="pill" data-cy="changes-number">
|
|
30
|
-
{formattedNumberOfChanges}
|
|
31
|
-
</RightElement>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{54132:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var r=t(62230),o=t(85244),i=t(98240),c=t(52322);t(2784);var d=t(75289),a=function(e){var n=e.bg,t=e.background,o=e.sx,i=e.withRadius,a=e.radius,s=e.children;return(0,c.jsx)(d.xu,{sx:(0,r.Z)({p:4,bg:n||t},i?{borderBottomLeftRadius:a,borderBottomRightRadius:a}:null,o),children:s})},s=function(e){var n=e.Header,t=void 0===n?null:n,s=e.SubHeader,l=void 0===s?null:s,u=e.Body,v=void 0===u?null:u,f=e.Footer,m=void 0===f?null:f,h=e.borderFooter,p=e.radius,b=void 0===p?"6px":p,g=e.bodySx,Z=e.footerSx,x=e.sx,_=e.bg,y=e.background,C=e.children,j=(0,i.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(d.Zb,(0,o.Z)((0,r.Z)({sx:(0,r.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:b},void 0===x?null:x)},j),{children:[t?(0,c.jsx)(t,{radius:b}):null,l?(0,c.jsx)(l,{radius:b}):null,(0,c.jsxs)(a,{bg:_,background:y,sx:void 0===g?{}:g,withRadius:!m,children:[v?(0,c.jsx)(v,{}):null,C||null]}),m?(0,c.jsx)(a,{bg:_,background:y,sx:(0,r.Z)({},void 0!==h&&h?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===Z?{}:Z),radius:b,withRadius:!0,children:"object"==typeof m?m:(0,c.jsx)(m,{})}):null]}))}},75329:function(e,n,t){"use strict";t.d(n,{Sn:function(){return d},lS:function(){return r},nG:function(){return o},pq:function(){return a},rd:function(){return c},xo:function(){return i}});var r=["components"],o=["png","jpg","jpeg"],i=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",d="SM_HELP_VIDEOS/mock_data",a="slice-machine-simulator"},38876:function(e,n,t){"use strict";t.d(n,{MP:function(){return i},T3:function(){return d},Ti:function(){return o},lV:function(){return a}});var r=/-(\w)/g;function o(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function i(e){return e?(e=e.replace(/_/g,"-").replace(r,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var c=/\B([A-Z])/g;function d(e){var n;return e.replace(c,"-$1").toLowerCase().replace(/-/g,"_")}var a=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},24804:function(e,n,t){"use strict";t.d(n,{Zb:function(){return p},T$:function(){return g},eW:function(){return Z},ZB:function(){return b},Lm:function(){return x}});var r=t(67557),o=t(62230),i=t(85244),c=t(98240),d=t(52322),a=t(50002),s=t(22715),l=t(6277),u=t(2784);t(71457);var v={solid:"_1ecs97d3c _1ecs97dap _1ecs97d4pk _1ecs97d4wx",outlined:"_1ecs97d2i _1ecs97d9v _1ecs97dw _1ecs97d89 _1ecs97d2w _1ecs97da9 _1ecs97d4oq _1ecs97d4w3 _1ecs97d4oc _1ecs97d4vp"},f={div:"_1ecs97dez0 _1ecs97dez3 _1ecs97dezd",img:"kedahr9 _1ecs97df77 _1ecs97dezn"},m={small:"kedahr2",medium:"kedahr3"},h={solid:"kedahr4 _1ecs97d1u _1ecs97d97 _1ecs97d4pe _1ecs97d4wr",outlined:"kedahr5 _1ecs97d18 _1ecs97d8l _1ecs97d4o6 _1ecs97d4vj"},p=function(e){var n,t=e.checked,s=e.size,f=e.variant,p=void 0===f?"solid":f,b=(e.interactive,e.disabled,e.onClick,e.href,e.component),g=void 0===b?"a":b,Z=(e.replace,(0,c.Z)(e,["checked","size","variant","interactive","disabled","onClick","href","component","replace"])),x=(0,i.Z)((0,o.Z)({},Z),{className:(0,l.W)("_1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dez1 _1ecs97dezr _1ecs97dezv",m[void 0===s?"medium":s],h[p],(n={},(0,r.Z)(n,"kedahr6",e.interactive),(0,r.Z)(n,v[p],e.interactive),n)),"data-state":!0===(void 0!==t&&t)?"checked":void 0});return!0===e.interactive&&void 0===e.href?(0,d.jsx)("div",(0,i.Z)((0,o.Z)({},x),{"data-disabled":!0===e.disabled?"":void 0,onClick:function(n){if(!0!==e.disabled&&void 0!==e.onClick){var t=n.target;(0,a.JY)(t)===n.currentTarget&&e.onClick(n)}},tabIndex:!0===e.disabled?void 0:0})):!0===e.interactive?(0,u.createElement)(g,(0,o.Z)((0,i.Z)((0,o.Z)({},x),{href:e.href,onClick:function(e){var n=e.target;(0,a.JY)(n)!==e.currentTarget&&e.preventDefault()}}),"a"===g?{}:{replace:e.replace})):(0,d.jsx)("div",(0,o.Z)({},x))},b=function(e){var n=e.className,t=e.component,r=void 0===t?"img":t,a=e.overlay,s=(0,c.Z)(e,["className","component","overlay"]);return(0,d.jsxs)("div",{className:"kedahr7 _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df7d _1ecs97dezv",children:[(0,u.createElement)(r,(0,i.Z)((0,o.Z)({},s),{className:(0,l.W)(f[r],n)})),Boolean(a)?(0,d.jsx)("div",{className:"kedahra _1ecs97dez0 _1ecs97dez3 _1ecs97df9d _1ecs97dezt _1ecs97df0i",children:a}):void 0]})},g=function(e){return(0,d.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"kedahrc kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df71 _1ecs97dezi"}))},Z=function(e){var n=e.action,t=e.subtitle,r=e.title,a=(0,c.Z)(e,["action","subtitle","title"]);return(0,d.jsxs)("div",(0,i.Z)((0,o.Z)({},a),{className:"kedahrd kedahrb _1ecs97dez0 _1ecs97dez2 _1ecs97dez8 _1ecs97dez1 _1ecs97dezc _1ecs97df92 _1ecs97df73",children:[(0,d.jsxs)("div",{className:"kedahre _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97deze _1ecs97dezd _1ecs97df51",children:[(0,d.jsx)(s.xv,{component:"span",noWrap:!0,variant:"bold",children:r}),(0,d.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,variant:"small",children:t})]}),n]}))},x=function(e){var n=e.children,t=(0,c.Z)(e,["children"]);return(0,d.jsx)("div",(0,i.Z)((0,o.Z)({},t),{className:"kedahrf _1ecs97dez0 _1ecs97dez2 _1ecs97dezb _1ecs97df6v _1ecs97dfb5 _1ecs97dezh _1ecs97dfhi _1ecs97dezt",children:(0,d.jsx)(s.xv,{align:"center",color:"inherit",component:"span",noWrap:!0,variant:"smallBold",children:n})}))}},5479:function(e,n,t){"use strict";t.d(n,{AK:function(){return h},Dj:function(){return u},Kp:function(){return m},L4:function(){return p},PQ:function(){return x},cx:function(){return l},d7:function(){return v},fo:function(){return Z},gR:function(){return g},ux:function(){return f},xS:function(){return b}});var r=t(67557),o=t(62230),i=t(85244),c=t(17064),d=t(81541),a=t(38876),s="default";function l(e){return e.model.variations.length-Object.keys(e.screenshots).length}function u(e){var n,t,r;return null!==(r=null!==(t=null===(n=e.config)||void 0===n?void 0:n.label)&&void 0!==t?t:"Group"===e.type||"Slice"===e.type||"Boolean"!==e.type&&"Separator"!==e.type?e.fieldset:void 0)&&void 0!==r?r:e.type}function v(e,n){var t;return null===(t=e.screenshots[n.id])||void 0===t?void 0:t.url}function f(e,n){var t={},r={};if("type"in e){if("Slice"===e.type){for(var o in e["non-repeat"])t[o]=e["non-repeat"][o].type;for(var i in e.repeat)r[i]=e.repeat[i].type}else if("Group"===e.type)for(var c in null===(l=e.config)||void 0===l?void 0:l.fields)r[c]=null!==(v=null===(u=e.config)||void 0===u?void 0:u.fields[c].type)&&void 0!==v?v:"";else t[n]=e.type}else if("id"in e){var d=!0,a=!1,s=void 0;try{for(var l,u,v,f,m,h=(null!==(f=e.primary)&&void 0!==f?f:[])[Symbol.iterator]();!(d=(m=h.next()).done);d=!0){var p=m.value,b=p.key,g=p.value;t[b]=g.type}}catch(Z){a=!0,s=Z}finally{try{d||null==h.return||h.return()}finally{if(a)throw s}}var x=!0,_=!1,y=void 0;try{for(var C,j,k=(null!==(C=e.items)&&void 0!==C?C:[])[Symbol.iterator]();!(x=(j=k.next()).done);x=!0){var z=j.value,S=z.key,w=z.value;r[S]=w.type}}catch(T){_=!0,y=T}finally{try{x||null==k.return||k.return()}finally{if(_)throw y}}}return{primary:JSON.stringify(Object.keys(t).sort().map(function(e){return[e,t[e]]})),items:JSON.stringify(Object.keys(r).sort().map(function(e){return[e,r[e]]}))}}function m(e){var n=e.slice,t=e.id,r=e.name,c=e.copiedVariation,d=(0,i.Z)((0,o.Z)({},c),{id:t,name:r});return{slice:(0,i.Z)((0,o.Z)({},n),{model:(0,i.Z)((0,o.Z)({},n.model),{variations:n.model.variations.concat([d])})}),variation:d}}function h(e){var n=e.slice,t=e.variationId,c=e.widgetArea,d=e.fieldId;return(0,i.Z)((0,o.Z)({},n),{model:(0,i.Z)((0,o.Z)({},n.model),{variations:n.model.variations.map(function(e){if(e.id===t){var n;return(0,i.Z)((0,o.Z)({},e),(0,r.Z)({},c,null===(n=e[c])||void 0===n?void 0:n.filter(function(e){return e.key!==d})))}return e})})})}function p(e){var n=e.slice,t=e.variationId,c=e.widgetArea,d=e.previousFieldId,a=e.newFieldId,s=e.newField;return(0,i.Z)((0,o.Z)({},n),{model:(0,i.Z)((0,o.Z)({},n.model),{variations:n.model.variations.map(function(e){if(e.id===t){var n;return(0,i.Z)((0,o.Z)({},e),(0,r.Z)({},c,null===(n=e[c])||void 0===n?void 0:n.map(function(e){return e.key===d?{key:a,value:s}:e})))}return e})})})}function b(e){var n=e.slice,t=e.variationId,c=e.widgetArea,d=e.newFieldId,a=e.newField;return(0,i.Z)((0,o.Z)({},n),{model:(0,i.Z)((0,o.Z)({},n.model),{variations:n.model.variations.map(function(e){if(e.id===t){var n;return(0,i.Z)((0,o.Z)({},e),(0,r.Z)({},c,null===(n=e[c])||void 0===n?void 0:n.concat([{key:d,value:a},])))}return e})})})}function g(e){var n,t,a=e.slice,s=e.variationId,l=e.widgetArea,u=e.sourceIndex,v=e.destinationIndex,f=null!==(t=null===(n=a.model.variations.find(function(e){return e.id===s}))||void 0===n?void 0:n[l])&&void 0!==t?t:[],m=(0,d.Z)(f),h=(0,c.Z)(m.splice(u,1),1)[0];return m.splice(v,0,h),(0,i.Z)((0,o.Z)({},a),{model:(0,i.Z)((0,o.Z)({},a.model),{variations:a.model.variations.map(function(e){return e.id===s?(0,i.Z)((0,o.Z)({},e),(0,r.Z)({},l,m)):e})})})}function Z(e){return{id:(0,a.T3)(e),type:"SharedSlice",name:e,description:e,variations:[{id:s,name:(0,a.MP)(s),docURL:"...",version:"initial",description:(0,a.MP)(s),imageUrl:""},]}}function x(e,n){return(0,i.Z)((0,o.Z)({},e),{model:(0,i.Z)((0,o.Z)({},e.model),{name:n})})}},34728:function(e,n,t){"use strict";t.d(n,{O:function(){return d}});var r=t(52322),o=t(22715),i=t(32681),c=t(79096),d=function(e){var n=function(e){var n=a[e.modelType];switch(e.modelStatus){case i.G.New:return{badgeColor:"green",badgeTitle:"New",tooltipContent:"This ".concat(n," exists only locally. Upon sync, it will be pushed to your remote repository.")};case i.G.Modified:return{badgeColor:"amber",badgeTitle:"Modified",tooltipContent:"This ".concat(n," has been modified locally. Upon sync, changes will be pushed to your remote repository.")};case i.G.Synced:return{badgeColor:"purple",badgeTitle:"Synced",tooltipContent:"This ".concat(n," is in sync with the remote repository.")};case i.G.Deleted:return{badgeColor:"tomato",badgeTitle:"Deleted",tooltipContent:"This ".concat(n," has been deleted locally.")};case i.G.Unknown:if(!e.isOnline)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (no internet connection)."};if(e.authStatus===c.t.UNAUTHORIZED)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (not connected to Prismic)."};if(e.authStatus===c.t.FORBIDDEN)return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (you don't have access to the repository)."};default:return{badgeColor:"grey",badgeTitle:"Unknown",tooltipContent:"Data from the remote repository could not be fetched (unknown error)."}}}(e),t=n.badgeColor,d=n.badgeTitle,s=n.tooltipContent;return(0,r.jsx)(o.u,{content:s,side:"bottom",children:(0,r.jsx)(o.Ct,{color:t,title:d})})},a={CustomType:"type",Slice:"slice"}},71749:function(e,n,t){"use strict";t.d(n,{b:function(){return b}});var r=t(62230),o=t(85244),i=t(52322),c=t(22715),d=t(39097),a=t.n(d),s=t(67557),l=t(17064),u={build:function(e){var n;return(0,o.Z)((0,r.Z)({},e),{screenshots:(n=e.screenshots)?Object.entries(n).reduce(function(e,n){var t,i=(0,l.Z)(n,2),c=i[0],d=i[1];return d.hash?(0,o.Z)((0,r.Z)({},e),(0,s.Z)({},c,(0,r.Z)({},d,{hash:d.hash}))):e},{}):{}})},variation:function(e,n){if(e.model.variations.length)return n?e.model.variations.find(function(e){return e.id===n}):e.model.variations[0]}},v=t(24804),f=t(5479),m=t(34728),h=t(49451),p=function(e){return(0,i.jsx)("svg",(0,o.Z)((0,r.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5.5C4 4.67157 4.67157 4 5.5 4H18.5C19.3284 4 20 4.67157 20 5.5V12.4413C20 12.4512 19.9997 12.461 19.9991 12.4707C20.0072 12.6083 19.9586 12.7485 19.8536 12.8536C19.6583 13.0488 19.3417 13.0488 19.1464 12.8536L16.3536 10.0607C16.1583 9.8654 15.8417 9.8654 15.6464 10.0607L11.8536 13.8536C11.6583 14.0488 11.3417 14.0488 11.1464 13.8536L9.35355 12.0607C9.15829 11.8654 8.84171 11.8654 8.64645 12.0607L5 15.7071V18.5C5 18.7761 5.22386 19 5.5 19H12.5C12.7761 19 13 19.2239 13 19.5C13 19.7761 12.7761 20 12.5 20H5.5C4.67157 20 4 19.3284 4 18.5V15.5003V15.4997V5.5ZM11.5 12.7929L14.9393 9.35355C15.5251 8.76777 16.4749 8.76777 17.0607 9.35355L19 11.2929V5.5C19 5.22386 18.7761 5 18.5 5H5.5C5.22386 5 5 5.22386 5 5.5V14.2929L7.93934 11.3536C8.52513 10.7678 9.47487 10.7678 10.0607 11.3536L11.5 12.7929ZM16.5 13C16.7761 13 17 13.2239 17 13.5V16H19.5C19.7761 16 20 16.2239 20 16.5C20 16.7761 19.7761 17 19.5 17H17V19.5C17 19.7761 16.7761 20 16.5 20C16.2239 20 16 19.7761 16 19.5V17H13.5C13.2239 17 13 16.7761 13 16.5C13 16.2239 13.2239 16 13.5 16H16V13.5C16 13.2239 16.2239 13 16.5 13Z",fill:"currentColor"})}))},b=function(e){var n,t=e.action,d=e.isComingSoon,s=void 0!==d&&d,l=e.isDeleted,b=e.onUpdateScreenshot,x=e.selected,_=void 0!==x&&x,y=e.slice,C=e.variant,j=e.variationId,k=u.variation(y,j);if(!k)return null;var z=(0,f.d7)(y,k),S=s||void 0!==l&&l,w=!S&&!!b,T="outlined"===C,I=void 0!==j;return n="selection"===e.mode?{disabled:S,interactive:!0,onClick:function(){e.onSelectedChange(!_)}}:S?{interactive:!1}:{component:a(),href:h.Y.getBuilderPagePathname({libraryName:y.href,sliceName:y.model.name,variationId:k.id}),interactive:!0,replace:e.replace},(0,i.jsxs)(v.Zb,(0,o.Z)((0,r.Z)({"aria-label":"".concat(y.model.name," ").concat(k.name," slice card"),checked:_,"data-cy":"shared-slice-card","data-testid":"shared-slice-card"},n,"outlined"===C?{size:"small",variant:"outlined"}:{}),{children:[void 0!==z?(0,i.jsx)(v.ZB,{alt:"Preview image",overlay:w&&!T?(0,i.jsx)(c.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(g,{onClick:b})}):void 0,src:z}):(0,i.jsx)(v.ZB,{component:"div",children:(0,i.jsxs)(c.xu,{alignItems:"center",flexDirection:"column",gap:8,justifyContent:"center",children:[(0,i.jsx)(c.xv,{color:"grey11",component:"span",children:"No screenshot available"}),w&&!T?(0,i.jsx)(g,{onClick:b}):void 0]})}),(0,i.jsx)(v.eW,{action:"checkbox"===t.type&&"selection"===e.mode?(0,i.jsx)("div",{onClick:function(e){return e.stopPropagation()},children:(0,i.jsx)(c.XZ,{checked:_,disabled:S,onCheckedChange:e.onSelectedChange})}):"menu"===t.type?(0,i.jsxs)(c.h_,{modal:!0,children:[(0,i.jsx)(c.$F,{disabled:S,children:(0,i.jsx)(c.hU,{hiddenLabel:"Slice actions",icon:"moreVert"})}),(0,i.jsxs)(c.AW,{align:"end","data-cy":"slice-action-icon-dropdown",children:[w&&T?(0,i.jsx)(c.Xi,{onSelect:b,startIcon:(0,i.jsx)(p,{}),children:"Update screenshot"}):void 0,(0,i.jsx)(c.Xi,{onSelect:t.onRename,startIcon:(0,i.jsx)(c.I5,{name:"edit"}),children:"Rename"}),!0===t.removeDisabled&&I?(0,i.jsx)(c.u,{content:"The slice needs to have at least one variation.",side:"bottom",stableMount:!0,children:(0,i.jsx)(Z,{disabled:!0,onSelect:t.onRemove})}):(0,i.jsx)(Z,{disabled:!0===t.removeDisabled,onSelect:t.onRemove})]})]}):"remove"===t.type?(0,i.jsx)(c.hU,{icon:"close",onClick:function(){return!S&&t.onRemove()},hiddenLabel:"Remove slice"}):"status"===t.type?(0,i.jsx)(m.O,{authStatus:t.authStatus,isOnline:t.isOnline,modelStatus:t.modelStatus,modelType:"Slice"}):void 0,subtitle:(0,i.jsxs)(i.Fragment,{children:[I?k.id:"".concat(y.model.variations.length," variation").concat(y.model.variations.length>1?"s":""),s?(0,i.jsxs)(c.xv,{color:"purple11",component:"span",variant:"small",children:[" ","• (coming soon)"]}):void 0]}),title:I?k.name:y.model.name}),w&&!I&&(0,f.cx)(y)>0?(0,i.jsx)(v.Lm,{children:"Missing screenshot"}):void 0]}))},g=function(e){return(0,i.jsx)(c.zx,{onClick:e.onClick,renderStartIcon:function(){return(0,i.jsx)(p,{color:c.TV.color.greyLight11})},color:"grey",children:"Update screenshot"})},Z=function(e){return(0,i.jsx)(c.Xi,(0,o.Z)((0,r.Z)({},e),{color:"tomato",startIcon:(0,i.jsx)(c.I5,{name:"delete"}),children:"Delete"}))}},49451:function(e,n,t){"use strict";t.d(n,{Y:function(){return r}});var r={getBuilderPagePathname:function(e){return"/slices/".concat(e.libraryName.replaceAll("/","--"),"/").concat(e.sliceName,"/").concat(e.variationId)}}},71457:function(){}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[727],{54132:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(62230),a=r(85244),s=r(98240),c=r(52322);r(2784);var i=r(75289),l=function(e){var n=e.bg,r=e.background,a=e.sx,s=e.withRadius,l=e.radius,o=e.children;return(0,c.jsx)(i.xu,{sx:(0,t.Z)({p:4,bg:n||r},s?{borderBottomLeftRadius:l,borderBottomRightRadius:l}:null,a),children:o})},o=function(e){var n=e.Header,r=void 0===n?null:n,o=e.SubHeader,u=void 0===o?null:o,d=e.Body,f=void 0===d?null:d,h=e.Footer,x=void 0===h?null:h,p=e.borderFooter,m=e.radius,C=void 0===m?"6px":m,g=e.bodySx,j=e.footerSx,v=e.sx,b=e.bg,_=e.background,y=e.children,S=(0,s.Z)(e,["Header","SubHeader","Body","Footer","borderFooter","radius","bodySx","footerSx","sx","bg","background","children"]);return(0,c.jsxs)(i.Zb,(0,a.Z)((0,t.Z)({sx:(0,t.Z)({border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))},borderRadius:C},void 0===v?null:v)},S),{children:[r?(0,c.jsx)(r,{radius:C}):null,u?(0,c.jsx)(u,{radius:C}):null,(0,c.jsxs)(l,{bg:b,background:_,sx:void 0===g?{}:g,withRadius:!x,children:[f?(0,c.jsx)(f,{}):null,y||null]}),x?(0,c.jsx)(l,{bg:b,background:_,sx:(0,t.Z)({},void 0!==p&&p?{borderTop:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}}:null,void 0===j?{}:j),radius:C,withRadius:!0,children:"object"==typeof x?x:(0,c.jsx)(x,{})}):null]}))}},58882:function(e,n,r){"use strict";r.d(n,{M:function(){return z}});var t=r(22710),a=r(62230),s=r(85244),c=r(99267),i=r(52322),l=r(2784),o=r(75289),u=r(56580),d=r(5632),f=r(68780),h=r(90374),x=r(31667),p=r(38876),m=r(75329),C=r(78656),g=r(88932),j=r(13858),v=r(82770),b=r(91061);function _(){return(_=(0,t.Z)(function(e){var n,r,t,a,s,i,l,o,u,d;return(0,c.__generator)(this,function(c){switch(c.label){case 0:n=e.id,r=e.label,t=e.repeatable,a=e.format,s=e.onSuccess,i=C.$[a],l=(0,b.Ue)({id:n,label:r,repeatable:t,format:a}),c.label=1;case 1:return c.trys.push([1,4,,5]),[4,(0,v.KA)(l)];case 2:if((o=c.sent().errors).length>0)throw o;return v.Xe.track({event:"custom-type:created",id:l.id,name:r,format:a,type:t?"repeatable":"single",origin:"table"}),[4,s(l)];case 3:return c.sent(),g.Am.success((0,j.GX)({message:"".concat(i.name({start:!0,plural:!1})," saved successfully at "),path:"./customtypes/".concat(l.id,"/index.json")})),[3,5];case 4:return u=c.sent(),d="Internal Error: ".concat(i.name({start:!0,plural:!1})," not saved"),console.error(d,u),g.Am.error(d),[3,5];case 5:return[2]}})})).apply(this,arguments)}var y=r(67445),S=r(70041),w=r(17064),L=r(63397),Z=r(98240),T=function(e){var n=e.selected,r=(0,Z.Z)(e,["selected"]);return(0,i.jsx)(o.kC,(0,a.Z)({sx:{p:"24px",mb:3,alignItems:"top",cursor:"pointer",borderRadius:"6px",backgroundColor:"grayLight",boxShadow:n?function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}:"none","&:hover":{boxShadow:function(e){var n;return"0 0 0 2px ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.primary))}}}},r))},k=function(e){var n=e.format,r=(0,w.Z)((0,L.U$)("repeatable"),3),t=r[0],a=r[2],s=C.$[n];return(0,i.jsxs)(o.xu,{mb:2,children:[(0,i.jsxs)(T,{selected:t.value,onClick:function(){return a.setValue(!0)},children:[(0,i.jsx)(o.Y8,{checked:t.value,onChange:function(){},"data-cy":"repeatable-type-radio-btn"}),(0,i.jsxs)(o.xu,{sx:{marginLeft:2},children:["Reusable type",(0,i.jsx)(o.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:s.hintRepeatable})]})]}),(0,i.jsxs)(T,{selected:!t.value,onClick:function(){return a.setValue(!1)},children:[(0,i.jsx)(o.Y8,{checked:!t.value,onChange:function(){},"data-cy":"single-type-radio-btn"}),(0,i.jsxs)(o.xu,{sx:{marginLeft:2},children:["Single type",(0,i.jsx)(o.xu,{as:"p",sx:{fontSize:"12px",color:"textClear",mt:1},children:s.hintSingle})]})]})]})},z=function(e){var n,r=e.format,g=e.isCreating,j=e.isOpen,v=e.origin,w=void 0===v?"table":v,L=e.onCreateChange,Z=e.onOpenChange,T=(0,h.Z)().createCustomTypeSuccess,z=(0,u.v9)(function(e){return{customTypeIds:(0,x.W6)(e),customTypeLabels:(0,x.YS)(e)}}),H=z.customTypeIds,R=z.customTypeLabels,N=C.$[r],I=(0,l.useState)(!0),V=I[0],M=I[1],E=(0,d.useRouter)(),F=(n=(0,t.Z)(function(e){var n,a,s;return(0,c.__generator)(this,function(i){switch(i.label){case 0:var l;return n=e.id,a=e.label,s=e.repeatable,L(!0),[4,function(e){return _.apply(this,arguments)}({format:r,id:n,label:a,origin:w,repeatable:s,onSuccess:(l=(0,t.Z)(function(e){var r,t;return(0,c.__generator)(this,function(a){switch(a.label){case 0:return T(e),r=(0,b.y6)(e),t=y.cd[r],M(!0),[4,E.push({pathname:t.getBuilderPagePathname(n),query:"page"===e.format?{newPageType:!0}:void 0})];case 1:return a.sent(),[2]}})}),function(e){return l.apply(this,arguments)})})];case 1:return i.sent(),L(!1),Z(!1),[2]}})}),function(e){return n.apply(this,arguments)}),P=function(e,n,r){r(V?(0,s.Z)((0,a.Z)({},n),{label:e.target.value,id:(0,p.lV)(e.target.value)}):(0,s.Z)((0,a.Z)({},n),{label:e.target.value}))},A=function(e,n){n("id",e.target.value),M(!1)};return(0,i.jsx)(f.Z,{dataCy:"create-ct-modal",isOpen:j,widthInPx:"530px",formId:"create-custom-type",buttonLabel:"Create",close:function(){Z(!1),M(!0)},onSubmit:function(e){F(e)},isLoading:g,initialValues:{repeatable:!0,id:"",label:""},validate:function(e){var n=e.id,r=e.label,t={};return r&&r.length||(t.label="Cannot be empty."),!t.label&&R.includes(r)&&(t.label="".concat(N.name({start:!0,plural:!1})," name is already taken.")),n&&n.length||(t.id="ID cannot be empty."),t.id||!n||m.xo.exec(n)||(t.id="Invalid id: No special characters allowed."),!t.id&&n&&H.map(function(e){return e.toLowerCase()}).includes(n)&&(t.id='ID "'.concat(n,'" exists already.')),Object.keys(t).length>0?t:void 0},content:{title:"Create a new ".concat(N.name({start:!1,plural:!1}))},children:function(e){var n=e.errors,t=e.setValues,a=e.setFieldValue,s=e.values,c=e.touched;return(0,i.jsxs)(o.xu,{children:[(0,i.jsx)(k,{format:r}),(0,i.jsx)(S.W,{name:"label",label:"".concat(N.name({start:!0,plural:!1})," Name"),dataCy:"ct-name-input",placeholder:"A display name for the ".concat(N.name({start:!1,plural:!1})),error:c.label?n.label:void 0,onChange:function(e){return P(e,s,t)}}),(0,i.jsx)(S.W,{name:"id",dataCy:"ct-id-input",label:"".concat(N.name({start:!0,plural:!1})," ID"),placeholder:N.inputPlaceholder,error:c.id?n.id:void 0,onChange:function(e){return A(e,a)}})]})}})}},75329:function(e,n,r){"use strict";r.d(n,{Sn:function(){return i},lS:function(){return t},nG:function(){return a},pq:function(){return l},rd:function(){return c},xo:function(){return s}});var t=["components"],a=["png","jpg","jpeg"],s=/^[A-Za-z0-9]+(?:_[A-Za-z0-9]+)*$/,c="placeholders/What_are_Slices_mrvome",i="SM_HELP_VIDEOS/mock_data",l="slice-machine-simulator"},38876:function(e,n,r){"use strict";r.d(n,{MP:function(){return s},T3:function(){return i},Ti:function(){return a},lV:function(){return l}});var t=/-(\w)/g;function a(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function s(e){return e?(e=e.replace(/_/g,"-").replace(t,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var c=/\B([A-Z])/g;function i(e){var n;return e.replace(c,"-$1").toLowerCase().replace(/-/g,"_")}var l=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},840:function(e,n,r){"use strict";r.d(n,{F:function(){return F}});var t=r(52322),a=r(2784),s=r(22715),c=r(97729),i=r.n(c),l=r(31005),o=r(58882),u=r(78656),d=r(5632),f=r(67557),h=r(50002),x=r(6277);r(64117);var p=function(e){var n=e.children;return(0,t.jsx)("div",{className:"_1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezr",children:(0,t.jsx)("table",{className:"gdfsm51 _1ecs97dez0 _1ecs97dez5 _1ecs97df3p _1ecs97df4v",children:n})})},m=(0,a.createContext)("body");function C(){return(0,a.useContext)(m)}var g=function(e){var n=e.children;return(0,t.jsx)(m.Provider,{value:"head",children:(0,t.jsx)("thead",{className:"gdfsm52 _1ecs97dez0 _1ecs97dez5 _1ecs97d18 _1ecs97d8l",children:n})})},j=function(e){var n=e.children;return(0,t.jsx)(m.Provider,{value:"body",children:(0,t.jsx)("tbody",{className:"gdfsm53 _1ecs97dez0 _1ecs97dez5",children:n})})},v=function(e){var n,r=e.children,a=e.onClick,s=C();return(0,t.jsx)("tr",{className:(0,x.W)("_1ecs97dez0 _1ecs97dez5 _1ecs97df71",(n={},(0,f.Z)(n,"_1ecs97df41",!!a),(0,f.Z)(n,"_1ecs97dm _1ecs97d7z _1ecs97d3c _1ecs97dap _1ecs97d2w _1ecs97da9 _1ecs97df74 _1ecs97dfj8 _1ecs97df0d _1ecs97dfjb","body"===s),n)),onClick:function(e){var n,r=e.target;if(a&&e.currentTarget.contains(r)){var t=(0,h.JY)(r);(null===(n=null==t?void 0:t.contains(e.currentTarget))||void 0===n||n)&&a(e)}},children:r})},b=function(e){var n=e.children,r=C();return(0,t.jsx)("head"===r?"th":"td",{className:"gdfsm55 _1ecs97dez0 _1ecs97dez5 _1ecs97d3fg _1ecs97d3mt _1ecs97df2h _1ecs97dez1 _1ecs97da62 _1ecs97dadf _1ecs97df45 _1ecs97dfhi",children:(0,t.jsx)("div",{className:"gdfsm56 _1ecs97dez0 _1ecs97dez2",children:n})})},_=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0912 12C13.2794 12 11 14.2794 11 17.0912C11 19.903 13.2794 22.1824 16.0912 22.1824C17.9763 22.1824 19.6215 21.1577 20.501 19.6372C20.6563 19.3688 20.7878 19.0849 20.8926 18.7883C20.9846 18.5279 20.8482 18.2422 20.5878 18.1502C20.3275 18.0582 20.0418 18.1947 19.9498 18.455C19.8657 18.693 19.7601 18.9209 19.6354 19.1365C18.9273 20.3606 17.6049 21.1824 16.0912 21.1824C13.8317 21.1824 12 19.3507 12 17.0912C12 14.8317 13.8317 13 16.0912 13C17.4478 13 18.6507 13.66 19.3955 14.6782H17.6216C17.3455 14.6782 17.1216 14.9021 17.1216 15.1782C17.1216 15.4544 17.3455 15.6782 17.6216 15.6782H20.2998C20.576 15.6782 20.7998 15.4544 20.7998 15.1782V12.5C20.7998 12.2239 20.576 12 20.2998 12C20.0237 12 19.7998 12.2239 19.7998 12.5V13.6032C18.8717 12.6167 17.5536 12 16.0912 12Z",fill:"white"})]})},y=function(){return(0,t.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M8 28H24C25.1046 28 26 27.1046 26 26V9L21 4H8C6.89543 4 6 4.89543 6 6V26C6 27.1046 6.89543 28 8 28Z",fill:"#6E56CF"}),(0,t.jsx)("path",{d:"M23 9H26L21 4V7C21 8.10457 21.8954 9 23 9Z",fill:"#9E8CFC"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.0869 14.6818L14.6627 12.3787C14.7183 12.1561 14.9183 12 15.1477 12C15.473 12 15.7117 12.3057 15.6328 12.6213L15.1177 14.6818H17.7232L18.299 12.3787C18.3547 12.1561 18.5547 12 18.7841 12C19.1094 12 19.3481 12.3057 19.2692 12.6213L18.754 14.6818H21C21.2761 14.6818 21.5 14.9057 21.5 15.1818C21.5 15.458 21.2761 15.6818 21 15.6818H18.504L17.8449 18.3182H20C20.2761 18.3182 20.5 18.542 20.5 18.8182C20.5 19.0943 20.2761 19.3182 20 19.3182H17.5949L17.0192 21.6213C16.9635 21.8439 16.7635 22 16.5341 22C16.2088 22 15.9701 21.6943 16.049 21.3787L16.5642 19.3182H13.9586L13.3828 21.6213C13.3272 21.8439 13.1272 22 12.8977 22C12.5724 22 12.3338 21.6943 12.4127 21.3787L12.9278 19.3182H11C10.7239 19.3182 10.5 19.0943 10.5 18.8182C10.5 18.542 10.7239 18.3182 11 18.3182H13.1778L13.8369 15.6818H12C11.7239 15.6818 11.5 15.458 11.5 15.1818C11.5 14.9057 11.7239 14.6818 12 14.6818H14.0869ZM16.8142 18.3182L17.4732 15.6818H14.8677L14.2086 18.3182H16.8142Z",fill:"white"})]})},S=r(2754),w=r(67445),L=r(19345),Z=r(22710),T=r(99267),k=r(56580),z=r(17329),H=r(81038),R=r(31667),N=r(7819),I=r(14137);function V(e){return M.apply(this,arguments)}function M(){return(M=(0,Z.Z)(function(e){var n,r,t;return(0,T.__generator)(this,function(a){switch(a.label){case 0:return[4,H.j.customTypes.readAllCustomTypes({format:e})];case 1:if(r=(n=a.sent()).errors,t=n.models,r.length>0)throw r;return[2,t.map(function(e){return e.model})]}})})).apply(this,arguments)}var E=function(e){var n,r,c,i,l,o,f=e.format,h=e.isCreatingCustomType,x=e.openCreateCustomTypeModal,m=(0,d.useRouter)(),C=(r=(0,a.useCallback)(function(e){return(0,z.VA)(V,[f],e)},[f]),{customTypes:(0,z.QT)(V,[f]),updateCustomTypes:r}),Z=C.customTypes,T=C.updateCustomTypes,H=Z.sort(function(e,n){return e.id.localeCompare(n.id)}),M=w.cd[f],E=u.$[f];return(o=(0,k.v9)(function(e){return{storeCustomTypes:(0,R.Ch)(e).filter(N.TG)}}).storeCustomTypes,(0,a.useEffect)(function(){var e=o.filter(function(e){return e.local.format===f});(e.length!==Z.length||e.some(function(e){var n=Z.find(function(n){return n.id===e.local.id});return!n||JSON.stringify(I.Dc.fromSM(e.local))!==JSON.stringify(n)}))&&T(e.map(function(e){var n=e.local;return I.Dc.fromSM(n)}))},[f,T,Z,o]),0===H.length)?(0,t.jsxs)(S.R$,{style:{alignSelf:"center",marginTop:s.TV.size[72]},children:[(0,t.jsx)(S.u2,{children:(0,t.jsx)(s.Ee,{src:M.blankSlateImage,sizing:"cover"})}),(0,t.jsxs)(S.T9,{children:[(0,t.jsx)(S._T,{children:E.name({start:!0,plural:!0})}),(0,t.jsx)(S.nf,{children:E.blankSlateDescription}),(0,t.jsx)(S.Qj,{children:(0,t.jsx)(s.zx,{onClick:x,loading:h,children:"Create"})})]})]}):(0,t.jsxs)(p,{children:[(0,t.jsx)(g,{children:(0,t.jsxs)(v,{children:[(0,t.jsx)(b,{children:(0,t.jsx)(s.I5,{name:"notes",size:"medium"})}),(0,t.jsx)(b,{children:"Label"}),(0,t.jsx)(b,{children:"API ID"}),(0,t.jsx)(b,{children:"Limit"}),(0,t.jsx)(b,{})]})}),(0,t.jsx)(j,{children:H.map(function(e){var n=e.repeatable,r=e.label,a=e.id;return(0,t.jsxs)(v,{onClick:function(){m.push(w.cd[f].getBuilderPagePathname(a))},children:[(0,t.jsx)(b,{children:n?(0,t.jsx)(_,{}):(0,t.jsx)(y,{})}),(0,t.jsx)(b,{children:r}),(0,t.jsx)(b,{children:a}),(0,t.jsx)(b,{children:n?"Reusable":"Single"}),(0,t.jsx)(b,{children:(0,t.jsx)(L._,{isChangesLocal:!1,format:f,customType:e})})]},a)})})]})},F=function(e){var n=e.format,r=u.$[n],c=(0,a.useState)(!1),d=c[0],f=c[1],h=(0,a.useState)(!1),x=h[0],p=h[1];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsxs)("title",{children:[r.name({start:!0,plural:!0})," - Slice Machine"]})}),(0,t.jsx)(s.SV,{renderError:function(){return(0,t.jsx)(l.LN,{children:(0,t.jsx)(l.RN,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your ".concat(r.name({start:!1,plural:!0}),".")})})})})},children:(0,t.jsx)(a.Suspense,{fallback:(0,t.jsxs)(l.LN,{children:[(0,t.jsxs)(l.wd,{children:[(0,t.jsx)(l.Cx,{folder:r.name({start:!0,plural:!0})}),(0,t.jsx)(l.K2,{children:(0,t.jsx)(s.zx,{disabled:!0,startIcon:"add",children:"Create"})})]}),(0,t.jsx)(l.RN,{children:(0,t.jsx)(s._3,{})})]}),children:(0,t.jsxs)(l.LN,{children:[(0,t.jsxs)(l.wd,{children:[(0,t.jsx)(l.Cx,{folder:r.name({start:!0,plural:!0})}),(0,t.jsx)(l.K2,{children:(0,t.jsx)(s.zx,{"data-cy":"create-ct",loading:d,onClick:function(){p(!0)},startIcon:"add",children:"Create"})})]}),(0,t.jsx)(l.RN,{children:(0,t.jsxs)(s.xu,{flexDirection:"column",children:[(0,t.jsx)(E,{format:n,isCreatingCustomType:d,openCreateCustomTypeModal:function(){p(!0)}}),(0,t.jsx)(o.M,{format:n,isCreating:d,isOpen:x,onCreateChange:f,onOpenChange:p})]})})]})})})]})}},64117:function(){}}]);
|