@page-speed/lightbox 0.0.1 → 0.0.2
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/README.md +2 -0
- package/dist/components/LightboxContent.d.ts +3 -2
- package/dist/components/index.js +794 -128
- package/dist/index.cjs +799 -133
- package/dist/index.js +799 -133
- package/dist/renderers/ImageRenderer.d.ts +7 -6
- package/dist/renderers/index.js +746 -94
- package/dist/types.d.ts +21 -0
- package/package.json +2 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OptixFlowConfig as ImgOptixFlowConfig } from "@page-speed/img";
|
|
1
2
|
export type LightboxLayoutType = "horizontal" | "vertical-split" | "custom-slide" | "fullscreen" | "inline";
|
|
2
3
|
export type LightboxItemType = "image" | "video" | "pdf" | "component";
|
|
3
4
|
export interface LightboxDownload {
|
|
@@ -11,6 +12,21 @@ export interface LightboxShare {
|
|
|
11
12
|
url?: string;
|
|
12
13
|
title?: string;
|
|
13
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* OptixFlow configuration accepted by the lightbox.
|
|
17
|
+
*
|
|
18
|
+
* This mirrors the core OptixFlowConfig used across OpenSite UI blocks,
|
|
19
|
+
* while adapting to the underlying @page-speed/img configuration
|
|
20
|
+
* (which expects `compressionLevel`).
|
|
21
|
+
*/
|
|
22
|
+
export type LightboxOptixFlowConfig = ImgOptixFlowConfig & {
|
|
23
|
+
/**
|
|
24
|
+
* Convenience alias matching the common `compression` prop.
|
|
25
|
+
* If provided, it will override `compressionLevel` when passed
|
|
26
|
+
* through to the underlying <Img /> component.
|
|
27
|
+
*/
|
|
28
|
+
compression?: number;
|
|
29
|
+
};
|
|
14
30
|
export interface LightboxItem {
|
|
15
31
|
id: string;
|
|
16
32
|
type: LightboxItemType;
|
|
@@ -49,6 +65,11 @@ export interface LightboxProps {
|
|
|
49
65
|
className?: string;
|
|
50
66
|
style?: React.CSSProperties;
|
|
51
67
|
controls?: Partial<LightboxControls>;
|
|
68
|
+
/**
|
|
69
|
+
* OptixFlow image optimization configuration to pass through to
|
|
70
|
+
* the underlying @page-speed/img <Img /> component.
|
|
71
|
+
*/
|
|
72
|
+
optixFlowConfig?: LightboxOptixFlowConfig;
|
|
52
73
|
onOpen?: () => void;
|
|
53
74
|
onClose?: () => void;
|
|
54
75
|
onSelect?: (index: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@page-speed/lightbox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "High-performance, feature-rich lightbox for OpenSite platform",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"typescript": "^5.9.3"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
+
"@page-speed/img": "^0.4.3",
|
|
82
83
|
"@page-speed/pdf-viewer": "^0.0.2"
|
|
83
84
|
}
|
|
84
85
|
}
|