@vizejs/ui 0.345.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,112 @@
1
+ import { MaybeRefOrGetter, ShallowRef } from "vue";
2
+
3
+ //#region src/press-types.d.ts
4
+ /** Stable input family reported by a press interaction. */
5
+ type PressPointerType = "keyboard" | "mouse" | "pen" | "pointer" | "touch" | "virtual";
6
+ /** Lifecycle notification emitted by a press controller. */
7
+ type PressEventType = "press" | "pressend" | "pressstart" | "pressup";
8
+ /** Keyboard semantics applied when the host is not natively activatable. */
9
+ type PressKeyboardBehavior = "button" | "link" | "none";
10
+ /** Immutable, renderer-independent snapshot of one press lifecycle event. */
11
+ interface PressEvent {
12
+ /** Press lifecycle phase represented by this snapshot. */
13
+ readonly type: PressEventType;
14
+ /** Input family that initiated the interaction. */
15
+ readonly pointerType: PressPointerType;
16
+ /** Element whose bound press props own the interaction. */
17
+ readonly target: Element;
18
+ /** Native event responsible for this phase, or `null` for manual cancellation. */
19
+ readonly originalEvent: Event | null;
20
+ /** Viewport coordinate when supplied by pointing hardware. */
21
+ readonly x: number | null;
22
+ /** Viewport coordinate when supplied by pointing hardware. */
23
+ readonly y: number | null;
24
+ /** Modifier-key snapshots captured from the native event. */
25
+ readonly altKey: boolean;
26
+ readonly ctrlKey: boolean;
27
+ readonly metaKey: boolean;
28
+ readonly shiftKey: boolean;
29
+ /** Whether the lifecycle ended without an activation. */
30
+ readonly isCanceled: boolean;
31
+ }
32
+ /** Options shared by {@link createPress} and {@link usePress}. */
33
+ interface PressOptions {
34
+ /**
35
+ * Suppress every activation while retaining the bound props.
36
+ *
37
+ * Reactive values are read for every event, so disabling an interaction
38
+ * between pointer-down and pointer-up cancels it deterministically.
39
+ *
40
+ * @default false
41
+ */
42
+ readonly isDisabled?: MaybeRefOrGetter<boolean | undefined>;
43
+ /**
44
+ * Keyboard contract for hosts without native activation behavior.
45
+ * Native buttons, links, inputs, and summaries always keep browser timing.
46
+ *
47
+ * @default "button"
48
+ */
49
+ readonly keyboardBehavior?: MaybeRefOrGetter<PressKeyboardBehavior | undefined>;
50
+ /**
51
+ * End the interaction permanently on its first pointer exit.
52
+ * When false, leaving pauses pressed state and re-entering resumes it.
53
+ *
54
+ * @default false
55
+ */
56
+ readonly shouldCancelOnPointerExit?: MaybeRefOrGetter<boolean | undefined>;
57
+ /**
58
+ * Prevent the compatibility mousedown default that normally moves focus.
59
+ * Keyboard and virtual activation never lose focus.
60
+ *
61
+ * @default false
62
+ */
63
+ readonly preventFocusOnPress?: MaybeRefOrGetter<boolean | undefined>;
64
+ /**
65
+ * Preserve selectable text during an active pointer press. When false, the
66
+ * host's exact inline user-select declarations are restored at press end.
67
+ *
68
+ * @default false
69
+ */
70
+ readonly allowTextSelectionOnPress?: MaybeRefOrGetter<boolean | undefined>;
71
+ /** Called after pressed state becomes active. */
72
+ readonly onPressStart?: (event: PressEvent) => void;
73
+ /** Called after pressed state ends or pauses at the pointer boundary. */
74
+ readonly onPressEnd?: (event: PressEvent) => void;
75
+ /** Called for every distinct pressed-state transition. */
76
+ readonly onPressChange?: (isPressed: boolean) => void;
77
+ /** Called when keyboard or pointing hardware is released over the host. */
78
+ readonly onPressUp?: (event: PressEvent) => void;
79
+ /** Called exactly once for a completed activation. */
80
+ readonly onPress?: (event: PressEvent) => void;
81
+ }
82
+ /** Framework props to spread onto the element that owns a press interaction. */
83
+ interface PressProps {
84
+ readonly onClick: (event: MouseEvent) => void;
85
+ readonly onDragstart: (event: DragEvent) => void;
86
+ readonly onKeydown: (event: KeyboardEvent) => void;
87
+ readonly onKeyup: (event: KeyboardEvent) => void;
88
+ readonly onMousedown: (event: MouseEvent) => void;
89
+ readonly onMousemove: (event: MouseEvent) => void;
90
+ readonly onMouseup: (event: MouseEvent) => void;
91
+ readonly onPointercancel: (event: PointerEvent) => void;
92
+ readonly onPointerdown: (event: PointerEvent) => void;
93
+ readonly onPointermove: (event: PointerEvent) => void;
94
+ readonly onPointerup: (event: PointerEvent) => void;
95
+ readonly onTouchcancel: (event: TouchEvent) => void;
96
+ readonly onTouchend: (event: TouchEvent) => void;
97
+ readonly onTouchmove: (event: TouchEvent) => void;
98
+ readonly onTouchstart: (event: TouchEvent) => void;
99
+ }
100
+ /** Stateful press normalizer with explicit lifecycle ownership. */
101
+ interface PressController {
102
+ /** Whether the active input is currently within the pressed region. */
103
+ readonly isPressed: Readonly<ShallowRef<boolean>>;
104
+ /** Stable handlers to merge or spread onto exactly one host element. */
105
+ readonly pressProps: Readonly<PressProps>;
106
+ /** Cancel the current interaction without producing an activation. */
107
+ readonly cancel: () => boolean;
108
+ /** Release document listeners, timers, and transient selection changes. */
109
+ readonly dispose: () => void;
110
+ }
111
+ //#endregion
112
+ export { PressOptions as a, PressKeyboardBehavior as i, PressEvent as n, PressPointerType as o, PressEventType as r, PressProps as s, PressController as t };
@@ -0,0 +1,14 @@
1
+ import { a as PressOptions, i as PressKeyboardBehavior, n as PressEvent, o as PressPointerType, r as PressEventType, s as PressProps, t as PressController } from "./press-types-B8Ssxqg4.mjs";
2
+
3
+ //#region src/press.d.ts
4
+ /**
5
+ * Create an SSR-safe press normalizer for one host element.
6
+ *
7
+ * Spread the returned `pressProps` onto the host and call `dispose` when using
8
+ * this factory outside a Vue effect scope. No DOM global is read at setup.
9
+ */
10
+ declare function createPress(options?: PressOptions): PressController;
11
+ /** Create a press normalizer disposed with the current Vue effect scope. */
12
+ declare function usePress(options?: PressOptions): PressController;
13
+ //#endregion
14
+ export { type PressController, type PressEvent, type PressEventType, type PressKeyboardBehavior, type PressOptions, type PressPointerType, type PressProps, createPress, usePress };
package/dist/press.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { n as usePress, t as createPress } from "./press-Bp57IOe2.mjs";
2
+ export { createPress, usePress };
@@ -1,2 +1,2 @@
1
- import { n as PrimitiveElement, r as _default, t as PrimitiveAs } from "./primitive-BtvwikH1.mjs";
1
+ import { n as PrimitiveElement, r as _default, t as PrimitiveAs } from "./primitive-Bog8qvd8.mjs";
2
2
  export { _default as Primitive, PrimitiveAs, PrimitiveElement };
@@ -1,2 +1,2 @@
1
- import { t as PrimitiveElement_default } from "./primitive-DJB7pOf3.mjs";
1
+ import { t as PrimitiveElement_default } from "./primitive-BE28SwD7.mjs";
2
2
  export { PrimitiveElement_default as Primitive };
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./visually-hidden-BegtnMng.mjs";
1
+ import { t as _default } from "./visually-hidden-CekDwEwR.mjs";
2
2
  export { _default as VisuallyHidden };
@@ -1,2 +1,2 @@
1
- import { t as VisuallyHidden_default } from "./visually-hidden-QENRapzW.mjs";
1
+ import { t as VisuallyHidden_default } from "./visually-hidden-CTSV3ctZ.mjs";
2
2
  export { VisuallyHidden_default as VisuallyHidden };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/ui",
3
- "version": "0.345.0",
3
+ "version": "0.347.7",
4
4
  "description": "Accessible, headless, Native CSS-first UI primitives",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -44,6 +44,11 @@
44
44
  "import": "./dist/checkbox.mjs",
45
45
  "default": "./dist/checkbox.mjs"
46
46
  },
47
+ "./collection": {
48
+ "types": "./dist/collection.d.mts",
49
+ "import": "./dist/collection.mjs",
50
+ "default": "./dist/collection.mjs"
51
+ },
47
52
  "./context": {
48
53
  "types": "./dist/context.d.mts",
49
54
  "import": "./dist/context.mjs",
@@ -54,6 +59,26 @@
54
59
  "import": "./dist/controllable-state.mjs",
55
60
  "default": "./dist/controllable-state.mjs"
56
61
  },
62
+ "./id": {
63
+ "types": "./dist/id.d.mts",
64
+ "import": "./dist/id.mjs",
65
+ "default": "./dist/id.mjs"
66
+ },
67
+ "./interaction-modality": {
68
+ "types": "./dist/interaction-modality.d.mts",
69
+ "import": "./dist/interaction-modality.mjs",
70
+ "default": "./dist/interaction-modality.mjs"
71
+ },
72
+ "./long-press": {
73
+ "types": "./dist/long-press.d.mts",
74
+ "import": "./dist/long-press.mjs",
75
+ "default": "./dist/long-press.mjs"
76
+ },
77
+ "./press": {
78
+ "types": "./dist/press.d.mts",
79
+ "import": "./dist/press.mjs",
80
+ "default": "./dist/press.mjs"
81
+ },
57
82
  "./primitive": {
58
83
  "types": "./dist/primitive.d.mts",
59
84
  "import": "./dist/primitive.mjs",
@@ -88,14 +113,15 @@
88
113
  "@tsdown/css": "0.22.0",
89
114
  "@types/node": "25.9.2",
90
115
  "@vitejs/plugin-vue": "6.0.7",
91
- "@vizejs/native": "0.345.0",
116
+ "@vizejs/native": "0.347.7",
92
117
  "@vizejs/ui-tooling": "0.298.0",
93
118
  "@vue/test-utils": "2.4.10",
94
119
  "happy-dom": "20.11.0",
95
120
  "typescript": "6.0.3",
96
121
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.21",
97
122
  "vite-plus": "0.1.21",
98
- "vue": "3.5.35"
123
+ "vue": "3.5.35",
124
+ "vue-tsc": "3.3.4"
99
125
  },
100
126
  "peerDependencies": {
101
127
  "vue": "^3.5.0"
@@ -106,12 +132,13 @@
106
132
  "scripts": {
107
133
  "build": "vp pack",
108
134
  "dev": "vp pack --watch",
109
- "lint:sfc": "vp exec node scripts/lint-sfc.ts src",
110
- "pretest": "vp pack && pnpm check:size",
135
+ "lint:sfc": "vp exec node scripts/lint-sfc.ts src && vp exec node scripts/check-renderers.ts src",
136
+ "pretest": "vp pack && pnpm check:size && pnpm check:tree-shaking",
111
137
  "test": "vp test run",
112
- "check": "vp check src scripts vite.config.ts",
113
- "check:fix": "vp check --fix src scripts vite.config.ts",
138
+ "check": "vp check src scripts vite.config.ts tsconfig.typecheck.json && vue-tsc --noEmit -p tsconfig.typecheck.json",
139
+ "check:fix": "vp check --fix src scripts vite.config.ts tsconfig.typecheck.json",
114
140
  "check:size": "node scripts/check-size.mjs",
141
+ "check:tree-shaking": "node scripts/check-tree-shaking.mjs",
115
142
  "fmt": "vp fmt --write src scripts vite.config.ts"
116
143
  }
117
144
  }