schematic-symbols 0.0.141 → 0.0.143

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.js CHANGED
@@ -913,21 +913,30 @@ var SymbolModifier = class {
913
913
  }
914
914
  };
915
915
  var modifySymbol = (symbol5) => {
916
+ const primitives = symbol5.primitives ?? [
917
+ ...Object.values(symbol5.paths ?? {}),
918
+ ...Object.values(symbol5.texts ?? {}),
919
+ ...Object.values(symbol5.circles ?? {}),
920
+ ...Object.values(symbol5.rects ?? {})
921
+ ];
922
+ const ports = symbol5.ports ?? Object.entries(symbol5.refblocks).flatMap(([key, refblock]) => {
923
+ return [{ ...refblock, labels: [key] }];
924
+ });
925
+ let center = symbol5.center ?? {
926
+ x: symbol5.bounds.centerX,
927
+ y: symbol5.bounds.centerY
928
+ };
929
+ if (ports.length === 2) {
930
+ center = {
931
+ x: (ports[0].x + ports[1].x) / 2,
932
+ y: (ports[0].y + ports[1].y) / 2
933
+ };
934
+ }
916
935
  return new SymbolModifier({
917
936
  ...symbol5,
918
- primitives: symbol5.primitives ?? [
919
- ...Object.values(symbol5.paths ?? {}),
920
- ...Object.values(symbol5.texts ?? {}),
921
- ...Object.values(symbol5.circles ?? {}),
922
- ...Object.values(symbol5.rects ?? {})
923
- ],
924
- ports: symbol5.ports ?? Object.entries(symbol5.refblocks).flatMap(([key, refblock]) => {
925
- return [{ ...refblock, labels: [key] }];
926
- }),
927
- center: symbol5.center ?? {
928
- x: symbol5.bounds.centerX,
929
- y: symbol5.bounds.centerY
930
- }
937
+ primitives,
938
+ ports,
939
+ center
931
940
  });
932
941
  };
933
942
 
@@ -13322,7 +13331,16 @@ var pnp_bipolar_transistor_default = {
13322
13331
  centerX: 13877787807814457e-32,
13323
13332
  centerY: 11102230246251565e-32
13324
13333
  },
13325
- circles: {}
13334
+ circles: {
13335
+ "path1-0": {
13336
+ type: "circle",
13337
+ x: 0.13862605550000007,
13338
+ y: 0.003454799999999203,
13339
+ radius: 0.28854213,
13340
+ color: "primary",
13341
+ fill: false
13342
+ }
13343
+ }
13326
13344
  };
13327
13345
 
13328
13346
  // symbols/pnp_bipolar_transistor_horz.ts