@tscircuit/core 0.0.456 → 0.0.458

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
@@ -2477,6 +2477,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
2477
2477
  } & {
2478
2478
  manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
2479
2479
  pinLabels: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
2480
+ showPinAliases: zod.ZodOptional<zod.ZodBoolean>;
2480
2481
  internallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodString, "many">, "many">>;
2481
2482
  externallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodString, "many">, "many">>;
2482
2483
  schPinArrangement: zod.ZodOptional<zod.ZodObject<{
@@ -2794,6 +2795,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
2794
2795
  schHeight?: number | undefined;
2795
2796
  manufacturerPartNumber?: string | undefined;
2796
2797
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
2798
+ showPinAliases?: boolean | undefined;
2797
2799
  internallyConnectedPins?: string[][] | undefined;
2798
2800
  externallyConnectedPins?: string[][] | undefined;
2799
2801
  schPinArrangement?: {
@@ -2939,6 +2941,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
2939
2941
  schHeight?: string | number | undefined;
2940
2942
  manufacturerPartNumber?: string | undefined;
2941
2943
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
2944
+ showPinAliases?: boolean | undefined;
2942
2945
  internallyConnectedPins?: string[][] | undefined;
2943
2946
  externallyConnectedPins?: string[][] | undefined;
2944
2947
  schPinArrangement?: {
@@ -6543,6 +6546,7 @@ declare class NetAlias extends PrimitiveComponent<typeof netAliasProps> {
6543
6546
  componentName: string;
6544
6547
  zodProps: zod.ZodObject<{
6545
6548
  net: zod.ZodOptional<zod.ZodString>;
6549
+ connection: zod.ZodOptional<zod.ZodString>;
6546
6550
  schX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
6547
6551
  schY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
6548
6552
  schRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -6552,12 +6556,14 @@ declare class NetAlias extends PrimitiveComponent<typeof netAliasProps> {
6552
6556
  schY?: number | undefined;
6553
6557
  schRotation?: number | undefined;
6554
6558
  net?: string | undefined;
6559
+ connection?: string | undefined;
6555
6560
  anchorSide?: "up" | "down" | "left" | "right" | undefined;
6556
6561
  }, {
6557
6562
  schX?: string | number | undefined;
6558
6563
  schY?: string | number | undefined;
6559
6564
  schRotation?: string | number | undefined;
6560
6565
  net?: string | undefined;
6566
+ connection?: string | undefined;
6561
6567
  anchorSide?: "up" | "down" | "left" | "right" | undefined;
6562
6568
  }>;
6563
6569
  };
@@ -8792,6 +8798,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
8792
8798
  holeDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
8793
8799
  platedDiameter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
8794
8800
  pinLabels: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
8801
+ connections: zod.ZodOptional<zod.ZodPipeline<zod.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, zod.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>>;
8795
8802
  facingDirection: zod.ZodOptional<zod.ZodEnum<["left", "right"]>>;
8796
8803
  schPinArrangement: zod.ZodOptional<zod.ZodObject<{
8797
8804
  leftSize: zod.ZodOptional<zod.ZodNumber>;
@@ -8990,6 +8997,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
8990
8997
  topPinCount?: number | undefined;
8991
8998
  bottomPinCount?: number | undefined;
8992
8999
  } | undefined;
9000
+ connections?: Record<string, string | readonly string[] | string[]> | undefined;
8993
9001
  holeDiameter?: number | undefined;
8994
9002
  pitch?: number | undefined;
8995
9003
  schFacingDirection?: "up" | "down" | "left" | "right" | undefined;
@@ -9095,6 +9103,7 @@ declare class PinHeader extends NormalComponent<typeof pinHeaderProps> {
9095
9103
  topPinCount?: number | undefined;
9096
9104
  bottomPinCount?: number | undefined;
9097
9105
  } | undefined;
9106
+ connections?: Partial<Record<string, string | string[] | readonly string[]>> | undefined;
9098
9107
  holeDiameter?: string | number | undefined;
9099
9108
  pitch?: string | number | undefined;
9100
9109
  schFacingDirection?: "up" | "down" | "left" | "right" | undefined;
@@ -10615,6 +10624,7 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
10615
10624
  } & {
10616
10625
  manufacturerPartNumber: zod.ZodOptional<zod.ZodString>;
10617
10626
  pinLabels: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodUnion<[zod.ZodUnion<[zod.ZodString, zod.ZodReadonly<zod.ZodArray<zod.ZodString, "many">>]>, zod.ZodArray<zod.ZodString, "many">]>>>;
10627
+ showPinAliases: zod.ZodOptional<zod.ZodBoolean>;
10618
10628
  internallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodString, "many">, "many">>;
10619
10629
  externallyConnectedPins: zod.ZodOptional<zod.ZodArray<zod.ZodArray<zod.ZodString, "many">, "many">>;
10620
10630
  schPinArrangement: zod.ZodOptional<zod.ZodObject<{
@@ -10932,6 +10942,7 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
10932
10942
  schHeight?: number | undefined;
10933
10943
  manufacturerPartNumber?: string | undefined;
10934
10944
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
10945
+ showPinAliases?: boolean | undefined;
10935
10946
  internallyConnectedPins?: string[][] | undefined;
10936
10947
  externallyConnectedPins?: string[][] | undefined;
10937
10948
  schPinArrangement?: {
@@ -11077,6 +11088,7 @@ declare class PushButton extends NormalComponent<typeof pushButtonProps, Passive
11077
11088
  schHeight?: string | number | undefined;
11078
11089
  manufacturerPartNumber?: string | undefined;
11079
11090
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
11091
+ showPinAliases?: boolean | undefined;
11080
11092
  internallyConnectedPins?: string[][] | undefined;
11081
11093
  externallyConnectedPins?: string[][] | undefined;
11082
11094
  schPinArrangement?: {
@@ -12949,47 +12961,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
12949
12961
  paddingTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12950
12962
  paddingBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12951
12963
  title: zod.ZodOptional<zod.ZodString>;
12952
- titleAnchorPosition: zod.ZodOptional<zod.ZodObject<{
12953
- x: zod.ZodOptional<zod.ZodObject<{
12954
- x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
12955
- y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
12956
- }, "strip", zod.ZodTypeAny, {
12957
- x: number;
12958
- y: number;
12959
- }, {
12960
- x: string | number;
12961
- y: string | number;
12962
- }>>;
12963
- y: zod.ZodOptional<zod.ZodObject<{
12964
- x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
12965
- y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
12966
- }, "strip", zod.ZodTypeAny, {
12967
- x: number;
12968
- y: number;
12969
- }, {
12970
- x: string | number;
12971
- y: string | number;
12972
- }>>;
12973
- }, "strip", zod.ZodTypeAny, {
12974
- x?: {
12975
- x: number;
12976
- y: number;
12977
- } | undefined;
12978
- y?: {
12979
- x: number;
12980
- y: number;
12981
- } | undefined;
12982
- }, {
12983
- x?: {
12984
- x: string | number;
12985
- y: string | number;
12986
- } | undefined;
12987
- y?: {
12988
- x: string | number;
12989
- y: string | number;
12990
- } | undefined;
12991
- }>>;
12992
- titleAnchorAlignment: zod.ZodDefault<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
12964
+ titleAlignment: zod.ZodDefault<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
12993
12965
  titleColor: zod.ZodOptional<zod.ZodString>;
12994
12966
  titleFontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
12995
12967
  titleInside: zod.ZodDefault<zod.ZodBoolean>;
@@ -12997,7 +12969,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
12997
12969
  }, "strip", zod.ZodTypeAny, {
12998
12970
  schX: number;
12999
12971
  schY: number;
13000
- titleAnchorAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
12972
+ titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
13001
12973
  titleInside: boolean;
13002
12974
  strokeStyle: "solid" | "dashed";
13003
12975
  width?: number | undefined;
@@ -13009,16 +12981,6 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13009
12981
  paddingBottom?: number | undefined;
13010
12982
  overlay?: string[] | undefined;
13011
12983
  title?: string | undefined;
13012
- titleAnchorPosition?: {
13013
- x?: {
13014
- x: number;
13015
- y: number;
13016
- } | undefined;
13017
- y?: {
13018
- x: number;
13019
- y: number;
13020
- } | undefined;
13021
- } | undefined;
13022
12984
  titleColor?: string | undefined;
13023
12985
  titleFontSize?: number | undefined;
13024
12986
  }, {
@@ -13033,17 +12995,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13033
12995
  paddingBottom?: string | number | undefined;
13034
12996
  overlay?: string[] | undefined;
13035
12997
  title?: string | undefined;
13036
- titleAnchorPosition?: {
13037
- x?: {
13038
- x: string | number;
13039
- y: string | number;
13040
- } | undefined;
13041
- y?: {
13042
- x: string | number;
13043
- y: string | number;
13044
- } | undefined;
13045
- } | undefined;
13046
- titleAnchorAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
12998
+ titleAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
13047
12999
  titleColor?: string | undefined;
13048
13000
  titleFontSize?: string | number | undefined;
13049
13001
  titleInside?: boolean | undefined;
@@ -13051,7 +13003,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13051
13003
  }>, {
13052
13004
  schX: number;
13053
13005
  schY: number;
13054
- titleAnchorAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
13006
+ titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
13055
13007
  titleInside: boolean;
13056
13008
  strokeStyle: "solid" | "dashed";
13057
13009
  width?: number | undefined;
@@ -13063,16 +13015,6 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13063
13015
  paddingBottom?: number | undefined;
13064
13016
  overlay?: string[] | undefined;
13065
13017
  title?: string | undefined;
13066
- titleAnchorPosition?: {
13067
- x?: {
13068
- x: number;
13069
- y: number;
13070
- } | undefined;
13071
- y?: {
13072
- x: number;
13073
- y: number;
13074
- } | undefined;
13075
- } | undefined;
13076
13018
  titleColor?: string | undefined;
13077
13019
  titleFontSize?: number | undefined;
13078
13020
  }, {
@@ -13087,17 +13029,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13087
13029
  paddingBottom?: string | number | undefined;
13088
13030
  overlay?: string[] | undefined;
13089
13031
  title?: string | undefined;
13090
- titleAnchorPosition?: {
13091
- x?: {
13092
- x: string | number;
13093
- y: string | number;
13094
- } | undefined;
13095
- y?: {
13096
- x: string | number;
13097
- y: string | number;
13098
- } | undefined;
13099
- } | undefined;
13100
- titleAnchorAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
13032
+ titleAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
13101
13033
  titleColor?: string | undefined;
13102
13034
  titleFontSize?: string | number | undefined;
13103
13035
  titleInside?: boolean | undefined;
@@ -13105,7 +13037,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13105
13037
  }>, {
13106
13038
  schX: number;
13107
13039
  schY: number;
13108
- titleAnchorAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
13040
+ titleAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
13109
13041
  titleInside: boolean;
13110
13042
  strokeStyle: "solid" | "dashed";
13111
13043
  width?: number | undefined;
@@ -13117,16 +13049,6 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13117
13049
  paddingBottom?: number | undefined;
13118
13050
  overlay?: string[] | undefined;
13119
13051
  title?: string | undefined;
13120
- titleAnchorPosition?: {
13121
- x?: {
13122
- x: number;
13123
- y: number;
13124
- } | undefined;
13125
- y?: {
13126
- x: number;
13127
- y: number;
13128
- } | undefined;
13129
- } | undefined;
13130
13052
  titleColor?: string | undefined;
13131
13053
  titleFontSize?: number | undefined;
13132
13054
  }, {
@@ -13141,17 +13063,7 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
13141
13063
  paddingBottom?: string | number | undefined;
13142
13064
  overlay?: string[] | undefined;
13143
13065
  title?: string | undefined;
13144
- titleAnchorPosition?: {
13145
- x?: {
13146
- x: string | number;
13147
- y: string | number;
13148
- } | undefined;
13149
- y?: {
13150
- x: string | number;
13151
- y: string | number;
13152
- } | undefined;
13153
- } | undefined;
13154
- titleAnchorAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
13066
+ titleAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
13155
13067
  titleColor?: string | undefined;
13156
13068
  titleFontSize?: string | number | undefined;
13157
13069
  titleInside?: boolean | undefined;
package/dist/index.js CHANGED
@@ -2926,12 +2926,19 @@ var Port = class extends PrimitiveComponent2 {
2926
2926
  }[localPortInfo.side];
2927
2927
  }
2928
2928
  const sourcePort = db.source_port.get(this.source_port_id);
2929
- let bestDisplayPinLabel = void 0;
2929
+ const labelHints = [];
2930
2930
  for (const portHint of sourcePort?.port_hints ?? []) {
2931
2931
  if (portHint.match(/^(pin)?\d+$/)) continue;
2932
2932
  if (portHint.match(/^(left|right)/) && !sourcePort?.name.match(/^(left|right)/))
2933
2933
  continue;
2934
- bestDisplayPinLabel = portHint;
2934
+ labelHints.push(portHint);
2935
+ }
2936
+ let bestDisplayPinLabel = void 0;
2937
+ const showPinAliases = this.parent?.props?.showPinAliases;
2938
+ if (showPinAliases && labelHints.length > 0) {
2939
+ bestDisplayPinLabel = labelHints.join("/");
2940
+ } else if (labelHints.length > 0) {
2941
+ bestDisplayPinLabel = labelHints[labelHints.length - 1];
2935
2942
  }
2936
2943
  const schematic_port = db.schematic_port.insert({
2937
2944
  schematic_component_id: this.parent?.schematic_component_id,
@@ -9042,7 +9049,7 @@ var PinHeader = class extends NormalComponent {
9042
9049
  }
9043
9050
  _getSchematicPortArrangement() {
9044
9051
  const pinCount = this._parsedProps.pinCount ?? 1;
9045
- const facingDirection = this._parsedProps.facingDirection ?? "right";
9052
+ const facingDirection = this._parsedProps.schFacingDirection ?? this._parsedProps.facingDirection ?? "right";
9046
9053
  const schPinArrangement = this._parsedProps.schPinArrangement;
9047
9054
  if (facingDirection === "left") {
9048
9055
  return {
@@ -9511,7 +9518,7 @@ import { identity as identity4 } from "transformation-matrix";
9511
9518
  var package_default = {
9512
9519
  name: "@tscircuit/core",
9513
9520
  type: "module",
9514
- version: "0.0.455",
9521
+ version: "0.0.457",
9515
9522
  types: "dist/index.d.ts",
9516
9523
  main: "dist/index.js",
9517
9524
  module: "dist/index.js",
@@ -9543,7 +9550,7 @@ var package_default = {
9543
9550
  "@tscircuit/layout": "^0.0.28",
9544
9551
  "@tscircuit/log-soup": "^1.0.2",
9545
9552
  "@tscircuit/math-utils": "^0.0.18",
9546
- "@tscircuit/props": "^0.0.211",
9553
+ "@tscircuit/props": "^0.0.218",
9547
9554
  "@tscircuit/schematic-autolayout": "^0.0.6",
9548
9555
  "@tscircuit/schematic-match-adapt": "^0.0.16",
9549
9556
  "@tscircuit/simple-3d-svg": "^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.456",
4
+ "version": "0.0.458",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -33,7 +33,7 @@
33
33
  "@tscircuit/layout": "^0.0.28",
34
34
  "@tscircuit/log-soup": "^1.0.2",
35
35
  "@tscircuit/math-utils": "^0.0.18",
36
- "@tscircuit/props": "^0.0.211",
36
+ "@tscircuit/props": "^0.0.218",
37
37
  "@tscircuit/schematic-autolayout": "^0.0.6",
38
38
  "@tscircuit/schematic-match-adapt": "^0.0.16",
39
39
  "@tscircuit/simple-3d-svg": "^0.0.6",