@page-speed/lightbox 0.0.2 → 0.1.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/dist/index.cjs CHANGED
@@ -2802,11 +2802,11 @@ var require_react_jsx_runtime_development = __commonJS({
2802
2802
  return jsxWithValidation(type, props, key, false);
2803
2803
  }
2804
2804
  }
2805
- var jsx11 = jsxWithValidationDynamic;
2806
- var jsxs7 = jsxWithValidationStatic;
2805
+ var jsx15 = jsxWithValidationDynamic;
2806
+ var jsxs11 = jsxWithValidationStatic;
2807
2807
  exports2.Fragment = REACT_FRAGMENT_TYPE;
2808
- exports2.jsx = jsx11;
2809
- exports2.jsxs = jsxs7;
2808
+ exports2.jsx = jsx15;
2809
+ exports2.jsxs = jsxs11;
2810
2810
  })();
2811
2811
  }
2812
2812
  }
@@ -20856,7 +20856,7 @@ var require_pdf = __commonJS({
20856
20856
  }
20857
20857
  });
20858
20858
 
20859
- // node_modules/.pnpm/@page-speed+pdf-viewer@0.0.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
20859
+ // node_modules/.pnpm/@page-speed+pdf-viewer@0.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js
20860
20860
  var dist_exports = {};
20861
20861
  __export(dist_exports, {
20862
20862
  PDFCanvas: () => PDFCanvas,
@@ -21453,7 +21453,7 @@ function createProgressiveFetchHandler(onProgress) {
21453
21453
  }
21454
21454
  var import_react8, import_react9, pdfjsLib, import_react10, import_react11, import_react12, import_react13, import_react14, import_jsx_runtime5, import_jsx_runtime6, import_react15, import_jsx_runtime7, import_jsx_runtime8, DEFAULT_SCALE, CACHE_SIZE, MIN_ZOOM, MAX_ZOOM, ZOOM_STEP, PDFViewer_default, linearizedPDFConfig;
21455
21455
  var init_dist = __esm({
21456
- "node_modules/.pnpm/@page-speed+pdf-viewer@0.0.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
21456
+ "node_modules/.pnpm/@page-speed+pdf-viewer@0.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@page-speed/pdf-viewer/dist/index.js"() {
21457
21457
  import_react8 = __toESM(require_react());
21458
21458
  import_react9 = __toESM(require_react());
21459
21459
  pdfjsLib = __toESM(require_pdf());
@@ -21506,13 +21506,17 @@ var init_dist = __esm({
21506
21506
  var index_exports = {};
21507
21507
  __export(index_exports, {
21508
21508
  ComponentRenderer: () => ComponentRenderer,
21509
+ CustomSlideLayout: () => CustomSlideLayout,
21510
+ FullscreenLayout: () => FullscreenLayout,
21509
21511
  HorizontalLayout: () => HorizontalLayout,
21510
21512
  ImageRenderer: () => ImageRenderer,
21513
+ InlineLayout: () => InlineLayout,
21511
21514
  Lightbox: () => Lightbox,
21512
21515
  LightboxChrome: () => LightboxChrome,
21513
21516
  LightboxContent: () => LightboxContent,
21514
21517
  LightboxOverlay: () => LightboxOverlay,
21515
21518
  PDFRenderer: () => PDFRenderer,
21519
+ VerticalSplitLayout: () => VerticalSplitLayout,
21516
21520
  VideoRenderer: () => VideoRenderer,
21517
21521
  useGalleryState: () => useGalleryState,
21518
21522
  useKeyboardShortcuts: () => useKeyboardShortcuts,
@@ -21621,7 +21625,23 @@ var Lightbox_default = {
21621
21625
  captionTitle: "Lightbox_captionTitle",
21622
21626
  captionText: "Lightbox_captionText",
21623
21627
  pdfContainer: "Lightbox_pdfContainer",
21624
- pdfFallback: "Lightbox_pdfFallback"
21628
+ pdfFallback: "Lightbox_pdfFallback",
21629
+ verticalSplitLayoutRoot: "Lightbox_verticalSplitLayoutRoot",
21630
+ verticalSplitLayoutContainer: "Lightbox_verticalSplitLayoutContainer",
21631
+ verticalSplitContent: "Lightbox_verticalSplitContent",
21632
+ verticalSplitSidebar: "Lightbox_verticalSplitSidebar",
21633
+ customSlideLayoutRoot: "Lightbox_customSlideLayoutRoot",
21634
+ customSlideLayoutContainer: "Lightbox_customSlideLayoutContainer",
21635
+ customSlideContent: "Lightbox_customSlideContent",
21636
+ customSlideChrome: "Lightbox_customSlideChrome",
21637
+ fullscreenLayoutRoot: "Lightbox_fullscreenLayoutRoot",
21638
+ fullscreenLayoutContainer: "Lightbox_fullscreenLayoutContainer",
21639
+ fullscreenContent: "Lightbox_fullscreenContent",
21640
+ fullscreenChrome: "Lightbox_fullscreenChrome",
21641
+ inlineLayoutRoot: "Lightbox_inlineLayoutRoot",
21642
+ inlineLayoutContainer: "Lightbox_inlineLayoutContainer",
21643
+ inlineContent: "Lightbox_inlineContent",
21644
+ inlineToolbar: "Lightbox_inlineToolbar"
21625
21645
  };
21626
21646
 
21627
21647
  // src/components/LightboxOverlay.tsx
@@ -22494,8 +22514,121 @@ function HorizontalLayout({
22494
22514
  ) });
22495
22515
  }
22496
22516
 
22497
- // src/components/Lightbox.tsx
22517
+ // src/components/Layouts/VerticalSplitLayout.tsx
22498
22518
  var import_jsx_runtime14 = __toESM(require_jsx_runtime());
22519
+ function VerticalSplitLayout({
22520
+ content,
22521
+ chrome,
22522
+ height,
22523
+ maxWidth,
22524
+ className,
22525
+ style
22526
+ }) {
22527
+ const containerStyle = {
22528
+ maxWidth,
22529
+ height,
22530
+ ...style
22531
+ };
22532
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
22533
+ "div",
22534
+ {
22535
+ className: [
22536
+ Lightbox_default.verticalSplitLayoutContainer,
22537
+ className || ""
22538
+ ].join(" ").trim(),
22539
+ children: [
22540
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitContent, children: content }),
22541
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: Lightbox_default.verticalSplitSidebar, children: chrome })
22542
+ ]
22543
+ }
22544
+ ) });
22545
+ }
22546
+
22547
+ // src/components/Layouts/CustomSlideLayout.tsx
22548
+ var import_jsx_runtime15 = __toESM(require_jsx_runtime());
22549
+ function CustomSlideLayout({
22550
+ content,
22551
+ chrome,
22552
+ height,
22553
+ maxWidth,
22554
+ className,
22555
+ style
22556
+ }) {
22557
+ const containerStyle = {
22558
+ maxWidth,
22559
+ height,
22560
+ ...style
22561
+ };
22562
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
22563
+ "div",
22564
+ {
22565
+ className: [
22566
+ Lightbox_default.customSlideLayoutContainer,
22567
+ className || ""
22568
+ ].join(" ").trim(),
22569
+ children: [
22570
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideContent, children: content }),
22571
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: Lightbox_default.customSlideChrome, children: chrome })
22572
+ ]
22573
+ }
22574
+ ) });
22575
+ }
22576
+
22577
+ // src/components/Layouts/FullscreenLayout.tsx
22578
+ var import_jsx_runtime16 = __toESM(require_jsx_runtime());
22579
+ function FullscreenLayout({
22580
+ content,
22581
+ chrome,
22582
+ className,
22583
+ style
22584
+ }) {
22585
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenLayoutRoot, style, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
22586
+ "div",
22587
+ {
22588
+ className: [
22589
+ Lightbox_default.fullscreenLayoutContainer,
22590
+ className || ""
22591
+ ].join(" ").trim(),
22592
+ children: [
22593
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenContent, children: content }),
22594
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: Lightbox_default.fullscreenChrome, children: chrome })
22595
+ ]
22596
+ }
22597
+ ) });
22598
+ }
22599
+
22600
+ // src/components/Layouts/InlineLayout.tsx
22601
+ var import_jsx_runtime17 = __toESM(require_jsx_runtime());
22602
+ function InlineLayout({
22603
+ content,
22604
+ chrome,
22605
+ height,
22606
+ maxWidth,
22607
+ className,
22608
+ style
22609
+ }) {
22610
+ const containerStyle = {
22611
+ maxWidth,
22612
+ height,
22613
+ ...style
22614
+ };
22615
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineLayoutRoot, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
22616
+ "div",
22617
+ {
22618
+ className: [
22619
+ Lightbox_default.inlineLayoutContainer,
22620
+ className || ""
22621
+ ].join(" ").trim(),
22622
+ children: [
22623
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineContent, children: content }),
22624
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: Lightbox_default.inlineToolbar, children: chrome })
22625
+ ]
22626
+ }
22627
+ ) });
22628
+ }
22629
+
22630
+ // src/components/Lightbox.tsx
22631
+ var import_jsx_runtime18 = __toESM(require_jsx_runtime());
22499
22632
  function Lightbox(props) {
22500
22633
  const { items, initialIndex = 0 } = props;
22501
22634
  const gallery = useGalleryState({
@@ -22572,45 +22705,64 @@ function Lightbox(props) {
22572
22705
  captions: true,
22573
22706
  ...props.controls
22574
22707
  };
22575
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: Lightbox_default.lightboxPortal, role: "dialog", "aria-modal": "true", children: [
22576
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22708
+ const contentNode = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22709
+ LightboxContent,
22710
+ {
22711
+ item: currentItem,
22712
+ layout,
22713
+ optixFlowConfig: props.optixFlowConfig
22714
+ }
22715
+ );
22716
+ const chromeNode = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22717
+ LightboxChrome,
22718
+ {
22719
+ currentIndex: gallery.currentIndex,
22720
+ totalItems: items.length,
22721
+ currentItem,
22722
+ canNext: gallery.canNext,
22723
+ canPrev: gallery.canPrev,
22724
+ controls: effectiveControls,
22725
+ onNext: handleNext,
22726
+ onPrev: handlePrev,
22727
+ onClose: handleClose
22728
+ }
22729
+ );
22730
+ const layoutProps = {
22731
+ content: contentNode,
22732
+ chrome: chromeNode,
22733
+ height: props.height,
22734
+ maxWidth: props.maxWidth,
22735
+ className: props.className,
22736
+ style: props.style
22737
+ };
22738
+ if (layout === "inline") {
22739
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InlineLayout, { ...layoutProps });
22740
+ }
22741
+ let layoutComponent;
22742
+ switch (layout) {
22743
+ case "vertical-split":
22744
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VerticalSplitLayout, { ...layoutProps });
22745
+ break;
22746
+ case "custom-slide":
22747
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CustomSlideLayout, { ...layoutProps });
22748
+ break;
22749
+ case "fullscreen":
22750
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FullscreenLayout, { ...layoutProps });
22751
+ break;
22752
+ case "horizontal":
22753
+ default:
22754
+ layoutComponent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(HorizontalLayout, { ...layoutProps });
22755
+ break;
22756
+ }
22757
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: Lightbox_default.lightboxPortal, role: "dialog", "aria-modal": "true", children: [
22758
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
22577
22759
  LightboxOverlay,
22578
22760
  {
22579
22761
  onClose: handleClose,
22580
22762
  closeOnBackdropClick: props.closeOnBackdropClick ?? true
22581
22763
  }
22582
22764
  ),
22583
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22584
- HorizontalLayout,
22585
- {
22586
- content: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22587
- LightboxContent,
22588
- {
22589
- item: currentItem,
22590
- layout,
22591
- optixFlowConfig: props.optixFlowConfig
22592
- }
22593
- ),
22594
- chrome: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
22595
- LightboxChrome,
22596
- {
22597
- currentIndex: gallery.currentIndex,
22598
- totalItems: items.length,
22599
- currentItem,
22600
- canNext: gallery.canNext,
22601
- canPrev: gallery.canPrev,
22602
- controls: effectiveControls,
22603
- onNext: handleNext,
22604
- onPrev: handlePrev,
22605
- onClose: handleClose
22606
- }
22607
- ),
22608
- height: props.height,
22609
- maxWidth: props.maxWidth,
22610
- className: props.className,
22611
- style: props.style
22612
- }
22613
- )
22765
+ layoutComponent
22614
22766
  ] });
22615
22767
  }
22616
22768
 
package/dist/index.css CHANGED
@@ -97,3 +97,164 @@
97
97
  height: 100%;
98
98
  color: var(--lightbox-text-muted, rgba(255, 255, 255, 0.7));
99
99
  }
100
+ .Lightbox_verticalSplitLayoutRoot {
101
+ position: relative;
102
+ max-width: var(--lightbox-max-width, 90vw);
103
+ width: 100%;
104
+ padding: var(--lightbox-padding, 24px);
105
+ box-sizing: border-box;
106
+ }
107
+ .Lightbox_verticalSplitLayoutContainer {
108
+ position: relative;
109
+ background: var(--lightbox-modal-bg, #111);
110
+ color: var(--lightbox-text, #fff);
111
+ border-radius: var(--lightbox-radius, 12px);
112
+ overflow: hidden;
113
+ display: flex;
114
+ flex-direction: row;
115
+ min-height: 70vh;
116
+ }
117
+ .Lightbox_verticalSplitContent {
118
+ flex: 2;
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: center;
122
+ background: var(--lightbox-content-bg, #000);
123
+ overflow: auto;
124
+ }
125
+ .Lightbox_verticalSplitSidebar {
126
+ flex: 1;
127
+ min-width: 300px;
128
+ max-width: 400px;
129
+ border-left: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
130
+ display: flex;
131
+ flex-direction: column;
132
+ background: var(--lightbox-sidebar-bg, rgba(0, 0, 0, 0.3));
133
+ }
134
+ @media (max-width: 1024px) {
135
+ .Lightbox_verticalSplitLayoutContainer {
136
+ flex-direction: column;
137
+ }
138
+ .Lightbox_verticalSplitSidebar {
139
+ min-width: auto;
140
+ max-width: none;
141
+ border-left: none;
142
+ border-top: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
143
+ }
144
+ }
145
+ .Lightbox_customSlideLayoutRoot {
146
+ position: relative;
147
+ max-width: var(--lightbox-max-width, 95vw);
148
+ width: 100%;
149
+ padding: var(--lightbox-padding, 16px);
150
+ box-sizing: border-box;
151
+ }
152
+ .Lightbox_customSlideLayoutContainer {
153
+ position: relative;
154
+ background: var(--lightbox-modal-bg, #111);
155
+ color: var(--lightbox-text, #fff);
156
+ border-radius: var(--lightbox-radius, 12px);
157
+ overflow: hidden;
158
+ min-height: 80vh;
159
+ display: flex;
160
+ flex-direction: column;
161
+ }
162
+ .Lightbox_customSlideContent {
163
+ flex: 1;
164
+ position: relative;
165
+ display: flex;
166
+ align-items: center;
167
+ justify-content: center;
168
+ background: var(--lightbox-content-bg, #000);
169
+ overflow: auto;
170
+ }
171
+ .Lightbox_customSlideChrome {
172
+ position: absolute;
173
+ bottom: 0;
174
+ left: 0;
175
+ right: 0;
176
+ background:
177
+ linear-gradient(
178
+ to top,
179
+ rgba(0, 0, 0, 0.8) 0%,
180
+ transparent 100%);
181
+ padding: 24px 16px 16px;
182
+ z-index: 10;
183
+ }
184
+ .Lightbox_fullscreenLayoutRoot {
185
+ position: fixed;
186
+ inset: 0;
187
+ z-index: 1000;
188
+ background: var(--lightbox-fullscreen-bg, #000);
189
+ }
190
+ .Lightbox_fullscreenLayoutContainer {
191
+ width: 100%;
192
+ height: 100%;
193
+ display: flex;
194
+ flex-direction: column;
195
+ color: var(--lightbox-text, #fff);
196
+ }
197
+ .Lightbox_fullscreenContent {
198
+ flex: 1;
199
+ display: flex;
200
+ align-items: center;
201
+ justify-content: center;
202
+ background: var(--lightbox-content-bg, #000);
203
+ overflow: auto;
204
+ }
205
+ .Lightbox_fullscreenChrome {
206
+ position: absolute;
207
+ top: 0;
208
+ left: 0;
209
+ right: 0;
210
+ background:
211
+ linear-gradient(
212
+ to bottom,
213
+ rgba(0, 0, 0, 0.8) 0%,
214
+ transparent 100%);
215
+ padding: 16px 24px 48px;
216
+ z-index: 10;
217
+ }
218
+ .Lightbox_inlineLayoutRoot {
219
+ position: relative;
220
+ max-width: var(--lightbox-max-width, 100%);
221
+ width: 100%;
222
+ margin: 0 auto;
223
+ }
224
+ .Lightbox_inlineLayoutContainer {
225
+ position: relative;
226
+ background: var(--lightbox-modal-bg, #111);
227
+ color: var(--lightbox-text, #fff);
228
+ border-radius: var(--lightbox-radius, 12px);
229
+ overflow: hidden;
230
+ display: flex;
231
+ flex-direction: column;
232
+ }
233
+ .Lightbox_inlineContent {
234
+ flex: 1;
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ background: var(--lightbox-content-bg, #000);
239
+ min-height: 400px;
240
+ }
241
+ .Lightbox_inlineToolbar {
242
+ border-top: 1px solid var(--lightbox-border, rgba(255, 255, 255, 0.1));
243
+ }
244
+ @media (max-width: 768px) {
245
+ .Lightbox_verticalSplitLayoutRoot,
246
+ .Lightbox_customSlideLayoutRoot {
247
+ padding: 0;
248
+ max-width: 100vw;
249
+ max-height: 100vh;
250
+ }
251
+ .Lightbox_verticalSplitLayoutContainer,
252
+ .Lightbox_customSlideLayoutContainer {
253
+ border-radius: 0;
254
+ min-height: 100vh;
255
+ }
256
+ .Lightbox_customSlideChrome,
257
+ .Lightbox_fullscreenChrome {
258
+ padding: 12px;
259
+ }
260
+ }