@forgebuild/hotal-ui 0.23.205 → 0.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/dist/components/ai-chat-widget.js +4 -4
- package/dist/components/availability-calendar.js +2 -2
- package/dist/components/booking-card.js +2 -2
- package/dist/components/booking-checkout.js +2 -2
- package/dist/components/booking-confirmed.js +1 -1
- package/dist/components/booking-flow.js +26 -26
- package/dist/components/booking-progress-bar.js +1 -1
- package/dist/components/booking-summary.js +2 -2
- package/dist/components/chunks/client-DNa0V682.js +3 -0
- package/dist/components/confirmation-card.js +2 -2
- package/dist/components/dining-teaser.js +2 -2
- package/dist/components/event-contact-form.js +2 -2
- package/dist/components/event-inquiries-feed.js +2 -2
- package/dist/components/extras-catalogue.js +2 -2
- package/dist/components/floor-plan-hero.js +2 -2
- package/dist/components/google-reviews.js +2 -2
- package/dist/components/instagram-feed.js +2 -2
- package/dist/components/island-map.js +1 -1
- package/dist/components/live-dining-orders-feed.js +2 -2
- package/dist/components/live-golf-bookings-feed.js +2 -2
- package/dist/components/live-reservations-feed.js +2 -2
- package/dist/components/live-room-bookings-feed.js +2 -2
- package/dist/components/live-shop-orders-feed.js +2 -2
- package/dist/components/live-spa-bookings-feed.js +2 -2
- package/dist/components/menu-section.js +13 -7
- package/dist/components/proshop-catalogue.js +2 -2
- package/dist/components/reservation-bar.js +2 -2
- package/dist/components/reservation-cancel.js +2 -2
- package/dist/components/restaurant-order-form.js +2 -2
- package/dist/components/room-grid.js +2 -2
- package/dist/components/searchable-select.js +2 -2
- package/dist/components/service-booking-bar.js +2 -2
- package/dist/components/spa-booking-widget.js +3 -3
- package/dist/components/stay-search.js +2 -2
- package/dist/components/tripadvisor-reviews.js +2 -2
- package/dist/components/venue-carousel.js +2 -2
- package/dist/hotal-ui.js +11327 -11125
- package/dist/index.d.ts +47 -0
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.js +34 -0
- package/dist/server/menu-section.js +944 -0
- package/dist/server/menu-section.meta.js +2 -0
- package/package.json +8 -2
- package/dist/components/chunks/client-BDk8LqGN.js +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -108,6 +108,14 @@ export interface BookingFlowElement extends HTMLElement {
|
|
|
108
108
|
book?: (details: BookingDetails) => Promise<BookResult>;
|
|
109
109
|
stripePublishableKey?: string;
|
|
110
110
|
stripeAppearance?: Record<string, unknown>;
|
|
111
|
+
/** Prefills the contact fields; the guest can still edit them and still
|
|
112
|
+
* confirms (and adds any card) themselves. */
|
|
113
|
+
contact?: { name?: string; email?: string; phone?: string; notes?: string };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface MenuItemBadge {
|
|
117
|
+
label: string;
|
|
118
|
+
tone?: 'accent';
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
export interface MenuItem {
|
|
@@ -125,11 +133,15 @@ export interface MenuItem {
|
|
|
125
133
|
group?: string;
|
|
126
134
|
country?: string;
|
|
127
135
|
allergens?: string[];
|
|
136
|
+
badges?: MenuItemBadge[];
|
|
137
|
+
notes?: string[];
|
|
128
138
|
}
|
|
129
139
|
|
|
130
140
|
export interface MenuCategory {
|
|
131
141
|
label: string;
|
|
132
142
|
items: MenuItem[];
|
|
143
|
+
aside?: string;
|
|
144
|
+
note?: string;
|
|
133
145
|
}
|
|
134
146
|
|
|
135
147
|
export interface MenuCartItem {
|
|
@@ -185,6 +197,41 @@ export interface MenuSectionElement extends HTMLElement {
|
|
|
185
197
|
* quantities a host changed elsewhere, same as
|
|
186
198
|
* ProshopCatalogueElement's own `initial`. */
|
|
187
199
|
initial?: { id: string; quantity: number }[];
|
|
200
|
+
/** Set by renderMenuSection(); skips the entrance tweens over content that is already on screen. */
|
|
201
|
+
prerendered?: boolean;
|
|
202
|
+
/** Small print under the panels (e.g. a consumer advisory). */
|
|
203
|
+
footnote?: string;
|
|
204
|
+
/** The heading's level. Default: h1 in the classic variant, h2 in 'panel',
|
|
205
|
+
* as before -- a host page that already has its own h1 sets 2. */
|
|
206
|
+
headingLevel?: 1 | 2 | 3;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** The serialisable props of <menu-section>, as renderMenuSection() (from
|
|
210
|
+
* '@forgebuild/hotal-ui/server') takes them. */
|
|
211
|
+
export interface MenuSectionProps {
|
|
212
|
+
title?: string;
|
|
213
|
+
eyebrow?: string;
|
|
214
|
+
categories?: MenuCategory[];
|
|
215
|
+
info?: MenuInfoItem[];
|
|
216
|
+
allergens?: Allergen[];
|
|
217
|
+
pdfUrl?: string;
|
|
218
|
+
pdfLabel?: string;
|
|
219
|
+
topFlourishSrc?: string;
|
|
220
|
+
tailFlourishSrc?: string;
|
|
221
|
+
headingCircleColor?: string;
|
|
222
|
+
headingAlign?: 'center' | 'left';
|
|
223
|
+
layout?: 'stacked' | 'split';
|
|
224
|
+
variant?: 'default' | 'panel';
|
|
225
|
+
disableHeadingMotion?: boolean;
|
|
226
|
+
itemColumns?: 2 | 3;
|
|
227
|
+
openInNewTabLabel?: string;
|
|
228
|
+
closeAriaLabel?: string;
|
|
229
|
+
groupFilter?: boolean;
|
|
230
|
+
countryFilter?: boolean;
|
|
231
|
+
groupFilterAllLabel?: string;
|
|
232
|
+
countryFilterAllLabel?: string;
|
|
233
|
+
footnote?: string;
|
|
234
|
+
headingLevel?: 1 | 2 | 3;
|
|
188
235
|
}
|
|
189
236
|
|
|
190
237
|
export interface EventInquiry {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MenuSectionProps } from '../index';
|
|
2
|
+
|
|
3
|
+
export interface PrerenderedElement {
|
|
4
|
+
/** Attributes for the host element, unescaped -- let your templating escape them. Includes `prerendered`. */
|
|
5
|
+
attributes: Record<string, string>;
|
|
6
|
+
/** `<template shadowrootmode="open">…</template>`: put it inside the element, alongside any slotted light-DOM children. */
|
|
7
|
+
shadowRoot: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Prerenders `<menu-section>` for a host page's HTML. See README → Prerendering. */
|
|
11
|
+
export function renderMenuSection(props?: MenuSectionProps): PrerenderedElement;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Server renderers: prerender a hotal-ui element into a declarative shadow
|
|
2
|
+
// root, so the host page ships real content in its HTML and the element's
|
|
3
|
+
// client script only has to take over. Built into dist/server/ by
|
|
4
|
+
// scripts/build-server.mjs; imported as '@forgebuild/hotal-ui/server'.
|
|
5
|
+
import { render } from 'svelte/server';
|
|
6
|
+
import MenuSection from './menu-section.js';
|
|
7
|
+
import { css as menuSectionCss, props as menuSectionProps } from './menu-section.meta.js';
|
|
8
|
+
|
|
9
|
+
// Props -> the attributes the element reads when it upgrades, from the
|
|
10
|
+
// element's own prop table (read out of the compiled component), so a new
|
|
11
|
+
// prop needs no change here. The client renders the same markup from these
|
|
12
|
+
// that the server printed.
|
|
13
|
+
function attributesFor(props, table) {
|
|
14
|
+
const attributes = {};
|
|
15
|
+
for (const [name, value] of Object.entries(props)) {
|
|
16
|
+
const spec = table[name];
|
|
17
|
+
if (!spec || value === undefined || value === null || typeof value === 'function') continue;
|
|
18
|
+
if (spec.type === 'Boolean') {
|
|
19
|
+
if (value) attributes[spec.attribute] = '';
|
|
20
|
+
} else {
|
|
21
|
+
attributes[spec.attribute] = spec.type === 'Object' || spec.type === 'Array' ? JSON.stringify(value) : String(value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return attributes;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function renderMenuSection(props = {}) {
|
|
28
|
+
const all = { ...props, prerendered: true };
|
|
29
|
+
const { body } = render(MenuSection, { props: all });
|
|
30
|
+
return {
|
|
31
|
+
attributes: attributesFor(all, menuSectionProps),
|
|
32
|
+
shadowRoot: `<template shadowrootmode="open"><style>${menuSectionCss}</style>${body}</template>`,
|
|
33
|
+
};
|
|
34
|
+
}
|