@vitreajs/vitrea 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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
  /**
@@ -2915,6 +2917,25 @@ interface MaterialProfile {
2915
2917
  readonly tintShadeDark: number;
2916
2918
  readonly tintShadeLight: number;
2917
2919
  readonly tintShadeStrength: number;
2920
+ /**
2921
+ * The fraction of the author's seed saturation retained before the shade law.
2922
+ * The neutral endpoint is the seed's maximum linear channel, not its luminance:
2923
+ * W27c's orange and blue checkerboard capsules at both 1x and 2x lose their hue
2924
+ * to the SAME grey, despite the seeds having different luminances (§5.130).
2925
+ * Strength still composites the resulting layer; it is not discarded.
2926
+ * Absence means 1, the identity. Identity values are omitted from resolved
2927
+ * documents so the frozen active profiles keep their existing fingerprints.
2928
+ */
2929
+ readonly tintChromaScale?: number;
2930
+ /**
2931
+ * The fraction of the tint shade retained when backdrop adaptation collapses
2932
+ * the body. W27c's 1x light dark-solid tinted capsule requires Y 0.03678 while
2933
+ * its checkerboard counterpart requires Y 0.45128. A chroma-only seed change
2934
+ * cannot supply both: collapse forces the old shade to 1. Retention lets the
2935
+ * same shade law follow the collapsed body's level instead of exposing the
2936
+ * unshaded seed. Absence means 0, preserving the active law and its fingerprint.
2937
+ */
2938
+ readonly tintShadeCollapseRetention?: number;
2918
2939
  /**
2919
2940
  * **Backdrop tone adaptation (W7)** — the axis Apple's material has and this
2920
2941
  * one did not: over a dark enough backdrop the material stops being a lighter
@@ -3254,6 +3275,8 @@ interface MaterialProfilePatch {
3254
3275
  readonly tintShadeDark?: number;
3255
3276
  readonly tintShadeLight?: number;
3256
3277
  readonly tintShadeStrength?: number;
3278
+ readonly tintChromaScale?: number;
3279
+ readonly tintShadeCollapseRetention?: number;
3257
3280
  readonly backdropToneMax?: number;
3258
3281
  readonly backdropToneLow?: number;
3259
3282
  readonly backdropToneHigh?: number;
@@ -3547,8 +3570,50 @@ interface SurfaceChannels {
3547
3570
  * when v1 gains one.
3548
3571
  */
3549
3572
  readonly shimmer: number;
3550
- /** `lensStrength`, 0..1. Multiplies the resolved refraction scale. */
3573
+ /**
3574
+ * `lensStrength`, 0..1+. Multiplies the resolved refraction scale.
3575
+ *
3576
+ * **The range is open above 1** (W27a), which is the range `@vitreajs/vitrea-web`'s
3577
+ * `channels.ts` has always documented and the range the motion table has always
3578
+ * driven: 1 at rest, 1.03 focused, 1.06 hover, 1.10 morphing, 1.14 pressed, and
3579
+ * 0.5 disabled. The instance builder used to clamp the channel at 1 on its way
3580
+ * into the shader, which left `disabled` as the only interaction state the lens
3581
+ * could see and silently discarded every one that deepens it. The lens depth is
3582
+ * still clamped to the surface's half span in the fragment stage, so a strength
3583
+ * above 1 deepens the lens without pushing it through the surface.
3584
+ */
3551
3585
  readonly lensStrength: number;
3586
+ /**
3587
+ * `materialization`, 0..1 — the surface's PRESENCE (W27d; contract X6).
3588
+ *
3589
+ * Apple's `Glass.identity` animates glass to nothing in place and
3590
+ * `GlassEffectTransition.materialize` brings it back, and Apple states the
3591
+ * mechanism twice: "prefer setting the effect property over the alpha", and a
3592
+ * surface materializes "by gradually modulating the light bending and
3593
+ * lensing". The runtime states it a third time from the other side — an
3594
+ * `opacity` below 1 on a host or one of its ancestors forms a Backdrop Root
3595
+ * and kills the group's proxy sampling — so presence is a scalar on the
3596
+ * material's own optical terms and never on the element.
3597
+ *
3598
+ * It scales the lens's depth and magnitude, the body's mix away from the
3599
+ * unblurred backdrop, the material's alpha, the author tint's coverage, the
3600
+ * inner and outer shadows, the rim and the highlight. At 1 every one of those
3601
+ * is a multiplication by exactly one, so the resting material is byte-identical
3602
+ * to the material that had no channel.
3603
+ *
3604
+ * **Exactly 0 is not the bottom of that ramp but the absence of the surface**
3605
+ * (`Glass.identity`). The member is dropped before the field pass
3606
+ * (`resolveSurfaces`), so it owns no coverage and joins no union: a group whose
3607
+ * members are all at 0 draws nothing at all, and one absent member of a
3608
+ * connected group leaves its neighbours the pixels they would have had alone.
3609
+ * A material scaled to nothing would still have been a silhouette, and a
3610
+ * silhouette that eroded as it faded would be a geometric transition, which is
3611
+ * what Apple says materializing is not.
3612
+ *
3613
+ * The renderer takes a value and never a time: the transit is the motion
3614
+ * kernel's `monotonic-ease` driver, on the CPU, like every other channel here.
3615
+ */
3616
+ readonly materialization: number;
3552
3617
  /** Press point in viewport CSS px. Defaults to the surface's centre. */
3553
3618
  readonly pressPoint?: readonly [number, number];
3554
3619
  }
@@ -3649,23 +3714,15 @@ interface GroupRenderInput {
3649
3714
  */
3650
3715
  readonly backdropToneLinearLuminance?: number;
3651
3716
  /**
3652
- * The material's tint and alpha for a group that samples NOTHING (W11a) — a
3653
- * `css-backdrop` group whose blurred backdrop is a DOM proxy beneath the
3654
- * canvas, or a `none` group over the page itself. Such a group's body is
3655
- * not composited in the shader: the optics pass writes the material as a
3656
- * premultiplied layer and the browser composites it over the DOM, in
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).
3717
+ * Enables the profile-at-tone material for a DOM layer (W27f G1).
3718
+ * The reference is an encoded-compositing convention only, never a measured
3719
+ * tone or permission to collapse. The profile itself stays in linear light.
3720
+ * Absent preserves the renderer-only harness's legacy no-backdrop drawing;
3721
+ * texture groups ignore this descriptor entirely.
3665
3722
  */
3666
3723
  readonly unsampledMaterial?: {
3667
- readonly tint: Rgb;
3668
- readonly tintAlpha: number;
3724
+ readonly referenceBackdropLuminance: number;
3725
+ readonly minimumTintContrast: number;
3669
3726
  };
3670
3727
  readonly variant?: MaterialVariant;
3671
3728
  /** Overrides the calibration-delegated union defaults. */
@@ -4269,6 +4326,17 @@ interface DrawFrameArgs {
4269
4326
  readonly timing?: TimingCollector;
4270
4327
  /** Clear the targets first. Default true. */
4271
4328
  readonly clear?: boolean;
4329
+ /**
4330
+ * Which plane these targets are, for a host that draws more than one.
4331
+ *
4332
+ * The renderer treats it as an opaque namespace: it qualifies each group's
4333
+ * pooled resources (`groupResourceId`) so that one group id drawn on two
4334
+ * planes owns two independent sets rather than reallocating one set twice a
4335
+ * frame, and it appears in the resource labels. It names no logical group and
4336
+ * no state. Omitted is the single-plane namespace, which is what a standalone
4337
+ * renderer, the goldens and the calibration harness all draw in.
4338
+ */
4339
+ readonly plane?: string;
4272
4340
  }
4273
4341
  interface DrawFrameResult {
4274
4342
  readonly groupsDrawn: number;
@@ -4345,11 +4413,15 @@ interface GlassRenderer {
4345
4413
  /** The tunables in force. Read-only; `setMaterialProfile` is the way in. */
4346
4414
  readonly materialProfile: MaterialProfile;
4347
4415
  drawFrame(args: DrawFrameArgs): DrawFrameResult;
4348
- /** Targets for the participant path, where core drives the phases. */
4416
+ /**
4417
+ * Targets for the participant path, where core drives the phases. `plane` is
4418
+ * `DrawFrameArgs.plane` — see it.
4419
+ */
4349
4420
  setTargets(targets: {
4350
4421
  readonly optics: GPUTextureView;
4351
4422
  readonly highlight?: GPUTextureView;
4352
4423
  readonly format?: GPUTextureFormat;
4424
+ readonly plane?: string;
4353
4425
  }): void;
4354
4426
  frameParticipant(): FrameParticipantView;
4355
4427
  /** 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-WM2DV3ZD.js';
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-PT4PUS4K.js');
1095
+ return import('./dist-C43H3RKY.js');
1096
1096
  }
1097
1097
  async function loadWebGPURenderer() {
1098
1098
  const { createWebGPURenderer } = await loadWebGPURendererModule();