@0m0g1/griot 0.1.11 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0m0g1/griot",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "A self-contained block-based rich text editor and renderer built for historical document authoring.",
5
5
  "type": "module",
6
6
  "main": "./src/Griot.js",
@@ -11,15 +11,7 @@
11
11
  // layouts: 'grid' | 'masonry' | 'carousel' | 'strip'
12
12
  // ─────────────────────────────────────────────────────────────────────────────
13
13
 
14
- // Lazy import avoids circular dependency when both are re-exported from Griot.js
15
- let _lightbox = null;
16
- function getLightbox() {
17
- if (!_lightbox) {
18
- // Dynamic require/import — works in both CJS and ESM bundler contexts
19
- _lightbox = require('./Lightbox.js').lightbox;
20
- }
21
- return _lightbox;
22
- }
14
+ import { lightbox } from './Lightbox.js';
23
15
 
24
16
  const VALID_LAYOUTS = new Set(['grid', 'masonry', 'carousel', 'strip']);
25
17
 
@@ -105,7 +97,7 @@ function _itemEl(item, index, allItems) {
105
97
  img.decoding = 'async';
106
98
  img.draggable = false;
107
99
 
108
- img.addEventListener('click', () => getLightbox().open(allItems, index));
100
+ img.addEventListener('click', () => lightbox.open(allItems, index));
109
101
 
110
102
  el.appendChild(img);
111
103
 
@@ -150,7 +142,7 @@ function _carousel(items, wrap) {
150
142
 
151
143
  // Click on carousel image → open lightbox at CURRENT idx (not i, since user
152
144
  // may have navigated away from the first image)
153
- img.addEventListener('click', () => getLightbox().open(items, idx));
145
+ img.addEventListener('click', () => lightbox.open(items, idx));
154
146
 
155
147
  slide.appendChild(img);
156
148