@pie-players/pie-players-shared 0.3.61 → 0.3.63

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.
Files changed (147) hide show
  1. package/dist/config/profile.js +0 -1
  2. package/dist/i18n/index.js +0 -1
  3. package/dist/i18n/loader.js +0 -1
  4. package/dist/i18n/simple-i18n.js +0 -1
  5. package/dist/i18n/types.js +0 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -1
  8. package/dist/instrumentation/debug-panel-stream.js +0 -1
  9. package/dist/instrumentation/index.js +0 -1
  10. package/dist/instrumentation/provider-guards.js +0 -1
  11. package/dist/instrumentation/providers/BaseInstrumentationProvider.js +0 -1
  12. package/dist/instrumentation/providers/CompositeInstrumentationProvider.js +0 -1
  13. package/dist/instrumentation/providers/ConsoleInstrumentationProvider.js +0 -1
  14. package/dist/instrumentation/providers/DebugPanelInstrumentationProvider.js +0 -1
  15. package/dist/instrumentation/providers/NewRelicInstrumentationProvider.js +0 -1
  16. package/dist/instrumentation/providers/index.js +0 -1
  17. package/dist/instrumentation/types.js +0 -1
  18. package/dist/loader-config.js +0 -1
  19. package/dist/loaders/ElementLoader.js +0 -1
  20. package/dist/loaders/element-loader-types.js +0 -1
  21. package/dist/loaders/element-loader.js +0 -1
  22. package/dist/loaders/element-package-policy.js +0 -1
  23. package/dist/loaders/esm-adapter.js +0 -1
  24. package/dist/loaders/iife-adapter.js +0 -1
  25. package/dist/loaders/index.js +0 -1
  26. package/dist/object/index.js +0 -1
  27. package/dist/pie/asset-handler.js +0 -1
  28. package/dist/pie/authoring-tag.js +0 -1
  29. package/dist/pie/authoring.js +0 -1
  30. package/dist/pie/component-context.js +0 -1
  31. package/dist/pie/config.js +0 -1
  32. package/dist/pie/configure-initialization.js +0 -1
  33. package/dist/pie/correct-response-env.js +0 -1
  34. package/dist/pie/custom-element-define.js +0 -1
  35. package/dist/pie/index.js +0 -1
  36. package/dist/pie/initialization.js +0 -1
  37. package/dist/pie/instrumentation-event-bridge.js +0 -1
  38. package/dist/pie/instrumentation-event-map.js +0 -1
  39. package/dist/pie/instrumentation-provider-resolution.js +0 -1
  40. package/dist/pie/item-controller-storage.js +0 -1
  41. package/dist/pie/item-controller.js +0 -1
  42. package/dist/pie/item-session-contract.js +0 -1
  43. package/dist/pie/logger.js +0 -1
  44. package/dist/pie/math-rendering.js +0 -1
  45. package/dist/pie/overrides.js +0 -1
  46. package/dist/pie/player-initializer.js +0 -1
  47. package/dist/pie/registry.js +0 -1
  48. package/dist/pie/resource-monitor.js +0 -1
  49. package/dist/pie/scoring.js +0 -1
  50. package/dist/pie/stage-tracker.js +0 -1
  51. package/dist/pie/stages.js +0 -1
  52. package/dist/pie/tag-names.js +0 -1
  53. package/dist/pie/types.js +0 -1
  54. package/dist/pie/updates.js +0 -1
  55. package/dist/pie/utils.js +0 -1
  56. package/dist/pie/versioned-tag.js +0 -1
  57. package/dist/player-strategy.js +0 -1
  58. package/dist/security/index.js +0 -1
  59. package/dist/security/sanitize-item-markup.d.ts +11 -0
  60. package/dist/security/sanitize-item-markup.js +5 -3
  61. package/dist/security/sanitize-svg-icon.js +0 -1
  62. package/dist/security/validate-style-url.js +0 -1
  63. package/dist/security/wrap-model-rich-content.js +0 -1
  64. package/dist/security/wrap-overwide-images.js +0 -1
  65. package/dist/security/wrap-overwide-tables.js +0 -1
  66. package/dist/server/npm-registry.js +0 -1
  67. package/dist/types/index.js +0 -1
  68. package/dist/ui/content-styles.js +0 -1
  69. package/dist/ui/debug-panel-persistence.js +0 -1
  70. package/dist/ui/first-focusable.js +0 -1
  71. package/dist/ui/focus-trap.js +0 -1
  72. package/dist/ui/safe-storage.js +0 -1
  73. package/dist/ui/scope-css.d.ts +56 -0
  74. package/dist/ui/scope-css.js +310 -0
  75. package/dist/ui/zoom-compensation.js +0 -1
  76. package/package.json +4 -4
  77. package/dist/config/profile.js.map +0 -1
  78. package/dist/i18n/index.js.map +0 -1
  79. package/dist/i18n/loader.js.map +0 -1
  80. package/dist/i18n/simple-i18n.js.map +0 -1
  81. package/dist/i18n/types.js.map +0 -1
  82. package/dist/index.js.map +0 -1
  83. package/dist/instrumentation/debug-panel-stream.js.map +0 -1
  84. package/dist/instrumentation/index.js.map +0 -1
  85. package/dist/instrumentation/provider-guards.js.map +0 -1
  86. package/dist/instrumentation/providers/BaseInstrumentationProvider.js.map +0 -1
  87. package/dist/instrumentation/providers/CompositeInstrumentationProvider.js.map +0 -1
  88. package/dist/instrumentation/providers/ConsoleInstrumentationProvider.js.map +0 -1
  89. package/dist/instrumentation/providers/DebugPanelInstrumentationProvider.js.map +0 -1
  90. package/dist/instrumentation/providers/NewRelicInstrumentationProvider.js.map +0 -1
  91. package/dist/instrumentation/providers/index.js.map +0 -1
  92. package/dist/instrumentation/types.js.map +0 -1
  93. package/dist/loader-config.js.map +0 -1
  94. package/dist/loaders/ElementLoader.js.map +0 -1
  95. package/dist/loaders/element-loader-types.js.map +0 -1
  96. package/dist/loaders/element-loader.js.map +0 -1
  97. package/dist/loaders/element-package-policy.js.map +0 -1
  98. package/dist/loaders/esm-adapter.js.map +0 -1
  99. package/dist/loaders/iife-adapter.js.map +0 -1
  100. package/dist/loaders/index.js.map +0 -1
  101. package/dist/object/index.js.map +0 -1
  102. package/dist/pie/asset-handler.js.map +0 -1
  103. package/dist/pie/authoring-tag.js.map +0 -1
  104. package/dist/pie/authoring.js.map +0 -1
  105. package/dist/pie/component-context.js.map +0 -1
  106. package/dist/pie/config.js.map +0 -1
  107. package/dist/pie/configure-initialization.js.map +0 -1
  108. package/dist/pie/correct-response-env.js.map +0 -1
  109. package/dist/pie/custom-element-define.js.map +0 -1
  110. package/dist/pie/index.js.map +0 -1
  111. package/dist/pie/initialization.js.map +0 -1
  112. package/dist/pie/instrumentation-event-bridge.js.map +0 -1
  113. package/dist/pie/instrumentation-event-map.js.map +0 -1
  114. package/dist/pie/instrumentation-provider-resolution.js.map +0 -1
  115. package/dist/pie/item-controller-storage.js.map +0 -1
  116. package/dist/pie/item-controller.js.map +0 -1
  117. package/dist/pie/item-session-contract.js.map +0 -1
  118. package/dist/pie/logger.js.map +0 -1
  119. package/dist/pie/math-rendering.js.map +0 -1
  120. package/dist/pie/overrides.js.map +0 -1
  121. package/dist/pie/player-initializer.js.map +0 -1
  122. package/dist/pie/registry.js.map +0 -1
  123. package/dist/pie/resource-monitor.js.map +0 -1
  124. package/dist/pie/scoring.js.map +0 -1
  125. package/dist/pie/stage-tracker.js.map +0 -1
  126. package/dist/pie/stages.js.map +0 -1
  127. package/dist/pie/tag-names.js.map +0 -1
  128. package/dist/pie/types.js.map +0 -1
  129. package/dist/pie/updates.js.map +0 -1
  130. package/dist/pie/utils.js.map +0 -1
  131. package/dist/pie/versioned-tag.js.map +0 -1
  132. package/dist/player-strategy.js.map +0 -1
  133. package/dist/security/index.js.map +0 -1
  134. package/dist/security/sanitize-item-markup.js.map +0 -1
  135. package/dist/security/sanitize-svg-icon.js.map +0 -1
  136. package/dist/security/validate-style-url.js.map +0 -1
  137. package/dist/security/wrap-model-rich-content.js.map +0 -1
  138. package/dist/security/wrap-overwide-images.js.map +0 -1
  139. package/dist/security/wrap-overwide-tables.js.map +0 -1
  140. package/dist/server/npm-registry.js.map +0 -1
  141. package/dist/types/index.js.map +0 -1
  142. package/dist/ui/content-styles.js.map +0 -1
  143. package/dist/ui/debug-panel-persistence.js.map +0 -1
  144. package/dist/ui/first-focusable.js.map +0 -1
  145. package/dist/ui/focus-trap.js.map +0 -1
  146. package/dist/ui/safe-storage.js.map +0 -1
  147. package/dist/ui/zoom-compensation.js.map +0 -1
@@ -24,4 +24,3 @@ export const BUILDER_ORIGIN_URL = (typeof window !== "undefined" && window.PIE_B
24
24
  export const BUILDER_BUNDLE_URL = (typeof window !== "undefined" && window.PIE_BUILDER_BUNDLE_URL) ||
25
25
  readPublicEnv("PUBLIC_BUILDER_BUNDLE_URL") ||
26
26
  DEFAULT_BUILDER_BUNDLE_URL;
27
- //# sourceMappingURL=profile.js.map
@@ -7,4 +7,3 @@
7
7
  */
8
8
  export { BUNDLED_TRANSLATIONS, getAvailableLocales, isRTLLocale, loadTranslations, } from "./loader.js";
9
9
  export { SimpleI18n } from "./simple-i18n.js";
10
- //# sourceMappingURL=index.js.map
@@ -130,4 +130,3 @@ export function getAvailableLocales() {
130
130
  export function isRTLLocale(locale) {
131
131
  return RTL_LOCALES.includes(locale);
132
132
  }
133
- //# sourceMappingURL=loader.js.map
@@ -196,4 +196,3 @@ export class SimpleI18n {
196
196
  return browserLang.split("-")[0];
197
197
  }
198
198
  }
199
- //# sourceMappingURL=simple-i18n.js.map
@@ -5,4 +5,3 @@
5
5
  * Defined in players-shared to avoid circular dependencies.
6
6
  */
7
7
  export {};
8
- //# sourceMappingURL=types.js.map
package/dist/index.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from "./ui/focus-trap.js";
13
13
  export * from "./ui/first-focusable.js";
14
14
  export * from "./ui/debug-panel-persistence.js";
15
15
  export * from "./ui/safe-storage.js";
16
+ export * from "./ui/scope-css.js";
package/dist/index.js CHANGED
@@ -13,4 +13,4 @@ export * from "./ui/focus-trap.js";
13
13
  export * from "./ui/first-focusable.js";
14
14
  export * from "./ui/debug-panel-persistence.js";
15
15
  export * from "./ui/safe-storage.js";
16
- //# sourceMappingURL=index.js.map
16
+ export * from "./ui/scope-css.js";
@@ -107,4 +107,3 @@ export function createMetricDebugRecord(args) {
107
107
  : undefined,
108
108
  };
109
109
  }
110
- //# sourceMappingURL=debug-panel-stream.js.map
@@ -33,4 +33,3 @@
33
33
  export * from "./providers/index.js";
34
34
  export { isInstrumentationProvider } from "./provider-guards.js";
35
35
  export { clearBufferedInstrumentationDebugRecords, getBufferedInstrumentationDebugRecords, INSTRUMENTATION_DEBUG_EVENT_NAME, subscribeInstrumentationDebugRecords, } from "./debug-panel-stream.js";
36
- //# sourceMappingURL=index.js.map
@@ -10,4 +10,3 @@ export function isInstrumentationProvider(value) {
10
10
  typeof candidate.destroy === "function" &&
11
11
  typeof candidate.isReady === "function");
12
12
  }
13
- //# sourceMappingURL=provider-guards.js.map
@@ -264,4 +264,3 @@ export class BaseInstrumentationProvider {
264
264
  return attributes;
265
265
  }
266
266
  }
267
- //# sourceMappingURL=BaseInstrumentationProvider.js.map
@@ -79,4 +79,3 @@ export class CompositeInstrumentationProvider {
79
79
  }
80
80
  }
81
81
  }
82
- //# sourceMappingURL=CompositeInstrumentationProvider.js.map
@@ -179,4 +179,3 @@ export class ConsoleInstrumentationProvider extends BaseInstrumentationProvider
179
179
  console.log("Attributes:", attributes);
180
180
  }
181
181
  }
182
- //# sourceMappingURL=ConsoleInstrumentationProvider.js.map
@@ -70,4 +70,3 @@ export class DebugPanelInstrumentationProvider extends BaseInstrumentationProvid
70
70
  });
71
71
  }
72
72
  }
73
- //# sourceMappingURL=DebugPanelInstrumentationProvider.js.map
@@ -131,4 +131,3 @@ export class NewRelicInstrumentationProvider extends BaseInstrumentationProvider
131
131
  }
132
132
  }
133
133
  }
134
- //# sourceMappingURL=NewRelicInstrumentationProvider.js.map
@@ -10,4 +10,3 @@ export { CompositeInstrumentationProvider } from "./CompositeInstrumentationProv
10
10
  export { ConsoleInstrumentationProvider } from "./ConsoleInstrumentationProvider.js";
11
11
  export { DebugPanelInstrumentationProvider } from "./DebugPanelInstrumentationProvider.js";
12
12
  export { NewRelicInstrumentationProvider } from "./NewRelicInstrumentationProvider.js";
13
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@
6
6
  * to enable clients to use any instrumentation provider.
7
7
  */
8
8
  export {};
9
- //# sourceMappingURL=types.js.map
@@ -14,4 +14,3 @@ export const DEFAULT_LOADER_CONFIG = {
14
14
  resourceRetryDelay: 500,
15
15
  iifeBundleRetry: DEFAULT_IIFE_BUNDLE_RETRY_CONFIG,
16
16
  };
17
- //# sourceMappingURL=loader-config.js.map
@@ -54,4 +54,3 @@ export function aggregateElements(items) {
54
54
  });
55
55
  return elementMap;
56
56
  }
57
- //# sourceMappingURL=ElementLoader.js.map
@@ -23,4 +23,3 @@ export class AdapterFailure extends Error {
23
23
  this.reasons = reasons;
24
24
  }
25
25
  }
26
- //# sourceMappingURL=element-loader-types.js.map
@@ -416,4 +416,3 @@ export const __testing = {
416
416
  resolvedBackendOverrides.clear();
417
417
  },
418
418
  };
419
- //# sourceMappingURL=element-loader.js.map
@@ -65,4 +65,3 @@ export function assertElementPackagesAllowed(elements, policy) {
65
65
  }
66
66
  }
67
67
  }
68
- //# sourceMappingURL=element-package-policy.js.map
@@ -541,4 +541,3 @@ function assertImportMapSupported() {
541
541
  throw new Error('This browser does not support import maps. Use moduleResolution="url" or switch to iife/preloaded strategy.');
542
542
  }
543
543
  }
544
- //# sourceMappingURL=esm-adapter.js.map
@@ -395,4 +395,3 @@ function createEmptyConfigure() {
395
395
  }
396
396
  };
397
397
  }
398
- //# sourceMappingURL=iife-adapter.js.map
@@ -35,4 +35,3 @@ export { assertElementPackagesAllowed, ElementPackagePolicyError, } from "./elem
35
35
  export { AdapterFailure, ElementAssertionError, ElementLoaderError, assertRegistered, ensureRegistered, } from "./element-loader.js";
36
36
  export { BUILT_IN_VIEWS, createEsmBackend, mapEsmViewElements, } from "./esm-adapter.js";
37
37
  export { createIifeBackend, DEFAULT_BUNDLE_HOST } from "./iife-adapter.js";
38
- //# sourceMappingURL=index.js.map
@@ -37,4 +37,3 @@ export const cloneDeep = (value) => {
37
37
  }
38
38
  return copy;
39
39
  };
40
- //# sourceMappingURL=index.js.map
@@ -413,4 +413,3 @@ export function createDefaultSoundDeleteHandler() {
413
413
  done(); // Success
414
414
  };
415
415
  }
416
- //# sourceMappingURL=asset-handler.js.map
@@ -10,4 +10,3 @@ export function transformMarkupForAuthoring(markup, elements) {
10
10
  return result.replace(exactTag, (_match, opening) => `${opening}${elementTag}-config`);
11
11
  }, markup);
12
12
  }
13
- //# sourceMappingURL=authoring-tag.js.map
@@ -198,4 +198,3 @@ export function createAuthoringAssetEventManager(rootElement, handlers, onHandle
198
198
  }
199
199
  : undefined);
200
200
  }
201
- //# sourceMappingURL=authoring.js.map
@@ -27,4 +27,3 @@ export function getCurrentComponentContext() {
27
27
  ? activeComponents[activeComponents.length - 1]
28
28
  : null;
29
29
  }
30
- //# sourceMappingURL=component-context.js.map
@@ -258,4 +258,3 @@ export const makeUniqueTags = (container) => {
258
258
  },
259
259
  };
260
260
  };
261
- //# sourceMappingURL=config.js.map
@@ -28,4 +28,3 @@ export function initializeConfiguresFromLoadedBundle(config, configuration, opti
28
28
  logger.debug("[initializeConfiguresFromLoadedBundle] Initialization complete");
29
29
  return initializedModels;
30
30
  }
31
- //# sourceMappingURL=configure-initialization.js.map
@@ -3,4 +3,3 @@ export const getCorrectResponseEnv = (env) => ({
3
3
  ...env,
4
4
  role: "instructor",
5
5
  });
6
- //# sourceMappingURL=correct-response-env.js.map
@@ -28,4 +28,3 @@ export const defineCustomElementSafely = (tagName, elementConstructor, context =
28
28
  throw error;
29
29
  }
30
30
  };
31
- //# sourceMappingURL=custom-element-define.js.map
package/dist/pie/index.js CHANGED
@@ -44,4 +44,3 @@ export { updatePieElement, updatePieElements, updatePieElementWithRef, } from ".
44
44
  export { addOrUpdateOverrideInUrl, applyElementOverrides, applyElementVersionOverridesPreserveTags, extractPackageInfo, formatElementOverrideParam, parseElementOverridesFromCurrentUrl, parseElementOverridesFromUrl, } from "./overrides.js";
45
45
  // Utils
46
46
  export { findOrAddSession, getPackageWithoutVersion, getPieElementBundlesUrl, parsePackageName, } from "./utils.js";
47
- //# sourceMappingURL=index.js.map
@@ -423,4 +423,3 @@ const withBlobBundleUrl = async (bundleJs, options, run) => {
423
423
  URL.revokeObjectURL(bundleUrl);
424
424
  }
425
425
  };
426
- //# sourceMappingURL=initialization.js.map
@@ -106,4 +106,3 @@ export function attachInstrumentationEventBridge(args) {
106
106
  }
107
107
  };
108
108
  }
109
- //# sourceMappingURL=instrumentation-event-bridge.js.map
@@ -101,4 +101,3 @@ export const ASSESSMENT_INSTRUMENTATION_EVENT_MAP = [
101
101
  instrumentationEventName: "pie-assessment-error",
102
102
  },
103
103
  ];
104
- //# sourceMappingURL=instrumentation-event-map.js.map
@@ -63,4 +63,3 @@ export function resolveInstrumentationProvider(args) {
63
63
  }
64
64
  return undefined;
65
65
  }
66
- //# sourceMappingURL=instrumentation-provider-resolution.js.map
@@ -41,4 +41,3 @@ export class SessionStorageItemSessionStorage {
41
41
  catch { }
42
42
  }
43
43
  }
44
- //# sourceMappingURL=item-controller-storage.js.map
@@ -89,4 +89,3 @@ export class ItemController {
89
89
  }
90
90
  }
91
91
  export const normalizeItemSessionContainer = normalizeSessionContainer;
92
- //# sourceMappingURL=item-controller.js.map
@@ -254,4 +254,3 @@ export function normalizeItemSessionChange(args) {
254
254
  complete: getMetadataComplete(sessionDetail, candidate),
255
255
  };
256
256
  }
257
- //# sourceMappingURL=item-session-contract.js.map
@@ -42,4 +42,3 @@ export function createPieLogger(namespace, debugEnabledFn) {
42
42
  export function isGlobalDebugEnabled() {
43
43
  return typeof window !== "undefined" && window.PIE_DEBUG === true;
44
44
  }
45
- //# sourceMappingURL=logger.js.map
@@ -123,4 +123,3 @@ export function renderMath(element) {
123
123
  renderer.renderMath(element);
124
124
  }
125
125
  }
126
- //# sourceMappingURL=math-rendering.js.map
@@ -199,4 +199,3 @@ export function extractPackageInfo(packageStr) {
199
199
  };
200
200
  }
201
201
  }
202
- //# sourceMappingURL=overrides.js.map
@@ -120,4 +120,3 @@ export async function fetchItemData(apiBaseUrl, itemId, token, endpoint, env, ad
120
120
  }
121
121
  return await response.json();
122
122
  }
123
- //# sourceMappingURL=player-initializer.js.map
@@ -18,4 +18,3 @@ export const pieRegistry = () => {
18
18
  }
19
19
  return registry;
20
20
  };
21
- //# sourceMappingURL=registry.js.map
@@ -1349,4 +1349,3 @@ export function getTrackedResourceRequests() {
1349
1349
  export function clearTrackedResourceRequests() {
1350
1350
  failedRequests.clear();
1351
1351
  }
1352
- //# sourceMappingURL=resource-monitor.js.map
@@ -108,4 +108,3 @@ export async function scorePieItem(config, sessionData, options = {}) {
108
108
  : r.filter(Boolean),
109
109
  };
110
110
  }
111
- //# sourceMappingURL=scoring.js.map
@@ -103,4 +103,3 @@ export function createStageTracker(opts) {
103
103
  }
104
104
  return { enter, reset, getCurrent };
105
105
  }
106
- //# sourceMappingURL=stage-tracker.js.map
@@ -55,4 +55,3 @@ export function stageOrdinal(stage) {
55
55
  }
56
56
  return idx;
57
57
  }
58
- //# sourceMappingURL=stages.js.map
@@ -59,4 +59,3 @@ export const toPrintHashedTag = (baseTag, hashSource, hashFn) => {
59
59
  const hash = Math.abs(hashFn(hashSource));
60
60
  return `${baseTag}-print-${hash}`;
61
61
  };
62
- //# sourceMappingURL=tag-names.js.map
package/dist/pie/types.js CHANGED
@@ -49,4 +49,3 @@ export function isCustomElementConstructor(obj) {
49
49
  export function isPieRegistryAvailable(obj) {
50
50
  return obj && typeof obj.PIE_REGISTRY === "object";
51
51
  }
52
- //# sourceMappingURL=types.js.map
@@ -225,4 +225,3 @@ export const updatePieElements = (config, session, env, container, onElementSess
225
225
  onElementSessionUpdate,
226
226
  }))).then(() => undefined);
227
227
  };
228
- //# sourceMappingURL=updates.js.map
package/dist/pie/utils.js CHANGED
@@ -71,4 +71,3 @@ export const findOrAddSession = (data, id, element) => {
71
71
  data.push(ss);
72
72
  return ss;
73
73
  };
74
- //# sourceMappingURL=utils.js.map
@@ -40,4 +40,3 @@ export function toPackageVersionedTag(tagName, packageSpec, options = {}) {
40
40
  // package versions at runtime, which requires updating the cloned runtime tag.
41
41
  return `${baseName}${VERSION_DELIMITER}${targetEncodedVersion}`;
42
42
  }
43
- //# sourceMappingURL=versioned-tag.js.map
@@ -10,4 +10,3 @@ export function resolveItemPlayerView(mode, defaultView = "delivery") {
10
10
  }
11
11
  return defaultView;
12
12
  }
13
- //# sourceMappingURL=player-strategy.js.map
@@ -4,4 +4,3 @@ export { resetSvgSanitizerForTesting, sanitizeSvgIcon, } from "./sanitize-svg-ic
4
4
  export { wrapOverwideImages, wrapOverwideImagesInElement, } from "./wrap-overwide-images.js";
5
5
  export { wrapModelRichContent } from "./wrap-model-rich-content.js";
6
6
  export { wrapOverwideTables, wrapOverwideTablesInElement, } from "./wrap-overwide-tables.js";
7
- //# sourceMappingURL=index.js.map
@@ -15,6 +15,17 @@ export interface SanitizeItemMarkupOptions {
15
15
  * tags that rewrite to `pie-*-config` or host-registered extensions.
16
16
  */
17
17
  allowedCustomElements?: string[];
18
+ /**
19
+ * Whether to apply the overwide image / table scroll wrappers after
20
+ * sanitizing. Defaults to `true` for screen rendering.
21
+ *
22
+ * Print rendering must pass `false`: the wrappers are `overflow-x: auto`
23
+ * reflow affordances (WCAG 1.4.10 at 400% zoom), and `@pie-players/pie-theme`
24
+ * carries no `@media print` override for them. In print media `overflow`
25
+ * clips instead of scrolling, so a wide image or table would be silently
26
+ * cut off at the column edge with no way to reach the rest.
27
+ */
28
+ wrapOverwideContent?: boolean;
18
29
  }
19
30
  /**
20
31
  * Sanitize raw item/passage markup before it is injected into the DOM.
@@ -138,6 +138,9 @@ export function sanitizeItemMarkup(markup, options = {}) {
138
138
  RETURN_TRUSTED_TYPE: false,
139
139
  });
140
140
  const sanitized = typeof result === "string" ? result : String(result ?? "");
141
+ // Print rendering opts out: `overflow` clips rather than scrolls on paper.
142
+ if (options.wrapOverwideContent === false)
143
+ return sanitized;
141
144
  // PIE-94: wrap overwide authored images in a horizontal-scroll container
142
145
  // so they don't get clipped by ancestor `overflow-x: hidden` regions in
143
146
  // the section player (and match WCAG 1.4.10 Reflow at 400% zoom).
@@ -151,8 +154,8 @@ export function sanitizeItemMarkup(markup, options = {}) {
151
154
  * can safely use reference equality when deciding whether to re-sanitize.
152
155
  */
153
156
  export function createDefaultItemMarkupSanitizer(options = {}) {
154
- const { allowedCustomElements } = options;
155
- return (markup) => sanitizeItemMarkup(markup, { allowedCustomElements });
157
+ const { allowedCustomElements, wrapOverwideContent } = options;
158
+ return (markup) => sanitizeItemMarkup(markup, { allowedCustomElements, wrapOverwideContent });
156
159
  }
157
160
  /**
158
161
  * Derive the authoring-mode allow-list (`pie-*-config`) from a set of PIE
@@ -174,4 +177,3 @@ export function buildAuthoringAllowList(elementTagNames) {
174
177
  export function resetPurifierForTesting() {
175
178
  purifierInstance = null;
176
179
  }
177
- //# sourceMappingURL=sanitize-item-markup.js.map
@@ -86,4 +86,3 @@ export function resetSvgSanitizerForTesting() {
86
86
  svgPurifierInstance = null;
87
87
  stringCache.clear();
88
88
  }
89
- //# sourceMappingURL=sanitize-svg-icon.js.map
@@ -55,4 +55,3 @@ export function parseAllowedStyleOrigins(raw) {
55
55
  .map((entry) => entry.trim())
56
56
  .filter((entry) => entry.length > 0);
57
57
  }
58
- //# sourceMappingURL=validate-style-url.js.map
@@ -38,4 +38,3 @@ function wrapValue(value, parentKey) {
38
38
  export function wrapModelRichContent(model) {
39
39
  return wrapValue(model);
40
40
  }
41
- //# sourceMappingURL=wrap-model-rich-content.js.map
@@ -113,4 +113,3 @@ export function wrapOverwideImages(markup) {
113
113
  });
114
114
  return wrapped > 0 ? body.innerHTML : markup;
115
115
  }
116
- //# sourceMappingURL=wrap-overwide-images.js.map
@@ -124,4 +124,3 @@ export function wrapOverwideTables(markup) {
124
124
  });
125
125
  return wrapped > 0 ? body.innerHTML : markup;
126
126
  }
127
- //# sourceMappingURL=wrap-overwide-tables.js.map
@@ -57,4 +57,3 @@ export const getNpmPackageVersions = async (element, fetch, filter = DEFAULT_FIL
57
57
  return searchTerm ? [] : ["latest"];
58
58
  }
59
59
  };
60
- //# sourceMappingURL=npm-registry.js.map
@@ -117,4 +117,3 @@ export var StandardType;
117
117
  StandardType[StandardType["LEVEL"] = 2] = "LEVEL";
118
118
  StandardType[StandardType["STANDARD"] = 3] = "STANDARD";
119
119
  })(StandardType || (StandardType = {}));
120
- //# sourceMappingURL=index.js.map
@@ -202,4 +202,3 @@ export function resetContentStylesWarningForTesting() {
202
202
  clearTimeout(handle);
203
203
  pendingChecks.length = 0;
204
204
  }
205
- //# sourceMappingURL=content-styles.js.map
@@ -35,4 +35,3 @@ export function clearDebugPanelState(key) {
35
35
  // ignore
36
36
  }
37
37
  }
38
- //# sourceMappingURL=debug-panel-persistence.js.map
@@ -24,4 +24,3 @@ export function isProgrammaticFocusTarget(el) {
24
24
  return false;
25
25
  return el.offsetParent !== null || el.getClientRects().length > 0;
26
26
  }
27
- //# sourceMappingURL=first-focusable.js.map
@@ -81,4 +81,3 @@ export function createFocusTrap(container, options = {}) {
81
81
  }
82
82
  };
83
83
  }
84
- //# sourceMappingURL=focus-trap.js.map
@@ -18,4 +18,3 @@ export function safeLocalStorageSet(key, value) {
18
18
  // ignore
19
19
  }
20
20
  }
21
- //# sourceMappingURL=safe-storage.js.map
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Scope an external stylesheet's rules to a single player instance, so a
3
+ * partner-authored stylesheet loaded via `<pie-item-player
4
+ * external-style-urls="...">` or `itemConfig.resources.stylesheets[*].url`
5
+ * styles that player's subtree instead of the whole host document.
6
+ *
7
+ * This replaces a single-regex implementation that prefixed every
8
+ * selector-like fragment. That is correct for flat selector rules and wrong for
9
+ * everything else: `@media screen { ... }` became
10
+ * `.scope @media screen { ... }`, an invalid selector, so the browser dropped
11
+ * the whole block and every rule inside it; `@font-face` and `@keyframes` were
12
+ * corrupted the same way; and `:root` became `.scope :root`, which can never
13
+ * match, because `:root` is `<html>` and is not a descendant of the player.
14
+ * At-rules and `:root` custom properties therefore never applied at all.
15
+ *
16
+ * The QTI player's `scopeCssRules` (`pie-qti` -
17
+ * `packages/item-player/src/components/utils/stylesheetRender.ts`) is not a
18
+ * drop-in either. Its `:root` handling is the behaviour we want and is adopted
19
+ * here, but it excludes `@` from its selector pattern rather than understanding
20
+ * at-rules, so `@media` and `@supports` lose their condition and their inner
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.
23
+ *
24
+ * So this walks the stylesheet brace-by-brace instead of pattern-matching it.
25
+ * A real CSS parser would be the textbook answer and is deliberately not used:
26
+ * `@pie-players/pie-item-player` ships with two workspace dependencies, this
27
+ * runs in the delivery path, and scoping needs to know about rule boundaries
28
+ * only — not about property grammar.
29
+ *
30
+ * Known limits, all preserving existing behaviour rather than adding policy:
31
+ *
32
+ * - `@import` is passed through untouched, exactly as the old regex left it. It
33
+ * pulls in an unscoped stylesheet, so it defeats scoping, but blocking it is
34
+ * a security policy decision and not this function's job. Callers gate
35
+ * stylesheet URLs with `validateExternalStyleUrl` before fetching.
36
+ * - Declaration blocks are emitted verbatim, so `url(...)` references are left
37
+ * as authored and resolve against the stylesheet's own URL as before.
38
+ * - A style rule's block is never rewritten, which is also what native CSS
39
+ * nesting needs: nested selectors are relative to a parent that has already
40
+ * been scoped.
41
+ */
42
+ /**
43
+ * Rewrite `cssText` so every selector it contains is confined to
44
+ * `scopeSelector`.
45
+ *
46
+ * Returns `cssText` unchanged when there is no scope selector to apply, and
47
+ * `""` for empty or non-string input.
48
+ */
49
+ export declare function scopeStylesheetCss(cssText: unknown, scopeSelector: string): string;
50
+ /**
51
+ * Confine a single selector to `scopeSelector`.
52
+ *
53
+ * Exported for tests and for callers that scope a selector they built
54
+ * themselves; `scopeStylesheetCss` is the entry point for stylesheet text.
55
+ */
56
+ export declare function scopeSelector(selector: string, scopeSelector: string): string;