@bigz-app/booking-widget 0.2.0 → 0.2.2
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/booking-widget.js +38 -0
- package/dist/booking-widget.js.map +1 -1
- package/dist/components/BookingForm.d.ts.map +1 -1
- package/dist/components/PaymentForm.d.ts.map +1 -1
- package/dist/index.cjs +38 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +38 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingForm.d.ts","sourceRoot":"","sources":["../../src/components/BookingForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookingForm.d.ts","sourceRoot":"","sources":["../../src/components/BookingForm.tsx"],"names":[],"mappings":"AAoCA,UAAU,YAAY;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,YAAY,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,C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gB,2CAuLlB"}
|
package/dist/index.cjs
CHANGED
|
@@ -935,6 +935,9 @@ const inferConfigFromUrl = (baseConfig) => {
|
|
|
935
935
|
const createApiHeaders = (config) => {
|
|
936
936
|
return {
|
|
937
937
|
"Content-Type": "application/json",
|
|
938
|
+
"x-origin-url": window.location.href,
|
|
939
|
+
"x-language": navigator.language,
|
|
940
|
+
"x-user-agent": navigator.userAgent,
|
|
938
941
|
};
|
|
939
942
|
};
|
|
940
943
|
const createRequestBody = (config, additionalData) => {
|
|
@@ -9278,6 +9281,7 @@ function PaymentFormInner({ config, eventDetails, formData, totalAmount, discoun
|
|
|
9278
9281
|
// Main PaymentForm component that handles payment intent creation and Elements wrapper
|
|
9279
9282
|
function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode, onSuccess, onError, systemConfig, stripePromise, stripeAppearance, }) {
|
|
9280
9283
|
const [clientSecret, setClientSecret] = React__default.useState(null);
|
|
9284
|
+
const [paymentIntentId, setPaymentIntentId] = React__default.useState(null);
|
|
9281
9285
|
const [isCreatingPaymentIntent, setIsCreatingPaymentIntent] = React__default.useState(false);
|
|
9282
9286
|
const [paymentError, setPaymentError] = React__default.useState(null);
|
|
9283
9287
|
// Create payment intent when component mounts or when relevant data changes
|
|
@@ -9317,6 +9321,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
|
|
|
9317
9321
|
customerEmail: formData.customerEmail?.trim(),
|
|
9318
9322
|
customerPhone: formData.customerPhone?.trim(),
|
|
9319
9323
|
comment: formData.comment?.trim(),
|
|
9324
|
+
...(paymentIntentId && { paymentIntentId }), // Include existing payment intent ID if available
|
|
9320
9325
|
};
|
|
9321
9326
|
// Validate required fields
|
|
9322
9327
|
if (!requestData.eventInstanceId) {
|
|
@@ -9342,6 +9347,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
|
|
|
9342
9347
|
const data = await response.json();
|
|
9343
9348
|
if (response.ok) {
|
|
9344
9349
|
setClientSecret(data.clientSecret);
|
|
9350
|
+
setPaymentIntentId(data.paymentIntentId); // Save payment intent ID for future updates
|
|
9345
9351
|
}
|
|
9346
9352
|
else {
|
|
9347
9353
|
console.error("[PAYMENT_FORM] Payment intent creation failed:", {
|
|
@@ -9617,6 +9623,7 @@ const bookingFormSchema = objectType({
|
|
|
9617
9623
|
customerPhone: stringType().optional(),
|
|
9618
9624
|
participants: arrayType(participantSchema).min(1, "Mindestens ein Teilnehmer erforderlich"),
|
|
9619
9625
|
discountCode: stringType().optional(),
|
|
9626
|
+
comment: stringType().optional(),
|
|
9620
9627
|
acceptTerms: booleanType()
|
|
9621
9628
|
.refine((val) => val === true, "Bitte akzeptiere die Allgemeinen Geschäftsbedingungen"),
|
|
9622
9629
|
});
|
|
@@ -9632,6 +9639,7 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
|
|
|
9632
9639
|
defaultValues: {
|
|
9633
9640
|
participants: [{ name: "", age: undefined }],
|
|
9634
9641
|
discountCode: "",
|
|
9642
|
+
comment: "",
|
|
9635
9643
|
acceptTerms: false,
|
|
9636
9644
|
},
|
|
9637
9645
|
});
|
|
@@ -10018,6 +10026,36 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
|
|
|
10018
10026
|
backdropFilter: "blur(4px)",
|
|
10019
10027
|
borderRadius: "var(--bw-border-radius)",
|
|
10020
10028
|
padding: "var(--bw-spacing)",
|
|
10029
|
+
}, children: [jsxRuntime.jsx("label", { htmlFor: "booking-comment", style: {
|
|
10030
|
+
fontSize: "var(--bw-font-size)",
|
|
10031
|
+
fontWeight: "500",
|
|
10032
|
+
color: "var(--bw-text-color)",
|
|
10033
|
+
fontFamily: "var(--bw-font-family)",
|
|
10034
|
+
display: "block",
|
|
10035
|
+
marginBottom: "8px",
|
|
10036
|
+
}, children: "Kommentar (optional)" }), jsxRuntime.jsx("textarea", { id: "booking-comment", ...form.register("comment"), placeholder: "Zus\u00E4tzliche Anmerkungen zu Ihrer Buchung...", rows: 3, style: {
|
|
10037
|
+
width: "100%",
|
|
10038
|
+
padding: "12px",
|
|
10039
|
+
border: `1px solid var(--bw-border-color)`,
|
|
10040
|
+
borderRadius: "var(--bw-border-radius)",
|
|
10041
|
+
fontSize: "var(--bw-font-size)",
|
|
10042
|
+
fontFamily: "var(--bw-font-family)",
|
|
10043
|
+
backgroundColor: "var(--bw-input-bg)",
|
|
10044
|
+
color: "var(--bw-text-color)",
|
|
10045
|
+
resize: "vertical",
|
|
10046
|
+
minHeight: "80px",
|
|
10047
|
+
outline: "none",
|
|
10048
|
+
transition: "border-color 0.2s ease",
|
|
10049
|
+
}, onFocus: (e) => {
|
|
10050
|
+
e.target.style.borderColor = "var(--bw-highlight-color)";
|
|
10051
|
+
}, onBlur: (e) => {
|
|
10052
|
+
e.target.style.borderColor = "var(--bw-border-color)";
|
|
10053
|
+
} })] }), jsxRuntime.jsxs("div", { style: {
|
|
10054
|
+
backgroundColor: "var(--bw-surface-color)",
|
|
10055
|
+
border: `1px solid var(--bw-border-color)`,
|
|
10056
|
+
backdropFilter: "blur(4px)",
|
|
10057
|
+
borderRadius: "var(--bw-border-radius)",
|
|
10058
|
+
padding: "var(--bw-spacing)",
|
|
10021
10059
|
}, children: [jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [jsxRuntime.jsx("input", { id: "acceptTerms", ...form.register("acceptTerms"), type: "checkbox", style: {
|
|
10022
10060
|
marginTop: "4px",
|
|
10023
10061
|
width: "20px",
|