@tscircuit/core 0.0.785 → 0.0.786
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 +119 -2
- package/dist/index.js +92 -15
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as circuit_json from 'circuit-json';
|
|
2
2
|
import { PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, LayerRef, AnyCircuitElement, Size, AnySourceComponent, PcbTraceRoutePoint, PcbTrace as PcbTrace$1, PcbVia, SchematicPort, SchematicComponent, RouteHintPoint, CircuitJson } from 'circuit-json';
|
|
3
3
|
import * as _tscircuit_props from '@tscircuit/props';
|
|
4
|
-
import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, CommonComponentProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, pcbNoteLineProps, pcbNoteRectProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, copperPourProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
4
|
+
import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, CommonComponentProps, resistorProps, constraintProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, copperPourProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, voltageProbeProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
|
|
5
5
|
import * as react from 'react';
|
|
6
6
|
import react__default, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
|
|
7
7
|
export { createElement } from 'react';
|
|
@@ -17328,6 +17328,122 @@ declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationN
|
|
|
17328
17328
|
doInitialPcbPrimitiveRender(): void;
|
|
17329
17329
|
}
|
|
17330
17330
|
|
|
17331
|
+
declare class FabricationNoteDimension extends PrimitiveComponent<typeof fabricationNoteDimensionProps> {
|
|
17332
|
+
fabrication_note_dimension_id: string | null;
|
|
17333
|
+
isPcbPrimitive: boolean;
|
|
17334
|
+
get config(): {
|
|
17335
|
+
componentName: string;
|
|
17336
|
+
zodProps: zod.ZodObject<Omit<{
|
|
17337
|
+
pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17338
|
+
pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17339
|
+
pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17340
|
+
pcbPositionAnchor: zod.ZodOptional<zod.ZodString>;
|
|
17341
|
+
layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
|
|
17342
|
+
name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
|
|
17343
|
+
}, "strip", zod.ZodTypeAny, {
|
|
17344
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
17345
|
+
}, {
|
|
17346
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
17347
|
+
}>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
17348
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
17349
|
+
}>>;
|
|
17350
|
+
pcbMarginTop: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17351
|
+
pcbMarginRight: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17352
|
+
pcbMarginBottom: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17353
|
+
pcbMarginLeft: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17354
|
+
pcbMarginX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17355
|
+
pcbMarginY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17356
|
+
pcbRelative: zod.ZodOptional<zod.ZodBoolean>;
|
|
17357
|
+
relative: zod.ZodOptional<zod.ZodBoolean>;
|
|
17358
|
+
}, "pcbRotation" | "pcbX" | "pcbY"> & {
|
|
17359
|
+
from: zod.ZodUnion<[zod.ZodString, zod.ZodObject<{
|
|
17360
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
17361
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
17362
|
+
}, "strip", zod.ZodTypeAny, {
|
|
17363
|
+
x: number;
|
|
17364
|
+
y: number;
|
|
17365
|
+
}, {
|
|
17366
|
+
x: string | number;
|
|
17367
|
+
y: string | number;
|
|
17368
|
+
}>]>;
|
|
17369
|
+
to: zod.ZodUnion<[zod.ZodString, zod.ZodObject<{
|
|
17370
|
+
x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
17371
|
+
y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
|
|
17372
|
+
}, "strip", zod.ZodTypeAny, {
|
|
17373
|
+
x: number;
|
|
17374
|
+
y: number;
|
|
17375
|
+
}, {
|
|
17376
|
+
x: string | number;
|
|
17377
|
+
y: string | number;
|
|
17378
|
+
}>]>;
|
|
17379
|
+
text: zod.ZodOptional<zod.ZodString>;
|
|
17380
|
+
offset: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17381
|
+
font: zod.ZodOptional<zod.ZodEnum<["tscircuit2024"]>>;
|
|
17382
|
+
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17383
|
+
color: zod.ZodOptional<zod.ZodString>;
|
|
17384
|
+
arrowSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
17385
|
+
}, "strip", zod.ZodTypeAny, {
|
|
17386
|
+
from: string | {
|
|
17387
|
+
x: number;
|
|
17388
|
+
y: number;
|
|
17389
|
+
};
|
|
17390
|
+
to: string | {
|
|
17391
|
+
x: number;
|
|
17392
|
+
y: number;
|
|
17393
|
+
};
|
|
17394
|
+
pcbPositionAnchor?: string | undefined;
|
|
17395
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
|
|
17396
|
+
pcbMarginTop?: number | undefined;
|
|
17397
|
+
pcbMarginRight?: number | undefined;
|
|
17398
|
+
pcbMarginBottom?: number | undefined;
|
|
17399
|
+
pcbMarginLeft?: number | undefined;
|
|
17400
|
+
pcbMarginX?: number | undefined;
|
|
17401
|
+
pcbMarginY?: number | undefined;
|
|
17402
|
+
pcbRelative?: boolean | undefined;
|
|
17403
|
+
relative?: boolean | undefined;
|
|
17404
|
+
color?: string | undefined;
|
|
17405
|
+
text?: string | undefined;
|
|
17406
|
+
font?: "tscircuit2024" | undefined;
|
|
17407
|
+
fontSize?: number | undefined;
|
|
17408
|
+
offset?: number | undefined;
|
|
17409
|
+
arrowSize?: number | undefined;
|
|
17410
|
+
}, {
|
|
17411
|
+
from: string | {
|
|
17412
|
+
x: string | number;
|
|
17413
|
+
y: string | number;
|
|
17414
|
+
};
|
|
17415
|
+
to: string | {
|
|
17416
|
+
x: string | number;
|
|
17417
|
+
y: string | number;
|
|
17418
|
+
};
|
|
17419
|
+
pcbPositionAnchor?: string | undefined;
|
|
17420
|
+
layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
|
|
17421
|
+
name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
17422
|
+
} | undefined;
|
|
17423
|
+
pcbMarginTop?: string | number | undefined;
|
|
17424
|
+
pcbMarginRight?: string | number | undefined;
|
|
17425
|
+
pcbMarginBottom?: string | number | undefined;
|
|
17426
|
+
pcbMarginLeft?: string | number | undefined;
|
|
17427
|
+
pcbMarginX?: string | number | undefined;
|
|
17428
|
+
pcbMarginY?: string | number | undefined;
|
|
17429
|
+
pcbRelative?: boolean | undefined;
|
|
17430
|
+
relative?: boolean | undefined;
|
|
17431
|
+
color?: string | undefined;
|
|
17432
|
+
text?: string | undefined;
|
|
17433
|
+
font?: "tscircuit2024" | undefined;
|
|
17434
|
+
fontSize?: string | number | undefined;
|
|
17435
|
+
offset?: string | number | undefined;
|
|
17436
|
+
arrowSize?: string | number | undefined;
|
|
17437
|
+
}>;
|
|
17438
|
+
};
|
|
17439
|
+
private _resolvePoint;
|
|
17440
|
+
doInitialPcbPrimitiveRender(): void;
|
|
17441
|
+
getPcbSize(): {
|
|
17442
|
+
width: number;
|
|
17443
|
+
height: number;
|
|
17444
|
+
};
|
|
17445
|
+
}
|
|
17446
|
+
|
|
17331
17447
|
declare class PcbNoteLine extends PrimitiveComponent<typeof pcbNoteLineProps> {
|
|
17332
17448
|
pcb_note_line_id: string | null;
|
|
17333
17449
|
isPcbPrimitive: boolean;
|
|
@@ -34958,6 +35074,7 @@ interface TscircuitElements {
|
|
|
34958
35074
|
pcbnotedimension: _tscircuit_props.PcbNoteDimensionProps;
|
|
34959
35075
|
fabricationnotetext: _tscircuit_props.FabricationNoteTextProps;
|
|
34960
35076
|
fabricationnotepath: _tscircuit_props.FabricationNotePathProps;
|
|
35077
|
+
fabricationnotedimension: _tscircuit_props.FabricationNoteDimensionProps;
|
|
34961
35078
|
constraint: _tscircuit_props.ConstraintProps;
|
|
34962
35079
|
constrainedlayout: _tscircuit_props.ConstrainedLayoutProps;
|
|
34963
35080
|
battery: _tscircuit_props.BatteryProps;
|
|
@@ -34988,4 +35105,4 @@ declare module "react/jsx-runtime" {
|
|
|
34988
35105
|
}
|
|
34989
35106
|
}
|
|
34990
35107
|
|
|
34991
|
-
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
35108
|
+
export { AnalogSimulation, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, CadAssembly, CadModel, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, CopperPour, Crystal, Cutout, type DebugLogOutputEvent, Diode, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, NormalComponent, type Obstacle, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbTrace, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicLine, SchematicRect, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __export(components_exports, {
|
|
|
21
21
|
Crystal: () => Crystal,
|
|
22
22
|
Cutout: () => Cutout,
|
|
23
23
|
Diode: () => Diode,
|
|
24
|
+
FabricationNoteDimension: () => FabricationNoteDimension,
|
|
24
25
|
FabricationNotePath: () => FabricationNotePath,
|
|
25
26
|
FabricationNoteRect: () => FabricationNoteRect,
|
|
26
27
|
FabricationNoteText: () => FabricationNoteText,
|
|
@@ -14372,9 +14373,84 @@ var FabricationNoteText = class extends PrimitiveComponent2 {
|
|
|
14372
14373
|
}
|
|
14373
14374
|
};
|
|
14374
14375
|
|
|
14376
|
+
// lib/components/primitive-components/FabricationNoteDimension.ts
|
|
14377
|
+
import { fabricationNoteDimensionProps } from "@tscircuit/props";
|
|
14378
|
+
import { applyToPoint as applyToPoint10 } from "transformation-matrix";
|
|
14379
|
+
var FabricationNoteDimension = class extends PrimitiveComponent2 {
|
|
14380
|
+
fabrication_note_dimension_id = null;
|
|
14381
|
+
isPcbPrimitive = true;
|
|
14382
|
+
get config() {
|
|
14383
|
+
return {
|
|
14384
|
+
componentName: "FabricationNoteDimension",
|
|
14385
|
+
zodProps: fabricationNoteDimensionProps
|
|
14386
|
+
};
|
|
14387
|
+
}
|
|
14388
|
+
_resolvePoint(input, transform) {
|
|
14389
|
+
if (typeof input === "string") {
|
|
14390
|
+
const target = this.getSubcircuit().selectOne(
|
|
14391
|
+
input
|
|
14392
|
+
);
|
|
14393
|
+
if (!target) {
|
|
14394
|
+
this.renderError(
|
|
14395
|
+
`FabricationNoteDimension could not find selector "${input}"`
|
|
14396
|
+
);
|
|
14397
|
+
return applyToPoint10(transform, { x: 0, y: 0 });
|
|
14398
|
+
}
|
|
14399
|
+
return target._getGlobalPcbPositionBeforeLayout();
|
|
14400
|
+
}
|
|
14401
|
+
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
14402
|
+
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
14403
|
+
return applyToPoint10(transform, { x: numericX, y: numericY });
|
|
14404
|
+
}
|
|
14405
|
+
doInitialPcbPrimitiveRender() {
|
|
14406
|
+
if (this.root?.pcbDisabled) return;
|
|
14407
|
+
const { db } = this.root;
|
|
14408
|
+
const { _parsedProps: props } = this;
|
|
14409
|
+
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
14410
|
+
const from = this._resolvePoint(props.from, transform);
|
|
14411
|
+
const to = this._resolvePoint(props.to, transform);
|
|
14412
|
+
const subcircuit = this.getSubcircuit();
|
|
14413
|
+
const group = this.getGroup();
|
|
14414
|
+
const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
|
|
14415
|
+
const layer = maybeFlipLayer(props.layer ?? "top");
|
|
14416
|
+
if (layer !== "top" && layer !== "bottom") {
|
|
14417
|
+
throw new Error(
|
|
14418
|
+
`Invalid layer "${layer}" for FabricationNoteDimension. Must be "top" or "bottom".`
|
|
14419
|
+
);
|
|
14420
|
+
}
|
|
14421
|
+
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id;
|
|
14422
|
+
const fabrication_note_dimension = db.pcb_fabrication_note_dimension.insert(
|
|
14423
|
+
{
|
|
14424
|
+
pcb_component_id,
|
|
14425
|
+
subcircuit_id: subcircuit?.subcircuit_id ?? void 0,
|
|
14426
|
+
pcb_group_id: group?.pcb_group_id ?? void 0,
|
|
14427
|
+
layer,
|
|
14428
|
+
from,
|
|
14429
|
+
to,
|
|
14430
|
+
text: props.text,
|
|
14431
|
+
offset: props.offset,
|
|
14432
|
+
font: props.font ?? "tscircuit2024",
|
|
14433
|
+
font_size: props.fontSize ?? 1,
|
|
14434
|
+
color: props.color,
|
|
14435
|
+
arrow_size: props.arrowSize ?? 1
|
|
14436
|
+
}
|
|
14437
|
+
);
|
|
14438
|
+
this.fabrication_note_dimension_id = fabrication_note_dimension.pcb_fabrication_note_dimension_id;
|
|
14439
|
+
}
|
|
14440
|
+
getPcbSize() {
|
|
14441
|
+
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
14442
|
+
const from = this._resolvePoint(this._parsedProps.from, transform);
|
|
14443
|
+
const to = this._resolvePoint(this._parsedProps.to, transform);
|
|
14444
|
+
return {
|
|
14445
|
+
width: Math.abs(to.x - from.x),
|
|
14446
|
+
height: Math.abs(to.y - from.y)
|
|
14447
|
+
};
|
|
14448
|
+
}
|
|
14449
|
+
};
|
|
14450
|
+
|
|
14375
14451
|
// lib/components/primitive-components/PcbNoteLine.ts
|
|
14376
14452
|
import { pcbNoteLineProps } from "@tscircuit/props";
|
|
14377
|
-
import { applyToPoint as
|
|
14453
|
+
import { applyToPoint as applyToPoint11 } from "transformation-matrix";
|
|
14378
14454
|
var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
14379
14455
|
pcb_note_line_id = null;
|
|
14380
14456
|
isPcbPrimitive = true;
|
|
@@ -14391,8 +14467,8 @@ var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
|
14391
14467
|
const subcircuit = this.getSubcircuit();
|
|
14392
14468
|
const group = this.getGroup();
|
|
14393
14469
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
14394
|
-
const start =
|
|
14395
|
-
const end =
|
|
14470
|
+
const start = applyToPoint11(transform, { x: props.x1, y: props.y1 });
|
|
14471
|
+
const end = applyToPoint11(transform, { x: props.x2, y: props.y2 });
|
|
14396
14472
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
|
|
14397
14473
|
const pcb_note_line = db.pcb_note_line.insert({
|
|
14398
14474
|
pcb_component_id,
|
|
@@ -14419,7 +14495,7 @@ var PcbNoteLine = class extends PrimitiveComponent2 {
|
|
|
14419
14495
|
|
|
14420
14496
|
// lib/components/primitive-components/PcbNoteRect.ts
|
|
14421
14497
|
import { pcbNoteRectProps } from "@tscircuit/props";
|
|
14422
|
-
import { applyToPoint as
|
|
14498
|
+
import { applyToPoint as applyToPoint12 } from "transformation-matrix";
|
|
14423
14499
|
var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
14424
14500
|
pcb_note_rect_id = null;
|
|
14425
14501
|
isPcbPrimitive = true;
|
|
@@ -14434,7 +14510,7 @@ var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
|
14434
14510
|
const { db } = this.root;
|
|
14435
14511
|
const { _parsedProps: props } = this;
|
|
14436
14512
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
14437
|
-
const center =
|
|
14513
|
+
const center = applyToPoint12(transform, { x: 0, y: 0 });
|
|
14438
14514
|
const subcircuit = this.getSubcircuit();
|
|
14439
14515
|
const group = this.getGroup();
|
|
14440
14516
|
const pcb_component_id = this.parent?.pcb_component_id ?? this.getPrimitiveContainer()?.pcb_component_id ?? void 0;
|
|
@@ -14463,7 +14539,7 @@ var PcbNoteRect = class extends PrimitiveComponent2 {
|
|
|
14463
14539
|
|
|
14464
14540
|
// lib/components/primitive-components/PcbNotePath.ts
|
|
14465
14541
|
import { pcbNotePathProps } from "@tscircuit/props";
|
|
14466
|
-
import { applyToPoint as
|
|
14542
|
+
import { applyToPoint as applyToPoint13 } from "transformation-matrix";
|
|
14467
14543
|
var PcbNotePath = class extends PrimitiveComponent2 {
|
|
14468
14544
|
pcb_note_path_id = null;
|
|
14469
14545
|
isPcbPrimitive = true;
|
|
@@ -14485,7 +14561,7 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
14485
14561
|
const { x, y, ...rest } = point;
|
|
14486
14562
|
const numericX = typeof x === "string" ? parseFloat(x) : x;
|
|
14487
14563
|
const numericY = typeof y === "string" ? parseFloat(y) : y;
|
|
14488
|
-
const transformed =
|
|
14564
|
+
const transformed = applyToPoint13(transform, { x: numericX, y: numericY });
|
|
14489
14565
|
return { ...rest, x: transformed.x, y: transformed.y };
|
|
14490
14566
|
});
|
|
14491
14567
|
const pcb_note_path = db.pcb_note_path.insert({
|
|
@@ -14517,7 +14593,7 @@ var PcbNotePath = class extends PrimitiveComponent2 {
|
|
|
14517
14593
|
|
|
14518
14594
|
// lib/components/primitive-components/PcbNoteDimension.ts
|
|
14519
14595
|
import { pcbNoteDimensionProps } from "@tscircuit/props";
|
|
14520
|
-
import { applyToPoint as
|
|
14596
|
+
import { applyToPoint as applyToPoint14 } from "transformation-matrix";
|
|
14521
14597
|
var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
14522
14598
|
pcb_note_dimension_id = null;
|
|
14523
14599
|
isPcbPrimitive = true;
|
|
@@ -14534,13 +14610,13 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
14534
14610
|
);
|
|
14535
14611
|
if (!target) {
|
|
14536
14612
|
this.renderError(`PcbNoteDimension could not find selector "${input}"`);
|
|
14537
|
-
return
|
|
14613
|
+
return applyToPoint14(transform, { x: 0, y: 0 });
|
|
14538
14614
|
}
|
|
14539
14615
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
14540
14616
|
}
|
|
14541
14617
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
14542
14618
|
const numericY = typeof input.y === "string" ? parseFloat(input.y) : input.y;
|
|
14543
|
-
return
|
|
14619
|
+
return applyToPoint14(transform, { x: numericX, y: numericY });
|
|
14544
14620
|
}
|
|
14545
14621
|
doInitialPcbPrimitiveRender() {
|
|
14546
14622
|
if (this.root?.pcbDisabled) return;
|
|
@@ -14701,7 +14777,7 @@ var BreakoutPoint = class extends PrimitiveComponent2 {
|
|
|
14701
14777
|
// lib/components/primitive-components/NetLabel.ts
|
|
14702
14778
|
import { netLabelProps } from "@tscircuit/props";
|
|
14703
14779
|
import {
|
|
14704
|
-
applyToPoint as
|
|
14780
|
+
applyToPoint as applyToPoint15,
|
|
14705
14781
|
identity as identity5,
|
|
14706
14782
|
translate as translate6
|
|
14707
14783
|
} from "transformation-matrix";
|
|
@@ -14752,7 +14828,7 @@ var NetLabel = class extends PrimitiveComponent2 {
|
|
|
14752
14828
|
const connectedPorts = this._getConnectedPorts();
|
|
14753
14829
|
if (connectedPorts.length > 0) {
|
|
14754
14830
|
const portPos = connectedPorts[0]._getGlobalSchematicPositionBeforeLayout();
|
|
14755
|
-
const parentCenter =
|
|
14831
|
+
const parentCenter = applyToPoint15(
|
|
14756
14832
|
this.parent?.computeSchematicGlobalTransform?.() ?? identity5(),
|
|
14757
14833
|
{ x: 0, y: 0 }
|
|
14758
14834
|
);
|
|
@@ -16610,7 +16686,7 @@ import { identity as identity6 } from "transformation-matrix";
|
|
|
16610
16686
|
var package_default = {
|
|
16611
16687
|
name: "@tscircuit/core",
|
|
16612
16688
|
type: "module",
|
|
16613
|
-
version: "0.0.
|
|
16689
|
+
version: "0.0.785",
|
|
16614
16690
|
types: "dist/index.d.ts",
|
|
16615
16691
|
main: "dist/index.js",
|
|
16616
16692
|
module: "dist/index.js",
|
|
@@ -16663,12 +16739,12 @@ var package_default = {
|
|
|
16663
16739
|
"bun-match-svg": "0.0.12",
|
|
16664
16740
|
"calculate-elbow": "^0.0.12",
|
|
16665
16741
|
"chokidar-cli": "^3.0.0",
|
|
16666
|
-
"circuit-json": "^0.0.
|
|
16742
|
+
"circuit-json": "^0.0.278",
|
|
16667
16743
|
"circuit-json-to-bpc": "^0.0.13",
|
|
16668
16744
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
16669
16745
|
"circuit-json-to-gltf": "^0.0.7",
|
|
16670
16746
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
16671
|
-
"circuit-to-svg": "^0.0.
|
|
16747
|
+
"circuit-to-svg": "^0.0.238",
|
|
16672
16748
|
"circuit-json-to-spice": "^0.0.14",
|
|
16673
16749
|
concurrently: "^9.1.2",
|
|
16674
16750
|
"connectivity-map": "^1.0.0",
|
|
@@ -17132,6 +17208,7 @@ export {
|
|
|
17132
17208
|
Crystal,
|
|
17133
17209
|
Cutout,
|
|
17134
17210
|
Diode,
|
|
17211
|
+
FabricationNoteDimension,
|
|
17135
17212
|
FabricationNotePath,
|
|
17136
17213
|
FabricationNoteRect,
|
|
17137
17214
|
FabricationNoteText,
|
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.786",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"bun-match-svg": "0.0.12",
|
|
55
55
|
"calculate-elbow": "^0.0.12",
|
|
56
56
|
"chokidar-cli": "^3.0.0",
|
|
57
|
-
"circuit-json": "^0.0.
|
|
57
|
+
"circuit-json": "^0.0.278",
|
|
58
58
|
"circuit-json-to-bpc": "^0.0.13",
|
|
59
59
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
60
60
|
"circuit-json-to-gltf": "^0.0.7",
|
|
61
61
|
"circuit-json-to-simple-3d": "^0.0.9",
|
|
62
|
-
"circuit-to-svg": "^0.0.
|
|
62
|
+
"circuit-to-svg": "^0.0.238",
|
|
63
63
|
"circuit-json-to-spice": "^0.0.14",
|
|
64
64
|
"concurrently": "^9.1.2",
|
|
65
65
|
"connectivity-map": "^1.0.0",
|