@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.
- package/LICENSE +21 -0
- package/dist/node_modules/maplibre-gl/dist/maplibre-gl.js +1101 -1056
- package/dist/packages/mdx-render-vue/dist/composables/useTripMap.js +21 -25
- package/dist/packages/mdx-render-vue/dist/edit/TripMapEdit.vue.js +1 -0
- package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +105 -94
- package/dist/packages/mdx-schema/dist/metadata/index.js +9 -0
- package/dist/packages/mdx-schema/dist/styles/index.js +2 -0
- package/dist/packages/mdx-schema/dist/tripmap.js +63 -30
- package/dist/packages/tripmap-core/dist/css.js +93 -16
- package/dist/packages/tripmap-core/dist/detail.js +50 -0
- package/dist/packages/tripmap-core/dist/engine.js +326 -171
- package/dist/packages/tripmap-core/dist/export.js +70 -0
- package/dist/packages/tripmap-core/dist/filmstrip.js +1 -1
- package/dist/packages/tripmap-core/dist/index.js +50 -34
- package/dist/packages/tripmap-core/dist/lightbox.js +94 -0
- package/dist/packages/tripmap-core/dist/markers.js +62 -57
- package/dist/packages/tripmap-core/dist/playback.js +19 -15
- package/dist/packages/tripmap-core/dist/preload.js +44 -0
- package/package.json +2 -2
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { splitTripMapList as
|
|
3
|
-
import { tripMapFormatTime as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
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:
|
|
14
|
-
excludeList:
|
|
15
|
-
handNodes:
|
|
16
|
-
facadeThumbs:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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:
|
|
22
|
-
labels:
|
|
23
|
-
texts:
|
|
17
|
+
geoUrl: g,
|
|
18
|
+
labels: m,
|
|
19
|
+
texts: T
|
|
24
20
|
};
|
|
25
21
|
}
|
|
26
22
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
_ as MDX_ARTICLE_CONTEXT_KEY,
|
|
24
|
+
M as parseHandNodes,
|
|
25
|
+
N as tripMapFormatTime,
|
|
26
|
+
A as useTripMap
|
|
31
27
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
4
|
-
import { tripMapFormatTime as
|
|
5
|
-
const
|
|
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(
|
|
23
|
-
const
|
|
24
|
-
let T = null, m = null,
|
|
25
|
-
async function
|
|
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 (
|
|
32
|
+
if (I.value) return { nodes: [] };
|
|
32
33
|
throw t;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
async function
|
|
36
|
-
if (!
|
|
37
|
-
|
|
36
|
+
async function E() {
|
|
37
|
+
if (!k) {
|
|
38
|
+
k = !0, u.value = "loading";
|
|
38
39
|
try {
|
|
39
|
-
const [t,
|
|
40
|
-
id:
|
|
41
|
-
lat:
|
|
42
|
-
lng:
|
|
43
|
-
capturedAt:
|
|
44
|
-
thumbnailUrl:
|
|
45
|
-
imageUrl:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
54
|
-
styleUrl:
|
|
55
|
-
darkStyleUrl:
|
|
56
|
-
theme:
|
|
57
|
-
cluster:
|
|
58
|
-
showLine:
|
|
59
|
-
showFilmstrip:
|
|
60
|
-
showPlayback:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
71
|
+
b.setNodes(M), await b.init(), T = () => b.destroy(), u.value = "live";
|
|
67
72
|
} catch {
|
|
68
|
-
|
|
73
|
+
u.value = k && u.value === "loading" ? "facade" : u.value;
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
|
-
function
|
|
73
|
-
if (!
|
|
74
|
-
const [t,
|
|
75
|
-
if (!(!Number.isFinite(t) || !Number.isFinite(
|
|
76
|
-
return { center: [
|
|
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
|
|
79
|
-
const t =
|
|
83
|
+
return L(() => {
|
|
84
|
+
const t = N.value;
|
|
80
85
|
if (t) {
|
|
81
86
|
if (typeof IntersectionObserver > "u") {
|
|
82
|
-
|
|
87
|
+
E();
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
90
|
m = new IntersectionObserver(
|
|
86
|
-
(
|
|
87
|
-
|
|
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
|
-
}),
|
|
97
|
+
}), P(() => {
|
|
93
98
|
m?.disconnect(), T?.();
|
|
94
|
-
}), (t,
|
|
99
|
+
}), (t, c) => (s(), n("div", {
|
|
95
100
|
ref_key: "rootEl",
|
|
96
|
-
ref:
|
|
97
|
-
class:
|
|
101
|
+
ref: N,
|
|
102
|
+
class: i(e(r).container),
|
|
98
103
|
"data-mdx-component": "TripMap",
|
|
99
|
-
"aria-label":
|
|
104
|
+
"aria-label": y.title
|
|
100
105
|
}, [
|
|
101
|
-
|
|
106
|
+
y.title ? (s(), n("p", {
|
|
102
107
|
key: 0,
|
|
103
|
-
class:
|
|
104
|
-
},
|
|
105
|
-
e(
|
|
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:
|
|
112
|
+
class: i(e(r).strip)
|
|
108
113
|
}, [
|
|
109
|
-
(
|
|
110
|
-
key:
|
|
111
|
-
class:
|
|
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
|
-
|
|
114
|
-
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:
|
|
121
|
-
}, null, 10,
|
|
125
|
+
class: i(e(r).stripImg)
|
|
126
|
+
}, null, 10, $)
|
|
122
127
|
], 2))), 128))
|
|
123
|
-
], 2)) :
|
|
124
|
-
|
|
125
|
-
class:
|
|
126
|
-
style:
|
|
128
|
+
], 2)) : d("", !0),
|
|
129
|
+
p("div", {
|
|
130
|
+
class: i(e(r).mapWrap),
|
|
131
|
+
style: j(e(_))
|
|
127
132
|
}, [
|
|
128
|
-
|
|
133
|
+
p("div", {
|
|
129
134
|
ref_key: "mapEl",
|
|
130
|
-
ref:
|
|
135
|
+
ref: h,
|
|
131
136
|
class: "absolute inset-0"
|
|
132
137
|
}, null, 512),
|
|
133
|
-
|
|
138
|
+
u.value !== "live" ? (s(), n("div", {
|
|
134
139
|
key: 0,
|
|
135
|
-
class:
|
|
140
|
+
class: i([e(r).mapOverlay])
|
|
136
141
|
}, [
|
|
137
|
-
|
|
138
|
-
class:
|
|
142
|
+
p("div", {
|
|
143
|
+
class: i(e(r).mapBox)
|
|
139
144
|
}, [
|
|
140
|
-
|
|
141
|
-
class:
|
|
142
|
-
},
|
|
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)) :
|
|
149
|
+
], 2)) : d("", !0)
|
|
145
150
|
], 6),
|
|
146
|
-
|
|
151
|
+
l.detail === "panel" ? (s(), n("div", {
|
|
147
152
|
key: 2,
|
|
148
|
-
|
|
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
|
-
(
|
|
151
|
-
key:
|
|
161
|
+
(s(!0), n(B, null, F(e(U), (a) => (s(), n("li", {
|
|
162
|
+
key: a.key
|
|
152
163
|
}, [
|
|
153
|
-
|
|
164
|
+
a.capturedAt ? (s(), n("span", {
|
|
154
165
|
key: 0,
|
|
155
|
-
class:
|
|
156
|
-
},
|
|
157
|
-
|
|
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)) :
|
|
160
|
-
|
|
161
|
-
key:
|
|
162
|
-
class:
|
|
163
|
-
},
|
|
164
|
-
], 10,
|
|
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
|
-
|
|
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
|
|
2
|
-
function
|
|
3
|
-
return (
|
|
1
|
+
const f = "420px";
|
|
2
|
+
function s(a) {
|
|
3
|
+
return (a ?? "").split(",").map((e) => e.trim()).filter(Boolean);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
let e =
|
|
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((
|
|
13
|
+
return Array.isArray(e) ? e.filter((o) => !!o && typeof o == "object" && typeof o.lat == "number" && typeof o.lng == "number") : [];
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const e = /T(\d{2}):(\d{2})/.exec(
|
|
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
|
|
20
|
-
const
|
|
21
|
-
e?.language &&
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
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
|
-
|
|
27
|
-
const
|
|
28
|
-
return
|
|
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
|
|
31
|
-
return
|
|
30
|
+
const n = o.toString();
|
|
31
|
+
return n ? `/api/media/geo?${n}` : "/api/media/geo";
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return (
|
|
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
|
|
45
|
-
return (
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
2
|
-
const
|
|
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:
|
|
24
|
+
transition: box-shadow 120ms ease, border-color 120ms ease;
|
|
12
25
|
}
|
|
13
|
-
.tripmap-marker:hover {
|
|
14
|
-
.tripmap-marker--active { border-color: #2563eb;
|
|
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 {
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
.
|
|
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
|
-
.
|
|
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(
|
|
66
|
-
if (
|
|
67
|
-
const i =
|
|
68
|
-
i.id =
|
|
69
|
-
${
|
|
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
|
|
148
|
+
r as TRIPMAP_COMPONENT_CSS,
|
|
149
|
+
e as TRIPMAP_STYLE_ID,
|
|
73
150
|
a as injectTripMapCss
|
|
74
151
|
};
|