@pie-players/pie-players-shared 0.3.75 → 1.0.0-beta.0
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 +88 -77
- package/dist/components/vendor/nds/README.md +4 -5
- package/dist/config/profile.d.ts +1 -1
- package/dist/config/profile.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/language-tags.d.ts +9 -1
- package/dist/i18n/language-tags.js +11 -1
- package/dist/i18n/messages/en-US.d.ts +33 -5
- package/dist/i18n/messages/en-US.js +33 -5
- package/dist/i18n/messages/nl-NL.d.ts +33 -5
- package/dist/i18n/messages/nl-NL.js +33 -5
- package/dist/i18n/provider.d.ts +14 -7
- package/dist/i18n/provider.js +26 -29
- package/dist/index.js +0 -1
- package/dist/instrumentation/providers/BaseInstrumentationProvider.js +0 -14
- package/dist/loader-config.d.ts +0 -2
- package/dist/loader-config.js +0 -2
- package/dist/loaders/element-loader.js +13 -6
- package/dist/loaders/esm-adapter.js +48 -37
- package/dist/loaders/iife-adapter.d.ts +3 -3
- package/dist/loaders/iife-adapter.js +36 -35
- package/dist/media/index.d.ts +4 -6
- package/dist/media/index.js +6 -8
- package/dist/object/index.d.ts +8 -3
- package/dist/object/index.js +8 -6
- package/dist/pie/asset-handler.d.ts +0 -17
- package/dist/pie/asset-handler.js +1 -1
- package/dist/pie/authoring.js +5 -7
- package/dist/pie/elements-rendered.d.ts +0 -2
- package/dist/pie/elements-rendered.js +1 -1
- package/dist/pie/initialization.d.ts +13 -14
- package/dist/pie/initialization.js +61 -75
- package/dist/pie/item-session-contract.js +7 -9
- package/dist/pie/resource-monitor.d.ts +34 -32
- package/dist/pie/resource-monitor.js +152 -231
- package/dist/pie/stages.d.ts +4 -3
- package/dist/pie/stages.js +4 -3
- package/dist/pie/updates.js +5 -4
- package/dist/pie/utils.d.ts +0 -2
- package/dist/pie/utils.js +0 -2
- package/dist/security/sanitize-item-markup.d.ts +4 -4
- package/dist/security/sanitize-item-markup.js +4 -4
- package/dist/security/sanitize-svg-icon.js +2 -2
- package/dist/security/wrap-overwide-images.d.ts +1 -1
- package/dist/security/wrap-overwide-images.js +1 -1
- package/dist/timed-media/media-element-source.js +1 -2
- package/dist/types/index.d.ts +62 -52
- package/dist/types/index.js +2 -2
- package/dist/ui/attribute-coercion.d.ts +5 -0
- package/dist/ui/attribute-coercion.js +6 -4
- package/dist/ui/content-styles.d.ts +6 -10
- package/dist/ui/content-styles.js +8 -13
- package/dist/ui/first-focusable.d.ts +0 -1
- package/dist/ui/first-focusable.js +0 -1
- package/dist/ui/focus-trap.js +2 -3
- package/dist/ui/scope-css.d.ts +23 -26
- package/dist/ui/scope-css.js +23 -26
- package/package.json +3 -2
package/dist/ui/scope-css.js
CHANGED
|
@@ -4,37 +4,34 @@
|
|
|
4
4
|
* external-style-urls="...">` or `itemConfig.resources.stylesheets[*].url`
|
|
5
5
|
* styles that player's subtree instead of the whole host document.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
7
|
+
* Walks the stylesheet brace-by-brace. Block at-rules that hold rules
|
|
8
|
+
* (`@media`, `@supports`, `@container`, `@layer`, `@scope`) keep their prelude
|
|
9
|
+
* and have their inner rules scoped, every other at-rule passes through, and a
|
|
10
|
+
* leading `:root`, `html` or `body` is replaced by the scope, since
|
|
11
|
+
* `.scope :root` can never match: `:root` is `<html>`, which is no descendant
|
|
12
|
+
* of the player. A regex prefixer fails on exactly these cases: it turned
|
|
13
|
+
* `@media screen { … }` into the invalid `.scope @media screen { … }`, which the
|
|
14
|
+
* browser drops with every rule inside, and corrupted `@font-face`,
|
|
15
|
+
* `@keyframes` and `:root` the same way.
|
|
15
16
|
*
|
|
16
|
-
* The QTI player's `scopeCssRules` (`pie-qti` -
|
|
17
|
-
* `packages/item-player/src/components/utils/stylesheetRender.ts`) is
|
|
18
|
-
* drop-in
|
|
19
|
-
*
|
|
20
|
-
* at
|
|
21
|
-
* rules are hoisted and applied unconditionally — a mobile-only rule then
|
|
22
|
-
* applies at every viewport width, which is a subtler failure than dropping it.
|
|
17
|
+
* The `:root` handling follows the QTI player's `scopeCssRules` (`pie-qti` -
|
|
18
|
+
* `packages/item-player/src/components/utils/stylesheetRender.ts`), which is no
|
|
19
|
+
* drop-in: it excludes `@` from its selector pattern without understanding
|
|
20
|
+
* at-rules, so `@media` and `@supports` lose their condition and their rules
|
|
21
|
+
* apply at every viewport width.
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* runs in the delivery path, and scoping needs to know about rule boundaries
|
|
28
|
-
* only — not about property grammar.
|
|
23
|
+
* No CSS parser: `@pie-players/pie-item-player` ships with two workspace
|
|
24
|
+
* dependencies, this runs in the delivery path, and scoping needs rule
|
|
25
|
+
* boundaries only.
|
|
29
26
|
*
|
|
30
|
-
* Known limits
|
|
27
|
+
* Known limits:
|
|
31
28
|
*
|
|
32
|
-
* - `@import` is passed through untouched
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
29
|
+
* - `@import` is passed through untouched. It pulls in an unscoped stylesheet,
|
|
30
|
+
* so it defeats scoping, but blocking it is a security policy decision and
|
|
31
|
+
* not this function's job. Callers gate stylesheet URLs with
|
|
32
|
+
* `validateExternalStyleUrl` before fetching.
|
|
36
33
|
* - Declaration blocks are emitted verbatim, so `url(...)` references are left
|
|
37
|
-
* as authored and resolve against the stylesheet's own URL
|
|
34
|
+
* as authored and resolve against the stylesheet's own URL.
|
|
38
35
|
* - A style rule's block is never rewritten, which is also what native CSS
|
|
39
36
|
* nesting needs: nested selectors are relative to a parent that has already
|
|
40
37
|
* been scoped.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-players-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Shared runtime + UI utilities for PIE players",
|
|
6
6
|
"license": "MIT",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"dev": "tsc -p tsconfig.json --watch",
|
|
113
113
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json",
|
|
114
114
|
"lint": "biome lint .",
|
|
115
|
-
"check": "
|
|
115
|
+
"check": "svelte-check --tsconfig ./tsconfig.svelte-check.json",
|
|
116
116
|
"test": "bun test",
|
|
117
117
|
"check-i18n": "bun run src/i18n/scripts/check-coverage.ts",
|
|
118
118
|
"scan-hardcoded": "bun run src/i18n/scripts/scan-hardcoded.ts"
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"esbuild": "^0.28.2",
|
|
128
128
|
"glob": "^13.0.0",
|
|
129
129
|
"svelte": "^5.57.1",
|
|
130
|
+
"svelte-check": "^4.7.6",
|
|
130
131
|
"typescript": "^5.9.3"
|
|
131
132
|
},
|
|
132
133
|
"homepage": "https://github.com/pie-framework/pie-players/tree/master/packages/players-shared#readme",
|