@tscircuit/core 0.0.1964 → 0.0.1965
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 +6 -6
- package/dist/index.js +28 -20
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -98194,7 +98194,7 @@ declare const baseBreakoutPointProps: zod.ZodObject<Omit<{
|
|
|
98194
98194
|
pcbOffsetX?: number | undefined;
|
|
98195
98195
|
pcbOffsetY?: number | undefined;
|
|
98196
98196
|
pcbPositionAnchor?: string | undefined;
|
|
98197
|
-
pcbPositionMode?: "
|
|
98197
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
98198
98198
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
98199
98199
|
pcbMarginTop?: number | undefined;
|
|
98200
98200
|
pcbMarginRight?: number | undefined;
|
|
@@ -98225,7 +98225,7 @@ declare const baseBreakoutPointProps: zod.ZodObject<Omit<{
|
|
|
98225
98225
|
pcbOffsetX?: string | number | undefined;
|
|
98226
98226
|
pcbOffsetY?: string | number | undefined;
|
|
98227
98227
|
pcbPositionAnchor?: string | undefined;
|
|
98228
|
-
pcbPositionMode?: "
|
|
98228
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
98229
98229
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
98230
98230
|
pcbMarginTop?: string | number | undefined;
|
|
98231
98231
|
pcbMarginRight?: string | number | undefined;
|
|
@@ -108349,7 +108349,7 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
108349
108349
|
pcbOffsetY?: number | undefined;
|
|
108350
108350
|
pcbRotation?: number | undefined;
|
|
108351
108351
|
pcbPositionAnchor?: string | undefined;
|
|
108352
|
-
pcbPositionMode?: "
|
|
108352
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
108353
108353
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
108354
108354
|
pcbMarginTop?: number | undefined;
|
|
108355
108355
|
pcbMarginRight?: number | undefined;
|
|
@@ -108418,7 +108418,7 @@ declare const pcbViaProps: z.ZodObject<{
|
|
|
108418
108418
|
pcbOffsetY?: string | number | undefined;
|
|
108419
108419
|
pcbRotation?: string | number | undefined;
|
|
108420
108420
|
pcbPositionAnchor?: string | undefined;
|
|
108421
|
-
pcbPositionMode?: "
|
|
108421
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
108422
108422
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
108423
108423
|
pcbMarginTop?: string | number | undefined;
|
|
108424
108424
|
pcbMarginRight?: string | number | undefined;
|
|
@@ -108609,7 +108609,7 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
108609
108609
|
pcbOffsetY?: number | undefined;
|
|
108610
108610
|
pcbRotation?: number | undefined;
|
|
108611
108611
|
pcbPositionAnchor?: string | undefined;
|
|
108612
|
-
pcbPositionMode?: "
|
|
108612
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
108613
108613
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
108614
108614
|
pcbMarginTop?: number | undefined;
|
|
108615
108615
|
pcbMarginRight?: number | undefined;
|
|
@@ -108678,7 +108678,7 @@ declare class PcbVia extends PrimitiveComponent<typeof pcbViaProps> {
|
|
|
108678
108678
|
pcbOffsetY?: string | number | undefined;
|
|
108679
108679
|
pcbRotation?: string | number | undefined;
|
|
108680
108680
|
pcbPositionAnchor?: string | undefined;
|
|
108681
|
-
pcbPositionMode?: "
|
|
108681
|
+
pcbPositionMode?: "auto" | "relative_to_group_anchor" | "relative_to_board_anchor" | "relative_to_component_anchor" | undefined;
|
|
108682
108682
|
shouldBeOnEdgeOfBoard?: boolean | undefined;
|
|
108683
108683
|
pcbMarginTop?: string | number | undefined;
|
|
108684
108684
|
pcbMarginRight?: string | number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -389,6 +389,24 @@ var mergeRoutes = (routes) => {
|
|
|
389
389
|
// lib/components/primitive-components/Net.ts
|
|
390
390
|
import { netProps } from "@tscircuit/props";
|
|
391
391
|
|
|
392
|
+
// lib/components/base-components/PrimitiveComponent/select-net-by-literal-selector.ts
|
|
393
|
+
var netsBySelectorByNets = /* @__PURE__ */ new WeakMap();
|
|
394
|
+
var selectNetByLiteralSelector = (nets, selector) => {
|
|
395
|
+
let netsBySelector = netsBySelectorByNets.get(nets);
|
|
396
|
+
if (!netsBySelector) {
|
|
397
|
+
netsBySelector = /* @__PURE__ */ new Map();
|
|
398
|
+
for (const net of nets) {
|
|
399
|
+
for (const alias of net.getNameAndAliases().join(" ").split(/\s+/)) {
|
|
400
|
+
const netSelector = `net.${alias}`;
|
|
401
|
+
if (!netsBySelector.has(netSelector))
|
|
402
|
+
netsBySelector.set(netSelector, net);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
netsBySelectorByNets.set(nets, netsBySelector);
|
|
406
|
+
}
|
|
407
|
+
return netsBySelector.get(selector) ?? null;
|
|
408
|
+
};
|
|
409
|
+
|
|
392
410
|
// lib/components/base-components/PrimitiveComponent/PrimitiveComponent.ts
|
|
393
411
|
import { selectAll, selectOne } from "css-select";
|
|
394
412
|
import "debug";
|
|
@@ -2354,6 +2372,14 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
2354
2372
|
}
|
|
2355
2373
|
_cachedSelectOneQueries = /* @__PURE__ */ new Map();
|
|
2356
2374
|
selectOne(selectorRaw, options) {
|
|
2375
|
+
if (/^net\.[A-Za-z_][A-Za-z0-9_]*$/.test(selectorRaw)) {
|
|
2376
|
+
if (options?.port || options?.type && options.type !== "net")
|
|
2377
|
+
return null;
|
|
2378
|
+
return selectNetByLiteralSelector(
|
|
2379
|
+
this.selectAll("net"),
|
|
2380
|
+
selectorRaw
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2357
2383
|
if (this._cachedSelectOneQueries.has(selectorRaw)) {
|
|
2358
2384
|
return this._cachedSelectOneQueries.get(selectorRaw);
|
|
2359
2385
|
}
|
|
@@ -2718,24 +2744,6 @@ var Net = class extends PrimitiveComponent2 {
|
|
|
2718
2744
|
};
|
|
2719
2745
|
|
|
2720
2746
|
// lib/utils/components/createNetsFromProps.ts
|
|
2721
|
-
var netSelectorsByNets = /* @__PURE__ */ new WeakMap();
|
|
2722
|
-
var hasNet = (subcircuit, selector) => {
|
|
2723
|
-
if (!/^net\.[A-Za-z_][A-Za-z0-9_]*$/.test(selector)) {
|
|
2724
|
-
return Boolean(subcircuit.selectOne(selector));
|
|
2725
|
-
}
|
|
2726
|
-
const nets = subcircuit.selectAll("net");
|
|
2727
|
-
let netSelectors = netSelectorsByNets.get(nets);
|
|
2728
|
-
if (!netSelectors) {
|
|
2729
|
-
netSelectors = /* @__PURE__ */ new Set();
|
|
2730
|
-
for (const net of nets) {
|
|
2731
|
-
for (const alias of net.getNameAndAliases().join(" ").split(/\s+/)) {
|
|
2732
|
-
netSelectors.add(`net.${alias}`);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
netSelectorsByNets.set(nets, netSelectors);
|
|
2736
|
-
}
|
|
2737
|
-
return netSelectors.has(selector);
|
|
2738
|
-
};
|
|
2739
2747
|
var createNetsFromProps = (component, props) => {
|
|
2740
2748
|
for (const prop of props) {
|
|
2741
2749
|
if (typeof prop === "string" && prop.startsWith("net.")) {
|
|
@@ -2756,7 +2764,7 @@ var createNetsFromProps = (component, props) => {
|
|
|
2756
2764
|
);
|
|
2757
2765
|
}
|
|
2758
2766
|
const subcircuit = component.getSubcircuit();
|
|
2759
|
-
if (!
|
|
2767
|
+
if (!subcircuit.selectOne(prop)) {
|
|
2760
2768
|
const net = new Net({
|
|
2761
2769
|
name: prop.split("net.")[1]
|
|
2762
2770
|
});
|
|
@@ -63766,7 +63774,7 @@ function Group_getRoutingPhasePlans(group) {
|
|
|
63766
63774
|
var package_default = {
|
|
63767
63775
|
name: "@tscircuit/core",
|
|
63768
63776
|
type: "module",
|
|
63769
|
-
version: "0.0.
|
|
63777
|
+
version: "0.0.1964",
|
|
63770
63778
|
types: "dist/index.d.ts",
|
|
63771
63779
|
main: "dist/index.js",
|
|
63772
63780
|
module: "dist/index.js",
|