@blogmcp/sdk 0.3.1 → 0.6.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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/dist/core/client-types.d.ts +7 -1
  3. package/dist/core/client.d.ts +25 -1
  4. package/dist/core/client.js +38 -34
  5. package/dist/core/consultation-adapter.d.ts +90 -0
  6. package/dist/core/consultation-adapter.js +200 -0
  7. package/dist/core/consultations.d.ts +108 -0
  8. package/dist/core/consultations.js +95 -0
  9. package/dist/core/errors.d.ts +52 -0
  10. package/dist/core/errors.js +73 -0
  11. package/dist/core/index.d.ts +7 -1
  12. package/dist/core/index.js +80 -64
  13. package/dist/core/queries.d.ts +16 -1
  14. package/dist/core/queries.js +198 -61
  15. package/dist/core/review/format.d.ts +30 -0
  16. package/dist/core/review/format.js +78 -0
  17. package/dist/core/review/index.d.ts +6 -0
  18. package/dist/core/review/index.js +9 -0
  19. package/dist/core/review/types.d.ts +176 -0
  20. package/dist/core/review/types.js +9 -0
  21. package/dist/core/server-only.d.ts +12 -0
  22. package/dist/core/server-only.js +11 -0
  23. package/dist/core/types.d.ts +295 -0
  24. package/dist/packages/mdx-render-vue/dist/composables/useTripMap.js +21 -25
  25. package/dist/packages/mdx-render-vue/dist/edit/TripMapEdit.vue.js +1 -0
  26. package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +105 -94
  27. package/dist/packages/mdx-schema/dist/metadata/index.js +12 -3
  28. package/dist/packages/mdx-schema/dist/styles/index.js +9 -1
  29. package/dist/packages/mdx-schema/dist/tripmap.js +81 -35
  30. package/dist/packages/tripmap-core/dist/attribution.js +121 -6
  31. package/dist/packages/tripmap-core/dist/css.js +149 -20
  32. package/dist/packages/tripmap-core/dist/detail.js +51 -0
  33. package/dist/packages/tripmap-core/dist/engine.js +367 -174
  34. package/dist/packages/tripmap-core/dist/export.js +72 -0
  35. package/dist/packages/tripmap-core/dist/filmstrip.js +30 -17
  36. package/dist/packages/tripmap-core/dist/framing.js +30 -30
  37. package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
  38. package/dist/packages/tripmap-core/dist/heading.js +8 -0
  39. package/dist/packages/tripmap-core/dist/href.js +18 -0
  40. package/dist/packages/tripmap-core/dist/index.js +60 -36
  41. package/dist/packages/tripmap-core/dist/lightbox.js +96 -0
  42. package/dist/packages/tripmap-core/dist/line.js +6 -6
  43. package/dist/packages/tripmap-core/dist/markers.js +60 -51
  44. package/dist/packages/tripmap-core/dist/nodes.js +56 -43
  45. package/dist/packages/tripmap-core/dist/playback.js +20 -16
  46. package/dist/packages/tripmap-core/dist/preload.js +44 -0
  47. package/dist/packages/tripmap-core/dist/theme.js +21 -21
  48. package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl.js +2006 -1791
  49. package/dist/{node_modules → packages/tripmap-core/node_modules}/pmtiles/dist/esm/index.js +1 -1
  50. package/package.json +8 -3
  51. package/src/core/client-types.ts +13 -2
  52. package/src/core/client.ts +40 -5
  53. package/src/core/consultation-adapter.ts +408 -0
  54. package/src/core/consultations.ts +224 -0
  55. package/src/core/errors.ts +145 -0
  56. package/src/core/index.ts +68 -0
  57. package/src/core/queries.ts +167 -3
  58. package/src/core/review/format.ts +138 -0
  59. package/src/core/review/index.ts +22 -0
  60. package/src/core/review/types.ts +168 -0
  61. package/src/core/server-only.ts +20 -0
  62. package/src/core/types.ts +337 -0
  63. /package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
@@ -1,22 +1,84 @@
1
- import t from "./node_modules/maplibre-gl/dist/maplibre-gl.css.js";
2
- const r = "tripmap-core-css", e = `
1
+ import r from "./node_modules/maplibre-gl/dist/maplibre-gl.css.js";
2
+ const i = "tripmap-core-css", a = `
3
3
  .tripmap { position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; }
4
+ /* Host stylesheets must never reach the engine's DOM (seen in the claude.ai
5
+ review app, 2026-09-07): Tailwind Typography's '.prose :where(img)' (margin
6
+ 2em 0) pushed photos out of their circles, and a renderer's
7
+ ':where(.render-embed) img { height: auto }' — which the app SCOPES under an
8
+ extra class, lifting it to (0,1,1) — turned marker photos back into their
9
+ intrinsic aspect. The structural sizing of engine-owned images is therefore
10
+ '!important' on purpose: nothing legitimate restyles these elements, and a
11
+ scoping host can add specificity we cannot out-rank any other way. */
12
+ .tripmap-lightbox figure, .tripmap-lightbox figcaption, .tripmap p, .tripmap-detail p { margin: 0; }
4
13
  .tripmap__map { position: relative; flex: 1 1 auto; width: 100%; min-height: 180px; border-radius: 12px; overflow: hidden; }
5
14
  .tripmap__map .maplibregl-canvas { outline: none; }
6
15
 
16
+ /*
17
+ * Brand mark, fullscreen only (engine toggles [hidden]).
18
+ *
19
+ * Bottom-LEFT because maplibre puts attribution bottom-right and our
20
+ * navigation/fullscreen/geolocate stack top-right; this is the one free corner.
21
+ * 'pointer-events: none' is load-bearing: the mark sits over a surface the
22
+ * reader drags, and a logo that swallows a pan is worse than no logo. The
23
+ * drop-shadow is what keeps a single-colour mark legible over both a snowy
24
+ * field and a dark forest without shipping two assets.
25
+ */
26
+ .tripmap__watermark {
27
+ position: absolute; left: 10px; bottom: 10px; z-index: 2;
28
+ height: 28px; width: auto; pointer-events: none; user-select: none;
29
+ opacity: 0.85; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
30
+ }
31
+ .tripmap__watermark[hidden] { display: none; }
32
+
33
+ /*
34
+ * Heading arrow on the user-location dot (engine sets --tripmap-heading and the
35
+ * modifier class). Drawn as a CHILD of maplibre's dot marker — never on the dot
36
+ * itself, whose transform maplibre owns and rewrites each frame.
37
+ *
38
+ * Hidden unless there IS a heading: coords.heading is null on a stationary or
39
+ * wifi fix, and an arrow frozen at its last value while you stand still points
40
+ * confidently in the wrong direction.
41
+ */
42
+ .tripmap .tripmap-heading { display: none; }
43
+ .tripmap .tripmap-user--heading .tripmap-heading {
44
+ display: block; position: absolute; left: 50%; top: 50%;
45
+ width: 0; height: 0; pointer-events: none;
46
+ /* Rotation happens on THIS element, around the dot's centre. */
47
+ transform: rotate(var(--tripmap-heading, 0deg));
48
+ }
49
+ .tripmap .tripmap-user--heading .tripmap-heading::before {
50
+ content: ''; position: absolute; left: -5px; top: -19px;
51
+ border-left: 5px solid transparent; border-right: 5px solid transparent;
52
+ border-bottom: 9px solid #1da1f2;
53
+ filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.9));
54
+ }
55
+
56
+ /*
57
+ * Marker roots are maplibre Marker elements: maplibre owns their 'position'
58
+ * (absolute, from its own stylesheet above) and their inline 'transform'
59
+ * (the translate that places them). Never declare 'position', 'transform'
60
+ * or a 'transform' transition on '.tripmap-marker*' root selectors — the
61
+ * 2026-09-06 regression was a 'position: relative' on the cluster variant,
62
+ * which put every cluster marker at its static flow slot + translate, i.e.
63
+ * each one 44px lower than the previous (the "band south of the route").
64
+ * A class-level 'transform' would be dead anyway (inline wins) and a
65
+ * transition on it makes markers trail the basemap while panning. Hover /
66
+ * active feedback therefore uses box-shadow + border-color only.
67
+ * Guarded by test/css.spec.ts and the Vue e2e cluster-alignment spec.
68
+ */
7
69
  .tripmap-marker {
8
70
  display: block; padding: 0; border: 2px solid #ffffff; border-radius: 9999px;
9
71
  background: #e5e7eb; cursor: pointer; width: 44px; height: 44px; overflow: hidden;
10
72
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
11
- transition: transform 120ms ease, border-color 120ms ease;
73
+ transition: box-shadow 120ms ease, border-color 120ms ease;
12
74
  }
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; }
15
- .tripmap-marker__img { width: 100%; height: 100%; object-fit: cover; display: block; }
75
+ .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; }
76
+ .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; }
77
+ .tripmap-marker__img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; display: block !important; object-fit: cover !important; }
16
78
  .tripmap-marker--dot { width: 18px; height: 18px; background: #2563eb; border-width: 3px; }
17
79
  .tripmap-marker__dot { display: block; width: 100%; height: 100%; }
18
- .tripmap-marker--cluster { position: relative; overflow: visible; }
19
- .tripmap-marker--cluster .tripmap-marker__img { border-radius: 9999px; }
80
+ .tripmap-marker--cluster { overflow: visible; }
81
+ .tripmap-marker--cluster .tripmap-marker__img { border-radius: 9999px !important; }
20
82
  .tripmap-marker__count {
21
83
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
22
84
  padding: 0 5px; border-radius: 9999px; background: #1d4ed8; color: #fff;
@@ -24,8 +86,52 @@ const r = "tripmap-core-css", e = `
24
86
  }
25
87
 
26
88
  .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; }
89
+ /* Never taller than the map it opens in: the description scrolls instead
90
+ (56px = popup tip/offset + the fit-in-view margins). */
91
+ .tripmap-popup { max-width: 260px; max-height: calc(var(--tripmap-map-h, 400px) - 56px); overflow-y: auto; overscroll-behavior: contain; }
92
+ .tripmap-popup__img { display: block !important; width: 100% !important; height: auto !important; max-width: none !important; max-height: var(--tripmap-popup-img-max, 180px) !important; margin: 0 !important; object-fit: cover !important; border-radius: 8px !important; }
93
+ .tripmap-popup__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
94
+
95
+ /* Detail panel (detail: 'panel') — the photo under the filmstrip at component width. */
96
+ .tripmap--panel { height: auto; }
97
+ .tripmap-detail { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 0; }
98
+ .tripmap-detail[hidden] { display: none !important; }
99
+ .tripmap-detail__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; }
100
+ .tripmap-detail__img { display: block !important; width: 100% !important; height: auto !important; max-width: none !important; max-height: min(70vh, 640px) !important; margin: 0 !important; object-fit: contain !important; background: #111827; border-radius: 12px !important; }
101
+ .tripmap-detail__meta { display: flex; flex-direction: column; gap: 2px; font: 14px/1.45 system-ui, sans-serif; color: #111827; }
102
+ .tripmap-detail__title { font-weight: 600; }
103
+ .tripmap-detail__time { color: #6b7280; font-size: 12px; }
104
+ .tripmap-detail__desc { margin: 0; }
105
+
106
+ /* Fullscreen viewer. Mounted on <body>, or inside the fullscreen element. */
107
+ .tripmap-lightbox {
108
+ position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
109
+ background: rgba(0,0,0,0.92);
110
+ }
111
+ .tripmap-lightbox__figure {
112
+ margin: 0; max-width: 100vw; max-height: 100vh; display: flex; flex-direction: column; align-items: center;
113
+ gap: 8px; padding: 0 56px; box-sizing: border-box;
114
+ }
115
+ .tripmap-lightbox__img { width: auto !important; height: auto !important; max-width: 100% !important; max-height: calc(100vh - 96px) !important; margin: 0 !important; object-fit: contain !important; }
116
+ .tripmap-lightbox__caption {
117
+ color: #e5e7eb; font: 14px/1.4 system-ui, sans-serif; text-align: center; max-width: 720px;
118
+ display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px;
119
+ }
120
+ .tripmap-lightbox__caption-head { font-weight: 600; color: #fff; }
121
+ .tripmap-lightbox__close, .tripmap-lightbox__nav {
122
+ position: absolute; border: 0; background: rgba(255,255,255,0.12); color: #fff;
123
+ font: 28px/1 system-ui, sans-serif; width: 44px; height: 44px; border-radius: 9999px; cursor: pointer;
124
+ }
125
+ .tripmap-lightbox__close { top: 12px; right: 12px; }
126
+ .tripmap-lightbox__nav { top: 50%; transform: translateY(-50%); }
127
+ .tripmap-lightbox__nav--prev { left: 8px; }
128
+ .tripmap-lightbox__nav--next { right: 8px; }
129
+ .tripmap-lightbox__close:hover, .tripmap-lightbox__nav:hover { background: rgba(255,255,255,0.25); }
130
+ .tripmap-lightbox [hidden] { display: none !important; }
131
+ @media (max-width: 640px) {
132
+ .tripmap-lightbox__figure { padding: 0 8px; }
133
+ .tripmap-lightbox__nav { top: auto; bottom: 12px; transform: none; }
134
+ }
29
135
  .tripmap-popup__meta { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
30
136
  .tripmap-popup__title { font-weight: 600; }
31
137
  .tripmap-popup__time { color: #6b7280; font-size: 12px; }
@@ -41,34 +147,57 @@ const r = "tripmap-core-css", e = `
41
147
  background: #f3f4f6; cursor: pointer;
42
148
  }
43
149
  .tripmap-filmstrip__item--active { border-color: #2563eb; }
44
- .tripmap-filmstrip__img { width: 100%; height: 100%; object-fit: cover; display: block; }
150
+ .tripmap-filmstrip__img { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; margin: 0 !important; display: block !important; object-fit: cover !important; }
45
151
  .tripmap-filmstrip__item--waypoint { display: flex; align-items: center; justify-content: center; }
46
152
  .tripmap-filmstrip__label {
47
153
  font: 600 10px/1.2 system-ui, sans-serif; color: #374151; padding: 2px 3px 14px; text-align: center;
48
154
  max-width: 100%; overflow-wrap: anywhere; hyphens: auto;
49
155
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
50
156
  }
157
+ /* The bottom padding clears the time bar. A waypoint tile without one (times
158
+ hidden, or none readable) centres its label instead of keeping the gap. */
159
+ .tripmap-filmstrip__label:last-child { padding-bottom: 2px; }
51
160
  .tripmap-filmstrip__time {
52
161
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 0;
53
162
  background: rgba(17,24,39,0.55); color: #fff; font: 10px/1.3 system-ui, sans-serif;
54
163
  text-align: center; pointer-events: none;
55
164
  }
56
165
 
166
+ .tripmap:fullscreen { background: #fff; padding: 10px; box-sizing: border-box; gap: 10px; }
167
+ .tripmap:fullscreen .tripmap__map { border-radius: 0; }
168
+
57
169
  .tripmap__controls { position: absolute; top: 10px; left: 10px; z-index: 5; display: flex; gap: 6px; }
58
- .tripmap__play {
170
+ .tripmap__ctrl {
59
171
  border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(255,255,255,0.95);
60
172
  color: #1f2937; font: 600 12px/1 system-ui, sans-serif; cursor: pointer;
61
173
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
62
174
  }
63
- .tripmap__play:hover { background: #fff; }
175
+ .tripmap__ctrl:hover { background: #fff; }
176
+ .tripmap__export { position: relative; }
177
+ .tripmap__export-btn[aria-expanded="true"] { background: #fff; }
178
+ .tripmap__menu {
179
+ position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; min-width: 230px;
180
+ display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 10px;
181
+ background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
182
+ }
183
+ .tripmap__menu-item {
184
+ display: block; width: 100%; box-sizing: border-box; text-align: left; border: 0; background: none;
185
+ padding: 8px 10px; border-radius: 6px; font: 13px/1.3 system-ui, sans-serif; color: #1f2937;
186
+ cursor: pointer; text-decoration: none;
187
+ }
188
+ .tripmap__menu-item:hover, .tripmap__menu-item:focus-visible { background: #f3f4f6; }
189
+ /* An author display rule beats the UA [hidden] rule — restate it, or el.hidden = true is a no-op. */
190
+ .tripmap__controls [hidden] { display: none !important; }
191
+ .tripmap__menu-item small { display: block; color: #6b7280; font-size: 11px; }
64
192
  `;
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);
193
+ function p(t = document) {
194
+ if (t.getElementById(i)) return;
195
+ const e = t.createElement("style");
196
+ e.id = i, e.textContent = `${r}
197
+ ${a}`, t.head.appendChild(e);
70
198
  }
71
199
  export {
72
- r as TRIPMAP_STYLE_ID,
73
- a as injectTripMapCss
200
+ a as TRIPMAP_COMPONENT_CSS,
201
+ i as TRIPMAP_STYLE_ID,
202
+ p as injectTripMapCss
74
203
  };
@@ -0,0 +1,51 @@
1
+ class c {
2
+ constructor(e, a, s) {
3
+ this.callbacks = a, this.labels = s, this.root = e.ownerDocument.createElement("div"), this.root.className = "tripmap-detail", this.root.hidden = !0, e.appendChild(this.root);
4
+ }
5
+ root;
6
+ nodeId = null;
7
+ get element() {
8
+ return this.root;
9
+ }
10
+ get currentId() {
11
+ return this.nodeId;
12
+ }
13
+ show(e) {
14
+ const a = this.root.ownerDocument;
15
+ this.root.textContent = "", this.nodeId = e.id, this.root.dataset.tripmapNode = e.id;
16
+ const s = e.imageUrl || e.thumbnailUrl;
17
+ if (s) {
18
+ const t = this.callbacks.takePreloaded?.(s) ?? a.createElement("img");
19
+ if (t.getAttribute("src") || (t.src = s, t.loading = "eager", t.decoding = "async"), t.alt = e.altText || e.title || "", t.className = "tripmap-detail__img", t.draggable = !1, this.callbacks.onImageClick) {
20
+ const l = a.createElement("button");
21
+ l.type = "button", l.className = "tripmap-detail__zoom", l.setAttribute("aria-label", this.labels.zoomImage), l.appendChild(t), l.addEventListener("click", () => this.callbacks.onImageClick?.(e)), this.root.appendChild(l);
22
+ } else
23
+ this.root.appendChild(t);
24
+ }
25
+ const i = a.createElement("div");
26
+ if (i.className = "tripmap-detail__meta", e.title) {
27
+ const t = a.createElement("strong");
28
+ t.className = "tripmap-detail__title", t.textContent = e.title, i.appendChild(t);
29
+ }
30
+ const o = e.capturedAt ? this.callbacks.formatTime(e.capturedAt) : "";
31
+ if (o) {
32
+ const t = a.createElement("span");
33
+ t.className = "tripmap-detail__time", t.textContent = o, i.appendChild(t);
34
+ }
35
+ const r = e.description || e.altText;
36
+ if (r) {
37
+ const t = a.createElement("p");
38
+ t.className = "tripmap-detail__desc", t.textContent = r, i.appendChild(t);
39
+ }
40
+ i.childNodes.length > 0 && this.root.appendChild(i), this.root.hidden = !1;
41
+ }
42
+ clear() {
43
+ this.root.textContent = "", this.root.hidden = !0, this.nodeId = null, delete this.root.dataset.tripmapNode;
44
+ }
45
+ destroy() {
46
+ this.root.remove();
47
+ }
48
+ }
49
+ export {
50
+ c as DetailPanel
51
+ };