@vizejs/ui 0.343.0 → 0.347.7

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 (44) hide show
  1. package/dist/{button-D7sM9Xmj.d.mts → button-BMIqJ_M5.d.mts} +1 -1
  2. package/dist/button.d.mts +1 -1
  3. package/dist/button.mjs +1 -1
  4. package/dist/{checkbox-DkwZFC80.d.mts → checkbox-sbhaWekB.d.mts} +1 -1
  5. package/dist/checkbox.d.mts +1 -1
  6. package/dist/collection-CoOROaho.mjs +453 -0
  7. package/dist/collection-aHZ6Pf0e.d.mts +185 -0
  8. package/dist/collection.d.mts +2 -0
  9. package/dist/collection.mjs +2 -0
  10. package/dist/controllable-state.d.mts +1 -1
  11. package/dist/id-BSgJwErt.d.mts +127 -0
  12. package/dist/id-CPBdeoL3.mjs +137 -0
  13. package/dist/id.d.mts +2 -0
  14. package/dist/id.mjs +2 -0
  15. package/dist/index.d.mts +12 -6
  16. package/dist/index.mjs +9 -4
  17. package/dist/interaction-modality-CO-eQzNy.mjs +304 -0
  18. package/dist/interaction-modality-tee79ZBZ.d.mts +89 -0
  19. package/dist/interaction-modality.d.mts +2 -0
  20. package/dist/interaction-modality.mjs +2 -0
  21. package/dist/long-press-CRjjjJK2.d.mts +115 -0
  22. package/dist/long-press.d.mts +2 -0
  23. package/dist/long-press.mjs +246 -0
  24. package/dist/media-pdf.d.mts +1 -1
  25. package/dist/media-pdf.mjs +1 -1
  26. package/dist/media.d.mts +1 -1
  27. package/dist/media.mjs +1 -1
  28. package/dist/press-Bp57IOe2.mjs +615 -0
  29. package/dist/press-types-B8Ssxqg4.d.mts +112 -0
  30. package/dist/press.d.mts +14 -0
  31. package/dist/press.mjs +2 -0
  32. package/dist/primitive.d.mts +1 -1
  33. package/dist/primitive.mjs +1 -1
  34. package/dist/visually-hidden.d.mts +1 -1
  35. package/dist/visually-hidden.mjs +1 -1
  36. package/package.json +34 -7
  37. /package/dist/{button-8BOlFJNu.mjs → button-CaLxP2l2.mjs} +0 -0
  38. /package/dist/{controllable-state-DXsYJ3yl.d.mts → controllable-state-B9v6FClp.d.mts} +0 -0
  39. /package/dist/{pdf-source-COxN3A1l.d.mts → pdf-source-BbZKF_dS.d.mts} +0 -0
  40. /package/dist/{pdf-source-C52YE8tp.mjs → pdf-source-C9zNQd9l.mjs} +0 -0
  41. /package/dist/{primitive-DJB7pOf3.mjs → primitive-BE28SwD7.mjs} +0 -0
  42. /package/dist/{primitive-BtvwikH1.d.mts → primitive-Bog8qvd8.d.mts} +0 -0
  43. /package/dist/{visually-hidden-QENRapzW.mjs → visually-hidden-CTSV3ctZ.mjs} +0 -0
  44. /package/dist/{visually-hidden-BegtnMng.d.mts → visually-hidden-CekDwEwR.d.mts} +0 -0
@@ -0,0 +1,89 @@
1
+ import { ComputedRef, MaybeRefOrGetter, ShallowRef } from "vue";
2
+
3
+ //#region src/interaction-modality-types.d.ts
4
+ /**
5
+ * Input family that most recently expressed user intent.
6
+ *
7
+ * Pens and unknown pointing hardware intentionally map to `pointer`; consumers
8
+ * that need device-specific geometry should inspect the original pointer event.
9
+ */
10
+ type InteractionModality = "keyboard" | "pointer" | "touch" | "virtual";
11
+ /** Why an {@link InteractionModalityTracker} changed. */
12
+ type InteractionModalityChangeReason = InteractionModality | "document" | "manual";
13
+ /** Immutable notification emitted after a distinct modality change. */
14
+ interface InteractionModalityChange {
15
+ /** New modality, or `null` when a consumer explicitly resets detection. */
16
+ readonly modality: InteractionModality | null;
17
+ /** Value observed immediately before this change. */
18
+ readonly previousModality: InteractionModality | null;
19
+ /** Event classification or lifecycle operation responsible for the change. */
20
+ readonly reason: InteractionModalityChangeReason;
21
+ /** Native event when the change came from document input. */
22
+ readonly originalEvent: Event | null;
23
+ /** Document whose state produced the change, if the tracker is attached. */
24
+ readonly document: Document | null;
25
+ }
26
+ /** Options for {@link createInteractionModalityTracker}. */
27
+ interface InteractionModalityOptions {
28
+ /**
29
+ * Reactive document to observe. Pass `null` for SSR or deferred attachment.
30
+ *
31
+ * When omitted, the current global document is resolved lazily. No DOM global
32
+ * is read while the module is evaluated.
33
+ *
34
+ * @default globalThis.document when available
35
+ */
36
+ readonly document?: MaybeRefOrGetter<Document | null | undefined>;
37
+ /**
38
+ * Value used before the first qualifying input event.
39
+ *
40
+ * @default null
41
+ */
42
+ readonly initialModality?: InteractionModality | null;
43
+ /** Called synchronously after each distinct change. */
44
+ readonly onChange?: (change: InteractionModalityChange) => void;
45
+ }
46
+ /** Reactive, explicitly disposable input-modality observer. */
47
+ interface InteractionModalityTracker {
48
+ /** Document currently observed by this tracker. */
49
+ readonly document: Readonly<ShallowRef<Document | null>>;
50
+ /** Most recently detected input family. */
51
+ readonly modality: Readonly<ShallowRef<InteractionModality | null>>;
52
+ /** Whether global focus treatment should currently be keyboard-visible. */
53
+ readonly isFocusVisible: ComputedRef<boolean>;
54
+ /** Attach to another document, retaining the current value until synchronized. */
55
+ readonly attach: (document: Document | null) => boolean;
56
+ /** Stop observing the current document without clearing the current value. */
57
+ readonly detach: () => boolean;
58
+ /** Explicitly set or reset modality and synchronize peers on the same document. */
59
+ readonly setModality: (modality: InteractionModality | null) => boolean;
60
+ /** Release reactive observation and native listeners. Safe to call repeatedly. */
61
+ readonly dispose: () => void;
62
+ }
63
+ //#endregion
64
+ //#region src/interaction-modality.d.ts
65
+ /**
66
+ * Create an SSR-safe, document-scoped interaction-modality observer.
67
+ *
68
+ * Trackers in one document share native capture listeners and state. Separate
69
+ * documents, including iframes, remain isolated. Call {@link InteractionModalityTracker.dispose}
70
+ * when using this factory outside a Vue effect scope.
71
+ */
72
+ declare function createInteractionModalityTracker(options?: InteractionModalityOptions): InteractionModalityTracker;
73
+ /**
74
+ * Create a tracker owned by the current Vue effect scope.
75
+ *
76
+ * The tracker is disposed automatically when its component or effect scope is
77
+ * destroyed, preventing document-listener leaks.
78
+ */
79
+ declare function useInteractionModality(options?: InteractionModalityOptions): InteractionModalityTracker;
80
+ /**
81
+ * Determine whether a focused element should expose its focus indicator.
82
+ *
83
+ * Native `:focus-visible` semantics take precedence. The modality fallback is
84
+ * used only when the selector is unsupported, preserving text-input and
85
+ * platform heuristics implemented by the browser.
86
+ */
87
+ declare function isElementFocusVisible(element: Element | null | undefined, modality: InteractionModality | null): boolean;
88
+ //#endregion
89
+ export { InteractionModalityChange as a, InteractionModalityTracker as c, InteractionModality as i, isElementFocusVisible as n, InteractionModalityChangeReason as o, useInteractionModality as r, InteractionModalityOptions as s, createInteractionModalityTracker as t };
@@ -0,0 +1,2 @@
1
+ import { a as InteractionModalityChange, c as InteractionModalityTracker, i as InteractionModality, n as isElementFocusVisible, o as InteractionModalityChangeReason, r as useInteractionModality, s as InteractionModalityOptions, t as createInteractionModalityTracker } from "./interaction-modality-tee79ZBZ.mjs";
2
+ export { InteractionModality, InteractionModalityChange, InteractionModalityChangeReason, InteractionModalityOptions, InteractionModalityTracker, createInteractionModalityTracker, isElementFocusVisible, useInteractionModality };
@@ -0,0 +1,2 @@
1
+ import { n as isElementFocusVisible, r as useInteractionModality, t as createInteractionModalityTracker } from "./interaction-modality-CO-eQzNy.mjs";
2
+ export { createInteractionModalityTracker, isElementFocusVisible, useInteractionModality };
@@ -0,0 +1,115 @@
1
+ import { n as PressEvent, o as PressPointerType, s as PressProps } from "./press-types-B8Ssxqg4.mjs";
2
+ import { MaybeRefOrGetter, ShallowRef } from "vue";
3
+
4
+ //#region src/long-press-types.d.ts
5
+ /** Pointing-device families eligible to start a long press. */
6
+ type LongPressPointerType = Extract<PressPointerType, "mouse" | "pen" | "pointer" | "touch">;
7
+ /** Lifecycle notification emitted by a long-press controller. */
8
+ type LongPressEventType = "longpress" | "longpressend" | "longpressstart";
9
+ /** Immutable snapshot of one long-press lifecycle event. */
10
+ interface LongPressEvent {
11
+ /** Long-press lifecycle phase represented by this snapshot. */
12
+ readonly type: LongPressEventType;
13
+ /** Pointing-device family that initiated the interaction. */
14
+ readonly pointerType: LongPressPointerType;
15
+ /** Element whose bound props own the interaction. */
16
+ readonly target: Element;
17
+ /** Native event responsible for this phase, or `null` for manual cancellation. */
18
+ readonly originalEvent: Event | null;
19
+ /** Viewport coordinate when supplied by pointing hardware. */
20
+ readonly x: number | null;
21
+ /** Viewport coordinate when supplied by pointing hardware. */
22
+ readonly y: number | null;
23
+ /** Modifier-key snapshots captured from the native event. */
24
+ readonly altKey: boolean;
25
+ readonly ctrlKey: boolean;
26
+ readonly metaKey: boolean;
27
+ readonly shiftKey: boolean;
28
+ /** Whether the attempt ended without reaching a normal release. */
29
+ readonly isCanceled: boolean;
30
+ }
31
+ /** Options shared by {@link createLongPress} and {@link useLongPress}. */
32
+ interface LongPressOptions {
33
+ /**
34
+ * Suppress long and short activation while retaining the bound props.
35
+ * Reactive values are checked at start and again when the threshold elapses.
36
+ *
37
+ * @default false
38
+ */
39
+ readonly isDisabled?: MaybeRefOrGetter<boolean | undefined>;
40
+ /**
41
+ * Restrict long-press recognition to one pointing-device family.
42
+ * Keyboard and virtual activation remain available through `onPress`.
43
+ *
44
+ * @default undefined
45
+ */
46
+ readonly pointerType?: MaybeRefOrGetter<LongPressPointerType | undefined>;
47
+ /**
48
+ * Time in milliseconds that the primary pointer must remain down.
49
+ * The value is resolved once per attempt and must be finite and non-negative.
50
+ *
51
+ * @default 500
52
+ */
53
+ readonly threshold?: MaybeRefOrGetter<number | undefined>;
54
+ /**
55
+ * Accessible explanation of the long action, for example
56
+ * "Long press to open actions". Used as `aria-description` unless
57
+ * `accessibilityDescriptionId` is supplied.
58
+ */
59
+ readonly accessibilityDescription?: MaybeRefOrGetter<string | undefined>;
60
+ /**
61
+ * ID of consumer-rendered descriptive content. When supplied, the host uses
62
+ * `aria-describedby` and the inline accessibility description is omitted.
63
+ */
64
+ readonly accessibilityDescriptionId?: MaybeRefOrGetter<string | undefined>;
65
+ /**
66
+ * Preserve selectable text during the pointer attempt.
67
+ *
68
+ * @default false
69
+ */
70
+ readonly allowTextSelectionOnPress?: MaybeRefOrGetter<boolean | undefined>;
71
+ /**
72
+ * Prevent the compatibility mousedown default that normally moves focus.
73
+ *
74
+ * @default false
75
+ */
76
+ readonly preventFocusOnPress?: MaybeRefOrGetter<boolean | undefined>;
77
+ /** Called after a qualifying primary pointer starts. */
78
+ readonly onLongPressStart?: (event: LongPressEvent) => void;
79
+ /** Called when an attempt ends, whether before or after the threshold. */
80
+ readonly onLongPressEnd?: (event: LongPressEvent) => void;
81
+ /** Called exactly once when the configured threshold is reached. */
82
+ readonly onLongPress?: (event: LongPressEvent) => void;
83
+ /**
84
+ * Called for an ordinary short, keyboard, or virtual activation.
85
+ * Use this as the keyboard-accessible alternative to a long-only action.
86
+ */
87
+ readonly onPress?: (event: PressEvent) => void;
88
+ }
89
+ /** Attributes and native handlers to spread onto one long-press host. */
90
+ interface LongPressProps extends PressProps {
91
+ readonly "aria-describedby": string | undefined;
92
+ readonly "aria-description": string | undefined;
93
+ readonly onContextmenu: (event: MouseEvent) => void;
94
+ }
95
+ /** Stateful long-press recognizer with explicit lifecycle ownership. */
96
+ interface LongPressController {
97
+ /** Whether an eligible pointer attempt is currently active. */
98
+ readonly isPressed: Readonly<ShallowRef<boolean>>;
99
+ /** Whether the active attempt has crossed the configured threshold. */
100
+ readonly isLongPressed: Readonly<ShallowRef<boolean>>;
101
+ /** Stable handlers and accessibility attributes for exactly one host. */
102
+ readonly longPressProps: Readonly<LongPressProps>;
103
+ /** Cancel the current pending or triggered interaction. */
104
+ readonly cancel: () => boolean;
105
+ /** Release timers, listeners, selection guards, and reactive state. */
106
+ readonly dispose: () => void;
107
+ }
108
+ //#endregion
109
+ //#region src/long-press.d.ts
110
+ /** Create an SSR-safe long-press recognizer for one host element. */
111
+ declare function createLongPress(options?: LongPressOptions): LongPressController;
112
+ /** Create a long-press recognizer disposed with the current Vue effect scope. */
113
+ declare function useLongPress(options?: LongPressOptions): LongPressController;
114
+ //#endregion
115
+ export { LongPressEventType as a, LongPressProps as c, LongPressEvent as i, useLongPress as n, LongPressOptions as o, LongPressController as r, LongPressPointerType as s, createLongPress as t };
@@ -0,0 +1,2 @@
1
+ import { a as LongPressEventType, c as LongPressProps, i as LongPressEvent, n as useLongPress, o as LongPressOptions, r as LongPressController, s as LongPressPointerType, t as createLongPress } from "./long-press-CRjjjJK2.mjs";
2
+ export { LongPressController, LongPressEvent, LongPressEventType, LongPressOptions, LongPressPointerType, LongPressProps, createLongPress, useLongPress };
@@ -0,0 +1,246 @@
1
+ import { i as disableTextSelection, r as createPressEvent, t as createPress } from "./press-Bp57IOe2.mjs";
2
+ import { getCurrentScope, onScopeDispose, shallowReadonly, shallowRef, toValue } from "vue";
3
+ //#region src/long-press.ts
4
+ const defaultThreshold = 500;
5
+ const invalidOptionDiagnostic = "VIZE_UI_LONG_PRESS_OPTION";
6
+ const disposedDiagnostic = "VIZE_UI_LONG_PRESS_DISPOSED";
7
+ const setupDiagnostic = "VIZE_UI_LONG_PRESS_SETUP";
8
+ const hardwarePointers = new Set([
9
+ "mouse",
10
+ "pen",
11
+ "pointer",
12
+ "touch"
13
+ ]);
14
+ function readBoolean(value, name) {
15
+ const resolved = toValue(value);
16
+ if (resolved === void 0) return false;
17
+ if (typeof resolved !== "boolean") throw new TypeError(`${invalidOptionDiagnostic}: ${name} must resolve to a boolean`);
18
+ return resolved;
19
+ }
20
+ function readPointerType(value) {
21
+ const resolved = toValue(value) ?? null;
22
+ if (resolved !== null && !hardwarePointers.has(resolved)) throw new TypeError(`${invalidOptionDiagnostic}: pointerType must resolve to mouse, pen, pointer, or touch`);
23
+ return resolved;
24
+ }
25
+ function readThreshold(value) {
26
+ const resolved = toValue(value) ?? defaultThreshold;
27
+ if (typeof resolved !== "number" || !Number.isFinite(resolved) || resolved < 0) throw new TypeError(`${invalidOptionDiagnostic}: threshold must resolve to a finite number >= 0`);
28
+ return resolved;
29
+ }
30
+ function readText(value, name) {
31
+ const resolved = toValue(value);
32
+ if (resolved === void 0 || resolved === "") return void 0;
33
+ if (typeof resolved !== "string") throw new TypeError(`${invalidOptionDiagnostic}: ${name} must resolve to a string`);
34
+ return resolved;
35
+ }
36
+ function toLongPressEvent(type, event, originalEvent = event.originalEvent, isCanceled = event.isCanceled) {
37
+ const snapshot = createPressEvent("pressend", event.target, event.pointerType, originalEvent, isCanceled);
38
+ return Object.freeze({
39
+ ...snapshot,
40
+ type
41
+ });
42
+ }
43
+ function validateOptions(options) {
44
+ for (const name of [
45
+ "onLongPress",
46
+ "onLongPressEnd",
47
+ "onLongPressStart",
48
+ "onPress"
49
+ ]) {
50
+ const callback = options[name];
51
+ if (callback !== void 0 && typeof callback !== "function") throw new TypeError(`${invalidOptionDiagnostic}: ${name} must be a function`);
52
+ }
53
+ if (typeof options.threshold !== "function") readThreshold(options.threshold);
54
+ if (typeof options.pointerType !== "function") readPointerType(options.pointerType);
55
+ }
56
+ /** Create an SSR-safe long-press recognizer for one host element. */
57
+ function createLongPress(options = {}) {
58
+ validateOptions(options);
59
+ const isPressed = shallowRef(false);
60
+ const isLongPressed = shallowRef(false);
61
+ let attempt = null;
62
+ let releaseTriggered = null;
63
+ let restoreTriggeredSelection = null;
64
+ let contextMenuPointer = null;
65
+ let contextMenuTimer = null;
66
+ let endingAtThreshold = false;
67
+ let disposed = false;
68
+ const clearContextMenuTimer = () => {
69
+ if (contextMenuTimer !== null) clearTimeout(contextMenuTimer);
70
+ contextMenuTimer = null;
71
+ };
72
+ const lingerContextMenuSuppression = () => {
73
+ clearContextMenuTimer();
74
+ contextMenuTimer = setTimeout(() => {
75
+ contextMenuPointer = null;
76
+ contextMenuTimer = null;
77
+ }, 50);
78
+ };
79
+ const clearRelease = () => {
80
+ releaseTriggered?.();
81
+ releaseTriggered = null;
82
+ restoreTriggeredSelection?.();
83
+ restoreTriggeredSelection = null;
84
+ };
85
+ const clearAttempt = () => {
86
+ const timer = attempt?.timer;
87
+ if (timer != null) clearTimeout(timer);
88
+ attempt = null;
89
+ };
90
+ const finishTriggered = (originalEvent, isCanceled) => {
91
+ if (!isLongPressed.value || !attempt) return false;
92
+ const current = attempt;
93
+ const canceled = isCanceled || readBoolean(options.isDisabled, "isDisabled");
94
+ clearRelease();
95
+ clearAttempt();
96
+ isPressed.value = false;
97
+ isLongPressed.value = false;
98
+ lingerContextMenuSuppression();
99
+ options.onLongPressEnd?.(toLongPressEvent("longpressend", current.event, originalEvent, canceled));
100
+ return true;
101
+ };
102
+ const installTriggeredRelease = (current) => {
103
+ const removals = [];
104
+ const document = current.target.ownerDocument;
105
+ const start = current.event.originalEvent;
106
+ const listen = (owner, type, callback, capture = true) => {
107
+ owner.addEventListener(type, callback, capture);
108
+ removals.push(() => owner.removeEventListener(type, callback, capture));
109
+ };
110
+ const finish = (event, canceled = false) => finishTriggered(event, canceled);
111
+ if (start && "pointerId" in start) {
112
+ const id = Number(start.pointerId);
113
+ listen(document, "pointerup", ((event) => {
114
+ if (event.pointerId === id) finish(event);
115
+ }));
116
+ listen(document, "pointercancel", ((event) => {
117
+ if (event.pointerId === id) finish(event, true);
118
+ }));
119
+ } else if (start && "changedTouches" in start) {
120
+ const id = start.changedTouches.item(0)?.identifier;
121
+ const ownsTouch = (event) => id !== void 0 && Array.from(event.changedTouches).some((touch) => touch.identifier === id);
122
+ listen(document, "touchend", ((event) => {
123
+ if (ownsTouch(event)) finish(event);
124
+ }));
125
+ listen(document, "touchcancel", ((event) => {
126
+ if (ownsTouch(event)) finish(event, true);
127
+ }));
128
+ } else listen(document, "mouseup", ((event) => {
129
+ if (event.button === 0) finish(event);
130
+ }));
131
+ listen(document, "dragstart", (event) => finish(event, true));
132
+ listen(document, "visibilitychange", (() => {
133
+ if (document.visibilityState === "hidden") finish(null, true);
134
+ }));
135
+ if (document.defaultView) listen(document.defaultView, "blur", (event) => finish(event, true), false);
136
+ return () => {
137
+ for (const remove of removals.splice(0)) remove();
138
+ };
139
+ };
140
+ let press;
141
+ const trigger = (current) => {
142
+ if (disposed || attempt !== current) return;
143
+ current.timer = null;
144
+ if (readBoolean(options.isDisabled, "isDisabled")) {
145
+ press.cancel();
146
+ return;
147
+ }
148
+ isLongPressed.value = true;
149
+ releaseTriggered = installTriggeredRelease(current);
150
+ endingAtThreshold = true;
151
+ try {
152
+ press.cancel();
153
+ } finally {
154
+ endingAtThreshold = false;
155
+ }
156
+ const focusable = current.target;
157
+ if ((current.pointerType === "touch" || current.pointerType === "pen") && current.target.ownerDocument.activeElement !== current.target && typeof focusable.focus === "function") try {
158
+ focusable.focus({ preventScroll: true });
159
+ } catch {
160
+ focusable.focus();
161
+ }
162
+ if (!readBoolean(options.allowTextSelectionOnPress, "allowTextSelectionOnPress")) restoreTriggeredSelection = disableTextSelection(current.target);
163
+ options.onLongPress?.(toLongPressEvent("longpress", current.event));
164
+ };
165
+ press = createPress({
166
+ ...options.isDisabled === void 0 ? {} : { isDisabled: options.isDisabled },
167
+ ...options.allowTextSelectionOnPress === void 0 ? {} : { allowTextSelectionOnPress: options.allowTextSelectionOnPress },
168
+ ...options.preventFocusOnPress === void 0 ? {} : { preventFocusOnPress: options.preventFocusOnPress },
169
+ shouldCancelOnPointerExit: true,
170
+ onPressStart(event) {
171
+ if (!hardwarePointers.has(event.pointerType)) return;
172
+ const pointerType = event.pointerType;
173
+ const filter = readPointerType(options.pointerType);
174
+ if (filter && filter !== pointerType) return;
175
+ clearAttempt();
176
+ contextMenuPointer = pointerType;
177
+ clearContextMenuTimer();
178
+ const start = toLongPressEvent("longpressstart", event);
179
+ const current = {
180
+ event: start,
181
+ pointerType,
182
+ target: event.target,
183
+ timer: null
184
+ };
185
+ attempt = current;
186
+ isPressed.value = true;
187
+ current.timer = setTimeout(() => trigger(current), readThreshold(options.threshold));
188
+ options.onLongPressStart?.(start);
189
+ },
190
+ onPressEnd(event) {
191
+ if (!attempt || endingAtThreshold) return;
192
+ const current = attempt;
193
+ clearAttempt();
194
+ isPressed.value = false;
195
+ if (current.pointerType === "touch" || current.pointerType === "pen") lingerContextMenuSuppression();
196
+ else contextMenuPointer = null;
197
+ options.onLongPressEnd?.(toLongPressEvent("longpressend", current.event, event.originalEvent, event.isCanceled));
198
+ },
199
+ ...options.onPress ? { onPress: options.onPress } : {}
200
+ });
201
+ const attributes = {
202
+ ...press.pressProps,
203
+ get "aria-describedby"() {
204
+ if (readBoolean(options.isDisabled, "isDisabled") || !options.onLongPress) return void 0;
205
+ return readText(options.accessibilityDescriptionId, "accessibilityDescriptionId");
206
+ },
207
+ get "aria-description"() {
208
+ if (readBoolean(options.isDisabled, "isDisabled") || !options.onLongPress) return void 0;
209
+ if (readText(options.accessibilityDescriptionId, "accessibilityDescriptionId")) return void 0;
210
+ return readText(options.accessibilityDescription, "accessibilityDescription");
211
+ },
212
+ onContextmenu(event) {
213
+ if (contextMenuPointer === "touch" || contextMenuPointer === "pen") event.preventDefault();
214
+ }
215
+ };
216
+ return Object.freeze({
217
+ isPressed: shallowReadonly(isPressed),
218
+ isLongPressed: shallowReadonly(isLongPressed),
219
+ longPressProps: Object.freeze(attributes),
220
+ cancel: () => {
221
+ if (disposed) throw new Error(`${disposedDiagnostic}: the controller has been disposed`);
222
+ if (finishTriggered(null, true)) return true;
223
+ return press.cancel();
224
+ },
225
+ dispose: () => {
226
+ if (disposed) return;
227
+ clearRelease();
228
+ clearAttempt();
229
+ clearContextMenuTimer();
230
+ contextMenuPointer = null;
231
+ isPressed.value = false;
232
+ isLongPressed.value = false;
233
+ press.dispose();
234
+ disposed = true;
235
+ }
236
+ });
237
+ }
238
+ /** Create a long-press recognizer disposed with the current Vue effect scope. */
239
+ function useLongPress(options = {}) {
240
+ if (!getCurrentScope()) throw new Error(`${setupDiagnostic}: use inside component setup or an active effect scope`);
241
+ const controller = createLongPress(options);
242
+ onScopeDispose(controller.dispose);
243
+ return controller;
244
+ }
245
+ //#endregion
246
+ export { createLongPress, useLongPress };
@@ -1,2 +1,2 @@
1
- import { n as createPDFSource, t as CreatePDFSourceOptions } from "./pdf-source-COxN3A1l.mjs";
1
+ import { n as createPDFSource, t as CreatePDFSourceOptions } from "./pdf-source-BbZKF_dS.mjs";
2
2
  export { type CreatePDFSourceOptions, createPDFSource };
@@ -1,2 +1,2 @@
1
- import { t as createPDFSource } from "./pdf-source-C52YE8tp.mjs";
1
+ import { t as createPDFSource } from "./pdf-source-C9zNQd9l.mjs";
2
2
  export { createPDFSource };
package/dist/media.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { MediaSourceKind, NormalizeMediaSourceOptions, normalizeMediaSource } from "./media-source.mjs";
2
- import { n as createPDFSource, t as CreatePDFSourceOptions } from "./pdf-source-COxN3A1l.mjs";
2
+ import { n as createPDFSource, t as CreatePDFSourceOptions } from "./pdf-source-BbZKF_dS.mjs";
3
3
  export { type CreatePDFSourceOptions, type MediaSourceKind, type NormalizeMediaSourceOptions, createPDFSource, normalizeMediaSource };
package/dist/media.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { normalizeMediaSource } from "./media-source.mjs";
2
- import { t as createPDFSource } from "./pdf-source-C52YE8tp.mjs";
2
+ import { t as createPDFSource } from "./pdf-source-C9zNQd9l.mjs";
3
3
  export { createPDFSource, normalizeMediaSource };