@sparkstudio/storage-ui 1.0.29 → 1.0.30

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
@@ -777,7 +777,8 @@ function ContainerIdGridPanel(props) {
777
777
  icon,
778
778
  iconHtml,
779
779
  deleteDisabled,
780
- className
780
+ className,
781
+ onDeleted
781
782
  } = props;
782
783
  const sdkDb = (0, import_react5.useMemo)(
783
784
  () => new SparkStudioStorageSDK(containerApiBaseUrl),
@@ -891,6 +892,7 @@ function ContainerIdGridPanel(props) {
891
892
  const prev = idsRef.current ?? [];
892
893
  onContainerIdsChange(prev.filter((id) => id !== file.Id));
893
894
  setFiles((prevFiles) => prevFiles.filter((x) => x.Id !== file.Id));
895
+ onDeleted?.(file);
894
896
  };
895
897
  const openPicker = () => {
896
898
  const input = document.createElement("input");
@@ -1981,6 +1983,13 @@ function HomeContent() {
1981
1983
  onSelect: (file) => {
1982
1984
  setSelectedId(file.Id);
1983
1985
  setSelectedFile(file);
1986
+ },
1987
+ onDeleted: (file) => {
1988
+ console.log("Deleted:", file);
1989
+ if (selectedId === file.Id) {
1990
+ setSelectedId(void 0);
1991
+ setSelectedFile(null);
1992
+ }
1984
1993
  }
1985
1994
  }
1986
1995
  ),
package/dist/index.d.cts CHANGED
@@ -127,6 +127,7 @@ type Props = {
127
127
  iconHtml?: string;
128
128
  deleteDisabled?: boolean;
129
129
  className?: string;
130
+ onDeleted?: (file: ContainerDTO) => void;
130
131
  };
131
132
  declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
132
133
 
package/dist/index.d.ts CHANGED
@@ -127,6 +127,7 @@ type Props = {
127
127
  iconHtml?: string;
128
128
  deleteDisabled?: boolean;
129
129
  className?: string;
130
+ onDeleted?: (file: ContainerDTO) => void;
130
131
  };
131
132
  declare function ContainerIdGridPanel(props: Props): react_jsx_runtime.JSX.Element;
132
133
 
package/dist/index.js CHANGED
@@ -730,7 +730,8 @@ function ContainerIdGridPanel(props) {
730
730
  icon,
731
731
  iconHtml,
732
732
  deleteDisabled,
733
- className
733
+ className,
734
+ onDeleted
734
735
  } = props;
735
736
  const sdkDb = useMemo2(
736
737
  () => new SparkStudioStorageSDK(containerApiBaseUrl),
@@ -844,6 +845,7 @@ function ContainerIdGridPanel(props) {
844
845
  const prev = idsRef.current ?? [];
845
846
  onContainerIdsChange(prev.filter((id) => id !== file.Id));
846
847
  setFiles((prevFiles) => prevFiles.filter((x) => x.Id !== file.Id));
848
+ onDeleted?.(file);
847
849
  };
848
850
  const openPicker = () => {
849
851
  const input = document.createElement("input");
@@ -1955,6 +1957,13 @@ function HomeContent() {
1955
1957
  onSelect: (file) => {
1956
1958
  setSelectedId(file.Id);
1957
1959
  setSelectedFile(file);
1960
+ },
1961
+ onDeleted: (file) => {
1962
+ console.log("Deleted:", file);
1963
+ if (selectedId === file.Id) {
1964
+ setSelectedId(void 0);
1965
+ setSelectedFile(null);
1966
+ }
1958
1967
  }
1959
1968
  }
1960
1969
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkstudio/storage-ui",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",