@almadar/ui 2.61.1 → 3.1.2

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 (48) hide show
  1. package/dist/avl/index.cjs +1344 -1507
  2. package/dist/avl/index.css +7 -2
  3. package/dist/avl/index.js +268 -431
  4. package/dist/components/index.cjs +40 -38
  5. package/dist/components/index.css +7 -2
  6. package/dist/components/index.js +41 -39
  7. package/dist/components/organisms/DataTable.d.ts +3 -2
  8. package/dist/components/organisms/JazariStateMachine.d.ts +10 -37
  9. package/dist/components/organisms/MasterDetail.d.ts +4 -3
  10. package/dist/components/organisms/MediaGallery.d.ts +3 -2
  11. package/dist/components/organisms/Sidebar.d.ts +7 -2
  12. package/dist/components/organisms/StateMachineView.d.ts +7 -2
  13. package/dist/components/organisms/Table.d.ts +2 -1
  14. package/dist/components/organisms/Timeline.d.ts +15 -2
  15. package/dist/components/organisms/book/BookChapterView.d.ts +3 -2
  16. package/dist/components/organisms/book/BookCoverPage.d.ts +3 -3
  17. package/dist/components/organisms/book/BookNavBar.d.ts +3 -3
  18. package/dist/components/organisms/book/BookTableOfContents.d.ts +3 -2
  19. package/dist/components/organisms/book/BookViewer.d.ts +2 -2
  20. package/dist/components/organisms/book/types.d.ts +9 -4
  21. package/dist/components/organisms/game/WorldMapBoard.d.ts +9 -3
  22. package/dist/components/organisms/game/three/index.cjs +8 -4
  23. package/dist/components/organisms/game/three/index.js +8 -4
  24. package/dist/components/organisms/marketing-types.d.ts +22 -12
  25. package/dist/components/organisms/types.d.ts +24 -12
  26. package/dist/components/templates/types.d.ts +7 -2
  27. package/dist/docs/index.cjs +6 -2
  28. package/dist/docs/index.d.cts +1 -1
  29. package/dist/docs/index.js +6 -2
  30. package/dist/hooks/event-bus-types.d.ts +19 -27
  31. package/dist/hooks/index.cjs +13 -6
  32. package/dist/hooks/index.d.ts +1 -1
  33. package/dist/hooks/index.js +13 -6
  34. package/dist/hooks/useEventBus.d.ts +3 -3
  35. package/dist/lib/index.cjs +5 -2
  36. package/dist/lib/index.js +5 -2
  37. package/dist/lib/verificationRegistry.d.ts +3 -5
  38. package/dist/marketing/index.cjs +6 -2
  39. package/dist/marketing/index.js +6 -2
  40. package/dist/providers/index.cjs +997 -1168
  41. package/dist/providers/index.css +7 -2
  42. package/dist/providers/index.d.ts +0 -2
  43. package/dist/providers/index.js +241 -406
  44. package/dist/runtime/index.cjs +47 -70
  45. package/dist/runtime/index.css +7 -2
  46. package/dist/runtime/index.js +48 -71
  47. package/package.json +4 -4
  48. package/dist/providers/EntityStoreProvider.d.ts +0 -63
@@ -33,6 +33,7 @@ var langDiff = require('react-syntax-highlighter/dist/esm/languages/prism/diff.j
33
33
  var langToml = require('react-syntax-highlighter/dist/esm/languages/prism/toml.js');
34
34
  var langGo = require('react-syntax-highlighter/dist/esm/languages/prism/go.js');
35
35
  var langGraphql = require('react-syntax-highlighter/dist/esm/languages/prism/graphql.js');
36
+ var core = require('@almadar/core');
36
37
  var context = require('@almadar/ui/context');
37
38
  var reactQuery = require('@tanstack/react-query');
38
39
 
@@ -207,8 +208,8 @@ function useEventListener(event, handler) {
207
208
  function useEmitEvent() {
208
209
  const eventBus = useEventBus();
209
210
  return React110.useCallback(
210
- (type, payload) => {
211
- eventBus.emit(type, payload);
211
+ (type, payload, source) => {
212
+ eventBus.emit(type, payload, source);
212
213
  },
213
214
  [eventBus]
214
215
  );
@@ -223,11 +224,15 @@ var init_useEventBus = __esm({
223
224
  fallbackListeners = /* @__PURE__ */ new Map();
224
225
  fallbackAnyListeners = /* @__PURE__ */ new Set();
225
226
  fallbackEventBus = {
226
- emit: (type, payload) => {
227
+ emit: (type, payload, source) => {
227
228
  const event = {
228
229
  type,
230
+ // Narrow at the bus boundary: public emit accepts an opaque object so
231
+ // generic UI emit sites don't require casts; the envelope stores the
232
+ // payload as EventPayload which listeners consume directly.
229
233
  payload,
230
- timestamp: Date.now()
234
+ timestamp: Date.now(),
235
+ source
231
236
  };
232
237
  const handlers = fallbackListeners.get(type);
233
238
  log.debug("emit", { type, payloadKeys: payload ? Object.keys(payload).length : 0, listenerCount: (handlers?.size ?? 0) + fallbackAnyListeners.size });
@@ -8943,9 +8948,9 @@ var init_ScaledDiagram = __esm({
8943
8948
  }
8944
8949
  });
8945
8950
 
8946
- // node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css
8951
+ // node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
8947
8952
  var init_katex_min = __esm({
8948
- "node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css"() {
8953
+ "node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
8949
8954
  }
8950
8955
  });
8951
8956
  exports.MarkdownContent = void 0;
@@ -10994,7 +10999,9 @@ function extractTrait(schema, trait, traitIndex) {
10994
10999
  for (const orbital of schema.orbitals) {
10995
11000
  const traits2 = orbital.traits ?? [];
10996
11001
  if (traitIndex < traits2.length) {
10997
- return traits2[traitIndex];
11002
+ const traitRef = traits2[traitIndex];
11003
+ if (core.isInlineTrait(traitRef)) return traitRef;
11004
+ return null;
10998
11005
  }
10999
11006
  }
11000
11007
  return null;
@@ -11002,8 +11009,10 @@ function extractTrait(schema, trait, traitIndex) {
11002
11009
  function extractEntityFields(schema) {
11003
11010
  if (!schema?.orbitals?.length) return [];
11004
11011
  const entity = schema.orbitals[0].entity;
11005
- if (!entity?.fields) return [];
11006
- return entity.fields.map((f3) => f3.name);
11012
+ if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
11013
+ const inlineEntity = entity;
11014
+ if (!inlineEntity.fields) return [];
11015
+ return inlineEntity.fields.map((f3) => f3.name);
11007
11016
  }
11008
11017
  function toStateMachineDefinition(sm) {
11009
11018
  return {
@@ -11298,12 +11307,18 @@ var init_ContentRenderer = __esm({
11298
11307
  );
11299
11308
  case "orbital": {
11300
11309
  const parsed = segment.schema;
11310
+ const inlineTrait = {
11311
+ name: "inline",
11312
+ scope: "instance",
11313
+ stateMachine: parsed
11314
+ };
11301
11315
  const schema = Array.isArray(parsed.orbitals) ? parsed : {
11316
+ name: "inline",
11302
11317
  orbitals: [{
11303
- traits: [{
11304
- name: "inline",
11305
- stateMachine: parsed
11306
- }]
11318
+ name: "inline",
11319
+ entity: { name: "inline", fields: [] },
11320
+ traits: [inlineTrait],
11321
+ pages: []
11307
11322
  }]
11308
11323
  };
11309
11324
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "sm", children: [
@@ -37491,19 +37506,15 @@ function SlotContentRenderer({
37491
37506
  patternPath
37492
37507
  }) {
37493
37508
  const entityProp = content.props.entity;
37494
- const entityType = typeof entityProp === "string" ? entityProp : "";
37495
- const storeData = providers.useEntityRef(entityType);
37496
- React110__namespace.default.useEffect(() => {
37497
- if (!entityType) return;
37498
- if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37499
- if (STRING_ENTITY_WARNED.has(entityType)) return;
37500
- STRING_ENTITY_WARNED.add(entityType);
37501
- console.warn(
37502
- `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37503
- );
37504
- }, [entityType]);
37509
+ if (typeof entityProp === "string" && entityProp.length > 0) {
37510
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
37511
+ throw new Error(
37512
+ `[UISlotRenderer] Received string 'entity: "${entityProp}"' at render time. The V2 flow requires pre-resolved data; declare a fetch success listener and pass 'entity: @payload.data'. See docs/Almadar_Entity_V2_Plan.md \xA76.`
37513
+ );
37514
+ }
37515
+ }
37505
37516
  const schemaCtx = useEntitySchemaOptional();
37506
- const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37517
+ const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
37507
37518
  const PatternComponent = getComponentForPattern(content.pattern);
37508
37519
  if (PatternComponent) {
37509
37520
  const childrenConfig = content.props.children;
@@ -37512,12 +37523,7 @@ function SlotContentRenderer({
37512
37523
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
37513
37524
  const { children: _childrenConfig, ...restProps } = content.props;
37514
37525
  const renderedProps = renderPatternProps(restProps, onDismiss);
37515
- let finalProps;
37516
- if (entityType) {
37517
- finalProps = { ...renderedProps, entity: storeData };
37518
- } else {
37519
- finalProps = renderedProps;
37520
- }
37526
+ const finalProps = renderedProps;
37521
37527
  const resolvedItems = Array.isArray(
37522
37528
  finalProps.entity
37523
37529
  ) ? finalProps.entity : null;
@@ -37531,9 +37537,6 @@ function SlotContentRenderer({
37531
37537
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37532
37538
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37533
37539
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
37534
- if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
37535
- finalProps.initialData = storeData[0];
37536
- }
37537
37540
  }
37538
37541
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
37539
37542
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -37627,7 +37630,7 @@ function UISlotRenderer({
37627
37630
  }
37628
37631
  return wrapped;
37629
37632
  }
37630
- var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37633
+ var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37631
37634
  var init_UISlotRenderer = __esm({
37632
37635
  "components/organisms/UISlotRenderer.tsx"() {
37633
37636
  "use client";
@@ -37644,7 +37647,6 @@ var init_UISlotRenderer = __esm({
37644
37647
  init_TraitFrame();
37645
37648
  init_component_registry_generated();
37646
37649
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37647
- STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37648
37650
  SuspenseConfigContext = React110.createContext({ enabled: false });
37649
37651
  SlotContainedContext = React110.createContext(false);
37650
37652
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -41111,8 +41113,8 @@ var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ?
41111
41113
  var ApiError = class extends Error {
41112
41114
  constructor(status, statusText, message) {
41113
41115
  super(message || `API Error: ${status} ${statusText}`);
41114
- this.status = status;
41115
- this.statusText = statusText;
41116
+ __publicField(this, "status", status);
41117
+ __publicField(this, "statusText", statusText);
41116
41118
  this.name = "ApiError";
41117
41119
  }
41118
41120
  };
@@ -1,4 +1,4 @@
1
- /* node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css */
1
+ /* node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css */
2
2
  @font-face {
3
3
  font-display: block;
4
4
  font-family: KaTeX_AMS;
@@ -205,6 +205,7 @@
205
205
  Times New Roman,
206
206
  serif;
207
207
  line-height: 1.2;
208
+ position: relative;
208
209
  text-indent: 0;
209
210
  text-rendering: auto;
210
211
  }
@@ -213,7 +214,7 @@
213
214
  border-color: currentColor;
214
215
  }
215
216
  .katex .katex-version:after {
216
- content: "0.16.33";
217
+ content: "0.16.45";
217
218
  }
218
219
  .katex .katex-mathml {
219
220
  clip: rect(1px, 1px, 1px, 1px);
@@ -389,6 +390,10 @@
389
390
  .katex .mspace {
390
391
  display: inline-block;
391
392
  }
393
+ .katex .smash {
394
+ display: inline;
395
+ line-height: 0;
396
+ }
392
397
  .katex .clap,
393
398
  .katex .llap,
394
399
  .katex .rlap {
@@ -2,7 +2,7 @@ import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as React110 from 'react';
4
4
  import React110__default, { createContext, useContext, useRef, useEffect, useCallback, useState, Suspense, useMemo, lazy, useSyncExternalStore, useLayoutEffect, useId } from 'react';
5
- import { EventBusContext, useEntityRef, SelectionContext } from '@almadar/ui/providers';
5
+ import { EventBusContext, SelectionContext } from '@almadar/ui/providers';
6
6
  import * as LucideIcons from 'lucide-react';
7
7
  import { Loader2, X, AlertTriangle, Info, AlertCircle, CheckCircle, ChevronDown, List, Printer, ChevronRight, ChevronLeft, XCircle, Wrench, RotateCcw, Send, Code, FileText, WrapText, Check, Copy, Zap, Sword, Move, Heart, Shield, Trash2, Settings, Menu as Menu$1, Search, Bell, LogOut, ChevronUp, MoreHorizontal, Bug, ZoomOut, ZoomIn, Download, Pause, Play, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ArrowRight, ArrowLeft, Eraser, SkipForward, TrendingUp, TrendingDown, Minus, ArrowUp, ArrowDown, MoreVertical, Circle, Clock, CheckCircle2, HelpCircle, FileQuestion, Inbox, Plus, User, Filter, Star, FileWarning, Tag, DollarSign, Sun, Moon } from 'lucide-react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -33,6 +33,7 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff.js'
33
33
  import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js';
34
34
  import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
35
35
  import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
36
+ import { isInlineTrait } from '@almadar/core';
36
37
  import { useUISlots } from '@almadar/ui/context';
37
38
  import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
38
39
 
@@ -162,8 +163,8 @@ function useEventListener(event, handler) {
162
163
  function useEmitEvent() {
163
164
  const eventBus = useEventBus();
164
165
  return useCallback(
165
- (type, payload) => {
166
- eventBus.emit(type, payload);
166
+ (type, payload, source) => {
167
+ eventBus.emit(type, payload, source);
167
168
  },
168
169
  [eventBus]
169
170
  );
@@ -178,11 +179,15 @@ var init_useEventBus = __esm({
178
179
  fallbackListeners = /* @__PURE__ */ new Map();
179
180
  fallbackAnyListeners = /* @__PURE__ */ new Set();
180
181
  fallbackEventBus = {
181
- emit: (type, payload) => {
182
+ emit: (type, payload, source) => {
182
183
  const event = {
183
184
  type,
185
+ // Narrow at the bus boundary: public emit accepts an opaque object so
186
+ // generic UI emit sites don't require casts; the envelope stores the
187
+ // payload as EventPayload which listeners consume directly.
184
188
  payload,
185
- timestamp: Date.now()
189
+ timestamp: Date.now(),
190
+ source
186
191
  };
187
192
  const handlers = fallbackListeners.get(type);
188
193
  log.debug("emit", { type, payloadKeys: payload ? Object.keys(payload).length : 0, listenerCount: (handlers?.size ?? 0) + fallbackAnyListeners.size });
@@ -8898,9 +8903,9 @@ var init_ScaledDiagram = __esm({
8898
8903
  }
8899
8904
  });
8900
8905
 
8901
- // node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css
8906
+ // node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
8902
8907
  var init_katex_min = __esm({
8903
- "node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css"() {
8908
+ "node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
8904
8909
  }
8905
8910
  });
8906
8911
  var MarkdownContent;
@@ -10949,7 +10954,9 @@ function extractTrait(schema, trait, traitIndex) {
10949
10954
  for (const orbital of schema.orbitals) {
10950
10955
  const traits2 = orbital.traits ?? [];
10951
10956
  if (traitIndex < traits2.length) {
10952
- return traits2[traitIndex];
10957
+ const traitRef = traits2[traitIndex];
10958
+ if (isInlineTrait(traitRef)) return traitRef;
10959
+ return null;
10953
10960
  }
10954
10961
  }
10955
10962
  return null;
@@ -10957,8 +10964,10 @@ function extractTrait(schema, trait, traitIndex) {
10957
10964
  function extractEntityFields(schema) {
10958
10965
  if (!schema?.orbitals?.length) return [];
10959
10966
  const entity = schema.orbitals[0].entity;
10960
- if (!entity?.fields) return [];
10961
- return entity.fields.map((f3) => f3.name);
10967
+ if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
10968
+ const inlineEntity = entity;
10969
+ if (!inlineEntity.fields) return [];
10970
+ return inlineEntity.fields.map((f3) => f3.name);
10962
10971
  }
10963
10972
  function toStateMachineDefinition(sm) {
10964
10973
  return {
@@ -11253,12 +11262,18 @@ var init_ContentRenderer = __esm({
11253
11262
  );
11254
11263
  case "orbital": {
11255
11264
  const parsed = segment.schema;
11265
+ const inlineTrait = {
11266
+ name: "inline",
11267
+ scope: "instance",
11268
+ stateMachine: parsed
11269
+ };
11256
11270
  const schema = Array.isArray(parsed.orbitals) ? parsed : {
11271
+ name: "inline",
11257
11272
  orbitals: [{
11258
- traits: [{
11259
- name: "inline",
11260
- stateMachine: parsed
11261
- }]
11273
+ name: "inline",
11274
+ entity: { name: "inline", fields: [] },
11275
+ traits: [inlineTrait],
11276
+ pages: []
11262
11277
  }]
11263
11278
  };
11264
11279
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
@@ -37446,19 +37461,15 @@ function SlotContentRenderer({
37446
37461
  patternPath
37447
37462
  }) {
37448
37463
  const entityProp = content.props.entity;
37449
- const entityType = typeof entityProp === "string" ? entityProp : "";
37450
- const storeData = useEntityRef(entityType);
37451
- React110__default.useEffect(() => {
37452
- if (!entityType) return;
37453
- if (typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production") return;
37454
- if (STRING_ENTITY_WARNED.has(entityType)) return;
37455
- STRING_ENTITY_WARNED.add(entityType);
37456
- console.warn(
37457
- `[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
37458
- );
37459
- }, [entityType]);
37464
+ if (typeof entityProp === "string" && entityProp.length > 0) {
37465
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
37466
+ throw new Error(
37467
+ `[UISlotRenderer] Received string 'entity: "${entityProp}"' at render time. The V2 flow requires pre-resolved data; declare a fetch success listener and pass 'entity: @payload.data'. See docs/Almadar_Entity_V2_Plan.md \xA76.`
37468
+ );
37469
+ }
37470
+ }
37460
37471
  const schemaCtx = useEntitySchemaOptional();
37461
- const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37472
+ const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
37462
37473
  const PatternComponent = getComponentForPattern(content.pattern);
37463
37474
  if (PatternComponent) {
37464
37475
  const childrenConfig = content.props.children;
@@ -37467,12 +37478,7 @@ function SlotContentRenderer({
37467
37478
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
37468
37479
  const { children: _childrenConfig, ...restProps } = content.props;
37469
37480
  const renderedProps = renderPatternProps(restProps, onDismiss);
37470
- let finalProps;
37471
- if (entityType) {
37472
- finalProps = { ...renderedProps, entity: storeData };
37473
- } else {
37474
- finalProps = renderedProps;
37475
- }
37481
+ const finalProps = renderedProps;
37476
37482
  const resolvedItems = Array.isArray(
37477
37483
  finalProps.entity
37478
37484
  ) ? finalProps.entity : null;
@@ -37486,9 +37492,6 @@ function SlotContentRenderer({
37486
37492
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37487
37493
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37488
37494
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
37489
- if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
37490
- finalProps.initialData = storeData[0];
37491
- }
37492
37495
  }
37493
37496
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
37494
37497
  return /* @__PURE__ */ jsx(
@@ -37582,7 +37585,7 @@ function UISlotRenderer({
37582
37585
  }
37583
37586
  return wrapped;
37584
37587
  }
37585
- var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37588
+ var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37586
37589
  var init_UISlotRenderer = __esm({
37587
37590
  "components/organisms/UISlotRenderer.tsx"() {
37588
37591
  "use client";
@@ -37599,7 +37602,6 @@ var init_UISlotRenderer = __esm({
37599
37602
  init_TraitFrame();
37600
37603
  init_component_registry_generated();
37601
37604
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37602
- STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37603
37605
  SuspenseConfigContext = createContext({ enabled: false });
37604
37606
  SlotContainedContext = createContext(false);
37605
37607
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -41066,8 +41068,8 @@ var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ?
41066
41068
  var ApiError = class extends Error {
41067
41069
  constructor(status, statusText, message) {
41068
41070
  super(message || `API Error: ${status} ${statusText}`);
41069
- this.status = status;
41070
- this.statusText = statusText;
41071
+ __publicField(this, "status", status);
41072
+ __publicField(this, "statusText", statusText);
41071
41073
  this.name = "ApiError";
41072
41074
  }
41073
41075
  };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { LucideIcon } from "lucide-react";
3
3
  import { EntityDisplayProps } from "./types";
4
+ import type { EntityRow } from "@almadar/core";
4
5
  export interface Column<T> {
5
6
  key: keyof T | string;
6
7
  header: string;
@@ -20,7 +21,7 @@ export interface RowAction<T> {
20
21
  show?: (row: T) => boolean;
21
22
  event?: string;
22
23
  }
23
- export interface DataTableProps<T extends {
24
+ export interface DataTableProps<T extends EntityRow & {
24
25
  id: string | number;
25
26
  }> extends EntityDisplayProps<T> {
26
27
  /** Fields to display - accepts string[] or Column[] for unified interface. Alias for columns */
@@ -59,7 +60,7 @@ export interface DataTableProps<T extends {
59
60
  /** Show total count in pagination */
60
61
  showTotal?: boolean;
61
62
  }
62
- export declare function DataTable<T extends {
63
+ export declare function DataTable<T extends EntityRow & {
63
64
  id: string | number;
64
65
  }>({ fields, columns, entity, itemActions, isLoading, error, emptyIcon, emptyTitle, emptyDescription, emptyAction, selectable, selectedIds, sortBy, sortDirection, searchable, searchValue, searchPlaceholder, page, pageSize, totalCount, rowActions: externalRowActions, bulkActions, headerActions, showTotal, className, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
65
66
  export declare namespace DataTable {
@@ -8,43 +8,16 @@
8
8
  * 4. Renders gear-shaped state nodes via the renderStateNode prop
9
9
  */
10
10
  import React from 'react';
11
- import type { EntityDisplayProps } from './types';
12
- interface SmState {
13
- name: string;
14
- isInitial?: boolean;
15
- isTerminal?: boolean;
16
- isFinal?: boolean;
17
- }
18
- interface SmTransition {
19
- from: string;
20
- to: string;
21
- event: string;
22
- guard?: unknown;
23
- effects?: unknown[];
24
- }
25
- interface SmStateMachine {
26
- states: SmState[];
27
- transitions: SmTransition[];
28
- }
29
- interface SmTrait {
30
- name: string;
31
- stateMachine?: SmStateMachine;
32
- linkedEntity?: string;
33
- }
34
- interface SmEntity {
35
- name: string;
36
- fields?: Array<{
37
- name: string;
38
- }>;
39
- }
40
- interface SmOrbital {
41
- entity?: SmEntity;
42
- traits?: SmTrait[];
43
- }
44
- interface SmSchema {
45
- orbitals?: SmOrbital[];
46
- }
47
- export interface JazariStateMachineProps extends EntityDisplayProps<SmSchema> {
11
+ import type { OrbitalSchema, Trait as CoreTrait } from '@almadar/core';
12
+ type SmTrait = CoreTrait;
13
+ type SmSchema = OrbitalSchema;
14
+ export interface JazariStateMachineProps {
15
+ /** Additional CSS classes */
16
+ className?: string;
17
+ /** Loading state indicator */
18
+ isLoading?: boolean;
19
+ /** Error state */
20
+ error?: Error | null;
48
21
  /** Full schema — extracts first trait's state machine */
49
22
  schema?: SmSchema;
50
23
  /** Or pass a single trait directly */
@@ -10,9 +10,10 @@
10
10
  */
11
11
  import React from 'react';
12
12
  import type { EntityDisplayProps } from './types';
13
- export interface MasterDetailProps<T extends {
13
+ import type { EntityRow } from '@almadar/core';
14
+ export interface MasterDetailProps<T extends EntityRow & {
14
15
  id: string | number;
15
- } = {
16
+ } = EntityRow & {
16
17
  id: string | number;
17
18
  }> extends EntityDisplayProps<T> {
18
19
  /** Fields to show in the master list (maps to DataTable columns) */
@@ -22,7 +23,7 @@ export interface MasterDetailProps<T extends {
22
23
  /** Loading state (alias for isLoading) */
23
24
  loading?: boolean;
24
25
  }
25
- export declare function MasterDetail<T extends {
26
+ export declare function MasterDetail<T extends EntityRow & {
26
27
  id: string | number;
27
28
  }>({ entity, masterFields, detailFields: _detailFields, // Captured but not used here - detail handled separately
28
29
  loading: externalLoading, isLoading: externalIsLoading, error: externalError, className, ...rest }: MasterDetailProps<T>): React.ReactElement;
@@ -12,7 +12,8 @@
12
12
  */
13
13
  import React from "react";
14
14
  import type { EntityDisplayProps } from "./types";
15
- export interface MediaItem {
15
+ import type { EntityRow } from "@almadar/core";
16
+ export type MediaItem = EntityRow & {
16
17
  /** Unique identifier */
17
18
  id: string;
18
19
  /** Media URL */
@@ -27,7 +28,7 @@ export interface MediaItem {
27
28
  caption?: string;
28
29
  /** File size */
29
30
  fileSize?: string;
30
- }
31
+ };
31
32
  export interface MediaGalleryAction {
32
33
  label: string;
33
34
  event?: string;
@@ -11,7 +11,6 @@
11
11
  */
12
12
  import React from 'react';
13
13
  import type { LucideIcon } from 'lucide-react';
14
- import type { EntityDisplayProps } from './types';
15
14
  export interface SidebarItem {
16
15
  /** Item ID */
17
16
  id: string;
@@ -32,7 +31,13 @@ export interface SidebarItem {
32
31
  /** Sub-items (for nested navigation) */
33
32
  subItems?: SidebarItem[];
34
33
  }
35
- export interface SidebarProps extends EntityDisplayProps<SidebarItem> {
34
+ export interface SidebarProps {
35
+ /** Additional CSS classes */
36
+ className?: string;
37
+ /** Loading state indicator */
38
+ isLoading?: boolean;
39
+ /** Error state */
40
+ error?: Error | null;
36
41
  /** Logo/Brand content - can be a ReactNode or logo config */
37
42
  logo?: React.ReactNode;
38
43
  /** Logo image source */
@@ -16,7 +16,6 @@
16
16
  */
17
17
  import React from 'react';
18
18
  import type { DomLayoutData, DomStateNode, DomTransitionLabel, VisualizerConfig } from '../../lib/visualizer/index.js';
19
- import type { EntityDisplayProps } from './types';
20
19
  /** Bundled transitions between same from→to states */
21
20
  export interface TransitionBundle {
22
21
  id: string;
@@ -26,7 +25,13 @@ export interface TransitionBundle {
26
25
  isBidirectional: boolean;
27
26
  isReverse: boolean;
28
27
  }
29
- export interface StateMachineViewProps extends EntityDisplayProps<DomLayoutData> {
28
+ export interface StateMachineViewProps {
29
+ /** Additional CSS classes */
30
+ className?: string;
31
+ /** Loading state indicator */
32
+ isLoading?: boolean;
33
+ /** Error state */
34
+ error?: Error | null;
30
35
  layoutData: DomLayoutData;
31
36
  /** Custom state node renderer — when provided, replaces the default circle nodes */
32
37
  renderStateNode?: (state: DomStateNode, config: VisualizerConfig) => React.ReactNode;
@@ -10,6 +10,7 @@
10
10
  import React from "react";
11
11
  import { MenuItem } from "../molecules/Menu";
12
12
  import type { EntityDisplayProps } from "./types";
13
+ import type { EntityRow } from "@almadar/core";
13
14
  export type SortDirection = "asc" | "desc";
14
15
  export interface TableColumn<T = any> {
15
16
  /**
@@ -34,7 +35,7 @@ export interface TableColumn<T = any> {
34
35
  */
35
36
  width?: string;
36
37
  }
37
- export interface TableProps<T = Record<string, unknown>> extends EntityDisplayProps<T> {
38
+ export interface TableProps<T extends EntityRow = EntityRow> extends EntityDisplayProps<T> {
38
39
  /**
39
40
  * Table columns
40
41
  */
@@ -11,7 +11,7 @@
11
11
  * - className for external styling
12
12
  */
13
13
  import React from "react";
14
- import type { EntityDisplayProps } from "./types";
14
+ import type { EntityRow } from "@almadar/core";
15
15
  import type { LucideIcon } from "lucide-react";
16
16
  export type TimelineItemStatus = "complete" | "active" | "pending" | "error";
17
17
  export interface TimelineItem {
@@ -36,7 +36,20 @@ export interface TimelineAction {
36
36
  navigatesTo?: string;
37
37
  variant?: "primary" | "secondary" | "ghost";
38
38
  }
39
- export interface TimelineProps extends EntityDisplayProps<TimelineItem> {
39
+ export interface TimelineProps {
40
+ /** Additional CSS classes */
41
+ className?: string;
42
+ /** Loading state indicator */
43
+ isLoading?: boolean;
44
+ /** Error state */
45
+ error?: Error | null;
46
+ /**
47
+ * Schema entity data typed against @almadar/core's EntityRow. Items from
48
+ * `entity` are normalised into `items` when `items` is omitted. UI-specific
49
+ * TimelineItem fields (`icon`, callbacks) cannot round-trip through the
50
+ * event bus, so decorative stories that need them pass `items` directly.
51
+ */
52
+ entity?: EntityRow | readonly EntityRow[];
40
53
  /** Timeline title */
41
54
  title?: string;
42
55
  /** Timeline items */
@@ -8,9 +8,10 @@
8
8
  * - Delegates to ContentRenderer children
9
9
  */
10
10
  import React from 'react';
11
- import type { EntityDisplayProps } from '../types';
12
11
  import type { BookChapter } from './types';
13
- export interface BookChapterViewProps extends EntityDisplayProps<BookChapter> {
12
+ export interface BookChapterViewProps {
13
+ /** Additional CSS classes */
14
+ className?: string;
14
15
  chapter: BookChapter;
15
16
  direction?: 'rtl' | 'ltr';
16
17
  }
@@ -8,9 +8,9 @@
8
8
  * - Emits: UI:BOOK_START
9
9
  */
10
10
  import React from 'react';
11
- import type { EntityDisplayProps } from '../types';
12
- import type { BookData } from './types';
13
- export interface BookCoverPageProps extends EntityDisplayProps<BookData> {
11
+ export interface BookCoverPageProps {
12
+ /** Additional CSS classes */
13
+ className?: string;
14
14
  title: string;
15
15
  subtitle?: string;
16
16
  author?: string;
@@ -8,9 +8,9 @@
8
8
  * - Emits: UI:BOOK_PAGE_PREV, UI:BOOK_PAGE_NEXT, UI:BOOK_PRINT, UI:BOOK_SHOW_TOC
9
9
  */
10
10
  import React from 'react';
11
- import type { EntityDisplayProps } from '../types';
12
- import type { BookData } from './types';
13
- export interface BookNavBarProps extends EntityDisplayProps<BookData> {
11
+ export interface BookNavBarProps {
12
+ /** Additional CSS classes */
13
+ className?: string;
14
14
  currentPage: number;
15
15
  totalPages: number;
16
16
  chapterTitle?: string;