@tscircuit/core 0.0.1086 → 0.0.1088
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 +88 -82
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5498,6 +5498,81 @@ function normalizeTextForCircuitJson(text) {
|
|
|
5498
5498
|
return text.replace(/\\n/g, "\n");
|
|
5499
5499
|
}
|
|
5500
5500
|
|
|
5501
|
+
// lib/utils/pcbSx/resolve-pcb-property.ts
|
|
5502
|
+
function parseSegment(seg) {
|
|
5503
|
+
const bracketIdx = seg.indexOf("[");
|
|
5504
|
+
if (bracketIdx === -1) return { tag: seg };
|
|
5505
|
+
const tag = seg.slice(0, bracketIdx);
|
|
5506
|
+
const attrPart = seg.slice(bracketIdx + 1, seg.lastIndexOf("]"));
|
|
5507
|
+
const m = attrPart.match(/^(\w+)(\^=|\$=|=)['"]?(.*?)['"]?$/);
|
|
5508
|
+
if (!m) return { tag };
|
|
5509
|
+
return { tag, attrName: m[1], attrOp: m[2], attrValue: m[3] };
|
|
5510
|
+
}
|
|
5511
|
+
function componentMatchesSegment(component, seg) {
|
|
5512
|
+
if (component.lowercaseComponentName !== seg.tag) return false;
|
|
5513
|
+
if (!seg.attrName) return true;
|
|
5514
|
+
const attrVal = component.props?.[seg.attrName];
|
|
5515
|
+
if (attrVal === void 0) return false;
|
|
5516
|
+
const valStr = String(attrVal);
|
|
5517
|
+
switch (seg.attrOp) {
|
|
5518
|
+
case "^=":
|
|
5519
|
+
return valStr.startsWith(seg.attrValue);
|
|
5520
|
+
case "$=":
|
|
5521
|
+
return valStr.endsWith(seg.attrValue);
|
|
5522
|
+
case "=":
|
|
5523
|
+
return valStr === seg.attrValue;
|
|
5524
|
+
default:
|
|
5525
|
+
return false;
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
function matchesCompoundSelector(component, segments) {
|
|
5529
|
+
if (!componentMatchesSegment(component, segments[segments.length - 1])) {
|
|
5530
|
+
return false;
|
|
5531
|
+
}
|
|
5532
|
+
let segIdx = segments.length - 2;
|
|
5533
|
+
let current = component.parent;
|
|
5534
|
+
while (segIdx >= 0 && current) {
|
|
5535
|
+
if (componentMatchesSegment(current, segments[segIdx])) {
|
|
5536
|
+
segIdx--;
|
|
5537
|
+
}
|
|
5538
|
+
current = current.parent;
|
|
5539
|
+
}
|
|
5540
|
+
return segIdx < 0;
|
|
5541
|
+
}
|
|
5542
|
+
function resolvePcbProperty({
|
|
5543
|
+
propertyName,
|
|
5544
|
+
resolvedPcbSx,
|
|
5545
|
+
pathFromAmpersand,
|
|
5546
|
+
component
|
|
5547
|
+
}) {
|
|
5548
|
+
if (!resolvedPcbSx) return void 0;
|
|
5549
|
+
let result;
|
|
5550
|
+
let bestSpecificity = 0;
|
|
5551
|
+
for (const [key, entry] of Object.entries(resolvedPcbSx)) {
|
|
5552
|
+
if (!entry || !(propertyName in entry)) continue;
|
|
5553
|
+
const selectorBody = key.startsWith("& ") ? key.slice(2) : key;
|
|
5554
|
+
if (selectorBody === pathFromAmpersand) {
|
|
5555
|
+
const specificity = 1;
|
|
5556
|
+
if (specificity > bestSpecificity) {
|
|
5557
|
+
bestSpecificity = specificity;
|
|
5558
|
+
result = entry[propertyName];
|
|
5559
|
+
}
|
|
5560
|
+
continue;
|
|
5561
|
+
}
|
|
5562
|
+
if (!component) continue;
|
|
5563
|
+
const segments = selectorBody.split(/\s+/).map(parseSegment);
|
|
5564
|
+
if (segments.length < 2) continue;
|
|
5565
|
+
if (matchesCompoundSelector(component, segments)) {
|
|
5566
|
+
const specificity = segments.length;
|
|
5567
|
+
if (specificity > bestSpecificity) {
|
|
5568
|
+
bestSpecificity = specificity;
|
|
5569
|
+
result = entry[propertyName];
|
|
5570
|
+
}
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
return result;
|
|
5574
|
+
}
|
|
5575
|
+
|
|
5501
5576
|
// lib/components/primitive-components/FabricationNoteText.ts
|
|
5502
5577
|
var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
5503
5578
|
pcb_fabrication_note_text_id = null;
|
|
@@ -5515,6 +5590,13 @@ var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
|
5515
5590
|
const position = this._getGlobalPcbPositionBeforeLayout();
|
|
5516
5591
|
const container = this.getPrimitiveContainer();
|
|
5517
5592
|
const subcircuit = this.getSubcircuit();
|
|
5593
|
+
const resolvedPcbSxVisibility = resolvePcbProperty({
|
|
5594
|
+
propertyName: "visibility",
|
|
5595
|
+
resolvedPcbSx: this.getResolvedPcbSx(),
|
|
5596
|
+
pathFromAmpersand: "fabricationnotetext",
|
|
5597
|
+
component: this
|
|
5598
|
+
});
|
|
5599
|
+
if (resolvedPcbSxVisibility === "hidden") return;
|
|
5518
5600
|
const pcb_fabrication_note_text = db.pcb_fabrication_note_text.insert({
|
|
5519
5601
|
anchor_alignment: props.anchorAlignment,
|
|
5520
5602
|
anchor_position: {
|
|
@@ -6749,83 +6831,6 @@ var SilkscreenRect = class extends PrimitiveComponent2 {
|
|
|
6749
6831
|
|
|
6750
6832
|
// lib/components/primitive-components/SilkscreenText.ts
|
|
6751
6833
|
import { silkscreenTextProps } from "@tscircuit/props";
|
|
6752
|
-
|
|
6753
|
-
// lib/utils/pcbSx/resolve-pcb-property.ts
|
|
6754
|
-
function parseSegment(seg) {
|
|
6755
|
-
const bracketIdx = seg.indexOf("[");
|
|
6756
|
-
if (bracketIdx === -1) return { tag: seg };
|
|
6757
|
-
const tag = seg.slice(0, bracketIdx);
|
|
6758
|
-
const attrPart = seg.slice(bracketIdx + 1, seg.lastIndexOf("]"));
|
|
6759
|
-
const m = attrPart.match(/^(\w+)(\^=|\$=|=)['"]?(.*?)['"]?$/);
|
|
6760
|
-
if (!m) return { tag };
|
|
6761
|
-
return { tag, attrName: m[1], attrOp: m[2], attrValue: m[3] };
|
|
6762
|
-
}
|
|
6763
|
-
function componentMatchesSegment(component, seg) {
|
|
6764
|
-
if (component.lowercaseComponentName !== seg.tag) return false;
|
|
6765
|
-
if (!seg.attrName) return true;
|
|
6766
|
-
const attrVal = component.props?.[seg.attrName];
|
|
6767
|
-
if (attrVal === void 0) return false;
|
|
6768
|
-
const valStr = String(attrVal);
|
|
6769
|
-
switch (seg.attrOp) {
|
|
6770
|
-
case "^=":
|
|
6771
|
-
return valStr.startsWith(seg.attrValue);
|
|
6772
|
-
case "$=":
|
|
6773
|
-
return valStr.endsWith(seg.attrValue);
|
|
6774
|
-
case "=":
|
|
6775
|
-
return valStr === seg.attrValue;
|
|
6776
|
-
default:
|
|
6777
|
-
return false;
|
|
6778
|
-
}
|
|
6779
|
-
}
|
|
6780
|
-
function matchesCompoundSelector(component, segments) {
|
|
6781
|
-
if (!componentMatchesSegment(component, segments[segments.length - 1])) {
|
|
6782
|
-
return false;
|
|
6783
|
-
}
|
|
6784
|
-
let segIdx = segments.length - 2;
|
|
6785
|
-
let current = component.parent;
|
|
6786
|
-
while (segIdx >= 0 && current) {
|
|
6787
|
-
if (componentMatchesSegment(current, segments[segIdx])) {
|
|
6788
|
-
segIdx--;
|
|
6789
|
-
}
|
|
6790
|
-
current = current.parent;
|
|
6791
|
-
}
|
|
6792
|
-
return segIdx < 0;
|
|
6793
|
-
}
|
|
6794
|
-
function resolvePcbProperty({
|
|
6795
|
-
propertyName,
|
|
6796
|
-
resolvedPcbSx,
|
|
6797
|
-
pathFromAmpersand,
|
|
6798
|
-
component
|
|
6799
|
-
}) {
|
|
6800
|
-
if (!resolvedPcbSx) return void 0;
|
|
6801
|
-
let result;
|
|
6802
|
-
let bestSpecificity = 0;
|
|
6803
|
-
for (const [key, entry] of Object.entries(resolvedPcbSx)) {
|
|
6804
|
-
if (!entry || !(propertyName in entry)) continue;
|
|
6805
|
-
const selectorBody = key.startsWith("& ") ? key.slice(2) : key;
|
|
6806
|
-
if (selectorBody === pathFromAmpersand) {
|
|
6807
|
-
const specificity = 1;
|
|
6808
|
-
if (specificity > bestSpecificity) {
|
|
6809
|
-
bestSpecificity = specificity;
|
|
6810
|
-
result = entry[propertyName];
|
|
6811
|
-
}
|
|
6812
|
-
continue;
|
|
6813
|
-
}
|
|
6814
|
-
if (!component) continue;
|
|
6815
|
-
const segments = selectorBody.split(/\s+/).map(parseSegment);
|
|
6816
|
-
if (segments.length < 2) continue;
|
|
6817
|
-
if (matchesCompoundSelector(component, segments)) {
|
|
6818
|
-
const specificity = segments.length;
|
|
6819
|
-
if (specificity > bestSpecificity) {
|
|
6820
|
-
bestSpecificity = specificity;
|
|
6821
|
-
result = entry[propertyName];
|
|
6822
|
-
}
|
|
6823
|
-
}
|
|
6824
|
-
}
|
|
6825
|
-
return result;
|
|
6826
|
-
}
|
|
6827
|
-
|
|
6828
|
-
// lib/components/primitive-components/SilkscreenText.ts
|
|
6829
6834
|
import {
|
|
6830
6835
|
applyToPoint as applyToPoint13,
|
|
6831
6836
|
compose as compose3,
|
|
@@ -18194,7 +18199,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
18194
18199
|
var package_default = {
|
|
18195
18200
|
name: "@tscircuit/core",
|
|
18196
18201
|
type: "module",
|
|
18197
|
-
version: "0.0.
|
|
18202
|
+
version: "0.0.1087",
|
|
18198
18203
|
types: "dist/index.d.ts",
|
|
18199
18204
|
main: "dist/index.js",
|
|
18200
18205
|
module: "dist/index.js",
|
|
@@ -18239,7 +18244,7 @@ var package_default = {
|
|
|
18239
18244
|
"@tscircuit/math-utils": "^0.0.29",
|
|
18240
18245
|
"@tscircuit/miniflex": "^0.0.4",
|
|
18241
18246
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
18242
|
-
"@tscircuit/props": "^0.0.
|
|
18247
|
+
"@tscircuit/props": "^0.0.490",
|
|
18243
18248
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
18244
18249
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
18245
18250
|
"@tscircuit/solver-utils": "^0.0.3",
|
|
@@ -19114,12 +19119,13 @@ var Board = class extends Group6 {
|
|
|
19114
19119
|
const { db } = this.root;
|
|
19115
19120
|
const routingDisabled = this.root?.pcbRoutingDisabled || this.getInheritedProperty("routingDisabled");
|
|
19116
19121
|
const pcbDisabled = this.root?.pcbDisabled;
|
|
19122
|
+
const drcChecksDisabled = this.root?.platform?.drcChecksDisabled ?? this.getInheritedProperty("drcChecksDisabled");
|
|
19117
19123
|
const netlistDrcChecksDisabled = this.root?.platform?.netlistDrcChecksDisabled ?? this.getInheritedProperty("netlistDrcChecksDisabled");
|
|
19118
19124
|
const placementDrcChecksDisabled = this.root?.platform?.placementDrcChecksDisabled ?? this.getInheritedProperty("placementDrcChecksDisabled");
|
|
19119
19125
|
const routingDrcChecksDisabled = this.root?.platform?.routingDrcChecksDisabled ?? this.getInheritedProperty("routingDrcChecksDisabled");
|
|
19120
|
-
const shouldRunNetlistChecks = !netlistDrcChecksDisabled;
|
|
19121
|
-
const shouldRunPlacementChecks = !pcbDisabled && !placementDrcChecksDisabled;
|
|
19122
|
-
const shouldRunRoutingChecks = !pcbDisabled && !routingDisabled && !routingDrcChecksDisabled;
|
|
19126
|
+
const shouldRunNetlistChecks = !drcChecksDisabled && !netlistDrcChecksDisabled;
|
|
19127
|
+
const shouldRunPlacementChecks = !drcChecksDisabled && !pcbDisabled && !placementDrcChecksDisabled;
|
|
19128
|
+
const shouldRunRoutingChecks = !drcChecksDisabled && !pcbDisabled && !routingDisabled && !routingDrcChecksDisabled;
|
|
19123
19129
|
if (shouldRunRoutingChecks && this._hasIncompleteAsyncEffectsInSubtreeForPhase("PcbTraceRender"))
|
|
19124
19130
|
return;
|
|
19125
19131
|
const hasTracesToRoute = this._hasTracesToRoute();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.1088",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@tscircuit/math-utils": "^0.0.29",
|
|
47
47
|
"@tscircuit/miniflex": "^0.0.4",
|
|
48
48
|
"@tscircuit/ngspice-spice-engine": "^0.0.8",
|
|
49
|
-
"@tscircuit/props": "^0.0.
|
|
49
|
+
"@tscircuit/props": "^0.0.490",
|
|
50
50
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
51
51
|
"@tscircuit/schematic-trace-solver": "^v0.0.45",
|
|
52
52
|
"@tscircuit/solver-utils": "^0.0.3",
|