@antscorp/antsomi-ui 1.3.5-beta.169 → 1.3.5-beta.171

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.
@@ -7,7 +7,7 @@ export const BigImage = React.memo(props => {
7
7
  const currentTime = useMemo(() => new Date(), []);
8
8
  const timeGenerated = Math.floor(currentTime.getTime() / 1000 - (currentTime.getTime() % 3)) * 1000;
9
9
  const urlNoCache = url
10
- ? url.includes('nocache')
10
+ ? url.includes('nocache') || url.startsWith('data:image')
11
11
  ? url
12
12
  : `${url}?nocache=${timeGenerated}`
13
13
  : undefined;
@@ -5,7 +5,7 @@ export const SmallImage = React.memo(props => {
5
5
  const currentTime = useMemo(() => new Date(), []);
6
6
  const timeGenerated = Math.floor(currentTime.getTime() / 1000 - (currentTime.getTime() % 3)) * 1000;
7
7
  const urlNoCache = url
8
- ? url.includes('nocache')
8
+ ? url.includes('nocache') || url.startsWith('data:image')
9
9
  ? url
10
10
  : `${url}?nocache=${timeGenerated}`
11
11
  : undefined;
@@ -34,6 +34,8 @@ export const ThumbnailCard = memo(props => {
34
34
  const _a = removeModalProps || {}, { onOk } = _a, restOfRemoveTemplateModalProps = __rest(_a, ["onOk"]);
35
35
  const _b = editBtnProps || {}, { text: editText = 'Edit thumbnail', onClick: onClickEdit } = _b, restOfEditBtnProps = __rest(_b, ["text", "onClick"]);
36
36
  const _c = previewBtnProps || {}, { text: previewText = 'Preview', onClick: onClickPreview } = _c, restOfPreviewBtnProps = __rest(_c, ["text", "onClick"]);
37
+ // Memo
38
+ const showSkeletonMemo = typeof showSkeleton === 'function' ? showSkeleton(props) : showSkeleton;
37
39
  // Handlers
38
40
  const handleRemoveThumbnail = e => {
39
41
  e.stopPropagation();
@@ -49,7 +51,7 @@ export const ThumbnailCard = memo(props => {
49
51
  onClickWrapper === null || onClickWrapper === void 0 ? void 0 : onClickWrapper(id);
50
52
  };
51
53
  return (React.createElement(Flex, Object.assign({ gap: 10, vertical: true }, restOfProps, { style: Object.assign({ width }, restOfProps.style) }),
52
- React.createElement(ThumbnailCardWrapper, { "$showSkeleton": showSkeleton, style: { height, cursor: actionAvailable ? 'default' : 'pointer' }, onClick: handleWrapperClick },
54
+ React.createElement(ThumbnailCardWrapper, { "$showSkeleton": showSkeletonMemo, style: { height, cursor: actionAvailable ? 'default' : 'pointer' }, onClick: handleWrapperClick },
53
55
  React.createElement("div", { className: "screen" }, thumbnail && React.createElement("img", { src: thumbnail, alt: "" })),
54
56
  actionAvailable && !loading && (React.createElement(React.Fragment, null,
55
57
  React.createElement(Flex, { className: "center-action", align: "center", gap: 10, vertical: true },
@@ -15,7 +15,7 @@ export interface ThumbnailCardProps extends Omit<HTMLAttributes<HTMLDivElement>,
15
15
  height?: number;
16
16
  thumbnail?: string;
17
17
  removable?: boolean;
18
- showSkeleton?: boolean;
18
+ showSkeleton?: boolean | ((thumbnailCard: Omit<ThumbnailCardProps, 'showSkeleton' | ''>) => boolean);
19
19
  loading?: boolean;
20
20
  editBtnProps?: TThumbnailButton;
21
21
  previewBtnProps?: TThumbnailButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.5-beta.169",
3
+ "version": "1.3.5-beta.171",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",