@wix/headless-bookings 0.0.59 → 0.0.60

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.
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type ServiceServiceConfig } from '../../../services/service/service.js';
7
- import type { Service, Payment, BookingPolicy, Schedule } from '@wix/auto_sdk_bookings_services';
7
+ import type { Service, Payment, BookingPolicy, Schedule, StaffMember } from '@wix/auto_sdk_bookings_services';
8
8
  import type { MoneyData } from '@wix/headless-components/react';
9
9
  /**
10
10
  * Props for Service.Root component
@@ -56,10 +56,7 @@ export interface InfoProps {
56
56
  _id?: string;
57
57
  };
58
58
  locations?: Array<NonNullable<Service['locations']>[number]>;
59
- staff?: Array<{
60
- name?: string;
61
- _id?: string;
62
- }>;
59
+ staff?: StaffMember[];
63
60
  media?: Array<{
64
61
  url?: string;
65
62
  _id?: string;
@@ -92,10 +92,7 @@ export function Info(props) {
92
92
  const duration = service.schedule?.availabilityConstraints?.sessionDurations?.[0];
93
93
  // Get staff members from staffMemberDetails.staffMembers
94
94
  // (available when using conditionalFields: ['STAFF_MEMBER_DETAILS'] in queryServices)
95
- const staff = service.staffMembers?.map((member) => ({
96
- _id: member.staffMemberId,
97
- name: member.name || undefined,
98
- })) || [];
95
+ const staff = service.staffMembers || [];
99
96
  // Convert mainMedia to WixMediaImage format
100
97
  // Handle both snake_case (main_media) and camelCase (mainMedia) from API
101
98
  // Handle both string and object formats for image
@@ -9,13 +9,6 @@ import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-compon
9
9
  import { type AsChildChildren } from '@wix/headless-utils/react';
10
10
  import type { StaffMemberListServiceConfig } from '../../services/staff-member-list/staff-member-list.js';
11
11
  import type { StaffMemberData } from '../../services/staff-member-list/staff-member-list.def.js';
12
- /**
13
- * Staff member with id for list rendering
14
- * Uses staffMemberId as the id (which equals resource id)
15
- */
16
- interface StaffMemberWithId extends StaffMemberData {
17
- id: string;
18
- }
19
12
  /**
20
13
  * Props for the StaffMemberList root component
21
14
  */
@@ -73,7 +66,7 @@ export declare const StaffMembers: React.ForwardRefExoticComponent<StaffMembersP
73
66
  /**
74
67
  * Props for StaffMemberList.StaffMemberRepeater component
75
68
  */
76
- export type StaffMemberRepeaterProps = GenericListRepeaterProps<StaffMemberWithId>;
69
+ export type StaffMemberRepeaterProps = GenericListRepeaterProps<StaffMemberData>;
77
70
  export declare const StaffMemberRepeater: React.ForwardRefExoticComponent<StaffMemberRepeaterProps & React.RefAttributes<HTMLElement>>;
78
71
  /**
79
72
  * Props for StaffMemberList.Totals component
@@ -120,4 +113,3 @@ export interface ClearProps {
120
113
  export declare const Actions: {
121
114
  Clear: React.ForwardRefExoticComponent<ClearProps & React.RefAttributes<HTMLButtonElement>>;
122
115
  };
123
- export {};
@@ -59,10 +59,9 @@ Root.displayName = 'StaffMemberList.Root';
59
59
  const RootContent = React.forwardRef((props, ref) => {
60
60
  const { children, className, variant } = props;
61
61
  return (_jsx(CoreStaffMemberList.StaffMembers, { children: ({ staffMembers, isLoading }) => {
62
- // Add id to each staff member for GenericList (staffMemberId equals resource id)
63
- const itemsWithId = staffMembers.map((staffMember, index) => ({
62
+ const itemsWithId = staffMembers.map((staffMember) => ({
64
63
  ...staffMember,
65
- id: staffMember.staffMemberId || String(index),
64
+ id: staffMember.staffMemberId,
66
65
  }));
67
66
  return (_jsx(GenericList.Root, { items: itemsWithId, hasMore: false, isLoading: isLoading, className: className, ref: ref, "data-testid": TestIds.staffMemberListRoot, variant: variant, children: children }));
68
67
  } }));
@@ -90,8 +89,8 @@ StaffMembers.displayName = 'StaffMemberList.StaffMembers';
90
89
  export const StaffMemberRepeater = React.forwardRef((props, ref) => {
91
90
  const { children } = props;
92
91
  // Custom itemWrapper that wraps each item in StaffMember.Root
93
- const staffMemberItemWrapper = ({ item: staffMemberWithId, children: itemChildren, }) => {
94
- return (_jsx(StaffMember.Root, { staffMember: staffMemberWithId, "data-testid": TestIds.staffMemberListStaffMember, "data-staff-member-id": staffMemberWithId.id, "data-item-id": staffMemberWithId.id, children: itemChildren }, staffMemberWithId.id));
92
+ const staffMemberItemWrapper = ({ item: staffMember, children: itemChildren, }) => {
93
+ return (_jsx(StaffMember.Root, { staffMember: staffMember, "data-testid": TestIds.staffMemberListStaffMember, "data-staff-member-id": staffMember.staffMemberId, "data-item-id": staffMember.staffMemberId, children: itemChildren }, staffMember.staffMemberId));
95
94
  };
96
95
  return (_jsx(GenericList.Repeater, { ref: ref, itemWrapper: staffMemberItemWrapper, children: children }));
97
96
  });
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type ServiceServiceConfig } from '../../../services/service/service.js';
7
- import type { Service, Payment, BookingPolicy, Schedule } from '@wix/auto_sdk_bookings_services';
7
+ import type { Service, Payment, BookingPolicy, Schedule, StaffMember } from '@wix/auto_sdk_bookings_services';
8
8
  import type { MoneyData } from '@wix/headless-components/react';
9
9
  /**
10
10
  * Props for Service.Root component
@@ -56,10 +56,7 @@ export interface InfoProps {
56
56
  _id?: string;
57
57
  };
58
58
  locations?: Array<NonNullable<Service['locations']>[number]>;
59
- staff?: Array<{
60
- name?: string;
61
- _id?: string;
62
- }>;
59
+ staff?: StaffMember[];
63
60
  media?: Array<{
64
61
  url?: string;
65
62
  _id?: string;
@@ -92,10 +92,7 @@ export function Info(props) {
92
92
  const duration = service.schedule?.availabilityConstraints?.sessionDurations?.[0];
93
93
  // Get staff members from staffMemberDetails.staffMembers
94
94
  // (available when using conditionalFields: ['STAFF_MEMBER_DETAILS'] in queryServices)
95
- const staff = service.staffMembers?.map((member) => ({
96
- _id: member.staffMemberId,
97
- name: member.name || undefined,
98
- })) || [];
95
+ const staff = service.staffMembers || [];
99
96
  // Convert mainMedia to WixMediaImage format
100
97
  // Handle both snake_case (main_media) and camelCase (mainMedia) from API
101
98
  // Handle both string and object formats for image
@@ -9,13 +9,6 @@ import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-compon
9
9
  import { type AsChildChildren } from '@wix/headless-utils/react';
10
10
  import type { StaffMemberListServiceConfig } from '../../services/staff-member-list/staff-member-list.js';
11
11
  import type { StaffMemberData } from '../../services/staff-member-list/staff-member-list.def.js';
12
- /**
13
- * Staff member with id for list rendering
14
- * Uses staffMemberId as the id (which equals resource id)
15
- */
16
- interface StaffMemberWithId extends StaffMemberData {
17
- id: string;
18
- }
19
12
  /**
20
13
  * Props for the StaffMemberList root component
21
14
  */
@@ -73,7 +66,7 @@ export declare const StaffMembers: React.ForwardRefExoticComponent<StaffMembersP
73
66
  /**
74
67
  * Props for StaffMemberList.StaffMemberRepeater component
75
68
  */
76
- export type StaffMemberRepeaterProps = GenericListRepeaterProps<StaffMemberWithId>;
69
+ export type StaffMemberRepeaterProps = GenericListRepeaterProps<StaffMemberData>;
77
70
  export declare const StaffMemberRepeater: React.ForwardRefExoticComponent<StaffMemberRepeaterProps & React.RefAttributes<HTMLElement>>;
78
71
  /**
79
72
  * Props for StaffMemberList.Totals component
@@ -120,4 +113,3 @@ export interface ClearProps {
120
113
  export declare const Actions: {
121
114
  Clear: React.ForwardRefExoticComponent<ClearProps & React.RefAttributes<HTMLButtonElement>>;
122
115
  };
123
- export {};
@@ -59,10 +59,9 @@ Root.displayName = 'StaffMemberList.Root';
59
59
  const RootContent = React.forwardRef((props, ref) => {
60
60
  const { children, className, variant } = props;
61
61
  return (_jsx(CoreStaffMemberList.StaffMembers, { children: ({ staffMembers, isLoading }) => {
62
- // Add id to each staff member for GenericList (staffMemberId equals resource id)
63
- const itemsWithId = staffMembers.map((staffMember, index) => ({
62
+ const itemsWithId = staffMembers.map((staffMember) => ({
64
63
  ...staffMember,
65
- id: staffMember.staffMemberId || String(index),
64
+ id: staffMember.staffMemberId,
66
65
  }));
67
66
  return (_jsx(GenericList.Root, { items: itemsWithId, hasMore: false, isLoading: isLoading, className: className, ref: ref, "data-testid": TestIds.staffMemberListRoot, variant: variant, children: children }));
68
67
  } }));
@@ -90,8 +89,8 @@ StaffMembers.displayName = 'StaffMemberList.StaffMembers';
90
89
  export const StaffMemberRepeater = React.forwardRef((props, ref) => {
91
90
  const { children } = props;
92
91
  // Custom itemWrapper that wraps each item in StaffMember.Root
93
- const staffMemberItemWrapper = ({ item: staffMemberWithId, children: itemChildren, }) => {
94
- return (_jsx(StaffMember.Root, { staffMember: staffMemberWithId, "data-testid": TestIds.staffMemberListStaffMember, "data-staff-member-id": staffMemberWithId.id, "data-item-id": staffMemberWithId.id, children: itemChildren }, staffMemberWithId.id));
92
+ const staffMemberItemWrapper = ({ item: staffMember, children: itemChildren, }) => {
93
+ return (_jsx(StaffMember.Root, { staffMember: staffMember, "data-testid": TestIds.staffMemberListStaffMember, "data-staff-member-id": staffMember.staffMemberId, "data-item-id": staffMember.staffMemberId, children: itemChildren }, staffMember.staffMemberId));
95
94
  };
96
95
  return (_jsx(GenericList.Repeater, { ref: ref, itemWrapper: staffMemberItemWrapper, children: children }));
97
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.59",
3
+ "version": "0.0.60",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "61ca8eb4d4959dd03911f50f6d490b55be609f85f03f0aff55af5948"
75
+ "falconPackageHash": "42dc732173b7489bf0966f3c1db262dcc4ca3ee26f306b3ae0c74c8d"
76
76
  }