@blogmcp/sdk 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,31 +1,27 @@
1
- import { inject as T, computed as t } from "vue";
2
- import { splitTripMapList as i, parseTripMapHandNodes as h, TRIPMAP_DEFAULT_HEIGHT as M, buildTripMapGeoUrl as x, tripMapPlaybackLabels as b, tripMapUiTexts as f } from "../../../mdx-schema/dist/tripmap.js";
3
- import { tripMapFormatTime as A } from "../../../mdx-schema/dist/tripmap.js";
4
- const L = /* @__PURE__ */ Symbol.for("blogmcp:mdx-article-context");
5
- function U(e) {
6
- const o = T(L, null), a = t(() => i(e.slugs)), s = t(() => i(e.exclude)), l = t(() => h(e.nodes)), c = t(() => a.value.length === 0), r = t(() => a.value.length === 0 && !o?.filename), p = t(
7
- () => a.value.map((n) => ({
8
- slug: n,
9
- src: `/api/media/thumb/${encodeURIComponent(n)}?width=192`
10
- }))
11
- ), d = t(() => ({ height: e.height || M })), m = t(() => x(e, o)), u = t(() => b(o?.language)), g = t(() => f(o?.language));
1
+ import { inject as h, computed as t } from "vue";
2
+ import { splitTripMapList as n, parseTripMapHandNodes as M, tripMapFacade as f, TRIPMAP_DEFAULT_HEIGHT as x, buildTripMapGeoUrl as b, tripMapPlaybackLabels as L, tripMapUiTexts as E } from "../../../mdx-schema/dist/tripmap.js";
3
+ import { tripMapFormatTime as N } from "../../../mdx-schema/dist/tripmap.js";
4
+ const _ = /* @__PURE__ */ Symbol.for("blogmcp:mdx-article-context");
5
+ function A(e) {
6
+ const a = h(_, null), o = t(() => n(e.slugs)), l = t(() => n(e.exclude)), c = t(() => M(e.nodes)), i = t(() => o.value.length === 0), r = t(() => o.value.length === 0 && !a?.filename), s = t(() => f(e, a)), u = t(() => s.value.thumbs), d = t(() => s.value.stops), p = t(() => ({ height: e.height || x })), g = t(() => b(e, a)), m = t(() => L(a?.language)), T = t(() => E(a?.language));
12
7
  return {
13
- slugList: a,
14
- excludeList: s,
15
- handNodes: l,
16
- facadeThumbs: p,
17
- heightStyle: d,
18
- articleContext: o,
19
- isAutoMode: c,
8
+ slugList: o,
9
+ excludeList: l,
10
+ handNodes: c,
11
+ facadeThumbs: u,
12
+ facadeStops: d,
13
+ heightStyle: p,
14
+ articleContext: a,
15
+ isAutoMode: i,
20
16
  isConfigOnly: r,
21
- geoUrl: m,
22
- labels: u,
23
- texts: g
17
+ geoUrl: g,
18
+ labels: m,
19
+ texts: T
24
20
  };
25
21
  }
26
22
  export {
27
- L as MDX_ARTICLE_CONTEXT_KEY,
28
- h as parseHandNodes,
29
- A as tripMapFormatTime,
30
- U as useTripMap
23
+ _ as MDX_ARTICLE_CONTEXT_KEY,
24
+ M as parseHandNodes,
25
+ N as tripMapFormatTime,
26
+ A as useTripMap
31
27
  };
@@ -15,6 +15,7 @@ const f = {
15
15
  playback: { type: Boolean },
16
16
  cluster: { type: Boolean },
17
17
  theme: {},
18
+ detail: {},
18
19
  styleUrl: {},
19
20
  center: {},
20
21
  zoom: {},
@@ -1,8 +1,8 @@
1
- import { defineComponent as O, ref as g, onMounted as V, onBeforeUnmount as L, createElementBlock as n, openBlock as u, normalizeClass as a, unref as e, createCommentVNode as p, createElementVNode as d, toDisplayString as f, Fragment as B, renderList as E, normalizeStyle as P } from "vue";
1
+ import { defineComponent as H, ref as f, onMounted as L, onBeforeUnmount as P, createElementBlock as n, openBlock as s, normalizeClass as i, unref as e, createCommentVNode as d, createElementVNode as p, toDisplayString as v, Fragment as B, renderList as F, normalizeStyle as j } from "vue";
2
2
  import { tripMapStyles as r } from "../../../../mdx-schema/dist/styles/index.js";
3
- import { useTripMap as $ } from "../../composables/useTripMap.js";
4
- import { tripMapFormatTime as j } from "../../../../mdx-schema/dist/tripmap.js";
5
- const D = ["aria-label"], G = ["src"], K = /* @__PURE__ */ O({
3
+ import { useTripMap as D } from "../../composables/useTripMap.js";
4
+ import { tripMapFormatTime as G } from "../../../../mdx-schema/dist/tripmap.js";
5
+ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
6
6
  __name: "TripMapDefault",
7
7
  props: {
8
8
  slugs: {},
@@ -14,156 +14,167 @@ const D = ["aria-label"], G = ["src"], K = /* @__PURE__ */ O({
14
14
  playback: { type: Boolean, default: !0 },
15
15
  cluster: { type: Boolean, default: !0 },
16
16
  theme: { default: "auto" },
17
+ detail: { default: "popup" },
17
18
  styleUrl: {},
18
19
  center: {},
19
20
  zoom: {},
20
21
  title: {}
21
22
  },
22
- setup(v) {
23
- const c = v, { handNodes: h, facadeThumbs: U, heightStyle: F, geoUrl: z, isConfigOnly: S, labels: _, texts: b } = $(c), x = g(null), k = g(null), i = g("facade"), A = g(0);
24
- let T = null, m = null, w = !1;
25
- async function C() {
23
+ setup(y) {
24
+ const l = y, { handNodes: S, facadeThumbs: w, facadeStops: U, heightStyle: _, geoUrl: z, isConfigOnly: I, labels: A, texts: g } = D(l), N = f(null), h = f(null), x = f(null), u = f("facade"), C = f(0);
25
+ let T = null, m = null, k = !1;
26
+ async function O() {
26
27
  try {
27
28
  const t = await fetch(z.value, { headers: { accept: "application/json" } });
28
29
  if (!t.ok) throw new Error(`media/geo ${t.status}`);
29
30
  return await t.json();
30
31
  } catch (t) {
31
- if (S.value) return { nodes: [] };
32
+ if (I.value) return { nodes: [] };
32
33
  throw t;
33
34
  }
34
35
  }
35
- async function M() {
36
- if (!w) {
37
- w = !0, i.value = "loading";
36
+ async function E() {
37
+ if (!k) {
38
+ k = !0, u.value = "loading";
38
39
  try {
39
- const [t, o] = await Promise.all([import("../../../../tripmap-core/dist/index.js"), C()]), l = (o.nodes ?? []).filter((s) => typeof s.latitude == "number" && typeof s.longitude == "number").map((s) => ({
40
- id: s.slug,
41
- lat: s.latitude,
42
- lng: s.longitude,
43
- capturedAt: s.capturedAt ?? void 0,
44
- thumbnailUrl: s.thumbnailUrl ?? void 0,
45
- imageUrl: s.url ?? void 0,
46
- altText: s.altText ?? void 0,
47
- title: s.placeName ?? void 0
48
- })), y = t.buildTripNodes(l, h.value);
49
- if (A.value = o.skipped ?? 0, y.length === 0 || !k.value) {
50
- i.value = "empty";
40
+ const [t, c] = await Promise.all([import("../../../../tripmap-core/dist/index.js"), O()]), a = (c.nodes ?? []).filter((o) => typeof o.latitude == "number" && typeof o.longitude == "number").map((o) => ({
41
+ id: o.slug,
42
+ lat: o.latitude,
43
+ lng: o.longitude,
44
+ capturedAt: o.capturedAt ?? void 0,
45
+ thumbnailUrl: o.thumbnailUrl ?? void 0,
46
+ imageUrl: o.url ?? void 0,
47
+ largeImageUrl: o.largeUrl ?? void 0,
48
+ altText: o.altText ?? void 0,
49
+ title: o.placeName ?? void 0
50
+ })), M = t.buildTripNodes(a, S.value);
51
+ if (C.value = c.skipped ?? 0, M.length === 0 || !h.value) {
52
+ u.value = "empty";
51
53
  return;
52
54
  }
53
- const N = new t.TripMap(k.value, {
54
- styleUrl: c.styleUrl || o.config?.styleUrl || "",
55
- darkStyleUrl: o.config?.darkStyleUrl,
56
- theme: c.theme,
57
- cluster: c.cluster,
58
- showLine: c.line,
59
- showFilmstrip: c.filmstrip,
60
- showPlayback: c.playback,
61
- extraAttribution: o.config?.attribution,
62
- labels: _.value,
63
- initialView: I(),
55
+ const b = new t.TripMap(h.value, {
56
+ styleUrl: l.styleUrl || c.config?.styleUrl || "",
57
+ darkStyleUrl: c.config?.darkStyleUrl,
58
+ theme: l.theme,
59
+ cluster: l.cluster,
60
+ showLine: l.line,
61
+ showFilmstrip: l.filmstrip,
62
+ showPlayback: l.playback,
63
+ title: l.title,
64
+ detail: l.detail,
65
+ detailHost: l.detail === "panel" ? x.value ?? void 0 : void 0,
66
+ extraAttribution: c.config?.attribution,
67
+ labels: A.value,
68
+ initialView: V(),
64
69
  events: {}
65
70
  });
66
- N.setNodes(y), await N.init(), T = () => N.destroy(), i.value = "live";
71
+ b.setNodes(M), await b.init(), T = () => b.destroy(), u.value = "live";
67
72
  } catch {
68
- i.value = w && i.value === "loading" ? "facade" : i.value;
73
+ u.value = k && u.value === "loading" ? "facade" : u.value;
69
74
  }
70
75
  }
71
76
  }
72
- function I() {
73
- if (!c.center) return;
74
- const [t, o] = c.center.split(",").map((l) => Number.parseFloat(l.trim()));
75
- if (!(!Number.isFinite(t) || !Number.isFinite(o)))
76
- return { center: [o, t], zoom: c.zoom };
77
+ function V() {
78
+ if (!l.center) return;
79
+ const [t, c] = l.center.split(",").map((a) => Number.parseFloat(a.trim()));
80
+ if (!(!Number.isFinite(t) || !Number.isFinite(c)))
81
+ return { center: [c, t], zoom: l.zoom };
77
82
  }
78
- return V(() => {
79
- const t = x.value;
83
+ return L(() => {
84
+ const t = N.value;
80
85
  if (t) {
81
86
  if (typeof IntersectionObserver > "u") {
82
- M();
87
+ E();
83
88
  return;
84
89
  }
85
90
  m = new IntersectionObserver(
86
- (o) => {
87
- o.some((l) => l.isIntersecting) && (m?.disconnect(), m = null, M());
91
+ (c) => {
92
+ c.some((a) => a.isIntersecting) && (m?.disconnect(), m = null, E());
88
93
  },
89
94
  { rootMargin: "300px" }
90
95
  ), m.observe(t);
91
96
  }
92
- }), L(() => {
97
+ }), P(() => {
93
98
  m?.disconnect(), T?.();
94
- }), (t, o) => (u(), n("div", {
99
+ }), (t, c) => (s(), n("div", {
95
100
  ref_key: "rootEl",
96
- ref: x,
97
- class: a(e(r).container),
101
+ ref: N,
102
+ class: i(e(r).container),
98
103
  "data-mdx-component": "TripMap",
99
- "aria-label": v.title
104
+ "aria-label": y.title
100
105
  }, [
101
- v.title ? (u(), n("p", {
106
+ y.title ? (s(), n("p", {
102
107
  key: 0,
103
- class: a(e(r).head)
104
- }, f(v.title), 3)) : p("", !0),
105
- e(U).length && i.value !== "live" ? (u(), n("ol", {
108
+ class: i(e(r).head)
109
+ }, v(y.title), 3)) : d("", !0),
110
+ e(w).length && u.value !== "live" ? (s(), n("ol", {
106
111
  key: 1,
107
- class: a(e(r).strip)
112
+ class: i(e(r).strip)
108
113
  }, [
109
- (u(!0), n(B, null, E(e(U), (l) => (u(), n("li", {
110
- key: l.slug,
111
- class: a(e(r).stripItem)
114
+ (s(!0), n(B, null, F(e(w), (a) => (s(), n("li", {
115
+ key: a.slug,
116
+ class: i(e(r).stripItem)
112
117
  }, [
113
- d("img", {
114
- src: l.src,
115
- alt: "",
118
+ p("img", {
119
+ src: a.src,
120
+ alt: a.alt,
116
121
  width: "80",
117
122
  height: "80",
118
123
  loading: "lazy",
119
124
  decoding: "async",
120
- class: a(e(r).stripImg)
121
- }, null, 10, G)
125
+ class: i(e(r).stripImg)
126
+ }, null, 10, $)
122
127
  ], 2))), 128))
123
- ], 2)) : p("", !0),
124
- d("div", {
125
- class: a(e(r).mapWrap),
126
- style: P(e(F))
128
+ ], 2)) : d("", !0),
129
+ p("div", {
130
+ class: i(e(r).mapWrap),
131
+ style: j(e(_))
127
132
  }, [
128
- d("div", {
133
+ p("div", {
129
134
  ref_key: "mapEl",
130
- ref: k,
135
+ ref: h,
131
136
  class: "absolute inset-0"
132
137
  }, null, 512),
133
- i.value !== "live" ? (u(), n("div", {
138
+ u.value !== "live" ? (s(), n("div", {
134
139
  key: 0,
135
- class: a([e(r).mapOverlay])
140
+ class: i([e(r).mapOverlay])
136
141
  }, [
137
- d("div", {
138
- class: a(e(r).mapBox)
142
+ p("div", {
143
+ class: i(e(r).mapBox)
139
144
  }, [
140
- d("span", {
141
- class: a(e(r).mapHint)
142
- }, f(i.value === "empty" ? e(b).empty : e(b).hint), 3)
145
+ p("span", {
146
+ class: i(e(r).mapHint)
147
+ }, v(u.value === "empty" ? e(g).empty : e(g).hint), 3)
143
148
  ], 2)
144
- ], 2)) : p("", !0)
149
+ ], 2)) : d("", !0)
145
150
  ], 6),
146
- e(h).length && i.value !== "live" ? (u(), n("ol", {
151
+ l.detail === "panel" ? (s(), n("div", {
147
152
  key: 2,
148
- class: a(e(r).stopList)
153
+ ref_key: "detailEl",
154
+ ref: x,
155
+ class: i(e(r).detailHost)
156
+ }, null, 2)) : d("", !0),
157
+ e(U).length && u.value !== "live" ? (s(), n("ol", {
158
+ key: 3,
159
+ class: i(e(r).stopList)
149
160
  }, [
150
- (u(!0), n(B, null, E(e(h), (l, y) => (u(), n("li", {
151
- key: l.id || y
161
+ (s(!0), n(B, null, F(e(U), (a) => (s(), n("li", {
162
+ key: a.key
152
163
  }, [
153
- l.capturedAt ? (u(), n("span", {
164
+ a.capturedAt ? (s(), n("span", {
154
165
  key: 0,
155
- class: a(e(r).stopTime)
156
- }, f(e(j)(l.capturedAt)), 3)) : p("", !0),
157
- d("span", null, f(l.title || `${l.lat}, ${l.lng}`), 1)
166
+ class: i(e(r).stopTime)
167
+ }, v(e(G)(a.capturedAt)), 3)) : d("", !0),
168
+ p("span", null, v(a.title), 1)
158
169
  ]))), 128))
159
- ], 2)) : p("", !0),
160
- i.value !== "live" ? (u(), n("p", {
161
- key: 3,
162
- class: a(e(r).note)
163
- }, f(e(b).unavailable), 3)) : p("", !0)
164
- ], 10, D));
170
+ ], 2)) : d("", !0),
171
+ u.value !== "live" ? (s(), n("p", {
172
+ key: 4,
173
+ class: i(e(r).note)
174
+ }, v(e(g).unavailable), 3)) : d("", !0)
175
+ ], 10, W));
165
176
  }
166
177
  });
167
178
  export {
168
- K as default
179
+ R as default
169
180
  };
@@ -469,6 +469,15 @@ Read this carefully.
469
469
  description: 'Map color scheme; "auto" follows the reader’s system preference.',
470
470
  enum: ["light", "dark", "auto"]
471
471
  },
472
+ {
473
+ name: "detail",
474
+ type: "string",
475
+ required: !1,
476
+ default: '"popup"',
477
+ description: 'Where the selected photo opens: "popup" on the map, or "panel" below the filmstrip at full width (larger photos; the map keeps its height). Both open the photo full-screen on click.',
478
+ enum: ["popup", "panel"],
479
+ addedIn: "0.4.0"
480
+ },
472
481
  {
473
482
  name: "styleUrl",
474
483
  type: "string",
@@ -8,6 +8,8 @@ const t = {
8
8
  * own container would clobber the classes the engine adds to it).
9
9
  */
10
10
  mapWrap: "relative w-full overflow-hidden rounded-lg",
11
+ /** detail="panel": engine-owned photo panel host below the map box (empty until a photo is picked). */
12
+ detailHost: "w-full",
11
13
  mapOverlay: "absolute inset-0",
12
14
  mapBox: "flex h-full w-full items-center justify-center overflow-hidden rounded-lg bg-gray-100",
13
15
  mapHint: "text-sm text-gray-500",
@@ -1,37 +1,37 @@
1
- const s = "420px";
2
- function r(t) {
3
- return (t ?? "").split(",").map((e) => e.trim()).filter(Boolean);
1
+ const f = "420px";
2
+ function s(a) {
3
+ return (a ?? "").split(",").map((e) => e.trim()).filter(Boolean);
4
4
  }
5
- function p(t) {
6
- let e = t;
5
+ function g(a) {
6
+ let e = a;
7
7
  if (typeof e == "string")
8
8
  try {
9
9
  e = JSON.parse(e);
10
10
  } catch {
11
11
  return typeof console < "u" && console.warn('[TripMap] `nodes` prop is not valid JSON — use quoted keys: [{"lat":49.3,"lng":16.3}]'), [];
12
12
  }
13
- return Array.isArray(e) ? e.filter((a) => !!a && typeof a == "object" && typeof a.lat == "number" && typeof a.lng == "number") : [];
13
+ return Array.isArray(e) ? e.filter((o) => !!o && typeof o == "object" && typeof o.lat == "number" && typeof o.lng == "number") : [];
14
14
  }
15
- function u(t) {
16
- const e = /T(\d{2}):(\d{2})/.exec(t);
15
+ function h(a) {
16
+ const e = /T(\d{2}):(\d{2})/.exec(a);
17
17
  return e ? `${e[1]}:${e[2]}` : "";
18
18
  }
19
- function l(t, e) {
20
- const a = new URLSearchParams();
21
- e?.language && a.set("lang", e.language);
22
- const n = r(t.slugs);
23
- if (n.length > 0)
24
- return a.set("slugs", n.join(",")), `/api/media/geo?${a.toString()}`;
19
+ function b(a, e) {
20
+ const o = new URLSearchParams();
21
+ e?.language && o.set("lang", e.language);
22
+ const r = s(a.slugs);
23
+ if (r.length > 0)
24
+ return o.set("slugs", r.join(",")), `/api/media/geo?${o.toString()}`;
25
25
  if (e?.filename) {
26
- a.set("article", e.filename);
27
- const o = r(t.exclude);
28
- return o.length > 0 && a.set("exclude", o.join(",")), `/api/media/geo?${a.toString()}`;
26
+ o.set("article", e.filename);
27
+ const i = s(a.exclude);
28
+ return i.length > 0 && o.set("exclude", i.join(",")), `/api/media/geo?${o.toString()}`;
29
29
  }
30
- const i = a.toString();
31
- return i ? `/api/media/geo?${i}` : "/api/media/geo";
30
+ const n = o.toString();
31
+ return n ? `/api/media/geo?${n}` : "/api/media/geo";
32
32
  }
33
- function c(t) {
34
- return (t ?? "").toLowerCase().startsWith("cs") ? {
33
+ function x(a) {
34
+ return (a ?? "").toLowerCase().startsWith("cs") ? {
35
35
  hint: "Interaktivní mapa výletu",
36
36
  empty: "Žádná z fotek nemá zveřejněnou polohu.",
37
37
  unavailable: "Mapa se zobrazí na publikovaném webu."
@@ -41,15 +41,48 @@ function c(t) {
41
41
  unavailable: "The map is shown on the published page."
42
42
  };
43
43
  }
44
- function f(t) {
45
- return (t ?? "").toLowerCase().startsWith("cs") ? { play: "Přehrát trasu", stop: "Zastavit" } : void 0;
44
+ function y(a) {
45
+ return (a ?? "").toLowerCase().startsWith("cs") ? {
46
+ play: "Přehrát trasu",
47
+ stop: "Zastavit",
48
+ fullscreen: "Celá obrazovka",
49
+ exitFullscreen: "Ukončit celou obrazovku",
50
+ export: "Export trasy",
51
+ exportGpx: "Stáhnout GPX",
52
+ exportGpxHint: "hodinky, Garmin, Strava, Komoot",
53
+ openInMapy: "Otevřít v Mapy.com",
54
+ openInGoogleMaps: "Otevřít v Google Maps",
55
+ lightboxClose: "Zavřít",
56
+ lightboxPrev: "Předchozí fotka",
57
+ lightboxNext: "Další fotka",
58
+ zoomImage: "Zobrazit na celou obrazovku"
59
+ } : void 0;
60
+ }
61
+ const c = (a) => `/api/media/thumb/${encodeURIComponent(a)}?width=192`, d = (a, e) => a.capturedAt && e.capturedAt ? a.capturedAt < e.capturedAt ? -1 : a.capturedAt > e.capturedAt ? 1 : 0 : a.capturedAt ? -1 : e.capturedAt ? 1 : 0;
62
+ function v(a, e) {
63
+ const o = (e?.media ?? []).filter((t) => !!t.slug), r = new Map(o.map((t) => [t.slug, t])), n = s(a.slugs), i = new Set(s(a.exclude));
64
+ let l, p;
65
+ n.length > 0 ? (p = n.map((t) => {
66
+ const u = r.get(t);
67
+ return { slug: t, src: u?.thumbnailUrl || c(t), alt: u?.altText ?? "" };
68
+ }), l = n.map((t) => r.get(t)).filter((t) => !!t)) : (l = o.filter((t) => !i.has(t.slug)).slice().sort(d), p = l.map((t) => ({ slug: t.slug, src: t.thumbnailUrl || c(t.slug), alt: t.altText ?? "" })));
69
+ const m = [
70
+ ...l.filter((t) => t.placeName).map((t) => ({ key: `m:${t.slug}`, title: t.placeName, capturedAt: t.capturedAt ?? void 0 })),
71
+ ...g(a.nodes).map((t, u) => ({
72
+ key: `n:${t.id || u}`,
73
+ title: t.title || `${t.lat}, ${t.lng}`,
74
+ capturedAt: t.capturedAt
75
+ }))
76
+ ].sort(d);
77
+ return { thumbs: p, stops: m };
46
78
  }
47
79
  export {
48
- s as TRIPMAP_DEFAULT_HEIGHT,
49
- l as buildTripMapGeoUrl,
50
- p as parseTripMapHandNodes,
51
- r as splitTripMapList,
52
- u as tripMapFormatTime,
53
- f as tripMapPlaybackLabels,
54
- c as tripMapUiTexts
80
+ f as TRIPMAP_DEFAULT_HEIGHT,
81
+ b as buildTripMapGeoUrl,
82
+ g as parseTripMapHandNodes,
83
+ s as splitTripMapList,
84
+ v as tripMapFacade,
85
+ h as tripMapFormatTime,
86
+ y as tripMapPlaybackLabels,
87
+ x as tripMapUiTexts
55
88
  };
@@ -1,21 +1,34 @@
1
- import t from "./node_modules/maplibre-gl/dist/maplibre-gl.css.js";
2
- const r = "tripmap-core-css", e = `
1
+ import p from "./node_modules/maplibre-gl/dist/maplibre-gl.css.js";
2
+ const e = "tripmap-core-css", r = `
3
3
  .tripmap { position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; }
4
4
  .tripmap__map { position: relative; flex: 1 1 auto; width: 100%; min-height: 180px; border-radius: 12px; overflow: hidden; }
5
5
  .tripmap__map .maplibregl-canvas { outline: none; }
6
6
 
7
+ /*
8
+ * Marker roots are maplibre Marker elements: maplibre owns their 'position'
9
+ * (absolute, from its own stylesheet above) and their inline 'transform'
10
+ * (the translate that places them). Never declare 'position', 'transform'
11
+ * or a 'transform' transition on '.tripmap-marker*' root selectors — the
12
+ * 2026-09-06 regression was a 'position: relative' on the cluster variant,
13
+ * which put every cluster marker at its static flow slot + translate, i.e.
14
+ * each one 44px lower than the previous (the "band south of the route").
15
+ * A class-level 'transform' would be dead anyway (inline wins) and a
16
+ * transition on it makes markers trail the basemap while panning. Hover /
17
+ * active feedback therefore uses box-shadow + border-color only.
18
+ * Guarded by test/css.spec.ts and the Vue e2e cluster-alignment spec.
19
+ */
7
20
  .tripmap-marker {
8
21
  display: block; padding: 0; border: 2px solid #ffffff; border-radius: 9999px;
9
22
  background: #e5e7eb; cursor: pointer; width: 44px; height: 44px; overflow: hidden;
10
23
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
11
- transition: transform 120ms ease, border-color 120ms ease;
24
+ transition: box-shadow 120ms ease, border-color 120ms ease;
12
25
  }
13
- .tripmap-marker:hover { transform: scale(1.12); z-index: 3; }
14
- .tripmap-marker--active { border-color: #2563eb; transform: scale(1.15); z-index: 4; }
26
+ .tripmap-marker:hover { box-shadow: 0 0 0 3px rgba(37,99,235,0.35), 0 1px 4px rgba(0,0,0,0.35); z-index: 3; }
27
+ .tripmap-marker--active { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.5), 0 1px 4px rgba(0,0,0,0.35); z-index: 4; }
15
28
  .tripmap-marker__img { width: 100%; height: 100%; object-fit: cover; display: block; }
16
29
  .tripmap-marker--dot { width: 18px; height: 18px; background: #2563eb; border-width: 3px; }
17
30
  .tripmap-marker__dot { display: block; width: 100%; height: 100%; }
18
- .tripmap-marker--cluster { position: relative; overflow: visible; }
31
+ .tripmap-marker--cluster { overflow: visible; }
19
32
  .tripmap-marker--cluster .tripmap-marker__img { border-radius: 9999px; }
20
33
  .tripmap-marker__count {
21
34
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
@@ -24,8 +37,52 @@ const r = "tripmap-core-css", e = `
24
37
  }
25
38
 
26
39
  .tripmap-popup .maplibregl-popup-content, .tripmap-popup { font: 13px/1.4 system-ui, sans-serif; }
27
- .tripmap-popup { max-width: 260px; }
28
- .tripmap-popup__img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; }
40
+ /* Never taller than the map it opens in: the description scrolls instead
41
+ (56px = popup tip/offset + the fit-in-view margins). */
42
+ .tripmap-popup { max-width: 260px; max-height: calc(var(--tripmap-map-h, 400px) - 56px); overflow-y: auto; overscroll-behavior: contain; }
43
+ .tripmap-popup__img { display: block; width: 100%; max-height: var(--tripmap-popup-img-max, 180px); object-fit: cover; border-radius: 8px; }
44
+ .tripmap-popup__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
45
+
46
+ /* Detail panel (detail: 'panel') — the photo under the filmstrip at component width. */
47
+ .tripmap--panel { height: auto; }
48
+ .tripmap-detail { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 0; }
49
+ .tripmap-detail[hidden] { display: none !important; }
50
+ .tripmap-detail__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; }
51
+ .tripmap-detail__img { display: block; width: 100%; max-height: min(70vh, 640px); object-fit: contain; background: #111827; border-radius: 12px; }
52
+ .tripmap-detail__meta { display: flex; flex-direction: column; gap: 2px; font: 14px/1.45 system-ui, sans-serif; color: #111827; }
53
+ .tripmap-detail__title { font-weight: 600; }
54
+ .tripmap-detail__time { color: #6b7280; font-size: 12px; }
55
+ .tripmap-detail__desc { margin: 0; }
56
+
57
+ /* Fullscreen viewer. Mounted on <body>, or inside the fullscreen element. */
58
+ .tripmap-lightbox {
59
+ position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
60
+ background: rgba(0,0,0,0.92);
61
+ }
62
+ .tripmap-lightbox__figure {
63
+ margin: 0; max-width: 100vw; max-height: 100vh; display: flex; flex-direction: column; align-items: center;
64
+ gap: 8px; padding: 0 56px; box-sizing: border-box;
65
+ }
66
+ .tripmap-lightbox__img { max-width: 100%; max-height: calc(100vh - 96px); object-fit: contain; }
67
+ .tripmap-lightbox__caption {
68
+ color: #e5e7eb; font: 14px/1.4 system-ui, sans-serif; text-align: center; max-width: 720px;
69
+ display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px;
70
+ }
71
+ .tripmap-lightbox__caption-head { font-weight: 600; color: #fff; }
72
+ .tripmap-lightbox__close, .tripmap-lightbox__nav {
73
+ position: absolute; border: 0; background: rgba(255,255,255,0.12); color: #fff;
74
+ font: 28px/1 system-ui, sans-serif; width: 44px; height: 44px; border-radius: 9999px; cursor: pointer;
75
+ }
76
+ .tripmap-lightbox__close { top: 12px; right: 12px; }
77
+ .tripmap-lightbox__nav { top: 50%; transform: translateY(-50%); }
78
+ .tripmap-lightbox__nav--prev { left: 8px; }
79
+ .tripmap-lightbox__nav--next { right: 8px; }
80
+ .tripmap-lightbox__close:hover, .tripmap-lightbox__nav:hover { background: rgba(255,255,255,0.25); }
81
+ .tripmap-lightbox [hidden] { display: none !important; }
82
+ @media (max-width: 640px) {
83
+ .tripmap-lightbox__figure { padding: 0 8px; }
84
+ .tripmap-lightbox__nav { top: auto; bottom: 12px; transform: none; }
85
+ }
29
86
  .tripmap-popup__meta { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
30
87
  .tripmap-popup__title { font-weight: 600; }
31
88
  .tripmap-popup__time { color: #6b7280; font-size: 12px; }
@@ -54,21 +111,41 @@ const r = "tripmap-core-css", e = `
54
111
  text-align: center; pointer-events: none;
55
112
  }
56
113
 
114
+ .tripmap:fullscreen { background: #fff; padding: 10px; box-sizing: border-box; gap: 10px; }
115
+ .tripmap:fullscreen .tripmap__map { border-radius: 0; }
116
+
57
117
  .tripmap__controls { position: absolute; top: 10px; left: 10px; z-index: 5; display: flex; gap: 6px; }
58
- .tripmap__play {
118
+ .tripmap__ctrl {
59
119
  border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(255,255,255,0.95);
60
120
  color: #1f2937; font: 600 12px/1 system-ui, sans-serif; cursor: pointer;
61
121
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
62
122
  }
63
- .tripmap__play:hover { background: #fff; }
123
+ .tripmap__ctrl:hover { background: #fff; }
124
+ .tripmap__export { position: relative; }
125
+ .tripmap__export-btn[aria-expanded="true"] { background: #fff; }
126
+ .tripmap__menu {
127
+ position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; min-width: 230px;
128
+ display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 10px;
129
+ background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
130
+ }
131
+ .tripmap__menu-item {
132
+ display: block; width: 100%; box-sizing: border-box; text-align: left; border: 0; background: none;
133
+ padding: 8px 10px; border-radius: 6px; font: 13px/1.3 system-ui, sans-serif; color: #1f2937;
134
+ cursor: pointer; text-decoration: none;
135
+ }
136
+ .tripmap__menu-item:hover, .tripmap__menu-item:focus-visible { background: #f3f4f6; }
137
+ /* An author display rule beats the UA [hidden] rule — restate it, or el.hidden = true is a no-op. */
138
+ .tripmap__controls [hidden] { display: none !important; }
139
+ .tripmap__menu-item small { display: block; color: #6b7280; font-size: 11px; }
64
140
  `;
65
- function a(p = document) {
66
- if (p.getElementById(r)) return;
67
- const i = p.createElement("style");
68
- i.id = r, i.textContent = `${t}
69
- ${e}`, p.head.appendChild(i);
141
+ function a(t = document) {
142
+ if (t.getElementById(e)) return;
143
+ const i = t.createElement("style");
144
+ i.id = e, i.textContent = `${p}
145
+ ${r}`, t.head.appendChild(i);
70
146
  }
71
147
  export {
72
- r as TRIPMAP_STYLE_ID,
148
+ r as TRIPMAP_COMPONENT_CSS,
149
+ e as TRIPMAP_STYLE_ID,
73
150
  a as injectTripMapCss
74
151
  };