@levo-so/blocks 0.1.101 → 0.1.102
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/package.json +6 -5
- package/src/blocks/about-us/about-us-1.schema.ts +302 -295
- package/src/blocks/about-us/about-us-2.schema.ts +225 -220
- package/src/blocks/blogs/blog-author-1.schema.ts +719 -0
- package/src/blocks/blogs/blog-author-1.tsx +121 -0
- package/src/blocks/blogs/blog-listing-1.tsx +111 -33
- package/src/blocks/blogs/blog-listing-2.schema.ts +15 -33
- package/src/blocks/blogs/blog-listing-2.tsx +118 -33
- package/src/blocks/blogs/blog-listing-3.schema.ts +10 -22
- package/src/blocks/blogs/blog-listing-3.tsx +118 -33
- package/src/blocks/blogs/blog-post-1.schema.ts +766 -16
- package/src/blocks/blogs/blog-post-1.tsx +256 -32
- package/src/blocks/calendar/calendar-1.schema.ts +641 -192
- package/src/blocks/calendar/calendar-1.tsx +1 -0
- package/src/blocks/cards/cards-10.schema.ts +557 -544
- package/src/blocks/cards/cards-11.schema.ts +525 -419
- package/src/blocks/cards/cards-12.schema.ts +538 -147
- package/src/blocks/cards/cards-13.schema.ts +482 -312
- package/src/blocks/cards/cards-14.schema.ts +423 -196
- package/src/blocks/cards/cards-15.schema.ts +309 -143
- package/src/blocks/cards/cards-16.schema.ts +1277 -175
- package/src/blocks/cards/cards-17.schema.ts +2908 -1303
- package/src/blocks/cards/cards-18.schema.ts +1404 -217
- package/src/blocks/cards/cards-19.schema.ts +1105 -1084
- package/src/blocks/cards/cards-19.tsx +4 -5
- package/src/blocks/cards/cards-2.schema.ts +513 -42
- package/src/blocks/cards/cards-20.schema.ts +790 -212
- package/src/blocks/cards/cards-21.schema.ts +1215 -229
- package/src/blocks/cards/cards-21.tsx +51 -6
- package/src/blocks/cards/cards-22.schema.ts +1252 -2809
- package/src/blocks/cards/cards-22.tsx +6 -7
- package/src/blocks/cards/cards-23.schema.ts +571 -109
- package/src/blocks/cards/cards-3.schema.ts +355 -116
- package/src/blocks/cards/cards-4.schema.ts +805 -321
- package/src/blocks/cards/cards-5.schema.ts +216 -64
- package/src/blocks/cards/cards-6.schema.ts +568 -1330
- package/src/blocks/cards/cards-7.schema.ts +1181 -1378
- package/src/blocks/cards/cards-8.schema.ts +585 -221
- package/src/blocks/cards/cards-9.schema.ts +763 -382
- package/src/blocks/carousel/carousel-1.schema.ts +257 -502
- package/src/blocks/carousel/carousel-2.schema.ts +771 -761
- package/src/blocks/community/community-1.schema.ts +8 -23
- package/src/blocks/community/community-1.tsx +3 -3
- package/src/blocks/community/community-post-1.tsx +4 -4
- package/src/blocks/contact-us/contact-us-1.schema.ts +360 -14
- package/src/blocks/contact-us/contact-us-2.schema.ts +441 -325
- package/src/blocks/content/content-1.schema.ts +800 -381
- package/src/blocks/content/content-10.schema.ts +763 -20
- package/src/blocks/content/content-2.schema.ts +426 -52
- package/src/blocks/content/content-3.schema.ts +631 -432
- package/src/blocks/content/content-4.schema.ts +378 -123
- package/src/blocks/content/content-5.schema.ts +1152 -682
- package/src/blocks/content/content-6.schema.ts +679 -707
- package/src/blocks/content/content-7.schema.ts +694 -291
- package/src/blocks/content/content-8.schema.ts +247 -7
- package/src/blocks/content/content-9.schema.ts +855 -116
- package/src/blocks/cta/cta-1.schema.ts +294 -62
- package/src/blocks/cta/cta-2.schema.ts +302 -66
- package/src/blocks/cta/cta-2.tsx +1 -2
- package/src/blocks/cta/cta-3.schema.ts +312 -62
- package/src/blocks/embed/embed-1.schema.ts +181 -0
- package/src/blocks/event/event-listing-2.schema.ts +5 -11
- package/src/blocks/event/event-listing-3.schema.ts +5 -11
- package/src/blocks/event/event-listing-4.schema.ts +5 -11
- package/src/blocks/event/event-listing.schema.ts +5 -11
- package/src/blocks/faq/faq-1.schema.ts +439 -260
- package/src/blocks/faq/faq-2.schema.ts +444 -266
- package/src/blocks/faq/faq-3.schema.ts +1420 -224
- package/src/blocks/features/features-1/features-1.schema.ts +21 -21
- package/src/blocks/features/features-1/variants/default.ts +120 -138
- package/src/blocks/features/features-1/variants/index.ts +2 -2
- package/src/blocks/features/features-1/variants/minimal-list.ts +139 -0
- package/src/blocks/features/features-1/variants/stylized-cards-v1.ts +69 -385
- package/src/blocks/features/features-1/variants/stylized-cards-v2.ts +74 -408
- package/src/blocks/features/features-2.schema.ts +368 -286
- package/src/blocks/features/features-3.schema.ts +557 -280
- package/src/blocks/features/features-4.schema.ts +940 -432
- package/src/blocks/features/features-5.schema.ts +566 -407
- package/src/blocks/features/features-6.schema.ts +557 -523
- package/src/blocks/filter-listing/filter-listing-1.schema.ts +922 -270
- package/src/blocks/floating-buttons/floating-button-1.schema.ts +123 -0
- package/src/blocks/footer/footer-1.schema.ts +383 -401
- package/src/blocks/footer/footer-2.schema.ts +337 -878
- package/src/blocks/footer/footer-3.schema.ts +445 -381
- package/src/blocks/footer/footer-4.schema.ts +610 -439
- package/src/blocks/footer/footer-5.schema.ts +367 -321
- package/src/blocks/footer/footer-6.schema.ts +610 -357
- package/src/blocks/form/form-1.schema.ts +237 -0
- package/src/blocks/hero/hero-1.schema.ts +251 -221
- package/src/blocks/hero/hero-10.schema.ts +23 -14
- package/src/blocks/hero/hero-11.schema.ts +728 -601
- package/src/blocks/hero/hero-12.schema.ts +524 -334
- package/src/blocks/hero/hero-13.schema.ts +83 -95
- package/src/blocks/hero/hero-2.schema.ts +277 -68
- package/src/blocks/hero/hero-3.schema.ts +371 -235
- package/src/blocks/hero/hero-3.tsx +1 -1
- package/src/blocks/hero/hero-4.schema.ts +605 -338
- package/src/blocks/hero/hero-5.schema.ts +545 -61
- package/src/blocks/hero/hero-6.schema.ts +446 -257
- package/src/blocks/hero/hero-6.tsx +1 -1
- package/src/blocks/hero/hero-7.schema.ts +1299 -131
- package/src/blocks/hero/hero-7.tsx +43 -23
- package/src/blocks/hero/hero-8.schema.ts +736 -236
- package/src/blocks/hero/hero-9.schema.ts +908 -58
- package/src/blocks/index.ts +2 -0
- package/src/blocks/jobs/jobs-1.schema.ts +741 -219
- package/src/blocks/logos/logos-1.schema.ts +317 -321
- package/src/blocks/logos/logos-1.tsx +32 -19
- package/src/blocks/navbar/navbar-1.schema.ts +319 -186
- package/src/blocks/navbar/navbar-2.schema.ts +311 -190
- package/src/blocks/navbar/navbar-3.schema.ts +612 -570
- package/src/blocks/navbar/navbar-4.schema.ts +741 -1250
- package/src/blocks/polling/polling-1.schema.ts +161 -0
- package/src/blocks/pricing/pricing-1.schema.ts +549 -626
- package/src/blocks/products/products-listing-1.schema.ts +363 -249
- package/src/blocks/products/products-listing-2.schema.ts +515 -257
- package/src/blocks/products/products-listing-3.schema.ts +789 -836
- package/src/blocks/profile/profile-1.schema.ts +168 -187
- package/src/blocks/profile/profile-2.schema.ts +150 -122
- package/src/blocks/profile/profile-3.schema.ts +307 -256
- package/src/blocks/profile/profile-4.schema.ts +372 -504
- package/src/blocks/profile/profile-5.schema.ts +186 -79
- package/src/blocks/services/service-1.schema.ts +700 -631
- package/src/blocks/services/service-2.schema.ts +559 -82
- package/src/blocks/services/service-2.tsx +5 -3
- package/src/blocks/services/service-3.schema.ts +587 -215
- package/src/blocks/services/service-3.tsx +4 -2
- package/src/blocks/stats/stats-1.schema.ts +347 -257
- package/src/blocks/stats/stats-2.schema.ts +14 -2
- package/src/blocks/stats/variants/default.ts +14 -37
- package/src/blocks/stats/variants/extra.ts +232 -0
- package/src/blocks/stats/variants/hero.ts +1 -30
- package/src/blocks/stats/variants/index.ts +13 -1
- package/src/blocks/tabs/tab-1.schema.ts +1361 -214
- package/src/blocks/tabs/tab-2.schema.ts +984 -390
- package/src/blocks/tabs/tab-3.schema.ts +961 -95
- package/src/blocks/team/team-1.schema.ts +681 -564
- package/src/blocks/team/team-2.schema.ts +589 -935
- package/src/blocks/team/team-3.schema.ts +375 -284
- package/src/blocks/team/team-4.schema.ts +569 -355
- package/src/blocks/team/team-5.schema.ts +307 -111
- package/src/blocks/testimonial/testimonial-1.schema.ts +605 -706
- package/src/blocks/testimonial/testimonial-2.schema.ts +825 -1099
- package/src/blocks/testimonial/testimonial-3.schema.ts +580 -235
- package/src/blocks/testimonial/testimonial-4.schema.ts +1326 -1779
- package/src/blocks/testimonial/testimonial-5/variants/default.ts +179 -328
- package/src/blocks/testimonial/testimonial-5/variants/index.ts +9 -1
- package/src/blocks/testimonial/testimonial-5/variants/testimonialCentered.ts +194 -0
- package/src/blocks/testimonial/testimonial-5/variants/testimonialCompact.ts +188 -0
- package/src/blocks/testimonial/testimonial-5/variants/testimonialWithLogo.ts +275 -396
- package/src/blocks/testimonial/testimonial-5/variants/testimonialWithRatings.ts +254 -602
- package/src/blocks/testimonial/testimonial-5.schema.ts +6 -2
- package/src/blocks/testimonial/testimonial-6.schema.ts +962 -1234
- package/src/blocks/testimonial/testimonial-7.schema.ts +515 -233
- package/src/blocks/timeline/timeline-1.schema.ts +382 -140
- package/src/blocks/users/edit-profile.schema.ts +2 -8
- package/src/blocks/users/edit-profile.tsx +2 -3
- package/src/schemas/blocks.ts +2 -0
- package/src/blocks/features/features-1/variants/stylized-cards-v3.ts +0 -268
|
@@ -2,6 +2,8 @@ import type { IModuleStudioConfig, IPost } from "@levo-so/core";
|
|
|
2
2
|
import {
|
|
3
3
|
Avatar,
|
|
4
4
|
AvatarFallbackV2,
|
|
5
|
+
AvatarGroup,
|
|
6
|
+
AvatarGroupCount,
|
|
5
7
|
AvatarImageV2,
|
|
6
8
|
Box,
|
|
7
9
|
Button,
|
|
@@ -9,6 +11,7 @@ import {
|
|
|
9
11
|
Heading,
|
|
10
12
|
Icon,
|
|
11
13
|
type ILevoBlockBaseProps,
|
|
14
|
+
type IStudioSource,
|
|
12
15
|
Media,
|
|
13
16
|
Section,
|
|
14
17
|
Typography,
|
|
@@ -24,11 +27,113 @@ import type { IBlogListing3Content } from "./blog-listing-3.schema";
|
|
|
24
27
|
interface IBlogMeta {
|
|
25
28
|
total: number;
|
|
26
29
|
pages: number;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
+
studio_config?: (IModuleStudioConfig & {
|
|
31
|
+
module: IStudioSource["module"];
|
|
32
|
+
})[];
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
const getAuthorsText = (authors: any[]): string => {
|
|
36
|
+
const names = authors.map((a) => [a?.first_name].filter(Boolean).join(" ") || "Anonymous");
|
|
37
|
+
|
|
38
|
+
if (names.length === 2) return `${names[0]} and ${names[1]}`;
|
|
39
|
+
// if (names.length === 3) return `${names[0]}, ${names[1]}, and ${names[2]}`;
|
|
40
|
+
|
|
41
|
+
// 4+ authors: show first 3 names then remaining count
|
|
42
|
+
const remaining = names.length - 2;
|
|
43
|
+
return `${names[0]}, ${names[1]} and ${remaining} ${remaining === 1 ? "other" : "others"}`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const AuthorRenderer: React.FC<{
|
|
47
|
+
index: number;
|
|
48
|
+
authors: any[];
|
|
49
|
+
}> = ({ authors, index }) => {
|
|
50
|
+
if (authors?.length === 1) {
|
|
51
|
+
const authorNameArr = [authors?.[0]?.first_name, authors?.[0]?.last_name].filter(Boolean);
|
|
52
|
+
|
|
53
|
+
const authorName = authorNameArr.join(" ");
|
|
54
|
+
|
|
55
|
+
const authorNameFallback = authorNameArr
|
|
56
|
+
?.map((v) => v?.[0])
|
|
57
|
+
.join("")
|
|
58
|
+
.toUpperCase();
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Box elementKey={`blogs.${index}.blog-author`}>
|
|
62
|
+
<Avatar className="h-8 w-8">
|
|
63
|
+
<AvatarImageV2 src={authors?.[0]?.profile_picture?.location} />
|
|
64
|
+
<AvatarFallbackV2>{authorNameFallback}</AvatarFallbackV2>
|
|
65
|
+
</Avatar>
|
|
66
|
+
<Box elementKey={`blogs.${index}.author-info-wrapper`}>
|
|
67
|
+
<Typography elementKey={`blogs.${index}.author-name`}>
|
|
68
|
+
{authorName ? authorName : "Anonymous"}
|
|
69
|
+
</Typography>
|
|
70
|
+
{/* <Typography elementKey={`blogs.${index}.author-description`}>
|
|
71
|
+
{authors?.[0]?.username}
|
|
72
|
+
</Typography> */}
|
|
73
|
+
</Box>
|
|
74
|
+
</Box>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (authors?.length > 1) {
|
|
79
|
+
const firstThreeAuthors = authors?.slice(0, 2);
|
|
80
|
+
const remainingAuthors = authors?.slice(2);
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Box
|
|
84
|
+
elementKey={`blogs.${index}.blog-authors`}
|
|
85
|
+
style={{
|
|
86
|
+
display: "flex",
|
|
87
|
+
gap: "8px",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<AvatarGroup className="">
|
|
92
|
+
{firstThreeAuthors?.map((author, authorIndex) => {
|
|
93
|
+
const authorNameArr = [author?.first_name, author?.last_name].filter(Boolean);
|
|
94
|
+
|
|
95
|
+
const authorName = authorNameArr.join(" ");
|
|
96
|
+
|
|
97
|
+
const authorNameFallback = authorNameArr
|
|
98
|
+
?.map((v) => v?.[0])
|
|
99
|
+
.join("")
|
|
100
|
+
.toUpperCase();
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Avatar key={`blogs.${index}.blog-author.${authorIndex}`} className="h-8 w-8">
|
|
104
|
+
<AvatarImageV2
|
|
105
|
+
src={author?.profile_picture?.location}
|
|
106
|
+
className="object-cover"
|
|
107
|
+
alt={authorName}
|
|
108
|
+
/>
|
|
109
|
+
<AvatarFallbackV2>{authorNameFallback}</AvatarFallbackV2>
|
|
110
|
+
</Avatar>
|
|
111
|
+
);
|
|
112
|
+
})}
|
|
113
|
+
{remainingAuthors?.length > 0 && (
|
|
114
|
+
<AvatarGroupCount
|
|
115
|
+
className="h-8 w-8"
|
|
116
|
+
style={{
|
|
117
|
+
background: "var(--color-brand-secondary)",
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
+{remainingAuthors?.length}
|
|
121
|
+
</AvatarGroupCount>
|
|
122
|
+
)}
|
|
123
|
+
</AvatarGroup>
|
|
124
|
+
<Typography
|
|
125
|
+
elementKey={`blogs.${index}.author-name`}
|
|
126
|
+
title={authors?.map((v) => v?.first_name)?.join(", ")}
|
|
127
|
+
>
|
|
128
|
+
{getAuthorsText(authors)}
|
|
129
|
+
</Typography>
|
|
130
|
+
</Box>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return <Box elementKey={`blogs.${index}.blog-author`} />;
|
|
135
|
+
};
|
|
136
|
+
|
|
32
137
|
const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ content, config }) => {
|
|
33
138
|
const { response, query, setQuery } = useContextEngine<IPost, IBlogMeta>("blogs");
|
|
34
139
|
const { isStudio, blockData } = useBlockContext();
|
|
@@ -36,7 +141,9 @@ const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ con
|
|
|
36
141
|
const handleNext = () => setQuery({ page: (query?.page || 0) + 1 });
|
|
37
142
|
const handlePrevious = () => setQuery({ page: (query?.page || 0) - 1 });
|
|
38
143
|
|
|
39
|
-
const
|
|
144
|
+
const blogStudioConfig = response?.meta?.studio_config?.find(
|
|
145
|
+
(item) => !item.block_instance_id && item?.module === "blog",
|
|
146
|
+
);
|
|
40
147
|
const fallbackConfig = (blockData as any)?.config?.blogs?.[0]?.blog?.action?.value;
|
|
41
148
|
|
|
42
149
|
return (
|
|
@@ -63,15 +170,16 @@ const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ con
|
|
|
63
170
|
data-levo_group_item
|
|
64
171
|
elementKey={`blogs.${index}.blog`}
|
|
65
172
|
config={
|
|
66
|
-
(isStudio &&
|
|
173
|
+
(isStudio && blogStudioConfig?.preview_url) ||
|
|
174
|
+
(!isStudio && blogStudioConfig?.live_url)
|
|
67
175
|
? {
|
|
68
176
|
action: {
|
|
69
177
|
type: "external_link",
|
|
70
178
|
value:
|
|
71
|
-
isStudio &&
|
|
72
|
-
?
|
|
73
|
-
: !isStudio &&
|
|
74
|
-
?
|
|
179
|
+
isStudio && blogStudioConfig.preview_url
|
|
180
|
+
? blogStudioConfig.preview_url.replace(/\{[^}]+\}/g, item?.slug)
|
|
181
|
+
: !isStudio && blogStudioConfig.live_url
|
|
182
|
+
? blogStudioConfig.live_url.replace(/\{[^}]+\}/g, item?.slug)
|
|
75
183
|
: "",
|
|
76
184
|
options: {},
|
|
77
185
|
},
|
|
@@ -119,30 +227,7 @@ const BlogListing3: React.FC<ILevoBlockBaseProps<IBlogListing3Content>> = ({ con
|
|
|
119
227
|
</Typography>
|
|
120
228
|
</Box>
|
|
121
229
|
<Box elementKey={`blogs.${index}.blog-footer`}>
|
|
122
|
-
<
|
|
123
|
-
<Avatar className="h-10 w-10">
|
|
124
|
-
<AvatarImageV2 src={item?.authors?.[0]?.profile_picture?.location} />
|
|
125
|
-
<AvatarFallbackV2>
|
|
126
|
-
{[item?.authors?.[0]?.first_name, item?.authors?.[0]?.last_name]
|
|
127
|
-
?.map((v) => v?.[0])
|
|
128
|
-
.filter(Boolean)
|
|
129
|
-
.join("")
|
|
130
|
-
.toUpperCase()}
|
|
131
|
-
</AvatarFallbackV2>
|
|
132
|
-
</Avatar>
|
|
133
|
-
<Box elementKey={`blogs.${index}.author-info-wrapper`}>
|
|
134
|
-
<Heading elementKey={`blogs.${index}.author-name`}>
|
|
135
|
-
{item?.authors?.[0]
|
|
136
|
-
? [item?.authors?.[0]?.first_name, item?.authors?.[0]?.last_name]
|
|
137
|
-
.filter(Boolean)
|
|
138
|
-
.join(" ")
|
|
139
|
-
: "Anonymous"}
|
|
140
|
-
</Heading>
|
|
141
|
-
<Typography elementKey={`blogs.${index}.author-description`}>
|
|
142
|
-
{item?.authors?.[0]?.bio || "Author"}
|
|
143
|
-
</Typography>
|
|
144
|
-
</Box>
|
|
145
|
-
</Box>
|
|
230
|
+
<AuthorRenderer authors={item?.authors ?? []} index={index} />
|
|
146
231
|
{item?.categories?.at(0)?.name && (
|
|
147
232
|
<Box elementKey={`blogs.${index}.category_wrapper`}>
|
|
148
233
|
<Icon elementKey={`blogs.${index}.category_icon`} />
|