@tscircuit/schematic-viewer 1.4.3 → 2.0.1

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 (98) hide show
  1. package/.github/workflows/bun-pver-release.yml +24 -0
  2. package/.github/workflows/{npm-typecheck.yml → bun-typecheck.yml} +6 -6
  3. package/LICENSE +21 -0
  4. package/README.md +16 -26
  5. package/biome.json +8 -1
  6. package/bun.lockb +0 -0
  7. package/cosmos.config.json +3 -0
  8. package/cosmos.decorator.tsx +3 -0
  9. package/examples/resistor-and-capacitor.fixture.tsx +14 -0
  10. package/index.html +12 -0
  11. package/lib/components/SchematicViewer.tsx +79 -0
  12. package/lib/dev/render-to-circuit-json.ts +7 -0
  13. package/lib/index.ts +1 -0
  14. package/package.json +27 -74
  15. package/src/main.tsx +20 -0
  16. package/test.ts +0 -0
  17. package/tsconfig.json +28 -25
  18. package/vite.config.js +12 -4
  19. package/.codesandbox/tasks.json +0 -36
  20. package/.github/workflows/chromatic.yml +0 -30
  21. package/.github/workflows/npm-build.yml +0 -26
  22. package/.github/workflows/release.yml +0 -29
  23. package/.prettierrc +0 -1
  24. package/.storybook/main.ts +0 -12
  25. package/.storybook/preview.ts +0 -17
  26. package/ava.config.js +0 -7
  27. package/dist/index.css +0 -7
  28. package/dist/index.css.map +0 -1
  29. package/dist/index.d.ts +0 -15
  30. package/dist/index.js +0 -2502
  31. package/dist/index.js.map +0 -1
  32. package/next-env.d.ts +0 -5
  33. package/parsel.d.ts +0 -81
  34. package/release.config.js +0 -15
  35. package/renovate.json +0 -17
  36. package/src/Schematic.tsx +0 -250
  37. package/src/index.ts +0 -1
  38. package/src/lib/hooks/index.ts +0 -1
  39. package/src/lib/hooks/use-maybe-promise.ts +0 -14
  40. package/src/lib/render-context/index.ts +0 -28
  41. package/src/lib/types/core.ts +0 -181
  42. package/src/lib/types/index.ts +0 -4
  43. package/src/lib/types/route-solver.ts +0 -10
  44. package/src/lib/types/source-component.ts +0 -73
  45. package/src/lib/types/util.ts +0 -52
  46. package/src/lib/utils/collect-element-refs.ts +0 -45
  47. package/src/lib/utils/colors.ts +0 -235
  48. package/src/lib/utils/direction-to-vec.ts +0 -50
  49. package/src/lib/utils/get-rotation-from-anchor-side.ts +0 -11
  50. package/src/lib/utils/get-svg-path-bounds.ts +0 -22
  51. package/src/lib/utils/get-vec-from-anchor-side.ts +0 -11
  52. package/src/lib/utils/point-math.ts +0 -26
  53. package/src/pages/_app.tsx +0 -23
  54. package/src/pages/index.tsx +0 -10
  55. package/src/pages/led-circuit-react.tsx +0 -54
  56. package/src/pages/style.css +0 -5
  57. package/src/schematic-components/ContextProviders.tsx +0 -15
  58. package/src/schematic-components/DebugPoint.tsx +0 -25
  59. package/src/schematic-components/RenderError.tsx +0 -23
  60. package/src/schematic-components/SVGPathComponent.tsx +0 -183
  61. package/src/schematic-components/SVGPathComponent2.tsx +0 -76
  62. package/src/schematic-components/SchematicChip.tsx +0 -202
  63. package/src/schematic-components/SchematicComponent.tsx +0 -51
  64. package/src/schematic-components/SchematicComponentFromSymbol.tsx +0 -46
  65. package/src/schematic-components/SchematicElement.tsx +0 -43
  66. package/src/schematic-components/SchematicGroup.tsx +0 -3
  67. package/src/schematic-components/SchematicNetLabel.tsx +0 -63
  68. package/src/schematic-components/SchematicText.tsx +0 -44
  69. package/src/schematic-components/SchematicTrace.tsx +0 -51
  70. package/src/schematic-components/TableViewer.tsx +0 -13
  71. package/src/schematic-components/index.tsx +0 -9
  72. package/src/stories/basics/schematic-net-label.stories.tsx +0 -138
  73. package/src/stories/basics/schematic-net-labels-2.stories.tsx +0 -35
  74. package/src/stories/bug-connections.stories.tsx +0 -31
  75. package/src/stories/bug-high-port-numbers.stories.tsx +0 -130
  76. package/src/stories/bug-one-sided.stories.tsx +0 -34
  77. package/src/stories/bug-pin-spacing.stories.tsx +0 -52
  78. package/src/stories/bugs/bug1-y-flip.stories.tsx +0 -20
  79. package/src/stories/bugs/bug2-component-bounds.stories.tsx +0 -62
  80. package/src/stories/bugs/bug3-scaling-trace.stories.tsx +0 -24
  81. package/src/stories/bugs/bug4-schematic-line.stories.tsx +0 -17
  82. package/src/stories/bugs/bug5-diode.stories.tsx +0 -16
  83. package/src/stories/bugs/bug6-trace-scaling.stories.tsx +0 -18
  84. package/src/stories/bugs/bug7-multiple-schematic-panning.stories.tsx +0 -23
  85. package/src/stories/bugs/bug8-autolayout.stories.tsx +0 -43
  86. package/src/stories/circuit-components/diode.stories.tsx +0 -16
  87. package/src/stories/circuit-components/netalias.stories.tsx +0 -14
  88. package/src/stories/circuit-components/resistor.stories.tsx +0 -16
  89. package/src/stories/component-drawing-example.stories.tsx +0 -17
  90. package/src/stories/led-circuit-react.stories.tsx +0 -48
  91. package/src/stories/net-alias.stories.tsx +0 -92
  92. package/src/stories/off-center-render.stories.tsx +0 -29
  93. package/src/stories/rotated-resistor.stories.tsx +0 -23
  94. package/src/stories/schematic-path.stories.tsx +0 -40
  95. package/src/stories/three-sided-bug.stories.tsx +0 -30
  96. package/tsconfig.tsbuildinfo +0 -1
  97. package/tsup.config.ts +0 -8
  98. package/vercel.json +0 -3
package/dist/index.css DELETED
@@ -1,7 +0,0 @@
1
- @import "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap";
2
-
3
- /* src/pages/style.css */
4
- .schematic-text {
5
- font-family: "IBM Plex Mono", monospace;
6
- }
7
- /*# sourceMappingURL=index.css.map */
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/pages/style.css"],"sourcesContent":["@import url(\"https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap\");\n\n.schematic-text {\n font-family: \"IBM Plex Mono\", monospace;\n}\n"],"mappings":";;;AAEA;AACE;AAAA;","names":[]}
package/dist/index.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { AnyCircuitElement } from 'circuit-json';
3
- import React from 'react';
4
-
5
- interface SchematicProps {
6
- children?: any;
7
- soup?: AnyCircuitElement[];
8
- style?: React.CSSProperties;
9
- showTable?: boolean;
10
- _soupPostProcessor?: (soup: AnyCircuitElement[]) => AnyCircuitElement[];
11
- }
12
- declare const Schematic: (props: SchematicProps) => react_jsx_runtime.JSX.Element;
13
- declare const SchematicWithoutContext: ({ children, soup, style, showTable, _soupPostProcessor, }: SchematicProps) => react_jsx_runtime.JSX.Element;
14
-
15
- export { Schematic, SchematicProps, SchematicWithoutContext };