@trycourier/courier-react 8.0.6-beta → 8.0.7-beta

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.
@@ -0,0 +1,18 @@
1
+ import * as ReactDOM from "react-dom";
2
+ import { flushSync } from "react-dom";
3
+ class LegacyRenderer {
4
+ static render(node, container) {
5
+ if ("render" in ReactDOM) {
6
+ ReactDOM.render(node, container);
7
+ } else {
8
+ const root = ReactDOM.createRoot(container);
9
+ flushSync(() => {
10
+ root.render(node);
11
+ });
12
+ }
13
+ }
14
+ }
15
+ export {
16
+ LegacyRenderer as default
17
+ };
18
+ //# sourceMappingURL=legacy-O6WN3SMx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-O6WN3SMx.mjs","sources":["../src/renderer/legacy.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { flushSync } from 'react-dom';\n\nexport default class LegacyRenderer {\n\n public static render(node: ReactNode, container: HTMLElement) {\n // Use the render method from ReactDOM if available, otherwise fallback to createRoot\n if ('render' in ReactDOM) {\n (ReactDOM as any).render(node, container);\n } else {\n const root = (ReactDOM as any).createRoot(container);\n flushSync(() => {\n root.render(node);\n });\n }\n }\n\n}"],"names":[],"mappings":";;AAIA,MAAqB,eAAe;AAAA,EAElC,OAAc,OAAO,MAAiB,WAAwB;AAE5D,QAAI,YAAY,UAAU;AACvB,eAAiB,OAAO,MAAM,SAAS;AAAA,IAAA,OACnC;AACC,YAAA,OAAQ,SAAiB,WAAW,SAAS;AACnD,gBAAU,MAAM;AACd,aAAK,OAAO,IAAI;AAAA,MAAA,CACjB;AAAA,IAAA;AAAA,EACH;AAGJ;"}
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export default class LegacyRenderer {
3
+ static render(node: ReactNode, container: HTMLElement): void;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ export default class ModernRenderer {
3
+ static render(node: ReactNode, container: HTMLElement): void;
4
+ }
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from 'react';
2
+ export default class Renderer {
3
+ private static reactVersion;
4
+ static render(node: ReactNode, container: HTMLElement): Promise<void>;
5
+ }
@@ -1,8 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
  /**
3
- * Converts a React node to an HTMLElement.
4
- * This function uses flushSync to ensure the DOM is updated synchronously.
5
- * @param node - The React node to convert.
6
- * @returns The converted HTMLElement.
3
+ * Converts React node to HTMLElement with synchronous updates
7
4
  */
8
5
  export declare function reactNodeToHTMLElement(node: ReactNode): HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier-react",
3
- "version": "8.0.6-beta",
3
+ "version": "8.0.7-beta",
4
4
  "description": "The React components for the Courier web UI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -31,15 +31,20 @@
31
31
  "@trycourier/courier-ui-inbox": "1.0.6-beta"
32
32
  },
33
33
  "peerDependencies": {
34
- "react": ">=17.0.0",
35
- "react-dom": ">=17.0.0"
34
+ "react": ">=17.0.2",
35
+ "react-dom": ">=17.0.2"
36
+ },
37
+ "peerDependenciesMeta": {
38
+ "object-assign": {
39
+ "optional": true
40
+ }
36
41
  },
37
42
  "devDependencies": {
38
43
  "@trycourier/courier-ui-inbox": "file:../@trycourier/courier-ui-inbox",
39
44
  "@types/react": "19.1.0",
40
45
  "@types/react-dom": "19.1.0",
41
46
  "@vitejs/plugin-react": "4.4.1",
42
- "react": ">=17.0.0",
43
- "react-dom": ">=17.0.0"
47
+ "react": ">=17.0.2",
48
+ "react-dom": ">=17.0.2"
44
49
  }
45
50
  }