@goodhood-web/nebenan-base 3.4.0-development.8 → 3.4.0-next.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.
Files changed (41) hide show
  1. package/index.d.ts +4 -3
  2. package/index.js +112 -107
  3. package/index.mjs +23237 -21404
  4. package/lib/DesktopLayoutTwoColumn/DesktopLayoutTwoColumn.d.ts +1 -1
  5. package/lib/DesktopLayoutTwoColumn/DesktopLayoutTwoColumn.types.d.ts +1 -1
  6. package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/GridFeedAggregator.types.d.ts +2 -2
  7. package/lib/Feed/Aggregators/GridFeedAggregator/components/FeedDynamicRenderer/FeedDynamicRenderer.types.d.ts +5 -0
  8. package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/components/FeedEmptyStateCard/FeedEmptyStateCard.types.d.ts +1 -1
  9. package/lib/Feed/Feed/Feed.d.ts +3 -0
  10. package/lib/Feed/Feed/Feed.types.d.ts +40 -0
  11. package/lib/Feed/Feed/utils.d.ts +26 -0
  12. package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/MarketplaceDetailPage.d.ts +1 -1
  13. package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/MarketplaceDetailPage.types.d.ts +2 -0
  14. package/lib/Feed/FeedItem/Marketplace/MarketplaceDetailPage/components/MarketplaceContent/MarketplaceContent.d.ts +3 -1
  15. package/lib/Feed/FeedItem/Post/Post.d.ts +6 -0
  16. package/lib/Gallery/Gallery.d.ts +1 -1
  17. package/lib/Gallery/Gallery.types.d.ts +3 -0
  18. package/lib/ImageAttachment/ImageAttachment.d.ts +1 -1
  19. package/lib/ImageAttachment/ImageAttachment.types.d.ts +5 -1
  20. package/lib/ImageAttachment/components/CollageImageAttachment/CollageImageAttachment.d.ts +2 -0
  21. package/lib/ImageAttachment/components/PlaceholderImageAttachment/PlaceholderImageAttachment.d.ts +7 -0
  22. package/lib/ImageAttachment/components/SwiperImageAttachment/SwiperImageAttachment.d.ts +2 -0
  23. package/lib/ImageCropper/ImageCropper.d.ts +1 -1
  24. package/lib/ImageCropper/ImageCropper.types.d.ts +1 -2
  25. package/lib/ImageCropper/util.d.ts +6 -2
  26. package/lib/utils/hooks.d.ts +3 -0
  27. package/package.json +1 -1
  28. package/style.css +1 -9
  29. package/assets/cropper.css +0 -309
  30. package/lib/Feed/GridFeed/GridFeed.d.ts +0 -3
  31. package/lib/Feed/GridFeed/GridFeed.types.d.ts +0 -33
  32. package/lib/Feed/GridFeed/GridFeedAggregator/components/FeedDynamicRenderer/FeedDynamicRenderer.types.d.ts +0 -6
  33. package/lib/Feed/GridFeed/GridFeedDynamicRenderer/GridFeedDynamicRenderer.d.ts +0 -3
  34. package/lib/Feed/GridFeed/GridFeedDynamicRenderer/GridFeedDynamicRenderer.types.d.ts +0 -4
  35. package/lib/Feed/GridFeed/utils.d.ts +0 -7
  36. package/lib/ImageCropper/hooks/useCropper.d.ts +0 -5
  37. /package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/GridFeedAggregator.d.ts +0 -0
  38. /package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/components/FeedDynamicRenderer/FeedDynamicRenderer.d.ts +0 -0
  39. /package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/components/FeedEmptyStateCard/FeedEmptyStateCard.d.ts +0 -0
  40. /package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/components/FeedEmptyStateCard/utils.d.ts +0 -0
  41. /package/lib/Feed/{GridFeed → Aggregators}/GridFeedAggregator/utils.d.ts +0 -0
@@ -1,3 +1,3 @@
1
1
  import { DesktopLayoutTwoColumnProps } from './DesktopLayoutTwoColumn.types';
2
- declare const DesktopLayoutTwoColumn: ({ banner, children, isMainFullWidth, leftAdSlot, navbar, right, rightAdSlot, enableAdSlots, }: DesktopLayoutTwoColumnProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const DesktopLayoutTwoColumn: ({ banner, children, enableAdSlots, isMainFullWidth, leftAdSlot, navbar, right, rightAdSlot, }: DesktopLayoutTwoColumnProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default DesktopLayoutTwoColumn;
@@ -3,9 +3,9 @@ export interface DesktopLayoutTwoColumnProps {
3
3
  banner?: ReactElement;
4
4
  children: ReactNode;
5
5
  enableAdSlots?: boolean;
6
+ isMainFullWidth?: boolean;
6
7
  leftAdSlot?: ReactElement;
7
8
  navbar: ReactElement;
8
9
  right?: ReactElement;
9
10
  rightAdSlot?: ReactElement;
10
- isMainFullWidth?: boolean;
11
11
  }
@@ -1,7 +1,7 @@
1
- import { GridFeedMarketplaceItem, GridFeedProps } from '../GridFeed.types';
1
+ import { GridFeedAd, GridFeedHoodMessage, GridFeedProps } from '../../Feed/Feed.types';
2
2
  export type GridFeedAggregatorProps = {
3
3
  feedType: GridFeedProps['feedType'];
4
- items: GridFeedMarketplaceItem[];
4
+ items: (GridFeedAd | GridFeedHoodMessage)[];
5
5
  };
6
6
  export declare const GridFeedAggregatorNavigateEnum: {
7
7
  readonly event: "";
@@ -0,0 +1,5 @@
1
+ import { GridFeedHoodMessage, GridFeedProps } from '../../../../Feed/Feed.types';
2
+ export interface FeedDynamicRendererProps {
3
+ feedType: GridFeedProps['feedType'];
4
+ item: GridFeedHoodMessage;
5
+ }
@@ -1,4 +1,4 @@
1
- import { GridFeedProps } from '../../../GridFeed.types';
1
+ import { GridFeedProps } from '../../../../Feed/Feed.types';
2
2
  export interface FeedEmptyStateCardProps {
3
3
  classNameButtonDesktop?: string;
4
4
  classNameButtonMobile?: string;
@@ -0,0 +1,3 @@
1
+ import { GridFeedProps } from './Feed.types';
2
+ declare const Feed: ({ ads, feedItems, feedType, viewMode, }: GridFeedProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export default Feed;
@@ -0,0 +1,40 @@
1
+ import { NewsFeedHoodMessage } from '../../../../../api/src/lib/core';
2
+ export declare const GridFeedTypeEnum: {
3
+ readonly event: "event";
4
+ readonly feed: "feed";
5
+ readonly group: "group";
6
+ readonly marketplace: "marketplace";
7
+ readonly post: "post";
8
+ };
9
+ export declare const FeedViewMode: {
10
+ readonly grid: "grid";
11
+ readonly list: "list";
12
+ };
13
+ declare const ALLOWED_POSITIONS: readonly [0, 1, 2, 3, 4, 5];
14
+ type Position = (typeof ALLOWED_POSITIONS)[number];
15
+ export interface GridFeedItem {
16
+ type: 'grid-feed-ad' | 'grid-feed-message' | 'grid-feed-aggregator';
17
+ }
18
+ export interface GridFeedAd extends GridFeedItem {
19
+ ad_type?: string;
20
+ aggregatorPosition?: Position;
21
+ block: number;
22
+ content: React.ReactNode;
23
+ id: string;
24
+ type: 'grid-feed-ad';
25
+ }
26
+ export interface GridFeedHoodMessage extends GridFeedItem {
27
+ hoodMessage: NewsFeedHoodMessage;
28
+ type: 'grid-feed-message';
29
+ }
30
+ export interface GridFeedFeedAggregator extends GridFeedItem {
31
+ items: (GridFeedHoodMessage | GridFeedAd)[];
32
+ type: 'grid-feed-aggregator';
33
+ }
34
+ export type GridFeedProps = {
35
+ ads?: GridFeedAd[];
36
+ feedItems: NewsFeedHoodMessage[];
37
+ feedType: (typeof GridFeedTypeEnum)[keyof typeof GridFeedTypeEnum];
38
+ viewMode?: (typeof FeedViewMode)[keyof typeof FeedViewMode];
39
+ };
40
+ export {};
@@ -0,0 +1,26 @@
1
+ import { NewsFeedHoodMessage } from '../../../../../api/src/lib/types/newsFeeds';
2
+ import { GridFeedAd, GridFeedHoodMessage, GridFeedItem } from './Feed.types';
3
+ type FeedItem = GridFeedHoodMessage | GridFeedAd;
4
+ /**
5
+ * Filters ads based on the number of feed items
6
+ * Only includes ads that would be visible with the current number of items
7
+ */
8
+ export declare const filterAdsByFeedLength: (ads: GridFeedAd[] | undefined, feedItemsLength: number, chunkSize?: number) => GridFeedAd[];
9
+ /**
10
+ * Splits feed items into chunks and handles ad placement.
11
+ *
12
+ * Ad placement works in two ways:
13
+ * 1. Inline ads (with aggregatorPosition):
14
+ * - block: which chunk of items (0-based)
15
+ * - aggregatorPosition: position within that chunk (0-5)
16
+ * Example: block: 1, position: 2 means "insert after 2nd item in 2nd chunk"
17
+ *
18
+ * 2. Standalone ads (without aggregatorPosition):
19
+ * - block: which chunk to appear after
20
+ * Example: block: 1 means "show after the 1st chunk"
21
+ */
22
+ export declare const splitIntoChunks: (feedItems: NewsFeedHoodMessage[], ads?: GridFeedAd[], chunkSize?: number) => GridFeedItem[];
23
+ export declare const formatCurrency: (cents: number | null) => string;
24
+ export declare const getLang: <T>(lang: Record<string, T>, selectedLang?: string) => T;
25
+ export declare const interweaveWithAds: (feedItems: NewsFeedHoodMessage[], ads?: GridFeedAd[], chunkSize?: number) => FeedItem[];
26
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { MarketplaceDetailPageProps } from './MarketplaceDetailPage.types';
2
- export declare function MarketplaceDetailPage({ ads, author, categories, embeds, interactions, isBusinessProfile, postData, profile, related, renderAdSlot, renderGallery, }: MarketplaceDetailPageProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function MarketplaceDetailPage({ ads, author, categories, embeds, handleReserve, interactions, isBusinessProfile, isReserved, postData, profile, related, renderAdSlot, renderGallery, }: MarketplaceDetailPageProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default MarketplaceDetailPage;
@@ -15,8 +15,10 @@ export interface MarketplaceDetailPageProps {
15
15
  author: NeighbourResponse | BusinessProfilesResponse;
16
16
  categories: CategoriesResponse;
17
17
  embeds?: EmbedResponse[];
18
+ handleReserve: () => void;
18
19
  interactions: InteractionResponse;
19
20
  isBusinessProfile: boolean;
21
+ isReserved: boolean;
20
22
  postData: PostResponse;
21
23
  profile: ProfileResponse;
22
24
  related: RelatedPostsResponse;
@@ -2,6 +2,8 @@ import { ReactElement } from 'react';
2
2
  import { MarketplaceBodyTypes } from '../../../MarketplaceBody/MarketplaceBody.types';
3
3
  export interface MarketplaceContentProps {
4
4
  children?: ReactElement;
5
+ handleReserve: () => void;
6
+ isReserved: boolean;
5
7
  marketplaceBodyItems: MarketplaceBodyTypes;
6
8
  }
7
- export declare const MarketplaceContent: ({ children, marketplaceBodyItems, }: MarketplaceContentProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const MarketplaceContent: ({ children, handleReserve, isReserved, marketplaceBodyItems, }: MarketplaceContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { NewsFeedHoodMessage } from '../../../../../../api/src/lib/types/newsFeeds';
2
+ interface PostProps {
3
+ hoodMessage: NewsFeedHoodMessage;
4
+ }
5
+ export declare const Post: ({ hoodMessage }: PostProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default Post;
@@ -1,3 +1,3 @@
1
1
  import { GalleryProps } from './Gallery.types';
2
- export declare const Gallery: ({ ads, footerAd, images, reserved }: GalleryProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Gallery: ({ ads, ctaSlot, footerAd, images, reserved, stickerSlot, type, }: GalleryProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default Gallery;
@@ -9,7 +9,10 @@ export type GalleryAdType = {
9
9
  };
10
10
  export type GalleryProps = {
11
11
  ads?: GalleryAdType[];
12
+ ctaSlot?: ImageAttachmentProps['ctaSlot'];
12
13
  footerAd?: GalleryAdType;
13
14
  images: ImageAttachmentProps['images'];
14
15
  reserved?: ImageAttachmentProps['reserved'];
16
+ stickerSlot?: ImageAttachmentProps['stickerSlot'];
17
+ type?: ImageAttachmentProps['type'];
15
18
  };
@@ -1,3 +1,3 @@
1
1
  import { ImageAttachmentProps } from './ImageAttachment.types';
2
- export declare const ImageAttachment: ({ activeIndex, images, onImageClick, reserved, }: ImageAttachmentProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const ImageAttachment: ({ activeIndex, ctaSlot, images, onImageClick, reserved, stickerSlot, type, }: ImageAttachmentProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ImageAttachment;
@@ -1,6 +1,10 @@
1
+ import { ReactElement } from 'react';
1
2
  export type ImageAttachmentProps = {
2
- activeIndex: number;
3
+ activeIndex?: number;
4
+ ctaSlot?: ReactElement;
3
5
  images: string[];
4
6
  onImageClick: (index: number) => void;
5
7
  reserved?: boolean;
8
+ stickerSlot?: ReactElement;
9
+ type?: 'slideshow' | 'collage';
6
10
  };
@@ -0,0 +1,2 @@
1
+ import { ImageAttachmentProps } from '../../ImageAttachment.types';
2
+ export declare const CollageImageAttachment: ({ ctaSlot, images, onImageClick, stickerSlot, }: Omit<ImageAttachmentProps, "activeIndex" | "type">) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { ImageAttachmentProps } from '../../ImageAttachment.types';
2
+ type PlaceholderImageAttachmentProps = {
3
+ ctaSlot?: ImageAttachmentProps['ctaSlot'];
4
+ type: ImageAttachmentProps['type'];
5
+ };
6
+ export declare const PlaceholderImageAttachment: ({ ctaSlot, type, }: PlaceholderImageAttachmentProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ImageAttachmentProps } from '../../ImageAttachment.types';
2
+ export declare const SwiperImageAttachment: ({ activeIndex, ctaSlot, images, onImageClick, stickerSlot, }: Omit<ImageAttachmentProps, "type">) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { ImageCropperProps } from './ImageCropper.types';
2
- declare const ImageCropper: ({ aspectRatio, imageFile, minCropHeight, minCropWidth, onClose, onCrop, translations: t, }: ImageCropperProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ImageCropper: ({ aspectRatio, imageFile, onClose, onCrop, translations: t, }: ImageCropperProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ImageCropper;
@@ -1,13 +1,12 @@
1
1
  export type ImageCropperProps = {
2
2
  aspectRatio?: number;
3
3
  imageFile?: File;
4
- minCropHeight?: number;
5
- minCropWidth?: number;
6
4
  onClose: () => void;
7
5
  onCrop: (image: File) => void;
8
6
  translations?: {
9
7
  close: string;
10
8
  crop: string;
9
+ mobileTitle: string;
11
10
  rotate: string;
12
11
  title: string;
13
12
  };
@@ -1,2 +1,6 @@
1
- export declare const cropImage: (cropper: Cropper, imgType: string, onCrop: (file: File) => void) => void;
2
- export declare const rotateImage: (cropper: Cropper, direction: "left" | "right") => void;
1
+ import { CropperRef, CropperState } from 'react-advanced-cropper';
2
+ export declare const cropImage: (cropperRef: React.RefObject<CropperRef>, imgType: string, onCrop: (file: File) => void) => void;
3
+ export declare const getDefaultSize: (state: CropperState) => {
4
+ height: number;
5
+ width: number;
6
+ };
@@ -0,0 +1,3 @@
1
+ type EventType = 'keydown' | 'keyup' | 'keypress';
2
+ declare function useKeyEvent(targetKeys: string | string[], callback: (event: KeyboardEvent) => void, eventType?: EventType): void;
3
+ export default useKeyEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "3.4.0-development.8",
3
+ "version": "3.4.0-next.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",