@pie-players/pie-assessment-player 1.0.0-beta.0 → 1.0.0-beta.10
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 +21 -0
- package/README.md +9 -18
- package/custom-elements.json +20 -3
- package/dist/THIRD-PARTY-LICENSES.txt +51 -0
- package/dist/components/AssessmentPlayerDefaultElement.d.ts +13 -1
- package/dist/components/AssessmentPlayerShellElement.d.ts +3 -1
- package/dist/contracts/elements.d.ts +12 -0
- package/dist/pie-assessment-player.d.ts +1 -0
- package/dist/pie-assessment-player.js +4 -2007
- package/dist/types.d.ts +4 -4
- package/package.json +15 -14
- package/dist/components/assessment-player-default-element.d.ts +0 -1
- package/dist/components/assessment-player-shell-element.d.ts +0 -1
- package/dist/components/assessment-section-player-runtime.d.ts +0 -10
- package/dist/nl-NL-DqnT-1mq.js +0 -516
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PIE Framework contributors
|
|
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
|
@@ -31,8 +31,8 @@ Importing the package registers `pie-assessment-player-default` and
|
|
|
31
31
|
registers the section player layouts. The entry is bundler-only and
|
|
32
32
|
browser-only: it imports `@pie-players/pie-section-player` and
|
|
33
33
|
`@pie-players/pie-assessment-toolkit` by bare specifier. The package has no
|
|
34
|
-
browser build, so a CDN cannot serve it
|
|
35
|
-
|
|
34
|
+
browser build, so a CDN cannot serve it, and it has no `unpkg` or `jsdelivr`
|
|
35
|
+
field.
|
|
36
36
|
|
|
37
37
|
## Elements
|
|
38
38
|
|
|
@@ -395,8 +395,8 @@ const hooks: AssessmentPlayerHooks = {
|
|
|
395
395
|
```
|
|
396
396
|
|
|
397
397
|
The section player's [Card titles](../section-player/README.md#card-titles)
|
|
398
|
-
lists the context fields
|
|
399
|
-
default title.
|
|
398
|
+
lists the context fields. `{ visible: false }` hides a card's title; any other
|
|
399
|
+
return that is not a non-empty string keeps the default title.
|
|
400
400
|
|
|
401
401
|
## Debug logging
|
|
402
402
|
|
|
@@ -435,20 +435,11 @@ before the assessment player mounts:
|
|
|
435
435
|
import { registerPreloadedElements } from "@pie-players/pie-item-player/preloaded";
|
|
436
436
|
import * as delivery from "@pie-element/multiple-choice/browser/delivery";
|
|
437
437
|
import * as controller from "@pie-element/multiple-choice/browser/controller";
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
registerPreloadedElements(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
tag: "pie-element-multiple-choice",
|
|
444
|
-
package: "@pie-element/multiple-choice",
|
|
445
|
-
version: manifest.dependencies["@pie-element/multiple-choice"],
|
|
446
|
-
element: delivery,
|
|
447
|
-
controller,
|
|
448
|
-
},
|
|
449
|
-
],
|
|
450
|
-
{ math: { assetRoot: "https://assets.example.com/npm" } },
|
|
451
|
-
);
|
|
438
|
+
|
|
439
|
+
// The modules name their package and version; the tag defaults from the name.
|
|
440
|
+
registerPreloadedElements([{ element: delivery, controller }], {
|
|
441
|
+
math: { assetRoot: "https://assets.example.com/npm" },
|
|
442
|
+
});
|
|
452
443
|
```
|
|
453
444
|
|
|
454
445
|
A tag missing at pre-warm leaves the section's items unmounted and raises a
|
package/custom-elements.json
CHANGED
|
@@ -290,8 +290,14 @@
|
|
|
290
290
|
"name": "assessment-progress-changed",
|
|
291
291
|
"type": {
|
|
292
292
|
"text": "CustomEvent<AssessmentProgressChangedDetail>"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"name": "framework-error",
|
|
297
|
+
"type": {
|
|
298
|
+
"text": "CustomEvent<{ kind: \"i18n-locale-load\"; source: string; message: string; details: string[]; recoverable: true; scope: \"runtime\"; cause?: unknown }>"
|
|
293
299
|
},
|
|
294
|
-
"description": "When the visited-section count changes."
|
|
300
|
+
"description": "When a requested interface-locale catalog fails to load for the assembly's own navigation chrome; the assembly keeps rendering through the English fallback chain. Failed loads are not cached, so a later change of `locale` back to that locale retries the load. When the visited-section count changes."
|
|
295
301
|
},
|
|
296
302
|
{
|
|
297
303
|
"name": "assessment-submission-state-changed",
|
|
@@ -309,7 +315,19 @@
|
|
|
309
315
|
}
|
|
310
316
|
],
|
|
311
317
|
"x-pie": {
|
|
312
|
-
"shadow": "none"
|
|
318
|
+
"shadow": "none",
|
|
319
|
+
"classes": [
|
|
320
|
+
"pie-assessment-player-announcer",
|
|
321
|
+
"pie-assessment-player-current-position",
|
|
322
|
+
"pie-assessment-player-default",
|
|
323
|
+
"pie-assessment-player-empty",
|
|
324
|
+
"pie-assessment-player-nav-btn",
|
|
325
|
+
"pie-assessment-player-nav-controls",
|
|
326
|
+
"pie-assessment-player-navigation",
|
|
327
|
+
"pie-assessment-player-retry",
|
|
328
|
+
"pie-assessment-player-section-host",
|
|
329
|
+
"pie-assessment-player-status-message"
|
|
330
|
+
]
|
|
313
331
|
}
|
|
314
332
|
},
|
|
315
333
|
{
|
|
@@ -328,7 +346,6 @@
|
|
|
328
346
|
"type": {
|
|
329
347
|
"text": "boolean | string | null | undefined"
|
|
330
348
|
},
|
|
331
|
-
"default": "true",
|
|
332
349
|
"attribute": "show-navigation"
|
|
333
350
|
}
|
|
334
351
|
],
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Third-party software included in this package's bundles, with the licence each is used under.
|
|
2
|
+
|
|
3
|
+
========================================================================
|
|
4
|
+
|
|
5
|
+
es-module-shims 2.8.4
|
|
6
|
+
License: MIT
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
-----------
|
|
10
|
+
|
|
11
|
+
Copyright (C) 2018-2021 Guy Bedford
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
18
|
+
|
|
19
|
+
========================================================================
|
|
20
|
+
|
|
21
|
+
lit (pre-bundled in the vendored NDS icon button)
|
|
22
|
+
License: BSD-3-Clause
|
|
23
|
+
|
|
24
|
+
BSD 3-Clause License
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2017 Google LLC. All rights reserved.
|
|
27
|
+
|
|
28
|
+
Redistribution and use in source and binary forms, with or without
|
|
29
|
+
modification, are permitted provided that the following conditions are met:
|
|
30
|
+
|
|
31
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
32
|
+
list of conditions and the following disclaimer.
|
|
33
|
+
|
|
34
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
35
|
+
this list of conditions and the following disclaimer in the documentation
|
|
36
|
+
and/or other materials provided with the distribution.
|
|
37
|
+
|
|
38
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
39
|
+
contributors may be used to endorse or promote products derived from
|
|
40
|
+
this software without specific prior written permission.
|
|
41
|
+
|
|
42
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
43
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
44
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
45
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
46
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
47
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
48
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
49
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
50
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
51
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -21,6 +21,8 @@ import { AssessmentDefinition, AssessmentPlayerHooks, AssessmentPlayerRuntimeCon
|
|
|
21
21
|
* @fires {CustomEvent<{ type: "assessment-session-changed"; timestamp: number }>} assessment-session-changed -
|
|
22
22
|
* When navigation or a section snapshot changes the assessment session.
|
|
23
23
|
* @fires {CustomEvent<AssessmentProgressChangedDetail>} assessment-progress-changed -
|
|
24
|
+
*
|
|
25
|
+
* @fires {CustomEvent<{ kind: "i18n-locale-load"; source: string; message: string; details: string[]; recoverable: true; scope: "runtime"; cause?: unknown }>} framework-error - When a requested interface-locale catalog fails to load for the assembly's own navigation chrome; the assembly keeps rendering through the English fallback chain. Failed loads are not cached, so a later change of `locale` back to that locale retries the load.
|
|
24
26
|
* When the visited-section count changes.
|
|
25
27
|
* @fires {CustomEvent<AssessmentSubmissionStateChangedDetail>} assessment-submission-state-changed -
|
|
26
28
|
* When `submit()` records the submission state.
|
|
@@ -63,8 +65,18 @@ export declare class AssessmentPlayerDefaultElement extends HTMLElement implemen
|
|
|
63
65
|
* context above it to resolve from. Constructed with the English catalog
|
|
64
66
|
* already resident, so `t` never returns a bare key.
|
|
65
67
|
*/
|
|
66
|
-
private readonly
|
|
68
|
+
private readonly ownedI18n;
|
|
69
|
+
/** The provider the host supplied through `sectionPlayerRuntime.i18n`, if any. */
|
|
70
|
+
private suppliedI18n;
|
|
71
|
+
private subscribedI18n;
|
|
67
72
|
private unsubscribeI18n?;
|
|
73
|
+
/**
|
|
74
|
+
* The provider resolving this player's navigation chrome: the host's
|
|
75
|
+
* `sectionPlayerRuntime.i18n` when supplied, else the one built here. The
|
|
76
|
+
* section element's runtime carries the same object, so the section and
|
|
77
|
+
* everything under it resolve one provider.
|
|
78
|
+
*/
|
|
79
|
+
private get i18n();
|
|
68
80
|
private sectionHost;
|
|
69
81
|
private sectionControllerRef;
|
|
70
82
|
private sectionSessionReady;
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class AssessmentPlayerShellElement extends HTMLElement {
|
|
12
12
|
static get observedAttributes(): string[];
|
|
13
|
-
|
|
13
|
+
private _showNavigation;
|
|
14
14
|
constructor();
|
|
15
|
+
get showNavigation(): boolean | string | null | undefined;
|
|
16
|
+
set showNavigation(value: boolean | string | null | undefined);
|
|
15
17
|
connectedCallback(): void;
|
|
16
18
|
attributeChangedCallback(name: string, _oldValue: string | null, value: string | null): void;
|
|
17
19
|
private render;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssessmentPlayerDefaultElement } from '../components/AssessmentPlayerDefaultElement.js';
|
|
2
|
+
import { AssessmentPlayerShellElement } from '../components/AssessmentPlayerShellElement.js';
|
|
3
|
+
/** Native host interface, derived from the implementation's public members. */
|
|
4
|
+
export type PieAssessmentPlayerDefaultElement = Pick<AssessmentPlayerDefaultElement, keyof AssessmentPlayerDefaultElement>;
|
|
5
|
+
/** Native host interface for `<pie-assessment-player-shell>`. */
|
|
6
|
+
export type PieAssessmentPlayerShellElement = Pick<AssessmentPlayerShellElement, keyof AssessmentPlayerShellElement>;
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
"pie-assessment-player-default": PieAssessmentPlayerDefaultElement;
|
|
10
|
+
"pie-assessment-player-shell": PieAssessmentPlayerShellElement;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { PieAssessmentPlayerDefaultElement, PieAssessmentPlayerShellElement, } from './contracts/elements.js';
|
|
1
2
|
export { ASSESSMENT_PLAYER_PUBLIC_EVENTS, type AssessmentPlayerPublicEventName, type AssessmentPlayerReadinessPhase, type AssessmentNavigationRequestedDetail, type AssessmentRouteChangedDetail, type AssessmentProgressChangedDetail, type AssessmentSubmissionStateChangedDetail, type AssessmentReadinessChangeDetail, } from './contracts/public-events.js';
|
|
2
3
|
export type { AssessmentPlayerRuntimeHostContract, AssessmentPlayerNavigationSnapshot, AssessmentPlayerProgressSnapshot, AssessmentPlayerSnapshot, } from './contracts/runtime-host-contract.js';
|
|
3
4
|
export type { AssessmentDefinition, AssessmentDeliveryPlan, AssessmentSectionInstance, AssessmentDeliveryPlanContext, AssessmentDeliveryPlanFactoryDefaults, AssessmentSessionPersistenceContext, AssessmentSessionPersistenceStrategy, AssessmentSessionPersistenceFactoryDefaults, AssessmentPlayerHooks, AssessmentPlayerRuntimeConfig, } from './types.js';
|