@tscircuit/core 0.0.1031 → 0.0.1033
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.d.ts +1 -0
- package/dist/index.js +34 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -65593,6 +65593,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
65593
65593
|
};
|
|
65594
65594
|
private _resolvePoint;
|
|
65595
65595
|
doInitialPcbPrimitiveRender(): void;
|
|
65596
|
+
doInitialPcbLayout(): void;
|
|
65596
65597
|
getPcbSize(): {
|
|
65597
65598
|
width: number;
|
|
65598
65599
|
height: number;
|
package/dist/index.js
CHANGED
|
@@ -11240,6 +11240,7 @@ function Group_doInitialPcbCalcPlacementResolution(group) {
|
|
|
11240
11240
|
inDegree.set(component.name, 0);
|
|
11241
11241
|
}
|
|
11242
11242
|
for (const [candidateName, candidate] of candidatesByName.entries()) {
|
|
11243
|
+
const referencedCandidateNames = /* @__PURE__ */ new Set();
|
|
11243
11244
|
for (const token of candidate.refs) {
|
|
11244
11245
|
const { referencePath, field } = parseComponentReferenceToken(token);
|
|
11245
11246
|
if (!SUPPORTED_COMPONENT_FIELDS.has(field)) {
|
|
@@ -11254,12 +11255,15 @@ function Group_doInitialPcbCalcPlacementResolution(group) {
|
|
|
11254
11255
|
normalComponentNameMap
|
|
11255
11256
|
});
|
|
11256
11257
|
if (candidatesByName.has(referencedComponentName) && referencedComponentName !== candidateName) {
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11258
|
+
referencedCandidateNames.add(referencedComponentName);
|
|
11259
|
+
}
|
|
11260
|
+
}
|
|
11261
|
+
for (const referencedComponentName of referencedCandidateNames) {
|
|
11262
|
+
inDegree.set(candidateName, (inDegree.get(candidateName) ?? 0) + 1);
|
|
11263
|
+
if (!dependents.has(referencedComponentName)) {
|
|
11264
|
+
dependents.set(referencedComponentName, /* @__PURE__ */ new Set());
|
|
11262
11265
|
}
|
|
11266
|
+
dependents.get(referencedComponentName).add(candidateName);
|
|
11263
11267
|
}
|
|
11264
11268
|
}
|
|
11265
11269
|
const queue = [...inDegree.entries()].filter(([, degree]) => degree === 0).map(([name]) => name);
|
|
@@ -12531,7 +12535,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
12531
12535
|
var package_default = {
|
|
12532
12536
|
name: "@tscircuit/core",
|
|
12533
12537
|
type: "module",
|
|
12534
|
-
version: "0.0.
|
|
12538
|
+
version: "0.0.1032",
|
|
12535
12539
|
types: "dist/index.d.ts",
|
|
12536
12540
|
main: "dist/index.js",
|
|
12537
12541
|
module: "dist/index.js",
|
|
@@ -20049,6 +20053,17 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
20049
20053
|
this.renderError(`PcbNoteDimension could not find selector "${input}"`);
|
|
20050
20054
|
return applyToPoint16(transform, { x: 0, y: 0 });
|
|
20051
20055
|
}
|
|
20056
|
+
const targetPcbComponentId = target.pcb_component_id;
|
|
20057
|
+
const root = this.root;
|
|
20058
|
+
if (targetPcbComponentId && root) {
|
|
20059
|
+
const pcbComponent = root.db.pcb_component.get(targetPcbComponentId);
|
|
20060
|
+
if (pcbComponent?.center) {
|
|
20061
|
+
return {
|
|
20062
|
+
x: pcbComponent.center.x,
|
|
20063
|
+
y: pcbComponent.center.y
|
|
20064
|
+
};
|
|
20065
|
+
}
|
|
20066
|
+
}
|
|
20052
20067
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
20053
20068
|
}
|
|
20054
20069
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
@@ -20080,6 +20095,19 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
20080
20095
|
});
|
|
20081
20096
|
this.pcb_note_dimension_id = pcb_note_dimension.pcb_note_dimension_id;
|
|
20082
20097
|
}
|
|
20098
|
+
doInitialPcbLayout() {
|
|
20099
|
+
const root = this.root;
|
|
20100
|
+
if (!root || root.pcbDisabled) return;
|
|
20101
|
+
if (!this.pcb_note_dimension_id) return;
|
|
20102
|
+
const { db } = root;
|
|
20103
|
+
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
20104
|
+
const from = this._resolvePoint(this._parsedProps.from, transform);
|
|
20105
|
+
const to = this._resolvePoint(this._parsedProps.to, transform);
|
|
20106
|
+
db.pcb_note_dimension.update(this.pcb_note_dimension_id, {
|
|
20107
|
+
from,
|
|
20108
|
+
to
|
|
20109
|
+
});
|
|
20110
|
+
}
|
|
20083
20111
|
getPcbSize() {
|
|
20084
20112
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
20085
20113
|
const from = this._resolvePoint(this._parsedProps.from, transform);
|