@proveanything/smartlinks-utils-ui 1.13.0 → 1.13.1

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.
@@ -2025,7 +2025,7 @@ var GlobalUploadToggle = ({ checked, onChange, appName }) => /* @__PURE__ */ jsx
2025
2025
  /* @__PURE__ */ jsx("span", { className: "block", children: checked ? `Asset will be available to every app in this collection.` : `Asset will be tagged to ${appName}. Tick to share with every app in the collection instead.` })
2026
2026
  ] })
2027
2027
  ] });
2028
- var ScopedAssetBrowser = ({ scope, accept, pageSize, viewMode, search, selectedIds, onToggleSelect, onDoubleClickSelect, onDelete, allowDelete, emptyText, listAppId, currentAppId, currentAppName, getAppName }) => {
2028
+ var ScopedAssetBrowser = ({ scope, accept, pageSize, viewMode, search, selectedIds, onToggleSelect, onDoubleClickSelect, onDelete, allowDelete, emptyText, listAppId, requireProductId, currentAppId, currentAppName, getAppName }) => {
2029
2029
  const { assets, loading, error, refresh, remove, updateAsset, replaceFile } = useAssets({ scope, accept, pageSize, listAppId });
2030
2030
  const replaceInputRef = React7.useRef(null);
2031
2031
  const replaceTargetRef = React7.useRef(null);
@@ -2085,6 +2085,10 @@ var ScopedAssetBrowser = ({ scope, accept, pageSize, viewMode, search, selectedI
2085
2085
  const filteredAssets = useMemo(() => {
2086
2086
  const q = search.trim().toLowerCase();
2087
2087
  return assets.filter((a) => {
2088
+ if (requireProductId) {
2089
+ const pid = a.productId || a.metadata?.productId || (a.scope?.type === "product" ? a.scope?.productId : void 0);
2090
+ if (pid !== requireProductId) return false;
2091
+ }
2088
2092
  if (q) {
2089
2093
  const hit = (a.name || "").toLowerCase().includes(q) || (a.cleanName || "").toLowerCase().includes(q) || (a.mimeType || "").toLowerCase().includes(q) || (a.labels || []).some((l) => l.toLowerCase().includes(q));
2090
2094
  if (!hit) return false;
@@ -2097,7 +2101,7 @@ var ScopedAssetBrowser = ({ scope, accept, pageSize, viewMode, search, selectedI
2097
2101
  }
2098
2102
  return true;
2099
2103
  });
2100
- }, [assets, search, activeLabels]);
2104
+ }, [assets, search, activeLabels, requireProductId]);
2101
2105
  if (loading && assets.length === 0) {
2102
2106
  return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx(Loader2, { className: "w-6 h-6 text-muted-foreground animate-spin" }) });
2103
2107
  }
@@ -2158,9 +2162,9 @@ var ScopedAssetBrowser = ({ scope, accept, pageSize, viewMode, search, selectedI
2158
2162
  onToggleSelect,
2159
2163
  onDoubleClickSelect,
2160
2164
  onDelete: allowDelete ? handleDeleteWithConfirm : void 0,
2161
- onRename: allowDelete ? handleRename : void 0,
2162
- onReplace: allowDelete ? handleReplace : void 0,
2163
- onEditTags: allowDelete ? handleEditTags : void 0,
2165
+ onRename: handleRename,
2166
+ onReplace: handleReplace,
2167
+ onEditTags: handleEditTags,
2164
2168
  allowDelete,
2165
2169
  currentAppId,
2166
2170
  currentAppName,
@@ -2501,6 +2505,7 @@ var AssetPickerContent = ({
2501
2505
  allowDelete,
2502
2506
  emptyText,
2503
2507
  listAppId,
2508
+ requireProductId: hasProductScope && scopeTab === "product" ? productScope.productId : void 0,
2504
2509
  currentAppId: appId,
2505
2510
  currentAppName: resolvedAppName,
2506
2511
  getAppName
@@ -2673,5 +2678,5 @@ var AssetPicker = (props) => {
2673
2678
  assertStylesLoaded();
2674
2679
 
2675
2680
  export { ASSET_MIME_FILTERS, AssetPicker, useAppRegistry, useAssets };
2676
- //# sourceMappingURL=chunk-PSVYUVZC.js.map
2677
- //# sourceMappingURL=chunk-PSVYUVZC.js.map
2681
+ //# sourceMappingURL=chunk-HKL24TFC.js.map
2682
+ //# sourceMappingURL=chunk-HKL24TFC.js.map