@onexapis/cli 1.1.34 → 1.1.36
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 +1 -1
- package/templates/default/CLAUDE.md +78 -24
package/package.json
CHANGED
|
@@ -464,44 +464,36 @@ Without these, the editor cannot select sections/blocks for editing.
|
|
|
464
464
|
|
|
465
465
|
34 built-in components from `@onexapis/core` that render inside sections via `ComponentRenderer`:
|
|
466
466
|
|
|
467
|
-
| Component
|
|
468
|
-
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
| `progress` | Progress bar | value (0-100), label, color |
|
|
480
|
-
| `rating` | Star rating | value (1-5), readOnly, size |
|
|
481
|
-
| `social-links` | Social media links | Reads from WebsiteSettings context |
|
|
482
|
-
| `hotline-contacts` | Contact info | Reads from WebsiteSettings context |
|
|
483
|
-
| `company-info` | Company details | Reads from WebsiteSettings context |
|
|
484
|
-
| `product-card` | Product display | product (Product), showQuickAdd |
|
|
485
|
-
| `blog-card` | Blog post card | blog (Blog) |
|
|
467
|
+
| Component | Description | Key Settings |
|
|
468
|
+
| --------- | ----------- | ------------ |
|
|
469
|
+
|
|
470
|
+
**Text:** `heading` (H1-H6), `paragraph`, `quote`
|
|
471
|
+
**Interactive:** `button` (default/outline/ghost/link), `link`, `input`, `textarea`, `checkbox`, `select`
|
|
472
|
+
**Media:** `image`, `video` (youtube/vimeo/hosted), `icon` (Lucide icons), `gallery`
|
|
473
|
+
**Layout:** `divider`, `spacer`, `container`, `grid`, `columns`, `card`
|
|
474
|
+
**Display:** `badge`, `alert`, `progress`, `rating`, `timer`, `list`, `table`, `accordion`, `tabs`, `code`, `map`
|
|
475
|
+
**Special:** `product-card`, `blog-card`, `social-links`, `hotline-contacts`, `company-info`
|
|
476
|
+
**Decorative:** `torn-separator`
|
|
477
|
+
|
|
478
|
+
Use `onexthm://components` MCP resource for full details (content/style fields, slots, examples).
|
|
486
479
|
|
|
487
480
|
Components are rendered via `ComponentRenderer` — you don't import them directly.
|
|
488
481
|
|
|
489
482
|
## Component Slots
|
|
490
483
|
|
|
491
|
-
Components use `slot` to
|
|
484
|
+
Components use `slot` to identify their role:
|
|
492
485
|
|
|
493
486
|
```tsx
|
|
494
|
-
// In section component
|
|
495
487
|
const titleComp = components.find((c) => c.slot === "section-title");
|
|
496
488
|
const ctaButton = components.find((c) => c.slot === "cta-button");
|
|
497
|
-
const subtitle = components.find((c) => c.slot === "description");
|
|
498
489
|
```
|
|
499
490
|
|
|
500
|
-
Common
|
|
491
|
+
Common slots: `section-title`, `section-subtitle`, `description`, `cta-button`, `secondary-cta`, `badge`, `icon`, `image`, `block-title`, `block-description`, `feature-icon`
|
|
501
492
|
|
|
502
493
|
## Block System
|
|
503
494
|
|
|
504
|
-
Blocks are nested containers inside sections. They
|
|
495
|
+
Blocks are nested containers inside sections. They hold components and can nest other blocks.
|
|
496
|
+
Use `onexthm://blocks` MCP resource for full block patterns (features, testimonials, pricing, FAQ, team).
|
|
505
497
|
|
|
506
498
|
```tsx
|
|
507
499
|
// Section → Blocks → Components
|
|
@@ -521,6 +513,68 @@ Blocks are nested containers inside sections. They can contain components AND ot
|
|
|
521
513
|
|
|
522
514
|
Use `BlockRenderer` to render blocks — it handles recursive nesting automatically.
|
|
523
515
|
|
|
516
|
+
### Defining Blocks in Schema
|
|
517
|
+
|
|
518
|
+
```tsx
|
|
519
|
+
// In your-section.schema.ts
|
|
520
|
+
export const mySchema: SectionSchema = {
|
|
521
|
+
type: "features",
|
|
522
|
+
// ...settings, defaults...
|
|
523
|
+
blocks: [
|
|
524
|
+
{
|
|
525
|
+
type: "feature-item",
|
|
526
|
+
name: "Feature Item",
|
|
527
|
+
limit: 6, // Max 6 blocks of this type
|
|
528
|
+
settings: [
|
|
529
|
+
{
|
|
530
|
+
id: "backgroundColor",
|
|
531
|
+
type: "color",
|
|
532
|
+
label: "Background",
|
|
533
|
+
default: "#FFFFFF",
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
components: [
|
|
537
|
+
{ type: "icon", slot: "feature-icon", label: "Icon" },
|
|
538
|
+
{ type: "heading", slot: "block-title", label: "Title" },
|
|
539
|
+
{ type: "paragraph", slot: "block-description", label: "Description" },
|
|
540
|
+
],
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
};
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### Rendering Blocks
|
|
547
|
+
|
|
548
|
+
```tsx
|
|
549
|
+
const blocks = (section.blocks || []).filter((b) => b.enabled !== false);
|
|
550
|
+
|
|
551
|
+
{
|
|
552
|
+
blocks.map((block) => (
|
|
553
|
+
<div
|
|
554
|
+
key={block.id}
|
|
555
|
+
data-section-id={section.id} // REQUIRED
|
|
556
|
+
data-block-id={block.id} // REQUIRED
|
|
557
|
+
data-block-type={block.type} // REQUIRED
|
|
558
|
+
className="p-6 rounded-xl border"
|
|
559
|
+
>
|
|
560
|
+
<BlockRenderer
|
|
561
|
+
block={block}
|
|
562
|
+
sectionId={section.id}
|
|
563
|
+
isEditing={isEditing}
|
|
564
|
+
/>
|
|
565
|
+
</div>
|
|
566
|
+
));
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
{
|
|
570
|
+
blocks.length === 0 && isEditing && (
|
|
571
|
+
<div className="text-center py-12 border-2 border-dashed border-gray-300 rounded-lg">
|
|
572
|
+
<p className="text-gray-500">Add blocks to populate this section</p>
|
|
573
|
+
</div>
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
524
578
|
## Animation System
|
|
525
579
|
|
|
526
580
|
Sections, blocks, and components support animations via framer-motion:
|