@tscircuit/core 0.0.394 → 0.0.396

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
@@ -1,5 +1,5 @@
1
1
  import * as _tscircuit_props from '@tscircuit/props';
2
- import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
2
+ import { PlatformConfig, subcircuitGroupProps, AutorouterConfig, traceProps, SupplierPartNumbers, SchematicPortArrangement, groupProps, boardProps, capacitorProps, chipProps, diodeProps, jumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, holeProps, pcbKeepoutProps, netAliasProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, schematicTextProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
3
3
  import React, { ReactElement, DetailedHTMLProps, SVGProps } from 'react';
4
4
  export { createElement } from 'react';
5
5
  import * as zod from 'zod';
@@ -12,7 +12,7 @@ import * as _tscircuit_layout from '@tscircuit/layout';
12
12
  import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
13
13
  import { GraphicsObject } from 'graphics-debug';
14
14
 
15
- declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
15
+ declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "OptimizeSelectorCache", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPrimitiveRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceHintRender", "PcbTraceRender", "PcbRouteNetIslands", "PcbDesignRuleChecks", "CadModelRender", "PartsEngineRender"];
16
16
  type RenderPhase = (typeof orderedRenderPhases)[number];
17
17
  type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
18
18
  type RenderPhaseStates = Record<RenderPhase, {
@@ -11820,6 +11820,36 @@ declare class Switch extends NormalComponent<typeof switchProps> {
11820
11820
  doInitialSourceRender(): void;
11821
11821
  }
11822
11822
 
11823
+ declare class SchematicText extends PrimitiveComponent<typeof schematicTextProps> {
11824
+ isPcbPrimitive: boolean;
11825
+ get config(): {
11826
+ componentName: string;
11827
+ zodProps: zod.ZodObject<{
11828
+ schX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
11829
+ schY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
11830
+ text: zod.ZodString;
11831
+ anchor: zod.ZodUnion<[zod.ZodEnum<["center", "left", "right", "top", "bottom"]>, zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>]>;
11832
+ color: zod.ZodDefault<zod.ZodString>;
11833
+ schRotation: zod.ZodDefault<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
11834
+ }, "strip", zod.ZodTypeAny, {
11835
+ anchor: "left" | "right" | "top" | "bottom" | "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
11836
+ schX: number;
11837
+ schY: number;
11838
+ schRotation: number;
11839
+ color: string;
11840
+ text: string;
11841
+ }, {
11842
+ anchor: "left" | "right" | "top" | "bottom" | "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center";
11843
+ schX: string | number;
11844
+ schY: string | number;
11845
+ text: string;
11846
+ schRotation?: string | number | undefined;
11847
+ color?: string | undefined;
11848
+ }>;
11849
+ };
11850
+ doInitialSchematicPrimitiveRender(): void;
11851
+ }
11852
+
11823
11853
  declare const useRenderedCircuit: (reactElements: React.ReactElement) => {
11824
11854
  isLoading: boolean;
11825
11855
  error?: Error | null;
@@ -12183,4 +12213,4 @@ declare module "react/jsx-runtime" {
12183
12213
  }
12184
12214
  }
12185
12215
 
12186
- export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, type Obstacle, PcbTrace, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
12216
+ export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, type Obstacle, PcbTrace, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -38,6 +38,7 @@ __export(components_exports, {
38
38
  Renderable: () => Renderable,
39
39
  Resistor: () => Resistor,
40
40
  Resonator: () => Resonator,
41
+ SchematicText: () => SchematicText,
41
42
  SilkscreenCircle: () => SilkscreenCircle,
42
43
  SilkscreenLine: () => SilkscreenLine,
43
44
  SilkscreenPath: () => SilkscreenPath,
@@ -84,6 +85,7 @@ var orderedRenderPhases = [
84
85
  "SourceTraceRender",
85
86
  "SourceAddConnectivityMapKey",
86
87
  "SchematicComponentRender",
88
+ "SchematicPrimitiveRender",
87
89
  "SchematicPortRender",
88
90
  "SchematicLayout",
89
91
  "SchematicTraceRender",
@@ -8086,6 +8088,33 @@ var Switch = class extends NormalComponent {
8086
8088
  }
8087
8089
  };
8088
8090
 
8091
+ // lib/components/primitive-components/SchematicText.ts
8092
+ import { schematicTextProps } from "@tscircuit/props";
8093
+ var SchematicText = class extends PrimitiveComponent2 {
8094
+ isPcbPrimitive = true;
8095
+ get config() {
8096
+ return {
8097
+ componentName: "SchematicText",
8098
+ zodProps: schematicTextProps
8099
+ };
8100
+ }
8101
+ doInitialSchematicPrimitiveRender() {
8102
+ if (this.root?.schematicDisabled) return;
8103
+ const { db } = this.root;
8104
+ const { _parsedProps: props } = this;
8105
+ db.schematic_text.insert({
8106
+ anchor: props.anchor ?? "center",
8107
+ text: props.text,
8108
+ color: props.color || "#000000",
8109
+ position: {
8110
+ x: props.schX,
8111
+ y: props.schY
8112
+ },
8113
+ rotation: props.schRotation ?? 0
8114
+ });
8115
+ }
8116
+ };
8117
+
8089
8118
  // lib/RootCircuit.ts
8090
8119
  import { su as su5 } from "@tscircuit/circuit-json-util";
8091
8120
  import { isValidElement as isValidElement2 } from "react";
@@ -8095,7 +8124,7 @@ import { identity as identity4 } from "transformation-matrix";
8095
8124
  var package_default = {
8096
8125
  name: "@tscircuit/core",
8097
8126
  type: "module",
8098
- version: "0.0.393",
8127
+ version: "0.0.395",
8099
8128
  types: "dist/index.d.ts",
8100
8129
  main: "dist/index.js",
8101
8130
  module: "dist/index.js",
@@ -8118,7 +8147,7 @@ var package_default = {
8118
8147
  },
8119
8148
  devDependencies: {
8120
8149
  "@biomejs/biome": "^1.8.3",
8121
- "@tscircuit/footprinter": "^0.0.154",
8150
+ "@tscircuit/footprinter": "^0.0.155",
8122
8151
  "@tscircuit/import-snippet": "^0.0.4",
8123
8152
  "@tscircuit/layout": "^0.0.28",
8124
8153
  "@tscircuit/log-soup": "^1.0.2",
@@ -8153,9 +8182,9 @@ var package_default = {
8153
8182
  "@tscircuit/circuit-json-util": "^0.0.47",
8154
8183
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
8155
8184
  "@tscircuit/math-utils": "^0.0.14",
8156
- "@tscircuit/props": "^0.0.174",
8185
+ "@tscircuit/props": "^0.0.177",
8157
8186
  "@tscircuit/schematic-autolayout": "^0.0.6",
8158
- "circuit-json": "0.0.164",
8187
+ "circuit-json": "0.0.169",
8159
8188
  "circuit-json-to-connectivity-map": "^0.0.20",
8160
8189
  "css-select": "^5.1.0",
8161
8190
  "format-si-unit": "^0.0.3",
@@ -8561,6 +8590,7 @@ export {
8561
8590
  Resistor,
8562
8591
  Resonator,
8563
8592
  RootCircuit,
8593
+ SchematicText,
8564
8594
  SilkscreenCircle,
8565
8595
  SilkscreenLine,
8566
8596
  SilkscreenPath,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.394",
4
+ "version": "0.0.396",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@biomejs/biome": "^1.8.3",
27
- "@tscircuit/footprinter": "^0.0.154",
27
+ "@tscircuit/footprinter": "^0.0.155",
28
28
  "@tscircuit/import-snippet": "^0.0.4",
29
29
  "@tscircuit/layout": "^0.0.28",
30
30
  "@tscircuit/log-soup": "^1.0.2",
@@ -59,9 +59,9 @@
59
59
  "@tscircuit/circuit-json-util": "^0.0.47",
60
60
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
61
61
  "@tscircuit/math-utils": "^0.0.14",
62
- "@tscircuit/props": "^0.0.174",
62
+ "@tscircuit/props": "^0.0.177",
63
63
  "@tscircuit/schematic-autolayout": "^0.0.6",
64
- "circuit-json": "0.0.164",
64
+ "circuit-json": "0.0.169",
65
65
  "circuit-json-to-connectivity-map": "^0.0.20",
66
66
  "css-select": "^5.1.0",
67
67
  "format-si-unit": "^0.0.3",