@wix/bookings 1.0.1741 → 1.0.1742
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/_sdk-exports/context-booking-checkout-context/runtime.d.ts +2784 -0
- package/_sdk-exports/context-booking-checkout-context/runtime.js +2 -0
- package/_sdk-exports/context-categories-context/runtime.d.ts +144 -0
- package/_sdk-exports/context-categories-context/runtime.js +1 -0
- package/_sdk-exports/context-locations-context/runtime.d.ts +282 -0
- package/_sdk-exports/context-locations-context/runtime.js +1 -0
- package/_sdk-exports/context-service-addons-context/runtime.d.ts +264 -0
- package/_sdk-exports/context-service-addons-context/runtime.js +1 -0
- package/_sdk-exports/context-service-context/runtime.d.ts +3667 -0
- package/_sdk-exports/context-service-context/runtime.js +2 -0
- package/_sdk-exports/context-services-context/runtime.d.ts +2863 -0
- package/_sdk-exports/context-services-context/runtime.js +2 -0
- package/_sdk-exports/context-time-slots-context/runtime.d.ts +660 -0
- package/_sdk-exports/context-time-slots-context/runtime.js +2 -0
- package/build/cjs/context-booking-checkout-context.d.ts +2784 -0
- package/build/cjs/context-booking-checkout-context.js +3940 -0
- package/build/cjs/context-booking-checkout-context.js.map +1 -0
- package/build/cjs/context-categories-context.d.ts +144 -0
- package/build/cjs/context-categories-context.js +1188 -0
- package/build/cjs/context-categories-context.js.map +1 -0
- package/build/cjs/context-locations-context.d.ts +282 -0
- package/build/cjs/context-locations-context.js +1252 -0
- package/build/cjs/context-locations-context.js.map +1 -0
- package/build/cjs/context-service-addons-context.d.ts +264 -0
- package/build/cjs/context-service-addons-context.js +1324 -0
- package/build/cjs/context-service-addons-context.js.map +1 -0
- package/build/cjs/context-service-context.d.ts +3667 -0
- package/build/cjs/context-service-context.js +5330 -0
- package/build/cjs/context-service-context.js.map +1 -0
- package/build/cjs/context-services-context.d.ts +2863 -0
- package/build/cjs/context-services-context.js +2203 -0
- package/build/cjs/context-services-context.js.map +1 -0
- package/build/cjs/context-time-slots-context.d.ts +660 -0
- package/build/cjs/context-time-slots-context.js +2822 -0
- package/build/cjs/context-time-slots-context.js.map +1 -0
- package/build/es/context-booking-checkout-context.d.mts +2784 -0
- package/build/es/context-booking-checkout-context.mjs +3898 -0
- package/build/es/context-booking-checkout-context.mjs.map +1 -0
- package/build/es/context-categories-context.d.mts +144 -0
- package/build/es/context-categories-context.mjs +1157 -0
- package/build/es/context-categories-context.mjs.map +1 -0
- package/build/es/context-locations-context.d.mts +282 -0
- package/build/es/context-locations-context.mjs +1221 -0
- package/build/es/context-locations-context.mjs.map +1 -0
- package/build/es/context-service-addons-context.d.mts +264 -0
- package/build/es/context-service-addons-context.mjs +1294 -0
- package/build/es/context-service-addons-context.mjs.map +1 -0
- package/build/es/context-service-context.d.mts +3667 -0
- package/build/es/context-service-context.mjs +5298 -0
- package/build/es/context-service-context.mjs.map +1 -0
- package/build/es/context-services-context.d.mts +2863 -0
- package/build/es/context-services-context.mjs +2172 -0
- package/build/es/context-services-context.mjs.map +1 -0
- package/build/es/context-time-slots-context.d.mts +660 -0
- package/build/es/context-time-slots-context.mjs +2792 -0
- package/build/es/context-time-slots-context.mjs.map +1 -0
- package/build/internal/cjs/context-booking-checkout-context.d.ts +2784 -0
- package/build/internal/cjs/context-categories-context.d.ts +144 -0
- package/build/internal/cjs/context-locations-context.d.ts +282 -0
- package/build/internal/cjs/context-service-addons-context.d.ts +264 -0
- package/build/internal/cjs/context-service-context.d.ts +3667 -0
- package/build/internal/cjs/context-services-context.d.ts +2863 -0
- package/build/internal/cjs/context-time-slots-context.d.ts +660 -0
- package/build/internal/es/context-booking-checkout-context.d.mts +2784 -0
- package/build/internal/es/context-categories-context.d.mts +144 -0
- package/build/internal/es/context-locations-context.d.mts +282 -0
- package/build/internal/es/context-service-addons-context.d.mts +264 -0
- package/build/internal/es/context-service-context.d.mts +3667 -0
- package/build/internal/es/context-services-context.d.mts +2863 -0
- package/build/internal/es/context-time-slots-context.d.mts +660 -0
- package/context/booking-checkout-context/package.json +3 -0
- package/context/categories-context/package.json +3 -0
- package/context/locations-context/package.json +3 -0
- package/context/service-addons-context/package.json +3 -0
- package/context/service-context/package.json +3 -0
- package/context/services-context/package.json +3 -0
- package/context/time-slots-context/package.json +3 -0
- package/package.json +68 -7
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/type-fest/source/observable-like.d.ts
|
|
4
|
+
declare global {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6
|
+
interface SymbolConstructor {
|
|
7
|
+
readonly observable: symbol;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
@remarks
|
|
12
|
+
The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
|
|
13
|
+
As well, some guidance on making an `Observable` to not include `closed` property.
|
|
14
|
+
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
|
|
15
|
+
@see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
|
|
16
|
+
@see https://github.com/benlesh/symbol-observable#making-an-object-observable
|
|
17
|
+
|
|
18
|
+
@category Observable
|
|
19
|
+
*/
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../../node_modules/@wix/sdk-types/internal/build/index.d.ts
|
|
22
|
+
declare global {
|
|
23
|
+
interface ContextualClient {}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates concrete types from SDK descriptors when a contextual client is
|
|
27
|
+
* available.
|
|
28
|
+
*
|
|
29
|
+
* For a REST descriptor the built (bound) API is intersected with the original
|
|
30
|
+
* descriptor, matching what `contextualizeRESTModuleV2` returns at runtime — a
|
|
31
|
+
* value callable as the bound API and still usable as a descriptor. Keeping the
|
|
32
|
+
* descriptor half lets contextual modules be passed to descriptor-constrained
|
|
33
|
+
* helpers such as `elevate` from `@wix/sdk/context` (FEDINF-14092).
|
|
34
|
+
*
|
|
35
|
+
* The `& T` is scoped to REST descriptors — the only shape codegen wraps in
|
|
36
|
+
* `MaybeContext` — so `BuildDescriptors` (used by `createClient().use`) is left
|
|
37
|
+
* unchanged and stays bound-only. The fix lives here rather than in `elevate`,
|
|
38
|
+
* which is kept strict on purpose (see #941) so it still rejects bound-only
|
|
39
|
+
* functions that are unsafe through `createRESTModule`.
|
|
40
|
+
*/
|
|
41
|
+
declare global {
|
|
42
|
+
/**
|
|
43
|
+
* A global interface to set the exposure toggle for the SDK.
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* declare global {
|
|
47
|
+
* interface SDKExposureToggle {
|
|
48
|
+
* alpha: true;
|
|
49
|
+
* }
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
interface SDKExposureToggle {}
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
/**
|
|
56
|
+
* A global interface to set the type mode for the SDK.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* declare global {
|
|
60
|
+
* interface SDKTypeMode {
|
|
61
|
+
* strict: true;
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
65
|
+
interface SDKTypeMode {}
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../node_modules/@wix/auto_sdk_bookings_services/build/es/bookings-services-v2-service-services.universal-Bf4TC5aj.d.mts
|
|
69
|
+
interface V2Category {
|
|
70
|
+
/**
|
|
71
|
+
* Category ID.
|
|
72
|
+
* @format GUID
|
|
73
|
+
*/
|
|
74
|
+
_id?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Category name.
|
|
77
|
+
* @maxLength 500
|
|
78
|
+
* @readonly
|
|
79
|
+
*/
|
|
80
|
+
name?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Order of a category within a category list.
|
|
83
|
+
* @readonly
|
|
84
|
+
*/
|
|
85
|
+
sortOrder?: number | null;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/api/adapters/category/category.d.ts
|
|
89
|
+
type Category = V2Category;
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/lib/picker-filter.d.ts
|
|
92
|
+
/** One field of a panel filter backed by an Items Selection provider (`$in`, or `$eq` after an operator switch). */
|
|
93
|
+
interface PickerRule {
|
|
94
|
+
$in?: string[];
|
|
95
|
+
$eq?: string;
|
|
96
|
+
}
|
|
97
|
+
interface CategoriesPickerFilter {
|
|
98
|
+
categoryId?: PickerRule;
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/extensions/contexts/categories-context/categories-context.d.ts
|
|
102
|
+
/** A service category as shown in a category list, with its selected state. */
|
|
103
|
+
interface CategoryItem {
|
|
104
|
+
categoryId: string | null;
|
|
105
|
+
categoryName: string | null;
|
|
106
|
+
isSelected: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** The business service categories, the selected category, the loading and error state, and the actions to change or reload them. */
|
|
109
|
+
interface CategoriesContextValue {
|
|
110
|
+
categories: Category[];
|
|
111
|
+
categoryItems: CategoryItem[];
|
|
112
|
+
selectedCategoryId: string | null;
|
|
113
|
+
selectedCategoryIndex: number;
|
|
114
|
+
selectedCategory: Category | null;
|
|
115
|
+
selectedCategoryName: string | null;
|
|
116
|
+
hasMultipleCategories: boolean;
|
|
117
|
+
isLoading: boolean;
|
|
118
|
+
hasError: boolean;
|
|
119
|
+
refetch: () => void;
|
|
120
|
+
selectCategory: (categoryId: string | null) => void;
|
|
121
|
+
}
|
|
122
|
+
/** Props accepted by {@link CategoriesContextProvider}. */
|
|
123
|
+
interface CategoriesContextProviderProps {
|
|
124
|
+
/** Selected on load when the page URL names no category. */
|
|
125
|
+
initialCategoryId?: string;
|
|
126
|
+
/** Shows only the picked categories. */
|
|
127
|
+
categoriesPicker?: CategoriesPickerFilter;
|
|
128
|
+
/** Bumped by the editor bundle on realtime data-changes; non-zero refetches, bypassing warmup. */
|
|
129
|
+
refreshSignal?: number;
|
|
130
|
+
children: ReactNode;
|
|
131
|
+
}
|
|
132
|
+
declare const categoriesContext: React.Context<CategoriesContextValue | null>;
|
|
133
|
+
declare const CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR = "useCategoriesContext must be used within CategoriesContextProvider";
|
|
134
|
+
/** Reads the categories state; throws when no CategoriesContextProvider is above. */
|
|
135
|
+
declare function useCategoriesContext(): CategoriesContextValue;
|
|
136
|
+
/** Loads the business service categories and tracks the selected category in the page URL. */
|
|
137
|
+
declare function CategoriesContextProvider({
|
|
138
|
+
initialCategoryId,
|
|
139
|
+
categoriesPicker,
|
|
140
|
+
refreshSignal,
|
|
141
|
+
children
|
|
142
|
+
}: CategoriesContextProviderProps): React.JSX.Element;
|
|
143
|
+
|
|
144
|
+
export { CATEGORIES_CONTEXT_MISSING_PROVIDER_ERROR, CategoriesContextProvider, type CategoriesContextProviderProps, type CategoriesContextValue, type CategoryItem, categoriesContext, CategoriesContextProvider as default, useCategoriesContext };
|