@levo-so/blocks 0.1.75 → 0.1.76
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 +4 -4
- package/src/blocks/about-us/about-us-1.schema.ts +0 -3
- package/src/blocks/blogs/ClientOnly.tsx +24 -0
- package/src/blocks/blogs/blog-listing-1.schema.ts +750 -111
- package/src/blocks/blogs/blog-listing-1.tsx +123 -41
- package/src/blocks/blogs/blog-listing-2.schema.ts +1127 -2640
- package/src/blocks/blogs/blog-listing-2.tsx +110 -23
- package/src/blocks/blogs/blog-listing-3.schema.ts +713 -2010
- package/src/blocks/blogs/blog-listing-3.tsx +118 -20
- package/src/blocks/blogs/blog-post-1.schema.ts +262 -32
- package/src/blocks/blogs/blog-post-1.tsx +217 -28
- package/src/blocks/cards/cards-16.schema.ts +947 -0
- package/src/blocks/cards/cards-16.tsx +106 -0
- package/src/blocks/cards/cards-17.schema.ts +1945 -0
- package/src/blocks/cards/cards-17.tsx +112 -0
- package/src/blocks/cards/cards-18.schema.ts +1040 -0
- package/src/blocks/cards/cards-18.tsx +102 -0
- package/src/blocks/cards/cards-2.schema.ts +2 -2
- package/src/blocks/cards/cards-3.schema.ts +3 -16
- package/src/blocks/cards/cards-4.schema.ts +3 -28
- package/src/blocks/cards/cards-7.schema.ts +4 -7
- package/src/blocks/cards/cards-8.schema.ts +1 -10
- package/src/blocks/carousel/carousel-2.schema.ts +1 -2
- package/src/blocks/content/content-10.schema.ts +450 -0
- package/src/blocks/content/content-10.tsx +43 -0
- package/src/blocks/content/content-3.schema.ts +22 -28
- package/src/blocks/content/content-5.schema.ts +0 -4
- package/src/blocks/cta/cta-1.schema.ts +0 -3
- package/src/blocks/event/event-details.schema.ts +41 -175
- package/src/blocks/event/event-details.tsx +45 -50
- package/src/blocks/event/event-listing-2.schema.ts +437 -202
- package/src/blocks/event/event-listing-2.tsx +86 -22
- package/src/blocks/event/event-listing-3.schema.ts +232 -196
- package/src/blocks/event/event-listing-3.tsx +62 -29
- package/src/blocks/event/event-listing-4.schema.ts +314 -2824
- package/src/blocks/event/event-listing-4.tsx +68 -32
- package/src/blocks/event/event-listing.schema.ts +176 -1032
- package/src/blocks/event/event-listing.tsx +59 -25
- package/src/blocks/features/features-1/variants/stylized-cards-v2.ts +0 -1
- package/src/blocks/features/features-4.schema.ts +4 -14
- package/src/blocks/features/features-5.schema.ts +30 -51
- package/src/blocks/features/features-6.schema.ts +0 -1
- package/src/blocks/filter-listing/filter-listing-1.schema.ts +1 -3
- package/src/blocks/footer/footer-3.schema.ts +6 -14
- package/src/blocks/hero/hero-11.schema.ts +25 -54
- package/src/blocks/hero/hero-5.schema.ts +2 -6
- package/src/blocks/hero/hero-6.schema.ts +1 -10
- package/src/blocks/index.ts +4 -0
- package/src/blocks/logos/logos-1.schema.ts +0 -30
- package/src/blocks/pricing/pricing-1.schema.ts +0 -3
- package/src/blocks/stats/variants/default.ts +4 -5
- package/src/blocks/team/team-2.schema.ts +57 -154
- package/src/blocks/team/team-3.schema.ts +14 -31
- package/src/blocks/testimonial/testimonial-4.schema.ts +67 -152
- package/src/blocks/testimonial/testimonial-5/variants/default.ts +0 -1
- package/src/blocks/testimonial/testimonial-5/variants/testimonialWithLogo.ts +0 -1
- package/src/blocks/testimonial/testimonial-5/variants/testimonialWithRatings.ts +0 -1
- package/src/schemas/blocks.ts +8 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IModuleStudioConfig, LevoEvent } from "@levo-so/core";
|
|
1
2
|
import type { ILevoBlockBaseProps } from "@levo-so/studio";
|
|
2
3
|
import {
|
|
3
4
|
Box,
|
|
@@ -8,66 +9,98 @@ import {
|
|
|
8
9
|
Image,
|
|
9
10
|
Section,
|
|
10
11
|
Typography,
|
|
11
|
-
|
|
12
|
+
useBlockContext,
|
|
13
|
+
useContextEngine,
|
|
12
14
|
} from "@levo-so/studio";
|
|
13
15
|
import dayjs from "dayjs";
|
|
14
16
|
|
|
15
17
|
import { ClientOnly } from "./ClientOnly";
|
|
16
18
|
import type { IEventListing3 } from "./event-listing-3.schema";
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/** */
|
|
21
|
+
interface IEventMeta {
|
|
22
|
+
total: number;
|
|
23
|
+
pages: number;
|
|
24
|
+
series?: {
|
|
25
|
+
studio_config?: IModuleStudioConfig[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const EventListing3: React.FC<ILevoBlockBaseProps<IEventListing3>> = ({ content }) => {
|
|
30
|
+
const { response, query, setQuery } = useContextEngine<LevoEvent.Root, IEventMeta>("events");
|
|
31
|
+
const { isBuilder } = useBlockContext();
|
|
20
32
|
|
|
21
33
|
const handleNext = () => setQuery({ page: (query?.page || 0) + 1 });
|
|
22
34
|
const handlePrevious = () => setQuery({ page: (query?.page || 0) - 1 });
|
|
23
35
|
|
|
36
|
+
const studioConfig = response?.meta?.series?.studio_config?.find(
|
|
37
|
+
(item) => !item.block_instance_id,
|
|
38
|
+
);
|
|
39
|
+
|
|
24
40
|
return (
|
|
25
41
|
<Section elementKey="layout">
|
|
26
42
|
<Container elementKey="container">
|
|
27
|
-
<Box elementKey="header
|
|
28
|
-
<
|
|
29
|
-
|
|
43
|
+
<Box elementKey="header">
|
|
44
|
+
<Box elementKey="header-container">
|
|
45
|
+
<Heading elementKey="title" />
|
|
46
|
+
<Typography elementKey="description" />
|
|
47
|
+
</Box>
|
|
48
|
+
<Box elementKey="cta-buttons_levoGroup" data-levo_group>
|
|
49
|
+
{content?.["cta-buttons"]?.map((item, index: number) => (
|
|
50
|
+
<Button key={`cta-buttons.${index}`} elementKey={`cta-buttons.${index}.cta-button`} />
|
|
51
|
+
))}
|
|
52
|
+
</Box>
|
|
30
53
|
</Box>
|
|
31
54
|
|
|
32
55
|
<Box elementKey="events_levoGroup" data-levo_group>
|
|
33
|
-
{
|
|
56
|
+
{response?.data?.map((item, index: number) => (
|
|
34
57
|
<Box
|
|
35
58
|
key={`events-listing-element-${index}`}
|
|
36
59
|
data-levo_group_item
|
|
37
60
|
elementKey={`events.${index}.eventWrapper`}
|
|
61
|
+
config={
|
|
62
|
+
(isBuilder && studioConfig?.preview_url) || (!isBuilder && studioConfig?.live_url)
|
|
63
|
+
? {
|
|
64
|
+
action: {
|
|
65
|
+
type: "external_link",
|
|
66
|
+
value:
|
|
67
|
+
isBuilder && studioConfig.preview_url
|
|
68
|
+
? studioConfig.preview_url.replace(/\{[^}]+\}/g, item?.slug)
|
|
69
|
+
: !isBuilder && studioConfig.live_url
|
|
70
|
+
? studioConfig.live_url.replace(/\{[^}]+\}/g, item?.slug)
|
|
71
|
+
: "",
|
|
72
|
+
options: {},
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
: {}
|
|
76
|
+
}
|
|
38
77
|
>
|
|
39
|
-
<Image
|
|
78
|
+
<Image
|
|
79
|
+
elementKey={`events.${index}.image`}
|
|
80
|
+
alt="event poster"
|
|
81
|
+
image={item?.cover_image ?? undefined}
|
|
82
|
+
/>
|
|
40
83
|
<Box elementKey={`events.${index}.text-wrapper`}>
|
|
41
|
-
<Box elementKey={`events.${index}.
|
|
42
|
-
<
|
|
43
|
-
|
|
84
|
+
<Box elementKey={`events.${index}.date-wrapper`}>
|
|
85
|
+
<Icon elementKey={`events.${index}.date-icon`} />
|
|
86
|
+
<ClientOnly>
|
|
44
87
|
<Typography elementKey={`events.${index}.publishedAt-header`}>
|
|
45
|
-
|
|
46
|
-
{dayjs(item?.["publishedAt-header"]).format("MMM D, YYYY")}
|
|
47
|
-
</ClientOnly>
|
|
88
|
+
{dayjs(item?.starts_at).format("MMM D, YYYY")}
|
|
48
89
|
</Typography>
|
|
49
|
-
</
|
|
50
|
-
|
|
51
|
-
<Box elementKey={`events.${index}.author-wrapper`}>
|
|
52
|
-
<Icon elementKey={`events.${index}.author-image`} />
|
|
53
|
-
<Typography elementKey={`events.${index}.author-name`} />
|
|
54
|
-
</Box>
|
|
90
|
+
</ClientOnly>
|
|
55
91
|
</Box>
|
|
56
92
|
|
|
57
93
|
<Box elementKey={`events.${index}.content-container`}>
|
|
58
|
-
<
|
|
59
|
-
<Typography elementKey={`events.${index}.description`}
|
|
60
|
-
|
|
61
|
-
<ClientOnly>{dayjs(item?.publishedAt).format("MMM D, YYYY")}</ClientOnly>
|
|
94
|
+
<Heading elementKey={`events.${index}.title`}>{item?.title}</Heading>
|
|
95
|
+
<Typography elementKey={`events.${index}.description`}>
|
|
96
|
+
{item?.description}
|
|
62
97
|
</Typography>
|
|
63
|
-
|
|
64
|
-
<Button elementKey={`events.${index}.cta`} />
|
|
65
98
|
</Box>
|
|
66
99
|
</Box>
|
|
67
100
|
</Box>
|
|
68
101
|
))}
|
|
69
102
|
</Box>
|
|
70
|
-
{(meta
|
|
103
|
+
{(response?.meta.pages ?? 0) > 1 && (
|
|
71
104
|
<Box elementKey="paginationWrapper">
|
|
72
105
|
<Button
|
|
73
106
|
elementKey="paginationLeftButton"
|
|
@@ -76,12 +109,12 @@ const EventListing3: React.FC<ILevoBlockBaseProps<IEventListing3>> = () => {
|
|
|
76
109
|
/>
|
|
77
110
|
|
|
78
111
|
<Typography elementKey="paginationText">
|
|
79
|
-
{`${query?.page || 0}/${meta?.pages || 0}`}
|
|
112
|
+
{`${query?.page || 0}/${response?.meta?.pages || 0}`}
|
|
80
113
|
</Typography>
|
|
81
114
|
<Button
|
|
82
115
|
elementKey="paginationRightButton"
|
|
83
116
|
onClick={handleNext}
|
|
84
|
-
disabled={query?.page === meta?.pages}
|
|
117
|
+
disabled={query?.page === response?.meta?.pages}
|
|
85
118
|
/>
|
|
86
119
|
</Box>
|
|
87
120
|
)}
|