@tscircuit/core 0.0.1033 → 0.0.1034
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 +24 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12535,7 +12535,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
12535
12535
|
var package_default = {
|
|
12536
12536
|
name: "@tscircuit/core",
|
|
12537
12537
|
type: "module",
|
|
12538
|
-
version: "0.0.
|
|
12538
|
+
version: "0.0.1033",
|
|
12539
12539
|
types: "dist/index.d.ts",
|
|
12540
12540
|
main: "dist/index.js",
|
|
12541
12541
|
module: "dist/index.js",
|
|
@@ -13467,6 +13467,21 @@ function rotateDirection(direction, degrees) {
|
|
|
13467
13467
|
const newIndex = (currentIndex + steps) % 4;
|
|
13468
13468
|
return directions[newIndex < 0 ? newIndex + 4 : newIndex];
|
|
13469
13469
|
}
|
|
13470
|
+
function isTreeChildExplicitlyPositioned(treeChild, group) {
|
|
13471
|
+
if (treeChild.nodeType === "component" && treeChild.sourceComponent) {
|
|
13472
|
+
const component = group.children.find(
|
|
13473
|
+
(groupChild) => groupChild.source_component_id === treeChild.sourceComponent?.source_component_id
|
|
13474
|
+
);
|
|
13475
|
+
return component?._parsedProps?.schX !== void 0 || component?._parsedProps?.schY !== void 0;
|
|
13476
|
+
}
|
|
13477
|
+
if (treeChild.nodeType === "group" && treeChild.sourceGroup) {
|
|
13478
|
+
const nestedGroup = group.children.find(
|
|
13479
|
+
(groupChild) => groupChild.source_group_id === treeChild.sourceGroup?.source_group_id
|
|
13480
|
+
);
|
|
13481
|
+
return nestedGroup?._parsedProps?.schX !== void 0 || nestedGroup?._parsedProps?.schY !== void 0;
|
|
13482
|
+
}
|
|
13483
|
+
return false;
|
|
13484
|
+
}
|
|
13470
13485
|
function convertTreeToInputProblem(tree, db, group) {
|
|
13471
13486
|
const problem = {
|
|
13472
13487
|
chipMap: {},
|
|
@@ -13482,6 +13497,12 @@ function convertTreeToInputProblem(tree, db, group) {
|
|
|
13482
13497
|
`[${group.name}] Processing ${tree.childNodes.length} child nodes for input problem`
|
|
13483
13498
|
);
|
|
13484
13499
|
tree.childNodes.forEach((child, index) => {
|
|
13500
|
+
if (isTreeChildExplicitlyPositioned(child, group)) {
|
|
13501
|
+
debug6(
|
|
13502
|
+
`[${group.name}] Skipping explicitly positioned child ${index} from matchpack`
|
|
13503
|
+
);
|
|
13504
|
+
return;
|
|
13505
|
+
}
|
|
13485
13506
|
debug6(
|
|
13486
13507
|
`[${group.name}] Processing child ${index}: nodeType=${child.nodeType}`
|
|
13487
13508
|
);
|
|
@@ -16099,6 +16120,7 @@ var Group = class extends NormalComponent3 {
|
|
|
16099
16120
|
}
|
|
16100
16121
|
_getSchematicLayoutMode() {
|
|
16101
16122
|
const props = this._parsedProps;
|
|
16123
|
+
const schAutoLayoutEnabled = props.schAutoLayoutEnabled ?? false;
|
|
16102
16124
|
if (props.schLayout?.layoutMode === "none") return "relative";
|
|
16103
16125
|
if (props.schLayout?.layoutMode === "relative") return "relative";
|
|
16104
16126
|
if (props.schLayout?.matchAdapt) return "match-adapt";
|
|
@@ -16117,6 +16139,7 @@ var Group = class extends NormalComponent3 {
|
|
|
16117
16139
|
return cProps?.schX !== void 0 || cProps?.schY !== void 0;
|
|
16118
16140
|
});
|
|
16119
16141
|
const hasManualEdits = (props.manualEdits?.schematic_placements?.length ?? 0) > 0;
|
|
16142
|
+
if (schAutoLayoutEnabled && !hasManualEdits) return "match-adapt";
|
|
16120
16143
|
if (!anyChildHasSchCoords && !hasManualEdits) return "match-adapt";
|
|
16121
16144
|
return "relative";
|
|
16122
16145
|
}
|