@leavepulse/ui 0.93.2 → 0.94.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 (78) hide show
  1. package/README.md +53 -3
  2. package/dist/assets/LpTabs-D7EyG21l.css +18 -0
  3. package/dist/assets/LpVideoTrim-D8JDg9Qn.css +8 -0
  4. package/dist/chunks/AppShellContextNav-BoH4ffnC.js +54 -0
  5. package/dist/chunks/{LpAppShell-BWaVRsDB.js → LpAppShell-xEBmGV78.js} +12 -5
  6. package/dist/chunks/{LpDateRangePicker-CAn2yGbn.js → LpDateRangePicker-DRBB8z6t.js} +1 -1
  7. package/dist/chunks/{LpDrawer-iRHwJOGn.js → LpDrawer-BkWjFdV0.js} +81 -42
  8. package/dist/chunks/{LpLightbox-a24V_0Wk.js → LpLightbox-DPgz7IsT.js} +62 -49
  9. package/dist/chunks/{LpMapPicker-DVfiy3rR.js → LpMapPicker-V0Lybi10.js} +19 -52
  10. package/dist/chunks/{LpMediaGallery-B7DOV_aL.js → LpMediaGallery-CTejKF2-.js} +36 -15
  11. package/dist/chunks/{LpModalNav-DivqT1NV.js → LpModalNav-DVXAF-DG.js} +1 -1
  12. package/dist/chunks/{LpRangeCalendar-C9gkNMYw.js → LpRangeCalendar-9BvaLZji.js} +3 -4
  13. package/dist/chunks/LpScrollStrip-D4tsOfAQ.js +78 -0
  14. package/dist/chunks/{LpSidebar-DQtCYlT4.js → LpSidebar-BIhusppV.js} +1 -1
  15. package/dist/component-names.d.ts +1 -1
  16. package/dist/components/AppShellContextNav.vue.js +1 -1
  17. package/dist/components/LpAppShell.vue.js +1 -1
  18. package/dist/components/LpChart.vue.js +3 -3
  19. package/dist/components/LpDateRangePicker.vue.js +1 -1
  20. package/dist/components/LpDrawer.vue.d.ts +10 -2
  21. package/dist/components/LpDrawer.vue.js +1 -1
  22. package/dist/components/LpDropzone.vue.d.ts +1 -1
  23. package/dist/components/LpLightbox.vue.js +1 -1
  24. package/dist/components/LpMapPicker.vue.js +1 -1
  25. package/dist/components/LpMediaGallery.vue.d.ts +2 -0
  26. package/dist/components/LpMediaGallery.vue.js +1 -1
  27. package/dist/components/LpModalNav.vue.js +1 -1
  28. package/dist/components/LpRangeCalendar.vue.js +1 -1
  29. package/dist/components/LpRevealOnScroll.vue.d.ts +1 -1
  30. package/dist/components/LpScrollStrip.vue.d.ts +48 -0
  31. package/dist/components/LpScrollStrip.vue.js +4 -0
  32. package/dist/components/LpSidebar.vue.js +1 -1
  33. package/dist/components/LpTabs.vue.d.ts +4 -4
  34. package/dist/components/LpTabs.vue.js +104 -90
  35. package/dist/components/LpVideoTrim.vue.js +41 -54
  36. package/dist/composables/gesture.d.ts +141 -0
  37. package/dist/composables/gesture.js +176 -0
  38. package/dist/composables/scroll.d.ts +5 -1
  39. package/dist/composables/scroll.js +16 -9
  40. package/dist/composables/useAppUpdate.d.ts +26 -0
  41. package/dist/composables/useAppUpdate.js +91 -0
  42. package/dist/composables/useGesture.d.ts +107 -0
  43. package/dist/composables/useGesture.js +281 -0
  44. package/dist/composables/usePaintSelect.js +3 -4
  45. package/dist/composables/useScrollStrip.d.ts +27 -0
  46. package/dist/composables/useScrollStrip.js +194 -0
  47. package/dist/composables/useTouchHold.d.ts +3 -1
  48. package/dist/composables/useTouchHold.js +9 -51
  49. package/dist/composables/useZoomPan.js +4 -6
  50. package/dist/index.d.ts +9 -0
  51. package/dist/index.js +180 -152
  52. package/package.json +1 -1
  53. package/src/component-names.ts +1 -0
  54. package/src/components/AppShellContextNav.vue +3 -2
  55. package/src/components/LpAppShell.vue +10 -1
  56. package/src/components/LpChart.vue +2 -2
  57. package/src/components/LpDrawer.vue +121 -54
  58. package/src/components/LpLightbox.vue +33 -20
  59. package/src/components/LpMapPicker.vue +22 -64
  60. package/src/components/LpMediaGallery.vue +44 -11
  61. package/src/components/LpRangeCalendar.vue +4 -5
  62. package/src/components/LpScrollStrip.vue +96 -0
  63. package/src/components/LpSidebar.vue +2 -2
  64. package/src/components/LpTabs.vue +36 -17
  65. package/src/components/LpVideoTrim.vue +35 -46
  66. package/src/composables/gesture.ts +314 -0
  67. package/src/composables/scroll.ts +20 -9
  68. package/src/composables/useAppUpdate.ts +156 -0
  69. package/src/composables/useGesture.ts +451 -0
  70. package/src/composables/usePaintSelect.ts +4 -5
  71. package/src/composables/useScrollStrip.ts +249 -0
  72. package/src/composables/useTouchHold.ts +15 -73
  73. package/src/composables/useZoomPan.ts +6 -9
  74. package/src/index.ts +27 -0
  75. package/src/tokens/effects.css +40 -0
  76. package/dist/assets/LpTabs-Bh7a-Bdl.css +0 -18
  77. package/dist/assets/LpVideoTrim-CMoUw3dJ.css +0 -8
  78. package/dist/chunks/AppShellContextNav-C6Ho2mof.js +0 -49
@@ -4,13 +4,15 @@ import { clamp } from "../composables/clamp.js";
4
4
  import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from "reka-ui";
5
5
  import { useLabels } from "../composables/useLpConfig.js";
6
6
  import { useZoomPan } from "../composables/useZoomPan.js";
7
+ import { _ as _sfc_main$5 } from "./LpScrollStrip-D4tsOfAQ.js";
8
+ import { createDragSession, slopFor } from "../composables/gesture.js";
7
9
  import { clickLink } from "../components/exportData.js";
8
10
  import { isVideoItem, fileNameOf } from "../components/lightbox.js";
9
11
  import { _ as _sfc_main$2 } from "./LpCopyButton-BGzw95Xc.js";
10
12
  import { _ as _sfc_main$1 } from "./LpIcon-CxHFPwKt.js";
11
13
  import { _ as _sfc_main$4 } from "./LpLoader-Bf1yZwaU.js";
12
14
  import { _ as _sfc_main$3 } from "./LpVideoPlayer-FMuxTAU8.js";
13
- import { _ as _sfc_main$5 } from "./VideoThumb-BfDkIXqE.js";
15
+ import { _ as _sfc_main$6 } from "./VideoThumb-BfDkIXqE.js";
14
16
  import { useModalLayer } from "../components/modalDepth.js";
15
17
  import { inTextField } from "../composables/textEntry.js";
16
18
  import { useView, usePortalTarget, useOutsideGuard, viewDocument } from "../composables/useView.js";
@@ -56,8 +58,9 @@ const _hoisted_20 = {
56
58
  key: 1,
57
59
  class: "truncate text-xs text-white/55"
58
60
  };
59
- const _hoisted_21 = ["data-index", "aria-label", "onClick"];
60
- const _hoisted_22 = ["src", "alt"];
61
+ const _hoisted_21 = { class: "mx-auto flex w-max gap-2 p-1" };
62
+ const _hoisted_22 = ["data-index", "aria-label", "onClick"];
63
+ const _hoisted_23 = ["src", "alt"];
61
64
  const WHEEL_STEP = 60;
62
65
  const OWNS_KEYS = "input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='searchbox'], [role='combobox']";
63
66
  const BTN = "flex size-9 items-center justify-center rounded-control text-white/80 outline-none transition-colors duration-[var(--duration-fast)] hover:bg-white/15 hover:text-white focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40";
@@ -182,8 +185,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
182
185
  if (!ok) failed.value = true;
183
186
  }
184
187
  function scrollThumbIntoView() {
185
- const el = stripEl.value?.querySelector(`[data-index="${current.value}"]`);
186
- el?.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "center" });
188
+ const el = stripEl.value?.scroller?.querySelector(`[data-index="${current.value}"]`);
189
+ stripEl.value?.reveal(el, { block: "center" });
187
190
  }
188
191
  function close() {
189
192
  emit("update:open", false);
@@ -250,37 +253,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
250
253
  rotation.value = (rotation.value + 90) % 360;
251
254
  zoom.reset();
252
255
  }
253
- let swipeStart = null;
256
+ let swipe = null;
254
257
  const fingers = /* @__PURE__ */ new Set();
258
+ function startSwipe(e) {
259
+ swipe = createDragSession({ x: e.clientX, y: e.clientY }, e.timeStamp, { slop: slopFor(e.pointerType), axis: "x" });
260
+ }
255
261
  function onPointerDown(e) {
256
262
  fingers.add(e.pointerId);
257
263
  if (fingers.size > 1) {
258
- swipeStart = null;
264
+ swipe = null;
259
265
  if (!isVideo.value) zoom.onPointerDown(e);
260
266
  return;
261
267
  }
262
268
  if (isVideo.value) {
263
- swipeStart = e.target.closest?.("[data-lp-player-controls]") ? null : { x: e.clientX, y: e.clientY };
269
+ if (e.target.closest?.("[data-lp-player-controls]")) swipe = null;
270
+ else startSwipe(e);
264
271
  return;
265
272
  }
266
273
  zoom.onPointerDown(e);
267
- swipeStart = zoom.zoomed.value ? null : { x: e.clientX, y: e.clientY };
274
+ if (zoom.zoomed.value) swipe = null;
275
+ else startSwipe(e);
276
+ }
277
+ function onPointerMove(e) {
278
+ if (!isVideo.value) zoom.onPointerMove(e);
279
+ if (swipe?.move({ x: e.clientX, y: e.clientY }, e.timeStamp).phase === "rejected") swipe = null;
268
280
  }
269
281
  function onPointerCancel(e) {
270
282
  fingers.delete(e.pointerId);
271
- swipeStart = null;
283
+ swipe = null;
272
284
  if (!isVideo.value) zoom.onPointerUp(e);
273
285
  }
274
286
  function onPointerUp(e) {
275
287
  fingers.delete(e.pointerId);
276
288
  if (!isVideo.value) zoom.onPointerUp(e);
277
- if (!swipeStart) return;
278
- const dx = e.clientX - swipeStart.x;
279
- const dy = e.clientY - swipeStart.y;
280
- swipeStart = null;
281
- if (Math.abs(dx) > 60 && Math.abs(dx) > Math.abs(dy) * 1.5) {
282
- go(current.value + (dx < 0 ? 1 : -1));
283
- }
289
+ const ended = swipe?.end({ x: e.clientX, y: e.clientY }, e.timeStamp, { axis: "x" });
290
+ swipe = null;
291
+ if (ended?.swipe === "left") go(current.value + 1);
292
+ else if (ended?.swipe === "right") go(current.value - 1);
284
293
  }
285
294
  function onDoubleClick(e) {
286
295
  if (isVideo.value) return;
@@ -366,7 +375,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
366
375
  return (_ctx, _cache) => {
367
376
  return openBlock(), createBlock(unref(DialogRoot), {
368
377
  open: __props.open,
369
- "onUpdate:open": _cache[10] || (_cache[10] = (v) => emit("update:open", v))
378
+ "onUpdate:open": _cache[9] || (_cache[9] = (v) => emit("update:open", v))
370
379
  }, {
371
380
  default: withCtx(() => [
372
381
  createVNode(unref(DialogPortal), { to: unref(portalTo) }, {
@@ -481,8 +490,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
481
490
  class: normalizeClass(["relative flex min-h-0 flex-1 touch-none items-center justify-center overflow-hidden", isPanning.value ? "cursor-grabbing" : isZoomed.value ? "cursor-grab" : ""]),
482
491
  onWheel: onStageWheel,
483
492
  onPointerdown: onPointerDown,
484
- onPointermove: _cache[9] || (_cache[9] = //@ts-ignore
485
- (...args) => unref(zoom).onPointerMove && unref(zoom).onPointerMove(...args)),
493
+ onPointermove: onPointerMove,
486
494
  onPointerup: onPointerUp,
487
495
  onPointercancel: onPointerCancel,
488
496
  onDblclick: onDoubleClick,
@@ -574,38 +582,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
574
582
  item.value.description ? (openBlock(), createElementBlock("p", _hoisted_20, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)
575
583
  ])) : createCommentVNode("", true)
576
584
  ]),
577
- showStrip.value && total.value > 1 ? (openBlock(), createElementBlock("div", {
585
+ showStrip.value && total.value > 1 ? (openBlock(), createBlock(_sfc_main$5, {
578
586
  key: 0,
579
587
  ref_key: "stripEl",
580
588
  ref: stripEl,
581
- class: "lp-scrollbar-none flex justify-start gap-2 overflow-x-auto sm:justify-center"
582
- }, [
583
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (entry, i) => {
584
- return openBlock(), createElementBlock("button", {
585
- key: entry.src + i,
586
- "data-index": i,
587
- type: "button",
588
- style: normalizeStyle({ "--thumb-delay": `${Math.min(i * 30, 240)}ms` }),
589
- class: normalizeClass(["relative size-14 shrink-0 overflow-hidden rounded-control outline-none ring-2 transition-[opacity,box-shadow,scale] duration-[var(--duration-fast)] hover:scale-105 focus-visible:ring-ring animate-[lightbox-chrome-in_var(--duration-medium)_var(--ease-emphasized)_both] [animation-delay:var(--thumb-delay)] motion-reduce:animate-none", i === current.value ? "opacity-100 ring-brand" : "opacity-45 ring-transparent hover:opacity-80"]),
590
- "aria-label": entry.title ?? position(i),
591
- onClick: ($event) => go(i)
592
- }, [
593
- unref(isVideoItem)(entry) ? (openBlock(), createBlock(_sfc_main$5, {
594
- key: 0,
595
- item: entry,
596
- compact: "",
597
- alt: entry.title ?? "",
598
- "media-class": covered(i) ? "scale-110 blur-md" : void 0
599
- }, null, 8, ["item", "alt", "media-class"])) : (openBlock(), createElementBlock("img", {
600
- key: 1,
601
- src: entry.thumb ?? entry.src,
602
- alt: entry.title ?? "",
603
- class: normalizeClass(["size-full object-cover", covered(i) ? "scale-110 blur-md" : ""]),
604
- draggable: "false"
605
- }, null, 10, _hoisted_22))
606
- ], 14, _hoisted_21);
607
- }), 128))
608
- ], 512)) : createCommentVNode("", true)
589
+ buttons: false
590
+ }, {
591
+ default: withCtx(() => [
592
+ createElementVNode("div", _hoisted_21, [
593
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (entry, i) => {
594
+ return openBlock(), createElementBlock("button", {
595
+ key: entry.src + i,
596
+ "data-index": i,
597
+ type: "button",
598
+ style: normalizeStyle({ "--thumb-delay": `${Math.min(i * 30, 240)}ms` }),
599
+ class: normalizeClass(["relative size-14 shrink-0 overflow-hidden rounded-control outline-none ring-2 transition-[opacity,box-shadow,scale] duration-[var(--duration-fast)] hover:scale-105 focus-visible:ring-ring animate-[lightbox-chrome-in_var(--duration-medium)_var(--ease-emphasized)_both] [animation-delay:var(--thumb-delay)] motion-reduce:animate-none", i === current.value ? "opacity-100 ring-brand" : "opacity-45 ring-transparent hover:opacity-80"]),
600
+ "aria-label": entry.title ?? position(i),
601
+ onClick: ($event) => go(i)
602
+ }, [
603
+ unref(isVideoItem)(entry) ? (openBlock(), createBlock(_sfc_main$6, {
604
+ key: 0,
605
+ item: entry,
606
+ compact: "",
607
+ alt: entry.title ?? "",
608
+ "media-class": covered(i) ? "scale-110 blur-md" : void 0
609
+ }, null, 8, ["item", "alt", "media-class"])) : (openBlock(), createElementBlock("img", {
610
+ key: 1,
611
+ src: entry.thumb ?? entry.src,
612
+ alt: entry.title ?? "",
613
+ class: normalizeClass(["size-full object-cover", covered(i) ? "scale-110 blur-md" : ""]),
614
+ draggable: "false"
615
+ }, null, 10, _hoisted_23))
616
+ ], 14, _hoisted_22);
617
+ }), 128))
618
+ ])
619
+ ]),
620
+ _: 1
621
+ }, 512)) : createCommentVNode("", true)
609
622
  ])
610
623
  ]),
611
624
  _: 3
@@ -1,6 +1,8 @@
1
1
  import { defineComponent, computed, ref, watch, onBeforeUnmount, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createCommentVNode, createBlock, toDisplayString } from "vue";
2
2
  import { clamp } from "../composables/clamp.js";
3
- import { prefersReducedMotion } from "../composables/easing.js";
3
+ import { createDragSession, slopFor } from "../composables/gesture.js";
4
+ import { glide } from "../composables/useGesture.js";
5
+ import { nodeWindow } from "../composables/realm.js";
4
6
  import { OSM_TILES, project, tileUrl, unproject } from "../components/address.js";
5
7
  import { _ as _sfc_main$1 } from "./LpIcon-CxHFPwKt.js";
6
8
  import { _ as _sfc_main$2 } from "./LpLoader-Bf1yZwaU.js";
@@ -185,72 +187,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
185
187
  return unproject(origin.value.x + at.x, origin.value.y + at.y, level.value, tileSize.value);
186
188
  }
187
189
  const panning = ref(false);
188
- let moved = false;
189
- let last = { x: 0, y: 0 };
190
- let velocity = { x: 0, y: 0 };
191
- let lastMove = 0;
192
- let glideFrame;
190
+ let session = null;
191
+ let coast = null;
193
192
  function stopGlide() {
194
- if (glideFrame !== void 0) cancelAnimationFrame(glideFrame);
195
- glideFrame = void 0;
196
- velocity = { x: 0, y: 0 };
193
+ coast?.stop();
194
+ coast = null;
197
195
  }
198
196
  function onPointerDown(e) {
199
197
  if (props.disabled || e.button !== 0 || zooming.value) return;
200
198
  stopGlide();
201
199
  panning.value = true;
202
- moved = false;
203
- last = { x: e.clientX, y: e.clientY };
204
- lastMove = performance.now();
200
+ session = createDragSession({ x: e.clientX, y: e.clientY }, e.timeStamp, { slop: slopFor(e.pointerType) });
205
201
  e.currentTarget.setPointerCapture(e.pointerId);
206
202
  }
207
203
  function onPointerMove(e) {
208
- if (!panning.value) return;
209
- const dx = e.clientX - last.x;
210
- const dy = e.clientY - last.y;
211
- if (Math.abs(dx) > 2 || Math.abs(dy) > 2) moved = true;
212
- const now = performance.now();
213
- const dt = now - lastMove;
214
- if (dt > 0) {
215
- velocity = {
216
- x: velocity.x * 0.7 + dx / dt * 0.3,
217
- y: velocity.y * 0.7 + dy / dt * 0.3
218
- };
219
- }
220
- lastMove = now;
221
- last = { x: e.clientX, y: e.clientY };
222
- panBy(-dx, -dy);
204
+ if (!panning.value || !session) return;
205
+ const frame = session.move({ x: e.clientX, y: e.clientY }, e.timeStamp);
206
+ if (frame.phase !== "drag") return;
207
+ panBy(-(frame.first ? frame.movement.x : frame.delta.x), -(frame.first ? frame.movement.y : frame.delta.y));
223
208
  }
224
209
  function onPointerUp(e) {
225
- if (!panning.value) return;
210
+ if (!panning.value || !session) return;
226
211
  panning.value = false;
227
212
  e.currentTarget.releasePointerCapture?.(e.pointerId);
228
- if (!moved && !props.disabled) {
229
- emit("update:modelValue", toLatLon(viewportPoint(e)));
230
- return;
231
- }
232
- if (performance.now() - lastMove > 90) velocity = { x: 0, y: 0 };
233
- glide();
234
- }
235
- function glide() {
236
- if (prefersReducedMotion() || Math.hypot(velocity.x, velocity.y) < 0.05) {
237
- velocity = { x: 0, y: 0 };
213
+ const end = session.end({ x: e.clientX, y: e.clientY }, e.timeStamp);
214
+ session = null;
215
+ if (end.phase !== "drag") {
216
+ if (!props.disabled && e.type !== "pointercancel") emit("update:modelValue", toLatLon(viewportPoint(e)));
238
217
  return;
239
218
  }
240
- let previous = performance.now();
241
- const step = (now) => {
242
- const dt = Math.min(now - previous, 32);
243
- previous = now;
244
- const friction = Math.exp(-dt / 240);
245
- velocity = { x: velocity.x * friction, y: velocity.y * friction };
246
- panBy(-velocity.x * dt, -velocity.y * dt);
247
- if (Math.hypot(velocity.x, velocity.y) > 0.015) {
248
- glideFrame = requestAnimationFrame(step);
249
- } else {
250
- stopGlide();
251
- }
252
- };
253
- glideFrame = requestAnimationFrame(step);
219
+ if (e.type === "pointercancel") return;
220
+ coast = glide(end.velocity, (dx, dy) => panBy(-dx, -dy), { win: nodeWindow(e.currentTarget) });
254
221
  }
255
222
  function panBy(dx, dy) {
256
223
  mapCenter.value = unproject(
@@ -4,12 +4,12 @@ import { useMergedAttrs } from "../composables/useMergedClass.js";
4
4
  import { useLabels } from "../composables/useLpConfig.js";
5
5
  import { _ as _sfc_main$1 } from "./LpContextMenu-DEFirphS.js";
6
6
  import { _ as _sfc_main$3 } from "./LpIcon-CxHFPwKt.js";
7
- import { _ as _sfc_main$4 } from "./LpLightbox-a24V_0Wk.js";
7
+ import { _ as _sfc_main$4 } from "./LpLightbox-DPgz7IsT.js";
8
8
  import { _ as _sfc_main$2 } from "./VideoThumb-BfDkIXqE.js";
9
9
  const _hoisted_1 = { key: 0 };
10
10
  const _hoisted_2 = ["aria-label"];
11
11
  const _hoisted_3 = ["aria-label", "onClick"];
12
- const _hoisted_4 = ["src", "alt"];
12
+ const _hoisted_4 = ["src", "alt", "onError"];
13
13
  const _hoisted_5 = {
14
14
  key: 0,
15
15
  class: "pointer-events-none absolute inset-0 flex items-center justify-center"
@@ -39,7 +39,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
39
  itemMenu: {},
40
40
  labels: {}
41
41
  },
42
- emits: ["select", "reveal", "update:open"],
42
+ emits: ["select", "reveal", "broken", "update:open"],
43
43
  setup(__props, { expose: __expose, emit: __emit }) {
44
44
  const DEFAULT_LABELS = {
45
45
  /** Accessible name of the grid. */
@@ -60,7 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
60
60
  }
61
61
  function menuTitle(item, i) {
62
62
  if (isHidden(item)) return text.value.spoiler;
63
- return item.title || fill(text.value.image, i + 1, props.items.length);
63
+ return item.title || fill(text.value.image, i + 1, shown.value.length);
64
64
  }
65
65
  const emit = __emit;
66
66
  const open = ref(false);
@@ -68,10 +68,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
68
68
  watch(open, (value, was) => {
69
69
  if (!value && was) emit("update:open", false);
70
70
  });
71
+ const fellBack = ref(/* @__PURE__ */ new Set());
72
+ const broken = ref(/* @__PURE__ */ new Set());
73
+ const shown = computed(
74
+ () => broken.value.size ? props.items.filter((item) => !broken.value.has(item.src)) : props.items
75
+ );
76
+ function thumbOf(item) {
77
+ return item.thumb && !fellBack.value.has(item.src) ? item.thumb : item.src;
78
+ }
79
+ function onImageError(item) {
80
+ if (item.thumb && item.thumb !== item.src && !fellBack.value.has(item.src)) {
81
+ fellBack.value = new Set(fellBack.value).add(item.src);
82
+ return;
83
+ }
84
+ if (broken.value.has(item.src)) return;
85
+ broken.value = new Set(broken.value).add(item.src);
86
+ emit("broken", item);
87
+ }
71
88
  const visible = computed(
72
- () => props.max && props.items.length > props.max ? props.items.slice(0, props.max) : props.items
89
+ () => props.max && shown.value.length > props.max ? shown.value.slice(0, props.max) : shown.value
73
90
  );
74
- const hiddenCount = computed(() => Math.max(props.items.length - visible.value.length, 0));
91
+ const hiddenCount = computed(() => Math.max(shown.value.length - visible.value.length, 0));
75
92
  const COLS = {
76
93
  1: "grid-cols-1",
77
94
  2: "grid-cols-2",
@@ -141,9 +158,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
141
158
  () => ["grid", columnClass.value, GAPS[props.gap] ?? GAPS[2]].join(" ")
142
159
  );
143
160
  function activate(i) {
144
- const item = props.items[i];
161
+ const item = shown.value[i];
145
162
  if (!item) return;
146
- emit("select", item, i);
163
+ emit("select", item, props.items.indexOf(item));
147
164
  if (!props.openable) return;
148
165
  const at = openIndexOf(i);
149
166
  if (at === -1) return;
@@ -162,14 +179,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
162
179
  revealed.value = new Set(revealed.value).add(item.src);
163
180
  emit("reveal", item);
164
181
  }
165
- const openItems = computed(() => props.items.filter((item) => !isHidden(item)));
182
+ const openItems = computed(() => shown.value.filter((item) => !isHidden(item)));
166
183
  function openIndexOf(i) {
167
- const item = props.items[i];
184
+ const item = shown.value[i];
168
185
  return item ? openItems.value.indexOf(item) : -1;
169
186
  }
170
187
  __expose({
171
188
  /** Open the lightbox at an index — for a "view all" button outside the grid. */
172
- openAt: (i) => activate(i),
189
+ openAt: (i) => {
190
+ const item = props.items[i];
191
+ if (item) activate(shown.value.indexOf(item));
192
+ },
173
193
  /** Uncover every spoiler in the set. */
174
194
  revealAll: () => {
175
195
  const next = new Set(revealed.value);
@@ -178,7 +198,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
178
198
  }
179
199
  });
180
200
  return (_ctx, _cache) => {
181
- return !__props.items.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
201
+ return !shown.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
182
202
  renderSlot(_ctx.$slots, "empty")
183
203
  ])) : (openBlock(), createElementBlock("div", mergeProps({
184
204
  key: 1,
@@ -191,7 +211,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
191
211
  key: item.src + i,
192
212
  items: __props.itemMenu?.(item, i) ?? [],
193
213
  title: menuTitle(item, i),
194
- "title-image": isHidden(item) ? void 0 : unref(isVideoItem)(item) ? item.poster ?? item.thumb : item.thumb || item.src,
214
+ "title-image": isHidden(item) ? void 0 : unref(isVideoItem)(item) ? item.poster ?? item.thumb : thumbOf(item),
195
215
  subtitle: isHidden(item) ? void 0 : item.description
196
216
  }, {
197
217
  default: withCtx(() => [
@@ -221,15 +241,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
221
241
  ]
222
242
  }, null, 8, ["item", "alt", "media-class"])) : (openBlock(), createElementBlock("img", {
223
243
  key: 1,
224
- src: item.thumb || item.src,
244
+ src: thumbOf(item),
225
245
  alt: isHidden(item) ? "" : item.title || "",
226
246
  loading: "lazy",
227
247
  decoding: "async",
248
+ onError: ($event) => onImageError(item),
228
249
  class: normalizeClass(["size-full object-cover transition-transform duration-[var(--duration-medium)] ease-[var(--ease-emphasized)] group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100", [
229
250
  isHidden(item) ? "scale-[1.12] blur-[18px] brightness-[0.6] saturate-[1.1] group-hover:scale-[1.12]" : "",
230
251
  !isHidden(item) && hiddenCount.value && i === visible.value.length - 1 ? "scale-[1.06] blur-[2px] brightness-[0.45] group-hover:scale-[1.06]" : ""
231
252
  ]])
232
- }, null, 10, _hoisted_4))
253
+ }, null, 42, _hoisted_4))
233
254
  ]),
234
255
  isHidden(item) ? (openBlock(), createElementBlock("span", _hoisted_5, [
235
256
  createElementVNode("span", _hoisted_6, toDisplayString(unref(text).spoiler), 1)
@@ -5,7 +5,7 @@ import { _ as _sfc_main$2 } from "./LpButton-BvVoF-PO.js";
5
5
  import { _ as _sfc_main$3 } from "./LpIcon-CxHFPwKt.js";
6
6
  import { MODAL_MAX_HEIGHT } from "../components/modalDepth.js";
7
7
  import { _ as _sfc_main$1 } from "./LpModal-D1E7rQzw.js";
8
- import { _ as _sfc_main$4 } from "./LpSidebar-DQtCYlT4.js";
8
+ import { _ as _sfc_main$4 } from "./LpSidebar-BIhusppV.js";
9
9
  const _hoisted_1 = { class: "flex items-center gap-2" };
10
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  __name: "LpModalNav",
@@ -1,4 +1,5 @@
1
1
  import { defineComponent, shallowRef, watch, computed, ref, onMounted, onBeforeUnmount, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, normalizeClass, createElementVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, nextTick } from "vue";
2
+ import { HOLD_TO_DRAG_MS, TOUCH_SLOP } from "../composables/gesture.js";
2
3
  import { today, getLocalTimeZone } from "@internationalized/date";
3
4
  import { RangeCalendarRoot, RangeCalendarHeader, RangeCalendarPrev, RangeCalendarHeading, RangeCalendarNext, RangeCalendarGrid, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarGridBody, RangeCalendarCell, RangeCalendarCellTrigger } from "reka-ui";
4
5
  import { useLabels } from "../composables/useLpConfig.js";
@@ -60,8 +61,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
60
61
  });
61
62
  }
62
63
  const root = ref(null);
63
- const HOLD_MS = 320;
64
- const SLOP_PX = 8;
65
64
  let anchor = null;
66
65
  let pointerId = -1;
67
66
  let armed = false;
@@ -113,12 +112,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
113
112
  dragging.value = true;
114
113
  draft.value = toReka({ start: day, end: day });
115
114
  navigator.vibrate?.(8);
116
- }, HOLD_MS);
115
+ }, HOLD_TO_DRAG_MS);
117
116
  }
118
117
  function onPointerMove(e) {
119
118
  if (anchor === null || e.pointerId !== pointerId) return;
120
119
  if (!armed) {
121
- if (Math.hypot(e.clientX - startX, e.clientY - startY) > SLOP_PX) reset();
120
+ if (Math.hypot(e.clientX - startX, e.clientY - startY) > TOUCH_SLOP) reset();
122
121
  return;
123
122
  }
124
123
  const day = cellAt(e.clientX, e.clientY)?.dataset.value;
@@ -0,0 +1,78 @@
1
+ import { defineComponent, useAttrs, computed, ref, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, Fragment, renderList, createElementVNode, withModifiers, createVNode, createCommentVNode } from "vue";
2
+ import { useMediaQuery } from "../composables/useMediaQuery.js";
3
+ import { useScrollStrip } from "../composables/useScrollStrip.js";
4
+ import { _ as _sfc_main$1 } from "./LpIcon-CxHFPwKt.js";
5
+ const _hoisted_1 = ["data-lp-strip-button", "onClick"];
6
+ const BUTTON = "absolute top-1/2 z-10 grid size-7 -translate-y-1/2 place-items-center rounded-full border border-line bg-surface-raised text-muted shadow-sm outline-none transition-[opacity,color] duration-(--duration-fast) ease-(--ease-emphasized) hover:text-ink motion-reduce:transition-none";
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ ...{ inheritAttrs: false },
9
+ __name: "LpScrollStrip",
10
+ props: {
11
+ contentClass: {},
12
+ fade: { type: Boolean, default: true },
13
+ buttons: { type: [Boolean, String], default: "auto" },
14
+ wheel: { type: Boolean, default: true },
15
+ drag: { type: Boolean, default: true },
16
+ as: { default: "div" },
17
+ inline: { type: Boolean, default: false }
18
+ },
19
+ setup(__props, { expose: __expose }) {
20
+ const attrs = useAttrs();
21
+ const rowAttrs = computed(() => {
22
+ const { class: _class, style: _style, ...rest } = attrs;
23
+ return rest;
24
+ });
25
+ const props = __props;
26
+ const scroller = ref(null);
27
+ const strip = useScrollStrip(scroller, { wheel: () => props.wheel, drag: () => props.drag });
28
+ const fine = useMediaQuery("(hover: hover) and (pointer: fine)");
29
+ const withButtons = computed(() => props.buttons === true || props.buttons === "auto" && fine.value);
30
+ __expose({ scroller, page: strip.page, scrollBy: strip.scrollBy, reveal: strip.reveal, measure: strip.measure, overflowing: strip.overflowing, atStart: strip.atStart, atEnd: strip.atEnd });
31
+ return (_ctx, _cache) => {
32
+ return openBlock(), createElementBlock("div", {
33
+ class: normalizeClass(["group/strip relative min-w-0", [__props.inline ? "inline-flex max-w-full" : "flex", unref(attrs).class]]),
34
+ style: normalizeStyle(unref(attrs).style),
35
+ "data-lp-strip": ""
36
+ }, [
37
+ (openBlock(), createBlock(resolveDynamicComponent(__props.as), mergeProps(rowAttrs.value, {
38
+ ref_key: "scroller",
39
+ ref: scroller,
40
+ class: ["lp-scrollbar-none flex min-w-0 flex-1 overflow-x-auto", [__props.contentClass, __props.fade ? "lp-strip-fade" : "", unref(strip).dragging.value ? "cursor-grabbing select-none" : ""]],
41
+ "data-lp-more-start": unref(strip).overflowing.value && !unref(strip).atStart.value ? "" : void 0,
42
+ "data-lp-more-end": unref(strip).overflowing.value && !unref(strip).atEnd.value ? "" : void 0,
43
+ "data-lp-strip-row": ""
44
+ }), {
45
+ default: withCtx(() => [
46
+ renderSlot(_ctx.$slots, "default")
47
+ ]),
48
+ _: 3
49
+ }, 16, ["class", "data-lp-more-start", "data-lp-more-end"])),
50
+ withButtons.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([-1, 1], (side) => {
51
+ return createElementVNode("button", {
52
+ key: side,
53
+ type: "button",
54
+ tabindex: "-1",
55
+ "aria-hidden": "true",
56
+ class: normalizeClass([
57
+ BUTTON,
58
+ side < 0 ? "left-0.5" : "right-0.5",
59
+ unref(strip).overflowing.value && !(side < 0 ? unref(strip).atStart.value : unref(strip).atEnd.value) ? __props.buttons === true ? "opacity-100" : "opacity-0 group-hover/strip:opacity-100" : "pointer-events-none opacity-0"
60
+ ]),
61
+ "data-lp-strip-button": side < 0 ? "prev" : "next",
62
+ onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
63
+ }, ["prevent"])),
64
+ onClick: ($event) => unref(strip).page(side)
65
+ }, [
66
+ createVNode(_sfc_main$1, {
67
+ name: side < 0 ? "lucide:chevron-left" : "lucide:chevron-right",
68
+ size: 16
69
+ }, null, 8, ["name"])
70
+ ], 42, _hoisted_1);
71
+ }), 64)) : createCommentVNode("", true)
72
+ ], 6);
73
+ };
74
+ }
75
+ });
76
+ export {
77
+ _sfc_main as _
78
+ };
@@ -4,7 +4,7 @@ import { useHotkeys, parseCombo } from "../composables/useHotkeys.js";
4
4
  import { startPointerDrag } from "../composables/pointerDrag.js";
5
5
  import { usePersisted } from "../composables/usePersisted.js";
6
6
  import { useLabels } from "../composables/useLpConfig.js";
7
- import { _ as _sfc_main$5 } from "./LpDrawer-iRHwJOGn.js";
7
+ import { _ as _sfc_main$5 } from "./LpDrawer-BkWjFdV0.js";
8
8
  import { _ as _sfc_main$2 } from "./LpIcon-CxHFPwKt.js";
9
9
  import { _ as _sfc_main$3 } from "./LpInput-DGMpxrcg.js";
10
10
  import { _ as _sfc_main$1 } from "./LpTooltip-BKde8Xjv.js";
@@ -1 +1 @@
1
- export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LpActionBar", "LpActivityLine", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBottomNav", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpChart", "LpCheckbox", "LpCodeBlock", "LpCodeDisplay", "LpCollapse", "LpColorPicker", "LpCommandPalette", "LpCommandScope", "LpConfirmDialog", "LpConfirmHost", "LpContextMenu", "LpContextSwitcher", "LpCopyButton", "LpCountdown", "LpDataList", "LpDatePicker", "LpDateRangePicker", "LpDisclosure", "LpDivider", "LpDock", "LpDrawer", "LpDropdownMenu", "LpDropzone", "LpEditable", "LpEmptyState", "LpFieldNotice", "LpFileTree", "LpFormField", "LpFrame", "LpGauge", "LpGlowBorder", "LpHintExample", "LpHintLayer", "LpHints", "LpHoverCard", "LpIcon", "LpIdenticon", "LpImageEditor", "LpInfraNode", "LpInput", "LpInspector", "LpKeys", "LpLightbox", "LpLink", "LpLoader", "LpLogInspector", "LpLogViewer", "LpMagnetic", "LpMapPicker", "LpMasonry", "LpMediaGallery", "LpModal", "LpModalNav", "LpNotificationBell", "LpNotificationFeed", "LpNumberField", "LpNumberFlow", "LpOtpInput", "LpPageScrollbar", "LpPagination", "LpPaletteFacts", "LpPaletteHeader", "LpPalettePreview", "LpPaletteStats", "LpPaletteSwatches", "LpPaletteTheme", "LpPasswordInput", "LpPhoneInput", "LpPie", "LpPipeline", "LpPopover", "LpProgress", "LpQuota", "LpRadio", "LpRadioGroup", "LpRangeCalendar", "LpRangeSlider", "LpRelativeTime", "LpRepeater", "LpRevealOnScroll", "LpRollingText", "LpScramble", "LpScrollArea", "LpSecretField", "LpSection", "LpSegmented", "LpSelect", "LpServiceNode", "LpShaderBackdrop", "LpShift", "LpShinyText", "LpShortcutsDialog", "LpSidebar", "LpSkeleton", "LpSlider", "LpSparkline", "LpSpotlight", "LpStat", "LpStatus", "LpStepMark", "LpStepper", "LpSwap", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTagsInput", "LpTextReveal", "LpTextarea", "LpThemeProvider", "LpThemeStudio", "LpThemeStudioSection", "LpThemeSwitcher", "LpTilt", "LpTimeField", "LpToaster", "LpTooltip", "LpTooltipProvider", "LpTopologyCanvas", "LpTour", "LpTruncate", "LpTypewriter", "LpUptimeBar", "LpVideoBackdrop", "LpVideoCompress", "LpVideoPlayer", "LpVideoTrim", "LpWindow", "LpWorkspaceSwitcher"];
1
+ export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LpActionBar", "LpActivityLine", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBottomNav", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpChart", "LpCheckbox", "LpCodeBlock", "LpCodeDisplay", "LpCollapse", "LpColorPicker", "LpCommandPalette", "LpCommandScope", "LpConfirmDialog", "LpConfirmHost", "LpContextMenu", "LpContextSwitcher", "LpCopyButton", "LpCountdown", "LpDataList", "LpDatePicker", "LpDateRangePicker", "LpDisclosure", "LpDivider", "LpDock", "LpDrawer", "LpDropdownMenu", "LpDropzone", "LpEditable", "LpEmptyState", "LpFieldNotice", "LpFileTree", "LpFormField", "LpFrame", "LpGauge", "LpGlowBorder", "LpHintExample", "LpHintLayer", "LpHints", "LpHoverCard", "LpIcon", "LpIdenticon", "LpImageEditor", "LpInfraNode", "LpInput", "LpInspector", "LpKeys", "LpLightbox", "LpLink", "LpLoader", "LpLogInspector", "LpLogViewer", "LpMagnetic", "LpMapPicker", "LpMasonry", "LpMediaGallery", "LpModal", "LpModalNav", "LpNotificationBell", "LpNotificationFeed", "LpNumberField", "LpNumberFlow", "LpOtpInput", "LpPageScrollbar", "LpPagination", "LpPaletteFacts", "LpPaletteHeader", "LpPalettePreview", "LpPaletteStats", "LpPaletteSwatches", "LpPaletteTheme", "LpPasswordInput", "LpPhoneInput", "LpPie", "LpPipeline", "LpPopover", "LpProgress", "LpQuota", "LpRadio", "LpRadioGroup", "LpRangeCalendar", "LpRangeSlider", "LpRelativeTime", "LpRepeater", "LpRevealOnScroll", "LpRollingText", "LpScramble", "LpScrollArea", "LpScrollStrip", "LpSecretField", "LpSection", "LpSegmented", "LpSelect", "LpServiceNode", "LpShaderBackdrop", "LpShift", "LpShinyText", "LpShortcutsDialog", "LpSidebar", "LpSkeleton", "LpSlider", "LpSparkline", "LpSpotlight", "LpStat", "LpStatus", "LpStepMark", "LpStepper", "LpSwap", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTagsInput", "LpTextReveal", "LpTextarea", "LpThemeProvider", "LpThemeStudio", "LpThemeStudioSection", "LpThemeSwitcher", "LpTilt", "LpTimeField", "LpToaster", "LpTooltip", "LpTooltipProvider", "LpTopologyCanvas", "LpTour", "LpTruncate", "LpTypewriter", "LpUptimeBar", "LpVideoBackdrop", "LpVideoCompress", "LpVideoPlayer", "LpVideoTrim", "LpWindow", "LpWorkspaceSwitcher"];
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/AppShellContextNav-C6Ho2mof.js";
1
+ import { _ as _sfc_main } from "../chunks/AppShellContextNav-BoH4ffnC.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAppShell-BWaVRsDB.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAppShell-xEBmGV78.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -6,6 +6,7 @@ import { useLabels } from "../composables/useLpConfig.js";
6
6
  import { easeTravel } from "../composables/easing.js";
7
7
  import { usePrefersReducedMotion } from "../composables/useReducedMotion.js";
8
8
  import { startPointerDrag } from "../composables/pointerDrag.js";
9
+ import { MOUSE_SLOP } from "../composables/gesture.js";
9
10
  import { nodeWindow } from "../composables/realm.js";
10
11
  import { usePillTransition } from "../composables/usePillTransition.js";
11
12
  import { useReveal } from "../composables/useReveal.js";
@@ -605,7 +606,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
605
606
  });
606
607
  const crosshair = computed(() => active.value >= 0 ? active.value : peerSlot.value);
607
608
  watch(active, (slot) => publish(slot >= 0 ? labels.value[slot] ?? null : null));
608
- const SELECT_SLOP = 4;
609
609
  let swallowClick = false;
610
610
  const selection = ref(null);
611
611
  const onPointerDown = (e) => {
@@ -616,7 +616,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
616
616
  startPointerDrag(e, {
617
617
  move(ev) {
618
618
  const x = offset(ev);
619
- if (Math.abs(x - pressedAt) > SELECT_SLOP) selection.value = { from: pressedAt, to: x };
619
+ if (Math.abs(x - pressedAt) > MOUSE_SLOP) selection.value = { from: pressedAt, to: x };
620
620
  },
621
621
  end(completed) {
622
622
  const picked = selection.value;
@@ -1457,7 +1457,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1457
1457
  };
1458
1458
  }
1459
1459
  });
1460
- const LpChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-39ed90d7"]]);
1460
+ const LpChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-946a5b6d"]]);
1461
1461
  export {
1462
1462
  LpChart as default
1463
1463
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpDateRangePicker-CAn2yGbn.js";
1
+ import { _ as _sfc_main } from "../chunks/LpDateRangePicker-DRBB8z6t.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };