@ticketlayer/elements 0.4.0 → 1.0.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 (161) hide show
  1. package/dist/cjs/{index-I9CoYv3k.js → index-DanPUX0s.js} +1 -1
  2. package/dist/cjs/index.cjs.js +2 -1
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
  5. package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
  6. package/dist/cjs/tl-buy-modal.cjs.entry.js +3 -3
  7. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -74
  8. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +61 -30
  9. package/dist/cjs/tl-cart-badge.cjs.entry.js +74 -61
  10. package/dist/cjs/tl-cart-drawer.cjs.entry.js +51 -23
  11. package/dist/cjs/tl-cart.cjs.entry.js +71 -103
  12. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +51 -29
  13. package/dist/cjs/tl-event-card.cjs.entry.js +43 -105
  14. package/dist/cjs/tl-event-list.cjs.entry.js +72 -35
  15. package/dist/cjs/tl-login.cjs.entry.js +74 -141
  16. package/dist/cjs/tl-my-orders.cjs.entry.js +52 -92
  17. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +153 -921
  18. package/dist/cjs/tl-order-confirmation.cjs.entry.js +71 -107
  19. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +48 -74
  20. package/dist/cjs/tl-promo-code.cjs.entry.js +50 -47
  21. package/dist/cjs/tl-seat-map.cjs.entry.js +3 -3
  22. package/dist/cjs/web-query-Ce73jB4k.js +16 -0
  23. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
  24. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +37 -0
  25. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -79
  26. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
  27. package/dist/collection/components/tl-cart/tl-cart.js +82 -107
  28. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
  29. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
  30. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
  31. package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
  32. package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
  33. package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
  34. package/dist/collection/components/tl-login/tl-login.js +83 -147
  35. package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
  36. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
  37. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -115
  38. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
  39. package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
  40. package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
  41. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +34 -20
  42. package/dist/collection/utils/order-summary.js +15 -135
  43. package/dist/collection/utils/testing/deep-text.js +29 -0
  44. package/dist/collection/utils/testing/fixtures.js +290 -0
  45. package/dist/collection/utils/testing/mock-sdk.js +13 -2
  46. package/dist/collection/utils/web-query.js +12 -0
  47. package/dist/collection/utils/web-storage.js +22 -0
  48. package/dist/components/ticket-selector.js +1 -0
  49. package/dist/components/tl-buy-modal.js +1 -1
  50. package/dist/components/tl-buy-tickets-button.js +1 -1
  51. package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
  52. package/dist/components/tl-cart-badge.js +1 -1
  53. package/dist/components/tl-cart-drawer.js +1 -1
  54. package/dist/components/tl-cart2.js +1 -1
  55. package/dist/components/tl-checkout-wrapper2.js +1 -1
  56. package/dist/components/tl-event-card2.js +1 -1
  57. package/dist/components/tl-event-list.js +1 -1
  58. package/dist/components/tl-login2.js +1 -1
  59. package/dist/components/tl-my-orders.js +1 -1
  60. package/dist/components/tl-occurrence-selector2.js +1 -1
  61. package/dist/components/tl-order-confirmation.js +1 -1
  62. package/dist/components/tl-order-tickets2.js +1 -1
  63. package/dist/components/tl-promo-code.js +1 -1
  64. package/dist/components/tl-seat-map.js +1 -1
  65. package/dist/components/tl-ticket-selector2.js +1 -1
  66. package/dist/components/web-query.js +1 -0
  67. package/dist/elements.docs.json +34 -34
  68. package/dist/esm/{index-OoYV1faY.js → index-imfxp765.js} +1 -1
  69. package/dist/esm/index.js +2 -1
  70. package/dist/esm/loader.js +3 -3
  71. package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
  72. package/dist/esm/ticketlayer-elements.js +3 -3
  73. package/dist/esm/tl-buy-modal.entry.js +3 -3
  74. package/dist/esm/tl-buy-tickets-button.entry.js +90 -75
  75. package/dist/esm/tl-buy-tickets-wrapper.entry.js +62 -31
  76. package/dist/esm/tl-cart-badge.entry.js +75 -62
  77. package/dist/esm/tl-cart-drawer.entry.js +52 -24
  78. package/dist/esm/tl-cart.entry.js +72 -104
  79. package/dist/esm/tl-checkout-wrapper.entry.js +52 -30
  80. package/dist/esm/tl-event-card.entry.js +44 -106
  81. package/dist/esm/tl-event-list.entry.js +73 -36
  82. package/dist/esm/tl-login.entry.js +75 -142
  83. package/dist/esm/tl-my-orders.entry.js +53 -93
  84. package/dist/esm/tl-occurrence-selector_2.entry.js +152 -920
  85. package/dist/esm/tl-order-confirmation.entry.js +72 -108
  86. package/dist/esm/tl-order-tickets_2.entry.js +49 -75
  87. package/dist/esm/tl-promo-code.entry.js +51 -48
  88. package/dist/esm/tl-seat-map.entry.js +3 -3
  89. package/dist/esm/web-query-Bdbb2lk5.js +14 -0
  90. package/dist/ticketlayer-elements/index.esm.js +1 -1
  91. package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
  92. package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
  93. package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
  94. package/dist/ticketlayer-elements/{p-ac264adc.entry.js → p-5135630e.entry.js} +1 -1
  95. package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
  96. package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
  97. package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
  98. package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
  99. package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
  100. package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
  101. package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
  102. package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
  103. package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
  104. package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
  105. package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
  106. package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
  107. package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
  108. package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
  109. package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
  110. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
  111. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
  112. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
  113. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
  114. package/dist/types/components/tl-cart/tl-cart.d.ts +40 -42
  115. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
  116. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
  117. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
  118. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
  119. package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
  120. package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
  121. package/dist/types/components/tl-login/tl-login.d.ts +68 -22
  122. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
  123. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
  124. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
  125. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
  126. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
  127. package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
  128. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +22 -4
  129. package/dist/types/components.d.ts +270 -62
  130. package/dist/types/utils/order-summary.d.ts +14 -97
  131. package/dist/types/utils/testing/deep-text.d.ts +13 -0
  132. package/dist/types/utils/testing/fixtures.d.ts +225 -0
  133. package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
  134. package/dist/types/utils/web-query.d.ts +18 -0
  135. package/dist/types/utils/web-storage.d.ts +16 -0
  136. package/elements.catalogue.json +602 -50
  137. package/package.json +8 -6
  138. package/dist/cjs/money-BtmM2gt-.js +0 -118
  139. package/dist/cjs/order-summary-X3TlZxc2.js +0 -150
  140. package/dist/components/money.js +0 -1
  141. package/dist/components/order-summary.js +0 -1
  142. package/dist/esm/money-4ig0-WB6.js +0 -112
  143. package/dist/esm/order-summary-DiDtvfZM.js +0 -136
  144. package/dist/ticketlayer-elements/p-0814420f.entry.js +0 -1
  145. package/dist/ticketlayer-elements/p-0acabc26.entry.js +0 -1
  146. package/dist/ticketlayer-elements/p-109a3feb.entry.js +0 -1
  147. package/dist/ticketlayer-elements/p-1a4ba71c.entry.js +0 -1
  148. package/dist/ticketlayer-elements/p-318965c1.entry.js +0 -1
  149. package/dist/ticketlayer-elements/p-347c7fd1.entry.js +0 -1
  150. package/dist/ticketlayer-elements/p-3649c26d.entry.js +0 -1
  151. package/dist/ticketlayer-elements/p-40260cc9.entry.js +0 -1
  152. package/dist/ticketlayer-elements/p-4ig0-WB6.js +0 -1
  153. package/dist/ticketlayer-elements/p-55fd2f9f.entry.js +0 -1
  154. package/dist/ticketlayer-elements/p-62ee659b.entry.js +0 -1
  155. package/dist/ticketlayer-elements/p-7d4ecc2b.entry.js +0 -1
  156. package/dist/ticketlayer-elements/p-7f0abf95.entry.js +0 -1
  157. package/dist/ticketlayer-elements/p-BXpVGW51.js +0 -1
  158. package/dist/ticketlayer-elements/p-OoYV1faY.js +0 -3
  159. package/dist/ticketlayer-elements/p-a3c1b26c.entry.js +0 -1
  160. package/dist/ticketlayer-elements/p-aeb4c6fb.entry.js +0 -1
  161. package/dist/ticketlayer-elements/p-ba62541f.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import type { TlTicketData } from '../tl-ticket/tl-ticket';
1
+ import { type OrderTicketsDerived, type OrderTicketsProps, type OrderTicketsState, type OrderTicketsStatus } from '@ticketlayer/elements-core';
2
2
  /**
3
3
  * tl-order-tickets - renders all the tickets for an order as scannable QR
4
4
  * cards with PDF download. Fetches the order through the SDK (order-access
@@ -6,44 +6,42 @@ import type { TlTicketData } from '../tl-ticket/tl-ticket';
6
6
  *
7
7
  * Usage: <tl-order-tickets order-id="ord_xxx"></tl-order-tickets>
8
8
  *
9
- * On an empty result it waits rather than concluding there is nothing.
10
- *
11
- * Tickets are issued asynchronously: the payment confirms, the order is
12
- * marked paid, and entitlement issuance follows a moment later. A confirmation
13
- * page therefore renders BEFORE the passes exist - reliably, not occasionally.
14
- * The component used to answer that with "No tickets for this order yet",
15
- * which is true and reads as "something went wrong" to someone who has just
16
- * been charged. Refreshing showed them, so the only thing missing was the
17
- * waiting.
18
- *
19
- * So: an empty order is treated as issuance in flight and polled, with the
20
- * gaps widening, for about a minute. Then it stops and says the tickets are
21
- * coming by email, because at that point something probably is wrong and a
22
- * page that polls forever is worse than one that admits it.
9
+ * On an empty result it waits rather than concluding there is nothing: tickets
10
+ * are issued a moment after the order is paid, so a confirmation page renders
11
+ * before the passes exist. The waiting, the widening schedule behind it and
12
+ * the point at which it gives up are all in `orderTicketsCore`
13
+ * (`@ticketlayer/elements-core`, AGENTS.md, TKT-11), along with every string.
14
+ * This harness renders and forwards, and the one thing it owns is pairing
15
+ * `mount()` with its teardown - which is what stops the polling when the
16
+ * element goes off screen.
23
17
  */
24
18
  export declare class TlOrderTickets {
25
19
  /** The order whose tickets to show. */
26
20
  orderId: string;
27
21
  /** Columns in the grid (default 2). */
28
22
  columns: number;
29
- tickets: TlTicketData[];
30
- loading: boolean;
31
- error: string | null;
32
- /** The order loaded, but has no tickets yet and we are still waiting. */
33
- issuing: boolean;
23
+ private element;
24
+ private unsubscribe?;
25
+ private teardown?;
26
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
27
+ view: import("@ticketlayer/elements-core").ElementView<OrderTicketsProps, OrderTicketsState, OrderTicketsDerived, OrderTicketsStatus, {
28
+ loading: string;
29
+ preparing: string;
30
+ delayed: string;
31
+ notAvailable: string;
32
+ loadFailed: string;
33
+ }>;
34
+ /** A different order: forget this one and read again, from the top. */
35
+ watchOrder(): void;
36
+ syncProps(): void;
37
+ connectedCallback(): void;
34
38
  /**
35
- * Gaps between polls, in milliseconds. Front-loaded because issuance
36
- * usually lands in the first few seconds, then widening so a genuinely
37
- * stuck order is not hammered. Sums to roughly one minute.
39
+ * Off screen: run the mount's teardown, which is what stops the polling.
40
+ * Not `destroy()`: Stencil calls this for a DOM move as well as a removal,
41
+ * and a destroyed core never mounts again.
38
42
  */
39
- private static readonly POLL_DELAYS_MS;
40
- private timer?;
41
- private poll;
42
- watchOrder(): void;
43
- componentWillLoad(): Promise<void>;
44
43
  disconnectedCallback(): void;
45
- private reset;
46
- private stopPolling;
47
- private load;
44
+ /** The core declares no events, so nothing ever reaches here. */
45
+ private forward;
48
46
  render(): any;
49
47
  }
@@ -1,9 +1,6 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { type PresaleRedemption } from '../../utils/sdk-connector';
3
- export interface TlPromoApplied extends PresaleRedemption {
4
- code: string;
5
- cart: unknown | null;
6
- }
2
+ import { type PromoCodeDerived, type PromoCodeProps, type PromoCodeState, type PromoCodeStatus, type TlPromoApplied as CoreTlPromoApplied } from '@ticketlayer/elements-core';
3
+ export type TlPromoApplied = CoreTlPromoApplied;
7
4
  /**
8
5
  * tl-promo-code - an input plus Apply button that redeems a presale or promo
9
6
  * code for the current cart (POST /sales/presale-codes/redeem through the
@@ -13,6 +10,9 @@ export interface TlPromoApplied extends PresaleRedemption {
13
10
  * The API has no un-redeem, so the applied state offers only "use a different
14
11
  * code", which clears the input for another redemption.
15
12
  *
13
+ * The web harness for `promoCodeCore`: the redemption, the two error messages
14
+ * and every string are the core's (AGENTS.md, TKT-11).
15
+ *
16
16
  * Usage: <tl-promo-code></tl-promo-code>
17
17
  *
18
18
  * @event tlPromoApplied - a code was redeemed ({ code, benefit, alreadyHeld, cart })
@@ -23,17 +23,35 @@ export declare class TlPromoCode {
23
23
  placeholder: string;
24
24
  /** Apply button label. */
25
25
  buttonLabel: string;
26
- code: string;
27
- applying: boolean;
28
- applied: TlPromoApplied | null;
29
- error: string | null;
30
26
  tlPromoApplied: EventEmitter<TlPromoApplied>;
31
27
  tlError: EventEmitter<{
32
28
  message: string;
33
29
  }>;
30
+ private element;
31
+ private unsubscribe?;
32
+ private teardown?;
33
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
34
+ view: import("@ticketlayer/elements-core").ElementView<PromoCodeProps, PromoCodeState, PromoCodeDerived, PromoCodeStatus, {
35
+ applying: string;
36
+ codePrefix: string;
37
+ appliedSuffix: string;
38
+ alreadyHeldSuffix: string;
39
+ useDifferent: string;
40
+ enterCode: string;
41
+ notAvailable: string;
42
+ signIn: string;
43
+ rejected: string;
44
+ }>;
45
+ syncProps(): void;
46
+ /**
47
+ * This core has nothing to do on mount, and the harness calls `mount()`
48
+ * anyway: a harness never asks what a core's lifecycle means (TKT-197).
49
+ */
50
+ connectedCallback(): void;
51
+ disconnectedCallback(): void;
52
+ private forward;
34
53
  private handleInput;
35
54
  private handleSubmit;
36
- private apply;
37
55
  private reset;
38
56
  render(): any;
39
57
  }
@@ -1,14 +1,5 @@
1
- export interface TlTicketData {
2
- id: string;
3
- barcode: string;
4
- type: string;
5
- status: string;
6
- holderName: string | null;
7
- name: string;
8
- admissionStatus: string;
9
- eventOccurrenceId: string | null;
10
- seatLabel: string | null;
11
- }
1
+ import type { TlTicketData as CoreTlTicketData } from '@ticketlayer/elements-core';
2
+ export type TlTicketData = CoreTlTicketData;
12
3
  /**
13
4
  * tl-ticket - a single event ticket: a scannable QR (the redemption token),
14
5
  * ticket name / seat / holder, and a PDF download. Greys out + stamps
@@ -50,6 +50,7 @@ export declare class TlTicketSelector {
50
50
  }>;
51
51
  private element;
52
52
  private unsubscribe?;
53
+ private teardown?;
53
54
  /** The core's whole view. Assigning it is what makes Stencil re-render. */
54
55
  view: import("@ticketlayer/elements-core").ElementView<TicketSelectorProps, TicketSelectorState, TicketSelectorDerived, TicketSelectorStatus, {
55
56
  selectTickets: string;
@@ -73,14 +74,31 @@ export declare class TlTicketSelector {
73
74
  */
74
75
  get feeQuote(): TlFeeQuote | null;
75
76
  set feeQuote(quote: TlFeeQuote | null);
77
+ /**
78
+ * A new event or occurrence is a new subject: the element is torn down and
79
+ * mounted again, so whatever the core set up for the old one is undone
80
+ * before anything is set up for the new one.
81
+ */
76
82
  watchPropsChange(): void;
77
83
  syncProps(): void;
78
- componentWillLoad(): Promise<void>;
79
- disconnectedCallback(): void;
80
84
  /**
81
- * Wait for SDK to be ready, then load ticket types
85
+ * On screen: render what the core says and put the core to work. What "to
86
+ * work" means is the core's own business - for this element, waiting for the
87
+ * client and reading the ticket types.
88
+ *
89
+ * `connectedCallback` and not `componentWillLoad` because this runs again
90
+ * when the element is moved in the DOM, and that is exactly when a mount and
91
+ * its teardown have to pair up.
82
92
  */
83
- private waitForSDKAndLoad;
93
+ connectedCallback(): void;
94
+ /**
95
+ * Off screen: run the mount's teardown, and nothing more. `destroy()` is
96
+ * terminal and Stencil calls this for a move as well as a removal, so
97
+ * destroying here would leave a re-inserted element frozen. The instance
98
+ * holds no listener and no subscription once these two have run.
99
+ */
100
+ disconnectedCallback(): void;
101
+ private remount;
84
102
  private forward;
85
103
  private renderSkeleton;
86
104
  private renderError;