@page-speed/lightbox 0.0.1
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 +244 -0
- package/dist/__mocks__/styleMock.d.ts +4 -0
- package/dist/components/Layouts/HorizontalLayout.d.ts +16 -0
- package/dist/components/Lightbox.d.ts +10 -0
- package/dist/components/LightboxChrome.d.ts +21 -0
- package/dist/components/LightboxContent.d.ts +13 -0
- package/dist/components/LightboxOverlay.d.ts +12 -0
- package/dist/components/index.css +99 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +21964 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2033 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +2079 -0
- package/dist/hooks/useGalleryState.d.ts +14 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +1 -0
- package/dist/hooks/useLightbox.d.ts +20 -0
- package/dist/hooks/useLightboxState.d.ts +9 -0
- package/dist/hooks/useResponsiveness.d.ts +7 -0
- package/dist/index.cjs +22043 -0
- package/dist/index.css +99 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22043 -0
- package/dist/renderers/ComponentRenderer.d.ts +9 -0
- package/dist/renderers/ImageRenderer.d.ts +14 -0
- package/dist/renderers/PDFRenderer.d.ts +11 -0
- package/dist/renderers/VideoRenderer.d.ts +13 -0
- package/dist/renderers/index.css +99 -0
- package/dist/renderers/index.d.ts +4 -0
- package/dist/renderers/index.js +21620 -0
- package/dist/types.d.ts +62 -0
- package/package.json +84 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type LightboxLayoutType = "horizontal" | "vertical-split" | "custom-slide" | "fullscreen" | "inline";
|
|
2
|
+
export type LightboxItemType = "image" | "video" | "pdf" | "component";
|
|
3
|
+
export interface LightboxDownload {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
url?: string;
|
|
6
|
+
filename?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LightboxShare {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
platforms?: Array<"facebook" | "twitter" | "pinterest" | "linkedin" | "email" | "copy">;
|
|
11
|
+
url?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LightboxItem {
|
|
15
|
+
id: string;
|
|
16
|
+
type: LightboxItemType;
|
|
17
|
+
src?: string;
|
|
18
|
+
mediaId?: string;
|
|
19
|
+
srcSet?: string;
|
|
20
|
+
alt?: string;
|
|
21
|
+
caption?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
thumbnail?: string;
|
|
24
|
+
download?: LightboxDownload | boolean;
|
|
25
|
+
share?: LightboxShare | boolean;
|
|
26
|
+
data?: Record<string, any>;
|
|
27
|
+
component?: React.ComponentType<any>;
|
|
28
|
+
}
|
|
29
|
+
export interface LightboxControls {
|
|
30
|
+
navigation?: boolean;
|
|
31
|
+
keyboard?: boolean;
|
|
32
|
+
mouseWheel?: boolean;
|
|
33
|
+
swipe?: boolean;
|
|
34
|
+
thumbnails?: boolean;
|
|
35
|
+
counter?: boolean;
|
|
36
|
+
captions?: boolean;
|
|
37
|
+
zoom?: boolean;
|
|
38
|
+
download?: boolean;
|
|
39
|
+
share?: boolean;
|
|
40
|
+
fullscreen?: boolean;
|
|
41
|
+
closeButton?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface LightboxProps {
|
|
44
|
+
items: LightboxItem[];
|
|
45
|
+
initialIndex?: number;
|
|
46
|
+
layout?: LightboxLayoutType;
|
|
47
|
+
height?: string | number;
|
|
48
|
+
maxWidth?: string | number;
|
|
49
|
+
className?: string;
|
|
50
|
+
style?: React.CSSProperties;
|
|
51
|
+
controls?: Partial<LightboxControls>;
|
|
52
|
+
onOpen?: () => void;
|
|
53
|
+
onClose?: () => void;
|
|
54
|
+
onSelect?: (index: number) => void;
|
|
55
|
+
onNext?: () => void;
|
|
56
|
+
onPrev?: () => void;
|
|
57
|
+
enableDeepLinking?: boolean;
|
|
58
|
+
enableKeyboardShortcuts?: boolean;
|
|
59
|
+
disableScroll?: boolean;
|
|
60
|
+
closeOnBackdropClick?: boolean;
|
|
61
|
+
closeOnEscape?: boolean;
|
|
62
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@page-speed/lightbox",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "High-performance, feature-rich lightbox for OpenSite platform",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./core": {
|
|
19
|
+
"import": "./dist/core/index.js",
|
|
20
|
+
"types": "./dist/core/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./hooks": {
|
|
23
|
+
"import": "./dist/hooks/index.js",
|
|
24
|
+
"types": "./dist/hooks/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./renderers": {
|
|
27
|
+
"import": "./dist/renderers/index.js",
|
|
28
|
+
"types": "./dist/renderers/index.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./components": {
|
|
31
|
+
"import": "./dist/components/index.js",
|
|
32
|
+
"types": "./dist/components/index.d.ts"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc --emitDeclarationOnly && pnpm run build:esm && pnpm run build:cjs",
|
|
37
|
+
"build:esm": "esbuild src/index.ts src/core/index.ts src/hooks/index.ts src/renderers/index.ts src/components/index.ts --bundle --platform=browser --format=esm --outdir=dist --outbase=src",
|
|
38
|
+
"build:cjs": "esbuild src/index.ts --bundle --platform=browser --format=cjs --outfile=dist/index.cjs",
|
|
39
|
+
"bundle-analyze": "esbuild src/index.ts --bundle --analyze --outfile=/dev/null",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"test:watch": "jest --watch",
|
|
42
|
+
"test:coverage": "jest --coverage",
|
|
43
|
+
"lint": "tsc --noEmit",
|
|
44
|
+
"type-check": "tsc --noEmit",
|
|
45
|
+
"prepare": "pnpm run build"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": "^18.0.0",
|
|
52
|
+
"react-dom": "^18.0.0"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"lightbox",
|
|
56
|
+
"shadcn",
|
|
57
|
+
"ui",
|
|
58
|
+
"tailwind",
|
|
59
|
+
"react"
|
|
60
|
+
],
|
|
61
|
+
"repository": {
|
|
62
|
+
"type": "git",
|
|
63
|
+
"url": "https://github.com/opensite-ai/page-speed-lightbox"
|
|
64
|
+
},
|
|
65
|
+
"bugs": {
|
|
66
|
+
"url": "https://github.com/opensite-ai/page-speed-lightbox/issues"
|
|
67
|
+
},
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
71
|
+
"@testing-library/react": "^16.3.1",
|
|
72
|
+
"@types/jest": "^30.0.0",
|
|
73
|
+
"@types/react": "^19.2.7",
|
|
74
|
+
"@types/react-dom": "^19.2.3",
|
|
75
|
+
"esbuild": "^0.27.2",
|
|
76
|
+
"jest": "^30.2.0",
|
|
77
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
78
|
+
"ts-jest": "^29.4.6",
|
|
79
|
+
"typescript": "^5.9.3"
|
|
80
|
+
},
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@page-speed/pdf-viewer": "^0.0.2"
|
|
83
|
+
}
|
|
84
|
+
}
|