@leavepulse/ui 0.93.3 → 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.
- package/README.md +53 -3
- package/dist/assets/LpTabs-D7EyG21l.css +18 -0
- package/dist/assets/LpVideoTrim-D8JDg9Qn.css +8 -0
- package/dist/chunks/AppShellContextNav-BoH4ffnC.js +54 -0
- package/dist/chunks/{LpAppShell-BWaVRsDB.js → LpAppShell-xEBmGV78.js} +12 -5
- package/dist/chunks/{LpDateRangePicker-CAn2yGbn.js → LpDateRangePicker-DRBB8z6t.js} +1 -1
- package/dist/chunks/{LpDrawer-iRHwJOGn.js → LpDrawer-BkWjFdV0.js} +81 -42
- package/dist/chunks/{LpLightbox-a24V_0Wk.js → LpLightbox-DPgz7IsT.js} +62 -49
- package/dist/chunks/{LpMapPicker-DVfiy3rR.js → LpMapPicker-V0Lybi10.js} +19 -52
- package/dist/chunks/{LpMediaGallery-CtWA5Uab.js → LpMediaGallery-CTejKF2-.js} +1 -1
- package/dist/chunks/{LpModalNav-DivqT1NV.js → LpModalNav-DVXAF-DG.js} +1 -1
- package/dist/chunks/{LpRangeCalendar-C9gkNMYw.js → LpRangeCalendar-9BvaLZji.js} +3 -4
- package/dist/chunks/LpScrollStrip-D4tsOfAQ.js +78 -0
- package/dist/chunks/{LpSidebar-DQtCYlT4.js → LpSidebar-BIhusppV.js} +1 -1
- package/dist/component-names.d.ts +1 -1
- package/dist/components/AppShellContextNav.vue.js +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpChart.vue.js +3 -3
- package/dist/components/LpDateRangePicker.vue.js +1 -1
- package/dist/components/LpDrawer.vue.d.ts +10 -2
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropzone.vue.d.ts +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpRangeCalendar.vue.js +1 -1
- package/dist/components/LpRevealOnScroll.vue.d.ts +1 -1
- package/dist/components/LpScrollStrip.vue.d.ts +48 -0
- package/dist/components/LpScrollStrip.vue.js +4 -0
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +4 -4
- package/dist/components/LpTabs.vue.js +104 -90
- package/dist/components/LpVideoTrim.vue.js +41 -54
- package/dist/composables/gesture.d.ts +141 -0
- package/dist/composables/gesture.js +176 -0
- package/dist/composables/scroll.d.ts +5 -1
- package/dist/composables/scroll.js +16 -9
- package/dist/composables/useAppUpdate.d.ts +26 -0
- package/dist/composables/useAppUpdate.js +91 -0
- package/dist/composables/useGesture.d.ts +107 -0
- package/dist/composables/useGesture.js +281 -0
- package/dist/composables/usePaintSelect.js +3 -4
- package/dist/composables/useScrollStrip.d.ts +27 -0
- package/dist/composables/useScrollStrip.js +194 -0
- package/dist/composables/useTouchHold.d.ts +3 -1
- package/dist/composables/useTouchHold.js +9 -51
- package/dist/composables/useZoomPan.js +4 -6
- package/dist/index.d.ts +9 -0
- package/dist/index.js +180 -152
- package/package.json +1 -1
- package/src/component-names.ts +1 -0
- package/src/components/AppShellContextNav.vue +3 -2
- package/src/components/LpAppShell.vue +10 -1
- package/src/components/LpChart.vue +2 -2
- package/src/components/LpDrawer.vue +121 -54
- package/src/components/LpLightbox.vue +33 -20
- package/src/components/LpMapPicker.vue +22 -64
- package/src/components/LpRangeCalendar.vue +4 -5
- package/src/components/LpScrollStrip.vue +96 -0
- package/src/components/LpSidebar.vue +2 -2
- package/src/components/LpTabs.vue +36 -17
- package/src/components/LpVideoTrim.vue +35 -46
- package/src/composables/gesture.ts +314 -0
- package/src/composables/scroll.ts +20 -9
- package/src/composables/useAppUpdate.ts +156 -0
- package/src/composables/useGesture.ts +451 -0
- package/src/composables/usePaintSelect.ts +4 -5
- package/src/composables/useScrollStrip.ts +249 -0
- package/src/composables/useTouchHold.ts +15 -73
- package/src/composables/useZoomPan.ts +6 -9
- package/src/index.ts +27 -0
- package/src/tokens/effects.css +40 -0
- package/dist/assets/LpTabs-Bh7a-Bdl.css +0 -18
- package/dist/assets/LpVideoTrim-CMoUw3dJ.css +0 -8
- 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$
|
|
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 =
|
|
60
|
-
const _hoisted_22 = ["
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
264
|
+
swipe = null;
|
|
259
265
|
if (!isVideo.value) zoom.onPointerDown(e);
|
|
260
266
|
return;
|
|
261
267
|
}
|
|
262
268
|
if (isVideo.value) {
|
|
263
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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[
|
|
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:
|
|
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(),
|
|
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
|
-
|
|
582
|
-
},
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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 {
|
|
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
|
|
189
|
-
let
|
|
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
|
-
|
|
195
|
-
|
|
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
|
-
|
|
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
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
241
|
-
|
|
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,7 +4,7 @@ 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-
|
|
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"];
|
|
@@ -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-
|
|
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
|
-
},
|
|
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) >
|
|
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-
|
|
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"];
|
|
@@ -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) >
|
|
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-
|
|
1460
|
+
const LpChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-946a5b6d"]]);
|
|
1461
1461
|
export {
|
|
1462
1462
|
LpChart as default
|
|
1463
1463
|
};
|
|
@@ -55,7 +55,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
55
55
|
* does), so a wide touch screen with the rail visible doesn't pull it too.
|
|
56
56
|
*/
|
|
57
57
|
edgeBreakpoint?: "sm" | "md" | "lg" | "xl";
|
|
58
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Distance (px) from the edge within which a touch can start a pull. Wide
|
|
60
|
+
* enough to start a thumb's width in, clear of the system's back gesture
|
|
61
|
+
* along the very edge.
|
|
62
|
+
*/
|
|
59
63
|
edgeSize?: number;
|
|
60
64
|
/** Fraction (0–1) of the panel width the pull must reach to open on release. */
|
|
61
65
|
edgeOpenThreshold?: number;
|
|
@@ -152,7 +156,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
152
156
|
* does), so a wide touch screen with the rail visible doesn't pull it too.
|
|
153
157
|
*/
|
|
154
158
|
edgeBreakpoint?: "sm" | "md" | "lg" | "xl";
|
|
155
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Distance (px) from the edge within which a touch can start a pull. Wide
|
|
161
|
+
* enough to start a thumb's width in, clear of the system's back gesture
|
|
162
|
+
* along the very edge.
|
|
163
|
+
*/
|
|
156
164
|
edgeSize?: number;
|
|
157
165
|
/** Fraction (0–1) of the panel width the pull must reach to open on release. */
|
|
158
166
|
edgeOpenThreshold?: number;
|
|
@@ -109,11 +109,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
109
109
|
}> & Readonly<{
|
|
110
110
|
onLink?: ((url: string) => any) | undefined;
|
|
111
111
|
onFiles?: ((files: File[]) => any) | undefined;
|
|
112
|
-
"onUpdate:linking"?: ((value: boolean) => any) | undefined;
|
|
113
112
|
onRejected?: ((reason: {
|
|
114
113
|
file: File;
|
|
115
114
|
cause: "type" | "size";
|
|
116
115
|
}[]) => any) | undefined;
|
|
116
|
+
"onUpdate:linking"?: ((value: boolean) => any) | undefined;
|
|
117
117
|
}>, {
|
|
118
118
|
title: string;
|
|
119
119
|
animate: boolean;
|
|
@@ -53,10 +53,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
53
53
|
direction: RevealDirection;
|
|
54
54
|
delay: number;
|
|
55
55
|
immediate: boolean;
|
|
56
|
+
distance: number;
|
|
56
57
|
threshold: number;
|
|
57
58
|
preset: RevealPreset;
|
|
58
59
|
stagger: number;
|
|
59
|
-
distance: number;
|
|
60
60
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
61
61
|
default?: (props: {}) => any;
|
|
62
62
|
}>;
|