@proveanything/smartlinks-utils-ui 1.13.2 → 1.13.4

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,9 +1,9 @@
1
1
  import { assertStylesLoaded } from './chunk-OLYC54YT.js';
2
2
  import { cn } from './chunk-L7FQ52F5.js';
3
3
  import React7, { useState, useRef, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
4
- import * as SL from '@proveanything/smartlinks';
5
4
  import { createPortal } from 'react-dom';
6
- import { Filter, Search, LayoutGrid, List, X, Loader2, AlertCircle, Tag, ImageOff, Wand2, Maximize2, Clipboard, Pencil, Check, Upload, Link, MicOff, Mic, ChevronDown, ChevronRight, Sparkles, Image as Image$1, Plus, FileIcon, Film, Music, FileText, AppWindow, MoreVertical, Trash2 } from 'lucide-react';
5
+ import * as SL from '@proveanything/smartlinks';
6
+ import { Filter, Search, LayoutGrid, List, Loader2, AlertCircle, Tag, X, ImageOff, Wand2, Maximize2, Clipboard, Pencil, Check, Upload, Link, MicOff, Mic, ChevronDown, ChevronRight, Sparkles, Image as Image$1, Plus, FileIcon, Film, Music, FileText, AppWindow, MoreVertical, Trash2 } from 'lucide-react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
 
9
9
  // src/components/AssetPicker/types.ts
@@ -436,7 +436,7 @@ var CardMenu = ({ onRename, onReplace, onEditTags, onDelete, position = "absolut
436
436
  "div",
437
437
  {
438
438
  ref: menuRef,
439
- className: "fixed z-[1000] min-w-[160px] rounded-md border border-border bg-popover text-popover-foreground shadow-lg py-1",
439
+ className: "fixed z-[2147483647] min-w-[160px] rounded-md border border-border bg-popover text-popover-foreground shadow-lg py-1",
440
440
  style: pos ? { top: pos.top, left: pos.left } : { visibility: "hidden", top: 0, left: 0 },
441
441
  role: "menu",
442
442
  onClick: (e) => e.stopPropagation(),
@@ -2091,7 +2091,7 @@ var AttachToContextToggle = ({ checked, onChange, contextLabel }) => /* @__PURE_
2091
2091
  /* @__PURE__ */ jsx("span", { className: "block", children: checked ? `Asset will be tagged to ${contextLabel}.` : `Asset will be added to the collection (available everywhere). Tick to attach it to ${contextLabel} instead.` })
2092
2092
  ] })
2093
2093
  ] });
2094
- var ScopedAssetBrowser = ({ scope: _scope, accept: _accept, pageSize: _pageSize, viewMode, search, selectedIds, onToggleSelect, onDoubleClickSelect, onDelete, allowDelete, emptyText, listAppId: _listAppId, requireProductId, currentAppId, currentAppName, getAppName, assets, loading, error, refresh, remove, updateAsset, replaceFile }) => {
2094
+ var ScopedAssetBrowser = ({ scope: _scope, accept: _accept, pageSize: _pageSize, viewMode, search, selectedIds, onToggleSelect, onDoubleClickSelect, onDelete, allowDelete, emptyText, listAppId: _listAppId, currentAppId, currentAppName, getAppName, assets, loading, error, refresh, remove, updateAsset, replaceFile }) => {
2095
2095
  const replaceInputRef = React7.useRef(null);
2096
2096
  const replaceTargetRef = React7.useRef(null);
2097
2097
  const handleRename = useCallback(async (asset2) => {
@@ -2150,10 +2150,6 @@ var ScopedAssetBrowser = ({ scope: _scope, accept: _accept, pageSize: _pageSize,
2150
2150
  const filteredAssets = useMemo(() => {
2151
2151
  const q = search.trim().toLowerCase();
2152
2152
  return assets.filter((a) => {
2153
- if (requireProductId) {
2154
- const pid = a.productId || a.metadata?.productId || (a.scope?.type === "product" ? a.scope?.productId : void 0);
2155
- if (pid !== requireProductId) return false;
2156
- }
2157
2153
  if (q) {
2158
2154
  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));
2159
2155
  if (!hit) return false;
@@ -2166,7 +2162,7 @@ var ScopedAssetBrowser = ({ scope: _scope, accept: _accept, pageSize: _pageSize,
2166
2162
  }
2167
2163
  return true;
2168
2164
  });
2169
- }, [assets, search, activeLabels, requireProductId]);
2165
+ }, [assets, search, activeLabels]);
2170
2166
  if (loading && assets.length === 0) {
2171
2167
  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" }) });
2172
2168
  }
@@ -2624,7 +2620,6 @@ var AssetPickerContent = ({
2624
2620
  allowDelete,
2625
2621
  emptyText,
2626
2622
  listAppId,
2627
- requireProductId: hasProductScope && scopeTab === "product" ? productScope.productId : void 0,
2628
2623
  currentAppId: appId,
2629
2624
  currentAppName: resolvedAppName,
2630
2625
  getAppName,
@@ -2769,7 +2764,7 @@ var AssetPickerContent = ({
2769
2764
  };
2770
2765
  var PickerDialog = ({ open, onClose, maxWidth, children }) => {
2771
2766
  if (!open) return null;
2772
- return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
2767
+ const node = /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[2147483600] flex items-center justify-center", children: [
2773
2768
  /* @__PURE__ */ jsx(
2774
2769
  "div",
2775
2770
  {
@@ -2803,6 +2798,8 @@ var PickerDialog = ({ open, onClose, maxWidth, children }) => {
2803
2798
  }
2804
2799
  )
2805
2800
  ] });
2801
+ if (typeof document === "undefined") return node;
2802
+ return createPortal(node, document.body);
2806
2803
  };
2807
2804
  var AssetPicker = (props) => {
2808
2805
  const { mode = "inline", open: controlledOpen, onClose, trigger, onSelect, multiple, className, dialogMaxWidth } = props;
@@ -2836,5 +2833,5 @@ var AssetPicker = (props) => {
2836
2833
  assertStylesLoaded();
2837
2834
 
2838
2835
  export { ASSET_MIME_FILTERS, AssetPicker, useAppRegistry, useAssets };
2839
- //# sourceMappingURL=chunk-AWWWHHLL.js.map
2840
- //# sourceMappingURL=chunk-AWWWHHLL.js.map
2836
+ //# sourceMappingURL=chunk-R3B5CK2M.js.map
2837
+ //# sourceMappingURL=chunk-R3B5CK2M.js.map