@dutchiesdk/ecommerce-extensions-sdk 0.8.1 → 0.8.3
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/components/remote-boundary.cjs +3 -12
- package/dist/components/remote-boundary.d.ts +6 -15
- package/dist/context/ecommerce-data-bridge.cjs +1 -2
- package/dist/esm/components/remote-boundary.d.ts +6 -15
- package/dist/esm/components/remote-boundary.js +4 -10
- package/dist/esm/context/ecommerce-data-bridge.js +1 -2
- package/package.json +1 -1
|
@@ -34,7 +34,6 @@ var __webpack_exports__ = {};
|
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
36
|
createLazyRemoteBoundaryComponent: ()=>createLazyRemoteBoundaryComponent,
|
|
37
|
-
default: ()=>remote_boundary,
|
|
38
37
|
withRemoteBoundary: ()=>withRemoteBoundary
|
|
39
38
|
});
|
|
40
39
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
@@ -42,21 +41,15 @@ const external_react_namespaceObject = require("react");
|
|
|
42
41
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
43
42
|
const ecommerce_data_bridge_cjs_namespaceObject = require("../context/ecommerce-data-bridge.cjs");
|
|
44
43
|
const withRemoteBoundary = (WrappedComponent)=>{
|
|
45
|
-
function WithRemoteBoundaryComponent(
|
|
46
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
47
|
-
|
|
44
|
+
function WithRemoteBoundaryComponent({ data }) {
|
|
45
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ecommerce_data_bridge_cjs_namespaceObject.DataBridgeContext.Provider, {
|
|
46
|
+
value: data,
|
|
48
47
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(WrappedComponent, {})
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
50
|
WithRemoteBoundaryComponent.DataBridgeVersion = ecommerce_data_bridge_cjs_namespaceObject.DataBridgeVersion;
|
|
52
51
|
return WithRemoteBoundaryComponent;
|
|
53
52
|
};
|
|
54
|
-
const RemoteBoundary = ({ children, data })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ecommerce_data_bridge_cjs_namespaceObject.DataBridgeContext.Provider, {
|
|
55
|
-
value: data,
|
|
56
|
-
children: children
|
|
57
|
-
});
|
|
58
|
-
RemoteBoundary.DataBridgeVersion = ecommerce_data_bridge_cjs_namespaceObject.DataBridgeVersion;
|
|
59
|
-
const remote_boundary = RemoteBoundary;
|
|
60
53
|
function createLazyRemoteBoundaryComponent(importFn, options = {}) {
|
|
61
54
|
const { fallback, onError } = options;
|
|
62
55
|
const LazyComponent = /*#__PURE__*/ external_react_default().lazy(async ()=>{
|
|
@@ -83,11 +76,9 @@ function createLazyRemoteBoundaryComponent(importFn, options = {}) {
|
|
|
83
76
|
return LazyRemoteBoundaryWrapper;
|
|
84
77
|
}
|
|
85
78
|
exports.createLazyRemoteBoundaryComponent = __webpack_exports__.createLazyRemoteBoundaryComponent;
|
|
86
|
-
exports["default"] = __webpack_exports__["default"];
|
|
87
79
|
exports.withRemoteBoundary = __webpack_exports__.withRemoteBoundary;
|
|
88
80
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
89
81
|
"createLazyRemoteBoundaryComponent",
|
|
90
|
-
"default",
|
|
91
82
|
"withRemoteBoundary"
|
|
92
83
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
93
84
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -2,26 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import type { RemoteBoundaryComponent, RemoteModuleRegistry } from '../types/ecommerce-extension';
|
|
3
3
|
import type { CommerceComponentsDataInterface } from '../types/interface';
|
|
4
4
|
export type { RemoteBoundaryComponent, RemoteModuleRegistry };
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
data: CommerceComponentsDataInterface;
|
|
8
|
-
}
|
|
9
|
-
export declare const withRemoteBoundary: (WrappedComponent: React.ComponentType) => {
|
|
10
|
-
(props: RemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
DataBridgeVersion: string;
|
|
5
|
+
type WithRemoteBoundaryProps = {
|
|
6
|
+
data?: CommerceComponentsDataInterface;
|
|
12
7
|
};
|
|
13
|
-
declare const
|
|
14
|
-
({
|
|
8
|
+
export declare const withRemoteBoundary: (WrappedComponent: React.ComponentType) => {
|
|
9
|
+
({ data }: WithRemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
15
10
|
DataBridgeVersion: string;
|
|
16
11
|
};
|
|
17
|
-
export default RemoteBoundary;
|
|
18
12
|
interface LazyRemoteBoundaryOptions {
|
|
19
13
|
fallback?: React.ReactNode;
|
|
20
14
|
onError?: (error: Error) => void;
|
|
21
15
|
}
|
|
22
|
-
export declare function createLazyRemoteBoundaryComponent<P extends
|
|
16
|
+
export declare function createLazyRemoteBoundaryComponent<P extends WithRemoteBoundaryProps = WithRemoteBoundaryProps>(importFn: () => Promise<{
|
|
23
17
|
default: React.ComponentType;
|
|
24
|
-
}>, options?: LazyRemoteBoundaryOptions):
|
|
25
|
-
(props: P): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
DataBridgeVersion: string;
|
|
27
|
-
};
|
|
18
|
+
}>, options?: LazyRemoteBoundaryOptions): RemoteBoundaryComponent<P>;
|
|
@@ -30,8 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
useDataBridge: ()=>useDataBridge
|
|
31
31
|
});
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
34
|
-
const DataBridgeVersion = external_package_json_namespaceObject.version;
|
|
33
|
+
const DataBridgeVersion = '0.8.3';
|
|
35
34
|
const DataBridgeContext = (0, external_react_namespaceObject.createContext)(void 0);
|
|
36
35
|
const useDataBridge = ()=>{
|
|
37
36
|
const context = (0, external_react_namespaceObject.useContext)(DataBridgeContext);
|
|
@@ -2,26 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import type { RemoteBoundaryComponent, RemoteModuleRegistry } from '../types/ecommerce-extension';
|
|
3
3
|
import type { CommerceComponentsDataInterface } from '../types/interface';
|
|
4
4
|
export type { RemoteBoundaryComponent, RemoteModuleRegistry };
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
data: CommerceComponentsDataInterface;
|
|
8
|
-
}
|
|
9
|
-
export declare const withRemoteBoundary: (WrappedComponent: React.ComponentType) => {
|
|
10
|
-
(props: RemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
DataBridgeVersion: string;
|
|
5
|
+
type WithRemoteBoundaryProps = {
|
|
6
|
+
data?: CommerceComponentsDataInterface;
|
|
12
7
|
};
|
|
13
|
-
declare const
|
|
14
|
-
({
|
|
8
|
+
export declare const withRemoteBoundary: (WrappedComponent: React.ComponentType) => {
|
|
9
|
+
({ data }: WithRemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
15
10
|
DataBridgeVersion: string;
|
|
16
11
|
};
|
|
17
|
-
export default RemoteBoundary;
|
|
18
12
|
interface LazyRemoteBoundaryOptions {
|
|
19
13
|
fallback?: React.ReactNode;
|
|
20
14
|
onError?: (error: Error) => void;
|
|
21
15
|
}
|
|
22
|
-
export declare function createLazyRemoteBoundaryComponent<P extends
|
|
16
|
+
export declare function createLazyRemoteBoundaryComponent<P extends WithRemoteBoundaryProps = WithRemoteBoundaryProps>(importFn: () => Promise<{
|
|
23
17
|
default: React.ComponentType;
|
|
24
|
-
}>, options?: LazyRemoteBoundaryOptions):
|
|
25
|
-
(props: P): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
DataBridgeVersion: string;
|
|
27
|
-
};
|
|
18
|
+
}>, options?: LazyRemoteBoundaryOptions): RemoteBoundaryComponent<P>;
|
|
@@ -2,21 +2,15 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import external_react_default, { Suspense } from "react";
|
|
3
3
|
import { DataBridgeContext, DataBridgeVersion } from "../context/ecommerce-data-bridge.js";
|
|
4
4
|
const withRemoteBoundary = (WrappedComponent)=>{
|
|
5
|
-
function WithRemoteBoundaryComponent(
|
|
6
|
-
return /*#__PURE__*/ jsx(
|
|
7
|
-
|
|
5
|
+
function WithRemoteBoundaryComponent({ data }) {
|
|
6
|
+
return /*#__PURE__*/ jsx(DataBridgeContext.Provider, {
|
|
7
|
+
value: data,
|
|
8
8
|
children: /*#__PURE__*/ jsx(WrappedComponent, {})
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
WithRemoteBoundaryComponent.DataBridgeVersion = DataBridgeVersion;
|
|
12
12
|
return WithRemoteBoundaryComponent;
|
|
13
13
|
};
|
|
14
|
-
const RemoteBoundary = ({ children, data })=>/*#__PURE__*/ jsx(DataBridgeContext.Provider, {
|
|
15
|
-
value: data,
|
|
16
|
-
children: children
|
|
17
|
-
});
|
|
18
|
-
RemoteBoundary.DataBridgeVersion = DataBridgeVersion;
|
|
19
|
-
const remote_boundary = RemoteBoundary;
|
|
20
14
|
function createLazyRemoteBoundaryComponent(importFn, options = {}) {
|
|
21
15
|
const { fallback, onError } = options;
|
|
22
16
|
const LazyComponent = /*#__PURE__*/ external_react_default.lazy(async ()=>{
|
|
@@ -42,4 +36,4 @@ function createLazyRemoteBoundaryComponent(importFn, options = {}) {
|
|
|
42
36
|
LazyRemoteBoundaryWrapper.DataBridgeVersion = DataBridgeVersion;
|
|
43
37
|
return LazyRemoteBoundaryWrapper;
|
|
44
38
|
}
|
|
45
|
-
export { createLazyRemoteBoundaryComponent,
|
|
39
|
+
export { createLazyRemoteBoundaryComponent, withRemoteBoundary };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
const DataBridgeVersion = version;
|
|
2
|
+
const DataBridgeVersion = '0.8.3';
|
|
4
3
|
const DataBridgeContext = createContext(void 0);
|
|
5
4
|
const useDataBridge = ()=>{
|
|
6
5
|
const context = useContext(DataBridgeContext);
|