@tscircuit/core 0.0.688 → 0.0.690
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 +2903 -219
- package/dist/index.js +31 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -85,6 +85,7 @@ import Debug from "debug";
|
|
|
85
85
|
var debug = Debug("tscircuit:renderable");
|
|
86
86
|
var orderedRenderPhases = [
|
|
87
87
|
"ReactSubtreesRender",
|
|
88
|
+
"SourceNameDuplicateComponentRemoval",
|
|
88
89
|
"PcbFootprintStringRender",
|
|
89
90
|
"InitializePortsFromChildren",
|
|
90
91
|
"CreateNetsFromProps",
|
|
@@ -6507,6 +6508,32 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
6507
6508
|
this._addChildrenFromStringFootprint();
|
|
6508
6509
|
this.initPorts();
|
|
6509
6510
|
}
|
|
6511
|
+
doInitialSourceNameDuplicateComponentRemoval() {
|
|
6512
|
+
if (!this.name) return;
|
|
6513
|
+
const root = this.root;
|
|
6514
|
+
const componentsWithSameName = this.getSubcircuit().selectAll(
|
|
6515
|
+
`.${this.name}`
|
|
6516
|
+
);
|
|
6517
|
+
const conflictingComponents = componentsWithSameName.filter(
|
|
6518
|
+
(component) => component !== this && component._isNormalComponent && component.renderPhaseStates?.SourceNameDuplicateComponentRemoval?.initialized
|
|
6519
|
+
);
|
|
6520
|
+
if (conflictingComponents.length > 0) {
|
|
6521
|
+
const pcbPosition = this._getGlobalPcbPositionBeforeLayout();
|
|
6522
|
+
const schematicPosition = this._getGlobalSchematicPositionBeforeLayout();
|
|
6523
|
+
root.db.source_failed_to_create_component_error.insert({
|
|
6524
|
+
component_name: this.name,
|
|
6525
|
+
error_type: "source_failed_to_create_component_error",
|
|
6526
|
+
message: `Cannot create component "${this.name}": A component with the same name already exists`,
|
|
6527
|
+
pcb_center: pcbPosition,
|
|
6528
|
+
schematic_center: schematicPosition
|
|
6529
|
+
});
|
|
6530
|
+
this.shouldBeRemoved = true;
|
|
6531
|
+
const childrenToRemove = [...this.children];
|
|
6532
|
+
for (const child of childrenToRemove) {
|
|
6533
|
+
this.remove(child);
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
}
|
|
6510
6537
|
/**
|
|
6511
6538
|
* Override this method for better control over the auto-discovery of ports.
|
|
6512
6539
|
*
|
|
@@ -7251,6 +7278,7 @@ var NormalComponent = class extends PrimitiveComponent2 {
|
|
|
7251
7278
|
source_component_id: this.source_component_id,
|
|
7252
7279
|
model_stl_url: "stlUrl" in (cadModel ?? {}) ? this._addCachebustToModelUrl(cadModel.stlUrl) : void 0,
|
|
7253
7280
|
model_obj_url: "objUrl" in (cadModel ?? {}) ? this._addCachebustToModelUrl(cadModel.objUrl) : void 0,
|
|
7281
|
+
model_gltf_url: "gltfUrl" in (cadModel ?? {}) ? this._addCachebustToModelUrl(cadModel.gltfUrl) : void 0,
|
|
7254
7282
|
model_jscad: "jscad" in (cadModel ?? {}) ? cadModel.jscad : void 0,
|
|
7255
7283
|
footprinter_string: typeof footprint === "string" && !cadModel ? footprint : void 0
|
|
7256
7284
|
});
|
|
@@ -14089,7 +14117,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
14089
14117
|
var package_default = {
|
|
14090
14118
|
name: "@tscircuit/core",
|
|
14091
14119
|
type: "module",
|
|
14092
|
-
version: "0.0.
|
|
14120
|
+
version: "0.0.689",
|
|
14093
14121
|
types: "dist/index.d.ts",
|
|
14094
14122
|
main: "dist/index.js",
|
|
14095
14123
|
module: "dist/index.js",
|
|
@@ -14128,7 +14156,7 @@ var package_default = {
|
|
|
14128
14156
|
"@tscircuit/matchpack": "^0.0.16",
|
|
14129
14157
|
"@tscircuit/math-utils": "^0.0.18",
|
|
14130
14158
|
"@tscircuit/miniflex": "^0.0.4",
|
|
14131
|
-
"@tscircuit/props": "0.0.
|
|
14159
|
+
"@tscircuit/props": "0.0.297",
|
|
14132
14160
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
14133
14161
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
14134
14162
|
"@tscircuit/schematic-trace-solver": "^0.0.25",
|
|
@@ -14142,7 +14170,7 @@ var package_default = {
|
|
|
14142
14170
|
"bun-match-svg": "0.0.12",
|
|
14143
14171
|
"calculate-elbow": "^0.0.9",
|
|
14144
14172
|
"chokidar-cli": "^3.0.0",
|
|
14145
|
-
"circuit-json": "^0.0.
|
|
14173
|
+
"circuit-json": "^0.0.242",
|
|
14146
14174
|
"circuit-json-to-bpc": "^0.0.13",
|
|
14147
14175
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
14148
14176
|
"circuit-json-to-simple-3d": "^0.0.6",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.690",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@tscircuit/matchpack": "^0.0.16",
|
|
41
41
|
"@tscircuit/math-utils": "^0.0.18",
|
|
42
42
|
"@tscircuit/miniflex": "^0.0.4",
|
|
43
|
-
"@tscircuit/props": "0.0.
|
|
43
|
+
"@tscircuit/props": "0.0.297",
|
|
44
44
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
45
45
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
46
46
|
"@tscircuit/schematic-trace-solver": "^0.0.25",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"bun-match-svg": "0.0.12",
|
|
55
55
|
"calculate-elbow": "^0.0.9",
|
|
56
56
|
"chokidar-cli": "^3.0.0",
|
|
57
|
-
"circuit-json": "^0.0.
|
|
57
|
+
"circuit-json": "^0.0.242",
|
|
58
58
|
"circuit-json-to-bpc": "^0.0.13",
|
|
59
59
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
60
60
|
"circuit-json-to-simple-3d": "^0.0.6",
|