@pie-element/element-player 0.1.2-next.6 → 0.1.2-next.8

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.
@@ -4,7 +4,7 @@
4
4
  * Dynamically loads PIE elements from CDN and registers them as custom elements.
5
5
  * Based on the ESM loader pattern from pie-players.
6
6
  */
7
- import type { PieElementRuntimeSupport } from './runtime-support';
7
+ import type { PieElementRuntimeSupport } from './runtime-support.js';
8
8
  export type ElementModuleKind = 'delivery' | 'author' | 'print' | 'controller' | 'runtime-support';
9
9
  export interface ElementModuleResolveRequest {
10
10
  packagePath: string;
@@ -1,7 +1,7 @@
1
- import { type ElementModuleResolver } from './element-loader';
2
- import { type IifeBundleRetryConfig, type IifeBundleRetryStatus, type IifeBundleLoadError, type LocalBundleMeta } from './iife-bundle-loader';
3
- import { type ElementPlayerStrategy, type ElementPlayerView } from './player-strategy';
4
- import { type PieElementRuntimeSupport, type RuntimeSupportCheck } from './runtime-support';
1
+ import { type ElementModuleResolver } from './element-loader.js';
2
+ import { type IifeBundleRetryConfig, type IifeBundleRetryStatus, type IifeBundleLoadError, type LocalBundleMeta } from './iife-bundle-loader.js';
3
+ import { type ElementPlayerStrategy, type ElementPlayerView } from './player-strategy.js';
4
+ import { type PieElementRuntimeSupport, type RuntimeSupportCheck } from './runtime-support.js';
5
5
  export interface UnifiedPlayerLoadRequest {
6
6
  strategy: string | null | undefined;
7
7
  view: string | null | undefined;
@@ -86,10 +86,16 @@ function h(e) {
86
86
  function g(e = {}) {
87
87
  let t = e.useSingleDollar ?? !1;
88
88
  return async (n) => {
89
- if (typeof window > "u" || (l(n), !u(n, t))) return;
90
- await h(e);
91
- let r = s();
92
- await r?.startup?.promise, typeof r?.typesetPromise == "function" && await r.typesetPromise([n]);
89
+ if (typeof window > "u") return;
90
+ l(n);
91
+ let r = h(e);
92
+ if (!u(n, t)) {
93
+ r.catch(() => {});
94
+ return;
95
+ }
96
+ await r;
97
+ let i = s();
98
+ await i?.startup?.promise, typeof i?.typesetPromise == "function" && await i.typesetPromise([n]);
93
99
  };
94
100
  }
95
101
  //#endregion