@astryx-vue/core 0.27.0 → 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.
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-CGGkPG4T.js → AlertDialog-B195FgtL.js} +2 -2
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-DGJgCvS6.js → AppShell-Da255Ktm.js} +3 -3
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/{Breadcrumbs-Bt6Pp3gV.js → Breadcrumbs-CmtcXM4e.js} +1 -1
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Carousel/index.d.ts +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CWHlG8Jq.js → CheckboxList-DGM-cgX5.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BSRdsb6w.js → Collapsible-B2vrr_YP.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-DI3J30Ho.js → ComplexSelector-Dq9esodQ.js} +1 -1
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-CVf4OqJP.js → ContextMenu-DB4XcNKf.js} +1 -1
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-DK-FI37x.js → DateInput-DNqm49AX.js} +1 -1
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-ClriBc4F.js → DateRangeInput-Bch513M0.js} +1 -1
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BdXkBBYi.js → DateTimeInput-BCFgCeNy.js} +1 -1
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-CmbnIRug.js → DropdownMenu-D9swCben.js} +3 -3
- package/dist/{DropdownMenu-NIGjTT7o.js → DropdownMenu-DlfMGzZ2.js} +2 -2
- package/dist/{DropdownMenuRadioItem.vue-DINRx71W.d.ts → DropdownMenuRadioItem.vue-C8rePTyz.d.ts} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/InfoTip/index.d.ts +1 -1
- package/dist/{Item-DUI1Qnnd.js → Item-C8UAQwFQ.js} +193 -111
- package/dist/Link/index.d.ts +1 -1
- package/dist/List/index.d.ts +2 -2
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-C8SqSrU6.js → ListItem-BlrEngDO.js} +11 -3
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-vavlbJ-p.js → MoreMenu-GPcHAauX.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-DvQbXc_H.js → Outline-DI9MZnuQ.js} +106 -50
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-CRrou1P-.js → Pagination-BNPBvFW1.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-sERt08TR.js → Popover-MJQZog5m.js} +2 -2
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CUY0iULe.js → PowerSearch-Bv-yUo6C.js} +4 -4
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +2 -2
- package/dist/{SideNav-CHSwzwTt.js → SideNav-B_0Fv-ZU.js} +4 -4
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.d.ts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-B7MHrvdy.js → Table-B0Aj43zB.js} +7 -7
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-Ce79A3zT.js → TopNav-ctvKlpxf.js} +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BEPHdVYu.js → TreeList-Dh0uAj2B.js} +48 -7
- package/dist/{animator-BooLoGyI.js → animator-BGq5a6vT.js} +4 -300
- package/dist/{batch-CM-vJhQg.js → batch-BhaAWUIt.js} +3 -2
- package/dist/{bezier-Cts7gENO.js → bezier-Df-yGuNZ.js} +1 -90
- package/dist/composables/index.js +2 -1
- package/dist/{composables-BtqijTIO.js → composables-BTRbNgmR.js} +4 -41
- package/dist/{context-DH8E-qjm.js → context-jtpQfR6F.js} +1 -1
- package/dist/{edge-BYXwSggM.js → edge-CJIswPTX.js} +1 -1
- package/dist/{edgeRide-B5mlN2Q4.js → edgeRide-Drk4V-MC.js} +2 -2
- package/dist/{index-X4S7_dmq.d.ts → index-BA8exXNP.d.ts} +1 -1
- package/dist/{index-CVNtRsJb.d.ts → index-BLsYMZgA.d.ts} +2 -2
- package/dist/{index-BR3MOBYd.d.ts → index-BgT6mH3U.d.ts} +2 -2
- package/dist/{index-BD-Pxni9.d.ts → index-BhxqUt3y.d.ts} +1 -1
- package/dist/{index-C4EuWBql.d.ts → index-C6IcBhAn.d.ts} +1 -1
- package/dist/{index-waTkqxTz.d.ts → index-C89cIh4E.d.ts} +1 -1
- package/dist/{index-CiVrhGUJ.d.ts → index-C9ZssPUV.d.ts} +1 -1
- package/dist/{index-Cm36VS1A.d.ts → index-C9uW39Mj.d.ts} +1 -1
- package/dist/{index-CRtGmCHi.d.ts → index-CEtFUoIm.d.ts} +1 -1
- package/dist/{index-B-oy8Ko6.d.ts → index-CMZnO7VU.d.ts} +2 -2
- package/dist/{index-BO8V3n98.d.ts → index-CkzTX9pb.d.ts} +38 -38
- package/dist/{index-SI2AkpMU.d.ts → index-Ct6SEtjd.d.ts} +1 -1
- package/dist/{index-rdwI-mcm.d.ts → index-CtYlR9Cu.d.ts} +1 -1
- package/dist/{index-FeZXsFO-.d.ts → index-DDrL_-hJ.d.ts} +1 -1
- package/dist/{index-DDVCVpnG.d.ts → index-DE-QPNz0.d.ts} +1 -1
- package/dist/{index-BO9TY87G.d.ts → index-DFLPv9io.d.ts} +1 -1
- package/dist/{index-CfPgindd.d.ts → index-DIw5D3zj.d.ts} +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +31 -30
- package/dist/{landing-B9Uvex6x.js → landing-CBaXCGEg.js} +2 -2
- package/dist/resolveMotion-CurhYTVC.js +307 -0
- package/dist/{themeTiming-CWEvdh31.js → themeTiming-BFDOPRjK.js} +1 -1
- package/dist/timing-CSHWQbTJ.js +90 -0
- package/dist/{types-Gw2OjSK9.d.ts → types-ClOMFbqC.d.ts} +2 -2
- package/dist/useAnimatedLayout-DC2l3WrE.js +40 -0
- package/dist/{useMenuDrillIn-CP0P49ej.js → useMenuDrillIn-BQx6lQMz.js} +1 -1
- package/package.json +1 -1
- package/styles/list.css +102 -5
- package/styles/metadata-list.css +6 -1
- package/styles/outline.css +2 -1
- package/dist/{Chat-RE_6Ez79.js → Chat-Bg1IuDMt.js} +1 -1
- package/dist/{ClickableCard-CwGxO0GU.js → ClickableCard-ChmOwgYq.js} +1 -1
- package/dist/{NavItem-c1ScHEJY.js → NavItem-kj9FbbFS.js} +1 -1
- package/dist/{Selector-Bj4q6aT5.js → Selector-BrNA4sLV.js} +1 -1
- package/dist/{index-BqhgeAT4.d.ts → index-CHx33xGa.d.ts} +2 -2
|
@@ -3,15 +3,18 @@ import { t as usePressFeedback } from "./usePressFeedback-BhNcuxQv.js";
|
|
|
3
3
|
import { i as isIconGlyph, t as _sfc_main$2 } from "./Icon-Dk0jccgU.js";
|
|
4
4
|
import { n as isSafeUrl } from "./safeUrl-CsvfcZ9m.js";
|
|
5
5
|
import { n as useLinkComponent } from "./context-C_peZbXf.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { t as useCoarsePointer } from "./useCoarsePointer-GItEMrjX.js";
|
|
7
|
+
import { n as releaseLayoutExit, r as playLayoutChange, t as holdLayoutExit } from "./edgeRide-Drk4V-MC.js";
|
|
8
|
+
import { i as reportLayoutChange, t as applyLayoutChangeTransition } from "./landing-CBaXCGEg.js";
|
|
9
|
+
import { t as useAnimatedLayout } from "./useAnimatedLayout-DC2l3WrE.js";
|
|
8
10
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
9
11
|
import { n as isShortcutChord, r as nextTypeaheadBuffer, t as findTypeaheadMatch } from "./typeaheadMatch-Cl-oxKFt.js";
|
|
10
12
|
import { t as _sfc_main$3 } from "./Badge-BbPS_49c.js";
|
|
11
13
|
import { t as useFocusAcrossSwap } from "./focusAcrossSwap-Casww_IY.js";
|
|
12
14
|
import { t as consumeWhileDisabled } from "./disabledInteraction-Bqoyhoss.js";
|
|
15
|
+
import { t as useIndicator } from "./useIndicator-PFDBNOvX.js";
|
|
13
16
|
import { t as treeListMessages } from "./tree-list-NZ1EZhtd.js";
|
|
14
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode,
|
|
17
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onMounted, openBlock, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useAttrs, useId, useSlots, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
15
18
|
import "../styles/tree-list.css";
|
|
16
19
|
//#region src/TreeList/TreeListItem.vue
|
|
17
20
|
const _hoisted_1$1 = [
|
|
@@ -90,7 +93,7 @@ const _hoisted_21 = {
|
|
|
90
93
|
class: "astryx-tree-list__group",
|
|
91
94
|
role: "group"
|
|
92
95
|
};
|
|
93
|
-
const branchMargin = "calc(var(--astryx-spacing-2, 8px) + var(--astryx-spacing-
|
|
96
|
+
const branchMargin = "calc(var(--astryx-spacing-2, 8px) + var(--astryx-spacing-4, 16px) / 2 - var(--astryx-spacing-5, 20px) / 2)";
|
|
94
97
|
const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
95
98
|
name: "AstryxTreeListItem",
|
|
96
99
|
__name: "TreeListItem",
|
|
@@ -134,6 +137,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
134
137
|
const reservesChevron = computed(() => !hasChildren.value && props.hasExpandableItems);
|
|
135
138
|
const indent = computed(() => reservesChevron.value ? `calc(${props.nestedLevel} * var(--tree-list-indent) + var(--astryx-spacing-4, 16px) + var(--astryx-spacing-2, 8px))` : `calc(${props.nestedLevel} * var(--tree-list-indent))`);
|
|
136
139
|
const childAncestors = computed(() => [...props.ancestorsIsLast, props.isLast]);
|
|
140
|
+
/** 引导线列的起点:以 16px 箭头的中心为中线,让 20px 的列居中,再加上行 8px 的内边距。 */
|
|
137
141
|
function branchOffset(level) {
|
|
138
142
|
return `calc(${branchMargin} + ${level} * var(--tree-list-indent))`;
|
|
139
143
|
}
|
|
@@ -159,6 +163,7 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
159
163
|
if (props.item.isDisabled) event.preventDefault();
|
|
160
164
|
consumeWhileDisabled(event, props.item.isDisabled === true);
|
|
161
165
|
}
|
|
166
|
+
const ThemeDisclosure = useIndicator("tree-disclosure");
|
|
162
167
|
const press = usePressFeedback({ isContainer: true });
|
|
163
168
|
/** 整行点下去是展开收起(没有自己的点击):这时箭头按钮做的是同一件事,按它也算按这一行。 */
|
|
164
169
|
const chevronPress = computed(() => props.item.onClick == null ? press.pressActionProps : {});
|
|
@@ -222,11 +227,15 @@ const _sfc_main$1 = /*@__PURE__*/ defineComponent({
|
|
|
222
227
|
}, chevronPress.value, {
|
|
223
228
|
onClick: onToggle,
|
|
224
229
|
onKeydown: _cache[0] || (_cache[0] = ($event) => unref(consumeWhileDisabled)($event, __props.item.isDisabled === true))
|
|
225
|
-
}), [
|
|
230
|
+
}), [unref(ThemeDisclosure) ? (openBlock(), createBlock(resolveDynamicComponent(unref(ThemeDisclosure)), {
|
|
231
|
+
key: 0,
|
|
232
|
+
state: isExpanded.value ? "expanded" : "collapsed"
|
|
233
|
+
}, null, 8, ["state"])) : (openBlock(), createBlock(_sfc_main$2, {
|
|
234
|
+
key: 1,
|
|
226
235
|
icon: "chevronRight",
|
|
227
236
|
size: "sm",
|
|
228
237
|
color: "inherit"
|
|
229
|
-
})], 16, _hoisted_6)) : createCommentVNode("v-if", true),
|
|
238
|
+
}))], 16, _hoisted_6)) : createCommentVNode("v-if", true),
|
|
230
239
|
__props.item.startContent ? (openBlock(), createElementBlock("span", _hoisted_7, [(openBlock(), createBlock(resolveDynamicComponent(__props.item.startContent)))])) : __props.item.icon ? (openBlock(), createElementBlock("span", _hoisted_8, [unref(isIconGlyph)(__props.item.icon) ? (openBlock(), createBlock(_sfc_main$2, {
|
|
231
240
|
key: 0,
|
|
232
241
|
icon: __props.item.icon,
|
|
@@ -536,6 +545,32 @@ function useTreeFocus(options) {
|
|
|
536
545
|
};
|
|
537
546
|
}
|
|
538
547
|
//#endregion
|
|
548
|
+
//#region src/TreeList/clipWhileMoving.ts
|
|
549
|
+
/**
|
|
550
|
+
* @file clipWhileMoving.ts
|
|
551
|
+
* @position TreeList 内部:自己带动效的树(触屏下没有传入句柄)在行滑动时把下沿裁住。
|
|
552
|
+
*
|
|
553
|
+
* 往上滑进更短的树的行只在树的范围里显示,不会盖到树后面的内容上。
|
|
554
|
+
* 只裁下沿,且留出行焦点环的距离。
|
|
555
|
+
*/
|
|
556
|
+
const MOVING_CLIP = "inset(-100vmax -100vmax calc(-1 * (var(--astryx-focus-outline-width, 2px) + var(--astryx-focus-outline-offset, 3px))) -100vmax)";
|
|
557
|
+
const generations = /* @__PURE__ */ new WeakMap();
|
|
558
|
+
/** 树里有有限时长的动画在播时裁住树,直到它们全部结束。 */
|
|
559
|
+
function clipWhileMoving(tree) {
|
|
560
|
+
if (typeof tree.getAnimations !== "function") return;
|
|
561
|
+
const moving = tree.getAnimations({ subtree: true }).filter((animation) => animation.playState === "running" && Number.isFinite(animation.effect?.getComputedTiming().endTime ?? Infinity));
|
|
562
|
+
if (moving.length === 0) return;
|
|
563
|
+
const generation = (generations.get(tree) ?? 0) + 1;
|
|
564
|
+
generations.set(tree, generation);
|
|
565
|
+
tree.style.setProperty("clip-path", MOVING_CLIP);
|
|
566
|
+
Promise.allSettled(moving.map(async (animation) => animation.finished)).then(() => {
|
|
567
|
+
if (generations.get(tree) === generation) {
|
|
568
|
+
generations.delete(tree);
|
|
569
|
+
tree.style.removeProperty("clip-path");
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
//#endregion
|
|
539
574
|
//#region src/TreeList/useTreeLayoutMotion.ts
|
|
540
575
|
const CHEVRON = "[data-tree-toggle] > .astryx-icon";
|
|
541
576
|
function sameIds(a, b) {
|
|
@@ -609,6 +644,8 @@ function useTreeLayoutMotion(options) {
|
|
|
609
644
|
};
|
|
610
645
|
if (!(isMeasured && group != null && holdLayoutExit(handle, group, endAll))) endAll();
|
|
611
646
|
}
|
|
647
|
+
const tree = options.tree();
|
|
648
|
+
if (changes.length > 0 && tree != null && options.shouldClip?.() === true) clipWhileMoving(tree);
|
|
612
649
|
}, { flush: "post" });
|
|
613
650
|
function clearChevronsWithoutHandle() {
|
|
614
651
|
if (options.animatedLayout() != null) return;
|
|
@@ -737,8 +774,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
737
774
|
return false;
|
|
738
775
|
}
|
|
739
776
|
});
|
|
777
|
+
const isTouch = useCoarsePointer();
|
|
778
|
+
const ownLayout = useAnimatedLayout({ containerRef: () => treeRef.value });
|
|
779
|
+
const layout = computed(() => props.animatedLayout ?? (isTouch.value ? ownLayout : void 0));
|
|
740
780
|
const { exitingIds } = useTreeLayoutMotion({
|
|
741
|
-
animatedLayout: () =>
|
|
781
|
+
animatedLayout: () => layout.value,
|
|
782
|
+
shouldClip: () => layout.value === ownLayout,
|
|
742
783
|
expandedIds: () => expandedIds.value,
|
|
743
784
|
tree: () => treeRef.value ?? null
|
|
744
785
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { b as
|
|
1
|
+
import { C as REDUCED_TRANSITION, E as SAMPLE_TOLERANCE, S as PROPERTIES, T as SAMPLE_GRID_MS, _ as END_RECHECK_MS, a as expandList, b as MAX_DURATION_MS, c as isIdentityText, d as round, f as sameShown, g as END_HOLD_MS, h as DECAY_PROPERTIES, i as expand, l as motionNow, m as CHANNEL_OF, n as defaultIsCoarsePointer, o as format, p as CHANNELS, r as defaultPrefersReducedMotion, s as inlineText, t as resolveMotion, u as registerCustomProperty, v as IDENTITY, y as IDENTITY_TEXT } from "./resolveMotion-CurhYTVC.js";
|
|
2
2
|
import { t as quietFinished } from "./quietFinished-CKZXgsPM.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as registerReducedMotionCrossFade, r as themeReducesMotion, t as reducedMotionCrossFade } from "./timing-CSHWQbTJ.js";
|
|
4
|
+
import { l as writePresentedResolve, o as registerPresentedOffset, r as clearPresentedResolve, t as cubicBezier } from "./bezier-Df-yGuNZ.js";
|
|
4
5
|
import { n as isDevBuild } from "./devBuild-G249YcdZ.js";
|
|
5
6
|
import { t as devWarn } from "./useDevWarning-B2fsk2B-.js";
|
|
6
7
|
//#region src/motion/springParameters.ts
|
|
@@ -172,220 +173,6 @@ function solveSpring(spring, { from, to, velocity: initialVelocity = 0 }) {
|
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
//#endregion
|
|
175
|
-
//#region src/motion/engine/constants.ts
|
|
176
|
-
const PROPERTIES = [
|
|
177
|
-
"x",
|
|
178
|
-
"y",
|
|
179
|
-
"rotate",
|
|
180
|
-
"scaleX",
|
|
181
|
-
"scaleY",
|
|
182
|
-
"opacity"
|
|
183
|
-
];
|
|
184
|
-
/** The axes momentum moves: `decay` takes only these (DR2, DEC-2). */
|
|
185
|
-
const DECAY_PROPERTIES = ["x", "y"];
|
|
186
|
-
const IDENTITY = {
|
|
187
|
-
x: 0,
|
|
188
|
-
y: 0,
|
|
189
|
-
rotate: 0,
|
|
190
|
-
scaleX: 1,
|
|
191
|
-
scaleY: 1,
|
|
192
|
-
opacity: 1
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Keyframes are added until linear interpolation is within this: a quarter of
|
|
196
|
-
* a device pixel (this quarter of a CSS pixel, divided by the device pixel
|
|
197
|
-
* ratio where it is above 1), a twentieth of a degree, a 2000th of the size,
|
|
198
|
-
* about one step of an 8-bit alpha. Every one is below what a moving element
|
|
199
|
-
* can show.
|
|
200
|
-
*/
|
|
201
|
-
const SAMPLE_TOLERANCE = {
|
|
202
|
-
x: .25,
|
|
203
|
-
y: .25,
|
|
204
|
-
rotate: .05,
|
|
205
|
-
scaleX: 5e-4,
|
|
206
|
-
scaleY: 5e-4,
|
|
207
|
-
opacity: .004
|
|
208
|
-
};
|
|
209
|
-
/** Keyframes start on this grid (ms) and are split where the curve needs it. */
|
|
210
|
-
const SAMPLE_GRID_MS = 1e3 / 30;
|
|
211
|
-
/** A curve that has not settled by then (an undamped spring) snaps. */
|
|
212
|
-
const MAX_DURATION_MS = 3e4;
|
|
213
|
-
/**
|
|
214
|
-
* The keyframes hold the end state this long after a curve ends. An engine
|
|
215
|
-
* whose compositor ends an animation while the main thread is blocked falls
|
|
216
|
-
* back to the value its main thread last committed, the curve's start
|
|
217
|
-
* (WebKit on Linux); the hold keeps the end state on screen through any such
|
|
218
|
-
* block. It only stretches the last keyframe. The main thread retires the
|
|
219
|
-
* animation as soon as it runs after the curve's end.
|
|
220
|
-
*
|
|
221
|
-
* Why a tail inside the curve's own animation, with a bound (measured Oct 24
|
|
222
|
-
* 2026; do not replace it without these proofs):
|
|
223
|
-
* - WebKit on Linux (WebKitGTK and WPE) ignores `fill` on its compositor:
|
|
224
|
-
* a 400 ms move that ends during a 1 s main-thread block snaps back to the
|
|
225
|
-
* block-start position 13 ms after its end, with `fill: forwards` or with
|
|
226
|
-
* no fill, and holds with this tail. iOS 26.2 Mobile Safari holds the end
|
|
227
|
-
* in all three forms, so there the tail is unneeded but harmless (measured
|
|
228
|
-
* Oct 25 2026). The browser proof "a spring that ends inside the block
|
|
229
|
-
* keeps showing its end state" catches it.
|
|
230
|
-
* - A separate static animation of the end state under the curve would hold
|
|
231
|
-
* it without a bound, but two animations on one property push Chromium to
|
|
232
|
-
* run the curve on the main thread: the 1 s block proof moved in 0 of 57
|
|
233
|
-
* frames, the start-before-a-block proof failed, and seeking the curve
|
|
234
|
-
* broke.
|
|
235
|
-
*/
|
|
236
|
-
const END_HOLD_MS = 6e4;
|
|
237
|
-
/**
|
|
238
|
-
* The soonest a running animation's end is looked for again, ms: a frame at
|
|
239
|
-
* 60 Hz. WebKit moves an animation's currentTime once per frame, so a look
|
|
240
|
-
* within a frame reads the frame's time, a fraction of a ms short of the end,
|
|
241
|
-
* and a timer for that fraction would fire again before anything moved.
|
|
242
|
-
*/
|
|
243
|
-
const END_RECHECK_MS = 1e3 / 60;
|
|
244
|
-
const CHANNELS = {
|
|
245
|
-
translate: ["x", "y"],
|
|
246
|
-
rotate: ["rotate"],
|
|
247
|
-
scale: ["scaleX", "scaleY"],
|
|
248
|
-
opacity: ["opacity"]
|
|
249
|
-
};
|
|
250
|
-
const CHANNEL_OF = {
|
|
251
|
-
x: "translate",
|
|
252
|
-
y: "translate",
|
|
253
|
-
rotate: "rotate",
|
|
254
|
-
scaleX: "scale",
|
|
255
|
-
scaleY: "scale",
|
|
256
|
-
opacity: "opacity"
|
|
257
|
-
};
|
|
258
|
-
/** What `inlineText` writes for each channel at identity. */
|
|
259
|
-
const IDENTITY_TEXT = {
|
|
260
|
-
translate: "none",
|
|
261
|
-
rotate: "none",
|
|
262
|
-
scale: "none",
|
|
263
|
-
opacity: "1"
|
|
264
|
-
};
|
|
265
|
-
/**
|
|
266
|
-
* The transition `decay` hands a Reduce Motion transition curve to: under
|
|
267
|
-
* Reduce Motion `animate` plays no spring (a cross-fade, or at once), so the
|
|
268
|
-
* spring itself is never solved.
|
|
269
|
-
*/
|
|
270
|
-
const REDUCED_TRANSITION = { spring: {
|
|
271
|
-
duration: .5,
|
|
272
|
-
bounce: 0
|
|
273
|
-
} };
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region src/motion/engine/cssValues.ts
|
|
276
|
-
function round(value, digits) {
|
|
277
|
-
return Number(value.toFixed(digits));
|
|
278
|
-
}
|
|
279
|
-
function format(channel, value) {
|
|
280
|
-
switch (channel) {
|
|
281
|
-
case "translate": return `${round(value("x"), 3)}px ${round(value("y"), 3)}px`;
|
|
282
|
-
case "rotate": return `${round(value("rotate"), 4)}deg`;
|
|
283
|
-
case "scale": return `${round(value("scaleX"), 5)} ${round(value("scaleY"), 5)}`;
|
|
284
|
-
case "opacity": return `${round(Math.min(1, Math.max(0, value("opacity"))), 4)}`;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Whether a computed value shows `expected` (`format`'s text). An unset or
|
|
289
|
-
* `none` value is the channel's identity. One value of a two-value channel
|
|
290
|
-
* stands for both (scale), or for x with y at 0 (translate).
|
|
291
|
-
*/
|
|
292
|
-
function sameShown(channel, shown, expected) {
|
|
293
|
-
const numbers = (text) => {
|
|
294
|
-
const list = ((text === "" || text === "none" ? IDENTITY_TEXT[channel] : text).match(/-?\d*\.?\d+(?:e-?\d+)?/g) ?? []).map(Number);
|
|
295
|
-
if (channel === "translate") return [list[0] ?? 0, list[1] ?? 0];
|
|
296
|
-
if (channel === "scale") return [list[0] ?? 1, list[1] ?? list[0] ?? 1];
|
|
297
|
-
return list.length > 0 ? list : [channel === "opacity" ? 1 : 0];
|
|
298
|
-
};
|
|
299
|
-
const a = numbers(shown);
|
|
300
|
-
const b = numbers(expected);
|
|
301
|
-
return a.length === b.length && a.every((value, i) => Math.abs(value - b[i]) < .001);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* The inline text for a channel: `format`, except that an identity transform
|
|
305
|
-
* is written `none`. Any other value, `translate: 0px 0px` included, makes
|
|
306
|
-
* the element the containing block of its `position: fixed` descendants and
|
|
307
|
-
* a stacking context, so a motion back to identity would leave a fixed child
|
|
308
|
-
* moved with its parent; Mobile Safari also lets no finger scroll a list
|
|
309
|
-
* inside an element left at `scale: 1`. At rest the identity leaves the
|
|
310
|
-
* element entirely when its stylesheet agrees (`releaseIdentity`).
|
|
311
|
-
*/
|
|
312
|
-
function inlineText(channel, value) {
|
|
313
|
-
const at = (property, identity, digits) => round(value(property), digits) === identity;
|
|
314
|
-
switch (channel) {
|
|
315
|
-
case "translate": return at("x", 0, 3) && at("y", 0, 3) ? "none" : format(channel, value);
|
|
316
|
-
case "rotate": return at("rotate", 0, 4) ? "none" : format(channel, value);
|
|
317
|
-
case "scale": return at("scaleX", 1, 5) && at("scaleY", 1, 5) ? "none" : format(channel, value);
|
|
318
|
-
case "opacity": return format(channel, value);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
/** Whether a computed value (or an unset one) is the channel's identity. */
|
|
322
|
-
function isIdentityText(channel, text) {
|
|
323
|
-
const value = text.trim();
|
|
324
|
-
if (value === "" || value === "none") return true;
|
|
325
|
-
const numbers = value.split(/\s+/).map((part) => Number.parseFloat(part));
|
|
326
|
-
if (numbers.some((number) => !Number.isFinite(number))) return false;
|
|
327
|
-
const identity = channel === "scale" || channel === "opacity" ? 1 : 0;
|
|
328
|
-
return numbers.every((number) => Math.abs(number - identity) < 1e-6);
|
|
329
|
-
}
|
|
330
|
-
function expand(values) {
|
|
331
|
-
const out = {};
|
|
332
|
-
for (const [key, value] of Object.entries(values)) {
|
|
333
|
-
if (value == null || !Number.isFinite(value)) continue;
|
|
334
|
-
if (key === "scale") {
|
|
335
|
-
out.scaleX ??= value;
|
|
336
|
-
out.scaleY ??= value;
|
|
337
|
-
} else if (PROPERTIES.includes(key)) out[key] = value;
|
|
338
|
-
}
|
|
339
|
-
return out;
|
|
340
|
-
}
|
|
341
|
-
/** The time the motion clock reads (`performance.now()`'s time base). */
|
|
342
|
-
function motionNow() {
|
|
343
|
-
return typeof performance === "undefined" ? Date.now() : performance.now();
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Whether the user asked for reduced motion (`prefers-reduced-motion:
|
|
347
|
-
* reduce`), read at the moment of the call: the preference the animator uses
|
|
348
|
-
* by default for its Reduce Motion substitution. A component never reads it
|
|
349
|
-
* to pick a curve of its own: its motion settings do not override the
|
|
350
|
-
* policy (design:reduced-motion DR4); `animator.reducedMotion()` or
|
|
351
|
-
* `reducedMotionFade()` gives the policy's answer. False without a window
|
|
352
|
-
* (server rendering).
|
|
353
|
-
*/
|
|
354
|
-
function defaultPrefersReducedMotion() {
|
|
355
|
-
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
356
|
-
}
|
|
357
|
-
/** Whether the primary pointer is coarse: `(pointer: coarse)`. */
|
|
358
|
-
function defaultIsCoarsePointer() {
|
|
359
|
-
return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: coarse)").matches;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Registers `name` as an inherited `<length>` (initially 0px) or `<number>`
|
|
363
|
-
* (initially 0) so keyframes interpolate it; an unregistered custom property
|
|
364
|
-
* animates in steps. A property the page already registered is left as it
|
|
365
|
-
* is.
|
|
366
|
-
*/
|
|
367
|
-
function registerCustomProperty(name, syntax) {
|
|
368
|
-
if (typeof CSS === "undefined" || typeof CSS.registerProperty !== "function") return;
|
|
369
|
-
try {
|
|
370
|
-
CSS.registerProperty({
|
|
371
|
-
name,
|
|
372
|
-
syntax,
|
|
373
|
-
inherits: true,
|
|
374
|
-
initialValue: syntax === "<length>" ? "0px" : "0"
|
|
375
|
-
});
|
|
376
|
-
} catch (error) {
|
|
377
|
-
if (!(error instanceof DOMException) || error.name !== "InvalidModificationError") throw error;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
function expandList(properties) {
|
|
381
|
-
const out = /* @__PURE__ */ new Set();
|
|
382
|
-
for (const property of properties) if (property === "scale") {
|
|
383
|
-
out.add("scaleX");
|
|
384
|
-
out.add("scaleY");
|
|
385
|
-
} else out.add(property);
|
|
386
|
-
return [...out];
|
|
387
|
-
}
|
|
388
|
-
//#endregion
|
|
389
176
|
//#region src/motion/engine/taskClock.ts
|
|
390
177
|
/** The task the current calls from rest are made in, until it ends. */
|
|
391
178
|
let openTask = null;
|
|
@@ -2440,89 +2227,6 @@ function installSampling(engine) {
|
|
|
2440
2227
|
};
|
|
2441
2228
|
}
|
|
2442
2229
|
//#endregion
|
|
2443
|
-
//#region src/motion/themeTempo.ts
|
|
2444
|
-
/**
|
|
2445
|
-
* @file themeTempo.ts
|
|
2446
|
-
* @input An element on the page
|
|
2447
|
-
* @output `themeTempo(element)`: the tempo of the theme the element is in
|
|
2448
|
-
* @position Motion foundation; resolveMotion.ts scales a motion role by it,
|
|
2449
|
-
* and the pager scales its settle by it, which no role names
|
|
2450
|
-
*
|
|
2451
|
-
* A theme that sets `tempo` writes it, clamped, to the private custom
|
|
2452
|
-
* property `--_astryx-motion-tempo` beside its duration tokens. An
|
|
2453
|
-
* adaptation rule writes it where its condition holds, and a nested theme
|
|
2454
|
-
* that sets no tempo inherits it. A layer whose durations come from a
|
|
2455
|
-
* duration scale writes a tempo of 1, so its springs keep its own pace. One
|
|
2456
|
-
* read of a custom property forces no layout.
|
|
2457
|
-
* Nothing here imports a theme module, runs on import or runs on the server.
|
|
2458
|
-
*/
|
|
2459
|
-
/** The property a theme that sets `tempo` writes (theme/themeMotion.ts). */
|
|
2460
|
-
const TEMPO_PROPERTY = "--_astryx-motion-tempo";
|
|
2461
|
-
/**
|
|
2462
|
-
* The tempo motion on `element` plays at: the one its theme or an adaptation
|
|
2463
|
-
* rule sets, else 1. Without an element in a document, or with a value that
|
|
2464
|
-
* is not a positive number, it is 1.
|
|
2465
|
-
*/
|
|
2466
|
-
function themeTempo(element) {
|
|
2467
|
-
const view = element?.ownerDocument?.defaultView;
|
|
2468
|
-
if (element == null || view == null) return 1;
|
|
2469
|
-
const text = view.getComputedStyle(element).getPropertyValue(TEMPO_PROPERTY).trim();
|
|
2470
|
-
const tempo = text === "" ? NaN : Number(text);
|
|
2471
|
-
return Number.isFinite(tempo) && tempo > 0 ? tempo : 1;
|
|
2472
|
-
}
|
|
2473
|
-
//#endregion
|
|
2474
|
-
//#region src/motion/resolveMotion.ts
|
|
2475
|
-
/**
|
|
2476
|
-
* The roles the tempo leaves as measured: the parts that follow a finger,
|
|
2477
|
-
* and ProgressBar's busy loop.
|
|
2478
|
-
*/
|
|
2479
|
-
const FIXED_ROLES = /* @__PURE__ */ new Set([
|
|
2480
|
-
"springs.fingerTracking",
|
|
2481
|
-
"switchControl.tracking",
|
|
2482
|
-
"progress.reducedMotionPulseMs"
|
|
2483
|
-
]);
|
|
2484
|
-
/** Each role spring at each tempo, so a role resolves to one object per tempo. */
|
|
2485
|
-
const springsAtTempo = /* @__PURE__ */ new WeakMap();
|
|
2486
|
-
/**
|
|
2487
|
-
* `spring` at `tempo`. In each of its forms, the undamped period grows by the
|
|
2488
|
-
* tempo and the damping ratio stays. So the motion keeps its shape and takes
|
|
2489
|
-
* `tempo` times as long.
|
|
2490
|
-
*/
|
|
2491
|
-
function springAtTempo(spring, tempo) {
|
|
2492
|
-
let byTempo = springsAtTempo.get(spring);
|
|
2493
|
-
if (byTempo == null) {
|
|
2494
|
-
byTempo = /* @__PURE__ */ new Map();
|
|
2495
|
-
springsAtTempo.set(spring, byTempo);
|
|
2496
|
-
}
|
|
2497
|
-
let scaled = byTempo.get(tempo);
|
|
2498
|
-
if (scaled == null) {
|
|
2499
|
-
if ("response" in spring) scaled = {
|
|
2500
|
-
response: spring.response * tempo,
|
|
2501
|
-
dampingRatio: spring.dampingRatio
|
|
2502
|
-
};
|
|
2503
|
-
else if ("duration" in spring) scaled = {
|
|
2504
|
-
duration: spring.duration * tempo,
|
|
2505
|
-
bounce: spring.bounce
|
|
2506
|
-
};
|
|
2507
|
-
else scaled = {
|
|
2508
|
-
...spring.mass == null ? null : { mass: spring.mass },
|
|
2509
|
-
stiffness: spring.stiffness / (tempo * tempo),
|
|
2510
|
-
damping: spring.damping / tempo
|
|
2511
|
-
};
|
|
2512
|
-
byTempo.set(tempo, scaled);
|
|
2513
|
-
}
|
|
2514
|
-
return scaled;
|
|
2515
|
-
}
|
|
2516
|
-
function resolveMotion(element, leafOrGroup, key) {
|
|
2517
|
-
const value = key === void 0 ? leafOrGroup : leafOrGroup[key];
|
|
2518
|
-
const role = key === void 0 ? motionRoleOf(leafOrGroup) : motionRoleIn(leafOrGroup, key);
|
|
2519
|
-
if (role == null || role.kind === "curve" || FIXED_ROLES.has(role.id)) return value;
|
|
2520
|
-
const tempo = themeTempo(element);
|
|
2521
|
-
if (tempo === 1) return value;
|
|
2522
|
-
if (typeof value === "number") return value * tempo;
|
|
2523
|
-
return isSpring(value) ? springAtTempo(value, tempo) : value;
|
|
2524
|
-
}
|
|
2525
|
-
//#endregion
|
|
2526
2230
|
//#region src/motion/engine/segments.ts
|
|
2527
2231
|
function installSegments(engine) {
|
|
2528
2232
|
engine.springSegment = (owner, property, start, to, spring, velocity) => engine.springFrom(owner, property, start, engine.valueAt(property, start), velocity, to, resolveMotion(engine.target, spring));
|
|
@@ -3161,4 +2865,4 @@ function createMotionEngine(element, options = {}) {
|
|
|
3161
2865
|
return engine.animator;
|
|
3162
2866
|
}
|
|
3163
2867
|
//#endregion
|
|
3164
|
-
export {
|
|
2868
|
+
export { toSpring as i, SETTLE_THRESHOLD as n, solveSpring as r, createMotionEngine as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { c as sharedState, l as sharedWeakMap, s as sharedMap, u as sharedWeakSet } from "./inputStream-LZdK8luP.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { r as themeReducesMotion, t as reducedMotionCrossFade } from "./timing-CSHWQbTJ.js";
|
|
3
|
+
import { l as writePresentedResolve, n as batchPresented, o as registerPresentedOffset, r as clearPresentedResolve } from "./bezier-Df-yGuNZ.js";
|
|
4
|
+
import { r as readThemeTokenText, t as readThemeTiming } from "./themeTiming-BFDOPRjK.js";
|
|
4
5
|
//#region src/motion/linearEasing.ts
|
|
5
6
|
/**
|
|
6
7
|
* @file linearEasing.ts
|
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import { r as parentAcrossShadow, s as isElement } from "./flatTree-BB4yPMNL.js";
|
|
2
2
|
import { a as realmValue, o as sharedKey } from "./inputStream-LZdK8luP.js";
|
|
3
|
-
import { v as registerMotionTable } from "./pressGesture-BzIBmKF2.js";
|
|
4
|
-
//#region src/motion/reducedMotionMark.ts
|
|
5
|
-
/**
|
|
6
|
-
* @file reducedMotionMark.ts
|
|
7
|
-
* @input Whether a theme reduces motion for everyone
|
|
8
|
-
* @output reducedMotionMarkProps and setRootReducedMotionMark, which write the
|
|
9
|
-
* mark, and themeReducesMotion, which reads it
|
|
10
|
-
* @position Owner module of the private reduced-motion attribute: the only
|
|
11
|
-
* file that writes its name. A theme that reduces motion for everyone
|
|
12
|
-
* spreads the mark on its root, and the root theme sets it on `<html>`; the
|
|
13
|
-
* animator and reducedMotionFade read it as the person's Reduce Motion
|
|
14
|
-
* setting. No package entry exports it.
|
|
15
|
-
*/
|
|
16
|
-
const REDUCED_MOTION = "data-astryx-reduced-motion";
|
|
17
|
-
/**
|
|
18
|
-
* Whether the theme `element` is in reduces motion for everyone: its root,
|
|
19
|
-
* or `<html>` for the root theme, carries the mark.
|
|
20
|
-
*/
|
|
21
|
-
function themeReducesMotion(element) {
|
|
22
|
-
return element?.closest?.(`[${REDUCED_MOTION}]`) != null;
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
3
|
//#region src/motion/presentation.ts
|
|
26
4
|
/**
|
|
27
5
|
* @file presentation.ts
|
|
@@ -173,73 +151,6 @@ function resolvePresented(elements) {
|
|
|
173
151
|
for (const element of elements) sources.get(element)?.resolve();
|
|
174
152
|
}
|
|
175
153
|
//#endregion
|
|
176
|
-
//#region src/motion/uikit/timing.ts
|
|
177
|
-
/**
|
|
178
|
-
* @file timing.ts
|
|
179
|
-
* @input Nothing; data only
|
|
180
|
-
* @output Exports `timing`: the non-spring clocks and curves UIKit uses
|
|
181
|
-
* (press highlight onset, flash and fade, Core Animation's named Bézier
|
|
182
|
-
* curves, the navigation bar hide/show duration, the keyboard
|
|
183
|
-
* notification duration, the Reduced Motion cross-fade)
|
|
184
|
-
* @position The timing domain of the UIKit constants table (motion/uikit)
|
|
185
|
-
*
|
|
186
|
-
* Every leaf carries one or more `@source` (apple-docs | wwdc | webkit |
|
|
187
|
-
* measured | GUESS); webkit and GUESS values also carry the `@measure` task
|
|
188
|
-
* that will confirm or replace them (MEASUREMENTS.md). uikit.test.ts
|
|
189
|
-
* enforces both.
|
|
190
|
-
*
|
|
191
|
-
* Durations are in ms (the unit of pointer-event timestamps, which these
|
|
192
|
-
* clocks are compared against); curves are cubic-bézier control points
|
|
193
|
-
* [x1, y1, x2, y2].
|
|
194
|
-
*/
|
|
195
|
-
/**
|
|
196
|
-
* The Reduce Motion fade, its own export so the animator reads it without
|
|
197
|
-
* the rest of the table (`architecture:component-style-authoring` INV6).
|
|
198
|
-
* `timing` composes it under its table paths, `reducedMotionCrossFadeMs` and
|
|
199
|
-
* `curves.move`, so their roles are unchanged.
|
|
200
|
-
*/
|
|
201
|
-
const reducedMotionCrossFade = {
|
|
202
|
-
/**
|
|
203
|
-
* The Reduced Motion cross-fade, in ms, on `curves.move`: under
|
|
204
|
-
* Reduce Motion an entrance, exit, presentation switch or state change
|
|
205
|
-
* becomes an opacity-only cross-fade of this length on a coarse pointer
|
|
206
|
-
* (design:reduced-motion DR2 caps it at 200 ms, by owner decision DEC-1
|
|
207
|
-
* of 2026-10-24, departing from UIKit's own navigation cross-fade,
|
|
208
|
-
* measured below at 0.5 s). Not a role: nothing lengthens it (DR4).
|
|
209
|
-
* @source apple-docs https://developer.apple.com/documentation/uikit/uiaccessibility/preferscrossfadetransitions
|
|
210
|
-
* (the setting)
|
|
211
|
-
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
212
|
-
* iPhone 17 Pro, CAAnimation dump with Reduce Motion and Prefer
|
|
213
|
-
* Cross-Fade Transitions on (opacity CABasicAnimation 0.5 s,
|
|
214
|
-
* (0.42, 0, 0.58, 1)), Oct 23 2026
|
|
215
|
-
*/
|
|
216
|
-
durationMs: 200,
|
|
217
|
-
/**
|
|
218
|
-
* `easeInEaseOut`; UIKit's default curve (`UIView.AnimationCurve
|
|
219
|
-
* .easeInOut`, "the default curve for most animations").
|
|
220
|
-
* @source apple-docs https://developer.apple.com/documentation/quartzcore/camediatimingfunctionname/easeineaseout
|
|
221
|
-
* @source measured: UIKit lab (injected host app), iOS 26.2 simulator,
|
|
222
|
-
* iPhone 17 Pro, CAMediaTimingFunction read from UIView.animate,
|
|
223
|
-
* Oct 23 2026
|
|
224
|
-
*/
|
|
225
|
-
curve: [
|
|
226
|
-
.42,
|
|
227
|
-
0,
|
|
228
|
-
.58,
|
|
229
|
-
1
|
|
230
|
-
]
|
|
231
|
-
};
|
|
232
|
-
const { durationMs: reducedMotionCrossFadeMs, curve: move } = reducedMotionCrossFade;
|
|
233
|
-
const reducedMotionCrossFadeRoles = { curves: { move } };
|
|
234
|
-
/**
|
|
235
|
-
* Registers only the Reduce Motion fade's curve as its role,
|
|
236
|
-
* `timing.curves.move`, for code that reads the fade without the rest of the
|
|
237
|
-
* table (the animator, reducedMotionFade()). The fade's length is not a role.
|
|
238
|
-
*/
|
|
239
|
-
function registerReducedMotionCrossFade() {
|
|
240
|
-
registerMotionTable("timing", reducedMotionCrossFadeRoles, { roles: ["curves.move"] });
|
|
241
|
-
}
|
|
242
|
-
//#endregion
|
|
243
154
|
//#region src/motion/bezier.ts
|
|
244
155
|
/** The timing function for `points`: maps time progress to eased progress. */
|
|
245
156
|
function cubicBezier([x1, y1, x2, y2]) {
|
|
@@ -276,4 +187,4 @@ function cubicBezier([x1, y1, x2, y2]) {
|
|
|
276
187
|
return (x) => x <= 0 ? 0 : x >= 1 ? 1 : sampleY(solveT(x));
|
|
277
188
|
}
|
|
278
189
|
//#endregion
|
|
279
|
-
export {
|
|
190
|
+
export { presentedOffsetOf as a, watchPresentedElements as c, presentedElements as i, writePresentedResolve as l, batchPresented as n, registerPresentedOffset as o, clearPresentedResolve as r, resolvePresented as s, cubicBezier as t };
|
|
@@ -7,8 +7,9 @@ import { t as useCoarsePointer } from "../useCoarsePointer-GItEMrjX.js";
|
|
|
7
7
|
import { t as useMediaQuery } from "../useMediaQuery-BzXGT1Aw.js";
|
|
8
8
|
import { t as characterCount } from "../characters-wTnzjkkR.js";
|
|
9
9
|
import { n as useDevWarning, t as devWarn } from "../useDevWarning-B2fsk2B-.js";
|
|
10
|
-
import { _ as useAnimator, a as usePanGesture, b as
|
|
10
|
+
import { _ as useAnimator, a as usePanGesture, b as createAnimator, c as imageModeFromPixels, d as useGridRovingFocus, f as useGridFocus, g as useContainerReveal, h as useControllableState, i as useSnapPaging, l as perceptualLightness, m as useDragToSnapPoints, n as snapToGraphemeBoundary, o as useKeyboardHint, p as useEntryAnimation, r as useStreamingText, s as useIndicatorFocusRing, t as useTouchTrigger, u as useImageMode, v as createDragToSnapPoints, y as createPanGesture } from "../composables-BTRbNgmR.js";
|
|
11
11
|
import { t as useListFocus } from "../useListFocus-CkHfsZp0.js";
|
|
12
|
+
import { t as useAnimatedLayout } from "../useAnimatedLayout-DC2l3WrE.js";
|
|
12
13
|
import { t as useAnnounce } from "../announce-GU01Oix2.js";
|
|
13
14
|
import { n as useAppShellMobile, t as appShellMobileKey } from "../useAppShellMobile-DTsyuAJ4.js";
|
|
14
15
|
import { n as useAsyncSource, t as createStaticSource } from "../useAsyncSource-7GTcK8ep.js";
|
|
@@ -2,17 +2,17 @@ import { a as shadowRootsOutward, c as isHTMLElement, i as shadowHostOf, l as is
|
|
|
2
2
|
import { d as parseTouchAction, f as rootOverflow, l as SCROLLABLE_OVERFLOW, p as clockOf, u as isInsideScrollView } from "./pressFeedback-DVR5V1b6.js";
|
|
3
3
|
import { i as withoutClickGuard, n as disarmClickGuard, t as armClickGuard } from "./clickGuard-FrlnECMp.js";
|
|
4
4
|
import { a as realmValue, i as subscribeInput, l as sharedWeakMap, o as sharedKey } from "./inputStream-LZdK8luP.js";
|
|
5
|
-
import {
|
|
5
|
+
import { i as toSpring, n as SETTLE_THRESHOLD, r as solveSpring, t as createMotionEngine } from "./animator-BGq5a6vT.js";
|
|
6
6
|
import { c as UIKIT_PAN, d as UIKIT_VELOCITY, f as registerScrollTable, l as UIKIT_PRESS, p as scroll, s as UIKIT_LONG_PRESS, u as UIKIT_TAP, v as registerMotionTable, y as registerSpringRole } from "./pressGesture-BzIBmKF2.js";
|
|
7
7
|
import { o as pushLayer } from "./layerDepth-D3Rh8T5C.js";
|
|
8
8
|
import { t as useMediaQuery } from "./useMediaQuery-BzXGT1Aw.js";
|
|
9
|
-
import { l as
|
|
9
|
+
import { l as motionNow, t as resolveMotion } from "./resolveMotion-CurhYTVC.js";
|
|
10
|
+
import { a as presentedOffsetOf, c as watchPresentedElements, i as presentedElements, s as resolvePresented } from "./bezier-Df-yGuNZ.js";
|
|
10
11
|
import { t as devWarn } from "./useDevWarning-B2fsk2B-.js";
|
|
11
12
|
import { t as isApplePlatform } from "./isApplePlatform-B1ju6F5B.js";
|
|
12
13
|
import { a as isIosWebKit, r as watchCoarsePointer, t as isCoarsePointer } from "./coarsePointer-BfMx3H23.js";
|
|
13
14
|
import { n as isRtlElement } from "./useListFocus-CkHfsZp0.js";
|
|
14
15
|
import { t as holdsTouch } from "./touchHold-CFJlSClt.js";
|
|
15
|
-
import { n as createAnimatedLayout } from "./handle-BazRxHwq.js";
|
|
16
16
|
import { o as useComponentMessages } from "./context-B8IEFCDR.js";
|
|
17
17
|
import { t as _sfc_main$1 } from "./Kbd-CbD993ig.js";
|
|
18
18
|
import { t as keyboardHintMessages } from "./keyboard-hint-KWx0-7kD.js";
|
|
@@ -6900,43 +6900,6 @@ function createDragToSnapPoints(element, options) {
|
|
|
6900
6900
|
};
|
|
6901
6901
|
}
|
|
6902
6902
|
//#endregion
|
|
6903
|
-
//#region src/composables/useAnimatedLayout.ts
|
|
6904
|
-
function elementOf(value) {
|
|
6905
|
-
if (value == null) return null;
|
|
6906
|
-
if (typeof Element !== "undefined" && value instanceof Element) return value;
|
|
6907
|
-
const root = value.$el;
|
|
6908
|
-
return typeof Element !== "undefined" && root instanceof Element ? root : null;
|
|
6909
|
-
}
|
|
6910
|
-
/**
|
|
6911
|
-
* 返回一个句柄,交给尺寸会变的组件(例如 TreeList、Collapsible)。组件尺寸变化时,
|
|
6912
|
-
* 它和 `containerRef` 里排在它后面的内容按同一条动效一起滑到新位置。固定定位和吸住的
|
|
6913
|
-
* 粘性元素不动,滑动从不滚动容器,并遵从「减少动态效果」。
|
|
6914
|
-
*
|
|
6915
|
-
* 容器在变化发生时才读,所以句柄只创建一次,之后 ref 指向别的元素也能读到。
|
|
6916
|
-
* 句柄没有公开成员。服务端渲染时不碰 DOM。
|
|
6917
|
-
*
|
|
6918
|
-
* @example
|
|
6919
|
-
* ```vue
|
|
6920
|
-
* <script setup lang="ts">
|
|
6921
|
-
* import { useAnimatedLayout } from '@astryx-vue/core'
|
|
6922
|
-
* import { useTemplateRef } from 'vue'
|
|
6923
|
-
*
|
|
6924
|
-
* const container = useTemplateRef<HTMLElement>('container')
|
|
6925
|
-
* const animatedLayout = useAnimatedLayout({ containerRef: container })
|
|
6926
|
-
* <\/script>
|
|
6927
|
-
*
|
|
6928
|
-
* <template>
|
|
6929
|
-
* <div ref="container">
|
|
6930
|
-
* <TreeList :items="items" :animated-layout="animatedLayout" />
|
|
6931
|
-
* <p>备注</p>
|
|
6932
|
-
* </div>
|
|
6933
|
-
* </template>
|
|
6934
|
-
* ```
|
|
6935
|
-
*/
|
|
6936
|
-
function useAnimatedLayout({ containerRef }) {
|
|
6937
|
-
return createAnimatedLayout(() => elementOf(toValue(containerRef)));
|
|
6938
|
-
}
|
|
6939
|
-
//#endregion
|
|
6940
6903
|
//#region src/composables/useAnimator.ts
|
|
6941
6904
|
/**
|
|
6942
6905
|
* 用组件库自己的动效驱动 `target` 指向的元素。`target` 可以是模板 ref、
|
|
@@ -8653,4 +8616,4 @@ function useTouchTrigger(options) {
|
|
|
8653
8616
|
};
|
|
8654
8617
|
}
|
|
8655
8618
|
//#endregion
|
|
8656
|
-
export { useAnimator as _, usePanGesture as a,
|
|
8619
|
+
export { useAnimator as _, usePanGesture as a, createAnimator as b, imageModeFromPixels as c, useGridRovingFocus as d, useGridFocus as f, useContainerReveal as g, useControllableState as h, useSnapPaging as i, perceptualLightness as l, useDragToSnapPoints as m, snapToGraphemeBoundary as n, useKeyboardHint as o, useEntryAnimation as p, useStreamingText as r, useIndicatorFocusRing as s, useTouchTrigger as t, useImageMode as u, createDragToSnapPoints as v, createPanGesture as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as glides, _ as safeAnimate, d as layoutMotion, h as beginChange, m as sampleOver, p as sampleKeyframes, r as changeStartIn } from "./batch-
|
|
1
|
+
import { D as glides, _ as safeAnimate, d as layoutMotion, h as beginChange, m as sampleOver, p as sampleKeyframes, r as changeStartIn } from "./batch-BhaAWUIt.js";
|
|
2
2
|
import { r as readArea, t as areaOf } from "./handle-BazRxHwq.js";
|
|
3
3
|
import { c as paintedBackground, i as placeOver, n as isCopyable, o as visiblePartCopy, s as wrapText, t as inertCopy } from "./transientCopy-VAsg2a46.js";
|
|
4
4
|
import { computed, inject, ref } from "vue";
|