@blogmcp/mdx-render-vue 0.11.0 → 0.12.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.
@@ -21,11 +21,11 @@
21
21
  color: #374151;
22
22
  }
23
23
 
24
- .lightbox-fade-enter-active[data-v-f28ad12c],
25
- .lightbox-fade-leave-active[data-v-f28ad12c] {
24
+ .lightbox-fade-enter-active[data-v-458c8685],
25
+ .lightbox-fade-leave-active[data-v-458c8685] {
26
26
  transition: opacity 0.2s ease;
27
27
  }
28
- .lightbox-fade-enter-from[data-v-f28ad12c],
29
- .lightbox-fade-leave-to[data-v-f28ad12c] {
28
+ .lightbox-fade-enter-from[data-v-458c8685],
29
+ .lightbox-fade-leave-to[data-v-458c8685] {
30
30
  opacity: 0;
31
31
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./GalleryLightbox.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const GalleryLightbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f28ad12c"]]);
4
+ const GalleryLightbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-458c8685"]]);
5
5
  export {
6
6
  GalleryLightbox as default
7
7
  };
@@ -93,7 +93,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
93
93
  function initialViewFromProps() {
94
94
  if (!props.center) return void 0;
95
95
  const [lat, lng] = props.center.split(",").map((v) => Number.parseFloat(v.trim()));
96
- if (!Number.isFinite(lat) || !Number.isFinite(lng)) return void 0;
96
+ if (lat === void 0 || lng === void 0 || !Number.isFinite(lat) || !Number.isFinite(lng)) return void 0;
97
97
  return { center: [lng, lat], zoom: props.zoom };
98
98
  }
99
99
  onMounted(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogmcp/mdx-render-vue",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Vue renderer for MDX components — edit + render SFCs wired to @blogmcp/mdx-schema",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -100,8 +100,8 @@
100
100
  "postpack": "node ../../scripts/pack-dist-types.mjs postpack"
101
101
  },
102
102
  "dependencies": {
103
- "@blogmcp/mdx-schema": "^0.11.0",
104
- "@blogmcp/sanitize": "^0.11.0",
103
+ "@blogmcp/mdx-schema": "^0.12.0",
104
+ "@blogmcp/sanitize": "^0.12.0",
105
105
  "@blogmcp/tripmap-core": "^0.1.2",
106
106
  "@ark-ui/vue": "^5.0.0",
107
107
  "@iconify/vue": "^5.0.0"
@@ -63,7 +63,7 @@ export function useGallery(props: GalleryProps) {
63
63
  * Get the image source URL at a given index
64
64
  */
65
65
  function getImageSrc(index: number): string {
66
- const image = props.images[index]
66
+ const image = props.images[index]! // an index of `images`, like every getter's
67
67
  return isMediaObject(image) ? image.src : image
68
68
  }
69
69
 
@@ -101,7 +101,7 @@ export function useGallery(props: GalleryProps) {
101
101
  * Check if the item at index is a video (by type field or URL extension)
102
102
  */
103
103
  function isVideo(index: number): boolean {
104
- const image = props.images[index]
104
+ const image = props.images[index]!
105
105
  if (isMediaObject(image)) {
106
106
  if (image.type === 'video') return true
107
107
  if (image.type === 'image') return false
@@ -49,17 +49,17 @@ function navigateLightbox(newIndex: number) {
49
49
  lightboxIndex.value = newIndex
50
50
  }
51
51
 
52
- // Map lightbox index back to full array index for getters
52
+ // Map lightbox index back to full array index for getters (the lightbox navigates only within imageOnlyIndices)
53
53
  function lightboxGetSrc(idx: number): string {
54
- return getImageSrc(imageOnlyIndices.value[idx])
54
+ return getImageSrc(imageOnlyIndices.value[idx]!)
55
55
  }
56
56
 
57
57
  function lightboxGetAlt(idx: number): string {
58
- return getImageAlt(imageOnlyIndices.value[idx])
58
+ return getImageAlt(imageOnlyIndices.value[idx]!)
59
59
  }
60
60
 
61
61
  function lightboxGetDescription(idx: number): string | undefined {
62
- return getImageDescription(imageOnlyIndices.value[idx])
62
+ return getImageDescription(imageOnlyIndices.value[idx]!)
63
63
  }
64
64
 
65
65
  // Scroll lock
@@ -51,13 +51,14 @@ const touchStartX = ref(0)
51
51
  const touchStartY = ref(0)
52
52
 
53
53
  function onTouchStart(e: TouchEvent) {
54
- touchStartX.value = e.touches[0].clientX
55
- touchStartY.value = e.touches[0].clientY
54
+ // A touchstart has at least the touch that started it, a touchend the touch that ended.
55
+ touchStartX.value = e.touches[0]!.clientX
56
+ touchStartY.value = e.touches[0]!.clientY
56
57
  }
57
58
 
58
59
  function onTouchEnd(e: TouchEvent) {
59
- const dx = e.changedTouches[0].clientX - touchStartX.value
60
- const dy = e.changedTouches[0].clientY - touchStartY.value
60
+ const dx = e.changedTouches[0]!.clientX - touchStartX.value
61
+ const dy = e.changedTouches[0]!.clientY - touchStartY.value
61
62
  // Only trigger if horizontal swipe is dominant and exceeds threshold
62
63
  if (Math.abs(dx) > 50 && Math.abs(dx) > Math.abs(dy)) {
63
64
  if (dx < 0 && hasNext.value) {
@@ -112,7 +112,7 @@ async function start(): Promise<void> {
112
112
  function initialViewFromProps(): { center?: [number, number]; zoom?: number } | undefined {
113
113
  if (!props.center) return undefined
114
114
  const [lat, lng] = props.center.split(',').map((v) => Number.parseFloat(v.trim()))
115
- if (!Number.isFinite(lat) || !Number.isFinite(lng)) return undefined
115
+ if (lat === undefined || lng === undefined || !Number.isFinite(lat) || !Number.isFinite(lng)) return undefined
116
116
  return { center: [lng, lat], zoom: props.zoom }
117
117
  }
118
118