calmlens 0.27.4 → 0.27.5
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/bin/calmlens.js +1 -1
- package/cjs/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-DJZY1LSU.d.ts} +2 -2
- package/cjs/{BrowserUpload-Ch9y2ZDx.js → BrowserUpload-DhruIgFN.js} +1 -1
- package/cjs/{CalmLensAppClient-DGtj1vUV.js → CalmLensAppClient-BA_xaNHY.js} +2 -2
- package/cjs/{CalmLensOptionKeys-DbL03fZj.js → CalmLensOptionKeys-BvLQghl-.js} +1 -1
- package/cjs/{CalmLensServerClient-D62AeRAi.js → CalmLensServerClient-D55xDZm4.js} +2 -2
- package/cjs/{Core-BXeXyiNv.d.ts → Core-CTO_Eh0l.d.ts} +11 -12
- package/cjs/{Core-Cv2zLAJ-.js → Core-kKGmyk5V.js} +63 -21
- package/cjs/{ModerationContextLimits-DjacyIkw.js → ModerationContextLimits-Cxaob3tc.js} +1 -1
- package/cjs/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BDXV4aHT.d.ts} +1 -1
- package/cjs/{ReactUpload-CytoQTh_.js → ReactUpload-Cx3Hi7xt.js} +1 -1
- package/cjs/{UploadController-fpTC5TUO.js → UploadController-CC1afxmL.js} +2 -2
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +7 -18
- package/cjs/elements.js +45 -53
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -11
- package/cjs/react.js +29 -36
- package/cjs/server.js +2 -2
- package/cjs/testing.js +5 -5
- package/cjs/{ui-5IdEYYpC.d.ts → ui-DAbpyM2Z.d.ts} +2 -8
- package/cjs/{ui-BvyDbJBb.js → ui-I75EvP9r.js} +2 -201
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +5 -5
- package/cjs/vue.d.ts +4 -317
- package/cjs/vue.js +27 -17
- package/esm/{BrowserUpload-BE8OVeBC.js → BrowserUpload-CejeWw5r.js} +1 -1
- package/esm/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-DJZY1LSU.d.ts} +2 -2
- package/esm/{CalmLensAppClient-C1cpQEYR.js → CalmLensAppClient-BxkCVPCl.js} +2 -2
- package/esm/{CalmLensOptionKeys-DoCKKuLT.js → CalmLensOptionKeys-DC9FUO43.js} +1 -1
- package/esm/{CalmLensServerClient-CSCrJ7wX.js → CalmLensServerClient-D-TIIQp2.js} +2 -2
- package/esm/{Core-Df2PSa1n.js → Core-B85V5dxv.js} +52 -22
- package/esm/{Core-BXeXyiNv.d.ts → Core-CTO_Eh0l.d.ts} +11 -12
- package/esm/{ModerationContextLimits-tu_PY4fn.js → ModerationContextLimits-Tev2lxE0.js} +1 -1
- package/esm/{ReactUpload-BsbisXS6.js → ReactUpload-B7QXMSWJ.js} +1 -1
- package/esm/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BDXV4aHT.d.ts} +1 -1
- package/esm/{UploadController-Dqjf23bS.js → UploadController-D7XmzO-p.js} +2 -2
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +7 -18
- package/esm/elements.js +44 -50
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +3 -3
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +5 -11
- package/esm/react.js +29 -34
- package/esm/server.js +2 -2
- package/esm/styles.css +12 -16
- package/esm/svelte/CalmLensAsset.svelte +22 -4
- package/esm/svelte/index.d.ts +0 -6
- package/esm/svelte/index.js +0 -2
- package/esm/testing.js +5 -5
- package/esm/{ui-5IdEYYpC.d.ts → ui-DAbpyM2Z.d.ts} +2 -8
- package/esm/{ui-DF7-9mB3.js → ui-cE1lyljs.js} +3 -190
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +4 -317
- package/esm/vue.js +26 -14
- package/package.json +1 -1
- package/esm/svelte/CalmLensImageViewer.svelte +0 -7
- package/esm/svelte/CalmLensWebsiteViewer.svelte +0 -7
package/cjs/react-native.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
|
|
3
|
+
const require_Core = require("./Core-kKGmyk5V.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CC1afxmL.js");
|
|
5
5
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
6
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
6
|
+
const require_ReactUpload = require("./ReactUpload-Cx3Hi7xt.js");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let react_native = require("react-native");
|
|
@@ -606,6 +606,7 @@ exports.CalmLensUploader = CalmLensUploader;
|
|
|
606
606
|
exports.DEFAULT_MESSAGES = require_Core.DEFAULT_MESSAGES;
|
|
607
607
|
exports.ICONS = require_Core.ICONS;
|
|
608
608
|
exports.ICON_ATTRIBUTES = require_Core.ICON_ATTRIBUTES;
|
|
609
|
+
exports.INSTANT_LOAD_MS = require_Core.INSTANT_LOAD_MS;
|
|
609
610
|
exports.UploadController = require_UploadController.UploadController;
|
|
610
611
|
exports.createProgressFetch = require_UploadController.createProgressFetch;
|
|
611
612
|
exports.createUploadController = require_UploadController.createUploadController;
|
|
@@ -622,6 +623,7 @@ exports.getPlayedPercent = require_Core.getPlayedPercent;
|
|
|
622
623
|
exports.getUploadItemMessage = require_Core.getUploadItemMessage;
|
|
623
624
|
exports.getUploadItemOutcome = require_Core.getUploadItemOutcome;
|
|
624
625
|
exports.isFileAccepted = require_UploadController.isFileAccepted;
|
|
626
|
+
exports.isImageReady = require_Core.isImageReady;
|
|
625
627
|
exports.pickAssetSource = require_Core.pickAssetSource;
|
|
626
628
|
exports.resolveMessages = require_Core.resolveMessages;
|
|
627
629
|
exports.resolveTheme = require_Core.resolveTheme;
|
package/cjs/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-
|
|
3
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
4
|
-
import {
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CTO_Eh0l.js";
|
|
2
|
+
import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BDXV4aHT.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-DJZY1LSU.js";
|
|
4
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-DAbpyM2Z.js";
|
|
5
5
|
import { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
6
6
|
type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
7
7
|
/** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */
|
|
@@ -9,15 +9,9 @@ type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: CSSProperties;
|
|
11
11
|
};
|
|
12
|
-
export type CalmLensImageViewerProps = ImageViewerOptions & ElementProps;
|
|
13
|
-
export type CalmLensWebsiteViewerProps = WebsiteViewerOptions & ElementProps;
|
|
14
12
|
export type CalmLensTextViewerProps = TextViewerOptions & ElementProps;
|
|
15
13
|
export type CalmLensDocumentViewerProps = DocumentViewerOptions & ElementProps;
|
|
16
14
|
export type CalmLensSpreadsheetViewerProps = SpreadsheetViewerOptions & ElementProps;
|
|
17
|
-
/** Shows an image asset's rendered file, fitted to the element, over its placeholder. */
|
|
18
|
-
export declare function CalmLensImageViewer(props: CalmLensImageViewerProps): import("react").JSX.Element;
|
|
19
|
-
/** Shows a website asset's screenshot with a link to the original page. */
|
|
20
|
-
export declare function CalmLensWebsiteViewer(props: CalmLensWebsiteViewerProps): import("react").JSX.Element;
|
|
21
15
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
22
16
|
export declare function CalmLensTextViewer(props: CalmLensTextViewerProps): import("react").JSX.Element;
|
|
23
17
|
/** Shows a PDF, or a document rendered as one, a page at a time with pdf.js (loaded lazily). */
|
|
@@ -61,4 +55,4 @@ export type CalmLensAssetProps = AssetProps & StyleOptions & Omit<HTMLAttributes
|
|
|
61
55
|
* and a reveal button; content the CDN refuses shows the unavailable notice.
|
|
62
56
|
*/
|
|
63
57
|
export declare function CalmLensAsset(props: CalmLensAssetProps): import("react").JSX.Element;
|
|
64
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, CalmLensProvider, type CalmLensProviderProps, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES,
|
|
58
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, CalmLensProvider, type CalmLensProviderProps, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, type UseCalmLensUploadResult, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/cjs/react.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_ui = require("./ui-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
const require_ui = require("./ui-I75EvP9r.js");
|
|
4
|
+
const require_Core = require("./Core-kKGmyk5V.js");
|
|
5
|
+
const require_UploadController = require("./UploadController-CC1afxmL.js");
|
|
6
6
|
const require_FileIcons = require("./FileIcons-Ob003MdS.js");
|
|
7
|
-
const require_ReactUpload = require("./ReactUpload-
|
|
8
|
-
const require_BrowserUpload = require("./BrowserUpload-
|
|
7
|
+
const require_ReactUpload = require("./ReactUpload-Cx3Hi7xt.js");
|
|
8
|
+
const require_BrowserUpload = require("./BrowserUpload-DhruIgFN.js");
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -16,7 +16,6 @@ const OPTION_NAMES = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"viewerClaims",
|
|
17
17
|
"label",
|
|
18
18
|
"messages",
|
|
19
|
-
"sizes",
|
|
20
19
|
"text",
|
|
21
20
|
"getText",
|
|
22
21
|
"pageSize",
|
|
@@ -62,20 +61,6 @@ function Viewer({ kind, props }) {
|
|
|
62
61
|
"data-kind": kind
|
|
63
62
|
})] });
|
|
64
63
|
}
|
|
65
|
-
/** Shows an image asset's rendered file, fitted to the element, over its placeholder. */
|
|
66
|
-
function CalmLensImageViewer(props) {
|
|
67
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewer, {
|
|
68
|
-
kind: "image",
|
|
69
|
-
props
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/** Shows a website asset's screenshot with a link to the original page. */
|
|
73
|
-
function CalmLensWebsiteViewer(props) {
|
|
74
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewer, {
|
|
75
|
-
kind: "website",
|
|
76
|
-
props
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
64
|
/** Shows a text asset's text, escaped, in a scrolling region. */
|
|
80
65
|
function CalmLensTextViewer(props) {
|
|
81
66
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Viewer, {
|
|
@@ -288,6 +273,7 @@ function CalmLensUploader({ disabled, capture, messages: overrides, unstyled, co
|
|
|
288
273
|
]
|
|
289
274
|
});
|
|
290
275
|
}
|
|
276
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? react.useLayoutEffect : react.useEffect;
|
|
291
277
|
/** Audio's waveform: the preview still, with the played part of its peaks drawn over it. */
|
|
292
278
|
const Waveform = ({ url, peaks, played }) => {
|
|
293
279
|
if (!url && !peaks) return null;
|
|
@@ -357,14 +343,17 @@ function CalmLensAsset(props) {
|
|
|
357
343
|
const loadKey = require_Core.getAssetViewKey(view);
|
|
358
344
|
const [load, setLoad] = (0, react.useState)({
|
|
359
345
|
key: loadKey,
|
|
360
|
-
state: "loading"
|
|
346
|
+
state: "loading",
|
|
347
|
+
instant: false
|
|
361
348
|
});
|
|
362
349
|
const current = load.key === loadKey ? load : {
|
|
363
350
|
key: loadKey,
|
|
364
|
-
state: "loading"
|
|
351
|
+
state: "loading",
|
|
352
|
+
instant: false
|
|
365
353
|
};
|
|
366
354
|
const [played, setPlayed] = (0, react.useState)(0);
|
|
367
355
|
const imageRef = (0, react.useRef)(null);
|
|
356
|
+
const loadStartedAt = (0, react.useRef)(0);
|
|
368
357
|
const media = (0, react.useRef)(null);
|
|
369
358
|
const viewerRoot = (0, react.useRef)(null);
|
|
370
359
|
const callbacks = (0, react.useRef)({
|
|
@@ -379,16 +368,18 @@ function CalmLensAsset(props) {
|
|
|
379
368
|
};
|
|
380
369
|
(0, react.useEffect)(() => setMounted(true), []);
|
|
381
370
|
(0, react.useEffect)(() => session.load());
|
|
382
|
-
(
|
|
383
|
-
|
|
371
|
+
useIsomorphicLayoutEffect(() => {
|
|
372
|
+
loadStartedAt.current = performance.now();
|
|
373
|
+
if (require_Core.isImageReady(imageRef.current)) setLoad({
|
|
384
374
|
key: loadKey,
|
|
385
|
-
state: "loaded"
|
|
375
|
+
state: "loaded",
|
|
376
|
+
instant: true
|
|
386
377
|
});
|
|
387
378
|
}, [loadKey]);
|
|
388
379
|
(0, react.useEffect)(() => {
|
|
389
380
|
if (current.state === "loaded") callbacks.current.onLoad?.();
|
|
390
381
|
if (current.state === "error") callbacks.current.onError?.();
|
|
391
|
-
}, [current.state]);
|
|
382
|
+
}, [current.key, current.state]);
|
|
392
383
|
const availability = view.kind === "unavailable" ? "unavailable" : view.kind === "age-restricted" ? "age-restricted" : view.kind === "pending" ? void 0 : "available";
|
|
393
384
|
(0, react.useEffect)(() => {
|
|
394
385
|
if (availability) callbacks.current.onAvailabilityChange?.(availability);
|
|
@@ -398,7 +389,8 @@ function CalmLensAsset(props) {
|
|
|
398
389
|
viewers.update(viewerRoot.current, viewerKind, require_ui.getMountedViewerOptions(options, session), (viewerState) => {
|
|
399
390
|
if (viewerState !== "loading") setLoad({
|
|
400
391
|
key: loadKey,
|
|
401
|
-
state: viewerState
|
|
392
|
+
state: viewerState,
|
|
393
|
+
instant: false
|
|
402
394
|
});
|
|
403
395
|
});
|
|
404
396
|
});
|
|
@@ -406,7 +398,7 @@ function CalmLensAsset(props) {
|
|
|
406
398
|
(0, react.useEffect)(() => streams.update(media.current, view));
|
|
407
399
|
(0, react.useEffect)(() => () => streams.stop(), [streams]);
|
|
408
400
|
const ratio = require_Core.getAssetAspectRatio(view, state.info, aspectRatio);
|
|
409
|
-
const placeholderUrl = "placeholderUrl" in view && (view.kind === "age-restricted" || view.kind === "pending" || current.state !== "loaded") ? view.placeholderUrl : void 0;
|
|
401
|
+
const placeholderUrl = "placeholderUrl" in view && (view.kind === "age-restricted" || view.kind === "pending" || current.state !== "error" && !(current.state === "loaded" && current.instant)) ? view.placeholderUrl : void 0;
|
|
410
402
|
const onMediaError = (element) => {
|
|
411
403
|
if (streams.recover(element)) return;
|
|
412
404
|
session.mediaFailed({
|
|
@@ -419,7 +411,8 @@ function CalmLensAsset(props) {
|
|
|
419
411
|
session.mediaLoaded(event.currentTarget);
|
|
420
412
|
setLoad({
|
|
421
413
|
key: loadKey,
|
|
422
|
-
state: "loaded"
|
|
414
|
+
state: "loaded",
|
|
415
|
+
instant: false
|
|
423
416
|
});
|
|
424
417
|
},
|
|
425
418
|
onError: (event) => onMediaError(event.currentTarget),
|
|
@@ -436,7 +429,7 @@ function CalmLensAsset(props) {
|
|
|
436
429
|
className: "calmlens-asset__content",
|
|
437
430
|
src: shown.src,
|
|
438
431
|
srcSet: shown.srcSet,
|
|
439
|
-
sizes: shown.srcSet ? image?.sizes : void 0,
|
|
432
|
+
sizes: shown.srcSet ? image?.sizes ?? (lazy ? "auto, 100vw" : "100vw") : void 0,
|
|
440
433
|
alt,
|
|
441
434
|
width: shown.width,
|
|
442
435
|
height: shown.height,
|
|
@@ -445,9 +438,10 @@ function CalmLensAsset(props) {
|
|
|
445
438
|
fetchPriority,
|
|
446
439
|
onLoad: () => {
|
|
447
440
|
session.loaded();
|
|
448
|
-
setLoad({
|
|
441
|
+
setLoad((prev) => prev.key === loadKey && prev.state === "loaded" ? prev : {
|
|
449
442
|
key: loadKey,
|
|
450
|
-
state: "loaded"
|
|
443
|
+
state: "loaded",
|
|
444
|
+
instant: performance.now() - loadStartedAt.current < 50
|
|
451
445
|
});
|
|
452
446
|
},
|
|
453
447
|
onError: () => session.failed()
|
|
@@ -457,6 +451,7 @@ function CalmLensAsset(props) {
|
|
|
457
451
|
className: joinClassNames("calmlens-asset", className),
|
|
458
452
|
"data-kind": view.kind,
|
|
459
453
|
"data-state": current.state,
|
|
454
|
+
"data-instant": current.instant ? "" : void 0,
|
|
460
455
|
"data-sized": ratio ? "" : void 0,
|
|
461
456
|
"aria-busy": view.kind === "pending" ? true : void 0,
|
|
462
457
|
style: {
|
|
@@ -579,26 +574,23 @@ exports.CALMLENS_STYLES = require_Core.CALMLENS_STYLES;
|
|
|
579
574
|
exports.CALMLENS_THEME = require_Core.CALMLENS_THEME;
|
|
580
575
|
exports.CalmLensAsset = CalmLensAsset;
|
|
581
576
|
exports.CalmLensDocumentViewer = CalmLensDocumentViewer;
|
|
582
|
-
exports.CalmLensImageViewer = CalmLensImageViewer;
|
|
583
577
|
exports.CalmLensProvider = require_ReactUpload.CalmLensProvider;
|
|
584
578
|
exports.CalmLensSpreadsheetViewer = CalmLensSpreadsheetViewer;
|
|
585
579
|
exports.CalmLensTextViewer = CalmLensTextViewer;
|
|
586
580
|
exports.CalmLensUploader = CalmLensUploader;
|
|
587
|
-
exports.CalmLensWebsiteViewer = CalmLensWebsiteViewer;
|
|
588
581
|
exports.DEFAULT_MESSAGES = require_Core.DEFAULT_MESSAGES;
|
|
589
582
|
exports.DEFAULT_VIEWER_MESSAGES = require_ui.DEFAULT_VIEWER_MESSAGES;
|
|
590
583
|
exports.ICONS = require_Core.ICONS;
|
|
591
584
|
exports.ICON_ATTRIBUTES = require_Core.ICON_ATTRIBUTES;
|
|
585
|
+
exports.INSTANT_LOAD_MS = require_Core.INSTANT_LOAD_MS;
|
|
592
586
|
exports.MediaStreamPlayer = require_ui.MediaStreamPlayer;
|
|
593
587
|
exports.UploadController = require_UploadController.UploadController;
|
|
594
588
|
exports.VIEWER_STYLES = require_Core.VIEWER_STYLES;
|
|
595
589
|
exports.createDocumentViewer = require_ui.createDocumentViewer;
|
|
596
|
-
exports.createImageViewer = require_ui.createImageViewer;
|
|
597
590
|
exports.createProgressFetch = require_UploadController.createProgressFetch;
|
|
598
591
|
exports.createSpreadsheetViewer = require_ui.createSpreadsheetViewer;
|
|
599
592
|
exports.createTextViewer = require_ui.createTextViewer;
|
|
600
593
|
exports.createUploadController = require_BrowserUpload.createUploadController;
|
|
601
|
-
exports.createWebsiteViewer = require_ui.createWebsiteViewer;
|
|
602
594
|
exports.describeUploadItem = require_Core.describeUploadItem;
|
|
603
595
|
exports.describeUploader = require_Core.describeUploader;
|
|
604
596
|
exports.formatBytes = require_Core.formatBytes;
|
|
@@ -616,6 +608,7 @@ exports.getSpreadsheetPage = require_ui.getSpreadsheetPage;
|
|
|
616
608
|
exports.getUploadItemMessage = require_Core.getUploadItemMessage;
|
|
617
609
|
exports.getUploadItemOutcome = require_Core.getUploadItemOutcome;
|
|
618
610
|
exports.isFileAccepted = require_UploadController.isFileAccepted;
|
|
611
|
+
exports.isImageReady = require_Core.isImageReady;
|
|
619
612
|
exports.isMountedViewerKind = require_ui.isMountedViewerKind;
|
|
620
613
|
exports.isSpreadsheetFormat = require_Core.isSpreadsheetFormat;
|
|
621
614
|
exports.loadPdfJs = require_ui.loadPdfJs;
|
package/cjs/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-D55xDZm4.js");
|
|
5
5
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
|
|
6
6
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
7
7
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
package/cjs/testing.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_TestTriggers_Cvi7e2KA = require("./TestTriggers-Cvi7e2KA-DcT1pc_W.js");
|
|
3
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
4
|
-
const require_CalmLensServerClient = require("./CalmLensServerClient-
|
|
5
|
-
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-
|
|
3
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
|
|
4
|
+
const require_CalmLensServerClient = require("./CalmLensServerClient-D55xDZm4.js");
|
|
5
|
+
const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-BvLQghl-.js");
|
|
6
6
|
const require_CryptoUtils_B_x8lMIx = require("./CryptoUtils-B_x8lMIx-YBW1-bvL.js");
|
|
7
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
8
|
-
const require_UploadController = require("./UploadController-
|
|
7
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-BA_xaNHY.js");
|
|
8
|
+
const require_UploadController = require("./UploadController-CC1afxmL.js");
|
|
9
9
|
let zod = require("zod");
|
|
10
10
|
zod = require_TestTriggers_Cvi7e2KA.__toESM(zod, 1);
|
|
11
11
|
// src/contract/MediaTestTriggers.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./CalmLensTypes-OWZsGvBX.js";
|
|
2
|
-
import { K as AssetOptions, Z as AssetView, ct as
|
|
2
|
+
import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-CTO_Eh0l.js";
|
|
3
3
|
import "pdfjs-dist";
|
|
4
4
|
/** A viewer mounted into an element, which it owns the children of. */
|
|
5
5
|
interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
@@ -11,10 +11,6 @@ interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
|
|
|
11
11
|
type ViewerState = "loading" | "loaded" | "error";
|
|
12
12
|
/** Shows a PDF, or a document rendered as one, in `root`. */
|
|
13
13
|
declare const createDocumentViewer: (root: HTMLElement, options: DocumentViewerOptions) => AssetViewer<DocumentViewerOptions>;
|
|
14
|
-
/** Shows an image asset's rendered file in `root`. */
|
|
15
|
-
declare const createImageViewer: (root: HTMLElement, options: ImageViewerOptions) => AssetViewer<ImageViewerOptions>;
|
|
16
|
-
/** Shows a website asset's screenshot and a link to the page in `root`. */
|
|
17
|
-
declare const createWebsiteViewer: (root: HTMLElement, options: WebsiteViewerOptions) => AssetViewer<WebsiteViewerOptions>;
|
|
18
14
|
type PdfJs = typeof import("pdfjs-dist");
|
|
19
15
|
/**
|
|
20
16
|
* Loads pdf.js, the first time a document viewer needs it: never at import, so pages without
|
|
@@ -83,8 +79,6 @@ declare const createSpreadsheetViewer: (root: HTMLElement, options: SpreadsheetV
|
|
|
83
79
|
declare const VIEWER_STYLES: string;
|
|
84
80
|
/** Each viewer's options, by the kind of viewer `getAssetViewerKind` names. */
|
|
85
81
|
interface AssetViewerOptionsByKind {
|
|
86
|
-
image: ImageViewerOptions;
|
|
87
|
-
website: WebsiteViewerOptions;
|
|
88
82
|
text: TextViewerOptions;
|
|
89
83
|
document: DocumentViewerOptions;
|
|
90
84
|
spreadsheet: SpreadsheetViewerOptions;
|
|
@@ -136,4 +130,4 @@ declare class MediaStreamPlayer {
|
|
|
136
130
|
/** Stops the stream, when the component unmounts. */
|
|
137
131
|
stop(): void;
|
|
138
132
|
}
|
|
139
|
-
export {
|
|
133
|
+
export { spreadsheetColumnIndex as _, isMountedViewerKind as a, AssetViewer as b, AssetViewerOptionsByKind as c, createTextViewer as d, SpreadsheetCell as f, parseSpreadsheetText as g, getSpreadsheetPage as h, getMountedViewerOptions as i, VIEWER_STYLES as l, SpreadsheetSheet as m, AssetViewerMount as n, ASSET_VIEWERS as o, SpreadsheetRow as p, MountedViewerKind as r, AssetViewerName as s, MediaStreamPlayer as t, createSpreadsheetViewer as u, loadPdfJs as v, ViewerState as x, createDocumentViewer as y };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
|
|
3
|
-
require("./Core-Cv2zLAJ-.js");
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
|
|
2
|
+
require("./Core-kKGmyk5V.js");
|
|
4
3
|
// src/ui/viewers/PdfLoader.ts
|
|
5
4
|
let loading;
|
|
6
5
|
/**
|
|
@@ -38,9 +37,6 @@ const openPdfDocument = async (url, options = {}) => {
|
|
|
38
37
|
// src/ui/viewers/ViewerMessages.ts
|
|
39
38
|
const DEFAULT_VIEWER_MESSAGES = {
|
|
40
39
|
loading: "Loading…",
|
|
41
|
-
imageFailed: "This image can't be shown.",
|
|
42
|
-
openWebsite: "Open {host}",
|
|
43
|
-
websiteLabel: "Website screenshot",
|
|
44
40
|
textLabel: "Text",
|
|
45
41
|
textFailed: "This text can't be shown.",
|
|
46
42
|
documentLabel: "Document",
|
|
@@ -576,187 +572,6 @@ const createDocumentViewer = (root, options) => {
|
|
|
576
572
|
viewer.update(options);
|
|
577
573
|
return viewer;
|
|
578
574
|
};
|
|
579
|
-
// src/ui/viewers/ImageViewers.ts
|
|
580
|
-
/** Widths offered for a public image, so the browser fetches the smallest that fills the frame. */
|
|
581
|
-
const IMAGE_WIDTHS = [
|
|
582
|
-
320,
|
|
583
|
-
640,
|
|
584
|
-
960,
|
|
585
|
-
1280,
|
|
586
|
-
1920,
|
|
587
|
-
2560
|
|
588
|
-
];
|
|
589
|
-
/** The blurred placeholder shown while the image loads: the stored ThumbHash, or the CDN's. */
|
|
590
|
-
const placeholderFor = (asset, urls) => {
|
|
591
|
-
const hash = asset.content?.preview?.thumbhash;
|
|
592
|
-
if (hash) try {
|
|
593
|
-
return require_UploadController.placeholderHashToDataURL(hash);
|
|
594
|
-
} catch {}
|
|
595
|
-
return asset.content?.rendered || asset.content?.preview ? urls.url("placeholder") : void 0;
|
|
596
|
-
};
|
|
597
|
-
/**
|
|
598
|
-
* Loads the rendered image into `image` at responsive widths, asking once for a fresh asset URL
|
|
599
|
-
* when it fails to load (as an expired signed one does).
|
|
600
|
-
*/
|
|
601
|
-
const loadRenderedImage = async (urls, image, { sizes, width }, signal, done) => {
|
|
602
|
-
const widths = IMAGE_WIDTHS.filter((candidate) => !width || candidate < width);
|
|
603
|
-
const setSources = (src) => {
|
|
604
|
-
if (widths.length) {
|
|
605
|
-
image.srcset = [...widths, ...width ? [width] : []].map((candidate) => `${urls.url("rendered", { width: candidate })} ${candidate}w`).join(", ");
|
|
606
|
-
image.sizes = sizes;
|
|
607
|
-
}
|
|
608
|
-
image.src = src;
|
|
609
|
-
};
|
|
610
|
-
image.addEventListener("load", () => {
|
|
611
|
-
urls.loaded("rendered");
|
|
612
|
-
done("loaded");
|
|
613
|
-
});
|
|
614
|
-
image.addEventListener("error", () => {
|
|
615
|
-
const fresh = urls.refresh("rendered");
|
|
616
|
-
if (!fresh) return done("error");
|
|
617
|
-
fresh.then((url) => {
|
|
618
|
-
if (!signal.aborted) setSources(url);
|
|
619
|
-
}, () => done("error"));
|
|
620
|
-
});
|
|
621
|
-
const url = await urls.get("rendered");
|
|
622
|
-
if (!signal.aborted) setSources(url);
|
|
623
|
-
};
|
|
624
|
-
/**
|
|
625
|
-
* Shows an image asset's rendered file, fitted inside the element (the whole frame, for an embed
|
|
626
|
-
* page), over its blurred placeholder until it loads.
|
|
627
|
-
*/
|
|
628
|
-
var ImageViewer = class extends ViewerBase {
|
|
629
|
-
constructor(root) {
|
|
630
|
-
super(root, "image");
|
|
631
|
-
}
|
|
632
|
-
describe({ asset, sizes }) {
|
|
633
|
-
return [
|
|
634
|
-
asset.content?.rendered,
|
|
635
|
-
asset.content?.preview?.thumbhash,
|
|
636
|
-
sizes
|
|
637
|
-
];
|
|
638
|
-
}
|
|
639
|
-
async load(signal) {
|
|
640
|
-
const { asset, label = "", sizes = "100vw" } = this.options;
|
|
641
|
-
const rendered = asset.content?.rendered;
|
|
642
|
-
if (rendered?.width && rendered.height) this.root.style.setProperty("--calmlens-viewer-ratio", `${rendered.width} / ${rendered.height}`);
|
|
643
|
-
const placeholderUrl = placeholderFor(asset, this.urls);
|
|
644
|
-
const placeholder = placeholderUrl && el("img", {
|
|
645
|
-
class: "calmlens-viewer__placeholder",
|
|
646
|
-
src: placeholderUrl,
|
|
647
|
-
alt: "",
|
|
648
|
-
"aria-hidden": "true"
|
|
649
|
-
});
|
|
650
|
-
const image = el("img", {
|
|
651
|
-
class: "calmlens-viewer__image",
|
|
652
|
-
alt: label,
|
|
653
|
-
width: rendered?.width ?? void 0,
|
|
654
|
-
height: rendered?.height ?? void 0,
|
|
655
|
-
decoding: "async"
|
|
656
|
-
});
|
|
657
|
-
this.frame.replaceChildren(...[placeholder, image].filter((node) => !!node));
|
|
658
|
-
await loadRenderedImage(this.urls, image, {
|
|
659
|
-
sizes,
|
|
660
|
-
width: rendered?.width
|
|
661
|
-
}, signal, (outcome) => {
|
|
662
|
-
if (signal.aborted) return;
|
|
663
|
-
if (outcome === "error") return this.fail();
|
|
664
|
-
this.state = "loaded";
|
|
665
|
-
if (placeholder) placeholder.remove();
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
fail() {
|
|
669
|
-
this.state = "error";
|
|
670
|
-
this.frame.replaceChildren(this.notice(this.messages.imageFailed));
|
|
671
|
-
}
|
|
672
|
-
};
|
|
673
|
-
/** The page's address, if it is a web address the viewer may link to. */
|
|
674
|
-
const websiteUrl = (asset) => {
|
|
675
|
-
if (!asset.externalUrl) return void 0;
|
|
676
|
-
try {
|
|
677
|
-
const url = new URL(asset.externalUrl);
|
|
678
|
-
return url.protocol === "https:" || url.protocol === "http:" ? url : void 0;
|
|
679
|
-
} catch {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
};
|
|
683
|
-
/**
|
|
684
|
-
* Shows a website asset: a link to the original page, then its screenshot at the element's width,
|
|
685
|
-
* scrolling down the page.
|
|
686
|
-
*/
|
|
687
|
-
var WebsiteViewer = class extends ViewerBase {
|
|
688
|
-
constructor(root) {
|
|
689
|
-
super(root, "website");
|
|
690
|
-
}
|
|
691
|
-
describe({ asset }) {
|
|
692
|
-
return [
|
|
693
|
-
asset.content?.rendered,
|
|
694
|
-
asset.content?.preview?.thumbhash,
|
|
695
|
-
asset.externalUrl
|
|
696
|
-
];
|
|
697
|
-
}
|
|
698
|
-
#link() {
|
|
699
|
-
const url = websiteUrl(this.options.asset);
|
|
700
|
-
return url ? el("div", { class: "calmlens-viewer__bar" }, [el("a", {
|
|
701
|
-
class: "calmlens-button calmlens-viewer__link",
|
|
702
|
-
href: url.href,
|
|
703
|
-
target: "_blank",
|
|
704
|
-
rel: "noopener noreferrer nofollow"
|
|
705
|
-
}, [formatViewerMessage(this.messages.openWebsite, { host: url.host })])]) : void 0;
|
|
706
|
-
}
|
|
707
|
-
async load(signal) {
|
|
708
|
-
const { asset, label } = this.options;
|
|
709
|
-
const rendered = asset.content?.rendered;
|
|
710
|
-
if (!rendered) return this.fail();
|
|
711
|
-
const name = label || this.messages.websiteLabel;
|
|
712
|
-
const placeholderUrl = placeholderFor(asset, this.urls);
|
|
713
|
-
const placeholder = placeholderUrl && el("img", {
|
|
714
|
-
class: "calmlens-viewer__placeholder",
|
|
715
|
-
src: placeholderUrl,
|
|
716
|
-
alt: "",
|
|
717
|
-
"aria-hidden": "true"
|
|
718
|
-
});
|
|
719
|
-
const image = el("img", {
|
|
720
|
-
class: "calmlens-viewer__image",
|
|
721
|
-
alt: name,
|
|
722
|
-
width: rendered.width ?? void 0,
|
|
723
|
-
height: rendered.height ?? void 0,
|
|
724
|
-
decoding: "async"
|
|
725
|
-
});
|
|
726
|
-
const page = el("div", {
|
|
727
|
-
class: "calmlens-viewer__scroll",
|
|
728
|
-
role: "region",
|
|
729
|
-
"aria-label": name,
|
|
730
|
-
tabindex: 0
|
|
731
|
-
}, [placeholder, image]);
|
|
732
|
-
this.frame.replaceChildren(...[this.#link(), page].filter((node) => !!node));
|
|
733
|
-
await loadRenderedImage(this.urls, image, {
|
|
734
|
-
sizes: "100vw",
|
|
735
|
-
width: rendered.width
|
|
736
|
-
}, signal, (outcome) => {
|
|
737
|
-
if (signal.aborted) return;
|
|
738
|
-
if (outcome === "error") return this.fail();
|
|
739
|
-
this.state = "loaded";
|
|
740
|
-
if (placeholder) placeholder.remove();
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
fail() {
|
|
744
|
-
this.state = "error";
|
|
745
|
-
this.frame.replaceChildren(...[this.#link(), this.notice(this.messages.imageFailed)].filter((node) => !!node));
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
/** Shows an image asset's rendered file in `root`. */
|
|
749
|
-
const createImageViewer = (root, options) => {
|
|
750
|
-
const viewer = new ImageViewer(root);
|
|
751
|
-
viewer.update(options);
|
|
752
|
-
return viewer;
|
|
753
|
-
};
|
|
754
|
-
/** Shows a website asset's screenshot and a link to the page in `root`. */
|
|
755
|
-
const createWebsiteViewer = (root, options) => {
|
|
756
|
-
const viewer = new WebsiteViewer(root);
|
|
757
|
-
viewer.update(options);
|
|
758
|
-
return viewer;
|
|
759
|
-
};
|
|
760
575
|
// src/ui/viewers/Spreadsheet.ts
|
|
761
576
|
const SHEET_LINE = /^# Sheet "((?:[^"\\]|\\.)*)"( \(hidden\))?$/;
|
|
762
577
|
const ROW_LINE = /^Row (\d+)( \(hidden\))?: (.*)$/;
|
|
@@ -1074,8 +889,6 @@ const createSpreadsheetViewer = (root, options) => {
|
|
|
1074
889
|
// src/ui/viewers/index.ts
|
|
1075
890
|
/** Mounts each viewer, by kind, for the bindings. */
|
|
1076
891
|
const ASSET_VIEWERS = {
|
|
1077
|
-
image: createImageViewer,
|
|
1078
|
-
website: createWebsiteViewer,
|
|
1079
892
|
text: createTextViewer,
|
|
1080
893
|
document: createDocumentViewer,
|
|
1081
894
|
spreadsheet: createSpreadsheetViewer
|
|
@@ -1287,12 +1100,6 @@ Object.defineProperty(exports, "createDocumentViewer", {
|
|
|
1287
1100
|
return createDocumentViewer;
|
|
1288
1101
|
}
|
|
1289
1102
|
});
|
|
1290
|
-
Object.defineProperty(exports, "createImageViewer", {
|
|
1291
|
-
enumerable: true,
|
|
1292
|
-
get: function() {
|
|
1293
|
-
return createImageViewer;
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
1103
|
Object.defineProperty(exports, "createSpreadsheetViewer", {
|
|
1297
1104
|
enumerable: true,
|
|
1298
1105
|
get: function() {
|
|
@@ -1305,12 +1112,6 @@ Object.defineProperty(exports, "createTextViewer", {
|
|
|
1305
1112
|
return createTextViewer;
|
|
1306
1113
|
}
|
|
1307
1114
|
});
|
|
1308
|
-
Object.defineProperty(exports, "createWebsiteViewer", {
|
|
1309
|
-
enumerable: true,
|
|
1310
|
-
get: function() {
|
|
1311
|
-
return createWebsiteViewer;
|
|
1312
|
-
}
|
|
1313
|
-
});
|
|
1314
1115
|
Object.defineProperty(exports, "formatViewerMessage", {
|
|
1315
1116
|
enumerable: true,
|
|
1316
1117
|
get: function() {
|
package/cjs/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES,
|
|
1
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-CTO_Eh0l.js";
|
|
2
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-DAbpyM2Z.js";
|
|
3
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|
package/cjs/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ui = require("./ui-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const require_ui = require("./ui-I75EvP9r.js");
|
|
3
|
+
const require_Core = require("./Core-kKGmyk5V.js");
|
|
4
|
+
const require_UploadController = require("./UploadController-CC1afxmL.js");
|
|
5
5
|
exports.ASSET_FILE_ICON_SIZE = require_Core.ASSET_FILE_ICON_SIZE;
|
|
6
6
|
exports.ASSET_VIEWERS = require_ui.ASSET_VIEWERS;
|
|
7
7
|
exports.AssetSession = require_Core.AssetSession;
|
|
@@ -12,16 +12,15 @@ exports.DEFAULT_MESSAGES = require_Core.DEFAULT_MESSAGES;
|
|
|
12
12
|
exports.DEFAULT_VIEWER_MESSAGES = require_ui.DEFAULT_VIEWER_MESSAGES;
|
|
13
13
|
exports.ICONS = require_Core.ICONS;
|
|
14
14
|
exports.ICON_ATTRIBUTES = require_Core.ICON_ATTRIBUTES;
|
|
15
|
+
exports.INSTANT_LOAD_MS = require_Core.INSTANT_LOAD_MS;
|
|
15
16
|
exports.MediaStreamPlayer = require_ui.MediaStreamPlayer;
|
|
16
17
|
exports.UploadController = require_UploadController.UploadController;
|
|
17
18
|
exports.VIEWER_STYLES = require_Core.VIEWER_STYLES;
|
|
18
19
|
exports.createDocumentViewer = require_ui.createDocumentViewer;
|
|
19
|
-
exports.createImageViewer = require_ui.createImageViewer;
|
|
20
20
|
exports.createProgressFetch = require_UploadController.createProgressFetch;
|
|
21
21
|
exports.createSpreadsheetViewer = require_ui.createSpreadsheetViewer;
|
|
22
22
|
exports.createTextViewer = require_ui.createTextViewer;
|
|
23
23
|
exports.createUploadController = require_UploadController.createUploadController;
|
|
24
|
-
exports.createWebsiteViewer = require_ui.createWebsiteViewer;
|
|
25
24
|
exports.describeUploadItem = require_Core.describeUploadItem;
|
|
26
25
|
exports.describeUploader = require_Core.describeUploader;
|
|
27
26
|
exports.formatBytes = require_Core.formatBytes;
|
|
@@ -39,6 +38,7 @@ exports.getSpreadsheetPage = require_ui.getSpreadsheetPage;
|
|
|
39
38
|
exports.getUploadItemMessage = require_Core.getUploadItemMessage;
|
|
40
39
|
exports.getUploadItemOutcome = require_Core.getUploadItemOutcome;
|
|
41
40
|
exports.isFileAccepted = require_UploadController.isFileAccepted;
|
|
41
|
+
exports.isImageReady = require_Core.isImageReady;
|
|
42
42
|
exports.isMountedViewerKind = require_ui.isMountedViewerKind;
|
|
43
43
|
exports.isSpreadsheetFormat = require_Core.isSpreadsheetFormat;
|
|
44
44
|
exports.loadPdfJs = require_ui.loadPdfJs;
|