slice-machine-ui 2.7.2-beta.1 → 2.7.2-beta.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/out/404.html +1 -1
- package/out/_next/static/Vybc_NjXNn02kEihqAM3V/_buildManifest.js +1 -0
- package/out/_next/static/chunks/{150-1e09cb4726b8a7a7.js → 150-96a0c443c430ec4b.js} +1 -1
- package/out/_next/static/chunks/18539003-9b393c900c89e552.js +22 -0
- package/out/_next/static/chunks/349-6ad3cca7ea294292.js +31 -0
- package/out/_next/static/chunks/372-cfee53700e416e09.js +1 -0
- package/out/_next/static/chunks/441-76bd8e7cf8cc22da.js +12 -0
- package/out/_next/static/chunks/588-d017e0fe2a651a87.js +1 -0
- package/out/_next/static/chunks/{918-38ab72e6ee071fec.js → 591-a272f15a4bf9830a.js} +2 -2
- package/out/_next/static/chunks/{479-6205c85aa978fc0b.js → 627-092c9e4c99442c08.js} +2 -2
- package/out/_next/static/chunks/750-aa35f21031ee1f96.js +1 -0
- package/out/_next/static/chunks/{772-58d0c8f8ae1c6791.js → 772-db5f72095641ec1d.js} +1 -1
- package/out/_next/static/chunks/{882-1ccb9dbd9bd4734b.js → 882-32959ffa63fa455c.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-6750d78957aee027.js → _app-51bef5d3c62d085e.js} +157 -155
- package/out/_next/static/chunks/pages/{changelog-2c26b4f6b5bd1129.js → changelog-86f30b15d852e710.js} +1 -1
- package/out/_next/static/chunks/pages/changes-6c05ef623617785e.js +1 -0
- package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-2065dee71d774cd3.js → [customTypeId]-fd2416081ef2ffca.js} +1 -1
- package/out/_next/static/chunks/pages/{custom-types-ddc20cfdd8049c04.js → custom-types-5de2dd7b9b93236e.js} +1 -1
- package/out/_next/static/chunks/pages/{index-17f953c11b46cb20.js → index-2d7f95201a656c12.js} +1 -1
- package/out/_next/static/chunks/pages/{labs-6574554a7f090ccd.js → labs-81cf5c5f09fa0bda.js} +1 -1
- package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-07052182875ae5dd.js → [pageTypeId]-59e143620505f73f.js} +1 -1
- package/out/_next/static/chunks/pages/settings-80e0d6f1c79282d3.js +1 -0
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]/{simulator-783b6577bd4e3728.js → simulator-908e779f6d24760d.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-0b6162eb591ee324.js +1 -0
- package/out/_next/static/chunks/pages/{slices-6b069bca7b6ecfa8.js → slices-317ec2bd3451566e.js} +1 -1
- package/out/_next/static/css/{22103e0fe77e9b53.css → 4e475d945cf8a890.css} +1 -1
- package/out/_next/static/css/850c81be38195a0f.css +1 -0
- package/out/_next/static/css/{00e9fba6d8022425.css → 9d17b7d9f44c5c5d.css} +1 -1
- package/out/_next/static/css/{cc20f7c46912c5dc.css → e5c7f63f02ff4d0f.css} +1 -1
- package/out/_next/static/css/{7f2ebc8f03a13272.css → e5f781f20e24a5ea.css} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/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 +8 -8
- package/src/components/BlankSlate/BlankSlate.module.css +0 -10
- package/src/components/BlankSlate/BlankSlate.module.css.d.ts +0 -1
- package/src/components/BlankSlate/BlankSlate.tsx +2 -2
- package/src/components/Breadcrumb/Breadcrumb.module.css +0 -4
- package/src/components/Breadcrumb/Breadcrumb.module.css.d.ts +0 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -2
- package/src/components/ContentTabs/ContentTabs.tsx +2 -1
- package/src/components/FieldSet/FieldSet.module.css +0 -8
- package/src/components/FieldSet/FieldSet.module.css.d.ts +0 -2
- package/src/components/FieldSet/FieldSet.tsx +2 -7
- package/src/components/SideNav/SideNavEnvironmentSelector.tsx +2 -1
- package/src/features/builder/AddFieldDropdown.tsx +1 -1
- package/src/features/changes/BlankSlates/NoChangesBlankSlate.tsx +16 -55
- package/src/features/documentation/MarkdownRenderer/index.tsx +4 -2
- package/src/features/onboarding/OnboardingGuide/OnboardingGuide.tsx +8 -87
- package/src/features/onboarding/OnboardingProgressStepper.tsx +3 -7
- package/src/features/onboarding/OnboardingProvider.tsx +2 -7
- package/src/features/onboarding/OnboardingTutorial/OnboardingTutorial.tsx +2 -5
- package/src/features/onboarding/content.tsx +0 -85
- package/src/features/sync/components/AutoSyncStatusIndicator.tsx +5 -1
- package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +3 -0
- package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +3 -0
- package/src/legacy/lib/models/common/widgets/Group/ListItem/index.jsx +3 -0
- package/src/legacy/lib/models/common/widgets/Link/Form.jsx +43 -3
- package/src/legacy/lib/models/common/widgets/Link/components.tsx +56 -0
- package/src/legacy/lib/models/common/widgets/Link/index.ts +8 -3
- package/src/legacy/lib/models/common/widgets/LinkToMedia/Form.jsx +14 -1
- package/src/legacy/lib/models/common/widgets/LinkToMedia/index.ts +1 -0
- package/src/pages/changes.tsx +1 -13
- package/out/_next/static/XTNKE9wmTlQ2cFGPxGdBg/_buildManifest.js +0 -1
- package/out/_next/static/chunks/168-c494986647b0f939.js +0 -31
- package/out/_next/static/chunks/18539003-080f6b8eec027936.js +0 -22
- package/out/_next/static/chunks/372-a86e2c479a721702.js +0 -1
- package/out/_next/static/chunks/441-126d623f1b578785.js +0 -12
- package/out/_next/static/chunks/50-586dc7ab5e584e76.js +0 -1
- package/out/_next/static/chunks/543-f8766685f7f451e2.js +0 -1
- package/out/_next/static/chunks/764-cf90b7301c3b3a9e.js +0 -1
- package/out/_next/static/chunks/pages/changes-0da6506ff137516c.js +0 -1
- package/out/_next/static/chunks/pages/settings-80462fc1f134572a.js +0 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-17c7f402037bbcc7.js +0 -1
- package/out/_next/static/css/a20944a3d66dde5a.css +0 -1
- package/src/features/changes/usePromptToCreateContentExperiment.ts +0 -19
- package/src/features/onboarding/useOnboardingCardVisibilityExperiment.ts +0 -20
- /package/out/_next/static/{XTNKE9wmTlQ2cFGPxGdBg → Vybc_NjXNn02kEihqAM3V}/_ssgManifest.js +0 -0
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
useOnboardingContext,
|
|
15
15
|
} from "@/features/onboarding/OnboardingProvider";
|
|
16
16
|
import { OnboardingTutorial } from "@/features/onboarding/OnboardingTutorial/OnboardingTutorial";
|
|
17
|
-
import { useOnboardingCardVisibilityExperiment } from "@/features/onboarding/useOnboardingCardVisibilityExperiment";
|
|
18
17
|
import { useOnboardingExperiment } from "@/features/onboarding/useOnboardingExperiment";
|
|
19
18
|
import { useUpdateAvailable } from "@/hooks/useUpdateAvailable";
|
|
20
19
|
|
|
@@ -57,22 +56,6 @@ function OnboardingGuideContent() {
|
|
|
57
56
|
function OnboardingGuideCard() {
|
|
58
57
|
const { steps, completedStepCount, isComplete } = useOnboardingContext();
|
|
59
58
|
const isVisible = useMediaQuery({ min: "medium" });
|
|
60
|
-
const { eligible: isOnboardingCardVisibilityExperiment, variant } =
|
|
61
|
-
useOnboardingCardVisibilityExperiment();
|
|
62
|
-
|
|
63
|
-
const {
|
|
64
|
-
buttonSize,
|
|
65
|
-
cardColor,
|
|
66
|
-
cardVariant,
|
|
67
|
-
cardDescription,
|
|
68
|
-
cardTitle,
|
|
69
|
-
descriptionColor,
|
|
70
|
-
descriptionVariant,
|
|
71
|
-
progressColor,
|
|
72
|
-
progressBackgroundColor,
|
|
73
|
-
progressLabelColor,
|
|
74
|
-
titleColor,
|
|
75
|
-
} = getCardUi({ variant, stepsCount: steps.length });
|
|
76
59
|
|
|
77
60
|
if (!isVisible) return null;
|
|
78
61
|
|
|
@@ -80,29 +63,26 @@ function OnboardingGuideCard() {
|
|
|
80
63
|
<div
|
|
81
64
|
className={isComplete ? styles.invisible : styles.visible}
|
|
82
65
|
// 1px padding to avoid cliping of animated card while it scales up
|
|
83
|
-
style={{ padding:
|
|
66
|
+
style={{ padding: 1 }}
|
|
84
67
|
>
|
|
85
|
-
<Card
|
|
68
|
+
<Card variant="animated-light" paddingBlock={16}>
|
|
86
69
|
<CardContent>
|
|
87
70
|
<div>
|
|
88
|
-
<Text variant="bold" color=
|
|
89
|
-
{
|
|
71
|
+
<Text variant="bold" color="grey12">
|
|
72
|
+
{`Build your first Prismic Page in ${steps.length.toString()} simple steps`}
|
|
90
73
|
</Text>
|
|
91
|
-
<Text color=
|
|
92
|
-
|
|
74
|
+
<Text color="grey11">
|
|
75
|
+
Render a live page with content coming from Prismic in 5 mins
|
|
93
76
|
</Text>
|
|
94
77
|
</div>
|
|
95
78
|
<ProgressBar
|
|
96
|
-
color={progressColor}
|
|
97
|
-
backgroundColor={progressBackgroundColor}
|
|
98
|
-
labelColor={progressLabelColor}
|
|
99
79
|
value={completedStepCount}
|
|
100
80
|
max={steps.length}
|
|
101
81
|
displayLabel
|
|
102
82
|
getValueLabel={(value, max) => `${value}/${max}`}
|
|
103
83
|
/>
|
|
104
|
-
<OnboardingProgressStepper buttonSize=
|
|
105
|
-
|
|
84
|
+
<OnboardingProgressStepper buttonSize="large" />
|
|
85
|
+
<OnboardingTutorial />
|
|
106
86
|
</CardContent>
|
|
107
87
|
</Card>
|
|
108
88
|
</div>
|
|
@@ -119,62 +99,3 @@ const confettiConfig: ConfettiConfig = {
|
|
|
119
99
|
spread: 90,
|
|
120
100
|
duration: 3000,
|
|
121
101
|
};
|
|
122
|
-
|
|
123
|
-
interface GetCardUiProps {
|
|
124
|
-
variant?: string;
|
|
125
|
-
stepsCount: number;
|
|
126
|
-
}
|
|
127
|
-
interface GetCardUiReturnValue {
|
|
128
|
-
buttonSize: "large" | "medium";
|
|
129
|
-
cardColor?: "grey2";
|
|
130
|
-
cardVariant?: "outlined" | "animated-light" | "animated-dark";
|
|
131
|
-
cardTitle: string;
|
|
132
|
-
cardDescription: string;
|
|
133
|
-
titleColor?: "grey12" | "purple1";
|
|
134
|
-
descriptionColor?: "grey11" | "purple6";
|
|
135
|
-
descriptionVariant?: "small";
|
|
136
|
-
progressColor?: "white";
|
|
137
|
-
progressBackgroundColor?: "purple8";
|
|
138
|
-
progressLabelColor?: "purple3";
|
|
139
|
-
}
|
|
140
|
-
function getCardUi(props: GetCardUiProps): GetCardUiReturnValue {
|
|
141
|
-
const { variant, stepsCount } = props;
|
|
142
|
-
const count = stepsCount.toString();
|
|
143
|
-
|
|
144
|
-
switch (variant) {
|
|
145
|
-
case "light":
|
|
146
|
-
return {
|
|
147
|
-
buttonSize: "large",
|
|
148
|
-
cardDescription:
|
|
149
|
-
"Render a live page with content coming from Prismic in 5 mins",
|
|
150
|
-
cardTitle: `Build your first Prismic Page in ${count} simple steps`,
|
|
151
|
-
cardVariant: "animated-light",
|
|
152
|
-
descriptionColor: "grey11",
|
|
153
|
-
titleColor: "grey12",
|
|
154
|
-
};
|
|
155
|
-
case "dark":
|
|
156
|
-
return {
|
|
157
|
-
buttonSize: "large",
|
|
158
|
-
cardDescription:
|
|
159
|
-
"Render a live page with content coming from Prismic in 5 mins",
|
|
160
|
-
cardTitle: `Build your first Prismic Page in ${count} simple steps`,
|
|
161
|
-
cardVariant: "animated-dark",
|
|
162
|
-
descriptionColor: "purple6",
|
|
163
|
-
progressColor: "white",
|
|
164
|
-
progressBackgroundColor: "purple8",
|
|
165
|
-
progressLabelColor: "purple3",
|
|
166
|
-
titleColor: "purple1",
|
|
167
|
-
};
|
|
168
|
-
default:
|
|
169
|
-
return {
|
|
170
|
-
buttonSize: "medium",
|
|
171
|
-
cardColor: "grey2",
|
|
172
|
-
cardVariant: "outlined",
|
|
173
|
-
cardTitle: `Build a page in ${count} steps`,
|
|
174
|
-
cardDescription: "Render a live page with content coming from Prismic",
|
|
175
|
-
descriptionColor: "grey11",
|
|
176
|
-
descriptionVariant: "small",
|
|
177
|
-
titleColor: "grey12",
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
}
|
|
@@ -14,7 +14,6 @@ import { telemetry } from "@/apiClient";
|
|
|
14
14
|
import { useOnboardingContext } from "@/features/onboarding/OnboardingProvider";
|
|
15
15
|
import { OnboardingStepDialog } from "@/features/onboarding/OnboardingStepDialog";
|
|
16
16
|
import type { OnboardingStep } from "@/features/onboarding/types";
|
|
17
|
-
import { useOnboardingCardVisibilityExperiment } from "@/features/onboarding/useOnboardingCardVisibilityExperiment";
|
|
18
17
|
|
|
19
18
|
const EndCtaIcon = () => <Icon name="playCircle" size="small" color="grey11" />;
|
|
20
19
|
|
|
@@ -27,8 +26,6 @@ export function OnboardingProgressStepper(
|
|
|
27
26
|
const { buttonSize = "medium" } = props;
|
|
28
27
|
const { completedStepCount, steps, isStepComplete, isComplete } =
|
|
29
28
|
useOnboardingContext();
|
|
30
|
-
const { eligible: isOnboardingCardVisibilityExperiment } =
|
|
31
|
-
useOnboardingCardVisibilityExperiment();
|
|
32
29
|
|
|
33
30
|
const [isListOpen, setListOpen] = useState(false);
|
|
34
31
|
const [isDialogOpen, setDialogOpen] = useState(false);
|
|
@@ -59,7 +56,8 @@ export function OnboardingProgressStepper(
|
|
|
59
56
|
color="grey"
|
|
60
57
|
sx={{ width: "100%" }}
|
|
61
58
|
renderEndIcon={EndCtaIcon}
|
|
62
|
-
|
|
59
|
+
// TODO: Fix typescript error
|
|
60
|
+
{...{ onMouseEnter: () => setListOpen(true) }}
|
|
63
61
|
>
|
|
64
62
|
{completedStepCount > 0 ? "Continue" : "Start now"}
|
|
65
63
|
</Button>
|
|
@@ -88,9 +86,7 @@ export function OnboardingProgressStepper(
|
|
|
88
86
|
)
|
|
89
87
|
}
|
|
90
88
|
>
|
|
91
|
-
{
|
|
92
|
-
? `${index + 1} ${step.title}`
|
|
93
|
-
: step.title}
|
|
89
|
+
{`${index + 1} ${step.title}`}
|
|
94
90
|
</DropdownMenuItem>
|
|
95
91
|
);
|
|
96
92
|
})}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { createContext, ReactNode, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { telemetry } from "@/apiClient";
|
|
4
|
-
import {
|
|
5
|
-
onboardingExperimentSteps,
|
|
6
|
-
onboardingSteps,
|
|
7
|
-
} from "@/features/onboarding/content";
|
|
4
|
+
import { onboardingSteps } from "@/features/onboarding/content";
|
|
8
5
|
import {
|
|
9
6
|
type OnboardingStep,
|
|
10
7
|
type OnboardingStepId,
|
|
11
8
|
type OnboardingStepStatuses,
|
|
12
9
|
onboardingStepStatusesSchema,
|
|
13
10
|
} from "@/features/onboarding/types";
|
|
14
|
-
import { useOnboardingCardVisibilityExperiment } from "@/features/onboarding/useOnboardingCardVisibilityExperiment";
|
|
15
11
|
import { usePersistedState } from "@/hooks/usePersistedState";
|
|
16
12
|
|
|
17
13
|
type OnboardingContext = {
|
|
@@ -49,8 +45,7 @@ export const OnboardingProvider = ({
|
|
|
49
45
|
children,
|
|
50
46
|
onComplete,
|
|
51
47
|
}: OnboardingProviderProps) => {
|
|
52
|
-
const
|
|
53
|
-
const steps = eligible ? onboardingExperimentSteps : onboardingSteps;
|
|
48
|
+
const steps = onboardingSteps;
|
|
54
49
|
|
|
55
50
|
const [stepStatus, setStepStatus] = usePersistedState(
|
|
56
51
|
"onboardingSteps",
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { Box, Icon, Text } from "@prismicio/editor-ui";
|
|
2
2
|
|
|
3
|
-
import { useOnboardingCardVisibilityExperiment } from "@/features/onboarding/useOnboardingCardVisibilityExperiment";
|
|
4
3
|
import { useMarketingContent } from "@/hooks/useMarketingContent";
|
|
5
4
|
|
|
6
5
|
export function OnboardingTutorial() {
|
|
7
|
-
const { variant } = useOnboardingCardVisibilityExperiment();
|
|
8
6
|
const { tutorial } = useMarketingContent();
|
|
9
7
|
|
|
10
|
-
const color = variant === "dark" ? "white" : "grey11";
|
|
11
8
|
const url = tutorial?.url;
|
|
12
9
|
|
|
13
10
|
if (url === undefined) return null;
|
|
14
11
|
|
|
15
12
|
return (
|
|
16
13
|
<Box justifyContent="center" padding={{ block: 6 }}>
|
|
17
|
-
<Text href={url} variant="smallBold" color=
|
|
14
|
+
<Text href={url} variant="smallBold" color="grey11">
|
|
18
15
|
Or watch our full course
|
|
19
16
|
<Icon
|
|
20
17
|
name="playCircle"
|
|
21
|
-
color=
|
|
18
|
+
color="grey11"
|
|
22
19
|
size="small"
|
|
23
20
|
sx={{ marginLeft: 4 }}
|
|
24
21
|
/>
|
|
@@ -3,91 +3,6 @@ import { Text } from "@prismicio/editor-ui";
|
|
|
3
3
|
import type { OnboardingStep } from "@/features/onboarding/types";
|
|
4
4
|
|
|
5
5
|
export const onboardingSteps: OnboardingStep[] = [
|
|
6
|
-
{
|
|
7
|
-
id: "createPageType",
|
|
8
|
-
title: "Create a Page Type",
|
|
9
|
-
description: "Build the structure for your page.",
|
|
10
|
-
videoUrl:
|
|
11
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",
|
|
12
|
-
content: () => (
|
|
13
|
-
<Text>
|
|
14
|
-
A page type is a base content structure editors will use to create pages
|
|
15
|
-
in the Page Builder (Prismic's content creation UI). A page type can be
|
|
16
|
-
reusable (e.g., for multiple blog posts) or single (e.g., for a one-time
|
|
17
|
-
page like the homepage).
|
|
18
|
-
</Text>
|
|
19
|
-
),
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: "codePage",
|
|
23
|
-
title: "Code Your Page Type",
|
|
24
|
-
description: "Prepare code to fetch content.",
|
|
25
|
-
videoUrl:
|
|
26
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",
|
|
27
|
-
content: () => (
|
|
28
|
-
<Text>Prepare your code to query the content from the Prismic API.</Text>
|
|
29
|
-
),
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "createSlice",
|
|
33
|
-
title: "Create a Slice",
|
|
34
|
-
description: "Build a reusable website section.",
|
|
35
|
-
videoUrl:
|
|
36
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",
|
|
37
|
-
content: () => (
|
|
38
|
-
<Text>
|
|
39
|
-
Slices are website sections that can be reused on different pages with
|
|
40
|
-
different content. Each slice has a code component automatically
|
|
41
|
-
generated by Slice Machine. Start with a template and look at your code
|
|
42
|
-
to see how it's structured.
|
|
43
|
-
</Text>
|
|
44
|
-
),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "reviewAndPush",
|
|
48
|
-
title: "Review and Push Changes",
|
|
49
|
-
description: "Enable editors to create content.",
|
|
50
|
-
videoUrl:
|
|
51
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",
|
|
52
|
-
content: () => (
|
|
53
|
-
<Text>
|
|
54
|
-
Your page types and slices currently exist only in your local project.
|
|
55
|
-
Push them to your repository to make them available for your content
|
|
56
|
-
editors.
|
|
57
|
-
</Text>
|
|
58
|
-
),
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
id: "createContent",
|
|
62
|
-
title: "Create Content",
|
|
63
|
-
description: "Publish a page to the Prismic API.",
|
|
64
|
-
videoUrl:
|
|
65
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918324/DEV_TOOLS/ONBOARDING_GUIDE/Cre%CC%81er_contenu_e%CC%81tape_4_z9vlzt.mp4",
|
|
66
|
-
content: () => (
|
|
67
|
-
<Text>
|
|
68
|
-
In Prismic, content creation takes place in the Prismic Page Builder UI.
|
|
69
|
-
Open the Page Builder and start creating your first page.
|
|
70
|
-
</Text>
|
|
71
|
-
),
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "renderPage",
|
|
75
|
-
title: "Render your page",
|
|
76
|
-
description: "View your page in the browser.",
|
|
77
|
-
videoUrl:
|
|
78
|
-
"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",
|
|
79
|
-
content: () => (
|
|
80
|
-
<Text>
|
|
81
|
-
Now that your content is published, you can run your project in your
|
|
82
|
-
terminal and visit the page on your local server (e.g.,{" "}
|
|
83
|
-
<Text component="code">localhost:3000/example-page</Text>). Your content
|
|
84
|
-
should now be visible!
|
|
85
|
-
</Text>
|
|
86
|
-
),
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
export const onboardingExperimentSteps: OnboardingStep[] = [
|
|
91
6
|
{
|
|
92
7
|
id: "createProject",
|
|
93
8
|
title: "Create your Prismic website",
|
|
@@ -49,7 +49,11 @@ export const AutoSyncStatusIndicator: FC<AutoSyncStatusIndicatorProps> = (
|
|
|
49
49
|
<Tooltip content={autoSaveStatusInfo.tooltipText} side="right">
|
|
50
50
|
<div className={styles.root}>
|
|
51
51
|
{autoSaveStatusInfo.icon}
|
|
52
|
-
<Text
|
|
52
|
+
<Text
|
|
53
|
+
// TODO: Stop using className
|
|
54
|
+
{...{ className: styles.text }}
|
|
55
|
+
color="grey11"
|
|
56
|
+
>
|
|
53
57
|
{autoSaveStatusInfo.text}
|
|
54
58
|
</Text>
|
|
55
59
|
</div>
|
|
@@ -145,6 +145,9 @@ const TabZone: FC<TabZoneProps> = ({ tabId }) => {
|
|
|
145
145
|
type: newField.type,
|
|
146
146
|
isInAGroup: false,
|
|
147
147
|
contentType: getContentTypeForTracking(window.location.pathname),
|
|
148
|
+
...(newField.type === "Link" && {
|
|
149
|
+
allowText: newField.config?.allowText,
|
|
150
|
+
}),
|
|
148
151
|
});
|
|
149
152
|
};
|
|
150
153
|
|
|
@@ -166,6 +166,9 @@ const FieldZones: FC = () => {
|
|
|
166
166
|
type: newField.type,
|
|
167
167
|
isInAGroup: false,
|
|
168
168
|
contentType: getContentTypeForTracking(window.location.pathname),
|
|
169
|
+
...(newField.type === "Link" && {
|
|
170
|
+
allowText: newField.config?.allowText,
|
|
171
|
+
}),
|
|
169
172
|
});
|
|
170
173
|
};
|
|
171
174
|
|
|
@@ -1,24 +1,33 @@
|
|
|
1
|
+
import { Box, Label } from "theme-ui";
|
|
2
|
+
|
|
1
3
|
import { Col, Flex as FlexGrid } from "@/legacy/components/Flex";
|
|
2
4
|
import WidgetFormField from "@/legacy/lib/builders/common/EditModal/Field";
|
|
3
5
|
import { createFieldNameFromKey } from "@/legacy/lib/forms";
|
|
4
6
|
import { DefaultFields } from "@/legacy/lib/forms/defaults";
|
|
5
7
|
import { CheckBox } from "@/legacy/lib/forms/fields";
|
|
6
8
|
|
|
9
|
+
import { DisplayTextCheckbox } from "./components";
|
|
10
|
+
|
|
7
11
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
8
12
|
const FormFields = {
|
|
9
13
|
...DefaultFields,
|
|
10
|
-
allowTargetBlank: CheckBox("Allow target blank", false,
|
|
14
|
+
allowTargetBlank: CheckBox("Allow target blank", false, true),
|
|
11
15
|
};
|
|
12
16
|
|
|
13
17
|
const Form = (props) => {
|
|
14
18
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
15
|
-
const { initialValues, fields } = props;
|
|
19
|
+
const { initialValues, values: formValues, fields, setFieldValue } = props;
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
22
|
+
const {
|
|
23
|
+
config: { allowText },
|
|
24
|
+
} = formValues;
|
|
16
25
|
|
|
17
26
|
return (
|
|
18
27
|
<FlexGrid>
|
|
19
28
|
{
|
|
20
29
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
21
|
-
Object.entries(
|
|
30
|
+
Object.entries(DefaultFields).map(([key, field]) => (
|
|
22
31
|
<Col key={key}>
|
|
23
32
|
<WidgetFormField
|
|
24
33
|
fieldName={createFieldNameFromKey(key)}
|
|
@@ -32,6 +41,37 @@ const Form = (props) => {
|
|
|
32
41
|
</Col>
|
|
33
42
|
))
|
|
34
43
|
}
|
|
44
|
+
<Col />
|
|
45
|
+
<Col key="allowTargetBlank">
|
|
46
|
+
<Box sx={{ mt: 2 }}>
|
|
47
|
+
<Label
|
|
48
|
+
htmlFor="allowTargetBlank"
|
|
49
|
+
variant="label.primary"
|
|
50
|
+
sx={{
|
|
51
|
+
display: "flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
Link properties
|
|
56
|
+
</Label>
|
|
57
|
+
<WidgetFormField
|
|
58
|
+
fieldName={createFieldNameFromKey("allowTargetBlank")}
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
60
|
+
formField={CheckBox("Allow target blank", false, true)}
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
62
|
+
fields={fields}
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
64
|
+
initialValues={initialValues}
|
|
65
|
+
/>
|
|
66
|
+
</Box>
|
|
67
|
+
</Col>
|
|
68
|
+
<DisplayTextCheckbox
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
70
|
+
allowText={allowText}
|
|
71
|
+
height={127}
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
73
|
+
setFieldValue={setFieldValue}
|
|
74
|
+
/>
|
|
35
75
|
</FlexGrid>
|
|
36
76
|
);
|
|
37
77
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Box, Icon, Tooltip } from "@prismicio/editor-ui";
|
|
2
|
+
import { Checkbox, Flex, Label } from "theme-ui";
|
|
3
|
+
|
|
4
|
+
import { Col } from "@/legacy/components/Flex";
|
|
5
|
+
|
|
6
|
+
interface DisplayTextCheckboxProps {
|
|
7
|
+
allowText?: boolean;
|
|
8
|
+
height?: 130 | 127;
|
|
9
|
+
setFieldValue: (
|
|
10
|
+
a: string,
|
|
11
|
+
b?: boolean,
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
) => void | Promise<any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function DisplayTextCheckbox(props: DisplayTextCheckboxProps) {
|
|
17
|
+
const { allowText, height = 130, setFieldValue } = props;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Col>
|
|
21
|
+
<Flex
|
|
22
|
+
sx={{
|
|
23
|
+
mt: 2,
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
height: `${height}%`,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<Label variant="label.border">
|
|
29
|
+
<Box
|
|
30
|
+
display="flex"
|
|
31
|
+
justifyContent="space-between"
|
|
32
|
+
alignItems="center"
|
|
33
|
+
width="100%"
|
|
34
|
+
>
|
|
35
|
+
<Flex>
|
|
36
|
+
<Checkbox
|
|
37
|
+
checked={allowText}
|
|
38
|
+
onChange={(event) => {
|
|
39
|
+
void setFieldValue("config.allowText", event.target.checked);
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
Allow display text
|
|
43
|
+
</Flex>
|
|
44
|
+
<Tooltip
|
|
45
|
+
content="Allow editors to customize the link display text"
|
|
46
|
+
align="end"
|
|
47
|
+
zIndexHack
|
|
48
|
+
>
|
|
49
|
+
<Icon name="alert" size="medium" color="grey11" />
|
|
50
|
+
</Tooltip>
|
|
51
|
+
</Box>
|
|
52
|
+
</Label>
|
|
53
|
+
</Flex>
|
|
54
|
+
</Col>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -11,7 +11,8 @@ import Form, { FormFields } from "./Form";
|
|
|
11
11
|
"config": {
|
|
12
12
|
"label": "link",
|
|
13
13
|
"placeholder": "Could be a link to use case, press article, signup...",
|
|
14
|
-
"allowTargetBlank": true
|
|
14
|
+
"allowTargetBlank": true,
|
|
15
|
+
"allowText": true
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
*/
|
|
@@ -23,7 +24,8 @@ import Form, { FormFields } from "./Form";
|
|
|
23
24
|
"select": "document",
|
|
24
25
|
"customtypes": ["homepage"],
|
|
25
26
|
"label": "contentrrrrr",
|
|
26
|
-
"placeholder": "dsfdsfsdf"
|
|
27
|
+
"placeholder": "dsfdsfsdf",
|
|
28
|
+
"allowText": true
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
*/
|
|
@@ -33,7 +35,8 @@ import Form, { FormFields } from "./Form";
|
|
|
33
35
|
"config" : {
|
|
34
36
|
"select" : "media",
|
|
35
37
|
"label" : "tomedia",
|
|
36
|
-
"placeholder" : "qsdqsdqsd"
|
|
38
|
+
"placeholder" : "qsdqsdqsd",
|
|
39
|
+
"allowText": true
|
|
37
40
|
}
|
|
38
41
|
} */
|
|
39
42
|
|
|
@@ -70,6 +73,7 @@ export const linkConfigSchema = yup
|
|
|
70
73
|
masks: yup.array(yup.string()).optional(),
|
|
71
74
|
tags: yup.array(yup.string()).optional(),
|
|
72
75
|
allowTargetBlank: yup.boolean().strict().optional(),
|
|
76
|
+
allowText: yup.boolean().strict().optional(),
|
|
73
77
|
})
|
|
74
78
|
.required()
|
|
75
79
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
@@ -98,6 +102,7 @@ export const LinkWidget: Widget<Link, typeof schema> = {
|
|
|
98
102
|
label,
|
|
99
103
|
placeholder: "",
|
|
100
104
|
select: null,
|
|
105
|
+
allowText: true,
|
|
101
106
|
},
|
|
102
107
|
}),
|
|
103
108
|
TYPE_NAME: "Link",
|
|
@@ -3,6 +3,8 @@ import WidgetFormField from "@/legacy/lib/builders/common/EditModal/Field";
|
|
|
3
3
|
import { createFieldNameFromKey } from "@/legacy/lib/forms";
|
|
4
4
|
import { DefaultFields } from "@/legacy/lib/forms/defaults";
|
|
5
5
|
|
|
6
|
+
import { DisplayTextCheckbox } from "../Link/components";
|
|
7
|
+
|
|
6
8
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
7
9
|
const FormFields = {
|
|
8
10
|
...DefaultFields,
|
|
@@ -10,7 +12,12 @@ const FormFields = {
|
|
|
10
12
|
|
|
11
13
|
const Form = (props) => {
|
|
12
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
13
|
-
const { initialValues, fields } = props;
|
|
15
|
+
const { initialValues, values: formValues, fields, setFieldValue } = props;
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
18
|
+
const {
|
|
19
|
+
config: { allowText },
|
|
20
|
+
} = formValues;
|
|
14
21
|
|
|
15
22
|
return (
|
|
16
23
|
<FlexGrid>
|
|
@@ -30,6 +37,12 @@ const Form = (props) => {
|
|
|
30
37
|
</Col>
|
|
31
38
|
))
|
|
32
39
|
}
|
|
40
|
+
<DisplayTextCheckbox
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
42
|
+
allowText={allowText}
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
44
|
+
setFieldValue={setFieldValue}
|
|
45
|
+
/>
|
|
33
46
|
</FlexGrid>
|
|
34
47
|
);
|
|
35
48
|
};
|
package/src/pages/changes.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { getState, telemetry } from "@/apiClient";
|
|
|
10
10
|
import { BreadcrumbItem } from "@/components/Breadcrumb";
|
|
11
11
|
import { NoChangesBlankSlate } from "@/features/changes/BlankSlates";
|
|
12
12
|
import { PushChangesButton } from "@/features/changes/PushChangesButton";
|
|
13
|
-
import { usePromptToCreateContentExperiment } from "@/features/changes/usePromptToCreateContentExperiment";
|
|
14
13
|
import { pushChanges } from "@/features/sync/actions/pushChanges";
|
|
15
14
|
import { useAutoSync } from "@/features/sync/AutoSyncProvider";
|
|
16
15
|
import { useUnSyncChanges } from "@/features/sync/useUnSyncChanges";
|
|
@@ -56,8 +55,6 @@ const Changes: React.FunctionComponent = () => {
|
|
|
56
55
|
const router = useRouter();
|
|
57
56
|
const [isPushed, setIsPushed] = useState(false);
|
|
58
57
|
const [isToastOpen, setIsToastOpen] = useState(false);
|
|
59
|
-
const { eligible: isPromptToCreateContentExperimentEligible } =
|
|
60
|
-
usePromptToCreateContentExperiment();
|
|
61
58
|
const { repositoryName } = useRepositoryInformation();
|
|
62
59
|
|
|
63
60
|
const documentsListEndpoint =
|
|
@@ -97,12 +94,7 @@ const Changes: React.FunctionComponent = () => {
|
|
|
97
94
|
pushChangesSuccess();
|
|
98
95
|
|
|
99
96
|
setIsPushed(true);
|
|
100
|
-
|
|
101
|
-
if (isPromptToCreateContentExperimentEligible) {
|
|
102
|
-
setIsToastOpen(true);
|
|
103
|
-
} else {
|
|
104
|
-
toast.success("All slices and types have been pushed");
|
|
105
|
-
}
|
|
97
|
+
setIsToastOpen(true);
|
|
106
98
|
}
|
|
107
99
|
} catch (error) {
|
|
108
100
|
console.error(
|
|
@@ -133,9 +125,6 @@ const Changes: React.FunctionComponent = () => {
|
|
|
133
125
|
<NoChangesBlankSlate
|
|
134
126
|
isPostPush={isPushed}
|
|
135
127
|
documentsListEndpoint={documentsListEndpoint}
|
|
136
|
-
isPromptToCreateContentExperimentEligible={
|
|
137
|
-
isPromptToCreateContentExperimentEligible
|
|
138
|
-
}
|
|
139
128
|
/>
|
|
140
129
|
);
|
|
141
130
|
}
|
|
@@ -157,7 +146,6 @@ const Changes: React.FunctionComponent = () => {
|
|
|
157
146
|
modelsStatuses,
|
|
158
147
|
isPushed,
|
|
159
148
|
documentsListEndpoint,
|
|
160
|
-
isPromptToCreateContentExperimentEligible,
|
|
161
149
|
]);
|
|
162
150
|
|
|
163
151
|
return (
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,d,u,b,f,h,l,k,j,p,g,o,r){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,j,p,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-2c26b4f6b5bd1129.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js",i,"static/chunks/918-38ab72e6ee071fec.js",c,d,"static/css/a20944a3d66dde5a.css","static/chunks/pages/changes-0da6506ff137516c.js"],"/custom-types":[a,j,p,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,u,b,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/custom-types/[customTypeId]-2065dee71d774cd3.js"],"/labs":["static/chunks/pages/labs-6574554a7f090ccd.js"],"/page-types/[pageTypeId]":[s,u,b,f,h,e,n,i,l,g,c,a,k,o,r,"static/chunks/pages/page-types/[pageTypeId]-07052182875ae5dd.js"],"/settings":["static/css/7f2ebc8f03a13272.css","static/chunks/pages/settings-80462fc1f134572a.js"],"/slices":[s,t,n,c,d,"static/css/b5323377600915db.css","static/chunks/pages/slices-6b069bca7b6ecfa8.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,u,b,f,h,e,n,i,l,c,k,d,"static/css/4840a6c8541a6625.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-17c7f402037bbcc7.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/18539003-080f6b8eec027936.js","static/chunks/441-126d623f1b578785.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-783b6577bd4e3728.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-58d0c8f8ae1c6791.js","static/chunks/372-a86e2c479a721702.js","static/chunks/183-1298bf7953a6f2a0.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/543-f8766685f7f451e2.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-175fa5cb82faf87c.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-642bc2ece03445a4.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/168-c494986647b0f939.js","static/chunks/882-1ccb9dbd9bd4734b.js","static/chunks/764-cf90b7301c3b3a9e.js","static/css/22103e0fe77e9b53.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/150-1e09cb4726b8a7a7.js","static/css/00e9fba6d8022425.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|