@ticketlayer/elements 0.3.3 → 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 (179) hide show
  1. package/README.md +3 -2
  2. package/dist/cjs/{index-BpfoKd9Q.js → index-DanPUX0s.js} +1 -1
  3. package/dist/cjs/index.cjs.js +2 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
  6. package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
  7. package/dist/cjs/tl-buy-modal.cjs.entry.js +4 -4
  8. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -71
  9. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +62 -31
  10. package/dist/cjs/tl-cart-badge.cjs.entry.js +75 -62
  11. package/dist/cjs/tl-cart-drawer.cjs.entry.js +52 -24
  12. package/dist/cjs/tl-cart.cjs.entry.js +72 -98
  13. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +52 -30
  14. package/dist/cjs/tl-event-card.cjs.entry.js +44 -105
  15. package/dist/cjs/tl-event-list.cjs.entry.js +73 -36
  16. package/dist/cjs/tl-login.cjs.entry.js +75 -141
  17. package/dist/cjs/tl-my-orders.cjs.entry.js +53 -92
  18. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +205 -641
  19. package/dist/cjs/tl-order-confirmation.cjs.entry.js +72 -105
  20. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +50 -76
  21. package/dist/cjs/tl-promo-code.cjs.entry.js +51 -47
  22. package/dist/cjs/tl-seat-map.cjs.entry.js +4 -4
  23. package/dist/cjs/web-query-Ce73jB4k.js +16 -0
  24. package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -19
  25. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
  26. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +41 -4
  27. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -76
  28. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
  29. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
  30. package/dist/collection/components/tl-cart/tl-cart.css +52 -51
  31. package/dist/collection/components/tl-cart/tl-cart.js +82 -101
  32. package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
  33. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
  34. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
  35. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
  36. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
  37. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
  38. package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
  39. package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
  40. package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
  41. package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
  42. package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
  43. package/dist/collection/components/tl-login/tl-login.css +26 -26
  44. package/dist/collection/components/tl-login/tl-login.js +83 -147
  45. package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
  46. package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
  47. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
  48. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
  49. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
  50. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -113
  51. package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
  52. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
  53. package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
  54. package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
  55. package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
  56. package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
  57. package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
  58. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
  59. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +95 -135
  60. package/dist/collection/utils/cart-totals.js +9 -0
  61. package/dist/collection/utils/order-summary.js +15 -99
  62. package/dist/collection/utils/testing/deep-text.js +29 -0
  63. package/dist/collection/utils/testing/fixtures.js +290 -0
  64. package/dist/collection/utils/testing/mock-sdk.js +13 -2
  65. package/dist/collection/utils/web-query.js +12 -0
  66. package/dist/collection/utils/web-storage.js +22 -0
  67. package/dist/components/ticket-selector.js +1 -0
  68. package/dist/components/tl-buy-modal.js +1 -1
  69. package/dist/components/tl-buy-tickets-button.js +1 -1
  70. package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
  71. package/dist/components/tl-cart-badge.js +1 -1
  72. package/dist/components/tl-cart-drawer.js +1 -1
  73. package/dist/components/tl-cart2.js +1 -1
  74. package/dist/components/tl-checkout-wrapper2.js +1 -1
  75. package/dist/components/tl-event-card2.js +1 -1
  76. package/dist/components/tl-event-list.js +1 -1
  77. package/dist/components/tl-login2.js +1 -1
  78. package/dist/components/tl-my-orders.js +1 -1
  79. package/dist/components/tl-occurrence-selector2.js +1 -1
  80. package/dist/components/tl-order-confirmation.js +1 -1
  81. package/dist/components/tl-order-tickets2.js +1 -1
  82. package/dist/components/tl-promo-code.js +1 -1
  83. package/dist/components/tl-seat-map.js +1 -1
  84. package/dist/components/tl-ticket-selector2.js +1 -1
  85. package/dist/components/tl-ticket2.js +1 -1
  86. package/dist/components/web-query.js +1 -0
  87. package/dist/elements.docs.json +36 -36
  88. package/dist/esm/{index-CNX8hZa8.js → index-imfxp765.js} +1 -1
  89. package/dist/esm/index.js +2 -1
  90. package/dist/esm/loader.js +3 -3
  91. package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
  92. package/dist/esm/ticketlayer-elements.js +3 -3
  93. package/dist/esm/tl-buy-modal.entry.js +4 -4
  94. package/dist/esm/tl-buy-tickets-button.entry.js +90 -72
  95. package/dist/esm/tl-buy-tickets-wrapper.entry.js +63 -32
  96. package/dist/esm/tl-cart-badge.entry.js +76 -63
  97. package/dist/esm/tl-cart-drawer.entry.js +53 -25
  98. package/dist/esm/tl-cart.entry.js +73 -99
  99. package/dist/esm/tl-checkout-wrapper.entry.js +53 -31
  100. package/dist/esm/tl-event-card.entry.js +45 -106
  101. package/dist/esm/tl-event-list.entry.js +74 -37
  102. package/dist/esm/tl-login.entry.js +76 -142
  103. package/dist/esm/tl-my-orders.entry.js +54 -93
  104. package/dist/esm/tl-occurrence-selector_2.entry.js +206 -642
  105. package/dist/esm/tl-order-confirmation.entry.js +73 -106
  106. package/dist/esm/tl-order-tickets_2.entry.js +51 -77
  107. package/dist/esm/tl-promo-code.entry.js +52 -48
  108. package/dist/esm/tl-seat-map.entry.js +4 -4
  109. package/dist/esm/web-query-Bdbb2lk5.js +14 -0
  110. package/dist/ticketlayer-elements/index.esm.js +1 -1
  111. package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
  112. package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
  113. package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
  114. package/dist/ticketlayer-elements/p-5135630e.entry.js +1 -0
  115. package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
  116. package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
  117. package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
  118. package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
  119. package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
  120. package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
  121. package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
  122. package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
  123. package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
  124. package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
  125. package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
  126. package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
  127. package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
  128. package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
  129. package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
  130. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
  131. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
  132. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
  133. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
  134. package/dist/types/components/tl-cart/tl-cart.d.ts +40 -32
  135. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
  136. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
  137. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
  138. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
  139. package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
  140. package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
  141. package/dist/types/components/tl-login/tl-login.d.ts +68 -22
  142. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
  143. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
  144. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
  145. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
  146. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
  147. package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
  148. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +61 -32
  149. package/dist/types/components.d.ts +302 -62
  150. package/dist/types/utils/cart-totals.d.ts +10 -0
  151. package/dist/types/utils/order-summary.d.ts +16 -65
  152. package/dist/types/utils/testing/deep-text.d.ts +13 -0
  153. package/dist/types/utils/testing/fixtures.d.ts +225 -0
  154. package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
  155. package/dist/types/utils/web-query.d.ts +18 -0
  156. package/dist/types/utils/web-storage.d.ts +16 -0
  157. package/elements.catalogue.json +676 -55
  158. package/package.json +14 -6
  159. package/dist/cjs/order-summary-ZMkJ5bez.js +0 -116
  160. package/dist/components/order-summary.js +0 -1
  161. package/dist/esm/order-summary-BGekdjN9.js +0 -103
  162. package/dist/ticketlayer-elements/p-0b1d16f8.entry.js +0 -1
  163. package/dist/ticketlayer-elements/p-1471f6d8.entry.js +0 -1
  164. package/dist/ticketlayer-elements/p-1c51cbc1.entry.js +0 -1
  165. package/dist/ticketlayer-elements/p-5169f68b.entry.js +0 -1
  166. package/dist/ticketlayer-elements/p-895ba1f3.entry.js +0 -1
  167. package/dist/ticketlayer-elements/p-8d5722e1.entry.js +0 -1
  168. package/dist/ticketlayer-elements/p-917d8e09.entry.js +0 -1
  169. package/dist/ticketlayer-elements/p-9629029a.entry.js +0 -1
  170. package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
  171. package/dist/ticketlayer-elements/p-CNX8hZa8.js +0 -3
  172. package/dist/ticketlayer-elements/p-a22714d0.entry.js +0 -1
  173. package/dist/ticketlayer-elements/p-bf73044b.entry.js +0 -1
  174. package/dist/ticketlayer-elements/p-e02079fa.entry.js +0 -1
  175. package/dist/ticketlayer-elements/p-e04ace15.entry.js +0 -1
  176. package/dist/ticketlayer-elements/p-e6fab1d5.entry.js +0 -1
  177. package/dist/ticketlayer-elements/p-f826b753.entry.js +0 -1
  178. package/dist/ticketlayer-elements/p-fa639d88.entry.js +0 -1
  179. package/dist/ticketlayer-elements/p-fbaca948.entry.js +0 -1
@@ -1,10 +1,7 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { type SDKCustomer } from '../../utils/sdk-connector';
3
- export type TlLoginPhase = 'email' | 'sent' | 'code' | 'verifying' | 'signed-in';
4
- export interface TlAuthChanged {
5
- customer: SDKCustomer | null;
6
- authenticated: boolean;
7
- }
2
+ import { type LoginDerived, type LoginProps, type LoginState, type TlAuthChanged as CoreTlAuthChanged, type TlLoginPhase as CoreTlLoginPhase } from '@ticketlayer/elements-core';
3
+ export type TlLoginPhase = CoreTlLoginPhase;
4
+ export type TlAuthChanged = CoreTlAuthChanged;
8
5
  /**
9
6
  * tl-login - magic-link sign-in. The customer enters an email, we ask the SDK
10
7
  * to send a link (POST /sales/customer-auth/magic-link), then either the link
@@ -15,6 +12,13 @@ export interface TlAuthChanged {
15
12
  * States: enter email -> check your inbox (resend, enter code) -> signed in
16
13
  * (email + sign out).
17
14
  *
15
+ * The web harness for `loginCore`: it renders and it forwards. The phases, the
16
+ * exchange, the auth subscriptions and every string are in
17
+ * `@ticketlayer/elements-core` (AGENTS.md, TKT-11). What is left here is the
18
+ * Stencil surface and the two genuinely web things: the client the page
19
+ * published on `window.Ticketlayer`, and `window.location.search`, which is
20
+ * where this runtime keeps the `?code=` the core asks for.
21
+ *
18
22
  * Usage: <tl-login></tl-login>
19
23
  *
20
24
  * @event tlAuthChanged - signed in or out ({ customer, authenticated })
@@ -26,13 +30,6 @@ export declare class TlLogin {
26
30
  heading: string;
27
31
  /** Offer a "enter the code" path alongside the emailed link (default true). */
28
32
  allowCodeEntry: boolean;
29
- phase: TlLoginPhase;
30
- email: string;
31
- code: string;
32
- busy: boolean;
33
- error: string | null;
34
- notice: string | null;
35
- customer: SDKCustomer | null;
36
33
  tlAuthChanged: EventEmitter<TlAuthChanged>;
37
34
  tlMagicLinkSent: EventEmitter<{
38
35
  email: string;
@@ -40,20 +37,69 @@ export declare class TlLogin {
40
37
  tlError: EventEmitter<{
41
38
  message: string;
42
39
  }>;
43
- private auth;
44
- private unsubscribes;
45
- private urlCodeUsed;
46
- componentWillLoad(): Promise<void>;
40
+ private element;
41
+ private unsubscribe?;
42
+ private teardown?;
43
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
44
+ view: import("@ticketlayer/elements-core").ElementView<LoginProps, LoginState, LoginDerived, CoreTlLoginPhase, {
45
+ signedInPrefix: string;
46
+ fallbackAccount: string;
47
+ signOut: string;
48
+ verifyingTitle: string;
49
+ verifyingLead: string;
50
+ sentTitle: string;
51
+ sentLeadBefore: string;
52
+ sentLeadAfter: string;
53
+ sentAgain: string;
54
+ resendLink: string;
55
+ resending: string;
56
+ enterCodeInstead: string;
57
+ differentEmail: string;
58
+ codeTitle: string;
59
+ codeLeadBefore: string;
60
+ codeLeadAfter: string;
61
+ codeLabel: string;
62
+ codePlaceholder: string;
63
+ codeSubmit: string;
64
+ checking: string;
65
+ back: string;
66
+ emailLead: string;
67
+ emailLabel: string;
68
+ emailPlaceholder: string;
69
+ emailSubmit: string;
70
+ sendingLink: string;
71
+ enterEmail: string;
72
+ enterCode: string;
73
+ codeRejected: string;
74
+ requestFailed: string;
75
+ unavailable: string;
76
+ unsupported: string;
77
+ }>;
78
+ syncProps(): void;
79
+ connectedCallback(): void;
80
+ /**
81
+ * Nothing is painted until this page's client is up.
82
+ *
83
+ * A rendering decision, and the harness's to make: Stencil waits on this
84
+ * promise before the first render, and without it the form would flash
85
+ * disabled for a microtask on every page. The core is already at work by
86
+ * now - `connectedCallback` mounted it - so this waits on the same
87
+ * `whenSDK()` it is waiting on rather than deciding anything of its own, and
88
+ * a page that never starts Live renders the core's "not available" state
89
+ * instead of hanging.
90
+ */
91
+ componentWillLoad(): Promise<import("../../utils/sdk-connector").TicketlayerSDK | undefined>;
92
+ /**
93
+ * Off screen: run the mount's teardown, which drops both auth
94
+ * subscriptions. Not `destroy()`: Stencil calls this for a DOM move as well
95
+ * as a removal, and a destroyed core never mounts again.
96
+ */
47
97
  disconnectedCallback(): void;
48
- private codeFromUrl;
49
- private syncFromSDK;
98
+ private forward;
50
99
  private handleEmailInput;
51
100
  private handleCodeInput;
52
101
  private handleEmailSubmit;
53
102
  private handleCodeSubmit;
54
- private requestLink;
55
- private exchange;
56
- private signOut;
57
103
  private renderError;
58
104
  render(): any;
59
105
  }
@@ -1,11 +1,15 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { type TlOrderData } from '../../utils/order-summary';
2
+ import { type MyOrdersDerived, type MyOrdersProps, type MyOrdersState, type MyOrdersStatus } from '@ticketlayer/elements-core';
3
3
  /**
4
4
  * tl-my-orders - the signed-in customer's orders (GET /sales/my-orders through
5
5
  * the SDK): event, date, ticket count, total and status per row. Clicking a
6
6
  * row expands it to show the order's tickets (tl-order-tickets). Shows
7
7
  * tl-login inline when nobody is signed in.
8
8
  *
9
+ * The web harness for `myOrdersCore`: it renders and it forwards. Who is
10
+ * signed in, the two auth subscriptions that keep that current, the listing
11
+ * and every string are in `@ticketlayer/elements-core` (AGENTS.md, TKT-11).
12
+ *
9
13
  * Usage: <tl-my-orders></tl-my-orders>
10
14
  *
11
15
  * @event tlOrderSelect - a row was expanded ({ orderId })
@@ -16,24 +20,38 @@ export declare class TlMyOrders {
16
20
  emptyMessage: string;
17
21
  /** Columns for the expanded ticket grid. */
18
22
  columns: number;
19
- orders: TlOrderData[];
20
- authenticated: boolean;
21
- loading: boolean;
22
- error: string | null;
23
- expandedId: string | null;
24
23
  tlOrderSelect: EventEmitter<{
25
24
  orderId: string;
26
25
  }>;
27
26
  tlError: EventEmitter<{
28
27
  message: string;
29
28
  }>;
30
- private sdk;
31
- private unsubscribes;
32
- componentWillLoad(): Promise<void>;
29
+ private element;
30
+ private unsubscribe?;
31
+ private teardown?;
32
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
33
+ view: import("@ticketlayer/elements-core").ElementView<MyOrdersProps, MyOrdersState, MyOrdersDerived, MyOrdersStatus, {
34
+ signInTitle: string;
35
+ signInText: string;
36
+ errorTitle: string;
37
+ emptyTitle: string;
38
+ orderPrefix: string;
39
+ unnamedEvent: string;
40
+ ticketSingular: string;
41
+ ticketPlural: string;
42
+ unavailable: string;
43
+ noOrdersManager: string;
44
+ loadFailed: string;
45
+ }>;
46
+ syncProps(): void;
47
+ connectedCallback(): void;
48
+ /**
49
+ * Off screen: run the mount's teardown, which drops both auth
50
+ * subscriptions. Not `destroy()`: Stencil calls this for a DOM move as well
51
+ * as a removal, and a destroyed core never mounts again.
52
+ */
33
53
  disconnectedCallback(): void;
34
- private syncAuth;
35
- private load;
36
- private toggle;
54
+ private forward;
37
55
  private renderRow;
38
56
  render(): any;
39
57
  }
@@ -1,29 +1,25 @@
1
- import { EventEmitter } from '../../stencil-public-runtime';
2
1
  /**
3
- * Occurrence data structure
2
+ * The web harness for `occurrenceSelectorCore`.
3
+ *
4
+ * It renders and it forwards. Which of the three views to show, where the
5
+ * calendar opens, which days and times are pressable, how far the month
6
+ * navigation may walk and every label are in `@ticketlayer/elements-core`
7
+ * (AGENTS.md, TKT-11, TKT-202). What is left here is the Stencil surface a host
8
+ * writes HTML against, the icons, and the three things that are genuinely web:
9
+ *
10
+ * - finding the client the page published on `window.Ticketlayer`;
11
+ * - measuring the element, with a `ResizeObserver`, and telling the core what
12
+ * it measured - the core decides what a width means;
13
+ * - writing the host's `theme` prop onto the element as `--tl-*` custom
14
+ * properties. Those nine are the same nine the stylesheet reads and the core
15
+ * declares, so nothing is themed here that the catalogue cannot see - a
16
+ * token named only in a `.tsx` would be invisible to
17
+ * `scripts/check-core-tokens.mjs`, which reads the stylesheet.
4
18
  */
5
- export interface TlOccurrence {
6
- id: string;
7
- startsAt: string;
8
- endsAt?: string;
9
- status?: string;
10
- availableCapacity?: number;
11
- soldOut?: boolean;
12
- }
13
- /**
14
- * Theme configuration for styling
15
- */
16
- export interface TlOccurrenceSelectorTheme {
17
- primaryColor?: string;
18
- primaryForeground?: string;
19
- backgroundColor?: string;
20
- foregroundColor?: string;
21
- mutedColor?: string;
22
- mutedForeground?: string;
23
- borderColor?: string;
24
- borderRadius?: string;
25
- fontFamily?: string;
26
- }
19
+ import { EventEmitter } from '../../stencil-public-runtime';
20
+ import { type OccurrenceSelectorDerived, type OccurrenceSelectorProps, type OccurrenceSelectorState, type OccurrenceSelectorStatus, type TlOccurrence as CoreTlOccurrence, type TlOccurrenceSelectorTheme as CoreTlOccurrenceSelectorTheme } from '@ticketlayer/elements-core';
21
+ export type TlOccurrence = CoreTlOccurrence;
22
+ export type TlOccurrenceSelectorTheme = CoreTlOccurrenceSelectorTheme;
27
23
  type DisplayMode = 'list' | 'slots' | 'calendar';
28
24
  type Orientation = 'horizontal' | 'vertical' | 'auto';
29
25
  export declare class TlOccurrenceSelector {
@@ -49,159 +45,75 @@ export declare class TlOccurrenceSelector {
49
45
  tlSelect: EventEmitter<{
50
46
  occurrence: TlOccurrence;
51
47
  }>;
52
- /**
53
- * Loading state
54
- */
55
- loading: boolean;
56
- /**
57
- * Error message
58
- */
59
- error: string | null;
60
- /**
61
- * Fetched occurrences
62
- */
63
- occurrences: TlOccurrence[];
64
- /**
65
- * Current month being displayed in calendar view
66
- */
67
- currentMonth: Date;
68
- /**
69
- * Currently selected date in calendar view
70
- */
71
- selectedDate: Date | null;
72
- /**
73
- * Computed display mode based on occurrences
74
- */
75
- computedDisplayMode: DisplayMode;
76
- /**
77
- * Container width for responsive layout
78
- */
79
- containerWidth: number;
48
+ private element;
49
+ private unsubscribe?;
50
+ private teardown?;
80
51
  private containerRef?;
81
52
  private resizeObserver?;
82
- componentWillLoad(): Promise<void>;
83
- /**
84
- * Wait for SDK to be ready, then fetch occurrences
85
- */
86
- private waitForSDKAndFetch;
87
- componentDidLoad(): void;
88
- disconnectedCallback(): void;
89
- onEventIdChange(): Promise<void>;
90
- /**
91
- * Fetch occurrences from the SDK
92
- */
93
- private fetchOccurrences;
94
- /**
95
- * Compute the display mode based on occurrence count and date distribution
96
- */
97
- private computeDisplayMode;
98
- /**
99
- * Compute the initial date selection for calendar/slots views
100
- */
101
- private computeInitialSelection;
102
- /**
103
- * Get a map of dates to occurrences
104
- */
105
- private getDatesWithOccurrences;
106
- /**
107
- * Get the first and last occurrence dates
108
- */
109
- private getDateRange;
110
- /**
111
- * Check if all occurrences fit in one week (Monday-Sunday)
112
- */
113
- private isSingleWeek;
114
- /**
115
- * Check if all occurrences are in the same month
116
- */
117
- private isSingleMonth;
118
- /**
119
- * Check if we should use horizontal layout
120
- */
121
- private isHorizontalLayout;
122
- /**
123
- * Format a date for display
124
- */
125
- private formatDate;
126
- /**
127
- * Format a time for display
128
- */
129
- private formatTime;
130
- /**
131
- * Format a full date and time for list view
132
- */
133
- private formatDateTime;
134
- /**
135
- * Handle occurrence selection
136
- */
137
- private handleSelect;
138
- /**
139
- * Handle date selection in calendar view
140
- */
141
- private handleDateSelect;
142
- /**
143
- * Navigate to previous month
144
- */
145
- private handlePrevMonth;
146
- /**
147
- * Navigate to next month
148
- */
149
- private handleNextMonth;
150
- /**
151
- * Check if prev month button should be disabled
152
- */
153
- private isPrevMonthDisabled;
154
- /**
155
- * Check if next month button should be disabled
156
- */
157
- private isNextMonthDisabled;
158
- /**
159
- * Get calendar grid days for the current month
160
- */
161
- private getCalendarDays;
162
- /**
163
- * Check if a date has occurrences
164
- */
165
- private hasOccurrencesOnDate;
53
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
54
+ view: import("@ticketlayer/elements-core").ElementView<OccurrenceSelectorProps, OccurrenceSelectorState, OccurrenceSelectorDerived, OccurrenceSelectorStatus, {
55
+ noEventId: string;
56
+ noClient: string;
57
+ notFound: string;
58
+ loadFailed: string;
59
+ empty: string;
60
+ retry: string;
61
+ soldOut: string;
62
+ available: string;
63
+ selectADate: string;
64
+ previousMonth: string;
65
+ nextMonth: string;
66
+ weekdayMon: string;
67
+ weekdayTue: string;
68
+ weekdayWed: string;
69
+ weekdayThu: string;
70
+ weekdayFri: string;
71
+ weekdaySat: string;
72
+ weekdaySun: string;
73
+ }>;
166
74
  /**
167
- * Check if all occurrences on a date are sold out
75
+ * A new event is a new subject: the element is torn down and mounted again,
76
+ * so whatever the core set up for the old one is undone before anything is
77
+ * set up for the new one.
168
78
  */
169
- private isDateSoldOut;
79
+ watchSubject(): void;
80
+ syncProps(): void;
170
81
  /**
171
- * Get occurrences for the selected date
82
+ * On screen: subscribe to the view, then put the core to work.
83
+ *
84
+ * `connectedCallback` and not `componentWillLoad` because this runs again
85
+ * when the element is moved in the DOM, and that is exactly when a mount and
86
+ * its teardown have to pair up.
172
87
  */
173
- private getSelectedDateOccurrences;
88
+ connectedCallback(): void;
89
+ /** Measuring the element is the runtime's job; what a width means is not. */
90
+ componentDidLoad(): void;
174
91
  /**
175
- * Get CSS custom properties from theme
92
+ * Off screen: run the mount's teardown, and nothing more. Not `destroy()`:
93
+ * Stencil calls this for a DOM move as well as a removal, and a destroyed
94
+ * core never mounts again.
176
95
  */
177
- private getThemeStyles;
96
+ disconnectedCallback(): void;
97
+ private forward;
178
98
  /**
179
- * Render the list view (≤5 occurrences)
99
+ * The host's theme, as custom properties over the ones the theme package
100
+ * ships. Web only: a custom property is not a fact every runtime has, so the
101
+ * core declares the prop and the harness is what acts on it.
180
102
  */
103
+ private themeStyles;
104
+ /** The availability mark a row carries, in the list and the slots panel. */
105
+ private renderRowStatus;
106
+ /** The list view (five occurrences or fewer). */
181
107
  private renderListView;
182
- /**
183
- * Render the time slots view (>5 occurrences, same day)
184
- */
108
+ /** The time slots view (more than five, all on one date). */
185
109
  private renderSlotsView;
186
- /**
187
- * Render the calendar header
188
- */
189
110
  private renderCalendarHeader;
190
- /**
191
- * Render the calendar grid
192
- */
111
+ private renderCalendarDay;
193
112
  private renderCalendarGrid;
194
- /**
195
- * Render the selected date's time slots
196
- */
113
+ /** The picked date's times, beside or below the calendar. */
197
114
  private renderSelectedDateSlots;
198
- /**
199
- * Render the calendar view with slots panel
200
- */
201
115
  private renderCalendarView;
202
- /**
203
- * Render skeleton loading state
204
- */
116
+ /** The skeleton, which is a calendar because that is the common shape. */
205
117
  private renderSkeleton;
206
118
  render(): any;
207
119
  }
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import { type TlOrderData, type TlResolvedOccurrence } from '../../utils/order-summary';
2
+ import { type OrderConfirmationDerived, type OrderConfirmationProps, type OrderConfirmationState, type OrderConfirmationStatus, type TlOrderData } from '@ticketlayer/elements-core';
3
3
  /**
4
4
  * tl-order-confirmation - the "thank you" page block: order reference,
5
5
  * customer email, event and date, ticket lines, totals, then the tickets
@@ -12,6 +12,13 @@ import { type TlOrderData, type TlResolvedOccurrence } from '../../utils/order-s
12
12
  * 3. the SDK's `checkout:completed` event, for a page that mounts this before
13
13
  * the customer pays
14
14
  *
15
+ * The web harness for `orderConfirmationCore`: it renders and it forwards. All
16
+ * three of those routes, the money rows, the event lookup and every string are
17
+ * in `@ticketlayer/elements-core` (AGENTS.md, TKT-11). What is left here is the
18
+ * Stencil surface and the two genuinely web things: the client the page
19
+ * published on `window.Ticketlayer`, and `window.location.search`, which is
20
+ * where this runtime keeps the parameters the core asks for.
21
+ *
15
22
  * Usage: <tl-order-confirmation order-id="ord_xxx"></tl-order-confirmation>
16
23
  *
17
24
  * @event tlOrderLoaded - the order was loaded
@@ -26,28 +33,54 @@ export declare class TlOrderConfirmation {
26
33
  showTickets: boolean;
27
34
  /** Columns for the ticket grid. */
28
35
  columns: number;
29
- order: TlOrderData | null;
30
- resolvedOrderId: string | null;
31
- loading: boolean;
32
- error: string | null;
33
- paymentFailed: boolean;
34
- occurrence: TlResolvedOccurrence | null;
35
- signedInCustomer: unknown | null;
36
36
  tlOrderLoaded: EventEmitter<{
37
37
  order: TlOrderData;
38
38
  }>;
39
39
  tlError: EventEmitter<{
40
40
  message: string;
41
41
  }>;
42
+ private element;
42
43
  private unsubscribe?;
43
- watchOrderId(next?: string): void;
44
- componentWillLoad(): Promise<void>;
45
- componentDidLoad(): void;
44
+ private teardown?;
45
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
46
+ view: import("@ticketlayer/elements-core").ElementView<OrderConfirmationProps, OrderConfirmationState, OrderConfirmationDerived, OrderConfirmationStatus, {
47
+ paymentFailedTitle: string;
48
+ paymentFailedLead: string;
49
+ title: string;
50
+ leadPrefix: string;
51
+ leadSuffix: string;
52
+ leadGeneric: string;
53
+ errorPrefix: string;
54
+ rowReference: string;
55
+ rowEmail: string;
56
+ rowEvent: string;
57
+ rowDate: string;
58
+ subtotalRow: string;
59
+ taxRow: string;
60
+ discountRow: string;
61
+ totalRow: string;
62
+ ticketsTitle: string;
63
+ ticketsHint: string;
64
+ noOrdersManager: string;
65
+ notFound: string;
66
+ loadFailed: string;
67
+ }>;
68
+ /**
69
+ * A new order id is a new subject, and the core resolves it again the way
70
+ * the mount did - the prop first, the link second. Not a remount: the
71
+ * `checkout:completed` subscription belongs to the element rather than to
72
+ * the order it is showing.
73
+ */
74
+ watchOrderId(): void;
75
+ syncProps(): void;
76
+ connectedCallback(): void;
77
+ /**
78
+ * Off screen: run the mount's teardown, which drops the
79
+ * `checkout:completed` subscription. Not `destroy()`: Stencil calls this for
80
+ * a DOM move as well as a removal, and a destroyed core never mounts again.
81
+ */
46
82
  disconnectedCallback(): void;
47
- private urlParams;
48
- private orderIdFromUrl;
49
- private load;
50
- private resolveEvent;
83
+ private forward;
51
84
  private renderRows;
52
85
  private renderTotals;
53
86
  render(): any;
@@ -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
  }