@elaraai/e3-ui-components 0.0.1-beta.8 → 0.0.1-beta.9

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.
package/dist/index.cjs CHANGED
@@ -4483,13 +4483,15 @@ class ErrorBoundary extends React.Component {
4483
4483
  }
4484
4484
  const MAX_DOWNLOAD_SIZE$1 = 10 * 1024 * 1024;
4485
4485
  function useInputDataPreview(apiUrl, repo, workspace, inputInfo, requestOptions, queryOptions) {
4486
- var _a, _b, _c;
4487
- const isUpToDate = (inputInfo == null ? void 0 : inputInfo.status.type) === "up-to-date";
4488
- const hash = ((_a = inputInfo == null ? void 0 : inputInfo.hash) == null ? void 0 : _a.type) === "some" ? inputInfo.hash.value : null;
4486
+ const isUpToDate = React.useMemo(() => (inputInfo == null ? void 0 : inputInfo.status.type) === "up-to-date", [inputInfo == null ? void 0 : inputInfo.status.type]);
4487
+ const hash = React.useMemo(() => {
4488
+ var _a;
4489
+ return ((_a = inputInfo == null ? void 0 : inputInfo.hash) == null ? void 0 : _a.type) === "some" ? inputInfo.hash.value : null;
4490
+ }, [inputInfo == null ? void 0 : inputInfo.hash]);
4489
4491
  const pathParts = React.useMemo(
4490
4492
  () => {
4491
- var _a2;
4492
- return ((_a2 = inputInfo == null ? void 0 : inputInfo.path) == null ? void 0 : _a2.split(".").filter(Boolean).map((v2) => east.variant("field", v2))) ?? [];
4493
+ var _a;
4494
+ return ((_a = inputInfo == null ? void 0 : inputInfo.path) == null ? void 0 : _a.split(".").filter(Boolean).map((v2) => east.variant("field", v2))) ?? [];
4493
4495
  },
4494
4496
  [inputInfo == null ? void 0 : inputInfo.path]
4495
4497
  );
@@ -4499,8 +4501,11 @@ function useInputDataPreview(apiUrl, repo, workspace, inputInfo, requestOptions,
4499
4501
  enabled: !!workspace && !!inputInfo && isUpToDate,
4500
4502
  ...queryOptions
4501
4503
  });
4502
- const size = ((_c = (_b = status.data) == null ? void 0 : _b.size) == null ? void 0 : _c.type) === "some" ? status.data.size.value : null;
4503
- const isOversized = size !== null && size > MAX_DOWNLOAD_SIZE$1;
4504
+ const size = React.useMemo(() => {
4505
+ var _a, _b;
4506
+ return ((_b = (_a = status.data) == null ? void 0 : _a.size) == null ? void 0 : _b.type) === "some" ? status.data.size.value : null;
4507
+ }, [status.data]);
4508
+ const isOversized = React.useMemo(() => size !== null && size > MAX_DOWNLOAD_SIZE$1, [size]);
4504
4509
  const data = reactQuery.useQuery({
4505
4510
  queryKey: ["inputData", apiUrl, repo, workspace, inputInfo == null ? void 0 : inputInfo.path, hash],
4506
4511
  queryFn: () => e3ApiClient.datasetGet(apiUrl, repo, workspace, pathParts, requestOptions ?? { token: null }),
@@ -5353,14 +5358,13 @@ function VirtualizedLogViewer({ content, tabs }) {
5353
5358
  }
5354
5359
  );
5355
5360
  }
5356
- const MAX_DOWNLOAD_SIZE = 10 * 1024 * 1024;
5361
+ const MAX_DOWNLOAD_SIZE = 50 * 1024 * 1024;
5357
5362
  function useTaskOutputPreview(apiUrl, repo, workspace, task, outputHash = null, requestOptions, queryOptions) {
5358
- var _a, _b;
5359
- const isUpToDate = (task == null ? void 0 : task.status.type) === "up-to-date";
5363
+ const isUpToDate = React.useMemo(() => (task == null ? void 0 : task.status.type) === "up-to-date", [task == null ? void 0 : task.status.type]);
5360
5364
  const pathParts = React.useMemo(
5361
5365
  () => {
5362
- var _a2;
5363
- return ((_a2 = task == null ? void 0 : task.output) == null ? void 0 : _a2.split(".").map((v2) => east.variant("field", v2))) ?? [];
5366
+ var _a;
5367
+ return ((_a = task == null ? void 0 : task.output) == null ? void 0 : _a.split(".").map((v2) => east.variant("field", v2))) ?? [];
5364
5368
  },
5365
5369
  [task == null ? void 0 : task.output]
5366
5370
  );
@@ -5370,8 +5374,11 @@ function useTaskOutputPreview(apiUrl, repo, workspace, task, outputHash = null,
5370
5374
  enabled: !!workspace && !!task && isUpToDate,
5371
5375
  ...queryOptions
5372
5376
  });
5373
- const size = ((_b = (_a = status.data) == null ? void 0 : _a.size) == null ? void 0 : _b.type) === "some" ? status.data.size.value : null;
5374
- const isOversized = size !== null && size > MAX_DOWNLOAD_SIZE;
5377
+ const size = React.useMemo(() => {
5378
+ var _a, _b;
5379
+ return ((_b = (_a = status.data) == null ? void 0 : _a.size) == null ? void 0 : _b.type) === "some" ? status.data.size.value : null;
5380
+ }, [status.data]);
5381
+ const isOversized = React.useMemo(() => size !== null && size > MAX_DOWNLOAD_SIZE, [size]);
5375
5382
  const data = reactQuery.useQuery({
5376
5383
  queryKey: ["taskOutput", apiUrl, repo, workspace, task == null ? void 0 : task.name, outputHash],
5377
5384
  queryFn: () => e3ApiClient.datasetGet(apiUrl, repo, workspace, pathParts, requestOptions ?? { token: null }),