@almadar/ui 2.48.3 → 2.48.5

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.
@@ -0,0 +1,71 @@
1
+ /**
2
+ * prepareSchemaForPreview
3
+ *
4
+ * Single source of truth for the "give an Orbital schema a runnable preview"
5
+ * pipeline. Used by both:
6
+ * * `<OrbPreview autoMock />` (the docs / MDX path)
7
+ * * `PlaygroundContent` (the interactive playground)
8
+ *
9
+ * Type signature in `@almadar/core` terms:
10
+ *
11
+ * buildMockData : OrbitalSchema → EntityData
12
+ * adjustSchemaForMockData: (OrbitalSchema, EntityData) → OrbitalSchema
13
+ * prepareSchemaForPreview: OrbitalSchema → { schema: OrbitalSchema, mockData: EntityData }
14
+ *
15
+ * Steps:
16
+ * 1. `buildMockData` — for each orbital, generate (or pick up from
17
+ * `entity.instances`) `EntityRow[]` for that entity.
18
+ * 2. `adjustSchemaForMockData` — flip two-state INIT machines so the data
19
+ * state is initial (e.g. `empty -> hasItems` becomes `hasItems` initial).
20
+ *
21
+ * @packageDocumentation
22
+ */
23
+ import type { OrbitalSchema, EntityData } from '@almadar/core';
24
+ /**
25
+ * Build mock entity rows (`EntityData`) for every orbital in the schema.
26
+ *
27
+ * For each orbital's entity:
28
+ * * If the entity has an `instances` array (from the schema author),
29
+ * use it as-is.
30
+ * * Otherwise generate 10 synthetic `EntityRow`s from the field
31
+ * definitions via `generateEntityRow`.
32
+ *
33
+ * @public
34
+ */
35
+ export declare function buildMockData(schema: OrbitalSchema): EntityData;
36
+ /**
37
+ * When mock data exists for a trait's linked entity, swap the state
38
+ * machine's initial state to the state that also handles INIT (the "data
39
+ * state"). This makes previews land directly in the populated UI.
40
+ *
41
+ * Behavior is per-trait:
42
+ * * Inline traits with two-state INIT patterns are rewritten.
43
+ * * String / object trait refs are left untouched (the resolver handles them).
44
+ * * Single-state INIT machines are left untouched.
45
+ *
46
+ * @public
47
+ */
48
+ export declare function adjustSchemaForMockData(schema: OrbitalSchema, mockData: EntityData): OrbitalSchema;
49
+ /**
50
+ * Result of `prepareSchemaForPreview`.
51
+ *
52
+ * @public
53
+ */
54
+ export interface PreparedPreviewSchema {
55
+ /** Schema with state machines flipped so data states are initial. */
56
+ schema: OrbitalSchema;
57
+ /** Mock entity rows keyed by entity name — pass to `OrbPreview.mockData`. */
58
+ mockData: EntityData;
59
+ }
60
+ /**
61
+ * Run the full preview prep pipeline on a schema.
62
+ *
63
+ * Accepts either an already-parsed `OrbitalSchema` or a JSON string.
64
+ * Returns `{ schema, mockData }` ready to feed `<OrbPreview>`.
65
+ *
66
+ * Functional signature:
67
+ * `OrbitalSchema | string → { schema: OrbitalSchema, mockData: EntityData }`
68
+ *
69
+ * @public
70
+ */
71
+ export declare function prepareSchemaForPreview(input: OrbitalSchema | string): PreparedPreviewSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.48.3",
3
+ "version": "2.48.5",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",