@tscircuit/core 0.0.912 → 0.0.914

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
@@ -3359,6 +3359,11 @@ declare class Panel extends Group<typeof panelProps> {
3359
3359
  tabWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3360
3360
  tabLength: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3361
3361
  mouseBites: zod.ZodOptional<zod.ZodBoolean>;
3362
+ edgePadding: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3363
+ edgePaddingLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3364
+ edgePaddingRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3365
+ edgePaddingTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3366
+ edgePaddingBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3362
3367
  }, "strip", zod.ZodTypeAny, {
3363
3368
  symbol?: _tscircuit_props.SymbolProp | undefined;
3364
3369
  key?: any;
@@ -3622,6 +3627,11 @@ declare class Panel extends Group<typeof panelProps> {
3622
3627
  tabWidth?: number | undefined;
3623
3628
  tabLength?: number | undefined;
3624
3629
  mouseBites?: boolean | undefined;
3630
+ edgePadding?: number | undefined;
3631
+ edgePaddingLeft?: number | undefined;
3632
+ edgePaddingRight?: number | undefined;
3633
+ edgePaddingTop?: number | undefined;
3634
+ edgePaddingBottom?: number | undefined;
3625
3635
  }, {
3626
3636
  symbol?: _tscircuit_props.SymbolProp | undefined;
3627
3637
  key?: any;
@@ -3887,6 +3897,11 @@ declare class Panel extends Group<typeof panelProps> {
3887
3897
  tabWidth?: string | number | undefined;
3888
3898
  tabLength?: string | number | undefined;
3889
3899
  mouseBites?: boolean | undefined;
3900
+ edgePadding?: string | number | undefined;
3901
+ edgePaddingLeft?: string | number | undefined;
3902
+ edgePaddingRight?: string | number | undefined;
3903
+ edgePaddingTop?: string | number | undefined;
3904
+ edgePaddingBottom?: string | number | undefined;
3890
3905
  }>;
3891
3906
  };
3892
3907
  get isGroup(): boolean;
@@ -18851,6 +18866,7 @@ declare class VoltageSource extends NormalComponent<typeof voltageSourceProps, "
18851
18866
  runRenderPhaseForChildren(phase: RenderPhase): void;
18852
18867
  doInitialPcbComponentRender(): void;
18853
18868
  initPorts(): void;
18869
+ _getSchematicSymbolDisplayValue(): string | undefined;
18854
18870
  doInitialSourceRender(): void;
18855
18871
  doInitialSimulationRender(): void;
18856
18872
  terminal1: Port;
package/dist/index.js CHANGED
@@ -15744,7 +15744,6 @@ import { distance as distance10 } from "circuit-json";
15744
15744
 
15745
15745
  // lib/utils/panels/generate-panel-tabs-and-mouse-bites.ts
15746
15746
  import * as Flatten from "@flatten-js/core";
15747
- var DEFAULT_PANEL_MARGIN = 5;
15748
15747
  var DEFAULT_TAB_LENGTH = 5;
15749
15748
  var DEFAULT_TAB_WIDTH = 2;
15750
15749
  var generateCutoutsAndMousebitesForOutline = (outline, options) => {
@@ -16056,9 +16055,27 @@ var Panel = class extends Group6 {
16056
16055
  height: distance10.parse(this._parsedProps.height)
16057
16056
  });
16058
16057
  } else if (gridWidth > 0 || gridHeight > 0) {
16058
+ const {
16059
+ edgePadding: edgePaddingProp,
16060
+ edgePaddingLeft: edgePaddingLeftProp,
16061
+ edgePaddingRight: edgePaddingRightProp,
16062
+ edgePaddingTop: edgePaddingTopProp,
16063
+ edgePaddingBottom: edgePaddingBottomProp
16064
+ } = this._parsedProps;
16065
+ const edgePadding = distance10.parse(edgePaddingProp ?? 5);
16066
+ const edgePaddingLeft = distance10.parse(
16067
+ edgePaddingLeftProp ?? edgePadding
16068
+ );
16069
+ const edgePaddingRight = distance10.parse(
16070
+ edgePaddingRightProp ?? edgePadding
16071
+ );
16072
+ const edgePaddingTop = distance10.parse(edgePaddingTopProp ?? edgePadding);
16073
+ const edgePaddingBottom = distance10.parse(
16074
+ edgePaddingBottomProp ?? edgePadding
16075
+ );
16059
16076
  db.pcb_panel.update(this.pcb_panel_id, {
16060
- width: hasExplicitWidth ? distance10.parse(this._parsedProps.width) : gridWidth + 2 * DEFAULT_PANEL_MARGIN,
16061
- height: hasExplicitHeight ? distance10.parse(this._parsedProps.height) : gridHeight + 2 * DEFAULT_PANEL_MARGIN
16077
+ width: hasExplicitWidth ? distance10.parse(this._parsedProps.width) : gridWidth + edgePaddingLeft + edgePaddingRight,
16078
+ height: hasExplicitHeight ? distance10.parse(this._parsedProps.height) : gridHeight + edgePaddingTop + edgePaddingBottom
16062
16079
  });
16063
16080
  }
16064
16081
  }
@@ -16579,6 +16596,7 @@ var PowerSource = class extends NormalComponent3 {
16579
16596
 
16580
16597
  // lib/components/normal-components/VoltageSource.ts
16581
16598
  import { voltageSourceProps } from "@tscircuit/props";
16599
+ import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
16582
16600
  var VoltageSource = class extends NormalComponent3 {
16583
16601
  get config() {
16584
16602
  const isSquare = this.props.waveShape === "square";
@@ -16608,6 +16626,17 @@ var VoltageSource = class extends NormalComponent3 {
16608
16626
  }
16609
16627
  });
16610
16628
  }
16629
+ _getSchematicSymbolDisplayValue() {
16630
+ const { voltage, frequency: frequency2 } = this._parsedProps;
16631
+ const parts = [];
16632
+ if (voltage !== void 0) {
16633
+ parts.push(`${formatSiUnit5(voltage)}V`);
16634
+ }
16635
+ if (frequency2 !== void 0) {
16636
+ parts.push(`${formatSiUnit5(frequency2)}Hz`);
16637
+ }
16638
+ return parts.length > 0 ? parts.join(" ") : void 0;
16639
+ }
16611
16640
  doInitialSourceRender() {
16612
16641
  const { db } = this.root;
16613
16642
  const { _parsedProps: props } = this;
@@ -18034,7 +18063,7 @@ var PinHeader = class extends NormalComponent3 {
18034
18063
 
18035
18064
  // lib/components/normal-components/Resonator.ts
18036
18065
  import { resonatorProps } from "@tscircuit/props";
18037
- import { formatSiUnit as formatSiUnit5 } from "format-si-unit";
18066
+ import { formatSiUnit as formatSiUnit6 } from "format-si-unit";
18038
18067
  function getResonatorSymbolName(variant) {
18039
18068
  switch (variant) {
18040
18069
  case "two_ground_pins":
@@ -18072,9 +18101,9 @@ var Resonator = class extends NormalComponent3 {
18072
18101
  this.source_component_id = source_component.source_component_id;
18073
18102
  }
18074
18103
  _getSchematicSymbolDisplayValue() {
18075
- const freqDisplay = `${formatSiUnit5(this._parsedProps.frequency)}Hz`;
18104
+ const freqDisplay = `${formatSiUnit6(this._parsedProps.frequency)}Hz`;
18076
18105
  if (this._parsedProps.loadCapacitance) {
18077
- return `${freqDisplay} / ${formatSiUnit5(this._parsedProps.loadCapacitance)}F`;
18106
+ return `${freqDisplay} / ${formatSiUnit6(this._parsedProps.loadCapacitance)}F`;
18078
18107
  }
18079
18108
  return freqDisplay;
18080
18109
  }
@@ -18082,7 +18111,7 @@ var Resonator = class extends NormalComponent3 {
18082
18111
 
18083
18112
  // lib/components/normal-components/Potentiometer.ts
18084
18113
  import { potentiometerProps } from "@tscircuit/props";
18085
- import { formatSiUnit as formatSiUnit6 } from "format-si-unit";
18114
+ import { formatSiUnit as formatSiUnit7 } from "format-si-unit";
18086
18115
  function getPotentiometerSymbolName(variant) {
18087
18116
  switch (variant) {
18088
18117
  case "three_pin":
@@ -18103,7 +18132,7 @@ var Potentiometer = class extends NormalComponent3 {
18103
18132
  };
18104
18133
  }
18105
18134
  _getSchematicSymbolDisplayValue() {
18106
- return `${formatSiUnit6(this._parsedProps.maxResistance)}\u03A9`;
18135
+ return `${formatSiUnit7(this._parsedProps.maxResistance)}\u03A9`;
18107
18136
  }
18108
18137
  doInitialSourceRender() {
18109
18138
  const { db } = this.root;
@@ -18187,7 +18216,7 @@ var PushButton = class extends NormalComponent3 {
18187
18216
 
18188
18217
  // lib/components/normal-components/Crystal.ts
18189
18218
  import { crystalProps } from "@tscircuit/props";
18190
- import { formatSiUnit as formatSiUnit7 } from "format-si-unit";
18219
+ import { formatSiUnit as formatSiUnit8 } from "format-si-unit";
18191
18220
  var Crystal = class extends NormalComponent3 {
18192
18221
  // @ts-ignore
18193
18222
  get config() {
@@ -18214,9 +18243,9 @@ var Crystal = class extends NormalComponent3 {
18214
18243
  });
18215
18244
  }
18216
18245
  _getSchematicSymbolDisplayValue() {
18217
- const freqDisplay = `${formatSiUnit7(this._parsedProps.frequency)}Hz`;
18246
+ const freqDisplay = `${formatSiUnit8(this._parsedProps.frequency)}Hz`;
18218
18247
  if (this._parsedProps.loadCapacitance) {
18219
- return `${freqDisplay} / ${formatSiUnit7(
18248
+ return `${freqDisplay} / ${formatSiUnit8(
18220
18249
  this._parsedProps.loadCapacitance
18221
18250
  )}F`;
18222
18251
  }
@@ -19140,7 +19169,7 @@ import { identity as identity5 } from "transformation-matrix";
19140
19169
  var package_default = {
19141
19170
  name: "@tscircuit/core",
19142
19171
  type: "module",
19143
- version: "0.0.910",
19172
+ version: "0.0.913",
19144
19173
  types: "dist/index.d.ts",
19145
19174
  main: "dist/index.js",
19146
19175
  module: "dist/index.js",
@@ -19184,7 +19213,7 @@ var package_default = {
19184
19213
  "@tscircuit/math-utils": "^0.0.29",
19185
19214
  "@tscircuit/miniflex": "^0.0.4",
19186
19215
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
19187
- "@tscircuit/props": "^0.0.425",
19216
+ "@tscircuit/props": "^0.0.426",
19188
19217
  "@tscircuit/schematic-autolayout": "^0.0.6",
19189
19218
  "@tscircuit/schematic-match-adapt": "^0.0.16",
19190
19219
  "@tscircuit/schematic-trace-solver": "^v0.0.45",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.912",
4
+ "version": "0.0.914",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -45,7 +45,7 @@
45
45
  "@tscircuit/math-utils": "^0.0.29",
46
46
  "@tscircuit/miniflex": "^0.0.4",
47
47
  "@tscircuit/ngspice-spice-engine": "^0.0.8",
48
- "@tscircuit/props": "^0.0.425",
48
+ "@tscircuit/props": "^0.0.426",
49
49
  "@tscircuit/schematic-autolayout": "^0.0.6",
50
50
  "@tscircuit/schematic-match-adapt": "^0.0.16",
51
51
  "@tscircuit/schematic-trace-solver": "^v0.0.45",