@netless/app-presentation 0.1.13-beta.4 → 0.1.13
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/dist/index.d.ts +11 -1
- package/dist/index.global.js +45 -35
- package/dist/index.js +45 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/app-presentation.ts +33 -41
- package/src/presentation.ts +8 -1
package/dist/index.d.ts
CHANGED
|
@@ -276,6 +276,7 @@ interface PresentationConfig {
|
|
|
276
276
|
readonly pages: PresentationPage[];
|
|
277
277
|
readonly readonly?: boolean;
|
|
278
278
|
readonly thumbnail?: (src: string) => string;
|
|
279
|
+
readonly onThumbnailError?: (error: unknown) => void;
|
|
279
280
|
}
|
|
280
281
|
/**
|
|
281
282
|
* Standalone presentation slide viewer.
|
|
@@ -316,6 +317,7 @@ declare class Presentation implements IDisposable<void> {
|
|
|
316
317
|
readonly dispose: DisposableStore;
|
|
317
318
|
readonly pages: PresentationPage[];
|
|
318
319
|
readonly preload: Preload;
|
|
320
|
+
readonly onThumbnailError?: (error: unknown) => void;
|
|
319
321
|
dom: Element | DocumentFragment;
|
|
320
322
|
contentDOM: HTMLDivElement;
|
|
321
323
|
previewDOM: HTMLDivElement;
|
|
@@ -429,6 +431,13 @@ declare class Scrollbar {
|
|
|
429
431
|
}
|
|
430
432
|
|
|
431
433
|
type Logger = (...data: any[]) => void;
|
|
434
|
+
interface PresentationDiagnosticLogger {
|
|
435
|
+
info(event: string, payload?: unknown): void;
|
|
436
|
+
warn(event: string, payload?: unknown): void;
|
|
437
|
+
error(event: string, error: unknown, payload?: unknown): void;
|
|
438
|
+
debouncedInfo(event: string, payload?: unknown): void;
|
|
439
|
+
flush(): void;
|
|
440
|
+
}
|
|
432
441
|
interface PresentationAttributes {
|
|
433
442
|
/** Shared logical camera reference size. New pages are proportionally contained within it. */
|
|
434
443
|
originSize?: Size | null;
|
|
@@ -555,6 +564,7 @@ declare const setupBlurThumbnailDegradation: (config: {
|
|
|
555
564
|
app: Presentation;
|
|
556
565
|
dispose: ReturnType<typeof disposableStore>;
|
|
557
566
|
}) => void;
|
|
567
|
+
declare const createDiagnosticLogger: (context: AppContext) => PresentationDiagnosticLogger;
|
|
558
568
|
declare const NetlessAppPresentation: NetlessApp<PresentationAttributes, {}, PresentationAppOptions, PresentationController> & {
|
|
559
569
|
teardown(context: AppContext): void;
|
|
560
570
|
};
|
|
@@ -582,5 +592,5 @@ declare const install: (register: RegisterFn, options?: InstallOptions) => Promi
|
|
|
582
592
|
|
|
583
593
|
declare const version: string;
|
|
584
594
|
|
|
585
|
-
export { NetlessAppPresentation, Presentation, Scrollbar, NetlessAppPresentation as default, install, setupBlurThumbnailDegradation, version };
|
|
595
|
+
export { NetlessAppPresentation, Presentation, Scrollbar, createDiagnosticLogger, NetlessAppPresentation as default, install, setupBlurThumbnailDegradation, version };
|
|
586
596
|
export type { InstallOptions, Logger, PresentationAppOptions, PresentationAttributes, PresentationConfig, PresentationController, PresentationPage, RegisterFn, ScrollbarEventCallback, ScrollbarOption };
|
package/dist/index.global.js
CHANGED
|
@@ -1304,6 +1304,7 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
1304
1304
|
var _a;
|
|
1305
1305
|
this.pages = config.pages;
|
|
1306
1306
|
this.preload = new Preload(this.pages);
|
|
1307
|
+
this.onThumbnailError = config.onThumbnailError;
|
|
1307
1308
|
if (config.thumbnail)
|
|
1308
1309
|
this.thumbnail = config.thumbnail;
|
|
1309
1310
|
this.dispose.add(this.preload);
|
|
@@ -1519,12 +1520,16 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
1519
1520
|
}
|
|
1520
1521
|
/** Returns a modified URL that points to the thumbnail image. */
|
|
1521
1522
|
thumbnail(src) {
|
|
1523
|
+
var _a;
|
|
1522
1524
|
try {
|
|
1523
1525
|
const url = new URL(src);
|
|
1524
1526
|
url.searchParams.set("x-oss-process", "image/resize,l_50");
|
|
1525
1527
|
return url.toString();
|
|
1526
1528
|
} catch (err) {
|
|
1527
|
-
|
|
1529
|
+
try {
|
|
1530
|
+
(_a = this.onThumbnailError) == null ? void 0 : _a.call(this, err);
|
|
1531
|
+
} catch (e) {
|
|
1532
|
+
}
|
|
1528
1533
|
return src;
|
|
1529
1534
|
}
|
|
1530
1535
|
}
|
|
@@ -2119,7 +2124,8 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2119
2124
|
const box = context.getBox();
|
|
2120
2125
|
const boxBlurClass = box.wrapClassName("blur");
|
|
2121
2126
|
let blurEpisode = false;
|
|
2122
|
-
let
|
|
2127
|
+
let failedThumbnailPageIndex = null;
|
|
2128
|
+
const canReDegrade = () => blurEpisode && failedThumbnailPageIndex !== pageIndex$.value;
|
|
2123
2129
|
let previewSuspended = false;
|
|
2124
2130
|
let appliedFocusState = true;
|
|
2125
2131
|
let logicalFocused = true;
|
|
@@ -2176,7 +2182,7 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2176
2182
|
app.suspendPreviewResources();
|
|
2177
2183
|
}
|
|
2178
2184
|
const page = pages[pageIndex$.value];
|
|
2179
|
-
if (!page || !hasUsableThumbnail(page) ||
|
|
2185
|
+
if (!page || !hasUsableThumbnail(page) || canReDegrade()) {
|
|
2180
2186
|
degrade();
|
|
2181
2187
|
}
|
|
2182
2188
|
};
|
|
@@ -2184,7 +2190,7 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2184
2190
|
if (!blurEpisode)
|
|
2185
2191
|
return;
|
|
2186
2192
|
blurEpisode = false;
|
|
2187
|
-
|
|
2193
|
+
failedThumbnailPageIndex = null;
|
|
2188
2194
|
previewSuspended = false;
|
|
2189
2195
|
restore2();
|
|
2190
2196
|
app.preload.resume(pageIndex$.value);
|
|
@@ -2203,18 +2209,22 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2203
2209
|
return !!(el && el.contains(target));
|
|
2204
2210
|
};
|
|
2205
2211
|
const onImgLoad = (ev) => {
|
|
2206
|
-
if (!
|
|
2212
|
+
if (!canReDegrade())
|
|
2207
2213
|
return;
|
|
2208
2214
|
if (!ownsTarget(ev.target))
|
|
2209
2215
|
return;
|
|
2210
2216
|
degrade();
|
|
2211
2217
|
};
|
|
2212
2218
|
const onImgError = (ev) => {
|
|
2213
|
-
|
|
2219
|
+
var _a;
|
|
2220
|
+
if (!canReDegrade())
|
|
2214
2221
|
return;
|
|
2215
2222
|
if (!ownsTarget(ev.target))
|
|
2216
2223
|
return;
|
|
2217
|
-
|
|
2224
|
+
const thumbnailURL = (_a = pages[pageIndex$.value]) == null ? void 0 : _a.thumbnail;
|
|
2225
|
+
if (thumbnailURL && resolveImageUrl(ev.target.src) === resolveImageUrl(thumbnailURL)) {
|
|
2226
|
+
failedThumbnailPageIndex = pageIndex$.value;
|
|
2227
|
+
}
|
|
2218
2228
|
};
|
|
2219
2229
|
const applyActivity = () => {
|
|
2220
2230
|
var _a;
|
|
@@ -2228,7 +2238,7 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2228
2238
|
restoreFocusedResources();
|
|
2229
2239
|
} else {
|
|
2230
2240
|
blurEpisode = true;
|
|
2231
|
-
|
|
2241
|
+
failedThumbnailPageIndex = null;
|
|
2232
2242
|
degrade();
|
|
2233
2243
|
app.preload.pause();
|
|
2234
2244
|
suspendCachedResources();
|
|
@@ -2275,26 +2285,21 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2275
2285
|
document.removeEventListener("error", onImgError, true);
|
|
2276
2286
|
});
|
|
2277
2287
|
};
|
|
2278
|
-
var
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2288
|
+
var getLogger = (context) => {
|
|
2289
|
+
var _a, _b, _c;
|
|
2290
|
+
return (_c = (_a = context.getWindowManager()) == null ? void 0 : _a.Logger) != null ? _c : (_b = context.getRoom()) == null ? void 0 : _b.logger;
|
|
2291
|
+
};
|
|
2292
|
+
var createLogger = (context) => {
|
|
2293
|
+
return (...args) => {
|
|
2294
|
+
var _a, _b;
|
|
2295
|
+
return (_b = (_a = getLogger(context)) == null ? void 0 : _a.info) == null ? void 0 : _b.call(_a, ...args);
|
|
2296
|
+
};
|
|
2284
2297
|
};
|
|
2285
2298
|
var createDiagnosticLogger = (context) => {
|
|
2286
|
-
var _a;
|
|
2287
|
-
const createAppLogger = context.createLogger;
|
|
2288
|
-
if (typeof createAppLogger === "function") {
|
|
2289
|
-
return createAppLogger.call(context, "camera", {
|
|
2290
|
-
debounceTime: 300,
|
|
2291
|
-
maxWaitTime: 2e3
|
|
2292
|
-
});
|
|
2293
|
-
}
|
|
2294
|
-
const roomLogger = (_a = context.getRoom()) == null ? void 0 : _a.logger;
|
|
2295
2299
|
const prefix = `[Presentation][${context.appId}][camera]`;
|
|
2296
2300
|
const emit = (level, event, ...data) => {
|
|
2297
2301
|
try {
|
|
2302
|
+
const roomLogger = getLogger(context);
|
|
2298
2303
|
const printer = roomLogger == null ? void 0 : roomLogger[level];
|
|
2299
2304
|
if (typeof printer === "function")
|
|
2300
2305
|
printer.call(roomLogger, `${prefix}[${event}]`, ...data);
|
|
@@ -2359,9 +2364,11 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2359
2364
|
);
|
|
2360
2365
|
const options = context.getAppOptions() || {};
|
|
2361
2366
|
const room = context.getRoom();
|
|
2362
|
-
const log = options.log || createLogger(
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2367
|
+
const log = options.log || createLogger(context);
|
|
2368
|
+
const warn = (...data) => {
|
|
2369
|
+
var _a2, _b2;
|
|
2370
|
+
return (_b2 = (_a2 = getLogger(context)) == null ? void 0 : _a2.warn) == null ? void 0 : _b2.call(_a2, ...data);
|
|
2371
|
+
};
|
|
2365
2372
|
const configuredOriginSize = context.storage.state.originSize;
|
|
2366
2373
|
const originSize = isValidSize(configuredOriginSize) ? {
|
|
2367
2374
|
width: configuredOriginSize.width,
|
|
@@ -2693,10 +2700,14 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
2693
2700
|
pageIndex$,
|
|
2694
2701
|
view,
|
|
2695
2702
|
options.thumbnail,
|
|
2696
|
-
options.useClipView
|
|
2703
|
+
options.useClipView,
|
|
2704
|
+
(error) => {
|
|
2705
|
+
var _a2, _b2;
|
|
2706
|
+
return (_b2 = (_a2 = getLogger(context)) == null ? void 0 : _a2.error) == null ? void 0 : _b2.call(_a2, "[Presentation] thumbnail URL parsing failed", context.appId, error);
|
|
2707
|
+
}
|
|
2697
2708
|
)
|
|
2698
2709
|
);
|
|
2699
|
-
app.contentDOM.dataset.appPresentationVersion = "0.1.13
|
|
2710
|
+
app.contentDOM.dataset.appPresentationVersion = "0.1.13";
|
|
2700
2711
|
app.scaleDocsToFit = scaleDocsToFit;
|
|
2701
2712
|
app.log = log;
|
|
2702
2713
|
app.warn = warn;
|
|
@@ -3176,10 +3187,7 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
3176
3187
|
);
|
|
3177
3188
|
if (disposed)
|
|
3178
3189
|
throw new Error("[Presentation] disposed before setup ready");
|
|
3179
|
-
if (result === "error"
|
|
3180
|
-
throw new Error("[Presentation] setup page image failed to load");
|
|
3181
|
-
}
|
|
3182
|
-
if (result === "error" && !disposed) {
|
|
3190
|
+
if (result === "error") {
|
|
3183
3191
|
warn("[Presentation] setup page image failed to load; continuing setup");
|
|
3184
3192
|
}
|
|
3185
3193
|
return controller;
|
|
@@ -3215,13 +3223,14 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
3215
3223
|
}
|
|
3216
3224
|
}
|
|
3217
3225
|
};
|
|
3218
|
-
function createPresentation(box, pages, jumpPage, pageIndex$, view, thumbnail, useClipView) {
|
|
3226
|
+
function createPresentation(box, pages, jumpPage, pageIndex$, view, thumbnail, useClipView, onThumbnailError) {
|
|
3219
3227
|
box.mountStyles(style_default);
|
|
3220
3228
|
const app = new AppPresentation({
|
|
3221
3229
|
pages,
|
|
3222
3230
|
readonly: box.readonly,
|
|
3223
3231
|
jumpPage,
|
|
3224
|
-
thumbnail
|
|
3232
|
+
thumbnail,
|
|
3233
|
+
onThumbnailError
|
|
3225
3234
|
});
|
|
3226
3235
|
app.box = box;
|
|
3227
3236
|
box.mountContent(app.contentDOM);
|
|
@@ -3269,11 +3278,12 @@ var NetlessAppPresentation = (function (exports) {
|
|
|
3269
3278
|
};
|
|
3270
3279
|
|
|
3271
3280
|
// src/index.ts
|
|
3272
|
-
var version = "0.1.13
|
|
3281
|
+
var version = "0.1.13";
|
|
3273
3282
|
|
|
3274
3283
|
exports.NetlessAppPresentation = NetlessAppPresentation;
|
|
3275
3284
|
exports.Presentation = Presentation;
|
|
3276
3285
|
exports.Scrollbar = Scrollbar;
|
|
3286
|
+
exports.createDiagnosticLogger = createDiagnosticLogger;
|
|
3277
3287
|
exports.default = NetlessAppPresentation;
|
|
3278
3288
|
exports.install = install;
|
|
3279
3289
|
exports.setupBlurThumbnailDegradation = setupBlurThumbnailDegradation;
|
package/dist/index.js
CHANGED
|
@@ -1305,6 +1305,7 @@ var Presentation = class {
|
|
|
1305
1305
|
var _a;
|
|
1306
1306
|
this.pages = config.pages;
|
|
1307
1307
|
this.preload = new Preload(this.pages);
|
|
1308
|
+
this.onThumbnailError = config.onThumbnailError;
|
|
1308
1309
|
if (config.thumbnail)
|
|
1309
1310
|
this.thumbnail = config.thumbnail;
|
|
1310
1311
|
this.dispose.add(this.preload);
|
|
@@ -1520,12 +1521,16 @@ var Presentation = class {
|
|
|
1520
1521
|
}
|
|
1521
1522
|
/** Returns a modified URL that points to the thumbnail image. */
|
|
1522
1523
|
thumbnail(src) {
|
|
1524
|
+
var _a;
|
|
1523
1525
|
try {
|
|
1524
1526
|
const url = new URL(src);
|
|
1525
1527
|
url.searchParams.set("x-oss-process", "image/resize,l_50");
|
|
1526
1528
|
return url.toString();
|
|
1527
1529
|
} catch (err) {
|
|
1528
|
-
|
|
1530
|
+
try {
|
|
1531
|
+
(_a = this.onThumbnailError) == null ? void 0 : _a.call(this, err);
|
|
1532
|
+
} catch (e) {
|
|
1533
|
+
}
|
|
1529
1534
|
return src;
|
|
1530
1535
|
}
|
|
1531
1536
|
}
|
|
@@ -2120,7 +2125,8 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2120
2125
|
const box = context.getBox();
|
|
2121
2126
|
const boxBlurClass = box.wrapClassName("blur");
|
|
2122
2127
|
let blurEpisode = false;
|
|
2123
|
-
let
|
|
2128
|
+
let failedThumbnailPageIndex = null;
|
|
2129
|
+
const canReDegrade = () => blurEpisode && failedThumbnailPageIndex !== pageIndex$.value;
|
|
2124
2130
|
let previewSuspended = false;
|
|
2125
2131
|
let appliedFocusState = true;
|
|
2126
2132
|
let logicalFocused = true;
|
|
@@ -2177,7 +2183,7 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2177
2183
|
app.suspendPreviewResources();
|
|
2178
2184
|
}
|
|
2179
2185
|
const page = pages[pageIndex$.value];
|
|
2180
|
-
if (!page || !hasUsableThumbnail(page) ||
|
|
2186
|
+
if (!page || !hasUsableThumbnail(page) || canReDegrade()) {
|
|
2181
2187
|
degrade();
|
|
2182
2188
|
}
|
|
2183
2189
|
};
|
|
@@ -2185,7 +2191,7 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2185
2191
|
if (!blurEpisode)
|
|
2186
2192
|
return;
|
|
2187
2193
|
blurEpisode = false;
|
|
2188
|
-
|
|
2194
|
+
failedThumbnailPageIndex = null;
|
|
2189
2195
|
previewSuspended = false;
|
|
2190
2196
|
restore2();
|
|
2191
2197
|
app.preload.resume(pageIndex$.value);
|
|
@@ -2204,18 +2210,22 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2204
2210
|
return !!(el && el.contains(target));
|
|
2205
2211
|
};
|
|
2206
2212
|
const onImgLoad = (ev) => {
|
|
2207
|
-
if (!
|
|
2213
|
+
if (!canReDegrade())
|
|
2208
2214
|
return;
|
|
2209
2215
|
if (!ownsTarget(ev.target))
|
|
2210
2216
|
return;
|
|
2211
2217
|
degrade();
|
|
2212
2218
|
};
|
|
2213
2219
|
const onImgError = (ev) => {
|
|
2214
|
-
|
|
2220
|
+
var _a;
|
|
2221
|
+
if (!canReDegrade())
|
|
2215
2222
|
return;
|
|
2216
2223
|
if (!ownsTarget(ev.target))
|
|
2217
2224
|
return;
|
|
2218
|
-
|
|
2225
|
+
const thumbnailURL = (_a = pages[pageIndex$.value]) == null ? void 0 : _a.thumbnail;
|
|
2226
|
+
if (thumbnailURL && resolveImageUrl(ev.target.src) === resolveImageUrl(thumbnailURL)) {
|
|
2227
|
+
failedThumbnailPageIndex = pageIndex$.value;
|
|
2228
|
+
}
|
|
2219
2229
|
};
|
|
2220
2230
|
const applyActivity = () => {
|
|
2221
2231
|
var _a;
|
|
@@ -2229,7 +2239,7 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2229
2239
|
restoreFocusedResources();
|
|
2230
2240
|
} else {
|
|
2231
2241
|
blurEpisode = true;
|
|
2232
|
-
|
|
2242
|
+
failedThumbnailPageIndex = null;
|
|
2233
2243
|
degrade();
|
|
2234
2244
|
app.preload.pause();
|
|
2235
2245
|
suspendCachedResources();
|
|
@@ -2276,26 +2286,21 @@ var setupBlurThumbnailDegradation = (config) => {
|
|
|
2276
2286
|
document.removeEventListener("error", onImgError, true);
|
|
2277
2287
|
});
|
|
2278
2288
|
};
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2289
|
+
var getLogger = (context) => {
|
|
2290
|
+
var _a, _b, _c;
|
|
2291
|
+
return (_c = (_a = context.getWindowManager()) == null ? void 0 : _a.Logger) != null ? _c : (_b = context.getRoom()) == null ? void 0 : _b.logger;
|
|
2292
|
+
};
|
|
2293
|
+
var createLogger = (context) => {
|
|
2294
|
+
return (...args) => {
|
|
2295
|
+
var _a, _b;
|
|
2296
|
+
return (_b = (_a = getLogger(context)) == null ? void 0 : _a.info) == null ? void 0 : _b.call(_a, ...args);
|
|
2297
|
+
};
|
|
2285
2298
|
};
|
|
2286
2299
|
var createDiagnosticLogger = (context) => {
|
|
2287
|
-
var _a;
|
|
2288
|
-
const createAppLogger = context.createLogger;
|
|
2289
|
-
if (typeof createAppLogger === "function") {
|
|
2290
|
-
return createAppLogger.call(context, "camera", {
|
|
2291
|
-
debounceTime: 300,
|
|
2292
|
-
maxWaitTime: 2e3
|
|
2293
|
-
});
|
|
2294
|
-
}
|
|
2295
|
-
const roomLogger = (_a = context.getRoom()) == null ? void 0 : _a.logger;
|
|
2296
2300
|
const prefix = `[Presentation][${context.appId}][camera]`;
|
|
2297
2301
|
const emit = (level, event, ...data) => {
|
|
2298
2302
|
try {
|
|
2303
|
+
const roomLogger = getLogger(context);
|
|
2299
2304
|
const printer = roomLogger == null ? void 0 : roomLogger[level];
|
|
2300
2305
|
if (typeof printer === "function")
|
|
2301
2306
|
printer.call(roomLogger, `${prefix}[${event}]`, ...data);
|
|
@@ -2360,9 +2365,11 @@ var NetlessAppPresentation = {
|
|
|
2360
2365
|
);
|
|
2361
2366
|
const options = context.getAppOptions() || {};
|
|
2362
2367
|
const room = context.getRoom();
|
|
2363
|
-
const log = options.log || createLogger(
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2368
|
+
const log = options.log || createLogger(context);
|
|
2369
|
+
const warn = (...data) => {
|
|
2370
|
+
var _a2, _b2;
|
|
2371
|
+
return (_b2 = (_a2 = getLogger(context)) == null ? void 0 : _a2.warn) == null ? void 0 : _b2.call(_a2, ...data);
|
|
2372
|
+
};
|
|
2366
2373
|
const configuredOriginSize = context.storage.state.originSize;
|
|
2367
2374
|
const originSize = isValidSize(configuredOriginSize) ? {
|
|
2368
2375
|
width: configuredOriginSize.width,
|
|
@@ -2694,10 +2701,14 @@ var NetlessAppPresentation = {
|
|
|
2694
2701
|
pageIndex$,
|
|
2695
2702
|
view,
|
|
2696
2703
|
options.thumbnail,
|
|
2697
|
-
options.useClipView
|
|
2704
|
+
options.useClipView,
|
|
2705
|
+
(error) => {
|
|
2706
|
+
var _a2, _b2;
|
|
2707
|
+
return (_b2 = (_a2 = getLogger(context)) == null ? void 0 : _a2.error) == null ? void 0 : _b2.call(_a2, "[Presentation] thumbnail URL parsing failed", context.appId, error);
|
|
2708
|
+
}
|
|
2698
2709
|
)
|
|
2699
2710
|
);
|
|
2700
|
-
app.contentDOM.dataset.appPresentationVersion = "0.1.13
|
|
2711
|
+
app.contentDOM.dataset.appPresentationVersion = "0.1.13";
|
|
2701
2712
|
app.scaleDocsToFit = scaleDocsToFit;
|
|
2702
2713
|
app.log = log;
|
|
2703
2714
|
app.warn = warn;
|
|
@@ -3177,10 +3188,7 @@ var NetlessAppPresentation = {
|
|
|
3177
3188
|
);
|
|
3178
3189
|
if (disposed)
|
|
3179
3190
|
throw new Error("[Presentation] disposed before setup ready");
|
|
3180
|
-
if (result === "error"
|
|
3181
|
-
throw new Error("[Presentation] setup page image failed to load");
|
|
3182
|
-
}
|
|
3183
|
-
if (result === "error" && !disposed) {
|
|
3191
|
+
if (result === "error") {
|
|
3184
3192
|
warn("[Presentation] setup page image failed to load; continuing setup");
|
|
3185
3193
|
}
|
|
3186
3194
|
return controller;
|
|
@@ -3216,13 +3224,14 @@ var AppPresentation = class extends Presentation {
|
|
|
3216
3224
|
}
|
|
3217
3225
|
}
|
|
3218
3226
|
};
|
|
3219
|
-
function createPresentation(box, pages, jumpPage, pageIndex$, view, thumbnail, useClipView) {
|
|
3227
|
+
function createPresentation(box, pages, jumpPage, pageIndex$, view, thumbnail, useClipView, onThumbnailError) {
|
|
3220
3228
|
box.mountStyles(style_default);
|
|
3221
3229
|
const app = new AppPresentation({
|
|
3222
3230
|
pages,
|
|
3223
3231
|
readonly: box.readonly,
|
|
3224
3232
|
jumpPage,
|
|
3225
|
-
thumbnail
|
|
3233
|
+
thumbnail,
|
|
3234
|
+
onThumbnailError
|
|
3226
3235
|
});
|
|
3227
3236
|
app.box = box;
|
|
3228
3237
|
box.mountContent(app.contentDOM);
|
|
@@ -3270,11 +3279,12 @@ var install = (register, options = {}) => {
|
|
|
3270
3279
|
};
|
|
3271
3280
|
|
|
3272
3281
|
// src/index.ts
|
|
3273
|
-
var version = "0.1.13
|
|
3282
|
+
var version = "0.1.13";
|
|
3274
3283
|
|
|
3275
3284
|
exports.NetlessAppPresentation = NetlessAppPresentation;
|
|
3276
3285
|
exports.Presentation = Presentation;
|
|
3277
3286
|
exports.Scrollbar = Scrollbar;
|
|
3287
|
+
exports.createDiagnosticLogger = createDiagnosticLogger;
|
|
3278
3288
|
exports.default = NetlessAppPresentation;
|
|
3279
3289
|
exports.install = install;
|
|
3280
3290
|
exports.setupBlurThumbnailDegradation = setupBlurThumbnailDegradation;
|