@micromag/screen-gallery 0.4.70 → 0.4.74
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/es/index.d.ts +4 -2
- package/es/index.js +421 -258
- package/package.json +17 -16
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardedRef } from 'react';
|
|
3
|
+
import { ImageMedia, ImageElement, TextStyle, BackgroundElement, Header, Footer, MediaElement } from '@micromag/core';
|
|
3
4
|
|
|
4
5
|
interface GalleryScreenProps {
|
|
5
6
|
layout?: 'two-vertical-equal' | 'two-vertical-top' | 'two-vertical-bottom' | 'three-vertical' | 'one-two' | 'two-one' | 'two-by-two' | 'four-vertical' | 'one-two-one' | 'four-mosaic' | 'two-one-two' | 'one-two-two' | 'two-two-one' | 'two-by-three' | 'one-one-two-two' | 'two-two-one-one';
|
|
@@ -14,9 +15,10 @@ interface GalleryScreenProps {
|
|
|
14
15
|
current?: boolean;
|
|
15
16
|
active?: boolean;
|
|
16
17
|
preload?: boolean;
|
|
18
|
+
mediaRef?: ForwardedRef<MediaElement> | null;
|
|
17
19
|
className?: string | null;
|
|
18
20
|
}
|
|
19
|
-
declare function GalleryScreen({ layout, images, withCaptions, imageCaptionStyle, background, header, footer, current, active, preload, spacing: initialSpacing, captionMaxLines, className, }: GalleryScreenProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function GalleryScreen({ layout, images, withCaptions, imageCaptionStyle, background, header, footer, current, active, preload, spacing: initialSpacing, captionMaxLines, mediaRef: customMediaRef, className, }: GalleryScreenProps): react_jsx_runtime.JSX.Element;
|
|
20
22
|
|
|
21
23
|
declare function GalleryCaptionsScreen({ ...props }: {
|
|
22
24
|
[x: string]: any;
|
package/es/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { FormattedMessage, defineMessage } from 'react-intl';
|
|
2
|
-
import
|
|
3
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
5
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
+
import { c } from 'react/compiler-runtime';
|
|
6
3
|
import classNames from 'classnames';
|
|
7
4
|
import isPlainObject from 'lodash/isPlainObject';
|
|
8
|
-
import { useState,
|
|
5
|
+
import { useState, useRef, useEffect } from 'react';
|
|
9
6
|
import { ScreenElement } from '@micromag/core/components';
|
|
10
7
|
import { useScreenSize, useViewerContext, useViewerWebView, usePlaybackContext, usePlaybackMediaRef, useScreenRenderContext } from '@micromag/core/contexts';
|
|
11
8
|
import { useDimensionObserver } from '@micromag/core/hooks';
|
|
12
|
-
import { isHeaderFilled, isFooterFilled, getFooterProps, isImageFilled, isTextFilled } from '@micromag/core/utils';
|
|
9
|
+
import { isHeaderFilled, isFooterFilled, getFooterProps, isImageFilled, isTextFilled, mergeRefs } from '@micromag/core/utils';
|
|
13
10
|
import Background from '@micromag/element-background';
|
|
14
11
|
import Container from '@micromag/element-container';
|
|
15
12
|
import Footer from '@micromag/element-footer';
|
|
@@ -18,8 +15,6 @@ import Header from '@micromag/element-header';
|
|
|
18
15
|
import Text from '@micromag/element-text';
|
|
19
16
|
import Visual from '@micromag/element-visual';
|
|
20
17
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
21
|
-
import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
|
|
22
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
23
18
|
|
|
24
19
|
var layoutProps = {
|
|
25
20
|
// 2
|
|
@@ -193,236 +188,391 @@ var layoutProps = {
|
|
|
193
188
|
|
|
194
189
|
var styles = {"container":"micromag-screen-gallery-container","background":"micromag-screen-gallery-background","content":"micromag-screen-gallery-content","inner":"micromag-screen-gallery-inner","grid":"micromag-screen-gallery-grid","placeholder":"micromag-screen-gallery-placeholder","emptyImage":"micromag-screen-gallery-emptyImage","emptyCaption":"micromag-screen-gallery-emptyCaption","gridItem":"micromag-screen-gallery-gridItem","imageContainer":"micromag-screen-gallery-imageContainer","header":"micromag-screen-gallery-header","footer":"micromag-screen-gallery-footer","image":"micromag-screen-gallery-image","caption":"micromag-screen-gallery-caption"};
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
function GalleryScreen(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
images
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
191
|
+
const emptyArray = [];
|
|
192
|
+
function GalleryScreen(t0) {
|
|
193
|
+
const $ = c(73);
|
|
194
|
+
const {
|
|
195
|
+
layout: t1,
|
|
196
|
+
images: t2,
|
|
197
|
+
withCaptions: t3,
|
|
198
|
+
imageCaptionStyle: t4,
|
|
199
|
+
background: t5,
|
|
200
|
+
header: t6,
|
|
201
|
+
footer: t7,
|
|
202
|
+
current: t8,
|
|
203
|
+
active: t9,
|
|
204
|
+
preload: t10,
|
|
205
|
+
spacing: t11,
|
|
206
|
+
captionMaxLines: t12,
|
|
207
|
+
mediaRef: t13,
|
|
208
|
+
className: t14
|
|
209
|
+
} = t0;
|
|
210
|
+
const layout = t1 === undefined ? "four-mosaic" : t1;
|
|
211
|
+
const images = t2 === undefined ? emptyArray : t2;
|
|
212
|
+
const withCaptions = t3 === undefined ? false : t3;
|
|
213
|
+
const imageCaptionStyle = t4 === undefined ? null : t4;
|
|
214
|
+
const background = t5 === undefined ? null : t5;
|
|
215
|
+
const header = t6 === undefined ? null : t6;
|
|
216
|
+
const footer = t7 === undefined ? null : t7;
|
|
217
|
+
const current = t8 === undefined ? true : t8;
|
|
218
|
+
const active = t9 === undefined ? true : t9;
|
|
219
|
+
const preload = t10 === undefined ? true : t10;
|
|
220
|
+
const initialSpacing = t11 === undefined ? 20 : t11;
|
|
221
|
+
const captionMaxLines = t12 === undefined ? 2 : t12;
|
|
222
|
+
const customMediaRef = t13 === undefined ? null : t13;
|
|
223
|
+
const className = t14 === undefined ? null : t14;
|
|
224
|
+
const {
|
|
225
|
+
width,
|
|
226
|
+
height,
|
|
227
|
+
resolution
|
|
228
|
+
} = useScreenSize();
|
|
229
|
+
const {
|
|
230
|
+
topHeight: viewerTopHeight,
|
|
231
|
+
bottomHeight: viewerBottomHeight,
|
|
232
|
+
bottomSidesWidth: viewerBottomSidesWidth
|
|
233
|
+
} = useViewerContext();
|
|
234
|
+
const {
|
|
235
|
+
open: openWebView
|
|
236
|
+
} = useViewerWebView();
|
|
237
|
+
const {
|
|
238
|
+
muted
|
|
239
|
+
} = usePlaybackContext();
|
|
240
|
+
const {
|
|
241
|
+
ref: mediaRef,
|
|
242
|
+
isCurrent: t15
|
|
243
|
+
} = usePlaybackMediaRef(current, true);
|
|
244
|
+
const isCurrentMedia = t15 === undefined ? false : t15;
|
|
245
|
+
const spacing = initialSpacing !== null ? Math.max(0, initialSpacing || 0) : 20;
|
|
246
|
+
const {
|
|
247
|
+
isView,
|
|
248
|
+
isPreview,
|
|
249
|
+
isPlaceholder,
|
|
250
|
+
isEdit
|
|
251
|
+
} = useScreenRenderContext();
|
|
252
|
+
const backgroundPlaying = current && (isView || isEdit) && (isCurrentMedia || !isView);
|
|
253
|
+
const mediaShouldLoad = current || preload;
|
|
254
|
+
const finalSpacing = isPlaceholder ? 5 : spacing;
|
|
255
|
+
const grid = isPlainObject(layoutProps[layout]) ? layoutProps[layout] : {};
|
|
256
|
+
const {
|
|
257
|
+
layout: t16,
|
|
258
|
+
vertical: t17
|
|
259
|
+
} = grid;
|
|
260
|
+
const gridLayout = t16 === undefined ? [] : t16;
|
|
261
|
+
const vertical = t17 === undefined ? false : t17;
|
|
262
|
+
const gridSpaces = gridLayout.reduce((acc, t18) => {
|
|
263
|
+
const {
|
|
264
|
+
rows,
|
|
265
|
+
columns
|
|
266
|
+
} = t18;
|
|
257
267
|
return acc + (vertical ? rows : columns).length;
|
|
258
268
|
}, 0);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
const [imagesLoaded, setImagesLoaded] = useState(0);
|
|
270
|
+
const imagesCount = images !== null ? Math.min(gridSpaces, images.length) : 0;
|
|
271
|
+
const ready = imagesLoaded >= imagesCount;
|
|
272
|
+
let t19;
|
|
273
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
274
|
+
t19 = () => {
|
|
275
|
+
setImagesLoaded(_temp);
|
|
276
|
+
};
|
|
277
|
+
$[0] = t19;
|
|
278
|
+
} else {
|
|
279
|
+
t19 = $[0];
|
|
280
|
+
}
|
|
281
|
+
const onImageLoaded = t19;
|
|
282
|
+
let t20;
|
|
283
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
284
|
+
t20 = [];
|
|
285
|
+
$[1] = t20;
|
|
286
|
+
} else {
|
|
287
|
+
t20 = $[1];
|
|
288
|
+
}
|
|
289
|
+
const imagesEl = useRef(t20);
|
|
290
|
+
let t21;
|
|
291
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
292
|
+
t21 = [];
|
|
293
|
+
$[2] = t21;
|
|
294
|
+
} else {
|
|
295
|
+
t21 = $[2];
|
|
296
|
+
}
|
|
297
|
+
const [imagesSizes, setImagesSizes] = useState(t21);
|
|
298
|
+
const {
|
|
299
|
+
ref: contentRef,
|
|
300
|
+
width: t22,
|
|
301
|
+
height: t23
|
|
302
|
+
} = useDimensionObserver();
|
|
303
|
+
const contentWidth = t22 === undefined ? null : t22;
|
|
304
|
+
const contentHeight = t23 === undefined ? null : t23;
|
|
305
|
+
let t24;
|
|
306
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
307
|
+
t24 = () => {
|
|
308
|
+
if (imagesEl.current.length) {
|
|
309
|
+
setImagesSizes(imagesEl.current.map(_temp2));
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
$[3] = t24;
|
|
313
|
+
} else {
|
|
314
|
+
t24 = $[3];
|
|
315
|
+
}
|
|
316
|
+
let t25;
|
|
317
|
+
if ($[4] !== contentHeight || $[5] !== contentWidth || $[6] !== layout) {
|
|
318
|
+
t25 = [contentWidth, contentHeight, layout, setImagesSizes];
|
|
319
|
+
$[4] = contentHeight;
|
|
320
|
+
$[5] = contentWidth;
|
|
321
|
+
$[6] = layout;
|
|
322
|
+
$[7] = t25;
|
|
323
|
+
} else {
|
|
324
|
+
t25 = $[7];
|
|
325
|
+
}
|
|
326
|
+
useEffect(t24, t25);
|
|
327
|
+
let t26;
|
|
328
|
+
if ($[8] !== header) {
|
|
329
|
+
t26 = isHeaderFilled(header);
|
|
330
|
+
$[8] = header;
|
|
331
|
+
$[9] = t26;
|
|
332
|
+
} else {
|
|
333
|
+
t26 = $[9];
|
|
334
|
+
}
|
|
335
|
+
const hasHeader = t26;
|
|
336
|
+
let t27;
|
|
337
|
+
if ($[10] !== footer) {
|
|
338
|
+
t27 = isFooterFilled(footer);
|
|
339
|
+
$[10] = footer;
|
|
340
|
+
$[11] = t27;
|
|
341
|
+
} else {
|
|
342
|
+
t27 = $[11];
|
|
343
|
+
}
|
|
344
|
+
const hasFooter = t27;
|
|
345
|
+
let t28;
|
|
346
|
+
if ($[12] !== current || $[13] !== footer || $[14] !== isPreview || $[15] !== isView || $[16] !== openWebView) {
|
|
347
|
+
t28 = getFooterProps(footer, {
|
|
348
|
+
isView,
|
|
349
|
+
current,
|
|
350
|
+
openWebView,
|
|
351
|
+
isPreview
|
|
268
352
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
var hasHeader = isHeaderFilled(header);
|
|
294
|
-
var hasFooter = isFooterFilled(footer);
|
|
295
|
-
var footerProps = getFooterProps(footer, {
|
|
296
|
-
isView: isView,
|
|
297
|
-
current: current,
|
|
298
|
-
openWebView: openWebView,
|
|
299
|
-
isPreview: isPreview
|
|
300
|
-
});
|
|
301
|
-
var _useDimensionObserver4 = useDimensionObserver(),
|
|
302
|
-
headerRef = _useDimensionObserver4.ref,
|
|
303
|
-
_useDimensionObserver5 = _useDimensionObserver4.height,
|
|
304
|
-
headerHeight = _useDimensionObserver5 === void 0 ? 0 : _useDimensionObserver5;
|
|
305
|
-
var _useDimensionObserver6 = useDimensionObserver(),
|
|
306
|
-
footerRef = _useDimensionObserver6.ref,
|
|
307
|
-
_useDimensionObserver7 = _useDimensionObserver6.height,
|
|
308
|
-
footerHeight = _useDimensionObserver7 === void 0 ? 0 : _useDimensionObserver7;
|
|
309
|
-
|
|
310
|
-
// items
|
|
311
|
-
var items = _toConsumableArray(Array(gridSpaces)).map(function (item, itemI) {
|
|
312
|
-
var image = images !== null ? images[itemI] : null;
|
|
313
|
-
var imageSize = imagesSizes[itemI] || {};
|
|
314
|
-
var finalImage = withCaptions ? image : {
|
|
353
|
+
$[12] = current;
|
|
354
|
+
$[13] = footer;
|
|
355
|
+
$[14] = isPreview;
|
|
356
|
+
$[15] = isView;
|
|
357
|
+
$[16] = openWebView;
|
|
358
|
+
$[17] = t28;
|
|
359
|
+
} else {
|
|
360
|
+
t28 = $[17];
|
|
361
|
+
}
|
|
362
|
+
const footerProps = t28;
|
|
363
|
+
const {
|
|
364
|
+
ref: headerRef,
|
|
365
|
+
height: t29
|
|
366
|
+
} = useDimensionObserver();
|
|
367
|
+
const headerHeight = t29 === undefined ? 0 : t29;
|
|
368
|
+
const {
|
|
369
|
+
ref: footerRef,
|
|
370
|
+
height: t30
|
|
371
|
+
} = useDimensionObserver();
|
|
372
|
+
const footerHeight = t30 === undefined ? 0 : t30;
|
|
373
|
+
const items = [...Array(gridSpaces)].map((item, itemI) => {
|
|
374
|
+
const image = images !== null ? images[itemI] : null;
|
|
375
|
+
const imageSize = imagesSizes[itemI] || {};
|
|
376
|
+
const finalImage = withCaptions ? image : {
|
|
315
377
|
media: image
|
|
316
378
|
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
textStyle
|
|
379
|
+
const {
|
|
380
|
+
caption: t31
|
|
381
|
+
} = finalImage || {};
|
|
382
|
+
const caption = t31 === undefined ? null : t31;
|
|
383
|
+
const hasImage = isImageFilled(finalImage);
|
|
384
|
+
const hasCaption = isTextFilled(caption);
|
|
385
|
+
const {
|
|
386
|
+
textStyle: t32
|
|
387
|
+
} = caption || {};
|
|
388
|
+
const textStyle = t32 === undefined ? null : t32;
|
|
325
389
|
return /*#__PURE__*/jsxs("div", {
|
|
326
390
|
className: styles.gridItem,
|
|
327
391
|
children: [/*#__PURE__*/jsx("div", {
|
|
328
392
|
className: styles.imageContainer,
|
|
329
|
-
ref:
|
|
393
|
+
ref: el => {
|
|
330
394
|
imagesEl.current[itemI] = el;
|
|
331
395
|
},
|
|
332
396
|
children: /*#__PURE__*/jsx(ScreenElement, {
|
|
333
397
|
placeholder: "image",
|
|
334
398
|
placeholderProps: {
|
|
335
399
|
className: styles.placeholder,
|
|
336
|
-
height:
|
|
400
|
+
height: "100%"
|
|
337
401
|
},
|
|
338
402
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
339
403
|
id: "ebsPd4",
|
|
340
|
-
defaultMessage:
|
|
341
|
-
"type": 0,
|
|
342
|
-
"value": "Image"
|
|
343
|
-
}]
|
|
404
|
+
defaultMessage: "Image"
|
|
344
405
|
}),
|
|
345
406
|
emptyClassName: styles.emptyImage,
|
|
346
407
|
isEmpty: !hasImage,
|
|
347
|
-
children: active || current ? /*#__PURE__*/jsx(Visual,
|
|
348
|
-
className: styles.image
|
|
349
|
-
|
|
408
|
+
children: active || current ? /*#__PURE__*/jsx(Visual, {
|
|
409
|
+
className: styles.image,
|
|
410
|
+
...finalImage,
|
|
411
|
+
...imageSize,
|
|
350
412
|
loadingMode: "lazy",
|
|
351
413
|
resolution: resolution,
|
|
352
414
|
objectFit: {
|
|
353
|
-
fit:
|
|
415
|
+
fit: "cover"
|
|
354
416
|
},
|
|
355
417
|
playing: backgroundPlaying,
|
|
356
418
|
active: active,
|
|
357
419
|
shouldLoad: mediaShouldLoad,
|
|
358
420
|
withoutVideo: isPreview,
|
|
359
421
|
onLoaded: onImageLoaded
|
|
360
|
-
})
|
|
422
|
+
}) : null
|
|
361
423
|
})
|
|
362
424
|
}), withCaptions ? /*#__PURE__*/jsx(ScreenElement, {
|
|
363
425
|
placeholder: "line",
|
|
364
426
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
365
427
|
id: "6tIigB",
|
|
366
|
-
defaultMessage:
|
|
367
|
-
"type": 0,
|
|
368
|
-
"value": "Caption"
|
|
369
|
-
}]
|
|
428
|
+
defaultMessage: "Caption"
|
|
370
429
|
}),
|
|
371
430
|
emptyClassName: styles.emptyCaption,
|
|
372
431
|
isEmpty: !hasCaption,
|
|
373
432
|
children: /*#__PURE__*/jsx("div", {
|
|
374
433
|
className: styles.caption,
|
|
375
|
-
children: /*#__PURE__*/jsx(Text,
|
|
434
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
435
|
+
...caption,
|
|
376
436
|
className: styles.captionText,
|
|
377
437
|
lineClamp: captionMaxLines,
|
|
378
|
-
textStyle:
|
|
379
|
-
|
|
438
|
+
textStyle: {
|
|
439
|
+
...(imageCaptionStyle || null),
|
|
440
|
+
...textStyle
|
|
441
|
+
}
|
|
442
|
+
})
|
|
380
443
|
})
|
|
381
444
|
}) : null]
|
|
382
|
-
},
|
|
445
|
+
}, `item-${itemI}`);
|
|
383
446
|
});
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
447
|
+
let t33;
|
|
448
|
+
if ($[18] !== className || $[19] !== isPlaceholder) {
|
|
449
|
+
t33 = classNames([styles.container, className, {
|
|
450
|
+
[styles.isPlaceholder]: isPlaceholder
|
|
451
|
+
}]);
|
|
452
|
+
$[18] = className;
|
|
453
|
+
$[19] = isPlaceholder;
|
|
454
|
+
$[20] = t33;
|
|
455
|
+
} else {
|
|
456
|
+
t33 = $[20];
|
|
457
|
+
}
|
|
458
|
+
const t34 = (hasHeader ? headerHeight : 0) + (!isPreview ? viewerTopHeight : 0);
|
|
459
|
+
const t35 = (hasFooter ? footerHeight : 0) + (current && !isPreview ? viewerBottomHeight : 0);
|
|
460
|
+
let t36;
|
|
461
|
+
if ($[21] !== t34 || $[22] !== t35) {
|
|
462
|
+
t36 = {
|
|
463
|
+
paddingTop: t34,
|
|
464
|
+
paddingBottom: t35
|
|
465
|
+
};
|
|
466
|
+
$[21] = t34;
|
|
467
|
+
$[22] = t35;
|
|
468
|
+
$[23] = t36;
|
|
469
|
+
} else {
|
|
470
|
+
t36 = $[23];
|
|
471
|
+
}
|
|
472
|
+
let t37;
|
|
473
|
+
if ($[24] !== finalSpacing || $[25] !== hasHeader || $[26] !== header || $[27] !== headerRef || $[28] !== isPlaceholder || $[29] !== isPreview || $[30] !== spacing || $[31] !== viewerTopHeight) {
|
|
474
|
+
t37 = !isPlaceholder && hasHeader ? /*#__PURE__*/jsx("div", {
|
|
475
|
+
className: styles.header,
|
|
476
|
+
ref: headerRef,
|
|
477
|
+
style: {
|
|
478
|
+
paddingTop: hasHeader ? finalSpacing / 2 : spacing,
|
|
479
|
+
paddingLeft: spacing,
|
|
480
|
+
paddingRight: spacing,
|
|
481
|
+
transform: !isPreview ? `translate(0, ${viewerTopHeight}px)` : null
|
|
482
|
+
},
|
|
483
|
+
children: /*#__PURE__*/jsx(Header, {
|
|
484
|
+
...header
|
|
485
|
+
})
|
|
486
|
+
}) : null;
|
|
487
|
+
$[24] = finalSpacing;
|
|
488
|
+
$[25] = hasHeader;
|
|
489
|
+
$[26] = header;
|
|
490
|
+
$[27] = headerRef;
|
|
491
|
+
$[28] = isPlaceholder;
|
|
492
|
+
$[29] = isPreview;
|
|
493
|
+
$[30] = spacing;
|
|
494
|
+
$[31] = viewerTopHeight;
|
|
495
|
+
$[32] = t37;
|
|
496
|
+
} else {
|
|
497
|
+
t37 = $[32];
|
|
498
|
+
}
|
|
499
|
+
let t38;
|
|
500
|
+
if ($[33] !== finalSpacing || $[34] !== grid || $[35] !== items) {
|
|
501
|
+
t38 = /*#__PURE__*/jsx(Grid, {
|
|
502
|
+
className: styles.grid,
|
|
503
|
+
spacing: finalSpacing,
|
|
504
|
+
items: items,
|
|
505
|
+
...grid
|
|
506
|
+
});
|
|
507
|
+
$[33] = finalSpacing;
|
|
508
|
+
$[34] = grid;
|
|
509
|
+
$[35] = items;
|
|
510
|
+
$[36] = t38;
|
|
511
|
+
} else {
|
|
512
|
+
t38 = $[36];
|
|
513
|
+
}
|
|
514
|
+
let t39;
|
|
515
|
+
if ($[37] !== finalSpacing || $[38] !== footerProps || $[39] !== footerRef || $[40] !== hasFooter || $[41] !== isPlaceholder || $[42] !== isPreview || $[43] !== viewerBottomHeight || $[44] !== viewerBottomSidesWidth) {
|
|
516
|
+
t39 = !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
517
|
+
className: styles.footer,
|
|
518
|
+
ref: footerRef,
|
|
519
|
+
style: {
|
|
520
|
+
paddingLeft: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
521
|
+
paddingRight: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
522
|
+
paddingBottom: finalSpacing / 2,
|
|
523
|
+
transform: !isPreview ? `translate(0, -${viewerBottomHeight}px)` : null
|
|
524
|
+
},
|
|
525
|
+
children: /*#__PURE__*/jsx(Footer, {
|
|
526
|
+
...footerProps
|
|
527
|
+
})
|
|
528
|
+
}) : null;
|
|
529
|
+
$[37] = finalSpacing;
|
|
530
|
+
$[38] = footerProps;
|
|
531
|
+
$[39] = footerRef;
|
|
532
|
+
$[40] = hasFooter;
|
|
533
|
+
$[41] = isPlaceholder;
|
|
534
|
+
$[42] = isPreview;
|
|
535
|
+
$[43] = viewerBottomHeight;
|
|
536
|
+
$[44] = viewerBottomSidesWidth;
|
|
537
|
+
$[45] = t39;
|
|
538
|
+
} else {
|
|
539
|
+
t39 = $[45];
|
|
540
|
+
}
|
|
541
|
+
let t40;
|
|
542
|
+
if ($[46] !== contentRef || $[47] !== t36 || $[48] !== t37 || $[49] !== t38 || $[50] !== t39) {
|
|
543
|
+
t40 = /*#__PURE__*/jsxs("div", {
|
|
544
|
+
className: styles.inner,
|
|
545
|
+
style: t36,
|
|
546
|
+
ref: contentRef,
|
|
547
|
+
children: [t37, t38, t39]
|
|
548
|
+
});
|
|
549
|
+
$[46] = contentRef;
|
|
550
|
+
$[47] = t36;
|
|
551
|
+
$[48] = t37;
|
|
552
|
+
$[49] = t38;
|
|
553
|
+
$[50] = t39;
|
|
554
|
+
$[51] = t40;
|
|
555
|
+
} else {
|
|
556
|
+
t40 = $[51];
|
|
557
|
+
}
|
|
558
|
+
let t41;
|
|
559
|
+
if ($[52] !== height || $[53] !== t40 || $[54] !== width) {
|
|
560
|
+
t41 = /*#__PURE__*/jsx(Container, {
|
|
388
561
|
width: width,
|
|
389
562
|
height: height,
|
|
390
563
|
className: styles.content,
|
|
391
|
-
children:
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
paddingLeft: spacing,
|
|
404
|
-
paddingRight: spacing,
|
|
405
|
-
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
406
|
-
},
|
|
407
|
-
children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
|
|
408
|
-
}) : null, /*#__PURE__*/jsx(Grid, _objectSpread({
|
|
409
|
-
className: styles.grid,
|
|
410
|
-
spacing: finalSpacing,
|
|
411
|
-
items: items
|
|
412
|
-
}, grid)), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
413
|
-
className: styles.footer,
|
|
414
|
-
ref: footerRef,
|
|
415
|
-
style: {
|
|
416
|
-
paddingLeft: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
417
|
-
paddingRight: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
418
|
-
// paddingTop: finalSpacing / 2,
|
|
419
|
-
paddingBottom: finalSpacing / 2,
|
|
420
|
-
transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
|
|
421
|
-
},
|
|
422
|
-
children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
|
|
423
|
-
}) : null]
|
|
424
|
-
})
|
|
425
|
-
}), !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
564
|
+
children: t40
|
|
565
|
+
});
|
|
566
|
+
$[52] = height;
|
|
567
|
+
$[53] = t40;
|
|
568
|
+
$[54] = width;
|
|
569
|
+
$[55] = t41;
|
|
570
|
+
} else {
|
|
571
|
+
t41 = $[55];
|
|
572
|
+
}
|
|
573
|
+
let t42;
|
|
574
|
+
if ($[56] !== background || $[57] !== backgroundPlaying || $[58] !== customMediaRef || $[59] !== height || $[60] !== isPlaceholder || $[61] !== isPreview || $[62] !== mediaRef || $[63] !== mediaShouldLoad || $[64] !== muted || $[65] !== resolution || $[66] !== width) {
|
|
575
|
+
t42 = !isPlaceholder ? /*#__PURE__*/jsx(Background, {
|
|
426
576
|
background: background,
|
|
427
577
|
width: width,
|
|
428
578
|
height: height,
|
|
@@ -430,18 +580,76 @@ function GalleryScreen(_ref) {
|
|
|
430
580
|
playing: backgroundPlaying,
|
|
431
581
|
muted: muted,
|
|
432
582
|
shouldLoad: mediaShouldLoad,
|
|
433
|
-
mediaRef: mediaRef,
|
|
583
|
+
mediaRef: mergeRefs(mediaRef, customMediaRef),
|
|
434
584
|
withoutVideo: isPreview,
|
|
435
585
|
className: styles.background
|
|
436
|
-
}) : null
|
|
437
|
-
|
|
586
|
+
}) : null;
|
|
587
|
+
$[56] = background;
|
|
588
|
+
$[57] = backgroundPlaying;
|
|
589
|
+
$[58] = customMediaRef;
|
|
590
|
+
$[59] = height;
|
|
591
|
+
$[60] = isPlaceholder;
|
|
592
|
+
$[61] = isPreview;
|
|
593
|
+
$[62] = mediaRef;
|
|
594
|
+
$[63] = mediaShouldLoad;
|
|
595
|
+
$[64] = muted;
|
|
596
|
+
$[65] = resolution;
|
|
597
|
+
$[66] = width;
|
|
598
|
+
$[67] = t42;
|
|
599
|
+
} else {
|
|
600
|
+
t42 = $[67];
|
|
601
|
+
}
|
|
602
|
+
let t43;
|
|
603
|
+
if ($[68] !== ready || $[69] !== t33 || $[70] !== t41 || $[71] !== t42) {
|
|
604
|
+
t43 = /*#__PURE__*/jsxs("div", {
|
|
605
|
+
className: t33,
|
|
606
|
+
"data-screen-ready": ready,
|
|
607
|
+
children: [t41, t42]
|
|
608
|
+
});
|
|
609
|
+
$[68] = ready;
|
|
610
|
+
$[69] = t33;
|
|
611
|
+
$[70] = t41;
|
|
612
|
+
$[71] = t42;
|
|
613
|
+
$[72] = t43;
|
|
614
|
+
} else {
|
|
615
|
+
t43 = $[72];
|
|
616
|
+
}
|
|
617
|
+
return t43;
|
|
618
|
+
}
|
|
619
|
+
function _temp2(imageEl) {
|
|
620
|
+
return imageEl !== null ? {
|
|
621
|
+
width: imageEl.offsetWidth,
|
|
622
|
+
height: imageEl.offsetHeight
|
|
623
|
+
} : {};
|
|
624
|
+
}
|
|
625
|
+
function _temp(count) {
|
|
626
|
+
return count + 1;
|
|
438
627
|
}
|
|
439
628
|
|
|
440
|
-
function GalleryCaptionsScreen(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
629
|
+
function GalleryCaptionsScreen(t0) {
|
|
630
|
+
const $ = c(4);
|
|
631
|
+
let props;
|
|
632
|
+
if ($[0] !== t0) {
|
|
633
|
+
({
|
|
634
|
+
...props
|
|
635
|
+
} = t0);
|
|
636
|
+
$[0] = t0;
|
|
637
|
+
$[1] = props;
|
|
638
|
+
} else {
|
|
639
|
+
props = $[1];
|
|
640
|
+
}
|
|
641
|
+
let t1;
|
|
642
|
+
if ($[2] !== props) {
|
|
643
|
+
t1 = /*#__PURE__*/jsx(GalleryScreen, {
|
|
644
|
+
...props,
|
|
645
|
+
withCaptions: true
|
|
646
|
+
});
|
|
647
|
+
$[2] = props;
|
|
648
|
+
$[3] = t1;
|
|
649
|
+
} else {
|
|
650
|
+
t1 = $[3];
|
|
651
|
+
}
|
|
652
|
+
return t1;
|
|
445
653
|
}
|
|
446
654
|
|
|
447
655
|
// import * as transforms from './transforms/index';
|
|
@@ -452,19 +660,13 @@ var definition = [{
|
|
|
452
660
|
group: {
|
|
453
661
|
label: defineMessage({
|
|
454
662
|
id: "6mX2ya",
|
|
455
|
-
defaultMessage:
|
|
456
|
-
"type": 0,
|
|
457
|
-
"value": "Images"
|
|
458
|
-
}]
|
|
663
|
+
defaultMessage: "Images"
|
|
459
664
|
}),
|
|
460
665
|
order: 4
|
|
461
666
|
},
|
|
462
667
|
title: defineMessage({
|
|
463
668
|
id: "jaFXki",
|
|
464
|
-
defaultMessage:
|
|
465
|
-
"type": 0,
|
|
466
|
-
"value": "Gallery"
|
|
467
|
-
}]
|
|
669
|
+
defaultMessage: "Gallery"
|
|
468
670
|
}),
|
|
469
671
|
component: GalleryScreen,
|
|
470
672
|
layouts: [
|
|
@@ -485,40 +687,28 @@ var definition = [{
|
|
|
485
687
|
defaultValue: 'two-vertical-equal',
|
|
486
688
|
label: defineMessage({
|
|
487
689
|
id: "4iBXj2",
|
|
488
|
-
defaultMessage:
|
|
489
|
-
"type": 0,
|
|
490
|
-
"value": "Layout"
|
|
491
|
-
}]
|
|
690
|
+
defaultMessage: "Layout"
|
|
492
691
|
})
|
|
493
692
|
}, {
|
|
494
693
|
name: 'images',
|
|
495
694
|
type: 'visuals',
|
|
496
695
|
label: defineMessage({
|
|
497
696
|
id: "muYwrB",
|
|
498
|
-
defaultMessage:
|
|
499
|
-
"type": 0,
|
|
500
|
-
"value": "Images"
|
|
501
|
-
}]
|
|
697
|
+
defaultMessage: "Images"
|
|
502
698
|
})
|
|
503
699
|
}, {
|
|
504
700
|
name: 'background',
|
|
505
701
|
type: 'background',
|
|
506
702
|
label: defineMessage({
|
|
507
703
|
id: "+MPZRu",
|
|
508
|
-
defaultMessage:
|
|
509
|
-
"type": 0,
|
|
510
|
-
"value": "Background"
|
|
511
|
-
}]
|
|
704
|
+
defaultMessage: "Background"
|
|
512
705
|
})
|
|
513
706
|
}, {
|
|
514
707
|
name: 'header',
|
|
515
708
|
type: 'header',
|
|
516
709
|
label: defineMessage({
|
|
517
710
|
id: "rhuDxI",
|
|
518
|
-
defaultMessage:
|
|
519
|
-
"type": 0,
|
|
520
|
-
"value": "Header"
|
|
521
|
-
}]
|
|
711
|
+
defaultMessage: "Header"
|
|
522
712
|
}),
|
|
523
713
|
theme: {
|
|
524
714
|
badge: {
|
|
@@ -533,10 +723,7 @@ var definition = [{
|
|
|
533
723
|
type: 'footer',
|
|
534
724
|
label: defineMessage({
|
|
535
725
|
id: "g4nybp",
|
|
536
|
-
defaultMessage:
|
|
537
|
-
"type": 0,
|
|
538
|
-
"value": "Footer"
|
|
539
|
-
}]
|
|
726
|
+
defaultMessage: "Footer"
|
|
540
727
|
}),
|
|
541
728
|
theme: {
|
|
542
729
|
callToAction: {
|
|
@@ -553,19 +740,13 @@ var definition = [{
|
|
|
553
740
|
group: {
|
|
554
741
|
label: defineMessage({
|
|
555
742
|
id: "6mX2ya",
|
|
556
|
-
defaultMessage:
|
|
557
|
-
"type": 0,
|
|
558
|
-
"value": "Images"
|
|
559
|
-
}]
|
|
743
|
+
defaultMessage: "Images"
|
|
560
744
|
}),
|
|
561
745
|
order: 4
|
|
562
746
|
},
|
|
563
747
|
title: defineMessage({
|
|
564
748
|
id: "MmJQ7o",
|
|
565
|
-
defaultMessage:
|
|
566
|
-
"type": 0,
|
|
567
|
-
"value": "Gallery with captions"
|
|
568
|
-
}]
|
|
749
|
+
defaultMessage: "Gallery with captions"
|
|
569
750
|
}),
|
|
570
751
|
component: GalleryCaptionsScreen,
|
|
571
752
|
layouts: [
|
|
@@ -586,10 +767,7 @@ var definition = [{
|
|
|
586
767
|
defaultValue: 'two-vertical-equal',
|
|
587
768
|
label: defineMessage({
|
|
588
769
|
id: "4iBXj2",
|
|
589
|
-
defaultMessage:
|
|
590
|
-
"type": 0,
|
|
591
|
-
"value": "Layout"
|
|
592
|
-
}]
|
|
770
|
+
defaultMessage: "Layout"
|
|
593
771
|
})
|
|
594
772
|
}, {
|
|
595
773
|
name: 'images',
|
|
@@ -601,40 +779,28 @@ var definition = [{
|
|
|
601
779
|
},
|
|
602
780
|
label: defineMessage({
|
|
603
781
|
id: "59f2bg",
|
|
604
|
-
defaultMessage:
|
|
605
|
-
"type": 0,
|
|
606
|
-
"value": "Images"
|
|
607
|
-
}]
|
|
782
|
+
defaultMessage: "Images"
|
|
608
783
|
})
|
|
609
784
|
}, {
|
|
610
785
|
name: 'imageCaptionStyle',
|
|
611
786
|
type: 'text-style-form',
|
|
612
787
|
label: defineMessage({
|
|
613
788
|
id: "Qz7nUz",
|
|
614
|
-
defaultMessage:
|
|
615
|
-
"type": 0,
|
|
616
|
-
"value": "Caption style"
|
|
617
|
-
}]
|
|
789
|
+
defaultMessage: "Caption style"
|
|
618
790
|
})
|
|
619
791
|
}, {
|
|
620
792
|
name: 'background',
|
|
621
793
|
type: 'background',
|
|
622
794
|
label: defineMessage({
|
|
623
795
|
id: "+MPZRu",
|
|
624
|
-
defaultMessage:
|
|
625
|
-
"type": 0,
|
|
626
|
-
"value": "Background"
|
|
627
|
-
}]
|
|
796
|
+
defaultMessage: "Background"
|
|
628
797
|
})
|
|
629
798
|
}, {
|
|
630
799
|
name: 'header',
|
|
631
800
|
type: 'header',
|
|
632
801
|
label: defineMessage({
|
|
633
802
|
id: "rhuDxI",
|
|
634
|
-
defaultMessage:
|
|
635
|
-
"type": 0,
|
|
636
|
-
"value": "Header"
|
|
637
|
-
}]
|
|
803
|
+
defaultMessage: "Header"
|
|
638
804
|
}),
|
|
639
805
|
theme: {
|
|
640
806
|
badge: {
|
|
@@ -649,10 +815,7 @@ var definition = [{
|
|
|
649
815
|
type: 'footer',
|
|
650
816
|
label: defineMessage({
|
|
651
817
|
id: "g4nybp",
|
|
652
|
-
defaultMessage:
|
|
653
|
-
"type": 0,
|
|
654
|
-
"value": "Footer"
|
|
655
|
-
}]
|
|
818
|
+
defaultMessage: "Footer"
|
|
656
819
|
}),
|
|
657
820
|
theme: {
|
|
658
821
|
callToAction: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-gallery",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.74",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
38
|
"types": "./es/index.d.ts",
|
|
39
|
+
"style": "./assets/css/styles.css",
|
|
39
40
|
"import": "./es/index.js"
|
|
40
41
|
},
|
|
41
42
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -52,25 +53,25 @@
|
|
|
52
53
|
"build": "../../scripts/prepare-package.sh --types"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"react": "^
|
|
56
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"react": "^
|
|
60
|
-
"react-dom": "^
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"@babel/runtime": "^7.28.6",
|
|
64
|
-
"@micromag/core": "^0.4.
|
|
65
|
-
"@micromag/element-background": "^0.4.
|
|
66
|
-
"@micromag/element-container": "^0.4.
|
|
67
|
-
"@micromag/element-footer": "^0.4.
|
|
68
|
-
"@micromag/element-grid": "^0.4.
|
|
69
|
-
"@micromag/element-header": "^0.4.
|
|
70
|
-
"@micromag/element-layout": "^0.4.
|
|
71
|
-
"@micromag/element-text": "^0.4.
|
|
72
|
-
"@micromag/element-visual": "^0.4.
|
|
73
|
-
"@micromag/transforms": "^0.4.
|
|
65
|
+
"@micromag/core": "^0.4.74",
|
|
66
|
+
"@micromag/element-background": "^0.4.74",
|
|
67
|
+
"@micromag/element-container": "^0.4.74",
|
|
68
|
+
"@micromag/element-footer": "^0.4.74",
|
|
69
|
+
"@micromag/element-grid": "^0.4.74",
|
|
70
|
+
"@micromag/element-header": "^0.4.74",
|
|
71
|
+
"@micromag/element-layout": "^0.4.74",
|
|
72
|
+
"@micromag/element-text": "^0.4.74",
|
|
73
|
+
"@micromag/element-visual": "^0.4.74",
|
|
74
|
+
"@micromag/transforms": "^0.4.74",
|
|
74
75
|
"classnames": "^2.2.6",
|
|
75
76
|
"lodash": "^4.17.23",
|
|
76
77
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -80,6 +81,6 @@
|
|
|
80
81
|
"access": "public",
|
|
81
82
|
"registry": "https://registry.npmjs.org/"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "fe510ee87845280d0760cb292aef9d2eb69e67c1",
|
|
84
85
|
"types": "es/index.d.ts"
|
|
85
86
|
}
|