@meaple-com/react-headless-components 1.0.1 → 1.0.3

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
@@ -285,10 +285,10 @@ var ListEventProducts = ({
285
285
 
286
286
  // src/components/ListEvents.tsx
287
287
  var import_react_query5 = require("@meaple-com/react-query");
288
- var ListEvents = ({ children, channelId, options }) => {
289
- const { data, isPending, error } = (0, import_react_query5.useChannelEvents)({ channelId }, options);
288
+ var ListEvents = ({ children, params, options }) => {
289
+ const { data, isPending, error } = (0, import_react_query5.useEvents)(params, options);
290
290
  return children({
291
- events: data ?? [],
291
+ events: data?.events ?? [],
292
292
  isPending,
293
293
  error
294
294
  });
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import * as _meaple_com_types from '@meaple-com/types';
3
- import { TicketProps, GroupProps as GroupProps$1, CouponProps, GetOrderProps as GetOrderProps$1, CategoryProps, EventProps, UserTicketProps, UserOrderProps } from '@meaple-com/types';
3
+ import { TicketProps, GroupProps as GroupProps$1, CouponProps, GetOrderProps as GetOrderProps$1, CategoryProps, EventProps, FindEventsParams, UserTicketProps, UserOrderProps } from '@meaple-com/types';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { useCheckCoupon, useOrder, useCategories, useEventProducts, useChannelEvents, useEventTickets, useUserEvents, useUserEventTickets, useUserOrders } from '@meaple-com/react-query';
5
+ import { useCheckCoupon, useOrder, useCategories, useEventProducts, useEvents, useEventTickets, useUserEvents, useUserEventTickets, useUserOrders } from '@meaple-com/react-query';
6
6
 
7
7
  type ItemProps$1 = Pick<TicketProps, 'id' | 'name' | 'price' | 'amount' | 'type'> & {
8
8
  group?: Pick<GroupProps$1, 'name'>;
@@ -28,8 +28,6 @@ type CartProps = {
28
28
  clearCart: () => void;
29
29
  items: ItemProps$1[];
30
30
  }) => ReactNode;
31
- eventId?: string;
32
- channelId?: string;
33
31
  feeType?: 'POS' | 'DIGITAL';
34
32
  platformFee?: PlatformFeeData;
35
33
  };
@@ -135,10 +133,10 @@ type ListEventsProps = {
135
133
  isPending: boolean;
136
134
  error: Error | null;
137
135
  }) => ReactNode;
138
- channelId: string;
139
- options?: Parameters<typeof useChannelEvents>[1];
136
+ params?: FindEventsParams;
137
+ options?: Parameters<typeof useEvents>[1];
140
138
  };
141
- declare const ListEvents: ({ children, channelId, options }: ListEventsProps) => ReactNode;
139
+ declare const ListEvents: ({ children, params, options }: ListEventsProps) => ReactNode;
142
140
 
143
141
  type GroupProps = GroupProps$1 & {
144
142
  maxBuyAmount?: number;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import * as _meaple_com_types from '@meaple-com/types';
3
- import { TicketProps, GroupProps as GroupProps$1, CouponProps, GetOrderProps as GetOrderProps$1, CategoryProps, EventProps, UserTicketProps, UserOrderProps } from '@meaple-com/types';
3
+ import { TicketProps, GroupProps as GroupProps$1, CouponProps, GetOrderProps as GetOrderProps$1, CategoryProps, EventProps, FindEventsParams, UserTicketProps, UserOrderProps } from '@meaple-com/types';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { useCheckCoupon, useOrder, useCategories, useEventProducts, useChannelEvents, useEventTickets, useUserEvents, useUserEventTickets, useUserOrders } from '@meaple-com/react-query';
5
+ import { useCheckCoupon, useOrder, useCategories, useEventProducts, useEvents, useEventTickets, useUserEvents, useUserEventTickets, useUserOrders } from '@meaple-com/react-query';
6
6
 
7
7
  type ItemProps$1 = Pick<TicketProps, 'id' | 'name' | 'price' | 'amount' | 'type'> & {
8
8
  group?: Pick<GroupProps$1, 'name'>;
@@ -28,8 +28,6 @@ type CartProps = {
28
28
  clearCart: () => void;
29
29
  items: ItemProps$1[];
30
30
  }) => ReactNode;
31
- eventId?: string;
32
- channelId?: string;
33
31
  feeType?: 'POS' | 'DIGITAL';
34
32
  platformFee?: PlatformFeeData;
35
33
  };
@@ -135,10 +133,10 @@ type ListEventsProps = {
135
133
  isPending: boolean;
136
134
  error: Error | null;
137
135
  }) => ReactNode;
138
- channelId: string;
139
- options?: Parameters<typeof useChannelEvents>[1];
136
+ params?: FindEventsParams;
137
+ options?: Parameters<typeof useEvents>[1];
140
138
  };
141
- declare const ListEvents: ({ children, channelId, options }: ListEventsProps) => ReactNode;
139
+ declare const ListEvents: ({ children, params, options }: ListEventsProps) => ReactNode;
142
140
 
143
141
  type GroupProps = GroupProps$1 & {
144
142
  maxBuyAmount?: number;
package/dist/index.js CHANGED
@@ -250,11 +250,11 @@ var ListEventProducts = ({
250
250
  };
251
251
 
252
252
  // src/components/ListEvents.tsx
253
- import { useChannelEvents } from "@meaple-com/react-query";
254
- var ListEvents = ({ children, channelId, options }) => {
255
- const { data, isPending, error } = useChannelEvents({ channelId }, options);
253
+ import { useEvents } from "@meaple-com/react-query";
254
+ var ListEvents = ({ children, params, options }) => {
255
+ const { data, isPending, error } = useEvents(params, options);
256
256
  return children({
257
- events: data ?? [],
257
+ events: data?.events ?? [],
258
258
  isPending,
259
259
  error
260
260
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meaple-com/react-headless-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Headless React components for Meaple SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,11 +28,11 @@
28
28
  "clean": "rimraf dist"
29
29
  },
30
30
  "dependencies": {
31
- "@meaple-com/types": "^1.0.1"
31
+ "@meaple-com/types": "^1.0.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@eslint/js": "^9.36.0",
35
- "@meaple-com/react-query": "^1.0.1",
35
+ "@meaple-com/react-query": "^1.0.3",
36
36
  "@types/react": "^19.0.0",
37
37
  "@typescript-eslint/eslint-plugin": "^7.18.0",
38
38
  "@typescript-eslint/parser": "^7.18.0",
@@ -44,7 +44,7 @@
44
44
  "rimraf": "^5.0.5"
45
45
  },
46
46
  "peerDependencies": {
47
- "@meaple-com/react-query": "^1.0.1",
47
+ "@meaple-com/react-query": "^1.0.3",
48
48
  "react": "^19.0.0"
49
49
  },
50
50
  "files": [