@tscircuit/core 0.0.1081 → 0.0.1083
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/README.md +5 -6
- package/dist/index.d.ts +4634 -1
- package/dist/index.js +62 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __export(components_exports, {
|
|
|
16
16
|
CadModel: () => CadModel,
|
|
17
17
|
Capacitor: () => Capacitor,
|
|
18
18
|
Chip: () => Chip,
|
|
19
|
+
Connector: () => Connector,
|
|
19
20
|
Constraint: () => Constraint3,
|
|
20
21
|
CopperPour: () => CopperPour,
|
|
21
22
|
CopperText: () => CopperText,
|
|
@@ -10412,7 +10413,6 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
10412
10413
|
if (this.root?.pcbDisabled) return;
|
|
10413
10414
|
if (!this.pcb_component_id) return;
|
|
10414
10415
|
const { db } = this.root;
|
|
10415
|
-
const { _parsedProps: props } = this;
|
|
10416
10416
|
const bounds = getBoundsOfPcbComponents(this.children);
|
|
10417
10417
|
if (bounds.width === 0 || bounds.height === 0) return;
|
|
10418
10418
|
const center = {
|
|
@@ -18134,7 +18134,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
18134
18134
|
var package_default = {
|
|
18135
18135
|
name: "@tscircuit/core",
|
|
18136
18136
|
type: "module",
|
|
18137
|
-
version: "0.0.
|
|
18137
|
+
version: "0.0.1082",
|
|
18138
18138
|
types: "dist/index.d.ts",
|
|
18139
18139
|
main: "dist/index.js",
|
|
18140
18140
|
module: "dist/index.js",
|
|
@@ -18172,6 +18172,7 @@ var package_default = {
|
|
|
18172
18172
|
"@tscircuit/common": "^0.0.20",
|
|
18173
18173
|
"@tscircuit/copper-pour-solver": "^0.0.20",
|
|
18174
18174
|
"@tscircuit/footprinter": "^0.0.316",
|
|
18175
|
+
"@tscircuit/infer-cable-insertion-point": "^0.0.2",
|
|
18175
18176
|
"@tscircuit/infgrid-ijump-astar": "^0.0.35",
|
|
18176
18177
|
"@tscircuit/log-soup": "^1.0.2",
|
|
18177
18178
|
"@tscircuit/matchpack": "^0.0.16",
|
|
@@ -18192,7 +18193,7 @@ var package_default = {
|
|
|
18192
18193
|
"bun-match-svg": "0.0.12",
|
|
18193
18194
|
"calculate-elbow": "^0.0.12",
|
|
18194
18195
|
"chokidar-cli": "^3.0.0",
|
|
18195
|
-
"circuit-json": "^0.0.
|
|
18196
|
+
"circuit-json": "^0.0.390",
|
|
18196
18197
|
"circuit-json-to-bpc": "^0.0.13",
|
|
18197
18198
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
18198
18199
|
"circuit-json-to-gltf": "^0.0.73",
|
|
@@ -21969,6 +21970,63 @@ var Battery = class extends NormalComponent3 {
|
|
|
21969
21970
|
}
|
|
21970
21971
|
};
|
|
21971
21972
|
|
|
21973
|
+
// lib/components/normal-components/Connector.ts
|
|
21974
|
+
import { guessCableInsertCenter } from "@tscircuit/infer-cable-insertion-point";
|
|
21975
|
+
import { chipProps as chipProps3 } from "@tscircuit/props";
|
|
21976
|
+
var Connector = class extends Chip {
|
|
21977
|
+
get config() {
|
|
21978
|
+
return {
|
|
21979
|
+
componentName: "Connector",
|
|
21980
|
+
zodProps: chipProps3,
|
|
21981
|
+
shouldRenderAsSchematicBox: true
|
|
21982
|
+
};
|
|
21983
|
+
}
|
|
21984
|
+
doInitialSourceRender() {
|
|
21985
|
+
const { db } = this.root;
|
|
21986
|
+
const { _parsedProps: props } = this;
|
|
21987
|
+
const source_component = db.source_component.insert({
|
|
21988
|
+
ftype: "simple_connector",
|
|
21989
|
+
name: this.name,
|
|
21990
|
+
manufacturer_part_number: props.manufacturerPartNumber,
|
|
21991
|
+
supplier_part_numbers: props.supplierPartNumbers,
|
|
21992
|
+
display_name: props.displayName,
|
|
21993
|
+
standard: props.standard
|
|
21994
|
+
});
|
|
21995
|
+
this.source_component_id = source_component.source_component_id;
|
|
21996
|
+
}
|
|
21997
|
+
doInitialPcbComponentSizeCalculation() {
|
|
21998
|
+
super.doInitialPcbComponentSizeCalculation();
|
|
21999
|
+
if (this.root?.pcbDisabled) return;
|
|
22000
|
+
if (!this.pcb_component_id || !this.source_component_id) return;
|
|
22001
|
+
const { db } = this.root;
|
|
22002
|
+
const connectorCircuitJson = db.toArray().filter((elm) => {
|
|
22003
|
+
if (elm.type === "pcb_component") {
|
|
22004
|
+
return elm.pcb_component_id === this.pcb_component_id;
|
|
22005
|
+
}
|
|
22006
|
+
if (elm.type === "source_component") {
|
|
22007
|
+
return elm.source_component_id === this.source_component_id;
|
|
22008
|
+
}
|
|
22009
|
+
if ("pcb_component_id" in elm && elm.pcb_component_id === this.pcb_component_id) {
|
|
22010
|
+
return true;
|
|
22011
|
+
}
|
|
22012
|
+
if ("source_component_id" in elm && elm.source_component_id === this.source_component_id) {
|
|
22013
|
+
return true;
|
|
22014
|
+
}
|
|
22015
|
+
return false;
|
|
22016
|
+
});
|
|
22017
|
+
if (connectorCircuitJson.length === 0) return;
|
|
22018
|
+
const inferredInsertionCenter = guessCableInsertCenter(
|
|
22019
|
+
connectorCircuitJson
|
|
22020
|
+
);
|
|
22021
|
+
db.pcb_component.update(this.pcb_component_id, {
|
|
22022
|
+
cable_insertion_center: {
|
|
22023
|
+
x: inferredInsertionCenter.x,
|
|
22024
|
+
y: inferredInsertionCenter.y
|
|
22025
|
+
}
|
|
22026
|
+
});
|
|
22027
|
+
}
|
|
22028
|
+
};
|
|
22029
|
+
|
|
21972
22030
|
// lib/components/normal-components/PinHeader.ts
|
|
21973
22031
|
import { pinHeaderProps } from "@tscircuit/props";
|
|
21974
22032
|
var PinHeader = class extends NormalComponent3 {
|
|
@@ -24044,6 +24102,7 @@ export {
|
|
|
24044
24102
|
Capacitor,
|
|
24045
24103
|
Chip,
|
|
24046
24104
|
Circuit,
|
|
24105
|
+
Connector,
|
|
24047
24106
|
Constraint3 as Constraint,
|
|
24048
24107
|
CopperPour,
|
|
24049
24108
|
CopperText,
|
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.1083",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@tscircuit/common": "^0.0.20",
|
|
40
40
|
"@tscircuit/copper-pour-solver": "^0.0.20",
|
|
41
41
|
"@tscircuit/footprinter": "^0.0.316",
|
|
42
|
+
"@tscircuit/infer-cable-insertion-point": "^0.0.2",
|
|
42
43
|
"@tscircuit/infgrid-ijump-astar": "^0.0.35",
|
|
43
44
|
"@tscircuit/log-soup": "^1.0.2",
|
|
44
45
|
"@tscircuit/matchpack": "^0.0.16",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"bun-match-svg": "0.0.12",
|
|
60
61
|
"calculate-elbow": "^0.0.12",
|
|
61
62
|
"chokidar-cli": "^3.0.0",
|
|
62
|
-
"circuit-json": "^0.0.
|
|
63
|
+
"circuit-json": "^0.0.390",
|
|
63
64
|
"circuit-json-to-bpc": "^0.0.13",
|
|
64
65
|
"circuit-json-to-connectivity-map": "^0.0.23",
|
|
65
66
|
"circuit-json-to-gltf": "^0.0.73",
|