@mpeggroup/mpeg-sdl-editor 1.4.2 → 1.4.4
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/README.md +2 -5
- package/bun.lock +76 -34
- package/html/index.html +1 -1
- package/package.json +30 -30
- package/src/App.tsx +29 -56
- package/src/codemirror/ruler.ts +3 -9
- package/src/components/DesktopPanels.tsx +2 -6
- package/src/components/Editor.tsx +94 -109
- package/src/components/MobileDrawer.tsx +8 -12
- package/src/components/Navbar.tsx +35 -42
- package/src/components/ResizableLayout.tsx +20 -24
- package/src/components/Settings.tsx +38 -49
- package/src/components/StatusBar.tsx +2 -6
- package/src/components/SubNav.tsx +1 -6
- package/src/hooks/useAutoDisplayCompletions.ts +2 -7
- package/src/hooks/useDragResize.ts +63 -57
- package/src/hooks/useFileOperations.ts +1 -3
- package/src/hooks/useMobileDetection.ts +2 -6
- package/src/hooks/usePrettier.ts +1 -3
- package/src/hooks/useRulerWidth.ts +1 -10
- package/src/hooks/useShowSemanticWarnings.ts +1 -3
- package/src/hooks/useShowSymanticErrors.ts +7 -9
- package/src/hooks/useShowSyntaxErrors.ts +7 -9
- package/src/hooks/useToast.ts +1 -5
- package/src/sdl/sdlComplete.ts +5 -17
- package/src/sdl/sdlLinter.ts +1 -6
- package/tailwind.config.ts +2 -6
- package/tests/Editor_test.tsx +1 -3
- package/tsconfig.json +6 -2
package/README.md
CHANGED
|
@@ -32,16 +32,13 @@ Bundle:
|
|
|
32
32
|
|
|
33
33
|
`bun run build`
|
|
34
34
|
|
|
35
|
-
**NOTE**: The following tasks use Deno as it excels at these and Bun does not
|
|
36
|
-
currently provide such functionality:
|
|
37
|
-
|
|
38
35
|
Format:
|
|
39
36
|
|
|
40
|
-
`
|
|
37
|
+
`bunx oxfmt`
|
|
41
38
|
|
|
42
39
|
Lint:
|
|
43
40
|
|
|
44
|
-
`
|
|
41
|
+
`bunx oxlint index.ts src/ tests/`
|
|
45
42
|
|
|
46
43
|
## Functional Tests
|
|
47
44
|
|
package/bun.lock
CHANGED
|
@@ -5,31 +5,31 @@
|
|
|
5
5
|
"": {
|
|
6
6
|
"name": "@mpeggroup/mpeg-sdl-editor",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@codemirror/language": "
|
|
9
|
-
"@codemirror/lint": "
|
|
10
|
-
"@lezer/common": "
|
|
11
|
-
"@lezer/highlight": "
|
|
12
|
-
"@mpeggroup/mpeg-sdl-parser": "
|
|
13
|
-
"@types/wicg-file-system-access": "
|
|
14
|
-
"@uiw/codemirror-theme-vscode": "
|
|
15
|
-
"@uiw/react-codemirror": "
|
|
16
|
-
"daisyui": "
|
|
17
|
-
"react": "
|
|
18
|
-
"react-dom": "
|
|
19
|
-
"tailwindcss": "
|
|
8
|
+
"@codemirror/language": "latest",
|
|
9
|
+
"@codemirror/lint": "latest",
|
|
10
|
+
"@lezer/common": "latest",
|
|
11
|
+
"@lezer/highlight": "latest",
|
|
12
|
+
"@mpeggroup/mpeg-sdl-parser": "latest",
|
|
13
|
+
"@types/wicg-file-system-access": "latest",
|
|
14
|
+
"@uiw/codemirror-theme-vscode": "latest",
|
|
15
|
+
"@uiw/react-codemirror": "latest",
|
|
16
|
+
"daisyui": "latest",
|
|
17
|
+
"react": "latest",
|
|
18
|
+
"react-dom": "latest",
|
|
19
|
+
"tailwindcss": "latest",
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@happy-dom/global-registrator": "
|
|
23
|
-
"@testing-library/dom": "
|
|
24
|
-
"@testing-library/react": "
|
|
25
|
-
"@types/bun": "
|
|
26
|
-
"bun-plugin-tailwind": "
|
|
27
|
-
"happy-dom": "
|
|
22
|
+
"@happy-dom/global-registrator": "latest",
|
|
23
|
+
"@testing-library/dom": "latest",
|
|
24
|
+
"@testing-library/react": "latest",
|
|
25
|
+
"@types/bun": "latest",
|
|
26
|
+
"bun-plugin-tailwind": "latest",
|
|
27
|
+
"happy-dom": "latest",
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@types/react": "
|
|
31
|
-
"@types/react-dom": "
|
|
32
|
-
"typescript": "
|
|
30
|
+
"@types/react": "latest",
|
|
31
|
+
"@types/react-dom": "latest",
|
|
32
|
+
"typescript": "latest",
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
},
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
|
|
66
66
|
"@codemirror/view": ["@codemirror/view@6.39.9", "", { "dependencies": { "@codemirror/state": "^6.5.0", "crelt": "^1.0.6", "style-mod": "^4.1.0", "w3c-keyname": "^2.2.4" } }, "sha512-miGSIfBOKC1s2oHoa80dp+BjtsL8sXsrgGlQnQuOcfvaedcQUtqddTmKbJSDkLl4mkgPvZyXuKic2HDNYcJLYA=="],
|
|
67
67
|
|
|
68
|
-
"@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.
|
|
68
|
+
"@happy-dom/global-registrator": ["@happy-dom/global-registrator@20.11.1", "", { "dependencies": { "@types/node": ">=20.0.0", "happy-dom": "^20.11.1" } }, "sha512-1C0wwHiyMlEdsbrJqff5ORE2PwaXBOam5rMqkZVOReAezd5nt6Tl/WGg28UAo75Ziuwchs0KaF8lvnn2oAtvJA=="],
|
|
69
69
|
|
|
70
70
|
"@lezer/common": ["@lezer/common@1.5.0", "", {}, "sha512-PNGcolp9hr4PJdXR4ix7XtixDrClScvtSCYW3rQG106oVMOOI+jFb+0+J3mbeL/53g1Zd6s0kJzaw6Ri68GmAA=="],
|
|
71
71
|
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
|
|
78
78
|
"@marijn/find-cluster-break": ["@marijn/find-cluster-break@1.0.2", "", {}, "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g=="],
|
|
79
79
|
|
|
80
|
-
"@mpeggroup/mpeg-sdl-parser": ["@mpeggroup/mpeg-sdl-parser@4.1.
|
|
80
|
+
"@mpeggroup/mpeg-sdl-parser": ["@mpeggroup/mpeg-sdl-parser@4.1.4", "", { "dependencies": { "@codemirror/language": "6.12.3", "@codemirror/state": "6.5.4", "@lezer/common": "1.5.0", "@lezer/generator": "1.8.0", "@lezer/highlight": "1.2.3", "@lezer/lr": "1.4.7", "prettier": "3.8.3" }, "peerDependencies": { "typescript": "6.0.3" } }, "sha512-xrnDQlEtUYIbz1yk1GUdWR1UdAMSawBMziYBgWIfggvuJz0uuZ7elZMug08mMeVv3GkVbX+WYlDtCRcKJgGy9g=="],
|
|
81
81
|
|
|
82
82
|
"@oven/bun-darwin-aarch64": ["@oven/bun-darwin-aarch64@1.3.14", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Omj20SuiHBOUjUBIyqtkNjSUIjOtEOJwmbix/ZyFH4BaQ6OZTaaRWIR4TjHVz0yadHgli6lLTiAh1uarnvD49A=="],
|
|
83
83
|
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
|
|
122
122
|
"@types/node": ["@types/node@25.9.1", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg=="],
|
|
123
123
|
|
|
124
|
-
"@types/react": ["@types/react@19.2.
|
|
124
|
+
"@types/react": ["@types/react@19.2.17", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-MXfmqaVPEVgkBT/aY0aGCkRWWtByiYQXo3xdQ8r5RzuFrPiRn8Gar2tQdXSUQ2GKV3bkXckek89V8wQBY2Q/Aw=="],
|
|
125
125
|
|
|
126
126
|
"@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
|
|
127
127
|
|
|
@@ -131,13 +131,53 @@
|
|
|
131
131
|
|
|
132
132
|
"@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
|
|
133
133
|
|
|
134
|
-
"@
|
|
134
|
+
"@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="],
|
|
135
135
|
|
|
136
|
-
"@
|
|
136
|
+
"@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="],
|
|
137
137
|
|
|
138
|
-
"@
|
|
138
|
+
"@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="],
|
|
139
139
|
|
|
140
|
-
"@
|
|
140
|
+
"@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="],
|
|
141
|
+
|
|
142
|
+
"@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="],
|
|
143
|
+
|
|
144
|
+
"@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="],
|
|
145
|
+
|
|
146
|
+
"@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="],
|
|
147
|
+
|
|
148
|
+
"@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="],
|
|
149
|
+
|
|
150
|
+
"@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="],
|
|
151
|
+
|
|
152
|
+
"@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="],
|
|
153
|
+
|
|
154
|
+
"@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="],
|
|
155
|
+
|
|
156
|
+
"@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="],
|
|
157
|
+
|
|
158
|
+
"@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="],
|
|
159
|
+
|
|
160
|
+
"@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="],
|
|
161
|
+
|
|
162
|
+
"@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="],
|
|
163
|
+
|
|
164
|
+
"@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="],
|
|
165
|
+
|
|
166
|
+
"@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="],
|
|
167
|
+
|
|
168
|
+
"@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="],
|
|
169
|
+
|
|
170
|
+
"@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="],
|
|
171
|
+
|
|
172
|
+
"@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="],
|
|
173
|
+
|
|
174
|
+
"@uiw/codemirror-extensions-basic-setup": ["@uiw/codemirror-extensions-basic-setup@4.25.11", "", { "dependencies": { "@codemirror/autocomplete": "^6.0.0", "@codemirror/commands": "^6.0.0", "@codemirror/language": "^6.0.0", "@codemirror/lint": "^6.0.0", "@codemirror/search": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0" } }, "sha512-otyFa+n9IOYtEjaKOxPedHkj15fTPUF21wdR9pv0GpZPfuGl27cvmcv6+tognbRu9VvEcsHKE+ESoszeo3KfTw=="],
|
|
175
|
+
|
|
176
|
+
"@uiw/codemirror-theme-vscode": ["@uiw/codemirror-theme-vscode@4.25.11", "", { "dependencies": { "@uiw/codemirror-themes": "4.25.11" } }, "sha512-fTQ5676L9iV3Y6UyDBDd8Wt9Gewh55aC5rqnCtIpwyVFb6zJEHJScI4g43lzAD2IKhY7HlozB1ucrS3UqBFNEQ=="],
|
|
177
|
+
|
|
178
|
+
"@uiw/codemirror-themes": ["@uiw/codemirror-themes@4.25.11", "", { "dependencies": { "@codemirror/language": "^6.0.0", "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0" } }, "sha512-SBNCOgRsCtewGNocRbmjbCkltGXlFcPJsvhxQ351VynQjnWUiPbUrFcEU/haQ3HanROdAAjWXZJPk5bMBxl2jw=="],
|
|
179
|
+
|
|
180
|
+
"@uiw/react-codemirror": ["@uiw/react-codemirror@4.25.11", "", { "dependencies": { "@babel/runtime": "^7.18.6", "@codemirror/commands": "^6.1.0", "@codemirror/state": "^6.1.1", "@codemirror/theme-one-dark": "^6.0.0", "@uiw/codemirror-extensions-basic-setup": "4.25.11", "codemirror": "^6.0.0" }, "peerDependencies": { "@codemirror/view": ">=6.0.0", "react": ">=17.0.0", "react-dom": ">=17.0.0" } }, "sha512-DYVFAKLX+F/4JS9N/7xexh+TICrlncwkX9HKKInrP1bwO0tSfc3k0GB6oawTYhelVKh20cX3TuRx+NJSkVXuMw=="],
|
|
141
181
|
|
|
142
182
|
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
|
|
143
183
|
|
|
@@ -145,6 +185,8 @@
|
|
|
145
185
|
|
|
146
186
|
"aria-query": ["aria-query@5.3.0", "", { "dependencies": { "dequal": "^2.0.3" } }, "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A=="],
|
|
147
187
|
|
|
188
|
+
"buffer-image-size": ["buffer-image-size@0.6.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="],
|
|
189
|
+
|
|
148
190
|
"bun": ["bun@1.3.14", "", { "optionalDependencies": { "@oven/bun-darwin-aarch64": "1.3.14", "@oven/bun-darwin-x64": "1.3.14", "@oven/bun-darwin-x64-baseline": "1.3.14", "@oven/bun-freebsd-aarch64": "1.3.14", "@oven/bun-freebsd-x64": "1.3.14", "@oven/bun-linux-aarch64": "1.3.14", "@oven/bun-linux-aarch64-android": "1.3.14", "@oven/bun-linux-aarch64-musl": "1.3.14", "@oven/bun-linux-x64": "1.3.14", "@oven/bun-linux-x64-android": "1.3.14", "@oven/bun-linux-x64-baseline": "1.3.14", "@oven/bun-linux-x64-musl": "1.3.14", "@oven/bun-linux-x64-musl-baseline": "1.3.14", "@oven/bun-windows-aarch64": "1.3.14", "@oven/bun-windows-x64": "1.3.14", "@oven/bun-windows-x64-baseline": "1.3.14" }, "os": [ "!aix", "!sunos", "!openbsd", ], "cpu": [ "x64", "arm64", ], "bin": { "bun": "bin/bun.exe", "bunx": "bin/bunx.exe" } }, "sha512-aB6GVd42x1Y5ie1K16SF+oLGtgSkwX9hgoDdIW88pjvfTccU8F1vfpoOt34QLv0dZ1v3XimtaxPlZUG81Gx9Zg=="],
|
|
149
191
|
|
|
150
192
|
"bun-plugin-tailwind": ["bun-plugin-tailwind@0.1.2", "", { "peerDependencies": { "bun": ">=1.0.0" } }, "sha512-41jNC1tZRSK3s1o7pTNrLuQG8kL/0vR/JgiTmZAJ1eHwe0w5j6HFPKeqEk0WAD13jfrUC7+ULuewFBBCoADPpg=="],
|
|
@@ -157,7 +199,7 @@
|
|
|
157
199
|
|
|
158
200
|
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
|
|
159
201
|
|
|
160
|
-
"daisyui": ["daisyui@5.
|
|
202
|
+
"daisyui": ["daisyui@5.7.4", "", {}, "sha512-zKzFIwvEvn2QvE1TbUUtDnYFOqWoxeZh+j4QXfhkZKYAT++pO2ijyT9rkFm0GIPDWR1/oo9hHZzd96AsTK0iZg=="],
|
|
161
203
|
|
|
162
204
|
"dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],
|
|
163
205
|
|
|
@@ -165,7 +207,7 @@
|
|
|
165
207
|
|
|
166
208
|
"entities": ["entities@7.0.1", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="],
|
|
167
209
|
|
|
168
|
-
"happy-dom": ["happy-dom@20.
|
|
210
|
+
"happy-dom": ["happy-dom@20.11.1", "", { "dependencies": { "@types/node": ">=20.0.0", "@types/whatwg-mimetype": "^3.0.2", "@types/ws": "^8.18.1", "buffer-image-size": "^0.6.4", "entities": "^7.0.1", "whatwg-mimetype": "^3.0.0", "ws": "^8.21.0" } }, "sha512-XSt8tMzbW9ymE7687xztkO1ckR7qJNQ3LywY9vlYGhGi3zXrGBHuUo2Cl1ztZaICW+1eAGdkLbj6iwVqDT33kg=="],
|
|
169
211
|
|
|
170
212
|
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
|
171
213
|
|
|
@@ -177,9 +219,9 @@
|
|
|
177
219
|
|
|
178
220
|
"pretty-format": ["pretty-format@27.5.1", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="],
|
|
179
221
|
|
|
180
|
-
"react": ["react@19.2.
|
|
222
|
+
"react": ["react@19.2.8", "", {}, "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw=="],
|
|
181
223
|
|
|
182
|
-
"react-dom": ["react-dom@19.2.
|
|
224
|
+
"react-dom": ["react-dom@19.2.8", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.8" } }, "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ=="],
|
|
183
225
|
|
|
184
226
|
"react-is": ["react-is@17.0.2", "", {}, "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="],
|
|
185
227
|
|
|
@@ -187,9 +229,9 @@
|
|
|
187
229
|
|
|
188
230
|
"style-mod": ["style-mod@4.1.3", "", {}, "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ=="],
|
|
189
231
|
|
|
190
|
-
"tailwindcss": ["tailwindcss@4.3.
|
|
232
|
+
"tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="],
|
|
191
233
|
|
|
192
|
-
"typescript": ["typescript@
|
|
234
|
+
"typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="],
|
|
193
235
|
|
|
194
236
|
"undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="],
|
|
195
237
|
|
package/html/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpeggroup/mpeg-sdl-editor",
|
|
3
|
+
"version": "1.4.4",
|
|
3
4
|
"description": "ISO/IEC 14496-34 Syntactic Description Language (MPEG SDL) web based editor",
|
|
4
|
-
"homepage": "https://github.com/MPEGGroup/mpeg-sdl-editor#readme",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/MPEGGroup/mpeg-sdl-editor.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
5
|
"keywords": [
|
|
11
6
|
"bun",
|
|
7
|
+
"editor",
|
|
12
8
|
"mpeg",
|
|
13
|
-
"sdl",
|
|
14
9
|
"parser",
|
|
15
|
-
"
|
|
10
|
+
"sdl"
|
|
16
11
|
],
|
|
12
|
+
"homepage": "https://github.com/MPEGGroup/mpeg-sdl-editor#readme",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/MPEGGroup/mpeg-sdl-editor.git"
|
|
17
|
+
},
|
|
17
18
|
"type": "module",
|
|
18
|
-
"
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
19
22
|
"scripts": {
|
|
20
23
|
"build": "bun build.ts"
|
|
21
24
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@codemirror/language": "6.12.1",
|
|
27
|
+
"@codemirror/lint": "6.9.2",
|
|
28
|
+
"@lezer/common": "1.5.0",
|
|
29
|
+
"@lezer/highlight": "1.2.3",
|
|
30
|
+
"@mpeggroup/mpeg-sdl-parser": "4.1.4",
|
|
31
|
+
"@types/wicg-file-system-access": "2023.10.7",
|
|
32
|
+
"@uiw/codemirror-theme-vscode": "4.25.11",
|
|
33
|
+
"@uiw/react-codemirror": "4.25.11",
|
|
34
|
+
"daisyui": "5.7.4",
|
|
35
|
+
"react": "19.2.8",
|
|
36
|
+
"react-dom": "19.2.8",
|
|
37
|
+
"tailwindcss": "4.3.3"
|
|
24
38
|
},
|
|
25
39
|
"devDependencies": {
|
|
26
|
-
"@happy-dom/global-registrator": "20.
|
|
40
|
+
"@happy-dom/global-registrator": "20.11.1",
|
|
27
41
|
"@testing-library/dom": "10.4.1",
|
|
28
42
|
"@testing-library/react": "16.3.2",
|
|
29
43
|
"@types/bun": "1.3.14",
|
|
30
44
|
"bun-plugin-tailwind": "0.1.2",
|
|
31
|
-
"happy-dom": "20.
|
|
45
|
+
"happy-dom": "20.11.1"
|
|
32
46
|
},
|
|
33
47
|
"peerDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"@types/react": "19.2.
|
|
36
|
-
"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@codemirror/language": "6.12.1",
|
|
40
|
-
"@codemirror/lint": "6.9.2",
|
|
41
|
-
"@lezer/common": "1.5.0",
|
|
42
|
-
"@lezer/highlight": "1.2.3",
|
|
43
|
-
"@mpeggroup/mpeg-sdl-parser": "4.1.2",
|
|
44
|
-
"@types/wicg-file-system-access": "2023.10.7",
|
|
45
|
-
"@uiw/codemirror-theme-vscode": "4.25.10",
|
|
46
|
-
"@uiw/react-codemirror": "4.25.10",
|
|
47
|
-
"daisyui": "5.5.20",
|
|
48
|
-
"react": "19.2.6",
|
|
49
|
-
"react-dom": "19.2.6",
|
|
50
|
-
"tailwindcss": "4.3.0"
|
|
48
|
+
"@types/react": "19.2.17",
|
|
49
|
+
"@types/react-dom": "19.2.3",
|
|
50
|
+
"typescript": "7.0.2"
|
|
51
51
|
},
|
|
52
52
|
"overrides": {
|
|
53
53
|
"@codemirror/language": "6.12.1",
|
package/src/App.tsx
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SemanticError,
|
|
3
|
-
SemanticWarning,
|
|
4
|
-
SyntaxError,
|
|
5
|
-
} from "@mpeggroup/mpeg-sdl-parser";
|
|
1
|
+
import { SemanticError, SemanticWarning, SyntaxError } from "@mpeggroup/mpeg-sdl-parser";
|
|
6
2
|
import { Editor } from "./components/Editor.tsx";
|
|
7
3
|
import type { EditorRef } from "./components/Editor.tsx";
|
|
8
4
|
import { Navbar } from "./components/Navbar.tsx";
|
|
@@ -36,12 +32,9 @@ function getInitialCodeFromHash(): string | null {
|
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
export function App() {
|
|
39
|
-
const defaultCode =
|
|
40
|
-
"// Start typing your SDL here... <Ctrl+Space> for completions\n";
|
|
35
|
+
const defaultCode = "// Start typing your SDL here... <Ctrl+Space> for completions\n";
|
|
41
36
|
|
|
42
|
-
const [code, setCodeInternal] = useState<string>(
|
|
43
|
-
() => getInitialCodeFromHash() ?? defaultCode,
|
|
44
|
-
);
|
|
37
|
+
const [code, setCodeInternal] = useState<string>(() => getInitialCodeFromHash() ?? defaultCode);
|
|
45
38
|
|
|
46
39
|
const setCode = useCallback((newCode: string) => {
|
|
47
40
|
setCodeInternal(newCode);
|
|
@@ -62,34 +55,29 @@ export function App() {
|
|
|
62
55
|
const isMobile = useMobileDetection();
|
|
63
56
|
const [isSettingsShown, setSettingsShown] = useState(false);
|
|
64
57
|
const { rulerWidth, setRulerWidth } = useRulerWidth();
|
|
65
|
-
const { autoDisplayCompletions, setAutoDisplayCompletions } =
|
|
66
|
-
useAutoDisplayCompletions();
|
|
58
|
+
const { autoDisplayCompletions, setAutoDisplayCompletions } = useAutoDisplayCompletions();
|
|
67
59
|
const { enableLinting, setEnableLinting } = useEnableLinting();
|
|
68
60
|
const { showSyntaxErrors, setShowSyntaxErrors } = useShowSyntaxErrors();
|
|
69
61
|
const { showSemanticErrors, setShowSemanticErrors } = useShowSemanticErrors();
|
|
70
|
-
const { showSemanticWarnings, setShowSemanticWarnings } =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
const { showSemanticWarnings, setShowSemanticWarnings } = useShowSemanticWarnings();
|
|
63
|
+
const [cursorPosition, setCursorPosition] = useState<{ line: number; col: number }>({
|
|
64
|
+
line: 1,
|
|
65
|
+
col: 1,
|
|
66
|
+
});
|
|
75
67
|
const editorRef = useRef<EditorRef>(null);
|
|
76
68
|
|
|
77
|
-
const onCursorChange = useCallback(
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
[],
|
|
88
|
-
);
|
|
69
|
+
const onCursorChange = useCallback((position: { line: number; col: number }) => {
|
|
70
|
+
setCursorPosition((prev) => {
|
|
71
|
+
// Only update if position actually changed
|
|
72
|
+
if (prev.line !== position.line || prev.col !== position.col) {
|
|
73
|
+
return position;
|
|
74
|
+
}
|
|
75
|
+
return prev;
|
|
76
|
+
});
|
|
77
|
+
}, []);
|
|
89
78
|
const handleShare = useCallback(async () => {
|
|
90
79
|
const encoded = btoa(code);
|
|
91
|
-
const url =
|
|
92
|
-
`${globalThis.location.origin}${globalThis.location.pathname}#c=${encoded}`;
|
|
80
|
+
const url = `${globalThis.location.origin}${globalThis.location.pathname}#c=${encoded}`;
|
|
93
81
|
try {
|
|
94
82
|
await navigator.clipboard.writeText(url);
|
|
95
83
|
showToast("URL copied!");
|
|
@@ -98,11 +86,7 @@ export function App() {
|
|
|
98
86
|
}
|
|
99
87
|
}, [code, showToast]);
|
|
100
88
|
|
|
101
|
-
const {
|
|
102
|
-
handleSave,
|
|
103
|
-
handleLoad,
|
|
104
|
-
handleCopy,
|
|
105
|
-
} = useFileOperations({
|
|
89
|
+
const { handleSave, handleLoad, handleCopy } = useFileOperations({
|
|
106
90
|
code,
|
|
107
91
|
setCode,
|
|
108
92
|
showToast,
|
|
@@ -113,9 +97,7 @@ export function App() {
|
|
|
113
97
|
const characterCount = useMemo(() => code.length, [code]);
|
|
114
98
|
const [syntaxErrors, setSyntaxErrors] = useState<SyntaxError[]>([]);
|
|
115
99
|
const [semanticErrors, setSemanticErrors] = useState<SemanticError[]>([]);
|
|
116
|
-
const [semanticWarnings, setSemanticWarnings] = useState<SemanticWarning[]>(
|
|
117
|
-
[],
|
|
118
|
-
);
|
|
100
|
+
const [semanticWarnings, setSemanticWarnings] = useState<SemanticWarning[]>([]);
|
|
119
101
|
|
|
120
102
|
const onSyntaxErrorChange = useCallback((newErrors: SyntaxError[]) => {
|
|
121
103
|
setSyntaxErrors(newErrors);
|
|
@@ -125,24 +107,15 @@ export function App() {
|
|
|
125
107
|
setSemanticErrors(newErrors);
|
|
126
108
|
}, []);
|
|
127
109
|
|
|
128
|
-
const onSemanticWarningChange = useCallback(
|
|
129
|
-
(newErrors
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
[],
|
|
133
|
-
);
|
|
110
|
+
const onSemanticWarningChange = useCallback((newErrors: SemanticWarning[]) => {
|
|
111
|
+
setSemanticWarnings(newErrors);
|
|
112
|
+
}, []);
|
|
134
113
|
|
|
135
|
-
const syntaxErrorCount = useMemo(() => syntaxErrors.length, [
|
|
136
|
-
syntaxErrors,
|
|
137
|
-
]);
|
|
114
|
+
const syntaxErrorCount = useMemo(() => syntaxErrors.length, [syntaxErrors]);
|
|
138
115
|
|
|
139
|
-
const semanticErrorCount = useMemo(() => semanticErrors.length, [
|
|
140
|
-
semanticErrors,
|
|
141
|
-
]);
|
|
116
|
+
const semanticErrorCount = useMemo(() => semanticErrors.length, [semanticErrors]);
|
|
142
117
|
|
|
143
|
-
const semanticWarningCount = useMemo(() => semanticWarnings.length, [
|
|
144
|
-
semanticWarnings,
|
|
145
|
-
]);
|
|
118
|
+
const semanticWarningCount = useMemo(() => semanticWarnings.length, [semanticWarnings]);
|
|
146
119
|
|
|
147
120
|
const { handlePrettify } = usePrettier({
|
|
148
121
|
code,
|
|
@@ -251,8 +224,8 @@ export function App() {
|
|
|
251
224
|
toastState.type === "success"
|
|
252
225
|
? "alert-success"
|
|
253
226
|
: toastState.type === "warning"
|
|
254
|
-
|
|
255
|
-
|
|
227
|
+
? "alert-warning"
|
|
228
|
+
: "alert-error"
|
|
256
229
|
}`}
|
|
257
230
|
>
|
|
258
231
|
<span>{toastState.message}</span>
|
package/src/codemirror/ruler.ts
CHANGED
|
@@ -7,7 +7,7 @@ const baseTheme = EditorView.baseTheme({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
const rulerWidth = Facet.define<number, number>({
|
|
10
|
-
combine: (values) => values.length ? Math.min(...values) : 10,
|
|
10
|
+
combine: (values) => (values.length ? Math.min(...values) : 10),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
const showRuler = ViewPlugin.fromClass(
|
|
@@ -38,9 +38,7 @@ const showRuler = ViewPlugin.fromClass(
|
|
|
38
38
|
const defaultCharacterWidth = view.defaultCharacterWidth;
|
|
39
39
|
const gutterWidth = view.contentDOM.getBoundingClientRect().x;
|
|
40
40
|
|
|
41
|
-
this.rulerDiv.style.left = `${
|
|
42
|
-
gutterWidth + (column * defaultCharacterWidth) + 6
|
|
43
|
-
}px`;
|
|
41
|
+
this.rulerDiv.style.left = `${gutterWidth + column * defaultCharacterWidth + 6}px`;
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
destroy() {
|
|
@@ -50,9 +48,5 @@ const showRuler = ViewPlugin.fromClass(
|
|
|
50
48
|
);
|
|
51
49
|
|
|
52
50
|
export function ruler(column: number): Extension {
|
|
53
|
-
return [
|
|
54
|
-
baseTheme,
|
|
55
|
-
rulerWidth.of(column),
|
|
56
|
-
showRuler,
|
|
57
|
-
];
|
|
51
|
+
return [baseTheme, rulerWidth.of(column), showRuler];
|
|
58
52
|
}
|
|
@@ -44,8 +44,7 @@ export function DesktopPanels({
|
|
|
44
44
|
? "bg-primary-content h-16"
|
|
45
45
|
: "group-hover:bg-base-content/50 group-hover:h-16"
|
|
46
46
|
}`}
|
|
47
|
-
>
|
|
48
|
-
</div>
|
|
47
|
+
></div>
|
|
49
48
|
</div>
|
|
50
49
|
</div>
|
|
51
50
|
)}
|
|
@@ -53,10 +52,7 @@ export function DesktopPanels({
|
|
|
53
52
|
{/* Right panel - only show when not collapsed */}
|
|
54
53
|
|
|
55
54
|
{isSettingsShown && (
|
|
56
|
-
<div
|
|
57
|
-
className="flex flex-col"
|
|
58
|
-
style={{ width: `${Math.max(100 - splitPercentage, 5)}%` }}
|
|
59
|
-
>
|
|
55
|
+
<div className="flex flex-col" style={{ width: `${Math.max(100 - splitPercentage, 5)}%` }}>
|
|
60
56
|
{rightChild}
|
|
61
57
|
</div>
|
|
62
58
|
)}
|