@pushwoosh/smart-components-kit 1.2.6 → 1.3.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.
@@ -270,12 +270,12 @@ export const MediaStorage = ({
270
270
  menuPlacement: "bottom-start",
271
271
  children: _jsxs(DropdownMenuSection, {
272
272
  children: [_jsx(DropdownMenuItem, {
273
- onClick: () => onSelect(file.url),
273
+ onClick: () => onSelect(file),
274
274
  children: lang({
275
275
  message: 'SMART.MEDIA_STORAGE.SELECT_ORIGINAL'
276
276
  })
277
277
  }), crops.map(crop => _jsx(DropdownMenuItem, {
278
- onClick: () => onSelect(crop.url),
278
+ onClick: () => onSelect(crop),
279
279
  children: getCropCaption(crop)
280
280
  }, crop.uuid))]
281
281
  })
@@ -288,7 +288,7 @@ export const MediaStorage = ({
288
288
  "aria-label": lang({
289
289
  message: 'SMART.MEDIA_STORAGE.SELECT_HINT'
290
290
  }),
291
- onClick: () => onSelect(file.url)
291
+ onClick: () => onSelect(file)
292
292
  }), _jsx(Button, {
293
293
  color: "secondary",
294
294
  size: "compact",
@@ -1,3 +1,4 @@
1
+ import type { MediaFile } from '@pushwoosh/rpc-v2-http-api-data/media_files';
1
2
  export type MediaStorageProps = {
2
3
  /** Application code whose media files are listed. */
3
4
  application: string;
@@ -7,8 +8,9 @@ export type MediaStorageProps = {
7
8
  perPage: number;
8
9
  /** Called when the user requests a different page. */
9
10
  onPageChange: (page: number) => void;
10
- /** Called with the chosen file URL (original or crop). */
11
- onSelect: (url: string) => void;
11
+ /** Called with the chosen file (original or crop) — `url` is the picked
12
+ * asset, `uuid` its gallery id. */
13
+ onSelect: (file: MediaFile) => void;
12
14
  };
13
15
  export type MediaStoragePaginatedProps = {
14
16
  /** Application code whose media files are listed. */
@@ -17,6 +19,7 @@ export type MediaStoragePaginatedProps = {
17
19
  initialPage?: number;
18
20
  /** Page size. Defaults to 30. */
19
21
  perPage?: number;
20
- /** Called with the chosen file URL (original or crop). */
21
- onSelect: (url: string) => void;
22
+ /** Called with the chosen file (original or crop) — `url` is the picked
23
+ * asset, `uuid` its gallery id. */
24
+ onSelect: (file: MediaFile) => void;
22
25
  };
package/package.json CHANGED
@@ -48,5 +48,5 @@
48
48
  "react": "^16.14.0 || ^18.0.0",
49
49
  "react-dom": "^16.14.0 || ^18.0.0"
50
50
  },
51
- "version": "1.2.6"
51
+ "version": "1.3.1"
52
52
  }