@tscircuit/core 0.0.560 → 0.0.562
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 +93 -2
- package/dist/index.js +179 -5
- package/package.json +3 -3
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, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, testpointProps, schematicTextProps, schematicBoxProps, 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, fuseProps, jumperProps, solderjumperProps, ledProps, powerSourceProps, resistorProps, constraintProps, fabricationNotePathProps, fabricationNoteTextProps, footprintProps, subcircuitProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, platedHoleProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, smtPadProps, traceHintProps, viaProps, cutoutProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, transistorProps, mosfetProps, switchProps, testpointProps, schematicTextProps, schematicBoxProps, schematicTableProps, schematicRowProps, schematicCellProps, 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';
|
|
@@ -331,6 +331,7 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
|
|
|
331
331
|
*
|
|
332
332
|
*/
|
|
333
333
|
isPrimitiveContainer: boolean;
|
|
334
|
+
canHaveTextChildren: boolean;
|
|
334
335
|
source_group_id: string | null;
|
|
335
336
|
source_component_id: string | null;
|
|
336
337
|
schematic_component_id: string | null;
|
|
@@ -14686,6 +14687,93 @@ declare class SchematicBox extends PrimitiveComponent<typeof schematicBoxProps>
|
|
|
14686
14687
|
doInitialSchematicPrimitiveRender(): void;
|
|
14687
14688
|
}
|
|
14688
14689
|
|
|
14690
|
+
declare class SchematicTable extends PrimitiveComponent<typeof schematicTableProps> {
|
|
14691
|
+
isSchematicPrimitive: boolean;
|
|
14692
|
+
schematic_table_id: string | null;
|
|
14693
|
+
get config(): {
|
|
14694
|
+
componentName: string;
|
|
14695
|
+
zodProps: zod.ZodObject<{
|
|
14696
|
+
schX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14697
|
+
schY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14698
|
+
children: zod.ZodOptional<zod.ZodAny>;
|
|
14699
|
+
cellPadding: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14700
|
+
borderWidth: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14701
|
+
anchor: zod.ZodOptional<zod.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
|
|
14702
|
+
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14703
|
+
}, "strip", zod.ZodTypeAny, {
|
|
14704
|
+
anchor?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
|
|
14705
|
+
schX?: number | undefined;
|
|
14706
|
+
schY?: number | undefined;
|
|
14707
|
+
children?: any;
|
|
14708
|
+
fontSize?: number | undefined;
|
|
14709
|
+
cellPadding?: number | undefined;
|
|
14710
|
+
borderWidth?: number | undefined;
|
|
14711
|
+
}, {
|
|
14712
|
+
anchor?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | "top_center" | "center_left" | "center_right" | "bottom_center" | undefined;
|
|
14713
|
+
schX?: string | number | undefined;
|
|
14714
|
+
schY?: string | number | undefined;
|
|
14715
|
+
children?: any;
|
|
14716
|
+
fontSize?: string | number | undefined;
|
|
14717
|
+
cellPadding?: string | number | undefined;
|
|
14718
|
+
borderWidth?: string | number | undefined;
|
|
14719
|
+
}>;
|
|
14720
|
+
};
|
|
14721
|
+
doInitialSchematicPrimitiveRender(): void;
|
|
14722
|
+
}
|
|
14723
|
+
|
|
14724
|
+
declare class SchematicRow extends PrimitiveComponent<typeof schematicRowProps> {
|
|
14725
|
+
isSchematicPrimitive: boolean;
|
|
14726
|
+
get config(): {
|
|
14727
|
+
componentName: string;
|
|
14728
|
+
zodProps: zod.ZodObject<{
|
|
14729
|
+
children: zod.ZodOptional<zod.ZodAny>;
|
|
14730
|
+
height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14731
|
+
}, "strip", zod.ZodTypeAny, {
|
|
14732
|
+
children?: any;
|
|
14733
|
+
height?: number | undefined;
|
|
14734
|
+
}, {
|
|
14735
|
+
children?: any;
|
|
14736
|
+
height?: string | number | undefined;
|
|
14737
|
+
}>;
|
|
14738
|
+
};
|
|
14739
|
+
}
|
|
14740
|
+
|
|
14741
|
+
declare class SchematicCell extends PrimitiveComponent<typeof schematicCellProps> {
|
|
14742
|
+
isSchematicPrimitive: boolean;
|
|
14743
|
+
canHaveTextChildren: boolean;
|
|
14744
|
+
get config(): {
|
|
14745
|
+
componentName: string;
|
|
14746
|
+
zodProps: zod.ZodObject<{
|
|
14747
|
+
children: zod.ZodOptional<zod.ZodString>;
|
|
14748
|
+
horizontalAlign: zod.ZodOptional<zod.ZodEnum<["left", "center", "right"]>>;
|
|
14749
|
+
verticalAlign: zod.ZodOptional<zod.ZodEnum<["top", "middle", "bottom"]>>;
|
|
14750
|
+
fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14751
|
+
rowSpan: zod.ZodOptional<zod.ZodNumber>;
|
|
14752
|
+
colSpan: zod.ZodOptional<zod.ZodNumber>;
|
|
14753
|
+
width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
|
|
14754
|
+
text: zod.ZodOptional<zod.ZodString>;
|
|
14755
|
+
}, "strip", zod.ZodTypeAny, {
|
|
14756
|
+
children?: string | undefined;
|
|
14757
|
+
width?: number | undefined;
|
|
14758
|
+
text?: string | undefined;
|
|
14759
|
+
fontSize?: number | undefined;
|
|
14760
|
+
horizontalAlign?: "left" | "right" | "center" | undefined;
|
|
14761
|
+
verticalAlign?: "top" | "bottom" | "middle" | undefined;
|
|
14762
|
+
rowSpan?: number | undefined;
|
|
14763
|
+
colSpan?: number | undefined;
|
|
14764
|
+
}, {
|
|
14765
|
+
children?: string | undefined;
|
|
14766
|
+
width?: string | number | undefined;
|
|
14767
|
+
text?: string | undefined;
|
|
14768
|
+
fontSize?: string | number | undefined;
|
|
14769
|
+
horizontalAlign?: "left" | "right" | "center" | undefined;
|
|
14770
|
+
verticalAlign?: "top" | "bottom" | "middle" | undefined;
|
|
14771
|
+
rowSpan?: number | undefined;
|
|
14772
|
+
colSpan?: number | undefined;
|
|
14773
|
+
}>;
|
|
14774
|
+
};
|
|
14775
|
+
}
|
|
14776
|
+
|
|
14689
14777
|
declare const useRenderedCircuit: (reactElements: React.ReactElement) => {
|
|
14690
14778
|
isLoading: boolean;
|
|
14691
14779
|
error?: Error | null;
|
|
@@ -15055,6 +15143,9 @@ interface TscircuitElements {
|
|
|
15055
15143
|
schematicline: _tscircuit_props.SchematicLineProps;
|
|
15056
15144
|
schematicpath: _tscircuit_props.SchematicPathProps;
|
|
15057
15145
|
schematictext: _tscircuit_props.SchematicTextProps;
|
|
15146
|
+
schematictable: _tscircuit_props.SchematicTableProps;
|
|
15147
|
+
schematicrow: _tscircuit_props.SchematicRowProps;
|
|
15148
|
+
schematiccell: _tscircuit_props.SchematicCellProps;
|
|
15058
15149
|
smtpad: _tscircuit_props.SmtPadProps;
|
|
15059
15150
|
platedhole: _tscircuit_props.PlatedHoleProps;
|
|
15060
15151
|
keepout: _tscircuit_props.PcbKeepoutProps;
|
|
@@ -15106,4 +15197,4 @@ declare module "react/jsx-runtime" {
|
|
|
15106
15197
|
}
|
|
15107
15198
|
}
|
|
15108
15199
|
|
|
15109
|
-
export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, 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, SchematicBox, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, TestPoint, Trace, TraceHint, Transistor, Via, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
15200
|
+
export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Cutout, Diode, FabricationNotePath, FabricationNoteText, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, Net, NetLabel, 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, SchematicBox, SchematicCell, SchematicRow, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, SolderJumper, Subcircuit, Switch, TestPoint, Trace, TraceHint, Transistor, Via, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -43,6 +43,9 @@ __export(components_exports, {
|
|
|
43
43
|
Resistor: () => Resistor,
|
|
44
44
|
Resonator: () => Resonator,
|
|
45
45
|
SchematicBox: () => SchematicBox,
|
|
46
|
+
SchematicCell: () => SchematicCell,
|
|
47
|
+
SchematicRow: () => SchematicRow,
|
|
48
|
+
SchematicTable: () => SchematicTable,
|
|
46
49
|
SchematicText: () => SchematicText,
|
|
47
50
|
SilkscreenCircle: () => SilkscreenCircle,
|
|
48
51
|
SilkscreenLine: () => SilkscreenLine,
|
|
@@ -573,6 +576,7 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
573
576
|
*
|
|
574
577
|
*/
|
|
575
578
|
isPrimitiveContainer = false;
|
|
579
|
+
canHaveTextChildren = false;
|
|
576
580
|
source_group_id = null;
|
|
577
581
|
source_component_id = null;
|
|
578
582
|
schematic_component_id = null;
|
|
@@ -882,12 +886,19 @@ var PrimitiveComponent2 = class extends Renderable {
|
|
|
882
886
|
this.parent?.onChildChanged?.(child);
|
|
883
887
|
}
|
|
884
888
|
add(component) {
|
|
889
|
+
if (Object.keys(component).length === 0) {
|
|
890
|
+
if (this.canHaveTextChildren) {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
885
894
|
if (this.lowercaseComponentName === "board" && component.lowercaseComponentName === "board") {
|
|
886
895
|
throw new Error("Nested boards are not supported");
|
|
887
896
|
}
|
|
888
897
|
if (!component.onAddToParent) {
|
|
889
898
|
throw new Error(
|
|
890
|
-
`Invalid JSX Element: Expected a React component but received "${JSON.stringify(
|
|
899
|
+
`Invalid JSX Element: Expected a React component but received "${JSON.stringify(
|
|
900
|
+
component
|
|
901
|
+
)}"`
|
|
891
902
|
);
|
|
892
903
|
}
|
|
893
904
|
component.onAddToParent(this);
|
|
@@ -3034,7 +3045,8 @@ var Port = class extends PrimitiveComponent2 {
|
|
|
3034
3045
|
side_of_component: localPortInfo?.side,
|
|
3035
3046
|
pin_number: props.pinNumber,
|
|
3036
3047
|
true_ccw_index: localPortInfo?.trueIndex,
|
|
3037
|
-
display_pin_label: bestDisplayPinLabel
|
|
3048
|
+
display_pin_label: bestDisplayPinLabel,
|
|
3049
|
+
is_connected: false
|
|
3038
3050
|
});
|
|
3039
3051
|
this.schematic_port_id = schematic_port.schematic_port_id;
|
|
3040
3052
|
}
|
|
@@ -5044,6 +5056,11 @@ var Trace_doInitialSchematicTraceRender = (trace) => {
|
|
|
5044
5056
|
junctions
|
|
5045
5057
|
});
|
|
5046
5058
|
trace.schematic_trace_id = dbTrace.schematic_trace_id;
|
|
5059
|
+
for (const { port } of connectedPorts) {
|
|
5060
|
+
if (port.schematic_port_id) {
|
|
5061
|
+
db.schematic_port.update(port.schematic_port_id, { is_connected: true });
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5047
5064
|
if (board?._connectedSchematicPortPairs)
|
|
5048
5065
|
board._connectedSchematicPortPairs.add(portPairKey);
|
|
5049
5066
|
};
|
|
@@ -10781,6 +10798,160 @@ var SchematicBox = class extends PrimitiveComponent2 {
|
|
|
10781
10798
|
}
|
|
10782
10799
|
};
|
|
10783
10800
|
|
|
10801
|
+
// lib/components/primitive-components/SchematicTable.ts
|
|
10802
|
+
import { schematicTableProps } from "@tscircuit/props";
|
|
10803
|
+
var SchematicTable = class extends PrimitiveComponent2 {
|
|
10804
|
+
isSchematicPrimitive = true;
|
|
10805
|
+
schematic_table_id = null;
|
|
10806
|
+
get config() {
|
|
10807
|
+
return {
|
|
10808
|
+
componentName: "SchematicTable",
|
|
10809
|
+
zodProps: schematicTableProps
|
|
10810
|
+
};
|
|
10811
|
+
}
|
|
10812
|
+
doInitialSchematicPrimitiveRender() {
|
|
10813
|
+
if (this.root?.schematicDisabled) return;
|
|
10814
|
+
const { db } = this.root;
|
|
10815
|
+
const { _parsedProps: props } = this;
|
|
10816
|
+
const rows = this.children.filter(
|
|
10817
|
+
(c) => c.componentName === "SchematicRow"
|
|
10818
|
+
);
|
|
10819
|
+
if (rows.length === 0) return;
|
|
10820
|
+
const grid = [];
|
|
10821
|
+
let maxCols = 0;
|
|
10822
|
+
for (const row of rows) {
|
|
10823
|
+
const cells = row.children.filter(
|
|
10824
|
+
(c) => c.componentName === "SchematicCell"
|
|
10825
|
+
);
|
|
10826
|
+
maxCols = Math.max(maxCols, cells.length);
|
|
10827
|
+
}
|
|
10828
|
+
for (let i = 0; i < rows.length; i++) {
|
|
10829
|
+
grid[i] = [];
|
|
10830
|
+
}
|
|
10831
|
+
for (let i = 0; i < rows.length; i++) {
|
|
10832
|
+
const row = rows[i];
|
|
10833
|
+
const cells = row.children.filter(
|
|
10834
|
+
(c) => c.componentName === "SchematicCell"
|
|
10835
|
+
);
|
|
10836
|
+
let k = 0;
|
|
10837
|
+
for (let j = 0; j < cells.length; j++) {
|
|
10838
|
+
while (grid[i][k]) {
|
|
10839
|
+
k++;
|
|
10840
|
+
}
|
|
10841
|
+
const cell = cells[j];
|
|
10842
|
+
const colSpan = cell._parsedProps.colSpan ?? 1;
|
|
10843
|
+
const rowSpan = cell._parsedProps.rowSpan ?? 1;
|
|
10844
|
+
for (let r = 0; r < rowSpan; r++) {
|
|
10845
|
+
for (let c = 0; c < colSpan; c++) {
|
|
10846
|
+
if (!grid[i + r]) grid[i + r] = [];
|
|
10847
|
+
grid[i + r][k + c] = cell;
|
|
10848
|
+
}
|
|
10849
|
+
}
|
|
10850
|
+
k += colSpan;
|
|
10851
|
+
}
|
|
10852
|
+
}
|
|
10853
|
+
maxCols = Math.max(0, ...grid.map((r) => r.length));
|
|
10854
|
+
const rowHeights = rows.map(
|
|
10855
|
+
(row, i) => row._parsedProps.height ?? 1
|
|
10856
|
+
);
|
|
10857
|
+
const colWidths = Array.from({ length: maxCols }, (_, j) => {
|
|
10858
|
+
let maxWidth = 0;
|
|
10859
|
+
for (let i = 0; i < rows.length; i++) {
|
|
10860
|
+
const cell = grid[i]?.[j];
|
|
10861
|
+
if (cell) {
|
|
10862
|
+
const text = cell._parsedProps.text ?? cell._parsedProps.children;
|
|
10863
|
+
const cellWidth = cell._parsedProps.width ?? (text?.length ?? 2) * 0.5;
|
|
10864
|
+
if (cellWidth > maxWidth) {
|
|
10865
|
+
maxWidth = cellWidth;
|
|
10866
|
+
}
|
|
10867
|
+
}
|
|
10868
|
+
}
|
|
10869
|
+
return maxWidth || 10;
|
|
10870
|
+
});
|
|
10871
|
+
const anchorPos = this._getGlobalSchematicPositionBeforeLayout();
|
|
10872
|
+
const table = db.schematic_table.insert({
|
|
10873
|
+
anchor_position: anchorPos,
|
|
10874
|
+
column_widths: colWidths,
|
|
10875
|
+
row_heights: rowHeights,
|
|
10876
|
+
cell_padding: props.cellPadding,
|
|
10877
|
+
border_width: props.borderWidth,
|
|
10878
|
+
anchor: props.anchor,
|
|
10879
|
+
subcircuit_id: this.getSubcircuit()?.subcircuit_id || "",
|
|
10880
|
+
schematic_component_id: this.parent?.schematic_component_id || ""
|
|
10881
|
+
});
|
|
10882
|
+
this.schematic_table_id = table.schematic_table_id;
|
|
10883
|
+
const processedCells = /* @__PURE__ */ new Set();
|
|
10884
|
+
let yOffset = 0;
|
|
10885
|
+
for (let i = 0; i < rows.length; i++) {
|
|
10886
|
+
let xOffset = 0;
|
|
10887
|
+
for (let j = 0; j < maxCols; j++) {
|
|
10888
|
+
const cell = grid[i]?.[j];
|
|
10889
|
+
if (cell && !processedCells.has(cell)) {
|
|
10890
|
+
processedCells.add(cell);
|
|
10891
|
+
const cellProps = cell._parsedProps;
|
|
10892
|
+
const rowSpan = cellProps.rowSpan ?? 1;
|
|
10893
|
+
const colSpan = cellProps.colSpan ?? 1;
|
|
10894
|
+
let cellWidth = 0;
|
|
10895
|
+
for (let c = 0; c < colSpan; c++) {
|
|
10896
|
+
cellWidth += colWidths[j + c];
|
|
10897
|
+
}
|
|
10898
|
+
let cellHeight = 0;
|
|
10899
|
+
for (let r = 0; r < rowSpan; r++) {
|
|
10900
|
+
cellHeight += rowHeights[i + r];
|
|
10901
|
+
}
|
|
10902
|
+
db.schematic_table_cell.insert({
|
|
10903
|
+
schematic_table_id: this.schematic_table_id,
|
|
10904
|
+
start_row_index: i,
|
|
10905
|
+
end_row_index: i + rowSpan - 1,
|
|
10906
|
+
start_column_index: j,
|
|
10907
|
+
end_column_index: j + colSpan - 1,
|
|
10908
|
+
text: cellProps.text ?? cellProps.children,
|
|
10909
|
+
center: {
|
|
10910
|
+
x: anchorPos.x + xOffset + cellWidth / 2,
|
|
10911
|
+
y: anchorPos.y - yOffset - cellHeight / 2
|
|
10912
|
+
},
|
|
10913
|
+
width: cellWidth,
|
|
10914
|
+
height: cellHeight,
|
|
10915
|
+
horizontal_align: cellProps.horizontalAlign,
|
|
10916
|
+
vertical_align: cellProps.verticalAlign,
|
|
10917
|
+
font_size: cellProps.fontSize ?? props.fontSize,
|
|
10918
|
+
subcircuit_id: this.getSubcircuit()?.subcircuit_id || ""
|
|
10919
|
+
});
|
|
10920
|
+
}
|
|
10921
|
+
if (colWidths[j]) {
|
|
10922
|
+
xOffset += colWidths[j];
|
|
10923
|
+
}
|
|
10924
|
+
}
|
|
10925
|
+
yOffset += rowHeights[i];
|
|
10926
|
+
}
|
|
10927
|
+
}
|
|
10928
|
+
};
|
|
10929
|
+
|
|
10930
|
+
// lib/components/primitive-components/SchematicRow.ts
|
|
10931
|
+
import { schematicRowProps } from "@tscircuit/props";
|
|
10932
|
+
var SchematicRow = class extends PrimitiveComponent2 {
|
|
10933
|
+
isSchematicPrimitive = true;
|
|
10934
|
+
get config() {
|
|
10935
|
+
return {
|
|
10936
|
+
componentName: "SchematicRow",
|
|
10937
|
+
zodProps: schematicRowProps
|
|
10938
|
+
};
|
|
10939
|
+
}
|
|
10940
|
+
};
|
|
10941
|
+
|
|
10942
|
+
// lib/components/primitive-components/SchematicCell.ts
|
|
10943
|
+
import { schematicCellProps } from "@tscircuit/props";
|
|
10944
|
+
var SchematicCell = class extends PrimitiveComponent2 {
|
|
10945
|
+
isSchematicPrimitive = true;
|
|
10946
|
+
canHaveTextChildren = true;
|
|
10947
|
+
get config() {
|
|
10948
|
+
return {
|
|
10949
|
+
componentName: "SchematicCell",
|
|
10950
|
+
zodProps: schematicCellProps
|
|
10951
|
+
};
|
|
10952
|
+
}
|
|
10953
|
+
};
|
|
10954
|
+
|
|
10784
10955
|
// lib/RootCircuit.ts
|
|
10785
10956
|
import { su as su5 } from "@tscircuit/circuit-json-util";
|
|
10786
10957
|
import { isValidElement as isValidElement2 } from "react";
|
|
@@ -10790,7 +10961,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
10790
10961
|
var package_default = {
|
|
10791
10962
|
name: "@tscircuit/core",
|
|
10792
10963
|
type: "module",
|
|
10793
|
-
version: "0.0.
|
|
10964
|
+
version: "0.0.561",
|
|
10794
10965
|
types: "dist/index.d.ts",
|
|
10795
10966
|
main: "dist/index.js",
|
|
10796
10967
|
module: "dist/index.js",
|
|
@@ -10821,7 +10992,7 @@ var package_default = {
|
|
|
10821
10992
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
10822
10993
|
"@tscircuit/log-soup": "^1.0.2",
|
|
10823
10994
|
"@tscircuit/math-utils": "^0.0.18",
|
|
10824
|
-
"@tscircuit/props": "^0.0.
|
|
10995
|
+
"@tscircuit/props": "^0.0.257",
|
|
10825
10996
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
10826
10997
|
"@tscircuit/schematic-corpus": "^0.0.52",
|
|
10827
10998
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
@@ -10839,7 +11010,7 @@ var package_default = {
|
|
|
10839
11010
|
"circuit-json-to-bpc": "^0.0.13",
|
|
10840
11011
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
10841
11012
|
"circuit-json-to-simple-3d": "^0.0.2",
|
|
10842
|
-
"circuit-to-svg": "^0.0.
|
|
11013
|
+
"circuit-to-svg": "^0.0.166",
|
|
10843
11014
|
concurrently: "^9.1.2",
|
|
10844
11015
|
debug: "^4.3.6",
|
|
10845
11016
|
"graphics-debug": "^0.0.60",
|
|
@@ -11311,6 +11482,9 @@ export {
|
|
|
11311
11482
|
Resonator,
|
|
11312
11483
|
RootCircuit,
|
|
11313
11484
|
SchematicBox,
|
|
11485
|
+
SchematicCell,
|
|
11486
|
+
SchematicRow,
|
|
11487
|
+
SchematicTable,
|
|
11314
11488
|
SchematicText,
|
|
11315
11489
|
SilkscreenCircle,
|
|
11316
11490
|
SilkscreenLine,
|
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.562",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@tscircuit/infgrid-ijump-astar": "^0.0.33",
|
|
33
33
|
"@tscircuit/log-soup": "^1.0.2",
|
|
34
34
|
"@tscircuit/math-utils": "^0.0.18",
|
|
35
|
-
"@tscircuit/props": "^0.0.
|
|
35
|
+
"@tscircuit/props": "^0.0.257",
|
|
36
36
|
"@tscircuit/schematic-autolayout": "^0.0.6",
|
|
37
37
|
"@tscircuit/schematic-corpus": "^0.0.52",
|
|
38
38
|
"@tscircuit/schematic-match-adapt": "^0.0.16",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"circuit-json-to-bpc": "^0.0.13",
|
|
51
51
|
"circuit-json-to-connectivity-map": "^0.0.22",
|
|
52
52
|
"circuit-json-to-simple-3d": "^0.0.2",
|
|
53
|
-
"circuit-to-svg": "^0.0.
|
|
53
|
+
"circuit-to-svg": "^0.0.166",
|
|
54
54
|
"concurrently": "^9.1.2",
|
|
55
55
|
"debug": "^4.3.6",
|
|
56
56
|
"graphics-debug": "^0.0.60",
|