slice-machine-ui 1.19.2-dev-next-release.6 → 1.19.2-dev-in-app-guide.3
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/Navigation/index.tsx +13 -17
- package/components/ReviewModal/ReviewForm.tsx +2 -2
- package/components/ReviewModal/ReviewModal.tsx +7 -0
- package/out/404.html +1 -1
- package/out/_next/static/chunks/{585-f3dca093db4b3792.js → 125-f0e2eb84ee39757a.js} +1 -3
- package/out/_next/static/chunks/18539003-371d86ea83e7293b.js +97 -0
- package/out/_next/static/chunks/{125-e3857af2068bbedf.js → 474-2393e400314474be.js} +2 -2
- package/out/_next/static/chunks/482-39cef3a713901788.js +1 -0
- package/out/_next/static/chunks/{550-1dafbcec5d50b384.js → 550-e72c08c598051224.js} +1 -1
- package/out/_next/static/chunks/{80-c513d12da6156fb7.js → 80-821a0b5d4ad61185.js} +1 -1
- package/out/_next/static/chunks/840-884e41a48b92e5d3.js +1 -0
- package/out/_next/static/chunks/904-55ff54caf14254dc.js +1 -0
- package/out/_next/static/chunks/958-be627006594efb21.js +1 -0
- package/out/_next/static/chunks/pages/_app-8a946d248c87dd25.js +439 -0
- package/out/_next/static/chunks/pages/{changelog-75b0bf58d1f3045d.js → changelog-fa36b9995c26e1d7.js} +1 -1
- package/out/_next/static/chunks/pages/{changes-9dcb1cdaa8b10560.js → changes-e388be4457a43c3a.js} +1 -1
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-aa37e07c96c8f9b5.js → [customTypeId]-3a37eb3373bb8823.js} +1 -1
- package/out/_next/static/chunks/pages/index-d8e3a2c0d712904f.js +1 -0
- package/out/_next/static/chunks/pages/labs-ebce03a4e7a95a4e.js +1 -0
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-d445f5cabeb460c0.js → [pageTypeId]-733f3890c0466a05.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-5e441f8b049cf91b.js → simulator-dda1f32608129e23.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-c9b5ff7076d2b19b.js → [variation]-2282320bb9091898.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-247c480530e98426.js → slices-22db04643850c1d8.js} +1 -1
- package/out/_next/static/css/{26b51745402a92af.css → 16b41648cd1de03b.css} +1 -1
- package/out/_next/static/css/{1fbd45881dcf43c4.css → 3e88bd24e38f18d0.css} +1 -1
- package/out/_next/static/css/{f585032018f6024b.css → 51597cd1f01c4889.css} +1 -1
- package/out/_next/static/css/{e4f4acc81f000d9c.css → 6e4843007ff41825.css} +1 -1
- package/out/_next/static/css/{22d69420bda374a7.css → 867d8d7ab4a75762.css} +1 -1
- package/out/_next/static/css/bca8066fd65eed7f.css +1 -0
- package/out/_next/static/iKwyM9kme9G-Y_a_L-e6V/_buildManifest.js +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 +7 -7
- package/pages/_app.tsx +34 -29
- package/src/components/ContentTabs/ContentTabs.css.ts +1 -1
- package/src/components/Counter/Counter.css.ts +25 -0
- package/src/components/Counter/Counter.stories.tsx +24 -0
- package/src/components/Counter/Counter.tsx +18 -0
- package/src/components/Counter/index.ts +1 -0
- package/src/components/SideNav/SideNav.css.ts +11 -11
- package/src/features/inAppGuide/InAppGuideContext.tsx +49 -0
- package/src/features/inAppGuide/InAppGuideDialog.tsx +112 -0
- package/src/features/inAppGuide/inAppGuideContent.tsx +60 -0
- package/src/features/labs/labsList/LabsListItem.tsx +1 -1
- package/src/hooks/usePersistedState.ts +23 -0
- package/src/hooks/useRepositoryInformation.ts +24 -0
- package/src/icons/FlowerBackgroundIcon.tsx +16 -0
- package/src/icons/HelpIcon.tsx +19 -0
- package/out/_next/static/66j49QzF8CgRcsFMiHqJx/_buildManifest.js +0 -1
- package/out/_next/static/chunks/18539003-1bb05c8aa7db2bc2.js +0 -97
- package/out/_next/static/chunks/482-e6bbd1fcdcdf79ad.js +0 -1
- package/out/_next/static/chunks/840-c317c8ff8de0f202.js +0 -1
- package/out/_next/static/chunks/904-d5dfccdb4d9ab010.js +0 -1
- package/out/_next/static/chunks/958-2b881a5b68ff11ba.js +0 -1
- package/out/_next/static/chunks/pages/_app-8239471ebbdfbc5f.js +0 -428
- package/out/_next/static/chunks/pages/index-5266b7f0ca55025a.js +0 -1
- package/out/_next/static/chunks/pages/labs-2349c21fbac1bd23.js +0 -1
- package/out/_next/static/css/66b3836ab88b0c5c.css +0 -1
- /package/out/_next/static/{66j49QzF8CgRcsFMiHqJx → iKwyM9kme9G-Y_a_L-e6V}/_ssgManifest.js +0 -0
package/pages/_app.tsx
CHANGED
|
@@ -34,6 +34,7 @@ import { PersistGate } from "redux-persist/integration/react";
|
|
|
34
34
|
import { ThemeProvider as ThemeUIThemeProvider, useThemeUI } from "theme-ui";
|
|
35
35
|
|
|
36
36
|
import { AppLayout, AppLayoutContent } from "@components/AppLayout";
|
|
37
|
+
import { InAppGuideProvider } from "@src/features/inAppGuide/InAppGuideContext";
|
|
37
38
|
|
|
38
39
|
import SliceMachineApp from "../components/App";
|
|
39
40
|
import LoadingPage from "../components/LoadingPage";
|
|
@@ -129,35 +130,39 @@ function MyApp({
|
|
|
129
130
|
<Provider store={smStore.store}>
|
|
130
131
|
<ConnectedRouter Router={Router}>
|
|
131
132
|
<PersistGate loading={null} persistor={smStore.persistor}>
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
>
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
133
|
+
<ErrorBoundary
|
|
134
|
+
renderError={(error) => {
|
|
135
|
+
console.error(error);
|
|
136
|
+
|
|
137
|
+
return (
|
|
138
|
+
<AppLayout>
|
|
139
|
+
<AppLayoutContent>
|
|
140
|
+
<Box
|
|
141
|
+
alignItems="center"
|
|
142
|
+
justifyContent="center"
|
|
143
|
+
>
|
|
144
|
+
<DefaultErrorMessage
|
|
145
|
+
title="Error"
|
|
146
|
+
description="An error occurred while rendering the app."
|
|
147
|
+
/>
|
|
148
|
+
</Box>
|
|
149
|
+
</AppLayoutContent>
|
|
150
|
+
</AppLayout>
|
|
151
|
+
);
|
|
152
|
+
}}
|
|
153
|
+
>
|
|
154
|
+
<Suspense>
|
|
155
|
+
<InAppGuideProvider>
|
|
156
|
+
<RouteChangeProvider>
|
|
157
|
+
<Suspense fallback={<LoadingPage />}>
|
|
158
|
+
<ComponentLayout>
|
|
159
|
+
<Component {...pageProps} />
|
|
160
|
+
</ComponentLayout>
|
|
161
|
+
</Suspense>
|
|
162
|
+
</RouteChangeProvider>
|
|
163
|
+
</InAppGuideProvider>
|
|
164
|
+
</Suspense>
|
|
165
|
+
</ErrorBoundary>
|
|
161
166
|
</PersistGate>
|
|
162
167
|
</ConnectedRouter>
|
|
163
168
|
<ToastContainer />
|
|
@@ -30,7 +30,7 @@ export const trigger = style([
|
|
|
30
30
|
"&:not(:last-child)": { marginRight: vars.space[16] },
|
|
31
31
|
'&[data-state="active"]': {
|
|
32
32
|
boxShadow: "inset 0 -1px 0 0 currentColor, 0 1px 0 0 currentColor",
|
|
33
|
-
color: vars.color.
|
|
33
|
+
color: vars.color.purpleLight9,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { colors, sprinkles } from "@prismicio/editor-ui";
|
|
2
|
+
import { style } from "@vanilla-extract/css";
|
|
3
|
+
|
|
4
|
+
export const root = sprinkles({
|
|
5
|
+
all: "unset",
|
|
6
|
+
display: "inline-flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
position: "relative",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const count = style([
|
|
12
|
+
sprinkles({
|
|
13
|
+
all: "unset",
|
|
14
|
+
color: colors.grey1,
|
|
15
|
+
position: "absolute",
|
|
16
|
+
}),
|
|
17
|
+
{
|
|
18
|
+
fontSize: "9px",
|
|
19
|
+
fontWeight: 500,
|
|
20
|
+
left: "50%",
|
|
21
|
+
lineHeight: "32px",
|
|
22
|
+
top: "50%",
|
|
23
|
+
transform: "translate(-50%, -50%)",
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import { FlowerBackgroundIcon } from "@src/icons/FlowerBackgroundIcon";
|
|
4
|
+
|
|
5
|
+
import { Counter } from "./Counter";
|
|
6
|
+
|
|
7
|
+
type Story = StoryObj<typeof meta>;
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
component: Counter,
|
|
11
|
+
argTypes: {
|
|
12
|
+
backgroundIcon: { control: { disable: true } },
|
|
13
|
+
children: { control: { disable: true } },
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof Counter>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
export const Default = {
|
|
20
|
+
args: {
|
|
21
|
+
backgroundIcon: <FlowerBackgroundIcon />,
|
|
22
|
+
children: 1,
|
|
23
|
+
},
|
|
24
|
+
} satisfies Story;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import * as styles from "./Counter.css";
|
|
4
|
+
|
|
5
|
+
export type CounterProps = PropsWithChildren<{
|
|
6
|
+
backgroundIcon: ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
export const Counter: FC<CounterProps> = (props) => {
|
|
10
|
+
const { backgroundIcon, children } = props;
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles.root}>
|
|
14
|
+
{backgroundIcon}
|
|
15
|
+
<span className={styles.count}>{children}</span>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Counter } from "./Counter";
|
|
@@ -117,7 +117,7 @@ export const repositoryLinkIcon = style([
|
|
|
117
117
|
}),
|
|
118
118
|
{
|
|
119
119
|
":focus": {
|
|
120
|
-
borderColor: vars.color.
|
|
120
|
+
borderColor: vars.color.purpleLight10,
|
|
121
121
|
boxShadow: vars.boxShadow.focus,
|
|
122
122
|
},
|
|
123
123
|
},
|
|
@@ -208,13 +208,13 @@ export const link = style([
|
|
|
208
208
|
},
|
|
209
209
|
// Not Active & Focus
|
|
210
210
|
"&:not([data-active=true]):focus": {
|
|
211
|
-
borderColor: vars.color.
|
|
211
|
+
borderColor: vars.color.purpleLight10,
|
|
212
212
|
},
|
|
213
213
|
// Active & Default
|
|
214
214
|
"&[data-active=true]": {
|
|
215
|
-
backgroundColor: vars.color.
|
|
216
|
-
borderColor: vars.color.
|
|
217
|
-
color: vars.color.
|
|
215
|
+
backgroundColor: vars.color.purpleLight3,
|
|
216
|
+
borderColor: vars.color.purpleLight10,
|
|
217
|
+
color: vars.color.purpleLight10,
|
|
218
218
|
},
|
|
219
219
|
// Active & Hover
|
|
220
220
|
"&[data-active=true]:hover": {
|
|
@@ -222,7 +222,7 @@ export const link = style([
|
|
|
222
222
|
},
|
|
223
223
|
// Parent list item is open
|
|
224
224
|
'[data-state="open"] > &, [data-state="open"] > &:hover': {
|
|
225
|
-
borderColor: vars.color.
|
|
225
|
+
borderColor: vars.color.purpleLight10,
|
|
226
226
|
boxShadow: vars.boxShadow.focus,
|
|
227
227
|
},
|
|
228
228
|
},
|
|
@@ -239,7 +239,7 @@ export const linkIcon = style([
|
|
|
239
239
|
},
|
|
240
240
|
// Active
|
|
241
241
|
[`${link}[data-active=true] &`]: {
|
|
242
|
-
fill: vars.color.
|
|
242
|
+
fill: vars.color.purpleLight10,
|
|
243
243
|
},
|
|
244
244
|
},
|
|
245
245
|
},
|
|
@@ -283,9 +283,9 @@ export const rightElementPill = style([
|
|
|
283
283
|
selectors: {
|
|
284
284
|
// Not Active
|
|
285
285
|
[`${link}:not([data-active=true]) &`]: {
|
|
286
|
-
backgroundColor: vars.color.
|
|
287
|
-
borderColor: vars.color.
|
|
288
|
-
color: vars.color.
|
|
286
|
+
backgroundColor: vars.color.purpleLight9,
|
|
287
|
+
borderColor: vars.color.purpleLight10,
|
|
288
|
+
color: vars.color.purpleLight3,
|
|
289
289
|
},
|
|
290
290
|
// Active
|
|
291
291
|
[`${link}[data-active=true] &`]: {
|
|
@@ -373,7 +373,7 @@ export const updateInfoLink = style([
|
|
|
373
373
|
fontWeight: 600,
|
|
374
374
|
lineHeight: "24px",
|
|
375
375
|
":focus": {
|
|
376
|
-
borderColor: vars.color.
|
|
376
|
+
borderColor: vars.color.purpleLight10,
|
|
377
377
|
boxShadow: vars.boxShadow.focus,
|
|
378
378
|
},
|
|
379
379
|
selectors: {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dispatch,
|
|
3
|
+
FC,
|
|
4
|
+
PropsWithChildren,
|
|
5
|
+
SetStateAction,
|
|
6
|
+
createContext,
|
|
7
|
+
useContext,
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
import { usePersistedState } from "@src/hooks/usePersistedState";
|
|
11
|
+
|
|
12
|
+
import { InAppGuideDialog } from "./InAppGuideDialog";
|
|
13
|
+
|
|
14
|
+
type InAppGuideContextValue = {
|
|
15
|
+
isInAppGuideOpen: boolean;
|
|
16
|
+
setIsInAppGuideOpen: Dispatch<SetStateAction<boolean>>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const InAppGuideContext = createContext<
|
|
20
|
+
InAppGuideContextValue | undefined
|
|
21
|
+
>(undefined);
|
|
22
|
+
|
|
23
|
+
export const InAppGuideProvider: FC<PropsWithChildren> = (props) => {
|
|
24
|
+
const { children } = props;
|
|
25
|
+
const [isInAppGuideOpen, setIsInAppGuideOpen] = usePersistedState(
|
|
26
|
+
true,
|
|
27
|
+
"isInAppGuideOpen",
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<InAppGuideContext.Provider
|
|
32
|
+
value={{
|
|
33
|
+
isInAppGuideOpen,
|
|
34
|
+
setIsInAppGuideOpen,
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
<InAppGuideDialog />
|
|
39
|
+
</InAppGuideContext.Provider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const useInAppGuide = () => {
|
|
44
|
+
const context = useContext(InAppGuideContext);
|
|
45
|
+
if (context === undefined) {
|
|
46
|
+
throw new Error("useInAppGuide must be used within a InAppGuideProvider");
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Dialog,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogHeader,
|
|
7
|
+
ScrollArea,
|
|
8
|
+
Separator,
|
|
9
|
+
Text,
|
|
10
|
+
Video,
|
|
11
|
+
vars,
|
|
12
|
+
} from "@prismicio/editor-ui";
|
|
13
|
+
|
|
14
|
+
import { Counter } from "@src/components/Counter";
|
|
15
|
+
import { FlowerBackgroundIcon } from "@src/icons/FlowerBackgroundIcon";
|
|
16
|
+
import { HelpIcon } from "@src/icons/HelpIcon";
|
|
17
|
+
import { useIsEmptyProject } from "@src/hooks/useIsEmptyProject";
|
|
18
|
+
import { useRepositoryInformation } from "@src/hooks/useRepositoryInformation";
|
|
19
|
+
|
|
20
|
+
import { IN_APP_GUIDE_CONTENT } from "./inAppGuideContent";
|
|
21
|
+
import { useInAppGuide } from "./InAppGuideContext";
|
|
22
|
+
|
|
23
|
+
export const InAppGuideDialog: FC = () => {
|
|
24
|
+
const isEmptyProject = useIsEmptyProject();
|
|
25
|
+
const { isInAppGuideOpen, setIsInAppGuideOpen } = useInAppGuide();
|
|
26
|
+
const { repositoryUrl } = useRepositoryInformation();
|
|
27
|
+
|
|
28
|
+
// TODO: Use new IconButton component from editor-ui
|
|
29
|
+
const trigger =
|
|
30
|
+
isEmptyProject === false ? (
|
|
31
|
+
<Box position="fixed" right={16} bottom={16}>
|
|
32
|
+
<button
|
|
33
|
+
style={{
|
|
34
|
+
all: "unset",
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
cursor: "pointer",
|
|
39
|
+
borderRadius: "50%",
|
|
40
|
+
backgroundColor: vars.color.greyDark1,
|
|
41
|
+
border: `1px solid ${vars.color.greyDark6}`,
|
|
42
|
+
height: 32,
|
|
43
|
+
width: 32,
|
|
44
|
+
}}
|
|
45
|
+
onClick={() => {
|
|
46
|
+
setIsInAppGuideOpen(!isInAppGuideOpen);
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<HelpIcon />
|
|
50
|
+
</button>
|
|
51
|
+
</Box>
|
|
52
|
+
) : undefined;
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Dialog
|
|
56
|
+
trigger={trigger}
|
|
57
|
+
modal={false}
|
|
58
|
+
open={isInAppGuideOpen && isEmptyProject === false}
|
|
59
|
+
onOpenChange={(open) => {
|
|
60
|
+
setIsInAppGuideOpen(open);
|
|
61
|
+
}}
|
|
62
|
+
position="bottomRight"
|
|
63
|
+
size={{
|
|
64
|
+
width: 360,
|
|
65
|
+
height: 440,
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<DialogHeader title={IN_APP_GUIDE_CONTENT.title} />
|
|
69
|
+
<DialogContent>
|
|
70
|
+
<ScrollArea>
|
|
71
|
+
{IN_APP_GUIDE_CONTENT.steps.map((content, index) => (
|
|
72
|
+
<Box key={index} flexDirection="column">
|
|
73
|
+
<Box flexDirection="column" padding={16} gap={8}>
|
|
74
|
+
<Box alignItems="center" gap={8}>
|
|
75
|
+
<Counter backgroundIcon={<FlowerBackgroundIcon />}>
|
|
76
|
+
{index + 1}
|
|
77
|
+
</Counter>
|
|
78
|
+
<Text component="h3" variant="bold">
|
|
79
|
+
{content.title}
|
|
80
|
+
</Text>
|
|
81
|
+
</Box>
|
|
82
|
+
<Video
|
|
83
|
+
src={content.videoUrl}
|
|
84
|
+
sizing="contain"
|
|
85
|
+
autoPlay
|
|
86
|
+
controls
|
|
87
|
+
loop
|
|
88
|
+
/>
|
|
89
|
+
<Text>
|
|
90
|
+
{typeof content.description === "function"
|
|
91
|
+
? content.description(repositoryUrl)
|
|
92
|
+
: content.description}
|
|
93
|
+
</Text>
|
|
94
|
+
</Box>
|
|
95
|
+
|
|
96
|
+
<Separator />
|
|
97
|
+
</Box>
|
|
98
|
+
))}
|
|
99
|
+
|
|
100
|
+
<Box flexDirection="column" padding={16} gap={4}>
|
|
101
|
+
<Text variant="bold">{IN_APP_GUIDE_CONTENT.successTitle}</Text>
|
|
102
|
+
<Box flexDirection="column">
|
|
103
|
+
{IN_APP_GUIDE_CONTENT.successSteps.map((content, index) => (
|
|
104
|
+
<Text key={index}>• {content}</Text>
|
|
105
|
+
))}
|
|
106
|
+
</Box>
|
|
107
|
+
</Box>
|
|
108
|
+
</ScrollArea>
|
|
109
|
+
</DialogContent>
|
|
110
|
+
</Dialog>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TextLink } from "@prismicio/editor-ui";
|
|
2
|
+
|
|
3
|
+
export const IN_APP_GUIDE_CONTENT = {
|
|
4
|
+
title: "Build your first page in 5 minutes",
|
|
5
|
+
steps: [
|
|
6
|
+
{
|
|
7
|
+
title: "Add slice to your page",
|
|
8
|
+
videoUrl:
|
|
9
|
+
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/ADD_SLICE.mp4",
|
|
10
|
+
description:
|
|
11
|
+
"Try one of our templates to get started after the creation of your first page",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
title: "Code your page",
|
|
15
|
+
videoUrl:
|
|
16
|
+
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/CODE_SNIP.mp4",
|
|
17
|
+
description:
|
|
18
|
+
"Slice Machine provides code snippets. Copy-paste them into your page component to render your page.",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "Push models to the Page Builder",
|
|
22
|
+
videoUrl:
|
|
23
|
+
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PUSH.mp4",
|
|
24
|
+
description:
|
|
25
|
+
"You have just created some models, but you can't use them yet. First, you must push them to the Page Builder. The Page Builder is where you create content. Go head — push your models.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: "Create your first page",
|
|
29
|
+
videoUrl:
|
|
30
|
+
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/WRITE.mp4",
|
|
31
|
+
description: (repositoryUrl: string) => (
|
|
32
|
+
<>
|
|
33
|
+
In your{" "}
|
|
34
|
+
<TextLink href={repositoryUrl} underline>
|
|
35
|
+
Page Builder
|
|
36
|
+
</TextLink>
|
|
37
|
+
, create your first page. Add slices to the page to create content.
|
|
38
|
+
Then save and publish and come back here.
|
|
39
|
+
</>
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Render your page",
|
|
44
|
+
videoUrl:
|
|
45
|
+
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1700213517/IN-APP-GUIDE-SM/PREVIEW.mp4",
|
|
46
|
+
description: "Run your project on localhost to see your first page.",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
successTitle: "You have made your first page!",
|
|
50
|
+
successSteps: [
|
|
51
|
+
"Edit, and style your slices",
|
|
52
|
+
"Create more pages in the Page Builder",
|
|
53
|
+
<>
|
|
54
|
+
Learn how to{" "}
|
|
55
|
+
<TextLink href="TODO" underline>
|
|
56
|
+
manage your routes
|
|
57
|
+
</TextLink>
|
|
58
|
+
</>,
|
|
59
|
+
],
|
|
60
|
+
};
|
|
@@ -14,7 +14,7 @@ export const LabsListItem: FC<LabsListItemProps> = ({
|
|
|
14
14
|
children,
|
|
15
15
|
}) => {
|
|
16
16
|
return (
|
|
17
|
-
<Card variant="outlined"
|
|
17
|
+
<Card variant="outlined">
|
|
18
18
|
<Box gap={8} padding={16}>
|
|
19
19
|
<Box padding={{ top: 6 }}>
|
|
20
20
|
<Icon name="viewDay" size="medium" color="grey11" />
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
type PersistedState<T> = [T, Dispatch<SetStateAction<T>>];
|
|
4
|
+
|
|
5
|
+
export const SLICE_MACHINE_STORAGE_PREFIX = "slice-machine";
|
|
6
|
+
|
|
7
|
+
export function usePersistedState<T>(
|
|
8
|
+
defaultValue: T,
|
|
9
|
+
key: string,
|
|
10
|
+
): PersistedState<T> {
|
|
11
|
+
const computedKey = `${SLICE_MACHINE_STORAGE_PREFIX}_${key}`;
|
|
12
|
+
const [value, setValue] = useState<T>(() => {
|
|
13
|
+
const value = localStorage.getItem(computedKey);
|
|
14
|
+
|
|
15
|
+
return value !== null ? (JSON.parse(value) as T) : defaultValue;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
localStorage.setItem(computedKey, JSON.stringify(value));
|
|
20
|
+
}, [computedKey, value]);
|
|
21
|
+
|
|
22
|
+
return [value, setValue];
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useSelector } from "react-redux";
|
|
2
|
+
|
|
3
|
+
import { SliceMachineStoreType } from "@src/redux/type";
|
|
4
|
+
import { getApiEndpoint, getRepoName } from "@src/modules/environment";
|
|
5
|
+
|
|
6
|
+
// TODO: This hook should be extracted to a new manager endpoint
|
|
7
|
+
export function useRepositoryInformation() {
|
|
8
|
+
const { repositoryName, apiEndpoint } = useSelector(
|
|
9
|
+
(store: SliceMachineStoreType) => ({
|
|
10
|
+
repositoryName: getRepoName(store),
|
|
11
|
+
apiEndpoint: getApiEndpoint(store),
|
|
12
|
+
}),
|
|
13
|
+
);
|
|
14
|
+
const repositoryDomain = new URL(apiEndpoint).hostname.replace(".cdn", "");
|
|
15
|
+
const repositoryUrl = apiEndpoint
|
|
16
|
+
.replace(".cdn.", ".")
|
|
17
|
+
.replace("/api/v2", "");
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
repositoryName,
|
|
21
|
+
repositoryDomain,
|
|
22
|
+
repositoryUrl,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
|
|
3
|
+
export const FlowerBackgroundIcon: FC = () => (
|
|
4
|
+
<svg
|
|
5
|
+
width="16"
|
|
6
|
+
height="16"
|
|
7
|
+
viewBox="0 0 16 16"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
d="M16 8C15.9847 7.44998 15.8169 6.91443 15.5147 6.45381C15.2133 5.99404 14.7893 5.62622 14.2903 5.39293C14.4802 4.87612 14.5202 4.31673 14.4095 3.77778C14.298 3.23797 14.0375 2.74074 13.6586 2.34142C13.2584 1.96254 12.762 1.70285 12.2222 1.59046C11.6833 1.47978 11.1239 1.5198 10.6071 1.70966C10.3746 1.20988 10.0077 0.785015 9.54704 0.48361C9.08642 0.182205 8.55087 0.0136228 8 0C7.44998 0.0144742 6.91613 0.181354 6.45636 0.48361C5.99659 0.785866 5.63133 1.21073 5.4006 1.70966C4.88293 1.5198 4.32184 1.47808 3.78118 1.59046C3.24053 1.70115 2.74244 1.96169 2.34227 2.34142C1.96339 2.74159 1.70456 3.23968 1.59472 3.77863C1.48404 4.31758 1.52661 4.87697 1.71733 5.39293C1.21754 5.62622 0.791826 5.99319 0.488719 6.45296C0.185611 6.91273 0.0161771 7.44913 0 8C0.0170285 8.55087 0.185611 9.08642 0.488719 9.54704C0.791826 10.0068 1.21754 10.3746 1.71733 10.6071C1.52661 11.123 1.48404 11.6824 1.59472 12.2214C1.70541 12.7612 1.96339 13.2584 2.34142 13.6586C2.74159 14.0358 3.23882 14.2946 3.77778 14.4061C4.31673 14.5185 4.87612 14.4777 5.39293 14.2903C5.62622 14.7893 5.99319 15.2133 6.45381 15.5155C6.91358 15.8169 7.44998 15.9847 8 16C8.55087 15.9864 9.08642 15.8186 9.54704 15.5172C10.0077 15.2158 10.3746 14.7901 10.6071 14.2912C11.1213 14.4947 11.685 14.5432 12.2273 14.4308C12.7688 14.3184 13.2661 14.0502 13.6577 13.6586C14.0494 13.2669 14.3184 12.7697 14.4308 12.2273C14.5432 11.685 14.4947 11.1213 14.2903 10.6071C14.7893 10.3738 15.2133 10.0068 15.5155 9.54619C15.8169 9.08642 15.9847 8.55002 16 8Z"
|
|
13
|
+
fill="#6E56CF"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FC, SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const HelpIcon: FC<SVGProps<SVGSVGElement>> = (props) => (
|
|
4
|
+
<svg
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
fill="none"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M12.5 18.9824C15.9675 18.7377 18.7377 15.9675 18.9824 12.5H15.9691C15.7434 14.3094 14.3094 15.7434 12.5 15.9691V18.9824ZM15.9691 11.5H18.9824C18.7377 8.03251 15.9675 5.2623 12.5 5.01758V8.03095C14.3094 8.25657 15.7434 9.69064 15.9691 11.5ZM11.5 18.9824V15.9691C9.69064 15.7434 8.25657 14.3094 8.03095 12.5H5.01758C5.2623 15.9675 8.03251 18.7377 11.5 18.9824ZM5.01758 11.5H8.03095C8.25657 9.69064 9.69064 8.25657 11.5 8.03095V5.01758C8.03251 5.2623 5.2623 8.03251 5.01758 11.5ZM9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12Z"
|
|
16
|
+
fill="#EDEDEF"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,e,a,t,i,b,n,f,u){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":[c,i,b,"static/chunks/pages/index-5266b7f0ca55025a.js"],"/_error":["static/chunks/pages/_error-69b4f498bafdd188.js"],"/changelog":["static/chunks/870-0c7a8a9622de78b7.js","static/chunks/pages/changelog-75b0bf58d1f3045d.js"],"/changes":[e,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38d08f1e885b222d.js",s,a,"static/css/f585032018f6024b.css","static/chunks/pages/changes-9dcb1cdaa8b10560.js"],"/custom-types":[c,i,b,"static/chunks/pages/custom-types-2f5664d9492b13fb.js"],"/custom-types/[customTypeId]":[n,s,c,t,f,u,"static/chunks/pages/custom-types/[customTypeId]-aa37e07c96c8f9b5.js"],"/labs":["static/chunks/pages/labs-2349c21fbac1bd23.js"],"/page-types/[pageTypeId]":[n,s,c,t,f,u,"static/chunks/pages/page-types/[pageTypeId]-d445f5cabeb460c0.js"],"/slices":[e,s,a,"static/css/22d69420bda374a7.css","static/chunks/pages/slices-247c480530e98426.js"],"/slices/[lib]/[sliceName]/[variation]":[e,s,a,t,"static/css/e4f4acc81f000d9c.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c9b5ff7076d2b19b.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[e,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-1bb05c8aa7db2bc2.js","static/chunks/585-f3dca093db4b3792.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-5e441f8b049cf91b.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-2b881a5b68ff11ba.js","static/chunks/550-1dafbcec5d50b384.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/80-c513d12da6156fb7.js","static/chunks/482-e6bbd1fcdcdf79ad.js","static/chunks/840-c317c8ff8de0f202.js","static/css/26b51745402a92af.css","static/chunks/125-e3857af2068bbedf.js","static/chunks/904-d5dfccdb4d9ab010.js","static/css/1fbd45881dcf43c4.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|