gesso-core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/{CanvasSurface-BpgbOku2.js → CanvasSurface-Cy2UErXI.js} +3366 -2617
- package/dist/CanvasSurface-Cy2UErXI.js.map +1 -0
- package/dist/{index-B5r1ETCh.d.ts → index-CQPJZwhG.d.ts} +753 -310
- package/dist/index.d.ts +2 -2
- package/dist/index.js +550 -205
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/CanvasSurface-BpgbOku2.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,81 +1,5 @@
|
|
|
1
|
-
import { $ as UiPlatformAdapter, $a as
|
|
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-Cy2UErXI.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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
|
792
|
-
const
|
|
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
|
-
|
|
810
|
-
|
|
811
|
-
|
|
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 (
|
|
1235
|
-
if (
|
|
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 = (
|
|
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.
|
|
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
|
-
*
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
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.
|
|
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
|
-
|
|
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;
|
|
@@ -2459,7 +2560,7 @@ var UiGraphBuilder = class {
|
|
|
2459
2560
|
matched.add(anchor);
|
|
2460
2561
|
if (this.reconciledFrom.get(anchor) === element) return anchor;
|
|
2461
2562
|
}
|
|
2462
|
-
this.reconcileChildren(anchor, [resolver.resolve(element, anchorId)]);
|
|
2563
|
+
this.reconcileChildren(anchor, [resolver.resolve(element, anchorId, anchor)]);
|
|
2463
2564
|
this.reconciledFrom.set(anchor, element);
|
|
2464
2565
|
return anchor;
|
|
2465
2566
|
}
|
|
@@ -3572,7 +3673,7 @@ const sizeContainer = defineModifier({
|
|
|
3572
3673
|
const vertical = inset("paddingTop", "paddingY") + inset("paddingBottom", "paddingY");
|
|
3573
3674
|
args.source.report(Math.max(0, box.width - horizontal), Math.max(0, box.height - vertical));
|
|
3574
3675
|
};
|
|
3575
|
-
host.
|
|
3676
|
+
host.onFlowLayout(report);
|
|
3576
3677
|
report();
|
|
3577
3678
|
}
|
|
3578
3679
|
});
|
|
@@ -3617,7 +3718,7 @@ const breakpoint = defineModifier({
|
|
|
3617
3718
|
}
|
|
3618
3719
|
for (const [name, value] of written) host.set(name, value);
|
|
3619
3720
|
};
|
|
3620
|
-
host.
|
|
3721
|
+
host.onFlowLayout(apply);
|
|
3621
3722
|
apply();
|
|
3622
3723
|
}
|
|
3623
3724
|
});
|
|
@@ -5457,6 +5558,12 @@ function dragSessionFor(node) {
|
|
|
5457
5558
|
var LayoutNotifier = class {
|
|
5458
5559
|
listeners = /* @__PURE__ */ new Map();
|
|
5459
5560
|
last = /* @__PURE__ */ new Map();
|
|
5561
|
+
/**
|
|
5562
|
+
* Listeners told about the node's place in the layout and its scroll
|
|
5563
|
+
* offset, and not about where it is drawn (`addFlow`).
|
|
5564
|
+
*/
|
|
5565
|
+
flowListeners = /* @__PURE__ */ new Map();
|
|
5566
|
+
flowLast = /* @__PURE__ */ new Map();
|
|
5460
5567
|
/** Registers a listener; the returned function removes it. */
|
|
5461
5568
|
add(node, listener) {
|
|
5462
5569
|
let forNode = this.listeners.get(node);
|
|
@@ -5475,36 +5582,73 @@ var LayoutNotifier = class {
|
|
|
5475
5582
|
}
|
|
5476
5583
|
};
|
|
5477
5584
|
}
|
|
5585
|
+
/**
|
|
5586
|
+
* Registers a listener told when the node's laid-out box or its own
|
|
5587
|
+
* scroll offset changes, and not when a scroll or a transform above it
|
|
5588
|
+
* moves it on screen; the returned function removes it.
|
|
5589
|
+
*
|
|
5590
|
+
* Most listeners are this kind: a size container, a breakpoint, a
|
|
5591
|
+
* layout animation, a scroll position read only the node's own box
|
|
5592
|
+
* and offset. Told of every move on screen, each of them was asked
|
|
5593
|
+
* on every step of a pan over a design tool's board, 2,600 of them,
|
|
5594
|
+
* to find nothing it reads had changed; and each answer was where
|
|
5595
|
+
* the node was drawn, worked out through every ancestor. Its place in
|
|
5596
|
+
* the layout is its record, read at once.
|
|
5597
|
+
*/
|
|
5598
|
+
addFlow(node, listener) {
|
|
5599
|
+
let forNode = this.flowListeners.get(node);
|
|
5600
|
+
if (forNode === void 0) {
|
|
5601
|
+
forNode = /* @__PURE__ */ new Set();
|
|
5602
|
+
this.flowListeners.set(node, forNode);
|
|
5603
|
+
}
|
|
5604
|
+
forNode.add(listener);
|
|
5605
|
+
return () => {
|
|
5606
|
+
const set = this.flowListeners.get(node);
|
|
5607
|
+
if (set === void 0) return;
|
|
5608
|
+
set.delete(listener);
|
|
5609
|
+
if (set.size === 0) {
|
|
5610
|
+
this.flowListeners.delete(node);
|
|
5611
|
+
this.flowLast.delete(node);
|
|
5612
|
+
}
|
|
5613
|
+
};
|
|
5614
|
+
}
|
|
5478
5615
|
get size() {
|
|
5479
|
-
return this.listeners.size;
|
|
5616
|
+
return this.listeners.size + this.flowListeners.size;
|
|
5480
5617
|
}
|
|
5481
5618
|
/** Whether anything is listening, so a frame can skip the walk. */
|
|
5482
5619
|
isEmpty() {
|
|
5483
|
-
return this.listeners.size === 0;
|
|
5620
|
+
return this.listeners.size === 0 && this.flowListeners.size === 0;
|
|
5484
5621
|
}
|
|
5485
5622
|
/**
|
|
5486
5623
|
* Calls the listeners of every watched node whose box or scroll
|
|
5487
5624
|
* offset differs from what it was last told about.
|
|
5488
5625
|
*/
|
|
5489
|
-
notify(read) {
|
|
5490
|
-
|
|
5491
|
-
|
|
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
|
-
}
|
|
5626
|
+
notify(read, readFlow = read) {
|
|
5627
|
+
notifyEach(this.listeners, this.last, read);
|
|
5628
|
+
notifyEach(this.flowListeners, this.flowLast, readFlow);
|
|
5501
5629
|
}
|
|
5502
5630
|
/** Drops a removed node's listeners, so nothing keeps it alive. */
|
|
5503
5631
|
handleNodeRemoved(node) {
|
|
5504
5632
|
this.listeners.delete(node);
|
|
5505
5633
|
this.last.delete(node);
|
|
5634
|
+
this.flowListeners.delete(node);
|
|
5635
|
+
this.flowLast.delete(node);
|
|
5506
5636
|
}
|
|
5507
5637
|
};
|
|
5638
|
+
/** Calls the listeners of each node whose layout, as `read` gives it, differs from what they were last told. */
|
|
5639
|
+
function notifyEach(listeners, last, read) {
|
|
5640
|
+
for (const [node, forNode] of listeners) {
|
|
5641
|
+
const current = read(node);
|
|
5642
|
+
const previous = last.get(node);
|
|
5643
|
+
if (previous !== void 0 && sameLayout(previous, current)) continue;
|
|
5644
|
+
last.set(node, {
|
|
5645
|
+
box: { ...current.box },
|
|
5646
|
+
scrollX: current.scrollX,
|
|
5647
|
+
scrollY: current.scrollY
|
|
5648
|
+
});
|
|
5649
|
+
for (const listener of forNode) listener(current.box);
|
|
5650
|
+
}
|
|
5651
|
+
}
|
|
5508
5652
|
function sameLayout(a, b) {
|
|
5509
5653
|
return a.scrollX === b.scrollX && a.scrollY === b.scrollY && sameBox(a.box, b.box);
|
|
5510
5654
|
}
|
|
@@ -5615,8 +5759,9 @@ const kind$4 = defineModifier({
|
|
|
5615
5759
|
name: "focusRing",
|
|
5616
5760
|
attach(host, options) {
|
|
5617
5761
|
const shapes = ringShapes(options);
|
|
5762
|
+
const shown = host.environment(ShownAsKey) === "focused";
|
|
5618
5763
|
const sync = () => {
|
|
5619
|
-
host.decorate(host.isFocused() && host.isFocusVisible() ? shapes : null);
|
|
5764
|
+
host.decorate(shown || host.isFocused() && host.isFocusVisible() ? shapes : null);
|
|
5620
5765
|
};
|
|
5621
5766
|
sync();
|
|
5622
5767
|
host.onFocusChange(sync);
|
|
@@ -5772,7 +5917,7 @@ const kind$3 = defineModifier({
|
|
|
5772
5917
|
name: "autoFocus",
|
|
5773
5918
|
attach(host, options) {
|
|
5774
5919
|
let done = false;
|
|
5775
|
-
host.
|
|
5920
|
+
host.onFlowLayout(() => {
|
|
5776
5921
|
if (done) return;
|
|
5777
5922
|
done = true;
|
|
5778
5923
|
host.focus(options);
|
|
@@ -6098,7 +6243,7 @@ var DropTarget = class {
|
|
|
6098
6243
|
}
|
|
6099
6244
|
attach() {
|
|
6100
6245
|
this.registration.sync();
|
|
6101
|
-
this.host.
|
|
6246
|
+
this.host.onFlowLayout(() => this.registration.sync());
|
|
6102
6247
|
this.host.own(() => {
|
|
6103
6248
|
this.stopScrolling();
|
|
6104
6249
|
this.registration.dispose();
|
|
@@ -6825,7 +6970,7 @@ var LayoutAnimation = class {
|
|
|
6825
6970
|
this.baseScaleY = numberOr(declared.scaleY, 1);
|
|
6826
6971
|
this.baseRotation = numberOr(declared.rotation, 0);
|
|
6827
6972
|
}
|
|
6828
|
-
this.host.
|
|
6973
|
+
this.host.onFlowLayout(() => this.handleLayout());
|
|
6829
6974
|
}
|
|
6830
6975
|
makeCell(read, write) {
|
|
6831
6976
|
return {
|
|
@@ -6902,7 +7047,7 @@ var LayoutAnimation = class {
|
|
|
6902
7047
|
}
|
|
6903
7048
|
const named = this.options.spring ?? "snappy";
|
|
6904
7049
|
this.host.spring(cell, 0, {
|
|
6905
|
-
spring:
|
|
7050
|
+
spring: springIn(motionOf(this.host.node), named),
|
|
6906
7051
|
restDelta: .5
|
|
6907
7052
|
});
|
|
6908
7053
|
}
|
|
@@ -7053,15 +7198,11 @@ const UNSUPPORTED_ELEMENTS = /* @__PURE__ */ new Set([
|
|
|
7053
7198
|
"text",
|
|
7054
7199
|
"image",
|
|
7055
7200
|
"foreignObject",
|
|
7056
|
-
"mask",
|
|
7057
|
-
"filter",
|
|
7058
7201
|
"pattern",
|
|
7059
7202
|
"marker"
|
|
7060
7203
|
]);
|
|
7061
7204
|
/** Attributes that point at one of those. */
|
|
7062
7205
|
const UNSUPPORTED_ATTRIBUTES = {
|
|
7063
|
-
mask: "mask",
|
|
7064
|
-
filter: "filter",
|
|
7065
7206
|
"marker-start": "marker",
|
|
7066
7207
|
"marker-mid": "marker",
|
|
7067
7208
|
"marker-end": "marker"
|
|
@@ -7082,10 +7223,21 @@ function parseSvg(source) {
|
|
|
7082
7223
|
if (id !== void 0 && !ids.has(id)) ids.set(id, element);
|
|
7083
7224
|
if (name === "style") rules.push(...parseStyleSheet(element.text));
|
|
7084
7225
|
if (UNSUPPORTED_ELEMENTS.has(name)) unsupported.add(name);
|
|
7226
|
+
if (name === "filter" && dropShadowOf(element) === void 0) unsupported.add("filter");
|
|
7085
7227
|
for (const [attribute, feature] of Object.entries(UNSUPPORTED_ATTRIBUTES)) if (element.attributes[attribute] !== void 0 && element.attributes[attribute] !== "none") unsupported.add(feature);
|
|
7228
|
+
for (const attribute of ["mask", "filter"]) {
|
|
7229
|
+
const value = element.attributes[attribute];
|
|
7230
|
+
if (value !== void 0 && value !== "none") references.push([attribute, value]);
|
|
7231
|
+
}
|
|
7086
7232
|
element.children.forEach(visit);
|
|
7087
7233
|
};
|
|
7234
|
+
const references = [];
|
|
7088
7235
|
visit(root);
|
|
7236
|
+
for (const [attribute, value] of references) {
|
|
7237
|
+
const id = referencedId(value);
|
|
7238
|
+
const target = id === void 0 ? void 0 : ids.get(id);
|
|
7239
|
+
if (target === void 0 || localName(target.name) !== attribute) unsupported.add(attribute);
|
|
7240
|
+
}
|
|
7089
7241
|
const viewBox = parseViewBox(root.attributes.viewBox);
|
|
7090
7242
|
const width = absoluteLength(root.attributes.width) ?? viewBox?.width ?? 300;
|
|
7091
7243
|
const height = absoluteLength(root.attributes.height) ?? viewBox?.height ?? 150;
|
|
@@ -7104,6 +7256,28 @@ function parseSvg(source) {
|
|
|
7104
7256
|
unsupported: [...unsupported]
|
|
7105
7257
|
};
|
|
7106
7258
|
}
|
|
7259
|
+
/** The id a value of the form `url(#id)` names, or undefined for anything else. */
|
|
7260
|
+
function referencedId(value) {
|
|
7261
|
+
return /^\s*url\(\s*['"]?#([^'")]+)['"]?\s*\)\s*$/.exec(value)?.[1];
|
|
7262
|
+
}
|
|
7263
|
+
/**
|
|
7264
|
+
* The `<feDropShadow>` a `<filter>` is, when it is exactly one drop
|
|
7265
|
+
* shadow of the element itself; undefined for any other filter, which
|
|
7266
|
+
* is not drawn.
|
|
7267
|
+
*/
|
|
7268
|
+
function dropShadowOf(filter) {
|
|
7269
|
+
const primitives = filter.children.filter((child) => !NOT_PRIMITIVES.has(localName(child.name)));
|
|
7270
|
+
const [primitive] = primitives;
|
|
7271
|
+
if (primitives.length !== 1 || localName(primitive.name) !== "feDropShadow") return;
|
|
7272
|
+
const input = primitive.attributes.in;
|
|
7273
|
+
return input === void 0 || input === "SourceGraphic" ? primitive : void 0;
|
|
7274
|
+
}
|
|
7275
|
+
/** What a `<filter>` may hold that is not a step of it. */
|
|
7276
|
+
const NOT_PRIMITIVES = /* @__PURE__ */ new Set([
|
|
7277
|
+
"title",
|
|
7278
|
+
"desc",
|
|
7279
|
+
"metadata"
|
|
7280
|
+
]);
|
|
7107
7281
|
/** An element's name without its namespace prefix: `svg:path` is `path`. */
|
|
7108
7282
|
function localName(name) {
|
|
7109
7283
|
const colon = name.indexOf(":");
|
|
@@ -7328,24 +7502,201 @@ function drawElement(element, inherited, viewport, context) {
|
|
|
7328
7502
|
const opacity = unit(declared.opacity);
|
|
7329
7503
|
if (opacity < 1) surface.alpha(opacity);
|
|
7330
7504
|
if (declared["clip-path"] !== void 0) clipTo(declared["clip-path"], viewport, context);
|
|
7505
|
+
const content = (at) => {
|
|
7506
|
+
switch (name) {
|
|
7507
|
+
case "g":
|
|
7508
|
+
case "a":
|
|
7509
|
+
case "switch":
|
|
7510
|
+
drawChildren(element, style, viewport, at);
|
|
7511
|
+
break;
|
|
7512
|
+
case "svg":
|
|
7513
|
+
drawNested(element, style, viewport, at);
|
|
7514
|
+
break;
|
|
7515
|
+
case "use":
|
|
7516
|
+
drawUse(element, style, viewport, at);
|
|
7517
|
+
break;
|
|
7518
|
+
default: {
|
|
7519
|
+
const shape = shapeOf(element, name, viewport);
|
|
7520
|
+
if (shape !== null && style.visible) paintShape(shape, style, viewport, at);
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
};
|
|
7524
|
+
const filtered = () => {
|
|
7525
|
+
const filter = declared.filter === void 0 ? void 0 : referencedElement(declared.filter, "filter", context);
|
|
7526
|
+
const shadow = filter === void 0 ? void 0 : dropShadowOf(filter);
|
|
7527
|
+
if (filter === void 0 || shadow === void 0) content(context);
|
|
7528
|
+
else drawWithShadow(element, filter, shadow, style, viewport, context, content);
|
|
7529
|
+
};
|
|
7530
|
+
const mask = declared.mask === void 0 ? void 0 : referencedElement(declared.mask, "mask", context);
|
|
7531
|
+
if (mask === void 0 || context.using.has(mask)) filtered();
|
|
7532
|
+
else drawMasked(element, mask, viewport, context, filtered);
|
|
7533
|
+
surface.restore();
|
|
7534
|
+
}
|
|
7535
|
+
/** The element of a kind that a `url(#id)` value names, if it is one. */
|
|
7536
|
+
function referencedElement(value, kind, context) {
|
|
7537
|
+
const id = referencedId(value);
|
|
7538
|
+
const target = id === void 0 ? void 0 : context.document.ids.get(id);
|
|
7539
|
+
return target !== void 0 && localName(target.name) === kind ? target : void 0;
|
|
7540
|
+
}
|
|
7541
|
+
/**
|
|
7542
|
+
* Draws an element through a `<mask>`: its drawing is a layer, and the
|
|
7543
|
+
* mask's children, drawn into the layer's mask, say how much of it
|
|
7544
|
+
* shows. By their luminance, or by their alpha for `mask-type: alpha`.
|
|
7545
|
+
*
|
|
7546
|
+
* The mask's region and its content are placed in the element's user
|
|
7547
|
+
* space or in fractions of its bounding box, as `maskUnits` and
|
|
7548
|
+
* `maskContentUnits` say; the region is cut to as the layer is.
|
|
7549
|
+
*/
|
|
7550
|
+
function drawMasked(element, mask, viewport, context, draw) {
|
|
7551
|
+
const { surface } = context;
|
|
7552
|
+
const attributes = mask.attributes;
|
|
7553
|
+
const declared = declarationsOf(mask, context.document);
|
|
7554
|
+
const bounds = attributes.maskUnits === "userSpaceOnUse" && attributes.maskContentUnits !== "objectBoundingBox" ? void 0 : elementBounds(element, viewport, context);
|
|
7555
|
+
const region = regionOf(attributes, attributes.maskUnits === "userSpaceOnUse", bounds, viewport);
|
|
7556
|
+
surface.beginMaskedLayer(region.x, region.y, region.width, region.height);
|
|
7557
|
+
draw();
|
|
7558
|
+
surface.layerMask(declared["mask-type"] === "alpha" ? "alpha" : "luminance");
|
|
7559
|
+
if (attributes.maskContentUnits === "objectBoundingBox") surface.transform(bounds.width, 0, 0, bounds.height, bounds.x, bounds.y);
|
|
7560
|
+
const root = cascade(INITIAL_STYLE, declarationsOf(context.document.root, context.document), context);
|
|
7561
|
+
context.using.add(mask);
|
|
7562
|
+
drawChildren(mask, cascade(root, declared, context), viewport, {
|
|
7563
|
+
...context,
|
|
7564
|
+
flood: void 0
|
|
7565
|
+
});
|
|
7566
|
+
context.using.delete(mask);
|
|
7567
|
+
surface.endMaskedLayer();
|
|
7568
|
+
}
|
|
7569
|
+
/**
|
|
7570
|
+
* Draws an element with the drop shadow its filter is, and then the
|
|
7571
|
+
* element over it, both cut to the filter's region as a filter's result
|
|
7572
|
+
* is.
|
|
7573
|
+
*
|
|
7574
|
+
* The shadow is the element again, every paint of it the flood colour,
|
|
7575
|
+
* moved by `dx` and `dy` and blurred by `stdDeviation`: its alpha in
|
|
7576
|
+
* the flood colour, which is what `<feDropShadow>` makes. It is drawn
|
|
7577
|
+
* as a layer composited at the flood opacity, so where two of a group's
|
|
7578
|
+
* shapes overlap their shadow is not darker; a host without layers
|
|
7579
|
+
* draws it shape by shape, which differs only there.
|
|
7580
|
+
*/
|
|
7581
|
+
function drawWithShadow(element, filter, shadow, style, viewport, context, draw) {
|
|
7582
|
+
const { surface } = context;
|
|
7583
|
+
const attributes = filter.attributes;
|
|
7584
|
+
const userSpace = attributes.filterUnits === "userSpaceOnUse";
|
|
7585
|
+
const primitivesInBox = attributes.primitiveUnits === "objectBoundingBox";
|
|
7586
|
+
const bounds = userSpace && !primitivesInBox ? void 0 : elementBounds(element, viewport, context);
|
|
7587
|
+
const region = regionOf(attributes, userSpace, bounds, viewport);
|
|
7588
|
+
if (!(region.width > 0) || !(region.height > 0)) return;
|
|
7589
|
+
const declared = declarationsOf(shadow, context.document);
|
|
7590
|
+
const number = (value, fallback) => {
|
|
7591
|
+
const parsed = value === void 0 ? NaN : parseFloat(value);
|
|
7592
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
7593
|
+
};
|
|
7594
|
+
let dx = number(declared.dx, 2);
|
|
7595
|
+
let dy = number(declared.dy, 2);
|
|
7596
|
+
const [sx, sy] = numbersIn(declared.stdDeviation ?? "2");
|
|
7597
|
+
let deviation = Math.max(0, sy === void 0 ? sx ?? 2 : ((sx ?? 0) + sy) / 2);
|
|
7598
|
+
if (primitivesInBox) {
|
|
7599
|
+
dx *= bounds.width;
|
|
7600
|
+
dy *= bounds.height;
|
|
7601
|
+
deviation *= Math.sqrt((bounds.width ** 2 + bounds.height ** 2) / 2);
|
|
7602
|
+
}
|
|
7603
|
+
const color = colorValue(declared["flood-color"] ?? "black", style, context) ?? BLACK_COLOR;
|
|
7604
|
+
const opacity = unit(declared["flood-opacity"]);
|
|
7605
|
+
surface.save();
|
|
7606
|
+
surface.beginPath();
|
|
7607
|
+
surface.rect(region.x, region.y, region.width, region.height);
|
|
7608
|
+
surface.clip();
|
|
7609
|
+
if (opacity > 0) {
|
|
7610
|
+
surface.save();
|
|
7611
|
+
if (opacity < 1) surface.alpha(opacity);
|
|
7612
|
+
surface.beginMaskedLayer(region.x, region.y, region.width, region.height);
|
|
7613
|
+
surface.translate(dx, dy);
|
|
7614
|
+
if (deviation > 0) surface.blur(deviation);
|
|
7615
|
+
draw({
|
|
7616
|
+
...context,
|
|
7617
|
+
flood: color
|
|
7618
|
+
});
|
|
7619
|
+
surface.endMaskedLayer();
|
|
7620
|
+
surface.restore();
|
|
7621
|
+
}
|
|
7622
|
+
draw(context);
|
|
7623
|
+
surface.restore();
|
|
7624
|
+
}
|
|
7625
|
+
/**
|
|
7626
|
+
* A mask's or a filter's region: its `x`, `y`, `width` and `height` in
|
|
7627
|
+
* user space, or in fractions of the element's bounding box, which is
|
|
7628
|
+
* where they are by default and where they default to a tenth beyond
|
|
7629
|
+
* it on every side.
|
|
7630
|
+
*/
|
|
7631
|
+
function regionOf(attributes, userSpace, bounds, viewport) {
|
|
7632
|
+
if (userSpace) return {
|
|
7633
|
+
x: length(attributes.x ?? "-10%", viewport.width),
|
|
7634
|
+
y: length(attributes.y ?? "-10%", viewport.height),
|
|
7635
|
+
width: length(attributes.width ?? "120%", viewport.width),
|
|
7636
|
+
height: length(attributes.height ?? "120%", viewport.height)
|
|
7637
|
+
};
|
|
7638
|
+
const box = bounds;
|
|
7639
|
+
return {
|
|
7640
|
+
x: box.x + fraction(attributes.x ?? "-10%") * box.width,
|
|
7641
|
+
y: box.y + fraction(attributes.y ?? "-10%") * box.height,
|
|
7642
|
+
width: fraction(attributes.width ?? "120%") * box.width,
|
|
7643
|
+
height: fraction(attributes.height ?? "120%") * box.height
|
|
7644
|
+
};
|
|
7645
|
+
}
|
|
7646
|
+
/** A fraction written as a number or a percentage: `0.5` and `50%` alike. */
|
|
7647
|
+
function fraction(value) {
|
|
7648
|
+
const trimmed = value.trim();
|
|
7649
|
+
const parsed = trimmed.endsWith("%") ? parseFloat(trimmed) / 100 : parseFloat(trimmed);
|
|
7650
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
7651
|
+
}
|
|
7652
|
+
/**
|
|
7653
|
+
* An element's bounding box in its own user space, as `getBBox` gives
|
|
7654
|
+
* it: its geometry and its children's through their transforms, without
|
|
7655
|
+
* a stroke and without its own transform.
|
|
7656
|
+
*/
|
|
7657
|
+
function elementBounds(element, viewport, context) {
|
|
7658
|
+
const bounds = new BoundsSurface();
|
|
7659
|
+
addBounds(element, IDENTITY$1, viewport, context, bounds, /* @__PURE__ */ new Set());
|
|
7660
|
+
return bounds.bounds();
|
|
7661
|
+
}
|
|
7662
|
+
function addBounds(element, matrix, viewport, context, bounds, using) {
|
|
7663
|
+
const name = localName(element.name);
|
|
7664
|
+
const into = new TransformedSurface(bounds, matrix);
|
|
7665
|
+
/** A child, or a used element, under its own transform. */
|
|
7666
|
+
const add = (child, at) => {
|
|
7667
|
+
const declared = declarationsOf(child, context.document);
|
|
7668
|
+
if (declared.display === "none") return;
|
|
7669
|
+
addBounds(child, declared.transform === void 0 ? at : multiply(at, parseTransform$1(declared.transform)), viewport, context, bounds, using);
|
|
7670
|
+
};
|
|
7331
7671
|
switch (name) {
|
|
7332
7672
|
case "g":
|
|
7333
7673
|
case "a":
|
|
7334
7674
|
case "switch":
|
|
7335
|
-
|
|
7336
|
-
|
|
7675
|
+
for (const child of element.children) if (!NOT_DRAWN.has(localName(child.name))) add(child, matrix);
|
|
7676
|
+
return;
|
|
7677
|
+
case "use": {
|
|
7678
|
+
const target = referenced(element, context.document);
|
|
7679
|
+
if (target === void 0 || using.has(element)) return;
|
|
7680
|
+
using.add(element);
|
|
7681
|
+
add(target, multiply(matrix, [
|
|
7682
|
+
1,
|
|
7683
|
+
0,
|
|
7684
|
+
0,
|
|
7685
|
+
1,
|
|
7686
|
+
length(element.attributes.x, viewport.width),
|
|
7687
|
+
length(element.attributes.y, viewport.height)
|
|
7688
|
+
]));
|
|
7689
|
+
using.delete(element);
|
|
7690
|
+
return;
|
|
7691
|
+
}
|
|
7337
7692
|
case "svg":
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
break;
|
|
7343
|
-
default: {
|
|
7344
|
-
const shape = shapeOf(element, name, viewport);
|
|
7345
|
-
if (shape !== null && style.visible) paintShape(shape, style, viewport, context);
|
|
7693
|
+
case "symbol": {
|
|
7694
|
+
const a = element.attributes;
|
|
7695
|
+
into.rect(length(a.x, viewport.width), length(a.y, viewport.height), length(a.width ?? "100%", viewport.width), length(a.height ?? "100%", viewport.height));
|
|
7696
|
+
return;
|
|
7346
7697
|
}
|
|
7698
|
+
default: shapeOf(element, name, viewport)?.trace(into);
|
|
7347
7699
|
}
|
|
7348
|
-
surface.restore();
|
|
7349
7700
|
}
|
|
7350
7701
|
/** A nested `<svg>`: a viewport of its own, at its x and y. */
|
|
7351
7702
|
function drawNested(element, style, viewport, context) {
|
|
@@ -7475,6 +7826,11 @@ function paintShape(shape, style, viewport, context) {
|
|
|
7475
7826
|
*/
|
|
7476
7827
|
function setPaint(paint, role, shape, style, viewport, context) {
|
|
7477
7828
|
if (paint.kind === "none") return false;
|
|
7829
|
+
if (context.flood !== void 0) {
|
|
7830
|
+
if (role === "fill") context.surface.fillColor(context.flood);
|
|
7831
|
+
else context.surface.strokeColor(context.flood);
|
|
7832
|
+
return true;
|
|
7833
|
+
}
|
|
7478
7834
|
if (paint.kind === "color") {
|
|
7479
7835
|
if (role === "fill") context.surface.fillColor(paint.color);
|
|
7480
7836
|
else context.surface.strokeColor(paint.color);
|
|
@@ -8477,14 +8833,14 @@ var MotionLayer = class {
|
|
|
8477
8833
|
}
|
|
8478
8834
|
drive(cell, to, timing) {
|
|
8479
8835
|
if (timing.spring !== void 0) return this.host.spring(cell, to, {
|
|
8480
|
-
spring:
|
|
8836
|
+
spring: springIn(motionOf(this.host.node), timing.spring),
|
|
8481
8837
|
delay: timing.delay,
|
|
8482
8838
|
reducedMotion: timing.reducedMotion,
|
|
8483
8839
|
restDelta: .002
|
|
8484
8840
|
});
|
|
8485
8841
|
return this.host.animate(cell, to, {
|
|
8486
|
-
duration:
|
|
8487
|
-
easing:
|
|
8842
|
+
duration: durationIn(motionOf(this.host.node), timing.duration),
|
|
8843
|
+
easing: easingIn(motionOf(this.host.node), timing.easing),
|
|
8488
8844
|
delay: timing.delay,
|
|
8489
8845
|
reducedMotion: timing.reducedMotion
|
|
8490
8846
|
});
|
|
@@ -8500,17 +8856,6 @@ var MotionLayer = class {
|
|
|
8500
8856
|
function channelEpsilon(channel) {
|
|
8501
8857
|
return channel === "x" || channel === "y" ? .01 : 1e-4;
|
|
8502
8858
|
}
|
|
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
8859
|
/**
|
|
8515
8860
|
* Moves an element to a visual state, and optionally in from another.
|
|
8516
8861
|
*
|
|
@@ -8553,7 +8898,7 @@ var MotionController = class {
|
|
|
8553
8898
|
attach() {
|
|
8554
8899
|
this.layer.measure(this.host.flowBox());
|
|
8555
8900
|
if (this.args.initial !== void 0) this.layer.snapTo(resolveMotionState(this.args.initial));
|
|
8556
|
-
this.host.
|
|
8901
|
+
this.host.onFlowLayout(() => this.layer.measure(this.host.flowBox()));
|
|
8557
8902
|
this.aim();
|
|
8558
8903
|
}
|
|
8559
8904
|
update(args) {
|
|
@@ -8849,13 +9194,13 @@ var SharedElementController = class {
|
|
|
8849
9194
|
const cell = geometry.cell(field);
|
|
8850
9195
|
const to = targets[field];
|
|
8851
9196
|
(timing.spring !== void 0 ? this.host.spring(cell, to, {
|
|
8852
|
-
spring:
|
|
9197
|
+
spring: springIn(motionOf(this.host.node), timing.spring),
|
|
8853
9198
|
delay: timing.delay,
|
|
8854
9199
|
reducedMotion: timing.reducedMotion,
|
|
8855
9200
|
restDelta: .5
|
|
8856
9201
|
}) : this.host.animate(cell, to, {
|
|
8857
|
-
duration:
|
|
8858
|
-
easing:
|
|
9202
|
+
duration: durationIn(motionOf(this.host.node), timing.duration),
|
|
9203
|
+
easing: easingIn(motionOf(this.host.node), timing.easing),
|
|
8859
9204
|
delay: timing.delay,
|
|
8860
9205
|
reducedMotion: timing.reducedMotion
|
|
8861
9206
|
})).subscribe({ complete: done });
|
|
@@ -9377,7 +9722,7 @@ const scrollPosition = defineModifier({
|
|
|
9377
9722
|
if (settling === 1) args.onSettled?.(offset);
|
|
9378
9723
|
} });
|
|
9379
9724
|
};
|
|
9380
|
-
host.
|
|
9725
|
+
host.onFlowLayout(() => {
|
|
9381
9726
|
const offset = host.scrollOffset();
|
|
9382
9727
|
if (offset === null || last !== null && last.x === offset.x && last.y === offset.y) return;
|
|
9383
9728
|
last = offset;
|
|
@@ -9427,7 +9772,7 @@ const publishInset = defineModifier({
|
|
|
9427
9772
|
if (write === null) write = source.publish(insets);
|
|
9428
9773
|
else write(insets);
|
|
9429
9774
|
};
|
|
9430
|
-
host.
|
|
9775
|
+
host.onFlowLayout(publish);
|
|
9431
9776
|
publish();
|
|
9432
9777
|
host.own(() => {
|
|
9433
9778
|
write?.();
|
|
@@ -12116,7 +12461,7 @@ function pushInstance(out, x, y, width, height, color, radius, opacity, borderWi
|
|
|
12116
12461
|
*/
|
|
12117
12462
|
function pushShadows(out, rec, paint, opacity, transform, clip, inset) {
|
|
12118
12463
|
const shadows = paint.boxShadows;
|
|
12119
|
-
const radius = borderRadiusIsZero(paint.borderRadius) ? 0 : uniformBorderRadius(paint.borderRadius);
|
|
12464
|
+
const radius = borderRadiusIsZero(paint.borderRadius) ? 0 : fittedShadowRadius(uniformBorderRadius(paint.borderRadius), rec.width, rec.height);
|
|
12120
12465
|
for (let i = shadows.length - 1; i >= 0; i--) {
|
|
12121
12466
|
const shadow = shadows[i];
|
|
12122
12467
|
if (shadow.inset === true !== inset || shadow.color.a <= 0) continue;
|
|
@@ -17598,6 +17943,6 @@ function recordsEqual(a, b) {
|
|
|
17598
17943
|
return true;
|
|
17599
17944
|
}
|
|
17600
17945
|
//#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 };
|
|
17946
|
+
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
17947
|
|
|
17603
17948
|
//# sourceMappingURL=index.js.map
|