@blogmcp/mdx-render-vue 0.4.0 → 0.5.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.
- package/LICENSE +21 -0
- package/dist/composables/useTripMap.d.ts +18 -10
- package/dist/composables/useTripMap.js +5 -7
- package/dist/edit/TripMapEdit.vue.js +1 -0
- package/dist/render/tripmap/TripMapDefault.vue.d.ts +1 -0
- package/dist/render/tripmap/TripMapDefault.vue.js +22 -10
- package/dist/useTripMap.d.ts +21 -9
- package/package.json +3 -3
- package/src/composables/useTripMap.ts +26 -9
- package/src/render/tripmap/TripMapDefault.vue +21 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lukas Zubal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { type ComputedRef, type InjectionKey } from 'vue';
|
|
14
14
|
import type { TripMapHandNode, TripMapProps } from '@blogmcp/mdx-schema';
|
|
15
|
-
import { parseTripMapHandNodes, tripMapFormatTime, type TripMapGeoNode, type TripMapGeoResponse, type TripMapUiTexts } from '@blogmcp/mdx-schema/tripmap';
|
|
15
|
+
import { parseTripMapHandNodes, tripMapFormatTime, type TripMapFacadeMedia, type TripMapFacadeStop, type TripMapFacadeThumb, type TripMapUiLabels, type TripMapGeoNode, type TripMapGeoResponse, type TripMapUiTexts } from '@blogmcp/mdx-schema/tripmap';
|
|
16
16
|
export { tripMapFormatTime };
|
|
17
17
|
export { parseTripMapHandNodes as parseHandNodes };
|
|
18
18
|
export type { TripMapGeoNode, TripMapGeoResponse };
|
|
@@ -26,17 +26,28 @@ export type { TripMapGeoNode, TripMapGeoResponse };
|
|
|
26
26
|
export interface MdxArticleContext {
|
|
27
27
|
filename: string;
|
|
28
28
|
language?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The article's geotagged media (the GraphQL `contentImagesGeo` rows),
|
|
31
|
+
* when the host already has them. Lets the SERVER-RENDERED facade carry
|
|
32
|
+
* real thumbnails with alt text and named stops in AUTO mode — the part of
|
|
33
|
+
* a TripMap that crawlers and answer engines read. Optional: without it
|
|
34
|
+
* the live map still fetches everything, only the no-JS view is poorer.
|
|
35
|
+
*/
|
|
36
|
+
media?: readonly TripMapFacadeMedia[] | null;
|
|
29
37
|
}
|
|
30
38
|
export declare const MDX_ARTICLE_CONTEXT_KEY: InjectionKey<MdxArticleContext | null>;
|
|
31
39
|
export interface UseTripMapResult {
|
|
32
40
|
slugList: ComputedRef<string[]>;
|
|
33
41
|
excludeList: ComputedRef<string[]>;
|
|
34
42
|
handNodes: ComputedRef<TripMapHandNode[]>;
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Deterministic SSR thumbs: author order for explicit `slugs`, capture
|
|
45
|
+
* order for AUTO mode when the host provided `context.media`. Alt text
|
|
46
|
+
* comes from that media (empty when unknown).
|
|
47
|
+
*/
|
|
48
|
+
facadeThumbs: ComputedRef<TripMapFacadeThumb[]>;
|
|
49
|
+
/** Named stops for the SSR facade: place-labelled photos + hand-made nodes, chronological. */
|
|
50
|
+
facadeStops: ComputedRef<TripMapFacadeStop[]>;
|
|
40
51
|
heightStyle: ComputedRef<{
|
|
41
52
|
height: string;
|
|
42
53
|
}>;
|
|
@@ -50,10 +61,7 @@ export interface UseTripMapResult {
|
|
|
50
61
|
isConfigOnly: ComputedRef<boolean>;
|
|
51
62
|
/** Always set: slugs / article selection, or the config-only URL. */
|
|
52
63
|
geoUrl: ComputedRef<string>;
|
|
53
|
-
labels: ComputedRef<
|
|
54
|
-
play: string;
|
|
55
|
-
stop: string;
|
|
56
|
-
} | undefined>;
|
|
64
|
+
labels: ComputedRef<TripMapUiLabels | undefined>;
|
|
57
65
|
texts: ComputedRef<TripMapUiTexts>;
|
|
58
66
|
}
|
|
59
67
|
export declare function useTripMap(props: TripMapProps): UseTripMapResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, computed } from "vue";
|
|
2
|
-
import { splitTripMapList, parseTripMapHandNodes, TRIPMAP_DEFAULT_HEIGHT, buildTripMapGeoUrl, tripMapPlaybackLabels, tripMapUiTexts } from "@blogmcp/mdx-schema/tripmap";
|
|
2
|
+
import { splitTripMapList, parseTripMapHandNodes, tripMapFacade, TRIPMAP_DEFAULT_HEIGHT, buildTripMapGeoUrl, tripMapPlaybackLabels, tripMapUiTexts } from "@blogmcp/mdx-schema/tripmap";
|
|
3
3
|
import { parseTripMapHandNodes as parseTripMapHandNodes2, tripMapFormatTime } from "@blogmcp/mdx-schema/tripmap";
|
|
4
4
|
const MDX_ARTICLE_CONTEXT_KEY = /* @__PURE__ */ Symbol.for("blogmcp:mdx-article-context");
|
|
5
5
|
function useTripMap(props) {
|
|
@@ -9,12 +9,9 @@ function useTripMap(props) {
|
|
|
9
9
|
const handNodes = computed(() => parseTripMapHandNodes(props.nodes));
|
|
10
10
|
const isAutoMode = computed(() => slugList.value.length === 0);
|
|
11
11
|
const isConfigOnly = computed(() => slugList.value.length === 0 && !articleContext?.filename);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
src: `/api/media/thumb/${encodeURIComponent(slug)}?width=192`
|
|
16
|
-
}))
|
|
17
|
-
);
|
|
12
|
+
const facade = computed(() => tripMapFacade(props, articleContext));
|
|
13
|
+
const facadeThumbs = computed(() => facade.value.thumbs);
|
|
14
|
+
const facadeStops = computed(() => facade.value.stops);
|
|
18
15
|
const heightStyle = computed(() => ({ height: props.height || TRIPMAP_DEFAULT_HEIGHT }));
|
|
19
16
|
const geoUrl = computed(() => buildTripMapGeoUrl(props, articleContext));
|
|
20
17
|
const labels = computed(() => tripMapPlaybackLabels(articleContext?.language));
|
|
@@ -24,6 +21,7 @@ function useTripMap(props) {
|
|
|
24
21
|
excludeList,
|
|
25
22
|
handNodes,
|
|
26
23
|
facadeThumbs,
|
|
24
|
+
facadeStops,
|
|
27
25
|
heightStyle,
|
|
28
26
|
articleContext,
|
|
29
27
|
isAutoMode,
|
|
@@ -5,5 +5,6 @@ declare const _default: import("vue").DefineComponent<TripMapProps, {}, {}, {},
|
|
|
5
5
|
playback: boolean;
|
|
6
6
|
cluster: boolean;
|
|
7
7
|
theme: "light" | "dark" | "auto";
|
|
8
|
+
detail: "popup" | "panel";
|
|
8
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
10
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { tripMapStyles } from "@blogmcp/mdx-schema/styles";
|
|
|
3
3
|
import { useTripMap } from "../../composables/useTripMap.js";
|
|
4
4
|
import { tripMapFormatTime } from "@blogmcp/mdx-schema/tripmap";
|
|
5
5
|
const _hoisted_1 = ["aria-label"];
|
|
6
|
-
const _hoisted_2 = ["src"];
|
|
6
|
+
const _hoisted_2 = ["src", "alt"];
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "TripMapDefault",
|
|
9
9
|
props: {
|
|
@@ -16,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
16
16
|
playback: { type: Boolean, default: true },
|
|
17
17
|
cluster: { type: Boolean, default: true },
|
|
18
18
|
theme: { default: "auto" },
|
|
19
|
+
detail: { default: "popup" },
|
|
19
20
|
styleUrl: {},
|
|
20
21
|
center: {},
|
|
21
22
|
zoom: {},
|
|
@@ -23,9 +24,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
23
24
|
},
|
|
24
25
|
setup(__props) {
|
|
25
26
|
const props = __props;
|
|
26
|
-
const { slugList, handNodes, facadeThumbs, heightStyle, geoUrl, isConfigOnly, labels, texts } = useTripMap(props);
|
|
27
|
+
const { slugList, handNodes, facadeThumbs, facadeStops, heightStyle, geoUrl, isConfigOnly, labels, texts } = useTripMap(props);
|
|
27
28
|
const rootEl = ref(null);
|
|
28
29
|
const mapEl = ref(null);
|
|
30
|
+
const detailEl = ref(null);
|
|
29
31
|
const status = ref("facade");
|
|
30
32
|
const skippedCount = ref(0);
|
|
31
33
|
let destroyMap = null;
|
|
@@ -54,6 +56,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
54
56
|
capturedAt: n.capturedAt ?? void 0,
|
|
55
57
|
thumbnailUrl: n.thumbnailUrl ?? void 0,
|
|
56
58
|
imageUrl: n.url ?? void 0,
|
|
59
|
+
largeImageUrl: n.largeUrl ?? void 0,
|
|
57
60
|
altText: n.altText ?? void 0,
|
|
58
61
|
title: n.placeName ?? void 0
|
|
59
62
|
}));
|
|
@@ -71,6 +74,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
71
74
|
showLine: props.line,
|
|
72
75
|
showFilmstrip: props.filmstrip,
|
|
73
76
|
showPlayback: props.playback,
|
|
77
|
+
title: props.title,
|
|
78
|
+
detail: props.detail,
|
|
79
|
+
detailHost: props.detail === "panel" ? detailEl.value ?? void 0 : void 0,
|
|
74
80
|
extraAttribution: geo.config?.attribution,
|
|
75
81
|
labels: labels.value,
|
|
76
82
|
initialView: initialViewFromProps(),
|
|
@@ -136,7 +142,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
136
142
|
}, [
|
|
137
143
|
createElementVNode("img", {
|
|
138
144
|
src: thumb.src,
|
|
139
|
-
alt:
|
|
145
|
+
alt: thumb.alt,
|
|
140
146
|
width: "80",
|
|
141
147
|
height: "80",
|
|
142
148
|
loading: "lazy",
|
|
@@ -168,24 +174,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
168
174
|
], 2)
|
|
169
175
|
], 2)) : createCommentVNode("", true)
|
|
170
176
|
], 6),
|
|
171
|
-
|
|
177
|
+
props.detail === "panel" ? (openBlock(), createElementBlock("div", {
|
|
172
178
|
key: 2,
|
|
179
|
+
ref_key: "detailEl",
|
|
180
|
+
ref: detailEl,
|
|
181
|
+
class: normalizeClass(unref(tripMapStyles).detailHost)
|
|
182
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
183
|
+
unref(facadeStops).length && status.value !== "live" ? (openBlock(), createElementBlock("ol", {
|
|
184
|
+
key: 3,
|
|
173
185
|
class: normalizeClass(unref(tripMapStyles).stopList)
|
|
174
186
|
}, [
|
|
175
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(
|
|
187
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(facadeStops), (stop) => {
|
|
176
188
|
return openBlock(), createElementBlock("li", {
|
|
177
|
-
key:
|
|
189
|
+
key: stop.key
|
|
178
190
|
}, [
|
|
179
|
-
|
|
191
|
+
stop.capturedAt ? (openBlock(), createElementBlock("span", {
|
|
180
192
|
key: 0,
|
|
181
193
|
class: normalizeClass(unref(tripMapStyles).stopTime)
|
|
182
|
-
}, toDisplayString(unref(tripMapFormatTime)(
|
|
183
|
-
createElementVNode("span", null, toDisplayString(
|
|
194
|
+
}, toDisplayString(unref(tripMapFormatTime)(stop.capturedAt)), 3)) : createCommentVNode("", true),
|
|
195
|
+
createElementVNode("span", null, toDisplayString(stop.title), 1)
|
|
184
196
|
]);
|
|
185
197
|
}), 128))
|
|
186
198
|
], 2)) : createCommentVNode("", true),
|
|
187
199
|
status.value !== "live" ? (openBlock(), createElementBlock("p", {
|
|
188
|
-
key:
|
|
200
|
+
key: 4,
|
|
189
201
|
class: normalizeClass(unref(tripMapStyles).note)
|
|
190
202
|
}, toDisplayString(unref(texts).unavailable), 3)) : createCommentVNode("", true)
|
|
191
203
|
], 10, _hoisted_1);
|
package/dist/useTripMap.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import { InjectionKey } from 'vue';
|
|
3
3
|
import { parseTripMapHandNodes as parseHandNodes } from '@blogmcp/mdx-schema/tripmap';
|
|
4
|
+
import { TripMapFacadeMedia } from '@blogmcp/mdx-schema/tripmap';
|
|
5
|
+
import { TripMapFacadeStop } from '@blogmcp/mdx-schema/tripmap';
|
|
6
|
+
import { TripMapFacadeThumb } from '@blogmcp/mdx-schema/tripmap';
|
|
4
7
|
import { tripMapFormatTime } from '@blogmcp/mdx-schema/tripmap';
|
|
5
8
|
import { TripMapGeoNode } from '@blogmcp/mdx-schema/tripmap';
|
|
6
9
|
import { TripMapGeoResponse } from '@blogmcp/mdx-schema/tripmap';
|
|
7
10
|
import { TripMapHandNode } from '@blogmcp/mdx-schema';
|
|
8
11
|
import { TripMapProps } from '@blogmcp/mdx-schema';
|
|
12
|
+
import { TripMapUiLabels } from '@blogmcp/mdx-schema/tripmap';
|
|
9
13
|
import { TripMapUiTexts } from '@blogmcp/mdx-schema/tripmap';
|
|
10
14
|
|
|
11
15
|
export declare const MDX_ARTICLE_CONTEXT_KEY: InjectionKey<MdxArticleContext | null>;
|
|
@@ -20,6 +24,14 @@ export declare const MDX_ARTICLE_CONTEXT_KEY: InjectionKey<MdxArticleContext | n
|
|
|
20
24
|
export declare interface MdxArticleContext {
|
|
21
25
|
filename: string;
|
|
22
26
|
language?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The article's geotagged media (the GraphQL `contentImagesGeo` rows),
|
|
29
|
+
* when the host already has them. Lets the SERVER-RENDERED facade carry
|
|
30
|
+
* real thumbnails with alt text and named stops in AUTO mode — the part of
|
|
31
|
+
* a TripMap that crawlers and answer engines read. Optional: without it
|
|
32
|
+
* the live map still fetches everything, only the no-JS view is poorer.
|
|
33
|
+
*/
|
|
34
|
+
media?: readonly TripMapFacadeMedia[] | null;
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
export { parseHandNodes }
|
|
@@ -36,11 +48,14 @@ export declare interface UseTripMapResult {
|
|
|
36
48
|
slugList: ComputedRef<string[]>;
|
|
37
49
|
excludeList: ComputedRef<string[]>;
|
|
38
50
|
handNodes: ComputedRef<TripMapHandNode[]>;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Deterministic SSR thumbs: author order for explicit `slugs`, capture
|
|
53
|
+
* order for AUTO mode when the host provided `context.media`. Alt text
|
|
54
|
+
* comes from that media (empty when unknown).
|
|
55
|
+
*/
|
|
56
|
+
facadeThumbs: ComputedRef<TripMapFacadeThumb[]>;
|
|
57
|
+
/** Named stops for the SSR facade: place-labelled photos + hand-made nodes, chronological. */
|
|
58
|
+
facadeStops: ComputedRef<TripMapFacadeStop[]>;
|
|
44
59
|
heightStyle: ComputedRef<{
|
|
45
60
|
height: string;
|
|
46
61
|
}>;
|
|
@@ -54,10 +69,7 @@ export declare interface UseTripMapResult {
|
|
|
54
69
|
isConfigOnly: ComputedRef<boolean>;
|
|
55
70
|
/** Always set: slugs / article selection, or the config-only URL. */
|
|
56
71
|
geoUrl: ComputedRef<string>;
|
|
57
|
-
labels: ComputedRef<
|
|
58
|
-
play: string;
|
|
59
|
-
stop: string;
|
|
60
|
-
} | undefined>;
|
|
72
|
+
labels: ComputedRef<TripMapUiLabels | undefined>;
|
|
61
73
|
texts: ComputedRef<TripMapUiTexts>;
|
|
62
74
|
}
|
|
63
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogmcp/mdx-render-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Vue renderer for MDX components — edit + render SFCs wired to @blogmcp/mdx-schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
"typecheck": "vue-tsc --noEmit"
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@blogmcp/mdx-schema": "^0.
|
|
101
|
+
"@blogmcp/mdx-schema": "^0.5.0",
|
|
102
102
|
"@blogmcp/sanitize": "^0.3.0",
|
|
103
|
-
"@blogmcp/tripmap-core": "^0.1.
|
|
103
|
+
"@blogmcp/tripmap-core": "^0.1.2",
|
|
104
104
|
"@ark-ui/vue": "^5.0.0",
|
|
105
105
|
"@iconify/vue": "^5.0.0"
|
|
106
106
|
},
|
|
@@ -19,7 +19,12 @@ import {
|
|
|
19
19
|
splitTripMapList,
|
|
20
20
|
TRIPMAP_DEFAULT_HEIGHT,
|
|
21
21
|
tripMapFormatTime,
|
|
22
|
+
tripMapFacade,
|
|
22
23
|
tripMapPlaybackLabels,
|
|
24
|
+
type TripMapFacadeMedia,
|
|
25
|
+
type TripMapFacadeStop,
|
|
26
|
+
type TripMapFacadeThumb,
|
|
27
|
+
type TripMapUiLabels,
|
|
23
28
|
tripMapUiTexts,
|
|
24
29
|
type TripMapGeoNode,
|
|
25
30
|
type TripMapGeoResponse,
|
|
@@ -42,6 +47,14 @@ export type { TripMapGeoNode, TripMapGeoResponse }
|
|
|
42
47
|
export interface MdxArticleContext {
|
|
43
48
|
filename: string
|
|
44
49
|
language?: string
|
|
50
|
+
/**
|
|
51
|
+
* The article's geotagged media (the GraphQL `contentImagesGeo` rows),
|
|
52
|
+
* when the host already has them. Lets the SERVER-RENDERED facade carry
|
|
53
|
+
* real thumbnails with alt text and named stops in AUTO mode — the part of
|
|
54
|
+
* a TripMap that crawlers and answer engines read. Optional: without it
|
|
55
|
+
* the live map still fetches everything, only the no-JS view is poorer.
|
|
56
|
+
*/
|
|
57
|
+
media?: readonly TripMapFacadeMedia[] | null
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
export const MDX_ARTICLE_CONTEXT_KEY: InjectionKey<MdxArticleContext | null> =
|
|
@@ -51,8 +64,14 @@ export interface UseTripMapResult {
|
|
|
51
64
|
slugList: ComputedRef<string[]>
|
|
52
65
|
excludeList: ComputedRef<string[]>
|
|
53
66
|
handNodes: ComputedRef<TripMapHandNode[]>
|
|
54
|
-
/**
|
|
55
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Deterministic SSR thumbs: author order for explicit `slugs`, capture
|
|
69
|
+
* order for AUTO mode when the host provided `context.media`. Alt text
|
|
70
|
+
* comes from that media (empty when unknown).
|
|
71
|
+
*/
|
|
72
|
+
facadeThumbs: ComputedRef<TripMapFacadeThumb[]>
|
|
73
|
+
/** Named stops for the SSR facade: place-labelled photos + hand-made nodes, chronological. */
|
|
74
|
+
facadeStops: ComputedRef<TripMapFacadeStop[]>
|
|
56
75
|
heightStyle: ComputedRef<{ height: string }>
|
|
57
76
|
articleContext: MdxArticleContext | null
|
|
58
77
|
isAutoMode: ComputedRef<boolean>
|
|
@@ -64,7 +83,7 @@ export interface UseTripMapResult {
|
|
|
64
83
|
isConfigOnly: ComputedRef<boolean>
|
|
65
84
|
/** Always set: slugs / article selection, or the config-only URL. */
|
|
66
85
|
geoUrl: ComputedRef<string>
|
|
67
|
-
labels: ComputedRef<
|
|
86
|
+
labels: ComputedRef<TripMapUiLabels | undefined>
|
|
68
87
|
texts: ComputedRef<TripMapUiTexts>
|
|
69
88
|
}
|
|
70
89
|
|
|
@@ -77,12 +96,9 @@ export function useTripMap(props: TripMapProps): UseTripMapResult {
|
|
|
77
96
|
const isAutoMode = computed(() => slugList.value.length === 0)
|
|
78
97
|
const isConfigOnly = computed(() => slugList.value.length === 0 && !articleContext?.filename)
|
|
79
98
|
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
src: `/api/media/thumb/${encodeURIComponent(slug)}?width=192`,
|
|
84
|
-
})),
|
|
85
|
-
)
|
|
99
|
+
const facade = computed(() => tripMapFacade(props, articleContext))
|
|
100
|
+
const facadeThumbs = computed(() => facade.value.thumbs)
|
|
101
|
+
const facadeStops = computed(() => facade.value.stops)
|
|
86
102
|
|
|
87
103
|
const heightStyle = computed(() => ({ height: props.height || TRIPMAP_DEFAULT_HEIGHT }))
|
|
88
104
|
|
|
@@ -96,6 +112,7 @@ export function useTripMap(props: TripMapProps): UseTripMapResult {
|
|
|
96
112
|
excludeList,
|
|
97
113
|
handNodes,
|
|
98
114
|
facadeThumbs,
|
|
115
|
+
facadeStops,
|
|
99
116
|
heightStyle,
|
|
100
117
|
articleContext,
|
|
101
118
|
isAutoMode,
|
|
@@ -25,13 +25,16 @@ const props = withDefaults(defineProps<TripMapProps>(), {
|
|
|
25
25
|
playback: true,
|
|
26
26
|
cluster: true,
|
|
27
27
|
theme: 'auto',
|
|
28
|
+
detail: 'popup',
|
|
28
29
|
})
|
|
29
30
|
|
|
30
|
-
const { slugList, handNodes, facadeThumbs, heightStyle, geoUrl, isConfigOnly, labels, texts } =
|
|
31
|
+
const { slugList, handNodes, facadeThumbs, facadeStops, heightStyle, geoUrl, isConfigOnly, labels, texts } =
|
|
31
32
|
useTripMap(props)
|
|
32
33
|
|
|
33
34
|
const rootEl = ref<HTMLElement | null>(null)
|
|
34
35
|
const mapEl = ref<HTMLElement | null>(null)
|
|
36
|
+
// detail="panel": the engine mounts the photo panel here, below the sized map box.
|
|
37
|
+
const detailEl = ref<HTMLElement | null>(null)
|
|
35
38
|
const status = ref<'facade' | 'loading' | 'live' | 'empty'>('facade')
|
|
36
39
|
const skippedCount = ref(0)
|
|
37
40
|
|
|
@@ -69,6 +72,7 @@ async function start(): Promise<void> {
|
|
|
69
72
|
capturedAt: n.capturedAt ?? undefined,
|
|
70
73
|
thumbnailUrl: n.thumbnailUrl ?? undefined,
|
|
71
74
|
imageUrl: n.url ?? undefined,
|
|
75
|
+
largeImageUrl: n.largeUrl ?? undefined,
|
|
72
76
|
altText: n.altText ?? undefined,
|
|
73
77
|
title: n.placeName ?? undefined,
|
|
74
78
|
}))
|
|
@@ -86,6 +90,9 @@ async function start(): Promise<void> {
|
|
|
86
90
|
showLine: props.line,
|
|
87
91
|
showFilmstrip: props.filmstrip,
|
|
88
92
|
showPlayback: props.playback,
|
|
93
|
+
title: props.title,
|
|
94
|
+
detail: props.detail,
|
|
95
|
+
detailHost: props.detail === 'panel' ? (detailEl.value ?? undefined) : undefined,
|
|
89
96
|
extraAttribution: geo.config?.attribution,
|
|
90
97
|
labels: labels.value,
|
|
91
98
|
initialView: initialViewFromProps(),
|
|
@@ -139,10 +146,14 @@ onBeforeUnmount(() => {
|
|
|
139
146
|
<div ref="rootEl" :class="tripMapStyles.container" data-mdx-component="TripMap" :aria-label="title">
|
|
140
147
|
<p v-if="title" :class="tripMapStyles.head">{{ title }}</p>
|
|
141
148
|
|
|
142
|
-
<!--
|
|
149
|
+
<!--
|
|
150
|
+
Facade thumb strip — server-rendered, with alt text when the host
|
|
151
|
+
provided the article media (crawlers read THIS, never the canvas);
|
|
152
|
+
replaced by the live filmstrip once the engine mounts.
|
|
153
|
+
-->
|
|
143
154
|
<ol v-if="facadeThumbs.length && status !== 'live'" :class="tripMapStyles.strip">
|
|
144
155
|
<li v-for="thumb in facadeThumbs" :key="thumb.slug" :class="tripMapStyles.stripItem">
|
|
145
|
-
<img :src="thumb.src" alt="" width="80" height="80" loading="lazy" decoding="async" :class="tripMapStyles.stripImg" />
|
|
156
|
+
<img :src="thumb.src" :alt="thumb.alt" width="80" height="80" loading="lazy" decoding="async" :class="tripMapStyles.stripImg" />
|
|
146
157
|
</li>
|
|
147
158
|
</ol>
|
|
148
159
|
|
|
@@ -162,12 +173,14 @@ onBeforeUnmount(() => {
|
|
|
162
173
|
</div>
|
|
163
174
|
</div>
|
|
164
175
|
</div>
|
|
176
|
+
<!-- detail="panel": engine-owned photo panel host (static, never re-patched). -->
|
|
177
|
+
<div v-if="props.detail === 'panel'" ref="detailEl" :class="tripMapStyles.detailHost"></div>
|
|
165
178
|
|
|
166
|
-
<!--
|
|
167
|
-
<ol v-if="
|
|
168
|
-
<li v-for="
|
|
169
|
-
<span v-if="
|
|
170
|
-
<span>{{
|
|
179
|
+
<!-- Named stops (place-labelled photos + hand-made nodes) for the static facade. -->
|
|
180
|
+
<ol v-if="facadeStops.length && status !== 'live'" :class="tripMapStyles.stopList">
|
|
181
|
+
<li v-for="stop in facadeStops" :key="stop.key">
|
|
182
|
+
<span v-if="stop.capturedAt" :class="tripMapStyles.stopTime">{{ tripMapFormatTime(stop.capturedAt) }}</span>
|
|
183
|
+
<span>{{ stop.title }}</span>
|
|
171
184
|
</li>
|
|
172
185
|
</ol>
|
|
173
186
|
|