slice-machine-ui 1.19.2-dev-in-app-guide.2 → 1.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/components/Navigation/index.tsx +0 -1
  2. package/out/404.html +1 -1
  3. package/out/_next/static/8rc3TRisi8gOyPYwHa35C/_buildManifest.js +1 -0
  4. package/out/_next/static/chunks/{474-2393e400314474be.js → 125-e3857af2068bbedf.js} +2 -2
  5. package/out/_next/static/chunks/18539003-1bb05c8aa7db2bc2.js +97 -0
  6. package/out/_next/static/chunks/482-bfe6dbc93fb63a0d.js +1 -0
  7. package/out/_next/static/chunks/{550-e72c08c598051224.js → 550-1dafbcec5d50b384.js} +1 -1
  8. package/out/_next/static/chunks/{125-f0e2eb84ee39757a.js → 585-f3dca093db4b3792.js} +3 -1
  9. package/out/_next/static/chunks/{80-821a0b5d4ad61185.js → 80-c513d12da6156fb7.js} +1 -1
  10. package/out/_next/static/chunks/840-c317c8ff8de0f202.js +1 -0
  11. package/out/_next/static/chunks/904-438ff06c6c7e18f3.js +1 -0
  12. package/out/_next/static/chunks/958-4f94d552d296c608.js +1 -0
  13. package/out/_next/static/chunks/pages/_app-19c4fbcd62918db2.js +428 -0
  14. package/out/_next/static/chunks/pages/{changelog-fa36b9995c26e1d7.js → changelog-75b0bf58d1f3045d.js} +1 -1
  15. package/out/_next/static/chunks/pages/{changes-e388be4457a43c3a.js → changes-9dcb1cdaa8b10560.js} +1 -1
  16. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-3a37eb3373bb8823.js → [customTypeId]-aa37e07c96c8f9b5.js} +1 -1
  17. package/out/_next/static/chunks/pages/index-5266b7f0ca55025a.js +1 -0
  18. package/out/_next/static/chunks/pages/labs-2349c21fbac1bd23.js +1 -0
  19. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-733f3890c0466a05.js → [pageTypeId]-d445f5cabeb460c0.js} +1 -1
  20. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-dda1f32608129e23.js → simulator-5e441f8b049cf91b.js} +1 -1
  21. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-2282320bb9091898.js → [variation]-c9b5ff7076d2b19b.js} +1 -1
  22. package/out/_next/static/chunks/pages/{slices-22db04643850c1d8.js → slices-247c480530e98426.js} +1 -1
  23. package/out/_next/static/css/{3e88bd24e38f18d0.css → 1fbd45881dcf43c4.css} +1 -1
  24. package/out/_next/static/css/{867d8d7ab4a75762.css → 22d69420bda374a7.css} +1 -1
  25. package/out/_next/static/css/{16b41648cd1de03b.css → 26b51745402a92af.css} +1 -1
  26. package/out/_next/static/css/66b3836ab88b0c5c.css +1 -0
  27. package/out/_next/static/css/{6e4843007ff41825.css → e4f4acc81f000d9c.css} +1 -1
  28. package/out/_next/static/css/{51597cd1f01c4889.css → f585032018f6024b.css} +1 -1
  29. package/out/changelog.html +1 -1
  30. package/out/changes.html +1 -1
  31. package/out/custom-types/[customTypeId].html +1 -1
  32. package/out/custom-types.html +1 -1
  33. package/out/index.html +1 -1
  34. package/out/labs.html +1 -1
  35. package/out/page-types/[pageTypeId].html +1 -1
  36. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  37. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  38. package/out/slices.html +1 -1
  39. package/package.json +7 -7
  40. package/pages/_app.tsx +37 -38
  41. package/src/components/ContentTabs/ContentTabs.css.ts +1 -1
  42. package/src/components/SideNav/SideNav.css.ts +11 -11
  43. package/src/features/labs/labsList/LabsListItem.tsx +1 -1
  44. package/out/_next/static/JtXmprA4ZlF_tsZXgw4Gi/_buildManifest.js +0 -1
  45. package/out/_next/static/chunks/18539003-371d86ea83e7293b.js +0 -97
  46. package/out/_next/static/chunks/482-39cef3a713901788.js +0 -1
  47. package/out/_next/static/chunks/840-884e41a48b92e5d3.js +0 -1
  48. package/out/_next/static/chunks/904-55ff54caf14254dc.js +0 -1
  49. package/out/_next/static/chunks/958-be627006594efb21.js +0 -1
  50. package/out/_next/static/chunks/pages/_app-6a64c583ef6e4158.js +0 -439
  51. package/out/_next/static/chunks/pages/index-d8e3a2c0d712904f.js +0 -1
  52. package/out/_next/static/chunks/pages/labs-ebce03a4e7a95a4e.js +0 -1
  53. package/out/_next/static/css/bca8066fd65eed7f.css +0 -1
  54. package/src/components/Counter/Counter.css.ts +0 -25
  55. package/src/components/Counter/Counter.stories.tsx +0 -24
  56. package/src/components/Counter/Counter.tsx +0 -18
  57. package/src/components/Counter/index.ts +0 -1
  58. package/src/features/inAppGuide/InAppGuideDialog.tsx +0 -109
  59. package/src/features/inAppGuide/inAppGuideContent.tsx +0 -68
  60. package/src/hooks/usePersistedState.ts +0 -23
  61. package/src/icons/FlowerBackgroundIcon.tsx +0 -16
  62. package/src/icons/HelpIcon.tsx +0 -19
  63. /package/out/_next/static/{JtXmprA4ZlF_tsZXgw4Gi → 8rc3TRisi8gOyPYwHa35C}/_ssgManifest.js +0 -0
@@ -1,25 +0,0 @@
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
- ]);
@@ -1,24 +0,0 @@
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;
@@ -1,18 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export { Counter } from "./Counter";
@@ -1,109 +0,0 @@
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 { usePersistedState } from "@src/hooks/usePersistedState";
18
- import { useIsEmptyProject } from "@src/hooks/useIsEmptyProject";
19
-
20
- import { IN_APP_GUIDE_CONTENT } from "./inAppGuideContent";
21
-
22
- export const InAppGuideDialog: FC = () => {
23
- const isEmptyProject = useIsEmptyProject();
24
- const [isInAppGuideOpen, setIsInAppGuideOpen] = usePersistedState(
25
- true,
26
- "isInAppGuideOpen",
27
- );
28
-
29
- // TODO: Use IconButton from @prismicio/editor-ui
30
- const trigger =
31
- isInAppGuideOpen === false && isEmptyProject === false ? (
32
- <Box position="fixed" right={16} bottom={16}>
33
- <button
34
- style={{
35
- all: "unset",
36
- display: "flex",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- cursor: "pointer",
40
- borderRadius: "50%",
41
- backgroundColor: vars.color.greyDark1,
42
- border: `1px solid ${vars.color.greyDark6}`,
43
- height: 32,
44
- width: 32,
45
- }}
46
- onClick={() => {
47
- setIsInAppGuideOpen(!isInAppGuideOpen);
48
- }}
49
- >
50
- <HelpIcon />
51
- </button>
52
- </Box>
53
- ) : undefined;
54
-
55
- return (
56
- <Dialog
57
- trigger={trigger}
58
- modal={false}
59
- open={isInAppGuideOpen && isEmptyProject === false}
60
- onOpenChange={(open) => {
61
- setIsInAppGuideOpen(open);
62
- }}
63
- position="bottomRight"
64
- size={{
65
- width: 360,
66
- height: 440,
67
- }}
68
- >
69
- <DialogHeader title={IN_APP_GUIDE_CONTENT.title} />
70
- <DialogContent>
71
- <ScrollArea>
72
- {IN_APP_GUIDE_CONTENT.steps.map((content, index) => (
73
- <Box key={index} flexDirection="column">
74
- <Box flexDirection="column" padding={16} gap={8}>
75
- <Box alignItems="center" gap={8}>
76
- <Counter backgroundIcon={<FlowerBackgroundIcon />}>
77
- {index + 1}
78
- </Counter>
79
- <Text component="h3" variant="bold">
80
- {content.title}
81
- </Text>
82
- </Box>
83
- <Video
84
- src={content.videoUrl}
85
- sizing="contain"
86
- autoPlay
87
- controls
88
- loop
89
- />
90
- <Text>{content.description}</Text>
91
- </Box>
92
-
93
- <Separator />
94
- </Box>
95
- ))}
96
-
97
- <Box flexDirection="column" padding={16} gap={4}>
98
- <Text variant="bold">{IN_APP_GUIDE_CONTENT.successTitle}</Text>
99
- <Box flexDirection="column">
100
- {IN_APP_GUIDE_CONTENT.successSteps.map((content, index) => (
101
- <Text key={index}>• {content}</Text>
102
- ))}
103
- </Box>
104
- </Box>
105
- </ScrollArea>
106
- </DialogContent>
107
- </Dialog>
108
- );
109
- };
@@ -1,68 +0,0 @@
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://images.prismic.io/page-builder-assets/8f5df837-d8c2-4aed-832c-dec21d3915d0_New+Recording+Jul+18+2023+0350+PM.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://images.prismic.io/page-builder-assets/8f5df837-d8c2-4aed-832c-dec21d3915d0_New+Recording+Jul+18+2023+0350+PM.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://images.prismic.io/page-builder-assets/8f5df837-d8c2-4aed-832c-dec21d3915d0_New+Recording+Jul+18+2023+0350+PM.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://images.prismic.io/page-builder-assets/8f5df837-d8c2-4aed-832c-dec21d3915d0_New+Recording+Jul+18+2023+0350+PM.mp4",
31
- description: (
32
- <>
33
- In your{" "}
34
- <TextLink href="TODO" 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://images.prismic.io/page-builder-assets/8f5df837-d8c2-4aed-832c-dec21d3915d0_New+Recording+Jul+18+2023+0350+PM.mp4",
46
- description: (
47
- <>
48
- Run your project on{" "}
49
- <TextLink href="TODO" underline>
50
- localhost
51
- </TextLink>{" "}
52
- to see your first page.
53
- </>
54
- ),
55
- },
56
- ],
57
- successTitle: "You have made your first page!",
58
- successSteps: [
59
- "Edit, and style your slices",
60
- "Create more pages in the Page Builder",
61
- <>
62
- Learn how to{" "}
63
- <TextLink href="TODO" underline>
64
- manage your routes
65
- </TextLink>
66
- </>,
67
- ],
68
- };
@@ -1,23 +0,0 @@
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
- }
@@ -1,16 +0,0 @@
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
- );
@@ -1,19 +0,0 @@
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
- );