@bigz-app/booking-widget 0.2.0 → 0.2.1
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 +35 -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 +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +35 -0
- package/dist/index.esm.js.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,CAAC;IACF,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CA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E,MAAM,KAAK,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,IAAI,CAAC;IACT,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACvB;AA+ND,wBAAgB,WAAW,CAAC,EAC3B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,OAAO,EACP,YAAY,EACZ,aAAa,EACb,gBAAgB,GAChB,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"PaymentForm.d.ts","sourceRoot":"","sources":["../../src/components/PaymentForm.tsx"],"names":[],"mappings":"AAIA,UAAU,gBAAgB;IACzB,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,EAAE,GAAG,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,YAAY,CAAC,EAAE;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,IAAI,CAAC;IACT,aAAa,EAAE,GAAG,CAAC;IACnB,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACvB;AA+ND,wBAAgB,WAAW,CAAC,EAC3B,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,SAAS,EACT,OAAO,EACP,YAAY,EACZ,aAAa,EACb,gBAAgB,GAChB,EAAE,gBAAgB,2CAuLlB"}
|
package/dist/index.cjs
CHANGED
|
@@ -9278,6 +9278,7 @@ function PaymentFormInner({ config, eventDetails, formData, totalAmount, discoun
|
|
|
9278
9278
|
// Main PaymentForm component that handles payment intent creation and Elements wrapper
|
|
9279
9279
|
function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode, onSuccess, onError, systemConfig, stripePromise, stripeAppearance, }) {
|
|
9280
9280
|
const [clientSecret, setClientSecret] = React__default.useState(null);
|
|
9281
|
+
const [paymentIntentId, setPaymentIntentId] = React__default.useState(null);
|
|
9281
9282
|
const [isCreatingPaymentIntent, setIsCreatingPaymentIntent] = React__default.useState(false);
|
|
9282
9283
|
const [paymentError, setPaymentError] = React__default.useState(null);
|
|
9283
9284
|
// Create payment intent when component mounts or when relevant data changes
|
|
@@ -9317,6 +9318,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
|
|
|
9317
9318
|
customerEmail: formData.customerEmail?.trim(),
|
|
9318
9319
|
customerPhone: formData.customerPhone?.trim(),
|
|
9319
9320
|
comment: formData.comment?.trim(),
|
|
9321
|
+
...(paymentIntentId && { paymentIntentId }), // Include existing payment intent ID if available
|
|
9320
9322
|
};
|
|
9321
9323
|
// Validate required fields
|
|
9322
9324
|
if (!requestData.eventInstanceId) {
|
|
@@ -9342,6 +9344,7 @@ function PaymentForm({ config, eventDetails, formData, totalAmount, discountCode
|
|
|
9342
9344
|
const data = await response.json();
|
|
9343
9345
|
if (response.ok) {
|
|
9344
9346
|
setClientSecret(data.clientSecret);
|
|
9347
|
+
setPaymentIntentId(data.paymentIntentId); // Save payment intent ID for future updates
|
|
9345
9348
|
}
|
|
9346
9349
|
else {
|
|
9347
9350
|
console.error("[PAYMENT_FORM] Payment intent creation failed:", {
|
|
@@ -9617,6 +9620,7 @@ const bookingFormSchema = objectType({
|
|
|
9617
9620
|
customerPhone: stringType().optional(),
|
|
9618
9621
|
participants: arrayType(participantSchema).min(1, "Mindestens ein Teilnehmer erforderlich"),
|
|
9619
9622
|
discountCode: stringType().optional(),
|
|
9623
|
+
comment: stringType().optional(),
|
|
9620
9624
|
acceptTerms: booleanType()
|
|
9621
9625
|
.refine((val) => val === true, "Bitte akzeptiere die Allgemeinen Geschäftsbedingungen"),
|
|
9622
9626
|
});
|
|
@@ -9632,6 +9636,7 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
|
|
|
9632
9636
|
defaultValues: {
|
|
9633
9637
|
participants: [{ name: "", age: undefined }],
|
|
9634
9638
|
discountCode: "",
|
|
9639
|
+
comment: "",
|
|
9635
9640
|
acceptTerms: false,
|
|
9636
9641
|
},
|
|
9637
9642
|
});
|
|
@@ -10018,6 +10023,36 @@ function BookingForm({ config, eventDetails, stripePromise, onSuccess, onError,
|
|
|
10018
10023
|
backdropFilter: "blur(4px)",
|
|
10019
10024
|
borderRadius: "var(--bw-border-radius)",
|
|
10020
10025
|
padding: "var(--bw-spacing)",
|
|
10026
|
+
}, children: [jsxRuntime.jsx("label", { htmlFor: "booking-comment", style: {
|
|
10027
|
+
fontSize: "var(--bw-font-size)",
|
|
10028
|
+
fontWeight: "500",
|
|
10029
|
+
color: "var(--bw-text-color)",
|
|
10030
|
+
fontFamily: "var(--bw-font-family)",
|
|
10031
|
+
display: "block",
|
|
10032
|
+
marginBottom: "8px",
|
|
10033
|
+
}, children: "Kommentar (optional)" }), jsxRuntime.jsx("textarea", { id: "booking-comment", ...form.register("comment"), placeholder: "Zus\u00E4tzliche Anmerkungen zu Ihrer Buchung...", rows: 3, style: {
|
|
10034
|
+
width: "100%",
|
|
10035
|
+
padding: "12px",
|
|
10036
|
+
border: `1px solid var(--bw-border-color)`,
|
|
10037
|
+
borderRadius: "var(--bw-border-radius)",
|
|
10038
|
+
fontSize: "var(--bw-font-size)",
|
|
10039
|
+
fontFamily: "var(--bw-font-family)",
|
|
10040
|
+
backgroundColor: "var(--bw-input-bg)",
|
|
10041
|
+
color: "var(--bw-text-color)",
|
|
10042
|
+
resize: "vertical",
|
|
10043
|
+
minHeight: "80px",
|
|
10044
|
+
outline: "none",
|
|
10045
|
+
transition: "border-color 0.2s ease",
|
|
10046
|
+
}, onFocus: (e) => {
|
|
10047
|
+
e.target.style.borderColor = "var(--bw-highlight-color)";
|
|
10048
|
+
}, onBlur: (e) => {
|
|
10049
|
+
e.target.style.borderColor = "var(--bw-border-color)";
|
|
10050
|
+
} })] }), jsxRuntime.jsxs("div", { style: {
|
|
10051
|
+
backgroundColor: "var(--bw-surface-color)",
|
|
10052
|
+
border: `1px solid var(--bw-border-color)`,
|
|
10053
|
+
backdropFilter: "blur(4px)",
|
|
10054
|
+
borderRadius: "var(--bw-border-radius)",
|
|
10055
|
+
padding: "var(--bw-spacing)",
|
|
10021
10056
|
}, children: [jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [jsxRuntime.jsx("input", { id: "acceptTerms", ...form.register("acceptTerms"), type: "checkbox", style: {
|
|
10022
10057
|
marginTop: "4px",
|
|
10023
10058
|
width: "20px",
|