@ioai/lerobot-studio 1.2.0 → 1.3.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.
@@ -1,5 +1,5 @@
1
1
  import { a as e, i as t, n, o as r, r as i } from "./tslib.es6-DT2YfilY.js";
2
- import { C as a, S as o, _ as s, d as c, f as l, i as u, l as ee, n as te, p as ne, r as re, v as ie, y as ae } from "./workerManager-CvezHmhd.js";
2
+ import { C as a, D as o, E as s, a as c, f as l, l as u, m as ee, n as te, p as ne, r as re, w as ie, x as ae } from "./workerManager-CQ6DPJcz.js";
3
3
  import { t as oe } from "./MediaCache-DZ7bEoOY.js";
4
4
  //#region src/core/types/lerobot.ts
5
5
  function se(e) {
@@ -6850,11 +6850,11 @@ function Wc(e) {
6850
6850
  var Gc = class {
6851
6851
  async loadSubtasks(e, t) {
6852
6852
  try {
6853
- let e = Wc(await t.readParquetToIPC(ie)), n = new Set(e.schema.fields.map((e) => e.name)), r = ae.find((e) => n.has(e)), i = r ? e.getChild(r) : null, a = e.getChild("subtask_index"), o = Array.from({ length: e.numRows }, (e, t) => ({
6854
- subtaskIndex: a ? le(a.get(t)) : t,
6853
+ let e = Wc(await t.readParquetToIPC(a)), n = new Set(e.schema.fields.map((e) => e.name)), r = ie.find((e) => n.has(e)), i = r ? e.getChild(r) : null, o = e.getChild("subtask_index"), s = Array.from({ length: e.numRows }, (e, t) => ({
6854
+ subtaskIndex: o ? le(o.get(t)) : t,
6855
6855
  label: i ? le(i.get(t)) : ""
6856
6856
  }));
6857
- return ne(o);
6857
+ return ee(s);
6858
6858
  } catch (e) {
6859
6859
  if (e instanceof RangeError) throw e;
6860
6860
  return {};
@@ -7644,24 +7644,24 @@ var Ll = class {
7644
7644
  }
7645
7645
  async loadEpisodeSubtaskSource(e) {
7646
7646
  if (!this.info) throw Error("Not initialized");
7647
- let t = o(this.info.features), n = a(this.info.features);
7647
+ let t = s(this.info.features), n = o(this.info.features);
7648
7648
  if (!t && !n && Object.keys(this.subtasks).length === 0) return {
7649
7649
  indices: [],
7650
7650
  table: this.subtasks
7651
7651
  };
7652
7652
  let r = [];
7653
7653
  if (n) try {
7654
- r = ((await this.loadFeatureData(e, [n]))[n] ?? []).map((e) => l(e));
7654
+ r = ((await this.loadFeatureData(e, [n]))[n] ?? []).map((e) => ne(e));
7655
7655
  } catch {
7656
7656
  r = [];
7657
7657
  }
7658
7658
  if (r.some((e) => e.length > 0)) {
7659
7659
  let e = {
7660
7660
  ...this.subtasks,
7661
- ...u(r)
7661
+ ...c(r)
7662
7662
  };
7663
7663
  return {
7664
- indices: ee(r, e),
7664
+ indices: u(r, e),
7665
7665
  table: e
7666
7666
  };
7667
7667
  }
@@ -7675,10 +7675,10 @@ var Ll = class {
7675
7675
  indices: [],
7676
7676
  table: this.subtasks
7677
7677
  };
7678
- let r = Array.from({ length: n.rows }, (e, t) => c(n.values[t * n.width]));
7678
+ let r = Array.from({ length: n.rows }, (e, t) => l(n.values[t * n.width]));
7679
7679
  return {
7680
7680
  indices: r,
7681
- table: s(r, this.subtasks)
7681
+ table: ae(r, this.subtasks)
7682
7682
  };
7683
7683
  } catch {
7684
7684
  return {
@@ -620,6 +620,10 @@
620
620
  z-index: 50;
621
621
  }
622
622
 
623
+ .lerobot-root .z-\[1\] {
624
+ z-index: 1;
625
+ }
626
+
623
627
  .lerobot-root .z-\[5\] {
624
628
  z-index: 5;
625
629
  }
@@ -998,10 +1002,6 @@
998
1002
  max-height: calc(var(--spacing) * 32);
999
1003
  }
1000
1004
 
1001
- .lerobot-root .max-h-36 {
1002
- max-height: calc(var(--spacing) * 36);
1003
- }
1004
-
1005
1005
  .lerobot-root .max-h-\[38vh\] {
1006
1006
  max-height: 38vh;
1007
1007
  }
@@ -1054,10 +1054,6 @@
1054
1054
  min-height: 100vh;
1055
1055
  }
1056
1056
 
1057
- .lerobot-root .w-0\.5 {
1058
- width: calc(var(--spacing) * .5);
1059
- }
1060
-
1061
1057
  .lerobot-root .w-1 {
1062
1058
  width: var(--spacing);
1063
1059
  }
@@ -1178,10 +1174,6 @@
1178
1174
  max-width: 120px;
1179
1175
  }
1180
1176
 
1181
- .lerobot-root .max-w-\[140px\] {
1182
- max-width: 140px;
1183
- }
1184
-
1185
1177
  .lerobot-root .max-w-\[200px\] {
1186
1178
  max-width: 200px;
1187
1179
  }
@@ -1339,6 +1331,10 @@
1339
1331
  cursor: default;
1340
1332
  }
1341
1333
 
1334
+ .lerobot-root .cursor-ew-resize {
1335
+ cursor: ew-resize;
1336
+ }
1337
+
1342
1338
  .lerobot-root .cursor-grabbing {
1343
1339
  cursor: grabbing;
1344
1340
  }
@@ -1824,6 +1820,16 @@
1824
1820
  }
1825
1821
  }
1826
1822
 
1823
+ .lerobot-root .bg-background\/90 {
1824
+ background-color: var(--background);
1825
+ }
1826
+
1827
+ @supports (color: color-mix(in lab, red, red)) {
1828
+ .lerobot-root .bg-background\/90 {
1829
+ background-color: color-mix(in oklab, var(--background) 90%, transparent);
1830
+ }
1831
+ }
1832
+
1827
1833
  .lerobot-root .bg-background\/95 {
1828
1834
  background-color: var(--background);
1829
1835
  }
@@ -1838,6 +1844,16 @@
1838
1844
  background-color: var(--color-black);
1839
1845
  }
1840
1846
 
1847
+ .lerobot-root .bg-black\/40 {
1848
+ background-color: #0006;
1849
+ }
1850
+
1851
+ @supports (color: color-mix(in lab, red, red)) {
1852
+ .lerobot-root .bg-black\/40 {
1853
+ background-color: color-mix(in oklab, var(--color-black) 40%, transparent);
1854
+ }
1855
+ }
1856
+
1841
1857
  .lerobot-root .bg-black\/50 {
1842
1858
  background-color: #00000080;
1843
1859
  }
@@ -2014,6 +2030,16 @@
2014
2030
  }
2015
2031
  }
2016
2032
 
2033
+ .lerobot-root .bg-primary\/35 {
2034
+ background-color: var(--primary);
2035
+ }
2036
+
2037
+ @supports (color: color-mix(in lab, red, red)) {
2038
+ .lerobot-root .bg-primary\/35 {
2039
+ background-color: color-mix(in oklab, var(--primary) 35%, transparent);
2040
+ }
2041
+ }
2042
+
2017
2043
  .lerobot-root .bg-primary\/60 {
2018
2044
  background-color: var(--primary);
2019
2045
  }
@@ -2042,6 +2068,10 @@
2042
2068
  background-color: #0000;
2043
2069
  }
2044
2070
 
2071
+ .lerobot-root .bg-\[length\:8px_8px\] {
2072
+ background-size: 8px 8px;
2073
+ }
2074
+
2045
2075
  .lerobot-root .fill-current {
2046
2076
  fill: currentColor;
2047
2077
  }
@@ -2305,6 +2335,11 @@
2305
2335
  font-size: 12px;
2306
2336
  }
2307
2337
 
2338
+ .lerobot-root .leading-4 {
2339
+ --tw-leading: calc(var(--spacing) * 4);
2340
+ line-height: calc(var(--spacing) * 4);
2341
+ }
2342
+
2308
2343
  .lerobot-root .leading-5 {
2309
2344
  --tw-leading: calc(var(--spacing) * 5);
2310
2345
  line-height: calc(var(--spacing) * 5);
@@ -2687,6 +2722,10 @@
2687
2722
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2688
2723
  }
2689
2724
 
2725
+ .lerobot-root .ring-border {
2726
+ --tw-ring-color: var(--border);
2727
+ }
2728
+
2690
2729
  .lerobot-root .ring-primary\/20 {
2691
2730
  --tw-ring-color: var(--primary);
2692
2731
  }
@@ -2697,6 +2736,16 @@
2697
2736
  }
2698
2737
  }
2699
2738
 
2739
+ .lerobot-root .ring-primary\/70 {
2740
+ --tw-ring-color: var(--primary);
2741
+ }
2742
+
2743
+ @supports (color: color-mix(in lab, red, red)) {
2744
+ .lerobot-root .ring-primary\/70 {
2745
+ --tw-ring-color: color-mix(in oklab, var(--primary) 70%, transparent);
2746
+ }
2747
+ }
2748
+
2700
2749
  .lerobot-root .ring-ring\/50 {
2701
2750
  --tw-ring-color: var(--ring);
2702
2751
  }
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  import { default as React_2 } from 'react';
8
+ import * as React_3 from 'react';
8
9
 
9
10
  /** Create a viewer data source for a local ZIP, TAR, or TAR.GZ archive. */
10
11
  export declare function createArchiveDataSourceFromFile(file: File): DataSource;
@@ -16,6 +17,9 @@ export declare function createArchiveDataSourceFromFile(file: File): DataSource;
16
17
  */
17
18
  export declare function createArchiveDataSourceFromUrl(url: string): DataSource;
18
19
 
20
+ /** Create a viewer data source from a File System Access directory handle. */
21
+ export declare function createDirectoryDataSource(handle: FileSystemDirectoryHandle): DataSource;
22
+
19
23
  /**
20
24
  * Create a viewer data source from a host-owned list of per-file HTTP(S) URLs.
21
25
  *
@@ -25,6 +29,20 @@ export declare function createArchiveDataSourceFromUrl(url: string): DataSource;
25
29
  */
26
30
  export declare function createRemoteManifestDataSource(files: RemoteFileEntry[]): DataSource;
27
31
 
32
+ /** Tabbed picker for local directory, local archive, or remote archive URL. */
33
+ export declare const DatasetSourceSelector: React_2.FC<DatasetSourceSelectorProps>;
34
+
35
+ /** Picker for a local directory, local archive, or remote archive URL. */
36
+ export declare interface DatasetSourceSelectorProps {
37
+ onOpenDirectory: () => void;
38
+ onOpenLocalArchive: () => void;
39
+ onOpenRemoteArchive: (url?: string) => void;
40
+ requested?: ParsedSourceUrl | null;
41
+ onRequestUrl?: (rawUrl: string | null, mode: 'push' | 'replace') => void;
42
+ onRestoreFromUrl?: (requested: ParsedSourceUrl) => void;
43
+ className?: string;
44
+ }
45
+
28
46
  /** Browser-readable storage abstraction consumed by the viewer. */
29
47
  export declare interface DataSource {
30
48
  /** Return whether a logical dataset path exists. */
@@ -47,8 +65,50 @@ export declare interface DataSource {
47
65
  invalidateObjectUrl?(path: string): void | Promise<void>;
48
66
  }
49
67
 
68
+ /** A dropped directory entry with a relative path. */
69
+ export declare interface DirectoryFile {
70
+ file: File;
71
+ path: string;
72
+ }
73
+
74
+ /** Callbacks for window-level file and folder drop (and file paste). */
75
+ export declare interface DragAndDropCallbacks {
76
+ onFile: (file: File) => void;
77
+ onDirectoryHandle?: (handle: FileSystemDirectoryHandle) => void;
78
+ onDirectoryFiles?: (files: DirectoryFile[]) => void;
79
+ onUnresolvedDirectory?: (name: string) => void;
80
+ }
81
+
82
+ /** @deprecated Prefer LeRobotStudioProvider */
83
+ export declare const LeRobotProvider: React_2.FC<LeRobotStudioProviderProps>;
84
+
85
+ /**
86
+ * Shared theme, language, and dataset context for the viewer and a custom welcome page.
87
+ */
88
+ export declare const LeRobotStudioProvider: React_2.FC<LeRobotStudioProviderProps>;
89
+
90
+ export declare interface LeRobotStudioProviderProps {
91
+ theme?: 'light' | 'dark' | 'system';
92
+ language?: string;
93
+ className?: string;
94
+ children: React_2.ReactNode;
95
+ /** When true, render the shared Sonner toaster inside the studio root. @defaultValue true */
96
+ showToaster?: boolean;
97
+ /**
98
+ * When true (default), wrap children in a scoped root for CSS and portals.
99
+ * Set false when the host page already provides its own layout wrapper.
100
+ */
101
+ wrapRoot?: boolean;
102
+ }
103
+
50
104
  export declare const LeRobotViewer: React_2.FC<LeRobotViewerProps>;
51
105
 
106
+ /** Viewer without the provider wrapper; render inside `LeRobotStudioProvider`. */
107
+ export declare function LeRobotViewerContent({ dataSource, showSidebar, showPlaybackBar, onFatalError, enableKeyboardShortcuts, onBack, onExport, }: Omit<LeRobotViewerProps, 'theme' | 'language' | 'className'> & {
108
+ showSidebar: boolean;
109
+ showPlaybackBar: boolean;
110
+ }): React_2.JSX.Element | null;
111
+
52
112
  /** A fatal viewer error that requires host action or an explicit retry. */
53
113
  export declare interface LeRobotViewerError {
54
114
  /** Machine-readable category. */
@@ -97,6 +157,34 @@ export declare interface LeRobotViewerProps {
97
157
  /** A phase reported while a data source reads or prepares content. */
98
158
  export declare type LoadingPhase = 'download' | 'index' | 'gunzip' | 'read';
99
159
 
160
+ /**
161
+ * Domain table pagination composed from official shadcn pagination primitives.
162
+ */
163
+ export declare function Pagination({ count, page, onPageChange, rowsPerPage, onRowsPerPageChange, rowsPerPageOptions, className, }: PaginationProps): React_3.JSX.Element;
164
+
165
+ export declare interface PaginationProps {
166
+ count: number;
167
+ page: number;
168
+ onPageChange: (event: unknown, newPage: number) => void;
169
+ rowsPerPage: number;
170
+ onRowsPerPageChange: (event: React_3.ChangeEvent<HTMLSelectElement>) => void;
171
+ rowsPerPageOptions?: number[];
172
+ className?: string;
173
+ }
174
+
175
+ /** Parsed `?url=` intent for restoring a previous local or remote source. */
176
+ export declare interface ParsedSourceUrl {
177
+ kind: SourceKind;
178
+ /** Decoded raw ?url= value */
179
+ raw: string;
180
+ /** UI hint (e.g. local label) */
181
+ hint?: string;
182
+ /** sample:// id */
183
+ sampleId?: string;
184
+ /** IndexedDB has a restorable handle */
185
+ restorable?: boolean;
186
+ }
187
+
100
188
  /** Receives data-source progress updates. */
101
189
  export declare type ProgressHandler = (info: ProgressInfo) => void;
102
190
 
@@ -124,4 +212,34 @@ export declare interface RemoteFileEntry {
124
212
  sizeBytes?: number | null;
125
213
  }
126
214
 
215
+ /** A sample dataset shown as a card on a welcome page. */
216
+ export declare interface SampleDataset {
217
+ id: string;
218
+ name: string;
219
+ description: string;
220
+ url?: string;
221
+ version?: 'v2' | 'v3';
222
+ title?: string;
223
+ coverImageUrl?: string;
224
+ previewVideoUrl?: string;
225
+ archiveUrl?: string;
226
+ }
227
+
228
+ /** Cover card for a sample dataset or similar list entry. */
229
+ export declare const SampleDatasetCard: React_2.FC<SampleDatasetCardProps>;
230
+
231
+ /** Cover card for a sample dataset or similar list entry. */
232
+ export declare interface SampleDatasetCardProps {
233
+ sample: SampleDataset;
234
+ onSelect: (sample: SampleDataset) => void | Promise<void>;
235
+ fallbackImageUrl?: string;
236
+ }
237
+
238
+ export declare type SourceKind = 'remoteArchive' | 'localArchive' | 'directory' | 'sample' | 'unknown';
239
+
240
+ /** Window-level drag-and-drop (and file paste) for local archives and directories. */
241
+ export declare function useDragAndDrop(callbacks: DragAndDropCallbacks): {
242
+ isDragging: boolean;
243
+ };
244
+
127
245
  export { }