@vitreajs/vitrea 0.15.0 → 0.17.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/README.md +4 -3
- package/dist/{chunk-WM2DV3ZD.js → chunk-IOTISK2R.js} +2 -2
- package/dist/{chunk-WM2DV3ZD.js.map → chunk-IOTISK2R.js.map} +1 -1
- package/dist/{dist-PT4PUS4K.js → dist-T7PRMUM4.js} +504 -96
- package/dist/dist-T7PRMUM4.js.map +1 -0
- package/dist/index.d.ts +104 -24
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-PT4PUS4K.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -370,7 +370,9 @@ interface ResolvedMotionPolicy {
|
|
|
370
370
|
* does it — a morph is one continuous material transition, not two surfaces
|
|
371
371
|
* dissolving. Reduced Motion reserves it for large plane shifts. (The
|
|
372
372
|
* foreground light/dark crossfade of §Motion's driver table is a different,
|
|
373
|
-
* unconditional channel and is not governed here.)
|
|
373
|
+
* unconditional channel and is not governed here.) An explicitly authored
|
|
374
|
+
* `materialize` transition crossfades content, not the surface element: its
|
|
375
|
+
* material follows optical presence and is independent of this plane-shift rule.
|
|
374
376
|
*/
|
|
375
377
|
readonly crossfade: "never" | "large-plane-shifts";
|
|
376
378
|
/**
|
|
@@ -2125,6 +2127,11 @@ interface MaterialOuterShadow {
|
|
|
2125
2127
|
* Units: CSS px for distance, linear light for colour, viewport coordinates with
|
|
2126
2128
|
* y pointing down for direction.
|
|
2127
2129
|
*/
|
|
2130
|
+
type BackdropToneKnotRow = readonly [number, number, number] | readonly [number, number, number, number];
|
|
2131
|
+
interface MaterialOcclusionLiftByPolicy {
|
|
2132
|
+
readonly reduceTransparency: number;
|
|
2133
|
+
readonly increaseContrast: number;
|
|
2134
|
+
}
|
|
2128
2135
|
interface MaterialProfile {
|
|
2129
2136
|
/** Per-variant optics. `clear` is persistently more transparent than `regular`. */
|
|
2130
2137
|
readonly optics: Readonly<Record<MaterialVariant, MaterialOptics>>;
|
|
@@ -2879,6 +2886,8 @@ interface MaterialProfile {
|
|
|
2879
2886
|
* both directions by `packages/calibration/test/tier-coherence.test.ts`.
|
|
2880
2887
|
*/
|
|
2881
2888
|
readonly increasedOcclusionLift: number;
|
|
2889
|
+
/** Optional policy-specific levels. Absent keeps the shared lift exactly. */
|
|
2890
|
+
readonly increasedOcclusionLiftByPolicy?: MaterialOcclusionLiftByPolicy;
|
|
2882
2891
|
readonly strongBorderRim: MaterialRim;
|
|
2883
2892
|
readonly reducedTintAdaptation: number;
|
|
2884
2893
|
/**
|
|
@@ -2915,6 +2924,25 @@ interface MaterialProfile {
|
|
|
2915
2924
|
readonly tintShadeDark: number;
|
|
2916
2925
|
readonly tintShadeLight: number;
|
|
2917
2926
|
readonly tintShadeStrength: number;
|
|
2927
|
+
/**
|
|
2928
|
+
* The fraction of the author's seed saturation retained before the shade law.
|
|
2929
|
+
* The neutral endpoint is the seed's maximum linear channel, not its luminance:
|
|
2930
|
+
* W27c's orange and blue checkerboard capsules at both 1x and 2x lose their hue
|
|
2931
|
+
* to the SAME grey, despite the seeds having different luminances (§5.130).
|
|
2932
|
+
* Strength still composites the resulting layer; it is not discarded.
|
|
2933
|
+
* Absence means 1, the identity. Identity values are omitted from resolved
|
|
2934
|
+
* documents so the frozen active profiles keep their existing fingerprints.
|
|
2935
|
+
*/
|
|
2936
|
+
readonly tintChromaScale?: number;
|
|
2937
|
+
/**
|
|
2938
|
+
* The fraction of the tint shade retained when backdrop adaptation collapses
|
|
2939
|
+
* the body. W27c's 1x light dark-solid tinted capsule requires Y 0.03678 while
|
|
2940
|
+
* its checkerboard counterpart requires Y 0.45128. A chroma-only seed change
|
|
2941
|
+
* cannot supply both: collapse forces the old shade to 1. Retention lets the
|
|
2942
|
+
* same shade law follow the collapsed body's level instead of exposing the
|
|
2943
|
+
* unshaded seed. Absence means 0, preserving the active law and its fingerprint.
|
|
2944
|
+
*/
|
|
2945
|
+
readonly tintShadeCollapseRetention?: number;
|
|
2918
2946
|
/**
|
|
2919
2947
|
* **Backdrop tone adaptation (W7)** — the axis Apple's material has and this
|
|
2920
2948
|
* one did not: over a dark enough backdrop the material stops being a lighter
|
|
@@ -3140,9 +3168,9 @@ interface MaterialProfile {
|
|
|
3140
3168
|
* extreme-dark region stays with the collapse constants that were fitted
|
|
3141
3169
|
* on it.
|
|
3142
3170
|
*/
|
|
3143
|
-
readonly backdropToneAnchorX:
|
|
3144
|
-
readonly backdropToneResponseThin:
|
|
3145
|
-
readonly backdropToneResponseThick:
|
|
3171
|
+
readonly backdropToneAnchorX: BackdropToneKnotRow;
|
|
3172
|
+
readonly backdropToneResponseThin: BackdropToneKnotRow;
|
|
3173
|
+
readonly backdropToneResponseThick: BackdropToneKnotRow;
|
|
3146
3174
|
/**
|
|
3147
3175
|
* How much authority the response law has in THIS profile, 0…1 (W9).
|
|
3148
3176
|
*
|
|
@@ -3249,11 +3277,14 @@ interface MaterialProfilePatch {
|
|
|
3249
3277
|
readonly lensOvalizationSpanMax?: number;
|
|
3250
3278
|
readonly reducedTransparencyFrost?: number;
|
|
3251
3279
|
readonly increasedOcclusionLift?: number;
|
|
3280
|
+
readonly increasedOcclusionLiftByPolicy?: Readonly<Partial<MaterialOcclusionLiftByPolicy>>;
|
|
3252
3281
|
readonly strongBorderRim?: Readonly<Partial<MaterialRim>>;
|
|
3253
3282
|
readonly reducedTintAdaptation?: number;
|
|
3254
3283
|
readonly tintShadeDark?: number;
|
|
3255
3284
|
readonly tintShadeLight?: number;
|
|
3256
3285
|
readonly tintShadeStrength?: number;
|
|
3286
|
+
readonly tintChromaScale?: number;
|
|
3287
|
+
readonly tintShadeCollapseRetention?: number;
|
|
3257
3288
|
readonly backdropToneMax?: number;
|
|
3258
3289
|
readonly backdropToneLow?: number;
|
|
3259
3290
|
readonly backdropToneHigh?: number;
|
|
@@ -3263,9 +3294,9 @@ interface MaterialProfilePatch {
|
|
|
3263
3294
|
readonly rimCollapsed?: number;
|
|
3264
3295
|
readonly rimCollapsedTinted?: number;
|
|
3265
3296
|
readonly rimTintChroma?: number;
|
|
3266
|
-
readonly backdropToneAnchorX?:
|
|
3267
|
-
readonly backdropToneResponseThin?:
|
|
3268
|
-
readonly backdropToneResponseThick?:
|
|
3297
|
+
readonly backdropToneAnchorX?: BackdropToneKnotRow;
|
|
3298
|
+
readonly backdropToneResponseThin?: BackdropToneKnotRow;
|
|
3299
|
+
readonly backdropToneResponseThick?: BackdropToneKnotRow;
|
|
3269
3300
|
readonly backdropToneResponseStrength?: number;
|
|
3270
3301
|
readonly outerShadow?: Readonly<Partial<MaterialOuterShadow>>;
|
|
3271
3302
|
readonly lightDirection?: readonly [number, number];
|
|
@@ -3547,8 +3578,50 @@ interface SurfaceChannels {
|
|
|
3547
3578
|
* when v1 gains one.
|
|
3548
3579
|
*/
|
|
3549
3580
|
readonly shimmer: number;
|
|
3550
|
-
/**
|
|
3581
|
+
/**
|
|
3582
|
+
* `lensStrength`, 0..1+. Multiplies the resolved refraction scale.
|
|
3583
|
+
*
|
|
3584
|
+
* **The range is open above 1** (W27a), which is the range `@vitreajs/vitrea-web`'s
|
|
3585
|
+
* `channels.ts` has always documented and the range the motion table has always
|
|
3586
|
+
* driven: 1 at rest, 1.03 focused, 1.06 hover, 1.10 morphing, 1.14 pressed, and
|
|
3587
|
+
* 0.5 disabled. The instance builder used to clamp the channel at 1 on its way
|
|
3588
|
+
* into the shader, which left `disabled` as the only interaction state the lens
|
|
3589
|
+
* could see and silently discarded every one that deepens it. The lens depth is
|
|
3590
|
+
* still clamped to the surface's half span in the fragment stage, so a strength
|
|
3591
|
+
* above 1 deepens the lens without pushing it through the surface.
|
|
3592
|
+
*/
|
|
3551
3593
|
readonly lensStrength: number;
|
|
3594
|
+
/**
|
|
3595
|
+
* `materialization`, 0..1 — the surface's PRESENCE (W27d; contract X6).
|
|
3596
|
+
*
|
|
3597
|
+
* Apple's `Glass.identity` animates glass to nothing in place and
|
|
3598
|
+
* `GlassEffectTransition.materialize` brings it back, and Apple states the
|
|
3599
|
+
* mechanism twice: "prefer setting the effect property over the alpha", and a
|
|
3600
|
+
* surface materializes "by gradually modulating the light bending and
|
|
3601
|
+
* lensing". The runtime states it a third time from the other side — an
|
|
3602
|
+
* `opacity` below 1 on a host or one of its ancestors forms a Backdrop Root
|
|
3603
|
+
* and kills the group's proxy sampling — so presence is a scalar on the
|
|
3604
|
+
* material's own optical terms and never on the element.
|
|
3605
|
+
*
|
|
3606
|
+
* It scales the lens's depth and magnitude, the body's mix away from the
|
|
3607
|
+
* unblurred backdrop, the material's alpha, the author tint's coverage, the
|
|
3608
|
+
* inner and outer shadows, the rim and the highlight. At 1 every one of those
|
|
3609
|
+
* is a multiplication by exactly one, so the resting material is byte-identical
|
|
3610
|
+
* to the material that had no channel.
|
|
3611
|
+
*
|
|
3612
|
+
* **Exactly 0 is not the bottom of that ramp but the absence of the surface**
|
|
3613
|
+
* (`Glass.identity`). The member is dropped before the field pass
|
|
3614
|
+
* (`resolveSurfaces`), so it owns no coverage and joins no union: a group whose
|
|
3615
|
+
* members are all at 0 draws nothing at all, and one absent member of a
|
|
3616
|
+
* connected group leaves its neighbours the pixels they would have had alone.
|
|
3617
|
+
* A material scaled to nothing would still have been a silhouette, and a
|
|
3618
|
+
* silhouette that eroded as it faded would be a geometric transition, which is
|
|
3619
|
+
* what Apple says materializing is not.
|
|
3620
|
+
*
|
|
3621
|
+
* The renderer takes a value and never a time: the transit is the motion
|
|
3622
|
+
* kernel's `monotonic-ease` driver, on the CPU, like every other channel here.
|
|
3623
|
+
*/
|
|
3624
|
+
readonly materialization: number;
|
|
3552
3625
|
/** Press point in viewport CSS px. Defaults to the surface's centre. */
|
|
3553
3626
|
readonly pressPoint?: readonly [number, number];
|
|
3554
3627
|
}
|
|
@@ -3649,23 +3722,15 @@ interface GroupRenderInput {
|
|
|
3649
3722
|
*/
|
|
3650
3723
|
readonly backdropToneLinearLuminance?: number;
|
|
3651
3724
|
/**
|
|
3652
|
-
*
|
|
3653
|
-
*
|
|
3654
|
-
*
|
|
3655
|
-
*
|
|
3656
|
-
*
|
|
3657
|
-
* encoded sRGB. A linear-light alpha written into that composite lands the
|
|
3658
|
-
* surface darker than the same material sampled on the GPU — the gap
|
|
3659
|
-
* `cssTintAlpha` closes for the CSS tier, at a declared reference level —
|
|
3660
|
-
* so the host, which owns that mapping, resolves the pair once and hands
|
|
3661
|
-
* the same numbers to both tiers. Linear light; the renderer folds the
|
|
3662
|
-
* accessibility policy over it exactly as over the profile's own. Ignored
|
|
3663
|
-
* wherever the group samples a backdrop; absent, the profile's pair is
|
|
3664
|
-
* written as it is (the golden harness, which has no host).
|
|
3725
|
+
* Enables the profile-at-tone material for a DOM layer (W27f G1).
|
|
3726
|
+
* The reference is an encoded-compositing convention only, never a measured
|
|
3727
|
+
* tone or permission to collapse. The profile itself stays in linear light.
|
|
3728
|
+
* Absent preserves the renderer-only harness's legacy no-backdrop drawing;
|
|
3729
|
+
* texture groups ignore this descriptor entirely.
|
|
3665
3730
|
*/
|
|
3666
3731
|
readonly unsampledMaterial?: {
|
|
3667
|
-
readonly
|
|
3668
|
-
readonly
|
|
3732
|
+
readonly referenceBackdropLuminance: number;
|
|
3733
|
+
readonly minimumTintContrast: number;
|
|
3669
3734
|
};
|
|
3670
3735
|
readonly variant?: MaterialVariant;
|
|
3671
3736
|
/** Overrides the calibration-delegated union defaults. */
|
|
@@ -4269,6 +4334,17 @@ interface DrawFrameArgs {
|
|
|
4269
4334
|
readonly timing?: TimingCollector;
|
|
4270
4335
|
/** Clear the targets first. Default true. */
|
|
4271
4336
|
readonly clear?: boolean;
|
|
4337
|
+
/**
|
|
4338
|
+
* Which plane these targets are, for a host that draws more than one.
|
|
4339
|
+
*
|
|
4340
|
+
* The renderer treats it as an opaque namespace: it qualifies each group's
|
|
4341
|
+
* pooled resources (`groupResourceId`) so that one group id drawn on two
|
|
4342
|
+
* planes owns two independent sets rather than reallocating one set twice a
|
|
4343
|
+
* frame, and it appears in the resource labels. It names no logical group and
|
|
4344
|
+
* no state. Omitted is the single-plane namespace, which is what a standalone
|
|
4345
|
+
* renderer, the goldens and the calibration harness all draw in.
|
|
4346
|
+
*/
|
|
4347
|
+
readonly plane?: string;
|
|
4272
4348
|
}
|
|
4273
4349
|
interface DrawFrameResult {
|
|
4274
4350
|
readonly groupsDrawn: number;
|
|
@@ -4345,11 +4421,15 @@ interface GlassRenderer {
|
|
|
4345
4421
|
/** The tunables in force. Read-only; `setMaterialProfile` is the way in. */
|
|
4346
4422
|
readonly materialProfile: MaterialProfile;
|
|
4347
4423
|
drawFrame(args: DrawFrameArgs): DrawFrameResult;
|
|
4348
|
-
/**
|
|
4424
|
+
/**
|
|
4425
|
+
* Targets for the participant path, where core drives the phases. `plane` is
|
|
4426
|
+
* `DrawFrameArgs.plane` — see it.
|
|
4427
|
+
*/
|
|
4349
4428
|
setTargets(targets: {
|
|
4350
4429
|
readonly optics: GPUTextureView;
|
|
4351
4430
|
readonly highlight?: GPUTextureView;
|
|
4352
4431
|
readonly format?: GPUTextureFormat;
|
|
4432
|
+
readonly plane?: string;
|
|
4353
4433
|
}): void;
|
|
4354
4434
|
frameParticipant(): FrameParticipantView;
|
|
4355
4435
|
/** Resolve any completed analysis readbacks into the adaptation drivers. */
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MOTION_DRIVER_BY_CHANNEL, INTERACTION_STATES, SHAPE_FAMILIES } from './chunk-
|
|
1
|
+
import { MOTION_DRIVER_BY_CHANNEL, INTERACTION_STATES, SHAPE_FAMILIES } from './chunk-IOTISK2R.js';
|
|
2
2
|
|
|
3
3
|
// src/accessibility.ts
|
|
4
4
|
var ACCESSIBILITY_FLAGS = [
|
|
@@ -1092,7 +1092,7 @@ function isHealthy(state) {
|
|
|
1092
1092
|
|
|
1093
1093
|
// src/renderer-seam.ts
|
|
1094
1094
|
async function loadWebGPURendererModule() {
|
|
1095
|
-
return import('./dist-
|
|
1095
|
+
return import('./dist-T7PRMUM4.js');
|
|
1096
1096
|
}
|
|
1097
1097
|
async function loadWebGPURenderer() {
|
|
1098
1098
|
const { createWebGPURenderer } = await loadWebGPURendererModule();
|