@tscircuit/core 0.0.271 → 0.0.272

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -10
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -56,7 +56,9 @@ import { point3, rotation } from "circuit-json";
56
56
  import Debug4 from "debug";
57
57
 
58
58
  // lib/fiber/create-instance-from-react-element.ts
59
+ import React from "react";
59
60
  import ReactReconciler from "react-reconciler";
61
+ import ReactReconciler18 from "react-reconciler-18";
60
62
  import { DefaultEventPriority } from "react-reconciler/constants";
61
63
 
62
64
  // lib/components/base-components/Renderable.ts
@@ -384,7 +386,12 @@ var hostConfig = {
384
386
  maySuspendCommit: () => false,
385
387
  supportsHydration: false
386
388
  };
387
- var reconciler = ReactReconciler(hostConfig);
389
+ var reconciler;
390
+ if (React.version.startsWith("19.")) {
391
+ reconciler = ReactReconciler(hostConfig);
392
+ } else {
393
+ reconciler = ReactReconciler18(hostConfig);
394
+ }
388
395
  var createInstanceFromReactElement = (reactElm) => {
389
396
  const rootContainer = {
390
397
  children: [],
@@ -417,9 +424,14 @@ var createInstanceFromReactElement = (reactElm) => {
417
424
  },
418
425
  null
419
426
  );
420
- reconciler.updateContainerSync(reactElm, container, null, () => {
421
- });
422
- reconciler.flushSyncWork();
427
+ if (React.version.startsWith("19.")) {
428
+ reconciler.updateContainerSync(reactElm, container, null, () => {
429
+ });
430
+ reconciler.flushSyncWork();
431
+ } else {
432
+ reconciler.updateContainer(reactElm, container, null, () => {
433
+ });
434
+ }
423
435
  if (containerErrors.length > 0) {
424
436
  throw containerErrors[0];
425
437
  }
@@ -6436,13 +6448,13 @@ var Project = RootCircuit;
6436
6448
  var Circuit = RootCircuit;
6437
6449
 
6438
6450
  // lib/hooks/use-rendered-circuit.ts
6439
- import React from "react";
6451
+ import React2 from "react";
6440
6452
  var useRenderedCircuit = (reactElements) => {
6441
- const [isLoading, setIsLoading] = React.useState(true);
6442
- const [error, setError] = React.useState(null);
6443
- const [circuit, setCircuit] = React.useState();
6444
- const [circuitJson, setCircuitJson] = React.useState();
6445
- React.useEffect(() => {
6453
+ const [isLoading, setIsLoading] = React2.useState(true);
6454
+ const [error, setError] = React2.useState(null);
6455
+ const [circuit, setCircuit] = React2.useState();
6456
+ const [circuitJson, setCircuitJson] = React2.useState();
6457
+ React2.useEffect(() => {
6446
6458
  setIsLoading(true);
6447
6459
  setError(null);
6448
6460
  if (reactElements) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.271",
4
+ "version": "0.0.272",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -63,6 +63,7 @@
63
63
  "nanoid": "^5.0.7",
64
64
  "performance-now": "^2.1.0",
65
65
  "react-reconciler": "^0.31.0",
66
+ "react-reconciler-18": "npm:react-reconciler@0.29.2",
66
67
  "schematic-symbols": "^0.0.113",
67
68
  "transformation-matrix": "^2.16.1",
68
69
  "zod": "^3.23.8"