@wix/bookings 1.0.1796 → 1.0.1798
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/build/cjs/context-booking-checkout.d.ts +3 -37
- package/build/cjs/context-booking-checkout.js +1350 -1340
- package/build/cjs/context-booking-checkout.js.map +1 -1
- package/build/cjs/context-categories.d.ts +1 -3
- package/build/cjs/context-categories.js +20 -43
- package/build/cjs/context-categories.js.map +1 -1
- package/build/cjs/context-locations.d.ts +1 -1
- package/build/cjs/context-locations.js +20 -43
- package/build/cjs/context-locations.js.map +1 -1
- package/build/cjs/context-service-addons.d.ts +1 -15
- package/build/cjs/context-service-addons.js +20 -43
- package/build/cjs/context-service-addons.js.map +1 -1
- package/build/cjs/context-service.d.ts +1 -65
- package/build/cjs/context-service.js +363 -386
- package/build/cjs/context-service.js.map +1 -1
- package/build/cjs/context-services.d.ts +1 -23
- package/build/cjs/context-services.js +542 -566
- package/build/cjs/context-services.js.map +1 -1
- package/build/cjs/context-time-slots.d.ts +1 -21
- package/build/cjs/context-time-slots.js +588 -615
- package/build/cjs/context-time-slots.js.map +1 -1
- package/build/es/context-booking-checkout.d.mts +3 -37
- package/build/es/context-booking-checkout.mjs +1350 -1340
- package/build/es/context-booking-checkout.mjs.map +1 -1
- package/build/es/context-categories.d.mts +1 -3
- package/build/es/context-categories.mjs +20 -43
- package/build/es/context-categories.mjs.map +1 -1
- package/build/es/context-locations.d.mts +1 -1
- package/build/es/context-locations.mjs +20 -43
- package/build/es/context-locations.mjs.map +1 -1
- package/build/es/context-service-addons.d.mts +1 -15
- package/build/es/context-service-addons.mjs +20 -43
- package/build/es/context-service-addons.mjs.map +1 -1
- package/build/es/context-service.d.mts +1 -65
- package/build/es/context-service.mjs +363 -386
- package/build/es/context-service.mjs.map +1 -1
- package/build/es/context-services.d.mts +1 -23
- package/build/es/context-services.mjs +542 -566
- package/build/es/context-services.mjs.map +1 -1
- package/build/es/context-time-slots.d.mts +1 -21
- package/build/es/context-time-slots.mjs +588 -615
- package/build/es/context-time-slots.mjs.map +1 -1
- package/build/internal/cjs/context-booking-checkout.d.ts +3 -37
- package/build/internal/cjs/context-categories.d.ts +1 -3
- package/build/internal/cjs/context-locations.d.ts +1 -1
- package/build/internal/cjs/context-service-addons.d.ts +1 -15
- package/build/internal/cjs/context-service.d.ts +1 -65
- package/build/internal/cjs/context-services.d.ts +1 -23
- package/build/internal/cjs/context-time-slots.d.ts +1 -21
- package/build/internal/es/context-booking-checkout.d.mts +3 -37
- package/build/internal/es/context-categories.d.mts +1 -3
- package/build/internal/es/context-locations.d.mts +1 -1
- package/build/internal/es/context-service-addons.d.mts +1 -15
- package/build/internal/es/context-service.d.mts +1 -65
- package/build/internal/es/context-services.d.mts +1 -23
- package/build/internal/es/context-time-slots.d.mts +1 -21
- package/context-runtime/context-booking-checkout/runtime.d.ts +3 -38
- package/context-runtime/context-booking-checkout/runtime.js +3 -3
- package/context-runtime/context-categories/runtime.d.ts +1 -4
- package/context-runtime/context-categories/runtime.js +2 -2
- package/context-runtime/context-locations/runtime.d.ts +1 -2
- package/context-runtime/context-locations/runtime.js +2 -2
- package/context-runtime/context-service/runtime.d.ts +1 -66
- package/context-runtime/context-service/runtime.js +3 -3
- package/context-runtime/context-service-addons/runtime.d.ts +1 -16
- package/context-runtime/context-service-addons/runtime.js +2 -2
- package/context-runtime/context-services/runtime.d.ts +1 -24
- package/context-runtime/context-services/runtime.js +3 -3
- package/context-runtime/context-time-slots/runtime.d.ts +1 -22
- package/context-runtime/context-time-slots/runtime.js +3 -3
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// ../../node_modules/type-fest/source/observable-like.d.ts
|
|
4
4
|
declare global {
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6
6
|
interface SymbolConstructor {
|
|
@@ -17,8 +17,6 @@ As well, some guidance on making an `Observable` to not include `closed` propert
|
|
|
17
17
|
|
|
18
18
|
@category Observable
|
|
19
19
|
*/
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region ../../node_modules/@wix/sdk-types/internal/build/index.d.ts
|
|
22
20
|
declare global {
|
|
23
21
|
interface ContextualClient {}
|
|
24
22
|
}
|
|
@@ -64,8 +62,6 @@ declare global {
|
|
|
64
62
|
*/
|
|
65
63
|
interface SDKTypeMode {}
|
|
66
64
|
}
|
|
67
|
-
//#endregion
|
|
68
|
-
//#region ../../node_modules/@wix/auto_sdk_bookings_services/build/es/bookings-services-v2-service-services.universal-p5eQUd5f.d.mts
|
|
69
65
|
/**
|
|
70
66
|
* Money.
|
|
71
67
|
* Default format to use. Sufficiently compliant with majority of standards: w3c, ISO 4217, ISO 20022, ISO 8583:2003.
|
|
@@ -199,15 +195,11 @@ interface AddOnGroupDetail$1 {
|
|
|
199
195
|
*/
|
|
200
196
|
promptTranslated?: string | null;
|
|
201
197
|
}
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region ../bookings-flow-data/dist/types.d.ts
|
|
204
198
|
/** An add-on the visitor chose, with its quantity. */
|
|
205
199
|
type AddOn$1 = {
|
|
206
200
|
/** ID of the add-on. */id: NonNullable<BookedAddOn['_id']>; /** Number of the add-on to book. */
|
|
207
201
|
quantity: NonNullable<BookedAddOn['quantity']>;
|
|
208
202
|
};
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region ../../node_modules/@wix/editor-react-types/dist/image.d.ts
|
|
211
203
|
type Point = {
|
|
212
204
|
x: number;
|
|
213
205
|
y: number;
|
|
@@ -243,8 +235,6 @@ type Image = {
|
|
|
243
235
|
quality?: number; /** The image alt text for accessibility. */
|
|
244
236
|
alt?: string;
|
|
245
237
|
};
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/api/adapters/service-addons/service-addons.d.ts
|
|
248
238
|
type AddOn = AddOn$2 & {
|
|
249
239
|
mainMedia?: {
|
|
250
240
|
image?: string | null;
|
|
@@ -353,8 +343,6 @@ interface AddOnGroupItem {
|
|
|
353
343
|
*/
|
|
354
344
|
canSelectMore: boolean;
|
|
355
345
|
}
|
|
356
|
-
//#endregion
|
|
357
|
-
//#region src/extensions/contexts/service-addons-context/service-addons-context.types.d.ts
|
|
358
346
|
/** The add-ons offered for the current service, the visitor's picks, and the actions to change them. */
|
|
359
347
|
interface ServiceAddOnsContextValue {
|
|
360
348
|
/**
|
|
@@ -498,8 +486,6 @@ interface ServiceAddOnsContextValue {
|
|
|
498
486
|
interface ServiceAddOnsContextProviderProps {
|
|
499
487
|
children: ReactNode;
|
|
500
488
|
}
|
|
501
|
-
//#endregion
|
|
502
|
-
//#region src/extensions/contexts/service-addons-context/service-addons-context.d.ts
|
|
503
489
|
declare const serviceAddOnsContext: React.Context<ServiceAddOnsContextValue | null>;
|
|
504
490
|
/**
|
|
505
491
|
* The `useServiceAddOnsContext()` hook provides access to the add-ons a Wix Bookings service offers
|
|
@@ -222,7 +222,7 @@ function Oe(e5, t2, n2) {
|
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
224
|
let a2 = r2[e6 + 1];
|
|
225
|
-
|
|
225
|
+
t3 in i2 && i2[t3] != null && typeof i2[t3] == `object` && i2[t3] !== null || (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
|
|
226
226
|
}
|
|
227
227
|
return e5;
|
|
228
228
|
}
|
|
@@ -289,11 +289,8 @@ var Ne = class {
|
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
let a3 = Le(e6);
|
|
292
|
-
if (a3 && a3 in t3)
|
|
293
|
-
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
292
|
+
if (a3 && a3 in t3) r2.push(a3), n2 = t3[a3];
|
|
293
|
+
else throw Error(`Cannot find key '${e6}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
297
294
|
}, o2 = (e6, t3) => {
|
|
298
295
|
r2.push(e6), n2 = t3[e6];
|
|
299
296
|
};
|
|
@@ -304,11 +301,7 @@ var Ne = class {
|
|
|
304
301
|
}
|
|
305
302
|
if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e6}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
|
|
306
303
|
let t3 = n2;
|
|
307
|
-
|
|
308
|
-
o2(e6, t3);
|
|
309
|
-
continue;
|
|
310
|
-
}
|
|
311
|
-
a2(e6, t3);
|
|
304
|
+
e6 in n2 ? o2(e6, t3) : a2(e6, t3);
|
|
312
305
|
}
|
|
313
306
|
return { [this.buildPathString(r2)]: n2 };
|
|
314
307
|
}
|
|
@@ -1673,13 +1666,7 @@ var Pa = class {
|
|
|
1673
1666
|
}), this;
|
|
1674
1667
|
}
|
|
1675
1668
|
off(e5, t2) {
|
|
1676
|
-
|
|
1677
|
-
if (!t2) {
|
|
1678
|
-
delete this.observers[e5];
|
|
1679
|
-
return;
|
|
1680
|
-
}
|
|
1681
|
-
this.observers[e5].delete(t2);
|
|
1682
|
-
}
|
|
1669
|
+
this.observers[e5] && (t2 ? this.observers[e5].delete(t2) : delete this.observers[e5]);
|
|
1683
1670
|
}
|
|
1684
1671
|
emit(e5, ...t2) {
|
|
1685
1672
|
this.observers[e5] && Array.from(this.observers[e5].entries()).forEach(([e6, n2]) => {
|
|
@@ -2206,24 +2193,17 @@ var eo = class extends Pa {
|
|
|
2206
2193
|
let e6 = this.waitingReads.shift();
|
|
2207
2194
|
this.read(e6.lng, e6.ns, e6.fcName, e6.tried, e6.wait, e6.callback);
|
|
2208
2195
|
}
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
}, i2);
|
|
2213
|
-
return;
|
|
2214
|
-
}
|
|
2215
|
-
a2(o3, s3);
|
|
2196
|
+
o3 && s3 && r2 < this.maxRetries ? setTimeout(() => {
|
|
2197
|
+
this.read.call(this, e5, t2, n2, r2 + 1, i2 * 2, a2);
|
|
2198
|
+
}, i2) : a2(o3, s3);
|
|
2216
2199
|
}, s2 = this.backend[n2].bind(this.backend);
|
|
2217
|
-
if (s2.length === 2) {
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
o2(e6);
|
|
2223
|
-
}
|
|
2224
|
-
return;
|
|
2200
|
+
if (s2.length === 2) try {
|
|
2201
|
+
let n3 = s2(e5, t2);
|
|
2202
|
+
n3 && typeof n3.then == `function` ? n3.then((e6) => o2(null, e6)).catch(o2) : o2(null, n3);
|
|
2203
|
+
} catch (e6) {
|
|
2204
|
+
o2(e6);
|
|
2225
2205
|
}
|
|
2226
|
-
return s2(e5, t2, o2);
|
|
2206
|
+
else return s2(e5, t2, o2);
|
|
2227
2207
|
}
|
|
2228
2208
|
prepareLoading(e5, t2, n2 = {}, r2) {
|
|
2229
2209
|
if (!this.backend) return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`), r2 && r2();
|
|
@@ -2248,11 +2228,8 @@ var eo = class extends Pa {
|
|
|
2248
2228
|
}
|
|
2249
2229
|
saveMissing(e5, t2, n2, r2, i2, a2 = {}, o2 = () => {
|
|
2250
2230
|
}) {
|
|
2251
|
-
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) {
|
|
2252
|
-
|
|
2253
|
-
return;
|
|
2254
|
-
}
|
|
2255
|
-
if (n2 != null && n2 !== ``) {
|
|
2231
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t2)) this.logger.warn(`did not save key "${n2}" as the namespace "${t2}" was not yet loaded`, `This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);
|
|
2232
|
+
else if (n2 != null && n2 !== ``) {
|
|
2256
2233
|
if (this.backend?.create) {
|
|
2257
2234
|
let s2 = { ...a2, isUpdate: i2 }, c2 = this.backend.create.bind(this.backend);
|
|
2258
2235
|
if (c2.length < 6) try {
|
|
@@ -2564,7 +2541,7 @@ var ko = class {
|
|
|
2564
2541
|
};
|
|
2565
2542
|
var Ao = (e5) => new ko(e5);
|
|
2566
2543
|
var jo = ga({ getMonitoringClient: (e5) => () => e5.getMonitoringClient ? e5.getMonitoringClient() : Ao(`Host monitoring client is not available on the current host. Make sure to use an updated version of the host initialization package.`) });
|
|
2567
|
-
var Mo = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule` };
|
|
2544
|
+
var Mo = { service: `service`, services: `services`, categories: `categories`, locations: `locations`, sessions: `sessions`, timeSlots: `time-slots`, serviceAddOns: `service-addons`, bookingsSettings: `bookings-settings`, serviceCta: `service-cta`, preferences: `preferences`, bookingSummary: `booking-summary`, bookingCheckout: `booking-checkout`, formValues: `form-values`, paymentOptions: `payment-options`, seo: `seo`, warmup: `warmup`, reschedule: `reschedule`, intakeForms: `intake-forms` };
|
|
2568
2545
|
function No(e5) {
|
|
2569
2546
|
try {
|
|
2570
2547
|
let t2 = jo.getMonitoringClient?.();
|
|
@@ -2647,7 +2624,7 @@ function Wo(e5) {
|
|
|
2647
2624
|
}
|
|
2648
2625
|
function Go() {
|
|
2649
2626
|
let e5 = Wo(Uo()), t2 = typeof window > `u`;
|
|
2650
|
-
return { scope: e5 ?? void 0, get: async (n2) => {
|
|
2627
|
+
return (0, import_react.useMemo)(() => ({ scope: e5 ?? void 0, get: async (n2) => {
|
|
2651
2628
|
if (t2 || !e5) return null;
|
|
2652
2629
|
try {
|
|
2653
2630
|
return await e5.get(n2);
|
|
@@ -2659,7 +2636,7 @@ function Go() {
|
|
|
2659
2636
|
e5.set(n2, r2);
|
|
2660
2637
|
} catch {
|
|
2661
2638
|
}
|
|
2662
|
-
} };
|
|
2639
|
+
} }), [e5, t2]);
|
|
2663
2640
|
}
|
|
2664
2641
|
var Ko = $(`@wix/site-service-locale`);
|
|
2665
2642
|
var qo = $;
|
|
@@ -2971,7 +2948,7 @@ function dc({ addOnsPromise: e5, isLoading: t2, pickedAddOns: n2, forwardToggleA
|
|
|
2971
2948
|
function fc({ children: e5 }) {
|
|
2972
2949
|
let { service: n2, serviceId: r2, hasAddOns: i2, locale: a2, isLoading: o2, bookingsSettingsLoading: c2, selection: l2, toggleAddOn: d2, setAddOnQuantity: f2 } = (0, import_service.useServiceContext)();
|
|
2973
2950
|
ac(nc.SERVICE_ADD_ONS, !o2 && !c2);
|
|
2974
|
-
let m2 = (0, import_react.useMemo)(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 = as(), v2 = n2 && i2 && r2 ? r2 : null, y2 = (0, import_react.useMemo)(() => v2 ? Vo(Vs({ serviceId: v2, locale: a2, language: g2, currency: _2, warmupData: h2 }), sc, cc) : oc, [v2, a2, g2, _2]), b2 = !v2 && !!o2;
|
|
2951
|
+
let m2 = (0, import_react.useMemo)(() => U(l2), [l2]), h2 = Go(), g2 = Zo(), _2 = as(), v2 = n2 && i2 && r2 ? r2 : null, y2 = (0, import_react.useMemo)(() => v2 ? Vo(Vs({ serviceId: v2, locale: a2, language: g2, currency: _2, warmupData: h2 }), sc, cc) : oc, [v2, a2, g2, _2, h2]), b2 = !v2 && !!o2;
|
|
2975
2952
|
return (0, import_jsx_runtime.jsx)(Io, { fallback: (0, import_jsx_runtime.jsx)(ds, { children: e5 }), feature: Mo.serviceAddOns, children: (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: (0, import_jsx_runtime.jsx)(us, { children: e5 }), children: (0, import_jsx_runtime.jsx)(dc, { addOnsPromise: y2, isLoading: b2, pickedAddOns: m2, forwardToggleAddOn: d2, forwardSetAddOnQuantity: f2, children: e5 }) }) });
|
|
2976
2953
|
}
|
|
2977
2954
|
var pc = na(`bcc1b809-bde5-4d7d-a7bb-89831fe5ccb8`);
|