@michaelyagi/shoji 0.1.0-beta.1 → 0.1.0-beta.12
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 +36 -5
- package/dist/core/shoji-core.css +833 -0
- package/dist/core/shoji-core.js +3304 -0
- package/dist/core/shoji-core.js.map +1 -0
- package/dist/core/shoji-core.min.css +1 -0
- package/dist/core/shoji-core.min.js +2 -0
- package/dist/core/shoji-core.min.js.map +1 -0
- package/dist/esm/core/Gallery.d.ts +2 -0
- package/dist/esm/core/index.js +95 -2
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/index.css +125 -815
- package/dist/esm/index.js +1 -1
- package/dist/esm/index2.css +819 -44
- package/dist/esm/index3.css +47 -159
- package/dist/esm/index4.css +169 -26
- package/dist/esm/index5.css +27 -0
- package/dist/esm/plugins/activeThumbnail/index.d.ts +9 -1
- package/dist/esm/plugins/activeThumbnail/index.js +60 -16
- package/dist/esm/plugins/activeThumbnail/index.js.map +1 -1
- package/dist/esm/plugins/rotateFlip/index.js +1 -1
- package/dist/esm/plugins/zoom/index.js +1 -1
- package/dist/esm/{zoomTransition-BbnYTxY-.js → zoomTransition-CQG__VzO.js} +10 -2
- package/dist/esm/zoomTransition-CQG__VzO.js.map +1 -0
- package/dist/plugins/activeThumbnail.css +143 -0
- package/dist/plugins/activeThumbnail.js +121 -0
- package/dist/plugins/activeThumbnail.js.map +1 -0
- package/dist/plugins/activeThumbnail.min.css +1 -0
- package/dist/plugins/activeThumbnail.min.js +2 -0
- package/dist/plugins/activeThumbnail.min.js.map +1 -0
- package/dist/plugins/autoplay.css +58 -0
- package/dist/plugins/autoplay.js +288 -0
- package/dist/plugins/autoplay.js.map +1 -0
- package/dist/plugins/autoplay.min.css +1 -0
- package/dist/plugins/autoplay.min.js +2 -0
- package/dist/plugins/autoplay.min.js.map +1 -0
- package/dist/plugins/fullscreen.js +80 -0
- package/dist/plugins/fullscreen.js.map +1 -0
- package/dist/plugins/fullscreen.min.js +2 -0
- package/dist/plugins/fullscreen.min.js.map +1 -0
- package/dist/plugins/layout.css +170 -0
- package/dist/plugins/layout.js +767 -0
- package/dist/plugins/layout.js.map +1 -0
- package/dist/plugins/layout.min.css +1 -0
- package/dist/plugins/layout.min.js +2 -0
- package/dist/plugins/layout.min.js.map +1 -0
- package/dist/plugins/rotateFlip.js +196 -0
- package/dist/plugins/rotateFlip.js.map +1 -0
- package/dist/plugins/rotateFlip.min.js +2 -0
- package/dist/plugins/rotateFlip.min.js.map +1 -0
- package/dist/plugins/video.js +227 -0
- package/dist/plugins/video.js.map +1 -0
- package/dist/plugins/video.min.js +2 -0
- package/dist/plugins/video.min.js.map +1 -0
- package/dist/plugins/zoom.css +27 -0
- package/dist/plugins/zoom.js +450 -0
- package/dist/plugins/zoom.js.map +1 -0
- package/dist/plugins/zoom.min.css +1 -0
- package/dist/plugins/zoom.min.js +2 -0
- package/dist/plugins/zoom.min.js.map +1 -0
- package/dist/shoji.css +143 -0
- package/dist/shoji.js +74 -17
- package/dist/shoji.js.map +1 -1
- package/dist/shoji.min.css +1 -1
- package/dist/shoji.min.js +1 -1
- package/dist/shoji.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/bodyScrollLock-CC5PJxJp.js +0 -96
- package/dist/esm/bodyScrollLock-CC5PJxJp.js.map +0 -1
- package/dist/esm/zoomTransition-BbnYTxY-.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Shoji
|
|
2
2
|
|
|
3
3
|
[](https://github.com/MichaelYagi/shoji/actions/workflows/ci.yml)
|
|
4
|
-
[](https://www.npmjs.com/package/@michaelyagi/shoji)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
> **AI-authored.** 100% of the code was written by Claude (Anthropic); I shaped the architecture, scope, and every decision, and did all the testing.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A zero-dependency, plugin-first TypeScript lightbox/gallery. Drop in two `<script>`/`<link>` tags, or install from npm — everything beyond the minimal lightbox, including every official plugin, is opt-in.
|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ A zero-dependency, plugin-first TypeScript lightbox/gallery. Drop in two `<scrip
|
|
|
14
14
|
- **Plugin system** — zoom (pinch/pan/wheel), fullscreen, rotate/flip, autoplay/slideshow, active-thumbnail sync, YouTube video embeds, and a grid/masonry/justified layout engine, each independently opt-in.
|
|
15
15
|
- **Accessibility is not a plugin** — keyboard nav, focus trapping, ARIA roles, and screen-reader announcements live in core.
|
|
16
16
|
- **Themeable via CSS custom properties** — no hardcoded colors/sizes in JS.
|
|
17
|
-
- **
|
|
17
|
+
- **Three distributions** — single-file (`dist/shoji.js` + `dist/shoji.css`, core + every plugin, self-registering) for zero-setup `<script>` tag use; core + individual plugin files (`dist/core/shoji-core.(min.)js` + `dist/plugins/{name}.(min.)js`) for `<script>`-tag consumers who want to pick exactly which plugins ship; and tree-shakable per-plugin ESM entries for bundler users.
|
|
18
18
|
- Size-budgeted and CI-enforced: core ≤ 21 kB, each plugin ≤ 8 kB, full bundle ≤ 90 kB (all min+gzip).
|
|
19
19
|
|
|
20
20
|
## Install
|
|
@@ -28,7 +28,7 @@ A zero-dependency, plugin-first TypeScript lightbox/gallery. Drop in two `<scrip
|
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install @michaelyagi/shoji@
|
|
31
|
+
npm install @michaelyagi/shoji@beta
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
```js
|
|
@@ -38,6 +38,25 @@ import '@michaelyagi/shoji/style.css';
|
|
|
38
38
|
new Shoji('#gallery', { plugins: [Shoji.Zoom] });
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
## CDN
|
|
42
|
+
|
|
43
|
+
Skip npm and load the built files straight from [jsDelivr](https://www.jsdelivr.net/), which mirrors every npm release automatically:
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@michaelyagi/shoji/dist/shoji.min.css" />
|
|
47
|
+
<script src="https://cdn.jsdelivr.net/npm/@michaelyagi/shoji/dist/shoji.min.js"></script>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- **Full bundle** (core + every plugin) — `dist/shoji.min.js` / `dist/shoji.min.css`, or unminified: `dist/shoji.js` / `dist/shoji.css`.
|
|
51
|
+
- **Core alone** — `dist/core/shoji-core.min.js` + `dist/core/shoji-core.min.css`.
|
|
52
|
+
- **Individual plugins**, loaded alongside core — `dist/plugins/<name>.min.js`, e.g. `zoom.min.js`, `layout.min.js`. Not every plugin ships CSS: `activeThumbnail`, `autoplay`, `layout`, and `zoom` do; `fullscreen`, `rotateFlip`, and `video` don't need any.
|
|
53
|
+
|
|
54
|
+
No version in the URL resolves to the latest release. To pin an exact one instead, add `@<version>` right after the package name — see [npmjs.com/package/@michaelyagi/shoji?activeTab=code](https://www.npmjs.com/package/@michaelyagi/shoji?activeTab=code) for what that currently is:
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<script src="https://cdn.jsdelivr.net/npm/@michaelyagi/shoji@0.1.0-beta.11/dist/shoji.min.js"></script>
|
|
58
|
+
```
|
|
59
|
+
|
|
41
60
|
## Quickstart
|
|
42
61
|
|
|
43
62
|
```html
|
|
@@ -78,6 +97,18 @@ npm run verify # the full gate: typecheck + lint + unit + e2e + size
|
|
|
78
97
|
|
|
79
98
|
`demo/assets/` (sample photos/video for the local demo pages) is gitignored — drop your own media there, or the demo pages just render with 0 items.
|
|
80
99
|
|
|
100
|
+
## Releasing
|
|
101
|
+
|
|
102
|
+
1. Bump `package.json`'s `version` to `<version>`, commit, and push to `main`.
|
|
103
|
+
2. Tag that same version and push the tag:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git tag v<version> # "v" + package.json's version, e.g. v0.1.0-beta.11
|
|
107
|
+
git push --tags
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Pushing the tag triggers `.github/workflows/ci.yml`'s `publish-npm` job — it runs the full verify gate (typecheck, lint, unit, e2e, size) first and only publishes if that passes. The dist-tag is derived automatically from the version string: a prerelease (e.g. `0.1.0-beta.11`) publishes under its own tag (`beta`) and is also promoted to `latest`; a plain version (e.g. `1.0.0`) just publishes as `latest` directly.
|
|
111
|
+
|
|
81
112
|
## License
|
|
82
113
|
|
|
83
114
|
MIT © Michael Yagi
|