@mun-ui/progressive-blur 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # @mun-ui/progressive-blur
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Progressive (variable-radius) blur as a SwiftUI-style modifier for Mün.
4
+
5
+ > **Use `@mun-ui/ui/progressive-blur`.** Progressive blur is an opt-in feature bundled with
6
+ > `@mun-ui/ui`, so no extra install is needed. This package is the internal implementation
7
+ > module that `@mun-ui/ui` re-exports. Importing `@mun-ui/progressive-blur` directly still works
8
+ > and yields the same module instance, but new code should use the `@mun-ui/ui` path.
9
+
10
+ ```ts
11
+ import { BlurProfile, blurFocus, focus, progressiveBlur } from "@mun-ui/ui/progressive-blur"
12
+
13
+ // Under a bar: strongest at the bottom edge, fading out over 120pt.
14
+ content.modifier(progressiveBlur(BlurProfile.edge("bottom", 120), { radius: 14 }))
15
+
16
+ // Gradient blur between two points, limited to a shape.
17
+ photo.modifier(progressiveBlur(BlurProfile.linear({ from: "center", to: "bottom" }), { radius: 16, in: RoundedRectangle(24) }))
18
+
19
+ // Around another view, without measuring anything yourself.
20
+ menu.modifier(blurFocus("menu"))
21
+ screen.modifier(progressiveBlur(BlurProfile.radial({ around: focus("menu"), inner: 120, outer: 360 }), { radius: 10, amount: isOpen ? 1 : 0 }))
22
+ ```
23
+
24
+ - **Profile** (`BlurProfile.uniform | linear | edge | radial`, then `.easing("smooth")`, `.inverted()`) says where and how fast the blur ramps.
25
+ - **Scope** is the view the modifier is attached to, optionally clipped with `in:`.
26
+ - **`amount`** (0...1) fades the effect; changing it animates.
27
+ - `ProgressiveBlur(profile, options)` is the underlying View (backdrop blur); use it in `.overlay`/`.background`/ZStack directly.
28
+ - `@mun-ui/ui/progressive-blur/plan` is the pure, DOM-free planner (profile to masked layers), shared by any renderer.
29
+
30
+ The web renderer stacks masked `backdrop-filter` layers. Avoid `opacity` or `filter` on an ancestor of the blurred
31
+ view, since that makes a backdrop root and the blur then sees only the ancestor's contents.
32
+
33
+ Notes: the blur covers the modified view's layout box (a `position: fixed` root has none, so give it a real box), and it
34
+ paints above the view's content; keep menus or toasts that must stay sharp above it with their own `z-index`.
35
+
36
+
37
+ Progressive blur subscribes to Mün's global `full` / `reduced` / `none` rendering
38
+ quality policy. Reduced quality uses two layers with recomputed masks and radii;
39
+ none disables all layers, including uniform blur. Updates apply to mounted blur
40
+ without replacing hydrated nodes. Radial focus tracking pauses at none and reduces
41
+ its measurement cadence at reduced quality.
42
+
43
+ The controller is shared with GPU island and Canvas rendering. It starts with the
44
+ cached startup measurement, observes passive frame/queue delays, and repeats the
45
+ same tiny idle CSS backdrop probe about every 30 seconds while consumers are mounted.
46
+ Quality falls under sustained pressure and recovers gradually after healthy probes.
47
+ SSR and initial uncertainty retain full quality; an unclear runtime check keeps the
48
+ current selection. Storage access fails safely.
49
+
50
+ `prepareProgressiveBlur()` remains a compatibility alias for
51
+ `prepareRenderingQuality()` from `@mun-ui/ui/rendering-quality`. Used alone it shares
52
+ one startup preparation; mounted consumers own ongoing monitoring and cleanup.
53
+ See the [global policy, thresholds, API and measurements](../../docs/RENDERING_QUALITY.md).
@@ -0,0 +1,25 @@
1
+ import { type ContentModifier, type ModifiableViewNode, type ViewNode } from "@mun-ui/core";
2
+ import { BlurProfile, focus, planBlur } from "./plan.js";
3
+ export { BlurProfile, focus, planBlur };
4
+ export { prepareProgressiveBlur } from "./quality.js";
5
+ export type { BlurCenter, BlurQuality, Easing, Edge, UnitPoint } from "./plan.js";
6
+ export interface ProgressiveBlurOptions {
7
+ /** Strongest effective blur radius in points. Defaults to 12. */
8
+ readonly radius?: number;
9
+ /** 0...1 blend of the whole effect; changing it animates. Defaults to 1. */
10
+ readonly amount?: number;
11
+ /** Clip the blur to a shape, like `.background(_, in:)`. */
12
+ readonly in?: ViewNode;
13
+ /** Fade duration in milliseconds when `amount` changes. Defaults to 380. */
14
+ readonly fadeMs?: number;
15
+ }
16
+ /** Backdrop-blurs whatever is behind it. Place it in `.overlay`, `.background` or a ZStack. */
17
+ export declare function ProgressiveBlur(profile: BlurProfile, options?: ProgressiveBlurOptions): ModifiableViewNode;
18
+ /**
19
+ * SwiftUI-style modifier: `view.modifier(progressiveBlur(.edge("bottom", 120)))`.
20
+ * The blur covers the modified view's bounds, so scoping is just where you attach it.
21
+ */
22
+ export declare function progressiveBlur(profile: BlurProfile, options?: ProgressiveBlurOptions): ContentModifier;
23
+ /** Marks a view as the center for radial profiles using `focus(id)`. */
24
+ export declare function blurFocus(id: string): ContentModifier;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAA;AACpG,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAA2D,MAAM,WAAW,CAAA;AAGjH,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AACrD,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAEjF,MAAM,WAAW,sBAAsB;IACrC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAA;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AA8BD,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,sBAA2B,GAAG,kBAAkB,CAiD9G;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAE3G;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAErD"}
package/dist/index.js ADDED
@@ -0,0 +1,99 @@
1
+ import { Element } from "@mun-ui/core";
2
+ import { BlurProfile, focus, planBlur } from "./plan.js";
3
+ import { observeRenderingQuality } from "@mun-ui/animation/rendering-quality";
4
+ export { BlurProfile, focus, planBlur };
5
+ export { prepareProgressiveBlur } from "./quality.js";
6
+ const focusSelector = (id) => `[data-pb-focus="${id.replace(/["\\]/g, "\\$&")}"]`;
7
+ /**
8
+ * Keep `--pb-cx/--pb-cy` pointing at the focus view's center, relative to the
9
+ * blur box, for as long as the box is connected and visible.
10
+ */
11
+ function followFocus(box, id, quality) {
12
+ const owner = box.ownerDocument.defaultView;
13
+ let frame = 0;
14
+ let previous = -Infinity;
15
+ const tick = (time) => {
16
+ if (!box.isConnected)
17
+ return;
18
+ if (Number(box.dataset.pbAmount) > 0 && (quality === "full" || time - previous >= 1000 / 30)) {
19
+ previous = time;
20
+ const target = box.ownerDocument.querySelector(focusSelector(id));
21
+ if (target) {
22
+ const t = target.getBoundingClientRect();
23
+ const b = box.getBoundingClientRect();
24
+ box.style.setProperty("--pb-cx", `${t.left - b.left + t.width / 2}px`);
25
+ box.style.setProperty("--pb-cy", `${t.top - b.top + t.height / 2}px`);
26
+ }
27
+ }
28
+ frame = owner.requestAnimationFrame(tick);
29
+ };
30
+ frame = owner.requestAnimationFrame(tick);
31
+ return () => owner.cancelAnimationFrame(frame);
32
+ }
33
+ /** Backdrop-blurs whatever is behind it. Place it in `.overlay`, `.background` or a ZStack. */
34
+ export function ProgressiveBlur(profile, options = {}) {
35
+ const radius = options.radius ?? 12;
36
+ const amount = Math.min(1, Math.max(0, options.amount ?? 1));
37
+ const fade = options.fadeMs ?? 380;
38
+ const layers = planBlur(profile, { radius });
39
+ const center = profile.kind === "radial" ? profile.around : undefined;
40
+ const focusId = center && typeof center === "object" && "focus" in center ? center.focus : undefined;
41
+ let stopQuality;
42
+ let stopFocus;
43
+ const box = Element("div", {
44
+ "aria-hidden": "true",
45
+ "data-pb-amount": String(amount),
46
+ ref: (element) => {
47
+ stopQuality?.();
48
+ stopFocus?.();
49
+ if (!element)
50
+ return;
51
+ const owner = element.ownerDocument.defaultView;
52
+ if (!owner)
53
+ return;
54
+ let applied;
55
+ stopQuality = observeRenderingQuality(({ quality }) => {
56
+ if (applied === quality)
57
+ return;
58
+ applied = quality;
59
+ element.dataset.pbQuality = quality;
60
+ stopFocus?.();
61
+ if (focusId !== undefined && quality !== "none")
62
+ stopFocus = followFocus(element, focusId, quality);
63
+ const planned = planBlur(profile, { radius, quality });
64
+ Array.from(element.children).forEach((child, index) => {
65
+ const style = child.style;
66
+ const layer = planned[index];
67
+ style.display = layer ? "" : "none";
68
+ style.backdropFilter = layer ? `blur(${layer.blur}px)` : "none";
69
+ style.setProperty("-webkit-backdrop-filter", style.backdropFilter);
70
+ style.maskImage = style.webkitMaskImage = layer?.mask ?? "none";
71
+ });
72
+ }, owner);
73
+ },
74
+ style: { position: "absolute", inset: "0px", pointerEvents: "none" },
75
+ }, ...layers.map((layer, index) => Element("div", {
76
+ style: {
77
+ position: "absolute",
78
+ inset: "0px",
79
+ opacity: amount,
80
+ transition: `opacity ${fade}ms ease`,
81
+ backdropFilter: `blur(${layer.blur}px)`,
82
+ WebkitBackdropFilter: `blur(${layer.blur}px)`,
83
+ ...(layer.mask ? { maskImage: layer.mask, WebkitMaskImage: layer.mask } : {}),
84
+ },
85
+ }).keyed(index)));
86
+ return options.in ? box.clipShape(options.in) : box;
87
+ }
88
+ /**
89
+ * SwiftUI-style modifier: `view.modifier(progressiveBlur(.edge("bottom", 120)))`.
90
+ * The blur covers the modified view's bounds, so scoping is just where you attach it.
91
+ */
92
+ export function progressiveBlur(profile, options = {}) {
93
+ return content => content.overlay(ProgressiveBlur(profile, options));
94
+ }
95
+ /** Marks a view as the center for radial profiles using `focus(id)`. */
96
+ export function blurFocus(id) {
97
+ return content => content.withProps({ "data-pb-focus": id });
98
+ }
99
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgE,MAAM,cAAc,CAAA;AACpG,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAA2D,MAAM,WAAW,CAAA;AACjH,OAAO,EAAE,uBAAuB,EAAyB,MAAM,q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E,EAAE,EAAE,CAAC,CAAA;AAC9D,CAAC"}
package/dist/plan.d.ts ADDED
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Renderer-independent progressive-blur planning.
3
+ *
4
+ * A {@link BlurProfile} says *where* and *how fast* blur ramps up; the planner
5
+ * turns it into a stack of uniform-blur layers, each masked by a CSS gradient.
6
+ * Nothing here touches the DOM, so every backend (web today, others later) can
7
+ * share it and it can be tested without a browser.
8
+ *
9
+ * Why layers: blur radii of stacked backdrop layers combine as the root of the
10
+ * sum of squares. With N layers of radius R/sqrt(N), fully opaque layers give R,
11
+ * and a layer at partial opacity contributes proportionally to variance. So the
12
+ * effective radius at strength `s` (0...1) is R * sqrt(s). The planner squares
13
+ * the eased curve so the *radius* itself follows the curve you asked for.
14
+ */
15
+ export type Edge = "top" | "bottom" | "leading" | "trailing";
16
+ export type UnitPoint = "top" | "bottom" | "leading" | "trailing" | "center" | "topLeading" | "topTrailing" | "bottomLeading" | "bottomTrailing" | {
17
+ readonly x: number;
18
+ readonly y: number;
19
+ };
20
+ export type Easing = "linear" | "smooth" | "easeIn" | "easeOut";
21
+ /** A radial profile is centered on a fixed point or on a view marked with `blurFocus(id)`. */
22
+ export type BlurCenter = UnitPoint | {
23
+ readonly focus: string;
24
+ };
25
+ interface ProfileBase {
26
+ readonly curve: Easing;
27
+ readonly isInverted: boolean;
28
+ /** The same profile with another falloff curve. */
29
+ easing(curve: Easing): this;
30
+ /** The same profile with strong and weak ends swapped. */
31
+ inverted(): this;
32
+ }
33
+ export interface UniformProfile extends ProfileBase {
34
+ readonly kind: "uniform";
35
+ }
36
+ export interface LinearProfile extends ProfileBase {
37
+ readonly kind: "linear";
38
+ readonly from: UnitPoint;
39
+ readonly to: UnitPoint;
40
+ }
41
+ export interface EdgeProfile extends ProfileBase {
42
+ readonly kind: "edge";
43
+ readonly edge: Edge;
44
+ readonly length: number;
45
+ }
46
+ export interface RadialProfile extends ProfileBase {
47
+ readonly kind: "radial";
48
+ readonly around: BlurCenter;
49
+ readonly inner: number;
50
+ readonly outer: number;
51
+ }
52
+ export type BlurProfile = UniformProfile | LinearProfile | EdgeProfile | RadialProfile;
53
+ export declare const BlurProfile: Readonly<{
54
+ /** Same blur everywhere in the modified view. Scope it with the view itself or `in:`. */
55
+ uniform(): UniformProfile;
56
+ /** Blur ramps from none at `from` to full at `to`, like a `LinearGradient`. */
57
+ linear(options: {
58
+ from: UnitPoint;
59
+ to: UnitPoint;
60
+ }): LinearProfile;
61
+ /** Blur is strongest at `edge` and fades out over `length` points; the common "under a bar" case. */
62
+ edge(edge: Edge, length: number): EdgeProfile;
63
+ /** Blur is full inside `inner` and fades to none at `outer`, like a `RadialGradient`. */
64
+ radial(options: {
65
+ around?: BlurCenter;
66
+ inner?: number;
67
+ outer: number;
68
+ }): RadialProfile;
69
+ }>;
70
+ /** Center of a radial profile that follows the view marked with `.modifier(blurFocus(id))`. */
71
+ export declare const focus: (id: string) => {
72
+ readonly focus: string;
73
+ };
74
+ export interface BlurLayer {
75
+ /** Blur radius of this backdrop layer, in CSS pixels. */
76
+ readonly blur: number;
77
+ /** CSS gradient used as the layer's alpha mask; absent means the whole box. */
78
+ readonly mask?: string;
79
+ }
80
+ export interface PlanOptions {
81
+ /** Strongest effective blur radius in points. */
82
+ readonly radius: number;
83
+ /** Rendering budget; reduced uses at most two layers, none disables blur. */
84
+ readonly quality?: BlurQuality;
85
+ /** Where a `focus` center currently is, in px inside the blurred box; CSS variables are used when absent. */
86
+ readonly focusCenter?: {
87
+ readonly x: number;
88
+ readonly y: number;
89
+ };
90
+ }
91
+ export type BlurQuality = "full" | "reduced" | "none";
92
+ /** Position along the profile (0 = no blur, 1 = full) to the *radius* fraction, 0...1. */
93
+ export declare function strengthAt(profile: BlurProfile, t: number): number;
94
+ export declare function layerCount(radius: number, quality?: BlurQuality): number;
95
+ /** Per-layer opacity for a strength fraction; exported so backends and tests agree on the model. */
96
+ export declare function layerAlphas(strength: number, count: number): number[];
97
+ /** Effective blur radius produced by `alphas` over `count` equal-variance layers of total radius `radius`. */
98
+ export declare function effectiveRadius(alphas: readonly number[], count: number, radius: number): number;
99
+ /** Turn a profile into the layer stack a backend renders. */
100
+ export declare function planBlur(profile: BlurProfile, options: PlanOptions): BlurLayer[];
101
+ export {};
102
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;AAC5D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,eAAe,GAAG,gBAAgB,GAAG;IAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAC7L,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AAC/D,8FAA8F;AAC9F,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/D,UAAU,WAAW;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,mDAAmD;IACnD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,0DAA0D;IAC1D,QAAQ,IAAI,IAAI,CAAA;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE;AAChF,MAAM,WAAW,aAAc,SAAQ,WAAW;IAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ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,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAA;IAC9B,6GAA6G;IAC7G,QAAQ,CAAC,WAAW,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAClE;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAYrD,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,WAAoB,GAAG,MAAM,CAGhF;AAED,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAGrE;AAED,8GAA8G;AAC9G,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhG;AAmED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,CAMhF"}
package/dist/plan.js ADDED
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Renderer-independent progressive-blur planning.
3
+ *
4
+ * A {@link BlurProfile} says *where* and *how fast* blur ramps up; the planner
5
+ * turns it into a stack of uniform-blur layers, each masked by a CSS gradient.
6
+ * Nothing here touches the DOM, so every backend (web today, others later) can
7
+ * share it and it can be tested without a browser.
8
+ *
9
+ * Why layers: blur radii of stacked backdrop layers combine as the root of the
10
+ * sum of squares. With N layers of radius R/sqrt(N), fully opaque layers give R,
11
+ * and a layer at partial opacity contributes proportionally to variance. So the
12
+ * effective radius at strength `s` (0...1) is R * sqrt(s). The planner squares
13
+ * the eased curve so the *radius* itself follows the curve you asked for.
14
+ */
15
+ function profile(fields) {
16
+ const value = {
17
+ ...fields,
18
+ easing(curve) { return profile({ ...fields, curve }); },
19
+ inverted() { return profile({ ...fields, isInverted: !fields.isInverted }); },
20
+ };
21
+ return Object.freeze(value);
22
+ }
23
+ export const BlurProfile = Object.freeze({
24
+ /** Same blur everywhere in the modified view. Scope it with the view itself or `in:`. */
25
+ uniform() {
26
+ return profile({ kind: "uniform", curve: "linear", isInverted: false });
27
+ },
28
+ /** Blur ramps from none at `from` to full at `to`, like a `LinearGradient`. */
29
+ linear(options) {
30
+ return profile({ kind: "linear", from: options.from, to: options.to, curve: "linear", isInverted: false });
31
+ },
32
+ /** Blur is strongest at `edge` and fades out over `length` points; the common "under a bar" case. */
33
+ edge(edge, length) {
34
+ return profile({ kind: "edge", edge, length: Math.max(0, length), curve: "linear", isInverted: false });
35
+ },
36
+ /** Blur is full inside `inner` and fades to none at `outer`, like a `RadialGradient`. */
37
+ radial(options) {
38
+ const inner = Math.max(0, options.inner ?? 0);
39
+ return profile({ kind: "radial", around: options.around ?? "center", inner, outer: Math.max(inner, options.outer), curve: "linear", isInverted: false });
40
+ },
41
+ });
42
+ /** Center of a radial profile that follows the view marked with `.modifier(blurFocus(id))`. */
43
+ export const focus = (id) => Object.freeze({ focus: id });
44
+ const SAMPLES = 16;
45
+ const clamp01 = (value) => Math.min(1, Math.max(0, value));
46
+ const curves = {
47
+ linear: t => t,
48
+ smooth: t => t * t * (3 - 2 * t),
49
+ easeIn: t => t * t,
50
+ easeOut: t => 1 - (1 - t) * (1 - t),
51
+ };
52
+ /** Position along the profile (0 = no blur, 1 = full) to the *radius* fraction, 0...1. */
53
+ export function strengthAt(profile, t) {
54
+ const position = clamp01(profile.isInverted ? 1 - t : t);
55
+ return clamp01(curves[profile.curve](position));
56
+ }
57
+ export function layerCount(radius, quality = "full") {
58
+ if (!(radius > 0) || quality === "none")
59
+ return 0;
60
+ return quality === "reduced" ? 2 : Math.min(8, Math.max(3, Math.round(radius / 2)));
61
+ }
62
+ /** Per-layer opacity for a strength fraction; exported so backends and tests agree on the model. */
63
+ export function layerAlphas(strength, count) {
64
+ const variance = clamp01(strength) ** 2; // radius fraction -> variance fraction
65
+ return Array.from({ length: count }, (_, index) => clamp01(count * variance - index));
66
+ }
67
+ /** Effective blur radius produced by `alphas` over `count` equal-variance layers of total radius `radius`. */
68
+ export function effectiveRadius(alphas, count, radius) {
69
+ return radius * Math.sqrt(alphas.reduce((sum, alpha) => sum + alpha, 0) / Math.max(1, count));
70
+ }
71
+ const unit = (point) => {
72
+ if (typeof point === "object")
73
+ return point;
74
+ switch (point) {
75
+ case "top": return { x: 0.5, y: 0 };
76
+ case "bottom": return { x: 0.5, y: 1 };
77
+ case "leading": return { x: 0, y: 0.5 };
78
+ case "trailing": return { x: 1, y: 0.5 };
79
+ case "topLeading": return { x: 0, y: 0 };
80
+ case "topTrailing": return { x: 1, y: 0 };
81
+ case "bottomLeading": return { x: 0, y: 1 };
82
+ case "bottomTrailing": return { x: 1, y: 1 };
83
+ default: return { x: 0.5, y: 0.5 };
84
+ }
85
+ };
86
+ const rgba = (alpha) => `rgba(0,0,0,${Math.round(alpha * 1000) / 1000})`;
87
+ const num = (value) => String(Math.round(value * 100) / 100);
88
+ /** CSS gradient line and the stop position (as a function of profile position t) for a profile. */
89
+ function axisFor(profile) {
90
+ if (profile.kind === "edge") {
91
+ const to = profile.edge === "leading" ? "left" : profile.edge === "trailing" ? "right" : profile.edge;
92
+ return { css: `to ${to}`, position: t => `calc(100% - ${num((1 - t) * profile.length)}px)` };
93
+ }
94
+ const from = unit(profile.from);
95
+ const to = unit(profile.to);
96
+ const dx = to.x - from.x;
97
+ const dy = to.y - from.y;
98
+ if (Math.abs(dx) < 1e-6 && Math.abs(dy) < 1e-6)
99
+ return { css: "to bottom", position: () => "0%" };
100
+ if (Math.abs(dx) < 1e-6 || Math.abs(dy) < 1e-6) {
101
+ const vertical = Math.abs(dx) < 1e-6;
102
+ const start = vertical ? from.y : from.x;
103
+ const span = vertical ? dy : dx;
104
+ const forward = span > 0;
105
+ const css = vertical ? (forward ? "to bottom" : "to top") : (forward ? "to right" : "to left");
106
+ const origin = forward ? start : 1 - start;
107
+ return { css, position: t => `${num((origin + t * Math.abs(span)) * 100)}%` };
108
+ }
109
+ // Diagonals: corner keyword gradient spanning the whole box.
110
+ const css = `to ${dy > 0 ? "bottom" : "top"} ${dx > 0 ? "right" : "left"}`;
111
+ return { css, position: t => `${num(t * 100)}%` };
112
+ }
113
+ function maskFor(profile, index, count, options) {
114
+ const alphaAt = (t) => layerAlphas(strengthAt(profile, t), count)[index] ?? 0;
115
+ const stops = (position, ts) => ts.map(t => `${rgba(alphaAt(t))} ${position(t)}`).join(",");
116
+ const ascending = Array.from({ length: SAMPLES + 1 }, (_, i) => i / SAMPLES);
117
+ if (profile.kind === "radial") {
118
+ const center = profile.around;
119
+ const at = typeof center === "object" && "focus" in center
120
+ ? options.focusCenter ? `${num(options.focusCenter.x)}px ${num(options.focusCenter.y)}px` : "var(--pb-cx,50%) var(--pb-cy,50%)"
121
+ : (() => { const point = unit(center); return `${num(point.x * 100)}% ${num(point.y * 100)}%`; })();
122
+ const span = profile.outer - profile.inner;
123
+ // Gradient distance grows outward while strength grows inward, so walk t downward.
124
+ const ts = [...ascending].reverse();
125
+ const position = (t) => `${num(profile.outer - t * span)}px`;
126
+ return `radial-gradient(circle at ${at},${rgba(alphaAt(1))} 0px,${stops(position, ts)})`;
127
+ }
128
+ if (profile.kind === "uniform")
129
+ return "";
130
+ const axis = axisFor(profile);
131
+ return `linear-gradient(${axis.css},${stops(axis.position, ascending)})`;
132
+ }
133
+ /** Turn a profile into the layer stack a backend renders. */
134
+ export function planBlur(profile, options) {
135
+ if (options.quality === "none")
136
+ return [];
137
+ if (profile.kind === "uniform")
138
+ return options.radius > 0 ? [{ blur: options.radius }] : [];
139
+ const count = layerCount(options.radius, options.quality);
140
+ const blur = count === 0 ? 0 : Math.round((options.radius / Math.sqrt(count)) * 100) / 100;
141
+ return Array.from({ length: count }, (_, index) => ({ blur, mask: maskFor(profile, index, count, options) }));
142
+ }
143
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuBH,SAAS,OAAO,CAAiF,MAAS;IACxG,MAAM,KAAK,GAAG;QACZ,GAAG,MAAM;QACT,MAAM,CAAC,KAAa,IAAI,OAAO,OAAO,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA,CAAC,CAAC;QAC9D,QAAQ,KAAK,OAAO,OAAO,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA,CAAC,CAAC;KAC7E,CAAA;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAA+B,CAAA;AAC3D,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,yFAAyF;IACzF,OAAO;QACL,OAAO,OAAO,CAAC,EAAE,IAAI,EAAE,SAAkB,EAAE,KAAK,EAAE,QAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAA;IAC5F,CAAC;IACD,+EAA+E;IAC/E,MAAM,CAAC,OAA2C;QAChD,OAAO,OAAO,CAAC,EAAE,IAAI,EAAE,QAAiB,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,QAAkB,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/H,CAAC;IACD,qGAAqG;IACrG,IAAI,CAAC,IAAU,EAAE,MAAc;QAC7B,OAAO,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MA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KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;IAC1F,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;AAC/G,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { prepareRenderingQuality as prepareProgressiveBlur, prepareRenderingQuality as progressiveBlurQuality, qualityFromFrames } from "@mun-ui/animation/rendering-quality";
2
+ //# sourceMappingURL=quality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quality.d.ts","sourceRoot":"","sources":["../src/quality.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,IAAI,sBAAsB,EAAE,uBAAuB,IAAI,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA"}
@@ -0,0 +1,4 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ // Compatibility entry point; the shared animation runtime now owns the policy.
3
+ export { prepareRenderingQuality as prepareProgressiveBlur, prepareRenderingQuality as progressiveBlurQuality, qualityFromFrames } from "@mun-ui/animation/rendering-quality";
4
+ //# sourceMappingURL=quality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quality.js","sourceRoot":"","sources":["../src/quality.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAElC,+EAA+E;AAC/E,OAAO,EAAE,uBAAuB,IAAI,sBAAsB,EAAE,uBAAuB,IAAI,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@mun-ui/progressive-blur",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Internal implementation of Mün's opt-in progressive blur. Import it from @mun-ui/ui/progressive-blur; this package name remains for compatibility.",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./plan": {
17
+ "types": "./dist/plan.d.ts",
18
+ "import": "./dist/plan.js"
19
+ },
20
+ "./quality": {
21
+ "types": "./dist/quality.d.ts",
22
+ "import": "./dist/quality.js"
23
+ }
24
+ },
25
+ "dependencies": {
26
+ "@mun-ui/animation": "0.2.0",
27
+ "@mun-ui/core": "0.2.0"
28
+ },
29
+ "sideEffects": false,
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "scripts": {
34
+ "build": "tsc -p tsconfig.json",
35
+ "check": "tsc -p tsconfig.json --noEmit",
36
+ "watch": "tsc -w -p tsconfig.json --preserveWatchOutput"
37
+ }
6
38
  }