diy-template-components 5.16.0 → 5.18.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/build/index.js CHANGED
@@ -691,7 +691,7 @@ var phoneIcon = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%2
691
691
 
692
692
  var facebook2 = "data:image/svg+xml,%3Csvg%20width%3D%229%22%20height%3D%2214%22%20viewBox%3D%220%200%209%2014%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.45882%204.66715H0.125488V7.00049H2.45882V14.0005H5.95882V7.00049H8.08216L8.29216%204.66715H5.95882V3.69532C5.95882%203.13765%206.07082%202.91715%206.60982%202.91715H8.29216V0.000488281H5.48749C3.38982%200.000488281%202.45882%200.924488%202.45882%202.69315V4.66715Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E";
693
693
 
694
- var twitter = "data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2213%22%20viewBox%3D%220%200%2015%2013%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M14.5005%202.0975C13.986%202.32617%2013.4318%202.48017%2012.8508%202.55017C13.4447%202.19433%2013.8985%201.632%2014.1143%200.961167C13.559%201.29017%2012.9442%201.52933%2012.2897%201.65767C11.767%201.09883%2011.0192%200.75%2010.1943%200.75C8.33932%200.75%206.97665%202.48017%207.39549%204.27683C5.00965%204.15667%202.89215%203.01333%201.47582%201.27617C0.723322%202.5665%201.08615%204.25583%202.36482%205.111C1.89465%205.09583%201.45249%204.96633%201.06515%204.75167C1.03365%206.08167%201.98799%207.3265%203.36932%207.60417C2.96565%207.71383%202.52232%207.7395%202.07199%207.65317C2.43715%208.79417%203.49999%209.62367%204.75532%209.647C3.54549%2010.5943%202.02532%2011.0178%200.500488%2010.8382C1.77215%2011.6537%203.28065%2012.1285%204.90232%2012.1285C10.2363%2012.1285%2013.2487%207.624%2013.0667%203.58383C13.629%203.18017%2014.1155%202.67383%2014.5005%202.0975Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E";
694
+ var twitter = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23ffffff%22%3E%20%20%3Cpath%20d%3D%22M18.901%201.153h3.68l-8.04%209.19%209.46%2012.504h-7.406l-5.8-7.584-6.64%207.584H.475l8.6-9.83L0%201.153h7.594l5.243%206.932L18.9%201.153zm-1.29%2019.39h2.04L6.482%203.358H4.29l13.32%2017.185z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E";
695
695
 
696
696
  var menu = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3%2018H21V16H3V18ZM3%2013H21V11H3V13ZM3%206V8H21V6H3Z%22%20fill%3D%22%231676F3%22%2F%3E%3C%2Fsvg%3E";
697
697
 
@@ -3226,22 +3226,30 @@ const sectionBackgroundStyles = () => ({
3226
3226
  position: 'absolute',
3227
3227
  top: '50%',
3228
3228
  left: '50%',
3229
- width: '100vw',
3230
- minWidth: '100%',
3231
- minHeight: '100vh',
3232
- height: '56.25vw' /* 16:9 */,
3233
3229
  transform: 'translate(-50%, -50%)',
3234
3230
  border: 'none',
3235
3231
  zIndex: 0,
3236
3232
  pointerEvents: 'none',
3233
+ /* Desktop/wide: fill by width, video may extend above/below (centered) */
3234
+ width: '100vw',
3235
+ minWidth: '100%',
3236
+ height: '56.25vw' /* 16:9 */,
3237
+ minHeight: '100%',
3237
3238
  '@media (min-aspect-ratio: 16/9)': {
3238
3239
  width: '177.78vh',
3239
3240
  height: '100vh',
3240
3241
  minWidth: '100%',
3241
3242
  minHeight: '100%'
3243
+ },
3244
+ /* Mobile/tall viewport: fill by height so no black bars top/bottom; crop sides */
3245
+ '@media (max-aspect-ratio: 16/9)': {
3246
+ width: '177.78vh',
3247
+ minWidth: '100%',
3248
+ height: '100vh',
3249
+ minHeight: '100%'
3242
3250
  }
3243
3251
  },
3244
- /* Blur overlay: frosted glass so content stays readable */
3252
+ /* Blur overlay: frosted glass so content stays readable; stronger blur on mobile */
3245
3253
  sectionBackgroundBlur: {
3246
3254
  position: 'absolute',
3247
3255
  top: 0,
@@ -3249,7 +3257,12 @@ const sectionBackgroundStyles = () => ({
3249
3257
  width: '100%',
3250
3258
  height: '100%',
3251
3259
  zIndex: 1,
3252
- pointerEvents: 'none'
3260
+ pointerEvents: 'none',
3261
+ '@media (max-width: 768px)': {
3262
+ backdropFilter: 'blur(8px)',
3263
+ WebkitBackdropFilter: 'blur(8px)',
3264
+ backgroundColor: 'rgba(0, 0, 0, 0.15)'
3265
+ }
3253
3266
  },
3254
3267
  /* Background layer: fills wrapper only (absolute), does not affect wrapper height */
3255
3268
  sectionBackgroundLayer: {
@@ -3341,7 +3354,8 @@ function withSectionBackground(WrappedSectionRenderer) {
3341
3354
  ...restProps
3342
3355
  } = props;
3343
3356
  const {
3344
- isMobile
3357
+ isMobile,
3358
+ isThumbnailEnable
3345
3359
  } = React.useContext(PageContext);
3346
3360
  const classes = useStyles$1();
3347
3361
 
@@ -3374,7 +3388,6 @@ function withSectionBackground(WrappedSectionRenderer) {
3374
3388
  } = componentBg;
3375
3389
  const value = metadata?.value;
3376
3390
  const isYoutubeBg = Boolean(isYoutube ?? isYoutubeVideo);
3377
- console.log('amit22222', type, value);
3378
3391
  if (!value) {
3379
3392
  return /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
3380
3393
  sectionData: sectionData,
@@ -3429,9 +3442,8 @@ function withSectionBackground(WrappedSectionRenderer) {
3429
3442
  sectionIndex: sectionIndex
3430
3443
  }, restProps))));
3431
3444
  }
3432
- // When isMobile is true, app is rendered inside an iframe; YouTube iframe often fails in nested iframes.
3433
- // Use static YouTube thumbnail as background instead of the YouTube player.
3434
- if (isMobile) {
3445
+ // When isThumbnailEnable and isMobile, show YouTube thumbnail only (no video) for type "video".
3446
+ if (isThumbnailEnable && isMobile) {
3435
3447
  const thumbUrl = getYoutubeThumbnailUrl(videoId);
3436
3448
  return /*#__PURE__*/React__default["default"].createElement("div", {
3437
3449
  className: classes.sectionBackgroundWrapper
@@ -3452,6 +3464,7 @@ function withSectionBackground(WrappedSectionRenderer) {
3452
3464
  sectionIndex: sectionIndex
3453
3465
  }, restProps))));
3454
3466
  }
3467
+ // Use YouTube iframe for desktop, or mobile when isThumbnailEnable is not true.
3455
3468
  const embedUrl = getYoutubeEmbedUrl(videoId);
3456
3469
  return /*#__PURE__*/React__default["default"].createElement("div", {
3457
3470
  className: classes.sectionBackgroundWrapper
@@ -3809,6 +3822,7 @@ function PageRenderer$1({
3809
3822
  isLandingPage = false
3810
3823
  },
3811
3824
  isMobile = false,
3825
+ isThumbnailEnable = false,
3812
3826
  isLandingPages = false,
3813
3827
  baseURLs = {},
3814
3828
  hashToken,
@@ -3829,6 +3843,7 @@ function PageRenderer$1({
3829
3843
  const navList = header?.navs;
3830
3844
  const context = React.useMemo(() => ({
3831
3845
  isMobile,
3846
+ isThumbnailEnable,
3832
3847
  isLandingPages,
3833
3848
  layout,
3834
3849
  baseURLs,
@@ -3847,7 +3862,7 @@ function PageRenderer$1({
3847
3862
  _id,
3848
3863
  countryCode,
3849
3864
  currencySymbol
3850
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
3865
+ }), [isMobile, isThumbnailEnable, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
3851
3866
  const theme = React.useMemo(() => generateTheme(color, font, context.isMobile, roundness), [color, font, context.isMobile, roundness]);
3852
3867
  const Wrapper = SectionWrapper || React.Fragment;
3853
3868
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
@@ -13942,6 +13957,7 @@ function PageRenderer({
13942
13957
  isCustomWebsite = false
13943
13958
  },
13944
13959
  isMobile = false,
13960
+ isThumbnailEnable = false,
13945
13961
  isLandingPages = false,
13946
13962
  baseURLs = {},
13947
13963
  hashToken,
@@ -13961,6 +13977,7 @@ function PageRenderer({
13961
13977
  const navList = header?.navs;
13962
13978
  const context = React.useMemo(() => ({
13963
13979
  isMobile,
13980
+ isThumbnailEnable,
13964
13981
  isLandingPages,
13965
13982
  layout,
13966
13983
  baseURLs,
@@ -13979,7 +13996,7 @@ function PageRenderer({
13979
13996
  _id,
13980
13997
  countryCode,
13981
13998
  currencySymbol
13982
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
13999
+ }), [isMobile, isThumbnailEnable, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
13983
14000
  const theme = React.useMemo(() => generateTheme(color, font, context.isMobile, roundness), [color, font, context.isMobile, roundness]);
13984
14001
  const Wrapper = SectionWrapper || React.Fragment;
13985
14002
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {