@tscircuit/runframe 0.0.2459 → 0.0.2461

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.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="800" height="600"><style></style><rect class="boundary" x="0" y="0" fill="#000" width="800" height="600" data-type="pcb_background" data-pcb-layer="global"/><rect class="pcb-boundary" fill="none" stroke="#fff" stroke-width="0.3" x="53.84615384615387" y="23.076923076923094" width="692.3076923076924" height="553.8461538461538" data-type="pcb_boundary" data-pcb-layer="global"/><path class="pcb-board" d="M 53.84615384615387 576.9230769230769 L 746.1538461538462 576.9230769230769 L 746.1538461538462 23.076923076923094 L 53.84615384615387 23.076923076923094 Z" fill="none" stroke="rgba(255, 255, 255, 0.5)" stroke-width="2.307692307692308" data-type="pcb_board" data-pcb-layer="board"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="338.8461538461538" y="249.1153846153846" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="338.8461538461538" y="278.42307692307696" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="338.8461538461538" y="307.7307692307692" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin3"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="338.8461538461538" y="337.03846153846155" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin4"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="438.0769230769231" y="337.03846153846155" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin5"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="438.0769230769231" y="307.7307692307692" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin6"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="438.0769230769231" y="278.42307692307696" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin7"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="438.0769230769231" y="249.1153846153846" width="23.076923076923077" height="13.846153846153845" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="U1.pin8"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="197.3846153846154" y="154.15384615384616" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R1.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="220.92307692307693" y="154.15384615384616" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R1.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="197.3846153846154" y="246.46153846153845" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R2.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="220.92307692307693" y="246.46153846153845" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R2.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="197.3846153846154" y="338.7692307692308" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R3.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="220.92307692307693" y="338.7692307692308" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="R3.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="566.6153846153845" y="154.15384615384616" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C1.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="590.1538461538461" y="154.15384615384616" width="12.461538461538462" height="14.76923076923077" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C1.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="556.3461538461538" y="265.96153846153845" width="18.461538461538463" height="21.923076923076923" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C2.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="594.4230769230769" y="265.96153846153845" width="18.461538461538463" height="21.923076923076923" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C2.pin2"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="551.7307692307693" y="399.2307692307692" width="23.65384615384615" height="32.30769230769231" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C3.pin1"/><rect class="pcb-pad" fill="rgb(200, 52, 52)" x="593.8461538461538" y="399.2307692307692" width="23.65384615384615" height="32.30769230769231" data-type="pcb_smtpad" data-pcb-layer="top" data-pad-name="C3.pin2"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 364.2307692307692 358.21153846153845 L 364.2307692307692 241.78846153846155 L 388.0769230769231 241.78846153846155 L 388.9845132662116 246.3512255397376 L 391.5691114550835 250.21935008337806 L 395.4372359987239 252.80394827224995 L 400 253.71153846153845 L 404.5627640012761 252.80394827224995 L 408.4308885449165 250.21935008337806 L 411.0154867337884 246.3512255397376 L 411.9230769230769 241.78846153846155 L 435.7692307692308 241.78846153846155 L 435.7692307692308 358.21153846153845 L 364.2307692307692 358.21153846153845 Z" fill="none" stroke="#f2eda1" stroke-width="2.307692307692308" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_0" data-pcb-silkscreen-path-id="pcb_silkscreen_path_0" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="14.317307692307692" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,400,232.55769230769232)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_0" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">U1</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 152.76923076923077 L 218.93017692307694 152.76923076923077" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_1" data-pcb-silkscreen-path-id="pcb_silkscreen_path_1" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 170.30769230769232 L 218.93017692307694 170.30769230769232" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_1" data-pcb-silkscreen-path-id="pcb_silkscreen_path_2" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,215.3846153846154,133.3846153846154)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_1" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">R1</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 245.0769230769231 L 218.93017692307694 245.0769230769231" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_2" data-pcb-silkscreen-path-id="pcb_silkscreen_path_3" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 262.61538461538464 L 218.93017692307694 262.61538461538464" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_2" data-pcb-silkscreen-path-id="pcb_silkscreen_path_4" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,215.3846153846154,225.69230769230768)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_2" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">R2</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 337.38461538461536 L 218.93017692307694 337.38461538461536" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_3" data-pcb-silkscreen-path-id="pcb_silkscreen_path_5" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><path class="pcb-silkscreen pcb-silkscreen-top" d="M 211.83905384615383 354.9230769230769 L 218.93017692307694 354.9230769230769" fill="none" stroke="#f2eda1" stroke-width="2.769230769230769" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_3" data-pcb-silkscreen-path-id="pcb_silkscreen_path_6" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,215.3846153846154,318)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_3" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">R3</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 596.3846153846154 144.92307692307693 L 562 144.92307692307693 L 562 178.15384615384613 L 596.3846153846154 178.15384615384613" fill="none" stroke="#f2eda1" stroke-width="2.307692307692308" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_4" data-pcb-silkscreen-path-id="pcb_silkscreen_path_7" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,584.6153846153846,133.3846153846154)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_4" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">C1</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 603.6538461538462 256.7307692307692 L 551.7307692307693 256.7307692307692 L 551.7307692307693 297.11538461538464 L 603.6538461538462 297.11538461538464" fill="none" stroke="#f2eda1" stroke-width="2.307692307692308" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_5" data-pcb-silkscreen-path-id="pcb_silkscreen_path_8" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,584.6153846153846,245.19230769230768)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_5" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">C2</text><path class="pcb-silkscreen pcb-silkscreen-top" d="M 605.6730769230769 390 L 547.1153846153846 390 L 547.1153846153846 440.7692307692307 L 605.6730769230769 440.7692307692307" fill="none" stroke="#f2eda1" stroke-width="2.307692307692308" stroke-linecap="round" stroke-linejoin="round" data-pcb-component-id="pcb_component_6" data-pcb-silkscreen-path-id="pcb_silkscreen_path_9" data-type="pcb_silkscreen_path" data-pcb-layer="top"/><text x="0" y="0" dx="0" dy="0" fill="#f2eda1" font-family="Arial, sans-serif" font-size="9.230769230769232" text-anchor="middle" dominant-baseline="central" transform="matrix(1,0,0,1,584.6153846153846,378.46153846153845)" class="pcb-silkscreen-text pcb-silkscreen-top" data-pcb-silkscreen-text-id="pcb_silkscreen_text_6" stroke="none" data-type="pcb_silkscreen_text" data-pcb-layer="top">C3</text></svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" class="tscircuit-schematic" width="1200" height="600" style="background-color: rgb(245, 241, 237)" data-real-to-screen-transform="matrix(42.002100105,0,0,-42.002100105,600,51.2425621281)"><style>
2
+ .boundary { fill: rgb(245, 241, 237); }
3
+ .schematic-boundary { fill: none; stroke: #fff; }
4
+ .component { fill: none; stroke: rgb(132, 0, 0); }
5
+ .chip { fill: rgb(255, 255, 194); stroke: rgb(132, 0, 0); }
6
+ .component-pin { fill: none; stroke: rgb(132, 0, 0); }
7
+ .text { font-family: sans-serif; fill: rgb(0, 150, 0); }
8
+ .pin-number { fill: rgb(169, 0, 0); }
9
+ .port-label { fill: rgb(0, 100, 100); }
10
+ .component-name { fill: rgb(0, 100, 100); }
11
+
12
+ </style><rect class="boundary" x="0" y="0" width="1200" height="600"/><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_0"><rect class="component chip sch-component-body" x="591.599579979" y="30.2415120756" width="16.80084004199989" height="42.002100105" stroke-width="0.8400420020999999px" fill="rgb(255, 255, 194)" stroke="rgb(132, 0, 0)"/><rect class="component-overlay sch-component-overlay" x="591.599579979" y="30.2415120756" width="16.80084004199989" height="42.002100105" fill="transparent"/><text class="sch-text" x="591.599579979" y="77.70388519424999" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="7.560378018899999px" transform="rotate(0, 591.599579979, 77.70388519424999)"></text><text class="sch-text" x="591.599579979" y="24.78123906195" fill="#006464" text-anchor="start" dominant-baseline="middle" font-family="sans-serif" font-size="7.560378018899999px" transform="rotate(0, 591.599579979, 24.78123906195)">U1</text><line class="component-pin sch-component-pin sch-port-line" x1="591.599579979" y1="38.641932096599994" x2="575.6387819391" y2="38.641932096599994" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_0"><circle class="component-pin sch-component-pin sch-port-terminal" cx="574.798739937" cy="38.641932096599994" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="573.9586979349001" y="37.801890094499996" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="583.199159958" y="37.801890094499996" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">1</text><line class="component-pin sch-component-pin sch-port-line" x1="591.599579979" y1="47.0423521176" x2="575.6387819391" y2="47.0423521176" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_1"><circle class="component-pin sch-component-pin sch-port-terminal" cx="574.798739937" cy="47.0423521176" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="573.9586979349001" y="46.2023101155" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="583.199159958" y="46.2023101155" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">2</text><line class="component-pin sch-component-pin sch-port-line" x1="591.599579979" y1="55.4427721386" x2="575.6387819391" y2="55.4427721386" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_2"><circle class="component-pin sch-component-pin sch-port-terminal" cx="574.798739937" cy="55.4427721386" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="573.9586979349001" y="54.6027301365" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="583.199159958" y="54.6027301365" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">3</text><line class="component-pin sch-component-pin sch-port-line" x1="591.599579979" y1="63.8431921596" x2="575.6387819391" y2="63.8431921596" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_3"><circle class="component-pin sch-component-pin sch-port-terminal" cx="574.798739937" cy="63.8431921596" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="573.9586979349001" y="63.0031501575" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="583.199159958" y="63.0031501575" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">4</text><line class="component-pin sch-component-pin sch-port-line" x1="608.400420021" y1="63.8431921596" x2="624.3612180609" y2="63.8431921596" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_4"><circle class="component-pin sch-component-pin sch-port-terminal" cx="625.201260063" cy="63.8431921596" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="624.3612180609" y="63.0031501575" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="616.800840042" y="63.0031501575" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">5</text><line class="component-pin sch-component-pin sch-port-line" x1="608.400420021" y1="55.4427721386" x2="624.3612180609" y2="55.4427721386" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_5"><circle class="component-pin sch-component-pin sch-port-terminal" cx="625.201260063" cy="55.4427721386" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="624.3612180609" y="54.6027301365" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="616.800840042" y="54.6027301365" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">6</text><line class="component-pin sch-component-pin sch-port-line" x1="608.400420021" y1="47.0423521176" x2="624.3612180609" y2="47.0423521176" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_6"><circle class="component-pin sch-component-pin sch-port-terminal" cx="625.201260063" cy="47.0423521176" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="624.3612180609" y="46.2023101155" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="616.800840042" y="46.2023101155" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">7</text><line class="component-pin sch-component-pin sch-port-line" x1="608.400420021" y1="38.641932096599994" x2="624.3612180609" y2="38.641932096599994" stroke-width="0.8400420020999999px"/><g class="sch-port" data-schematic-port-id="source_port_7"><circle class="component-pin sch-component-pin sch-port-terminal" cx="625.201260063" cy="38.641932096599994" r="0.8400420020999999" stroke-width="0.8400420020999999px"/><rect x="624.3612180609" y="37.801890094499996" width="1.6800840041999998" height="1.6800840041999998" opacity="0"/></g><text class="pin-number sch-pin-number" x="616.800840042" y="37.801890094499996" style="font-family: sans-serif;" fill="rgb(169, 0, 0)" text-anchor="middle" dominant-baseline="auto" font-size="6.300315015749999px" transform="">8</text></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_1"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="150.36835841790207" width="25.201260063000063" height="6.718655932795798" fill="transparent"/><path class="sch-component-symbol-path" d="M 587.3993699685 153.72768638429997 L 591.6004200210022 153.72768638429997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 608.3995799789978 153.72768638429997 L 612.6006300315 153.72768638429997" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 591.6004200210022 150.36835841790207 L 608.3995799789978 150.36835841790207 L 608.3995799789978 157.08701435069787 L 591.6004200210022 157.08701435069787 L 591.6004200210022 150.36835841790207" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="147.00735036749998" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">R1</text><text class="sch-component-text" x="600" y="160.44802240109996" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">100kΩ</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="153.72768638429997" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="153.72768638429997" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_2"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="229.33230661530206" width="25.201260063000063" height="6.718655932795798" fill="transparent"/><path class="sch-component-symbol-path" d="M 587.3993699685 232.69163458169996 L 591.6004200210022 232.69163458169996" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 608.3995799789978 232.69163458169996 L 612.6006300315 232.69163458169996" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 591.6004200210022 229.33230661530206 L 608.3995799789978 229.33230661530206 L 608.3995799789978 236.05096254809786 L 591.6004200210022 236.05096254809786 L 591.6004200210022 229.33230661530206" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="225.97129856489997" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">R2</text><text class="sch-component-text" x="600" y="239.41197059849995" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">10kΩ</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="232.69163458169996" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="232.69163458169996" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_3"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="308.29625481270205" width="25.201260063000063" height="6.718655932795855" fill="transparent"/><path class="sch-component-symbol-path" d="M 587.3993699685 311.6555827791 L 591.6004200210022 311.6555827791" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 608.3995799789978 311.6555827791 L 612.6006300315 311.6555827791" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 591.6004200210022 308.29625481270205 L 608.3995799789978 308.29625481270205 L 608.3995799789978 315.0149107454979 L 591.6004200210022 315.0149107454979 L 591.6004200210022 308.29625481270205" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="304.9352467623" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">R3</text><text class="sch-component-text" x="600" y="318.37591879589996" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">1kΩ</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="311.6555827791" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="311.6555827791" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_4"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="387.2585229260979" width="25.201260063000063" height="13.442352117604173" fill="transparent"/><path class="sch-component-symbol-path" d="M 612.6006300315 393.9796989849 L 602.5201260063 393.9796989849" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 393.9796989849 L 587.3993699685 393.9796989849" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 602.5201260063 387.2585229260979 L 602.5201260063 400.70087504370207" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 387.2585229260979 L 597.4798739937 400.70087504370207" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="383.89919495969997" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">C1</text><text class="sch-component-text" x="600" y="404.0602030101" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">100nF</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="393.9796989849" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="393.9796989849" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_5"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="472.9428071402979" width="25.201260063000063" height="13.442352117604173" fill="transparent"/><path class="sch-component-symbol-path" d="M 612.6006300315 479.66398319909996 L 602.5201260063 479.66398319909996" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 479.66398319909996 L 587.3993699685 479.66398319909996" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 602.5201260063 472.9428071402979 L 602.5201260063 486.38515925790205" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 472.9428071402979 L 597.4798739937 486.38515925790205" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="469.58347917389995" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">C2</text><text class="sch-component-text" x="600" y="489.7444872243" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">1uF</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="479.66398319909996" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="479.66398319909996" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="sch-component" data-circuit-json-type="schematic_component" data-schematic-component-id="schematic_component_6"><rect class="component-overlay sch-component-overlay" x="587.3993699685" y="558.6270913544977" width="25.201260063000063" height="13.442352117604287" fill="transparent"/><path class="sch-component-symbol-path" d="M 612.6006300315 565.3482674132998 L 602.5201260063 565.3482674132998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 565.3482674132998 L 587.3993699685 565.3482674132998" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 602.5201260063 558.6270913544977 L 602.5201260063 572.069443472102" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><path class="sch-component-symbol-path" d="M 597.4798739937 558.6270913544977 L 597.4798739937 572.069443472102" stroke="rgb(132, 0, 0)" fill="none" stroke-width="0.8400420020999999px" stroke-linecap="round"/><text class="sch-component-name sch-component-text" x="600" y="555.2677633880999" stroke="rgb(245, 241, 237)" stroke-width="0.8400420020999999px" paint-order="stroke" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="ideographic" font-size="7.560378018899999px">C3</text><text class="sch-component-text" x="600" y="575.4287714384998" fill="rgb(15, 15, 15)" font-family="sans-serif" text-anchor="middle" dominant-baseline="hanging" font-size="7.560378018899999px">4.7uF</text><circle class="component-pin sch-component-pin" cx="587.3993699685" cy="565.3482674132998" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/><circle class="component-pin sch-component-pin" cx="612.6006300315" cy="565.3482674132998" r="0.8400420020999999px" stroke-width="0.8400420020999999px" fill="none" stroke="rgb(132, 0, 0)"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_0"><circle cx="574.798739937" cy="38.641932096599994" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_1"><circle cx="574.798739937" cy="47.0423521176" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_2"><circle cx="574.798739937" cy="55.4427721386" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_3"><circle cx="574.798739937" cy="63.8431921596" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_4"><circle cx="625.201260063" cy="63.8431921596" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_5"><circle cx="625.201260063" cy="55.4427721386" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_6"><circle cx="625.201260063" cy="47.0423521176" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_7"><circle cx="625.201260063" cy="38.641932096599994" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_8"><circle cx="587.3993699685" cy="153.72768638429997" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_9"><circle cx="612.6006300315" cy="153.72768638429997" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_10"><circle cx="587.3993699685" cy="232.69163458169996" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_11"><circle cx="612.6006300315" cy="232.69163458169996" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_12"><circle cx="587.3993699685" cy="311.6555827791" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_13"><circle cx="612.6006300315" cy="311.6555827791" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_14"><circle cx="587.3993699685" cy="393.9796989849" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_15"><circle cx="612.6006300315" cy="393.9796989849" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_16"><circle cx="587.3993699685" cy="479.66398319909996" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_17"><circle cx="612.6006300315" cy="479.66398319909996" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_18"><circle cx="587.3993699685" cy="565.3482674132998" r="1.6800840041999998" fill="red" opacity="0"/></g><g class="schematic-port-hover sch-port-hover" data-schematic-port-id="source_port_19"><circle cx="612.6006300315" cy="565.3482674132998" r="1.6800840041999998" fill="red" opacity="0"/></g></svg>
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  SchematicViewer,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-4OLWPZIM.js";
11
+ } from "./chunk-MDUZTX7J.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.d.ts CHANGED
@@ -385,6 +385,8 @@ interface RunFrameStaticBuildViewerProps {
385
385
  projectName?: string;
386
386
  showFileMenu?: boolean;
387
387
  tabSelected?: TabId;
388
+ /** Open the visual circuit gallery on the initial render. */
389
+ defaultToGallery?: boolean;
388
390
  }
389
391
  declare const RunFrameStaticBuildViewer: (props: RunFrameStaticBuildViewerProps) => react.JSX.Element;
390
392
 
@@ -394,4 +396,12 @@ declare const CircuitJsonFileSelectorCombobox: ({ files, onFileChange, currentFi
394
396
  onFileChange: (value: string) => void;
395
397
  }) => react.JSX.Element;
396
398
 
397
- export { CircuitJsonFileSelectorCombobox, type ComponentSearchResult, ImportComponentDialog, ImportComponentDialog2, type ImportComponentDialog2Props, ImportComponentDialogForCli, type ImportComponentDialogProps, type ImportComponentDialogSearchResult, type ImportSource, type JlcpcbComponentSearchResult, type JlcpcbComponentSummary, type JlcpcbComponentTsxLoadedPayload, type KicadFootprintSearchResult, type KicadFootprintSummary, type KicadStringSelectedPayload, RunFrame, RunFrameForCli, type RunFrameForCliProps, type RunFrameProps, RunFrameStaticBuildViewer, type RunFrameStaticBuildViewerProps, RunFrameWithApi, type RunFrameWithApiProps, TabId, type TscircuitPackageDetails, type TscircuitPackageSearchResult, type TscircuitPackageSelectedPayload, guessEntrypoint, guessManualEditsFilePath, mapJLCComponentToSearchResult, mapTscircuitSnippetToSearchResult, searchJLCComponents, searchTscircuitComponents };
399
+ declare const getCircuitPreviewImageUrls: (fileRef: CircuitJsonFileReference) => string[];
400
+ declare const CircuitGallery: ({ files, projectName, onSelectFile, onClose, }: {
401
+ files: CircuitJsonFileReference[];
402
+ projectName?: string;
403
+ onSelectFile: (filePath: string) => void;
404
+ onClose: () => void;
405
+ }) => react.JSX.Element;
406
+
407
+ export { CircuitGallery, CircuitJsonFileSelectorCombobox, type ComponentSearchResult, ImportComponentDialog, ImportComponentDialog2, type ImportComponentDialog2Props, ImportComponentDialogForCli, type ImportComponentDialogProps, type ImportComponentDialogSearchResult, type ImportSource, type JlcpcbComponentSearchResult, type JlcpcbComponentSummary, type JlcpcbComponentTsxLoadedPayload, type KicadFootprintSearchResult, type KicadFootprintSummary, type KicadStringSelectedPayload, RunFrame, RunFrameForCli, type RunFrameForCliProps, type RunFrameProps, RunFrameStaticBuildViewer, type RunFrameStaticBuildViewerProps, RunFrameWithApi, type RunFrameWithApiProps, TabId, type TscircuitPackageDetails, type TscircuitPackageSearchResult, type TscircuitPackageSelectedPayload, getCircuitPreviewImageUrls, guessEntrypoint, guessManualEditsFilePath, mapJLCComponentToSearchResult, mapTscircuitSnippetToSearchResult, searchJLCComponents, searchTscircuitComponents };
package/dist/runner.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  useRunFrameStore,
41
41
  useRunnerStore,
42
42
  useStyles
43
- } from "./chunk-4OLWPZIM.js";
43
+ } from "./chunk-MDUZTX7J.js";
44
44
 
45
45
  // lib/components/RunFrame/RunFrame.tsx
46
46
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -2891,7 +2891,7 @@ var ImportComponentDialog = ({
2891
2891
  };
2892
2892
 
2893
2893
  // lib/components/RunFrameStaticBuildViewer/RunFrameStaticBuildViewer.tsx
2894
- import { useCallback as useCallback8, useEffect as useEffect10, useState as useState11 } from "react";
2894
+ import { useCallback as useCallback8, useEffect as useEffect11, useState as useState12 } from "react";
2895
2895
 
2896
2896
  // lib/components/RunFrameStaticBuildViewer/CircuitJsonFileSelectorCombobox.tsx
2897
2897
  import { jsx as jsx11 } from "react/jsx-runtime";
@@ -2919,6 +2919,19 @@ import { ErrorBoundary as ErrorBoundary2 } from "react-error-boundary";
2919
2919
 
2920
2920
  // lib/components/RunFrameStaticBuildViewer/use-static-circuit-json-path-hash.ts
2921
2921
  import { useCallback as useCallback7, useState as useState10 } from "react";
2922
+ var isEnabledFlag = (value) => value !== null && !["0", "false", "off", "no"].includes(value.toLowerCase());
2923
+ var hasGalleryFlag = ({
2924
+ hash,
2925
+ search = ""
2926
+ }) => {
2927
+ const hashParams = new URLSearchParams(
2928
+ hash.startsWith("#") ? hash.slice(1) : hash
2929
+ );
2930
+ const searchParams = new URLSearchParams(
2931
+ search.startsWith("?") ? search.slice(1) : search
2932
+ );
2933
+ return isEnabledFlag(hashParams.get("gallery")) || isEnabledFlag(searchParams.get("gallery"));
2934
+ };
2922
2935
  var getInitialCircuitJsonPath = ({
2923
2936
  hash,
2924
2937
  initialCircuitPath
@@ -2935,9 +2948,10 @@ var getUpdatedCircuitJsonPathHash = ({
2935
2948
  const params = new URLSearchParams(
2936
2949
  hash.startsWith("#") ? hash.slice(1) : hash
2937
2950
  );
2938
- if (params.get("file") === filePath && (!params.has("main_component") || params.get("main_component") === filePath)) {
2951
+ if (params.get("file") === filePath && !params.has("gallery") && (!params.has("main_component") || params.get("main_component") === filePath)) {
2939
2952
  return hash.startsWith("#") ? hash : hash ? `#${hash}` : "";
2940
2953
  }
2954
+ params.delete("gallery");
2941
2955
  params.set("file", filePath);
2942
2956
  if (params.has("main_component")) {
2943
2957
  params.set("main_component", filePath);
@@ -2945,7 +2959,7 @@ var getUpdatedCircuitJsonPathHash = ({
2945
2959
  const nextHash = params.toString();
2946
2960
  return nextHash ? `#${nextHash}` : "";
2947
2961
  };
2948
- var useStaticCircuitJsonPathHash = (initialCircuitPath) => {
2962
+ var useStaticCircuitJsonPathHash = (initialCircuitPath, defaultToGallery = false) => {
2949
2963
  const [currentCircuitJsonPath, setCurrentCircuitJsonPath] = useState10(
2950
2964
  () => {
2951
2965
  if (typeof window === "undefined") return initialCircuitPath ?? "";
@@ -2955,34 +2969,172 @@ var useStaticCircuitJsonPathHash = (initialCircuitPath) => {
2955
2969
  });
2956
2970
  }
2957
2971
  );
2972
+ const [isGalleryVisible, setIsGalleryVisible] = useState10(() => {
2973
+ if (typeof window === "undefined") return defaultToGallery;
2974
+ return defaultToGallery || hasGalleryFlag({
2975
+ hash: window.location.hash,
2976
+ search: window.location.search
2977
+ });
2978
+ });
2979
+ const updateGalleryUrl = useCallback7((visible) => {
2980
+ if (typeof window === "undefined") return;
2981
+ const hashParams = new URLSearchParams(window.location.hash.slice(1));
2982
+ const searchParams = new URLSearchParams(window.location.search.slice(1));
2983
+ if (visible) {
2984
+ hashParams.set("gallery", "true");
2985
+ } else {
2986
+ hashParams.delete("gallery");
2987
+ searchParams.delete("gallery");
2988
+ }
2989
+ const search = searchParams.toString();
2990
+ const hash = hashParams.toString();
2991
+ window.history.replaceState(
2992
+ null,
2993
+ "",
2994
+ `${window.location.pathname}${search ? `?${search}` : ""}${hash ? `#${hash}` : ""}`
2995
+ );
2996
+ }, []);
2997
+ const showGallery = useCallback7(() => {
2998
+ setIsGalleryVisible(true);
2999
+ updateGalleryUrl(true);
3000
+ }, [updateGalleryUrl]);
3001
+ const hideGallery = useCallback7(() => {
3002
+ setIsGalleryVisible(false);
3003
+ updateGalleryUrl(false);
3004
+ }, [updateGalleryUrl]);
2958
3005
  const updateFileHash = useCallback7((filePath) => {
2959
3006
  if (typeof window === "undefined") return;
2960
3007
  const newHash = getUpdatedCircuitJsonPathHash({
2961
3008
  hash: window.location.hash,
2962
3009
  filePath
2963
3010
  });
2964
- if (newHash === window.location.hash) return;
2965
- const newUrl = `${window.location.pathname}${window.location.search}${newHash}`;
3011
+ const searchParams = new URLSearchParams(window.location.search.slice(1));
3012
+ searchParams.delete("gallery");
3013
+ const search = searchParams.toString();
3014
+ const newUrl = `${window.location.pathname}${search ? `?${search}` : ""}${newHash}`;
3015
+ if (newHash === window.location.hash && `${search ? `?${search}` : ""}` === window.location.search)
3016
+ return;
2966
3017
  window.history.replaceState(null, "", newUrl);
2967
3018
  }, []);
2968
3019
  return {
2969
3020
  currentCircuitJsonPath,
2970
3021
  setCurrentCircuitJsonPath,
2971
- updateFileHash
3022
+ updateFileHash,
3023
+ isGalleryVisible,
3024
+ showGallery,
3025
+ hideGallery
2972
3026
  };
2973
3027
  };
2974
3028
 
2975
- // lib/components/RunFrameStaticBuildViewer/RunFrameStaticBuildViewer.tsx
3029
+ // lib/components/RunFrameStaticBuildViewer/CircuitGallery.tsx
3030
+ import { ArrowLeft, ImageIcon } from "lucide-react";
3031
+ import { useEffect as useEffect10, useState as useState11 } from "react";
2976
3032
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3033
+ var getCircuitPreviewImageUrls = (fileRef) => {
3034
+ const assetUrl = fileRef.fileStaticAssetUrl;
3035
+ const queryOrHashIndex = assetUrl.search(/[?#]/);
3036
+ const path = queryOrHashIndex === -1 ? assetUrl : assetUrl.slice(0, queryOrHashIndex);
3037
+ const suffix = queryOrHashIndex === -1 ? "" : assetUrl.slice(queryOrHashIndex);
3038
+ const directory = path.includes("/") ? path.slice(0, path.lastIndexOf("/") + 1) : "";
3039
+ return ["3d.png", "pcb.png", "pcb.svg", "schematic.png", "schematic.svg"].map(
3040
+ (fileName) => `${directory}${fileName}${suffix}`
3041
+ );
3042
+ };
3043
+ var getCircuitDisplayName = (filePath) => {
3044
+ const fileName = filePath.split("/").pop() ?? filePath;
3045
+ return fileName.replace(/(\.board|\.circuit)?\.(tsx|jsx|json)$/i, "");
3046
+ };
3047
+ var CircuitGalleryPreviewImage = ({
3048
+ fileRef
3049
+ }) => {
3050
+ const previewUrls = getCircuitPreviewImageUrls(fileRef);
3051
+ const [previewIndex, setPreviewIndex] = useState11(0);
3052
+ if (previewIndex >= previewUrls.length) {
3053
+ return /* @__PURE__ */ jsx12("div", { className: "rf-flex rf-h-full rf-w-full rf-items-center rf-justify-center rf-bg-zinc-100 rf-text-zinc-400", children: /* @__PURE__ */ jsx12(ImageIcon, { className: "rf-h-8 rf-w-8", "aria-hidden": "true" }) });
3054
+ }
3055
+ return /* @__PURE__ */ jsx12(
3056
+ "img",
3057
+ {
3058
+ src: previewUrls[previewIndex],
3059
+ alt: `Preview of ${getCircuitDisplayName(fileRef.filePath)}`,
3060
+ className: "rf-h-full rf-w-full rf-object-contain rf-transition-transform rf-duration-200 group-hover:rf-scale-[1.03]",
3061
+ loading: "lazy",
3062
+ onError: () => setPreviewIndex((index) => index + 1)
3063
+ }
3064
+ );
3065
+ };
3066
+ var CircuitGallery = ({
3067
+ files,
3068
+ projectName,
3069
+ onSelectFile,
3070
+ onClose
3071
+ }) => {
3072
+ useEffect10(() => {
3073
+ const handleKeyDown = (event) => {
3074
+ if (event.key === "Escape") onClose();
3075
+ };
3076
+ window.addEventListener("keydown", handleKeyDown);
3077
+ return () => window.removeEventListener("keydown", handleKeyDown);
3078
+ }, [onClose]);
3079
+ return /* @__PURE__ */ jsx12("main", { className: "rf-h-full rf-w-full rf-overflow-y-auto rf-bg-zinc-50", children: /* @__PURE__ */ jsxs10("div", { className: "rf-mx-auto rf-w-full rf-max-w-7xl rf-px-5 rf-py-8 sm:rf-px-8 sm:rf-py-10", children: [
3080
+ /* @__PURE__ */ jsxs10("div", { className: "rf-mb-7 rf-flex rf-items-start rf-justify-between rf-gap-4", children: [
3081
+ /* @__PURE__ */ jsxs10("div", { children: [
3082
+ /* @__PURE__ */ jsx12("p", { className: "rf-mb-1 rf-text-xs rf-font-medium rf-uppercase rf-tracking-wider rf-text-zinc-500", children: projectName ?? "tscircuit project" }),
3083
+ /* @__PURE__ */ jsx12("h1", { className: "rf-text-2xl rf-font-semibold rf-tracking-tight rf-text-zinc-950 sm:rf-text-3xl", children: "Circuit gallery" }),
3084
+ /* @__PURE__ */ jsxs10("p", { className: "rf-mt-2 rf-text-sm rf-text-zinc-600", children: [
3085
+ "Explore ",
3086
+ files.length,
3087
+ " ",
3088
+ files.length === 1 ? "board" : "boards",
3089
+ ". Select one to open its interactive preview."
3090
+ ] })
3091
+ ] }),
3092
+ /* @__PURE__ */ jsxs10(Button, { type: "button", variant: "outline", onClick: onClose, children: [
3093
+ /* @__PURE__ */ jsx12(ArrowLeft, { className: "rf-h-4 rf-w-4" }),
3094
+ "Back to circuit"
3095
+ ] })
3096
+ ] }),
3097
+ /* @__PURE__ */ jsx12("div", { className: "rf-grid rf-grid-cols-1 rf-gap-5 sm:rf-grid-cols-2 lg:rf-grid-cols-3", children: files.map((fileRef) => /* @__PURE__ */ jsxs10(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ onClick: () => onSelectFile(fileRef.filePath),
3102
+ className: "group rf-overflow-hidden rf-rounded-xl rf-border rf-border-zinc-200 rf-bg-white rf-text-left rf-shadow-sm rf-transition-all hover:rf--translate-y-0.5 hover:rf-border-zinc-300 hover:rf-shadow-md focus-visible:rf-outline-none focus-visible:rf-ring-2 focus-visible:rf-ring-zinc-900 focus-visible:rf-ring-offset-2",
3103
+ children: [
3104
+ /* @__PURE__ */ jsx12("div", { className: "rf-aspect-[4/3] rf-w-full rf-overflow-hidden rf-bg-white rf-p-3", children: /* @__PURE__ */ jsx12(CircuitGalleryPreviewImage, { fileRef }) }),
3105
+ /* @__PURE__ */ jsxs10("div", { className: "rf-border-t rf-border-zinc-100 rf-px-4 rf-py-3", children: [
3106
+ /* @__PURE__ */ jsx12("div", { className: "rf-truncate rf-text-sm rf-font-medium rf-text-zinc-900", children: getCircuitDisplayName(fileRef.filePath) }),
3107
+ /* @__PURE__ */ jsx12("div", { className: "rf-mt-0.5 rf-truncate rf-text-xs rf-text-zinc-500", children: fileRef.filePath })
3108
+ ] })
3109
+ ]
3110
+ },
3111
+ fileRef.filePath
3112
+ )) })
3113
+ ] }) });
3114
+ };
3115
+
3116
+ // lib/components/RunFrameStaticBuildViewer/RunFrameStaticBuildViewer.tsx
3117
+ import { LayoutGrid } from "lucide-react";
3118
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2977
3119
  var getErrorMessage = (error) => error instanceof Error ? error.message : "An unknown error occurred";
2978
3120
  var RunFrameStaticBuildViewer = (props) => {
2979
3121
  useStyles();
2980
- const { currentCircuitJsonPath, setCurrentCircuitJsonPath, updateFileHash } = useStaticCircuitJsonPathHash(props.initialCircuitPath);
2981
- const [circuitJson, setCircuitJson] = useState11(null);
2982
- const [isLoadingCurrentFile, setIsLoadingCurrentFile] = useState11(false);
2983
- const [fileCache, setFileCache] = useState11({});
2984
- const [loadingFiles, setLoadingFiles] = useState11(/* @__PURE__ */ new Set());
2985
- const [failedFiles, setFailedFiles] = useState11(/* @__PURE__ */ new Set());
3122
+ const {
3123
+ currentCircuitJsonPath,
3124
+ setCurrentCircuitJsonPath,
3125
+ updateFileHash,
3126
+ isGalleryVisible,
3127
+ showGallery,
3128
+ hideGallery
3129
+ } = useStaticCircuitJsonPathHash(
3130
+ props.initialCircuitPath,
3131
+ props.defaultToGallery
3132
+ );
3133
+ const [circuitJson, setCircuitJson] = useState12(null);
3134
+ const [isLoadingCurrentFile, setIsLoadingCurrentFile] = useState12(false);
3135
+ const [fileCache, setFileCache] = useState12({});
3136
+ const [loadingFiles, setLoadingFiles] = useState12(/* @__PURE__ */ new Set());
3137
+ const [failedFiles, setFailedFiles] = useState12(/* @__PURE__ */ new Set());
2986
3138
  const fileReferences = props.files;
2987
3139
  const availableFiles = fileReferences.map((f) => f.filePath);
2988
3140
  const defaultFetchFile = useCallback8(
@@ -3061,8 +3213,8 @@ var RunFrameStaticBuildViewer = (props) => {
3061
3213
  updateFileHash
3062
3214
  ]
3063
3215
  );
3064
- useEffect10(() => {
3065
- if (availableFiles.length === 0) return;
3216
+ useEffect11(() => {
3217
+ if (availableFiles.length === 0 || isGalleryVisible) return;
3066
3218
  let selectedPath = currentCircuitJsonPath;
3067
3219
  if (!selectedPath || !availableFiles.includes(selectedPath)) {
3068
3220
  selectedPath = guessEntrypoint(availableFiles) ?? availableFiles[0];
@@ -3071,10 +3223,14 @@ var RunFrameStaticBuildViewer = (props) => {
3071
3223
  if (selectedPath && availableFiles.includes(selectedPath)) {
3072
3224
  loadCircuitJsonFile(selectedPath);
3073
3225
  }
3074
- }, [currentCircuitJsonPath]);
3075
- const handleFileChange = useCallback8((newPath) => {
3076
- setCurrentCircuitJsonPath(newPath);
3077
- }, []);
3226
+ }, [currentCircuitJsonPath, isGalleryVisible]);
3227
+ const handleFileChange = useCallback8(
3228
+ (newPath) => {
3229
+ hideGallery();
3230
+ setCurrentCircuitJsonPath(newPath);
3231
+ },
3232
+ [hideGallery]
3233
+ );
3078
3234
  const retryFailedFile = useCallback8(
3079
3235
  (filePath) => {
3080
3236
  setFailedFiles((prev) => {
@@ -3087,22 +3243,55 @@ var RunFrameStaticBuildViewer = (props) => {
3087
3243
  [loadCircuitJsonFile]
3088
3244
  );
3089
3245
  if (availableFiles.length === 0) {
3090
- return /* @__PURE__ */ jsx12("div", { className: "rf-flex rf-flex-col rf-w-full rf-h-full rf-items-center rf-justify-center", children: /* @__PURE__ */ jsxs10("div", { className: "rf-text-center rf-p-8", children: [
3091
- /* @__PURE__ */ jsx12("h3", { className: "rf-text-lg rf-font-semibold rf-text-gray-800 rf-mb-2", children: "No Circuit JSON Files Found" }),
3092
- /* @__PURE__ */ jsx12("p", { className: "rf-text-sm rf-text-gray-600", children: "Please provide circuit JSON files to view." })
3246
+ return /* @__PURE__ */ jsx13("div", { className: "rf-flex rf-flex-col rf-w-full rf-h-full rf-items-center rf-justify-center", children: /* @__PURE__ */ jsxs11("div", { className: "rf-text-center rf-p-8", children: [
3247
+ /* @__PURE__ */ jsx13("h3", { className: "rf-text-lg rf-font-semibold rf-text-gray-800 rf-mb-2", children: "No Circuit JSON Files Found" }),
3248
+ /* @__PURE__ */ jsx13("p", { className: "rf-text-sm rf-text-gray-600", children: "Please provide circuit JSON files to view." })
3093
3249
  ] }) });
3094
3250
  }
3251
+ if (isGalleryVisible) {
3252
+ return /* @__PURE__ */ jsx13(
3253
+ CircuitGallery,
3254
+ {
3255
+ files: fileReferences,
3256
+ projectName: props.projectName,
3257
+ onSelectFile: handleFileChange,
3258
+ onClose: hideGallery
3259
+ }
3260
+ );
3261
+ }
3262
+ const fileNavigation = availableFiles.length > 1 ? /* @__PURE__ */ jsxs11(Fragment5, { children: [
3263
+ /* @__PURE__ */ jsx13(
3264
+ CircuitJsonFileSelectorCombobox,
3265
+ {
3266
+ currentFile: currentCircuitJsonPath,
3267
+ files: availableFiles,
3268
+ onFileChange: handleFileChange
3269
+ }
3270
+ ),
3271
+ /* @__PURE__ */ jsx13(
3272
+ Button,
3273
+ {
3274
+ type: "button",
3275
+ variant: "outline",
3276
+ size: "icon",
3277
+ onClick: showGallery,
3278
+ "aria-label": `Browse all ${availableFiles.length} circuits as a gallery`,
3279
+ title: "Open circuit gallery",
3280
+ children: /* @__PURE__ */ jsx13(LayoutGrid, { className: "rf-h-4 rf-w-4" })
3281
+ }
3282
+ )
3283
+ ] }) : null;
3095
3284
  const currentFileFailed = failedFiles.has(currentCircuitJsonPath);
3096
- return /* @__PURE__ */ jsx12(
3285
+ return /* @__PURE__ */ jsx13(
3097
3286
  ErrorBoundary2,
3098
3287
  {
3099
- fallbackRender: ({ error }) => /* @__PURE__ */ jsx12("div", { className: "rf-mt-4 rf-mx-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200", children: /* @__PURE__ */ jsxs10("div", { className: "rf-p-4", children: [
3100
- /* @__PURE__ */ jsx12("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3", children: "Error loading Circuit JSON Preview" }),
3101
- /* @__PURE__ */ jsx12("p", { className: "rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2", children: getErrorMessage(error) })
3288
+ fallbackRender: ({ error }) => /* @__PURE__ */ jsx13("div", { className: "rf-mt-4 rf-mx-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200", children: /* @__PURE__ */ jsxs11("div", { className: "rf-p-4", children: [
3289
+ /* @__PURE__ */ jsx13("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3", children: "Error loading Circuit JSON Preview" }),
3290
+ /* @__PURE__ */ jsx13("p", { className: "rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2", children: getErrorMessage(error) })
3102
3291
  ] }) }),
3103
- children: currentFileFailed ? /* @__PURE__ */ jsxs10("div", { className: "rf-w-full rf-h-full rf-flex rf-flex-col", children: [
3104
- /* @__PURE__ */ jsxs10("div", { className: "rf-flex rf-items-center rf-justify-between rf-w-full rf-p-4 rf-border-b rf-border-gray-200", children: [
3105
- (props.showFileMenu ?? true) && /* @__PURE__ */ jsx12(
3292
+ children: currentFileFailed ? /* @__PURE__ */ jsxs11("div", { className: "rf-w-full rf-h-full rf-flex rf-flex-col", children: [
3293
+ /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-justify-between rf-w-full rf-p-4 rf-border-b rf-border-gray-200", children: [
3294
+ (props.showFileMenu ?? true) && /* @__PURE__ */ jsx13(
3106
3295
  FileMenuLeftHeader,
3107
3296
  {
3108
3297
  isWebEmbedded: true,
@@ -3110,23 +3299,16 @@ var RunFrameStaticBuildViewer = (props) => {
3110
3299
  projectName: props.projectName
3111
3300
  }
3112
3301
  ),
3113
- availableFiles.length > 1 && /* @__PURE__ */ jsx12("div", { className: "rf-absolute rf-left-1/2 rf-transform rf--translate-x-1/2 rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx12(
3114
- CircuitJsonFileSelectorCombobox,
3115
- {
3116
- currentFile: currentCircuitJsonPath,
3117
- files: availableFiles,
3118
- onFileChange: handleFileChange
3119
- }
3120
- ) })
3302
+ availableFiles.length > 1 && /* @__PURE__ */ jsx13("div", { className: "rf-absolute rf-left-1/2 rf-transform rf--translate-x-1/2 rf-flex rf-items-center rf-gap-2", children: fileNavigation })
3121
3303
  ] }),
3122
- /* @__PURE__ */ jsx12("div", { className: "rf-flex-1 rf-flex rf-items-center rf-justify-center", children: /* @__PURE__ */ jsxs10("div", { className: "rf-text-center rf-p-8", children: [
3123
- /* @__PURE__ */ jsx12("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-600 rf-mb-2", children: "Failed to Load Circuit File" }),
3124
- /* @__PURE__ */ jsxs10("p", { className: "rf-text-sm rf-text-gray-600 rf-mb-4", children: [
3304
+ /* @__PURE__ */ jsx13("div", { className: "rf-flex-1 rf-flex rf-items-center rf-justify-center", children: /* @__PURE__ */ jsxs11("div", { className: "rf-text-center rf-p-8", children: [
3305
+ /* @__PURE__ */ jsx13("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-600 rf-mb-2", children: "Failed to Load Circuit File" }),
3306
+ /* @__PURE__ */ jsxs11("p", { className: "rf-text-sm rf-text-gray-600 rf-mb-4", children: [
3125
3307
  "Could not load: ",
3126
3308
  currentCircuitJsonPath
3127
3309
  ] }),
3128
- /* @__PURE__ */ jsxs10("div", { className: "rf-flex rf-flex-col rf-items-center rf-gap-2", children: [
3129
- /* @__PURE__ */ jsx12(
3310
+ /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-flex-col rf-items-center rf-gap-2", children: [
3311
+ /* @__PURE__ */ jsx13(
3130
3312
  "button",
3131
3313
  {
3132
3314
  onClick: () => retryFailedFile(currentCircuitJsonPath),
@@ -3134,10 +3316,10 @@ var RunFrameStaticBuildViewer = (props) => {
3134
3316
  children: "Retry"
3135
3317
  }
3136
3318
  ),
3137
- availableFiles.length > 1 && /* @__PURE__ */ jsx12("p", { className: "rf-text-xs rf-text-gray-500", children: "Or select a different file from the dropdown above" })
3319
+ availableFiles.length > 1 && /* @__PURE__ */ jsx13("p", { className: "rf-text-xs rf-text-gray-500", children: "Or select a different file from the dropdown above" })
3138
3320
  ] })
3139
3321
  ] }) })
3140
- ] }) : /* @__PURE__ */ jsx12(
3322
+ ] }) : /* @__PURE__ */ jsx13(
3141
3323
  CircuitJsonPreview,
3142
3324
  {
3143
3325
  circuitJson,
@@ -3147,8 +3329,8 @@ var RunFrameStaticBuildViewer = (props) => {
3147
3329
  isWebEmbedded: false,
3148
3330
  projectName: props.projectName,
3149
3331
  defaultActiveTab: props.tabSelected,
3150
- leftHeaderContent: /* @__PURE__ */ jsxs10("div", { className: "rf-flex rf-items-center rf-justify-between rf-w-full", children: [
3151
- (props.showFileMenu ?? true) && /* @__PURE__ */ jsx12(
3332
+ leftHeaderContent: /* @__PURE__ */ jsxs11("div", { className: "rf-flex rf-items-center rf-justify-between rf-w-full", children: [
3333
+ (props.showFileMenu ?? true) && /* @__PURE__ */ jsx13(
3152
3334
  FileMenuLeftHeader,
3153
3335
  {
3154
3336
  isWebEmbedded: true,
@@ -3156,18 +3338,11 @@ var RunFrameStaticBuildViewer = (props) => {
3156
3338
  projectName: props.projectName
3157
3339
  }
3158
3340
  ),
3159
- availableFiles.length > 1 && /* @__PURE__ */ jsx12(
3341
+ availableFiles.length > 1 && /* @__PURE__ */ jsx13(
3160
3342
  "div",
3161
3343
  {
3162
3344
  className: `rf-absolute rf-left-1/2 rf-transform rf--translate-x-1/2 rf-flex rf-items-center rf-gap-2 ${isLoadingCurrentFile ? "rf-opacity-50" : ""}`,
3163
- children: /* @__PURE__ */ jsx12(
3164
- CircuitJsonFileSelectorCombobox,
3165
- {
3166
- currentFile: currentCircuitJsonPath,
3167
- files: availableFiles,
3168
- onFileChange: handleFileChange
3169
- }
3170
- )
3345
+ children: fileNavigation
3171
3346
  }
3172
3347
  )
3173
3348
  ] })
@@ -3179,6 +3354,7 @@ var RunFrameStaticBuildViewer = (props) => {
3179
3354
  export {
3180
3355
  BomTable,
3181
3356
  CadViewer,
3357
+ CircuitGallery,
3182
3358
  CircuitJsonFileSelectorCombobox,
3183
3359
  CircuitJsonPreview,
3184
3360
  ExportAccessoryDialog,
@@ -3192,6 +3368,7 @@ export {
3192
3368
  RunFrameStaticBuildViewer,
3193
3369
  RunFrameWithApi,
3194
3370
  SchematicViewer,
3371
+ getCircuitPreviewImageUrls,
3195
3372
  guessEntrypoint,
3196
3373
  guessManualEditsFilePath,
3197
3374
  mapJLCComponentToSearchResult,