@telefonica/mistica 13.2.3 → 13.4.0
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/css/mistica.css +1 -1
- package/dist/card.js +14 -13
- package/dist/carousel.css-mistica.js +3 -3
- package/dist/carousel.css.d.ts +0 -1
- package/dist/carousel.d.ts +5 -0
- package/dist/carousel.js +218 -207
- package/dist/header.d.ts +5 -1
- package/dist/header.js +22 -22
- package/dist/hero.css-mistica.js +24 -0
- package/dist/hero.css.d.ts +8 -0
- package/dist/hero.css.ts.vanilla.js +9 -0
- package/dist/hero.d.ts +23 -0
- package/dist/hero.js +296 -0
- package/dist/image.d.ts +3 -2
- package/dist/image.js +13 -13
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/package-version.js +1 -1
- package/dist/responsive-layout.css.d.ts +4 -0
- package/dist/search-field.d.ts +1 -1
- package/dist/search-field.js +22 -21
- package/dist/video.js +13 -13
- package/dist-es/card.js +20 -19
- package/dist-es/carousel.css-mistica.js +2 -2
- package/dist-es/carousel.js +256 -247
- package/dist-es/header.js +33 -33
- package/dist-es/hero.css-mistica.js +7 -0
- package/dist-es/hero.css.ts.vanilla.js +2 -0
- package/dist-es/hero.js +245 -0
- package/dist-es/image.js +26 -26
- package/dist-es/index.js +1700 -1699
- package/dist-es/package-version.js +1 -1
- package/dist-es/search-field.js +33 -32
- package/dist-es/style.css +1 -1
- package/dist-es/video.js +14 -14
- package/package.json +1 -1
package/dist/carousel.js
CHANGED
|
@@ -9,10 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Carousel: ()=>
|
|
13
|
-
CenteredCarousel: ()=>
|
|
12
|
+
Carousel: ()=>ut,
|
|
13
|
+
CenteredCarousel: ()=>dt,
|
|
14
|
+
IsInsideSlideshowProvider: ()=>Ge,
|
|
14
15
|
PageBullets: ()=>re,
|
|
15
|
-
Slideshow: ()=>
|
|
16
|
+
Slideshow: ()=>ht,
|
|
17
|
+
useIsInsideSlideshowContext: ()=>ft
|
|
16
18
|
});
|
|
17
19
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
18
20
|
const _iconChevronLeftRegularJs = /*#__PURE__*/ _interopRequireDefault(require("./generated/mistica-icons/icon-chevron-left-regular.js"));
|
|
@@ -133,19 +135,19 @@ const oe = (e, r)=>{
|
|
|
133
135
|
return (0, _hooksJs.useIsInViewport)(r, !1) && t && !!e;
|
|
134
136
|
}, re = (param)=>{
|
|
135
137
|
let { currentIndex: e , numPages: r , onPress: t } = param;
|
|
136
|
-
const
|
|
137
|
-
const
|
|
138
|
-
return
|
|
138
|
+
const o = (0, _themeVariantContextJs.useIsInverseVariant)(), { isDesktopOrBigger: u } = (0, _hooksJs.useScreenSize)(), I = (P)=>{
|
|
139
|
+
const d = P === e;
|
|
140
|
+
return o ? d ? _carouselCssMisticaJs.bulletActiveInverse : _carouselCssMisticaJs.bulletInverse : d ? _carouselCssMisticaJs.bulletActive : _carouselCssMisticaJs.bullet;
|
|
139
141
|
};
|
|
140
142
|
return /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_inlineJs.default, {
|
|
141
|
-
space:
|
|
143
|
+
space: u ? 16 : 8,
|
|
142
144
|
alignItems: "center",
|
|
143
145
|
dataAttributes: {
|
|
144
146
|
"component-name": "PageBullets"
|
|
145
147
|
},
|
|
146
148
|
children: Array.from({
|
|
147
149
|
length: r
|
|
148
|
-
}, (
|
|
150
|
+
}, (P, d)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
|
|
149
151
|
className: (0, _sprinklesCssMisticaJs.sprinkles)({
|
|
150
152
|
display: "block",
|
|
151
153
|
padding: 0,
|
|
@@ -153,13 +155,13 @@ const oe = (e, r)=>{
|
|
|
153
155
|
background: "transparent"
|
|
154
156
|
}),
|
|
155
157
|
maybe: !0,
|
|
156
|
-
onPress:
|
|
158
|
+
onPress: u && t ? ()=>t(d) : void 0,
|
|
157
159
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
158
|
-
className:
|
|
160
|
+
className: I(d)
|
|
159
161
|
})
|
|
160
|
-
},
|
|
162
|
+
}, d))
|
|
161
163
|
});
|
|
162
|
-
}, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e],
|
|
164
|
+
}, K = (e, r, t)=>t ? typeof t == "number" ? t : t[e] || r[e] : r[e], qe = (e, r)=>{
|
|
163
165
|
const t = {
|
|
164
166
|
mobile: 1,
|
|
165
167
|
tablet: 2,
|
|
@@ -177,157 +179,157 @@ const oe = (e, r)=>{
|
|
|
177
179
|
tablet: r,
|
|
178
180
|
desktop: r
|
|
179
181
|
};
|
|
180
|
-
const
|
|
182
|
+
const o = K(e, t.desktop, r.desktop);
|
|
181
183
|
return _objectSpreadProps(_objectSpread({}, t, r), {
|
|
182
|
-
desktop:
|
|
184
|
+
desktop: o
|
|
183
185
|
});
|
|
184
186
|
}, Q = (e, r)=>{
|
|
185
187
|
if (e.length === 0) return [];
|
|
186
|
-
const t = Math.ceil(e.length / r),
|
|
187
|
-
for(let
|
|
188
|
-
return
|
|
189
|
-
},
|
|
188
|
+
const t = Math.ceil(e.length / r), o = [];
|
|
189
|
+
for(let u = 0; u < e.length; u += t)o.push(e[u]);
|
|
190
|
+
return o[o.length - 1] = e[e.length - t], o;
|
|
191
|
+
}, Ye = (e, r)=>{
|
|
190
192
|
const t = [];
|
|
191
|
-
for(let
|
|
192
|
-
for(let
|
|
193
|
+
for(let o = 0; o < r.length; o++)o === 0 ? t.push(r[0]) : t.push((r[o] + r[o - 1]) / 2);
|
|
194
|
+
for(let o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
|
|
193
195
|
return 0;
|
|
194
196
|
}, le = 5e3, ne = (param)=>{
|
|
195
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets:
|
|
196
|
-
const { texts:
|
|
197
|
+
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , itemsPerPage: P , itemsToScroll: d , gap: f , free: B , centered: w , autoplay: x , onPageChange: S , dataAttributes: k } = param;
|
|
198
|
+
const { texts: E , platformOverrides: F } = (0, _hooksJs.useTheme)(), L = (0, _desktopContainerTypeContextJs.useDesktopContainerType)(), m = qe(L || "large", P), { isDesktopOrBigger: n , isMobile: g } = (0, _hooksJs.useScreenSize)(), C = g ? m.mobile : m.tablet, p = Math.max(Math.floor(n ? m.desktop : C), 1), v = _react.useRef(null), b = Math.ceil(e.length / p), [{ scrollLeft: y , scrollRight: U }, ie] = _react.useState({
|
|
197
199
|
scrollLeft: 0,
|
|
198
200
|
scrollRight: 0
|
|
199
|
-
}), [
|
|
200
|
-
|
|
201
|
+
}), [q, ae] = _react.useState([]), T = _react.useMemo(()=>Q(q, b), [
|
|
202
|
+
q,
|
|
201
203
|
b
|
|
202
|
-
]),
|
|
204
|
+
]), W = d ? Q(q, Math.ceil(e.length / d)) : T, ue = U !== 0, de = y !== 0;
|
|
203
205
|
(0, _hooksJs.useIsomorphicLayoutEffect)(()=>{
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
206
|
-
const { scrollWidth:
|
|
207
|
-
|
|
208
|
-
scrollLeft:
|
|
209
|
-
scrollRight:
|
|
206
|
+
if (v.current) {
|
|
207
|
+
const l = v.current, i = ()=>{
|
|
208
|
+
const { scrollWidth: O , clientWidth: A } = l, z = Math.round(l.scrollLeft), j = Math.round(O - (z + A));
|
|
209
|
+
ie({
|
|
210
|
+
scrollLeft: z,
|
|
211
|
+
scrollRight: j
|
|
210
212
|
});
|
|
211
|
-
},
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
return Math.min(
|
|
213
|
+
}, a = ()=>{
|
|
214
|
+
const O = l.scrollWidth - l.clientWidth;
|
|
215
|
+
ae(Array.from(l.querySelectorAll("[data-item]")).map((A, z)=>{
|
|
216
|
+
if (z === e.length - 1) return O;
|
|
217
|
+
const j = A.offsetLeft, he = parseInt(getComputedStyle(A).scrollMargin), me = w && !n ? j - A.clientWidth / 2 : j;
|
|
218
|
+
return Math.min(me - he - l.offsetLeft, O);
|
|
217
219
|
}));
|
|
218
220
|
};
|
|
219
|
-
i(),
|
|
220
|
-
const
|
|
221
|
-
i(),
|
|
221
|
+
i(), a(), l.addEventListener("scroll", i);
|
|
222
|
+
const h = (0, _domJs.listenResize)(l, ()=>{
|
|
223
|
+
i(), a();
|
|
222
224
|
});
|
|
223
225
|
return ()=>{
|
|
224
|
-
|
|
226
|
+
l.removeEventListener("scroll", i), h();
|
|
225
227
|
};
|
|
226
228
|
}
|
|
227
229
|
return ()=>{};
|
|
228
230
|
}, [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
m.desktop,
|
|
232
|
+
m.tablet,
|
|
233
|
+
m.mobile,
|
|
232
234
|
b,
|
|
235
|
+
f,
|
|
233
236
|
w,
|
|
234
|
-
|
|
235
|
-
h,
|
|
237
|
+
n,
|
|
236
238
|
e.length
|
|
237
239
|
]);
|
|
238
|
-
const
|
|
240
|
+
const D = _react.useCallback(function(l) {
|
|
239
241
|
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
left:
|
|
242
|
+
const a = v.current;
|
|
243
|
+
if (a) {
|
|
244
|
+
const h = T[l];
|
|
245
|
+
a.scrollTo({
|
|
246
|
+
left: h,
|
|
245
247
|
behavior: i ? "smooth" : "auto"
|
|
246
248
|
});
|
|
247
249
|
}
|
|
248
250
|
}, [
|
|
249
|
-
|
|
251
|
+
T
|
|
250
252
|
]), fe = _react.useCallback(()=>{
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
253
|
-
const { scrollLeft: i } =
|
|
254
|
-
...
|
|
255
|
-
].reverse().find((
|
|
256
|
-
|
|
257
|
-
left:
|
|
253
|
+
const l = v.current;
|
|
254
|
+
if (l) {
|
|
255
|
+
const { scrollLeft: i } = l, a = [
|
|
256
|
+
...W
|
|
257
|
+
].reverse().find((h)=>h - i < -1);
|
|
258
|
+
l.scrollTo({
|
|
259
|
+
left: a,
|
|
258
260
|
behavior: "smooth"
|
|
259
261
|
});
|
|
260
262
|
}
|
|
261
263
|
}, [
|
|
262
|
-
|
|
263
|
-
]),
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
const { scrollLeft: i } =
|
|
267
|
-
|
|
268
|
-
left:
|
|
264
|
+
W
|
|
265
|
+
]), Y = _react.useCallback(()=>{
|
|
266
|
+
const l = v.current;
|
|
267
|
+
if (l) {
|
|
268
|
+
const { scrollLeft: i } = l, a = W.find((h)=>h - i > 1);
|
|
269
|
+
l.scrollTo({
|
|
270
|
+
left: a,
|
|
269
271
|
behavior: "smooth"
|
|
270
272
|
});
|
|
271
273
|
}
|
|
272
274
|
}, [
|
|
273
|
-
|
|
274
|
-
]), H = oe(!!
|
|
275
|
+
W
|
|
276
|
+
]), H = oe(!!x, v);
|
|
275
277
|
_react.useEffect(()=>{
|
|
276
|
-
|
|
278
|
+
I !== void 0 && D(Math.floor(I / p), !1);
|
|
277
279
|
}, [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
I,
|
|
281
|
+
D,
|
|
282
|
+
p
|
|
281
283
|
]), _react.useEffect(()=>{
|
|
282
|
-
if (H &&
|
|
283
|
-
const
|
|
284
|
-
var
|
|
285
|
-
|
|
284
|
+
if (H && x) {
|
|
285
|
+
const l = typeof x == "boolean" ? le : x.time, i = typeof x == "object" && x.loop, a = setInterval(()=>{
|
|
286
|
+
var h;
|
|
287
|
+
U !== 0 ? Y() : i && ((h = v.current) == null || h.scrollTo({
|
|
286
288
|
left: 0,
|
|
287
289
|
behavior: "smooth"
|
|
288
290
|
}));
|
|
289
|
-
},
|
|
290
|
-
return ()=>clearInterval(
|
|
291
|
+
}, l);
|
|
292
|
+
return ()=>clearInterval(a);
|
|
291
293
|
}
|
|
292
294
|
}, [
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
295
|
+
x,
|
|
296
|
+
Y,
|
|
297
|
+
U,
|
|
296
298
|
H
|
|
297
299
|
]);
|
|
298
|
-
const
|
|
300
|
+
const N = Ye(y, T);
|
|
299
301
|
_react.useEffect(()=>{
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
for(let
|
|
303
|
-
const
|
|
304
|
-
|
|
302
|
+
if (S) {
|
|
303
|
+
const l = Math.min((N + 1) * p - 1, e.length - 1), i = [];
|
|
304
|
+
for(let a = 0; a < p; a++){
|
|
305
|
+
const h = l - a;
|
|
306
|
+
h >= 0 && i.unshift(h);
|
|
305
307
|
}
|
|
306
|
-
|
|
307
|
-
pageIndex:
|
|
308
|
+
S({
|
|
309
|
+
pageIndex: N,
|
|
308
310
|
shownItemIndexes: i
|
|
309
311
|
});
|
|
310
312
|
}
|
|
311
313
|
}, [
|
|
312
|
-
|
|
314
|
+
N,
|
|
313
315
|
e.length,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
+
p,
|
|
317
|
+
S
|
|
316
318
|
]);
|
|
317
|
-
let
|
|
318
|
-
return
|
|
319
|
+
let V = null;
|
|
320
|
+
return u ? V = u({
|
|
319
321
|
numPages: b,
|
|
320
|
-
currentIndex:
|
|
321
|
-
onPress:
|
|
322
|
-
}) :
|
|
322
|
+
currentIndex: N,
|
|
323
|
+
onPress: D
|
|
324
|
+
}) : o && (V = b > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
|
|
323
325
|
numPages: b,
|
|
324
|
-
currentIndex:
|
|
325
|
-
onPress:
|
|
326
|
+
currentIndex: N,
|
|
327
|
+
onPress: D
|
|
326
328
|
})), /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)(_stackJs.default, {
|
|
327
329
|
space: 24,
|
|
328
330
|
dataAttributes: _objectSpread({
|
|
329
331
|
"component-name": "Carousel"
|
|
330
|
-
},
|
|
332
|
+
}, k),
|
|
331
333
|
children: [
|
|
332
334
|
/* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", {
|
|
333
335
|
className: _carouselCssMisticaJs.carouselContainer,
|
|
@@ -336,56 +338,56 @@ const oe = (e, r)=>{
|
|
|
336
338
|
isInverse: !1,
|
|
337
339
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
|
|
338
340
|
className: _carouselCssMisticaJs.carouselPrevArrowButton,
|
|
339
|
-
"aria-label":
|
|
341
|
+
"aria-label": E.carouselPrevButton,
|
|
340
342
|
onPress: fe,
|
|
341
|
-
disabled: !
|
|
343
|
+
disabled: !de,
|
|
342
344
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
|
|
343
345
|
})
|
|
344
346
|
}),
|
|
345
347
|
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
346
348
|
className: (0, _classnames.default)(_carouselCssMisticaJs.carousel, {
|
|
347
|
-
[_carouselCssMisticaJs.centeredCarousel]:
|
|
349
|
+
[_carouselCssMisticaJs.centeredCarousel]: w,
|
|
348
350
|
[_carouselCssMisticaJs.carouselWithScroll]: b > 1
|
|
349
351
|
}),
|
|
350
352
|
style: _objectSpreadProps(_objectSpread({}, (0, _dynamic.assignInlineVars)(_objectSpread({
|
|
351
|
-
[_carouselCssMisticaJs.vars.itemsPerPageDesktop]: String(
|
|
352
|
-
[_carouselCssMisticaJs.vars.itemsPerPageTablet]: String(
|
|
353
|
-
[_carouselCssMisticaJs.vars.itemsPerPageMobile]: String(
|
|
354
|
-
},
|
|
355
|
-
[_carouselCssMisticaJs.vars.gap]: String(
|
|
353
|
+
[_carouselCssMisticaJs.vars.itemsPerPageDesktop]: String(m.desktop),
|
|
354
|
+
[_carouselCssMisticaJs.vars.itemsPerPageTablet]: String(m.tablet),
|
|
355
|
+
[_carouselCssMisticaJs.vars.itemsPerPageMobile]: String(m.mobile)
|
|
356
|
+
}, f !== void 0 ? {
|
|
357
|
+
[_carouselCssMisticaJs.vars.gap]: String(f)
|
|
356
358
|
} : {}))), {
|
|
357
|
-
scrollSnapType:
|
|
359
|
+
scrollSnapType: B ? "initial" : "x mandatory"
|
|
358
360
|
}),
|
|
359
|
-
ref:
|
|
360
|
-
children: e.map((
|
|
361
|
+
ref: v,
|
|
362
|
+
children: e.map((l, i)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
361
363
|
className: (0, _classnames.default)(_carouselCssMisticaJs.carouselItem, t),
|
|
362
364
|
style: _objectSpreadProps(_objectSpread({}, r), {
|
|
363
|
-
scrollSnapStop: (0, _platformJs.isAndroid)(
|
|
365
|
+
scrollSnapStop: (0, _platformJs.isAndroid)(F) ? "always" : "normal"
|
|
364
366
|
}),
|
|
365
367
|
"data-item": !0,
|
|
366
|
-
children:
|
|
368
|
+
children: l
|
|
367
369
|
}, i))
|
|
368
370
|
}),
|
|
369
371
|
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
|
|
370
372
|
isInverse: !1,
|
|
371
373
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
|
|
372
374
|
className: _carouselCssMisticaJs.carouselNextArrowButton,
|
|
373
|
-
"aria-label":
|
|
374
|
-
onPress:
|
|
375
|
-
disabled: !
|
|
375
|
+
"aria-label": E.carouselNextButton,
|
|
376
|
+
onPress: Y,
|
|
377
|
+
disabled: !ue,
|
|
376
378
|
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
|
|
377
379
|
})
|
|
378
380
|
})
|
|
379
381
|
]
|
|
380
382
|
}),
|
|
381
|
-
|
|
383
|
+
V && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
382
384
|
className: _carouselCssMisticaJs.carouselBullets,
|
|
383
|
-
children:
|
|
385
|
+
children: V
|
|
384
386
|
})
|
|
385
387
|
]
|
|
386
388
|
});
|
|
387
|
-
},
|
|
388
|
-
let { items: e , itemStyle: r , itemClassName: t , withBullets:
|
|
389
|
+
}, ut = (e)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(ne, _objectSpread({}, e)), dt = (param)=>/* @__PURE__ */ {
|
|
390
|
+
let { items: e , itemStyle: r , itemClassName: t , withBullets: o , renderBullets: u , initialActiveItem: I , onPageChange: P , dataAttributes: d } = param;
|
|
389
391
|
return (0, _jsxRuntimeJs.jsx)(ne, {
|
|
390
392
|
items: e,
|
|
391
393
|
itemStyle: r,
|
|
@@ -398,118 +400,127 @@ const oe = (e, r)=>{
|
|
|
398
400
|
centered: !0,
|
|
399
401
|
itemsToScroll: 1,
|
|
400
402
|
gap: 0,
|
|
401
|
-
withBullets:
|
|
402
|
-
renderBullets:
|
|
403
|
-
initialActiveItem:
|
|
404
|
-
onPageChange:
|
|
405
|
-
dataAttributes:
|
|
403
|
+
withBullets: o,
|
|
404
|
+
renderBullets: u,
|
|
405
|
+
initialActiveItem: I,
|
|
406
|
+
onPageChange: P,
|
|
407
|
+
dataAttributes: d
|
|
408
|
+
});
|
|
409
|
+
}, ce = /*#__PURE__*/ _react.createContext(!1), ft = ()=>_react.useContext(ce), Ge = (param)=>/* @__PURE__ */ {
|
|
410
|
+
let { children: e } = param;
|
|
411
|
+
return (0, _jsxRuntimeJs.jsx)(ce.Provider, {
|
|
412
|
+
value: !0,
|
|
413
|
+
children: e
|
|
406
414
|
});
|
|
407
|
-
},
|
|
408
|
-
let { items: e , withBullets: r , autoplay: t , onPageChange:
|
|
409
|
-
const { texts:
|
|
415
|
+
}, ht = (param)=>{
|
|
416
|
+
let { items: e , withBullets: r , autoplay: t , onPageChange: o , dataAttributes: u , inverseBullets: I = !0 } = param;
|
|
417
|
+
const { texts: P , platformOverrides: d } = (0, _hooksJs.useTheme)(), f = _react.useRef(null), [{ scrollLeft: B , scrollRight: w }, x] = _react.useState({
|
|
410
418
|
scrollLeft: 0,
|
|
411
419
|
scrollRight: 0
|
|
412
|
-
}),
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
left: -
|
|
420
|
+
}), S = _react.useCallback(()=>{
|
|
421
|
+
const n = f.current;
|
|
422
|
+
n && n.scrollBy({
|
|
423
|
+
left: -n.clientWidth,
|
|
416
424
|
behavior: "smooth"
|
|
417
425
|
});
|
|
418
|
-
}, []),
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
left:
|
|
426
|
+
}, []), k = _react.useCallback(()=>{
|
|
427
|
+
const n = f.current;
|
|
428
|
+
n && n.scrollBy({
|
|
429
|
+
left: n.clientWidth,
|
|
422
430
|
behavior: "smooth"
|
|
423
431
|
});
|
|
424
|
-
}, []),
|
|
432
|
+
}, []), E = w !== 0, F = B !== 0, L = f.current ? Math.floor((B + f.current.clientWidth / 2) / f.current.clientWidth) : 0;
|
|
425
433
|
_react.useLayoutEffect(()=>{
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
const { scrollWidth:
|
|
430
|
-
|
|
431
|
-
scrollLeft:
|
|
432
|
-
scrollRight:
|
|
434
|
+
const n = f.current;
|
|
435
|
+
if (n) {
|
|
436
|
+
const g = ()=>{
|
|
437
|
+
const { scrollWidth: p , clientWidth: v } = n, b = Math.round(n.scrollLeft), y = Math.round(p - (b + v));
|
|
438
|
+
x({
|
|
439
|
+
scrollLeft: b,
|
|
440
|
+
scrollRight: y
|
|
433
441
|
});
|
|
434
442
|
};
|
|
435
|
-
|
|
436
|
-
const
|
|
443
|
+
g(), n.addEventListener("scroll", g);
|
|
444
|
+
const C = (0, _domJs.listenResize)(n, g);
|
|
437
445
|
return ()=>{
|
|
438
|
-
|
|
446
|
+
n.removeEventListener("scroll", g), C();
|
|
439
447
|
};
|
|
440
448
|
}
|
|
441
449
|
}, [
|
|
442
450
|
e.length
|
|
443
451
|
]);
|
|
444
|
-
const
|
|
452
|
+
const m = oe(!!t, f);
|
|
445
453
|
return _react.useEffect(()=>{
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
var
|
|
449
|
-
|
|
454
|
+
if (m && t) {
|
|
455
|
+
const n = typeof t == "boolean" ? le : t.time, g = typeof t == "object" && t.loop, C = setInterval(()=>{
|
|
456
|
+
var p;
|
|
457
|
+
w !== 0 ? k() : g && ((p = f.current) == null || p.scrollTo({
|
|
450
458
|
left: 0,
|
|
451
459
|
behavior: "smooth"
|
|
452
460
|
}));
|
|
453
|
-
},
|
|
454
|
-
return ()=>clearInterval(
|
|
461
|
+
}, n);
|
|
462
|
+
return ()=>clearInterval(C);
|
|
455
463
|
}
|
|
456
464
|
}, [
|
|
457
465
|
t,
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
466
|
+
k,
|
|
467
|
+
w,
|
|
468
|
+
m
|
|
461
469
|
]), _react.useEffect(()=>{
|
|
462
|
-
|
|
470
|
+
o && o(L);
|
|
463
471
|
}, [
|
|
464
472
|
L,
|
|
465
|
-
|
|
466
|
-
]), /* @__PURE__ */ (0, _jsxRuntimeJs.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(
|
|
508
|
-
|
|
509
|
-
|
|
473
|
+
o
|
|
474
|
+
]), /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(Ge, {
|
|
475
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsxs)("div", _objectSpreadProps(_objectSpread({
|
|
476
|
+
className: _carouselCssMisticaJs.slideshowContainer
|
|
477
|
+
}, (0, _domJs.getPrefixedDataAttributes)(u, "SlideShow")), {
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
|
|
480
|
+
isInverse: !1,
|
|
481
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
|
|
482
|
+
className: _carouselCssMisticaJs.slideshowPrevArrowButton,
|
|
483
|
+
"aria-label": P.carouselPrevButton,
|
|
484
|
+
onPress: S,
|
|
485
|
+
disabled: !F,
|
|
486
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronLeftRegularJs.default, {})
|
|
487
|
+
})
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_imageJs.MediaBorderRadiusProvider, {
|
|
490
|
+
value: !1,
|
|
491
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
492
|
+
className: _carouselCssMisticaJs.slideshow,
|
|
493
|
+
ref: f,
|
|
494
|
+
children: e.map((n, g)=>/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
495
|
+
className: _carouselCssMisticaJs.slideshowItem,
|
|
496
|
+
style: {
|
|
497
|
+
scrollSnapStop: (0, _platformJs.isAndroid)(d) ? "always" : "normal"
|
|
498
|
+
},
|
|
499
|
+
children: n
|
|
500
|
+
}, g))
|
|
501
|
+
})
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
|
|
504
|
+
isInverse: !1,
|
|
505
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_touchableJs.BaseTouchable, {
|
|
506
|
+
className: _carouselCssMisticaJs.slideshowNextArrowButton,
|
|
507
|
+
"aria-label": P.carouselNextButton,
|
|
508
|
+
onPress: k,
|
|
509
|
+
disabled: !E,
|
|
510
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_iconChevronRightRegularJs.default, {})
|
|
511
|
+
})
|
|
512
|
+
}),
|
|
513
|
+
r && e.length > 1 && /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(_themeVariantContextJs.ThemeVariant, {
|
|
514
|
+
isInverse: I,
|
|
515
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)("div", {
|
|
516
|
+
className: _carouselCssMisticaJs.slideshowBullets,
|
|
517
|
+
children: /* @__PURE__ */ (0, _jsxRuntimeJs.jsx)(re, {
|
|
518
|
+
numPages: e.length,
|
|
519
|
+
currentIndex: L
|
|
520
|
+
})
|
|
510
521
|
})
|
|
511
522
|
})
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
})
|
|
523
|
+
]
|
|
524
|
+
}))
|
|
525
|
+
});
|
|
515
526
|
};
|
package/dist/header.d.ts
CHANGED
|
@@ -51,7 +51,11 @@ export declare const MainSectionHeader: React.FC<MainSectionHeaderProps>;
|
|
|
51
51
|
type HeaderLayoutProps = {
|
|
52
52
|
isInverse?: boolean;
|
|
53
53
|
breadcrumbs?: RendersNullableElement<typeof NavigationBreadcrumbs>;
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Intentionally not forced to RendersElement<typeof Header> to allow skeletons for example
|
|
56
|
+
* The header is optional in order to allow webviews to delegate the header visualization to the surrounding native app.
|
|
57
|
+
*/
|
|
58
|
+
header?: React.ReactNode;
|
|
55
59
|
extra?: React.ReactNode;
|
|
56
60
|
sideBySideExtraOnDesktop?: boolean;
|
|
57
61
|
children?: void;
|