@cxtms/cx-schema 1.3.2 → 1.4.0

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.
@@ -156,7 +156,7 @@ Read the relevant category ref file when building specific component types:
156
156
 
157
157
  | Category | Components | File |
158
158
  |----------|-----------|------|
159
- | **Layout & Structure** | `layout`, `row`, `col`, `header`, `tabs`, `toolbar`, `card`, `line` | `.claude/skills/cx-module/ref-components-layout.md` |
159
+ | **Layout & Structure** | `layout`, `row`, `col`, `header`, `tabs`, `toolbar`, `card`, `line`, `slot` | `.claude/skills/cx-module/ref-components-layout.md` |
160
160
  | **Forms & Input** | `form`, `field`, `field-collection`, `barcodeScanner` | `.claude/skills/cx-module/ref-components-forms.md` |
161
161
  | **Data Display** | `dataGrid`, `text`, `markup`, `badge`, `icon`, `image`, `photo`, `summary`, `diff`, `viewer`, `embed` | `.claude/skills/cx-module/ref-components-display.md` |
162
162
  | **Interactive & Nav** | `button`, `dropdown`, `menuButton`, `link`, `redirect`, `navbar`, `navbarItem`, `navbarLink`, `navDropdown` | `.claude/skills/cx-module/ref-components-interactive.md` |
@@ -179,7 +179,7 @@ Read the relevant template after scaffolding to understand the generated structu
179
179
 
180
180
  Read schema files from `.cx-schema/` only when debugging validation errors:
181
181
  - `schemas.json` — main schema definitions
182
- - `components/<type>.json` — component schemas (layout, form, dataGrid, field, button, tabs, card, calendar, collection, appComponent, module)
182
+ - `components/<type>.json` — component schemas (layout, form, dataGrid, field, button, tabs, card, calendar, collection, appComponent, slot, module)
183
183
  - `fields/<type>.json` — field schemas (text, select, select-async)
184
184
  - `actions/<type>.json` — action schemas (navigate, mutation, dialog, all)
185
185
 
@@ -293,3 +293,46 @@ props:
293
293
  options:
294
294
  style: { margin: "1rem 0" }
295
295
  ```
296
+
297
+ ---
298
+
299
+ ## slot
300
+
301
+ Extension point that renders UI elements injected by other modules (via `appComponent` with `targetSlot`). Slots render extensions from the database — they have no YAML `children`.
302
+
303
+ **Props:**
304
+ | Prop | Type | Required | Description |
305
+ |------|------|----------|-------------|
306
+ | `name` | `string` | Yes | Slot name to match against. Extension components target this name via `targetSlot`. Supports template expressions. |
307
+ | `itemTag` | `string` | No | HTML element type to wrap each extension (e.g., `li`, `div`) |
308
+
309
+ **Children:** No — slots render extension components registered in the database, not YAML children.
310
+
311
+ **Naming convention:** Use `Module/Entity/Location` pattern for slot names to avoid collisions (e.g., `Orders/Detail/Sidebar`, `Contacts/Form/Actions`).
312
+
313
+ ```yaml
314
+ # Basic slot — extension point in a layout
315
+ component: slot
316
+ name: sidebarSlot
317
+ props:
318
+ name: "Orders/Detail/Sidebar"
319
+ ```
320
+
321
+ ```yaml
322
+ # Dynamic slot name using template expression
323
+ component: slot
324
+ name: entitySlot
325
+ props:
326
+ name: "{{ eval `Orders/${entityType}/Actions` }}"
327
+ ```
328
+
329
+ ```yaml
330
+ # Slot with itemTag for list-style extensions
331
+ component: slot
332
+ name: menuSlot
333
+ props:
334
+ name: "Navigation/MainMenu/Items"
335
+ itemTag: li
336
+ ```
337
+
338
+ **How extensions target slots:** Other modules register extension components using `appComponent` with `targetSlot` and optional `order` to control rendering position within the slot. See `appComponent.json` schema for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cxtms/cx-schema",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Schema validation package for CargoXplorer YAML modules",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -63,6 +63,9 @@
63
63
  },
64
64
  "module": {
65
65
  "$ref": "module.json"
66
+ },
67
+ "slot": {
68
+ "$ref": "slot.json"
66
69
  }
67
70
  }
68
71
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Slot Component",
4
+ "type": "object",
5
+ "properties": {
6
+ "component": {
7
+ "type": "string",
8
+ "const": "slot"
9
+ },
10
+ "name": {
11
+ "type": "string",
12
+ "description": "Component instance name"
13
+ },
14
+ "props": {
15
+ "type": "object",
16
+ "properties": {
17
+ "name": {
18
+ "type": "string",
19
+ "description": "Slot name to match against (supports template expressions)"
20
+ },
21
+ "itemTag": {
22
+ "type": "string",
23
+ "description": "HTML element type to wrap each extension (e.g., li, div)"
24
+ }
25
+ },
26
+ "required": ["name"]
27
+ }
28
+ },
29
+ "required": ["component", "props"]
30
+ }