@tscircuit/core 0.0.774 → 0.0.775
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/dist/index.js +61 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9226,6 +9226,47 @@ import { convertCircuitJsonToBpc } from "circuit-json-to-bpc";
|
|
|
9226
9226
|
import { getGraphicsForBpcGraph, layoutSchematicGraphVariants } from "bpc-graph";
|
|
9227
9227
|
import Debug5 from "debug";
|
|
9228
9228
|
import { buildSubtree } from "@tscircuit/circuit-json-util";
|
|
9229
|
+
|
|
9230
|
+
// lib/components/primitive-components/Group/utils/updateSchematicPrimitivesForLayoutShift.ts
|
|
9231
|
+
function updateSchematicPrimitivesForLayoutShift({
|
|
9232
|
+
db,
|
|
9233
|
+
schematicComponentId,
|
|
9234
|
+
deltaX,
|
|
9235
|
+
deltaY
|
|
9236
|
+
}) {
|
|
9237
|
+
const rects = db.schematic_rect.list({
|
|
9238
|
+
schematic_component_id: schematicComponentId
|
|
9239
|
+
});
|
|
9240
|
+
for (const rect of rects) {
|
|
9241
|
+
rect.center.x += deltaX;
|
|
9242
|
+
rect.center.y += deltaY;
|
|
9243
|
+
}
|
|
9244
|
+
const lines = db.schematic_line.list({
|
|
9245
|
+
schematic_component_id: schematicComponentId
|
|
9246
|
+
});
|
|
9247
|
+
for (const line of lines) {
|
|
9248
|
+
line.x1 += deltaX;
|
|
9249
|
+
line.y1 += deltaY;
|
|
9250
|
+
line.x2 += deltaX;
|
|
9251
|
+
line.y2 += deltaY;
|
|
9252
|
+
}
|
|
9253
|
+
const circles = db.schematic_circle.list({
|
|
9254
|
+
schematic_component_id: schematicComponentId
|
|
9255
|
+
});
|
|
9256
|
+
for (const circle of circles) {
|
|
9257
|
+
circle.center.x += deltaX;
|
|
9258
|
+
circle.center.y += deltaY;
|
|
9259
|
+
}
|
|
9260
|
+
const arcs = db.schematic_arc.list({
|
|
9261
|
+
schematic_component_id: schematicComponentId
|
|
9262
|
+
});
|
|
9263
|
+
for (const arc of arcs) {
|
|
9264
|
+
arc.center.x += deltaX;
|
|
9265
|
+
arc.center.y += deltaY;
|
|
9266
|
+
}
|
|
9267
|
+
}
|
|
9268
|
+
|
|
9269
|
+
// lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchAdapt.ts
|
|
9229
9270
|
var debug4 = Debug5("Group_doInitialSchematicLayoutMatchAdapt");
|
|
9230
9271
|
function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
9231
9272
|
const { db } = group.root;
|
|
@@ -9313,6 +9354,12 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
|
|
|
9313
9354
|
text.position.x += positionDelta.x;
|
|
9314
9355
|
text.position.y += positionDelta.y;
|
|
9315
9356
|
}
|
|
9357
|
+
updateSchematicPrimitivesForLayoutShift({
|
|
9358
|
+
db,
|
|
9359
|
+
schematicComponentId: schematic_component2.schematic_component_id,
|
|
9360
|
+
deltaX: positionDelta.x,
|
|
9361
|
+
deltaY: positionDelta.y
|
|
9362
|
+
});
|
|
9316
9363
|
schematic_component2.center = newCenter;
|
|
9317
9364
|
continue;
|
|
9318
9365
|
}
|
|
@@ -9789,7 +9836,7 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
|
|
|
9789
9836
|
if (!treeNode) {
|
|
9790
9837
|
debug5(`Warning: No tree node found for chip: ${chipId}`);
|
|
9791
9838
|
debug5(
|
|
9792
|
-
|
|
9839
|
+
"Available tree nodes:",
|
|
9793
9840
|
tree.childNodes.map((child, idx) => ({
|
|
9794
9841
|
type: child.nodeType,
|
|
9795
9842
|
name: child.nodeType === "component" ? child.sourceComponent?.name : child.sourceGroup?.name,
|
|
@@ -9826,6 +9873,12 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
|
|
|
9826
9873
|
text.position.x += positionDelta.x;
|
|
9827
9874
|
text.position.y += positionDelta.y;
|
|
9828
9875
|
}
|
|
9876
|
+
updateSchematicPrimitivesForLayoutShift({
|
|
9877
|
+
db,
|
|
9878
|
+
schematicComponentId: schematicComponent.schematic_component_id,
|
|
9879
|
+
deltaX: positionDelta.x,
|
|
9880
|
+
deltaY: positionDelta.y
|
|
9881
|
+
});
|
|
9829
9882
|
schematicComponent.center = newCenter;
|
|
9830
9883
|
if (placement.ccwRotationDegrees !== 0) {
|
|
9831
9884
|
debug5(
|
|
@@ -10120,6 +10173,12 @@ function Group_doInitialSchematicLayoutGrid(group) {
|
|
|
10120
10173
|
}
|
|
10121
10174
|
});
|
|
10122
10175
|
}
|
|
10176
|
+
updateSchematicPrimitivesForLayoutShift({
|
|
10177
|
+
db,
|
|
10178
|
+
schematicComponentId: child.schematic_component_id,
|
|
10179
|
+
deltaX,
|
|
10180
|
+
deltaY
|
|
10181
|
+
});
|
|
10123
10182
|
}
|
|
10124
10183
|
}
|
|
10125
10184
|
if (group.schematic_group_id) {
|
|
@@ -16131,7 +16190,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
16131
16190
|
var package_default = {
|
|
16132
16191
|
name: "@tscircuit/core",
|
|
16133
16192
|
type: "module",
|
|
16134
|
-
version: "0.0.
|
|
16193
|
+
version: "0.0.774",
|
|
16135
16194
|
types: "dist/index.d.ts",
|
|
16136
16195
|
main: "dist/index.js",
|
|
16137
16196
|
module: "dist/index.js",
|