@onexapis/cli 1.1.17 → 1.1.18

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.
Files changed (61) hide show
  1. package/README.md +82 -16
  2. package/dist/cli.js +522 -286
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +519 -283
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/index.js +47 -270
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +47 -270
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/templates/default/.env.example +1 -1
  12. package/templates/default/.mcp.json +8 -0
  13. package/templates/default/CLAUDE.md +941 -0
  14. package/templates/default/bundle-entry.ts +18 -0
  15. package/templates/default/index.ts +26 -0
  16. package/templates/default/package.json +37 -0
  17. package/templates/default/pages/about.ts +66 -0
  18. package/templates/default/pages/home.ts +93 -0
  19. package/templates/default/pages/showcase.ts +146 -0
  20. package/templates/default/sections/about/about-default.tsx +237 -0
  21. package/templates/default/sections/about/about.schema.ts +259 -0
  22. package/templates/default/sections/about/index.ts +15 -0
  23. package/templates/default/sections/cta/cta-default.tsx +180 -0
  24. package/templates/default/sections/cta/cta.schema.ts +210 -0
  25. package/templates/default/sections/cta/index.ts +11 -0
  26. package/templates/default/sections/features/features-default.tsx +154 -0
  27. package/templates/default/sections/features/features.schema.ts +330 -0
  28. package/templates/default/sections/features/index.ts +11 -0
  29. package/templates/default/sections/gallery/gallery-default.tsx +134 -0
  30. package/templates/default/sections/gallery/gallery.schema.ts +397 -0
  31. package/templates/default/sections/gallery/index.ts +11 -0
  32. package/templates/default/sections/hero/hero-default.tsx +212 -0
  33. package/templates/default/sections/hero/hero.schema.ts +273 -0
  34. package/templates/default/sections/hero/index.ts +15 -0
  35. package/templates/default/sections/stats/index.ts +11 -0
  36. package/templates/default/sections/stats/stats-default.tsx +103 -0
  37. package/templates/default/sections/stats/stats.schema.ts +266 -0
  38. package/templates/default/sections/testimonials/index.ts +11 -0
  39. package/templates/default/sections/testimonials/testimonials-default.tsx +130 -0
  40. package/templates/default/sections/testimonials/testimonials.schema.ts +371 -0
  41. package/templates/default/sections-registry.ts +32 -0
  42. package/templates/default/theme.config.ts +107 -0
  43. package/templates/default/theme.layout.ts +21 -0
  44. package/templates/default/tsconfig.json +16 -7
  45. package/templates/default/README.md.ejs +0 -129
  46. package/templates/default/esbuild.config.js +0 -81
  47. package/templates/default/package.json.ejs +0 -31
  48. package/templates/default/src/config.ts.ejs +0 -98
  49. package/templates/default/src/index.ts.ejs +0 -11
  50. package/templates/default/src/layout.ts +0 -23
  51. package/templates/default/src/manifest.ts.ejs +0 -47
  52. package/templates/default/src/pages/home.ts.ejs +0 -37
  53. package/templates/default/src/sections/footer/footer-default.tsx +0 -28
  54. package/templates/default/src/sections/footer/footer.schema.ts +0 -45
  55. package/templates/default/src/sections/footer/index.ts +0 -2
  56. package/templates/default/src/sections/header/header-default.tsx +0 -61
  57. package/templates/default/src/sections/header/header.schema.ts +0 -46
  58. package/templates/default/src/sections/header/index.ts +0 -2
  59. package/templates/default/src/sections/hero/hero-default.tsx +0 -52
  60. package/templates/default/src/sections/hero/hero.schema.ts +0 -52
  61. package/templates/default/src/sections/hero/index.ts +0 -2
@@ -0,0 +1,273 @@
1
+ import type { SectionSchema, FieldDefinition } from "@onexapis/core/types";
2
+
3
+ const commonSettings: FieldDefinition[] = [
4
+ {
5
+ id: "title",
6
+ type: "text",
7
+ label: "Title",
8
+ default: "Welcome to Our Site",
9
+ required: true,
10
+ },
11
+ {
12
+ id: "subtitle",
13
+ type: "text",
14
+ label: "Subtitle",
15
+ default: "This is a simple, clean theme for your website",
16
+ },
17
+ {
18
+ id: "buttonText",
19
+ type: "text",
20
+ label: "Button Text",
21
+ default: "Get Started",
22
+ },
23
+ {
24
+ id: "buttonLink",
25
+ type: "url",
26
+ label: "Button Link",
27
+ default: "/contact",
28
+ },
29
+ {
30
+ id: "secondaryButtonText",
31
+ type: "text",
32
+ label: "Secondary Button Text",
33
+ default: "Learn More",
34
+ },
35
+ {
36
+ id: "secondaryButtonLink",
37
+ type: "url",
38
+ label: "Secondary Button Link",
39
+ default: "/about",
40
+ },
41
+ {
42
+ id: "badgeText",
43
+ type: "text",
44
+ label: "Badge Text",
45
+ default: "New Release",
46
+ },
47
+ {
48
+ id: "showBadge",
49
+ type: "checkbox",
50
+ label: "Show Badge",
51
+ default: true,
52
+ },
53
+ {
54
+ id: "showImage",
55
+ type: "checkbox",
56
+ label: "Show Image",
57
+ default: true,
58
+ },
59
+ {
60
+ id: "backgroundColor",
61
+ type: "color",
62
+ label: "Background Color",
63
+ default: "#3B82F6",
64
+ },
65
+ ];
66
+
67
+ export const heroSchema: SectionSchema = {
68
+ type: "my-simple-hero",
69
+ name: "Simple Hero",
70
+ description:
71
+ "Hero section with badge, heading, paragraph, divider, buttons, and image",
72
+ category: "marketing",
73
+ icon: "layout",
74
+ settings: commonSettings,
75
+ templates: [
76
+ {
77
+ id: "default",
78
+ name: "Default Hero",
79
+ description:
80
+ "A hero section with badge, title, subtitle, divider, CTA buttons, and image",
81
+ },
82
+ ],
83
+ blocks: [
84
+ {
85
+ type: "hero-content",
86
+ name: "Hero Content",
87
+ description:
88
+ "Hero content block with badge, title, subtitle, buttons, and image",
89
+ icon: "layout",
90
+ settings: [
91
+ {
92
+ id: "contentAlignment",
93
+ type: "select",
94
+ label: "Content Alignment",
95
+ default: "center",
96
+ options: [
97
+ { label: "Left", value: "left" },
98
+ { label: "Center", value: "center" },
99
+ { label: "Right", value: "right" },
100
+ ],
101
+ },
102
+ {
103
+ id: "contentWidth",
104
+ type: "select",
105
+ label: "Content Width",
106
+ default: "lg",
107
+ options: [
108
+ { label: "Small", value: "sm" },
109
+ { label: "Medium", value: "md" },
110
+ { label: "Large", value: "lg" },
111
+ { label: "Full", value: "full" },
112
+ ],
113
+ },
114
+ ],
115
+ defaults: {
116
+ contentAlignment: "center",
117
+ contentWidth: "lg",
118
+ },
119
+ limit: 1,
120
+ },
121
+ ],
122
+ maxBlocks: 1,
123
+ defaults: {
124
+ settings: {
125
+ title: "Welcome to Our Site",
126
+ subtitle: "This is a simple, clean theme for your website",
127
+ buttonText: "Get Started",
128
+ buttonLink: "/contact",
129
+ secondaryButtonText: "Learn More",
130
+ secondaryButtonLink: "/about",
131
+ badgeText: "New Release",
132
+ showBadge: true,
133
+ showImage: true,
134
+ backgroundColor: "#3B82F6",
135
+ },
136
+ blocks: [
137
+ {
138
+ id: "hero-content-1",
139
+ type: "hero-content",
140
+ order: 0,
141
+ enabled: true,
142
+ settings: {},
143
+ components: [
144
+ {
145
+ id: "hero-badge",
146
+ type: "badge",
147
+ slot: "badge",
148
+ order: 0,
149
+ content: { text: "New Release" },
150
+ style: {
151
+ fontSize: "sm",
152
+ fontWeight: "semibold",
153
+ color: "#3B82F6",
154
+ backgroundColor: "rgba(255,255,255,0.2)",
155
+ padding: "0.25rem 0.75rem",
156
+ borderRadius: "9999px",
157
+ },
158
+ styleMode: "advanced",
159
+ enabled: true,
160
+ },
161
+ {
162
+ id: "hero-title",
163
+ type: "heading",
164
+ slot: "title",
165
+ order: 1,
166
+ content: {
167
+ text: "Welcome to Our Site",
168
+ tag: "h1",
169
+ },
170
+ style: {
171
+ fontSize: "5xl",
172
+ fontWeight: "bold",
173
+ color: "#FFFFFF",
174
+ marginBottom: "1rem",
175
+ },
176
+ styleMode: "advanced",
177
+ enabled: true,
178
+ },
179
+ {
180
+ id: "hero-subtitle",
181
+ type: "paragraph",
182
+ slot: "subtitle",
183
+ order: 2,
184
+ content: {
185
+ text: "This is a simple, clean theme for your website",
186
+ },
187
+ style: {
188
+ fontSize: "xl",
189
+ color: "rgba(255,255,255,0.9)",
190
+ marginBottom: "1.5rem",
191
+ },
192
+ styleMode: "advanced",
193
+ enabled: true,
194
+ },
195
+ {
196
+ id: "hero-divider",
197
+ type: "divider",
198
+ slot: "divider",
199
+ order: 3,
200
+ content: {},
201
+ style: {
202
+ borderColor: "rgba(255,255,255,0.3)",
203
+ marginTop: "0.5rem",
204
+ marginBottom: "1.5rem",
205
+ },
206
+ styleMode: "advanced",
207
+ enabled: true,
208
+ },
209
+ {
210
+ id: "hero-cta",
211
+ type: "button",
212
+ slot: "cta",
213
+ order: 4,
214
+ content: {
215
+ text: "Get Started",
216
+ href: "/contact",
217
+ },
218
+ style: {
219
+ fontSize: "base",
220
+ fontWeight: "semibold",
221
+ color: "#3B82F6",
222
+ backgroundColor: "#FFFFFF",
223
+ padding: "0.75rem 2rem",
224
+ borderRadius: "0.5rem",
225
+ },
226
+ styleMode: "advanced",
227
+ enabled: true,
228
+ },
229
+ {
230
+ id: "hero-secondary-cta",
231
+ type: "button",
232
+ slot: "secondary-cta",
233
+ order: 5,
234
+ content: {
235
+ text: "Learn More",
236
+ href: "/about",
237
+ },
238
+ style: {
239
+ fontSize: "base",
240
+ fontWeight: "semibold",
241
+ color: "#FFFFFF",
242
+ backgroundColor: "transparent",
243
+ padding: "0.75rem 2rem",
244
+ borderRadius: "0.5rem",
245
+ borderWidth: "2px",
246
+ borderColor: "#FFFFFF",
247
+ },
248
+ styleMode: "advanced",
249
+ enabled: true,
250
+ },
251
+ {
252
+ id: "hero-image",
253
+ type: "image",
254
+ slot: "image",
255
+ order: 6,
256
+ content: {
257
+ src: "https://picsum.photos/seed/hero/800/500",
258
+ alt: "Hero illustration",
259
+ },
260
+ style: {
261
+ width: "100%",
262
+ height: "auto",
263
+ borderRadius: "0.75rem",
264
+ marginTop: "2rem",
265
+ },
266
+ styleMode: "advanced",
267
+ enabled: true,
268
+ },
269
+ ],
270
+ },
271
+ ],
272
+ },
273
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Simple Hero Section Registry
3
+ */
4
+
5
+ import type { SectionComponentProps } from "@onexapis/core/types";
6
+ import { HeroDefault } from "./hero-default";
7
+
8
+ export const heroComponents: Record<
9
+ string,
10
+ React.ComponentType<SectionComponentProps>
11
+ > = {
12
+ default: HeroDefault,
13
+ };
14
+
15
+ export { heroSchema } from "./hero.schema";
@@ -0,0 +1,11 @@
1
+ import type { SectionComponentProps } from "@onexapis/core/types";
2
+ import { StatsDefault } from "./stats-default";
3
+
4
+ export const statsComponents: Record<
5
+ string,
6
+ React.ComponentType<SectionComponentProps>
7
+ > = {
8
+ default: StatsDefault,
9
+ };
10
+
11
+ export { statsSchema } from "./stats.schema";
@@ -0,0 +1,103 @@
1
+ "use client";
2
+
3
+ import type { SectionComponentProps } from "@onexapis/core/types";
4
+ import coreRenderers from "@onexapis/core/renderers";
5
+ import coreUtils from "@onexapis/core/utils";
6
+
7
+ const { ComponentRenderer, BlockRenderer } = coreRenderers;
8
+ const { toComponentInstance, getSectionValues, filterEnabledComponents } =
9
+ coreUtils;
10
+
11
+ export function StatsDefault({
12
+ section,
13
+ schema,
14
+ isEditing,
15
+ }: SectionComponentProps) {
16
+ const components = filterEnabledComponents(section.components || []);
17
+ const titleComp = components.find(
18
+ (c) => c.slot === "section-title" || c.id === "stats-title"
19
+ );
20
+
21
+ const { settings } = getSectionValues(section, schema);
22
+ const { sectionTitle, columns, backgroundColor } = settings;
23
+
24
+ const colClass =
25
+ columns === "2"
26
+ ? "md:grid-cols-2"
27
+ : columns === "3"
28
+ ? "md:grid-cols-3"
29
+ : "md:grid-cols-4";
30
+
31
+ const blocks = (section.blocks || [])
32
+ .filter((b) => b.enabled !== false)
33
+ .sort((a, b) => (a.order || 0) - (b.order || 0));
34
+
35
+ return (
36
+ <section
37
+ className="py-16"
38
+ style={{ backgroundColor: String(backgroundColor || "#111827") }}
39
+ data-section="stats"
40
+ data-section-id={section.id}
41
+ data-section-template="default"
42
+ data-section-name="Simple Stats"
43
+ >
44
+ <div className="container mx-auto px-4 max-w-6xl">
45
+ {/* Section Title */}
46
+ {titleComp ? (
47
+ <ComponentRenderer
48
+ key="section-title"
49
+ instance={toComponentInstance(titleComp)}
50
+ sectionId={section.id}
51
+ isEditing={isEditing}
52
+ />
53
+ ) : sectionTitle ? (
54
+ <h2
55
+ key="section-title-fallback"
56
+ className="text-3xl font-bold text-white text-center mb-12"
57
+ >
58
+ {String(sectionTitle)}
59
+ </h2>
60
+ ) : null}
61
+
62
+ {/* Stats Grid */}
63
+ <div className={`grid grid-cols-2 ${colClass} gap-8`}>
64
+ {blocks.map((block) => {
65
+ const bs = block.settings || {};
66
+ const alignMap: Record<string, string> = {
67
+ left: "text-left",
68
+ center: "text-center",
69
+ right: "text-right",
70
+ };
71
+ const align = alignMap[bs.alignment as string] || "text-center";
72
+ return (
73
+ <div
74
+ key={block.id}
75
+ className={`${align} py-4`}
76
+ data-section-id={section.id}
77
+ data-block-id={block.id}
78
+ data-block-type={block.type}
79
+ >
80
+ <BlockRenderer
81
+ block={block}
82
+ sectionId={section.id}
83
+ isEditing={isEditing}
84
+ />
85
+ </div>
86
+ );
87
+ })}
88
+ </div>
89
+
90
+ {/* Empty state for editor */}
91
+ {blocks.length === 0 && isEditing && (
92
+ <div className="text-center py-12 border-2 border-dashed border-gray-500 rounded-lg">
93
+ <p className="text-gray-400">
94
+ Add stat blocks to populate this section
95
+ </p>
96
+ </div>
97
+ )}
98
+ </div>
99
+ </section>
100
+ );
101
+ }
102
+
103
+ export default StatsDefault;
@@ -0,0 +1,266 @@
1
+ import type { SectionSchema, FieldDefinition } from "@onexapis/core/types";
2
+
3
+ const commonSettings: FieldDefinition[] = [
4
+ {
5
+ id: "sectionTitle",
6
+ type: "text",
7
+ label: "Section Title",
8
+ default: "By the Numbers",
9
+ },
10
+ {
11
+ id: "columns",
12
+ type: "select",
13
+ label: "Columns",
14
+ default: "4",
15
+ options: [
16
+ { label: "2 Columns", value: "2" },
17
+ { label: "3 Columns", value: "3" },
18
+ { label: "4 Columns", value: "4" },
19
+ ],
20
+ },
21
+ {
22
+ id: "backgroundColor",
23
+ type: "color",
24
+ label: "Background Color",
25
+ default: "#111827",
26
+ },
27
+ ];
28
+
29
+ export const statsSchema: SectionSchema = {
30
+ type: "my-simple-stats",
31
+ name: "Simple Stats",
32
+ description: "Statistics section with large numbers and labels",
33
+ category: "content",
34
+ icon: "bar-chart",
35
+ settings: commonSettings,
36
+ templates: [
37
+ {
38
+ id: "default",
39
+ name: "Default Stats",
40
+ description: "A grid of stat blocks with large numbers",
41
+ },
42
+ ],
43
+ blocks: [
44
+ {
45
+ type: "stat-item",
46
+ name: "Stat Item",
47
+ description: "A single stat with a number and label",
48
+ icon: "hash",
49
+ settings: [
50
+ {
51
+ id: "numberColor",
52
+ type: "color",
53
+ label: "Number Color",
54
+ default: "#FFFFFF",
55
+ },
56
+ {
57
+ id: "labelColor",
58
+ type: "color",
59
+ label: "Label Color",
60
+ default: "rgba(255,255,255,0.7)",
61
+ },
62
+ {
63
+ id: "alignment",
64
+ type: "select",
65
+ label: "Alignment",
66
+ default: "center",
67
+ options: [
68
+ { label: "Left", value: "left" },
69
+ { label: "Center", value: "center" },
70
+ { label: "Right", value: "right" },
71
+ ],
72
+ },
73
+ ],
74
+ defaults: {
75
+ numberColor: "#FFFFFF",
76
+ labelColor: "rgba(255,255,255,0.7)",
77
+ alignment: "center",
78
+ },
79
+ limit: 8,
80
+ },
81
+ ],
82
+ maxBlocks: 8,
83
+ defaults: {
84
+ settings: {
85
+ sectionTitle: "By the Numbers",
86
+ columns: "4",
87
+ backgroundColor: "#111827",
88
+ },
89
+ components: [
90
+ {
91
+ id: "stats-title",
92
+ type: "heading",
93
+ slot: "section-title",
94
+ order: 0,
95
+ content: { text: "By the Numbers", tag: "h2" },
96
+ style: {
97
+ fontSize: "3xl",
98
+ fontWeight: "bold",
99
+ color: "#FFFFFF",
100
+ textAlign: "center",
101
+ marginBottom: "3rem",
102
+ },
103
+ styleMode: "advanced",
104
+ enabled: true,
105
+ },
106
+ ],
107
+ blocks: [
108
+ {
109
+ id: "stat-1",
110
+ type: "stat-item",
111
+ order: 0,
112
+ enabled: true,
113
+ settings: {},
114
+ components: [
115
+ {
116
+ id: "stat-1-number",
117
+ type: "heading",
118
+ slot: "number",
119
+ order: 0,
120
+ content: { text: "10K+", tag: "h3" },
121
+ style: {
122
+ fontSize: "4xl",
123
+ fontWeight: "bold",
124
+ color: "#FFFFFF",
125
+ textAlign: "center",
126
+ marginBottom: "0.25rem",
127
+ },
128
+ styleMode: "advanced",
129
+ enabled: true,
130
+ },
131
+ {
132
+ id: "stat-1-label",
133
+ type: "paragraph",
134
+ slot: "label",
135
+ order: 1,
136
+ content: { text: "Happy Customers" },
137
+ style: {
138
+ fontSize: "base",
139
+ color: "rgba(255,255,255,0.7)",
140
+ textAlign: "center",
141
+ },
142
+ styleMode: "advanced",
143
+ enabled: true,
144
+ },
145
+ ],
146
+ },
147
+ {
148
+ id: "stat-2",
149
+ type: "stat-item",
150
+ order: 1,
151
+ enabled: true,
152
+ settings: {},
153
+ components: [
154
+ {
155
+ id: "stat-2-number",
156
+ type: "heading",
157
+ slot: "number",
158
+ order: 0,
159
+ content: { text: "99.9%", tag: "h3" },
160
+ style: {
161
+ fontSize: "4xl",
162
+ fontWeight: "bold",
163
+ color: "#FFFFFF",
164
+ textAlign: "center",
165
+ marginBottom: "0.25rem",
166
+ },
167
+ styleMode: "advanced",
168
+ enabled: true,
169
+ },
170
+ {
171
+ id: "stat-2-label",
172
+ type: "paragraph",
173
+ slot: "label",
174
+ order: 1,
175
+ content: { text: "Uptime SLA" },
176
+ style: {
177
+ fontSize: "base",
178
+ color: "rgba(255,255,255,0.7)",
179
+ textAlign: "center",
180
+ },
181
+ styleMode: "advanced",
182
+ enabled: true,
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ id: "stat-3",
188
+ type: "stat-item",
189
+ order: 2,
190
+ enabled: true,
191
+ settings: {},
192
+ components: [
193
+ {
194
+ id: "stat-3-number",
195
+ type: "heading",
196
+ slot: "number",
197
+ order: 0,
198
+ content: { text: "150+", tag: "h3" },
199
+ style: {
200
+ fontSize: "4xl",
201
+ fontWeight: "bold",
202
+ color: "#FFFFFF",
203
+ textAlign: "center",
204
+ marginBottom: "0.25rem",
205
+ },
206
+ styleMode: "advanced",
207
+ enabled: true,
208
+ },
209
+ {
210
+ id: "stat-3-label",
211
+ type: "paragraph",
212
+ slot: "label",
213
+ order: 1,
214
+ content: { text: "Integrations" },
215
+ style: {
216
+ fontSize: "base",
217
+ color: "rgba(255,255,255,0.7)",
218
+ textAlign: "center",
219
+ },
220
+ styleMode: "advanced",
221
+ enabled: true,
222
+ },
223
+ ],
224
+ },
225
+ {
226
+ id: "stat-4",
227
+ type: "stat-item",
228
+ order: 3,
229
+ enabled: true,
230
+ settings: {},
231
+ components: [
232
+ {
233
+ id: "stat-4-number",
234
+ type: "heading",
235
+ slot: "number",
236
+ order: 0,
237
+ content: { text: "24/7", tag: "h3" },
238
+ style: {
239
+ fontSize: "4xl",
240
+ fontWeight: "bold",
241
+ color: "#FFFFFF",
242
+ textAlign: "center",
243
+ marginBottom: "0.25rem",
244
+ },
245
+ styleMode: "advanced",
246
+ enabled: true,
247
+ },
248
+ {
249
+ id: "stat-4-label",
250
+ type: "paragraph",
251
+ slot: "label",
252
+ order: 1,
253
+ content: { text: "Support Available" },
254
+ style: {
255
+ fontSize: "base",
256
+ color: "rgba(255,255,255,0.7)",
257
+ textAlign: "center",
258
+ },
259
+ styleMode: "advanced",
260
+ enabled: true,
261
+ },
262
+ ],
263
+ },
264
+ ],
265
+ },
266
+ };
@@ -0,0 +1,11 @@
1
+ import type { SectionComponentProps } from "@onexapis/core/types";
2
+ import { TestimonialsDefault } from "./testimonials-default";
3
+
4
+ export const testimonialsComponents: Record<
5
+ string,
6
+ React.ComponentType<SectionComponentProps>
7
+ > = {
8
+ default: TestimonialsDefault,
9
+ };
10
+
11
+ export { testimonialsSchema } from "./testimonials.schema";