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.
@@ -3019,8 +3019,7 @@ expectStringUnionsMatch(true);
3019
3019
 
3020
3020
  // node_modules/@tscircuit/circuit-json-util/dist/index.js
3021
3021
  function connect(map, a, b) {
3022
- if (!a || !b)
3023
- return;
3022
+ if (!a || !b) return;
3024
3023
  let setA = map.get(a);
3025
3024
  if (!setA) {
3026
3025
  setA = /* @__PURE__ */ new Set();
@@ -3035,8 +3034,7 @@ function connect(map, a, b) {
3035
3034
  setB.add(a);
3036
3035
  }
3037
3036
  function buildSubtree(soup, opts) {
3038
- if (!opts.subcircuit_id && !opts.source_group_id)
3039
- return [...soup];
3037
+ if (!opts.subcircuit_id && !opts.source_group_id) return [...soup];
3040
3038
  const idMap = /* @__PURE__ */ new Map();
3041
3039
  for (const elm of soup) {
3042
3040
  const idVal = elm[`${elm.type}_id`];
@@ -3048,6 +3046,7 @@ function buildSubtree(soup, opts) {
3048
3046
  for (const elm of soup) {
3049
3047
  const entries = Object.entries(elm);
3050
3048
  for (const [key, val58] of entries) {
3049
+ if (key === "parent_source_group_id") continue;
3051
3050
  if (key.endsWith("_id") && typeof val58 === "string") {
3052
3051
  const other = idMap.get(val58);
3053
3052
  connect(adj, elm, other);
@@ -3074,8 +3073,7 @@ function buildSubtree(soup, opts) {
3074
3073
  while (queue.length > 0) {
3075
3074
  const elm = queue.shift();
3076
3075
  const neighbors = adj.get(elm);
3077
- if (!neighbors)
3078
- continue;
3076
+ if (!neighbors) continue;
3079
3077
  for (const n of neighbors) {
3080
3078
  if (!included.has(n)) {
3081
3079
  included.add(n);
@@ -3097,8 +3095,7 @@ var cju = (circuitJsonInput, options = {}) => {
3097
3095
  for (const elm of circuitJson) {
3098
3096
  const type = elm.type;
3099
3097
  const idVal = elm[`${type}_id`];
3100
- if (!idVal)
3101
- continue;
3098
+ if (!idVal) continue;
3102
3099
  const idNum = Number.parseInt(idVal.split("_").pop());
3103
3100
  if (!Number.isNaN(idNum)) {
3104
3101
  internalStore.counts[type] = Math.max(
@@ -3142,8 +3139,7 @@ var cju = (circuitJsonInput, options = {}) => {
3142
3139
  const joiner = circuitJson.find(
3143
3140
  (e) => e.type === join_type && e[join_key] === using[join_key]
3144
3141
  );
3145
- if (!joiner)
3146
- return null;
3142
+ if (!joiner) return null;
3147
3143
  return circuitJson.find(
3148
3144
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3149
3145
  );
@@ -3181,8 +3177,7 @@ var cju = (circuitJsonInput, options = {}) => {
3181
3177
  const elm = circuitJson.find(
3182
3178
  (e) => e[`${component_type}_id`] === id
3183
3179
  );
3184
- if (!elm)
3185
- return;
3180
+ if (!elm) return;
3186
3181
  circuitJson.splice(circuitJson.indexOf(elm), 1);
3187
3182
  internalStore.editCount++;
3188
3183
  },
@@ -3190,8 +3185,7 @@ var cju = (circuitJsonInput, options = {}) => {
3190
3185
  const elm = circuitJson.find(
3191
3186
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3192
3187
  );
3193
- if (!elm)
3194
- return null;
3188
+ if (!elm) return null;
3195
3189
  Object.assign(elm, newProps);
3196
3190
  internalStore.editCount++;
3197
3191
  return elm;
@@ -3206,15 +3200,12 @@ var cju = (circuitJsonInput, options = {}) => {
3206
3200
  const source_component = circuitJson.find(
3207
3201
  (e) => e.type === "source_component" && e.name === component_name
3208
3202
  );
3209
- if (!source_component)
3210
- return null;
3203
+ if (!source_component) return null;
3211
3204
  const source_port2 = circuitJson.find(
3212
3205
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
3213
3206
  );
3214
- if (!source_port2)
3215
- return null;
3216
- if (component_type === "source_port")
3217
- return source_port2;
3207
+ if (!source_port2) return null;
3208
+ if (component_type === "source_port") return source_port2;
3218
3209
  if (component_type === "pcb_port") {
3219
3210
  return circuitJson.find(
3220
3211
  (e) => e.type === "pcb_port" && e.source_port_id === source_port2.source_port_id
@@ -3250,8 +3241,7 @@ var cjuIndexed = (soup, options = {}) => {
3250
3241
  for (const elm of soup) {
3251
3242
  const type = elm.type;
3252
3243
  const idVal = elm[`${type}_id`];
3253
- if (!idVal)
3254
- continue;
3244
+ if (!idVal) continue;
3255
3245
  const idNum = Number.parseInt(idVal.split("_").pop() || "");
3256
3246
  if (!Number.isNaN(idNum)) {
3257
3247
  internalStore.counts[type] = Math.max(
@@ -3376,8 +3366,7 @@ var cjuIndexed = (soup, options = {}) => {
3376
3366
  if (relationMap) {
3377
3367
  const relatedElements = relationMap.get(using[join_key]) || [];
3378
3368
  const joiner2 = relatedElements.find((e) => e.type === join_type);
3379
- if (!joiner2)
3380
- return null;
3369
+ if (!joiner2) return null;
3381
3370
  const joinerId = joiner2[`${component_type}_id`];
3382
3371
  if (indexConfig.byId && internalStore.indexes.byId) {
3383
3372
  return internalStore.indexes.byId.get(
@@ -3398,8 +3387,7 @@ var cjuIndexed = (soup, options = {}) => {
3398
3387
  const joiner = soup.find(
3399
3388
  (e) => e.type === join_type && e[join_key] === using[join_key]
3400
3389
  );
3401
- if (!joiner)
3402
- return null;
3390
+ if (!joiner) return null;
3403
3391
  return soup.find(
3404
3392
  (e) => e.type === component_type && e[`${component_type}_id`] === joiner[`${component_type}_id`]
3405
3393
  ) || null;
@@ -3538,8 +3526,7 @@ var cjuIndexed = (soup, options = {}) => {
3538
3526
  } else {
3539
3527
  elm = soup.find((e) => e[`${component_type}_id`] === id);
3540
3528
  }
3541
- if (!elm)
3542
- return;
3529
+ if (!elm) return;
3543
3530
  const elmIndex = soup.indexOf(elm);
3544
3531
  if (elmIndex >= 0) {
3545
3532
  soup.splice(elmIndex, 1);
@@ -3616,8 +3603,7 @@ var cjuIndexed = (soup, options = {}) => {
3616
3603
  (e) => e.type === component_type && e[`${component_type}_id`] === id
3617
3604
  );
3618
3605
  }
3619
- if (!elm)
3620
- return null;
3606
+ if (!elm) return null;
3621
3607
  if (indexConfig.byRelation && internalStore.indexes.byRelation) {
3622
3608
  const elementEntries = Object.entries(elm);
3623
3609
  for (const [key, value] of elementEntries) {
@@ -3733,13 +3719,11 @@ var cjuIndexed = (soup, options = {}) => {
3733
3719
  const source_component = soup.find(
3734
3720
  (e) => e.type === "source_component" && e.name === component_name
3735
3721
  );
3736
- if (!source_component)
3737
- return null;
3722
+ if (!source_component) return null;
3738
3723
  const source_port2 = soup.find(
3739
3724
  (e) => e.type === "source_port" && e.source_component_id === source_component.source_component_id && (e.name === port_selector || (e.port_hints ?? []).includes(port_selector))
3740
3725
  );
3741
- if (!source_port2)
3742
- return null;
3726
+ if (!source_port2) return null;
3743
3727
  if (component_type === "source_port")
3744
3728
  return source_port2;
3745
3729
  if (component_type === "pcb_port") {
@@ -3835,16 +3819,13 @@ function getReadableNameForPcbTrace(soup, pcb_trace_id) {
3835
3819
  }
3836
3820
  function getComponentAndPortInfo(pcb_port_id) {
3837
3821
  const pcbPort = cju(soup).pcb_port.get(pcb_port_id);
3838
- if (!pcbPort)
3839
- return null;
3822
+ if (!pcbPort) return null;
3840
3823
  const pcbComponent = cju(soup).pcb_component.get(pcbPort.pcb_component_id);
3841
- if (!pcbComponent)
3842
- return null;
3824
+ if (!pcbComponent) return null;
3843
3825
  const sourceComponent = cju(soup).source_component.get(
3844
3826
  pcbComponent.source_component_id
3845
3827
  );
3846
- if (!sourceComponent)
3847
- return null;
3828
+ if (!sourceComponent) return null;
3848
3829
  const sourcePort = cju(soup).source_port.get(pcbPort.source_port_id);
3849
3830
  const portHint = sourcePort?.port_hints ? sourcePort.port_hints[1] : "";
3850
3831
  return {
@@ -3900,8 +3881,7 @@ function getReadableNameForPcbSmtpad(soup, pcb_smtpad_id) {
3900
3881
  var getReadableNameForElement = (soup, elm) => {
3901
3882
  if (typeof elm === "string") {
3902
3883
  const elmObj = getElementById(soup, elm);
3903
- if (!elmObj)
3904
- `unknown (could not find element with id ${elm})`;
3884
+ if (!elmObj) `unknown (could not find element with id ${elm})`;
3905
3885
  return getReadableNameForElement(soup, elmObj);
3906
3886
  }
3907
3887
  switch (elm.type) {
@@ -3923,8 +3903,7 @@ var getBoundsOfPcbElements = (elements) => {
3923
3903
  let maxX = Number.NEGATIVE_INFINITY;
3924
3904
  let maxY = Number.NEGATIVE_INFINITY;
3925
3905
  for (const elm of elements) {
3926
- if (!elm.type.startsWith("pcb_"))
3927
- continue;
3906
+ if (!elm.type.startsWith("pcb_")) continue;
3928
3907
  let centerX;
3929
3908
  let centerY;
3930
3909
  let width;
@@ -3977,8 +3956,7 @@ var getBoundsOfPcbElements = (elements) => {
3977
3956
  };
3978
3957
  function stringHash(str) {
3979
3958
  let hash = 0;
3980
- if (str.length == 0)
3981
- return hash;
3959
+ if (str.length == 0) return hash;
3982
3960
  for (var i = 0; i < str.length; i++) {
3983
3961
  var char = str.charCodeAt(i);
3984
3962
  hash = (hash << 5) - hash + char;
@@ -4120,8 +4098,7 @@ var getDebugLayoutObject = (lo) => {
4120
4098
  }
4121
4099
  const title = lo.text || lo.name || lo.source?.text || lo.source?.name || "?";
4122
4100
  const content = lo;
4123
- if (x === void 0 || y === void 0)
4124
- return null;
4101
+ if (x === void 0 || y === void 0) return null;
4125
4102
  if (width === void 0) {
4126
4103
  if ("outer_diameter" in lo) {
4127
4104
  width = lo.outer_diameter;
@@ -26250,4 +26227,4 @@ svgson/dist/svgson.umd.js:
26250
26227
  * @license MIT
26251
26228
  *)
26252
26229
  */
26253
- //# sourceMappingURL=chunk-2OEE54ND.js.map
26230
+ //# sourceMappingURL=chunk-OTDH63JU.js.map