fritzkit 0.0.0-stage → 0.1.0

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.
Files changed (328) hide show
  1. package/.claude-plugin/marketplace.json +12 -0
  2. package/.claude-plugin/plugin.json +13 -0
  3. package/CHANGELOG.md +8 -0
  4. package/LICENSE +21 -0
  5. package/README.md +429 -2
  6. package/dist/cli/commands/doctor.d.ts +4 -0
  7. package/dist/cli/commands/doctor.js +7 -0
  8. package/dist/cli/commands/doctor.js.map +1 -0
  9. package/dist/cli/commands/export.d.ts +17 -0
  10. package/dist/cli/commands/export.js +81 -0
  11. package/dist/cli/commands/export.js.map +1 -0
  12. package/dist/cli/commands/kicad.d.ts +10 -0
  13. package/dist/cli/commands/kicad.js +22 -0
  14. package/dist/cli/commands/kicad.js.map +1 -0
  15. package/dist/cli/commands/parts.d.ts +22 -0
  16. package/dist/cli/commands/parts.js +46 -0
  17. package/dist/cli/commands/parts.js.map +1 -0
  18. package/dist/cli/commands/prune.d.ts +14 -0
  19. package/dist/cli/commands/prune.js +67 -0
  20. package/dist/cli/commands/prune.js.map +1 -0
  21. package/dist/cli/commands/render.d.ts +24 -0
  22. package/dist/cli/commands/render.js +62 -0
  23. package/dist/cli/commands/render.js.map +1 -0
  24. package/dist/cli/commands/schema.d.ts +10 -0
  25. package/dist/cli/commands/schema.js +35 -0
  26. package/dist/cli/commands/schema.js.map +1 -0
  27. package/dist/cli/commands/ui.d.ts +14 -0
  28. package/dist/cli/commands/ui.js +67 -0
  29. package/dist/cli/commands/ui.js.map +1 -0
  30. package/dist/cli/commands/validate.d.ts +24 -0
  31. package/dist/cli/commands/validate.js +91 -0
  32. package/dist/cli/commands/validate.js.map +1 -0
  33. package/dist/cli/context.d.ts +81 -0
  34. package/dist/cli/context.js +139 -0
  35. package/dist/cli/context.js.map +1 -0
  36. package/dist/cli/main.d.ts +2 -0
  37. package/dist/cli/main.js +8 -0
  38. package/dist/cli/main.js.map +1 -0
  39. package/dist/cli/program.d.ts +21 -0
  40. package/dist/cli/program.js +158 -0
  41. package/dist/cli/program.js.map +1 -0
  42. package/dist/cli/raster.d.ts +4 -0
  43. package/dist/cli/raster.js +9 -0
  44. package/dist/cli/raster.js.map +1 -0
  45. package/dist/core/compile/breadboard-util.d.ts +12 -0
  46. package/dist/core/compile/breadboard-util.js +107 -0
  47. package/dist/core/compile/breadboard-util.js.map +1 -0
  48. package/dist/core/compile/breadboard.d.ts +60 -0
  49. package/dist/core/compile/breadboard.js +513 -0
  50. package/dist/core/compile/breadboard.js.map +1 -0
  51. package/dist/core/compile/fzp.d.ts +12 -0
  52. package/dist/core/compile/fzp.js +183 -0
  53. package/dist/core/compile/fzp.js.map +1 -0
  54. package/dist/core/compile/icon.d.ts +17 -0
  55. package/dist/core/compile/icon.js +27 -0
  56. package/dist/core/compile/icon.js.map +1 -0
  57. package/dist/core/compile/index.d.ts +4 -0
  58. package/dist/core/compile/index.js +62 -0
  59. package/dist/core/compile/index.js.map +1 -0
  60. package/dist/core/compile/pcb.d.ts +39 -0
  61. package/dist/core/compile/pcb.js +164 -0
  62. package/dist/core/compile/pcb.js.map +1 -0
  63. package/dist/core/compile/schematic.d.ts +69 -0
  64. package/dist/core/compile/schematic.js +240 -0
  65. package/dist/core/compile/schematic.js.map +1 -0
  66. package/dist/core/compile/style.d.ts +52 -0
  67. package/dist/core/compile/style.js +72 -0
  68. package/dist/core/compile/style.js.map +1 -0
  69. package/dist/core/compile/types.d.ts +50 -0
  70. package/dist/core/compile/types.js +15 -0
  71. package/dist/core/compile/types.js.map +1 -0
  72. package/dist/core/export/bin.d.ts +61 -0
  73. package/dist/core/export/bin.js +221 -0
  74. package/dist/core/export/bin.js.map +1 -0
  75. package/dist/core/export/fzpz.d.ts +37 -0
  76. package/dist/core/export/fzpz.js +121 -0
  77. package/dist/core/export/fzpz.js.map +1 -0
  78. package/dist/core/export/index.d.ts +5 -0
  79. package/dist/core/export/index.js +6 -0
  80. package/dist/core/export/index.js.map +1 -0
  81. package/dist/core/export/install.d.ts +77 -0
  82. package/dist/core/export/install.js +183 -0
  83. package/dist/core/export/install.js.map +1 -0
  84. package/dist/core/export/prune.d.ts +72 -0
  85. package/dist/core/export/prune.js +165 -0
  86. package/dist/core/export/prune.js.map +1 -0
  87. package/dist/core/fritzing.d.ts +22 -0
  88. package/dist/core/fritzing.js +77 -0
  89. package/dist/core/fritzing.js.map +1 -0
  90. package/dist/core/identity.d.ts +29 -0
  91. package/dist/core/identity.js +70 -0
  92. package/dist/core/identity.js.map +1 -0
  93. package/dist/core/image/bbox.d.ts +27 -0
  94. package/dist/core/image/bbox.js +24 -0
  95. package/dist/core/image/bbox.js.map +1 -0
  96. package/dist/core/image/index.d.ts +8 -0
  97. package/dist/core/image/index.js +9 -0
  98. package/dist/core/image/index.js.map +1 -0
  99. package/dist/core/image/key.d.ts +72 -0
  100. package/dist/core/image/key.js +317 -0
  101. package/dist/core/image/key.js.map +1 -0
  102. package/dist/core/image/prepare.d.ts +31 -0
  103. package/dist/core/image/prepare.js +98 -0
  104. package/dist/core/image/prepare.js.map +1 -0
  105. package/dist/core/image/remover.d.ts +17 -0
  106. package/dist/core/image/remover.js +51 -0
  107. package/dist/core/image/remover.js.map +1 -0
  108. package/dist/core/index.d.ts +16 -0
  109. package/dist/core/index.js +17 -0
  110. package/dist/core/index.js.map +1 -0
  111. package/dist/core/kicad/footprint.d.ts +104 -0
  112. package/dist/core/kicad/footprint.js +317 -0
  113. package/dist/core/kicad/footprint.js.map +1 -0
  114. package/dist/core/kicad/index.d.ts +25 -0
  115. package/dist/core/kicad/index.js +197 -0
  116. package/dist/core/kicad/index.js.map +1 -0
  117. package/dist/core/kicad/sexpr.d.ts +35 -0
  118. package/dist/core/kicad/sexpr.js +163 -0
  119. package/dist/core/kicad/sexpr.js.map +1 -0
  120. package/dist/core/resolve.d.ts +113 -0
  121. package/dist/core/resolve.js +301 -0
  122. package/dist/core/resolve.js.map +1 -0
  123. package/dist/core/schema/part.d.ts +995 -0
  124. package/dist/core/schema/part.js +278 -0
  125. package/dist/core/schema/part.js.map +1 -0
  126. package/dist/core/schema/part.schema.json +1122 -0
  127. package/dist/core/svg.d.ts +20 -0
  128. package/dist/core/svg.js +56 -0
  129. package/dist/core/svg.js.map +1 -0
  130. package/dist/core/units.d.ts +28 -0
  131. package/dist/core/units.js +42 -0
  132. package/dist/core/units.js.map +1 -0
  133. package/dist/core/validate/checker.d.ts +46 -0
  134. package/dist/core/validate/checker.js +142 -0
  135. package/dist/core/validate/checker.js.map +1 -0
  136. package/dist/core/validate/doctor.d.ts +25 -0
  137. package/dist/core/validate/doctor.js +156 -0
  138. package/dist/core/validate/doctor.js.map +1 -0
  139. package/dist/core/validate/explain.d.ts +10 -0
  140. package/dist/core/validate/explain.js +135 -0
  141. package/dist/core/validate/explain.js.map +1 -0
  142. package/dist/core/validate/index.d.ts +21 -0
  143. package/dist/core/validate/index.js +96 -0
  144. package/dist/core/validate/index.js.map +1 -0
  145. package/dist/core/validate/structural.d.ts +74 -0
  146. package/dist/core/validate/structural.js +664 -0
  147. package/dist/core/validate/structural.js.map +1 -0
  148. package/dist/core/workspace.d.ts +69 -0
  149. package/dist/core/workspace.js +213 -0
  150. package/dist/core/workspace.js.map +1 -0
  151. package/dist/mcp/jsonpatch.d.ts +30 -0
  152. package/dist/mcp/jsonpatch.js +145 -0
  153. package/dist/mcp/jsonpatch.js.map +1 -0
  154. package/dist/mcp/main.d.ts +2 -0
  155. package/dist/mcp/main.js +5 -0
  156. package/dist/mcp/main.js.map +1 -0
  157. package/dist/mcp/server.d.ts +28 -0
  158. package/dist/mcp/server.js +310 -0
  159. package/dist/mcp/server.js.map +1 -0
  160. package/dist/server/api.d.ts +72 -0
  161. package/dist/server/api.js +507 -0
  162. package/dist/server/api.js.map +1 -0
  163. package/dist/server/events.d.ts +28 -0
  164. package/dist/server/events.js +134 -0
  165. package/dist/server/events.js.map +1 -0
  166. package/dist/server/http.d.ts +36 -0
  167. package/dist/server/http.js +127 -0
  168. package/dist/server/http.js.map +1 -0
  169. package/dist/server/index.d.ts +65 -0
  170. package/dist/server/index.js +193 -0
  171. package/dist/server/index.js.map +1 -0
  172. package/dist/ui/assets/index-DLU8opyI.js +63 -0
  173. package/dist/ui/assets/index-GhUA-T3b.css +1 -0
  174. package/dist/ui/index.html +14 -0
  175. package/package.json +89 -4
  176. package/skills/fritzkit/SKILL.md +690 -0
  177. package/skills/fritzkit/reference/examples.md +275 -0
  178. package/skills/fritzkit/reference/part-json.md +333 -0
  179. package/skills/fritzkit/scripts/measure.py +197 -0
  180. package/tools/fzp-checker/.python-version +1 -0
  181. package/tools/fzp-checker/README.md +45 -0
  182. package/tools/fzp-checker/check_fzp.py +48 -0
  183. package/tools/fzp-checker/pyproject.toml +26 -0
  184. package/tools/fzp-checker/uv.lock +266 -0
  185. package/tools/fzp-checker/vendor/LICENSE.txt +8 -0
  186. package/tools/fzp-checker/vendor/UPSTREAM.md +25 -0
  187. package/tools/fzp-checker/vendor/fzp_checker.py +14 -0
  188. package/tools/fzp-checker/vendor/scripts/checks/__init__.py +26 -0
  189. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/__init__.cpython-313.pyc +0 -0
  190. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/check_missing_leg_ids.cpython-313.pyc +0 -0
  191. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/connector_numbering.cpython-313.pyc +0 -0
  192. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/fzp_checker_runner.cpython-313.pyc +0 -0
  193. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/fzp_checkers.cpython-313.pyc +0 -0
  194. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/fzp_svg_checkers.cpython-313.pyc +0 -0
  195. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/fzp_utils.cpython-313.pyc +0 -0
  196. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/svg_checkers.cpython-313.pyc +0 -0
  197. package/tools/fzp-checker/vendor/scripts/checks/__pycache__/svg_utils.cpython-313.pyc +0 -0
  198. package/tools/fzp-checker/vendor/scripts/checks/check_missing_leg_ids.py +44 -0
  199. package/tools/fzp-checker/vendor/scripts/checks/checkascii.py +27 -0
  200. package/tools/fzp-checker/vendor/scripts/checks/checkcase.py +156 -0
  201. package/tools/fzp-checker/vendor/scripts/checks/checkcopies.py +104 -0
  202. package/tools/fzp-checker/vendor/scripts/checks/connector_numbering.py +79 -0
  203. package/tools/fzp-checker/vendor/scripts/checks/connectors_misnumbered.py +228 -0
  204. package/tools/fzp-checker/vendor/scripts/checks/explain_errors.md +95 -0
  205. package/tools/fzp-checker/vendor/scripts/checks/fzp_checker_runner.py +717 -0
  206. package/tools/fzp-checker/vendor/scripts/checks/fzp_checkers.py +1069 -0
  207. package/tools/fzp-checker/vendor/scripts/checks/fzp_svg_checkers.py +62 -0
  208. package/tools/fzp-checker/vendor/scripts/checks/fzp_utils.py +222 -0
  209. package/tools/fzp-checker/vendor/scripts/checks/inspector_fc51.png +0 -0
  210. package/tools/fzp-checker/vendor/scripts/checks/invisibleconnectors.py +118 -0
  211. package/tools/fzp-checker/vendor/scripts/checks/nolayeridcheck.txt +758 -0
  212. package/tools/fzp-checker/vendor/scripts/checks/requirements.txt +3 -0
  213. package/tools/fzp-checker/vendor/scripts/checks/svg_checkers.py +953 -0
  214. package/tools/fzp-checker/vendor/scripts/checks/svg_utils.py +96 -0
  215. package/tools/fzp-checker/vendor/scripts/checks/test_checkers.py +839 -0
  216. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/author_missing.fzp.test +3 -0
  217. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/author_present.fzp.test +4 -0
  218. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/buses_missing_id.fzp.test +8 -0
  219. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/buses_missing_node_members.fzp.test +7 -0
  220. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/buses_present_valid.fzp.test +8 -0
  221. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/connector_layers_missing_attributes.fzp.test +16 -0
  222. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/connector_layers_present_valid.fzp.test +14 -0
  223. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/connector_numbering_invalid.fzp.test +70 -0
  224. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/connector_numbering_valid.fzp.test +70 -0
  225. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/connector_refs_valid.fzp.test +53 -0
  226. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_invalid_mixed.fzp.test +11 -0
  227. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_invalid_silkscreen_nested.fzp.test +11 -0
  228. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_invalid_style_attr.fzp.test +11 -0
  229. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_invalid_white_stroke.fzp.test +11 -0
  230. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_invalid_wrong_color.fzp.test +11 -0
  231. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_inherited.fzp.test +11 -0
  232. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_legacy.fzp.test +12 -0
  233. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_nested_copper.fzp.test +12 -0
  234. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_none.fzp.test +11 -0
  235. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_standard.fzp.test +12 -0
  236. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/copper_color_valid_uppercase.fzp.test +11 -0
  237. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/css_connector.fzp.test +100 -0
  238. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/description_missing.fzp.test +3 -0
  239. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/description_present.fzp.test +4 -0
  240. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/duplicate_ids.fzp.test +27 -0
  241. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/family_property_missing.fzp.test +6 -0
  242. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/family_property_present_valid.fzp.test +6 -0
  243. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/font_size.fzp.test +46 -0
  244. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/fritzing_version_invalid_format.fzp.test +4 -0
  245. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/fritzing_version_missing.fzp.test +4 -0
  246. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/fritzing_version_present_valid.fzp.test +4 -0
  247. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/gorn_absent.fzp.test +15 -0
  248. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/gorn_present.fzp.test +15 -0
  249. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/hybrid_connectors.fzp.test +232 -0
  250. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/invalid_xml.fzp.test +12 -0
  251. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/layer_ids_match.fzp.test +29 -0
  252. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/layer_ids_mismatch.fzp.test +30 -0
  253. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/layer_nesting_invalid.fzp.test +11 -0
  254. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/layer_nesting_valid.fzp.test +11 -0
  255. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/matrix_transform.fzp.test +8 -0
  256. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/missing_connector_refs.fzp.test +63 -0
  257. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/missing_leg_ids.fzp.test +34 -0
  258. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_missing.fzp.test +4 -0
  259. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_non_alnum.fzp.test +4 -0
  260. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_present.fzp.test +4 -0
  261. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_special_chars_absent.fzp.test +4 -0
  262. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_special_chars_present.fzp.test +4 -0
  263. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/module_id_too_short.fzp.test +4 -0
  264. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/no_layer_invalid.fzp.test +19 -0
  265. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/no_layer_namedview.fzp.test +19 -0
  266. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/no_layer_valid.fzp.test +19 -0
  267. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/pcb_only.fzp.test +48 -0
  268. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/property_fields_missing_name.fzp.test +6 -0
  269. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/property_fields_missing_value.fzp.test +6 -0
  270. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/property_fields_present.fzp.test +6 -0
  271. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/required_tags_missing.fzp.test +3 -0
  272. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/required_tags_present.fzp.test +11 -0
  273. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/stroke_test.fzp.test +60 -0
  274. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/template_svgs.fzp.test +35 -0
  275. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/title_missing.fzp.test +3 -0
  276. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/title_present.fzp.test +4 -0
  277. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/unique_ids.fzp.test +27 -0
  278. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/unique_property_names_duplicates.fzp.test +7 -0
  279. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/unique_property_names_unique.fzp.test +7 -0
  280. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/valid_xml.fzp.test +249 -0
  281. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/version_invalid_format.fzp.test +4 -0
  282. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/version_missing.fzp.test +3 -0
  283. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/version_present_valid.fzp.test +4 -0
  284. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/views_missing.fzp.test +3 -0
  285. package/tools/fzp-checker/vendor/scripts/checks/test_data/core/views_present.fzp.test +8 -0
  286. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/connector_refs_valid_breadboard.svg +7 -0
  287. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/duplicate_ids_breadboard.svg +13 -0
  288. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/gorn_absent_breadboard.svg +7 -0
  289. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/gorn_present_breadboard.svg +7 -0
  290. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/hybrid_connectors_breadboard.svg +102 -0
  291. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/layer_nesting_invalid.svg +13 -0
  292. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/layer_nesting_valid.svg +13 -0
  293. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/matrix_transform.svg +11 -0
  294. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/missing_connector_refs_breadboard.svg +8 -0
  295. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/missing_leg_ids_breadboard.svg +9 -0
  296. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/test_layer_ids_match_breadboard.svg +9 -0
  297. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/test_layer_ids_mismatch_breadboard.svg +9 -0
  298. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/breadboard/unique_ids_breadboard.svg +13 -0
  299. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/icon/hybrid_connectors_icon.svg +78 -0
  300. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/icon/no_layer_invalid.svg +4 -0
  301. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/icon/no_layer_namedview.svg +9 -0
  302. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/icon/no_layer_valid.svg +7 -0
  303. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/icon/plain_pcb.svg +10 -0
  304. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/connector_refs_valid_pcb.svg +10 -0
  305. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_invalid_mixed.svg +8 -0
  306. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_invalid_silkscreen_nested.svg +10 -0
  307. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_invalid_style_attr.svg +6 -0
  308. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_invalid_white_stroke.svg +6 -0
  309. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_invalid_wrong_color.svg +6 -0
  310. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_inherited.svg +7 -0
  311. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_legacy.svg +10 -0
  312. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_nested_copper.svg +9 -0
  313. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_none.svg +7 -0
  314. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_standard.svg +10 -0
  315. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/copper_color_valid_uppercase.svg +7 -0
  316. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/css_connector.svg +25 -0
  317. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/font_size.svg +54 -0
  318. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/hybrid_connectors_pcb.svg +35 -0
  319. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/missing_connector_refs_pcb.svg +14 -0
  320. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/pcb-arduino-shield.svg +25 -0
  321. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/stroke_test.svg +12 -0
  322. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/test_layer_ids_match_pcb.svg +12 -0
  323. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/pcb/test_layer_ids_mismatch_pcb.svg +12 -0
  324. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/schematic/connector_refs_valid_schematic.svg +7 -0
  325. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/schematic/hybrid_connectors_schematic.svg +59 -0
  326. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/schematic/missing_connector_refs_schematic.svg +8 -0
  327. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/schematic/test_layer_ids_match_schematic.svg +6 -0
  328. package/tools/fzp-checker/vendor/scripts/checks/test_data/svg/core/schematic/test_layer_ids_mismatch_schematic.svg +6 -0
@@ -0,0 +1,240 @@
1
+ import { el, FONT_SANS, svgRoot, text } from "../svg.js";
2
+ import { milToMm } from "../units.js";
3
+ import { STYLE } from "./style.js";
4
+ const SIDE_ORDER = ["left", "right", "top", "bottom"];
5
+ /** Default side for each role. Nothing goes on top unless spec.schematic.sides says so. */
6
+ export const DEFAULT_SIDES = {
7
+ power: "left",
8
+ usb: "left",
9
+ enable: "left",
10
+ reset: "left",
11
+ io: "right",
12
+ analog: "right",
13
+ pwm: "right",
14
+ i2c: "right",
15
+ spi: "right",
16
+ uart: "right",
17
+ clock: "right",
18
+ other: "right",
19
+ nc: "right",
20
+ gnd: "bottom",
21
+ };
22
+ const S = STYLE.schematic;
23
+ const GRID = S.gridMil;
24
+ const PIN_LEN = S.pinLengthMil;
25
+ /** Gap between the body edge and the start of a pin label. */
26
+ const LABEL_INSET = 25;
27
+ /** Minimum horizontal gap between the longest left label and the longest right label. */
28
+ const LABEL_GAP = 60;
29
+ const MIN_W_CELLS = 6;
30
+ const MIN_H_CELLS = 3;
31
+ const TITLE_MAX_CHARS = 16;
32
+ /** Baseline shift (x font size) that vertically centres Noto Sans caps on a coordinate. */
33
+ const BASELINE_SHIFT = 0.35;
34
+ /**
35
+ * Width estimate for a run of Noto Sans text: 0.6 x font size per character. Used to
36
+ * size the body so labels never overflow; generous for a proportional font.
37
+ */
38
+ export function estimateTextWidthMil(s, fontSizeMil) {
39
+ return s.length * fontSizeMil * 0.6;
40
+ }
41
+ const ceilGrid = (v) => Math.ceil(v / GRID - 1e-9) * GRID;
42
+ /**
43
+ * Role -> side map after applying spec.schematic.sides. A role listed on a side goes
44
+ * there (sides are applied in the order left, right, top, bottom, so a role listed on
45
+ * two sides ends up on the later one); unlisted roles keep DEFAULT_SIDES.
46
+ */
47
+ export function sideMap(overrides) {
48
+ const map = { ...DEFAULT_SIDES };
49
+ if (overrides) {
50
+ for (const side of SIDE_ORDER)
51
+ for (const role of overrides[side] ?? [])
52
+ map[role] = side;
53
+ }
54
+ return map;
55
+ }
56
+ /**
57
+ * Pick the title: spec.title if it fits maxWidth, else properties.mpn when it is short
58
+ * (<= 16 chars), else the first 16 chars + "..." (only when that is actually shorter
59
+ * than the title; a title of up to 19 chars is kept whole). needsWidth is the width the
60
+ * chosen short form needs (the body grows to fit it); 0 when the full title fits.
61
+ */
62
+ export function chooseTitle(title, mpn, maxWidth) {
63
+ const fs = S.titleFontSizeMil;
64
+ if (estimateTextWidthMil(title, fs) <= maxWidth)
65
+ return { text: title, needsWidth: 0 };
66
+ let short;
67
+ if (mpn && mpn.length <= TITLE_MAX_CHARS)
68
+ short = mpn;
69
+ else
70
+ short = title.length > TITLE_MAX_CHARS + 3 ? `${title.slice(0, TITLE_MAX_CHARS)}...` : title;
71
+ return { text: short, needsWidth: estimateTextWidthMil(short, fs) };
72
+ }
73
+ /** Compute the whole symbol geometry (mils). Pure; exported for tests. */
74
+ export function layoutSchematic(part) {
75
+ const map = sideMap(part.spec.schematic.sides);
76
+ const bySide = { left: [], right: [], top: [], bottom: [] };
77
+ for (const c of part.connectors)
78
+ bySide[map[c.role]].push(c);
79
+ const L = bySide.left.length;
80
+ const R = bySide.right.length;
81
+ const T = bySide.top.length;
82
+ const B = bySide.bottom.length;
83
+ const fs = S.fontSizeMil;
84
+ const maxW = (cs) => cs.reduce((m, c) => Math.max(m, estimateTextWidthMil(c.label || c.name, fs)), 0);
85
+ const maxL = maxW(bySide.left);
86
+ const maxR = maxW(bySide.right);
87
+ // Width: labels of both sides + gap, top/bottom pin counts, the minimum, then the title.
88
+ let w = Math.max(MIN_W_CELLS * GRID, (T + 1) * GRID, (B + 1) * GRID, ceilGrid((L ? LABEL_INSET + maxL : 0) + (R ? LABEL_INSET + maxR : 0) + (L && R ? LABEL_GAP : 0)));
89
+ const title = chooseTitle(part.spec.title, part.spec.properties["mpn"], w - 2 * LABEL_INSET);
90
+ w = Math.max(w, ceilGrid(title.needsWidth + 2 * LABEL_INSET));
91
+ // Height: vertical bands so the rotated top/bottom labels (inside the body) and the
92
+ // title never collide with the left/right label rows. With no top or bottom pins this
93
+ // is the plain (rows + 1) cells.
94
+ const topExt = T ? LABEL_INSET + maxW(bySide.top) : 0;
95
+ const botExt = B ? LABEL_INSET + maxW(bySide.bottom) : 0;
96
+ const tfs = S.titleFontSizeMil;
97
+ const titleBaseline = topExt + 15 + Math.round(tfs * 0.75);
98
+ const titleBottom = titleBaseline + Math.round(tfs * 0.25);
99
+ const n = Math.max(L, R);
100
+ let h;
101
+ let firstRow = GRID;
102
+ if (n > 0) {
103
+ firstRow = Math.max(GRID, ceilGrid(titleBottom + 0.4 * fs + 4));
104
+ const lastRow = firstRow + (n - 1) * GRID;
105
+ const bottomGap = Math.max(GRID, ceilGrid(botExt + 0.6 * fs + 4));
106
+ h = Math.max(MIN_H_CELLS * GRID, lastRow + bottomGap);
107
+ }
108
+ else {
109
+ h = Math.max(MIN_H_CELLS * GRID, ceilGrid(titleBottom + 10 + botExt));
110
+ }
111
+ const bx = L ? PIN_LEN : 0;
112
+ const by = T ? PIN_LEN : 0;
113
+ const widthMil = bx + w + (R ? PIN_LEN : 0);
114
+ const heightMil = by + h + (B ? PIN_LEN : 0);
115
+ const pins = [];
116
+ bySide.left.forEach((c, i) => {
117
+ const y = by + firstRow + i * GRID;
118
+ pins.push({ connector: c, side: "left", x1: bx, y1: y, x2: bx - PIN_LEN, y2: y });
119
+ });
120
+ bySide.right.forEach((c, i) => {
121
+ const y = by + firstRow + i * GRID;
122
+ pins.push({ connector: c, side: "right", x1: bx + w, y1: y, x2: bx + w + PIN_LEN, y2: y });
123
+ });
124
+ bySide.top.forEach((c, i) => {
125
+ const x = bx + (i + 1) * GRID;
126
+ pins.push({ connector: c, side: "top", x1: x, y1: by, x2: x, y2: by - PIN_LEN });
127
+ });
128
+ bySide.bottom.forEach((c, i) => {
129
+ const x = bx + (i + 1) * GRID;
130
+ pins.push({ connector: c, side: "bottom", x1: x, y1: by + h, x2: x, y2: by + h + PIN_LEN });
131
+ });
132
+ return {
133
+ widthMil,
134
+ heightMil,
135
+ body: { x: bx, y: by, w, h },
136
+ title: { text: title.text, x: bx + w / 2, y: by + titleBaseline },
137
+ pins,
138
+ };
139
+ }
140
+ function pinLabel(p) {
141
+ const fs = S.fontSizeMil;
142
+ const shift = Math.round(fs * BASELINE_SHIFT * 10) / 10;
143
+ const common = { "font-family": FONT_SANS, "font-size": fs, fill: S.body };
144
+ const label = p.connector.label || p.connector.name;
145
+ switch (p.side) {
146
+ case "left":
147
+ return text(label, {
148
+ x: p.x1 + LABEL_INSET,
149
+ y: p.y1 + shift,
150
+ ...common,
151
+ "text-anchor": "start",
152
+ });
153
+ case "right":
154
+ return text(label, {
155
+ x: p.x1 - LABEL_INSET,
156
+ y: p.y1 + shift,
157
+ ...common,
158
+ "text-anchor": "end",
159
+ });
160
+ case "bottom": {
161
+ // rotate(-90): the text runs upward from just inside the bottom edge.
162
+ const x = p.x1 + shift;
163
+ const y = p.y1 - LABEL_INSET;
164
+ return text(label, {
165
+ x,
166
+ y,
167
+ ...common,
168
+ "text-anchor": "start",
169
+ transform: `rotate(-90 ${x} ${y})`,
170
+ });
171
+ }
172
+ case "top": {
173
+ // rotate(-90) with anchor end: the text ends just inside the top edge.
174
+ const x = p.x1 + shift;
175
+ const y = p.y1 + LABEL_INSET;
176
+ return text(label, {
177
+ x,
178
+ y,
179
+ ...common,
180
+ "text-anchor": "end",
181
+ transform: `rotate(-90 ${x} ${y})`,
182
+ });
183
+ }
184
+ }
185
+ }
186
+ export function renderSchematic(part, _ctx) {
187
+ const lay = layoutSchematic(part);
188
+ const t = STYLE.terminalSizeMil;
189
+ // A body edge with no pins lies on the canvas edge; inset it by half the stroke so the
190
+ // stroke is not clipped to half width (Fritzing core symbols do the same). Edges with
191
+ // pins stay on the grid so the pins meet them.
192
+ const hs = S.bodyStrokeMil / 2;
193
+ const has = (side) => lay.pins.some((p) => p.side === side);
194
+ const x0 = lay.body.x + (has("left") ? 0 : hs);
195
+ const y0 = lay.body.y + (has("top") ? 0 : hs);
196
+ const x1 = lay.body.x + lay.body.w - (has("right") ? 0 : hs);
197
+ const y1 = lay.body.y + lay.body.h - (has("bottom") ? 0 : hs);
198
+ const items = [
199
+ el("rect", {
200
+ x: x0,
201
+ y: y0,
202
+ width: x1 - x0,
203
+ height: y1 - y0,
204
+ fill: S.bodyFill,
205
+ stroke: S.body,
206
+ "stroke-width": S.bodyStrokeMil,
207
+ }),
208
+ text(lay.title.text, {
209
+ x: lay.title.x,
210
+ y: lay.title.y,
211
+ "font-family": FONT_SANS,
212
+ "font-size": S.titleFontSizeMil,
213
+ fill: S.body,
214
+ "text-anchor": "middle",
215
+ }),
216
+ ];
217
+ for (const p of lay.pins) {
218
+ const c = p.connector;
219
+ items.push(el("line", {
220
+ id: c.svgId,
221
+ x1: p.x1,
222
+ y1: p.y1,
223
+ x2: p.x2,
224
+ y2: p.y2,
225
+ stroke: S.pin,
226
+ "stroke-width": S.pinStrokeMil,
227
+ }), el("rect", {
228
+ id: c.terminalId,
229
+ x: p.x2 - t / 2,
230
+ y: p.y2 - t / 2,
231
+ width: t,
232
+ height: t,
233
+ fill: S.pin,
234
+ stroke: "none",
235
+ }), pinLabel(p));
236
+ }
237
+ const group = ` <g id="schematic">\n${items.map((l) => ` ${l}`).join("\n")}\n </g>`;
238
+ return svgRoot(milToMm(lay.widthMil), milToMm(lay.heightMil), [group]);
239
+ }
240
+ //# sourceMappingURL=schematic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schematic.js","sourceRoot":"","sources":["../../../src/core/compile/schematic.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC,MAAM,UAAU,GAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAEvE,2FAA2F;AAC3F,MAAM,CAAC,MAAM,aAAa,GAAoC;IAC5D,KAAK,EAAE,MAAM;IACb,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,EAAE,EAAE,OAAO;IACX,MAAM,EAAE,OAAO;IACf,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ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AAE,CAAC,CAAC,UAAU;YAChB,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;YACf,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC;YACf,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC,CAAC,GAAG;YACX,MAAM,EAAE,MAAM;SACf,CAAC,EACF,QAAQ,CAAC,CAAC,CAAC,CACZ,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,yBAAyB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;IACzF,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Fritzing house style (graphic standards + core templates). Keep every colour and
3
+ * dimension here so the renderers stay consistent and a style change is one edit.
4
+ * Dimensions in mils unless the name says Mm.
5
+ */
6
+ export declare const STYLE: {
7
+ readonly legColor: "#8C8C8C";
8
+ readonly legWidthMil: 30;
9
+ readonly contactColor: "#9A916C";
10
+ readonly padHoleColor: "#000000";
11
+ readonly labelColor: "#E6E6E6";
12
+ readonly labelFontSizeMil: 50;
13
+ readonly silkFontSizeMil: 45;
14
+ readonly male: {
15
+ readonly body: "#404040";
16
+ readonly pinSquare: "#8D8C8C";
17
+ readonly center: "#8C8663";
18
+ readonly bevelTop: "#B8AF82";
19
+ readonly bevelRight: "#80795B";
20
+ readonly bevelBottom: "#5E5B43";
21
+ readonly bevelLeft: "#9A916C";
22
+ };
23
+ readonly female: {
24
+ readonly body: "#404040";
25
+ readonly hole: "#000000";
26
+ readonly bevelTop: "#2A2A29";
27
+ readonly bevelRight: "#474747";
28
+ readonly bevelBottom: "#595959";
29
+ readonly bevelLeft: "#373737";
30
+ };
31
+ readonly schematic: {
32
+ readonly body: "#000000";
33
+ readonly bodyFill: "#FFFFFF";
34
+ readonly bodyStrokeMil: 9.7;
35
+ readonly pin: "#555555";
36
+ readonly pinStrokeMil: 9.7;
37
+ readonly pinLengthMil: 100;
38
+ readonly fontSizeMil: 49;
39
+ readonly titleFontSizeMil: 59;
40
+ readonly gridMil: 100;
41
+ };
42
+ readonly pcb: {
43
+ readonly copper: "#F7BD13";
44
+ readonly silkscreen: "#000000";
45
+ readonly silkStrokeMil: 8;
46
+ readonly minRingMil: 20;
47
+ readonly minHoleMil: 40;
48
+ };
49
+ readonly terminalSizeMil: 1;
50
+ };
51
+ /** Default pin colours by role for the vector style breadboard pin labels. */
52
+ export declare const ROLE_COLORS: Record<string, string>;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Fritzing house style (graphic standards + core templates). Keep every colour and
3
+ * dimension here so the renderers stay consistent and a style change is one edit.
4
+ * Dimensions in mils unless the name says Mm.
5
+ */
6
+ export const STYLE = {
7
+ // Breadboard view
8
+ legColor: "#8C8C8C",
9
+ legWidthMil: 30,
10
+ contactColor: "#9A916C",
11
+ padHoleColor: "#000000",
12
+ labelColor: "#E6E6E6",
13
+ labelFontSizeMil: 50, // ~5 pt at 1 mil units (Fritzing labels are 5 pt light grey)
14
+ silkFontSizeMil: 45,
15
+ male: {
16
+ body: "#404040",
17
+ pinSquare: "#8D8C8C",
18
+ center: "#8C8663",
19
+ bevelTop: "#B8AF82",
20
+ bevelRight: "#80795B",
21
+ bevelBottom: "#5E5B43",
22
+ bevelLeft: "#9A916C",
23
+ },
24
+ female: {
25
+ body: "#404040",
26
+ hole: "#000000",
27
+ bevelTop: "#2A2A29",
28
+ bevelRight: "#474747",
29
+ bevelBottom: "#595959",
30
+ bevelLeft: "#373737",
31
+ },
32
+ // Schematic view
33
+ schematic: {
34
+ body: "#000000",
35
+ bodyFill: "#FFFFFF",
36
+ bodyStrokeMil: 9.7,
37
+ pin: "#555555",
38
+ pinStrokeMil: 9.7,
39
+ pinLengthMil: 100,
40
+ fontSizeMil: 49, // pin labels
41
+ titleFontSizeMil: 59,
42
+ gridMil: 100,
43
+ },
44
+ // PCB view
45
+ pcb: {
46
+ copper: "#F7BD13",
47
+ silkscreen: "#000000",
48
+ silkStrokeMil: 8,
49
+ minRingMil: 20,
50
+ minHoleMil: 40,
51
+ },
52
+ // Terminal rect (must have non-zero size or Fritzing ignores it)
53
+ terminalSizeMil: 1,
54
+ };
55
+ /** Default pin colours by role for the vector style breadboard pin labels. */
56
+ export const ROLE_COLORS = {
57
+ power: "#F2A6A1",
58
+ gnd: "#E6E6E6",
59
+ io: "#E6E6E6",
60
+ analog: "#E6E6E6",
61
+ pwm: "#E6E6E6",
62
+ i2c: "#E6E6E6",
63
+ spi: "#E6E6E6",
64
+ uart: "#E6E6E6",
65
+ usb: "#E6E6E6",
66
+ clock: "#E6E6E6",
67
+ reset: "#E6E6E6",
68
+ enable: "#E6E6E6",
69
+ nc: "#777777",
70
+ other: "#E6E6E6",
71
+ };
72
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/core/compile/style.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,kBAAkB;IAClB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,SAAS;IACrB,gBAAgB,EAAE,EAAE,EAAE,6DAA6D;IACnF,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,SAAS;QACnB,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,SAAS;KACrB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,SAAS;QACnB,UAAU,EAAE,SAAS;QACrB,WAAW,EAAE,SAAS;QACtB,SAAS,EAAE,SAAS;KACrB;IACD,iBAAiB;IACjB,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,SAAS;QACnB,aAAa,EAAE,GAAG;QAClB,GAAG,EAAE,SAAS;QACd,YAAY,EAAE,GAAG;QACjB,YAAY,EAAE,GAAG;QACjB,WAAW,EAAE,EAAE,EAAE,aAAa;QAC9B,gBAAgB,EAAE,EAAE;QACpB,OAAO,EAAE,GAAG;KACb;IACD,WAAW;IACX,GAAG,EAAE;QACH,MAAM,EAAE,SAAS;QACjB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;KACf;IACD,iEAAiE;IACjE,eAAe,EAAE,CAAC;CACV,CAAC;AAEX,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,EAAE,EAAE,SAAS;IACb,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,EAAE,EAAE,SAAS;IACb,KAAK,EAAE,SAAS;CACjB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Contracts between the compile orchestrator and the four view renderers plus the fzp
3
+ * builder. Renderers are pure: (ResolvedPart, RenderContext) -> SVG string.
4
+ */
5
+ import type { PartIdentity } from "../identity.js";
6
+ import type { ResolvedPart } from "../resolve.js";
7
+ export type View = "breadboard" | "schematic" | "pcb" | "icon";
8
+ export declare const VIEWS: readonly View[];
9
+ /** A raster prepared by the image module for the photo artwork style. */
10
+ export interface PreparedPhoto {
11
+ /** PNG bytes, already cropped/rotated/keyed, sized to cover the outline. */
12
+ png: Uint8Array;
13
+ widthPx: number;
14
+ heightPx: number;
15
+ /** Opacity to draw it with (from spec.artwork.photo.opacity). */
16
+ opacity: number;
17
+ }
18
+ export interface RenderContext {
19
+ identity: PartIdentity;
20
+ /** Present only when artwork.style is "photo" and the asset could be prepared. */
21
+ photo?: PreparedPhoto;
22
+ /** ISO date YYYY-MM-DD written into the fzp (fixed in tests for determinism). */
23
+ date: string;
24
+ /** fritzkit version string for the fzp <author>/<description> footer. */
25
+ generator: string;
26
+ }
27
+ export type ViewRenderer = (part: ResolvedPart, ctx: RenderContext) => string;
28
+ export interface CompiledPart {
29
+ identity: PartIdentity;
30
+ resolved: ResolvedPart;
31
+ fzp: string;
32
+ svgs: Record<View, string>;
33
+ /** Flat zip entries in the order they are written. */
34
+ entries: {
35
+ name: string;
36
+ data: Uint8Array;
37
+ }[];
38
+ /** Notes for the user: e.g. "photo asset missing, fell back to vector". */
39
+ warnings: string[];
40
+ }
41
+ export interface CompileOptions {
42
+ date?: string;
43
+ generator?: string;
44
+ /** Assets referenced by the spec (photo). Keyed by the spec-relative path. */
45
+ assets?: Map<string, Uint8Array>;
46
+ /** Hook that turns the photo asset into a PreparedPhoto (async, uses sharp). */
47
+ preparePhoto?: (data: Uint8Array, spec: ResolvedPart["spec"]) => Promise<PreparedPhoto | undefined>;
48
+ }
49
+ /** Layer ids each view lists in the fzp. */
50
+ export declare function layerIdsFor(view: View, hasTht: boolean): string[];
@@ -0,0 +1,15 @@
1
+ export const VIEWS = ["breadboard", "schematic", "pcb", "icon"];
2
+ /** Layer ids each view lists in the fzp. */
3
+ export function layerIdsFor(view, hasTht) {
4
+ switch (view) {
5
+ case "breadboard":
6
+ return ["breadboard"];
7
+ case "schematic":
8
+ return ["schematic"];
9
+ case "pcb":
10
+ return hasTht ? ["copper0", "copper1", "silkscreen"] : ["copper1", "silkscreen"];
11
+ case "icon":
12
+ return ["icon"];
13
+ }
14
+ }
15
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/compile/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,KAAK,GAAoB,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AA+C1F,4CAA4C;AAC5C,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,MAAe;IACrD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,YAAY;YACf,OAAO,CAAC,YAAY,CAAC,CAAC;QACxB,KAAK,WAAW;YACd,OAAO,CAAC,WAAW,CAAC,CAAC;QACvB,KAAK,KAAK;YACR,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QACnF,KAAK,MAAM;YACT,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -0,0 +1,61 @@
1
+ export interface BinInstance {
2
+ moduleIdRef: string;
3
+ modelIndex: number;
4
+ path: string;
5
+ }
6
+ export interface BinDocument {
7
+ xml: string;
8
+ instances: BinInstance[];
9
+ }
10
+ /**
11
+ * The minimal My Parts bin, byte for byte what Fritzing 1.0.7 ships on a fresh profile
12
+ * (CRLF, no BOM, note the space before `>` in the module tag).
13
+ */
14
+ export declare const EMPTY_MY_PARTS_BIN: string;
15
+ /** Lowest modelIndex handed out when the bin has no instances yet. */
16
+ export declare const FIRST_MODEL_INDEX = 100000;
17
+ /** How many `<bin>.bak-*` files to keep next to the bin. */
18
+ export declare const MAX_BIN_BACKUPS = 10;
19
+ /** Parse the `<instance>` elements of a bin document (in file order). */
20
+ export declare function parseBinInstances(xml: string): BinInstance[];
21
+ /** Read a bin file; a missing or empty file yields the minimal My Parts document. */
22
+ export declare function readBin(path: string): Promise<BinDocument>;
23
+ /** Next modelIndex: greater than every existing one, FIRST_MODEL_INDEX at minimum. */
24
+ export declare function nextModelIndex(xml: string): number;
25
+ /**
26
+ * The exact XML of one instance. The first line carries no indent (the caller places
27
+ * it); the following lines are indented with baseIndent (+ indentUnit for `<views/>`).
28
+ */
29
+ export declare function binInstanceXml(inst: BinInstance, indentUnit?: string, baseIndent?: string, eol?: string): string;
30
+ /**
31
+ * Append an instance just before `</instances>`, keeping the file's line endings and
32
+ * indentation. Returns the xml unchanged when moduleIdRef is already present. A missing
33
+ * modelIndex becomes nextModelIndex(xml).
34
+ */
35
+ export declare function addBinInstance(xml: string, inst: {
36
+ moduleIdRef: string;
37
+ path: string;
38
+ modelIndex?: number;
39
+ }): string;
40
+ /**
41
+ * Remove every instance for which predicate is true, together with its indentation and
42
+ * the line break before it. An instances element left holding only whitespace collapses
43
+ * to `<instances></instances>` (the shape of a fresh bin).
44
+ */
45
+ export declare function removeBinInstances(xml: string, predicate: (i: BinInstance) => boolean): string;
46
+ /**
47
+ * Copy the bin to `<bin>.bak-YYYYMMDD-HHMMSS` (local time; `-N` suffix on a clash) and
48
+ * delete all but the MAX_BIN_BACKUPS newest backups. Returns undefined when there is no
49
+ * bin to back up yet.
50
+ */
51
+ export declare function backupBin(binPath: string, now?: () => Date): Promise<string | undefined>;
52
+ /** Write a file atomically: write `<path>.tmp-<pid>` next to it, then rename over it. */
53
+ export declare function writeFileAtomic(path: string, data: string | Uint8Array): Promise<void>;
54
+ /**
55
+ * Write new bin xml, backing the old file up first unless `backup` is false. Returns the
56
+ * backup path (undefined when no backup was taken or there was no old file).
57
+ */
58
+ export declare function writeBin(binPath: string, xml: string, opts?: {
59
+ backup?: boolean;
60
+ now?: () => Date;
61
+ }): Promise<string | undefined>;