diff --git a/bun.lock b/bun.lock index 3462142..d512a36 100644 --- a/bun.lock +++ b/bun.lock @@ -21,7 +21,7 @@ "@docusaurus/module-type-aliases": "3.8.1", "@docusaurus/tsconfig": "3.8.1", "@docusaurus/types": "3.8.1", - "@tscircuit/create-snippet-url": "^0.0.12", + "@tscircuit/create-snippet-url": "^0.0.13", "@tscircuit/footprinter": "^0.0.135", "@tscircuit/math-utils": "^0.0.18", "@twind/core": "^1.1.3", @@ -619,7 +619,7 @@ "@trysound/sax": ["@trysound/sax@0.2.0", "", {}, "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA=="], - "@tscircuit/create-snippet-url": ["@tscircuit/create-snippet-url@0.0.12", "", { "dependencies": { "fflate": "^0.8.2" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-dOBs/rv53Gz2y6swurLKbF25kUmz9KPzDAndjBh+lmmWSs6QRs63OubIk7HYBagsdgwKvOhHDceSl4ByTmTAZQ=="], + "@tscircuit/create-snippet-url": ["@tscircuit/create-snippet-url@0.0.13", "", { "dependencies": { "fflate": "^0.8.2" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-F1BUIzGFR4h3pPKa3UqshYEXeMuv7uCbBG4JSz3FJByGTRwcbcgHAq9GPQSEibBujVWIbY/5gf1kcVO5GyJvmA=="], "@tscircuit/footprinter": ["@tscircuit/footprinter@0.0.135", "", { "dependencies": { "@tscircuit/mm": "^0.0.8", "zod": "^3.23.8" }, "peerDependencies": { "circuit-json": "*" } }, "sha512-+8MasMGTNQL/NINnlWk2v6zw/NDerfdIBG3uqhrTr0r7VOHh4lK1ymTkQR7IeoypkxTIHYGB9wHbOt39XAF3mg=="], diff --git a/docs/footprints/smtpad.mdx b/docs/footprints/smtpad.mdx index 0cc5e8b..3a94f34 100644 --- a/docs/footprints/smtpad.mdx +++ b/docs/footprints/smtpad.mdx @@ -119,4 +119,66 @@ Here’s an example of using a **polygon smtpad** ) `} +/> + +## Example: Capacitive Touch Sensor + + + ( + + + + + + + } + /> + + ) + `} /> \ No newline at end of file diff --git a/package.json b/package.json index 9fcabb2..675a4d6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@docusaurus/module-type-aliases": "3.8.1", "@docusaurus/tsconfig": "3.8.1", "@docusaurus/types": "3.8.1", - "@tscircuit/create-snippet-url": "^0.0.12", + "@tscircuit/create-snippet-url": "^0.0.13", "@tscircuit/footprinter": "^0.0.135", "@tscircuit/math-utils": "^0.0.18", "@twind/core": "^1.1.3", diff --git a/src/components/CircuitPreview.tsx b/src/components/CircuitPreview.tsx index 7f29fe2..a71ba6a 100644 --- a/src/components/CircuitPreview.tsx +++ b/src/components/CircuitPreview.tsx @@ -88,6 +88,7 @@ export default function CircuitPreview({ projectBaseUrl = "https://docs.tscircuit.com/", leftView, rightView, + showSolderMask, showSimulationGraph = false, }: { code?: string @@ -107,6 +108,7 @@ export default function CircuitPreview({ leftView?: "code" | "pcb" | "schematic" | "3d" | "runframe" | "pinout" rightView?: "code" | "pcb" | "schematic" | "3d" | "runframe" | "pinout" projectBaseUrl?: string + showSolderMask?: boolean showSimulationGraph?: boolean }) { const { isDarkTheme } = useColorMode() @@ -143,9 +145,13 @@ export default function CircuitPreview({ const fsMapOrCode = hasMultipleFiles ? fsMap || code : code || Object.values(fsMap ?? {})[0] + const pcbUrl = useMemo(() => { + if (showSolderMask) { + return createSvgUrl(fsMapOrCode, "pcb", { showSolderMask: true }) + } + return createSvgUrl(fsMapOrCode, "pcb") + }, [fsMapOrCode, showSolderMask]) - const pcbUrl = useMemo(() => createSvgUrl(fsMapOrCode, "pcb"), [fsMapOrCode]) - console.log(fsMapOrCode) const schUrl = useMemo( () => createSvgUrl(fsMapOrCode, showSimulationGraph ? "schsim" : "schematic", {