zudoku 0.4.3-dev.27 → 0.4.3-dev.28

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.
@@ -1,5 +1,5 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as s } from "./index-CMzlvgYf.js";
2
+ import { o as s } from "./index-Brsmo1Re.js";
3
3
  import "./urql-YhcsXYy8.js";
4
4
  import "./ZudokuContext-BHNQL3XO.js";
5
5
  import "zudoku/openapi-worker";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.4.3-dev.27",
3
+ "version": "0.4.3-dev.28",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -73,10 +73,17 @@ const parseSchemaInput = async (
73
73
  );
74
74
  }
75
75
 
76
+ const schemaText = await response.text();
77
+
76
78
  try {
77
- return (await response.json()) as JSONSchema;
79
+ if (schemaText.trim().startsWith("{")) {
80
+ return JSON.parse(schemaText) as JSONSchema;
81
+ } else {
82
+ const yaml = await import("yaml");
83
+ return yaml.parse(schemaText) as JSONSchema;
84
+ }
78
85
  } catch (err) {
79
- throw new GraphQLError("Fetched invalid JSON schema", {
86
+ throw new GraphQLError("Fetched invalid schema", {
80
87
  originalError: err,
81
88
  });
82
89
  }
@@ -193,7 +193,10 @@ export const Sidecar = ({
193
193
  value={selectedLang}
194
194
  onChange={(e) => {
195
195
  startTransition(() => {
196
- setSearchParams({ lang: e.target.value });
196
+ setSearchParams((prev) => {
197
+ prev.set("lang", e.target.value);
198
+ return prev;
199
+ });
197
200
  });
198
201
  }}
199
202
  options={[