@shopgate/engage 7.29.1-beta.2 → 7.30.0-alpha.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/package.json +10 -10
- package/page/helpers/index.d.ts +0 -14
- package/page/helpers/index.js +1 -9
- package/page/widgets/HTML/HTML.js +1 -1
- package/page/widgets/ImageSlider/hooks.js +6 -12
- package/page/widgets/ProductSlider/hooks.js +1 -1
- package/page/widgets/index.js +1 -1
- package/page/widgets/widgets.json +0 -3
- package/page/widgets/Video/Video.js +0 -4
- package/page/widgets/Video/hooks.js +0 -14
- package/page/widgets/Video/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/engage",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.30.0-alpha.1",
|
|
4
4
|
"description": "Shopgate's ENGAGE library.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@emotion/react": "^11.14.0",
|
|
19
19
|
"@shopgate/native-modules": "1.0.0-beta.25",
|
|
20
|
-
"@shopgate/pwa-common": "7.
|
|
21
|
-
"@shopgate/pwa-common-commerce": "7.
|
|
22
|
-
"@shopgate/pwa-core": "7.
|
|
23
|
-
"@shopgate/pwa-ui-ios": "7.
|
|
24
|
-
"@shopgate/pwa-ui-material": "7.
|
|
25
|
-
"@shopgate/pwa-ui-shared": "7.
|
|
20
|
+
"@shopgate/pwa-common": "7.30.0-alpha.1",
|
|
21
|
+
"@shopgate/pwa-common-commerce": "7.30.0-alpha.1",
|
|
22
|
+
"@shopgate/pwa-core": "7.30.0-alpha.1",
|
|
23
|
+
"@shopgate/pwa-ui-ios": "7.30.0-alpha.1",
|
|
24
|
+
"@shopgate/pwa-ui-material": "7.30.0-alpha.1",
|
|
25
|
+
"@shopgate/pwa-ui-shared": "7.30.0-alpha.1",
|
|
26
26
|
"@stripe/react-stripe-js": "^1.16.5",
|
|
27
27
|
"@stripe/stripe-js": "^1.3.1",
|
|
28
28
|
"@virtuous/conductor": "~2.5.0",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"intersection-observer": "^0.6.0",
|
|
35
35
|
"leaflet": "^1.8.0",
|
|
36
36
|
"leaflet-gesture-handling": "^1.2.2",
|
|
37
|
-
"lodash": "^4.17.
|
|
37
|
+
"lodash": "^4.17.21",
|
|
38
38
|
"moment": "^2.27.0",
|
|
39
|
-
"react-helmet": "^
|
|
39
|
+
"react-helmet": "^6.1.0",
|
|
40
40
|
"react-leaflet": "^3.2.5",
|
|
41
41
|
"react-phone-number-input": "^3.2.16",
|
|
42
42
|
"react-player": "1.11.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"classnames": "2.5.1",
|
|
50
50
|
"jest-mock-console": "^0.4.2",
|
|
51
|
-
"lodash": "^4.17.
|
|
51
|
+
"lodash": "^4.17.21",
|
|
52
52
|
"prop-types": "~15.8.1",
|
|
53
53
|
"react": "~16.14.0",
|
|
54
54
|
"react-redux": "^8.1.3",
|
package/page/helpers/index.d.ts
CHANGED
|
@@ -68,17 +68,3 @@ type BorderRadiusParams = {
|
|
|
68
68
|
export declare function resolveBorderRadiusFromWidgetConfig(
|
|
69
69
|
params: BorderRadiusParams
|
|
70
70
|
)
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Validator factory for regular expressions.
|
|
74
|
-
* @param regex The regular expression to match.
|
|
75
|
-
* @returns A function that validates if a value matches the regex.
|
|
76
|
-
*/
|
|
77
|
-
export declare function matchesRegex(regex: RegExp): (val: string) => boolean;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Validates if a given string is a valid HTTPS URL.
|
|
81
|
-
* @param val The string to validate.
|
|
82
|
-
* @returns True if the string is a valid HTTPS URL, false otherwise.
|
|
83
|
-
*/
|
|
84
|
-
export declare const isHttpsUrl: (val: string) => boolean;
|
package/page/helpers/index.js
CHANGED
|
@@ -21,12 +21,4 @@ var _ref2=mapping.find(function(_ref4){var _ref5=_slicedToArray(_ref4,2),value=_
|
|
|
21
21
|
* @param {"default"|"none"|"rounded"|"custom"} params.borderRadius The border radius option.
|
|
22
22
|
* @param {number} params.borderRadiusCustom The custom border radius value.
|
|
23
23
|
* @returns {number} The resolved border radius.
|
|
24
|
-
*/export var resolveBorderRadiusFromWidgetConfig=function resolveBorderRadiusFromWidgetConfig(_ref6){var borderRadius=_ref6.borderRadius,borderRadiusCustom=_ref6.borderRadiusCustom;if(borderRadius==='none')return 0;if(borderRadius==='rounded')return 16;if(borderRadius==='custom'&&typeof borderRadiusCustom==='number')return borderRadiusCustom;return 0;}
|
|
25
|
-
* Validator factory for regular expressions
|
|
26
|
-
* @param {RegExp} regex the regex
|
|
27
|
-
* @return {Function}
|
|
28
|
-
*/export var matchesRegex=function matchesRegex(regex){return function(val){return!val||regex.test(val);};};/**
|
|
29
|
-
* Returns a function that validates if input is a valid url with the https protocol
|
|
30
|
-
* @param {string} val the string to be validated
|
|
31
|
-
* @return {boolean}
|
|
32
|
-
*/export var isHttpsUrl=matchesRegex(new RegExp('^\\s*https://[^\\s/$.?#].[^\\s]*\\s*$','i'));
|
|
24
|
+
*/export var resolveBorderRadiusFromWidgetConfig=function resolveBorderRadiusFromWidgetConfig(_ref6){var borderRadius=_ref6.borderRadius,borderRadiusCustom=_ref6.borderRadiusCustom;if(borderRadius==='none')return 0;if(borderRadius==='rounded')return 16;if(borderRadius==='custom'&&typeof borderRadiusCustom==='number')return borderRadiusCustom;return 0;};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from'react';import{HtmlSanitizer}from'@shopgate/engage/components';import{makeStyles}from'@shopgate/engage/styles';import{themeConfig}from'@shopgate/engage';import{useHtmlWidget}from"./hooks";var colors=themeConfig.colors;var useStyles=makeStyles()({root:{' h1, h2, h3, h4, h5, h6, p, ul, ol':{margin:'1rem 0'},' h1, h2, h3, h4, h5, h6':{fontWeight:600},' h1':{fontSize:'1.5rem'},' h2':{fontSize:'1.25rem'},' h3':{fontSize:'1.1rem'},' h4, h5, h6':{fontSize:'1rem'},' ol, ul':{paddingLeft:'1rem'},' ol > li':{listStyle:'decimal'},' ul > li':{listStyle:'disc'},' img':{display:'initial'},' img[style*="float: left"], img[style*="float:left"], img.pull-left':{marginRight:'1rem'},' img[style*="float: right"], img[style*="float:right"], img.pull-right':{marginLeft:'1rem'},' code, pre':{whiteSpace:'pre-wrap'},' blockquote, q':{paddingLeft:'1rem',margin:'2rem 0',borderLeft:".25rem solid ".concat(colors.shade6),fontStyle:'italic'},' > :first-child':{marginTop:0},// Clearfix for floated widget content
|
|
2
|
-
':after':{clear:'both',content:'.',display:'block',visibility:'hidden',height:0},a:{color:'var(--color-primary)'}}});/**
|
|
2
|
+
':after':{clear:'both',content:'"."',display:'block',visibility:'hidden',height:0},a:{color:'var(--color-primary)'}}});/**
|
|
3
3
|
* The HtmlWidget component is used to display html code.
|
|
4
4
|
* @returns {JSX.Element}
|
|
5
5
|
*/var HtmlWidget=function HtmlWidget(){var _useStyles=useStyles(),classes=_useStyles.classes;var _useHtmlWidget=useHtmlWidget(),html=_useHtmlWidget.html;return React.createElement(HtmlSanitizer,{settings:{html:html},processStyles:true,className:classes.root},html);};export default HtmlWidget;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{useMemo}from'react';import{useWidget}from'@shopgate/engage/page/hooks';import{useTheme}from'@shopgate/engage/styles';import{resolveBorderRadiusFromWidgetConfig}from"../../helpers";/**
|
|
2
2
|
* @typedef {import('swiper/react').SwiperProps} SwiperCmpProps
|
|
3
3
|
*/ /**
|
|
4
4
|
* @typedef {Object} ImageSliderImageData
|
|
@@ -24,19 +24,13 @@ function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj
|
|
|
24
24
|
* @property {number} [borderRadiusCustom] The custom border radius value.
|
|
25
25
|
* the pagination type for the slider.
|
|
26
26
|
*/ /**
|
|
27
|
-
* @typedef {ReturnType<typeof import('@shopgate/engage/page/hooks')
|
|
27
|
+
* @typedef {ReturnType< typeof import('@shopgate/engage/page/hooks')
|
|
28
28
|
* .useWidget<ImageSliderWidgetConfig> >} UseWidgetReturnType
|
|
29
29
|
*/ // eslint-disable-next-line valid-jsdoc
|
|
30
30
|
/**
|
|
31
31
|
* Hook to access the ImageSlider widget configuration and data.
|
|
32
|
-
*/export var useImageSliderWidget=function useImageSliderWidget(){/** @type {UseWidgetReturnType} */var _useWidget=useWidget(),config=_useWidget.config,isPreview=_useWidget.isPreview
|
|
32
|
+
*/export var useImageSliderWidget=function useImageSliderWidget(){/** @type {UseWidgetReturnType} */var _useWidget=useWidget(),config=_useWidget.config,isPreview=_useWidget.isPreview;var theme=useTheme();var images=config.images,slideAutomatic=config.slideAutomatic,endlessSlider=config.endlessSlider,sliderSpeed=config.sliderSpeed,slidesPerView=config.slidesPerView,slidesPerViewCustomSmall=config.slidesPerViewCustomSmall,slidesPerViewCustomMedium=config.slidesPerViewCustomMedium,slidesPerViewCustomLarge=config.slidesPerViewCustomLarge,imageSpacing=config.imageSpacing,_config$paginationSty=config.paginationStyle,paginationStyle=_config$paginationSty===void 0?'bullets':_config$paginationSty,borderRadius=config.borderRadius,borderRadiusCustom=config.borderRadiusCustom;var borderRadiusResolved=resolveBorderRadiusFromWidgetConfig({borderRadius:borderRadius,borderRadiusCustom:borderRadiusCustom});var paginationType=useMemo(function(){return paginationStyle==='default'?'bullets':paginationStyle.toLowerCase();},[paginationStyle]);var imagesWithUrls=useMemo(function(){return images.filter(function(img){var _img$image;return img===null||img===void 0?void 0:(_img$image=img.image)===null||_img$image===void 0?void 0:_img$image.url;});},[images]);/**
|
|
33
33
|
* @type {SwiperCmpProps}
|
|
34
|
-
*/var swiperProps=useMemo(function(){var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
* Needs to be at least as large as the highest horizontal layout margin (when set) to avoid
|
|
38
|
-
* showing of more than one slide.
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/var imageSpacingForSingleSlide=Math.max((_ref=layout===null||layout===void 0?void 0:layout.marginLeft)!==null&&_ref!==void 0?_ref:0,(_ref2=layout===null||layout===void 0?void 0:layout.marginRight)!==null&&_ref2!==void 0?_ref2:0,imageSpacing);var breakpoints=_defineProperty(_defineProperty({},theme.breakpoints.values.sm,_extends({slidesPerView:slidesPerViewMedium},slidesPerViewMedium===1&&imageSpacingForSingleSlide?{spaceBetween:imageSpacingForSingleSlide}:{spaceBetween:imageSpacing})),theme.breakpoints.values.md,_extends({slidesPerView:slidesPerViewLarge},slidesPerViewLarge===1&&imageSpacingForSingleSlide?{spaceBetween:imageSpacingForSingleSlide}:{spaceBetween:imageSpacing}));var showPagination=paginationType!=='off'&&imagesWithUrls.length>1;// Create a key that changes when relevant config changes, to force remount of Swiper
|
|
41
|
-
var componentKey=isPreview?JSON.stringify(_extends({slidesPerView:slidesPerView,spaceBetween:imageSpacing,paginationType:paginationType,showPagination:showPagination},breakpoints)):null;return _extends({autoplay:slideAutomatic?{delay:sliderSpeed}:false,loop:endlessSlider,slidesPerView:slidesPerViewSmall,breakpoints:breakpoints,pagination:showPagination?{type:paginationType,clickable:true,dynamicBullets:true}:false},layout.marginLeft||layout.marginRight?{style:_extends({},layout.marginLeft?{marginLeft:layout.marginLeft*-1,paddingLeft:layout.marginLeft}:{},{},layout.marginRight?{marginRight:layout.marginRight*-1,paddingRight:layout.marginRight}:{})}:null,{},slidesPerViewSmall===1&&imageSpacingForSingleSlide?{spaceBetween:imageSpacingForSingleSlide}:{spaceBetween:imageSpacing},{},isPreview?{key:componentKey,// Improves interaction with the slider in the CMS preview iframe
|
|
42
|
-
touchStartPreventDefault:true}:{});},[slidesPerView,theme.breakpoints.values.sm,theme.breakpoints.values.md,paginationType,imagesWithUrls.length,imageSpacing,slideAutomatic,sliderSpeed,endlessSlider,isPreview,slidesPerViewCustomSmall,slidesPerViewCustomMedium,slidesPerViewCustomLarge,layout]);return{slides:imagesWithUrls,swiperProps:swiperProps,borderRadius:borderRadiusResolved};};
|
|
34
|
+
*/var swiperProps=useMemo(function(){var slidesPerViewSmall=1.0;var slidesPerViewMedium=1.3;var slidesPerViewLarge=1.6;if(slidesPerView==='dense'){slidesPerViewSmall=1.3;slidesPerViewMedium=1.8;slidesPerViewLarge=2.3;}else if(slidesPerView==='custom'){slidesPerViewSmall=slidesPerViewCustomSmall;slidesPerViewMedium=slidesPerViewCustomMedium;slidesPerViewLarge=slidesPerViewCustomLarge;}var breakpoints=_defineProperty(_defineProperty({},theme.breakpoints.values.sm,{slidesPerView:slidesPerViewMedium}),theme.breakpoints.values.md,{slidesPerView:slidesPerViewLarge});var showPagination=paginationType!=='off'&&imagesWithUrls.length>1;// Create a key that changes when relevant config changes, to force remount of Swiper
|
|
35
|
+
var componentKey=isPreview?JSON.stringify(_extends({slidesPerView:slidesPerView,spaceBetween:imageSpacing,paginationType:paginationType,showPagination:showPagination},breakpoints)):null;return _extends({autoplay:slideAutomatic?{delay:sliderSpeed}:false,loop:endlessSlider,slidesPerView:slidesPerViewSmall,breakpoints:breakpoints,spaceBetween:imageSpacing,pagination:showPagination?{type:paginationType,clickable:true,dynamicBullets:true}:false},isPreview?{key:componentKey,// Improves interaction with the slider in the CMS preview iframe
|
|
36
|
+
touchStartPreventDefault:true}:{});},[slidesPerView,theme.breakpoints.values.sm,theme.breakpoints.values.md,paginationType,imagesWithUrls.length,imageSpacing,slideAutomatic,sliderSpeed,endlessSlider,isPreview,slidesPerViewCustomSmall,slidesPerViewCustomMedium,slidesPerViewCustomLarge]);return{slides:imagesWithUrls,swiperProps:swiperProps,borderRadius:borderRadiusResolved};};
|
|
@@ -21,4 +21,4 @@ import _camelCase from"lodash/camelCase";function _extends(){_extends=Object.ass
|
|
|
21
21
|
*/ // eslint-disable-next-line valid-jsdoc
|
|
22
22
|
/**
|
|
23
23
|
* Hook to access the Product Slider widget configuration.
|
|
24
|
-
*/export var useProductSliderWidget=function useProductSliderWidget(){/** @type {UseWidgetReturnType} */var _useWidget=useWidget(),config=_useWidget.config,isPreview=_useWidget.isPreview
|
|
24
|
+
*/export var useProductSliderWidget=function useProductSliderWidget(){/** @type {UseWidgetReturnType} */var _useWidget=useWidget(),config=_useWidget.config,isPreview=_useWidget.isPreview;var products=config.products,productCount=config.productCount,sort=config.sort,_config$showName=config.showName,showName=_config$showName===void 0?false:_config$showName,_config$showPrice=config.showPrice,showPrice=_config$showPrice===void 0?false:_config$showPrice,_config$showRating=config.showRating,showRating=_config$showRating===void 0?false:_config$showRating,_config$slideAutomati=config.slideAutomatic,slideAutomatic=_config$slideAutomati===void 0?true:_config$slideAutomati,_config$endlessSlider=config.endlessSlider,endlessSlider=_config$endlessSlider===void 0?true:_config$endlessSlider,_config$sliderSpeed=config.sliderSpeed,sliderSpeed=_config$sliderSpeed===void 0?7000:_config$sliderSpeed,_config$showHeadline=config.showHeadline,showHeadline=_config$showHeadline===void 0?false:_config$showHeadline,headline=config.headline;var productSearchParams=useMemo(function(){return getProductSearchParamsFromProductsInputConfig(products);},[products]);var swiperProps=useMemo(function(){return{autoplay:slideAutomatic,delay:sliderSpeed,loop:endlessSlider};},[slideAutomatic,sliderSpeed,endlessSlider]);var productItemProps=useMemo(function(){return{hideName:!showName,hidePrice:!showPrice,hideRating:!showRating};},[showName,showPrice,showRating]);return _extends({},productSearchParams,{sort:_camelCase(sort),productCount:productCount,swiperProps:swiperProps,productItemProps:productItemProps,isPreview:isPreview,showHeadline:showHeadline,headline:headline});};
|
package/page/widgets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as PlaceholderWidget}from"./Placeholder";export{default as ProductListWidget}from"./ProductList";export{default as CategoryListWidget}from"./CategoryList";export{default as HtmlWidget}from"./HTML";export{default as
|
|
1
|
+
export{default as PlaceholderWidget}from"./Placeholder";export{default as ProductListWidget}from"./ProductList";export{default as CategoryListWidget}from"./CategoryList";export{default as HtmlWidget}from"./HTML";export{default as ProductSliderWidget}from"./ProductSlider";export{default as HeadlineWidget}from"./Headline";export{default as ImageWidget}from"./Image";export{default as ImageRowWidget}from"./ImageRow";export{default as ImageSliderWidget}from"./ImageSlider";export{default as RichTextWidget}from"./RichText";export{default as HeroBannerWidget}from"./HeroBanner";export{default as ButtonWidget}from"./Button";
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
"@shopgate/widgets/htmlWidget": {
|
|
12
12
|
"path": "@shopgate/engage/page/widgets/HTML"
|
|
13
13
|
},
|
|
14
|
-
"@shopgate/widgets/videoWidget": {
|
|
15
|
-
"path": "@shopgate/engage/page/widgets/Video"
|
|
16
|
-
},
|
|
17
14
|
"@shopgate/widgets/headlineWidget": {
|
|
18
15
|
"path": "@shopgate/engage/page/widgets/Headline"
|
|
19
16
|
},
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}import React,{useEffect,useMemo,useState}from'react';import{makeStyles}from'@shopgate/engage/styles';import{useReduceMotion}from'@shopgate/engage/a11y/hooks';import{usePrevious}from'@shopgate/engage/core';import{useVideoWidget}from"./hooks";import{isHttpsUrl}from"../../helpers";var useStyles=makeStyles()(function(theme,_ref){var borderRadius=_ref.borderRadius;return{video:{width:'100%',borderRadius:borderRadius}};});/**
|
|
2
|
-
* The VideoWidget is used to display a video.
|
|
3
|
-
* @returns {JSX.Element}
|
|
4
|
-
*/var Video=function Video(){var _useVideoWidget=useVideoWidget(),url=_useVideoWidget.url,muted=_useVideoWidget.muted,loop=_useVideoWidget.loop,controls=_useVideoWidget.controls,autoplay=_useVideoWidget.autoplay,borderRadius=_useVideoWidget.borderRadius;var _useStyles=useStyles({borderRadius:borderRadius}),classes=_useStyles.classes;var reduceMotion=useReduceMotion();var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hasError=_useState2[0],setHasError=_useState2[1];var videoRef=React.useRef(null);var prevAutoPlay=usePrevious(autoplay);var prevUrl=usePrevious(url);var isValidUrl=useMemo(function(){return url?isHttpsUrl(url):false;},[url]);useEffect(function(){if(videoRef.current&&prevAutoPlay&&!autoplay){videoRef.current.pause();videoRef.current.currentTime=0;}if(videoRef.current&&!prevAutoPlay&&autoplay){videoRef.current.play();}if(!url||url!==prevUrl||!hasError){setHasError(false);}},[autoplay,hasError,prevAutoPlay,prevUrl,url]);if(!url||hasError||!isValidUrl)return null;return React.createElement("video",{ref:videoRef,src:url,muted:muted,controls:!autoplay||reduceMotion?true:controls,autoPlay:reduceMotion?false:autoplay,className:classes.video,preload:"auto",playsInline:true,loop:loop,"aria-hidden":true,onError:function onError(){return setHasError(true);}},React.createElement("track",{kind:"captions",src:"",srcLang:"de",label:"Deutsch"}));};export default Video;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{useWidget}from'@shopgate/engage/page/hooks';import{resolveBorderRadiusFromWidgetConfig}from"../../helpers";/**
|
|
2
|
-
* @typedef {Object} VideoWidgetConfig
|
|
3
|
-
* @property {string} url The video URL.
|
|
4
|
-
* @property {boolean} [muted] Whether the video should be muted.
|
|
5
|
-
* @property {boolean} [loop] Whether the video should loop.
|
|
6
|
-
* @property {boolean} [controls] Whether the video should display controls.
|
|
7
|
-
* @property {boolean} [autoplay] Whether the video should autoplay.
|
|
8
|
-
*/ /**
|
|
9
|
-
* @typedef {ReturnType< typeof import('@shopgate/engage/page/hooks')
|
|
10
|
-
* .useWidget<VideoWidgetConfig> >} UseWidgetReturnType
|
|
11
|
-
*/ // eslint-disable-next-line valid-jsdoc
|
|
12
|
-
/**
|
|
13
|
-
* Hook to access the Video widget configuration and data.
|
|
14
|
-
*/export var useVideoWidget=function useVideoWidget(){/** @type {UseWidgetReturnType} */var _useWidget=useWidget(),config=_useWidget.config;var _ref=config||{},url=_ref.url,muted=_ref.muted,loop=_ref.loop,controls=_ref.controls,autoplay=_ref.autoplay,borderRadius=_ref.borderRadius,borderRadiusCustom=_ref.borderRadiusCustom;var borderRadiusResolved=resolveBorderRadiusFromWidgetConfig({borderRadius:borderRadius,borderRadiusCustom:borderRadiusCustom});return{url:url,muted:muted,loop:loop,controls:controls,autoplay:autoplay,borderRadius:borderRadiusResolved};};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./Video";
|