@tscircuit/schematic-viewer 0.0.9 → 1.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.
- package/.github/workflows/release.yml +27 -0
- package/package.json +12 -6
- package/release.config.js +15 -0
- package/src/Schematic.tsx +14 -1
- package/src/pages/led-circuit-react.tsx +1 -1
- package/src/pages/led-circuit.tsx +2 -4
- package/tsconfig.json +1 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -2225
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout code
|
|
13
|
+
uses: actions/checkout@v3
|
|
14
|
+
|
|
15
|
+
- name: Setup Node.js
|
|
16
|
+
uses: actions/setup-node@v2
|
|
17
|
+
with:
|
|
18
|
+
node-version: 18
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: yarn install
|
|
22
|
+
|
|
23
|
+
- name: Semantic Release
|
|
24
|
+
env:
|
|
25
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
27
|
+
run: yarn semantic-release
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/schematic-viewer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
"yalc": "npm run build && yalc push"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
|
-
"@tscircuit/react-fiber": "
|
|
14
|
-
"react": "
|
|
13
|
+
"@tscircuit/react-fiber": "*",
|
|
14
|
+
"react": "*"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.18.9",
|
|
18
18
|
"@chakra-ui/react": "^2.2.4",
|
|
19
19
|
"@emotion/react": "^11",
|
|
20
20
|
"@emotion/styled": "^11",
|
|
21
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
22
|
+
"@semantic-release/commit-analyzer": "^10.0.1",
|
|
23
|
+
"@semantic-release/git": "^10.0.1",
|
|
24
|
+
"@semantic-release/github": "^9.0.3",
|
|
25
|
+
"@semantic-release/npm": "^10.0.4",
|
|
26
|
+
"@semantic-release/release-notes-generator": "^11.0.4",
|
|
21
27
|
"@storybook/addon-actions": "^6.5.9",
|
|
22
28
|
"@storybook/addon-essentials": "^6.5.9",
|
|
23
29
|
"@storybook/addon-interactions": "^6.5.9",
|
|
@@ -37,9 +43,9 @@
|
|
|
37
43
|
"parse-svg-path": "^0.1.2",
|
|
38
44
|
"react": "^18.2.0",
|
|
39
45
|
"react-dom": "^18.2.0",
|
|
40
|
-
"react-no-ssr": "^1.1.0",
|
|
41
46
|
"react-use-measure": "^2.1.1",
|
|
42
47
|
"rectilinear-router": "^1.0.1",
|
|
48
|
+
"semantic-release": "^21.0.6",
|
|
43
49
|
"svg-path-bounds": "^1.0.2",
|
|
44
50
|
"svg-path-generator": "^1.1.0",
|
|
45
51
|
"transformation-matrix": "^2.12.0",
|
|
@@ -49,8 +55,8 @@
|
|
|
49
55
|
"zustand": "^4.0.0"
|
|
50
56
|
},
|
|
51
57
|
"dependencies": {
|
|
52
|
-
"@tscircuit/builder": "^1.
|
|
53
|
-
"@tscircuit/react-fiber": "
|
|
58
|
+
"@tscircuit/builder": "^1.1.1",
|
|
59
|
+
"@tscircuit/react-fiber": "*",
|
|
54
60
|
"react-error-boundary": "^4.0.4",
|
|
55
61
|
"use-mouse-matrix-transform": "^1.0.2"
|
|
56
62
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
branches: ["main"], // change this to your default branch if not `main`
|
|
3
|
+
plugins: [
|
|
4
|
+
"@semantic-release/commit-analyzer",
|
|
5
|
+
"@semantic-release/release-notes-generator",
|
|
6
|
+
["@semantic-release/npm", { npmPublish: true }],
|
|
7
|
+
[
|
|
8
|
+
"@semantic-release/git",
|
|
9
|
+
{
|
|
10
|
+
assets: ["package.json"],
|
|
11
|
+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
],
|
|
15
|
+
}
|
package/src/Schematic.tsx
CHANGED
|
@@ -26,9 +26,11 @@ const fallbackRender =
|
|
|
26
26
|
export const Schematic = ({
|
|
27
27
|
children,
|
|
28
28
|
elements: initialElements = [],
|
|
29
|
+
style,
|
|
29
30
|
}: {
|
|
30
31
|
children?: any
|
|
31
32
|
elements?: any
|
|
33
|
+
style?: any
|
|
32
34
|
}) => {
|
|
33
35
|
const [elements, setElements] = useState<any>(initialElements)
|
|
34
36
|
const [project, setProject] = useState<any>(null)
|
|
@@ -59,7 +61,18 @@ export const Schematic = ({
|
|
|
59
61
|
if (elements.length === 0) return null
|
|
60
62
|
|
|
61
63
|
return (
|
|
62
|
-
<div
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
width: "100%",
|
|
67
|
+
backgroundColor: "rgba(255,255,255,0)",
|
|
68
|
+
minHeight: 200,
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
position: "relative",
|
|
71
|
+
cursor: "grab",
|
|
72
|
+
...style,
|
|
73
|
+
}}
|
|
74
|
+
ref={ref}
|
|
75
|
+
>
|
|
63
76
|
{elements.map((elm) => (
|
|
64
77
|
<ErrorBoundary fallbackRender={fallbackRender(elm)}>
|
|
65
78
|
<SchematicElement
|
|
@@ -89,10 +89,8 @@ export default () => {
|
|
|
89
89
|
if (!elements) return null
|
|
90
90
|
return (
|
|
91
91
|
<>
|
|
92
|
-
<Schematic elements={elements} />
|
|
93
|
-
<pre
|
|
94
|
-
{JSON.stringify(elements, null, " ")}
|
|
95
|
-
</pre>
|
|
92
|
+
<Schematic style={{ height: 400 }} elements={elements} />
|
|
93
|
+
<pre>{JSON.stringify(elements, null, " ")}</pre>
|
|
96
94
|
</>
|
|
97
95
|
)
|
|
98
96
|
}
|
package/tsconfig.json
CHANGED