@tscircuit/core 0.0.1145 → 0.0.1146

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.
Files changed (2) hide show
  1. package/dist/index.js +69 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8500,6 +8500,73 @@ var getCenterOfPcbPrimitives = (pcbPrimitives) => {
8500
8500
  };
8501
8501
  };
8502
8502
 
8503
+ // lib/components/primitive-components/Port/apply-pin-attributes-to-source-port.ts
8504
+ var applyPinAttributesToSourcePort = (sourcePortProps, attributes) => {
8505
+ if (attributes.mustBeConnected !== void 0) {
8506
+ sourcePortProps.must_be_connected = attributes.mustBeConnected;
8507
+ }
8508
+ if (attributes.providesPower !== void 0) {
8509
+ sourcePortProps.provides_power = attributes.providesPower;
8510
+ }
8511
+ if (attributes.requiresPower !== void 0) {
8512
+ sourcePortProps.requires_power = attributes.requiresPower;
8513
+ }
8514
+ if (attributes.providesGround !== void 0) {
8515
+ sourcePortProps.provides_ground = attributes.providesGround;
8516
+ }
8517
+ if (attributes.requiresGround !== void 0) {
8518
+ sourcePortProps.requires_ground = attributes.requiresGround;
8519
+ }
8520
+ if (attributes.providesVoltage !== void 0) {
8521
+ sourcePortProps.provides_voltage = attributes.providesVoltage;
8522
+ }
8523
+ if (attributes.requiresVoltage !== void 0) {
8524
+ sourcePortProps.requires_voltage = attributes.requiresVoltage;
8525
+ }
8526
+ if (attributes.doNotConnect !== void 0) {
8527
+ sourcePortProps.do_not_connect = attributes.doNotConnect;
8528
+ }
8529
+ if (attributes.includeInBoardPinout !== void 0) {
8530
+ sourcePortProps.include_in_board_pinout = attributes.includeInBoardPinout;
8531
+ }
8532
+ if (attributes.canUseInternalPullup !== void 0) {
8533
+ sourcePortProps.can_use_internal_pullup = attributes.canUseInternalPullup;
8534
+ }
8535
+ if (attributes.isUsingInternalPullup !== void 0) {
8536
+ sourcePortProps.is_using_internal_pullup = attributes.isUsingInternalPullup;
8537
+ }
8538
+ if (attributes.needsExternalPullup !== void 0) {
8539
+ sourcePortProps.needs_external_pullup = attributes.needsExternalPullup;
8540
+ }
8541
+ if (attributes.canUseInternalPulldown !== void 0) {
8542
+ sourcePortProps.can_use_internal_pulldown = attributes.canUseInternalPulldown;
8543
+ }
8544
+ if (attributes.isUsingInternalPulldown !== void 0) {
8545
+ sourcePortProps.is_using_internal_pulldown = attributes.isUsingInternalPulldown;
8546
+ }
8547
+ if (attributes.needsExternalPulldown !== void 0) {
8548
+ sourcePortProps.needs_external_pulldown = attributes.needsExternalPulldown;
8549
+ }
8550
+ if (attributes.canUseOpenDrain !== void 0) {
8551
+ sourcePortProps.can_use_open_drain = attributes.canUseOpenDrain;
8552
+ }
8553
+ if (attributes.isUsingOpenDrain !== void 0) {
8554
+ sourcePortProps.is_using_open_drain = attributes.isUsingOpenDrain;
8555
+ }
8556
+ if (attributes.canUsePushPull !== void 0) {
8557
+ sourcePortProps.can_use_push_pull = attributes.canUsePushPull;
8558
+ }
8559
+ if (attributes.isUsingPushPull !== void 0) {
8560
+ sourcePortProps.is_using_push_pull = attributes.isUsingPushPull;
8561
+ }
8562
+ if (attributes.shouldHaveDecouplingCapacitor !== void 0) {
8563
+ sourcePortProps.should_have_decoupling_capacitor = attributes.shouldHaveDecouplingCapacitor;
8564
+ }
8565
+ if (attributes.recommendedDecouplingCapacitorCapacitance !== void 0) {
8566
+ sourcePortProps.recommended_decoupling_capacitor_capacitance = attributes.recommendedDecouplingCapacitorCapacitance;
8567
+ }
8568
+ };
8569
+
8503
8570
  // lib/components/primitive-components/Port/Port.ts
8504
8571
  var portProps = z7.object({
8505
8572
  name: z7.string().optional(),
@@ -8780,9 +8847,7 @@ var Port = class extends PrimitiveComponent2 {
8780
8847
  const pinAttributes = this._getMatchingPinAttributes();
8781
8848
  const portAttributesFromParent = {};
8782
8849
  for (const attributes of pinAttributes) {
8783
- if (attributes.mustBeConnected !== void 0) {
8784
- portAttributesFromParent.must_be_connected = attributes.mustBeConnected;
8785
- }
8850
+ applyPinAttributesToSourcePort(portAttributesFromParent, attributes);
8786
8851
  }
8787
8852
  const source_port = db.source_port.insert({
8788
8853
  name: props.name,
@@ -19080,7 +19145,7 @@ import { identity as identity5 } from "transformation-matrix";
19080
19145
  var package_default = {
19081
19146
  name: "@tscircuit/core",
19082
19147
  type: "module",
19083
- version: "0.0.1144",
19148
+ version: "0.0.1145",
19084
19149
  types: "dist/index.d.ts",
19085
19150
  main: "dist/index.js",
19086
19151
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1145",
4
+ "version": "0.0.1146",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",