@gomusdev/web-components 3.0.0 → 3.1.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/README.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.1 (2026-05-26)
4
+
5
+ ### Bug Fixes
6
+
7
+ * Remove old tickets from the cart
8
+
9
+ ## 3.1.0 (2026-05-26)
10
+
11
+ ### Features
12
+
13
+ * **coupon:** ensure coupon codes are stored in uppercase and update tests/documentation
14
+
15
+ ### Bug Fixes
16
+
17
+ * **auth:** replace 1s localStorage poll with storage event
18
+
3
19
  ## 3.0.0 (2026-05-26)
4
20
 
5
21
  ### ⚠ BREAKING CHANGES
@@ -5684,7 +5684,11 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
5684
5684
  };
5685
5685
  constructor() {
5686
5686
  this.load();
5687
- setInterval(() => this.load(), 1e3);
5687
+ if (typeof window !== "undefined") {
5688
+ window.addEventListener("storage", (e) => {
5689
+ if (e.key === "go-auth") this.load();
5690
+ });
5691
+ }
5688
5692
  }
5689
5693
  customerLevel() {
5690
5694
  if (this.isGuest()) return 10;
@@ -5726,9 +5730,11 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
5726
5730
  return JSON.stringify(this.#data);
5727
5731
  }
5728
5732
  save() {
5733
+ if (typeof localStorage === "undefined") return;
5729
5734
  localStorage.setItem("go-auth", this.toString());
5730
5735
  }
5731
5736
  load() {
5737
+ if (typeof localStorage === "undefined") return;
5732
5738
  const str = localStorage.getItem("go-auth");
5733
5739
  if (!str) {
5734
5740
  this.signOut();
@@ -11277,7 +11283,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
11277
11283
  const type = cartItem.product.type;
11278
11284
  switch (type) {
11279
11285
  case "Ticket":
11280
- if (cartItem.product.subtype === "timeslot" && !inTheFuture(cartItem.time)) return;
11286
+ if (cartItem.time && !inTheFuture(cartItem.time)) return;
11281
11287
  const ticket = createUITicket(cartItem.product);
11282
11288
  return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.quantity });
11283
11289
  case "Event":
@@ -17726,7 +17732,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17726
17732
  });
17727
17733
  async function runRedeem(form) {
17728
17734
  const field = form.details.fields.find((f) => f.key === "token");
17729
- const token = (form.details.fieldValue("token") ?? "").trim();
17735
+ const token = (form.details.fieldValue("token") ?? "").trim().toUpperCase();
17730
17736
  if (!token) return { success: true };
17731
17737
  const result = await redeem(token);
17732
17738
  if (!result.success) {
@@ -5684,7 +5684,11 @@ class Auth {
5684
5684
  };
5685
5685
  constructor() {
5686
5686
  this.load();
5687
- setInterval(() => this.load(), 1e3);
5687
+ if (typeof window !== "undefined") {
5688
+ window.addEventListener("storage", (e) => {
5689
+ if (e.key === "go-auth") this.load();
5690
+ });
5691
+ }
5688
5692
  }
5689
5693
  customerLevel() {
5690
5694
  if (this.isGuest()) return 10;
@@ -5726,9 +5730,11 @@ class Auth {
5726
5730
  return JSON.stringify(this.#data);
5727
5731
  }
5728
5732
  save() {
5733
+ if (typeof localStorage === "undefined") return;
5729
5734
  localStorage.setItem("go-auth", this.toString());
5730
5735
  }
5731
5736
  load() {
5737
+ if (typeof localStorage === "undefined") return;
5732
5738
  const str = localStorage.getItem("go-auth");
5733
5739
  if (!str) {
5734
5740
  this.signOut();
@@ -11277,7 +11283,7 @@ function generateCartItem(cartItem) {
11277
11283
  const type = cartItem.product.type;
11278
11284
  switch (type) {
11279
11285
  case "Ticket":
11280
- if (cartItem.product.subtype === "timeslot" && !inTheFuture(cartItem.time)) return;
11286
+ if (cartItem.time && !inTheFuture(cartItem.time)) return;
11281
11287
  const ticket = createUITicket(cartItem.product);
11282
11288
  return createCartItem(ticket, { time: cartItem.time, quantity: cartItem.quantity });
11283
11289
  case "Event":
@@ -17726,7 +17732,7 @@ function CouponRedemption($$anchor, $$props) {
17726
17732
  });
17727
17733
  async function runRedeem(form) {
17728
17734
  const field = form.details.fields.find((f) => f.key === "token");
17729
- const token = (form.details.fieldValue("token") ?? "").trim();
17735
+ const token = (form.details.fieldValue("token") ?? "").trim().toUpperCase();
17730
17736
  if (!token) return { success: true };
17731
17737
  const result = await redeem(token);
17732
17738
  if (!result.success) {