@almadar/ui 2.61.0 → 3.0.1

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 (37) hide show
  1. package/dist/avl/index.cjs +1328 -1505
  2. package/dist/avl/index.css +7 -2
  3. package/dist/avl/index.js +251 -428
  4. package/dist/components/index.cjs +35 -37
  5. package/dist/components/index.css +7 -2
  6. package/dist/components/index.js +36 -38
  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/marketing-types.d.ts +22 -12
  23. package/dist/components/organisms/types.d.ts +23 -17
  24. package/dist/components/templates/types.d.ts +7 -2
  25. package/dist/hooks/index.cjs +5 -2
  26. package/dist/hooks/index.js +5 -2
  27. package/dist/lib/index.cjs +5 -2
  28. package/dist/lib/index.js +5 -2
  29. package/dist/providers/index.cjs +987 -1166
  30. package/dist/providers/index.css +7 -2
  31. package/dist/providers/index.d.ts +0 -2
  32. package/dist/providers/index.js +230 -403
  33. package/dist/runtime/index.cjs +36 -69
  34. package/dist/runtime/index.css +7 -2
  35. package/dist/runtime/index.js +37 -70
  36. package/package.json +3 -3
  37. 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
 
@@ -8943,9 +8944,9 @@ var init_ScaledDiagram = __esm({
8943
8944
  }
8944
8945
  });
8945
8946
 
8946
- // node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css
8947
+ // node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
8947
8948
  var init_katex_min = __esm({
8948
- "node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css"() {
8949
+ "node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
8949
8950
  }
8950
8951
  });
8951
8952
  exports.MarkdownContent = void 0;
@@ -10994,7 +10995,9 @@ function extractTrait(schema, trait, traitIndex) {
10994
10995
  for (const orbital of schema.orbitals) {
10995
10996
  const traits2 = orbital.traits ?? [];
10996
10997
  if (traitIndex < traits2.length) {
10997
- return traits2[traitIndex];
10998
+ const traitRef = traits2[traitIndex];
10999
+ if (core.isInlineTrait(traitRef)) return traitRef;
11000
+ return null;
10998
11001
  }
10999
11002
  }
11000
11003
  return null;
@@ -11002,8 +11005,10 @@ function extractTrait(schema, trait, traitIndex) {
11002
11005
  function extractEntityFields(schema) {
11003
11006
  if (!schema?.orbitals?.length) return [];
11004
11007
  const entity = schema.orbitals[0].entity;
11005
- if (!entity?.fields) return [];
11006
- return entity.fields.map((f3) => f3.name);
11008
+ if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
11009
+ const inlineEntity = entity;
11010
+ if (!inlineEntity.fields) return [];
11011
+ return inlineEntity.fields.map((f3) => f3.name);
11007
11012
  }
11008
11013
  function toStateMachineDefinition(sm) {
11009
11014
  return {
@@ -11298,12 +11303,18 @@ var init_ContentRenderer = __esm({
11298
11303
  );
11299
11304
  case "orbital": {
11300
11305
  const parsed = segment.schema;
11306
+ const inlineTrait = {
11307
+ name: "inline",
11308
+ scope: "instance",
11309
+ stateMachine: parsed
11310
+ };
11301
11311
  const schema = Array.isArray(parsed.orbitals) ? parsed : {
11312
+ name: "inline",
11302
11313
  orbitals: [{
11303
- traits: [{
11304
- name: "inline",
11305
- stateMachine: parsed
11306
- }]
11314
+ name: "inline",
11315
+ entity: { name: "inline", fields: [] },
11316
+ traits: [inlineTrait],
11317
+ pages: []
11307
11318
  }]
11308
11319
  };
11309
11320
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "sm", children: [
@@ -37491,19 +37502,15 @@ function SlotContentRenderer({
37491
37502
  patternPath
37492
37503
  }) {
37493
37504
  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]);
37505
+ if (typeof entityProp === "string" && entityProp.length > 0) {
37506
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
37507
+ throw new Error(
37508
+ `[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.`
37509
+ );
37510
+ }
37511
+ }
37505
37512
  const schemaCtx = useEntitySchemaOptional();
37506
- const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37513
+ const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
37507
37514
  const PatternComponent = getComponentForPattern(content.pattern);
37508
37515
  if (PatternComponent) {
37509
37516
  const childrenConfig = content.props.children;
@@ -37512,15 +37519,10 @@ function SlotContentRenderer({
37512
37519
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
37513
37520
  const { children: _childrenConfig, ...restProps } = content.props;
37514
37521
  const renderedProps = renderPatternProps(restProps, onDismiss);
37515
- let finalProps;
37516
- const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37517
- if (entityType) {
37518
- finalProps = { ...renderedProps, entity: storeData };
37519
- } else if (Array.isArray(renderedProps.items)) {
37520
- finalProps = { ...renderedProps, entity: renderedProps.items };
37521
- } else {
37522
- finalProps = renderedProps;
37523
- }
37522
+ const finalProps = renderedProps;
37523
+ const resolvedItems = Array.isArray(
37524
+ finalProps.entity
37525
+ ) ? finalProps.entity : null;
37524
37526
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37525
37527
  const sample = resolvedItems[0];
37526
37528
  if (sample && typeof sample === "object") {
@@ -37531,9 +37533,6 @@ function SlotContentRenderer({
37531
37533
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37532
37534
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37533
37535
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
37534
- if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
37535
- finalProps.initialData = storeData[0];
37536
- }
37537
37536
  }
37538
37537
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
37539
37538
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -37627,7 +37626,7 @@ function UISlotRenderer({
37627
37626
  }
37628
37627
  return wrapped;
37629
37628
  }
37630
- var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37629
+ var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37631
37630
  var init_UISlotRenderer = __esm({
37632
37631
  "components/organisms/UISlotRenderer.tsx"() {
37633
37632
  "use client";
@@ -37644,7 +37643,6 @@ var init_UISlotRenderer = __esm({
37644
37643
  init_TraitFrame();
37645
37644
  init_component_registry_generated();
37646
37645
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37647
- STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37648
37646
  SuspenseConfigContext = React110.createContext({ enabled: false });
37649
37647
  SlotContainedContext = React110.createContext(false);
37650
37648
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -41111,8 +41109,8 @@ var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ?
41111
41109
  var ApiError = class extends Error {
41112
41110
  constructor(status, statusText, message) {
41113
41111
  super(message || `API Error: ${status} ${statusText}`);
41114
- this.status = status;
41115
- this.statusText = statusText;
41112
+ __publicField(this, "status", status);
41113
+ __publicField(this, "statusText", statusText);
41116
41114
  this.name = "ApiError";
41117
41115
  }
41118
41116
  };
@@ -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
 
@@ -8898,9 +8899,9 @@ var init_ScaledDiagram = __esm({
8898
8899
  }
8899
8900
  });
8900
8901
 
8901
- // node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css
8902
+ // node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
8902
8903
  var init_katex_min = __esm({
8903
- "node_modules/.pnpm/katex@0.16.33/node_modules/katex/dist/katex.min.css"() {
8904
+ "node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
8904
8905
  }
8905
8906
  });
8906
8907
  var MarkdownContent;
@@ -10949,7 +10950,9 @@ function extractTrait(schema, trait, traitIndex) {
10949
10950
  for (const orbital of schema.orbitals) {
10950
10951
  const traits2 = orbital.traits ?? [];
10951
10952
  if (traitIndex < traits2.length) {
10952
- return traits2[traitIndex];
10953
+ const traitRef = traits2[traitIndex];
10954
+ if (isInlineTrait(traitRef)) return traitRef;
10955
+ return null;
10953
10956
  }
10954
10957
  }
10955
10958
  return null;
@@ -10957,8 +10960,10 @@ function extractTrait(schema, trait, traitIndex) {
10957
10960
  function extractEntityFields(schema) {
10958
10961
  if (!schema?.orbitals?.length) return [];
10959
10962
  const entity = schema.orbitals[0].entity;
10960
- if (!entity?.fields) return [];
10961
- return entity.fields.map((f3) => f3.name);
10963
+ if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
10964
+ const inlineEntity = entity;
10965
+ if (!inlineEntity.fields) return [];
10966
+ return inlineEntity.fields.map((f3) => f3.name);
10962
10967
  }
10963
10968
  function toStateMachineDefinition(sm) {
10964
10969
  return {
@@ -11253,12 +11258,18 @@ var init_ContentRenderer = __esm({
11253
11258
  );
11254
11259
  case "orbital": {
11255
11260
  const parsed = segment.schema;
11261
+ const inlineTrait = {
11262
+ name: "inline",
11263
+ scope: "instance",
11264
+ stateMachine: parsed
11265
+ };
11256
11266
  const schema = Array.isArray(parsed.orbitals) ? parsed : {
11267
+ name: "inline",
11257
11268
  orbitals: [{
11258
- traits: [{
11259
- name: "inline",
11260
- stateMachine: parsed
11261
- }]
11269
+ name: "inline",
11270
+ entity: { name: "inline", fields: [] },
11271
+ traits: [inlineTrait],
11272
+ pages: []
11262
11273
  }]
11263
11274
  };
11264
11275
  return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
@@ -37446,19 +37457,15 @@ function SlotContentRenderer({
37446
37457
  patternPath
37447
37458
  }) {
37448
37459
  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]);
37460
+ if (typeof entityProp === "string" && entityProp.length > 0) {
37461
+ if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
37462
+ throw new Error(
37463
+ `[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.`
37464
+ );
37465
+ }
37466
+ }
37460
37467
  const schemaCtx = useEntitySchemaOptional();
37461
- const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
37468
+ const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
37462
37469
  const PatternComponent = getComponentForPattern(content.pattern);
37463
37470
  if (PatternComponent) {
37464
37471
  const childrenConfig = content.props.children;
@@ -37467,15 +37474,10 @@ function SlotContentRenderer({
37467
37474
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
37468
37475
  const { children: _childrenConfig, ...restProps } = content.props;
37469
37476
  const renderedProps = renderPatternProps(restProps, onDismiss);
37470
- let finalProps;
37471
- const resolvedItems = Array.isArray(renderedProps.items) ? renderedProps.items : entityType ? storeData : null;
37472
- if (entityType) {
37473
- finalProps = { ...renderedProps, entity: storeData };
37474
- } else if (Array.isArray(renderedProps.items)) {
37475
- finalProps = { ...renderedProps, entity: renderedProps.items };
37476
- } else {
37477
- finalProps = renderedProps;
37478
- }
37477
+ const finalProps = renderedProps;
37478
+ const resolvedItems = Array.isArray(
37479
+ finalProps.entity
37480
+ ) ? finalProps.entity : null;
37479
37481
  if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
37480
37482
  const sample = resolvedItems[0];
37481
37483
  if (sample && typeof sample === "object") {
@@ -37486,9 +37488,6 @@ function SlotContentRenderer({
37486
37488
  const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
37487
37489
  if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
37488
37490
  finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
37489
- if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
37490
- finalProps.initialData = storeData[0];
37491
- }
37492
37491
  }
37493
37492
  const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
37494
37493
  return /* @__PURE__ */ jsx(
@@ -37582,7 +37581,7 @@ function UISlotRenderer({
37582
37581
  }
37583
37582
  return wrapped;
37584
37583
  }
37585
- var TRAIT_BINDING_RE, STRING_ENTITY_WARNED, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37584
+ var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
37586
37585
  var init_UISlotRenderer = __esm({
37587
37586
  "components/organisms/UISlotRenderer.tsx"() {
37588
37587
  "use client";
@@ -37599,7 +37598,6 @@ var init_UISlotRenderer = __esm({
37599
37598
  init_TraitFrame();
37600
37599
  init_component_registry_generated();
37601
37600
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
37602
- STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
37603
37601
  SuspenseConfigContext = createContext({ enabled: false });
37604
37602
  SlotContainedContext = createContext(false);
37605
37603
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
@@ -41066,8 +41064,8 @@ var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ?
41066
41064
  var ApiError = class extends Error {
41067
41065
  constructor(status, statusText, message) {
41068
41066
  super(message || `API Error: ${status} ${statusText}`);
41069
- this.status = status;
41070
- this.statusText = statusText;
41067
+ __publicField(this, "status", status);
41068
+ __publicField(this, "statusText", statusText);
41071
41069
  this.name = "ApiError";
41072
41070
  }
41073
41071
  };
@@ -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;
@@ -8,9 +8,10 @@
8
8
  * - Emits: UI:BOOK_NAVIGATE { chapterId }
9
9
  */
10
10
  import React from 'react';
11
- import type { EntityDisplayProps } from '../types';
12
11
  import type { BookPart } from './types';
13
- export interface BookTableOfContentsProps extends EntityDisplayProps<BookPart> {
12
+ export interface BookTableOfContentsProps {
13
+ /** Additional CSS classes */
14
+ className?: string;
14
15
  parts: BookPart[];
15
16
  currentChapterId?: string;
16
17
  direction?: 'rtl' | 'ltr';
@@ -18,8 +18,8 @@
18
18
  */
19
19
  import React from 'react';
20
20
  import type { EntityDisplayProps } from '../types';
21
- import type { BookData, BookFieldMap } from './types';
22
- export interface BookViewerProps extends EntityDisplayProps<BookData | Record<string, unknown>> {
21
+ import type { BookFieldMap } from './types';
22
+ export interface BookViewerProps extends EntityDisplayProps {
23
23
  /** Initial page index (default: 0 = cover) */
24
24
  initialPage?: number;
25
25
  /** Field name translation map — a BookFieldMap object or locale key ("ar") */