@astryx-vue/core 0.26.1 → 0.28.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 (178) hide show
  1. package/dist/AlertDialog/index.js +1 -1
  2. package/dist/{AlertDialog-CGGkPG4T.js → AlertDialog-B195FgtL.js} +2 -2
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/{AppShell-DGJgCvS6.js → AppShell-Da255Ktm.js} +3 -3
  5. package/dist/AvatarGroup/index.d.ts +1 -1
  6. package/dist/Banner/index.d.ts +1 -1
  7. package/dist/BottomSheet/index.d.ts +1 -1
  8. package/dist/Breadcrumbs/index.d.ts +2 -2
  9. package/dist/Breadcrumbs/index.js +2 -2
  10. package/dist/{Breadcrumbs-BZsjHn_5.js → Breadcrumbs-CmtcXM4e.js} +1 -1
  11. package/dist/Button/index.d.ts +1 -1
  12. package/dist/ButtonGroup/index.d.ts +1 -1
  13. package/dist/Calendar/index.d.ts +1 -1
  14. package/dist/Carousel/index.d.ts +1 -1
  15. package/dist/Center/index.d.ts +1 -1
  16. package/dist/Chat/index.d.ts +1 -1
  17. package/dist/Chat/index.js +1 -1
  18. package/dist/CheckboxInput/index.d.ts +1 -1
  19. package/dist/CheckboxList/index.d.ts +1 -1
  20. package/dist/CheckboxList/index.js +1 -1
  21. package/dist/{CheckboxList-CWHlG8Jq.js → CheckboxList-DGM-cgX5.js} +2 -2
  22. package/dist/ClickableCard/index.d.ts +1 -1
  23. package/dist/ClickableCard/index.js +1 -1
  24. package/dist/Collapsible/index.js +1 -1
  25. package/dist/{Collapsible-BSRdsb6w.js → Collapsible-B2vrr_YP.js} +2 -2
  26. package/dist/ComplexSelector/index.js +1 -1
  27. package/dist/{ComplexSelector-DI3J30Ho.js → ComplexSelector-Dq9esodQ.js} +1 -1
  28. package/dist/ContextMenu/index.d.ts +2 -2
  29. package/dist/ContextMenu/index.js +2 -2
  30. package/dist/{ContextMenu-CVf4OqJP.js → ContextMenu-DB4XcNKf.js} +1 -1
  31. package/dist/DateInput/index.d.ts +1 -1
  32. package/dist/DateInput/index.js +1 -1
  33. package/dist/{DateInput-DK-FI37x.js → DateInput-DNqm49AX.js} +1 -1
  34. package/dist/DateRangeInput/index.d.ts +1 -1
  35. package/dist/DateRangeInput/index.js +1 -1
  36. package/dist/{DateRangeInput-ClriBc4F.js → DateRangeInput-Bch513M0.js} +1 -1
  37. package/dist/DateTimeInput/index.d.ts +1 -1
  38. package/dist/DateTimeInput/index.js +1 -1
  39. package/dist/{DateTimeInput-BdXkBBYi.js → DateTimeInput-BCFgCeNy.js} +1 -1
  40. package/dist/Dialog/index.d.ts +1 -1
  41. package/dist/Divider/index.d.ts +1 -1
  42. package/dist/Drawer/index.d.ts +1 -1
  43. package/dist/DropdownMenu/index.d.ts +2 -2
  44. package/dist/DropdownMenu/index.js +3 -3
  45. package/dist/{DropdownMenu-CdwEvDld.js → DropdownMenu-D9swCben.js} +3 -3
  46. package/dist/{DropdownMenu-q5euMYv-.js → DropdownMenu-DlfMGzZ2.js} +3 -33
  47. package/dist/{DropdownMenuRadioItem.vue-DINRx71W.d.ts → DropdownMenuRadioItem.vue-C8rePTyz.d.ts} +1 -1
  48. package/dist/HoverCard/index.d.ts +1 -1
  49. package/dist/InfoTip/index.d.ts +1 -1
  50. package/dist/InternationalizationProvider/index.d.ts +1 -1
  51. package/dist/InternationalizationProvider/index.js +1 -1
  52. package/dist/{InternationalizationProvider-8qllKdVk.js → InternationalizationProvider-CEmlN48L.js} +1 -1
  53. package/dist/{Item-DUI1Qnnd.js → Item-C8UAQwFQ.js} +193 -111
  54. package/dist/Link/index.d.ts +1 -1
  55. package/dist/List/index.d.ts +2 -2
  56. package/dist/List/index.js +2 -2
  57. package/dist/{ListItem-C8SqSrU6.js → ListItem-BlrEngDO.js} +11 -3
  58. package/dist/MetadataList/index.d.ts +1 -1
  59. package/dist/MoreMenu/index.d.ts +1 -1
  60. package/dist/MoreMenu/index.js +1 -1
  61. package/dist/{MoreMenu-DAq29azZ.js → MoreMenu-GPcHAauX.js} +3 -1
  62. package/dist/MultiSelector/index.d.ts +1 -1
  63. package/dist/NavItem/index.d.ts +1 -1
  64. package/dist/NavItem/index.js +1 -1
  65. package/dist/NumberInput/index.d.ts +1 -1
  66. package/dist/Outline/index.js +1 -1
  67. package/dist/{Outline-DvQbXc_H.js → Outline-DI9MZnuQ.js} +106 -50
  68. package/dist/OverflowList/index.d.ts +1 -1
  69. package/dist/Pagination/index.d.ts +1 -1
  70. package/dist/Pagination/index.js +1 -1
  71. package/dist/{Pagination-CRrou1P-.js → Pagination-BNPBvFW1.js} +2 -2
  72. package/dist/Popover/index.d.ts +1 -1
  73. package/dist/Popover/index.js +1 -1
  74. package/dist/{Popover-sERt08TR.js → Popover-MJQZog5m.js} +2 -2
  75. package/dist/PowerSearch/index.d.ts +1 -1
  76. package/dist/PowerSearch/index.js +1 -1
  77. package/dist/{PowerSearch-CiVIW13b.js → PowerSearch-Bv-yUo6C.js} +10 -8
  78. package/dist/Radio/index.d.ts +1 -1
  79. package/dist/RadioList/index.d.ts +1 -1
  80. package/dist/ScrollableArea/index.d.ts +1 -1
  81. package/dist/SelectableCard/index.d.ts +1 -1
  82. package/dist/Selector/index.d.ts +1 -1
  83. package/dist/Selector/index.js +1 -1
  84. package/dist/SideNav/index.d.ts +1 -1
  85. package/dist/SideNav/index.js +2 -2
  86. package/dist/{SideNav-CHSwzwTt.js → SideNav-B_0Fv-ZU.js} +4 -4
  87. package/dist/Stack/index.d.ts +1 -1
  88. package/dist/Stepper/index.d.ts +1 -1
  89. package/dist/Switch/index.d.ts +1 -1
  90. package/dist/TabList/index.d.ts +1 -1
  91. package/dist/Table/index.d.ts +1 -1
  92. package/dist/Table/index.js +1 -1
  93. package/dist/{Table-DEqfIA3q.js → Table-B0Aj43zB.js} +9 -9
  94. package/dist/TextArea/index.d.ts +1 -1
  95. package/dist/TextInput/index.d.ts +1 -1
  96. package/dist/TimeInput/index.d.ts +1 -1
  97. package/dist/Timestamp/index.d.ts +1 -1
  98. package/dist/ToggleButton/index.d.ts +1 -1
  99. package/dist/Token/index.d.ts +1 -1
  100. package/dist/Tokenizer/index.d.ts +2 -2
  101. package/dist/Tokenizer/index.js +1 -1
  102. package/dist/Tokenizer-iJb-WZ55.js +2067 -0
  103. package/dist/Toolbar/index.d.ts +1 -1
  104. package/dist/Tooltip/index.d.ts +1 -1
  105. package/dist/TopNav/index.d.ts +1 -1
  106. package/dist/TopNav/index.js +1 -1
  107. package/dist/{TopNav-Ce79A3zT.js → TopNav-ctvKlpxf.js} +1 -1
  108. package/dist/TreeList/index.d.ts +1 -1
  109. package/dist/TreeList/index.js +1 -1
  110. package/dist/{TreeList-BEPHdVYu.js → TreeList-Dh0uAj2B.js} +48 -7
  111. package/dist/Typeahead/index.d.ts +1 -1
  112. package/dist/Typeahead/index.js +2 -2
  113. package/dist/{Typeahead-CBrUdbHv.js → Typeahead-D2O3n477.js} +1 -1
  114. package/dist/{animator-BooLoGyI.js → animator-BGq5a6vT.js} +4 -300
  115. package/dist/{batch-CM-vJhQg.js → batch-BhaAWUIt.js} +3 -2
  116. package/dist/{bezier-Cts7gENO.js → bezier-Df-yGuNZ.js} +1 -90
  117. package/dist/composables/index.js +2 -1
  118. package/dist/{composables-BtqijTIO.js → composables-BTRbNgmR.js} +4 -41
  119. package/dist/{context-DH8E-qjm.js → context-jtpQfR6F.js} +1 -1
  120. package/dist/{edge-BYXwSggM.js → edge-CJIswPTX.js} +1 -1
  121. package/dist/{edgeRide-B5mlN2Q4.js → edgeRide-Drk4V-MC.js} +2 -2
  122. package/dist/{index-ZbNwGVkS.d.ts → index-BKnyTWPM.d.ts} +1 -1
  123. package/dist/{index-DeZ11MNP.d.ts → index-BLsYMZgA.d.ts} +4 -4
  124. package/dist/{index-D7ShT2c-.d.ts → index-BgT6mH3U.d.ts} +1 -1
  125. package/dist/{index-BD-Pxni9.d.ts → index-BhxqUt3y.d.ts} +1 -1
  126. package/dist/{index-LqFjvL4C.d.ts → index-Bu4R0WZA.d.ts} +21 -5
  127. package/dist/{index-B5aHF0Ml.d.ts → index-C0nKJSA2.d.ts} +1 -1
  128. package/dist/{index-DlKz3dB1.d.ts → index-C6IcBhAn.d.ts} +2 -2
  129. package/dist/{index-Cm36VS1A.d.ts → index-C9uW39Mj.d.ts} +1 -1
  130. package/dist/{index-CnOH43-f.d.ts → index-CBH9Gyte.d.ts} +1 -1
  131. package/dist/{index-CRtGmCHi.d.ts → index-CEtFUoIm.d.ts} +1 -1
  132. package/dist/{index-C4S65SAW.d.ts → index-CKnr0JlT.d.ts} +1 -1
  133. package/dist/{index-BdhQpERn.d.ts → index-CMZnO7VU.d.ts} +4 -4
  134. package/dist/{index-DY1kpap1.d.ts → index-CkzTX9pb.d.ts} +42 -42
  135. package/dist/{index-DSMv6W8s.d.ts → index-Ct6SEtjd.d.ts} +4 -4
  136. package/dist/{index-C8wfe0Mr.d.ts → index-D05JGsT3.d.ts} +1 -1
  137. package/dist/{index-FeZXsFO-.d.ts → index-DDrL_-hJ.d.ts} +1 -1
  138. package/dist/{index-DDVCVpnG.d.ts → index-DE-QPNz0.d.ts} +1 -1
  139. package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
  140. package/dist/{index-CB6VQETg.d.ts → index-DIw5D3zj.d.ts} +2 -2
  141. package/dist/{index-eCp-ElSp.d.ts → index-DYabo8TI.d.ts} +1 -1
  142. package/dist/{index-Otl047R1.d.ts → index-DofC9Rll.d.ts} +1 -1
  143. package/dist/{index-C2zWUiJ1.d.ts → index-DogWVRJi.d.ts} +1 -1
  144. package/dist/{index-aHC2C89h.d.ts → index-Ea2V_FSK.d.ts} +4 -4
  145. package/dist/{index-DPklTi3o.d.ts → index-Q1oG9yIT.d.ts} +1 -1
  146. package/dist/{index-NOXYEdOI.d.ts → index-utZGF4GR.d.ts} +1 -1
  147. package/dist/index.d.ts +30 -30
  148. package/dist/index.js +39 -37
  149. package/dist/{landing-B9Uvex6x.js → landing-CBaXCGEg.js} +2 -2
  150. package/dist/{loadCatalog-BRd5XCbW.js → loadCatalog-Blm5sm1o.js} +36 -8
  151. package/dist/{loadCatalog-CLm4V7mm.d.ts → loadCatalog-DDLjLKYA.d.ts} +21 -0
  152. package/dist/locale/index.d.ts +2 -2
  153. package/dist/locale/index.js +3 -3
  154. package/dist/{locale-BkAezFog.js → locale-Y7dHbjs4.js} +1 -1
  155. package/dist/resolveMotion-CurhYTVC.js +307 -0
  156. package/dist/{themeTiming-CWEvdh31.js → themeTiming-BFDOPRjK.js} +1 -1
  157. package/dist/timing-CSHWQbTJ.js +90 -0
  158. package/dist/tokenizer-C1y-55Ft.js +72 -0
  159. package/dist/{types-Gw2OjSK9.d.ts → types-ClOMFbqC.d.ts} +2 -2
  160. package/dist/useAnimatedLayout-DC2l3WrE.js +40 -0
  161. package/dist/{useMenuDrillIn-CP0P49ej.js → useMenuDrillIn-BQx6lQMz.js} +1 -1
  162. package/dist/useMenuEntranceHold-buV5S9yk.js +33 -0
  163. package/dist/{useTypeaheadMenuConfig-DeDGVR8S.js → useTypeaheadMenuConfig-Do0jOyEm.js} +35 -35
  164. package/package.json +1 -1
  165. package/styles/list.css +102 -5
  166. package/styles/metadata-list.css +6 -1
  167. package/styles/more-menu.css +42 -35
  168. package/styles/outline.css +2 -1
  169. package/styles/sheet-confirmation.css +8 -0
  170. package/styles/tokenizer-sheet.css +203 -0
  171. package/styles.css +2 -0
  172. package/dist/Tokenizer-2zj57yDt.js +0 -888
  173. package/dist/tokenizer-ChiAuPN-.js +0 -34
  174. package/dist/{Chat-RE_6Ez79.js → Chat-Bg1IuDMt.js} +1 -1
  175. package/dist/{ClickableCard-CwGxO0GU.js → ClickableCard-ChmOwgYq.js} +1 -1
  176. package/dist/{NavItem-c1ScHEJY.js → NavItem-kj9FbbFS.js} +1 -1
  177. package/dist/{Selector-Bj4q6aT5.js → Selector-BrNA4sLV.js} +1 -1
  178. package/dist/{index-J6YRJ7Ul.d.ts → index-CHx33xGa.d.ts} +1 -1
@@ -0,0 +1,307 @@
1
+ import { b as isSpring, h as motionRoleOf, m as motionRoleIn } from "./pressGesture-BzIBmKF2.js";
2
+ //#region src/motion/engine/constants.ts
3
+ const PROPERTIES = [
4
+ "x",
5
+ "y",
6
+ "rotate",
7
+ "scaleX",
8
+ "scaleY",
9
+ "opacity"
10
+ ];
11
+ /** The axes momentum moves: `decay` takes only these (DR2, DEC-2). */
12
+ const DECAY_PROPERTIES = ["x", "y"];
13
+ const IDENTITY = {
14
+ x: 0,
15
+ y: 0,
16
+ rotate: 0,
17
+ scaleX: 1,
18
+ scaleY: 1,
19
+ opacity: 1
20
+ };
21
+ /**
22
+ * Keyframes are added until linear interpolation is within this: a quarter of
23
+ * a device pixel (this quarter of a CSS pixel, divided by the device pixel
24
+ * ratio where it is above 1), a twentieth of a degree, a 2000th of the size,
25
+ * about one step of an 8-bit alpha. Every one is below what a moving element
26
+ * can show.
27
+ */
28
+ const SAMPLE_TOLERANCE = {
29
+ x: .25,
30
+ y: .25,
31
+ rotate: .05,
32
+ scaleX: 5e-4,
33
+ scaleY: 5e-4,
34
+ opacity: .004
35
+ };
36
+ /** Keyframes start on this grid (ms) and are split where the curve needs it. */
37
+ const SAMPLE_GRID_MS = 1e3 / 30;
38
+ /** A curve that has not settled by then (an undamped spring) snaps. */
39
+ const MAX_DURATION_MS = 3e4;
40
+ /**
41
+ * How close a spring's target and a value must be to count as the same, in
42
+ * the property's own units. Only float rounding separates two ways of
43
+ * computing one value, far below anything the screen shows.
44
+ */
45
+ const SAME_VALUE = 1e-6;
46
+ /** Above this many keyframes the tolerance is relaxed. */
47
+ const MAX_KEYFRAMES = 1200;
48
+ /**
49
+ * The keyframes hold the end state this long after a curve ends. An engine
50
+ * whose compositor ends an animation while the main thread is blocked falls
51
+ * back to the value its main thread last committed, the curve's start
52
+ * (WebKit on Linux); the hold keeps the end state on screen through any such
53
+ * block. It only stretches the last keyframe. The main thread retires the
54
+ * animation as soon as it runs after the curve's end.
55
+ *
56
+ * Why a tail inside the curve's own animation, with a bound (measured Oct 24
57
+ * 2026; do not replace it without these proofs):
58
+ * - WebKit on Linux (WebKitGTK and WPE) ignores `fill` on its compositor:
59
+ * a 400 ms move that ends during a 1 s main-thread block snaps back to the
60
+ * block-start position 13 ms after its end, with `fill: forwards` or with
61
+ * no fill, and holds with this tail. iOS 26.2 Mobile Safari holds the end
62
+ * in all three forms, so there the tail is unneeded but harmless (measured
63
+ * Oct 25 2026). The browser proof "a spring that ends inside the block
64
+ * keeps showing its end state" catches it.
65
+ * - A separate static animation of the end state under the curve would hold
66
+ * it without a bound, but two animations on one property push Chromium to
67
+ * run the curve on the main thread: the 1 s block proof moved in 0 of 57
68
+ * frames, the start-before-a-block proof failed, and seeking the curve
69
+ * broke.
70
+ */
71
+ const END_HOLD_MS = 6e4;
72
+ /**
73
+ * The soonest a running animation's end is looked for again, ms: a frame at
74
+ * 60 Hz. WebKit moves an animation's currentTime once per frame, so a look
75
+ * within a frame reads the frame's time, a fraction of a ms short of the end,
76
+ * and a timer for that fraction would fire again before anything moved.
77
+ */
78
+ const END_RECHECK_MS = 1e3 / 60;
79
+ const CHANNELS = {
80
+ translate: ["x", "y"],
81
+ rotate: ["rotate"],
82
+ scale: ["scaleX", "scaleY"],
83
+ opacity: ["opacity"]
84
+ };
85
+ const CHANNEL_OF = {
86
+ x: "translate",
87
+ y: "translate",
88
+ rotate: "rotate",
89
+ scaleX: "scale",
90
+ scaleY: "scale",
91
+ opacity: "opacity"
92
+ };
93
+ /** What `inlineText` writes for each channel at identity. */
94
+ const IDENTITY_TEXT = {
95
+ translate: "none",
96
+ rotate: "none",
97
+ scale: "none",
98
+ opacity: "1"
99
+ };
100
+ /**
101
+ * The transition `decay` hands a Reduce Motion transition curve to: under
102
+ * Reduce Motion `animate` plays no spring (a cross-fade, or at once), so the
103
+ * spring itself is never solved.
104
+ */
105
+ const REDUCED_TRANSITION = { spring: {
106
+ duration: .5,
107
+ bounce: 0
108
+ } };
109
+ //#endregion
110
+ //#region src/motion/engine/cssValues.ts
111
+ function round(value, digits) {
112
+ return Number(value.toFixed(digits));
113
+ }
114
+ function format(channel, value) {
115
+ switch (channel) {
116
+ case "translate": return `${round(value("x"), 3)}px ${round(value("y"), 3)}px`;
117
+ case "rotate": return `${round(value("rotate"), 4)}deg`;
118
+ case "scale": return `${round(value("scaleX"), 5)} ${round(value("scaleY"), 5)}`;
119
+ case "opacity": return `${round(Math.min(1, Math.max(0, value("opacity"))), 4)}`;
120
+ }
121
+ }
122
+ /**
123
+ * Whether a computed value shows `expected` (`format`'s text). An unset or
124
+ * `none` value is the channel's identity. One value of a two-value channel
125
+ * stands for both (scale), or for x with y at 0 (translate).
126
+ */
127
+ function sameShown(channel, shown, expected) {
128
+ const numbers = (text) => {
129
+ const list = ((text === "" || text === "none" ? IDENTITY_TEXT[channel] : text).match(/-?\d*\.?\d+(?:e-?\d+)?/g) ?? []).map(Number);
130
+ if (channel === "translate") return [list[0] ?? 0, list[1] ?? 0];
131
+ if (channel === "scale") return [list[0] ?? 1, list[1] ?? list[0] ?? 1];
132
+ return list.length > 0 ? list : [channel === "opacity" ? 1 : 0];
133
+ };
134
+ const a = numbers(shown);
135
+ const b = numbers(expected);
136
+ return a.length === b.length && a.every((value, i) => Math.abs(value - b[i]) < .001);
137
+ }
138
+ /**
139
+ * The inline text for a channel: `format`, except that an identity transform
140
+ * is written `none`. Any other value, `translate: 0px 0px` included, makes
141
+ * the element the containing block of its `position: fixed` descendants and
142
+ * a stacking context, so a motion back to identity would leave a fixed child
143
+ * moved with its parent; Mobile Safari also lets no finger scroll a list
144
+ * inside an element left at `scale: 1`. At rest the identity leaves the
145
+ * element entirely when its stylesheet agrees (`releaseIdentity`).
146
+ */
147
+ function inlineText(channel, value) {
148
+ const at = (property, identity, digits) => round(value(property), digits) === identity;
149
+ switch (channel) {
150
+ case "translate": return at("x", 0, 3) && at("y", 0, 3) ? "none" : format(channel, value);
151
+ case "rotate": return at("rotate", 0, 4) ? "none" : format(channel, value);
152
+ case "scale": return at("scaleX", 1, 5) && at("scaleY", 1, 5) ? "none" : format(channel, value);
153
+ case "opacity": return format(channel, value);
154
+ }
155
+ }
156
+ /** Whether a computed value (or an unset one) is the channel's identity. */
157
+ function isIdentityText(channel, text) {
158
+ const value = text.trim();
159
+ if (value === "" || value === "none") return true;
160
+ const numbers = value.split(/\s+/).map((part) => Number.parseFloat(part));
161
+ if (numbers.some((number) => !Number.isFinite(number))) return false;
162
+ const identity = channel === "scale" || channel === "opacity" ? 1 : 0;
163
+ return numbers.every((number) => Math.abs(number - identity) < 1e-6);
164
+ }
165
+ function expand(values) {
166
+ const out = {};
167
+ for (const [key, value] of Object.entries(values)) {
168
+ if (value == null || !Number.isFinite(value)) continue;
169
+ if (key === "scale") {
170
+ out.scaleX ??= value;
171
+ out.scaleY ??= value;
172
+ } else if (PROPERTIES.includes(key)) out[key] = value;
173
+ }
174
+ return out;
175
+ }
176
+ /** The time the motion clock reads (`performance.now()`'s time base). */
177
+ function motionNow() {
178
+ return typeof performance === "undefined" ? Date.now() : performance.now();
179
+ }
180
+ /**
181
+ * Whether the user asked for reduced motion (`prefers-reduced-motion:
182
+ * reduce`), read at the moment of the call: the preference the animator uses
183
+ * by default for its Reduce Motion substitution. A component never reads it
184
+ * to pick a curve of its own: its motion settings do not override the
185
+ * policy (design:reduced-motion DR4); `animator.reducedMotion()` or
186
+ * `reducedMotionFade()` gives the policy's answer. False without a window
187
+ * (server rendering).
188
+ */
189
+ function defaultPrefersReducedMotion() {
190
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
191
+ }
192
+ /** Whether the primary pointer is coarse: `(pointer: coarse)`. */
193
+ function defaultIsCoarsePointer() {
194
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches;
195
+ }
196
+ /**
197
+ * Registers `name` as an inherited `<length>` (initially 0px) or `<number>`
198
+ * (initially 0) so keyframes interpolate it; an unregistered custom property
199
+ * animates in steps. A property the page already registered is left as it
200
+ * is.
201
+ */
202
+ function registerCustomProperty(name, syntax) {
203
+ if (typeof CSS === "undefined" || typeof CSS.registerProperty !== "function") return;
204
+ try {
205
+ CSS.registerProperty({
206
+ name,
207
+ syntax,
208
+ inherits: true,
209
+ initialValue: syntax === "<length>" ? "0px" : "0"
210
+ });
211
+ } catch (error) {
212
+ if (!(error instanceof DOMException) || error.name !== "InvalidModificationError") throw error;
213
+ }
214
+ }
215
+ function expandList(properties) {
216
+ const out = /* @__PURE__ */ new Set();
217
+ for (const property of properties) if (property === "scale") {
218
+ out.add("scaleX");
219
+ out.add("scaleY");
220
+ } else out.add(property);
221
+ return [...out];
222
+ }
223
+ //#endregion
224
+ //#region src/motion/themeTempo.ts
225
+ /**
226
+ * @file themeTempo.ts
227
+ * @input An element on the page
228
+ * @output `themeTempo(element)`: the tempo of the theme the element is in
229
+ * @position Motion foundation; resolveMotion.ts scales a motion role by it,
230
+ * and the pager scales its settle by it, which no role names
231
+ *
232
+ * A theme that sets `tempo` writes it, clamped, to the private custom
233
+ * property `--_astryx-motion-tempo` beside its duration tokens. An
234
+ * adaptation rule writes it where its condition holds, and a nested theme
235
+ * that sets no tempo inherits it. A layer whose durations come from a
236
+ * duration scale writes a tempo of 1, so its springs keep its own pace. One
237
+ * read of a custom property forces no layout.
238
+ * Nothing here imports a theme module, runs on import or runs on the server.
239
+ */
240
+ /** The property a theme that sets `tempo` writes (theme/themeMotion.ts). */
241
+ const TEMPO_PROPERTY = "--_astryx-motion-tempo";
242
+ /**
243
+ * The tempo motion on `element` plays at: the one its theme or an adaptation
244
+ * rule sets, else 1. Without an element in a document, or with a value that
245
+ * is not a positive number, it is 1.
246
+ */
247
+ function themeTempo(element) {
248
+ const view = element?.ownerDocument?.defaultView;
249
+ if (element == null || view == null) return 1;
250
+ const text = view.getComputedStyle(element).getPropertyValue(TEMPO_PROPERTY).trim();
251
+ const tempo = text === "" ? NaN : Number(text);
252
+ return Number.isFinite(tempo) && tempo > 0 ? tempo : 1;
253
+ }
254
+ //#endregion
255
+ //#region src/motion/resolveMotion.ts
256
+ /**
257
+ * The roles the tempo leaves as measured: the parts that follow a finger,
258
+ * and ProgressBar's busy loop.
259
+ */
260
+ const FIXED_ROLES = /* @__PURE__ */ new Set([
261
+ "springs.fingerTracking",
262
+ "switchControl.tracking",
263
+ "progress.reducedMotionPulseMs"
264
+ ]);
265
+ /** Each role spring at each tempo, so a role resolves to one object per tempo. */
266
+ const springsAtTempo = /* @__PURE__ */ new WeakMap();
267
+ /**
268
+ * `spring` at `tempo`. In each of its forms, the undamped period grows by the
269
+ * tempo and the damping ratio stays. So the motion keeps its shape and takes
270
+ * `tempo` times as long.
271
+ */
272
+ function springAtTempo(spring, tempo) {
273
+ let byTempo = springsAtTempo.get(spring);
274
+ if (byTempo == null) {
275
+ byTempo = /* @__PURE__ */ new Map();
276
+ springsAtTempo.set(spring, byTempo);
277
+ }
278
+ let scaled = byTempo.get(tempo);
279
+ if (scaled == null) {
280
+ if ("response" in spring) scaled = {
281
+ response: spring.response * tempo,
282
+ dampingRatio: spring.dampingRatio
283
+ };
284
+ else if ("duration" in spring) scaled = {
285
+ duration: spring.duration * tempo,
286
+ bounce: spring.bounce
287
+ };
288
+ else scaled = {
289
+ ...spring.mass == null ? null : { mass: spring.mass },
290
+ stiffness: spring.stiffness / (tempo * tempo),
291
+ damping: spring.damping / tempo
292
+ };
293
+ byTempo.set(tempo, scaled);
294
+ }
295
+ return scaled;
296
+ }
297
+ function resolveMotion(element, leafOrGroup, key) {
298
+ const value = key === void 0 ? leafOrGroup : leafOrGroup[key];
299
+ const role = key === void 0 ? motionRoleOf(leafOrGroup) : motionRoleIn(leafOrGroup, key);
300
+ if (role == null || role.kind === "curve" || FIXED_ROLES.has(role.id)) return value;
301
+ const tempo = themeTempo(element);
302
+ if (tempo === 1) return value;
303
+ if (typeof value === "number") return value * tempo;
304
+ return isSpring(value) ? springAtTempo(value, tempo) : value;
305
+ }
306
+ //#endregion
307
+ export { REDUCED_TRANSITION as C, SAMPLE_TOLERANCE as E, PROPERTIES as S, SAMPLE_GRID_MS as T, END_RECHECK_MS as _, expandList as a, MAX_DURATION_MS as b, isIdentityText as c, round as d, sameShown as f, END_HOLD_MS as g, DECAY_PROPERTIES as h, expand as i, motionNow as l, CHANNEL_OF as m, defaultIsCoarsePointer as n, format as o, CHANNELS as p, defaultPrefersReducedMotion as r, inlineText as s, resolveMotion as t, registerCustomProperty as u, IDENTITY as v, SAME_VALUE as w, MAX_KEYFRAMES as x, IDENTITY_TEXT as y };
@@ -1,5 +1,5 @@
1
1
  import { _ as parseMotionRoleValue, g as parseCssEasing } from "./pressGesture-BzIBmKF2.js";
2
- import { t as cubicBezier } from "./bezier-Cts7gENO.js";
2
+ import { t as cubicBezier } from "./bezier-Df-yGuNZ.js";
3
3
  import { n as easeDefaults, t as durationDefaults } from "./motionTokenDefaults-EFzpiAF5.js";
4
4
  import { n as normalizeTokenName } from "./tokenName-0U-WEH09.js";
5
5
  //#region src/Theme/tokenReferences.ts
@@ -0,0 +1,90 @@
1
+ import { v as registerMotionTable } from "./pressGesture-BzIBmKF2.js";
2
+ //#region src/motion/reducedMotionMark.ts
3
+ /**
4
+ * @file reducedMotionMark.ts
5
+ * @input Whether a theme reduces motion for everyone
6
+ * @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
7
+ * mark, and themeReducesMotion, which reads it
8
+ * @position Owner module of the private reduced-motion attribute: the only
9
+ * file that writes its name. A theme that reduces motion for everyone
10
+ * spreads the mark on its root, and the root theme sets it on `<html>`; the
11
+ * animator and reducedMotionFade read it as the person's Reduce Motion
12
+ * setting. No package entry exports it.
13
+ */
14
+ const REDUCED_MOTION = "data-astryx-reduced-motion";
15
+ /**
16
+ * Whether the theme `element` is in reduces motion for everyone: its root,
17
+ * or `<html>` for the root theme, carries the mark.
18
+ */
19
+ function themeReducesMotion(element) {
20
+ return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
21
+ }
22
+ //#endregion
23
+ //#region src/motion/uikit/timing.ts
24
+ /**
25
+ * @file timing.ts
26
+ * @input Nothing; data only
27
+ * @output Exports `timing`: the non-spring clocks and curves UIKit uses
28
+ * (press highlight onset, flash and fade, Core Animation's named Bézier
29
+ * curves, the navigation bar hide/show duration, the keyboard
30
+ * notification duration, the Reduced Motion cross-fade)
31
+ * @position The timing domain of the UIKit constants table (motion/uikit)
32
+ *
33
+ * Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
34
+ * measured | GUESS); webkit and GUESS values also carry the `@measure` task
35
+ * that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
36
+ * enforces both.
37
+ *
38
+ * Durations are in ms (the unit of pointer-event timestamps, which these
39
+ * clocks are compared against); curves are cubic-bézier control points
40
+ * [x1, y1, x2, y2].
41
+ */
42
+ /**
43
+ * The Reduce Motion fade, its own export so the animator reads it without
44
+ * the rest of the table (`architecture:component-style-authoring` INV6).
45
+ * `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
46
+ * `curves.move`, so their roles are unchanged.
47
+ */
48
+ const reducedMotionCrossFade = {
49
+ /**
50
+ * The Reduced Motion cross-fade, in ms, on `curves.move`: under
51
+ * Reduce Motion an entrance, exit, presentation switch or state change
52
+ * becomes an opacity-only cross-fade of this length on a coarse pointer
53
+ * (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
54
+ * of 2026-10-24, departing from UIKit's own navigation cross-fade,
55
+ * measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
56
+ * @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
57
+ * (the setting)
58
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
59
+ * iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
60
+ * Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
61
+ * (0.42, 0, 0.58, 1)), Oct 23 2026
62
+ */
63
+ durationMs: 200,
64
+ /**
65
+ * `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
66
+ * .easeInOut`, "the default curve for most animations").
67
+ * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
68
+ * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
69
+ * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
70
+ * Oct 23 2026
71
+ */
72
+ curve: [
73
+ .42,
74
+ 0,
75
+ .58,
76
+ 1
77
+ ]
78
+ };
79
+ const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
80
+ const reducedMotionCrossFadeRoles = { curves: { move } };
81
+ /**
82
+ * Registers only the Reduce Motion fade's curve as its role,
83
+ * `timing.curves.move`, for code that reads the fade without the rest of the
84
+ * table (the animator, reducedMotionFade()). The fade's length is not a role.
85
+ */
86
+ function registerReducedMotionCrossFade() {
87
+ registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
88
+ }
89
+ //#endregion
90
+ export { registerReducedMotionCrossFade as n, themeReducesMotion as r, reducedMotionCrossFade as t };
@@ -0,0 +1,72 @@
1
+ import { n as englishPlural, r as formatCount } from "./shared-CTFb3-QO.js";
2
+ //#region src/locale/messages/alert-dialog.ts
3
+ const alertDialogMessages = {
4
+ "en": { cancel: "Cancel" },
5
+ "zh-CN": { cancel: "取消" }
6
+ };
7
+ //#endregion
8
+ //#region src/locale/messages/tokenizer.ts
9
+ const tokenizerMessages = {
10
+ "en": {
11
+ placeholder: "Add…",
12
+ empty: "No results found",
13
+ loading: "Loading",
14
+ error: "Couldn't load results",
15
+ clear: "Clear all",
16
+ results: "Search results",
17
+ more: (count) => `+${formatCount(count, "en")} more`,
18
+ added: (label) => `Added ${label}`,
19
+ removed: (label) => `Removed ${label}`,
20
+ allRemoved: "All items removed",
21
+ resultCount: (count) => `${formatCount(count, "en")} ${englishPlural(count, "result", "results")}`,
22
+ create: (query) => `Create "${query}"`,
23
+ search: (label) => `Search ${label}`,
24
+ searchPlaceholder: "Search…",
25
+ noResultsDescription: "Try a different search.",
26
+ add: "Add",
27
+ addValue: (value) => `Add ${value}`,
28
+ save: "Save",
29
+ selectionLimit: (count) => `Select up to ${formatCount(count, "en")} ${englishPlural(count, "item", "items")}`,
30
+ discardChangesTitle: "Discard changes?",
31
+ discardChangesDescription: (label) => `Your changes to ${label} haven't been saved.`,
32
+ keepEditing: "Keep editing",
33
+ discardChanges: "Discard changes",
34
+ clearAllTitle: "Clear all selected items?",
35
+ clearAllDescription: (label) => `This removes all selected items from ${label}.`,
36
+ nothingToClear: "Nothing selected",
37
+ selectedCount: (count) => `${formatCount(count, "en")} selected`,
38
+ clearSelection: "Clear selection"
39
+ },
40
+ "zh-CN": {
41
+ placeholder: "添加…",
42
+ empty: "未找到结果",
43
+ loading: "正在加载",
44
+ error: "加载失败",
45
+ clear: "全部清除",
46
+ results: "搜索结果",
47
+ more: (count) => `另外 ${formatCount(count, "zh-CN")} 个`,
48
+ added: (label) => `已添加${label}`,
49
+ removed: (label) => `已移除${label}`,
50
+ allRemoved: "已移除全部",
51
+ resultCount: (count) => `找到 ${formatCount(count, "zh-CN")} 个结果`,
52
+ create: (query) => `创建「${query}」`,
53
+ search: (label) => `搜索${label}`,
54
+ searchPlaceholder: "搜索…",
55
+ noResultsDescription: "换个关键词试试。",
56
+ add: "添加",
57
+ addValue: (value) => `添加${value}`,
58
+ save: "保存",
59
+ selectionLimit: (count) => `最多选择 ${formatCount(count, "zh-CN")} 项`,
60
+ discardChangesTitle: "放弃改动?",
61
+ discardChangesDescription: (label) => `对${label}的改动还没有保存。`,
62
+ keepEditing: "继续编辑",
63
+ discardChanges: "放弃改动",
64
+ clearAllTitle: "清除全部已选项?",
65
+ clearAllDescription: (label) => `这会移除${label}里的全部已选项。`,
66
+ nothingToClear: "还没有选择",
67
+ selectedCount: (count) => `已选 ${formatCount(count, "zh-CN")} 项`,
68
+ clearSelection: "清除选择"
69
+ }
70
+ };
71
+ //#endregion
72
+ export { alertDialogMessages as n, tokenizerMessages as t };
@@ -193,13 +193,13 @@ interface ListItemProps {
193
193
  swipeBehavior?: ItemSwipeBehavior;
194
194
  }
195
195
  interface ListItemSlots {
196
- /** Leading content before the label: an icon, an avatar, a checkbox. */
196
+ /** Content before the label, inside the row: an icon, an avatar, a checkbox. */
197
197
  startContent?: () => VNodeChild;
198
198
  /** Rich content replacing the `label` prop. */
199
199
  label?: () => VNodeChild;
200
200
  /** Rich content replacing the `description` prop. */
201
201
  description?: () => VNodeChild;
202
- /** Trailing content after the label area: a badge, a timestamp, a chevron. */
202
+ /** Content after the label and description, inside the row: a badge, a timestamp, a chevron. */
203
203
  endContent?: () => VNodeChild;
204
204
  }
205
205
  interface ItemProps extends ListItemProps {
@@ -0,0 +1,40 @@
1
+ import { n as createAnimatedLayout } from "./handle-BazRxHwq.js";
2
+ import { toValue } from "vue";
3
+ //#region src/composables/useAnimatedLayout.ts
4
+ function elementOf(value) {
5
+ if (value == null) return null;
6
+ if (typeof Element !== "undefined" && value instanceof Element) return value;
7
+ const root = value.$el;
8
+ return typeof Element !== "undefined" && root instanceof Element ? root : null;
9
+ }
10
+ /**
11
+ * 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
12
+ * 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
13
+ * 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
14
+ *
15
+ * 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
16
+ * 句柄没有公开成员。服务端渲染时不碰 DOM。
17
+ *
18
+ * @example
19
+ * ```vue
20
+ * <script setup lang="ts">
21
+ * import { useAnimatedLayout } from '@astryx-vue/core'
22
+ * import { useTemplateRef } from 'vue'
23
+ *
24
+ * const container = useTemplateRef<HTMLElement>('container')
25
+ * const animatedLayout = useAnimatedLayout({ containerRef: container })
26
+ * <\/script>
27
+ *
28
+ * <template>
29
+ * <div ref="container">
30
+ * <TreeList :items="items" :animated-layout="animatedLayout" />
31
+ * <p>备注</p>
32
+ * </div>
33
+ * </template>
34
+ * ```
35
+ */
36
+ function useAnimatedLayout({ containerRef }) {
37
+ return createAnimatedLayout(() => elementOf(toValue(containerRef)));
38
+ }
39
+ //#endregion
40
+ export { useAnimatedLayout as t };
@@ -1,7 +1,7 @@
1
1
  import { n as readLayerScoped, t as defineLayerScopedKey } from "./scopedProvide-C-Df7c15.js";
2
2
  import { t as _sfc_main$4 } from "./Icon-Dk0jccgU.js";
3
3
  import { o as useComponentMessages } from "./context-B8IEFCDR.js";
4
- import { t as _sfc_main$5 } from "./Item-DUI1Qnnd.js";
4
+ import { t as _sfc_main$5 } from "./Item-C8UAQwFQ.js";
5
5
  import { t as _sfc_main$6 } from "./CheckboxIndicator-fH4d-JE1.js";
6
6
  import { a as useCompactDefinition, r as readCompactTouch } from "./presentationHold-7IkbR4d8.js";
7
7
  import { t as dropdownMenuMessages } from "./dropdown-menu-BDu4gWwQ.js";
@@ -0,0 +1,33 @@
1
+ import { t as holdEntranceInput } from "./holdEntranceInput-DMCOeRqu.js";
2
+ import { nextTick, onBeforeUnmount, watch } from "vue";
3
+ //#region src/layer/useMenuEntranceHold.ts
4
+ /**
5
+ * 浮层一显示就开始暂挡,直到它的 CSS 进场播完,和 UIMenu 一样:这期间落下的手指
6
+ * 关不掉菜单、滚不动页面、也挪不走焦点。键盘和辅助技术照常。只在主指针是粗略
7
+ * 指针时挡;打开菜单的那根手指照样能选中一行(按压模型的命中测试看穿挡板)。
8
+ */
9
+ function useMenuEntranceHold(layer, isShown) {
10
+ let release = null;
11
+ let isUnmounted = false;
12
+ const stop = () => {
13
+ release?.();
14
+ release = null;
15
+ };
16
+ watch([isShown, layer], ([shown, element], [wasShown, previous]) => {
17
+ if (!shown) {
18
+ stop();
19
+ return;
20
+ }
21
+ if (element == null || wasShown && element === previous) return;
22
+ stop();
23
+ nextTick(() => {
24
+ if (!isUnmounted && release == null && isShown.value && layer.value === element) release = holdEntranceInput(element);
25
+ });
26
+ }, { flush: "post" });
27
+ onBeforeUnmount(() => {
28
+ isUnmounted = true;
29
+ stop();
30
+ });
31
+ }
32
+ //#endregion
33
+ export { useMenuEntranceHold as t };
@@ -249,40 +249,6 @@ function useTypeaheadMenu(options) {
249
249
  };
250
250
  }
251
251
  //#endregion
252
- //#region src/selectors/useLatchedOptionGrid.ts
253
- /** 一旦出现过带操作的条目,这次挂载里的菜单就保持两列网格。 */
254
- function useLatchedOptionGrid(options) {
255
- const gridLatched = ref(false);
256
- watch(options.entries, (list) => {
257
- if (list.some((entry) => isOptionAction(entry.action))) gridLatched.value = true;
258
- }, { immediate: true });
259
- const gridMode = computed(() => gridLatched.value);
260
- function optionId(index) {
261
- return `${options.listboxId()}-option-${index}`;
262
- }
263
- function actionId(index) {
264
- return `${options.listboxId()}-action-${index}`;
265
- }
266
- function rowHasAction(index) {
267
- return isOptionAction(options.entries()[index]?.action);
268
- }
269
- return {
270
- gridMode,
271
- actionGrid: useOptionActionGrid({
272
- enabled: () => gridMode.value,
273
- isOpen: options.isOpen,
274
- activeIndex: options.activeIndex,
275
- rowHasAction,
276
- getListbox: options.getListbox,
277
- optionId,
278
- actionId
279
- }),
280
- popupKind: computed(() => gridMode.value ? "grid" : "listbox"),
281
- optionId,
282
- actionId
283
- };
284
- }
285
- //#endregion
286
252
  //#region src/Typeahead/TypeaheadItem.vue
287
253
  const _hoisted_1$2 = ["data-disabled"];
288
254
  const _hoisted_2$1 = {
@@ -654,6 +620,40 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
654
620
  }
655
621
  });
656
622
  //#endregion
623
+ //#region src/selectors/useLatchedOptionGrid.ts
624
+ /** 一旦出现过带操作的条目,这次挂载里的菜单就保持两列网格。 */
625
+ function useLatchedOptionGrid(options) {
626
+ const gridLatched = ref(false);
627
+ watch(options.entries, (list) => {
628
+ if (list.some((entry) => isOptionAction(entry.action))) gridLatched.value = true;
629
+ }, { immediate: true });
630
+ const gridMode = computed(() => gridLatched.value);
631
+ function optionId(index) {
632
+ return `${options.listboxId()}-option-${index}`;
633
+ }
634
+ function actionId(index) {
635
+ return `${options.listboxId()}-action-${index}`;
636
+ }
637
+ function rowHasAction(index) {
638
+ return isOptionAction(options.entries()[index]?.action);
639
+ }
640
+ return {
641
+ gridMode,
642
+ actionGrid: useOptionActionGrid({
643
+ enabled: () => gridMode.value,
644
+ isOpen: options.isOpen,
645
+ activeIndex: options.activeIndex,
646
+ rowHasAction,
647
+ getListbox: options.getListbox,
648
+ optionId,
649
+ actionId
650
+ }),
651
+ popupKind: computed(() => gridMode.value ? "grid" : "listbox"),
652
+ optionId,
653
+ actionId
654
+ };
655
+ }
656
+ //#endregion
657
657
  //#region src/Typeahead/useTypeaheadAnnouncement.ts
658
658
  /**
659
659
  * 输入了文字、搜索落定之后,念一句结果数(点名每一条匹配,包括超出 `maxMenuItems`
@@ -778,4 +778,4 @@ function useTypeaheadMenuConfig(options) {
778
778
  };
779
779
  }
780
780
  //#endregion
781
- export { useLatchedOptionGrid as a, _sfc_main$2 as i, useTypeaheadAnnouncement as n, useTypeaheadMenu as o, _sfc_main as r, useTypeaheadMenuConfig as t };
781
+ export { _sfc_main$2 as a, _sfc_main as i, useTypeaheadAnnouncement as n, useTypeaheadMenu as o, useLatchedOptionGrid as r, useTypeaheadMenuConfig as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryx-vue/core",
3
3
  "type": "module",
4
- "version": "0.26.1",
4
+ "version": "0.28.0",
5
5
  "description": "Vue 3 components for the unofficial astryx-vue port of Astryx. Not affiliated with Meta.",
6
6
  "author": "ShenQingchuan",
7
7
  "license": "MIT",