@pie-players/pie-assessment-player 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -98,6 +98,12 @@ var e = {
98
98
  manualScoring: "Beoordeeld door een leraar",
99
99
  audio: "Audio",
100
100
  video: "Video"
101
+ },
102
+ list: {
103
+ expandA11y: "Volledige vraag tonen",
104
+ highlights: "Zoektreffers",
105
+ collapse: "Samenvatting tonen",
106
+ playerError: "Het volledige item kon niet worden geladen."
101
107
  }
102
108
  },
103
109
  toolkit: {
@@ -95,15 +95,15 @@ var ne = class {
95
95
  return this.config?.attributeTransformer ? this.config.attributeTransformer(e) : e;
96
96
  }
97
97
  };
98
- function L(e) {
98
+ function x(e) {
99
99
  const t = e;
100
100
  return typeof t?.noticeError == "function" && typeof t.addPageAction == "function";
101
101
  }
102
102
  function b() {
103
103
  if (typeof window > "u") return;
104
104
  const { newrelic: e, NREUM: t } = window;
105
- if (L(e)) return e;
106
- if (L(t)) return t;
105
+ if (x(e)) return e;
106
+ if (x(t)) return t;
107
107
  }
108
108
  var se = class extends ne {
109
109
  constructor(...e) {
@@ -133,7 +133,7 @@ var se = class extends ne {
133
133
  if (typeof t?.setCustomAttribute == "function") for (const [i, n] of Object.entries(e)) t.setCustomAttribute(i, n);
134
134
  }
135
135
  };
136
- function $(e) {
136
+ function q(e) {
137
137
  if (!e || typeof e != "object") return !1;
138
138
  const t = e;
139
139
  return typeof t.providerId == "string" && typeof t.providerName == "string" && typeof t.initialize == "function" && typeof t.trackError == "function" && typeof t.trackEvent == "function" && typeof t.destroy == "function" && typeof t.isReady == "function";
@@ -196,7 +196,7 @@ var oe = /* @__PURE__ */ new Set([
196
196
  };
197
197
  }
198
198
  }
199
- }, q = (e, t, i = "custom element tag") => {
199
+ }, $ = (e, t, i = "custom element tag") => {
200
200
  const n = ce(e, t, i);
201
201
  if (n.outcome === "error" || n.outcome === "wrapped-error") throw n.error;
202
202
  return {
@@ -206,9 +206,11 @@ var oe = /* @__PURE__ */ new Set([
206
206
  }, y = (e) => {
207
207
  if (e === null || typeof e != "object") return e;
208
208
  if (Array.isArray(e)) return e.map(y);
209
- const t = {};
210
- for (const i in e) Object.hasOwn(e, i) && (t[i] = y(e[i]));
211
- return t;
209
+ const t = Object.getPrototypeOf(e);
210
+ if (t !== Object.prototype && t !== null) return e;
211
+ const i = {};
212
+ for (const n in e) Object.hasOwn(e, n) && (i[n] = y(e[n]));
213
+ return i;
212
214
  };
213
215
  function G(e, t) {
214
216
  const i = `[${e}]`;
@@ -259,7 +261,7 @@ function ge(e) {
259
261
  };
260
262
  if (!e.instrumentationProvider) return () => {
261
263
  };
262
- if (!$(e.instrumentationProvider))
264
+ if (!q(e.instrumentationProvider))
263
265
  return e.debug && pe(e.component), () => {
264
266
  };
265
267
  const t = e.instrumentationProvider, i = [], n = Math.max(0, e.dedupeWindowMs ?? 0), s = /* @__PURE__ */ new Map(), o = (r, a) => {
@@ -307,11 +309,11 @@ function ge(e) {
307
309
  for (const r of i) r();
308
310
  };
309
311
  }
310
- function x(e) {
312
+ function L(e) {
311
313
  return e && typeof e == "object" ? e : {};
312
314
  }
313
315
  function M(e) {
314
- const t = x(x(e).loaderConfig);
316
+ const t = L(L(e).loaderConfig);
315
317
  return Object.keys(t).length > 0 ? t : null;
316
318
  }
317
319
  function D(e) {
@@ -338,7 +340,7 @@ function be(e) {
338
340
  const t = M(e.runtimePlayer), i = M(e.player), n = F(t), s = F(i), o = n ?? s ?? !1, r = fe(D(t), D(i));
339
341
  if (r.kind !== "null") {
340
342
  if (r.kind === "unset") return o ? ve() : void 0;
341
- if ($(r.value)) return r.value;
343
+ if (q(r.value)) return r.value;
342
344
  if (e.debug) {
343
345
  const a = e.component ? `[${e.component}] ` : "";
344
346
  ye.warn(`${a}Ignoring invalid instrumentation provider; expected InstrumentationProvider contract`);
@@ -490,6 +492,12 @@ var W = {
490
492
  manualScoring: "Scored by a teacher",
491
493
  audio: "Audio",
492
494
  video: "Video"
495
+ },
496
+ list: {
497
+ expandA11y: "Show the full item",
498
+ highlights: "Search matches",
499
+ collapse: "Show the summary",
500
+ playerError: "The full item could not be loaded."
493
501
  }
494
502
  },
495
503
  toolkit: {
@@ -1003,7 +1011,7 @@ var W = {
1003
1011
  ssml: "SSML"
1004
1012
  }
1005
1013
  }
1006
- }, we = { "nl-NL": () => import("./nl-NL-DAsk17yt.js") }, Ae = ["en-US", "nl-NL"];
1014
+ }, we = { "nl-NL": () => import("./nl-NL-Dhi39lYl.js") }, Ae = ["en-US", "nl-NL"];
1007
1015
  async function Ie(e) {
1008
1016
  if (e === "en-US") return W;
1009
1017
  const t = we[e];
@@ -1081,7 +1089,7 @@ function _(e) {
1081
1089
  }
1082
1090
  var V = class k {
1083
1091
  constructor(t = {}) {
1084
- f(this, "locale", void 0), f(this, "fallbackLocale", void 0), f(this, "catalogs", void 0), f(this, "customMessages", void 0), f(this, "loading", void 0), f(this, "listeners", /* @__PURE__ */ new Set()), f(this, "config", void 0), this.config = { ...t }, this.fallbackLocale = w(t.fallbackLocale) || "en-US", this.catalogs = /* @__PURE__ */ new Map([[C, W]]), this.customMessages = { ...t.customMessages ?? {} }, this.loading = /* @__PURE__ */ new Map(), this.locale = this.resolveLocaleTag(t.locale) ?? "en-US";
1092
+ f(this, "locale", void 0), f(this, "fallbackLocale", void 0), f(this, "catalogs", void 0), f(this, "customMessages", void 0), f(this, "loading", void 0), f(this, "requests", 0), f(this, "listeners", /* @__PURE__ */ new Set()), f(this, "config", void 0), this.config = { ...t }, this.fallbackLocale = w(t.fallbackLocale) || "en-US", this.catalogs = /* @__PURE__ */ new Map([[C, W]]), this.customMessages = { ...t.customMessages ?? {} }, this.loading = /* @__PURE__ */ new Map(), this.locale = this.resolveLocaleTag(t.locale) ?? "en-US";
1085
1093
  }
1086
1094
  async initialize(t) {
1087
1095
  if (this.config = {
@@ -1094,25 +1102,25 @@ var V = class k {
1094
1102
  return this.locale;
1095
1103
  }
1096
1104
  async setLocale(t) {
1097
- const i = this.resolveLocaleTag(t);
1098
- if (!i) {
1105
+ const i = ++this.requests, n = this.resolveLocaleTag(t);
1106
+ if (!n) {
1099
1107
  this.locale = w(t) || "en-US", this.notify();
1100
1108
  return;
1101
1109
  }
1102
- if (!this.catalogs.has(i) && this.config.availableLocales?.includes(i)) {
1103
- const n = this.loading.get(i);
1104
- if (n) await n;
1110
+ if (!this.catalogs.has(n) && this.config.availableLocales?.includes(n)) {
1111
+ const s = this.loading.get(n);
1112
+ if (s) await s;
1105
1113
  else {
1106
- const s = this.loadCatalog(i);
1107
- this.loading.set(i, s);
1114
+ const o = this.loadCatalog(n);
1115
+ this.loading.set(n, o);
1108
1116
  try {
1109
- await s;
1117
+ await o;
1110
1118
  } finally {
1111
- this.loading.delete(i);
1119
+ this.loading.delete(n);
1112
1120
  }
1113
1121
  }
1114
1122
  }
1115
- this.locale = i, this.notify();
1123
+ i === this.requests && (this.locale = n, this.notify());
1116
1124
  }
1117
1125
  t(t, i) {
1118
1126
  const n = this.lookup(t);
@@ -1271,7 +1279,7 @@ function B(e, t) {
1271
1279
  const i = t.getLocale();
1272
1280
  e.setAttribute("lang", Ce(i) ?? i), e.setAttribute("dir", t.getDirection?.() ?? "ltr");
1273
1281
  }
1274
- function Le(e, t, i) {
1282
+ function xe(e, t, i) {
1275
1283
  if (!e) return;
1276
1284
  const n = {
1277
1285
  kind: "i18n-locale-load",
@@ -1288,7 +1296,7 @@ function Le(e, t, i) {
1288
1296
  composed: !0
1289
1297
  }));
1290
1298
  }
1291
- function xe(e = {}) {
1299
+ function Le(e = {}) {
1292
1300
  return new V({
1293
1301
  loadCatalog: Ie,
1294
1302
  availableLocales: Ae,
@@ -1615,7 +1623,7 @@ function R(e, t) {
1615
1623
  }
1616
1624
  var Ue = "pie-section-player-splitpane", Oe = "pie-section-player-vertical", Be = class extends HTMLElement {
1617
1625
  constructor(...e) {
1618
- super(...e), this._assessmentId = "", this._attemptId = "", this._locale = "", this._assessment = null, this._env = null, this._coordinator = null, this._hooks = null, this.pendingSession = null, this._showNavigation = !0, this._sectionPlayerLayout = "splitpane", this._playerType = "iife", this._debug = void 0, this.controller = null, this.initializingController = null, this.generation = 0, this.reconcileQueued = !1, this.controllerWaiters = /* @__PURE__ */ new Set(), this.ownedI18n = xe(), this.suppliedI18n = null, this.subscribedI18n = null, this.sectionHost = null, this.sectionControllerRef = null, this.sectionSessionReady = !1, this.containerRef = null, this.announcer = null, this.restoreFocusOnRender = !1, this._sectionPlayerRuntime = null, this.readiness = { phase: "bootstrapping" };
1626
+ super(...e), this._assessmentId = "", this._attemptId = "", this._locale = "", this._assessment = null, this._env = null, this._coordinator = null, this._hooks = null, this.pendingSession = null, this._showNavigation = !0, this._sectionPlayerLayout = "splitpane", this._playerType = "iife", this._debug = void 0, this.controller = null, this.initializingController = null, this.generation = 0, this.reconcileQueued = !1, this.controllerWaiters = /* @__PURE__ */ new Set(), this.ownedI18n = Le(), this.suppliedI18n = null, this.subscribedI18n = null, this.sectionHost = null, this.sectionControllerRef = null, this.sectionSessionReady = !1, this.containerRef = null, this.announcer = null, this.restoreFocusOnRender = !1, this._sectionPlayerRuntime = null, this.readiness = { phase: "bootstrapping" };
1619
1627
  }
1620
1628
  static get observedAttributes() {
1621
1629
  return [
@@ -1706,7 +1714,7 @@ var Ue = "pie-section-player-splitpane", Oe = "pie-section-player-vertical", Be
1706
1714
  this.unsubscribeI18n && this.subscribedI18n !== e && (this.unsubscribeI18n(), this.unsubscribeI18n = void 0), this.unsubscribeI18n || (this.subscribedI18n = e, this.unsubscribeI18n = e.subscribe?.(() => {
1707
1715
  this.isConnected && this.updateNavigationChrome();
1708
1716
  })), (this.locale || e === this.ownedI18n) && Promise.resolve(e.setLocale(this.locale || "en-US")).catch((t) => {
1709
- Le(this, "pie-assessment-player", t);
1717
+ xe(this, "pie-assessment-player", t);
1710
1718
  }), this.forwardLocaleToSection(), B(this, e);
1711
1719
  }
1712
1720
  forwardLocaleToSection() {
@@ -2190,7 +2198,7 @@ var Ue = "pie-section-player-splitpane", Oe = "pie-section-player-vertical", Be
2190
2198
  }));
2191
2199
  }
2192
2200
  };
2193
- q("pie-assessment-player-default", Be, "assessment player default tag");
2201
+ $("pie-assessment-player-default", Be, "assessment player default tag");
2194
2202
  var He = class extends HTMLElement {
2195
2203
  static get observedAttributes() {
2196
2204
  return ["show-navigation"];
@@ -2242,7 +2250,7 @@ var He = class extends HTMLElement {
2242
2250
  n.appendChild(s), i.appendChild(n), this.shadowRoot?.replaceChildren(t, i);
2243
2251
  }
2244
2252
  };
2245
- q("pie-assessment-player-shell", He, "assessment player shell tag");
2253
+ $("pie-assessment-player-shell", He, "assessment player shell tag");
2246
2254
  export {
2247
2255
  g as ASSESSMENT_PLAYER_PUBLIC_EVENTS
2248
2256
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-assessment-player",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "type": "module",
5
5
  "description": "Assessment-level coordinator custom elements for orchestrating section-player instances",
6
6
  "license": "MIT",
@@ -40,9 +40,9 @@
40
40
  "lint": "biome lint ."
41
41
  },
42
42
  "dependencies": {
43
- "@pie-players/pie-assessment-toolkit": "1.0.0-beta.4",
44
- "@pie-players/pie-players-shared": "1.0.0-beta.4",
45
- "@pie-players/pie-section-player": "1.0.0-beta.4"
43
+ "@pie-players/pie-assessment-toolkit": "1.0.0-beta.5",
44
+ "@pie-players/pie-players-shared": "1.0.0-beta.5",
45
+ "@pie-players/pie-section-player": "1.0.0-beta.5"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@axe-core/playwright": "^4.14.0",