czon 0.3.5 → 0.3.6

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.
@@ -106,7 +106,44 @@ const ContentPage = props => {
106
106
  }, 300);
107
107
  }
108
108
 
109
- `))));
109
+ `),
110
+ react_1.default.createElement("script", { id: "embla-lib", src: "https://unpkg.com/embla-carousel/embla-carousel.umd.js", defer: true }),
111
+ react_1.default.createElement("script", { id: "embla-autoplay-lib", src: "https://unpkg.com/embla-carousel-autoplay/embla-carousel-autoplay.umd.js", defer: true }),
112
+ react_1.default.createElement("script", null, `
113
+ Promise.all([
114
+ new Promise(resolve => {document.getElementById('embla-lib').addEventListener('load', resolve)}),
115
+ new Promise(resolve => {document.getElementById('embla-autoplay-lib').addEventListener('load', resolve)}),
116
+ ]).then(() => {
117
+ console.log('Embla Carousel and Autoplay loaded');
118
+ renderEmblaCarousels();
119
+ });
120
+
121
+ function renderEmblaCarousels() {
122
+ // Detect image groups, make them carousels automatically
123
+ Map.groupBy(document.querySelectorAll('img'), x => x.parentNode).entries().forEach(([container, images]) => {
124
+ const outer = document.createElement('div');
125
+ outer.classList.add('embla');
126
+ container.appendChild(outer);
127
+
128
+ const inner = document.createElement('div');
129
+ inner.classList.add('embla__container');
130
+ outer.appendChild(inner);
131
+
132
+ images.forEach(img => {
133
+ container.removeChild(img);
134
+
135
+ const slide = document.createElement('div');
136
+ slide.classList.add('embla__slide');
137
+
138
+ slide.appendChild(img);
139
+ inner.appendChild(slide);
140
+ });
141
+
142
+ EmblaCarousel(outer, { loop: true }, [EmblaCarouselAutoplay()]);
143
+ });
144
+
145
+ }
146
+ `))));
110
147
  };
111
148
  exports.ContentPage = ContentPage;
112
149
  //# sourceMappingURL=ContentPage.js.map
package/dist/ssg/style.js CHANGED
@@ -434,5 +434,16 @@ exports.style = `
434
434
  transform: rotate(180deg);
435
435
  }
436
436
  }
437
+
438
+ .embla {
439
+ overflow: hidden;
440
+ }
441
+ .embla__container {
442
+ display: flex;
443
+ }
444
+ .embla__slide {
445
+ flex: 0 0 100%;
446
+ min-width: 0;
447
+ }
437
448
  `;
438
449
  //# sourceMappingURL=style.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "czon",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "CZone - AI enhanced Markdown content engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",