@tscircuit/core 0.0.1365 → 0.0.1366
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.d.ts +1 -1
- package/dist/index.js +78 -66
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2169,7 +2169,7 @@ declare class NormalComponent<ZodProps extends z.ZodType = any, PortNames extend
|
|
|
2169
2169
|
_hasStartedFootprintUrlLoad: boolean;
|
|
2170
2170
|
_hasStartedSupplierFootprintMismatchWarningCheck: boolean;
|
|
2171
2171
|
private _invalidFootprintPropMessages;
|
|
2172
|
-
|
|
2172
|
+
_invalidPinLabelMessages: string[];
|
|
2173
2173
|
/**
|
|
2174
2174
|
* Set to true to enable automatic silkscreen text adjustment when it overlaps with other components
|
|
2175
2175
|
*/
|
package/dist/index.js
CHANGED
|
@@ -114,7 +114,6 @@ import {
|
|
|
114
114
|
pcb_manual_edit_conflict_warning,
|
|
115
115
|
point3 as point32,
|
|
116
116
|
rotation as rotation2,
|
|
117
|
-
schematic_manual_edit_conflict_warning,
|
|
118
117
|
unknown_error_finding_part as unknown_error_finding_part2
|
|
119
118
|
} from "circuit-json";
|
|
120
119
|
import Debug5 from "debug";
|
|
@@ -2007,9 +2006,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
2007
2006
|
_resolveSchematicSheetId() {
|
|
2008
2007
|
const schSheetName = this._parsedProps?.schSheetName ?? this.props.schSheetName;
|
|
2009
2008
|
if (schSheetName) {
|
|
2010
|
-
const matchingSheet = this.root?.db.schematic_sheet.list().find(
|
|
2011
|
-
(sheet) => sheet.name === schSheetName || sheet.schematic_sheet_id === schSheetName
|
|
2012
|
-
);
|
|
2009
|
+
const matchingSheet = this.root?.db.schematic_sheet.list().find((sheet) => sheet.name === schSheetName);
|
|
2013
2010
|
if (matchingSheet) return matchingSheet.schematic_sheet_id;
|
|
2014
2011
|
}
|
|
2015
2012
|
if (this.schematic_sheet_id) return this.schematic_sheet_id;
|
|
@@ -11462,7 +11459,7 @@ var getNumericSchPinStyle = (pinStyles, pinLabels) => {
|
|
|
11462
11459
|
|
|
11463
11460
|
// lib/components/base-components/NormalComponent/NormalComponent.ts
|
|
11464
11461
|
import {
|
|
11465
|
-
isValidElement as
|
|
11462
|
+
isValidElement as isReactElement3,
|
|
11466
11463
|
isValidElement
|
|
11467
11464
|
} from "react";
|
|
11468
11465
|
import { symbols as symbols2 } from "schematic-symbols";
|
|
@@ -12585,6 +12582,79 @@ function NormalComponent_doInitialSupplierFootprintMismatchWarning(component) {
|
|
|
12585
12582
|
});
|
|
12586
12583
|
}
|
|
12587
12584
|
|
|
12585
|
+
// lib/components/base-components/NormalComponent/NormalComponent_doInitialSchematicComponentRender.ts
|
|
12586
|
+
import { schematic_manual_edit_conflict_warning } from "circuit-json";
|
|
12587
|
+
import { isValidElement as isReactElement2 } from "react";
|
|
12588
|
+
function NormalComponent_doInitialSchematicComponentRender(component) {
|
|
12589
|
+
if (component.root?.schematicDisabled) return;
|
|
12590
|
+
if (component.getCollapsedSchematicBoxAncestor()) return;
|
|
12591
|
+
const { db } = component.root;
|
|
12592
|
+
if (component._invalidPinLabelMessages?.length && component.root?.db) {
|
|
12593
|
+
for (const message of component._invalidPinLabelMessages) {
|
|
12594
|
+
let property_name = "pinLabels";
|
|
12595
|
+
const match = message.match(/^Invalid pin label:\s*([^=]+)=\s*'([^']+)'/);
|
|
12596
|
+
if (match) {
|
|
12597
|
+
const label = match[2];
|
|
12598
|
+
property_name = `pinLabels['${label}']`;
|
|
12599
|
+
}
|
|
12600
|
+
component.root.db.source_property_ignored_warning.insert({
|
|
12601
|
+
source_component_id: component.source_component_id,
|
|
12602
|
+
property_name,
|
|
12603
|
+
message,
|
|
12604
|
+
error_type: "source_property_ignored_warning"
|
|
12605
|
+
});
|
|
12606
|
+
}
|
|
12607
|
+
}
|
|
12608
|
+
if (component._parsedProps.schPinSpacing !== void 0 && component.root?.db) {
|
|
12609
|
+
component.root.db.source_property_ignored_warning.insert({
|
|
12610
|
+
source_component_id: component.source_component_id,
|
|
12611
|
+
property_name: "schPinSpacing",
|
|
12612
|
+
error_type: "source_property_ignored_warning",
|
|
12613
|
+
message: "schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."
|
|
12614
|
+
});
|
|
12615
|
+
}
|
|
12616
|
+
const { schematicSymbolName } = component.config;
|
|
12617
|
+
const { _parsedProps: props } = component;
|
|
12618
|
+
const hasSymbolChild = component.children.some(
|
|
12619
|
+
(c) => c.componentName === "Symbol"
|
|
12620
|
+
);
|
|
12621
|
+
if (props.symbol && isReactElement2(props.symbol) || hasSymbolChild) {
|
|
12622
|
+
component._doInitialSchematicComponentRenderWithReactSymbol(props.symbol);
|
|
12623
|
+
} else if (schematicSymbolName) {
|
|
12624
|
+
component._doInitialSchematicComponentRenderWithSymbol();
|
|
12625
|
+
} else {
|
|
12626
|
+
const dimensions = component._getSchematicBoxDimensions();
|
|
12627
|
+
if (dimensions) {
|
|
12628
|
+
component._doInitialSchematicComponentRenderWithSchematicBoxDimensions();
|
|
12629
|
+
}
|
|
12630
|
+
}
|
|
12631
|
+
const manualPlacement = component.getSubcircuit()?._getSchematicManualPlacementForComponent(component);
|
|
12632
|
+
if (component.schematic_component_id && (component.props.schX !== void 0 || component.props.schY !== void 0) && !!manualPlacement) {
|
|
12633
|
+
if (!component.schematic_component_id) {
|
|
12634
|
+
return;
|
|
12635
|
+
}
|
|
12636
|
+
const warning = schematic_manual_edit_conflict_warning.parse({
|
|
12637
|
+
type: "schematic_manual_edit_conflict_warning",
|
|
12638
|
+
schematic_manual_edit_conflict_warning_id: `schematic_manual_edit_conflict_${component.source_component_id}`,
|
|
12639
|
+
message: `${component.getString()} has both manual placement and prop coordinates. schX and schY will be used. Remove schX/schY or clear the manual placement.`,
|
|
12640
|
+
schematic_component_id: component.schematic_component_id,
|
|
12641
|
+
source_component_id: component.source_component_id,
|
|
12642
|
+
subcircuit_id: component.getSubcircuit()?.subcircuit_id
|
|
12643
|
+
});
|
|
12644
|
+
db.schematic_manual_edit_conflict_warning.insert(warning);
|
|
12645
|
+
}
|
|
12646
|
+
const schSheetName = component._parsedProps?.schSheetName ?? component.props.schSheetName;
|
|
12647
|
+
if (schSheetName && component.source_component_id && !component._resolveSchematicSheetId()) {
|
|
12648
|
+
db.source_property_ignored_warning.insert({
|
|
12649
|
+
source_component_id: component.source_component_id,
|
|
12650
|
+
property_name: "schSheetName",
|
|
12651
|
+
error_type: "source_property_ignored_warning",
|
|
12652
|
+
subcircuit_id: component.getSubcircuit()?.subcircuit_id ?? void 0,
|
|
12653
|
+
message: `${component.getString()} references schSheetName "${schSheetName}", which does not match any schematic sheet and will be ignored.`
|
|
12654
|
+
});
|
|
12655
|
+
}
|
|
12656
|
+
}
|
|
12657
|
+
|
|
12588
12658
|
// lib/components/base-components/NormalComponent/utils/canMergePortDefinitions.ts
|
|
12589
12659
|
var canMergePortDefinitions = (a, b) => {
|
|
12590
12660
|
const aPinNumber = a._parsedProps.pinNumber;
|
|
@@ -13150,65 +13220,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
13150
13220
|
* You can override this method to do more complicated things.
|
|
13151
13221
|
*/
|
|
13152
13222
|
doInitialSchematicComponentRender() {
|
|
13153
|
-
|
|
13154
|
-
if (this.getCollapsedSchematicBoxAncestor()) return;
|
|
13155
|
-
const { db } = this.root;
|
|
13156
|
-
if (this._invalidPinLabelMessages?.length && this.root?.db) {
|
|
13157
|
-
for (const message of this._invalidPinLabelMessages) {
|
|
13158
|
-
let property_name = "pinLabels";
|
|
13159
|
-
const match = message.match(
|
|
13160
|
-
/^Invalid pin label:\s*([^=]+)=\s*'([^']+)'/
|
|
13161
|
-
);
|
|
13162
|
-
if (match) {
|
|
13163
|
-
const label = match[2];
|
|
13164
|
-
property_name = `pinLabels['${label}']`;
|
|
13165
|
-
}
|
|
13166
|
-
this.root.db.source_property_ignored_warning.insert({
|
|
13167
|
-
source_component_id: this.source_component_id,
|
|
13168
|
-
property_name,
|
|
13169
|
-
message,
|
|
13170
|
-
error_type: "source_property_ignored_warning"
|
|
13171
|
-
});
|
|
13172
|
-
}
|
|
13173
|
-
}
|
|
13174
|
-
if (this._parsedProps.schPinSpacing !== void 0 && this.root?.db) {
|
|
13175
|
-
this.root.db.source_property_ignored_warning.insert({
|
|
13176
|
-
source_component_id: this.source_component_id,
|
|
13177
|
-
property_name: "schPinSpacing",
|
|
13178
|
-
error_type: "source_property_ignored_warning",
|
|
13179
|
-
message: "schPinSpacing is deprecated and will be ignored. Pin spacing is always 0.2."
|
|
13180
|
-
});
|
|
13181
|
-
}
|
|
13182
|
-
const { schematicSymbolName } = this.config;
|
|
13183
|
-
const { _parsedProps: props } = this;
|
|
13184
|
-
const hasSymbolChild = this.children.some(
|
|
13185
|
-
(c) => c.componentName === "Symbol"
|
|
13186
|
-
);
|
|
13187
|
-
if (props.symbol && isReactElement2(props.symbol) || hasSymbolChild) {
|
|
13188
|
-
this._doInitialSchematicComponentRenderWithReactSymbol(props.symbol);
|
|
13189
|
-
} else if (schematicSymbolName) {
|
|
13190
|
-
this._doInitialSchematicComponentRenderWithSymbol();
|
|
13191
|
-
} else {
|
|
13192
|
-
const dimensions = this._getSchematicBoxDimensions();
|
|
13193
|
-
if (dimensions) {
|
|
13194
|
-
this._doInitialSchematicComponentRenderWithSchematicBoxDimensions();
|
|
13195
|
-
}
|
|
13196
|
-
}
|
|
13197
|
-
const manualPlacement = this.getSubcircuit()?._getSchematicManualPlacementForComponent(this);
|
|
13198
|
-
if (this.schematic_component_id && (this.props.schX !== void 0 || this.props.schY !== void 0) && !!manualPlacement) {
|
|
13199
|
-
if (!this.schematic_component_id) {
|
|
13200
|
-
return;
|
|
13201
|
-
}
|
|
13202
|
-
const warning = schematic_manual_edit_conflict_warning.parse({
|
|
13203
|
-
type: "schematic_manual_edit_conflict_warning",
|
|
13204
|
-
schematic_manual_edit_conflict_warning_id: `schematic_manual_edit_conflict_${this.source_component_id}`,
|
|
13205
|
-
message: `${this.getString()} has both manual placement and prop coordinates. schX and schY will be used. Remove schX/schY or clear the manual placement.`,
|
|
13206
|
-
schematic_component_id: this.schematic_component_id,
|
|
13207
|
-
source_component_id: this.source_component_id,
|
|
13208
|
-
subcircuit_id: this.getSubcircuit()?.subcircuit_id
|
|
13209
|
-
});
|
|
13210
|
-
db.schematic_manual_edit_conflict_warning.insert(warning);
|
|
13211
|
-
}
|
|
13223
|
+
NormalComponent_doInitialSchematicComponentRender(this);
|
|
13212
13224
|
}
|
|
13213
13225
|
_getSchematicSymbolDisplayValue() {
|
|
13214
13226
|
return void 0;
|
|
@@ -13638,7 +13650,7 @@ var NormalComponent3 = class extends PrimitiveComponent2 {
|
|
|
13638
13650
|
}
|
|
13639
13651
|
add(componentOrElm) {
|
|
13640
13652
|
let component;
|
|
13641
|
-
if (
|
|
13653
|
+
if (isReactElement3(componentOrElm)) {
|
|
13642
13654
|
const subtree = this._renderReactSubtree(componentOrElm);
|
|
13643
13655
|
this.reactSubtrees.push(subtree);
|
|
13644
13656
|
component = subtree.component;
|
|
@@ -24347,7 +24359,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
24347
24359
|
var package_default = {
|
|
24348
24360
|
name: "@tscircuit/core",
|
|
24349
24361
|
type: "module",
|
|
24350
|
-
version: "0.0.
|
|
24362
|
+
version: "0.0.1365",
|
|
24351
24363
|
types: "dist/index.d.ts",
|
|
24352
24364
|
main: "dist/index.js",
|
|
24353
24365
|
module: "dist/index.js",
|