@gomusdev/web-components 3.5.0 → 3.7.0

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.
Files changed (24) hide show
  1. package/README.md +16 -0
  2. package/dist-js/components/cart/components/itemTitles/Coupon.svelte.d.ts +1 -0
  3. package/dist-js/gomus-webcomponents.iife.js +108 -42
  4. package/dist-js/gomus-webcomponents.js +108 -42
  5. package/dist-js/gomus-webcomponents.min.iife.js +19 -19
  6. package/dist-js/gomus-webcomponents.min.js +2733 -2683
  7. package/dist-js/src/components/cart/mocks/gomusTicketMocks.d.ts +0 -3
  8. package/dist-js/src/components/ticketSelection/filters/coupon.d.ts +9 -0
  9. package/dist-js/src/components/ticketSelection/filters/coupon.spec.d.ts +1 -0
  10. package/dist-js/src/components/ticketSelection/filters/registry.d.ts +1 -1
  11. package/dist-js/src/components/ticketSelection/filters/types.d.ts +1 -1
  12. package/dist-js/src/components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.d.ts +3 -3
  13. package/dist-js/src/factories/CartItemFactories.d.ts +4 -4
  14. package/dist-js/src/factories/CouponFactories.d.ts +4 -0
  15. package/dist-js/src/lib/models/cart/CartItem.d.ts +1 -1
  16. package/dist-js/src/lib/models/cart/cart.svelte.d.ts +6 -6
  17. package/dist-js/src/lib/models/cart/localStorage.svelte.d.ts +1 -1
  18. package/dist-js/src/lib/models/cart/types.d.ts +4 -1
  19. package/dist-js/src/lib/models/coupon/UICoupon.spec.d.ts +1 -0
  20. package/dist-js/src/lib/models/coupon/UICoupon.svelte.d.ts +25 -0
  21. package/dist-js/src/lib/models/eventTicket/UIEventTicket.svelte.d.ts +1 -2
  22. package/dist-js/src/lib/models/ticket/UITicket.svelte.d.ts +1 -4
  23. package/dist-js/src/lib/stores/shop.svelte.d.ts +13 -3
  24. package/package.json +2 -2
@@ -1,5 +1,4 @@
1
1
  export declare function createMockUITicket(): {
2
- uid: number;
3
2
  selectedTime: string;
4
3
  type: "Ticket";
5
4
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
@@ -64,7 +63,6 @@ export declare function createMockUITicket(): {
64
63
  [key: string]: number;
65
64
  } | null;
66
65
  } | {
67
- uid: number;
68
66
  selectedTime: string;
69
67
  type: "Ticket";
70
68
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
@@ -121,7 +119,6 @@ export declare function createMockUITicket(): {
121
119
  [key: string]: number;
122
120
  } | null;
123
121
  } | {
124
- uid: number;
125
122
  selectedTime: string;
126
123
  type: "Ticket";
127
124
  subtype: import('../../../lib/models/ticket/UITicket.svelte').UITicketType;
@@ -0,0 +1,9 @@
1
+ import { FilterModule } from './types.ts';
2
+ /**
3
+ * `coupon` — sells the shop's purchasable coupons (German "Wertgutschein" /
4
+ * gift card). Coupons are fixed-value, standalone products:
5
+ * no calendar, no timeslots, no capacity. They are always listed, like a
6
+ * shelf of products.
7
+ */
8
+ declare const filter: FilterModule;
9
+ export default filter;
@@ -1,4 +1,4 @@
1
1
  import { FilterModule, FilterName } from './types.ts';
2
2
  export declare function getFilter(name: FilterName): FilterModule;
3
3
  export declare function allFilters(): FilterModule[];
4
- export declare const validFilterNames: readonly ["ticket:timeslot", "ticket:day", "ticket:annual", "event:admission", "event:admission:day", "event:admission:timeslot", "event:price", "events:admission", "events:admission:day", "events:admission:timeslot", "events:price"];
4
+ export declare const validFilterNames: readonly ["ticket:timeslot", "ticket:day", "ticket:annual", "event:admission", "event:admission:day", "event:admission:timeslot", "event:price", "events:admission", "events:admission:day", "events:admission:timeslot", "events:price", "coupon"];
@@ -1,6 +1,6 @@
1
1
  import { TicketSelectionDetails } from '../../../../components/ticketSelection/TicketSelectionDetails.svelte.ts';
2
2
  import { SegmentDetails } from '../../../../components/ticketSelection/subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.ts';
3
- export declare const FILTER_NAMES: readonly ["ticket:timeslot", "ticket:day", "ticket:annual", "event:admission", "event:admission:day", "event:admission:timeslot", "event:price", "events:admission", "events:admission:day", "events:admission:timeslot", "events:price"];
3
+ export declare const FILTER_NAMES: readonly ["ticket:timeslot", "ticket:day", "ticket:annual", "event:admission", "event:admission:day", "event:admission:timeslot", "event:price", "events:admission", "events:admission:day", "events:admission:timeslot", "events:price", "coupon"];
4
4
  export type FilterName = (typeof FILTER_NAMES)[number];
5
5
  export type Required = {
6
6
  kind: 'tsd';
@@ -5,7 +5,7 @@ export type TicketSegmentFilter = FilterName | 'custom';
5
5
  export declare class SegmentDetails {
6
6
  preCart: {
7
7
  items: {
8
- type: "Ticket" | "Event";
8
+ type: "Ticket" | "Event" | "Coupon";
9
9
  product: import('../../../../../../lib/models/cart/types').Product;
10
10
  orderAttributes(): {
11
11
  time: string | undefined;
@@ -47,7 +47,7 @@ export declare class SegmentDetails {
47
47
  paymentModeId: undefined;
48
48
  uid: string;
49
49
  readonly nonEmptyItems: {
50
- type: "Ticket" | "Event";
50
+ type: "Ticket" | "Event" | "Coupon";
51
51
  product: import('../../../../../../lib/models/cart/types').Product;
52
52
  orderAttributes(): {
53
53
  time: string | undefined;
@@ -90,7 +90,7 @@ export declare class SegmentDetails {
90
90
  toString(): string;
91
91
  orderData(): {
92
92
  items: {
93
- type: "Ticket" | "Event";
93
+ type: "Ticket" | "Event" | "Coupon";
94
94
  attributes: {
95
95
  time: string | undefined;
96
96
  quantity: number | undefined;
@@ -14,7 +14,7 @@ interface EventCartItemOptions {
14
14
  }
15
15
  export declare const CartItemFactories: {
16
16
  timeslot({ quantity, time, ticket }?: TicketCartItemOptions): {
17
- type: "Ticket" | "Event";
17
+ type: "Ticket" | "Event" | "Coupon";
18
18
  product: import('../lib/models/cart/types.ts').Product;
19
19
  orderAttributes(): {
20
20
  time: string | undefined;
@@ -53,7 +53,7 @@ export declare const CartItemFactories: {
53
53
  } | undefined;
54
54
  };
55
55
  day({ quantity, time, ticket }?: TicketCartItemOptions): {
56
- type: "Ticket" | "Event";
56
+ type: "Ticket" | "Event" | "Coupon";
57
57
  product: import('../lib/models/cart/types.ts').Product;
58
58
  orderAttributes(): {
59
59
  time: string | undefined;
@@ -92,7 +92,7 @@ export declare const CartItemFactories: {
92
92
  } | undefined;
93
93
  };
94
94
  scaledEvent({ quantity, time, dateId, event_title, eventTicket, }?: EventCartItemOptions): {
95
- type: "Ticket" | "Event";
95
+ type: "Ticket" | "Event" | "Coupon";
96
96
  product: import('../lib/models/cart/types.ts').Product;
97
97
  orderAttributes(): {
98
98
  time: string | undefined;
@@ -131,7 +131,7 @@ export declare const CartItemFactories: {
131
131
  } | undefined;
132
132
  };
133
133
  flatEvent({ quantity, time, dateId, event_title, eventTicket, }?: EventCartItemOptions): {
134
- type: "Ticket" | "Event";
134
+ type: "Ticket" | "Event" | "Coupon";
135
135
  product: import('../lib/models/cart/types.ts').Product;
136
136
  orderAttributes(): {
137
137
  time: string | undefined;
@@ -0,0 +1,4 @@
1
+ import { CouponIndex } from '@gomus/types';
2
+ export declare class CouponFactories {
3
+ static value(overrides?: Partial<CouponIndex>): CouponIndex;
4
+ }
@@ -9,7 +9,7 @@ interface Options {
9
9
  };
10
10
  }
11
11
  export declare function createCartItem(product: Product, options?: Partial<Options>): {
12
- type: "Ticket" | "Event";
12
+ type: "Ticket" | "Event" | "Coupon";
13
13
  product: Product;
14
14
  /**
15
15
  * is passed to the Order API
@@ -2,7 +2,7 @@ import { CartItem, Product } from '../../../../lib/models/cart/types.ts';
2
2
  export type Cart = ReturnType<typeof createCart>;
3
3
  export declare function createCart(products?: Product[], contingent?: number): {
4
4
  items: {
5
- type: "Ticket" | "Event";
5
+ type: "Ticket" | "Event" | "Coupon";
6
6
  product: Product;
7
7
  orderAttributes(): {
8
8
  time: string | undefined;
@@ -44,7 +44,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
44
44
  paymentModeId: undefined;
45
45
  uid: string;
46
46
  readonly nonEmptyItems: {
47
- type: "Ticket" | "Event";
47
+ type: "Ticket" | "Event" | "Coupon";
48
48
  product: Product;
49
49
  orderAttributes(): {
50
50
  time: string | undefined;
@@ -90,7 +90,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
90
90
  toString(): string;
91
91
  orderData(): {
92
92
  items: {
93
- type: "Ticket" | "Event";
93
+ type: "Ticket" | "Event" | "Coupon";
94
94
  attributes: {
95
95
  time: string | undefined;
96
96
  quantity: number | undefined;
@@ -132,7 +132,7 @@ export declare function createCart(products?: Product[], contingent?: number): {
132
132
  export declare function formatCurrency(priceCents: number): string;
133
133
  export declare function createMainCart(): {
134
134
  items: {
135
- type: "Ticket" | "Event";
135
+ type: "Ticket" | "Event" | "Coupon";
136
136
  product: Product;
137
137
  orderAttributes(): {
138
138
  time: string | undefined;
@@ -174,7 +174,7 @@ export declare function createMainCart(): {
174
174
  paymentModeId: undefined;
175
175
  uid: string;
176
176
  readonly nonEmptyItems: {
177
- type: "Ticket" | "Event";
177
+ type: "Ticket" | "Event" | "Coupon";
178
178
  product: Product;
179
179
  orderAttributes(): {
180
180
  time: string | undefined;
@@ -220,7 +220,7 @@ export declare function createMainCart(): {
220
220
  toString(): string;
221
221
  orderData(): {
222
222
  items: {
223
- type: "Ticket" | "Event";
223
+ type: "Ticket" | "Event" | "Coupon";
224
224
  attributes: {
225
225
  time: string | undefined;
226
226
  quantity: number | undefined;
@@ -9,7 +9,7 @@ import { CartItem } from '../../../../lib/models/cart/types.ts';
9
9
  export declare function generateCartItem(cartItem: any): CartItem | undefined;
10
10
  export declare function clearLocalStorage(): void;
11
11
  export declare function loadFromLocalStorage(cart: Cart): {
12
- type: "Ticket" | "Event";
12
+ type: "Ticket" | "Event" | "Coupon";
13
13
  product: import('../../../../lib/models/cart/types.ts').Product;
14
14
  orderAttributes(): {
15
15
  time: string | undefined;
@@ -1,7 +1,8 @@
1
1
  import { createCartItem } from '../../../../lib/models/cart/CartItem.ts';
2
+ import { UICoupon } from '../../../../lib/models/coupon/UICoupon.svelte.ts';
2
3
  import { UIEventTicket } from '../../../../lib/models/eventTicket/UIEventTicket.svelte.ts';
3
4
  import { UITicket } from '../../../../lib/models/ticket/UITicket.svelte.ts';
4
- export type ProductType = 'Ticket' | 'Event';
5
+ export type ProductType = 'Ticket' | 'Event' | 'Coupon';
5
6
  export type CartItem = ReturnType<typeof createCartItem>;
6
7
  /**
7
8
  * minimal props to define a Product in a CartItem
@@ -19,4 +20,6 @@ export type Product = (UITicket & {
19
20
  type: 'Ticket';
20
21
  }) | (UIEventTicket & {
21
22
  type: 'Event';
23
+ }) | (UICoupon & {
24
+ type: 'Coupon';
22
25
  });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { BaseProduct, Product } from '../../../../lib/models/cart/types.ts';
2
+ import { CouponIndex } from '@gomus/types';
3
+ export type UICoupon = ReturnType<typeof createUICoupon>;
4
+ export declare function isUICoupon(x: BaseProduct | Product | null | undefined): x is UICoupon;
5
+ /**
6
+ * A purchasable coupon (German "Wertgutschein" = value voucher / gift card).
7
+ *
8
+ * Unlike tickets and event prices, a coupon is a fixed-value product: the API
9
+ * returns predefined coupons and the order payload (`coupon_cart_item`) only
10
+ * carries `id` + `quantity`. `coupon_index` has no `description`, so we default
11
+ * it to an empty string to satisfy the shared `BaseProduct` shape.
12
+ */
13
+ export declare function createUICoupon(apiCoupon: CouponIndex): {
14
+ description: string;
15
+ tax_included: boolean;
16
+ type: "Coupon";
17
+ id: number;
18
+ title: string;
19
+ price_cents: number;
20
+ value_cents: number;
21
+ vat_pct: number;
22
+ created_at: string;
23
+ updated_at: string;
24
+ shipped_with_merchandise_id: number | null;
25
+ };
@@ -22,7 +22,7 @@ interface Options {
22
22
  * use `isFlatEventTicket` / `isScaleEventTicket` to narrow.
23
23
  */
24
24
  type UIEventTicketSubtype = 'scale' | 'flat';
25
- export declare function isEventTicket(x: Product): x is UIEventTicket;
25
+ export declare function isEventTicket(x: Product | null | undefined): x is UIEventTicket;
26
26
  export declare function isFlatEventTicket(x: Product): x is UIEventTicketFlat;
27
27
  export declare function isScaleEventTicket(x: Product): x is UIEventTicketScale;
28
28
  export type UIEventTicketBase = ReturnType<typeof buildUIEventTicket>;
@@ -59,7 +59,6 @@ declare function buildUIEventTicket(apiTicket: EventTicket, dateId: number, opti
59
59
  date_description?: string;
60
60
  price_title?: string;
61
61
  price_description?: string;
62
- uid: number;
63
62
  dateId: number;
64
63
  };
65
64
  export declare function createUIEventTicket(apiTicket: EventTicket, dateId: number, options?: Options): UIEventTicket;
@@ -5,9 +5,8 @@ interface Options {
5
5
  }
6
6
  export type UITicketType = 'timeslot' | 'annual' | 'day' | 'event:ticket';
7
7
  export type UITicket = ReturnType<typeof createUITicket>;
8
- export declare function isUITicket(x: BaseProduct): x is UITicket;
8
+ export declare function isUITicket(x: BaseProduct | null | undefined): x is UITicket;
9
9
  export declare function createUITicket(apiTicket: Ticket | AnnualTicket | NormalTickets[number], options?: Options): {
10
- uid: number;
11
10
  selectedTime: string;
12
11
  type: "Ticket";
13
12
  subtype: UITicketType;
@@ -72,7 +71,6 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket | Normal
72
71
  [key: string]: number;
73
72
  } | null;
74
73
  } | {
75
- uid: number;
76
74
  selectedTime: string;
77
75
  type: "Ticket";
78
76
  subtype: UITicketType;
@@ -129,7 +127,6 @@ export declare function createUITicket(apiTicket: Ticket | AnnualTicket | Normal
129
127
  [key: string]: number;
130
128
  } | null;
131
129
  } | {
132
- uid: number;
133
130
  selectedTime: string;
134
131
  type: "Ticket";
135
132
  subtype: UITicketType;
@@ -75,7 +75,7 @@ export declare class Shop {
75
75
  };
76
76
  get cart(): {
77
77
  items: {
78
- type: "Ticket" | "Event";
78
+ type: "Ticket" | "Event" | "Coupon";
79
79
  product: import('../models/cart/types').Product;
80
80
  orderAttributes(): {
81
81
  time: string | undefined;
@@ -117,7 +117,7 @@ export declare class Shop {
117
117
  paymentModeId: undefined;
118
118
  uid: string;
119
119
  readonly nonEmptyItems: {
120
- type: "Ticket" | "Event";
120
+ type: "Ticket" | "Event" | "Coupon";
121
121
  product: import('../models/cart/types').Product;
122
122
  orderAttributes(): {
123
123
  time: string | undefined;
@@ -160,7 +160,7 @@ export declare class Shop {
160
160
  toString(): string;
161
161
  orderData(): {
162
162
  items: {
163
- type: "Ticket" | "Event";
163
+ type: "Ticket" | "Event" | "Coupon";
164
164
  attributes: {
165
165
  time: string | undefined;
166
166
  quantity: number | undefined;
@@ -593,6 +593,16 @@ export declare class Shop {
593
593
  value_action: string | null;
594
594
  value: number | null;
595
595
  };
596
+ getCoupons(): {
597
+ id: number;
598
+ title: string;
599
+ price_cents: number;
600
+ value_cents: number;
601
+ vat_pct: number;
602
+ created_at: string;
603
+ updated_at: string;
604
+ shipped_with_merchandise_id: number | null;
605
+ }[];
596
606
  getEventDetailsOnDate(eventId: number, dateId: number): {
597
607
  id?: number;
598
608
  event_id?: number;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Giantmonkey GmbH"
5
5
  },
6
6
  "license": "MIT",
7
- "version": "3.5.0",
7
+ "version": "3.7.0",
8
8
  "type": "module",
9
9
  "main": "./dist-js/gomus-webcomponents.iife.js",
10
10
  "module": "./dist-js/gomus-webcomponents.iife.js",
@@ -28,6 +28,7 @@
28
28
  "build-web-components": "vite build;",
29
29
  "copy-web-components": "cp ./dist-js/gomus-paypal.iife.js ../../../gomus-shop/src/assets/javascript",
30
30
  "build:standard-components": "pnpm vite -c vite.standard-components.config.ts build; cp dist-js/standard-components.js ../../../gomus-shop/src/assets/javascript",
31
+ "build:interactive-editor": "pnpm --filter @gomusdev/interactive-editor build",
31
32
  "=== E 2 E ===": "",
32
33
  "e2e:static": "vite build && npx playwright test --config=playwright-static.config.ts",
33
34
  "e2e:static:no-build": "npx playwright test --config=playwright-static.config.ts",
@@ -37,7 +38,6 @@
37
38
  "e2e:storybook:ui": "npx playwright test --ui --config=playwright-storybook.config.ts",
38
39
  "e2e:storybook:headed": "npx playwright test --headed --config=playwright-storybook.config.ts",
39
40
  "=== S T O R Y B O O K ===": "",
40
- "build:interactive-editor": "pnpm --filter @gomusdev/interactive-editor build",
41
41
  "chromatic": "npx chromatic --project-token=chpt_36bb239517e3c45 --allow-console-errors",
42
42
  "storybook": "pnpm build:interactive-editor && storybook dev",
43
43
  "storybook:build": "pnpm build:interactive-editor && storybook build -o ./.storybook/deploy/build",