@pie-players/pie-section-player 0.3.58 → 0.3.59
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-section-player",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Web component for rendering QTI 3.0 assessment sections with passages and items",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
"test": "bun test '.test.ts'"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@pie-players/pie-assessment-toolkit": "0.3.
|
|
98
|
-
"@pie-players/pie-default-tool-loaders": "0.3.
|
|
99
|
-
"@pie-players/pie-item-player": "0.3.
|
|
100
|
-
"@pie-players/pie-context": "0.3.
|
|
101
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
97
|
+
"@pie-players/pie-assessment-toolkit": "0.3.59",
|
|
98
|
+
"@pie-players/pie-default-tool-loaders": "0.3.59",
|
|
99
|
+
"@pie-players/pie-item-player": "0.3.59",
|
|
100
|
+
"@pie-players/pie-context": "0.3.59",
|
|
101
|
+
"@pie-players/pie-players-shared": "0.3.59"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@axe-core/playwright": "^4.11.1",
|
|
@@ -1,41 +0,0 @@
|
|
|
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;
|