@elaraai/e3-ui-components 1.0.58 → 1.0.60

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 +1 @@
1
- {"version":3,"file":"DatasetPreview.d.ts","sourceRoot":"","sources":["../../src/components/DatasetPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAkB7D,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mDAAmD;IACnD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;+EAC2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,2CAYzF;AAED,eAAO,MAAM,cAAc,2DAgIzB,CAAC"}
1
+ {"version":3,"file":"DatasetPreview.d.ts","sourceRoot":"","sources":["../../src/components/DatasetPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAkB7D,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mDAAmD;IACnD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;+EAC2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,2CAYzF;AAED,eAAO,MAAM,cAAc,2DAiJzB,CAAC"}
@@ -15,6 +15,11 @@ export interface PagedDatasetPreviewProps {
15
15
  requestOptions?: RequestOptions;
16
16
  /** Triggers a whole-value download (the existing download flow). */
17
17
  onDownload: () => void | Promise<void>;
18
+ /** Called when the server refuses the blob as un-pageable
19
+ * (`dataset_not_indexed` — a legacy blob predating the stored-segmented
20
+ * contract). The parent falls back to the inline tree so pre-index
21
+ * values keep rendering instead of dead-ending here. */
22
+ onNotIndexed?: () => void;
18
23
  }
19
24
  export declare const PagedDatasetPreview: import('react').NamedExoticComponent<PagedDatasetPreviewProps>;
20
25
  //# sourceMappingURL=PagedDatasetPreview.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PagedDatasetPreview.d.ts","sourceRoot":"","sources":["../../src/components/PagedDatasetPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAkD,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAenG,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,EAAE,aAAa,CAAC;IACpB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,oEAAoE;IACpE,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAkCD,eAAO,MAAM,mBAAmB,gEAkIgH,CAAC"}
1
+ {"version":3,"file":"PagedDatasetPreview.d.ts","sourceRoot":"","sources":["../../src/components/PagedDatasetPreview.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAezF,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,EAAE,aAAa,CAAC;IACpB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,oEAAoE;IACpE,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC;;;6DAGyD;IACzD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAiCD,eAAO,MAAM,mBAAmB,gEAyIgH,CAAC"}
package/dist/index.cjs CHANGED
@@ -64050,12 +64050,11 @@ function pageRows(type, decoded, offset) {
64050
64050
  }
64051
64051
  if (type.type === "Dict") {
64052
64052
  const { key: keyType, value: valueType } = type.value;
64053
- const printKey = east.printFor(keyType);
64054
64053
  const stringKeys = keyType.type === "String";
64055
64054
  return Array.from(decoded.entries()).map(([k2, v3], i) => ({
64056
64055
  node: eastUi.ValueTree.materialize(valueType, v3),
64057
64056
  step: stringKeys ? east.variant("key", k2) : east.variant("index", BigInt(offset + i)),
64058
- label: stringKeys ? k2 : printKey(k2)
64057
+ label: stringKeys ? k2 : eastUi.ValueTree.keyLabel(keyType, k2)
64059
64058
  }));
64060
64059
  }
64061
64060
  const elemType = type.value;
@@ -64076,7 +64075,8 @@ const PagedDatasetPreview = React.memo(function PagedDatasetPreview2({
64076
64075
  hash: hash2,
64077
64076
  sizeBytes,
64078
64077
  requestOptions,
64079
- onDownload
64078
+ onDownload,
64079
+ onNotIndexed
64080
64080
  }) {
64081
64081
  const queryClient = reactQuery.useQueryClient();
64082
64082
  const [pages, setPages] = React.useState(/* @__PURE__ */ new Map());
@@ -64119,12 +64119,15 @@ const PagedDatasetPreview = React.memo(function PagedDatasetPreview2({
64119
64119
  setPages((prev2) => new Map(prev2).set(pageIdx, rows));
64120
64120
  }).catch((err) => {
64121
64121
  pagingDebug(`p${pageIdx} FAILED:`, err);
64122
+ if (err instanceof e3ApiClient.ApiError && err.code === "dataset_not_indexed") {
64123
+ onNotIndexed == null ? void 0 : onNotIndexed();
64124
+ }
64122
64125
  setError(err instanceof Error ? err : new Error(String(err)));
64123
64126
  }).finally(() => {
64124
64127
  inflightRef.current.delete(pageIdx);
64125
64128
  setLoadingCount((n2) => n2 - 1);
64126
64129
  });
64127
- }, [queryClient, apiUrl, repo, workspace, path2, hash2, requestOptions, type]);
64130
+ }, [queryClient, apiUrl, repo, workspace, path2, hash2, requestOptions, type, onNotIndexed]);
64128
64131
  React.useEffect(() => {
64129
64132
  if (totals === null && error3 === null) loadPage(0);
64130
64133
  }, [totals, error3, loadPage]);
@@ -64221,7 +64224,11 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64221
64224
  const hasValue = (status == null ? void 0 : status.refType) === "value" && status.hash !== null;
64222
64225
  const sizeBytes = (status == null ? void 0 : status.sizeBytes) ?? 0;
64223
64226
  const isOversized = hasValue && sizeBytes > sizeLimit;
64224
- const shouldFetch = hasValue && !isOversized;
64227
+ const type = status == null ? void 0 : status.type;
64228
+ const [notIndexedHash, setNotIndexedHash] = React.useState(null);
64229
+ const pageable = hasValue && type !== void 0 && (type.type === "Array" || type.type === "Set" || type.type === "Dict");
64230
+ const usePaged = pageable && (!editable || isOversized) && workspace != null && path2 != null && (status == null ? void 0 : status.hash) != null && status.hash !== notIndexedHash;
64231
+ const shouldFetch = hasValue && !isOversized && !usePaged;
64225
64232
  const valueQuery = useDatasetValue(apiUrl, repo, workspace, path2, {
64226
64233
  ...requestOptions != null && { requestOptions },
64227
64234
  type: status == null ? void 0 : status.type,
@@ -64235,7 +64242,6 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64235
64242
  const download = useDatasetDownload(apiUrl, repo, workspace, path2, requestOptions);
64236
64243
  const setMutation = useDatasetSet(apiUrl, repo, workspace, requestOptions);
64237
64244
  const queryClient = reactQuery.useQueryClient();
64238
- const type = status == null ? void 0 : status.type;
64239
64245
  const decoded = (_a2 = valueQuery.data) == null ? void 0 : _a2.decoded;
64240
64246
  const write = React.useCallback(async (next2) => {
64241
64247
  if (workspace == null || path2 == null || type === void 0) return;
@@ -64262,24 +64268,25 @@ const DatasetPreview = React.memo(function DatasetPreview2({
64262
64268
  }
64263
64269
  if (!status) return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "info", title: "No status" });
64264
64270
  if (!hasValue) return /* @__PURE__ */ jsxRuntime.jsx(StatusDisplay, { variant: "info", title: "No data available", message: "Waiting for a value to be set" });
64271
+ if (usePaged && type !== void 0 && workspace != null && path2 != null && status.hash != null) {
64272
+ const pagedHash = status.hash;
64273
+ return /* @__PURE__ */ jsxRuntime.jsx(
64274
+ PagedDatasetPreview,
64275
+ {
64276
+ apiUrl,
64277
+ repo,
64278
+ workspace,
64279
+ path: path2,
64280
+ type,
64281
+ hash: pagedHash,
64282
+ sizeBytes,
64283
+ ...requestOptions != null && { requestOptions },
64284
+ onDownload: download,
64285
+ onNotIndexed: () => setNotIndexedHash(pagedHash)
64286
+ }
64287
+ );
64288
+ }
64265
64289
  if (isOversized) {
64266
- const pageable = type !== void 0 && (type.type === "Array" || type.type === "Set" || type.type === "Dict");
64267
- if (pageable && workspace != null && path2 != null && status.hash != null) {
64268
- return /* @__PURE__ */ jsxRuntime.jsx(
64269
- PagedDatasetPreview,
64270
- {
64271
- apiUrl,
64272
- repo,
64273
- workspace,
64274
- path: path2,
64275
- type,
64276
- hash: status.hash,
64277
- sizeBytes,
64278
- ...requestOptions != null && { requestOptions },
64279
- onDownload: download
64280
- }
64281
- );
64282
- }
64283
64290
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { height: "100%", direction: "column", align: "center", justify: "center", layerStyle: "banner.stale", borderRadius: "0", gap: 3, p: 6, children: [
64284
64291
  /* @__PURE__ */ jsxRuntime.jsx(react.Text, { fontSize: "lg", color: "fg.warning", fontWeight: "bold", children: "Value too large to display" }),
64285
64292
  /* @__PURE__ */ jsxRuntime.jsxs(react.Text, { color: "fg.muted", fontSize: "sm", children: [