fansunited-frontend-core 0.0.9 → 0.0.10

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/hooks/hooks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { useImageUrl } from "./useImageUrl";
2
- export { useThemeMode } from "./useThemeMode";
3
- export { useConstantContext } from "./useConstantContext";
4
- export { useImageVariant } from "./useImageVariant";
1
+ export { useImageUrl } from './useImageUrl';
2
+ export { useThemeMode } from './useThemeMode';
3
+ export { useConstantContext } from './useConstantContext';
4
+ export { useImageVariant } from './useImageVariant';
5
5
  //# sourceMappingURL=hooks.d.ts.map
@@ -1,5 +1,6 @@
1
- import { ImagesModel } from "fansunited-sdk-esm";
2
- import { WidgetTemplate } from "../enums/enums";
1
+ import { ImagesModel } from 'fansunited-sdk-esm';
2
+ import { WidgetTemplate } from '../enums/enums';
3
+
3
4
  type ImageEntity = {
4
5
  images: ImagesModel | null;
5
6
  imagePlaceholder: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-frontend-core",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Core types, components, providers and constants for Fans United widgets",
5
5
  "main": "index.es.js",
6
6
  "types": "index.d.ts",
package/hooks/hooks.js DELETED
@@ -1,5 +0,0 @@
1
- export { useImageUrl } from "./useImageUrl";
2
- export { useThemeMode } from "./useThemeMode";
3
- export { useConstantContext } from "./useConstantContext";
4
- export { useImageVariant } from "./useImageVariant";
5
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,16 +0,0 @@
1
- import { isMobile } from "../functions/theme";
2
- /**
3
- * Custom hook to determine the appropriate image URL based on position and device type
4
- * @param images The images model containing various image URLs
5
- * @param imagePosition The desired position for the image
6
- * @returns The appropriate image URL or null
7
- */
8
- export const useImageUrl = (images) => {
9
- if (!images)
10
- return null;
11
- if (isMobile() && images.mobile) {
12
- return images.mobile || images.main || null;
13
- }
14
- return images.main || null;
15
- };
16
- //# sourceMappingURL=useImageUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useImageUrl.js","sourceRoot":"","sources":["../../src/hooks/useImageUrl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,MAA2C,EAC5B,EAAE;IACjB,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,IAAI,QAAQ,EAAE,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;AAC7B,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { WidgetTemplate } from "../enums/enums";
2
- import { useImageUrl } from "./useImageUrl";
3
- export const useImageVariant = (entity, variant) => {
4
- let image = null;
5
- if (variant !== WidgetTemplate.OVERLAY) {
6
- image = useImageUrl(entity.images);
7
- }
8
- else {
9
- image = entity.images?.cover || "";
10
- }
11
- if (!image) {
12
- image = entity.imagePlaceholder;
13
- }
14
- return image;
15
- };
16
- //# sourceMappingURL=useImageVariant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useImageVariant.js","sourceRoot":"","sources":["../../src/hooks/useImageVariant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO5C,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAAmB,EACnB,OAAuB,EACvB,EAAE;IACF,IAAI,KAAK,GAAkB,IAAI,CAAC;IAEhC,IAAI,OAAO,KAAK,cAAc,CAAC,OAAO,EAAE,CAAC;QACvC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAClC,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}