@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.
@@ -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(props) {
46
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(RemoteBoundary, {
47
- ...props,
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
- interface RemoteBoundaryProps {
6
- children?: React.ReactNode;
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 RemoteBoundary: {
14
- ({ children, data }: RemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
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 RemoteBoundaryProps = RemoteBoundaryProps>(importFn: () => Promise<{
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 external_package_json_namespaceObject = require("../../package.json");
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
- interface RemoteBoundaryProps {
6
- children?: React.ReactNode;
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 RemoteBoundary: {
14
- ({ children, data }: RemoteBoundaryProps): import("react/jsx-runtime").JSX.Element;
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 RemoteBoundaryProps = RemoteBoundaryProps>(importFn: () => Promise<{
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(props) {
6
- return /*#__PURE__*/ jsx(RemoteBoundary, {
7
- ...props,
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, remote_boundary as default, withRemoteBoundary };
39
+ export { createLazyRemoteBoundaryComponent, withRemoteBoundary };
@@ -1,6 +1,5 @@
1
1
  import { createContext, useContext, useEffect, useState } from "react";
2
- import { version } from "../../package.json";
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);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.8.1",
7
+ "version": "0.8.3",
8
8
  "license": "MIT",
9
9
  "type": "module",
10
10
  "module": "./dist/esm/index.js",