@almadar/ui 2.55.1 → 2.57.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.
@@ -0,0 +1,37 @@
1
+ /**
2
+ * FileTree Molecule
3
+ *
4
+ * A filesystem tree navigator with folder expand/collapse, file-type icons,
5
+ * and click-to-select. Used by the Workspace tab to browse the agent's
6
+ * workspace directory.
7
+ *
8
+ * Follows atomic design: composes Box, Icon, Typography atoms.
9
+ */
10
+ import React from 'react';
11
+ export interface FileTreeNode {
12
+ /** File or directory name */
13
+ name: string;
14
+ /** Relative path from workspace root */
15
+ path: string;
16
+ /** 'file' or 'dir' */
17
+ type: 'file' | 'dir';
18
+ /** Children (only for directories) */
19
+ children?: FileTreeNode[];
20
+ /** File size in bytes (optional, for display) */
21
+ size?: number;
22
+ /** Detected language for syntax highlighting */
23
+ language?: string;
24
+ }
25
+ export interface FileTreeProps {
26
+ /** The tree data */
27
+ tree: FileTreeNode[];
28
+ /** Currently selected file path */
29
+ selectedPath?: string;
30
+ /** Called when a file is clicked */
31
+ onFileSelect?: (path: string) => void;
32
+ /** CSS class */
33
+ className?: string;
34
+ /** Indent size per level in px (default: 16) */
35
+ indent?: number;
36
+ }
37
+ export declare const FileTree: React.FC<FileTreeProps>;
@@ -1,4 +1,5 @@
1
1
  export { ErrorBoundary, type ErrorBoundaryProps } from './ErrorBoundary';
2
+ export { FileTree, type FileTreeProps, type FileTreeNode } from './FileTree';
2
3
  export { FormField, type FormFieldProps } from './FormField';
3
4
  export { EmptyState, type EmptyStateProps } from './EmptyState';
4
5
  export { LoadingState, type LoadingStateProps } from './LoadingState';
@@ -3499,6 +3499,9 @@ function exprToTree(expr) {
3499
3499
  function parseApplicationLevel(schema) {
3500
3500
  const orbitals = [];
3501
3501
  const crossLinks = [];
3502
+ if (!schema.orbitals || schema.orbitals.length === 0) {
3503
+ return { orbitals: [], crossLinks: [] };
3504
+ }
3502
3505
  const count = schema.orbitals.length;
3503
3506
  const cols = Math.ceil(Math.sqrt(count));
3504
3507
  const rows = Math.ceil(count / cols);
@@ -3553,6 +3556,7 @@ function parseApplicationLevel(schema) {
3553
3556
  return { orbitals, crossLinks };
3554
3557
  }
3555
3558
  function parseOrbitalLevel(schema, orbitalName) {
3559
+ if (!schema.orbitals) return null;
3556
3560
  const orbital = schema.orbitals.find((o) => o.name === orbitalName);
3557
3561
  if (!orbital) return null;
3558
3562
  const entity = getEntity(orbital);
@@ -3621,6 +3625,7 @@ function parseOrbitalLevel(schema, orbitalName) {
3621
3625
  };
3622
3626
  }
3623
3627
  function parseTraitLevel(schema, orbitalName, traitName) {
3628
+ if (!schema.orbitals) return null;
3624
3629
  const orbital = schema.orbitals.find((o) => o.name === orbitalName);
3625
3630
  if (!orbital) return null;
3626
3631
  const traits = getTraits(orbital);
@@ -3475,6 +3475,9 @@ function exprToTree(expr) {
3475
3475
  function parseApplicationLevel(schema) {
3476
3476
  const orbitals = [];
3477
3477
  const crossLinks = [];
3478
+ if (!schema.orbitals || schema.orbitals.length === 0) {
3479
+ return { orbitals: [], crossLinks: [] };
3480
+ }
3478
3481
  const count = schema.orbitals.length;
3479
3482
  const cols = Math.ceil(Math.sqrt(count));
3480
3483
  const rows = Math.ceil(count / cols);
@@ -3529,6 +3532,7 @@ function parseApplicationLevel(schema) {
3529
3532
  return { orbitals, crossLinks };
3530
3533
  }
3531
3534
  function parseOrbitalLevel(schema, orbitalName) {
3535
+ if (!schema.orbitals) return null;
3532
3536
  const orbital = schema.orbitals.find((o) => o.name === orbitalName);
3533
3537
  if (!orbital) return null;
3534
3538
  const entity = getEntity(orbital);
@@ -3597,6 +3601,7 @@ function parseOrbitalLevel(schema, orbitalName) {
3597
3601
  };
3598
3602
  }
3599
3603
  function parseTraitLevel(schema, orbitalName, traitName) {
3604
+ if (!schema.orbitals) return null;
3600
3605
  const orbital = schema.orbitals.find((o) => o.name === orbitalName);
3601
3606
  if (!orbital) return null;
3602
3607
  const traits = getTraits(orbital);