@bluepic/embed 0.4.0-next.102 → 0.4.0-next.104
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 +79 -79
- package/dist/bluepic-embed.umd.js +84 -84
- package/dist/components/AssetViewer/AssetViewer.vue.d.ts +57 -0
- package/dist/embed/embed.d.ts +14 -0
- package/dist/main.cjs +68 -68
- package/dist/main.d.ts +2 -0
- package/dist/main.mjs +10585 -10120
- package/dist/style.css +1 -1
- package/dist/util/gallery.d.ts +66 -2
- package/package.json +5 -4
|
@@ -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,6 +8596,7 @@ 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;
|
|
8599
8600
|
captions?: Record<string, string> | undefined;
|
|
8600
8601
|
categories?: Record<string, string> | undefined;
|
|
8601
8602
|
};
|
|
@@ -8618,6 +8619,12 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8618
8619
|
createdAt: string;
|
|
8619
8620
|
updatedAt: string;
|
|
8620
8621
|
pinnedBy: string[];
|
|
8622
|
+
assets?: {
|
|
8623
|
+
assetId: string;
|
|
8624
|
+
category?: string | null | undefined;
|
|
8625
|
+
title?: string | null | undefined;
|
|
8626
|
+
description?: string | null | undefined;
|
|
8627
|
+
}[] | undefined;
|
|
8621
8628
|
} | undefined, {
|
|
8622
8629
|
id: number;
|
|
8623
8630
|
uid: string;
|
|
@@ -8665,6 +8672,7 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8665
8672
|
logo?: string | undefined;
|
|
8666
8673
|
title?: string | undefined;
|
|
8667
8674
|
customStyle?: Record<string, string> | undefined;
|
|
8675
|
+
categoryOrder?: string[] | undefined;
|
|
8668
8676
|
captions?: Record<string, string> | undefined;
|
|
8669
8677
|
categories?: Record<string, string> | undefined;
|
|
8670
8678
|
};
|
|
@@ -8687,6 +8695,12 @@ export declare class BluepicEmbed extends EventTarget {
|
|
|
8687
8695
|
createdAt: string;
|
|
8688
8696
|
updatedAt: string;
|
|
8689
8697
|
pinnedBy: string[];
|
|
8698
|
+
assets?: {
|
|
8699
|
+
assetId: string;
|
|
8700
|
+
category?: string | null | undefined;
|
|
8701
|
+
title?: string | null | undefined;
|
|
8702
|
+
description?: string | null | undefined;
|
|
8703
|
+
}[] | undefined;
|
|
8690
8704
|
} | undefined>;
|
|
8691
8705
|
bxCoreVersion: Ref<string | undefined, string | undefined>;
|
|
8692
8706
|
allowPanAndZoom: Ref<boolean, boolean>;
|