@pie-players/pie-players-shared 0.3.70 → 0.3.72

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.
@@ -95,6 +95,8 @@ declare const enUS: {
95
95
  assessment: {
96
96
  sectionPosition: string;
97
97
  noSections: string;
98
+ loadFailed: string;
99
+ restoreFailed: string;
98
100
  };
99
101
  /** Formative delivery: check-answer control and its outcome announcements. */
100
102
  formative: {
@@ -95,6 +95,8 @@ const enUS = {
95
95
  assessment: {
96
96
  sectionPosition: "Section {position} of {total}",
97
97
  noSections: "No sections",
98
+ loadFailed: "The assessment could not be loaded. Try again.",
99
+ restoreFailed: "Your saved answers for this section could not be restored. Try again.",
98
100
  },
99
101
  /** Formative delivery: check-answer control and its outcome announcements. */
100
102
  formative: {
@@ -76,6 +76,8 @@ declare const nlNL: {
76
76
  assessment: {
77
77
  sectionPosition: string;
78
78
  noSections: string;
79
+ loadFailed: string;
80
+ restoreFailed: string;
79
81
  };
80
82
  formative: {
81
83
  checkAnswer: string;
@@ -76,6 +76,8 @@ const nlNL = {
76
76
  assessment: {
77
77
  sectionPosition: "Onderdeel {position} van {total}",
78
78
  noSections: "Geen onderdelen",
79
+ loadFailed: "De toets kon niet worden geladen. Probeer het opnieuw.",
80
+ restoreFailed: "Je opgeslagen antwoorden voor dit onderdeel konden niet worden hersteld. Probeer het opnieuw.",
79
81
  },
80
82
  formative: {
81
83
  checkAnswer: "Antwoord controleren",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-players-shared",
3
- "version": "0.3.70",
3
+ "version": "0.3.72",
4
4
  "type": "module",
5
5
  "description": "Shared runtime + UI utilities for PIE players",
6
6
  "license": "MIT",
@@ -89,10 +89,6 @@
89
89
  "types": "./dist/components/vendor/nds/nds-icon-button.d.ts",
90
90
  "import": "./dist/components/vendor/nds/nds-icon-button.js"
91
91
  },
92
- "./ui/zoom-compensation": {
93
- "types": "./dist/ui/zoom-compensation.d.ts",
94
- "import": "./dist/ui/zoom-compensation.js"
95
- },
96
92
  "./ui/content-styles": {
97
93
  "types": "./dist/ui/content-styles.d.ts",
98
94
  "import": "./dist/ui/content-styles.js"
@@ -1,44 +0,0 @@
1
- /**
2
- * Pure browser-zoom compensation math (framework-agnostic, no Svelte runes).
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). Callers apply the returned factor via CSS `zoom` so an
7
- * element that would otherwise keep enlarging past `maxZoom` compounds back
8
- * down to the cap.
9
- *
10
- * This module is tsc-buildable and shipped in `dist`, so it can be consumed by
11
- * packages that resolve `@pie-players/pie-players-shared` from its published
12
- * build (e.g. the assessment-toolkit CE bundle) as well as by the reactive
13
- * Svelte wrapper in `./use-zoom-compensation.svelte.ts`, which packages built
14
- * with Vite alias to source.
15
- */
16
- export type ZoomCompensationOptions = {
17
- /**
18
- * Zoom level (as a ratio, e.g. `2` for 200%) below which the factor is 1.
19
- * Above this level the factor shrinks as `maxZoom / zoom`.
20
- */
21
- maxZoom: number;
22
- /** Lower bound on the returned factor. */
23
- minCompensation: number;
24
- };
25
- /**
26
- * Shared zoom-cap settings for the toolbar icon buttons (the TTS play button and
27
- * the calculator button) so both compensate identically and can't drift apart.
28
- * Grow normally up to 200%, then freeze; the 0.25 floor keeps the cap holding
29
- * past 500% browser zoom (see the minCompensation note in
30
- * section-player's SectionPlayerTabbedContent).
31
- */
32
- export declare const ICON_BUTTON_ZOOM_OPTIONS: ZoomCompensationOptions;
33
- /**
34
- * Approximate the browser zoom level from an outer/inner width pair. Falls
35
- * back to 1 (100%) if the ratio isn't finite or is non-positive (which happens
36
- * during SSR, in headless envs, and briefly during resize on some browsers).
37
- */
38
- export declare function approximateZoomFromWidths(outerWidth: number, innerWidth: number): number;
39
- /**
40
- * Pure zoom-compensation math: exactly 1 at zoom <= maxZoom, then shrinks as
41
- * `maxZoom / zoom`, floored at `minCompensation` to guard against inflated
42
- * ratios from window chrome / side panels making the element unusably small.
43
- */
44
- export declare function computeZoomCompensation(zoom: number, maxZoom: number, minCompensation: number): number;
@@ -1,43 +0,0 @@
1
- /**
2
- * Pure browser-zoom compensation math (framework-agnostic, no Svelte runes).
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). Callers apply the returned factor via CSS `zoom` so an
7
- * element that would otherwise keep enlarging past `maxZoom` compounds back
8
- * down to the cap.
9
- *
10
- * This module is tsc-buildable and shipped in `dist`, so it can be consumed by
11
- * packages that resolve `@pie-players/pie-players-shared` from its published
12
- * build (e.g. the assessment-toolkit CE bundle) as well as by the reactive
13
- * Svelte wrapper in `./use-zoom-compensation.svelte.ts`, which packages built
14
- * with Vite alias to source.
15
- */
16
- /**
17
- * Shared zoom-cap settings for the toolbar icon buttons (the TTS play button and
18
- * the calculator button) so both compensate identically and can't drift apart.
19
- * Grow normally up to 200%, then freeze; the 0.25 floor keeps the cap holding
20
- * past 500% browser zoom (see the minCompensation note in
21
- * section-player's SectionPlayerTabbedContent).
22
- */
23
- export const ICON_BUTTON_ZOOM_OPTIONS = {
24
- maxZoom: 2,
25
- minCompensation: 0.25,
26
- };
27
- /**
28
- * Approximate the browser zoom level from an outer/inner width pair. Falls
29
- * back to 1 (100%) if the ratio isn't finite or is non-positive (which happens
30
- * during SSR, in headless envs, and briefly during resize on some browsers).
31
- */
32
- export function approximateZoomFromWidths(outerWidth, innerWidth) {
33
- const ratio = outerWidth / innerWidth;
34
- return Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
35
- }
36
- /**
37
- * Pure zoom-compensation math: exactly 1 at zoom <= maxZoom, then shrinks as
38
- * `maxZoom / zoom`, floored at `minCompensation` to guard against inflated
39
- * ratios from window chrome / side panels making the element unusably small.
40
- */
41
- export function computeZoomCompensation(zoom, maxZoom, minCompensation) {
42
- return Math.max(minCompensation, Math.min(1, maxZoom / zoom));
43
- }