easyeda 0.0.208 → 0.0.210

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.
@@ -12,7 +12,7 @@ import {
12
12
  toSVG,
13
13
  toString,
14
14
  translate
15
- } from "./chunk-2OEE54ND.js";
15
+ } from "./chunk-OTDH63JU.js";
16
16
 
17
17
  // node_modules/circuit-to-svg/dist/index.js
18
18
  var import_svgson = __toESM(require_svgson_umd(), 1);
@@ -6112,4 +6112,4 @@ export {
6112
6112
  createSvgObjectsForSchComponentPortHovers,
6113
6113
  getSoftwareUsedString
6114
6114
  };
6115
- //# sourceMappingURL=dist-3JBBLAAE.js.map
6115
+ //# sourceMappingURL=dist-NBAEN3WC.js.map
@@ -53,7 +53,7 @@ import {
53
53
  transformPCBElements,
54
54
  translate,
55
55
  voltage
56
- } from "./chunk-2OEE54ND.js";
56
+ } from "./chunk-OTDH63JU.js";
57
57
 
58
58
  // node_modules/ms/index.js
59
59
  var require_ms = __commonJS({
package/dist/main.cjs CHANGED
@@ -3224,8 +3224,7 @@ var init_parsel_min = __esm({
3224
3224
 
3225
3225
  // node_modules/@tscircuit/circuit-json-util/dist/index.js
3226
3226
  function connect(map, a, b) {
3227
- if (!a || !b)
3228
- return;
3227
+ if (!a || !b) return;
3229
3228
  let setA = map.get(a);
3230
3229
  if (!setA) {
3231
3230
  setA = /* @__PURE__ */ new Set();
@@ -3240,8 +3239,7 @@ function connect(map, a, b) {
3240
3239
  setB.add(a);
3241
3240
  }
3242
3241
  function buildSubtree(soup, opts) {
3243
- if (!opts.subcircuit_id && !opts.source_group_id)
3244
- return [...soup];
3242
+ if (!opts.subcircuit_id && !opts.source_group_id) return [...soup];
3245
3243
  const idMap = /* @__PURE__ */ new Map();
3246
3244
  for (const elm of soup) {
3247
3245
  const idVal = elm[`${elm.type}_id`];
@@ -3253,6 +3251,7 @@ function buildSubtree(soup, opts) {
3253
3251
  for (const elm of soup) {
3254
3252
  const entries = Object.entries(elm);
3255
3253
  for (const [key, val58] of entries) {
3254
+ if (key === "parent_source_group_id") continue;
3256
3255
  if (key.endsWith("_id") && typeof val58 === "string") {
3257
3256
  const other = idMap.get(val58);
3258
3257
  connect(adj, elm, other);
@@ -3279,8 +3278,7 @@ function buildSubtree(soup, opts) {
3279
3278
  while (queue.length > 0) {
3280
3279
  const elm = queue.shift();
3281
3280
  const neighbors = adj.get(elm);
3282
- if (!neighbors)
3283
- continue;
3281
+ if (!neighbors) continue;
3284
3282
  for (const n of neighbors) {
3285
3283
  if (!included.has(n)) {
3286
3284
  included.add(n);
@@ -3305,16 +3303,13 @@ function getReadableNameForPcbTrace(soup, pcb_trace_id) {
3305
3303
  }
3306
3304
  function getComponentAndPortInfo(pcb_port_id) {
3307
3305
  const pcbPort = cju(soup).pcb_port.get(pcb_port_id);
3308
- if (!pcbPort)
3309
- return null;
3306
+ if (!pcbPort) return null;
3310
3307
  const pcbComponent = cju(soup).pcb_component.get(pcbPort.pcb_component_id);
3311
- if (!pcbComponent)
3312
- return null;
3308
+ if (!pcbComponent) return null;
3313
3309
  const sourceComponent = cju(soup).source_component.get(
3314
3310
  pcbComponent.source_component_id
3315
3311
  );
3316
- if (!sourceComponent)
3317
- return null;
3312
+ if (!sourceComponent) return null;
3318
3313
  const sourcePort = cju(soup).source_port.get(pcbPort.source_port_id);
3319
3314
  const portHint = sourcePort?.port_hints ? sourcePort.port_hints[1] : "";
3320
3315
  return {
@@ -3340,8 +3335,7 @@ function getReadableNameForPcbSmtpad(soup, pcb_smtpad_id) {
3340
3335
  }
3341
3336
  function stringHash(str) {
3342
3337
  let hash = 0;
3343
- if (str.length == 0)
3344
- return hash;
3338
+ if (str.length == 0) return hash;
3345
3339
  for (var i = 0; i < str.length; i++) {
3346
3340
  var char = str.charCodeAt(i);
3347
3341
  hash = (hash << 5) - hash + char;
@@ -3370,8 +3364,7 @@ var init_dist2 = __esm({
3370
3364
  for (const elm of circuitJson) {
3371
3365
  const type = elm.type;
3372
3366
  const idVal = elm[`${type}_id`];
3373
- if (!idVal)
3374
- continue;
3367
+ if (!idVal) continue;
3375
3368
  const idNum = Number.parseInt(idVal.split("_").pop());
3376
3369
  if (!Number.isNaN(idNum)) {
3377
3370
  internalStore.counts[type] = Math.max(
@@ -3415,8 +3408,7 @@ var init_dist2 = __esm({
3415
3408
  const joiner = circuitJson.find(
3416
3409
  (e) => e.type === join_type && e[join_key] === using[join_key]
3417
3410
  );
3418
- if (!joiner)
3419
- return null;
3411
+ if (!joiner) return null;
3420
3412
  return circuitJson.find(
3421
3413
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3422
3414
  );
@@ -3454,8 +3446,7 @@ var init_dist2 = __esm({
3454
3446
  const elm = circuitJson.find(
3455
3447
  (e) => e[`${component_type}_id`] === id
3456
3448
  );
3457
- if (!elm)
3458
- return;
3449
+ if (!elm) return;
3459
3450
  circuitJson.splice(circuitJson.indexOf(elm), 1);
3460
3451
  internalStore.editCount++;
3461
3452
  },
@@ -3463,8 +3454,7 @@ var init_dist2 = __esm({
3463
3454
  const elm = circuitJson.find(
3464
3455
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3465
3456
  );
3466
- if (!elm)
3467
- return null;
3457
+ if (!elm) return null;
3468
3458
  Object.assign(elm, newProps);
3469
3459
  internalStore.editCount++;
3470
3460
  return elm;
@@ -3479,15 +3469,12 @@ var init_dist2 = __esm({
3479
3469
  const source_component = circuitJson.find(
3480
3470
  (e) => e.type === "source_component" && e.name === component_name
3481
3471
  );
3482
- if (!source_component)
3483
- return null;
3472
+ if (!source_component) return null;
3484
3473
  const source_port2 = circuitJson.find(
3485
3474
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
3486
3475
  );
3487
- if (!source_port2)
3488
- return null;
3489
- if (component_type === "source_port")
3490
- return source_port2;
3476
+ if (!source_port2) return null;
3477
+ if (component_type === "source_port") return source_port2;
3491
3478
  if (component_type === "pcb_port") {
3492
3479
  return circuitJson.find(
3493
3480
  (e) => e.type === "pcb_port" && e.source_port_id === source_port2.source_port_id
@@ -3519,8 +3506,7 @@ var init_dist2 = __esm({
3519
3506
  for (const elm of soup) {
3520
3507
  const type = elm.type;
3521
3508
  const idVal = elm[`${type}_id`];
3522
- if (!idVal)
3523
- continue;
3509
+ if (!idVal) continue;
3524
3510
  const idNum = Number.parseInt(idVal.split("_").pop() || "");
3525
3511
  if (!Number.isNaN(idNum)) {
3526
3512
  internalStore.counts[type] = Math.max(
@@ -3645,8 +3631,7 @@ var init_dist2 = __esm({
3645
3631
  if (relationMap) {
3646
3632
  const relatedElements = relationMap.get(using[join_key]) || [];
3647
3633
  const joiner2 = relatedElements.find((e) => e.type === join_type);
3648
- if (!joiner2)
3649
- return null;
3634
+ if (!joiner2) return null;
3650
3635
  const joinerId = joiner2[`${component_type}_id`];
3651
3636
  if (indexConfig.byId && internalStore.indexes.byId) {
3652
3637
  return internalStore.indexes.byId.get(
@@ -3667,8 +3652,7 @@ var init_dist2 = __esm({
3667
3652
  const joiner = soup.find(
3668
3653
  (e) => e.type === join_type && e[join_key] === using[join_key]
3669
3654
  );
3670
- if (!joiner)
3671
- return null;
3655
+ if (!joiner) return null;
3672
3656
  return soup.find(
3673
3657
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3674
3658
  ) || null;
@@ -3807,8 +3791,7 @@ var init_dist2 = __esm({
3807
3791
  } else {
3808
3792
  elm = soup.find((e) => e[`${component_type}_id`] === id);
3809
3793
  }
3810
- if (!elm)
3811
- return;
3794
+ if (!elm) return;
3812
3795
  const elmIndex = soup.indexOf(elm);
3813
3796
  if (elmIndex >= 0) {
3814
3797
  soup.splice(elmIndex, 1);
@@ -3885,8 +3868,7 @@ var init_dist2 = __esm({
3885
3868
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3886
3869
  );
3887
3870
  }
3888
- if (!elm)
3889
- return null;
3871
+ if (!elm) return null;
3890
3872
  if (indexConfig.byRelation && internalStore.indexes.byRelation) {
3891
3873
  const elementEntries = Object.entries(elm);
3892
3874
  for (const [key, value] of elementEntries) {
@@ -4002,13 +3984,11 @@ var init_dist2 = __esm({
4002
3984
  const source_component = soup.find(
4003
3985
  (e) => e.type === "source_component" && e.name === component_name
4004
3986
  );
4005
- if (!source_component)
4006
- return null;
3987
+ if (!source_component) return null;
4007
3988
  const source_port2 = soup.find(
4008
3989
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
4009
3990
  );
4010
- if (!source_port2)
4011
- return null;
3991
+ if (!source_port2) return null;
4012
3992
  if (component_type === "source_port")
4013
3993
  return source_port2;
4014
3994
  if (component_type === "pcb_port") {
@@ -4125,8 +4105,7 @@ var init_dist2 = __esm({
4125
4105
  getReadableNameForElement = (soup, elm) => {
4126
4106
  if (typeof elm === "string") {
4127
4107
  const elmObj = getElementById(soup, elm);
4128
- if (!elmObj)
4129
- `unknown (could not find element with id ${elm})`;
4108
+ if (!elmObj) `unknown (could not find element with id ${elm})`;
4130
4109
  return getReadableNameForElement(soup, elmObj);
4131
4110
  }
4132
4111
  switch (elm.type) {
@@ -4148,8 +4127,7 @@ var init_dist2 = __esm({
4148
4127
  let maxX = Number.NEGATIVE_INFINITY;
4149
4128
  let maxY = Number.NEGATIVE_INFINITY;
4150
4129
  for (const elm of elements) {
4151
- if (!elm.type.startsWith("pcb_"))
4152
- continue;
4130
+ if (!elm.type.startsWith("pcb_")) continue;
4153
4131
  let centerX;
4154
4132
  let centerY;
4155
4133
  let width;
@@ -4334,8 +4312,7 @@ var init_dist2 = __esm({
4334
4312
  }
4335
4313
  const title = lo.text || lo.name || lo.source?.text || lo.source?.name || "?";
4336
4314
  const content = lo;
4337
- if (x === void 0 || y === void 0)
4338
- return null;
4315
+ if (x === void 0 || y === void 0) return null;
4339
4316
  if (width === void 0) {
4340
4317
  if ("outer_diameter" in lo) {
4341
4318
  width = lo.outer_diameter;
@@ -133484,7 +133461,7 @@ var import_promises2 = __toESM(require("fs/promises"), 1);
133484
133461
  var package_default2 = {
133485
133462
  name: "easyeda",
133486
133463
  type: "module",
133487
- version: "0.0.207",
133464
+ version: "0.0.209",
133488
133465
  files: [
133489
133466
  "dist"
133490
133467
  ],
@@ -133522,7 +133499,7 @@ var package_default2 = {
133522
133499
  },
133523
133500
  devDependencies: {
133524
133501
  "@biomejs/biome": "^1.9.4",
133525
- "@tscircuit/circuit-json-util": "^0.0.53",
133502
+ "@tscircuit/circuit-json-util": "^0.0.57",
133526
133503
  "@tscircuit/mm": "^0.0.8",
133527
133504
  "@types/bun": "latest",
133528
133505
  "bun-match-svg": "^0.0.6",