@bluepic/embed 0.4.0-next.103 → 0.4.0-next.106
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/bluepic-embed.iife.js +71 -71
- package/dist/bluepic-embed.umd.js +71 -71
- package/dist/components/AssetViewer/AssetViewer.vue.d.ts +57 -0
- package/dist/embed/embed.d.ts +8 -6
- package/dist/main.cjs +69 -69
- package/dist/main.d.ts +2 -0
- package/dist/main.mjs +10910 -10595
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import '@zoompinch/vue/style.css';
|
|
2
|
+
/**
|
|
3
|
+
* Brand Portal — the asset viewer.
|
|
4
|
+
*
|
|
5
|
+
* Renders inside the existing overlay API (usePopup / injectPortal), the same
|
|
6
|
+
* surface as the image cropper, rather than sending the visitor to a browser
|
|
7
|
+
* tab.
|
|
8
|
+
*
|
|
9
|
+
* Efficiency rules that are load-bearing, not polish:
|
|
10
|
+
* - page rendering is INJECTED by the host (`renderPage`) rather than importing
|
|
11
|
+
* @bluepic/raster here. Embed ships a UMD build, and raster's root entry
|
|
12
|
+
* carries CommonJS interop that Rollup cannot express in UMD (it emits an
|
|
13
|
+
* invalid `var main.commonjsGlobal`). Injection also keeps the heavy engines
|
|
14
|
+
* out of embed entirely — the host loads them only if it has documents.
|
|
15
|
+
* Without a `renderPage`, paged types degrade to the download-only panel;
|
|
16
|
+
* - one page is rendered at a time, at a DPR clamped to 2;
|
|
17
|
+
* - at most PAGE_CACHE_LIMIT rendered pages are retained, so a 400-page PDF
|
|
18
|
+
* cannot hold 400 canvases;
|
|
19
|
+
* - in-flight work is abandoned on close/page-change — an orphaned
|
|
20
|
+
* Ghostscript-WASM job otherwise keeps a phone warm long after the user left.
|
|
21
|
+
*/
|
|
22
|
+
export type ViewerAsset = {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
filename: string;
|
|
26
|
+
mime: string;
|
|
27
|
+
size: number;
|
|
28
|
+
kind: 'image' | 'file';
|
|
29
|
+
previewUrl: string | null;
|
|
30
|
+
description?: string | null;
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
pageCount?: number;
|
|
34
|
+
/** Gated URL. Used both to fetch bytes for rasterization and to display media. */
|
|
35
|
+
downloadUrl: string;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_Props = {
|
|
38
|
+
asset: ViewerAsset;
|
|
39
|
+
/**
|
|
40
|
+
* Render one page of a document into the supplied canvas. Supplied by the
|
|
41
|
+
* host (bx-template passes @bluepic/raster). Absent → no paged preview.
|
|
42
|
+
*/
|
|
43
|
+
renderPage?: (bytes: ArrayBuffer, canvas: HTMLCanvasElement, opts: {
|
|
44
|
+
page: number;
|
|
45
|
+
dpi: number;
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
/** Page count for a paged document, when the host can determine it. */
|
|
48
|
+
getPageCount?: (bytes: ArrayBuffer) => Promise<number>;
|
|
49
|
+
};
|
|
50
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
51
|
+
close: () => any;
|
|
52
|
+
download: (asset: ViewerAsset) => any;
|
|
53
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
54
|
+
onClose?: (() => any) | undefined;
|
|
55
|
+
onDownload?: ((asset: ViewerAsset) => any) | undefined;
|
|
56
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
57
|
+
export default _default;
|
package/dist/embed/embed.d.ts
CHANGED
|
@@ -8596,9 +8596,11 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8596
8596
|
logo?: string | undefined;
|
|
8597
8597
|
title?: string | undefined;
|
|
8598
8598
|
customStyle?: Record<string, string> | undefined;
|
|
8599
|
-
categoryOrder?: string[] | undefined;
|
|
8600
8599
|
captions?: Record<string, string> | undefined;
|
|
8601
|
-
categories?:
|
|
8600
|
+
categories?: {
|
|
8601
|
+
label: string;
|
|
8602
|
+
items: string[];
|
|
8603
|
+
}[] | undefined;
|
|
8602
8604
|
};
|
|
8603
8605
|
landingPage: {
|
|
8604
8606
|
headerTitle?: string | undefined;
|
|
@@ -8621,7 +8623,6 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8621
8623
|
pinnedBy: string[];
|
|
8622
8624
|
assets?: {
|
|
8623
8625
|
assetId: string;
|
|
8624
|
-
category?: string | null | undefined;
|
|
8625
8626
|
title?: string | null | undefined;
|
|
8626
8627
|
description?: string | null | undefined;
|
|
8627
8628
|
}[] | undefined;
|
|
@@ -8672,9 +8673,11 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8672
8673
|
logo?: string | undefined;
|
|
8673
8674
|
title?: string | undefined;
|
|
8674
8675
|
customStyle?: Record<string, string> | undefined;
|
|
8675
|
-
categoryOrder?: string[] | undefined;
|
|
8676
8676
|
captions?: Record<string, string> | undefined;
|
|
8677
|
-
categories?:
|
|
8677
|
+
categories?: {
|
|
8678
|
+
label: string;
|
|
8679
|
+
items: string[];
|
|
8680
|
+
}[] | undefined;
|
|
8678
8681
|
};
|
|
8679
8682
|
landingPage: {
|
|
8680
8683
|
headerTitle?: string | undefined;
|
|
@@ -8697,7 +8700,6 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8697
8700
|
pinnedBy: string[];
|
|
8698
8701
|
assets?: {
|
|
8699
8702
|
assetId: string;
|
|
8700
|
-
category?: string | null | undefined;
|
|
8701
8703
|
title?: string | null | undefined;
|
|
8702
8704
|
description?: string | null | undefined;
|
|
8703
8705
|
}[] | undefined;
|