@pie-players/pie-preloaded-player 0.1.2-963a099.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ # @pie-players/pie-preloaded-player
2
+
3
+ Version: 0.1.2-963a099.1
4
+
5
+ Hash: 963a099
6
+
7
+ Use with `<pie-item-player strategy="preloaded">`.
@@ -0,0 +1,20 @@
1
+ declare module '@pie-players/pie-preloaded-player' {
2
+ export {};
3
+ global {
4
+ interface HTMLElementTagNameMap {
5
+ 'pie-item-player': HTMLElement;
6
+ }
7
+ interface Window {
8
+ PIE_DEBUG?: boolean;
9
+ PIE_LOADER_CONFIG?: {
10
+ trackPageActions?: boolean;
11
+ maxResourceRetries?: number;
12
+ resourceRetryDelay?: number;
13
+ };
14
+ newrelic?: {
15
+ addPageAction(name: string, attributes?: Record<string, any>): void;
16
+ noticeError(error: Error, attributes?: Record<string, any>): void;
17
+ };
18
+ }
19
+ }
20
+ }
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ // Auto-generated entry point for pie-preloaded-player
2
+ (async function initializePieItemPlayerStatic() {
3
+ const importWithRetry = async (specifier, attempts = 3, baseDelayMs = 200) => {
4
+ let lastError;
5
+ for (let attempt = 1; attempt <= attempts; attempt++) {
6
+ try {
7
+ return await import(specifier);
8
+ } catch (err) {
9
+ lastError = err;
10
+ if (attempt < attempts) {
11
+ const delay = baseDelayMs * Math.pow(2, attempt - 1);
12
+ await new Promise((res) => setTimeout(res, delay));
13
+ }
14
+ }
15
+ }
16
+ throw lastError;
17
+ };
18
+
19
+ try {
20
+
21
+ const mathRenderingModule = await importWithRetry('./math-rendering.js', 4, 200);
22
+ if (typeof window !== 'undefined') {
23
+ window['@pie-lib/math-rendering'] = mathRenderingModule._dll_pie_lib__math_rendering;
24
+ window['_dll_pie_lib__math_rendering'] = mathRenderingModule._dll_pie_lib__math_rendering;
25
+ }
26
+ await importWithRetry('./pie-elements-bundle-963a099.js', 4, 200);
27
+ await importWithRetry('./pie-item-player.js', 4, 200);
28
+ } catch (error) {
29
+ try { console.error('[pie-preloaded-player] Initialization failed'); } catch {}
30
+ }
31
+ })();
32
+
33
+ export {};