diy-template-components 0.2.64 → 0.2.66

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
@@ -1149,8 +1149,10 @@ const NextImageRenderer = ({
1149
1149
  const {
1150
1150
  isCustomWebsite,
1151
1151
  pageData,
1152
- isMobile
1152
+ isMobile,
1153
+ ASSET_PREFIX_URL
1153
1154
  } = React.useContext(PageContext);
1155
+ console.log("pageRenderer wrapper", ASSET_PREFIX_URL);
1154
1156
  try {
1155
1157
  let {
1156
1158
  refSetter,
@@ -1168,7 +1170,11 @@ const NextImageRenderer = ({
1168
1170
  desktop: 1200
1169
1171
  };
1170
1172
  const dynamicWidth = isMobile ? breakpoints.mobile : breakpoints?.desktop;
1171
- return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${dynamicWidth}`;
1173
+ if (ASSET_PREFIX_URL !== undefined) {
1174
+ return `${ASSET_PREFIX_URL}/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
1175
+ } else {
1176
+ return `/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
1177
+ }
1172
1178
  };
1173
1179
  const NextImage = require('next/image').default;
1174
1180
  return /*#__PURE__*/React__default["default"].createElement(NextImage, _extends({
@@ -2079,9 +2085,11 @@ function PageRenderer$1({
2079
2085
  isTutorWebsite = false,
2080
2086
  extraProps,
2081
2087
  hideLogin,
2082
- isCustomWebsite
2088
+ isCustomWebsite,
2089
+ ASSET_PREFIX_URL = undefined
2083
2090
  }) {
2084
2091
  const theme = React.useMemo(() => getTheme(color, font), [color, font]);
2092
+ console.log("pageRenderer", ASSET_PREFIX_URL);
2085
2093
  const navList = header?.navs;
2086
2094
  const context = React.useMemo(() => ({
2087
2095
  isMobile,
@@ -2100,8 +2108,9 @@ function PageRenderer$1({
2100
2108
  extraProps,
2101
2109
  hideLogin,
2102
2110
  isCustomWebsite,
2103
- _id
2104
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
2111
+ _id,
2112
+ ASSET_PREFIX_URL
2113
+ }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, ASSET_PREFIX_URL]);
2105
2114
  const Wrapper = SectionWrapper || React.Fragment;
2106
2115
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
2107
2116
  theme: theme
@@ -8839,10 +8848,12 @@ function PageRenderer({
8839
8848
  templateId,
8840
8849
  isTutorWebsite = false,
8841
8850
  extraProps,
8842
- hideLogin
8851
+ hideLogin,
8852
+ ASSET_PREFIX_URL
8843
8853
  }) {
8844
8854
  const theme = React.useMemo(() => getTheme(color, font), [color, font]);
8845
8855
  const navList = header?.navs;
8856
+ console.log("pageRenderer static", ASSET_PREFIX_URL);
8846
8857
  const context = React.useMemo(() => ({
8847
8858
  isMobile,
8848
8859
  isLandingPages,
@@ -8860,8 +8871,9 @@ function PageRenderer({
8860
8871
  extraProps,
8861
8872
  hideLogin,
8862
8873
  isCustomWebsite,
8863
- _id
8864
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
8874
+ _id,
8875
+ ASSET_PREFIX_URL
8876
+ }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, ASSET_PREFIX_URL]);
8865
8877
  const Wrapper = SectionWrapper || React.Fragment;
8866
8878
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
8867
8879
  theme: theme