@tscircuit/schematic-viewer 2.0.106 → 2.0.108
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 +15 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1468,6 +1468,10 @@ var priorityKeys = [
|
|
|
1468
1468
|
"power_rating",
|
|
1469
1469
|
"manufacturer_part_number"
|
|
1470
1470
|
];
|
|
1471
|
+
var displayKeyAliases = {
|
|
1472
|
+
current_rating_amps: "display_current_rating",
|
|
1473
|
+
voltage_rating_volts: "display_voltage_rating"
|
|
1474
|
+
};
|
|
1471
1475
|
var supplierPartNumberUrls = {
|
|
1472
1476
|
jlcpcb: (partNumber) => `https://jlcpcb.com/partdetail/${encodeURIComponent(partNumber)}`,
|
|
1473
1477
|
lcsc: (partNumber) => `https://www.lcsc.com/product-detail/${encodeURIComponent(partNumber)}.html`
|
|
@@ -1483,7 +1487,8 @@ var getKeyPriority = (key) => {
|
|
|
1483
1487
|
};
|
|
1484
1488
|
var formatComponentValue = (sourceComponent, key, value) => {
|
|
1485
1489
|
if (key === "name") return String(value);
|
|
1486
|
-
const
|
|
1490
|
+
const sourceComponentFields = sourceComponent;
|
|
1491
|
+
const displayValue = sourceComponentFields[`display_${key}`] ?? sourceComponentFields[displayKeyAliases[key]];
|
|
1487
1492
|
if (typeof displayValue === "string" && displayValue.trim()) {
|
|
1488
1493
|
const propValue = key === "resistance" ? displayValue.replace(/Ω$/, "") : displayValue;
|
|
1489
1494
|
return JSON.stringify(propValue);
|
|
@@ -1492,7 +1497,12 @@ var formatComponentValue = (sourceComponent, key, value) => {
|
|
|
1492
1497
|
};
|
|
1493
1498
|
var getSourceComponentInfoEntries = (sourceComponent) => Object.entries(sourceComponent).filter(([key, value]) => {
|
|
1494
1499
|
if (hiddenSourceComponentKeys.has(key)) return false;
|
|
1495
|
-
if (key.
|
|
1500
|
+
if (key === "id" || key.endsWith("_id") || key.endsWith("_ids")) {
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
if (key.startsWith("display_") && (key.slice("display_".length) in sourceComponent || Object.entries(displayKeyAliases).some(
|
|
1504
|
+
([sourceKey, displayKey]) => displayKey === key && sourceKey in sourceComponent
|
|
1505
|
+
))) {
|
|
1496
1506
|
return false;
|
|
1497
1507
|
}
|
|
1498
1508
|
return value !== void 0 && value !== null && value !== "";
|
|
@@ -1965,7 +1975,8 @@ var detailLabelStyle = {
|
|
|
1965
1975
|
color: "#64748b",
|
|
1966
1976
|
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
|
|
1967
1977
|
fontSize: "12px",
|
|
1968
|
-
lineHeight: 1.45
|
|
1978
|
+
lineHeight: 1.45,
|
|
1979
|
+
overflowWrap: "anywhere"
|
|
1969
1980
|
};
|
|
1970
1981
|
var SchematicComponentDetailsTooltip = ({
|
|
1971
1982
|
platformConfig,
|
|
@@ -3304,7 +3315,7 @@ import { useMemo as useMemo5 } from "react";
|
|
|
3304
3315
|
// package.json
|
|
3305
3316
|
var package_default = {
|
|
3306
3317
|
name: "@tscircuit/schematic-viewer",
|
|
3307
|
-
version: "2.0.
|
|
3318
|
+
version: "2.0.107",
|
|
3308
3319
|
repository: {
|
|
3309
3320
|
type: "git",
|
|
3310
3321
|
url: "https://github.com/tscircuit/schematic-viewer"
|