@tscircuit/core 0.0.623 → 0.0.625

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 CHANGED
@@ -11572,6 +11572,7 @@ declare class Resonator extends NormalComponent<typeof resonatorProps> {
11572
11572
  shouldRenderAsSchematicBox: boolean;
11573
11573
  };
11574
11574
  doInitialSourceRender(): void;
11575
+ _getSchematicSymbolDisplayValue(): string | undefined;
11575
11576
  }
11576
11577
 
11577
11578
  declare class Inductor extends NormalComponent<typeof inductorProps, PassivePorts> {
package/dist/index.js CHANGED
@@ -7952,6 +7952,20 @@ import {
7952
7952
  import { LayoutPipelineSolver } from "@tscircuit/matchpack";
7953
7953
  import Debug6 from "debug";
7954
7954
  var debug5 = Debug6("Group_doInitialSchematicLayoutMatchpack");
7955
+ function facingDirectionToSide(facingDirection) {
7956
+ switch (facingDirection) {
7957
+ case "up":
7958
+ return "y+";
7959
+ case "down":
7960
+ return "y-";
7961
+ case "left":
7962
+ return "x-";
7963
+ case "right":
7964
+ return "x+";
7965
+ default:
7966
+ return "y+";
7967
+ }
7968
+ }
7955
7969
  function rotateDirection(direction, degrees) {
7956
7970
  const directions = [
7957
7971
  "up",
@@ -7977,7 +7991,18 @@ function convertTreeToInputProblem(tree, db, group) {
7977
7991
  chipGap: 0.4,
7978
7992
  partitionGap: 1.2
7979
7993
  };
7994
+ debug5(
7995
+ `[${group.name}] Processing ${tree.childNodes.length} child nodes for input problem`
7996
+ );
7980
7997
  tree.childNodes.forEach((child, index) => {
7998
+ debug5(
7999
+ `[${group.name}] Processing child ${index}: nodeType=${child.nodeType}`
8000
+ );
8001
+ if (child.nodeType === "component") {
8002
+ debug5(`[${group.name}] - Component: ${child.sourceComponent?.name}`);
8003
+ } else if (child.nodeType === "group") {
8004
+ debug5(`[${group.name}] - Group: ${child.sourceGroup?.name}`);
8005
+ }
7981
8006
  if (child.nodeType === "component" && child.sourceComponent) {
7982
8007
  const chipId = child.sourceComponent.name || `chip_${index}`;
7983
8008
  const schematicComponent = db.schematic_component.getWhere({
@@ -8011,21 +8036,7 @@ function convertTreeToInputProblem(tree, db, group) {
8011
8036
  if (!sourcePort) continue;
8012
8037
  const pinId = `${chipId}.${sourcePort.pin_number || sourcePort.name || port.schematic_port_id}`;
8013
8038
  problem.chipMap[chipId].pins.push(pinId);
8014
- let side = "y+";
8015
- switch (port.facing_direction) {
8016
- case "up":
8017
- side = "y+";
8018
- break;
8019
- case "down":
8020
- side = "y-";
8021
- break;
8022
- case "left":
8023
- side = "x-";
8024
- break;
8025
- case "right":
8026
- side = "x+";
8027
- break;
8028
- }
8039
+ const side = facingDirectionToSide(port.facing_direction);
8029
8040
  problem.chipPinMap[pinId] = {
8030
8041
  pinId,
8031
8042
  offset: {
@@ -8037,67 +8048,226 @@ function convertTreeToInputProblem(tree, db, group) {
8037
8048
  }
8038
8049
  } else if (child.nodeType === "group" && child.sourceGroup) {
8039
8050
  const groupId = child.sourceGroup.name || `group_${index}`;
8051
+ debug5(`[${group.name}] Processing nested group: ${groupId}`);
8040
8052
  const schematicGroup = db.schematic_group?.getWhere?.({
8041
8053
  source_group_id: child.sourceGroup.source_group_id
8042
8054
  });
8055
+ debug5(
8056
+ `[${group.name}] Found schematic_group for ${groupId}:`,
8057
+ schematicGroup
8058
+ );
8043
8059
  if (schematicGroup) {
8060
+ debug5(`[${group.name}] Treating group ${groupId} as composite chip`);
8061
+ const groupComponents = db.schematic_component.list({
8062
+ schematic_group_id: schematicGroup.schematic_group_id
8063
+ });
8064
+ debug5(
8065
+ `[${group.name}] Group ${groupId} has ${groupComponents.length} components:`,
8066
+ groupComponents.map((c) => c.source_component_id)
8067
+ );
8068
+ let minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;
8069
+ let hasValidBounds = false;
8070
+ for (const comp of groupComponents) {
8071
+ if (comp.center && comp.size) {
8072
+ hasValidBounds = true;
8073
+ const halfWidth = comp.size.width / 2;
8074
+ const halfHeight = comp.size.height / 2;
8075
+ minX = Math.min(minX, comp.center.x - halfWidth);
8076
+ maxX = Math.max(maxX, comp.center.x + halfWidth);
8077
+ minY = Math.min(minY, comp.center.y - halfHeight);
8078
+ maxY = Math.max(maxY, comp.center.y + halfHeight);
8079
+ }
8080
+ }
8081
+ const groupWidth = hasValidBounds ? maxX - minX : 2;
8082
+ const groupHeight = hasValidBounds ? maxY - minY : 2;
8083
+ debug5(
8084
+ `[${group.name}] Group ${groupId} computed size: ${groupWidth} x ${groupHeight}`
8085
+ );
8086
+ const groupPins = [];
8087
+ for (const comp of groupComponents) {
8088
+ const ports = db.schematic_port.list({
8089
+ schematic_component_id: comp.schematic_component_id
8090
+ });
8091
+ for (const port of ports) {
8092
+ const sourcePort = db.source_port.get(port.source_port_id);
8093
+ if (!sourcePort) continue;
8094
+ const pinId = `${groupId}.${sourcePort.pin_number || sourcePort.name || port.schematic_port_id}`;
8095
+ groupPins.push(pinId);
8096
+ const groupCenter = schematicGroup.center || { x: 0, y: 0 };
8097
+ const side = facingDirectionToSide(port.facing_direction);
8098
+ problem.chipPinMap[pinId] = {
8099
+ pinId,
8100
+ offset: {
8101
+ x: (port.center?.x || 0) - groupCenter.x,
8102
+ y: (port.center?.y || 0) - groupCenter.y
8103
+ },
8104
+ side
8105
+ };
8106
+ }
8107
+ }
8108
+ debug5(
8109
+ `[${group.name}] Group ${groupId} has ${groupPins.length} pins:`,
8110
+ groupPins
8111
+ );
8044
8112
  problem.chipMap[groupId] = {
8045
8113
  chipId: groupId,
8046
- pins: [],
8114
+ pins: groupPins,
8047
8115
  size: {
8048
- x: schematicGroup.size?.width || 2,
8049
- y: schematicGroup.size?.height || 2
8116
+ x: groupWidth,
8117
+ y: groupHeight
8050
8118
  }
8051
8119
  };
8120
+ debug5(`[${group.name}] Added group ${groupId} to chipMap`);
8121
+ } else {
8122
+ debug5(
8123
+ `[${group.name}] Warning: No schematic_group found for group ${groupId}`
8124
+ );
8052
8125
  }
8053
8126
  }
8054
8127
  });
8055
- const sourceTraces = db.source_trace.list();
8056
- const sourceNets = db.source_net.list();
8057
- for (const net of sourceNets) {
8058
- problem.netMap[net.name || net.source_net_id] = {
8059
- netId: net.name || net.source_net_id
8060
- };
8061
- }
8062
- for (const trace of sourceTraces) {
8063
- const connectedPorts = trace.connected_source_port_ids || [];
8064
- const connectedNets = trace.connected_source_net_ids || [];
8065
- const relevantPins = [];
8066
- for (const portId of connectedPorts) {
8067
- const sourcePort = db.source_port.get(portId);
8068
- if (!sourcePort) continue;
8069
- for (const [chipId, chip] of Object.entries(problem.chipMap)) {
8070
- const chipSourceComponent = tree.childNodes.find(
8071
- (n) => n.sourceComponent?.name === chipId
8072
- )?.sourceComponent;
8073
- if (chipSourceComponent) {
8074
- const isPortInComponent = db.source_port.list({
8075
- source_component_id: chipSourceComponent.source_component_id
8076
- }).some((p) => p.source_port_id === portId);
8077
- if (isPortInComponent) {
8078
- const pinNumber = sourcePort.pin_number || sourcePort.name;
8079
- const expectedPinId = `${chipId}.${pinNumber}`;
8080
- if (chip.pins.includes(expectedPinId)) {
8081
- relevantPins.push(expectedPinId);
8082
- } else {
8083
- debug5(
8084
- `Warning: Could not find pin ${expectedPinId} in chip ${chipId}`
8085
- );
8128
+ debug5(`[${group.name}] Creating connections using connectivity keys`);
8129
+ const connectivityGroups = /* @__PURE__ */ new Map();
8130
+ for (const [chipId, chip] of Object.entries(problem.chipMap)) {
8131
+ for (const pinId of chip.pins) {
8132
+ const pinNumber = pinId.split(".").pop();
8133
+ const treeNode = tree.childNodes.find((child) => {
8134
+ if (child.nodeType === "component" && child.sourceComponent) {
8135
+ return child.sourceComponent.name === chipId;
8136
+ }
8137
+ if (child.nodeType === "group" && child.sourceGroup) {
8138
+ const expectedChipId = `group_${tree.childNodes.indexOf(child)}`;
8139
+ return expectedChipId === chipId;
8140
+ }
8141
+ return false;
8142
+ });
8143
+ if (treeNode?.nodeType === "group" && treeNode.sourceGroup) {
8144
+ const schematicGroup = db.schematic_group?.getWhere?.({
8145
+ source_group_id: treeNode.sourceGroup.source_group_id
8146
+ });
8147
+ if (schematicGroup) {
8148
+ const groupComponents = db.schematic_component.list({
8149
+ schematic_group_id: schematicGroup.schematic_group_id
8150
+ });
8151
+ for (const comp of groupComponents) {
8152
+ const sourcePorts = db.source_port.list({
8153
+ source_component_id: comp.source_component_id
8154
+ });
8155
+ for (const sourcePort of sourcePorts) {
8156
+ const portNumber = sourcePort.pin_number || sourcePort.name;
8157
+ if (String(portNumber) === String(pinNumber)) {
8158
+ if (sourcePort.subcircuit_connectivity_map_key) {
8159
+ const connectivityKey = sourcePort.subcircuit_connectivity_map_key;
8160
+ if (!connectivityGroups.has(connectivityKey)) {
8161
+ connectivityGroups.set(connectivityKey, []);
8162
+ }
8163
+ connectivityGroups.get(connectivityKey).push(pinId);
8164
+ debug5(
8165
+ `[${group.name}] \u2713 Pin ${pinId} has connectivity key: ${connectivityKey}`
8166
+ );
8167
+ } else {
8168
+ debug5(`[${group.name}] Pin ${pinId} has no connectivity key`);
8169
+ }
8170
+ }
8171
+ }
8172
+ }
8173
+ }
8174
+ } else if (treeNode?.nodeType === "component" && treeNode.sourceComponent) {
8175
+ const sourcePorts = db.source_port.list({
8176
+ source_component_id: treeNode.sourceComponent.source_component_id
8177
+ });
8178
+ for (const sourcePort of sourcePorts) {
8179
+ const portNumber = sourcePort.pin_number || sourcePort.name;
8180
+ if (String(portNumber) === String(pinNumber) && sourcePort.subcircuit_connectivity_map_key) {
8181
+ const connectivityKey = sourcePort.subcircuit_connectivity_map_key;
8182
+ if (!connectivityGroups.has(connectivityKey)) {
8183
+ connectivityGroups.set(connectivityKey, []);
8086
8184
  }
8185
+ connectivityGroups.get(connectivityKey).push(pinId);
8186
+ debug5(
8187
+ `[${group.name}] Pin ${pinId} has connectivity key: ${connectivityKey}`
8188
+ );
8087
8189
  }
8088
8190
  }
8089
8191
  }
8090
8192
  }
8091
- if (relevantPins.length === 2 && connectedNets.length === 0) {
8092
- const [pin1, pin2] = relevantPins;
8093
- problem.pinStrongConnMap[`${pin1}-${pin2}`] = true;
8094
- problem.pinStrongConnMap[`${pin2}-${pin1}`] = true;
8095
- }
8096
- for (const pinId of relevantPins) {
8097
- for (const netId of connectedNets) {
8098
- const net = db.source_net.get(netId);
8099
- const netName = net?.name || netId;
8100
- problem.netConnMap[`${pinId}-${netName}`] = true;
8193
+ }
8194
+ debug5(
8195
+ `[${group.name}] Found ${connectivityGroups.size} connectivity groups:`,
8196
+ Array.from(connectivityGroups.entries()).map(([key, pins]) => ({
8197
+ key,
8198
+ pins
8199
+ }))
8200
+ );
8201
+ for (const [connectivityKey, pins] of connectivityGroups) {
8202
+ if (pins.length >= 2) {
8203
+ const tracesWithThisKey = db.source_trace.list().filter(
8204
+ (trace) => trace.subcircuit_connectivity_map_key === connectivityKey
8205
+ );
8206
+ const hasNetConnections = tracesWithThisKey.some(
8207
+ (trace) => trace.connected_source_net_ids && trace.connected_source_net_ids.length > 0
8208
+ );
8209
+ const hasDirectConnections = tracesWithThisKey.some(
8210
+ (trace) => trace.connected_source_port_ids && trace.connected_source_port_ids.length >= 2
8211
+ );
8212
+ debug5(
8213
+ `[${group.name}] Connectivity ${connectivityKey}: hasNetConnections=${hasNetConnections}, hasDirectConnections=${hasDirectConnections}`
8214
+ );
8215
+ if (hasDirectConnections) {
8216
+ for (const trace of tracesWithThisKey) {
8217
+ if (trace.connected_source_port_ids && trace.connected_source_port_ids.length >= 2) {
8218
+ const directlyConnectedPins = [];
8219
+ for (const portId of trace.connected_source_port_ids) {
8220
+ for (const pinId of pins) {
8221
+ const pinNumber = pinId.split(".").pop();
8222
+ const sourcePort = db.source_port.get(portId);
8223
+ if (sourcePort && String(sourcePort.pin_number || sourcePort.name) === String(pinNumber)) {
8224
+ const chipId = pinId.split(".")[0];
8225
+ const treeNode = tree.childNodes.find((child) => {
8226
+ if (child.nodeType === "component" && child.sourceComponent) {
8227
+ return child.sourceComponent.name === chipId;
8228
+ }
8229
+ if (child.nodeType === "group" && child.sourceGroup) {
8230
+ const expectedChipId = `group_${tree.childNodes.indexOf(child)}`;
8231
+ return expectedChipId === chipId;
8232
+ }
8233
+ return false;
8234
+ });
8235
+ if (treeNode?.nodeType === "component" && treeNode.sourceComponent) {
8236
+ const portBelongsToComponent = db.source_port.list({
8237
+ source_component_id: treeNode.sourceComponent.source_component_id
8238
+ }).some((p) => p.source_port_id === portId);
8239
+ if (portBelongsToComponent) {
8240
+ directlyConnectedPins.push(pinId);
8241
+ }
8242
+ }
8243
+ }
8244
+ }
8245
+ }
8246
+ for (let i = 0; i < directlyConnectedPins.length; i++) {
8247
+ for (let j = i + 1; j < directlyConnectedPins.length; j++) {
8248
+ const pin1 = directlyConnectedPins[i];
8249
+ const pin2 = directlyConnectedPins[j];
8250
+ problem.pinStrongConnMap[`${pin1}-${pin2}`] = true;
8251
+ problem.pinStrongConnMap[`${pin2}-${pin1}`] = true;
8252
+ debug5(
8253
+ `[${group.name}] Created strong connection: ${pin1} <-> ${pin2}`
8254
+ );
8255
+ }
8256
+ }
8257
+ }
8258
+ }
8259
+ }
8260
+ if (hasNetConnections) {
8261
+ problem.netMap[connectivityKey] = {
8262
+ netId: connectivityKey
8263
+ };
8264
+ for (const pinId of pins) {
8265
+ problem.netConnMap[`${pinId}-${connectivityKey}`] = true;
8266
+ }
8267
+ debug5(
8268
+ `[${group.name}] Created net ${connectivityKey} with ${pins.length} pins:`,
8269
+ pins
8270
+ );
8101
8271
  }
8102
8272
  }
8103
8273
  }
@@ -8108,7 +8278,16 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8108
8278
  const tree = getCircuitJsonTree(db.toArray(), {
8109
8279
  source_group_id: group.source_group_id
8110
8280
  });
8111
- if (tree.childNodes.length <= 1) return;
8281
+ debug5(
8282
+ `[${group.name}] Starting matchpack layout with ${tree.childNodes.length} children`
8283
+ );
8284
+ debug5(`[${group.name}] Tree structure:`, JSON.stringify(tree, null, 2));
8285
+ if (tree.childNodes.length <= 1) {
8286
+ debug5(
8287
+ `[${group.name}] Only ${tree.childNodes.length} children, skipping layout`
8288
+ );
8289
+ return;
8290
+ }
8112
8291
  debug5("Converting circuit tree to InputProblem...");
8113
8292
  const inputProblem = convertTreeToInputProblem(tree, db, group);
8114
8293
  debug5("InputProblem:", JSON.stringify(inputProblem, null, 2));
@@ -8130,6 +8309,7 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8130
8309
  }
8131
8310
  const outputLayout = solver.getOutputLayout();
8132
8311
  debug5("OutputLayout:", JSON.stringify(outputLayout, null, 2));
8312
+ debug5("Solver completed successfully:", !solver.failed);
8133
8313
  if (debug5.enabled && global.debugGraphics) {
8134
8314
  const finalViz = solver.visualize();
8135
8315
  global.debugGraphics.push({
@@ -8148,20 +8328,44 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8148
8328
  }
8149
8329
  const groupOffset = group._getGlobalSchematicPositionBeforeLayout();
8150
8330
  debug5(`Group offset: x=${groupOffset.x}, y=${groupOffset.y}`);
8331
+ debug5(
8332
+ `Applying layout results for ${Object.keys(outputLayout.chipPlacements).length} chip placements`
8333
+ );
8151
8334
  for (const [chipId, placement] of Object.entries(
8152
8335
  outputLayout.chipPlacements
8153
8336
  )) {
8337
+ debug5(
8338
+ `Processing placement for chip: ${chipId} at (${placement.x}, ${placement.y})`
8339
+ );
8154
8340
  const treeNode = tree.childNodes.find((child) => {
8155
8341
  if (child.nodeType === "component" && child.sourceComponent) {
8156
- return child.sourceComponent.name === chipId;
8342
+ const matches = child.sourceComponent.name === chipId;
8343
+ debug5(
8344
+ ` Checking component ${child.sourceComponent.name}: matches=${matches}`
8345
+ );
8346
+ return matches;
8157
8347
  }
8158
8348
  if (child.nodeType === "group" && child.sourceGroup) {
8159
- return child.sourceGroup.name === chipId;
8349
+ const groupName = child.sourceGroup.name;
8350
+ const expectedChipId = `group_${tree.childNodes.indexOf(child)}`;
8351
+ const matches = expectedChipId === chipId;
8352
+ debug5(
8353
+ ` Checking group ${groupName} (expected chipId: ${expectedChipId}): matches=${matches}`
8354
+ );
8355
+ return matches;
8160
8356
  }
8161
8357
  return false;
8162
8358
  });
8163
8359
  if (!treeNode) {
8164
8360
  debug5(`Warning: No tree node found for chip: ${chipId}`);
8361
+ debug5(
8362
+ `Available tree nodes:`,
8363
+ tree.childNodes.map((child, idx) => ({
8364
+ type: child.nodeType,
8365
+ name: child.nodeType === "component" ? child.sourceComponent?.name : child.sourceGroup?.name,
8366
+ expectedChipId: child.nodeType === "group" ? `group_${idx}` : child.sourceComponent?.name
8367
+ }))
8368
+ );
8165
8369
  continue;
8166
8370
  }
8167
8371
  const newCenter = {
@@ -8237,7 +8441,55 @@ function Group_doInitialSchematicLayoutMatchPack(group) {
8237
8441
  source_group_id: treeNode.sourceGroup.source_group_id
8238
8442
  });
8239
8443
  if (schematicGroup) {
8240
- debug5(`Moving group ${chipId} to (${newCenter.x}, ${newCenter.y})`);
8444
+ debug5(
8445
+ `Moving group ${chipId} to (${newCenter.x}, ${newCenter.y}) from (${schematicGroup.center?.x}, ${schematicGroup.center?.y})`
8446
+ );
8447
+ const groupComponents = db.schematic_component.list({
8448
+ schematic_group_id: schematicGroup.schematic_group_id
8449
+ });
8450
+ debug5(
8451
+ `Group ${chipId} has ${groupComponents.length} components to move`
8452
+ );
8453
+ const oldCenter = schematicGroup.center || { x: 0, y: 0 };
8454
+ const positionDelta = {
8455
+ x: newCenter.x - oldCenter.x,
8456
+ y: newCenter.y - oldCenter.y
8457
+ };
8458
+ debug5(
8459
+ `Position delta for group ${chipId}: (${positionDelta.x}, ${positionDelta.y})`
8460
+ );
8461
+ for (const component of groupComponents) {
8462
+ if (component.center) {
8463
+ const oldComponentCenter = { ...component.center };
8464
+ component.center.x += positionDelta.x;
8465
+ component.center.y += positionDelta.y;
8466
+ debug5(
8467
+ `Moved component ${component.source_component_id} from (${oldComponentCenter.x}, ${oldComponentCenter.y}) to (${component.center.x}, ${component.center.y})`
8468
+ );
8469
+ const ports = db.schematic_port.list({
8470
+ schematic_component_id: component.schematic_component_id
8471
+ });
8472
+ const texts = db.schematic_text.list({
8473
+ schematic_component_id: component.schematic_component_id
8474
+ });
8475
+ for (const port of ports) {
8476
+ if (port.center) {
8477
+ port.center.x += positionDelta.x;
8478
+ port.center.y += positionDelta.y;
8479
+ }
8480
+ }
8481
+ for (const text of texts) {
8482
+ if (text.position) {
8483
+ text.position.x += positionDelta.x;
8484
+ text.position.y += positionDelta.y;
8485
+ }
8486
+ }
8487
+ }
8488
+ }
8489
+ schematicGroup.center = newCenter;
8490
+ debug5(
8491
+ `Updated group ${chipId} center to (${newCenter.x}, ${newCenter.y})`
8492
+ );
8241
8493
  }
8242
8494
  }
8243
8495
  }
@@ -9407,14 +9659,11 @@ var Group = class extends NormalComponent {
9407
9659
  const cProps = child._parsedProps;
9408
9660
  return cProps?.schX !== void 0 || cProps?.schY !== void 0;
9409
9661
  });
9410
- const anyChildIsGroup = this.children.some((child) => child.isGroup);
9411
9662
  const hasManualEdits = (props.manualEdits?.schematic_placements?.length ?? 0) > 0;
9412
- if (!anyChildHasSchCoords && !hasManualEdits && !anyChildIsGroup)
9413
- return "match-adapt";
9663
+ if (!anyChildHasSchCoords && !hasManualEdits) return "match-adapt";
9414
9664
  return "relative";
9415
9665
  }
9416
9666
  doInitialSchematicLayout() {
9417
- const props = this._parsedProps;
9418
9667
  const schematicLayoutMode = this._getSchematicLayoutMode();
9419
9668
  if (schematicLayoutMode === "match-adapt") {
9420
9669
  this._doInitialSchematicLayoutMatchpack();
@@ -11218,6 +11467,7 @@ var PinHeader = class extends NormalComponent {
11218
11467
 
11219
11468
  // lib/components/normal-components/Resonator.ts
11220
11469
  import { resonatorProps } from "@tscircuit/props";
11470
+ import { formatSiUnit as formatSiUnit4 } from "format-si-unit";
11221
11471
  function getResonatorSymbolName(variant) {
11222
11472
  switch (variant) {
11223
11473
  case "two_ground_pins":
@@ -11254,11 +11504,18 @@ var Resonator = class extends NormalComponent {
11254
11504
  });
11255
11505
  this.source_component_id = source_component.source_component_id;
11256
11506
  }
11507
+ _getSchematicSymbolDisplayValue() {
11508
+ const freqDisplay = `${formatSiUnit4(this._parsedProps.frequency)}Hz`;
11509
+ if (this._parsedProps.loadCapacitance) {
11510
+ return `${freqDisplay} / ${formatSiUnit4(this._parsedProps.loadCapacitance)}F`;
11511
+ }
11512
+ return freqDisplay;
11513
+ }
11257
11514
  };
11258
11515
 
11259
11516
  // lib/components/normal-components/Inductor.ts
11260
11517
  import { inductorProps } from "@tscircuit/props";
11261
- import { formatSiUnit as formatSiUnit4 } from "format-si-unit";
11518
+ import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
11262
11519
  var Inductor = class extends NormalComponent {
11263
11520
  get config() {
11264
11521
  return {
@@ -11269,7 +11526,7 @@ var Inductor = class extends NormalComponent {
11269
11526
  };
11270
11527
  }
11271
11528
  _getSchematicSymbolDisplayValue() {
11272
- return `${formatSiUnit4(this._parsedProps.inductance)}H`;
11529
+ return `${formatSiUnit5(this._parsedProps.inductance)}H`;
11273
11530
  }
11274
11531
  initPorts() {
11275
11532
  super.initPorts({
@@ -11295,7 +11552,7 @@ var Inductor = class extends NormalComponent {
11295
11552
 
11296
11553
  // lib/components/normal-components/Potentiometer.ts
11297
11554
  import { potentiometerProps } from "@tscircuit/props";
11298
- import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
11555
+ import { formatSiUnit as formatSiUnit6 } from "format-si-unit";
11299
11556
  function getPotentiometerSymbolName(variant) {
11300
11557
  switch (variant) {
11301
11558
  case "three_pin":
@@ -11316,7 +11573,7 @@ var Potentiometer = class extends NormalComponent {
11316
11573
  };
11317
11574
  }
11318
11575
  _getSchematicSymbolDisplayValue() {
11319
- return `${formatSiUnit5(this._parsedProps.maxResistance)}\u03A9`;
11576
+ return `${formatSiUnit6(this._parsedProps.maxResistance)}\u03A9`;
11320
11577
  }
11321
11578
  doInitialSourceRender() {
11322
11579
  const { db } = this.root;
@@ -11400,7 +11657,7 @@ var PushButton = class extends NormalComponent {
11400
11657
 
11401
11658
  // lib/components/normal-components/Crystal.ts
11402
11659
  import { crystalProps } from "@tscircuit/props";
11403
- import { formatSiUnit as formatSiUnit6 } from "format-si-unit";
11660
+ import { formatSiUnit as formatSiUnit7 } from "format-si-unit";
11404
11661
  var Crystal = class extends NormalComponent {
11405
11662
  // @ts-ignore
11406
11663
  get config() {
@@ -11427,9 +11684,9 @@ var Crystal = class extends NormalComponent {
11427
11684
  });
11428
11685
  }
11429
11686
  _getSchematicSymbolDisplayValue() {
11430
- const freqDisplay = `${formatSiUnit6(this._parsedProps.frequency)}Hz`;
11687
+ const freqDisplay = `${formatSiUnit7(this._parsedProps.frequency)}Hz`;
11431
11688
  if (this._parsedProps.loadCapacitance) {
11432
- return `${freqDisplay} / ${formatSiUnit6(
11689
+ return `${freqDisplay} / ${formatSiUnit7(
11433
11690
  this._parsedProps.loadCapacitance
11434
11691
  )}F`;
11435
11692
  }
@@ -12056,7 +12313,7 @@ import { identity as identity5 } from "transformation-matrix";
12056
12313
  var package_default = {
12057
12314
  name: "@tscircuit/core",
12058
12315
  type: "module",
12059
- version: "0.0.622",
12316
+ version: "0.0.624",
12060
12317
  types: "dist/index.d.ts",
12061
12318
  main: "dist/index.js",
12062
12319
  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.623",
4
+ "version": "0.0.625",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",