schematic-symbols 0.0.7 → 0.0.9
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.
- package/dist/index.cjs +1697 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +79 -0
- package/package.json +9 -2
- package/symbols/diode_horz.ts +18 -0
- package/symbols/diode_vert.ts +4 -0
- package/symbols/index.ts +4 -0
- package/.github/CODEOWNERS +0 -1
- package/.github/workflows/bun-formatcheck.yml +0 -26
- package/.github/workflows/bun-pver-release.yml +0 -27
- package/.github/workflows/bun-typecheck.yml +0 -26
- package/.github/workflows/formatbot.yml +0 -49
- package/assets/symbols-svg-json/boxresistor.json +0 -90
- package/assets/symbols-svg-json/capacitor.json +0 -76
- package/assets/symbols-svg-json/capacitor_polarized.json +0 -83
- package/assets/symbols-svg-json/diode.json +0 -91
- package/assets/symbols-svg-json/diode_bipolar_zener.json +0 -166
- package/assets/symbols-svg-json/diode_schottky.json +0 -76
- package/assets/symbols-svg-json/diode_zener.json +0 -31
- package/assets/symbols-svg-json/fuse.json +0 -84
- package/assets/symbols-svg-json/led.json +0 -205
- package/assets/symbols-svg-json/mosfet_depletion_normally_on.json +0 -267
- package/assets/symbols-svg-json/potentiometer.json +0 -137
- package/assets/symbols-svg-json/potentiometer2.json +0 -160
- package/assets/symbols-svg-json/testshape.json +0 -35
- package/assets/symbols-svg-json/varistor.json +0 -129
- package/assets/symbols.svg +0 -965
- package/biome.json +0 -44
- package/bun.lockb +0 -0
- package/dev-server.ts +0 -22
- package/scripts/build.ts +0 -18
- package/scripts/convertToObjectWithOrderedPositionIds.ts +0 -52
- package/scripts/generate-symbols-from-asset-svgs.ts +0 -146
- package/scripts/lib/applyGroupTransformsToChildren.ts +0 -119
- package/scripts/lib/findInnerText.ts +0 -11
- package/scripts/lib/generate-web-page.ts +0 -60
- package/scripts/lib/getTsFileContentForSvgGroup.ts +0 -33
- package/scripts/lib/serializeSvgPathCommands.ts +0 -48
- package/tests/assets/boxresistor-untransformed.json +0 -187
- package/tests/assets/testshape-untransformed.json +0 -25
- package/tests/normalize-svg.test.ts +0 -29
- package/tsconfig.json +0 -28
@@ -1,187 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "g",
|
3
|
-
"type": "element",
|
4
|
-
"value": "",
|
5
|
-
"parent": null,
|
6
|
-
"attributes": {
|
7
|
-
"id": "boxresistor",
|
8
|
-
"transform": "rotate(90,-72.654678,2.0374476)",
|
9
|
-
"inkscape:label": "boxresistor"
|
10
|
-
},
|
11
|
-
"children": [
|
12
|
-
{
|
13
|
-
"name": "title",
|
14
|
-
"type": "element",
|
15
|
-
"value": "",
|
16
|
-
"parent": null,
|
17
|
-
"attributes": {
|
18
|
-
"id": "title1"
|
19
|
-
},
|
20
|
-
"children": [
|
21
|
-
{
|
22
|
-
"name": "",
|
23
|
-
"type": "text",
|
24
|
-
"value": "Resistor",
|
25
|
-
"parent": null,
|
26
|
-
"attributes": {},
|
27
|
-
"children": []
|
28
|
-
}
|
29
|
-
]
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"name": "path",
|
33
|
-
"type": "element",
|
34
|
-
"value": "",
|
35
|
-
"parent": null,
|
36
|
-
"attributes": {
|
37
|
-
"style": "fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1",
|
38
|
-
"d": "M 30.427082,-90.614597 V -93.26043",
|
39
|
-
"id": "path1",
|
40
|
-
"inkscape:connector-curvature": "0"
|
41
|
-
},
|
42
|
-
"children": []
|
43
|
-
},
|
44
|
-
{
|
45
|
-
"name": "path",
|
46
|
-
"type": "element",
|
47
|
-
"value": "",
|
48
|
-
"parent": null,
|
49
|
-
"attributes": {
|
50
|
-
"style": "fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1",
|
51
|
-
"d": "m 30.427082,-98.552096 v -2.645834",
|
52
|
-
"id": "path2",
|
53
|
-
"inkscape:connector-curvature": "0"
|
54
|
-
},
|
55
|
-
"children": []
|
56
|
-
},
|
57
|
-
{
|
58
|
-
"name": "path",
|
59
|
-
"type": "element",
|
60
|
-
"value": "",
|
61
|
-
"parent": null,
|
62
|
-
"attributes": {
|
63
|
-
"style": "fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1",
|
64
|
-
"d": "m 29.104165,-95.906262 v -2.645833 h 2.645834 v 5.291667 h -2.645834 v -2.645834",
|
65
|
-
"id": "path3",
|
66
|
-
"inkscape:connector-curvature": "0"
|
67
|
-
},
|
68
|
-
"children": []
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"name": "text",
|
72
|
-
"type": "element",
|
73
|
-
"value": "",
|
74
|
-
"parent": null,
|
75
|
-
"attributes": {
|
76
|
-
"xml:space": "preserve",
|
77
|
-
"style": "font-size:1.41111px;text-align:center;text-anchor:middle;fill:#000000;stroke-width:0.264583",
|
78
|
-
"x": "95.718857",
|
79
|
-
"y": "28.388716",
|
80
|
-
"id": "text14-0-6",
|
81
|
-
"transform": "rotate(-90)"
|
82
|
-
},
|
83
|
-
"children": [
|
84
|
-
{
|
85
|
-
"name": "tspan",
|
86
|
-
"type": "element",
|
87
|
-
"value": "",
|
88
|
-
"parent": null,
|
89
|
-
"attributes": {
|
90
|
-
"sodipodi:role": "line",
|
91
|
-
"id": "tspan14-0-1",
|
92
|
-
"style": "font-size:1.41111px;text-align:center;text-anchor:middle;stroke-width:0.264583",
|
93
|
-
"x": "95.718857",
|
94
|
-
"y": "28.388716"
|
95
|
-
},
|
96
|
-
"children": [
|
97
|
-
{
|
98
|
-
"name": "",
|
99
|
-
"type": "text",
|
100
|
-
"value": "{REF}",
|
101
|
-
"parent": null,
|
102
|
-
"attributes": {},
|
103
|
-
"children": []
|
104
|
-
}
|
105
|
-
]
|
106
|
-
}
|
107
|
-
]
|
108
|
-
},
|
109
|
-
{
|
110
|
-
"name": "text",
|
111
|
-
"type": "element",
|
112
|
-
"value": "",
|
113
|
-
"parent": null,
|
114
|
-
"attributes": {
|
115
|
-
"xml:space": "preserve",
|
116
|
-
"style": "font-size:1.41111px;text-align:center;text-anchor:middle;fill:#000000;stroke-width:0.264583",
|
117
|
-
"x": "95.728477",
|
118
|
-
"y": "33.388676",
|
119
|
-
"id": "text14-0-4-4",
|
120
|
-
"transform": "rotate(-90)"
|
121
|
-
},
|
122
|
-
"children": [
|
123
|
-
{
|
124
|
-
"name": "tspan",
|
125
|
-
"type": "element",
|
126
|
-
"value": "",
|
127
|
-
"parent": null,
|
128
|
-
"attributes": {
|
129
|
-
"sodipodi:role": "line",
|
130
|
-
"id": "tspan14-0-9-0",
|
131
|
-
"style": "font-size:1.41111px;text-align:center;text-anchor:middle;stroke-width:0.264583",
|
132
|
-
"x": "95.728477",
|
133
|
-
"y": "33.388676"
|
134
|
-
},
|
135
|
-
"children": [
|
136
|
-
{
|
137
|
-
"name": "",
|
138
|
-
"type": "text",
|
139
|
-
"value": "{VAL}",
|
140
|
-
"parent": null,
|
141
|
-
"attributes": {},
|
142
|
-
"children": []
|
143
|
-
}
|
144
|
-
]
|
145
|
-
}
|
146
|
-
]
|
147
|
-
},
|
148
|
-
{
|
149
|
-
"name": "title",
|
150
|
-
"type": "element",
|
151
|
-
"value": "",
|
152
|
-
"parent": null,
|
153
|
-
"attributes": {
|
154
|
-
"id": "title3"
|
155
|
-
},
|
156
|
-
"children": [
|
157
|
-
{
|
158
|
-
"name": "",
|
159
|
-
"type": "text",
|
160
|
-
"value": "Resistor",
|
161
|
-
"parent": null,
|
162
|
-
"attributes": {},
|
163
|
-
"children": []
|
164
|
-
}
|
165
|
-
]
|
166
|
-
},
|
167
|
-
{
|
168
|
-
"name": "title",
|
169
|
-
"type": "element",
|
170
|
-
"value": "",
|
171
|
-
"parent": null,
|
172
|
-
"attributes": {
|
173
|
-
"id": "title4"
|
174
|
-
},
|
175
|
-
"children": [
|
176
|
-
{
|
177
|
-
"name": "",
|
178
|
-
"type": "text",
|
179
|
-
"value": "Resistor",
|
180
|
-
"parent": null,
|
181
|
-
"attributes": {},
|
182
|
-
"children": []
|
183
|
-
}
|
184
|
-
]
|
185
|
-
}
|
186
|
-
]
|
187
|
-
}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "g",
|
3
|
-
"type": "element",
|
4
|
-
"value": "",
|
5
|
-
"parent": null,
|
6
|
-
"attributes": {
|
7
|
-
"id": "testshape",
|
8
|
-
"style": "fill:none;stroke:#000000;stroke-opacity:1",
|
9
|
-
"transform": "translate(0.45366488,0.38885561)"
|
10
|
-
},
|
11
|
-
"children": [
|
12
|
-
{
|
13
|
-
"name": "path",
|
14
|
-
"type": "element",
|
15
|
-
"value": "",
|
16
|
-
"parent": null,
|
17
|
-
"attributes": {
|
18
|
-
"style": "opacity:1;fill:none;stroke:#000000;stroke-width:0.264583;stroke-opacity:1",
|
19
|
-
"d": "m 21.331058,95.261238 1.282194,-3.817442 4.953934,0.582816",
|
20
|
-
"id": "path207"
|
21
|
-
},
|
22
|
-
"children": []
|
23
|
-
}
|
24
|
-
]
|
25
|
-
}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { expect, it } from "bun:test"
|
2
|
-
import { svgPathToPoints } from "drawing/svgPathToPoints"
|
3
|
-
import { getBoundsOfSvgJson } from "drawing/getBoundsOfSvgJson"
|
4
|
-
import testShapeSvgJson from "./assets/testshape-untransformed.json"
|
5
|
-
import boxResistorSvgJson from "./assets/boxresistor-untransformed.json"
|
6
|
-
import {
|
7
|
-
applyGroupTransformsToChildren,
|
8
|
-
transformPath,
|
9
|
-
} from "../scripts/lib/applyGroupTransformsToChildren"
|
10
|
-
import { identity, translate } from "transformation-matrix"
|
11
|
-
|
12
|
-
it("applies group transforms to children", () => {
|
13
|
-
const bounds1 = getBoundsOfSvgJson(testShapeSvgJson as any)
|
14
|
-
const result = applyGroupTransformsToChildren(testShapeSvgJson)
|
15
|
-
const bounds2 = getBoundsOfSvgJson(result as any)
|
16
|
-
expect(bounds2.centerX).not.toEqual(bounds1.centerX)
|
17
|
-
})
|
18
|
-
|
19
|
-
it("should transform V properly", () => {
|
20
|
-
const transformed = transformPath("M1,2 V3", translate(1, 2))
|
21
|
-
expect(transformed).toEqual("M2,4 L2,5")
|
22
|
-
})
|
23
|
-
|
24
|
-
it("should load V path directives properly", () => {
|
25
|
-
const result = applyGroupTransformsToChildren(boxResistorSvgJson as any)
|
26
|
-
expect(result.children[1].attributes.d).toEqual(
|
27
|
-
"M19.997366600000007,105.11920759999998 L22.643199600000003,105.11920759999998",
|
28
|
-
)
|
29
|
-
})
|
package/tsconfig.json
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
// Enable latest features
|
4
|
-
"lib": ["ESNext", "DOM"],
|
5
|
-
"target": "ESNext",
|
6
|
-
"module": "ESNext",
|
7
|
-
"moduleDetection": "force",
|
8
|
-
"jsx": "react-jsx",
|
9
|
-
"allowJs": true,
|
10
|
-
"baseUrl": ".",
|
11
|
-
|
12
|
-
// Bundler mode
|
13
|
-
"moduleResolution": "bundler",
|
14
|
-
"allowImportingTsExtensions": true,
|
15
|
-
"verbatimModuleSyntax": false,
|
16
|
-
"noEmit": true,
|
17
|
-
|
18
|
-
// Best practices
|
19
|
-
"strict": true,
|
20
|
-
"skipLibCheck": true,
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
22
|
-
|
23
|
-
// Some stricter flags (disabled by default)
|
24
|
-
"noUnusedLocals": false,
|
25
|
-
"noUnusedParameters": false,
|
26
|
-
"noPropertyAccessFromIndexSignature": false
|
27
|
-
}
|
28
|
-
}
|