@forgebuild/hotal-ui 0.23.205 → 0.24.1
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 +2 -2
- 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 +11297 -11106
- package/dist/index.d.ts +44 -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
|
@@ -110,6 +110,11 @@ export interface BookingFlowElement extends HTMLElement {
|
|
|
110
110
|
stripeAppearance?: Record<string, unknown>;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
export interface MenuItemBadge {
|
|
114
|
+
label: string;
|
|
115
|
+
tone?: 'accent';
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
export interface MenuItem {
|
|
114
119
|
/** Needed to add this item to a cart (see MenuSectionElement.cartEnabled)
|
|
115
120
|
* -- an item missing this never gets a quantity stepper. */
|
|
@@ -125,11 +130,15 @@ export interface MenuItem {
|
|
|
125
130
|
group?: string;
|
|
126
131
|
country?: string;
|
|
127
132
|
allergens?: string[];
|
|
133
|
+
badges?: MenuItemBadge[];
|
|
134
|
+
notes?: string[];
|
|
128
135
|
}
|
|
129
136
|
|
|
130
137
|
export interface MenuCategory {
|
|
131
138
|
label: string;
|
|
132
139
|
items: MenuItem[];
|
|
140
|
+
aside?: string;
|
|
141
|
+
note?: string;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
export interface MenuCartItem {
|
|
@@ -185,6 +194,41 @@ export interface MenuSectionElement extends HTMLElement {
|
|
|
185
194
|
* quantities a host changed elsewhere, same as
|
|
186
195
|
* ProshopCatalogueElement's own `initial`. */
|
|
187
196
|
initial?: { id: string; quantity: number }[];
|
|
197
|
+
/** Set by renderMenuSection(); skips the entrance tweens over content that is already on screen. */
|
|
198
|
+
prerendered?: boolean;
|
|
199
|
+
/** Small print under the panels (e.g. a consumer advisory). */
|
|
200
|
+
footnote?: string;
|
|
201
|
+
/** The heading's level. Default: h1 in the classic variant, h2 in 'panel',
|
|
202
|
+
* as before -- a host page that already has its own h1 sets 2. */
|
|
203
|
+
headingLevel?: 1 | 2 | 3;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** The serialisable props of <menu-section>, as renderMenuSection() (from
|
|
207
|
+
* '@forgebuild/hotal-ui/server') takes them. */
|
|
208
|
+
export interface MenuSectionProps {
|
|
209
|
+
title?: string;
|
|
210
|
+
eyebrow?: string;
|
|
211
|
+
categories?: MenuCategory[];
|
|
212
|
+
info?: MenuInfoItem[];
|
|
213
|
+
allergens?: Allergen[];
|
|
214
|
+
pdfUrl?: string;
|
|
215
|
+
pdfLabel?: string;
|
|
216
|
+
topFlourishSrc?: string;
|
|
217
|
+
tailFlourishSrc?: string;
|
|
218
|
+
headingCircleColor?: string;
|
|
219
|
+
headingAlign?: 'center' | 'left';
|
|
220
|
+
layout?: 'stacked' | 'split';
|
|
221
|
+
variant?: 'default' | 'panel';
|
|
222
|
+
disableHeadingMotion?: boolean;
|
|
223
|
+
itemColumns?: 2 | 3;
|
|
224
|
+
openInNewTabLabel?: string;
|
|
225
|
+
closeAriaLabel?: string;
|
|
226
|
+
groupFilter?: boolean;
|
|
227
|
+
countryFilter?: boolean;
|
|
228
|
+
groupFilterAllLabel?: string;
|
|
229
|
+
countryFilterAllLabel?: string;
|
|
230
|
+
footnote?: string;
|
|
231
|
+
headingLevel?: 1 | 2 | 3;
|
|
188
232
|
}
|
|
189
233
|
|
|
190
234
|
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
|
+
}
|