@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,5 +1,14 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
- import type { TlEventCardEvent } from '../tl-event-card/tl-event-card';
2
+ import { type EventListDerived, type EventListProps, type EventListState, type EventListStatus } from '@ticketlayer/elements-core';
3
+ /**
4
+ * tl-event-list - what the channel is selling, as a grid of tl-event-card.
5
+ *
6
+ * The web harness for `eventListCore`: it renders and it forwards. What to ask
7
+ * for, what came back and every string are in `@ticketlayer/elements-core`
8
+ * (AGENTS.md, TKT-11).
9
+ *
10
+ * Usage: <tl-event-list limit="12" columns="3"></tl-event-list>
11
+ */
3
12
  export declare class TlEventList {
4
13
  /**
5
14
  * Maximum number of events to display
@@ -13,18 +22,49 @@ export declare class TlEventList {
13
22
  * Columns for grid layout (1, 2, 3, or 4)
14
23
  */
15
24
  columns: number;
16
- events: TlEventCardEvent[];
17
- loading: boolean;
18
- error: string | null;
19
25
  /**
20
26
  * Emitted when an event card is clicked
21
27
  */
22
28
  tlEventClick: EventEmitter<{
23
29
  eventId: string;
24
30
  }>;
31
+ private element;
32
+ private unsubscribe?;
33
+ private teardown?;
34
+ /** The core's whole view. Assigning it is what makes Stencil re-render. */
35
+ view: import("@ticketlayer/elements-core").ElementView<EventListProps, EventListState, EventListDerived, EventListStatus, {
36
+ errorTitle: string;
37
+ emptyTitle: string;
38
+ emptyMessage: string;
39
+ loadFailed: string;
40
+ noListing: string;
41
+ }>;
42
+ /** A different question deserves a fresh answer. */
25
43
  watchFiltersChange(): void;
26
- componentWillLoad(): Promise<void>;
27
- private loadEvents;
44
+ syncProps(): void;
45
+ connectedCallback(): void;
46
+ /**
47
+ * Nothing is painted until the first listing has landed.
48
+ *
49
+ * Kept as found rather than improved, and it is the harness's to keep: the
50
+ * component awaited its read in `componentWillLoad`, and Stencil does not
51
+ * paint a component until that resolves, so a slow channel shows an empty
52
+ * box where the skeleton markup below would fit. Held by the spec.
53
+ *
54
+ * Expressed against the core's own status rather than against a read this
55
+ * harness starts, because the read is the core's (`connectedCallback` has
56
+ * already mounted it). Every later read draws the skeleton, exactly as
57
+ * before.
58
+ */
59
+ componentWillLoad(): Promise<void> | undefined;
60
+ /**
61
+ * Off screen: run the mount's teardown, and nothing more. `destroy()` is
62
+ * terminal and Stencil calls this for a move as well as a removal, so
63
+ * destroying here would leave a re-inserted element frozen.
64
+ */
65
+ disconnectedCallback(): void;
66
+ private forward;
67
+ /** A card was clicked. The core has nothing to decide about it; pass it on. */
28
68
  private handleEventClick;
29
69
  render(): any;
30
70
  }
@@ -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;