@trycourier/courier-react 8.0.7-beta → 8.0.8-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.
@@ -1,5 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  /**
3
- * Converts React node to HTMLElement with synchronous updates
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.
4
7
  */
5
8
  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.7-beta",
3
+ "version": "8.0.8-beta",
4
4
  "description": "The React components for the Courier web UI",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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;"}