@pitcher/canvas-ui 2026.1.15-142258-beta → 2026.1.15-144700-beta

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/canvas-ui.js CHANGED
@@ -109730,16 +109730,18 @@ const _sfc_main$4U = /* @__PURE__ */ defineComponent({
109730
109730
 
109731
109731
  function filterByItemVisibility(items) {
109732
109732
  const isAdmin = state$3.appName.value === "admin";
109733
+ const isSearchMode = state$3.showFilteredResults.value;
109733
109734
  return items.reduce((acc, item) => {
109734
109735
  const hasCountData = "files_count" in item || "folders_count" in item || "available_files_count" in item || "available_folders_count" in item;
109735
109736
  const filesCount = item.available_files_count ?? item.files_count ?? 0;
109736
109737
  const foldersCount = item.available_folders_count ?? item.folders_count ?? 0;
109737
109738
  const isFolderEmpty = item.type == "folder" && hasCountData && filesCount === 0 && foldersCount === 0;
109739
+ const isFolderWithoutData = item.type == "folder" && !hasCountData && isSearchMode;
109738
109740
  const shouldHideItem = item.name?.startsWith(".") || isFolderEmpty || item.folder?.file_thumbnail_urls?.length === 0;
109739
109741
  if (!shouldHideItem && !isAdmin || isAdmin) {
109740
109742
  acc.push({
109741
109743
  ...item,
109742
- opacity: shouldHideItem && isAdmin ? 0.5 : 1
109744
+ opacity: isFolderWithoutData || shouldHideItem && isAdmin ? 0.5 : 1
109743
109745
  });
109744
109746
  }
109745
109747
  return acc;
@@ -110331,6 +110333,13 @@ function init({
110331
110333
  canvas_thumbnail_urls: []
110332
110334
  }
110333
110335
  ];
110336
+ state$2.folderCache[folder.id] = {
110337
+ files_count: 0,
110338
+ folders_count: 0,
110339
+ available_files_count: 0,
110340
+ available_folders_count: 0,
110341
+ timestamp: Date.now()
110342
+ };
110334
110343
  return folder;
110335
110344
  };
110336
110345
  state$2.folderUpdater = async function(payload) {
@@ -110354,6 +110363,7 @@ function init({
110354
110363
  state$2.folderDeleter = async function(payload) {
110355
110364
  await onFolderDelete(payload);
110356
110365
  state$2.folders = state$2.folders.filter((folder) => folder.id !== payload);
110366
+ delete state$2.folderCache[payload];
110357
110367
  useAppStore$4().removeSelectedItems([payload]);
110358
110368
  };
110359
110369
  state$2.folderFetcher = async function(folderId) {
@@ -110374,6 +110384,9 @@ function init({
110374
110384
  const response = await onFoldersDelete(payload);
110375
110385
  const deletedIdsSet = new Set(response.deleted_ids);
110376
110386
  state$2.folders = state$2.folders.filter((folder) => !deletedIdsSet.has(folder.id));
110387
+ response.deleted_ids.forEach((id2) => {
110388
+ delete state$2.folderCache[id2];
110389
+ });
110377
110390
  useAppStore$4().removeSelectedItems(response.deleted_ids);
110378
110391
  return response;
110379
110392
  };