gesso-core 0.7.0 → 0.8.1

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/index.js CHANGED
@@ -1,81 +1,5 @@
1
- import { $ as UiPlatformAdapter, $a as UiNode, $i as themeExtension, $n as isVideoSurface, $r as pathValuesEqual, $t as textRunDecorations, A as formatNumber, Aa as hiddenRangesOf, Ai as propertyValuesEqual, An as isPressable, Ao as UiBinding, Ar as resolveString, At as paragraphGeometryFrom, B as MAX_MEASURES_PER_CHILD, Ba as lightColors, Bi as containerBands, Bn as CARET_BLINK_MS, Br as UiProperties, Bt as isPrintable, C as LayoutEngine, Ca as shapesEqual, Ci as borderRadiusCorners, Cn as selectionRangeOf, Co as UiTextChangeEvent, Cr as wordRangeAt, Ct as scrollbarThumbs, D as describeOverrides, Da as defaultTextStyle, Di as normalizeBorderRadius, Dn as isNodeInert, Do as wheelDeltaYOf, Dr as resolveNumber, Dt as hasDrawnText, E as describeLength, Ea as typographyEqual, Ei as borderRadiusValuesEqual, En as isNodeHitTestable, Eo as noKeyModifiers, Er as resolveBoolean, Et as UiInputDispatcher, F as LayoutRecord, Fa as textContentOf, Fi as insetsEqual, Fn as hasTextLinks, Fr as inheritedPropertyNames, Ft as comparePositions, G as sizeGridTracks, Ga as colorsEqual, Gi as withContrast, Gn as editorOf, Gr as normalizeStates, Gt as drawText, H as FlexDirection, Ha as colorToHex, Hi as darkTheme, Hn as EDITOR_PROP, Hr as UI_SEMANTIC_STATES, Ht as applyCanvasTextStyle, I as Constraints, Ia as textSpansEqual, Ii as noInsets, In as linkHoverOf, Ir as propertyEffects, It as edgeField, J as MainAxisAlignment, Ja as rgb8, Ji as lengths, Jn as isReadOnly, Jr as validateStates, Jt as runCanvasStyleInto, K as AlignContent, Ka as normalizeColor, Ki as withDensity, Kn as isEditableNode, Kr as statesEqual, Kt as fillTextRects, L as clampSize, La as textStylesEqual, Li as observeViewportInsets, Ln as linkOf, Lr as propertyIsInherited, Lt as editingGroupOf, M as withOverrideSource, Ma as spanAtOffset, Mi as withPointer, Mn as pointerEventsOf, Mr as findPropertyDefinition, Mt as wordRangeIn, N as accumulatedOffsetTo, Na as spannedTextOf, Ni as UiEnvironmentKeys, Nn as resolveCursor, Nr as getPropertyNames, Nt as textInputOf, O as formatConstraints, Oa as editableSpansOf, Oi as uniformBorderRadius, On as isNodeSelectable, Oo as UiNodeType, Or as resolveProperty, Ot as offsetAtPointIn, P as contentOffset, Pa as spansDifferOnlyInPaint, Pi as UiInsetRegistry, Pn as clearLinkHover, Pr as inheritedPropertyFlags, Pt as adjacentField, Q as CanvasPlatformSurface, Qa as UiEnvironment, Qi as noThemeExtensions, Qn as resolveColorValue, Qr as paintValuesEqual, Qt as textRunBackgrounds, R as constraintsEqual, Ra as colorsEqualPalette, Ri as UiContainerSizeSource, Rn as linkRunAtPointIn, Rr as propertyNarrowers, Rt as commandForKey, S as tracePathData, Sa as isShapeName, Si as borderRadius, Sn as selectableTextOf, So as UiSelectionChangeEvent, Sr as previousWordStart, St as scrollbarThumb, T as SCROLLBAR_LINGER_MS, Ta as isTypographyRole, Ti as borderRadiusIsZero, Tn as isNodeFocusable, To as UiWheelEvent, Tr as DEFAULT_LINE_HEIGHT_FACTOR, Tt as scrollsFromRight, U as parseFlexDirection, Ua as colorToRgba, Ui as lightTheme, Un as caretVisibleAt, Ur as isUiRole, Ut as buildFontString, V as isLayoutProtocol, Va as UiBasicColors, Vi as unknownContainerSize, Vn as CARET_WIDTH, Vr as UI_ROLES, Vt as EditableLayout, W as placeGridItems, Wa as colorValuesEqual, Wi as themesEqual, Wn as editorFor, Wr as isUiSemanticState, Wt as createCanvasTextStyle, X as parseCrossAxisAlignment, Xa as createEnvironmentKey, Xi as defineThemeExtension, Xn as nextCaretToggle, Xr as validateSubgrid, Xt as spanOf, Y as parseAlignContent, Ya as rgba, Yi as unitsEqual, Yn as maskText, Yr as UI_SUBGRID_AXES, Yt as runFontString, Z as parseMainAxisAlignment, Za as findEnvironmentKey, Zi as hasThemeExtension, Zn as syncEditorValue, Zr as inputsEqual, Zt as textMeasureRequest, _ as paintsAfterChildren, _a as boxShadowReach, _i as minmax, _n as matchRangesOf, _o as UiInputEvent, _r as lineEndAt, _t as SCROLLBAR_MIN_THUMB, a as layerRegion, aa as relativeLuminance, ai as MAX_GRADIENT_STOPS, an as DEFAULT_FONT_SIZE, ao as writeOverrideProperty, ar as layoutParagraph, at as UiEditingController, b as labelOrigin, ba as shadowsOf, bi as resolveLength, bn as clearSelectionRange, bo as UiPinchEvent, br as nextWordEnd, bt as scrollLeaderOf, c as paintPictures, ca as scaleSpacing, ci as linearGradient, cn as colorToCss, co as hasVisualState, cr as lineIndexAtY, ct as UiPinchRecognizer, d as PaintRecorder, da as defaultShadows, di as auto, dn as isPaintVisible, do as MOUSE_POINTER, dr as offsetAtPoint, dt as UiKeyboardController, ea as themeExtensionsEqual, ei as UiTransforms, en as bumpFontStack, eo as DirtyNodeSet, er as videoFrameSize, et as capturePointer, f as replayPaint, fa as shadowsEqual, fi as fr, fn as normalizeTextAlign, fo as UiBeforeInputEvent, fr as offsetAtX, ft as UiPointerController, g as hasDecorationPhase, ga as boxShadowRadius, gi as isPercentLength, gn as clearMatchRanges, go as UiGestureEvent, gr as graphemeBoundaries, gt as SCROLLBAR_INSET, h as decorationRect, ha as boxShadowArraysEqual, hi as isMinMaxTrack, hn as TEXT_MATCHES_PROP, ho as UiFocusEvent, hr as EditableTextModel, ht as SCROLLBAR_HOVER_ZONE, i as traceRoundedRect, ia as raiseContrast, ii as transformsEqual, in as DEFAULT_FONT_FAMILY, io as writeDeclaredProperty, ir as ELLIPSIS, it as touchActionFor, j as labelNode, ja as resolvedSpansOf, ji as TOUCH_TARGET, jn as isSubtreeInert, jr as closestPropertyName, jt as selectionRectsIn, k as formatExplanation, ka as flattenTextSpans, ki as defineProperty, kn as isNodeTabStop, ko as DirtyFlags, kr as resolvePropertyByName, kt as paragraphGeometry, l as PaintTarget, la as spacingEqual, li as radialGradient, ln as computeObjectFitRect, lo as visualState, lr as lineIndexForOffset, lt as UiWheelController, m as decorationColor, ma as boxShadow, mi as isFrLength, mn as resolvePaintState, mo as UiEventType, mr as selectionRects, mt as UiHitTester, n as createCanvasSurface, na as contrastRatio, ni as transform, nn as fontStackFor, no as overrideSources, nr as ParagraphTextMeasurer, nt as pointerDeviceOf, o as opacityNeedsLayer, oa as densityFactors, oi as gradientPaint, on as DEFAULT_FONT_WEIGHT, oo as UiVisualState, or as proportionalFontMetrics, ot as UiTouchScroller, p as ScaledImageCache, pa as BOX_SHADOW_BLUR_REACH, pi as isAutoLength, pn as normalizeVerticalAlign, po as UiCompositionEvent, pr as offsetForVerticalMove, pt as UiFocusManager, q as CrossAxisAlignment, qa as parseColor, qi as defaultUnits, qn as isMultiline, qr as validateRole, qt as layoutTextLines, r as Canvas2DRenderer, ra as highContrastColors, ri as transformIsIdentity, rn as registerFontStack, ro as resetOverrideWarnings, rr as spannedRunsFor, rt as prepareInputSurface, s as PaintPictureCache, sa as defaultSpacing, si as gradientsEqual, sn as DEFAULT_TEXT_COLOR, so as defaultVisualState, sr as caretRectFor, st as UiGestureRecognizer, t as CanvasSurface, ta as withThemeExtension, ti as parseTransform, tn as clearFontStacks, to as clearOverrideProperty, tr as CharacterCountTextMeasurer, tt as isImeKey, u as EMPTY_RECORDING, ua as spacingSteps, ui as validateGradient, un as createPaintState, uo as visualStatesEqual, ur as lineLimit, ut as isScrollContainer, v as LABEL_PADDING_X, va as boxShadowValuesEqual, vi as percent, vn as setMatchRanges, vo as UiKeyboardEvent, vr as lineStartAt, vt as SCROLLBAR_THICKNESS, w as SCROLLBAR_FADE_MS, wa as defaultTypography, wi as borderRadiusEqual, wn as setSelectionRange, wo as UiWheelDeltaMode, wr as UiGraph, wt as scrollbarZoneAt, x as snapScroll, xa as defaultShapes, xi as UiBorderRadiuses, xn as selectableTextNodes, xo as UiPointerEvent, xr as previousGraphemeStart, xt as scrollRange, y as drawOverlayShapes, ya as boxShadowsEqual, yi as repeat, yn as TEXT_SELECTION_PROP, yo as UiPasteEvent, yr as nextGraphemeEnd, yt as scrollBounds, z as tightenConstraints, za as darkColors, zi as bandOf, zn as setLinkHover, zr as propertyValuesEqualByName, zt as detectEditingPlatform } from "./CanvasSurface-BpgbOku2.js";
1
+ import { $ as UiPlatformAdapter, $a as boxShadowArraysEqual, $i as UiKeyboardEvent, $n as isVideoSurface, $r as pathValuesEqual, $t as textRunDecorations, A as formatNumber, Aa as withDensity, Ai as propertyValuesEqual, An as isPressable, Ao as colorsEqual, Ar as resolveString, At as paragraphGeometryFrom, B as MAX_MEASURES_PER_CHILD, Ba as contrastRatio, Bi as writeOverrideProperty, Bn as CARET_BLINK_MS, Bo as easings, Br as UiProperties, Bt as isPrintable, C as LayoutEngine, Ca as bandOf, Ci as borderRadiusCorners, Cn as selectionRangeOf, Co as colorsEqualPalette, Cr as wordRangeAt, Ct as scrollbarThumbs, D as describeOverrides, Da as lightTheme, Di as normalizeBorderRadius, Dn as isNodeInert, Do as colorToHex, Dr as resolveNumber, Dt as hasDrawnText, E as describeLength, Ea as darkTheme, Ei as borderRadiusValuesEqual, En as isNodeHitTestable, Eo as UiBasicColors, Er as resolveBoolean, Et as UiInputDispatcher, F as LayoutRecord, Fa as hasThemeExtension, Fi as DirtyNodeSet, Fn as hasTextLinks, Fo as createEnvironmentKey, Fr as inheritedPropertyNames, Ft as comparePositions, G as sizeGridTracks, Ga as defaultSpacing, Gi as visualStatesEqual, Gn as editorOf, Gr as normalizeStates, Gt as drawText, H as FlexDirection, Ha as raiseContrast, Hi as defaultVisualState, Hn as EDITOR_PROP, Ho as steps, Hr as UI_SEMANTIC_STATES, Ht as applyCanvasTextStyle, I as Constraints, Ia as noThemeExtensions, Ii as clearOverrideProperty, In as linkHoverOf, Io as findEnvironmentKey, Ir as propertyEffects, It as edgeField, J as MainAxisAlignment, Ja as spacingSteps, Ji as UiCompositionEvent, Jn as isReadOnly, Jr as validateStates, Jt as runCanvasStyleInto, K as AlignContent, Ka as scaleSpacing, Ki as MOUSE_POINTER, Kn as isEditableNode, Kr as statesEqual, Kt as fillTextRects, L as clampSize, La as themeExtension, Li as overrideSources, Ln as linkOf, Lo as provided, Lr as propertyIsInherited, Lt as editingGroupOf, M as withOverrideSource, Ma as lengths, Mi as withPointer, Mn as pointerEventsOf, Mo as parseColor, Mr as findPropertyDefinition, Mt as wordRangeIn, N as accumulatedOffsetTo, Na as unitsEqual, Ni as UiEnvironment, Nn as resolveCursor, No as rgb8, Nr as getPropertyNames, Nt as textInputOf, O as formatConstraints, Oa as themesEqual, Oi as uniformBorderRadius, On as isNodeSelectable, Oo as colorToRgba, Or as resolveProperty, Ot as offsetAtPointIn, P as contentOffset, Pa as defineThemeExtension, Pi as UiNode, Pn as clearLinkHover, Po as rgba, Pr as inheritedPropertyFlags, Pt as adjacentField, Q as CanvasPlatformSurface, Qa as boxShadow, Qi as UiInputEvent, Qn as resolveColorValue, Qr as paintValuesEqual, Qt as textRunBackgrounds, R as constraintsEqual, Ra as themeExtensionsEqual, Ri as resetOverrideWarnings, Rn as linkRunAtPointIn, Ro as cubicBezier, Rr as propertyNarrowers, Rt as commandForKey, S as tracePathData, Sa as UiContainerSizeSource, Si as borderRadius, Sn as selectableTextOf, So as textStylesEqual, Sr as previousWordStart, St as scrollbarThumb, T as SCROLLBAR_LINGER_MS, Ta as unknownContainerSize, Ti as borderRadiusIsZero, Tn as isNodeFocusable, To as lightColors, Tr as DEFAULT_LINE_HEIGHT_FACTOR, Tt as scrollsFromRight, U as parseFlexDirection, Ua as relativeLuminance, Ui as hasVisualState, Un as caretVisibleAt, Ur as isUiRole, Ut as buildFontString, V as isLayoutProtocol, Va as highContrastColors, Vi as UiVisualState, Vn as CARET_WIDTH, Vo as linear, Vr as UI_ROLES, Vt as EditableLayout, W as placeGridItems, Wa as densityFactors, Wi as visualState, Wn as editorFor, Wr as isUiSemanticState, Wt as createCanvasTextStyle, X as parseCrossAxisAlignment, Xa as shadowsEqual, Xi as UiFocusEvent, Xn as nextCaretToggle, Xr as validateSubgrid, Xt as spanOf, Y as parseAlignContent, Ya as defaultShadows, Yi as UiEventType, Yn as maskText, Yr as UI_SUBGRID_AXES, Yt as runFontString, Z as parseMainAxisAlignment, Za as BOX_SHADOW_BLUR_REACH, Zi as UiGestureEvent, Zn as syncEditorValue, Zr as inputsEqual, Zt as textMeasureRequest, _ as paintsAfterChildren, _a as springIn, _i as minmax, _n as matchRangesOf, _o as spanAtOffset, _r as lineEndAt, _t as SCROLLBAR_MIN_THUMB, a as layerRegion, aa as UiWheelDeltaMode, ai as MAX_GRADIENT_STOPS, an as DEFAULT_FONT_SIZE, ao as shadowsOf, ar as layoutParagraph, at as UiEditingController, b as labelOrigin, ba as noInsets, bi as resolveLength, bn as clearSelectionRange, bo as textContentOf, br as nextWordEnd, bt as scrollLeaderOf, c as paintPictures, ca as wheelDeltaYOf, ci as linearGradient, cn as colorToCss, co as shapesEqual, cr as lineIndexAtY, ct as UiPinchRecognizer, d as PaintRecorder, da as UiBinding, di as auto, dn as isPaintVisible, do as typographyEqual, dr as offsetAtPoint, dt as UiKeyboardController, ea as UiPasteEvent, ei as UiTransforms, en as bumpFontStack, eo as boxShadowRadius, er as videoFrameSize, et as capturePointer, f as replayPaint, fa as UiEnvironmentKeys, fi as fr, fn as normalizeTextAlign, fo as defaultTextStyle, fr as offsetAtX, ft as UiPointerController, g as hasDecorationPhase, ga as easingIn, gi as isPercentLength, gn as clearMatchRanges, go as resolvedSpansOf, gr as graphemeBoundaries, gt as SCROLLBAR_INSET, h as decorationRect, ha as durationIn, hi as isMinMaxTrack, hn as TEXT_MATCHES_PROP, ho as hiddenRangesOf, hr as EditableTextModel, ht as SCROLLBAR_HOVER_ZONE, i as traceRoundedRect, ia as UiTextChangeEvent, ii as transformsEqual, in as DEFAULT_FONT_FAMILY, io as fittedShadowRadius, ir as ELLIPSIS, it as touchActionFor, j as labelNode, ja as defaultUnits, ji as TOUCH_TARGET, jn as isSubtreeInert, jo as normalizeColor, jr as closestPropertyName, jt as selectionRectsIn, k as formatExplanation, ka as withContrast, ki as defineProperty, kn as isNodeTabStop, ko as colorValuesEqual, kr as resolvePropertyByName, kt as paragraphGeometry, l as PaintTarget, la as UiNodeType, li as radialGradient, ln as computeObjectFitRect, lo as defaultTypography, lr as lineIndexForOffset, lt as UiWheelController, m as decorationColor, ma as defineMotion, mi as isFrLength, mn as resolvePaintState, mo as flattenTextSpans, mr as selectionRects, mt as UiHitTester, n as createCanvasSurface, na as UiPointerEvent, ni as transform, nn as fontStackFor, no as boxShadowValuesEqual, nr as ParagraphTextMeasurer, nt as pointerDeviceOf, o as opacityNeedsLayer, oa as UiWheelEvent, oi as gradientPaint, on as DEFAULT_FONT_WEIGHT, oo as defaultShapes, or as proportionalFontMetrics, ot as UiTouchScroller, p as ScaledImageCache, pa as defaultMotion, pi as isAutoLength, pn as normalizeVerticalAlign, po as editableSpansOf, pr as offsetForVerticalMove, pt as UiFocusManager, q as CrossAxisAlignment, qa as spacingEqual, qi as UiBeforeInputEvent, qn as isMultiline, qr as validateRole, qt as layoutTextLines, r as Canvas2DRenderer, ra as UiSelectionChangeEvent, ri as transformIsIdentity, rn as registerFontStack, ro as boxShadowsEqual, rr as spannedRunsFor, rt as prepareInputSurface, s as PaintPictureCache, sa as noKeyModifiers, si as gradientsEqual, sn as DEFAULT_TEXT_COLOR, so as isShapeName, sr as caretRectFor, st as UiGestureRecognizer, t as CanvasSurface, ta as UiPinchEvent, ti as parseTransform, tn as clearFontStacks, to as boxShadowReach, tr as CharacterCountTextMeasurer, tt as isImeKey, u as EMPTY_RECORDING, ua as DirtyFlags, ui as validateGradient, un as createPaintState, uo as isTypographyRole, ur as lineLimit, ut as isScrollContainer, v as LABEL_PADDING_X, va as UiInsetRegistry, vi as percent, vn as setMatchRanges, vo as spannedTextOf, vr as lineStartAt, vt as SCROLLBAR_THICKNESS, w as SCROLLBAR_FADE_MS, wa as containerBands, wi as borderRadiusEqual, wn as setSelectionRange, wo as darkColors, wr as UiGraph, wt as scrollbarZoneAt, x as snapScroll, xa as observeViewportInsets, xi as UiBorderRadiuses, xn as selectableTextNodes, xo as textSpansEqual, xr as previousGraphemeStart, xt as scrollRange, y as drawOverlayShapes, ya as insetsEqual, yi as repeat, yn as TEXT_SELECTION_PROP, yo as spansDifferOnlyInPaint, yr as nextGraphemeEnd, yt as scrollBounds, z as tightenConstraints, za as withThemeExtension, zi as writeDeclaredProperty, zn as setLinkHover, zo as easingCss, zr as propertyValuesEqualByName, zt as detectEditingPlatform } from "./CanvasSurface-CkRHlmpu.js";
2
2
  import { BehaviorSubject, EMPTY, Subject, combineLatest, distinctUntilChanged, isObservable as isObservable$1, map, of } from "rxjs";
3
- //#region src/animation/UiEasing.ts
4
- /** Progress equals time. What a spinner and a sweep want. */
5
- const linear = (t) => t;
6
- /**
7
- * A cubic Bézier easing, in the CSS `cubic-bezier(x1, y1, x2, y2)`
8
- * sense: the curve runs from (0, 0) to (1, 1) through the two control
9
- * points, and the easing is y at the t where x equals the input.
10
- *
11
- * Solved by Newton's method with a bisection fallback, which is what
12
- * every browser engine does; eight iterations is well past the point
13
- * where the result stops moving in a float.
14
- */
15
- function cubicBezier(x1, y1, x2, y2) {
16
- const ax = 3 * x1 - 3 * x2 + 1;
17
- const bx = 3 * x2 - 6 * x1;
18
- const cx = 3 * x1;
19
- const ay = 3 * y1 - 3 * y2 + 1;
20
- const by = 3 * y2 - 6 * y1;
21
- const cy = 3 * y1;
22
- const sampleX = (t) => ((ax * t + bx) * t + cx) * t;
23
- const sampleY = (t) => ((ay * t + by) * t + cy) * t;
24
- const slopeX = (t) => (3 * ax * t + 2 * bx) * t + cx;
25
- return (input) => {
26
- if (input <= 0) return 0;
27
- if (input >= 1) return 1;
28
- let t = input;
29
- for (let i = 0; i < 8; i++) {
30
- const error = sampleX(t) - input;
31
- if (Math.abs(error) < 1e-6) return sampleY(t);
32
- const slope = slopeX(t);
33
- if (Math.abs(slope) < 1e-6) break;
34
- t -= error / slope;
35
- }
36
- let low = 0;
37
- let high = 1;
38
- t = input;
39
- for (let i = 0; i < 24; i++) {
40
- const x = sampleX(t);
41
- if (Math.abs(x - input) < 1e-6) break;
42
- if (x > input) high = t;
43
- else low = t;
44
- t = (low + high) / 2;
45
- }
46
- return sampleY(t);
47
- };
48
- }
49
- /**
50
- * An easing that only takes `count` distinct values.
51
- *
52
- * The reason it exists is the `Spinner`: eight blades have eight
53
- * positions promised the F4 version would keep a
54
- * turn at eight writes a second rather than sixty. Paired with an
55
- * animation's `stepMs`, this is how that promise is kept — the value
56
- * is stepped and the frames are too.
57
- */
58
- function steps(count) {
59
- if (!(count >= 1)) throw new Error(`steps() needs at least one step, got ${count}.`);
60
- return (t) => Math.min(count - 1, Math.floor(t * count)) / count;
61
- }
62
- /**
63
- * The named curves a motion vocabulary is built from.
64
- *
65
- * `standard` is the one to reach for: something entering and leaving
66
- * at a natural pace. `decelerate` is for something arriving (it starts
67
- * fast and settles), `accelerate` for something leaving. `emphasized`
68
- * is `standard` with more of a lean, for the one movement on a screen
69
- * that should be noticed.
70
- */
71
- const easings = {
72
- linear,
73
- standard: cubicBezier(.2, 0, 0, 1),
74
- decelerate: cubicBezier(0, 0, 0, 1),
75
- accelerate: cubicBezier(.3, 0, 1, 1),
76
- emphasized: cubicBezier(.05, .7, .1, 1)
77
- };
78
- //#endregion
79
3
  //#region src/animation/Interpolate.ts
80
4
  const interpolateNumber = (from, to, t) => from + (to - from) * t;
81
5
  /**
@@ -283,7 +207,8 @@ var UiAnimation = class {
283
207
  this.begin(previous.lastAdvancedAt);
284
208
  }
285
209
  onBegin() {}
286
- advance(now) {
210
+ /** `hold`: at its end, stay there, unfinished, to be sampled again at an earlier time (`UiClock.holding`). */
211
+ advance(now, hold = false) {
287
212
  if (this.finished) return;
288
213
  this.begin(now);
289
214
  this.lastAdvancedAt = now;
@@ -296,7 +221,7 @@ var UiAnimation = class {
296
221
  this.cell.value = value;
297
222
  this.subject.next(value);
298
223
  }
299
- if (done) this.finish();
224
+ if (done && !hold) this.finish();
300
225
  }
301
226
  /**
302
227
  * Moves the ideal timeline on by one step.
@@ -519,40 +444,6 @@ function createTween(cell, to, options) {
519
444
  return new UiTween(cell, to, options, interpolate);
520
445
  }
521
446
  //#endregion
522
- //#region src/environment/UiMotion.ts
523
- const defaultMotion = {
524
- durations: {
525
- /** No motion. What `reducedMotion` turns everything else into. */
526
- instant: 0,
527
- /** A control acknowledging a press; too short to watch. */
528
- fast: 120,
529
- /** The default: something appearing, moving or changing colour. */
530
- normal: 200,
531
- /** A panel or a dialog, which is bigger and travels further. */
532
- slow: 320,
533
- /** A movement meant to be followed by the eye. Rare. */
534
- deliberate: 500
535
- },
536
- easings,
537
- springs: {
538
- gentle: {
539
- stiffness: 120,
540
- damping: 20,
541
- mass: 1
542
- },
543
- snappy: {
544
- stiffness: 220,
545
- damping: 24,
546
- mass: 1
547
- },
548
- stiff: {
549
- stiffness: 400,
550
- damping: 32,
551
- mass: 1
552
- }
553
- }
554
- };
555
- //#endregion
556
447
  //#region src/animation/UiTransition.ts
557
448
  /** A tween of `duration` milliseconds along `easing`. */
558
449
  function tween(duration, options = {}) {
@@ -571,12 +462,12 @@ function tween(duration, options = {}) {
571
462
  function spring(spec = "snappy", options = {}) {
572
463
  return {
573
464
  kind: "spring",
574
- spring: typeof spec === "string" ? defaultMotion.springs[spec] : spec,
465
+ spring: spec,
575
466
  ...options
576
467
  };
577
468
  }
578
469
  function normalizeTransition(value) {
579
- return typeof value === "number" ? {
470
+ return typeof value === "number" || typeof value === "string" ? {
580
471
  kind: "tween",
581
472
  duration: value
582
473
  } : value;
@@ -598,11 +489,18 @@ function assertTransitionMap(nodeId, value, isKnownProperty) {
598
489
  });
599
490
  continue;
600
491
  }
492
+ if (typeof entry === "string" && entry !== "") {
493
+ specs.set(property, {
494
+ kind: "tween",
495
+ duration: entry
496
+ });
497
+ continue;
498
+ }
601
499
  if (typeof entry === "object" && entry !== null && (entry.kind === "tween" || entry.kind === "spring")) {
602
500
  specs.set(property, entry);
603
501
  continue;
604
502
  }
605
- throw new Error(`The 'transition' for '${property}' on node '${nodeId}' must be a duration in milliseconds or a spec built by tween() or spring(), got ${describe$1(entry)}.`);
503
+ throw new Error(`The 'transition' for '${property}' on node '${nodeId}' must be a duration in milliseconds or by name, or a spec built by tween() or spring(), got ${describe$1(entry)}.`);
606
504
  }
607
505
  return specs;
608
506
  }
@@ -632,8 +530,13 @@ function erase(animation) {
632
530
  */
633
531
  var AnimationDriver = class {
634
532
  running = /* @__PURE__ */ new Map();
533
+ /** The clock each running animation was started on, when it was not real time; see `UiClock`. */
534
+ clocks = /* @__PURE__ */ new Map();
535
+ /** Each clock's `moves` as last drawn: one moved since (a seek) is drawn at its new time at once. */
536
+ seenMoves = /* @__PURE__ */ new WeakMap();
635
537
  reducedMotion = false;
636
538
  hidden = false;
539
+ advancing = false;
637
540
  wake = null;
638
541
  /**
639
542
  * Called when an animation enters the running set on an idle driver.
@@ -648,6 +551,14 @@ var AnimationDriver = class {
648
551
  setWakeListener(listener) {
649
552
  this.wake = listener;
650
553
  }
554
+ /**
555
+ * Whether a frame of the running animations is being written now: a
556
+ * value written meanwhile is a step of an animation, not a change for
557
+ * a transition to animate again.
558
+ */
559
+ get isAdvancing() {
560
+ return this.advancing;
561
+ }
651
562
  /** Whether anything is running, so the `ticks` phase can report 0. */
652
563
  get isRunning() {
653
564
  return this.running.size > 0;
@@ -669,8 +580,8 @@ var AnimationDriver = class {
669
580
  * animation says its movement is the information rather than the
670
581
  * decoration.
671
582
  */
672
- lands(policy) {
673
- return policy === "snap" && (this.reducedMotion || this.hidden);
583
+ lands(policy, clock) {
584
+ return clock?.settled === true || policy === "snap" && (this.reducedMotion || this.hidden);
674
585
  }
675
586
  /**
676
587
  * Starts an animation, replacing whatever was driving its cell.
@@ -682,16 +593,18 @@ var AnimationDriver = class {
682
593
  * So a reduced-motion app runs no animation frames, rather than
683
594
  * running them and drawing the same thing sixty times.
684
595
  */
685
- start(animation) {
596
+ start(animation, clock = null) {
686
597
  const cell = animation.cell;
687
598
  this.running.get(cell)?.cancel();
688
599
  this.running.delete(cell);
689
- if (this.lands(animation.reducedMotionPolicy)) {
600
+ this.clocks.delete(cell);
601
+ if (this.lands(animation.reducedMotionPolicy, clock ?? void 0)) {
690
602
  animation.snap();
691
603
  return animation.values;
692
604
  }
693
605
  const wasIdle = this.running.size === 0;
694
606
  this.running.set(cell, erase(animation));
607
+ if (clock !== null) this.clocks.set(cell, clock);
695
608
  if (wasIdle) this.wake?.();
696
609
  return animation.values;
697
610
  }
@@ -711,12 +624,14 @@ var AnimationDriver = class {
711
624
  const animation = this.running.get(cell);
712
625
  if (animation === void 0) return false;
713
626
  this.running.delete(cell);
627
+ this.clocks.delete(cell);
714
628
  animation.cancel();
715
629
  return true;
716
630
  }
717
631
  stopAll() {
718
632
  const animations = [...this.running.values()];
719
633
  this.running.clear();
634
+ this.clocks.clear();
720
635
  for (const animation of animations) animation.cancel();
721
636
  }
722
637
  /**
@@ -770,8 +685,9 @@ var AnimationDriver = class {
770
685
  }
771
686
  /** Puts everything that may be landed where it was going. */
772
687
  landRunning() {
773
- for (const [cell, animation] of this.running) if (this.lands(animation.reducedMotionPolicy)) {
688
+ for (const [cell, animation] of this.running) if (this.lands(animation.reducedMotionPolicy, this.clocks.get(cell))) {
774
689
  this.running.delete(cell);
690
+ this.clocks.delete(cell);
775
691
  animation.snap();
776
692
  }
777
693
  }
@@ -788,8 +704,14 @@ var AnimationDriver = class {
788
704
  */
789
705
  nextTickAt(now) {
790
706
  let earliest;
791
- for (const animation of this.running.values()) {
792
- const due = animation.dueAt(now) - animation.dueSlackMs;
707
+ for (const [cell, animation] of this.running) {
708
+ const clock = this.clocks.get(cell);
709
+ if (clock?.settled === true) return now;
710
+ if (clock !== void 0 && clock.moves !== (this.seenMoves.get(clock) ?? 0)) return now;
711
+ const at = clock === void 0 ? now : clock.local(now);
712
+ const dueAt = animation.dueAt(at) - animation.dueSlackMs;
713
+ const due = clock === void 0 ? dueAt : clock.real(dueAt);
714
+ if (!Number.isFinite(due)) continue;
793
715
  if (earliest === void 0 || due < earliest) earliest = due;
794
716
  }
795
717
  return earliest;
@@ -805,14 +727,144 @@ var AnimationDriver = class {
805
727
  * behind.
806
728
  */
807
729
  advance(now) {
730
+ this.advancing = true;
731
+ try {
732
+ this.advanceRunning(now);
733
+ } finally {
734
+ this.advancing = false;
735
+ }
736
+ }
737
+ advanceRunning(now) {
738
+ const moved = [...new Set(this.clocks.values())].filter((clock) => clock.moves !== (this.seenMoves.get(clock) ?? 0));
739
+ this.advanceEach(now);
740
+ for (const clock of moved) this.seenMoves.set(clock, clock.moves);
741
+ }
742
+ advanceEach(now) {
808
743
  for (const [cell, animation] of this.running) {
809
- if (animation.dueAt(now) - animation.dueSlackMs > now) continue;
810
- animation.advance(now);
811
- if (animation.isFinished && this.running.get(cell) === animation) this.running.delete(cell);
744
+ const clock = this.clocks.get(cell);
745
+ if (clock?.settled === true) {
746
+ this.running.delete(cell);
747
+ this.clocks.delete(cell);
748
+ animation.snap();
749
+ continue;
750
+ }
751
+ const at = clock === void 0 ? now : clock.local(now);
752
+ if (!(clock !== void 0 && clock.moves !== (this.seenMoves.get(clock) ?? 0)) && animation.dueAt(at) - animation.dueSlackMs > at) continue;
753
+ animation.advance(at, clock?.holding === true);
754
+ if (animation.isFinished && this.running.get(cell) === animation) {
755
+ this.running.delete(cell);
756
+ this.clocks.delete(cell);
757
+ }
812
758
  }
813
759
  }
814
760
  };
815
761
  //#endregion
762
+ //#region src/animation/UiClock.ts
763
+ /**
764
+ * How time passes for the animations under a node: at a speed of its
765
+ * own, or not at all.
766
+ *
767
+ * A node provides one to its subtree,
768
+ * `provide={[provided(UiEnvironmentKeys.clock, clock)]}`, and every
769
+ * animation started there runs on it: a transition, a `motion` state,
770
+ * hover and press, and `AnimationService.animate` given the node it
771
+ * animates `on`. Nothing provided is real time.
772
+ *
773
+ * What a design tool needs to show one screen two ways at once. The
774
+ * frames on its board are pictures: under a `settled` clock every
775
+ * animation lands where it is going the moment it starts, and a loop
776
+ * holds still. The screen it plays runs at the person's own speed, a
777
+ * quarter of it to watch a press closely, or paused. Reduced motion and
778
+ * a hidden page are the whole app's; this is one part of it.
779
+ *
780
+ * An animation takes all its time from the driver, which hands each
781
+ * the local time of its clock, so nothing inside a tween or a spring
782
+ * knows; and the driver asks for the next frame in real time, so a
783
+ * slowed clock asks for frames as often as it needs them and a paused
784
+ * one asks for none.
785
+ */
786
+ var UiClock = class {
787
+ rate;
788
+ /** A real time and the local time it was, from the last change of speed: where local time is measured from. */
789
+ anchor = null;
790
+ /** The real time last asked about, where a change of speed takes effect. */
791
+ lastReal = null;
792
+ /** Every animation lands where it is going, and none runs. */
793
+ settled;
794
+ /**
795
+ * Animations that reach their end stay, held there, rather than
796
+ * finishing: so moving the time back (`seek`) plays them back. What a
797
+ * design tool scrubs a transition with; let go, they finish as they
798
+ * would have. A spring, which is worked out step by step rather than
799
+ * from the time, holds but does not run back.
800
+ */
801
+ holding = false;
802
+ /** Bumped by `seek`, so a driver knows to draw again at the new time. */
803
+ moves = 0;
804
+ constructor(options = {}) {
805
+ this.rate = checkedSpeed(options.speed ?? 1);
806
+ this.settled = options.settled ?? false;
807
+ }
808
+ /** How fast time passes: 1 is real time, 0.25 a quarter of it, 0 paused. */
809
+ get speed() {
810
+ return this.rate;
811
+ }
812
+ set speed(next) {
813
+ const speed = checkedSpeed(next);
814
+ if (this.anchor !== null && this.lastReal !== null) this.anchor = {
815
+ real: this.lastReal,
816
+ local: this.local(this.lastReal)
817
+ };
818
+ this.rate = speed;
819
+ }
820
+ /** The local time now, as last asked: where a seek is measured from. */
821
+ get now() {
822
+ return this.lastReal === null ? 0 : this.local(this.lastReal);
823
+ }
824
+ /**
825
+ * Puts local time at `at`, from now on: forward, or back to replay
826
+ * what is held (`holding`). Paused, it stays there; running, it goes
827
+ * on from there.
828
+ */
829
+ seek(at) {
830
+ const real = this.lastReal ?? 0;
831
+ this.anchor = {
832
+ real,
833
+ local: at
834
+ };
835
+ this.moves += 1;
836
+ }
837
+ /** The local time at real time `now`. The first time asked, the two agree. */
838
+ local(now) {
839
+ this.anchor ??= {
840
+ real: now,
841
+ local: now
842
+ };
843
+ this.lastReal = now;
844
+ return this.anchor.local + (now - this.anchor.real) * this.rate;
845
+ }
846
+ /** The real time at which local time `at` comes; Infinity while paused. */
847
+ real(at) {
848
+ if (this.anchor === null) return at;
849
+ if (this.rate === 0) return Infinity;
850
+ return this.anchor.real + (at - this.anchor.local) / this.rate;
851
+ }
852
+ };
853
+ function checkedSpeed(speed) {
854
+ if (!(speed >= 0) || !Number.isFinite(speed)) throw new Error(`A clock's speed is a number of 0 or more (0 is paused, 1 real time), not ${speed}.`);
855
+ return speed;
856
+ }
857
+ /** The motion vocabulary names resolve to under `node`: the nearest provided above it, or Gesso's. */
858
+ function motionOf(node) {
859
+ for (let at = node ?? null; at !== null; at = at.parent) if (at.environment !== null) return at.environment.get(UiEnvironmentKeys.motion);
860
+ return UiEnvironmentKeys.motion.defaultValue;
861
+ }
862
+ /** The clock the animations under `node` run on: the nearest one provided above it, or null for real time. */
863
+ function clockOf(node) {
864
+ for (let at = node ?? null; at !== null; at = at.parent) if (at.environment !== null) return at.environment.get(UiEnvironmentKeys.clock);
865
+ return null;
866
+ }
867
+ //#endregion
816
868
  //#region src/animation/UiSharedElements.ts
817
869
  /**
818
870
  * Who currently owns each shared-element name, and where they were.
@@ -1099,9 +1151,7 @@ var UiChildrenBinding = class {
1099
1151
  handleValue(value) {
1100
1152
  const definitions = Array.isArray(value) ? value : [value];
1101
1153
  const fragment = this.graph.requireNode(this.fragmentId);
1102
- this.builder.reconcileChildren(fragment, definitions);
1103
- const parent = this.graph.requireNode(this.parentId);
1104
- this.graph.markDirty(parent, 16);
1154
+ if (this.builder.reconcileChildren(fragment, definitions).changed) this.graph.markDirty(this.graph.requireNode(this.parentId), 16);
1105
1155
  }
1106
1156
  };
1107
1157
  //#endregion
@@ -1211,6 +1261,19 @@ function isUiModifier(value) {
1211
1261
  }
1212
1262
  //#endregion
1213
1263
  //#region src/modifiers/interaction.ts
1264
+ /**
1265
+ * Draws what is under a node as though it were hovered, pressed or
1266
+ * focused: every `interactive` modifier there shows its hover or press
1267
+ * look, and every `focusRing` its ring. What a design tool draws a
1268
+ * component's pointer states with, beside its other states, where no
1269
+ * pointer is over it. Read as each modifier attaches, so a node drawn
1270
+ * under it starts so and stays so; the pointer still adds its own.
1271
+ * Pressed is hovered too, as a press under a pointer is.
1272
+ */
1273
+ const ShownAsKey = createEnvironmentKey({
1274
+ name: "gesso.shownAs",
1275
+ defaultValue: null
1276
+ });
1214
1277
  const BOTH = Object.freeze({
1215
1278
  hover: true,
1216
1279
  press: true
@@ -1228,19 +1291,25 @@ const kind$5 = defineModifier({
1228
1291
  attach(host, options) {
1229
1292
  let hovered = false;
1230
1293
  let pressed = false;
1294
+ const shown = host.environment(ShownAsKey);
1295
+ const shownPressed = shown === "pressed";
1296
+ const shownHovered = shownPressed || shown === "hovered";
1231
1297
  const styled = /* @__PURE__ */ new Set([...Object.keys(options.hovered ?? {}), ...Object.keys(options.pressed ?? {})]);
1232
1298
  const sync = () => {
1299
+ const isHovered = hovered || shownHovered;
1300
+ const isPressed = pressed || shownPressed;
1233
1301
  const states = /* @__PURE__ */ new Set();
1234
- if (hovered) states.add("hovered");
1235
- if (pressed) states.add("pressed");
1302
+ if (isHovered) states.add("hovered");
1303
+ if (isPressed) states.add("pressed");
1236
1304
  if (states.size === 0) states.add("normal");
1237
1305
  if (!sameStates(host.get("visualState"), states)) host.set("visualState", states);
1238
1306
  for (const property of styled) {
1239
- const value = (pressed ? options.pressed?.[property] : void 0) ?? (hovered ? options.hovered?.[property] : void 0);
1307
+ const value = (isPressed ? options.pressed?.[property] : void 0) ?? (isHovered ? options.hovered?.[property] : void 0);
1240
1308
  if (value === void 0) host.clear(property);
1241
1309
  else host.set(property, value);
1242
1310
  }
1243
1311
  };
1312
+ if (shownHovered) sync();
1244
1313
  if (options.hover) {
1245
1314
  host.on("pointerenter", () => {
1246
1315
  hovered = true;
@@ -1337,7 +1406,7 @@ const measureFlow = defineModifier({
1337
1406
  target.next(box);
1338
1407
  };
1339
1408
  report();
1340
- host.onLayout(report);
1409
+ host.onFlowLayout(report);
1341
1410
  }
1342
1411
  });
1343
1412
  //#endregion
@@ -1618,6 +1687,13 @@ var UiModifierSet = class {
1618
1687
  get names() {
1619
1688
  return this.attached.map((entry) => entry.kind.name);
1620
1689
  }
1690
+ /** What is attached, each kind with its current arguments, in order: for a tool reading what a node does. */
1691
+ get modifiers() {
1692
+ return this.attached.map((entry) => ({
1693
+ kind: entry.kind,
1694
+ args: entry.args
1695
+ }));
1696
+ }
1621
1697
  get size() {
1622
1698
  return this.attached.length;
1623
1699
  }
@@ -1815,6 +1891,17 @@ var Host = class {
1815
1891
  }
1816
1892
  this.own(layout.onLayout(this.node, listener));
1817
1893
  }
1894
+ onFlowLayout(listener) {
1895
+ const layout = this.services.layout;
1896
+ if (layout === void 0) {
1897
+ warnMissingLayout(this.name);
1898
+ return;
1899
+ }
1900
+ this.own(layout.onFlowLayout === void 0 ? layout.onLayout(this.node, () => {
1901
+ const box = layout.flowBox(this.node);
1902
+ if (box !== null) listener(box);
1903
+ }) : layout.onFlowLayout(this.node, listener));
1904
+ }
1818
1905
  environment(key, of = this.node) {
1819
1906
  const environment = this.services.environment;
1820
1907
  if (environment === void 0) return key.defaultValue;
@@ -1863,7 +1950,7 @@ var Host = class {
1863
1950
  return EMPTY;
1864
1951
  }
1865
1952
  this.animated.add(cell);
1866
- return driver.start(tween);
1953
+ return driver.start(tween, clockOf(this.node));
1867
1954
  }
1868
1955
  spring(cell, to, options) {
1869
1956
  const driver = this.services.animations;
@@ -1878,7 +1965,7 @@ var Host = class {
1878
1965
  return driver.start(new UiSpring(cell, to, {
1879
1966
  ...options,
1880
1967
  velocity
1881
- }));
1968
+ }), clockOf(this.node));
1882
1969
  }
1883
1970
  own(teardown) {
1884
1971
  this.teardowns.push(teardown);
@@ -2063,6 +2150,10 @@ var NodeTransitions = class {
2063
2150
  write(property, value, flags) {
2064
2151
  const spec = this.specs.get(property);
2065
2152
  if (spec === void 0) return false;
2153
+ if (this.driver.isAdvancing) {
2154
+ this.stopProperty(property);
2155
+ return false;
2156
+ }
2066
2157
  if (!this.node.properties.has(property)) return false;
2067
2158
  const current = this.node.properties.get(property);
2068
2159
  if (Object.is(current, value)) return false;
@@ -2082,6 +2173,12 @@ var NodeTransitions = class {
2082
2173
  this.targets.clear();
2083
2174
  this.specs = /* @__PURE__ */ new Map();
2084
2175
  }
2176
+ cancel(property) {
2177
+ this.stopProperty(property);
2178
+ }
2179
+ get declared() {
2180
+ return this.specs;
2181
+ }
2085
2182
  stopProperty(property) {
2086
2183
  const cell = this.cells.get(property);
2087
2184
  if (cell !== void 0) {
@@ -2095,10 +2192,9 @@ var NodeTransitions = class {
2095
2192
  * node: the driver keys its running set by cell identity, so a fresh
2096
2193
  * adapter per write would leave the previous animation running.
2097
2194
  *
2098
- * Writing goes through `updateNodePropertyNow`, which is the path a
2099
- * plain write takes minus this class — so a modifier's override still
2100
- * sits on top of an animated value, exactly as it sits on top of a
2101
- * bound one.
2195
+ * It writes what is drawn (`applyAnimatedValue`): the target already
2196
+ * is the value the element and any modifier over it settled on, so a
2197
+ * frame of the way there goes onto the node as it is.
2102
2198
  */
2103
2199
  cellFor(property, flags) {
2104
2200
  let cell = this.cells.get(property);
@@ -2110,7 +2206,7 @@ var NodeTransitions = class {
2110
2206
  return node.properties.get(property);
2111
2207
  },
2112
2208
  set value(next) {
2113
- graph.updateNodePropertyNow(node, property, next, flags);
2209
+ graph.applyAnimatedValue(node, property, next, flags);
2114
2210
  }
2115
2211
  };
2116
2212
  this.cells.set(property, cell);
@@ -2125,16 +2221,17 @@ var NodeTransitions = class {
2125
2221
  const previous = this.driver.animationFor(cell);
2126
2222
  const velocity = previous instanceof UiSpring ? previous.currentVelocity : 0;
2127
2223
  this.driver.start(new UiSpring(cell, to, {
2128
- spring: spec.spring,
2224
+ spring: springIn(motionOf(this.node), spec.spring),
2129
2225
  velocity,
2130
2226
  restDelta: spec.restDelta,
2131
2227
  reducedMotion: spec.reducedMotion
2132
- }));
2228
+ }), clockOf(this.node));
2133
2229
  return true;
2134
2230
  }
2231
+ const motion = motionOf(this.node);
2135
2232
  const tween = createTween(cell, to, {
2136
- duration: spec.duration,
2137
- easing: spec.easing,
2233
+ duration: durationIn(motion, spec.duration),
2234
+ easing: easingIn(motion, spec.easing),
2138
2235
  stepMs: spec.stepMs,
2139
2236
  reducedMotion: spec.reducedMotion
2140
2237
  });
@@ -2142,7 +2239,7 @@ var NodeTransitions = class {
2142
2239
  warnNotInterpolable(property);
2143
2240
  return false;
2144
2241
  }
2145
- this.driver.start(tween);
2242
+ this.driver.start(tween, clockOf(this.node));
2146
2243
  return true;
2147
2244
  }
2148
2245
  };
@@ -2327,7 +2424,11 @@ var UiGraphBuilder = class {
2327
2424
  const deferred = this.deferredChildren.get(parent);
2328
2425
  if (deferred !== void 0) {
2329
2426
  this.deferredChildren.delete(parent);
2330
- return this.reconcileChildren(parent, deferred);
2427
+ const again = this.reconcileChildren(parent, deferred);
2428
+ return {
2429
+ nodes: again.nodes,
2430
+ changed: result.changed || again.changed
2431
+ };
2331
2432
  }
2332
2433
  if (this.reconcileDepth === 0) this.components?.flushMounts();
2333
2434
  return result;
@@ -2457,9 +2558,18 @@ var UiGraphBuilder = class {
2457
2558
  this.graph.insertBefore(parent, anchor, cursor);
2458
2559
  } else {
2459
2560
  matched.add(anchor);
2460
- if (this.reconciledFrom.get(anchor) === element) return anchor;
2561
+ const previous = this.reconciledFrom.get(anchor);
2562
+ if (previous === element) return anchor;
2563
+ if (previous !== void 0 && isComponentLikeElement(previous) && previous.component !== element.component) {
2564
+ resolver.release(anchorId);
2565
+ for (let child = anchor.firstChild; child !== null;) {
2566
+ const next = child.nextSibling;
2567
+ this.removeSubtree(child);
2568
+ child = next;
2569
+ }
2570
+ }
2461
2571
  }
2462
- this.reconcileChildren(anchor, [resolver.resolve(element, anchorId)]);
2572
+ this.reconcileChildren(anchor, [resolver.resolve(element, anchorId, anchor)]);
2463
2573
  this.reconciledFrom.set(anchor, element);
2464
2574
  return anchor;
2465
2575
  }
@@ -3572,7 +3682,7 @@ const sizeContainer = defineModifier({
3572
3682
  const vertical = inset("paddingTop", "paddingY") + inset("paddingBottom", "paddingY");
3573
3683
  args.source.report(Math.max(0, box.width - horizontal), Math.max(0, box.height - vertical));
3574
3684
  };
3575
- host.onLayout(report);
3685
+ host.onFlowLayout(report);
3576
3686
  report();
3577
3687
  }
3578
3688
  });
@@ -3617,7 +3727,7 @@ const breakpoint = defineModifier({
3617
3727
  }
3618
3728
  for (const [name, value] of written) host.set(name, value);
3619
3729
  };
3620
- host.onLayout(apply);
3730
+ host.onFlowLayout(apply);
3621
3731
  apply();
3622
3732
  }
3623
3733
  });
@@ -5457,6 +5567,12 @@ function dragSessionFor(node) {
5457
5567
  var LayoutNotifier = class {
5458
5568
  listeners = /* @__PURE__ */ new Map();
5459
5569
  last = /* @__PURE__ */ new Map();
5570
+ /**
5571
+ * Listeners told about the node's place in the layout and its scroll
5572
+ * offset, and not about where it is drawn (`addFlow`).
5573
+ */
5574
+ flowListeners = /* @__PURE__ */ new Map();
5575
+ flowLast = /* @__PURE__ */ new Map();
5460
5576
  /** Registers a listener; the returned function removes it. */
5461
5577
  add(node, listener) {
5462
5578
  let forNode = this.listeners.get(node);
@@ -5475,36 +5591,73 @@ var LayoutNotifier = class {
5475
5591
  }
5476
5592
  };
5477
5593
  }
5594
+ /**
5595
+ * Registers a listener told when the node's laid-out box or its own
5596
+ * scroll offset changes, and not when a scroll or a transform above it
5597
+ * moves it on screen; the returned function removes it.
5598
+ *
5599
+ * Most listeners are this kind: a size container, a breakpoint, a
5600
+ * layout animation, a scroll position read only the node's own box
5601
+ * and offset. Told of every move on screen, each of them was asked
5602
+ * on every step of a pan over a design tool's board, 2,600 of them,
5603
+ * to find nothing it reads had changed; and each answer was where
5604
+ * the node was drawn, worked out through every ancestor. Its place in
5605
+ * the layout is its record, read at once.
5606
+ */
5607
+ addFlow(node, listener) {
5608
+ let forNode = this.flowListeners.get(node);
5609
+ if (forNode === void 0) {
5610
+ forNode = /* @__PURE__ */ new Set();
5611
+ this.flowListeners.set(node, forNode);
5612
+ }
5613
+ forNode.add(listener);
5614
+ return () => {
5615
+ const set = this.flowListeners.get(node);
5616
+ if (set === void 0) return;
5617
+ set.delete(listener);
5618
+ if (set.size === 0) {
5619
+ this.flowListeners.delete(node);
5620
+ this.flowLast.delete(node);
5621
+ }
5622
+ };
5623
+ }
5478
5624
  get size() {
5479
- return this.listeners.size;
5625
+ return this.listeners.size + this.flowListeners.size;
5480
5626
  }
5481
5627
  /** Whether anything is listening, so a frame can skip the walk. */
5482
5628
  isEmpty() {
5483
- return this.listeners.size === 0;
5629
+ return this.listeners.size === 0 && this.flowListeners.size === 0;
5484
5630
  }
5485
5631
  /**
5486
5632
  * Calls the listeners of every watched node whose box or scroll
5487
5633
  * offset differs from what it was last told about.
5488
5634
  */
5489
- notify(read) {
5490
- for (const [node, listeners] of this.listeners) {
5491
- const current = read(node);
5492
- const previous = this.last.get(node);
5493
- if (previous !== void 0 && sameLayout(previous, current)) continue;
5494
- this.last.set(node, {
5495
- box: { ...current.box },
5496
- scrollX: current.scrollX,
5497
- scrollY: current.scrollY
5498
- });
5499
- for (const listener of listeners) listener(current.box);
5500
- }
5635
+ notify(read, readFlow = read) {
5636
+ notifyEach(this.listeners, this.last, read);
5637
+ notifyEach(this.flowListeners, this.flowLast, readFlow);
5501
5638
  }
5502
5639
  /** Drops a removed node's listeners, so nothing keeps it alive. */
5503
5640
  handleNodeRemoved(node) {
5504
5641
  this.listeners.delete(node);
5505
5642
  this.last.delete(node);
5643
+ this.flowListeners.delete(node);
5644
+ this.flowLast.delete(node);
5506
5645
  }
5507
5646
  };
5647
+ /** Calls the listeners of each node whose layout, as `read` gives it, differs from what they were last told. */
5648
+ function notifyEach(listeners, last, read) {
5649
+ for (const [node, forNode] of listeners) {
5650
+ const current = read(node);
5651
+ const previous = last.get(node);
5652
+ if (previous !== void 0 && sameLayout(previous, current)) continue;
5653
+ last.set(node, {
5654
+ box: { ...current.box },
5655
+ scrollX: current.scrollX,
5656
+ scrollY: current.scrollY
5657
+ });
5658
+ for (const listener of forNode) listener(current.box);
5659
+ }
5660
+ }
5508
5661
  function sameLayout(a, b) {
5509
5662
  return a.scrollX === b.scrollX && a.scrollY === b.scrollY && sameBox(a.box, b.box);
5510
5663
  }
@@ -5615,8 +5768,9 @@ const kind$4 = defineModifier({
5615
5768
  name: "focusRing",
5616
5769
  attach(host, options) {
5617
5770
  const shapes = ringShapes(options);
5771
+ const shown = host.environment(ShownAsKey) === "focused";
5618
5772
  const sync = () => {
5619
- host.decorate(host.isFocused() && host.isFocusVisible() ? shapes : null);
5773
+ host.decorate(shown || host.isFocused() && host.isFocusVisible() ? shapes : null);
5620
5774
  };
5621
5775
  sync();
5622
5776
  host.onFocusChange(sync);
@@ -5772,7 +5926,7 @@ const kind$3 = defineModifier({
5772
5926
  name: "autoFocus",
5773
5927
  attach(host, options) {
5774
5928
  let done = false;
5775
- host.onLayout(() => {
5929
+ host.onFlowLayout(() => {
5776
5930
  if (done) return;
5777
5931
  done = true;
5778
5932
  host.focus(options);
@@ -6098,7 +6252,7 @@ var DropTarget = class {
6098
6252
  }
6099
6253
  attach() {
6100
6254
  this.registration.sync();
6101
- this.host.onLayout(() => this.registration.sync());
6255
+ this.host.onFlowLayout(() => this.registration.sync());
6102
6256
  this.host.own(() => {
6103
6257
  this.stopScrolling();
6104
6258
  this.registration.dispose();
@@ -6825,7 +6979,7 @@ var LayoutAnimation = class {
6825
6979
  this.baseScaleY = numberOr(declared.scaleY, 1);
6826
6980
  this.baseRotation = numberOr(declared.rotation, 0);
6827
6981
  }
6828
- this.host.onLayout(() => this.handleLayout());
6982
+ this.host.onFlowLayout(() => this.handleLayout());
6829
6983
  }
6830
6984
  makeCell(read, write) {
6831
6985
  return {
@@ -6902,7 +7056,7 @@ var LayoutAnimation = class {
6902
7056
  }
6903
7057
  const named = this.options.spring ?? "snappy";
6904
7058
  this.host.spring(cell, 0, {
6905
- spring: typeof named === "string" ? defaultMotion.springs[named] : named,
7059
+ spring: springIn(motionOf(this.host.node), named),
6906
7060
  restDelta: .5
6907
7061
  });
6908
7062
  }
@@ -7053,15 +7207,11 @@ const UNSUPPORTED_ELEMENTS = /* @__PURE__ */ new Set([
7053
7207
  "text",
7054
7208
  "image",
7055
7209
  "foreignObject",
7056
- "mask",
7057
- "filter",
7058
7210
  "pattern",
7059
7211
  "marker"
7060
7212
  ]);
7061
7213
  /** Attributes that point at one of those. */
7062
7214
  const UNSUPPORTED_ATTRIBUTES = {
7063
- mask: "mask",
7064
- filter: "filter",
7065
7215
  "marker-start": "marker",
7066
7216
  "marker-mid": "marker",
7067
7217
  "marker-end": "marker"
@@ -7082,10 +7232,21 @@ function parseSvg(source) {
7082
7232
  if (id !== void 0 && !ids.has(id)) ids.set(id, element);
7083
7233
  if (name === "style") rules.push(...parseStyleSheet(element.text));
7084
7234
  if (UNSUPPORTED_ELEMENTS.has(name)) unsupported.add(name);
7235
+ if (name === "filter" && dropShadowOf(element) === void 0) unsupported.add("filter");
7085
7236
  for (const [attribute, feature] of Object.entries(UNSUPPORTED_ATTRIBUTES)) if (element.attributes[attribute] !== void 0 && element.attributes[attribute] !== "none") unsupported.add(feature);
7237
+ for (const attribute of ["mask", "filter"]) {
7238
+ const value = element.attributes[attribute];
7239
+ if (value !== void 0 && value !== "none") references.push([attribute, value]);
7240
+ }
7086
7241
  element.children.forEach(visit);
7087
7242
  };
7243
+ const references = [];
7088
7244
  visit(root);
7245
+ for (const [attribute, value] of references) {
7246
+ const id = referencedId(value);
7247
+ const target = id === void 0 ? void 0 : ids.get(id);
7248
+ if (target === void 0 || localName(target.name) !== attribute) unsupported.add(attribute);
7249
+ }
7089
7250
  const viewBox = parseViewBox(root.attributes.viewBox);
7090
7251
  const width = absoluteLength(root.attributes.width) ?? viewBox?.width ?? 300;
7091
7252
  const height = absoluteLength(root.attributes.height) ?? viewBox?.height ?? 150;
@@ -7104,6 +7265,28 @@ function parseSvg(source) {
7104
7265
  unsupported: [...unsupported]
7105
7266
  };
7106
7267
  }
7268
+ /** The id a value of the form `url(#id)` names, or undefined for anything else. */
7269
+ function referencedId(value) {
7270
+ return /^\s*url\(\s*['"]?#([^'")]+)['"]?\s*\)\s*$/.exec(value)?.[1];
7271
+ }
7272
+ /**
7273
+ * The `<feDropShadow>` a `<filter>` is, when it is exactly one drop
7274
+ * shadow of the element itself; undefined for any other filter, which
7275
+ * is not drawn.
7276
+ */
7277
+ function dropShadowOf(filter) {
7278
+ const primitives = filter.children.filter((child) => !NOT_PRIMITIVES.has(localName(child.name)));
7279
+ const [primitive] = primitives;
7280
+ if (primitives.length !== 1 || localName(primitive.name) !== "feDropShadow") return;
7281
+ const input = primitive.attributes.in;
7282
+ return input === void 0 || input === "SourceGraphic" ? primitive : void 0;
7283
+ }
7284
+ /** What a `<filter>` may hold that is not a step of it. */
7285
+ const NOT_PRIMITIVES = /* @__PURE__ */ new Set([
7286
+ "title",
7287
+ "desc",
7288
+ "metadata"
7289
+ ]);
7107
7290
  /** An element's name without its namespace prefix: `svg:path` is `path`. */
7108
7291
  function localName(name) {
7109
7292
  const colon = name.indexOf(":");
@@ -7328,24 +7511,201 @@ function drawElement(element, inherited, viewport, context) {
7328
7511
  const opacity = unit(declared.opacity);
7329
7512
  if (opacity < 1) surface.alpha(opacity);
7330
7513
  if (declared["clip-path"] !== void 0) clipTo(declared["clip-path"], viewport, context);
7514
+ const content = (at) => {
7515
+ switch (name) {
7516
+ case "g":
7517
+ case "a":
7518
+ case "switch":
7519
+ drawChildren(element, style, viewport, at);
7520
+ break;
7521
+ case "svg":
7522
+ drawNested(element, style, viewport, at);
7523
+ break;
7524
+ case "use":
7525
+ drawUse(element, style, viewport, at);
7526
+ break;
7527
+ default: {
7528
+ const shape = shapeOf(element, name, viewport);
7529
+ if (shape !== null && style.visible) paintShape(shape, style, viewport, at);
7530
+ }
7531
+ }
7532
+ };
7533
+ const filtered = () => {
7534
+ const filter = declared.filter === void 0 ? void 0 : referencedElement(declared.filter, "filter", context);
7535
+ const shadow = filter === void 0 ? void 0 : dropShadowOf(filter);
7536
+ if (filter === void 0 || shadow === void 0) content(context);
7537
+ else drawWithShadow(element, filter, shadow, style, viewport, context, content);
7538
+ };
7539
+ const mask = declared.mask === void 0 ? void 0 : referencedElement(declared.mask, "mask", context);
7540
+ if (mask === void 0 || context.using.has(mask)) filtered();
7541
+ else drawMasked(element, mask, viewport, context, filtered);
7542
+ surface.restore();
7543
+ }
7544
+ /** The element of a kind that a `url(#id)` value names, if it is one. */
7545
+ function referencedElement(value, kind, context) {
7546
+ const id = referencedId(value);
7547
+ const target = id === void 0 ? void 0 : context.document.ids.get(id);
7548
+ return target !== void 0 && localName(target.name) === kind ? target : void 0;
7549
+ }
7550
+ /**
7551
+ * Draws an element through a `<mask>`: its drawing is a layer, and the
7552
+ * mask's children, drawn into the layer's mask, say how much of it
7553
+ * shows. By their luminance, or by their alpha for `mask-type: alpha`.
7554
+ *
7555
+ * The mask's region and its content are placed in the element's user
7556
+ * space or in fractions of its bounding box, as `maskUnits` and
7557
+ * `maskContentUnits` say; the region is cut to as the layer is.
7558
+ */
7559
+ function drawMasked(element, mask, viewport, context, draw) {
7560
+ const { surface } = context;
7561
+ const attributes = mask.attributes;
7562
+ const declared = declarationsOf(mask, context.document);
7563
+ const bounds = attributes.maskUnits === "userSpaceOnUse" && attributes.maskContentUnits !== "objectBoundingBox" ? void 0 : elementBounds(element, viewport, context);
7564
+ const region = regionOf(attributes, attributes.maskUnits === "userSpaceOnUse", bounds, viewport);
7565
+ surface.beginMaskedLayer(region.x, region.y, region.width, region.height);
7566
+ draw();
7567
+ surface.layerMask(declared["mask-type"] === "alpha" ? "alpha" : "luminance");
7568
+ if (attributes.maskContentUnits === "objectBoundingBox") surface.transform(bounds.width, 0, 0, bounds.height, bounds.x, bounds.y);
7569
+ const root = cascade(INITIAL_STYLE, declarationsOf(context.document.root, context.document), context);
7570
+ context.using.add(mask);
7571
+ drawChildren(mask, cascade(root, declared, context), viewport, {
7572
+ ...context,
7573
+ flood: void 0
7574
+ });
7575
+ context.using.delete(mask);
7576
+ surface.endMaskedLayer();
7577
+ }
7578
+ /**
7579
+ * Draws an element with the drop shadow its filter is, and then the
7580
+ * element over it, both cut to the filter's region as a filter's result
7581
+ * is.
7582
+ *
7583
+ * The shadow is the element again, every paint of it the flood colour,
7584
+ * moved by `dx` and `dy` and blurred by `stdDeviation`: its alpha in
7585
+ * the flood colour, which is what `<feDropShadow>` makes. It is drawn
7586
+ * as a layer composited at the flood opacity, so where two of a group's
7587
+ * shapes overlap their shadow is not darker; a host without layers
7588
+ * draws it shape by shape, which differs only there.
7589
+ */
7590
+ function drawWithShadow(element, filter, shadow, style, viewport, context, draw) {
7591
+ const { surface } = context;
7592
+ const attributes = filter.attributes;
7593
+ const userSpace = attributes.filterUnits === "userSpaceOnUse";
7594
+ const primitivesInBox = attributes.primitiveUnits === "objectBoundingBox";
7595
+ const bounds = userSpace && !primitivesInBox ? void 0 : elementBounds(element, viewport, context);
7596
+ const region = regionOf(attributes, userSpace, bounds, viewport);
7597
+ if (!(region.width > 0) || !(region.height > 0)) return;
7598
+ const declared = declarationsOf(shadow, context.document);
7599
+ const number = (value, fallback) => {
7600
+ const parsed = value === void 0 ? NaN : parseFloat(value);
7601
+ return Number.isFinite(parsed) ? parsed : fallback;
7602
+ };
7603
+ let dx = number(declared.dx, 2);
7604
+ let dy = number(declared.dy, 2);
7605
+ const [sx, sy] = numbersIn(declared.stdDeviation ?? "2");
7606
+ let deviation = Math.max(0, sy === void 0 ? sx ?? 2 : ((sx ?? 0) + sy) / 2);
7607
+ if (primitivesInBox) {
7608
+ dx *= bounds.width;
7609
+ dy *= bounds.height;
7610
+ deviation *= Math.sqrt((bounds.width ** 2 + bounds.height ** 2) / 2);
7611
+ }
7612
+ const color = colorValue(declared["flood-color"] ?? "black", style, context) ?? BLACK_COLOR;
7613
+ const opacity = unit(declared["flood-opacity"]);
7614
+ surface.save();
7615
+ surface.beginPath();
7616
+ surface.rect(region.x, region.y, region.width, region.height);
7617
+ surface.clip();
7618
+ if (opacity > 0) {
7619
+ surface.save();
7620
+ if (opacity < 1) surface.alpha(opacity);
7621
+ surface.beginMaskedLayer(region.x, region.y, region.width, region.height);
7622
+ surface.translate(dx, dy);
7623
+ if (deviation > 0) surface.blur(deviation);
7624
+ draw({
7625
+ ...context,
7626
+ flood: color
7627
+ });
7628
+ surface.endMaskedLayer();
7629
+ surface.restore();
7630
+ }
7631
+ draw(context);
7632
+ surface.restore();
7633
+ }
7634
+ /**
7635
+ * A mask's or a filter's region: its `x`, `y`, `width` and `height` in
7636
+ * user space, or in fractions of the element's bounding box, which is
7637
+ * where they are by default and where they default to a tenth beyond
7638
+ * it on every side.
7639
+ */
7640
+ function regionOf(attributes, userSpace, bounds, viewport) {
7641
+ if (userSpace) return {
7642
+ x: length(attributes.x ?? "-10%", viewport.width),
7643
+ y: length(attributes.y ?? "-10%", viewport.height),
7644
+ width: length(attributes.width ?? "120%", viewport.width),
7645
+ height: length(attributes.height ?? "120%", viewport.height)
7646
+ };
7647
+ const box = bounds;
7648
+ return {
7649
+ x: box.x + fraction(attributes.x ?? "-10%") * box.width,
7650
+ y: box.y + fraction(attributes.y ?? "-10%") * box.height,
7651
+ width: fraction(attributes.width ?? "120%") * box.width,
7652
+ height: fraction(attributes.height ?? "120%") * box.height
7653
+ };
7654
+ }
7655
+ /** A fraction written as a number or a percentage: `0.5` and `50%` alike. */
7656
+ function fraction(value) {
7657
+ const trimmed = value.trim();
7658
+ const parsed = trimmed.endsWith("%") ? parseFloat(trimmed) / 100 : parseFloat(trimmed);
7659
+ return Number.isFinite(parsed) ? parsed : 0;
7660
+ }
7661
+ /**
7662
+ * An element's bounding box in its own user space, as `getBBox` gives
7663
+ * it: its geometry and its children's through their transforms, without
7664
+ * a stroke and without its own transform.
7665
+ */
7666
+ function elementBounds(element, viewport, context) {
7667
+ const bounds = new BoundsSurface();
7668
+ addBounds(element, IDENTITY$1, viewport, context, bounds, /* @__PURE__ */ new Set());
7669
+ return bounds.bounds();
7670
+ }
7671
+ function addBounds(element, matrix, viewport, context, bounds, using) {
7672
+ const name = localName(element.name);
7673
+ const into = new TransformedSurface(bounds, matrix);
7674
+ /** A child, or a used element, under its own transform. */
7675
+ const add = (child, at) => {
7676
+ const declared = declarationsOf(child, context.document);
7677
+ if (declared.display === "none") return;
7678
+ addBounds(child, declared.transform === void 0 ? at : multiply(at, parseTransform$1(declared.transform)), viewport, context, bounds, using);
7679
+ };
7331
7680
  switch (name) {
7332
7681
  case "g":
7333
7682
  case "a":
7334
7683
  case "switch":
7335
- drawChildren(element, style, viewport, context);
7336
- break;
7684
+ for (const child of element.children) if (!NOT_DRAWN.has(localName(child.name))) add(child, matrix);
7685
+ return;
7686
+ case "use": {
7687
+ const target = referenced(element, context.document);
7688
+ if (target === void 0 || using.has(element)) return;
7689
+ using.add(element);
7690
+ add(target, multiply(matrix, [
7691
+ 1,
7692
+ 0,
7693
+ 0,
7694
+ 1,
7695
+ length(element.attributes.x, viewport.width),
7696
+ length(element.attributes.y, viewport.height)
7697
+ ]));
7698
+ using.delete(element);
7699
+ return;
7700
+ }
7337
7701
  case "svg":
7338
- drawNested(element, style, viewport, context);
7339
- break;
7340
- case "use":
7341
- drawUse(element, style, viewport, context);
7342
- break;
7343
- default: {
7344
- const shape = shapeOf(element, name, viewport);
7345
- if (shape !== null && style.visible) paintShape(shape, style, viewport, context);
7702
+ case "symbol": {
7703
+ const a = element.attributes;
7704
+ into.rect(length(a.x, viewport.width), length(a.y, viewport.height), length(a.width ?? "100%", viewport.width), length(a.height ?? "100%", viewport.height));
7705
+ return;
7346
7706
  }
7707
+ default: shapeOf(element, name, viewport)?.trace(into);
7347
7708
  }
7348
- surface.restore();
7349
7709
  }
7350
7710
  /** A nested `<svg>`: a viewport of its own, at its x and y. */
7351
7711
  function drawNested(element, style, viewport, context) {
@@ -7475,6 +7835,11 @@ function paintShape(shape, style, viewport, context) {
7475
7835
  */
7476
7836
  function setPaint(paint, role, shape, style, viewport, context) {
7477
7837
  if (paint.kind === "none") return false;
7838
+ if (context.flood !== void 0) {
7839
+ if (role === "fill") context.surface.fillColor(context.flood);
7840
+ else context.surface.strokeColor(context.flood);
7841
+ return true;
7842
+ }
7478
7843
  if (paint.kind === "color") {
7479
7844
  if (role === "fill") context.surface.fillColor(paint.color);
7480
7845
  else context.surface.strokeColor(paint.color);
@@ -8477,14 +8842,14 @@ var MotionLayer = class {
8477
8842
  }
8478
8843
  drive(cell, to, timing) {
8479
8844
  if (timing.spring !== void 0) return this.host.spring(cell, to, {
8480
- spring: springSpec(timing.spring),
8845
+ spring: springIn(motionOf(this.host.node), timing.spring),
8481
8846
  delay: timing.delay,
8482
8847
  reducedMotion: timing.reducedMotion,
8483
8848
  restDelta: .002
8484
8849
  });
8485
8850
  return this.host.animate(cell, to, {
8486
- duration: resolveDuration(timing.duration),
8487
- easing: resolveEasing(timing.easing),
8851
+ duration: durationIn(motionOf(this.host.node), timing.duration),
8852
+ easing: easingIn(motionOf(this.host.node), timing.easing),
8488
8853
  delay: timing.delay,
8489
8854
  reducedMotion: timing.reducedMotion
8490
8855
  });
@@ -8500,17 +8865,6 @@ var MotionLayer = class {
8500
8865
  function channelEpsilon(channel) {
8501
8866
  return channel === "x" || channel === "y" ? .01 : 1e-4;
8502
8867
  }
8503
- function springSpec(spring) {
8504
- return typeof spring === "string" ? defaultMotion.springs[spring] : spring;
8505
- }
8506
- function resolveDuration(duration) {
8507
- if (duration === void 0) return defaultMotion.durations.normal;
8508
- return typeof duration === "number" ? duration : defaultMotion.durations[duration];
8509
- }
8510
- function resolveEasing(easing) {
8511
- if (easing === void 0) return easings.standard;
8512
- return typeof easing === "function" ? easing : easings[easing] ?? easings.standard;
8513
- }
8514
8868
  /**
8515
8869
  * Moves an element to a visual state, and optionally in from another.
8516
8870
  *
@@ -8553,7 +8907,7 @@ var MotionController = class {
8553
8907
  attach() {
8554
8908
  this.layer.measure(this.host.flowBox());
8555
8909
  if (this.args.initial !== void 0) this.layer.snapTo(resolveMotionState(this.args.initial));
8556
- this.host.onLayout(() => this.layer.measure(this.host.flowBox()));
8910
+ this.host.onFlowLayout(() => this.layer.measure(this.host.flowBox()));
8557
8911
  this.aim();
8558
8912
  }
8559
8913
  update(args) {
@@ -8849,13 +9203,13 @@ var SharedElementController = class {
8849
9203
  const cell = geometry.cell(field);
8850
9204
  const to = targets[field];
8851
9205
  (timing.spring !== void 0 ? this.host.spring(cell, to, {
8852
- spring: springSpec(timing.spring),
9206
+ spring: springIn(motionOf(this.host.node), timing.spring),
8853
9207
  delay: timing.delay,
8854
9208
  reducedMotion: timing.reducedMotion,
8855
9209
  restDelta: .5
8856
9210
  }) : this.host.animate(cell, to, {
8857
- duration: resolveDuration(timing.duration),
8858
- easing: resolveEasing(timing.easing),
9211
+ duration: durationIn(motionOf(this.host.node), timing.duration),
9212
+ easing: easingIn(motionOf(this.host.node), timing.easing),
8859
9213
  delay: timing.delay,
8860
9214
  reducedMotion: timing.reducedMotion
8861
9215
  })).subscribe({ complete: done });
@@ -9377,7 +9731,7 @@ const scrollPosition = defineModifier({
9377
9731
  if (settling === 1) args.onSettled?.(offset);
9378
9732
  } });
9379
9733
  };
9380
- host.onLayout(() => {
9734
+ host.onFlowLayout(() => {
9381
9735
  const offset = host.scrollOffset();
9382
9736
  if (offset === null || last !== null && last.x === offset.x && last.y === offset.y) return;
9383
9737
  last = offset;
@@ -9427,7 +9781,7 @@ const publishInset = defineModifier({
9427
9781
  if (write === null) write = source.publish(insets);
9428
9782
  else write(insets);
9429
9783
  };
9430
- host.onLayout(publish);
9784
+ host.onFlowLayout(publish);
9431
9785
  publish();
9432
9786
  host.own(() => {
9433
9787
  write?.();
@@ -12116,7 +12470,7 @@ function pushInstance(out, x, y, width, height, color, radius, opacity, borderWi
12116
12470
  */
12117
12471
  function pushShadows(out, rec, paint, opacity, transform, clip, inset) {
12118
12472
  const shadows = paint.boxShadows;
12119
- const radius = borderRadiusIsZero(paint.borderRadius) ? 0 : uniformBorderRadius(paint.borderRadius);
12473
+ const radius = borderRadiusIsZero(paint.borderRadius) ? 0 : fittedShadowRadius(uniformBorderRadius(paint.borderRadius), rec.width, rec.height);
12120
12474
  for (let i = shadows.length - 1; i >= 0; i--) {
12121
12475
  const shadow = shadows[i];
12122
12476
  if (shadow.inset === true !== inset || shadow.color.a <= 0) continue;
@@ -16033,6 +16387,12 @@ const MAX_CADENCE_MS = 50;
16033
16387
  const WATCH_REFRESHES = 2;
16034
16388
  const IDLE_TICKS_BEFORE_STOP = 4;
16035
16389
  /**
16390
+ * How long a frame waits for this thread's own refresh before a timer
16391
+ * draws it instead; see `watchLocal`. Far longer than any display's
16392
+ * refresh, so it never stands in for one that is coming.
16393
+ */
16394
+ const LOCAL_WATCH_MS = 250;
16395
+ /**
16036
16396
  * Timer-backed clock that works in the browser main thread,
16037
16397
  * in a Worker, and in Node.
16038
16398
  */
@@ -16146,6 +16506,8 @@ const MAX_QUEUED_REFRESHES = 8;
16146
16506
  const RETRY_LOCAL_MS = 2e3;
16147
16507
  /** The most refreshes a frame is given: two, sixty at 120 Hz; slower than that is no smoother. */
16148
16508
  const MAX_STRIDE = 2;
16509
+ /** How many times faster than the display measured at start a refined beat may read before it is not believed. */
16510
+ const MAX_STRIDE_OFF = 4;
16149
16511
  function localAnimationFrame() {
16150
16512
  const host = globalThis;
16151
16513
  return typeof host.requestAnimationFrame === "function" ? host.requestAnimationFrame.bind(host) : null;
@@ -16191,6 +16553,10 @@ var UiHostFrameClock = class {
16191
16553
  /** This thread's own `requestAnimationFrame`, or null where there is none. */
16192
16554
  local;
16193
16555
  localHandle = null;
16556
+ /** This thread's own refreshes so far, which `watchLocal` counts on. */
16557
+ localRefreshes = 0;
16558
+ /** The timer standing by for a refresh that does not come; see `watchLocal`. */
16559
+ localWatch = null;
16194
16560
  /** Whether the page is hidden, when this thread's refreshes do not come. */
16195
16561
  hidden = false;
16196
16562
  timeOrigin;
@@ -16243,8 +16609,10 @@ var UiHostFrameClock = class {
16243
16609
  this.armTimer();
16244
16610
  return;
16245
16611
  }
16612
+ this.watchLocal();
16246
16613
  if (this.localHandle === null) this.localHandle = this.local((time) => {
16247
16614
  this.localHandle = null;
16615
+ this.localRefreshes++;
16248
16616
  this.recordLocal(time);
16249
16617
  if (this.pending) {
16250
16618
  const started = this.now();
@@ -16258,6 +16626,42 @@ var UiHostFrameClock = class {
16258
16626
  this.armTimer();
16259
16627
  }
16260
16628
  /**
16629
+ * Draws a wanted frame on a timer when this thread's own refreshes
16630
+ * have stopped coming on a page that says it is shown.
16631
+ *
16632
+ * They do stop. A window that is shown but not composited (a browser
16633
+ * pane hidden inside a desktop app, a window behind others on some
16634
+ * systems) refreshes a page once a second or not at all, while
16635
+ * `document.visibilityState` stays `visible`, so `setHidden` never
16636
+ * hears of it; and a worker whose canvas the compositor is behind on
16637
+ * is not given another refresh until it catches up. A frame asked for
16638
+ * then waited for a refresh that did not come, and with no timer on
16639
+ * this path, nothing else drew it: the application stopped answering,
16640
+ * with its last frame on screen.
16641
+ *
16642
+ * One timer, a quarter of a second long, armed while frames are wanted
16643
+ * and never more than one: it draws a frame only when not one refresh
16644
+ * came in the whole of it. A compositor that is answering, however
16645
+ * slowly the frames themselves run, always beats it, so it never
16646
+ * stands in for a refresh that is coming (see the spec about a blocked
16647
+ * host thread); it costs four wake-ups a second while something
16648
+ * animates, against one per refresh for a per-frame watch.
16649
+ */
16650
+ watchLocal() {
16651
+ if (this.localWatch !== null) return;
16652
+ const seen = this.localRefreshes;
16653
+ this.localWatch = setTimeout(() => {
16654
+ this.localWatch = null;
16655
+ if (!this.pending || this.local === null) return;
16656
+ if (this.localRefreshes === seen) {
16657
+ this.localHandle = null;
16658
+ this.deliver(this.now());
16659
+ if (!this.pending) return;
16660
+ }
16661
+ this.watchLocal();
16662
+ }, LOCAL_WATCH_MS);
16663
+ }
16664
+ /**
16261
16665
  * The page was hidden or shown. While it is hidden this thread's own
16262
16666
  * refreshes stop, so a frame asked for is paced by the timer, as a
16263
16667
  * hosted clock is when its host stops ticking; one already waiting
@@ -16390,6 +16794,7 @@ var UiHostFrameClock = class {
16390
16794
  const cadence = this.cadenceMs();
16391
16795
  let interval = cadence !== null && Math.abs(cadence - this.display.interval) > this.display.interval * NEW_DISPLAY ? cadence : this.display.interval;
16392
16796
  for (let pass = 0; pass < BEAT_PASSES; pass++) interval = this.refineInterval(interval);
16797
+ if (!(interval >= this.display.interval / MAX_STRIDE_OFF && interval <= MAX_CADENCE_MS)) interval = this.display.interval;
16393
16798
  const latest = this.refreshes[this.refreshes.length - 1];
16394
16799
  let earliest = Infinity;
16395
16800
  for (const time of this.refreshes) {
@@ -16435,7 +16840,8 @@ var UiHostFrameClock = class {
16435
16840
  deliverOnBeat(time) {
16436
16841
  const beat = this.beat();
16437
16842
  let refresh = time - ((time - beat.start) % beat.interval + beat.interval) % beat.interval;
16438
- while (refresh < this.lastLocked + (this.stride - .5) * beat.interval) refresh += beat.interval;
16843
+ const after = this.lastLocked + (this.stride - .5) * beat.interval;
16844
+ if (refresh < after) refresh += Math.ceil((after - refresh) / beat.interval) * beat.interval;
16439
16845
  this.lastLocked = refresh;
16440
16846
  this.refreshesSinceFrame = 0;
16441
16847
  const started = this.now();
@@ -16571,8 +16977,37 @@ var UiHostFrameClock = class {
16571
16977
  const cadence = this.cadenceMs();
16572
16978
  return cadence === null ? this.fallbackMs : Math.max(1, Math.min(this.fallbackMs, cadence));
16573
16979
  }
16980
+ /**
16981
+ * Draws the pending frame now, on this clock's timeline, and nothing
16982
+ * when none is pending (`FrameService.flush`): for a tool that changed
16983
+ * the screen and must read it drawn, in a window that may be sent no
16984
+ * refreshes. It is not a refresh, so it teaches the clock nothing about
16985
+ * the display. Handed to `tick` as one, with this thread's time, which
16986
+ * is not the host's, it took the beat backwards; see `tick`.
16987
+ */
16988
+ flush() {
16989
+ if (this.pending) this.drawNow();
16990
+ }
16991
+ /**
16992
+ * Draws the pending frame now, without waiting for a refresh: on the
16993
+ * display's beat when frames are timed on it, so its time is the next
16994
+ * refresh's and never one already drawn for; else at this moment, on
16995
+ * the timeline the clock's frames are on.
16996
+ */
16997
+ drawNow() {
16998
+ this.clearFallback();
16999
+ if (this.locked && this.display !== null && this.refreshes.length > 0 && this.lastTickTime !== null) {
17000
+ this.deliverOnBeat(this.lastTickTime);
17001
+ return;
17002
+ }
17003
+ this.deliver(this.local !== null ? this.now() : this.hostTime());
17004
+ }
16574
17005
  cancelFrame() {
16575
17006
  this.pending = false;
17007
+ if (this.localWatch !== null) {
17008
+ clearTimeout(this.localWatch);
17009
+ this.localWatch = null;
17010
+ }
16576
17011
  this.clearFallback();
16577
17012
  if (this.local === null) this.setActive(false);
16578
17013
  }
@@ -16592,11 +17027,19 @@ var UiHostFrameClock = class {
16592
17027
  * it is needed rather than negotiating every frame.
16593
17028
  */
16594
17029
  tick(time) {
17030
+ const backwards = this.lastTickTime !== null && time < this.lastTickTime;
17031
+ if (backwards && this.pending) {
17032
+ this.idleTicks = 0;
17033
+ this.drawNow();
17034
+ return;
17035
+ }
16595
17036
  this.hosted = true;
16596
17037
  this.stalled = false;
16597
- this.hostOffset = time - this.now();
16598
- this.recordCadence(time);
16599
- if (this.locked && this.display !== null) {
17038
+ if (!backwards) {
17039
+ this.hostOffset = time - this.now();
17040
+ this.recordCadence(time);
17041
+ }
17042
+ if (this.locked && this.display !== null && !backwards) {
16600
17043
  this.refreshes.push(time);
16601
17044
  if (this.refreshes.length > BEAT_SAMPLES) this.refreshes.shift();
16602
17045
  this.refreshesSinceFrame++;
@@ -16605,6 +17048,7 @@ var UiHostFrameClock = class {
16605
17048
  this.idleTicks = 0;
16606
17049
  const queued = this.now() - this.toLocal(time) > this.display.interval;
16607
17050
  if (this.refreshesSinceFrame >= this.stride && (!queued || this.refreshesSinceFrame >= MAX_QUEUED_REFRESHES)) this.deliverOnBeat(time);
17051
+ else this.armTimer();
16608
17052
  return;
16609
17053
  }
16610
17054
  }
@@ -17598,6 +18042,6 @@ function recordsEqual(a, b) {
17598
18042
  return true;
17599
18043
  }
17600
18044
  //#endregion
17601
- export { AlignContent, AnimationDriver, BOX_SHADOW_BLUR_REACH, BUTTON_INTERACTION, Box, Button, CARET_BLINK_MS, CARET_WIDTH, CLIP_STRIDE_BYTES, CLIP_STRIDE_FLOATS, Canvas2DRenderer, CanvasPlatformSurface, CanvasSurface, CanvasTextMeasurer, CharacterCountTextMeasurer, Column, CommandKind, Constraints, CrossAxisAlignment, DEFAULT_BLOCK_SIZE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_WEIGHT, DEFAULT_LINE_HEIGHT_FACTOR, DEFAULT_TEXT_COLOR, DefaultImageResolver, DefaultSvgResolver, DefaultVideoResolver, DirtyFlags, DirtyNodeSet, EDITOR_PROP, ELLIPSIS, EMPTY_RECORDING, EXTERNAL_FILES, EditableLayout, EditableText, EditableTextModel, EnvironmentNotifier, FlexDirection, FocusNotifier, GLYPH_SUBPIXEL_PHASES, GlyphShaper, Grid, INSPECTOR_HEAT_MS, INSTANCE_STRIDE_BYTES, INSTANCE_STRIDE_FLOATS, IconRasterizer, LABEL_PADDING_X, LayoutEngine, LayoutInspector, LayoutNotifier, LayoutRecord, LazyColumn, LazyGrid, LazyRow, LazySheet, MARK_PREFIX, MAX_GRADIENT_STOPS, MAX_MEASURES_PER_CHILD, MOTION_CHANNELS, MOTION_REST, MOUSE_POINTER, MainAxisAlignment, Mp3Frames, NO_CLIP_INDEX, NodeTransitions, Paint, PaintPictureCache, PaintRecorder, PaintTarget, ParagraphTextMeasurer, PrimitiveKind, Responsive, Row, SCROLLBAR_FADE_MS, SCROLLBAR_HOVER_ZONE, SCROLLBAR_INSET, SCROLLBAR_LINGER_MS, SCROLLBAR_MIN_THUMB, SCROLLBAR_THICKNESS, ScrollView, Stack, TEXTURED_STRIDE_BYTES, TEXTURED_STRIDE_FLOATS, TEXT_MATCHES_PROP, TEXT_RUN_ID_SEPARATOR, TEXT_SELECTION_PROP, TOUCH_TARGET, Text, UI_ROLES, UI_SEMANTIC_STATES, UI_SUBGRID_AXES, UiAnimation, UiAnimationFrameClock, UiBasicColors, UiBeforeInputEvent, UiBinding, UiBorderRadiuses, UiChildrenBinding, UiCompositionEvent, UiContainerSizeSource, UiDragSession, UiEditingController, UiEnvironment, UiEnvironmentKeys, UiEventBinding, UiEventType, UiFindController, UiFocusEvent, UiFocusManager, UiFrame, UiGestureEvent, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInputEvent, UiInsetRegistry, UiKeyboardController, UiKeyboardEvent, UiManualFrameClock, UiModifierSet, UiNode, UiNodeType, UiPasteEvent, UiPinchEvent, UiPinchRecognizer, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiProperties, UiScheduler, UiSelectionChangeEvent, UiSelectionController, UiSharedElements, UiShortcutRegistry, UiSpring, UiTextChangeEvent, UiTimerFrameClock, UiTouchScroller, UiTransforms, UiTween, UiUnknownModifierPropertyError, UiVirtualSheet, UiVirtualWindow, UiVisualState, UiWheelController, UiWheelDeltaMode, UiWheelEvent, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPUError, WebGPUGlyphAtlas, WebGPUGlyphPages, WebGPURenderer, WebGPUSurface, WebGPUTextureCache, accumulatedOffsetTo, adjacentField, animateLayout, applyCanvasTextStyle, assertModifierList, assertTransitionMap, auto, autoFocus, bandOf, borderRadius, borderRadiusCorners, borderRadiusEqual, borderRadiusIsZero, borderRadiusValuesEqual, borderShapes, borders, boxShadow, boxShadowArraysEqual, boxShadowRadius, boxShadowReach, boxShadowValuesEqual, boxShadowsEqual, breakpoint, bufferSource, buildFontString, buildRenderList, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, bundle, canDecodeVideo, capturePointer, caretRectFor, caretVisibleAt, clampSize, clearFontStacks, clearLinkHover, clearMatchRanges, clearOverrideProperty, clearSelectionRange, clickOutside, closestPropertyName, colorToCss, colorToHex, colorToRgba, colorValuesEqual, colorsEqual, colorsEqualPalette, commandForKey, comparePositions, computeObjectFitRect, constraintsEqual, containerBands, contentOffset, contextMenu, contrastRatio, createCanvasSurface, createCanvasTextStyle, createElement, createEnvironmentKey, createPaintState, createTextCache, createTween, createWebGPUSurface, cubicBezier, cueAt, darkColors, darkTheme, decorated, decorationColor, decorationRect, defaultMotion, defaultShadows, defaultShapes, defaultSpacing, defaultTextStyle, defaultTypography, defaultUnits, defaultVisualState, defineModifier, defineProperty, defineThemeExtension, demuxMp4Audio, demuxMp4Video, densityFactors, describeLength, describeOverrides, describeShortcut, detectEditingPlatform, diffSemantics, dragSessionFor, dragSource, draggable, drawOverlayShapes, drawSvg, drawText, dropIndexShifts, dropTarget, easings, edgeField, editableSpansOf, editingGroupOf, editorFor, editorOf, fade, fillTextRects, findEnvironmentKey, findMatchesIn, findPropertyDefinition, flattenTextSpans, focusRing, fontStackFor, formatConstraints, formatExplanation, formatShortcut, fr, getPropertyNames, glyphCount, gradientPaint, gradientsEqual, graphemeBoundaries, hasDecorationPhase, hasDrawnText, hasTextLinks, hasThemeExtension, hasVisualState, hiddenRangesOf, highContrastColors, hoverable, iconKey, iconSource, imageSource, inheritedPropertyFlags, inheritedPropertyNames, initializeWebGPU, inputsEqual, insetPadding, insetsEqual, interactive, interpolateColor, interpolateNumber, interpolateTransform, interpolatorFor, isAutoLength, isComponentLikeElement, isEditableNode, isFrLength, isImeKey, isLayoutProtocol, isMinMaxTrack, isMotionRest, isMultiline, isNodeFocusable, isNodeHitTestable, isNodeInert, isNodeSelectable, isNodeTabStop, isObservable, isPaintVisible, isPercentLength, isPrintable, isReadOnly, isScrollContainer, isShapeName, isSubtreeInert, isSvgSource, isTypographyRole, isUiChild, isUiElement, isUiModifier, isUiRole, isUiSemanticState, isVideoSurface, isWebGPUAvailable, labelNode, labelOrigin, layoutParagraph, layoutTextLines, lazySource, lengths, lightColors, lightTheme, lineEndAt, lineIndexAtY, lineIndexForOffset, lineLimit, lineStartAt, linear, linearGradient, linkHoverOf, linkOf, linkRunAtPointIn, markInstant, markNow, matchRangesOf, measure, measureFlow, measureSpan, mediaLoadsInFlight, minmax, motion, nextCaretToggle, nextGraphemeEnd, nextWordEnd, noInsets, noKeyModifiers, noModifiers, noThemeExtensions, normalizeBorderRadius, normalizeColor, normalizeStates, normalizeTextAlign, normalizeTransition, normalizeVerticalAlign, observeViewportInsets, offsetAtPoint, offsetAtPointIn, offsetAtX, offsetForVerticalMove, overrideSources, paintPictures, paintValuesEqual, paintsAfterChildren, paragraphGeometry, paragraphGeometryFrom, parseAlignContent, parseColor, parseCrossAxisAlignment, parseFlexDirection, parseMainAxisAlignment, parseShortcut, parseSvg, parseTransform, parseWebVtt, pathValuesEqual, percent, performanceMarksEnabled, pinchable, placeGridItems, pointerDeviceOf, pointerEventsOf, pop, prepareInputSurface, pressable, previousGraphemeStart, previousWordStart, propertyEffects, propertyIsInherited, propertyNarrowers, propertyValuesEqual, propertyValuesEqualByName, proportionalFontMetrics, provideEnvironment, publishInset, radialGradient, raiseContrast, rangeSource, readMp3Header, recordsEqual, registerFontStack, relativeLuminance, reorderable, repeat, replayPaint, resetOverrideWarnings, resetTransitionWarnings, resolveBoolean, resolveCursor, resolveLength, resolveMotionState, resolveNumber, resolvePaintState, resolveProperty, resolvePropertyByName, resolveString, resolvedSpansOf, rewalkSemantics, rgb8, rgba, rotateFrom, runCanvasStyleInto, runFontString, sameArgs, scaleFrom, scaleSpacing, scrollBounds, scrollLeaderOf, scrollPosition, scrollRange, scrollbarThumb, scrollbarThumbs, scrollbarZoneAt, scrollsFromRight, selectableTextNodes, selectableTextOf, selectionRangeOf, selectionRects, selectionRectsIn, semanticsInertAbove, semanticsMemory, setLinkHover, setMatchRanges, setPerformanceMarks, setSelectionRange, shadowsEqual, shadowsOf, shapesEqual, sharedElement, sheetSource, shortcut, shortcutKeyCaps, shortcuts, sizeContainer, sizeGridTracks, slideDown, slideFrom, slideUp, spacingEqual, spacingSteps, spanAtOffset, spannedRunsFor, spannedTextOf, spansDifferOnlyInPaint, splitMp3Frames, spring, statesEqual, steps, svgPaint, syncEditorValue, textContentOf, textInputOf, textRunBackgrounds, textRunDecorations, textRunOfRecordId, textRuns, textSpansEqual, textStylesEqual, themeExtension, themeExtensionsEqual, themeTokens, themesEqual, tightenConstraints, touchActionFor, tracePathData, traceRoundedRect, transform, transformIsIdentity, transformsEqual, tween, typographyEqual, uniformBorderRadius, unitsEqual, unknownContainerSize, validateGradient, validateRole, validateStates, validateSubgrid, videoFrameSize, videoSource, visualState, visualStatesEqual, wheelDeltaYOf, withContrast, withDensity, withOverrideSource, withPointer, withThemeExtension, wordRangeAt, wordRangeIn, writeDeclaredProperty, writeOverrideProperty };
18045
+ export { AlignContent, AnimationDriver, BOX_SHADOW_BLUR_REACH, BUTTON_INTERACTION, Box, Button, CARET_BLINK_MS, CARET_WIDTH, CLIP_STRIDE_BYTES, CLIP_STRIDE_FLOATS, Canvas2DRenderer, CanvasPlatformSurface, CanvasSurface, CanvasTextMeasurer, CharacterCountTextMeasurer, Column, CommandKind, Constraints, CrossAxisAlignment, DEFAULT_BLOCK_SIZE, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_WEIGHT, DEFAULT_LINE_HEIGHT_FACTOR, DEFAULT_TEXT_COLOR, DefaultImageResolver, DefaultSvgResolver, DefaultVideoResolver, DirtyFlags, DirtyNodeSet, EDITOR_PROP, ELLIPSIS, EMPTY_RECORDING, EXTERNAL_FILES, EditableLayout, EditableText, EditableTextModel, EnvironmentNotifier, FlexDirection, FocusNotifier, GLYPH_SUBPIXEL_PHASES, GlyphShaper, Grid, INSPECTOR_HEAT_MS, INSTANCE_STRIDE_BYTES, INSTANCE_STRIDE_FLOATS, IconRasterizer, LABEL_PADDING_X, LayoutEngine, LayoutInspector, LayoutNotifier, LayoutRecord, LazyColumn, LazyGrid, LazyRow, LazySheet, MARK_PREFIX, MAX_GRADIENT_STOPS, MAX_MEASURES_PER_CHILD, MOTION_CHANNELS, MOTION_REST, MOUSE_POINTER, MainAxisAlignment, Mp3Frames, NO_CLIP_INDEX, NodeTransitions, Paint, PaintPictureCache, PaintRecorder, PaintTarget, ParagraphTextMeasurer, PrimitiveKind, Responsive, Row, SCROLLBAR_FADE_MS, SCROLLBAR_HOVER_ZONE, SCROLLBAR_INSET, SCROLLBAR_LINGER_MS, SCROLLBAR_MIN_THUMB, SCROLLBAR_THICKNESS, ScrollView, ShownAsKey, Stack, TEXTURED_STRIDE_BYTES, TEXTURED_STRIDE_FLOATS, TEXT_MATCHES_PROP, TEXT_RUN_ID_SEPARATOR, TEXT_SELECTION_PROP, TOUCH_TARGET, Text, UI_ROLES, UI_SEMANTIC_STATES, UI_SUBGRID_AXES, UiAnimation, UiAnimationFrameClock, UiBasicColors, UiBeforeInputEvent, UiBinding, UiBorderRadiuses, UiChildrenBinding, UiClock, UiCompositionEvent, UiContainerSizeSource, UiDragSession, UiEditingController, UiEnvironment, UiEnvironmentKeys, UiEventBinding, UiEventType, UiFindController, UiFocusEvent, UiFocusManager, UiFrame, UiGestureEvent, UiGestureRecognizer, UiGraph, UiGraphBuilder, UiHitTester, UiHostFrameClock, UiInputDispatcher, UiInputEvent, UiInsetRegistry, UiKeyboardController, UiKeyboardEvent, UiManualFrameClock, UiModifierSet, UiNode, UiNodeType, UiPasteEvent, UiPinchEvent, UiPinchRecognizer, UiPlatformAdapter, UiPointerController, UiPointerEvent, UiProperties, UiScheduler, UiSelectionChangeEvent, UiSelectionController, UiSharedElements, UiShortcutRegistry, UiSpring, UiTextChangeEvent, UiTimerFrameClock, UiTouchScroller, UiTransforms, UiTween, UiUnknownModifierPropertyError, UiVirtualSheet, UiVirtualWindow, UiVisualState, UiWheelController, UiWheelDeltaMode, UiWheelEvent, VIRTUAL_INDEX_PROP, VIRTUAL_LEAD_PROP, VIRTUAL_SHEET_PROP, VIRTUAL_WINDOW_PROP, WebGPUError, WebGPUGlyphAtlas, WebGPUGlyphPages, WebGPURenderer, WebGPUSurface, WebGPUTextureCache, accumulatedOffsetTo, adjacentField, animateLayout, applyCanvasTextStyle, assertModifierList, assertTransitionMap, auto, autoFocus, bandOf, borderRadius, borderRadiusCorners, borderRadiusEqual, borderRadiusIsZero, borderRadiusValuesEqual, borderShapes, borders, boxShadow, boxShadowArraysEqual, boxShadowRadius, boxShadowReach, boxShadowValuesEqual, boxShadowsEqual, breakpoint, bufferSource, buildFontString, buildRenderList, buildSemanticsSubtree, buildSemanticsTree, bumpFontStack, bundle, canDecodeVideo, capturePointer, caretRectFor, caretVisibleAt, clampSize, clearFontStacks, clearLinkHover, clearMatchRanges, clearOverrideProperty, clearSelectionRange, clickOutside, clockOf, closestPropertyName, colorToCss, colorToHex, colorToRgba, colorValuesEqual, colorsEqual, colorsEqualPalette, commandForKey, comparePositions, computeObjectFitRect, constraintsEqual, containerBands, contentOffset, contextMenu, contrastRatio, createCanvasSurface, createCanvasTextStyle, createElement, createEnvironmentKey, createPaintState, createTextCache, createTween, createWebGPUSurface, cubicBezier, cueAt, darkColors, darkTheme, decorated, decorationColor, decorationRect, defaultMotion, defaultShadows, defaultShapes, defaultSpacing, defaultTextStyle, defaultTypography, defaultUnits, defaultVisualState, defineModifier, defineMotion, defineProperty, defineThemeExtension, demuxMp4Audio, demuxMp4Video, densityFactors, describeLength, describeOverrides, describeShortcut, detectEditingPlatform, diffSemantics, dragSessionFor, dragSource, draggable, drawOverlayShapes, drawSvg, drawText, dropIndexShifts, dropTarget, durationIn, easingCss, easingIn, easings, edgeField, editableSpansOf, editingGroupOf, editorFor, editorOf, fade, fillTextRects, findEnvironmentKey, findMatchesIn, findPropertyDefinition, fittedShadowRadius, flattenTextSpans, focusRing, fontStackFor, formatConstraints, formatExplanation, formatShortcut, fr, getPropertyNames, glyphCount, gradientPaint, gradientsEqual, graphemeBoundaries, hasDecorationPhase, hasDrawnText, hasTextLinks, hasThemeExtension, hasVisualState, hiddenRangesOf, highContrastColors, hoverable, iconKey, iconSource, imageSource, inheritedPropertyFlags, inheritedPropertyNames, initializeWebGPU, inputsEqual, insetPadding, insetsEqual, interactive, interpolateColor, interpolateNumber, interpolateTransform, interpolatorFor, isAutoLength, isComponentLikeElement, isEditableNode, isFrLength, isImeKey, isLayoutProtocol, isMinMaxTrack, isMotionRest, isMultiline, isNodeFocusable, isNodeHitTestable, isNodeInert, isNodeSelectable, isNodeTabStop, isObservable, isPaintVisible, isPercentLength, isPrintable, isReadOnly, isScrollContainer, isShapeName, isSubtreeInert, isSvgSource, isTypographyRole, isUiChild, isUiElement, isUiModifier, isUiRole, isUiSemanticState, isVideoSurface, isWebGPUAvailable, labelNode, labelOrigin, layoutParagraph, layoutTextLines, lazySource, lengths, lightColors, lightTheme, lineEndAt, lineIndexAtY, lineIndexForOffset, lineLimit, lineStartAt, linear, linearGradient, linkHoverOf, linkOf, linkRunAtPointIn, markInstant, markNow, matchRangesOf, measure, measureFlow, measureSpan, mediaLoadsInFlight, minmax, motion, motionOf, nextCaretToggle, nextGraphemeEnd, nextWordEnd, noInsets, noKeyModifiers, noModifiers, noThemeExtensions, normalizeBorderRadius, normalizeColor, normalizeStates, normalizeTextAlign, normalizeTransition, normalizeVerticalAlign, observeViewportInsets, offsetAtPoint, offsetAtPointIn, offsetAtX, offsetForVerticalMove, overrideSources, paintPictures, paintValuesEqual, paintsAfterChildren, paragraphGeometry, paragraphGeometryFrom, parseAlignContent, parseColor, parseCrossAxisAlignment, parseFlexDirection, parseMainAxisAlignment, parseShortcut, parseSvg, parseTransform, parseWebVtt, pathValuesEqual, percent, performanceMarksEnabled, pinchable, placeGridItems, pointerDeviceOf, pointerEventsOf, pop, prepareInputSurface, pressable, previousGraphemeStart, previousWordStart, propertyEffects, propertyIsInherited, propertyNarrowers, propertyValuesEqual, propertyValuesEqualByName, proportionalFontMetrics, provideEnvironment, provided, publishInset, radialGradient, raiseContrast, rangeSource, readMp3Header, recordsEqual, registerFontStack, relativeLuminance, reorderable, repeat, replayPaint, resetOverrideWarnings, resetTransitionWarnings, resolveBoolean, resolveCursor, resolveLength, resolveMotionState, resolveNumber, resolvePaintState, resolveProperty, resolvePropertyByName, resolveString, resolvedSpansOf, rewalkSemantics, rgb8, rgba, rotateFrom, runCanvasStyleInto, runFontString, sameArgs, scaleFrom, scaleSpacing, scrollBounds, scrollLeaderOf, scrollPosition, scrollRange, scrollbarThumb, scrollbarThumbs, scrollbarZoneAt, scrollsFromRight, selectableTextNodes, selectableTextOf, selectionRangeOf, selectionRects, selectionRectsIn, semanticsInertAbove, semanticsMemory, setLinkHover, setMatchRanges, setPerformanceMarks, setSelectionRange, shadowsEqual, shadowsOf, shapesEqual, sharedElement, sheetSource, shortcut, shortcutKeyCaps, shortcuts, sizeContainer, sizeGridTracks, slideDown, slideFrom, slideUp, spacingEqual, spacingSteps, spanAtOffset, spannedRunsFor, spannedTextOf, spansDifferOnlyInPaint, splitMp3Frames, spring, springIn, statesEqual, steps, svgPaint, syncEditorValue, textContentOf, textInputOf, textRunBackgrounds, textRunDecorations, textRunOfRecordId, textRuns, textSpansEqual, textStylesEqual, themeExtension, themeExtensionsEqual, themeTokens, themesEqual, tightenConstraints, touchActionFor, tracePathData, traceRoundedRect, transform, transformIsIdentity, transformsEqual, tween, typographyEqual, uniformBorderRadius, unitsEqual, unknownContainerSize, validateGradient, validateRole, validateStates, validateSubgrid, videoFrameSize, videoSource, visualState, visualStatesEqual, wheelDeltaYOf, withContrast, withDensity, withOverrideSource, withPointer, withThemeExtension, wordRangeAt, wordRangeIn, writeDeclaredProperty, writeOverrideProperty };
17602
18046
 
17603
18047
  //# sourceMappingURL=index.js.map