@blogmcp/mdx-schema 0.5.0 → 0.6.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/dist/metadata/index.js +3 -3
- package/dist/metadata/index.js.map +1 -1
- package/dist/styles/index.d.ts +7 -1
- package/dist/styles/index.js +7 -1
- package/dist/styles/index.js.map +1 -1
- package/dist/tripmap.d.ts +61 -0
- package/dist/tripmap.js +104 -11
- package/dist/tripmap.js.map +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +14 -12
- package/src/metadata/index.ts +3 -3
- package/src/styles/index.ts +7 -1
- package/src/tripmap.ts +150 -9
- package/src/types/index.ts +4 -1
package/dist/metadata/index.js
CHANGED
|
@@ -414,7 +414,7 @@ export const componentMetadata = [
|
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
416
|
name: 'TripMap',
|
|
417
|
-
description: 'Interactive trip map built from photo GPS + capture time: thumbnail markers, chronological route line, synced photo filmstrip, fly-through playback. Without props it maps every geotagged media attached to or embedded in the article (auto mode); only media with exposed location (geoExposed) appear.
|
|
417
|
+
description: 'Interactive trip map built from photo GPS + capture time: thumbnail markers, chronological route line, synced photo filmstrip, fly-through playback. Without props it maps every geotagged media attached to or embedded in the article (auto mode); only media with exposed location (geoExposed) appear. Article previews load the same live map; where its engine cannot load, a static photo strip + stop list stays in its place.',
|
|
418
418
|
icon: '🗺',
|
|
419
419
|
category: 'media',
|
|
420
420
|
aliases: ['tripmap', 'map', 'trip', 'route', 'travelmap', 'hike'],
|
|
@@ -435,7 +435,7 @@ export const componentMetadata = [
|
|
|
435
435
|
name: 'nodes',
|
|
436
436
|
type: 'array',
|
|
437
437
|
required: false,
|
|
438
|
-
description: 'Hand-made
|
|
438
|
+
description: 'Hand-made stops merged with the photos — a STRICT JSON array inside braces, keys quoted: nodes={[{"id": "eiffel-tower", "lat": 48.8582, "lng": 2.2945, "title": "Eiffel Tower", "capturedAt": "2025-04-20T07:30:00Z"}]}. lat/lng are JSON numbers, never strings. An id (optional) must be unique and must not equal a media slug — a clashing node is dropped. capturedAt is the local wall-clock time at the stop marked Z, the way photo capture times are stored (reached at 09:40 → "2025-04-20T09:40:00Z") — always write the Z; a real offset such as +02:00 shifts the stop against the photos by that offset. Timed nodes join the route line and the GPX track, untimed ones stay off both. Distance (km) and place labels are never derived from hand nodes. Unquoted keys or invalid JSON silently drop the whole prop.',
|
|
439
439
|
},
|
|
440
440
|
{
|
|
441
441
|
name: 'height',
|
|
@@ -519,7 +519,7 @@ export const componentMetadata = [
|
|
|
519
519
|
selfClosing: true,
|
|
520
520
|
defaultProps: 'title="Trasa výletu"',
|
|
521
521
|
defaultChildren: '',
|
|
522
|
-
example: '<TripMap title="
|
|
522
|
+
example: '<TripMap title="Paris walk" nodes={[{"id": "eiffel-tower", "lat": 48.8582, "lng": 2.2945, "title": "Eiffel Tower", "capturedAt": "2025-04-20T07:30:00Z"}, {"id": "arc-de-triomphe", "lat": 48.8736, "lng": 2.295, "title": "Arc de Triomphe", "capturedAt": "2025-04-20T08:15:00Z"}]} />',
|
|
523
523
|
addedIn: '0.3.0',
|
|
524
524
|
deprecated: [],
|
|
525
525
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metadata/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,qEAAqE;AACrE,qEAAqE;AACrE,iDAAiD;AACjD,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,eAAe,CAAA;AACjE,KAAK,eAAe,CAAA;AAGpB,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAwB;IACpD;QACE,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,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,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,4EAA4E;aAC1F;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,wEAAwE;aACtF;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,iEAAiE;gBAC9E,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;aACtB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,sCAAsC;aACpD;SACF;QACD,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,IAAI;QACjB,YAAY,EAAE,sBAAsB;QACpC,eAAe,EAAE,EAAE;QACnB,OAAO,EACL,0RAA0R;QAC5R,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,EAAE;KACf;CACF,CAAA;AAED,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpE,kDAAkD;AAClD,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,iBAAiB;IAC/B,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC;AAED,0FAA0F;AAC1F,cAAc,uBAAuB,CAAA"}
|
package/dist/styles/index.d.ts
CHANGED
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { GalleryProps } from '../types/index.js';
|
|
15
15
|
export declare const tripMapStyles: {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* `not-prose` is load-bearing: every host puts the article inside Tailwind Typography's
|
|
18
|
+
* `.prose` (both blogs, md-editor, the article-review MCP app), whose `img { margin: 2em 0 }`
|
|
19
|
+
* / `li` / `ol` rules would otherwise leak into the facade strip — an 80 px thumb pushed
|
|
20
|
+
* 32 px down inside an overflow-hidden 80 px tile (seen in the claude.ai preview, 2026-09-06).
|
|
21
|
+
*/
|
|
22
|
+
readonly container: "not-prose my-6 flex flex-col gap-3 rounded-xl border border-gray-200 bg-white p-3";
|
|
17
23
|
readonly head: "text-sm font-medium text-gray-700 m-0";
|
|
18
24
|
/**
|
|
19
25
|
* Sized wrapper that hosts BOTH the engine div and the facade overlay.
|
package/dist/styles/index.js
CHANGED
|
@@ -17,7 +17,13 @@
|
|
|
17
17
|
// the live map's own chrome is styled by @blogmcp/tripmap-core at runtime.
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
export const tripMapStyles = {
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* `not-prose` is load-bearing: every host puts the article inside Tailwind Typography's
|
|
22
|
+
* `.prose` (both blogs, md-editor, the article-review MCP app), whose `img { margin: 2em 0 }`
|
|
23
|
+
* / `li` / `ol` rules would otherwise leak into the facade strip — an 80 px thumb pushed
|
|
24
|
+
* 32 px down inside an overflow-hidden 80 px tile (seen in the claude.ai preview, 2026-09-06).
|
|
25
|
+
*/
|
|
26
|
+
container: 'not-prose my-6 flex flex-col gap-3 rounded-xl border border-gray-200 bg-white p-3',
|
|
21
27
|
head: 'text-sm font-medium text-gray-700 m-0',
|
|
22
28
|
/**
|
|
23
29
|
* Sized wrapper that hosts BOTH the engine div and the facade overlay.
|
package/dist/styles/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,8EAA8E;AAC9E,6E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IAAI,EAAE;YACJ,IAAI,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,eAAe,EAAE;YAC5E,OAAO,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,iBAAiB,EAAE;YACrF,GAAG,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,gBAAgB,EAAE;YAC9E,MAAM,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE;SAC5E;KACF;IACD,2EAA2E;IAC3E,SAAS,EAAE;QACT,IAAI,EAAE,2DAA2D;QACjE,OAAO,EAAE,sIAAsI;QAC/I,GAAG,EAAE,kNAAkN;QACvN,MAAM,EAAE,mDAAmD;KAC5D;CACO,CAAA;AA4BV;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAA6D;IAE7D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,GAAG,CAAA;IAC5C,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA;IAC3E,CAAC;IACD,OAAO;QACL,SAAS,EAAE,EAAE,WAAW,EAAE;QAC1B,UAAU,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,IAAI,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,QAAQ,IAAI,QAAQ,EAAE;QAC3F,cAAc,EAAE,eAAe;KAChC,CAAA;AACH,CAAC"}
|
package/dist/tripmap.d.ts
CHANGED
|
@@ -31,10 +31,17 @@ export declare function tripMapFormatTime(iso: string): string;
|
|
|
31
31
|
* win; otherwise auto mode selects by article identity; with neither the
|
|
32
32
|
* URL is a config-only request (the endpoint answers with the tenant basemap
|
|
33
33
|
* `config` and no nodes) so a hand-made-nodes map still gets its style.
|
|
34
|
+
*
|
|
35
|
+
* Auto mode maps the article as the caller is served it: a reader gets the
|
|
36
|
+
* published text's photos, and a draft is a 404. A DRAFT PREVIEW passes
|
|
37
|
+
* `article.previewToken` — the draft-preview token md-editor minted for this
|
|
38
|
+
* article (the one in the `/preview/<token>` or `/api/embed/<token>` URL) —
|
|
39
|
+
* and gets the working copy's photos instead.
|
|
34
40
|
*/
|
|
35
41
|
export declare function buildTripMapGeoUrl(props: Pick<TripMapProps, 'slugs' | 'exclude'>, article?: {
|
|
36
42
|
filename?: string;
|
|
37
43
|
language?: string;
|
|
44
|
+
previewToken?: string;
|
|
38
45
|
} | null): string;
|
|
39
46
|
/** One node of the GET /api/media/geo response. */
|
|
40
47
|
export interface TripMapGeoNode {
|
|
@@ -56,11 +63,65 @@ export interface TripMapGeoResponse {
|
|
|
56
63
|
styleUrl?: string;
|
|
57
64
|
darkStyleUrl?: string;
|
|
58
65
|
attribution?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Tenant switch for node clock times (HH:MM beside each photo in the
|
|
68
|
+
* filmstrip, popup, detail panel and viewer). `false` hides them; omitted
|
|
69
|
+
* shows them. Nothing honours it yet: kb-api does not send it, and it reaches
|
|
70
|
+
* the engine only through `tripMapEngineOptions`, which the Vue and React
|
|
71
|
+
* renderers do not call — they build their engine options inline. Until they
|
|
72
|
+
* adopt that helper, a tenant setting here changes nothing on the page.
|
|
73
|
+
*/
|
|
74
|
+
showTime?: boolean;
|
|
59
75
|
};
|
|
60
76
|
nodes: TripMapGeoNode[];
|
|
61
77
|
/** Count of requested media without exposed geo. */
|
|
62
78
|
skipped?: number;
|
|
63
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Media rows of GET /api/media/geo → the engine's node shape. Shared by every
|
|
82
|
+
* host that mounts the engine (Vue + React renderers, the article-review
|
|
83
|
+
* MCP app) so the field mapping is decided in ONE place.
|
|
84
|
+
*/
|
|
85
|
+
export interface TripMapMediaNodeInput {
|
|
86
|
+
id: string;
|
|
87
|
+
lat: number;
|
|
88
|
+
lng: number;
|
|
89
|
+
capturedAt?: string;
|
|
90
|
+
thumbnailUrl?: string;
|
|
91
|
+
imageUrl?: string;
|
|
92
|
+
largeImageUrl?: string;
|
|
93
|
+
altText?: string;
|
|
94
|
+
title?: string;
|
|
95
|
+
}
|
|
96
|
+
export declare function tripMapNodesFromGeo(nodes: readonly TripMapGeoNode[] | undefined): TripMapMediaNodeInput[];
|
|
97
|
+
/** `center="lat,lng"` + `zoom` → the engine's `initialView` (lng,lat order). */
|
|
98
|
+
export declare function tripMapInitialView(props: Pick<TripMapProps, 'center' | 'zoom'>): {
|
|
99
|
+
center?: [number, number];
|
|
100
|
+
zoom?: number;
|
|
101
|
+
} | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Engine options derived from the block props + the geo response — everything
|
|
104
|
+
* except the DOM hosts (`detailHost`) and event callbacks, which only the
|
|
105
|
+
* mounting host can supply. Prop defaults mirror the schema metadata.
|
|
106
|
+
*/
|
|
107
|
+
export declare function tripMapEngineOptions(props: TripMapProps, geo: Pick<TripMapGeoResponse, 'config'> | undefined, language: string | undefined): {
|
|
108
|
+
styleUrl: string;
|
|
109
|
+
darkStyleUrl?: string;
|
|
110
|
+
theme: NonNullable<TripMapProps['theme']>;
|
|
111
|
+
cluster: boolean;
|
|
112
|
+
showLine: boolean;
|
|
113
|
+
showFilmstrip: boolean;
|
|
114
|
+
showPlayback: boolean;
|
|
115
|
+
showTime: boolean;
|
|
116
|
+
title?: string;
|
|
117
|
+
detail: 'popup' | 'panel';
|
|
118
|
+
extraAttribution?: string;
|
|
119
|
+
labels?: TripMapUiLabels;
|
|
120
|
+
initialView?: {
|
|
121
|
+
center?: [number, number];
|
|
122
|
+
zoom?: number;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
64
125
|
export interface TripMapUiTexts {
|
|
65
126
|
hint: string;
|
|
66
127
|
empty: string;
|
package/dist/tripmap.js
CHANGED
|
@@ -57,6 +57,12 @@ export function tripMapFormatTime(iso) {
|
|
|
57
57
|
* win; otherwise auto mode selects by article identity; with neither the
|
|
58
58
|
* URL is a config-only request (the endpoint answers with the tenant basemap
|
|
59
59
|
* `config` and no nodes) so a hand-made-nodes map still gets its style.
|
|
60
|
+
*
|
|
61
|
+
* Auto mode maps the article as the caller is served it: a reader gets the
|
|
62
|
+
* published text's photos, and a draft is a 404. A DRAFT PREVIEW passes
|
|
63
|
+
* `article.previewToken` — the draft-preview token md-editor minted for this
|
|
64
|
+
* article (the one in the `/preview/<token>` or `/api/embed/<token>` URL) —
|
|
65
|
+
* and gets the working copy's photos instead.
|
|
60
66
|
*/
|
|
61
67
|
export function buildTripMapGeoUrl(props, article) {
|
|
62
68
|
const params = new URLSearchParams();
|
|
@@ -72,6 +78,8 @@ export function buildTripMapGeoUrl(props, article) {
|
|
|
72
78
|
const exclude = splitTripMapList(props.exclude);
|
|
73
79
|
if (exclude.length > 0)
|
|
74
80
|
params.set('exclude', exclude.join(','));
|
|
81
|
+
if (article.previewToken)
|
|
82
|
+
params.set('preview', article.previewToken);
|
|
75
83
|
return `/api/media/geo?${params.toString()}`;
|
|
76
84
|
}
|
|
77
85
|
// Nothing to select (hand-made nodes only, or a host that provides no
|
|
@@ -81,6 +89,55 @@ export function buildTripMapGeoUrl(props, article) {
|
|
|
81
89
|
const qs = params.toString();
|
|
82
90
|
return qs ? `/api/media/geo?${qs}` : '/api/media/geo';
|
|
83
91
|
}
|
|
92
|
+
export function tripMapNodesFromGeo(nodes) {
|
|
93
|
+
return (nodes ?? [])
|
|
94
|
+
.filter((n) => typeof n.latitude === 'number' && typeof n.longitude === 'number')
|
|
95
|
+
.map((n) => ({
|
|
96
|
+
id: n.slug,
|
|
97
|
+
lat: n.latitude,
|
|
98
|
+
lng: n.longitude,
|
|
99
|
+
capturedAt: n.capturedAt ?? undefined,
|
|
100
|
+
thumbnailUrl: n.thumbnailUrl ?? undefined,
|
|
101
|
+
imageUrl: n.url ?? undefined,
|
|
102
|
+
largeImageUrl: n.largeUrl ?? undefined,
|
|
103
|
+
altText: n.altText ?? undefined,
|
|
104
|
+
title: n.placeName ?? undefined,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
/** `center="lat,lng"` + `zoom` → the engine's `initialView` (lng,lat order). */
|
|
108
|
+
export function tripMapInitialView(props) {
|
|
109
|
+
if (!props.center)
|
|
110
|
+
return undefined;
|
|
111
|
+
const [lat, lng] = props.center.split(',').map((v) => Number.parseFloat(v.trim()));
|
|
112
|
+
if (!Number.isFinite(lat) || !Number.isFinite(lng))
|
|
113
|
+
return undefined;
|
|
114
|
+
return { center: [lng, lat], zoom: props.zoom };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Engine options derived from the block props + the geo response — everything
|
|
118
|
+
* except the DOM hosts (`detailHost`) and event callbacks, which only the
|
|
119
|
+
* mounting host can supply. Prop defaults mirror the schema metadata.
|
|
120
|
+
*/
|
|
121
|
+
export function tripMapEngineOptions(props, geo, language) {
|
|
122
|
+
return {
|
|
123
|
+
styleUrl: props.styleUrl || geo?.config?.styleUrl || '',
|
|
124
|
+
darkStyleUrl: geo?.config?.darkStyleUrl,
|
|
125
|
+
theme: props.theme ?? 'auto',
|
|
126
|
+
cluster: props.cluster ?? true,
|
|
127
|
+
showLine: props.line ?? true,
|
|
128
|
+
showFilmstrip: props.filmstrip ?? true,
|
|
129
|
+
showPlayback: props.playback ?? true,
|
|
130
|
+
// Tenant-level (geo config), deliberately not a block prop. Only an explicit
|
|
131
|
+
// false hides, which is the engine's own rule, so a stray non-boolean off the
|
|
132
|
+
// wire still shows times and this option stays a real boolean.
|
|
133
|
+
showTime: geo?.config?.showTime !== false,
|
|
134
|
+
title: props.title,
|
|
135
|
+
detail: props.detail === 'panel' ? 'panel' : 'popup',
|
|
136
|
+
extraAttribution: geo?.config?.attribution,
|
|
137
|
+
labels: tripMapPlaybackLabels(language),
|
|
138
|
+
initialView: tripMapInitialView(props),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
84
141
|
export function tripMapUiTexts(language) {
|
|
85
142
|
const czech = (language ?? '').toLowerCase().startsWith('cs');
|
|
86
143
|
return czech
|
|
@@ -115,15 +172,51 @@ export function tripMapPlaybackLabels(language) {
|
|
|
115
172
|
: undefined;
|
|
116
173
|
}
|
|
117
174
|
const thumbUrlFor = (slug) => `/api/media/thumb/${encodeURIComponent(slug)}?width=192`;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
175
|
+
// An ISO date-time with no zone designator: minutes, optional seconds and fraction.
|
|
176
|
+
// A space or a lowercase t in place of the T is read the same way by Date.parse.
|
|
177
|
+
const ZONELESS_DATE_TIME = /^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)$/;
|
|
178
|
+
/**
|
|
179
|
+
* Capture instant in ms, or null when there is nothing to order by — the rule of
|
|
180
|
+
* `@blogmcp/tripmap-core`'s `captureTimeMs`, repeated here because this module may
|
|
181
|
+
* not import the core (see the header). Date.parse, except that an ISO date-time
|
|
182
|
+
* without a zone is read as UTC, as if it carried the Z the trip convention writes.
|
|
183
|
+
* Left to Date.parse it lands in the runtime's zone, and this facade renders twice —
|
|
184
|
+
* on the server and again in the reader's browser — so a UTC pod and a Prague
|
|
185
|
+
* browser would list the stops in different orders: a hydration mismatch, and a
|
|
186
|
+
* crawler reading another order than the reader sees.
|
|
187
|
+
*/
|
|
188
|
+
const captureTimeMs = (capturedAt) => {
|
|
189
|
+
// Hand nodes are author JSON, not type-checked: a non-string is untimed, never a throw.
|
|
190
|
+
if (typeof capturedAt !== 'string' || !capturedAt)
|
|
191
|
+
return null;
|
|
192
|
+
const zoneless = ZONELESS_DATE_TIME.exec(capturedAt.trim());
|
|
193
|
+
const t = Date.parse(zoneless ? `${zoneless[1]}T${zoneless[2]}Z` : capturedAt);
|
|
194
|
+
return Number.isNaN(t) ? null : t;
|
|
126
195
|
};
|
|
196
|
+
/**
|
|
197
|
+
* Chronological order exactly as `@blogmcp/tripmap-core`'s `buildTripNodes` sorts
|
|
198
|
+
* the live map (this module may not import it — see the header), so the no-JS
|
|
199
|
+
* facade lists stops in the order the map draws them.
|
|
200
|
+
*
|
|
201
|
+
* By instant (`captureTimeMs`), never compared as strings: `capturedAt` has arrived
|
|
202
|
+
* as JS Date#toString ("Mon Apr 21 2025 …"), and as a string that sorts by weekday
|
|
203
|
+
* name and puts every such value after any ISO one. Timed items first by instant
|
|
204
|
+
* (stable, so equal instants keep input order); unparseable or missing times are
|
|
205
|
+
* untimed and follow in input order.
|
|
206
|
+
*/
|
|
207
|
+
function orderByCaptureTime(items) {
|
|
208
|
+
const timed = [];
|
|
209
|
+
const untimed = [];
|
|
210
|
+
for (const item of items) {
|
|
211
|
+
const t = captureTimeMs(item.capturedAt);
|
|
212
|
+
if (t === null)
|
|
213
|
+
untimed.push(item);
|
|
214
|
+
else
|
|
215
|
+
timed.push({ item, t });
|
|
216
|
+
}
|
|
217
|
+
timed.sort((a, b) => a.t - b.t);
|
|
218
|
+
return [...timed.map((entry) => entry.item), ...untimed];
|
|
219
|
+
}
|
|
127
220
|
/**
|
|
128
221
|
* The static facade both renderers server-render before any script runs:
|
|
129
222
|
* a thumbnail strip with alt text and a list of named stops. It is the part
|
|
@@ -151,10 +244,10 @@ export function tripMapFacade(props, context) {
|
|
|
151
244
|
photos = slugList.map((slug) => bySlug.get(slug)).filter((m) => Boolean(m));
|
|
152
245
|
}
|
|
153
246
|
else {
|
|
154
|
-
photos = media.filter((m) => !exclude.has(m.slug))
|
|
247
|
+
photos = orderByCaptureTime(media.filter((m) => !exclude.has(m.slug)));
|
|
155
248
|
thumbs = photos.map((m) => ({ slug: m.slug, src: m.thumbnailUrl || thumbUrlFor(m.slug), alt: m.altText ?? '' }));
|
|
156
249
|
}
|
|
157
|
-
const stops = [
|
|
250
|
+
const stops = orderByCaptureTime([
|
|
158
251
|
...photos
|
|
159
252
|
.filter((m) => m.placeName)
|
|
160
253
|
.map((m) => ({ key: `m:${m.slug}`, title: m.placeName, capturedAt: m.capturedAt ?? undefined })),
|
|
@@ -163,7 +256,7 @@ export function tripMapFacade(props, context) {
|
|
|
163
256
|
title: n.title || `${n.lat}, ${n.lng}`,
|
|
164
257
|
capturedAt: n.capturedAt,
|
|
165
258
|
})),
|
|
166
|
-
]
|
|
259
|
+
]);
|
|
167
260
|
return { thumbs, stops };
|
|
168
261
|
}
|
|
169
262
|
//# sourceMappingURL=tripmap.js.map
|
package/dist/tripmap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tripmap.js","sourceRoot":"","sources":["../src/tripmap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAA;AAE7C,8DAA8D;AAC9D,MAAM,UAAU,gBAAgB,CAAC,KAAyB;IACxD,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAA0B;IAC9D,IAAI,KAAK,GAAY,GAAG,CAAA;IACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;gBACnC,OAAO,CAAC,IAAI,CACV,uFAAuF,CACxF,CAAA;YACH,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CA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AAC,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,EAAE;YACtC,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAC;KACJ,CAAC,CAAA;IAEF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AAC1B,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -101,7 +101,10 @@ export interface TripMapHandNode {
|
|
|
101
101
|
/** ISO timestamp — places the node into the chronological route line */
|
|
102
102
|
capturedAt?: string;
|
|
103
103
|
thumbnailUrl?: string;
|
|
104
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Optional link target for the popup: an http(s) URL or an on-site reference
|
|
106
|
+
* (`/…`, `./…`, `../…`, `#…`, `?…`). The map renders anything else as no link.
|
|
107
|
+
*/
|
|
105
108
|
href?: string;
|
|
106
109
|
}
|
|
107
110
|
export interface TripMapProps {
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoaH,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAC/B,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,YAAY,CAAA;AACpC,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,iBAAiB,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,aAAa,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAA;AAC5C,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,uBAAuB,CAAA;AAC/C,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,KAAuB;IAEvB,OAAO,KAAK,CAAC,IAAI,KAAK,0BAA0B,CAAA;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogmcp/mdx-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Framework-agnostic schema + metadata + parsing for MDX components. Zero framework dependencies — consumed by Vue and React renderer packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,43 +11,43 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./types": {
|
|
18
|
-
"types": "./
|
|
18
|
+
"types": "./dist/types/index.d.ts",
|
|
19
19
|
"import": "./dist/types/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./metadata": {
|
|
22
|
-
"types": "./
|
|
22
|
+
"types": "./dist/metadata/index.d.ts",
|
|
23
23
|
"import": "./dist/metadata/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./metadata/validate": {
|
|
26
|
-
"types": "./
|
|
26
|
+
"types": "./dist/metadata/validate.d.ts",
|
|
27
27
|
"import": "./dist/metadata/validate.js"
|
|
28
28
|
},
|
|
29
29
|
"./composables/parsing": {
|
|
30
|
-
"types": "./
|
|
30
|
+
"types": "./dist/composables/useMdxParsing.d.ts",
|
|
31
31
|
"import": "./dist/composables/useMdxParsing.js"
|
|
32
32
|
},
|
|
33
33
|
"./styles": {
|
|
34
|
-
"types": "./
|
|
34
|
+
"types": "./dist/styles/index.d.ts",
|
|
35
35
|
"import": "./dist/styles/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./version": {
|
|
38
|
-
"types": "./
|
|
38
|
+
"types": "./dist/version.d.ts",
|
|
39
39
|
"import": "./dist/version.js"
|
|
40
40
|
},
|
|
41
41
|
"./prepareProps": {
|
|
42
|
-
"types": "./
|
|
42
|
+
"types": "./dist/prepareProps.d.ts",
|
|
43
43
|
"import": "./dist/prepareProps.js"
|
|
44
44
|
},
|
|
45
45
|
"./checkPin": {
|
|
46
|
-
"types": "./
|
|
46
|
+
"types": "./dist/checkPin.d.ts",
|
|
47
47
|
"import": "./dist/checkPin.js"
|
|
48
48
|
},
|
|
49
49
|
"./tripmap": {
|
|
50
|
-
"types": "./
|
|
50
|
+
"types": "./dist/tripmap.d.ts",
|
|
51
51
|
"import": "./dist/tripmap.js"
|
|
52
52
|
}
|
|
53
53
|
},
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
"test": "vitest run",
|
|
62
62
|
"test:watch": "vitest",
|
|
63
63
|
"typecheck": "tsc --noEmit",
|
|
64
|
-
"baseline:regen": "tsx scripts/regen-baseline.ts"
|
|
64
|
+
"baseline:regen": "tsx scripts/regen-baseline.ts",
|
|
65
|
+
"prepack": "node ../../scripts/pack-dist-types.mjs prepack",
|
|
66
|
+
"postpack": "node ../../scripts/pack-dist-types.mjs postpack"
|
|
65
67
|
},
|
|
66
68
|
"dependencies": {
|
|
67
69
|
"semver": "^7.6.0"
|
package/src/metadata/index.ts
CHANGED
|
@@ -422,7 +422,7 @@ export const componentMetadata: ComponentMetadata[] = [
|
|
|
422
422
|
{
|
|
423
423
|
name: 'TripMap',
|
|
424
424
|
description:
|
|
425
|
-
'Interactive trip map built from photo GPS + capture time: thumbnail markers, chronological route line, synced photo filmstrip, fly-through playback. Without props it maps every geotagged media attached to or embedded in the article (auto mode); only media with exposed location (geoExposed) appear.
|
|
425
|
+
'Interactive trip map built from photo GPS + capture time: thumbnail markers, chronological route line, synced photo filmstrip, fly-through playback. Without props it maps every geotagged media attached to or embedded in the article (auto mode); only media with exposed location (geoExposed) appear. Article previews load the same live map; where its engine cannot load, a static photo strip + stop list stays in its place.',
|
|
426
426
|
icon: '🗺',
|
|
427
427
|
category: 'media',
|
|
428
428
|
aliases: ['tripmap', 'map', 'trip', 'route', 'travelmap', 'hike'],
|
|
@@ -445,7 +445,7 @@ export const componentMetadata: ComponentMetadata[] = [
|
|
|
445
445
|
type: 'array',
|
|
446
446
|
required: false,
|
|
447
447
|
description:
|
|
448
|
-
'Hand-made
|
|
448
|
+
'Hand-made stops merged with the photos — a STRICT JSON array inside braces, keys quoted: nodes={[{"id": "eiffel-tower", "lat": 48.8582, "lng": 2.2945, "title": "Eiffel Tower", "capturedAt": "2025-04-20T07:30:00Z"}]}. lat/lng are JSON numbers, never strings. An id (optional) must be unique and must not equal a media slug — a clashing node is dropped. capturedAt is the local wall-clock time at the stop marked Z, the way photo capture times are stored (reached at 09:40 → "2025-04-20T09:40:00Z") — always write the Z; a real offset such as +02:00 shifts the stop against the photos by that offset. Timed nodes join the route line and the GPX track, untimed ones stay off both. Distance (km) and place labels are never derived from hand nodes. Unquoted keys or invalid JSON silently drop the whole prop.',
|
|
449
449
|
},
|
|
450
450
|
{
|
|
451
451
|
name: 'height',
|
|
@@ -531,7 +531,7 @@ export const componentMetadata: ComponentMetadata[] = [
|
|
|
531
531
|
defaultProps: 'title="Trasa výletu"',
|
|
532
532
|
defaultChildren: '',
|
|
533
533
|
example:
|
|
534
|
-
'<TripMap title="
|
|
534
|
+
'<TripMap title="Paris walk" nodes={[{"id": "eiffel-tower", "lat": 48.8582, "lng": 2.2945, "title": "Eiffel Tower", "capturedAt": "2025-04-20T07:30:00Z"}, {"id": "arc-de-triomphe", "lat": 48.8736, "lng": 2.295, "title": "Arc de Triomphe", "capturedAt": "2025-04-20T08:15:00Z"}]} />',
|
|
535
535
|
addedIn: '0.3.0',
|
|
536
536
|
deprecated: [],
|
|
537
537
|
},
|
package/src/styles/index.ts
CHANGED
|
@@ -20,7 +20,13 @@ import type { GalleryProps } from '../types/index.js'
|
|
|
20
20
|
// the live map's own chrome is styled by @blogmcp/tripmap-core at runtime.
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
22
22
|
export const tripMapStyles = {
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* `not-prose` is load-bearing: every host puts the article inside Tailwind Typography's
|
|
25
|
+
* `.prose` (both blogs, md-editor, the article-review MCP app), whose `img { margin: 2em 0 }`
|
|
26
|
+
* / `li` / `ol` rules would otherwise leak into the facade strip — an 80 px thumb pushed
|
|
27
|
+
* 32 px down inside an overflow-hidden 80 px tile (seen in the claude.ai preview, 2026-09-06).
|
|
28
|
+
*/
|
|
29
|
+
container: 'not-prose my-6 flex flex-col gap-3 rounded-xl border border-gray-200 bg-white p-3',
|
|
24
30
|
head: 'text-sm font-medium text-gray-700 m-0',
|
|
25
31
|
/**
|
|
26
32
|
* Sized wrapper that hosts BOTH the engine div and the facade overlay.
|
package/src/tripmap.ts
CHANGED
|
@@ -67,10 +67,16 @@ export function tripMapFormatTime(iso: string): string {
|
|
|
67
67
|
* win; otherwise auto mode selects by article identity; with neither the
|
|
68
68
|
* URL is a config-only request (the endpoint answers with the tenant basemap
|
|
69
69
|
* `config` and no nodes) so a hand-made-nodes map still gets its style.
|
|
70
|
+
*
|
|
71
|
+
* Auto mode maps the article as the caller is served it: a reader gets the
|
|
72
|
+
* published text's photos, and a draft is a 404. A DRAFT PREVIEW passes
|
|
73
|
+
* `article.previewToken` — the draft-preview token md-editor minted for this
|
|
74
|
+
* article (the one in the `/preview/<token>` or `/api/embed/<token>` URL) —
|
|
75
|
+
* and gets the working copy's photos instead.
|
|
70
76
|
*/
|
|
71
77
|
export function buildTripMapGeoUrl(
|
|
72
78
|
props: Pick<TripMapProps, 'slugs' | 'exclude'>,
|
|
73
|
-
article?: { filename?: string; language?: string } | null,
|
|
79
|
+
article?: { filename?: string; language?: string; previewToken?: string } | null,
|
|
74
80
|
): string {
|
|
75
81
|
const params = new URLSearchParams()
|
|
76
82
|
if (article?.language) params.set('lang', article.language)
|
|
@@ -83,6 +89,7 @@ export function buildTripMapGeoUrl(
|
|
|
83
89
|
params.set('article', article.filename)
|
|
84
90
|
const exclude = splitTripMapList(props.exclude)
|
|
85
91
|
if (exclude.length > 0) params.set('exclude', exclude.join(','))
|
|
92
|
+
if (article.previewToken) params.set('preview', article.previewToken)
|
|
86
93
|
return `/api/media/geo?${params.toString()}`
|
|
87
94
|
}
|
|
88
95
|
// Nothing to select (hand-made nodes only, or a host that provides no
|
|
@@ -114,12 +121,108 @@ export interface TripMapGeoResponse {
|
|
|
114
121
|
styleUrl?: string
|
|
115
122
|
darkStyleUrl?: string
|
|
116
123
|
attribution?: string
|
|
124
|
+
/**
|
|
125
|
+
* Tenant switch for node clock times (HH:MM beside each photo in the
|
|
126
|
+
* filmstrip, popup, detail panel and viewer). `false` hides them; omitted
|
|
127
|
+
* shows them. Nothing honours it yet: kb-api does not send it, and it reaches
|
|
128
|
+
* the engine only through `tripMapEngineOptions`, which the Vue and React
|
|
129
|
+
* renderers do not call — they build their engine options inline. Until they
|
|
130
|
+
* adopt that helper, a tenant setting here changes nothing on the page.
|
|
131
|
+
*/
|
|
132
|
+
showTime?: boolean
|
|
117
133
|
}
|
|
118
134
|
nodes: TripMapGeoNode[]
|
|
119
135
|
/** Count of requested media without exposed geo. */
|
|
120
136
|
skipped?: number
|
|
121
137
|
}
|
|
122
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Media rows of GET /api/media/geo → the engine's node shape. Shared by every
|
|
141
|
+
* host that mounts the engine (Vue + React renderers, the article-review
|
|
142
|
+
* MCP app) so the field mapping is decided in ONE place.
|
|
143
|
+
*/
|
|
144
|
+
export interface TripMapMediaNodeInput {
|
|
145
|
+
id: string
|
|
146
|
+
lat: number
|
|
147
|
+
lng: number
|
|
148
|
+
capturedAt?: string
|
|
149
|
+
thumbnailUrl?: string
|
|
150
|
+
imageUrl?: string
|
|
151
|
+
largeImageUrl?: string
|
|
152
|
+
altText?: string
|
|
153
|
+
title?: string
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function tripMapNodesFromGeo(nodes: readonly TripMapGeoNode[] | undefined): TripMapMediaNodeInput[] {
|
|
157
|
+
return (nodes ?? [])
|
|
158
|
+
.filter((n) => typeof n.latitude === 'number' && typeof n.longitude === 'number')
|
|
159
|
+
.map((n) => ({
|
|
160
|
+
id: n.slug,
|
|
161
|
+
lat: n.latitude,
|
|
162
|
+
lng: n.longitude,
|
|
163
|
+
capturedAt: n.capturedAt ?? undefined,
|
|
164
|
+
thumbnailUrl: n.thumbnailUrl ?? undefined,
|
|
165
|
+
imageUrl: n.url ?? undefined,
|
|
166
|
+
largeImageUrl: n.largeUrl ?? undefined,
|
|
167
|
+
altText: n.altText ?? undefined,
|
|
168
|
+
title: n.placeName ?? undefined,
|
|
169
|
+
}))
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** `center="lat,lng"` + `zoom` → the engine's `initialView` (lng,lat order). */
|
|
173
|
+
export function tripMapInitialView(
|
|
174
|
+
props: Pick<TripMapProps, 'center' | 'zoom'>,
|
|
175
|
+
): { center?: [number, number]; zoom?: number } | undefined {
|
|
176
|
+
if (!props.center) return undefined
|
|
177
|
+
const [lat, lng] = props.center.split(',').map((v) => Number.parseFloat(v.trim()))
|
|
178
|
+
if (!Number.isFinite(lat) || !Number.isFinite(lng)) return undefined
|
|
179
|
+
return { center: [lng, lat], zoom: props.zoom }
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Engine options derived from the block props + the geo response — everything
|
|
184
|
+
* except the DOM hosts (`detailHost`) and event callbacks, which only the
|
|
185
|
+
* mounting host can supply. Prop defaults mirror the schema metadata.
|
|
186
|
+
*/
|
|
187
|
+
export function tripMapEngineOptions(
|
|
188
|
+
props: TripMapProps,
|
|
189
|
+
geo: Pick<TripMapGeoResponse, 'config'> | undefined,
|
|
190
|
+
language: string | undefined,
|
|
191
|
+
): {
|
|
192
|
+
styleUrl: string
|
|
193
|
+
darkStyleUrl?: string
|
|
194
|
+
theme: NonNullable<TripMapProps['theme']>
|
|
195
|
+
cluster: boolean
|
|
196
|
+
showLine: boolean
|
|
197
|
+
showFilmstrip: boolean
|
|
198
|
+
showPlayback: boolean
|
|
199
|
+
showTime: boolean
|
|
200
|
+
title?: string
|
|
201
|
+
detail: 'popup' | 'panel'
|
|
202
|
+
extraAttribution?: string
|
|
203
|
+
labels?: TripMapUiLabels
|
|
204
|
+
initialView?: { center?: [number, number]; zoom?: number }
|
|
205
|
+
} {
|
|
206
|
+
return {
|
|
207
|
+
styleUrl: props.styleUrl || geo?.config?.styleUrl || '',
|
|
208
|
+
darkStyleUrl: geo?.config?.darkStyleUrl,
|
|
209
|
+
theme: props.theme ?? 'auto',
|
|
210
|
+
cluster: props.cluster ?? true,
|
|
211
|
+
showLine: props.line ?? true,
|
|
212
|
+
showFilmstrip: props.filmstrip ?? true,
|
|
213
|
+
showPlayback: props.playback ?? true,
|
|
214
|
+
// Tenant-level (geo config), deliberately not a block prop. Only an explicit
|
|
215
|
+
// false hides, which is the engine's own rule, so a stray non-boolean off the
|
|
216
|
+
// wire still shows times and this option stays a real boolean.
|
|
217
|
+
showTime: geo?.config?.showTime !== false,
|
|
218
|
+
title: props.title,
|
|
219
|
+
detail: props.detail === 'panel' ? 'panel' : 'popup',
|
|
220
|
+
extraAttribution: geo?.config?.attribution,
|
|
221
|
+
labels: tripMapPlaybackLabels(language),
|
|
222
|
+
initialView: tripMapInitialView(props),
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
123
226
|
export interface TripMapUiTexts {
|
|
124
227
|
hint: string
|
|
125
228
|
empty: string
|
|
@@ -218,11 +321,49 @@ export interface TripMapFacadeMedia {
|
|
|
218
321
|
|
|
219
322
|
const thumbUrlFor = (slug: string): string => `/api/media/thumb/${encodeURIComponent(slug)}?width=192`
|
|
220
323
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
324
|
+
// An ISO date-time with no zone designator: minutes, optional seconds and fraction.
|
|
325
|
+
// A space or a lowercase t in place of the T is read the same way by Date.parse.
|
|
326
|
+
const ZONELESS_DATE_TIME = /^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)$/
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Capture instant in ms, or null when there is nothing to order by — the rule of
|
|
330
|
+
* `@blogmcp/tripmap-core`'s `captureTimeMs`, repeated here because this module may
|
|
331
|
+
* not import the core (see the header). Date.parse, except that an ISO date-time
|
|
332
|
+
* without a zone is read as UTC, as if it carried the Z the trip convention writes.
|
|
333
|
+
* Left to Date.parse it lands in the runtime's zone, and this facade renders twice —
|
|
334
|
+
* on the server and again in the reader's browser — so a UTC pod and a Prague
|
|
335
|
+
* browser would list the stops in different orders: a hydration mismatch, and a
|
|
336
|
+
* crawler reading another order than the reader sees.
|
|
337
|
+
*/
|
|
338
|
+
const captureTimeMs = (capturedAt: unknown): number | null => {
|
|
339
|
+
// Hand nodes are author JSON, not type-checked: a non-string is untimed, never a throw.
|
|
340
|
+
if (typeof capturedAt !== 'string' || !capturedAt) return null
|
|
341
|
+
const zoneless = ZONELESS_DATE_TIME.exec(capturedAt.trim())
|
|
342
|
+
const t = Date.parse(zoneless ? `${zoneless[1]}T${zoneless[2]}Z` : capturedAt)
|
|
343
|
+
return Number.isNaN(t) ? null : t
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Chronological order exactly as `@blogmcp/tripmap-core`'s `buildTripNodes` sorts
|
|
348
|
+
* the live map (this module may not import it — see the header), so the no-JS
|
|
349
|
+
* facade lists stops in the order the map draws them.
|
|
350
|
+
*
|
|
351
|
+
* By instant (`captureTimeMs`), never compared as strings: `capturedAt` has arrived
|
|
352
|
+
* as JS Date#toString ("Mon Apr 21 2025 …"), and as a string that sorts by weekday
|
|
353
|
+
* name and puts every such value after any ISO one. Timed items first by instant
|
|
354
|
+
* (stable, so equal instants keep input order); unparseable or missing times are
|
|
355
|
+
* untimed and follow in input order.
|
|
356
|
+
*/
|
|
357
|
+
function orderByCaptureTime<T extends { capturedAt?: string | null }>(items: readonly T[]): T[] {
|
|
358
|
+
const timed: Array<{ item: T; t: number }> = []
|
|
359
|
+
const untimed: T[] = []
|
|
360
|
+
for (const item of items) {
|
|
361
|
+
const t = captureTimeMs(item.capturedAt)
|
|
362
|
+
if (t === null) untimed.push(item)
|
|
363
|
+
else timed.push({ item, t })
|
|
364
|
+
}
|
|
365
|
+
timed.sort((a, b) => a.t - b.t)
|
|
366
|
+
return [...timed.map((entry) => entry.item), ...untimed]
|
|
226
367
|
}
|
|
227
368
|
|
|
228
369
|
/**
|
|
@@ -255,11 +396,11 @@ export function tripMapFacade(
|
|
|
255
396
|
})
|
|
256
397
|
photos = slugList.map((slug) => bySlug.get(slug)).filter((m): m is TripMapFacadeMedia & { slug: string } => Boolean(m))
|
|
257
398
|
} else {
|
|
258
|
-
photos = media.filter((m) => !exclude.has(m.slug))
|
|
399
|
+
photos = orderByCaptureTime(media.filter((m) => !exclude.has(m.slug)))
|
|
259
400
|
thumbs = photos.map((m) => ({ slug: m.slug, src: m.thumbnailUrl || thumbUrlFor(m.slug), alt: m.altText ?? '' }))
|
|
260
401
|
}
|
|
261
402
|
|
|
262
|
-
const stops: TripMapFacadeStop[] = [
|
|
403
|
+
const stops: TripMapFacadeStop[] = orderByCaptureTime([
|
|
263
404
|
...photos
|
|
264
405
|
.filter((m) => m.placeName)
|
|
265
406
|
.map((m) => ({ key: `m:${m.slug}`, title: m.placeName as string, capturedAt: m.capturedAt ?? undefined })),
|
|
@@ -268,7 +409,7 @@ export function tripMapFacade(
|
|
|
268
409
|
title: n.title || `${n.lat}, ${n.lng}`,
|
|
269
410
|
capturedAt: n.capturedAt,
|
|
270
411
|
})),
|
|
271
|
-
]
|
|
412
|
+
])
|
|
272
413
|
|
|
273
414
|
return { thumbs, stops }
|
|
274
415
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -112,7 +112,10 @@ export interface TripMapHandNode {
|
|
|
112
112
|
/** ISO timestamp — places the node into the chronological route line */
|
|
113
113
|
capturedAt?: string
|
|
114
114
|
thumbnailUrl?: string
|
|
115
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Optional link target for the popup: an http(s) URL or an on-site reference
|
|
117
|
+
* (`/…`, `./…`, `../…`, `#…`, `?…`). The map renders anything else as no link.
|
|
118
|
+
*/
|
|
116
119
|
href?: string
|
|
117
120
|
}
|
|
118
121
|
|