@levo-so/blocks 0.1.81 → 0.1.83

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.
@@ -1,125 +1,151 @@
1
- import type { BlockComponent } from "@levo-so/studio";
2
- import { lazy } from "react";
1
+ import type { ComponentType } from "react";
3
2
 
4
- export const blocks: Record<string, BlockComponent> = {
5
- "about-us-2:v1": lazy(() => import("./about-us/about-us-2")),
6
- "about-us-1:v1": lazy(() => import("./about-us/about-us-1")),
7
- "blog-listing-1:v1": lazy(() => import("./blogs/blog-listing-1")),
8
- "blog-listing-2:v1": lazy(() => import("./blogs/blog-listing-2")),
9
- "blog-listing-3:v1": lazy(() => import("./blogs/blog-listing-3")),
10
- "blog-post-1:v1": lazy(() => import("./blogs/blog-post-1")),
11
- "calendar-1:v1": lazy(() => import("./calendar/calendar-1")),
12
- "community-1:v1": lazy(() => import("./community/community-1")),
13
- "community-post-1:v1": lazy(() => import("./community/community-post-1")),
14
- "cards-2:v1": lazy(() => import("./cards/cards-2")),
15
- "cards-3:v1": lazy(() => import("./cards/cards-3")),
16
- "cards-4:v1": lazy(() => import("./cards/cards-4")),
17
- "cards-5:v1": lazy(() => import("./cards/cards-5")),
18
- "cards-6:v1": lazy(() => import("./cards/cards-6")),
19
- "cards-7:v1": lazy(() => import("./cards/cards-7")),
20
- "cards-8:v1": lazy(() => import("./cards/cards-8")),
21
- "cards-9:v1": lazy(() => import("./cards/cards-9")),
22
- "cards-10:v1": lazy(() => import("./cards/cards-10")),
23
- "cards-11:v1": lazy(() => import("./cards/cards-11")),
24
- "cards-12:v1": lazy(() => import("./cards/cards-12")),
25
- "cards-13:v1": lazy(() => import("./cards/cards-13")),
26
- "cards-14:v1": lazy(() => import("./cards/cards-14")),
27
- "cards-15:v1": lazy(() => import("./cards/cards-15")),
28
- "cards-16:v1": lazy(() => import("./cards/cards-16")),
29
- "cards-17:v1": lazy(() => import("./cards/cards-17")),
30
- "cards-18:v1": lazy(() => import("./cards/cards-18")),
31
- "contact-us-1:v1": lazy(() => import("./contact-us/contact-us-1")),
32
- "contact-us-2:v1": lazy(() => import("./contact-us/contact-us-2")),
33
- "content-1:v1": lazy(() => import("./content/content-1")),
34
- "content-2:v1": lazy(() => import("./content/content-2")),
35
- "content-3:v1": lazy(() => import("./content/content-3")),
36
- "content-4:v1": lazy(() => import("./content/content-4")),
37
- "content-5:v1": lazy(() => import("./content/content-5")),
38
- "content-6:v1": lazy(() => import("./content/content-6")),
39
- "content-7:v1": lazy(() => import("./content/content-7")),
40
- "content-8:v1": lazy(() => import("./content/content-8")),
41
- "content-9:v1": lazy(() => import("./content/content-9")),
42
- "content-10:v1": lazy(() => import("./content/content-10")),
43
- "timeline-1:v1": lazy(() => import("./timeline/timeline-1")),
44
- "cta-1:v1": lazy(() => import("./cta/cta-1")),
45
- "cta-2:v1": lazy(() => import("./cta/cta-2")),
46
- "cta-3:v1": lazy(() => import("./cta/cta-3")),
47
- "embed-1:v1": lazy(() => import("./embed/embed-1")),
48
- "event-listing:v1": lazy(() => import("./event/event-listing")),
49
- "event-listing-2:v1": lazy(() => import("./event/event-listing-2")),
50
- "event-listing-3:v1": lazy(() => import("./event/event-listing-3")),
51
- "event-listing-4:v1": lazy(() => import("./event/event-listing-4")),
52
- "event-details:v1": lazy(() => import("./event/event-details")),
53
- "faq-1:v1": lazy(() => import("./faq/faq-1")),
54
- "faq-2:v1": lazy(() => import("./faq/faq-2")),
55
- "faq-3:v1": lazy(() => import("./faq/faq-3")),
56
- "features-1:v1": lazy(() => import("./features/features-1/features-1")),
57
- "features-2:v1": lazy(() => import("./features/features-2")),
58
- "features-3:v1": lazy(() => import("./features/features-3")),
59
- "features-4:v1": lazy(() => import("./features/features-4")),
60
- "features-5:v1": lazy(() => import("./features/features-5")),
61
- "features-6:v1": lazy(() => import("./features/features-6")),
62
- "footer-1:v1": lazy(() => import("./footer/footer-1")),
63
- "footer-2:v1": lazy(() => import("./footer/footer-2")),
64
- "footer-3:v1": lazy(() => import("./footer/footer-3")),
65
- "footer-4:v1": lazy(() => import("./footer/footer-4")),
66
- "footer-5:v1": lazy(() => import("./footer/footer-5")),
67
- "footer-6:v1": lazy(() => import("./footer/footer-6")),
68
- "form-1:v1": lazy(() => import("./form/form-1")),
69
- "filter-listing-1:v1": lazy(() => import("./filter-listing/filter-listing-1")),
70
- "hero-1:v1": lazy(() => import("./hero/hero-1")),
71
- "hero-2:v1": lazy(() => import("./hero/hero-2")),
72
- "hero-3:v1": lazy(() => import("./hero/hero-3")),
73
- "hero-4:v1": lazy(() => import("./hero/hero-4")),
74
- "hero-5:v1": lazy(() => import("./hero/hero-5")),
75
- "hero-6:v1": lazy(() => import("./hero/hero-6")),
76
- "hero-7:v1": lazy(() => import("./hero/hero-7")),
77
- "hero-8:v1": lazy(() => import("./hero/hero-8")),
78
- "hero-9:v1": lazy(() => import("./hero/hero-9")),
79
- "hero-10:v1": lazy(() => import("./hero/hero-10")),
80
- "hero-11:v1": lazy(() => import("./hero/hero-11")),
81
- "hero-12:v1": lazy(() => import("./hero/hero-12")),
82
- "hero-13:v1": lazy(() => import("./hero/hero-13")),
83
- "jobs-1:v1": lazy(() => import("./jobs/jobs-1")),
84
- "logos-1:v1": lazy(() => import("./logos/logos-1")),
85
- "navbar-1:v1": lazy(() => import("./navbar/navbar-1")),
86
- "navbar-2:v1": lazy(() => import("./navbar/navbar-2")),
87
- "navbar-3:v1": lazy(() => import("./navbar/navbar-3")),
88
- "navbar-4:v1": lazy(() => import("./navbar/navbar-4")),
89
- "pricing-1:v1": lazy(() => import("./pricing/pricing-1")),
90
- "polling-1:v1": lazy(() => import("./polling/polling-1")),
91
- "products-listing-1:v1": lazy(() => import("./products/products-listing-1")),
92
- "products-listing-2:v1": lazy(() => import("./products/products-listing-2")),
93
- "products-listing-3:v1": lazy(() => import("./products/products-listing-3")),
94
- "stats-1:v1": lazy(() => import("./stats/stats-1")),
95
- "stats-2:v1": lazy(() => import("./stats/stats-2")),
96
- "team-1:v1": lazy(() => import("./team/team-1")),
97
- "team-2:v1": lazy(() => import("./team/team-2")),
98
- "team-3:v1": lazy(() => import("./team/team-3")),
99
- "team-4:v1": lazy(() => import("./team/team-4")),
100
- "team-5:v1": lazy(() => import("./team/team-5")),
3
+ type BlockImportFn = () => Promise<{ default: ComponentType<any> }>;
101
4
 
102
- "testimonial-1:v1": lazy(() => import("./testimonial/testimonial-1")),
103
- "testimonial-2:v1": lazy(() => import("./testimonial/testimonial-2")),
104
- "testimonial-3:v1": lazy(() => import("./testimonial/testimonial-3")),
105
- "testimonial-4:v1": lazy(() => import("./testimonial/testimonial-4")),
106
- "testimonial-5:v1": lazy(() => import("./testimonial/testimonial-5")),
107
- "testimonial-6:v1": lazy(() => import("./testimonial/testimonial-6")),
108
- "testimonial-7:v1": lazy(() => import("./testimonial/testimonial-7")),
109
- "terms-and-conditions-1:v1": lazy(() => import("./termsAndPrivacy/terms-and-conditions-1")),
110
- "carousel-1:v1": lazy(() => import("./carousel/carousel-1")),
111
- "carousel-2:v1": lazy(() => import("./carousel/carousel-2")),
112
- "profile-1:v1": lazy(() => import("./profile/profile-1")),
113
- "profile-2:v1": lazy(() => import("./profile/profile-2")),
114
- "profile-3:v1": lazy(() => import("./profile/profile-3")),
115
- "profile-4:v1": lazy(() => import("./profile/profile-4")),
116
- "profile-5:v1": lazy(() => import("./profile/profile-5")),
117
- "edit-profile:v1": lazy(() => import("./users/edit-profile")),
118
- "service-2:v1": lazy(() => import("./services/service-2")),
119
- "service-3:v1": lazy(() => import("./services/service-3")),
120
- "tab-1:v1": lazy(() => import("./tabs/tab-1")),
121
- "tab-2:v1": lazy(() => import("./tabs/tab-2")),
122
- "tab-3:v1": lazy(() => import("./tabs/tab-3")),
123
- "service-1:v1": lazy(() => import("./services/service-1")),
124
- "floating-button-1:v1": lazy(() => import("./floating-buttons/floating-button-1")),
5
+ /** Raw dynamic import functions for every block. Single source of truth. */
6
+ export const blockImports: Record<string, BlockImportFn> = {
7
+ "about-us-2:v1": () => import("./about-us/about-us-2"),
8
+ "about-us-1:v1": () => import("./about-us/about-us-1"),
9
+ "blog-listing-1:v1": () => import("./blogs/blog-listing-1"),
10
+ "blog-listing-2:v1": () => import("./blogs/blog-listing-2"),
11
+ "blog-listing-3:v1": () => import("./blogs/blog-listing-3"),
12
+ "blog-post-1:v1": () => import("./blogs/blog-post-1"),
13
+ "calendar-1:v1": () => import("./calendar/calendar-1"),
14
+ "community-1:v1": () => import("./community/community-1"),
15
+ "community-post-1:v1": () => import("./community/community-post-1"),
16
+ "cards-2:v1": () => import("./cards/cards-2"),
17
+ "cards-3:v1": () => import("./cards/cards-3"),
18
+ "cards-4:v1": () => import("./cards/cards-4"),
19
+ "cards-5:v1": () => import("./cards/cards-5"),
20
+ "cards-6:v1": () => import("./cards/cards-6"),
21
+ "cards-7:v1": () => import("./cards/cards-7"),
22
+ "cards-8:v1": () => import("./cards/cards-8"),
23
+ "cards-9:v1": () => import("./cards/cards-9"),
24
+ "cards-10:v1": () => import("./cards/cards-10"),
25
+ "cards-11:v1": () => import("./cards/cards-11"),
26
+ "cards-12:v1": () => import("./cards/cards-12"),
27
+ "cards-13:v1": () => import("./cards/cards-13"),
28
+ "cards-14:v1": () => import("./cards/cards-14"),
29
+ "cards-15:v1": () => import("./cards/cards-15"),
30
+ "cards-16:v1": () => import("./cards/cards-16"),
31
+ "cards-17:v1": () => import("./cards/cards-17"),
32
+ "cards-18:v1": () => import("./cards/cards-18"),
33
+ "cards-19:v1": () => import("./cards/cards-19"),
34
+ "cards-20:v1": () => import("./cards/cards-20"),
35
+ "cards-21:v1": () => import("./cards/cards-21"),
36
+ "cards-22:v1": () => import("./cards/cards-22"),
37
+ "cards-23:v1": () => import("./cards/cards-23"),
38
+ "contact-us-1:v1": () => import("./contact-us/contact-us-1"),
39
+ "contact-us-2:v1": () => import("./contact-us/contact-us-2"),
40
+ "content-1:v1": () => import("./content/content-1"),
41
+ "content-2:v1": () => import("./content/content-2"),
42
+ "content-3:v1": () => import("./content/content-3"),
43
+ "content-4:v1": () => import("./content/content-4"),
44
+ "content-5:v1": () => import("./content/content-5"),
45
+ "content-6:v1": () => import("./content/content-6"),
46
+ "content-7:v1": () => import("./content/content-7"),
47
+ "content-8:v1": () => import("./content/content-8"),
48
+ "content-9:v1": () => import("./content/content-9"),
49
+ "content-10:v1": () => import("./content/content-10"),
50
+ "timeline-1:v1": () => import("./timeline/timeline-1"),
51
+ "cta-1:v1": () => import("./cta/cta-1"),
52
+ "cta-2:v1": () => import("./cta/cta-2"),
53
+ "cta-3:v1": () => import("./cta/cta-3"),
54
+ "embed-1:v1": () => import("./embed/embed-1"),
55
+ "event-listing:v1": () => import("./event/event-listing"),
56
+ "event-listing-2:v1": () => import("./event/event-listing-2"),
57
+ "event-listing-3:v1": () => import("./event/event-listing-3"),
58
+ "event-listing-4:v1": () => import("./event/event-listing-4"),
59
+ "event-details:v1": () => import("./event/event-details"),
60
+ "faq-1:v1": () => import("./faq/faq-1"),
61
+ "faq-2:v1": () => import("./faq/faq-2"),
62
+ "faq-3:v1": () => import("./faq/faq-3"),
63
+ "features-1:v1": () => import("./features/features-1/features-1"),
64
+ "features-2:v1": () => import("./features/features-2"),
65
+ "features-3:v1": () => import("./features/features-3"),
66
+ "features-4:v1": () => import("./features/features-4"),
67
+ "features-5:v1": () => import("./features/features-5"),
68
+ "features-6:v1": () => import("./features/features-6"),
69
+ "footer-1:v1": () => import("./footer/footer-1"),
70
+ "footer-2:v1": () => import("./footer/footer-2"),
71
+ "footer-3:v1": () => import("./footer/footer-3"),
72
+ "footer-4:v1": () => import("./footer/footer-4"),
73
+ "footer-5:v1": () => import("./footer/footer-5"),
74
+ "footer-6:v1": () => import("./footer/footer-6"),
75
+ "form-1:v1": () => import("./form/form-1"),
76
+ "filter-listing-1:v1": () => import("./filter-listing/filter-listing-1"),
77
+ "hero-1:v1": () => import("./hero/hero-1"),
78
+ "hero-2:v1": () => import("./hero/hero-2"),
79
+ "hero-3:v1": () => import("./hero/hero-3"),
80
+ "hero-4:v1": () => import("./hero/hero-4"),
81
+ "hero-5:v1": () => import("./hero/hero-5"),
82
+ "hero-6:v1": () => import("./hero/hero-6"),
83
+ "hero-7:v1": () => import("./hero/hero-7"),
84
+ "hero-8:v1": () => import("./hero/hero-8"),
85
+ "hero-9:v1": () => import("./hero/hero-9"),
86
+ "hero-10:v1": () => import("./hero/hero-10"),
87
+ "hero-11:v1": () => import("./hero/hero-11"),
88
+ "hero-12:v1": () => import("./hero/hero-12"),
89
+ "hero-13:v1": () => import("./hero/hero-13"),
90
+ "jobs-1:v1": () => import("./jobs/jobs-1"),
91
+ "logos-1:v1": () => import("./logos/logos-1"),
92
+ "navbar-1:v1": () => import("./navbar/navbar-1"),
93
+ "navbar-2:v1": () => import("./navbar/navbar-2"),
94
+ "navbar-3:v1": () => import("./navbar/navbar-3"),
95
+ "navbar-4:v1": () => import("./navbar/navbar-4"),
96
+ "pricing-1:v1": () => import("./pricing/pricing-1"),
97
+ "polling-1:v1": () => import("./polling/polling-1"),
98
+ "products-listing-1:v1": () => import("./products/products-listing-1"),
99
+ "products-listing-2:v1": () => import("./products/products-listing-2"),
100
+ "products-listing-3:v1": () => import("./products/products-listing-3"),
101
+ "stats-1:v1": () => import("./stats/stats-1"),
102
+ "stats-2:v1": () => import("./stats/stats-2"),
103
+ "team-1:v1": () => import("./team/team-1"),
104
+ "team-2:v1": () => import("./team/team-2"),
105
+ "team-3:v1": () => import("./team/team-3"),
106
+ "team-4:v1": () => import("./team/team-4"),
107
+ "team-5:v1": () => import("./team/team-5"),
108
+ "testimonial-1:v1": () => import("./testimonial/testimonial-1"),
109
+ "testimonial-2:v1": () => import("./testimonial/testimonial-2"),
110
+ "testimonial-3:v1": () => import("./testimonial/testimonial-3"),
111
+ "testimonial-4:v1": () => import("./testimonial/testimonial-4"),
112
+ "testimonial-5:v1": () => import("./testimonial/testimonial-5"),
113
+ "testimonial-6:v1": () => import("./testimonial/testimonial-6"),
114
+ "testimonial-7:v1": () => import("./testimonial/testimonial-7"),
115
+ "terms-and-conditions-1:v1": () => import("./termsAndPrivacy/terms-and-conditions-1"),
116
+ "carousel-1:v1": () => import("./carousel/carousel-1"),
117
+ "carousel-2:v1": () => import("./carousel/carousel-2"),
118
+ "profile-1:v1": () => import("./profile/profile-1"),
119
+ "profile-2:v1": () => import("./profile/profile-2"),
120
+ "profile-3:v1": () => import("./profile/profile-3"),
121
+ "profile-4:v1": () => import("./profile/profile-4"),
122
+ "profile-5:v1": () => import("./profile/profile-5"),
123
+ "edit-profile:v1": () => import("./users/edit-profile"),
124
+ "service-2:v1": () => import("./services/service-2"),
125
+ "service-3:v1": () => import("./services/service-3"),
126
+ "tab-1:v1": () => import("./tabs/tab-1"),
127
+ "tab-2:v1": () => import("./tabs/tab-2"),
128
+ "tab-3:v1": () => import("./tabs/tab-3"),
129
+ "service-1:v1": () => import("./services/service-1"),
130
+ "floating-button-1:v1": () => import("./floating-buttons/floating-button-1"),
125
131
  };
132
+
133
+ /**
134
+ * Wraps raw block import functions with a framework-specific loader.
135
+ *
136
+ * @example
137
+ * // Next.js (SSR-safe)
138
+ * import dynamic from "next/dynamic";
139
+ * const blocks = wrapBlocks(blockImports, dynamic);
140
+ *
141
+ * @example
142
+ * // React SPA
143
+ * import { lazy } from "react";
144
+ * const blocks = wrapBlocks(blockImports, lazy);
145
+ */
146
+ export function wrapBlocks<T>(
147
+ imports: Record<string, BlockImportFn>,
148
+ wrapper: (loader: BlockImportFn) => T,
149
+ ): Record<string, T> {
150
+ return Object.fromEntries(Object.entries(imports).map(([key, loader]) => [key, wrapper(loader)]));
151
+ }
package/src/index.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import { blocksRegistry } from "@levo-so/studio";
2
2
 
3
- import * as components from "./blocks";
4
3
  import * as schemas from "./schemas";
5
4
 
6
- export { components };
5
+ export { blockImports, wrapBlocks } from "./blocks";
7
6
  export { schemas };
8
7
 
9
8
  export const registerLibrary = () => {
@@ -24,6 +24,11 @@ import { Cards15 } from "../blocks/cards/cards-15.schema";
24
24
  import { Cards16 } from "../blocks/cards/cards-16.schema";
25
25
  import { Cards17 } from "../blocks/cards/cards-17.schema";
26
26
  import { Cards18 } from "../blocks/cards/cards-18.schema";
27
+ import { Cards19 } from "../blocks/cards/cards-19.schema";
28
+ import { Cards20 } from "../blocks/cards/cards-20.schema";
29
+ import { Cards21 } from "../blocks/cards/cards-21.schema";
30
+ import { Cards22 } from "../blocks/cards/cards-22.schema";
31
+ import { Cards23 } from "../blocks/cards/cards-23.schema";
27
32
  import { Carousel1 } from "../blocks/carousel/carousel-1.schema";
28
33
  import { Carousel2 } from "../blocks/carousel/carousel-2.schema";
29
34
  import { Community1 } from "../blocks/community/community-1.schema";
@@ -147,6 +152,11 @@ export const BlockList: IBlock[] = [
147
152
  Cards16,
148
153
  Cards17,
149
154
  Cards18,
155
+ Cards19,
156
+ Cards20,
157
+ Cards21,
158
+ Cards22,
159
+ Cards23,
150
160
  Carousel1,
151
161
  Carousel2,
152
162
  ContactUs1,