@windstream/react-shared-components 0.1.68 → 0.1.69
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/dist/contentful/index.esm.js +2 -2
- package/dist/contentful/index.esm.js.map +1 -1
- package/dist/contentful/index.js +2 -2
- package/dist/contentful/index.js.map +1 -1
- package/dist/core.d.ts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/next/index.esm.js +1 -1
- package/dist/next/index.esm.js.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/next/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/next-image/index.tsx +16 -5
package/package.json
CHANGED
|
@@ -9,11 +9,22 @@ import NextJsImageImport, {
|
|
|
9
9
|
import { cx } from "@shared/utils";
|
|
10
10
|
|
|
11
11
|
// Handle CJS/ESM interop: when bundled as ESM and consumed by Webpack,
|
|
12
|
-
// the default import may resolve to { default: Component }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
// the default import may resolve to { default: Component } (or be doubly
|
|
13
|
+
// wrapped) instead of the function. Unwrap until we land on a callable.
|
|
14
|
+
const resolveDefaultExport = (mod: unknown): unknown => {
|
|
15
|
+
let current: any = mod;
|
|
16
|
+
// Limit iterations to avoid pathological cycles.
|
|
17
|
+
for (let i = 0; i < 5; i++) {
|
|
18
|
+
if (typeof current === "function") return current;
|
|
19
|
+
if (current && typeof current === "object" && "default" in current) {
|
|
20
|
+
current = current.default;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
return current;
|
|
24
|
+
}
|
|
25
|
+
return current;
|
|
26
|
+
};
|
|
27
|
+
const NextJsImage = resolveDefaultExport(NextJsImageImport) as typeof NextJsImageImport;
|
|
17
28
|
|
|
18
29
|
export interface NextImageComponentProps extends NextImageProps {
|
|
19
30
|
className?: string;
|