@astryx-vue/core 0.17.0 → 0.19.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 (122) hide show
  1. package/dist/AvatarGroup/index.d.ts +1 -1
  2. package/dist/Banner/index.d.ts +1 -1
  3. package/dist/BottomSheet/index.d.ts +1 -1
  4. package/dist/ButtonGroup/index.d.ts +1 -1
  5. package/dist/Calendar/index.d.ts +1 -1
  6. package/dist/Calendar/index.js +1 -1
  7. package/dist/{Calendar-Bk2nGoT-.js → Calendar-DSRNuw3y.js} +37 -13
  8. package/dist/Carousel/index.d.ts +1 -1
  9. package/dist/Center/index.d.ts +1 -1
  10. package/dist/Chat/index.js +1 -1
  11. package/dist/{Chat-Wq7e98zS.js → Chat-CXwXzlZ0.js} +1 -1
  12. package/dist/CheckboxInput/index.d.ts +1 -1
  13. package/dist/CheckboxList/index.d.ts +1 -1
  14. package/dist/ClickableCard/index.d.ts +1 -1
  15. package/dist/Collapsible/index.d.ts +1 -1
  16. package/dist/Collapsible/index.js +1 -1
  17. package/dist/{Collapsible-Dk9BQQbT.js → Collapsible-ExzU7vC0.js} +104 -40
  18. package/dist/ContextMenu/index.d.ts +1 -1
  19. package/dist/DateInput/index.d.ts +1 -1
  20. package/dist/DateInput/index.js +1 -1
  21. package/dist/{DateInput-BitZfGEY.js → DateInput-s2H0orUW.js} +3 -3
  22. package/dist/DateRangeInput/index.d.ts +1 -1
  23. package/dist/DateRangeInput/index.js +1 -1
  24. package/dist/{DateRangeInput-kxXBsUTU.js → DateRangeInput-Dn9I2PMM.js} +7 -7
  25. package/dist/DateTimeInput/index.d.ts +1 -1
  26. package/dist/DateTimeInput/index.js +1 -1
  27. package/dist/{DateTimeInput-Cfkuec_h.js → DateTimeInput-BR_tdURg.js} +47 -17
  28. package/dist/Dialog/index.d.ts +1 -1
  29. package/dist/Drawer/index.d.ts +1 -1
  30. package/dist/FileInput/index.d.ts +1 -1
  31. package/dist/HoverCard/index.d.ts +1 -1
  32. package/dist/HoverCard/index.js +1 -1
  33. package/dist/{HoverCard-DVPLeccv.js → HoverCard-FHYH3VXg.js} +50 -2
  34. package/dist/InfoTip/index.d.ts +1 -1
  35. package/dist/InternationalizationProvider/index.d.ts +1 -1
  36. package/dist/InternationalizationProvider/index.js +1 -1
  37. package/dist/{InternationalizationProvider-Dr5GE6f0.js → InternationalizationProvider-Ddo_-tLK.js} +1 -1
  38. package/dist/Link/index.d.ts +1 -1
  39. package/dist/{MediaTheme-Bkj-_DFN.js → MediaTheme-DfcdEWx-.js} +2 -36
  40. package/dist/MoreMenu/index.d.ts +1 -1
  41. package/dist/MultiSelector/index.d.ts +1 -1
  42. package/dist/NumberInput/index.d.ts +1 -1
  43. package/dist/NumberInput/index.js +1 -1
  44. package/dist/{NumberInput-BPeesTRv.js → NumberInput-BsWTXomE.js} +2 -23
  45. package/dist/OverflowList/index.d.ts +1 -1
  46. package/dist/PowerSearch/index.d.ts +1 -1
  47. package/dist/PowerSearch/index.js +1 -1
  48. package/dist/{PowerSearch-BAOqpQag.js → PowerSearch-CDEn08Pe.js} +6 -6
  49. package/dist/Radio/index.d.ts +1 -1
  50. package/dist/RadioList/index.d.ts +1 -1
  51. package/dist/ScrollableArea/index.d.ts +1 -1
  52. package/dist/SelectableCard/index.d.ts +1 -1
  53. package/dist/Selector/index.d.ts +1 -1
  54. package/dist/SideNav/index.d.ts +1 -1
  55. package/dist/Switch/index.d.ts +1 -1
  56. package/dist/Table/index.d.ts +1 -1
  57. package/dist/Table/index.js +1 -1
  58. package/dist/{Table-CRKljXg4.js → Table-WukSceMV.js} +376 -5
  59. package/dist/TextArea/index.d.ts +1 -1
  60. package/dist/TextInput/index.d.ts +1 -1
  61. package/dist/Theme/index.js +3 -2
  62. package/dist/{Theme-iqi6AvU_.js → Theme-1RJVaRgz.js} +3 -38
  63. package/dist/{TimeField-CBWgdA1Y.js → TimeField-BM-rVFhC.js} +419 -140
  64. package/dist/TimeInput/index.d.ts +2 -2
  65. package/dist/TimeInput/index.js +1 -1
  66. package/dist/{TimeInput-8ASOMV3B.js → TimeInput-CkZfhhAr.js} +28 -8
  67. package/dist/Timer/index.d.ts +1 -1
  68. package/dist/Timer/index.js +1 -1
  69. package/dist/{Timer-C8evnsTE.js → Timer-DiIs5GLA.js} +24 -15
  70. package/dist/Timestamp/index.d.ts +1 -1
  71. package/dist/Timestamp/index.js +1 -1
  72. package/dist/{Timestamp-CgvZe6vH.js → Timestamp-D9Jyk9sD.js} +152 -96
  73. package/dist/Toast/index.js +1 -1
  74. package/dist/{Toast-CzbqvHDN.js → Toast-D4Q6wvYu.js} +1 -1
  75. package/dist/ToggleButton/index.d.ts +1 -1
  76. package/dist/Token/index.d.ts +1 -1
  77. package/dist/Toolbar/index.d.ts +1 -1
  78. package/dist/Tooltip/index.d.ts +1 -1
  79. package/dist/TopNav/index.d.ts +1 -1
  80. package/dist/TreeList/index.d.ts +1 -1
  81. package/dist/TreeList/index.js +1 -1
  82. package/dist/{TreeList-CNj4KnHH.js → TreeList-ugSF9DWj.js} +117 -2
  83. package/dist/composables/index.d.ts +3 -2
  84. package/dist/composables/index.js +3 -3
  85. package/dist/{composables-BKHcPgN0.js → composables-BgfubKnk.js} +39 -332
  86. package/dist/{format-CMHyAMn3.js → format-mffyPc-L.js} +34 -4
  87. package/dist/handle-BPXdHbkr.js +458 -0
  88. package/dist/{index-9eluGe3a.d.ts → index-BA8exXNP.d.ts} +2 -1
  89. package/dist/{index-tuNsmJxw.d.ts → index-BLnvQ4Oj.d.ts} +9 -2
  90. package/dist/{index-B0iRA00v.d.ts → index-BapQGST1.d.ts} +2 -2
  91. package/dist/{index-D31bgBoy.d.ts → index-BdZCLUgY.d.ts} +1 -1
  92. package/dist/{index-DK0Wdo9N.d.ts → index-C9OzEvE_.d.ts} +3 -3
  93. package/dist/{index-CbA8rR_b.d.ts → index-CBOv5j3c.d.ts} +1 -1
  94. package/dist/{index-CMLnSg3T.d.ts → index-CKnr0JlT.d.ts} +7 -0
  95. package/dist/{index-C1qJlC65.d.ts → index-CQ-sq76o.d.ts} +1 -1
  96. package/dist/{index-85RFPeV0.d.ts → index-CULdl3Dg.d.ts} +3 -3
  97. package/dist/{index-BxWCX2pJ.d.ts → index-DFLPv9io.d.ts} +3 -3
  98. package/dist/{index-DofC9Rll.d.ts → index-Otl047R1.d.ts} +1 -1
  99. package/dist/{index-BKnyTWPM.d.ts → index-ZbNwGVkS.d.ts} +1 -1
  100. package/dist/{index-DYabo8TI.d.ts → index-eCp-ElSp.d.ts} +1 -1
  101. package/dist/{index-B95VIgRl.d.ts → index-t27MvEzT.d.ts} +70 -23
  102. package/dist/{index-wY6dKz6c.d.ts → index-yQc-te9a.d.ts} +7 -0
  103. package/dist/index.d.ts +19 -18
  104. package/dist/index.js +25 -24
  105. package/dist/landing-Bs0aMIsR.js +2049 -0
  106. package/dist/{loadCatalog-BJwcyX8i.d.ts → loadCatalog-C4h9SmJs.d.ts} +2 -0
  107. package/dist/{loadCatalog-C1kms5sO.js → loadCatalog-DsEKSY3U.js} +5 -1
  108. package/dist/locale/index.d.ts +2 -2
  109. package/dist/locale/index.js +4 -4
  110. package/dist/{locale-CHhsd9Mq.js → locale-C-Y-13BP.js} +1 -1
  111. package/dist/motionTokenDefaults-EFzpiAF5.js +38 -0
  112. package/dist/timeFormat-CqrwFE42.js +203 -0
  113. package/dist/{timestamp-BMYQsFDj.js → timestamp-saJUedIU.js} +4 -2
  114. package/dist/tokenName-0U-WEH09.js +36 -0
  115. package/dist/unicodeDigits-_BYIJcAu.js +46 -0
  116. package/dist/useAnimatedLayout-C0koWm4a.d.ts +56 -0
  117. package/dist/{useTimeValue-_XW9g2V1.js → useTimeValue-CcKrnO8z.js} +13 -6
  118. package/package.json +1 -1
  119. package/styles/calendar.css +5 -1
  120. package/styles/table.css +19 -0
  121. package/styles/timestamp.css +22 -10
  122. package/dist/{index-D8lv2BiD.d.ts → index-J6YRJ7Ul.d.ts} +1 -1
@@ -1,5 +1,6 @@
1
1
  import { f as pushLayer } from "./interactionModality-B5dR7nnb.js";
2
2
  import { t as useMediaQuery } from "./useMediaQuery-BzXGT1Aw.js";
3
+ import { a as registerReducedMotionCrossFade, d as registerSpringRole, f as isSpring, g as writePresentedResolve, h as registerPresentedOffset, i as reducedMotionCrossFade, m as clearPresentedResolve, n as createAnimatedLayout, o as motionRoleIn, r as cubicBezier, s as motionRoleOf, u as registerMotionTable, x as themeReducesMotion } from "./handle-BPXdHbkr.js";
3
4
  import { n as isDevBuild } from "./devBuild-G249YcdZ.js";
4
5
  import { t as devWarn } from "./useDevWarning-B2fsk2B-.js";
5
6
  import { o as useComponentMessages } from "./context-B8IEFCDR.js";
@@ -526,27 +527,6 @@ function installAttach(engine) {
526
527
  };
527
528
  }
528
529
  //#endregion
529
- //#region src/motion/reducedMotionMark.ts
530
- /**
531
- * @file reducedMotionMark.ts
532
- * @input Whether a theme reduces motion for everyone
533
- * @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
534
- * mark, and themeReducesMotion, which reads it
535
- * @position Owner module of the private reduced-motion attribute: the only
536
- * file that writes its name. A theme that reduces motion for everyone
537
- * spreads the mark on its root, and the root theme sets it on `<html>`; the
538
- * animator and reducedMotionFade read it as the person's Reduce Motion
539
- * setting. No package entry exports it.
540
- */
541
- const REDUCED_MOTION = "data-astryx-reduced-motion";
542
- /**
543
- * Whether the theme `element` is in reduces motion for everyone: its root,
544
- * or `<html>` for the root theme, carries the mark.
545
- */
546
- function themeReducesMotion(element) {
547
- return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
548
- }
549
- //#endregion
550
530
  //#region src/motion/engine/channelText.ts
551
531
  function installChannelText(engine) {
552
532
  const { companion, customProperty, customUnit } = engine;
@@ -573,88 +553,6 @@ function installChannelText(engine) {
573
553
  };
574
554
  }
575
555
  //#endregion
576
- //#region src/utils/sharedRealm.ts
577
- /**
578
- * 对应原版 Astryx 的 `utils/sharedRealm`。
579
- *
580
- * 整个 JavaScript 运行环境里按键共享一份值:页面上同时加载了两份 core(比如包本身和一份复制进项目的副本)时,
581
- * 两边拿同一个键读到的是同一份值。不碰 DOM,服务端也能用。
582
- */
583
- /**
584
- * 共享值的注册键。版本号表示值的形状:形状变了、旧副本读不懂新值时就升版本,
585
- * 两边各用各的。
586
- */
587
- function sharedKey(name, version) {
588
- return Symbol.for(`@astryx-vue/core/${name}/v${version}`);
589
- }
590
- /**
591
- * `key` 下的共享值,第一次用时创建。
592
- * `accepts` 防键撞车:它不认的值原样留着,这一份自己另建一个。
593
- */
594
- function realmValue(key, create, accepts = () => true) {
595
- const realm = globalThis;
596
- if (Object.hasOwn(realm, key)) {
597
- const existing = realm[key];
598
- return accepts(existing) ? existing : create();
599
- }
600
- const value = create();
601
- realm[key] = value;
602
- return value;
603
- }
604
- //#endregion
605
- //#region src/motion/presentation.ts
606
- const presented = realmValue(sharedKey("motion/presentation", 1), () => ({
607
- sources: /* @__PURE__ */ new Map(),
608
- watchers: /* @__PURE__ */ new Set(),
609
- batchDepth: 0,
610
- isChanged: false
611
- }));
612
- const { sources, watchers } = presented;
613
- /** Tell every watcher the reported elements changed; one's throw stops none. */
614
- function notifyWatchers() {
615
- if (presented.batchDepth > 0) {
616
- presented.isChanged = true;
617
- return;
618
- }
619
- for (const watcher of [...watchers]) try {
620
- watcher();
621
- } catch (error) {
622
- queueMicrotask(() => {
623
- throw error;
624
- });
625
- }
626
- }
627
- /**
628
- * Report an element drawn away from where the engine hit-tests it. Returns
629
- * the function that removes the report.
630
- */
631
- function registerPresentedOffset(element, source) {
632
- sources.set(element, source);
633
- notifyWatchers();
634
- return () => {
635
- if (sources.get(element) === source) {
636
- sources.delete(element);
637
- notifyWatchers();
638
- }
639
- };
640
- }
641
- /** The custom property whose writes make WebKit resolve a moving element. */
642
- const RESOLVE_PROPERTY = "--astryx-presented";
643
- /**
644
- * Makes iOS WebKit resolve `element`'s transform again, to the value drawn
645
- * now: one write of a value the property does not have yet. The animator and
646
- * the animated layout both write it, so it counts up from the element's own
647
- * last value.
648
- */
649
- function writePresentedResolve(element) {
650
- const last = Number(element.style.getPropertyValue(RESOLVE_PROPERTY)) || 0;
651
- element.style.setProperty(RESOLVE_PROPERTY, String(last + 1));
652
- }
653
- /** Removes the resolve write from `element`. */
654
- function clearPresentedResolve(element) {
655
- element.style.removeProperty(RESOLVE_PROPERTY);
656
- }
657
- //#endregion
658
556
  //#region src/motion/engine/curveReads.ts
659
557
  function installCurveReads(engine) {
660
558
  const { companion, now, presentedSource, pseudoElement, resting, segments, touched } = engine;
@@ -1264,198 +1162,6 @@ function solveSpring(spring, { from, to, velocity: initialVelocity = 0 }) {
1264
1162
  };
1265
1163
  }
1266
1164
  //#endregion
1267
- //#region src/motion/roleValue.ts
1268
- const ROLE_ID = /^[a-z][A-Za-z0-9]*(?:\.[a-z][A-Za-z0-9]*)+$/;
1269
- /** Whether `id` is a well-formed role name (a dotted table path). */
1270
- function isMotionRoleId(id) {
1271
- return ROLE_ID.test(id);
1272
- }
1273
- /** The CSS custom property for a role: `--motion-` + the path in kebab case. */
1274
- function motionRoleVariable(id) {
1275
- if (!isMotionRoleId(id)) throw new Error(`motion role "${id}" must be a dotted table path such as "springs.sheetPresent"`);
1276
- return `--motion-${id.split(".").map((part) => part.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)).join("-")}`;
1277
- }
1278
- function isSpring(value) {
1279
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
1280
- return "response" in value && "dampingRatio" in value || "duration" in value && "bounce" in value || "stiffness" in value && "damping" in value;
1281
- }
1282
- function isCurve(value) {
1283
- return Array.isArray(value) && value.length === 4 && value.every((n) => typeof n === "number");
1284
- }
1285
- //#endregion
1286
- //#region src/motion/roles.ts
1287
- const rolesById = /* @__PURE__ */ new Map();
1288
- /** A table id → the table registered under it. */
1289
- const tablesById = /* @__PURE__ */ new Map();
1290
- /** A spring or curve leaf → its role. */
1291
- const roleOfLeaf = /* @__PURE__ */ new WeakMap();
1292
- /** A table or one of its groups → its path. */
1293
- const pathOfGroup = /* @__PURE__ */ new WeakMap();
1294
- /** A table path → the role id it is registered under, when renamed. */
1295
- const roleIdOfPath = /* @__PURE__ */ new Map();
1296
- /**
1297
- * Registers a motion table: each spring, `…Ms` duration and curve leaf that
1298
- * `roles` lists (its role name, relative to the table) becomes a role named
1299
- * by its path under `id`; the table's other values stay internal constants. A leaf object the table shares between
1300
- * two keys is replaced in the table by an equal copy, so each role has its own
1301
- * object (an animator resolves a role from the object it is handed).
1302
- * `exclude` lists paths, relative to the table, that are not motion;
1303
- * `rename` maps a path, relative to the table, to the role name it is
1304
- * registered under (relative too), so a role is named for its use while the
1305
- * table keeps its source's name. Registering the same table under the same id
1306
- * again does nothing.
1307
- */
1308
- function registerMotionTable(id, table, { roles = [], exclude = [], rename = {} } = {}) {
1309
- if (!/^[a-z][A-Za-z0-9]*$/.test(id)) throw new Error(`motion table id "${id}" must be one camelCase word`);
1310
- if (tablesById.get(id) === table) return;
1311
- tablesById.set(id, table);
1312
- const skip = new Set(exclude.map((path) => `${id}.${path}`));
1313
- const listed = new Set(roles.map((name) => `${id}.${name}`));
1314
- const walk = (group, prefix) => {
1315
- pathOfGroup.set(group, prefix);
1316
- for (const [key, value] of Object.entries(group)) {
1317
- const path = `${prefix}.${key}`;
1318
- if (skip.has(path)) continue;
1319
- let kind = null;
1320
- if (isSpring(value)) kind = "spring";
1321
- else if (isCurve(value)) kind = "curve";
1322
- else if (typeof value === "number" && key.endsWith("Ms")) kind = "duration";
1323
- else if (value !== null && typeof value === "object" && !Array.isArray(value)) {
1324
- walk(value, path);
1325
- continue;
1326
- }
1327
- if (kind == null) continue;
1328
- const relative = path.slice(id.length + 1);
1329
- const roleId = relative in rename ? `${id}.${rename[relative]}` : path;
1330
- if (!listed.has(roleId)) continue;
1331
- if (roleId !== path) roleIdOfPath.set(path, roleId);
1332
- let leaf = value;
1333
- if (typeof leaf === "object") {
1334
- const taken = roleOfLeaf.get(leaf);
1335
- if (taken != null && taken.id !== roleId) {
1336
- leaf = Object.freeze(Array.isArray(leaf) ? [...leaf] : { ...leaf });
1337
- group[key] = leaf;
1338
- }
1339
- }
1340
- const role = {
1341
- id: roleId,
1342
- kind,
1343
- variable: motionRoleVariable(roleId),
1344
- value: leaf
1345
- };
1346
- rolesById.set(roleId, role);
1347
- if (typeof leaf === "object") roleOfLeaf.set(leaf, role);
1348
- }
1349
- };
1350
- walk(table, id);
1351
- }
1352
- /**
1353
- * Registers `leaf` as the spring role `id` (a table path such as
1354
- * `springs.settle`) and returns it, so a table row can register itself. A row
1355
- * that calls it under a pure annotation drops out of a bundle that does not
1356
- * use it, call included. Registering the same leaf under the same id again
1357
- * does nothing.
1358
- */
1359
- function registerSpringRole(id, leaf) {
1360
- if (!isMotionRoleId(id)) throw new Error(`motion role "${id}" must be a dotted table path such as "springs.settle"`);
1361
- if (roleOfLeaf.get(leaf)?.id !== id) {
1362
- const role = {
1363
- id,
1364
- kind: "spring",
1365
- variable: motionRoleVariable(id),
1366
- value: leaf
1367
- };
1368
- rolesById.set(id, role);
1369
- roleOfLeaf.set(leaf, role);
1370
- }
1371
- return leaf;
1372
- }
1373
- /** The role a spring or curve leaf of a registered table plays, if any. */
1374
- function motionRoleOf(leaf) {
1375
- return leaf !== null && typeof leaf === "object" ? roleOfLeaf.get(leaf) : void 0;
1376
- }
1377
- /**
1378
- * The role `group[key]` plays, for a table or one of its groups: the way to
1379
- * name a duration, which is a bare number.
1380
- */
1381
- function motionRoleIn(group, key) {
1382
- const prefix = pathOfGroup.get(group);
1383
- if (prefix == null) return;
1384
- const path = `${prefix}.${key}`;
1385
- return rolesById.get(roleIdOfPath.get(path) ?? path);
1386
- }
1387
- const NUMBER = "(-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e-?\\d+)?)";
1388
- new RegExp(`^${NUMBER}s\\s+${NUMBER}$`);
1389
- new RegExp(`^${NUMBER}(ms|s)$`);
1390
- new RegExp(`^cubic-bezier\\(\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*,\\s*${NUMBER}\\s*\\)$`);
1391
- //#endregion
1392
- //#region src/motion/uikit/timing.ts
1393
- /**
1394
- * @file timing.ts
1395
- * @input Nothing; data only
1396
- * @output Exports `timing`: the non-spring clocks and curves UIKit uses
1397
- * (press highlight onset, flash and fade, Core Animation's named Bézier
1398
- * curves, the navigation bar hide/show duration, the keyboard
1399
- * notification duration, the Reduced Motion cross-fade)
1400
- * @position The timing domain of the UIKit constants table (motion/uikit)
1401
- *
1402
- * Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
1403
- * measured | GUESS); webkit and GUESS values also carry the `@measure` task
1404
- * that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
1405
- * enforces both.
1406
- *
1407
- * Durations are in ms (the unit of pointer-event timestamps, which these
1408
- * clocks are compared against); curves are cubic-bézier control points
1409
- * [x1, y1, x2, y2].
1410
- */
1411
- /**
1412
- * The Reduce Motion fade, its own export so the animator reads it without
1413
- * the rest of the table (`architecture:component-style-authoring` INV6).
1414
- * `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
1415
- * `curves.move`, so their roles are unchanged.
1416
- */
1417
- const reducedMotionCrossFade = {
1418
- /**
1419
- * The Reduced Motion cross-fade, in ms, on `curves.move`: under
1420
- * Reduce Motion an entrance, exit, presentation switch or state change
1421
- * becomes an opacity-only cross-fade of this length on a coarse pointer
1422
- * (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
1423
- * of 2026-10-24, departing from UIKit's own navigation cross-fade,
1424
- * measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
1425
- * @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
1426
- * (the setting)
1427
- * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
1428
- * iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
1429
- * Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
1430
- * (0.42, 0, 0.58, 1)), Oct 23 2026
1431
- */
1432
- durationMs: 200,
1433
- /**
1434
- * `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
1435
- * .easeInOut`, "the default curve for most animations").
1436
- * @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
1437
- * @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
1438
- * iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
1439
- * Oct 23 2026
1440
- */
1441
- curve: [
1442
- .42,
1443
- 0,
1444
- .58,
1445
- 1
1446
- ]
1447
- };
1448
- const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
1449
- const reducedMotionCrossFadeRoles = { curves: { move } };
1450
- /**
1451
- * Registers only the Reduce Motion fade's curve as its role,
1452
- * `timing.curves.move`, for code that reads the fade without the rest of the
1453
- * table (the animator, reducedMotionFade()). The fade's length is not a role.
1454
- */
1455
- function registerReducedMotionCrossFade() {
1456
- registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
1457
- }
1458
- //#endregion
1459
1165
  //#region src/motion/reducedMotionPlan.ts
1460
1166
  /** The properties that move an element rather than fade it. */
1461
1167
  const TRAVEL_PROPERTIES = [
@@ -2760,42 +2466,6 @@ function installSampling(engine) {
2760
2466
  };
2761
2467
  }
2762
2468
  //#endregion
2763
- //#region src/motion/bezier.ts
2764
- /** The timing function for `points`: maps time progress to eased progress. */
2765
- function cubicBezier([x1, y1, x2, y2]) {
2766
- const cx = 3 * x1;
2767
- const bx = 3 * (x2 - x1) - cx;
2768
- const ax = 1 - cx - bx;
2769
- const cy = 3 * y1;
2770
- const by = 3 * (y2 - y1) - cy;
2771
- const ay = 1 - cy - by;
2772
- const sampleX = (t) => ((ax * t + bx) * t + cx) * t;
2773
- const sampleY = (t) => ((ay * t + by) * t + cy) * t;
2774
- const slopeX = (t) => (3 * ax * t + 2 * bx) * t + cx;
2775
- const solveT = (x) => {
2776
- let t = x;
2777
- for (let i = 0; i < 8; i++) {
2778
- const error = sampleX(t) - x;
2779
- if (Math.abs(error) < 1e-7) return t;
2780
- const slope = slopeX(t);
2781
- if (Math.abs(slope) < 1e-6) break;
2782
- t -= error / slope;
2783
- }
2784
- let lo = 0;
2785
- let hi = 1;
2786
- t = x;
2787
- for (let i = 0; i < 60; i++) {
2788
- const value = sampleX(t);
2789
- if (Math.abs(value - x) < 1e-7) break;
2790
- if (value < x) lo = t;
2791
- else hi = t;
2792
- t = (lo + hi) / 2;
2793
- }
2794
- return t;
2795
- };
2796
- return (x) => x <= 0 ? 0 : x >= 1 ? 1 : sampleY(solveT(x));
2797
- }
2798
- //#endregion
2799
2469
  //#region src/motion/themeTempo.ts
2800
2470
  /**
2801
2471
  * @file themeTempo.ts
@@ -4451,6 +4121,43 @@ function createAnimator(element) {
4451
4121
  return animator;
4452
4122
  }
4453
4123
  //#endregion
4124
+ //#region src/composables/useAnimatedLayout.ts
4125
+ function elementOf(value) {
4126
+ if (value == null) return null;
4127
+ if (typeof Element !== "undefined" && value instanceof Element) return value;
4128
+ const root = value.$el;
4129
+ return typeof Element !== "undefined" && root instanceof Element ? root : null;
4130
+ }
4131
+ /**
4132
+ * 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
4133
+ * 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
4134
+ * 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
4135
+ *
4136
+ * 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
4137
+ * 句柄没有公开成员。服务端渲染时不碰 DOM。
4138
+ *
4139
+ * @example
4140
+ * ```vue
4141
+ * <script setup lang="ts">
4142
+ * import { useAnimatedLayout } from '@astryx-vue/core'
4143
+ * import { useTemplateRef } from 'vue'
4144
+ *
4145
+ * const container = useTemplateRef<HTMLElement>('container')
4146
+ * const animatedLayout = useAnimatedLayout({ containerRef: container })
4147
+ * <\/script>
4148
+ *
4149
+ * <template>
4150
+ * <div ref="container">
4151
+ * <TreeList :items="items" :animated-layout="animatedLayout" />
4152
+ * <p>备注</p>
4153
+ * </div>
4154
+ * </template>
4155
+ * ```
4156
+ */
4157
+ function useAnimatedLayout({ containerRef }) {
4158
+ return createAnimatedLayout(() => elementOf(toValue(containerRef)));
4159
+ }
4160
+ //#endregion
4454
4161
  //#region src/composables/useAnimator.ts
4455
4162
  /**
4456
4163
  * 用组件库自己的动效驱动 `target` 指向的元素。`target` 可以是模板 ref、
@@ -5727,4 +5434,4 @@ function useTouchTrigger(options) {
5727
5434
  };
5728
5435
  }
5729
5436
  //#endregion
5730
- export { useKeyboardHint as a, perceptualLightness as c, useGridFocus as d, useEntryAnimation as f, createAnimator as g, useAnimator as h, useSnapPaging as i, useImageMode as l, useContainerReveal as m, snapToGraphemeBoundary as n, useIndicatorFocusRing as o, useControllableState as p, useStreamingText as r, imageModeFromPixels as s, useTouchTrigger as t, useGridRovingFocus as u };
5437
+ export { createAnimator as _, useKeyboardHint as a, perceptualLightness as c, useGridFocus as d, useEntryAnimation as f, useAnimatedLayout as g, useAnimator as h, useSnapPaging as i, useImageMode as l, useContainerReveal as m, snapToGraphemeBoundary as n, useIndicatorFocusRing as o, useControllableState as p, useStreamingText as r, imageModeFromPixels as s, useTouchTrigger as t, useGridRovingFocus as u };
@@ -1,4 +1,4 @@
1
- import { n as firstCharacter } from "./characters-wTnzjkkR.js";
1
+ import { n as firstCharacter, t as characterCount } from "./characters-wTnzjkkR.js";
2
2
  //#region src/locale/weekdays.ts
3
3
  const standaloneShortWeekdayNamesByLocale = {
4
4
  "af": [
@@ -286,13 +286,29 @@ const standaloneShortWeekdayNamesByLocale = {
286
286
  const weekdayStart = new Date(2023, 0, 1);
287
287
  const englishWeekdays = standaloneShortWeekdayNamesByLocale.en;
288
288
  /**
289
+ * 没有内置表头数据的语言:`Intl` 的缩写写法(CLDR abbreviated)七个都不超过四个字符就用它,
290
+ * 否则退到窄写法,免得表头列被长名字撑挤。无效标签和宿主不认识的语言回到英文。
291
+ */
292
+ const MAX_ABBREVIATED_HEADER_LENGTH = 4;
293
+ function intlWeekdayNames(locale) {
294
+ let supported = false;
295
+ try {
296
+ supported = Intl.DateTimeFormat.supportedLocalesOf([locale]).length > 0;
297
+ } catch {
298
+ return null;
299
+ }
300
+ if (!supported) return null;
301
+ const abbreviated = weekdayNames(locale, "short");
302
+ return abbreviated.every((name) => characterCount(name) <= MAX_ABBREVIATED_HEADER_LENGTH) ? abbreviated : weekdayNames(locale, "narrow");
303
+ }
304
+ /**
289
305
  * 日历表头用的短星期名,从周日开始。
290
- * 先找完整标签,再找基础语言(`fr-FR` 找 `fr`),都没有时回到英文,和原版一致。
306
+ * 先找完整标签,再找基础语言(`fr-FR` 找 `fr`),再用 `Intl` 自己的写法,都没有时回到英文。
291
307
  */
292
308
  function standaloneShortWeekdayNames(locale) {
293
309
  try {
294
310
  const parsed = new Intl.Locale(locale);
295
- return standaloneShortWeekdayNamesByLocale[parsed.baseName] ?? standaloneShortWeekdayNamesByLocale[parsed.language] ?? englishWeekdays;
311
+ return standaloneShortWeekdayNamesByLocale[parsed.baseName] ?? standaloneShortWeekdayNamesByLocale[parsed.language] ?? intlWeekdayNames(parsed.baseName) ?? englishWeekdays;
296
312
  } catch {
297
313
  return englishWeekdays;
298
314
  }
@@ -337,5 +353,19 @@ function weekdayNames(locale, style) {
337
353
  return formatter.format(date);
338
354
  });
339
355
  }
356
+ const dayNumberFormats = /* @__PURE__ */ new Map();
357
+ /** 日期数字和周数:用语言自己的数字写法(如 fa-IR、ar-EG),不分组。 */
358
+ function formatDayNumber(value, locale) {
359
+ let format = dayNumberFormats.get(locale);
360
+ if (format == null) {
361
+ try {
362
+ format = new Intl.NumberFormat(locale, { useGrouping: false });
363
+ } catch {
364
+ format = new Intl.NumberFormat("en", { useGrouping: false });
365
+ }
366
+ dayNumberFormats.set(locale, format);
367
+ }
368
+ return format.format(value);
369
+ }
340
370
  //#endregion
341
- export { standaloneShortWeekdayNames as n, weekdayNames as r, formatCalendarMonth as t };
371
+ export { weekdayNames as i, formatDayNumber as n, standaloneShortWeekdayNames as r, formatCalendarMonth as t };