@thisiscrowd/crowdbox 1.0.0 → 1.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/LICENSE +21 -0
- package/README.md +102 -10
- package/dist/crowdbox.esm.js +1 -1
- package/dist/crowdbox.umd.js +1 -1
- package/package.json +16 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 thisiscrowd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -16,6 +16,31 @@ A modern, lightweight, extensible JavaScript Crowdbox gallery plugin.
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### NPM
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @thisiscrowd/crowdbox
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Yarn
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn add @thisiscrowd/crowdbox
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### CDN
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<!-- CSS -->
|
|
37
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thisiscrowd/crowdbox@latest/dist/crowdbox.css">
|
|
38
|
+
|
|
39
|
+
<!-- JavaScript (UMD) -->
|
|
40
|
+
<script src="https://cdn.jsdelivr.net/npm/@thisiscrowd/crowdbox@latest/dist/crowdbox.umd.js"></script>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
19
44
|
|
|
20
45
|
## Quick Start — Vanilla JS
|
|
21
46
|
|
|
@@ -51,8 +76,8 @@ A modern, lightweight, extensible JavaScript Crowdbox gallery plugin.
|
|
|
51
76
|
### JavaScript API
|
|
52
77
|
|
|
53
78
|
```js
|
|
54
|
-
import Crowdbox from
|
|
55
|
-
import 'crowdbox/styles';
|
|
79
|
+
import Crowdbox from "@thisiscrowd/crowdbox";
|
|
80
|
+
import '@thisiscrowd/crowdbox/styles';
|
|
56
81
|
|
|
57
82
|
const gallery = new Crowdbox({ loop: true, thumbnails: true });
|
|
58
83
|
|
|
@@ -157,8 +182,8 @@ gallery.destroy();
|
|
|
157
182
|
### GalleryGrid (simplest)
|
|
158
183
|
|
|
159
184
|
```jsx
|
|
160
|
-
import { GalleryGrid } from 'crowdbox/react';
|
|
161
|
-
import 'crowdbox/styles';
|
|
185
|
+
import { GalleryGrid } from '@thisiscrowd/crowdbox/react';
|
|
186
|
+
import '@thisiscrowd/crowdbox/styles';
|
|
162
187
|
|
|
163
188
|
const items = [
|
|
164
189
|
{ src: 'photo1.jpg', type: 'image', thumb: 'thumb1.jpg', caption: 'Photo 1' },
|
|
@@ -173,7 +198,8 @@ export default function Page() {
|
|
|
173
198
|
### Controlled Lightbox component
|
|
174
199
|
|
|
175
200
|
```jsx
|
|
176
|
-
import { Lightbox } from 'crowdbox/react';
|
|
201
|
+
import { Lightbox } from '@thisiscrowd/crowdbox/react';
|
|
202
|
+
import '@thisiscrowd/crowdbox/styles';
|
|
177
203
|
|
|
178
204
|
const [open, setOpen] = useState(false);
|
|
179
205
|
|
|
@@ -189,7 +215,8 @@ const [open, setOpen] = useState(false);
|
|
|
189
215
|
### useLightbox hook
|
|
190
216
|
|
|
191
217
|
```jsx
|
|
192
|
-
import { useLightbox } from 'crowdbox/react';
|
|
218
|
+
import { useLightbox } from '@thisiscrowd/crowdbox/react';
|
|
219
|
+
import '@thisiscrowd/crowdbox/styles';
|
|
193
220
|
|
|
194
221
|
function MyGallery({ items }) {
|
|
195
222
|
const { open } = useLightbox({ thumbnails: true, captions: true });
|
|
@@ -216,8 +243,8 @@ export default function Gallery({ items }) {
|
|
|
216
243
|
useEffect(() => {
|
|
217
244
|
let g;
|
|
218
245
|
// Dynamic import keeps Crowdbox out of the server bundle
|
|
219
|
-
import('crowdbox').then(({ Crowdbox }) => {
|
|
220
|
-
import('crowdbox/styles');
|
|
246
|
+
import('@thisiscrowd/crowdbox').then(({ Crowdbox }) => {
|
|
247
|
+
import('@thisiscrowd/crowdbox/styles');
|
|
221
248
|
g = new Crowdbox({ selector: null, thumbnails: true });
|
|
222
249
|
galleryRef.current = g;
|
|
223
250
|
});
|
|
@@ -240,9 +267,12 @@ export default function Gallery({ items }) {
|
|
|
240
267
|
}
|
|
241
268
|
```
|
|
242
269
|
|
|
270
|
+
## Plugins & Adapters
|
|
271
|
+
|
|
272
|
+
### Custom plugin
|
|
243
273
|
|
|
244
274
|
```js
|
|
245
|
-
import { Registry } from 'crowdbox';
|
|
275
|
+
import { Registry } from '@thisiscrowd/crowdbox';
|
|
246
276
|
|
|
247
277
|
const WatermarkPlugin = {
|
|
248
278
|
pluginName: 'watermark',
|
|
@@ -271,7 +301,7 @@ const gallery = new Crowdbox({ watermark: true });
|
|
|
271
301
|
### Custom media adapter
|
|
272
302
|
|
|
273
303
|
```js
|
|
274
|
-
import { Registry } from 'crowdbox';
|
|
304
|
+
import { Registry } from '@thisiscrowd/crowdbox';
|
|
275
305
|
|
|
276
306
|
Registry.registerAdapter('soundcloud', {
|
|
277
307
|
type: 'soundcloud',
|
|
@@ -346,3 +376,65 @@ All modern browsers (Chrome 80+, Firefox 75+, Safari 13.1+, Edge 80+). Uses:
|
|
|
346
376
|
- Fullscreen API
|
|
347
377
|
|
|
348
378
|
---
|
|
379
|
+
|
|
380
|
+
## Development
|
|
381
|
+
|
|
382
|
+
### Build from source
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Clone repository
|
|
386
|
+
git clone https://github.com/thisiscrowd/crowdbox.git
|
|
387
|
+
cd crowdbox
|
|
388
|
+
|
|
389
|
+
# Install dependencies
|
|
390
|
+
npm install
|
|
391
|
+
|
|
392
|
+
# Build (JS + CSS)
|
|
393
|
+
npm run build:all
|
|
394
|
+
|
|
395
|
+
# Watch mode (auto-rebuild on changes)
|
|
396
|
+
npm run dev
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Project structure
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
src/
|
|
403
|
+
├── adapters/ # Media type handlers (image, video, YouTube, etc.)
|
|
404
|
+
├── core/ # Core lightbox logic
|
|
405
|
+
├── plugins/ # Optional features (zoom, thumbnails, share, etc.)
|
|
406
|
+
├── react/ # React components and hooks
|
|
407
|
+
└── styles/ # SCSS source files
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Contributing
|
|
413
|
+
|
|
414
|
+
Contributions welcome! Please:
|
|
415
|
+
|
|
416
|
+
1. Fork the repository
|
|
417
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
418
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
419
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
420
|
+
5. Open a Pull Request
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## License
|
|
425
|
+
|
|
426
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Links
|
|
431
|
+
|
|
432
|
+
- **NPM Package**: [npmjs.com/package/@thisiscrowd/crowdbox](https://www.npmjs.com/package/@thisiscrowd/crowdbox)
|
|
433
|
+
- **Repository**: [github.com/thisiscrowd/crowdbox](https://github.com/thisiscrowd/crowdbox)
|
|
434
|
+
- **Issues**: [github.com/thisiscrowd/crowdbox/issues](https://github.com/thisiscrowd/crowdbox/issues)
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Acknowledgments
|
|
439
|
+
|
|
440
|
+
Inspired by Fancybox, Lightbox2, and other gallery libraries, but built from scratch with modern web standards.
|
package/dist/crowdbox.esm.js
CHANGED
package/dist/crowdbox.umd.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisiscrowd/crowdbox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A modern, lightweight, extensible Crowdbox gallery plugin supporting images and video",
|
|
6
6
|
"main": "dist/crowdbox.umd.js",
|
|
@@ -39,8 +39,16 @@
|
|
|
39
39
|
"nextjs",
|
|
40
40
|
"react"
|
|
41
41
|
],
|
|
42
|
-
"author": "",
|
|
42
|
+
"author": "thisiscrowd",
|
|
43
43
|
"license": "MIT",
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/thisiscrowd/crowdbox.git"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/thisiscrowd/crowdbox#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/thisiscrowd/crowdbox/issues"
|
|
51
|
+
},
|
|
44
52
|
"devDependencies": {
|
|
45
53
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
46
54
|
"@rollup/plugin-terser": "^0.4.0",
|
|
@@ -53,7 +61,11 @@
|
|
|
53
61
|
"react-dom": ">=17.0.0"
|
|
54
62
|
},
|
|
55
63
|
"peerDependenciesMeta": {
|
|
56
|
-
"react": {
|
|
57
|
-
|
|
64
|
+
"react": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"react-dom": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
}
|