@sdxc/ui 2026.11.18 → 2026.11.26
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 +133 -1
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +1 -0
- package/dist/app/mixins/command-palette.js +10 -2
- package/dist/app/mixins/log-viewer.js +17 -14
- package/dist/app/mixins/route-dialog.d.ts +17 -0
- package/dist/app/mixins/route-dialog.js +53 -0
- package/dist/app/optimistic-toggle.js +6 -0
- package/dist/app/route-dialog.d.ts +38 -0
- package/dist/app/route-dialog.js +49 -0
- package/dist/audio/equalizer.d.ts +24 -0
- package/dist/audio/equalizer.js +57 -0
- package/dist/audio/index.d.ts +16 -0
- package/dist/audio/index.js +16 -0
- package/dist/audio/media-tile.d.ts +38 -0
- package/dist/audio/media-tile.js +98 -0
- package/dist/audio/player-bar.d.ts +108 -0
- package/dist/audio/player-bar.js +338 -0
- package/dist/audio/queue-list.d.ts +56 -0
- package/dist/audio/queue-list.js +102 -0
- package/dist/audio/track-list.d.ts +91 -0
- package/dist/audio/track-list.js +226 -0
- package/dist/audio/utils/media-session.d.ts +44 -0
- package/dist/audio/utils/media-session.js +87 -0
- package/dist/audio/utils/play-queue.d.ts +98 -0
- package/dist/audio/utils/play-queue.js +149 -0
- package/dist/audio/utils/track-time.d.ts +28 -0
- package/dist/audio/utils/track-time.js +36 -0
- package/dist/chat/composer-format.d.ts +35 -0
- package/dist/chat/composer-format.js +84 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mention-menu.d.ts +43 -0
- package/dist/chat/mention-menu.js +70 -0
- package/dist/chat/message-group.d.ts +92 -0
- package/dist/chat/message-group.js +222 -0
- package/dist/chat/mixins/composer-format.d.ts +28 -0
- package/dist/chat/mixins/composer-format.js +80 -0
- package/dist/chat/mixins/composer-send.d.ts +2 -2
- package/dist/chat/mixins/composer-send.js +4 -2
- package/dist/chat/mixins/mention-menu.d.ts +41 -0
- package/dist/chat/mixins/mention-menu.js +213 -0
- package/dist/chat/mixins/reaction-sync.d.ts +47 -0
- package/dist/chat/mixins/reaction-sync.js +172 -0
- package/dist/chat/reaction-bar.d.ts +70 -0
- package/dist/chat/reaction-bar.js +108 -0
- package/dist/chat/typing-indicator.d.ts +42 -0
- package/dist/chat/typing-indicator.js +68 -0
- package/dist/chat/utils/composer-text.d.ts +38 -0
- package/dist/chat/utils/composer-text.js +86 -0
- package/dist/chat/utils/markdown-format.d.ts +30 -0
- package/dist/chat/utils/markdown-format.js +158 -0
- package/dist/chat/utils/mention-query.d.ts +55 -0
- package/dist/chat/utils/mention-query.js +60 -0
- package/dist/commerce/cart-drawer.d.ts +69 -0
- package/dist/commerce/cart-drawer.js +163 -0
- package/dist/commerce/cart-line.d.ts +32 -0
- package/dist/commerce/cart-line.js +43 -0
- package/dist/commerce/checkout-layout.d.ts +32 -0
- package/dist/commerce/checkout-layout.js +51 -0
- package/dist/commerce/facet-filters.d.ts +121 -0
- package/dist/commerce/facet-filters.js +318 -0
- package/dist/commerce/fulfilment-note.d.ts +28 -0
- package/dist/commerce/fulfilment-note.js +26 -0
- package/dist/commerce/index.d.ts +27 -0
- package/dist/commerce/index.js +27 -0
- package/dist/commerce/item-options-dialog.d.ts +67 -0
- package/dist/commerce/item-options-dialog.js +150 -0
- package/dist/commerce/menu-item-card.d.ts +37 -0
- package/dist/commerce/menu-item-card.js +96 -0
- package/dist/commerce/option-group.d.ts +62 -0
- package/dist/commerce/option-group.js +121 -0
- package/dist/commerce/order-summary.d.ts +42 -0
- package/dist/commerce/order-summary.js +76 -0
- package/dist/commerce/order-tracker.d.ts +80 -0
- package/dist/commerce/order-tracker.js +178 -0
- package/dist/commerce/price.d.ts +52 -0
- package/dist/commerce/price.js +108 -0
- package/dist/commerce/product-card.d.ts +53 -0
- package/dist/commerce/product-card.js +127 -0
- package/dist/commerce/product-gallery.d.ts +70 -0
- package/dist/commerce/product-gallery.js +186 -0
- package/dist/commerce/promo-code.d.ts +56 -0
- package/dist/commerce/promo-code.js +101 -0
- package/dist/commerce/quantity-stepper.d.ts +42 -0
- package/dist/commerce/quantity-stepper.js +53 -0
- package/dist/commerce/question-list.d.ts +53 -0
- package/dist/commerce/question-list.js +92 -0
- package/dist/commerce/shipping-estimate.d.ts +53 -0
- package/dist/commerce/shipping-estimate.js +39 -0
- package/dist/commerce/sort-select.d.ts +38 -0
- package/dist/commerce/sort-select.js +38 -0
- package/dist/commerce/variant-picker.d.ts +75 -0
- package/dist/commerce/variant-picker.js +135 -0
- package/dist/components/amount.d.ts +46 -0
- package/dist/components/amount.js +34 -0
- package/dist/components/autocomplete.d.ts +82 -0
- package/dist/components/autocomplete.js +114 -0
- package/dist/components/carousel.d.ts +31 -1
- package/dist/components/carousel.js +66 -3
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +11 -0
- package/dist/components/letterbox.d.ts +47 -0
- package/dist/components/letterbox.js +56 -0
- package/dist/components/lightbox.d.ts +88 -0
- package/dist/components/lightbox.js +224 -0
- package/dist/components/media-grid.d.ts +53 -0
- package/dist/components/media-grid.js +89 -0
- package/dist/components/range-months.d.ts +100 -0
- package/dist/components/range-months.js +274 -0
- package/dist/components/rating-input.d.ts +33 -0
- package/dist/components/rating-input.js +63 -0
- package/dist/components/rating.d.ts +38 -0
- package/dist/components/rating.js +66 -0
- package/dist/components/review-card.d.ts +39 -0
- package/dist/components/review-card.js +59 -0
- package/dist/components/section-bar.d.ts +57 -0
- package/dist/components/section-bar.js +140 -0
- package/dist/components/slider.js +7 -0
- package/dist/components/step-indicator.d.ts +46 -0
- package/dist/components/step-indicator.js +96 -0
- package/dist/finance/index.d.ts +10 -0
- package/dist/finance/index.js +10 -0
- package/dist/finance/ledger.d.ts +60 -0
- package/dist/finance/ledger.js +93 -0
- package/dist/finance/payment-card.d.ts +49 -0
- package/dist/finance/payment-card.js +115 -0
- package/dist/map/engine.d.ts +49 -0
- package/dist/map/engine.js +591 -0
- package/dist/map/index.d.ts +12 -0
- package/dist/map/index.js +12 -0
- package/dist/map/map-canvas.d.ts +101 -0
- package/dist/map/map-canvas.js +275 -0
- package/dist/map/map.d.ts +217 -0
- package/dist/map/map.js +598 -0
- package/dist/map/mixins/map-link.d.ts +30 -0
- package/dist/map/mixins/map-link.js +116 -0
- package/dist/map/utils/basemap.d.ts +88 -0
- package/dist/map/utils/basemap.js +84 -0
- package/dist/map/utils/cluster.d.ts +43 -0
- package/dist/map/utils/cluster.js +80 -0
- package/dist/map/utils/mercator.d.ts +66 -0
- package/dist/map/utils/mercator.js +92 -0
- package/dist/map/utils/stage.d.ts +24 -0
- package/dist/map/utils/stage.js +49 -0
- package/dist/mixins/autocomplete.d.ts +28 -0
- package/dist/mixins/autocomplete.js +283 -0
- package/dist/mixins/carousel-controls.d.ts +14 -3
- package/dist/mixins/carousel-controls.js +89 -30
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/mixins/lightbox-controls.d.ts +34 -0
- package/dist/mixins/lightbox-controls.js +176 -0
- package/dist/schedule/agenda.d.ts +63 -0
- package/dist/schedule/agenda.js +221 -0
- package/dist/schedule/day-strip.d.ts +50 -0
- package/dist/schedule/day-strip.js +136 -0
- package/dist/schedule/free-busy.d.ts +96 -0
- package/dist/schedule/free-busy.js +285 -0
- package/dist/schedule/index.d.ts +15 -0
- package/dist/schedule/index.js +15 -0
- package/dist/schedule/mixins/day-strip-scroll.d.ts +16 -0
- package/dist/schedule/mixins/day-strip-scroll.js +40 -0
- package/dist/schedule/mixins/time-grid-drag.d.ts +24 -0
- package/dist/schedule/mixins/time-grid-drag.js +532 -0
- package/dist/schedule/month-view.d.ts +68 -0
- package/dist/schedule/month-view.js +301 -0
- package/dist/schedule/time-grid.d.ts +168 -0
- package/dist/schedule/time-grid.js +417 -0
- package/dist/schedule/utils/time-grid-layout.d.ts +50 -0
- package/dist/schedule/utils/time-grid-layout.js +93 -0
- package/dist/schedule/year-view.d.ts +46 -0
- package/dist/schedule/year-view.js +142 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/typewriter-text.d.ts +20 -0
- package/dist/styles/typewriter-text.js +23 -0
- package/dist/test/map.d.ts +18 -0
- package/dist/test/map.js +96 -0
- package/dist/test/reels.d.ts +30 -0
- package/dist/test/reels.js +41 -0
- package/dist/test/stories.d.ts +31 -0
- package/dist/test/stories.js +66 -0
- package/dist/travel/boarding-pass.d.ts +107 -0
- package/dist/travel/boarding-pass.js +293 -0
- package/dist/travel/car-offer.d.ts +70 -0
- package/dist/travel/car-offer.js +127 -0
- package/dist/travel/fare-calendar.d.ts +85 -0
- package/dist/travel/fare-calendar.js +233 -0
- package/dist/travel/fare-options.d.ts +84 -0
- package/dist/travel/fare-options.js +142 -0
- package/dist/travel/flight-itinerary.d.ts +84 -0
- package/dist/travel/flight-itinerary.js +112 -0
- package/dist/travel/flight-option.d.ts +58 -0
- package/dist/travel/flight-option.js +111 -0
- package/dist/travel/flight-segment.d.ts +105 -0
- package/dist/travel/flight-segment.js +174 -0
- package/dist/travel/index.d.ts +20 -0
- package/dist/travel/index.js +20 -0
- package/dist/travel/package-savings.d.ts +74 -0
- package/dist/travel/package-savings.js +128 -0
- package/dist/travel/price-breakdown.d.ts +66 -0
- package/dist/travel/price-breakdown.js +102 -0
- package/dist/travel/rating-breakdown.d.ts +81 -0
- package/dist/travel/rating-breakdown.js +132 -0
- package/dist/travel/seat-map.d.ts +108 -0
- package/dist/travel/seat-map.js +371 -0
- package/dist/travel/trip-timeline.d.ts +84 -0
- package/dist/travel/trip-timeline.js +212 -0
- package/dist/utils/gamepad-presses.d.ts +21 -0
- package/dist/utils/gamepad-presses.js +28 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/move-focus.d.ts +20 -0
- package/dist/utils/move-focus.js +28 -0
- package/dist/utils/range-months.d.ts +54 -0
- package/dist/utils/range-months.js +98 -0
- package/dist/utils/swipe-direction.d.ts +23 -0
- package/dist/utils/swipe-direction.js +27 -0
- package/dist/utils/typewriter.d.ts +49 -0
- package/dist/utils/typewriter.js +171 -0
- package/dist/video/index.d.ts +6 -2
- package/dist/video/index.js +6 -2
- package/dist/video/mixins/reel-feed-sync.d.ts +41 -0
- package/dist/video/mixins/reel-feed-sync.js +430 -0
- package/dist/video/mixins/story-viewer-sync.d.ts +31 -0
- package/dist/video/mixins/story-viewer-sync.js +391 -0
- package/dist/video/reel-feed.d.ts +95 -0
- package/dist/video/reel-feed.js +124 -0
- package/dist/video/story-ring.d.ts +32 -0
- package/dist/video/story-ring.js +42 -0
- package/dist/video/story-viewer.d.ts +85 -0
- package/dist/video/story-viewer.js +250 -0
- package/package.json +21 -2
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { NfcIcon, SnowflakeIcon } from "@sdxc/icons";
|
|
3
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
4
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
5
|
+
import { motionReduce } from "@sdxc/u/responsive";
|
|
6
|
+
import { when } from "@sdxc/u/state";
|
|
7
|
+
import { font, tabularNums, weight } from "@sdxc/u/typography";
|
|
8
|
+
/** The width-to-height ratio of a bank card (ISO/IEC 7810 ID-1, 85.60 × 53.98 mm). */
|
|
9
|
+
const CARD_RATIO = "85.6 / 53.98";
|
|
10
|
+
/** The gradient each tone paints, from the theme's own scales. */
|
|
11
|
+
const TONE_BACKGROUND = {
|
|
12
|
+
brand: "linear-gradient(135deg, var(--ui-color-brand-500, #c2410c), var(--ui-color-brand-800, #7c2d12))",
|
|
13
|
+
ink: "linear-gradient(135deg, var(--ui-color-neutral-800, #27272a), var(--ui-color-neutral-950, #09090b))",
|
|
14
|
+
neutral: "linear-gradient(135deg, var(--ui-color-neutral-200, #e4e4e7), var(--ui-color-neutral-400, #a1a1aa))",
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders the card face. Sizes are in container units, so the same card fits a phone's
|
|
18
|
+
* carousel and a desktop column, and the masked number never wraps.
|
|
19
|
+
*
|
|
20
|
+
* @example <PaymentCard label="Everyday card ending 4821" brand="Tuppence" last4="4821" holder="Noor Halvorsen" expires="09/29" network="debit" />
|
|
21
|
+
* @example <PaymentCard label="Online card ending 0937" brand="Tuppence" last4="0937" holder="Noor Halvorsen" expires="03/27" network="debit" kind="virtual" tone="ink" frozen />
|
|
22
|
+
*/
|
|
23
|
+
export function PaymentCard(handle) {
|
|
24
|
+
return () => {
|
|
25
|
+
let { label, brand, last4, holder, expires, network, kind = "physical", virtualLabel = "Virtual", tone = "brand", frozen = false, frozenLabel = "Frozen", expiresLabel = "Exp", mix, ...rest } = handle.props;
|
|
26
|
+
return (_jsxs("div", { role: "group", "aria-label": frozen ? `${label}, ${frozenLabel.toLowerCase()}` : label, ...rest, "data-slot": "payment-card", "data-tone": tone, "data-kind": kind, "data-frozen": frozen ? "" : undefined, mix: mergeMix([
|
|
27
|
+
raw({
|
|
28
|
+
containerType: "inline-size",
|
|
29
|
+
position: "relative",
|
|
30
|
+
isolation: "isolate",
|
|
31
|
+
inlineSize: "100%",
|
|
32
|
+
maxInlineSize: "var(--ui-payment-card-max, 26rem)",
|
|
33
|
+
aspectRatio: CARD_RATIO,
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
borderRadius: "var(--ui-payment-card-radius, 1rem)",
|
|
36
|
+
background: `var(--ui-payment-card-bg, ${TONE_BACKGROUND[tone]})`,
|
|
37
|
+
color: tone === "neutral" ? "var(--ui-color-neutral-900, #18181b)" : "white",
|
|
38
|
+
boxShadow: "0 1px 0 rgb(255 255 255 / 0.18) inset, 0 12px 28px -14px rgb(0 0 0 / 0.45)",
|
|
39
|
+
userSelect: "none",
|
|
40
|
+
}),
|
|
41
|
+
], mix), children: [_jsx(CardPattern, {}), _jsxs("div", { "data-slot": "payment-card-face", mix: [
|
|
42
|
+
raw({
|
|
43
|
+
position: "absolute",
|
|
44
|
+
inset: "0",
|
|
45
|
+
display: "grid",
|
|
46
|
+
gridTemplateRows: "auto 1fr auto auto",
|
|
47
|
+
padding: "6.5cqi 7cqi",
|
|
48
|
+
gap: "2cqi",
|
|
49
|
+
transition: "filter 240ms ease",
|
|
50
|
+
}),
|
|
51
|
+
when("[data-frozen] > &", raw({ filter: "grayscale(0.85) blur(1.5px)", opacity: "0.75" })),
|
|
52
|
+
motionReduce(raw({ transition: "none" })),
|
|
53
|
+
], children: [_jsxs("div", { mix: raw({
|
|
54
|
+
display: "flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
justifyContent: "space-between",
|
|
57
|
+
fontSize: "5cqi",
|
|
58
|
+
}), children: [_jsx("span", { "data-slot": "payment-card-brand", mix: weight("semibold"), children: brand }), kind === "virtual" ? (_jsx("span", { "data-slot": "payment-card-virtual", mix: raw({
|
|
59
|
+
fontSize: "3.4cqi",
|
|
60
|
+
paddingBlock: "0.6cqi",
|
|
61
|
+
paddingInline: "2.4cqi",
|
|
62
|
+
borderRadius: "999px",
|
|
63
|
+
border: "1px solid currentcolor",
|
|
64
|
+
opacity: "0.85",
|
|
65
|
+
letterSpacing: "0.06em",
|
|
66
|
+
textTransform: "uppercase",
|
|
67
|
+
}), children: virtualLabel })) : (_jsx(NfcIcon, { size: 20, "aria-hidden": "true", mix: raw({ inlineSize: "6cqi", blockSize: "6cqi", opacity: "0.8" }) }))] }), _jsx("div", { mix: raw({ alignSelf: "center" }), children: kind === "physical" ? _jsx(Chip, {}) : null }), _jsxs("div", { "data-slot": "payment-card-number", mix: [
|
|
68
|
+
font("mono"),
|
|
69
|
+
tabularNums(),
|
|
70
|
+
raw({ fontSize: "6.2cqi", letterSpacing: "0.08em", whiteSpace: "nowrap" }),
|
|
71
|
+
], children: [_jsx("span", { "aria-hidden": "true", children: "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 " }), _jsx("span", { mix: visuallyHidden(), children: "ending " }), last4] }), _jsxs("div", { mix: raw({
|
|
72
|
+
display: "flex",
|
|
73
|
+
alignItems: "flex-end",
|
|
74
|
+
justifyContent: "space-between",
|
|
75
|
+
gap: "3cqi",
|
|
76
|
+
fontSize: "3.6cqi",
|
|
77
|
+
}), children: [_jsx("span", { "data-slot": "payment-card-holder", mix: raw({
|
|
78
|
+
textTransform: "uppercase",
|
|
79
|
+
letterSpacing: "0.08em",
|
|
80
|
+
overflow: "hidden",
|
|
81
|
+
textOverflow: "ellipsis",
|
|
82
|
+
whiteSpace: "nowrap",
|
|
83
|
+
}), children: holder }), _jsxs("span", { mix: raw({ display: "flex", alignItems: "baseline", gap: "4cqi", flex: "none" }), children: [_jsxs("span", { "data-slot": "payment-card-expires", mix: tabularNums(), children: [_jsx("span", { mix: raw({ opacity: "0.7", marginInlineEnd: "1.2cqi" }), children: expiresLabel }), expires] }), _jsx("span", { "data-slot": "payment-card-network", mix: [
|
|
84
|
+
weight("bold"),
|
|
85
|
+
raw({ fontSize: "5.4cqi", fontStyle: "italic", letterSpacing: "-0.01em" }),
|
|
86
|
+
], children: network })] })] })] }), frozen ? (_jsxs("div", { "data-slot": "payment-card-frozen", mix: raw({
|
|
87
|
+
position: "absolute",
|
|
88
|
+
inset: "0",
|
|
89
|
+
display: "grid",
|
|
90
|
+
placeItems: "center",
|
|
91
|
+
alignContent: "center",
|
|
92
|
+
gap: "1.5cqi",
|
|
93
|
+
fontSize: "4.6cqi",
|
|
94
|
+
fontWeight: "600",
|
|
95
|
+
color: "white",
|
|
96
|
+
background: "linear-gradient(160deg, rgb(219 234 254 / 0.38), rgb(148 163 184 / 0.32))",
|
|
97
|
+
textShadow: "0 1px 2px rgb(0 0 0 / 0.35)",
|
|
98
|
+
}), children: [_jsx(SnowflakeIcon, { size: 28, "aria-hidden": "true", mix: raw({ inlineSize: "9cqi", blockSize: "9cqi" }) }), _jsx("span", { "aria-hidden": "true", children: frozenLabel })] })) : null] }));
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/** The chip, drawn as a gold square with its contact lines, a third of the card's height. */
|
|
102
|
+
function Chip() {
|
|
103
|
+
return () => (_jsxs("svg", { viewBox: "0 0 40 30", "aria-hidden": "true", "data-slot": "payment-card-chip", mix: raw({ display: "block", inlineSize: "13cqi", blockSize: "auto" }), children: [_jsx("rect", { x: "0.5", y: "0.5", width: "39", height: "29", rx: "5", fill: "#e2c178" }), _jsx("path", { d: "M0 10 H13 M0 20 H13 M27 10 H40 M27 20 H40 M13 0 V30 M27 0 V30 M13 15 H27", stroke: "rgb(120 80 20 / 0.45)", "stroke-width": "1", fill: "none" })] }));
|
|
104
|
+
}
|
|
105
|
+
/** Wide concentric arcs at the far edge, a quiet guilloche that makes the face read as printed. */
|
|
106
|
+
function CardPattern() {
|
|
107
|
+
return () => (_jsx("svg", { viewBox: "0 0 160 100", preserveAspectRatio: "xMaxYMid slice", "aria-hidden": "true", mix: raw({
|
|
108
|
+
position: "absolute",
|
|
109
|
+
inset: "0",
|
|
110
|
+
inlineSize: "100%",
|
|
111
|
+
blockSize: "100%",
|
|
112
|
+
opacity: "0.16",
|
|
113
|
+
pointerEvents: "none",
|
|
114
|
+
}), children: [18, 30, 42, 54, 66, 78, 90].map((radius) => (_jsx("circle", { cx: "150", cy: "18", r: radius, fill: "none", stroke: "currentColor", "stroke-width": "0.6" }))) }));
|
|
115
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser side of a map stage: loads MapLibre on demand into the server-rendered stage,
|
|
3
|
+
* keeps the same marker, label and route nodes placed as the map pans and zooms, reclusters,
|
|
4
|
+
* and runs the controls and the search area. Without WebGL the server render stays as it is.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { MapFeatureCollection } from "./utils/basemap.js";
|
|
10
|
+
import type { LngLat } from "./utils/mercator.js";
|
|
11
|
+
/** The basemap as plain data the browser can draw. */
|
|
12
|
+
export type EngineBasemap = {
|
|
13
|
+
kind: "geojson";
|
|
14
|
+
data: MapFeatureCollection;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "style";
|
|
17
|
+
light: string;
|
|
18
|
+
dark: string;
|
|
19
|
+
};
|
|
20
|
+
/** What the stage serializes for the browser. */
|
|
21
|
+
export interface EngineProps {
|
|
22
|
+
/** The id of the stage element. */
|
|
23
|
+
root: string;
|
|
24
|
+
/** The map's accessible name, given to the canvas. */
|
|
25
|
+
label: string;
|
|
26
|
+
center: LngLat;
|
|
27
|
+
zoom: number;
|
|
28
|
+
minZoom: number;
|
|
29
|
+
maxZoom: number;
|
|
30
|
+
basemap: EngineBasemap | null;
|
|
31
|
+
clusterRadius: number;
|
|
32
|
+
/** A bubble's accessible name, with `{count}` for its markers. */
|
|
33
|
+
clusterLabel: string;
|
|
34
|
+
gestureHint: string;
|
|
35
|
+
workerUrl: string | null;
|
|
36
|
+
}
|
|
37
|
+
/** A running map, kept in step with the stage until stopped. */
|
|
38
|
+
export interface EngineSession {
|
|
39
|
+
/** Applies new props after the stage re-renders, such as a frame swap. */
|
|
40
|
+
sync(props: EngineProps): void;
|
|
41
|
+
stop(): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Hydrates a map stage: popups of link markers open on hover and focus, and where WebGL works
|
|
45
|
+
* MapLibre takes over the basemap with drag, wheel, pinch and keyboard panning and zooming
|
|
46
|
+
* (two fingers on touch screens). The stage's `data-engine` reads `live` then, or `static`
|
|
47
|
+
* when the server render stays; everything detaches when `signal` aborts.
|
|
48
|
+
*/
|
|
49
|
+
export declare function startEngine(stage: HTMLElement, props: EngineProps, signal: AbortSignal): Promise<EngineSession | undefined>;
|