@contentful/experiences-sdk-react 1.8.2-dev-20240627T0348-ac210ce.0 → 1.8.3-dev-20240627T1831-38d15cb.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundary.js","sources":["../../../src/components/ErrorBoundary.tsx"],"sourcesContent":["import React, { ErrorInfo, ReactElement } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport '../styles/ErrorBoundary.css';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\nexport class ErrorBoundary extends React.Component<\n { children: ReactElement },\n { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null; showErrorDetails: boolean }\n> {\n constructor(props: { children: ReactElement }) {\n super(props);\n this.state = { hasError: false, error: null, errorInfo: null, showErrorDetails: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n this.setState({ error, errorInfo });\n if (error.name !== 'ImportedComponentError') {\n sendMessage(OUTGOING_EVENTS.CanvasError, error);\n } else {\n throw error;\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"cf-error-message\">\n <h2 className=\"title\">{`Something went wrong while rendering the experience`}</h2>\n <div>\n The Experience Builder SDK has encountered an error. It may be that the SDK has not been\n set up properly or an imported component has thrown this error. Try to refresh the page\n and find more guidance in our{' '}\n <a\n href=\"https://www.contentful.com/developers/docs/tutorials/general/experience-builder/\"\n rel=\"noreferrer\"\n target=\"_blank\">\n documentation\n </a>\n .\n </div>\n <br />\n <span\n className=\"more-details\"\n onClick={() =>\n this.setState((prevState) => ({\n showErrorDetails: !prevState.showErrorDetails,\n }))\n }>\n {this.state.showErrorDetails ? 'Hide' : 'See'} details\n </span>\n {this.state.showErrorDetails && (\n <code>\n {this.state.error?.stack?.split('\\n').map((i, key) => {\n return <div key={key}>{i}</div>;\n })}\n </code>\n )}\n </div>\n );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AAA,CAAM,EACND,IACE,CAAA,MAAA,EAAA,EAAA,SAAS,EAAC,cAAc,EACxB,OAAO,EAAE,MACP,IAAI,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM;AAC5B,4BAAA,gBAAgB,EAAE,CAAC,SAAS,CAAC,gBAAgB;yBAC9C,CAAC,CAAC,aAEJ,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,MAAM,GAAG,KAAK,EAAA,UAAA,CAAA,EAAA,CACxC,EACN,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAC1BC,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EACG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAI;AACnD,4BAAA,OAAOA,GAAgB,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,CAAC,EAAP,EAAA,GAAG,CAAW,CAAC;AAClC,yBAAC,CAAC,EAAA,CACG,CACR,CAAA,EAAA,CACG,EACN;SACH;AACD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
1
+ {"version":3,"file":"ErrorBoundary.js","sources":["../../../src/components/ErrorBoundary.tsx"],"sourcesContent":["import React, { ErrorInfo, ReactElement } from 'react';\nimport { sendMessage } from '@contentful/experiences-core';\nimport '../styles/ErrorBoundary.css';\nimport { OUTGOING_EVENTS } from '@contentful/experiences-core/constants';\n\n('use client');\n\nexport class ErrorBoundary extends React.Component<\n { children: ReactElement },\n { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null; showErrorDetails: boolean }\n> {\n constructor(props: { children: ReactElement }) {\n super(props);\n this.state = { hasError: false, error: null, errorInfo: null, showErrorDetails: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n this.setState({ error, errorInfo });\n if (error.name !== 'ImportedComponentError') {\n sendMessage(OUTGOING_EVENTS.CanvasError, error);\n } else {\n throw error;\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"cf-error-message\">\n <h2 className=\"title\">{`Something went wrong while rendering the experience`}</h2>\n <div>\n The Experience Builder SDK has encountered an error. It may be that the SDK has not been\n set up properly or an imported component has thrown this error. Try to refresh the page\n and find more guidance in our{' '}\n <a\n href=\"https://www.contentful.com/developers/docs/tutorials/general/experience-builder/\"\n rel=\"noreferrer\"\n target=\"_blank\">\n documentation\n </a>\n .\n </div>\n <br />\n <span\n className=\"more-details\"\n onClick={() =>\n this.setState((prevState) => ({\n showErrorDetails: !prevState.showErrorDetails,\n }))\n }>\n {this.state.showErrorDetails ? 'Hide' : 'See'} details\n </span>\n {this.state.showErrorDetails && (\n <code>\n {this.state.error?.stack?.split('\\n').map((i, key) => {\n return <div key={key}>{i}</div>;\n })}\n </code>\n )}\n </div>\n );\n }\n return this.props.children;\n }\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAOa,MAAA,aAAc,SAAQ,KAAK,CAAC,SAGxC,CAAA;AACC,IAAA,WAAA,CAAY,KAAiC,EAAA;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC;KACzF;AAED,IAAA,OAAO,wBAAwB,GAAA;AAC7B,QAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC3B;IAED,iBAAiB,CAAC,KAAY,EAAE,SAAoB,EAAA;QAClD,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACpC,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,wBAAwB,EAAE;AAC3C,YAAA,WAAW,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CA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EACN;SACH;AACD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;KAC5B;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = '1.8.2-dev-20240627T0348-ac210ce.0';
1
+ const SDK_VERSION = '1.8.3-dev-20240627T1831-38d15cb.0';
2
2
 
3
3
  export { SDK_VERSION };
4
4
  //# sourceMappingURL=sdkVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.8.2-dev-20240627T0348-ac210ce.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
1
+ {"version":3,"file":"sdkVersion.js","sources":["../../src/sdkVersion.ts"],"sourcesContent":["export const SDK_VERSION = '1.8.3-dev-20240627T1831-38d15cb.0';\n"],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;;;;"}
@@ -19,8 +19,8 @@ export declare const getComponentRegistration: (id: string) => ComponentRegistra
19
19
  export declare const addComponentRegistration: (componentRegistration: ComponentRegistration) => void;
20
20
  export declare const createAssemblyRegistration: ({ definitionId, definitionName, component, }: {
21
21
  definitionId: string;
22
- definitionName?: string | undefined;
23
- component: ComponentRegistration['component'];
22
+ definitionName?: string;
23
+ component: ComponentRegistration["component"];
24
24
  }) => ComponentRegistration | undefined;
25
25
  /**
26
26
  * @deprecated This method is used to maintain the basic component ids (without the prefix 'contentful-') in order to be compatible
@@ -2,7 +2,7 @@ import { EntityStore } from '@contentful/experiences-core';
2
2
  import type { ComponentTreeNode } from '@contentful/experiences-core/types';
3
3
  export declare const deserializeAssemblyNode: ({ node, componentInstanceVariables, }: {
4
4
  node: ComponentTreeNode;
5
- componentInstanceVariables: ComponentTreeNode['variables'];
5
+ componentInstanceVariables: ComponentTreeNode["variables"];
6
6
  }) => ComponentTreeNode;
7
7
  export declare const resolveAssembly: ({ node, entityStore, }: {
8
8
  node: ComponentTreeNode;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.8.2-dev-20240627T0348-ac210ce.0";
1
+ export declare const SDK_VERSION = "1.8.3-dev-20240627T1831-38d15cb.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-sdk-react",
3
- "version": "1.8.2-dev-20240627T0348-ac210ce.0",
3
+ "version": "1.8.3-dev-20240627T1831-38d15cb.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -33,10 +33,10 @@
33
33
  "depcruise": "depcruise src"
34
34
  },
35
35
  "dependencies": {
36
- "@contentful/experiences-components-react": "1.8.2-dev-20240627T0348-ac210ce.0",
37
- "@contentful/experiences-core": "1.8.2-dev-20240627T0348-ac210ce.0",
38
- "@contentful/experiences-validators": "1.8.2-dev-20240627T0348-ac210ce.0",
39
- "@contentful/experiences-visual-editor-react": "1.8.2-dev-20240627T0348-ac210ce.0",
36
+ "@contentful/experiences-components-react": "1.8.3-dev-20240627T1831-38d15cb.0",
37
+ "@contentful/experiences-core": "1.8.3-dev-20240627T1831-38d15cb.0",
38
+ "@contentful/experiences-validators": "1.8.3-dev-20240627T1831-38d15cb.0",
39
+ "@contentful/experiences-visual-editor-react": "1.8.3-dev-20240627T1831-38d15cb.0",
40
40
  "@contentful/rich-text-types": "^16.2.1",
41
41
  "classnames": "^2.3.2",
42
42
  "csstype": "^3.1.2",
@@ -94,5 +94,5 @@
94
94
  "dist",
95
95
  "package.json"
96
96
  ],
97
- "gitHead": "f5770cc7da79fe006e7daada147eadda975d458b"
97
+ "gitHead": "0627de8a1e3794ea329b8f91d2439cb1863ba033"
98
98
  }