diy-template-components 0.2.33 → 0.2.35

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.es.js CHANGED
@@ -1,12 +1,12 @@
1
- function ___$insertStyle(css) {
2
- if (!css || typeof window === 'undefined') {
3
- return;
4
- }
5
- const style = document.createElement('style');
6
- style.setAttribute('type', 'text/css');
7
- style.innerHTML = css;
8
- document.head.appendChild(style);
9
- return css;
1
+ function ___$insertStyle(css) {
2
+ if (!css || !window) {
3
+ return;
4
+ }
5
+ const style = document.createElement('style');
6
+ style.setAttribute('type', 'text/css');
7
+ style.innerHTML = css;
8
+ document.head.appendChild(style);
9
+ return css;
10
10
  }
11
11
 
12
12
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
@@ -2271,39 +2271,27 @@ const NextImageRenderer = ({
2271
2271
  src,
2272
2272
  ...props
2273
2273
  }) => {
2274
- try {
2275
- const {
2276
- isCustomWebsite
2277
- } = useContext(PageContext);
2278
- let {
2279
- refSetter,
2280
- className
2281
- } = props;
2282
- if (isCustomWebsite) {
2283
- return /*#__PURE__*/React.createElement(require.resolve('next/image').default, {
2284
- src: src,
2285
- // height: "640",
2286
- // width: "959",
2287
- layout: 'fill',
2288
- ref: {
2289
- refSetter
2290
- },
2291
- className: {
2292
- className
2293
- },
2294
- ...props
2295
- });
2296
- } else {
2297
- return /*#__PURE__*/React.createElement("img", {
2298
- ref: refSetter,
2299
- className: className,
2300
- src: src
2301
- });
2302
- }
2303
- } catch (err) {
2304
- return {
2305
- notFound: true
2306
- };
2274
+ const {
2275
+ isCustomWebsite
2276
+ } = useContext(PageContext);
2277
+ let {
2278
+ refSetter,
2279
+ className
2280
+ } = props;
2281
+ if (isCustomWebsite) {
2282
+ const NextImage = require('next/image').default;
2283
+ return /*#__PURE__*/React.createElement(NextImage, _extends({
2284
+ src: src,
2285
+ layout: 'fill',
2286
+ ref: refSetter,
2287
+ className: className
2288
+ }, props));
2289
+ } else {
2290
+ return /*#__PURE__*/React.createElement("img", {
2291
+ ref: refSetter,
2292
+ className: className,
2293
+ src: src
2294
+ });
2307
2295
  }
2308
2296
  };
2309
2297