@tscircuit/core 0.0.38 → 0.0.39
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
CHANGED
|
@@ -6,7 +6,7 @@ import { ReactElement } from 'react';
|
|
|
6
6
|
import { Matrix } from 'transformation-matrix';
|
|
7
7
|
import { SchSymbol, BaseSymbolName } from 'schematic-symbols';
|
|
8
8
|
import * as Props from '@tscircuit/props';
|
|
9
|
-
import { traceProps, groupProps, boardProps, footprintProps, smtPadProps, resistorProps, ledProps, diodeProps, capacitorProps, traceHintProps, chipProps, jumperProps, silkscreenPathProps, platedHoleProps, constraintProps, holeProps } from '@tscircuit/props';
|
|
9
|
+
import { traceProps, groupProps, boardProps, footprintProps, smtPadProps, resistorProps, ledProps, diodeProps, capacitorProps, traceHintProps, chipProps, jumperProps, silkscreenPathProps, platedHoleProps, constraintProps, holeProps, silkscreenTextProps } from '@tscircuit/props';
|
|
10
10
|
|
|
11
11
|
declare class Circuit {
|
|
12
12
|
firstChild: PrimitiveComponent | null;
|
|
@@ -4005,6 +4005,10 @@ declare class Hole extends PrimitiveComponent<typeof holeProps> {
|
|
|
4005
4005
|
}): void;
|
|
4006
4006
|
}
|
|
4007
4007
|
|
|
4008
|
+
declare class SilkscreenText extends PrimitiveComponent<typeof silkscreenTextProps> {
|
|
4009
|
+
doInitialPcbPrimitiveRender(): void;
|
|
4010
|
+
}
|
|
4011
|
+
|
|
4008
4012
|
declare global {
|
|
4009
4013
|
namespace JSX {
|
|
4010
4014
|
interface IntrinsicElements {
|
|
@@ -4050,4 +4054,4 @@ declare global {
|
|
|
4050
4054
|
}
|
|
4051
4055
|
}
|
|
4052
4056
|
|
|
4053
|
-
export { Board, Capacitor, Chip, Circuit, Constraint, Diode, Footprint, Group, Hole, type IRenderable, Jumper, Led, Net, NormalComponent, PlatedHole, Port, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenPath, SmtPad, Trace, TraceHint };
|
|
4057
|
+
export { Board, Capacitor, Chip, Circuit, Constraint, Diode, Footprint, Group, Hole, type IRenderable, Jumper, Led, Net, NormalComponent, PlatedHole, Port, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenPath, SilkscreenText, SmtPad, Trace, TraceHint };
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(components_exports, {
|
|
|
25
25
|
Renderable: () => Renderable,
|
|
26
26
|
Resistor: () => Resistor,
|
|
27
27
|
SilkscreenPath: () => SilkscreenPath,
|
|
28
|
+
SilkscreenText: () => SilkscreenText,
|
|
28
29
|
SmtPad: () => SmtPad,
|
|
29
30
|
Trace: () => Trace,
|
|
30
31
|
TraceHint: () => TraceHint
|
|
@@ -3111,6 +3112,28 @@ var Hole = class extends PrimitiveComponent {
|
|
|
3111
3112
|
}
|
|
3112
3113
|
};
|
|
3113
3114
|
|
|
3115
|
+
// lib/components/primitive-components/SilkscreenText.ts
|
|
3116
|
+
import "@tscircuit/props";
|
|
3117
|
+
var SilkscreenText = class extends PrimitiveComponent {
|
|
3118
|
+
doInitialPcbPrimitiveRender() {
|
|
3119
|
+
const { db } = this.root;
|
|
3120
|
+
const { _parsedProps: props } = this;
|
|
3121
|
+
const container = this.getPrimitiveContainer();
|
|
3122
|
+
db.pcb_silkscreen_text.insert({
|
|
3123
|
+
anchor_alignment: props.anchorAlignment,
|
|
3124
|
+
anchor_position: {
|
|
3125
|
+
x: props.pcbX ?? 0,
|
|
3126
|
+
y: props.pcbY ?? 0
|
|
3127
|
+
},
|
|
3128
|
+
font: props.font ?? "tscircuit2024",
|
|
3129
|
+
font_size: props.fontSize ?? 1,
|
|
3130
|
+
layer: "top",
|
|
3131
|
+
text: props.text ?? "",
|
|
3132
|
+
pcb_component_id: container.pcb_component_id
|
|
3133
|
+
});
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3136
|
+
|
|
3114
3137
|
// lib/Project.ts
|
|
3115
3138
|
import { su } from "@tscircuit/soup-util";
|
|
3116
3139
|
import { isValidElement as isValidElement2 } from "react";
|
|
@@ -3230,6 +3253,7 @@ export {
|
|
|
3230
3253
|
Renderable,
|
|
3231
3254
|
Resistor,
|
|
3232
3255
|
SilkscreenPath,
|
|
3256
|
+
SilkscreenText,
|
|
3233
3257
|
SmtPad,
|
|
3234
3258
|
Trace,
|
|
3235
3259
|
TraceHint
|
package/lib/components/index.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { SilkscreenPath } from "./primitive-components/SilkscreenPath"
|
|
|
19
19
|
export { PlatedHole } from "./primitive-components/PlatedHole"
|
|
20
20
|
export { Constraint } from "./primitive-components/Constraint"
|
|
21
21
|
export { Hole } from "./primitive-components/Hole"
|
|
22
|
+
export { SilkscreenText } from "./primitive-components/SilkscreenText"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PrimitiveComponent } from "../base-components/PrimitiveComponent"
|
|
2
|
+
import { silkscreenTextProps } from "@tscircuit/props"
|
|
3
|
+
|
|
4
|
+
export class SilkscreenText extends PrimitiveComponent<
|
|
5
|
+
typeof silkscreenTextProps
|
|
6
|
+
> {
|
|
7
|
+
doInitialPcbPrimitiveRender(): void {
|
|
8
|
+
const { db } = this.root!
|
|
9
|
+
const { _parsedProps: props } = this
|
|
10
|
+
const container = this.getPrimitiveContainer()!
|
|
11
|
+
|
|
12
|
+
db.pcb_silkscreen_text.insert({
|
|
13
|
+
anchor_alignment: props.anchorAlignment,
|
|
14
|
+
anchor_position: {
|
|
15
|
+
x: props.pcbX ?? 0,
|
|
16
|
+
y: props.pcbY ?? 0,
|
|
17
|
+
},
|
|
18
|
+
font: props.font ?? "tscircuit2024",
|
|
19
|
+
font_size: props.fontSize ?? 1,
|
|
20
|
+
layer: "top",
|
|
21
|
+
text: props.text ?? "",
|
|
22
|
+
pcb_component_id: container.pcb_component_id!,
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -6,7 +6,7 @@ import { extendCatalogue } from "./fiber/catalogue"
|
|
|
6
6
|
// it'll automatically be registered!
|
|
7
7
|
extendCatalogue(Components)
|
|
8
8
|
|
|
9
|
-
// Aliases
|
|
9
|
+
// Aliases (only when class name is different than the name of the component)
|
|
10
10
|
extendCatalogue({
|
|
11
11
|
Bug: Components.Chip,
|
|
12
12
|
})
|