@embeddable.com/sdk-react 2.2.8 → 2.2.10
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/lib/index.esm.js +47 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +47 -3
- package/lib/index.js.map +1 -1
- package/lib/utils/EntrypointModifier.d.ts +6 -0
- package/lib/utils/entrypointModifiers.d.ts +2 -0
- package/lib/utils/styledComponentsEntrypointModifier.d.ts +8 -0
- package/package.json +1 -1
- package/templates/embeddable-entry-point.jsx.template +4 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntrypointModifier } from "./EntrypointModifier";
|
|
2
|
+
/**
|
|
3
|
+
* Modifies entry point only if there is 'styled-components' in the client's package.json.
|
|
4
|
+
* Imports StyleSheetManager from styled-components and adds shadow root as "target".
|
|
5
|
+
* That will force styled-components to add classes to the customers web-component
|
|
6
|
+
* see https://styled-components.com/docs/api#stylesheetmanager
|
|
7
|
+
*/
|
|
8
|
+
export declare const styledComponentsEntrypointModifier: EntrypointModifier;
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import 'vite/modulepreload-polyfill';
|
|
2
2
|
{{ERROR_FALLBACK_COMPONENT_IMPORT}}
|
|
3
|
+
{{ADDITIONAL_CONTENT_IMPORT}}
|
|
3
4
|
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import ReactDOM from 'react-dom/client';
|
|
@@ -18,7 +19,9 @@ export default (rootEl, componentName, props) => {
|
|
|
18
19
|
root.render(
|
|
19
20
|
<ErrorBoundary fallback={{{ERROR_FALLBACK_COMPONENT}}}>
|
|
20
21
|
<React.Suspense fallback={<div/>}>
|
|
21
|
-
|
|
22
|
+
{{ADDITIONAL_CONTENT_BEGIN}}
|
|
23
|
+
<Component {...props} propsUpdateListener={rootEl} />
|
|
24
|
+
{{ADDITIONAL_CONTENT_END}}
|
|
22
25
|
</React.Suspense>
|
|
23
26
|
</ErrorBoundary>
|
|
24
27
|
);
|