@pie-players/pie-section-player 0.3.55 → 0.3.57

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 CHANGED
@@ -204,6 +204,11 @@ Passage and item cards share a common header row
204
204
  - When a header fill is provided, header top corners default just inside the
205
205
  card radius. Hosts/themes can override them independently via
206
206
  `--pie-section-player-card-header-radius`.
207
+ - `pie-section-player-passage-card` also bridges
208
+ `--pie-passage-header-background` to `--pie-section-player-card-header-background`,
209
+ so a hosted passage-player custom element (defined outside this package)
210
+ picks up the same header fill without either side hardcoding the other's
211
+ token name.
207
212
 
208
213
  Example (host CSS):
209
214
 
@@ -5,7 +5,7 @@ var n = class {
5
5
  "basic",
6
6
  "scientific",
7
7
  "graphing"
8
- ]), s(this, "version", "1.10"), s(this, "initialized", !1), s(this, "apiKey", void 0), s(this, "proxyEndpoint", void 0), s(this, "isDevelopment", !1), s(this, "onTelemetry", void 0);
8
+ ]), s(this, "version", "1.12"), s(this, "initialized", !1), s(this, "apiKey", void 0), s(this, "proxyEndpoint", void 0), s(this, "isDevelopment", !1), s(this, "onTelemetry", void 0);
9
9
  }
10
10
  async emitTelemetry(e, o) {
11
11
  try {
@@ -20,7 +20,7 @@ var n = class {
20
20
  async loadDesmosScript() {
21
21
  return new Promise((e, o) => {
22
22
  const t = document.createElement("script");
23
- t.src = this.apiKey ? `https://www.desmos.com/api/v1.10/calculator.js?apiKey=${this.apiKey}` : "https://www.desmos.com/api/v1.10/calculator.js", t.async = !0, t.onload = () => {
23
+ t.src = this.apiKey ? `https://www.desmos.com/api/v1.12/calculator.js?apiKey=${this.apiKey}` : "https://www.desmos.com/api/v1.12/calculator.js", t.async = !0, t.onload = () => {
24
24
  window.Desmos ? (console.log("[DesmosProvider] Desmos API loaded successfully"), e()) : o(/* @__PURE__ */ new Error("Desmos API loaded but window.Desmos is undefined"));
25
25
  }, t.onerror = () => {
26
26
  o(/* @__PURE__ */ new Error("Failed to load Desmos API from CDN"));
@@ -65131,7 +65131,8 @@ var X$ = new As.SerializedMmlVisitor(), _N = (e) => X$.visitTree(e), V$ = G$("pi
65131
65131
  parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
65132
65132
  overarc: "\\overparen",
65133
65133
  napprox: "\\not\\approx",
65134
- longdiv: "\\enclose{longdiv}"
65134
+ longdiv: "\\enclose{longdiv}",
65135
+ abs: ["\\left|#1\\right|", 1]
65135
65136
  }, o = e.useSingleDollar ? {
65136
65137
  packages: r,
65137
65138
  macros: n,
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Reactive browser-zoom compensation factor.
3
+ *
4
+ * Browser zoom is approximated as outerWidth / innerWidth: outerWidth is the
5
+ * OS window size (zoom-independent) while innerWidth is in CSS pixels (shrinks
6
+ * as zoom increases). Zoom changes always fire a resize event, so listening to
7
+ * resize keeps the value current.
8
+ *
9
+ * The factor is min(1, maxZoom / zoom): exactly 1 at zoom <= maxZoom (caller
10
+ * behavior unchanged), shrinking proportionally above that. `minCompensation`
11
+ * guards against inflated ratios (docked devtools, browser side panels, window
12
+ * chrome) ever making the compensated element unusably small.
13
+ */
14
+ export type ZoomCompensationOptions = {
15
+ /**
16
+ * Zoom level (as a ratio, e.g. `2` for 200%) below which the factor is 1.
17
+ * Above this level the factor shrinks as `maxZoom / zoom`.
18
+ */
19
+ maxZoom: number;
20
+ /** Lower bound on the returned factor. */
21
+ minCompensation: number;
22
+ };
23
+ export type ZoomCompensationHandle = {
24
+ /** Compensation factor: min(1, maxZoom / zoom), clamped below by minCompensation. */
25
+ readonly current: number;
26
+ /** The raw approximated zoom ratio (1 at 100%, 2 at 200%, ...). */
27
+ readonly zoom: number;
28
+ };
29
+ /**
30
+ * Approximate the browser zoom level from an outer/inner width pair. Falls
31
+ * back to 1 (100%) if the ratio isn't finite or is non-positive (which happens
32
+ * during SSR, in headless envs, and briefly during resize on some browsers).
33
+ */
34
+ export declare function approximateZoomFromWidths(outerWidth: number, innerWidth: number): number;
35
+ /**
36
+ * Pure zoom-compensation math: exactly 1 at zoom <= maxZoom, then shrinks as
37
+ * `maxZoom / zoom`, floored at `minCompensation` to guard against inflated
38
+ * ratios from window chrome / side panels making the element unusably small.
39
+ */
40
+ export declare function computeZoomCompensation(zoom: number, maxZoom: number, minCompensation: number): number;
41
+ export declare function useZoomCompensation(options: ZoomCompensationOptions): ZoomCompensationHandle;