-
Notifications
You must be signed in to change notification settings - Fork 0
/
plasmic-init.ts
186 lines (169 loc) · 4.3 KB
/
plasmic-init.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
import getConfig from "next/config";
import { initPlasmicLoader } from "@plasmicapp/loader-nextjs";
import CountDownTimerDays from "./components/CountdownTimer/CountdownTimerDays";
import CountDownTimerHours from "./components/CountdownTimer/CountdownTimerHours";
import CountDownTimerMinutes from "./components/CountdownTimer/CountdownTimerMinutes";
import Outline from "./components/Outline";
import { HelloWorld, Link } from "./components";
import { Popup } from "./components/Popup";
import { Carousel, CarouselCard } from "./components/carousel";
import { DropdownMenu, Navbar } from "./components/Navbar";
import { registerYouTube, youtubeMeta } from "@plasmicpkgs/react-youtube";
import Workshop from "./components/workshop/Workshop";
import WorkshopCard from "./components/workshop/WorkshopCard";
import TitleBox from "./components/Dropdownable/TitleBox";
import TagFilter from "./components/workshop/TagFilter";
const { publicRuntimeConfig } = getConfig();
const {
NEXT_PUBLIC_PLASMIC_PREVIEW,
NEXT_PUBLIC_PLASMIC_PROJECT_ID,
NEXT_PUBLIC_PLASMIC_PROJECT_TOKEN,
} = publicRuntimeConfig;
export const PLASMIC = initPlasmicLoader({
projects: [
{
id: NEXT_PUBLIC_PLASMIC_PROJECT_ID, // ID of a project you are using
token: NEXT_PUBLIC_PLASMIC_PROJECT_TOKEN, // API token for that project
},
],
// Fetches the latest revisions, whether or not they were unpublished!
// Disable for production to ensure you render only published changes.
preview: NEXT_PUBLIC_PLASMIC_PREVIEW === "false" ? false : true,
});
PLASMIC.registerComponent(HelloWorld, {
name: "HelloWorld",
props: {
className: "string",
verbose: "boolean",
children: "slot",
},
});
registerYouTube(PLASMIC, youtubeMeta);
PLASMIC.registerComponent(Popup, {
name: "Popup",
props: {
preview: "boolean",
windowClassName: "string",
popupBoxClassName: "string",
clickableClassName: "string",
clickable: "slot",
popupBox: "slot",
},
});
PLASMIC.registerComponent(Carousel, {
name: "Carousel",
props: {
className: "string",
children: "slot",
showIndicators: "boolean",
IndicatorsClassName: "string",
showArrows: "boolean",
ArrowsClassName: "string",
leftArrowChild: "slot",
rightArrowChild: "slot",
autoplay: "boolean",
activeKey: {
type: "choice",
options: (props) => {
return Array(props.children!.length)
.fill(0)
.map((_, index) => index.toString());
},
editOnly: true,
},
},
});
PLASMIC.registerComponent(CarouselCard, {
name: "CarouselCard",
props: {
className: "string",
children: "slot",
},
});
PLASMIC.registerComponent(Link, {
name: "Link",
props: {
link: "string",
openInNewTab: "boolean",
className: "string",
children: "slot",
},
});
PLASMIC.registerComponent(Navbar, {
name: "Navbar",
props: {
children: "slot",
className: "string",
editMobile: "boolean",
mobileWidthRange: "number",
},
});
PLASMIC.registerComponent(DropdownMenu, {
name: "DropdownMenu",
props: {
children: "slot",
className: "string",
menuTitle: "string",
},
});
PLASMIC.registerComponent(Workshop, {
name: "Workshop",
props: {
title: "string",
children: "slot",
className: "string",
showTags: "boolean",
},
});
PLASMIC.registerComponent(WorkshopCard, {
name: "WorkshopCard",
props: {
className: "string",
title: "string",
date: "string",
excerpt: "string",
tags: "string",
image: "slot",
popupSpeakers: "slot",
popupImage: "slot",
popupDescription: "slot",
preview: "boolean",
},
});
PLASMIC.registerComponent(CountDownTimerDays, {
name: "CountDownTimerDays",
props: {
className: "string",
endDate: "string",
},
});
PLASMIC.registerComponent(CountDownTimerHours, {
name: "CountDownTimerHours",
props: {
className: "string",
endDate: "string",
},
});
PLASMIC.registerComponent(CountDownTimerMinutes, {
name: "CountDownTimerMinutes",
props: {
className: "string",
endDate: "string",
},
});
PLASMIC.registerComponent(Outline, {
name: "Outline",
props: {
className: "string",
children: "slot",
largeSize: "boolean",
},
});
PLASMIC.registerComponent(TitleBox, {
name: "TitleBox",
props: {
className: "string",
children: "slot",
title: "slot",
},
});