@micromag/screen-gallery 0.4.71 → 0.4.76
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 +2 -2
- package/es/index.js +419 -258
- package/package.json +17 -16
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ForwardedRef } from 'react';
|
|
3
|
-
import { ImageMedia, ImageElement, TextStyle, BackgroundElement, Header, Footer } from '@micromag/core';
|
|
3
|
+
import { ImageMedia, ImageElement, TextStyle, BackgroundElement, Header, Footer, MediaElement } from '@micromag/core';
|
|
4
4
|
|
|
5
5
|
interface GalleryScreenProps {
|
|
6
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';
|
|
@@ -15,7 +15,7 @@ interface GalleryScreenProps {
|
|
|
15
15
|
current?: boolean;
|
|
16
16
|
active?: boolean;
|
|
17
17
|
preload?: boolean;
|
|
18
|
-
mediaRef?: ForwardedRef<
|
|
18
|
+
mediaRef?: ForwardedRef<MediaElement> | null;
|
|
19
19
|
className?: string | null;
|
|
20
20
|
}
|
|
21
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;
|
package/es/index.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
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';
|
|
@@ -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,238 +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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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;
|
|
259
267
|
return acc + (vertical ? rows : columns).length;
|
|
260
268
|
}, 0);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
|
270
352
|
});
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
var hasHeader = isHeaderFilled(header);
|
|
296
|
-
var hasFooter = isFooterFilled(footer);
|
|
297
|
-
var footerProps = getFooterProps(footer, {
|
|
298
|
-
isView: isView,
|
|
299
|
-
current: current,
|
|
300
|
-
openWebView: openWebView,
|
|
301
|
-
isPreview: isPreview
|
|
302
|
-
});
|
|
303
|
-
var _useDimensionObserver4 = useDimensionObserver(),
|
|
304
|
-
headerRef = _useDimensionObserver4.ref,
|
|
305
|
-
_useDimensionObserver5 = _useDimensionObserver4.height,
|
|
306
|
-
headerHeight = _useDimensionObserver5 === void 0 ? 0 : _useDimensionObserver5;
|
|
307
|
-
var _useDimensionObserver6 = useDimensionObserver(),
|
|
308
|
-
footerRef = _useDimensionObserver6.ref,
|
|
309
|
-
_useDimensionObserver7 = _useDimensionObserver6.height,
|
|
310
|
-
footerHeight = _useDimensionObserver7 === void 0 ? 0 : _useDimensionObserver7;
|
|
311
|
-
|
|
312
|
-
// items
|
|
313
|
-
var items = _toConsumableArray(Array(gridSpaces)).map(function (item, itemI) {
|
|
314
|
-
var image = images !== null ? images[itemI] : null;
|
|
315
|
-
var imageSize = imagesSizes[itemI] || {};
|
|
316
|
-
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 : {
|
|
317
377
|
media: image
|
|
318
378
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
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;
|
|
327
389
|
return /*#__PURE__*/jsxs("div", {
|
|
328
390
|
className: styles.gridItem,
|
|
329
391
|
children: [/*#__PURE__*/jsx("div", {
|
|
330
392
|
className: styles.imageContainer,
|
|
331
|
-
ref:
|
|
393
|
+
ref: el => {
|
|
332
394
|
imagesEl.current[itemI] = el;
|
|
333
395
|
},
|
|
334
396
|
children: /*#__PURE__*/jsx(ScreenElement, {
|
|
335
397
|
placeholder: "image",
|
|
336
398
|
placeholderProps: {
|
|
337
399
|
className: styles.placeholder,
|
|
338
|
-
height:
|
|
400
|
+
height: "100%"
|
|
339
401
|
},
|
|
340
402
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
341
403
|
id: "ebsPd4",
|
|
342
|
-
defaultMessage:
|
|
343
|
-
"type": 0,
|
|
344
|
-
"value": "Image"
|
|
345
|
-
}]
|
|
404
|
+
defaultMessage: "Image"
|
|
346
405
|
}),
|
|
347
406
|
emptyClassName: styles.emptyImage,
|
|
348
407
|
isEmpty: !hasImage,
|
|
349
|
-
children: active || current ? /*#__PURE__*/jsx(Visual,
|
|
350
|
-
className: styles.image
|
|
351
|
-
|
|
408
|
+
children: active || current ? /*#__PURE__*/jsx(Visual, {
|
|
409
|
+
className: styles.image,
|
|
410
|
+
...finalImage,
|
|
411
|
+
...imageSize,
|
|
352
412
|
loadingMode: "lazy",
|
|
353
413
|
resolution: resolution,
|
|
354
414
|
objectFit: {
|
|
355
|
-
fit:
|
|
415
|
+
fit: "cover"
|
|
356
416
|
},
|
|
357
417
|
playing: backgroundPlaying,
|
|
358
418
|
active: active,
|
|
359
419
|
shouldLoad: mediaShouldLoad,
|
|
360
420
|
withoutVideo: isPreview,
|
|
361
421
|
onLoaded: onImageLoaded
|
|
362
|
-
})
|
|
422
|
+
}) : null
|
|
363
423
|
})
|
|
364
424
|
}), withCaptions ? /*#__PURE__*/jsx(ScreenElement, {
|
|
365
425
|
placeholder: "line",
|
|
366
426
|
emptyLabel: /*#__PURE__*/jsx(FormattedMessage, {
|
|
367
427
|
id: "6tIigB",
|
|
368
|
-
defaultMessage:
|
|
369
|
-
"type": 0,
|
|
370
|
-
"value": "Caption"
|
|
371
|
-
}]
|
|
428
|
+
defaultMessage: "Caption"
|
|
372
429
|
}),
|
|
373
430
|
emptyClassName: styles.emptyCaption,
|
|
374
431
|
isEmpty: !hasCaption,
|
|
375
432
|
children: /*#__PURE__*/jsx("div", {
|
|
376
433
|
className: styles.caption,
|
|
377
|
-
children: /*#__PURE__*/jsx(Text,
|
|
434
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
435
|
+
...caption,
|
|
378
436
|
className: styles.captionText,
|
|
379
437
|
lineClamp: captionMaxLines,
|
|
380
|
-
textStyle:
|
|
381
|
-
|
|
438
|
+
textStyle: {
|
|
439
|
+
...(imageCaptionStyle || null),
|
|
440
|
+
...textStyle
|
|
441
|
+
}
|
|
442
|
+
})
|
|
382
443
|
})
|
|
383
444
|
}) : null]
|
|
384
|
-
},
|
|
445
|
+
}, `item-${itemI}`);
|
|
385
446
|
});
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
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, {
|
|
390
561
|
width: width,
|
|
391
562
|
height: height,
|
|
392
563
|
className: styles.content,
|
|
393
|
-
children:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
paddingLeft: spacing,
|
|
406
|
-
paddingRight: spacing,
|
|
407
|
-
transform: !isPreview ? "translate(0, ".concat(viewerTopHeight, "px)") : null
|
|
408
|
-
},
|
|
409
|
-
children: /*#__PURE__*/jsx(Header, _objectSpread({}, header))
|
|
410
|
-
}) : null, /*#__PURE__*/jsx(Grid, _objectSpread({
|
|
411
|
-
className: styles.grid,
|
|
412
|
-
spacing: finalSpacing,
|
|
413
|
-
items: items
|
|
414
|
-
}, grid)), !isPlaceholder && hasFooter ? /*#__PURE__*/jsx("div", {
|
|
415
|
-
className: styles.footer,
|
|
416
|
-
ref: footerRef,
|
|
417
|
-
style: {
|
|
418
|
-
paddingLeft: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
419
|
-
paddingRight: Math.max(finalSpacing / 2, viewerBottomSidesWidth),
|
|
420
|
-
// paddingTop: finalSpacing / 2,
|
|
421
|
-
paddingBottom: finalSpacing / 2,
|
|
422
|
-
transform: !isPreview ? "translate(0, -".concat(viewerBottomHeight, "px)") : null
|
|
423
|
-
},
|
|
424
|
-
children: /*#__PURE__*/jsx(Footer, _objectSpread({}, footerProps))
|
|
425
|
-
}) : null]
|
|
426
|
-
})
|
|
427
|
-
}), !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, {
|
|
428
576
|
background: background,
|
|
429
577
|
width: width,
|
|
430
578
|
height: height,
|
|
@@ -435,15 +583,73 @@ function GalleryScreen(_ref) {
|
|
|
435
583
|
mediaRef: mergeRefs(mediaRef, customMediaRef),
|
|
436
584
|
withoutVideo: isPreview,
|
|
437
585
|
className: styles.background
|
|
438
|
-
}) : null
|
|
439
|
-
|
|
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;
|
|
440
627
|
}
|
|
441
628
|
|
|
442
|
-
function GalleryCaptionsScreen(
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
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;
|
|
447
653
|
}
|
|
448
654
|
|
|
449
655
|
// import * as transforms from './transforms/index';
|
|
@@ -454,19 +660,13 @@ var definition = [{
|
|
|
454
660
|
group: {
|
|
455
661
|
label: defineMessage({
|
|
456
662
|
id: "6mX2ya",
|
|
457
|
-
defaultMessage:
|
|
458
|
-
"type": 0,
|
|
459
|
-
"value": "Images"
|
|
460
|
-
}]
|
|
663
|
+
defaultMessage: "Images"
|
|
461
664
|
}),
|
|
462
665
|
order: 4
|
|
463
666
|
},
|
|
464
667
|
title: defineMessage({
|
|
465
668
|
id: "jaFXki",
|
|
466
|
-
defaultMessage:
|
|
467
|
-
"type": 0,
|
|
468
|
-
"value": "Gallery"
|
|
469
|
-
}]
|
|
669
|
+
defaultMessage: "Gallery"
|
|
470
670
|
}),
|
|
471
671
|
component: GalleryScreen,
|
|
472
672
|
layouts: [
|
|
@@ -487,40 +687,28 @@ var definition = [{
|
|
|
487
687
|
defaultValue: 'two-vertical-equal',
|
|
488
688
|
label: defineMessage({
|
|
489
689
|
id: "4iBXj2",
|
|
490
|
-
defaultMessage:
|
|
491
|
-
"type": 0,
|
|
492
|
-
"value": "Layout"
|
|
493
|
-
}]
|
|
690
|
+
defaultMessage: "Layout"
|
|
494
691
|
})
|
|
495
692
|
}, {
|
|
496
693
|
name: 'images',
|
|
497
694
|
type: 'visuals',
|
|
498
695
|
label: defineMessage({
|
|
499
696
|
id: "muYwrB",
|
|
500
|
-
defaultMessage:
|
|
501
|
-
"type": 0,
|
|
502
|
-
"value": "Images"
|
|
503
|
-
}]
|
|
697
|
+
defaultMessage: "Images"
|
|
504
698
|
})
|
|
505
699
|
}, {
|
|
506
700
|
name: 'background',
|
|
507
701
|
type: 'background',
|
|
508
702
|
label: defineMessage({
|
|
509
703
|
id: "+MPZRu",
|
|
510
|
-
defaultMessage:
|
|
511
|
-
"type": 0,
|
|
512
|
-
"value": "Background"
|
|
513
|
-
}]
|
|
704
|
+
defaultMessage: "Background"
|
|
514
705
|
})
|
|
515
706
|
}, {
|
|
516
707
|
name: 'header',
|
|
517
708
|
type: 'header',
|
|
518
709
|
label: defineMessage({
|
|
519
710
|
id: "rhuDxI",
|
|
520
|
-
defaultMessage:
|
|
521
|
-
"type": 0,
|
|
522
|
-
"value": "Header"
|
|
523
|
-
}]
|
|
711
|
+
defaultMessage: "Header"
|
|
524
712
|
}),
|
|
525
713
|
theme: {
|
|
526
714
|
badge: {
|
|
@@ -535,10 +723,7 @@ var definition = [{
|
|
|
535
723
|
type: 'footer',
|
|
536
724
|
label: defineMessage({
|
|
537
725
|
id: "g4nybp",
|
|
538
|
-
defaultMessage:
|
|
539
|
-
"type": 0,
|
|
540
|
-
"value": "Footer"
|
|
541
|
-
}]
|
|
726
|
+
defaultMessage: "Footer"
|
|
542
727
|
}),
|
|
543
728
|
theme: {
|
|
544
729
|
callToAction: {
|
|
@@ -555,19 +740,13 @@ var definition = [{
|
|
|
555
740
|
group: {
|
|
556
741
|
label: defineMessage({
|
|
557
742
|
id: "6mX2ya",
|
|
558
|
-
defaultMessage:
|
|
559
|
-
"type": 0,
|
|
560
|
-
"value": "Images"
|
|
561
|
-
}]
|
|
743
|
+
defaultMessage: "Images"
|
|
562
744
|
}),
|
|
563
745
|
order: 4
|
|
564
746
|
},
|
|
565
747
|
title: defineMessage({
|
|
566
748
|
id: "MmJQ7o",
|
|
567
|
-
defaultMessage:
|
|
568
|
-
"type": 0,
|
|
569
|
-
"value": "Gallery with captions"
|
|
570
|
-
}]
|
|
749
|
+
defaultMessage: "Gallery with captions"
|
|
571
750
|
}),
|
|
572
751
|
component: GalleryCaptionsScreen,
|
|
573
752
|
layouts: [
|
|
@@ -588,10 +767,7 @@ var definition = [{
|
|
|
588
767
|
defaultValue: 'two-vertical-equal',
|
|
589
768
|
label: defineMessage({
|
|
590
769
|
id: "4iBXj2",
|
|
591
|
-
defaultMessage:
|
|
592
|
-
"type": 0,
|
|
593
|
-
"value": "Layout"
|
|
594
|
-
}]
|
|
770
|
+
defaultMessage: "Layout"
|
|
595
771
|
})
|
|
596
772
|
}, {
|
|
597
773
|
name: 'images',
|
|
@@ -603,40 +779,28 @@ var definition = [{
|
|
|
603
779
|
},
|
|
604
780
|
label: defineMessage({
|
|
605
781
|
id: "59f2bg",
|
|
606
|
-
defaultMessage:
|
|
607
|
-
"type": 0,
|
|
608
|
-
"value": "Images"
|
|
609
|
-
}]
|
|
782
|
+
defaultMessage: "Images"
|
|
610
783
|
})
|
|
611
784
|
}, {
|
|
612
785
|
name: 'imageCaptionStyle',
|
|
613
786
|
type: 'text-style-form',
|
|
614
787
|
label: defineMessage({
|
|
615
788
|
id: "Qz7nUz",
|
|
616
|
-
defaultMessage:
|
|
617
|
-
"type": 0,
|
|
618
|
-
"value": "Caption style"
|
|
619
|
-
}]
|
|
789
|
+
defaultMessage: "Caption style"
|
|
620
790
|
})
|
|
621
791
|
}, {
|
|
622
792
|
name: 'background',
|
|
623
793
|
type: 'background',
|
|
624
794
|
label: defineMessage({
|
|
625
795
|
id: "+MPZRu",
|
|
626
|
-
defaultMessage:
|
|
627
|
-
"type": 0,
|
|
628
|
-
"value": "Background"
|
|
629
|
-
}]
|
|
796
|
+
defaultMessage: "Background"
|
|
630
797
|
})
|
|
631
798
|
}, {
|
|
632
799
|
name: 'header',
|
|
633
800
|
type: 'header',
|
|
634
801
|
label: defineMessage({
|
|
635
802
|
id: "rhuDxI",
|
|
636
|
-
defaultMessage:
|
|
637
|
-
"type": 0,
|
|
638
|
-
"value": "Header"
|
|
639
|
-
}]
|
|
803
|
+
defaultMessage: "Header"
|
|
640
804
|
}),
|
|
641
805
|
theme: {
|
|
642
806
|
badge: {
|
|
@@ -651,10 +815,7 @@ var definition = [{
|
|
|
651
815
|
type: 'footer',
|
|
652
816
|
label: defineMessage({
|
|
653
817
|
id: "g4nybp",
|
|
654
|
-
defaultMessage:
|
|
655
|
-
"type": 0,
|
|
656
|
-
"value": "Footer"
|
|
657
|
-
}]
|
|
818
|
+
defaultMessage: "Footer"
|
|
658
819
|
}),
|
|
659
820
|
theme: {
|
|
660
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.76",
|
|
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.76",
|
|
67
|
+
"@micromag/element-container": "^0.4.74",
|
|
68
|
+
"@micromag/element-footer": "^0.4.76",
|
|
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.76",
|
|
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": "42a24f578994b23090271013f136b7f78956b632",
|
|
84
85
|
"types": "es/index.d.ts"
|
|
85
86
|
}
|