@tscircuit/runframe 0.0.95 → 0.0.96

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.
@@ -22213,7 +22213,7 @@ void main() {
22213
22213
  L ${gV[3].x},${gV[3].y}
22214
22214
  L ${gV[4].x},${gV[4].y}
22215
22215
  Z
22216
- `;VV.push({name:"path",type:"element",attributes:{class:"net-label",d:JV,fill:"white",stroke:colorMap.schematic.label_global,"stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]});const nV={x:FV.x+dV.x*RV*.5,y:FV.y+dV.y*RV*.5},aV={left:"start",top:"start",bottom:"start",right:"end"}[lV.anchor_side],GV={left:"",right:"",top:`rotate(90 ${nV.x} ${nV.y})`,bottom:`rotate(-90 ${nV.x} ${nV.y})`}[lV.anchor_side];return VV.push({name:"text",type:"element",attributes:{class:"net-label-text",x:nV.x.toString(),y:nV.y.toString(),fill:colorMap.schematic.label_global,"text-anchor":aV,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${RV}px`,transform:GV},children:[{type:"text",value:lV.text||"",name:"",attributes:{},children:[]}],value:""}),VV};function convertCircuitJsonToSchematicSvg(lV,J){const VV=getSchematicBoundsFromCircuitJson(lV),RV=VV.maxX-VV.minX,UV=VV.maxY-VV.minY,ZV=(J==null?void 0:J.width)??1200,WV=(J==null?void 0:J.height)??600,IV=RV/UV,dV=ZV/WV;let CV;if(IV>dV){const TV=ZV/IV;CV={x:0,y:(WV-TV)/2}}else{const TV=WV*IV;CV={x:(ZV-TV)/2,y:0}}const FV=fromTriangles([{x:VV.minX,y:VV.maxY},{x:VV.maxX,y:VV.maxY},{x:VV.maxX,y:VV.minY}],[{x:CV.x,y:CV.y},{x:ZV-CV.x,y:CV.y},{x:ZV-CV.x,y:WV-CV.y}]),NV=[];if(NV.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:ZV.toString(),height:WV.toString()},children:[],value:""}),J!=null&&J.grid){const TV=typeof J.grid=="object"?J.grid:{};NV.push(drawSchematicGrid({bounds:VV,transform:FV,...TV}))}const eV=[],gV=[],JV=[],nV=[],aV=[],GV=[];for(const TV of lV)TV.type==="schematic_debug_object"?eV.push(...createSvgObjectsFromSchDebugObject(TV,FV)):TV.type==="schematic_component"?gV.push(...createSvgObjectsFromSchematicComponent({component:TV,transform:FV,circuitJson:lV})):TV.type==="schematic_trace"?JV.push(...createSchematicTrace(TV,FV)):TV.type==="schematic_net_label"?nV.push(...createSvgObjectsForSchNetLabel(TV,FV)):TV.type==="schematic_text"&&!TV.schematic_component_id?aV.push(createSvgSchText(TV,FV)):TV.type==="schematic_voltage_probe"&&GV.push(...createSvgObjectsFromSchVoltageProbe(TV,FV));NV.push(...eV,...gV,...JV,...nV,...aV,...GV),J!=null&&J.labeledPoints&&NV.push(drawSchematicLabeledPoints({points:J.labeledPoints,transform:FV}));const cV={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:ZV.toString(),height:WV.toString(),style:`background-color: ${colorMap.schematic.background}`,"data-real-to-screen-transform":toSVG(FV)},children:[{name:"style",type:"element",children:[{type:"text",value:`
22216
+ `;VV.push({name:"path",type:"element",attributes:{class:"net-label",d:JV,fill:"#FFFFFF99",stroke:colorMap.schematic.label_global,"stroke-width":`${getSchStrokeSize(J)}px`},value:"",children:[]});const nV={x:FV.x+dV.x*RV*.5,y:FV.y+dV.y*RV*.5},aV={left:"start",top:"start",bottom:"start",right:"end"}[lV.anchor_side],GV={left:"",right:"",top:`rotate(90 ${nV.x} ${nV.y})`,bottom:`rotate(-90 ${nV.x} ${nV.y})`}[lV.anchor_side];return VV.push({name:"text",type:"element",attributes:{class:"net-label-text",x:nV.x.toString(),y:nV.y.toString(),fill:colorMap.schematic.label_global,"text-anchor":aV,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${RV}px`,transform:GV},children:[{type:"text",value:lV.text||"",name:"",attributes:{},children:[]}],value:""}),VV};function convertCircuitJsonToSchematicSvg(lV,J){const VV=getSchematicBoundsFromCircuitJson(lV),RV=VV.maxX-VV.minX,UV=VV.maxY-VV.minY,ZV=(J==null?void 0:J.width)??1200,WV=(J==null?void 0:J.height)??600,IV=RV/UV,dV=ZV/WV;let CV;if(IV>dV){const TV=ZV/IV;CV={x:0,y:(WV-TV)/2}}else{const TV=WV*IV;CV={x:(ZV-TV)/2,y:0}}const FV=fromTriangles([{x:VV.minX,y:VV.maxY},{x:VV.maxX,y:VV.maxY},{x:VV.maxX,y:VV.minY}],[{x:CV.x,y:CV.y},{x:ZV-CV.x,y:CV.y},{x:ZV-CV.x,y:WV-CV.y}]),NV=[];if(NV.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:ZV.toString(),height:WV.toString()},children:[],value:""}),J!=null&&J.grid){const TV=typeof J.grid=="object"?J.grid:{};NV.push(drawSchematicGrid({bounds:VV,transform:FV,...TV}))}const eV=[],gV=[],JV=[],nV=[],aV=[],GV=[];for(const TV of lV)TV.type==="schematic_debug_object"?eV.push(...createSvgObjectsFromSchDebugObject(TV,FV)):TV.type==="schematic_component"?gV.push(...createSvgObjectsFromSchematicComponent({component:TV,transform:FV,circuitJson:lV})):TV.type==="schematic_trace"?JV.push(...createSchematicTrace(TV,FV)):TV.type==="schematic_net_label"?nV.push(...createSvgObjectsForSchNetLabel(TV,FV)):TV.type==="schematic_text"&&!TV.schematic_component_id?aV.push(createSvgSchText(TV,FV)):TV.type==="schematic_voltage_probe"&&GV.push(...createSvgObjectsFromSchVoltageProbe(TV,FV));NV.push(...eV,...gV,...JV,...nV,...aV,...GV),J!=null&&J.labeledPoints&&NV.push(drawSchematicLabeledPoints({points:J.labeledPoints,transform:FV}));const cV={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",width:ZV.toString(),height:WV.toString(),style:`background-color: ${colorMap.schematic.background}`,"data-real-to-screen-transform":toSVG(FV)},children:[{name:"style",type:"element",children:[{type:"text",value:`
22217
22217
  .boundary { fill: ${colorMap.schematic.background}; }
22218
22218
  .schematic-boundary { fill: none; stroke: #fff; }
22219
22219
  .component { fill: none; stroke: ${colorMap.schematic.component_outline}; }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tscircuit/runframe",
3
3
  "main": "dist/preview.js",
4
4
  "type": "module",
5
- "version": "0.0.95",
5
+ "version": "0.0.96",
6
6
  "exports": {
7
7
  ".": "./dist/preview.js",
8
8
  "./preview": "./dist/preview.js",
@@ -60,7 +60,7 @@
60
60
  "@tscircuit/pcb-viewer": "^1.10.22",
61
61
  "@tscircuit/props": "^0.0.129",
62
62
  "@tscircuit/schematic-viewer": "2.0.9",
63
- "circuit-to-svg": "^0.0.100",
63
+ "circuit-to-svg": "^0.0.101",
64
64
  "comlink": "^4.4.2",
65
65
  "cssnano": "^7.0.6",
66
66
  "lucide-react": "^0.468.0",