@nestia/editor 11.0.0-dev.20260316 → 11.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/LICENSE +21 -21
- package/README.md +93 -93
- package/dist/assets/{index-CwCzW6vi.js → index-DORxj52S.js} +3828 -3829
- package/dist/index.html +19 -19
- package/package.json +4 -4
- package/src/NestiaEditorApplication.tsx +94 -94
- package/src/NestiaEditorIframe.tsx +245 -245
- package/src/NestiaEditorModule.ts +136 -136
- package/src/NestiaEditorUploader.tsx +154 -154
- package/src/internal/NestiaEditorComposer.ts +90 -90
- package/src/internal/NestiaEditorFileUploader.tsx +68 -68
- package/src/main.tsx +10 -10
package/dist/index.html
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<html lang="en">
|
|
2
|
-
<head>
|
|
3
|
-
<meta charset="UTF-8" />
|
|
4
|
-
<meta
|
|
5
|
-
name="viewport"
|
|
6
|
-
content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1.0, maximum-scale=3.0s"
|
|
7
|
-
/>
|
|
8
|
-
<title>Nestia Editor</title>
|
|
9
|
-
<script type="module" src="./assets/index-
|
|
10
|
-
</head>
|
|
11
|
-
<body style="width: 100%; height: 100%; margin: 0px; overflow: hidden;">
|
|
12
|
-
<div id="root" style="width: 100%; height: 100%"></div>
|
|
13
|
-
<script>
|
|
14
|
-
window.package = "@ORGANIZATION/PROJECT";
|
|
15
|
-
window.simulate = false;
|
|
16
|
-
window.e2e = false;
|
|
17
|
-
</script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
1
|
+
<html lang="en">
|
|
2
|
+
<head>
|
|
3
|
+
<meta charset="UTF-8" />
|
|
4
|
+
<meta
|
|
5
|
+
name="viewport"
|
|
6
|
+
content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1.0, maximum-scale=3.0s"
|
|
7
|
+
/>
|
|
8
|
+
<title>Nestia Editor</title>
|
|
9
|
+
<script type="module" src="./assets/index-DORxj52S.js"></script>
|
|
10
|
+
</head>
|
|
11
|
+
<body style="width: 100%; height: 100%; margin: 0px; overflow: hidden;">
|
|
12
|
+
<div id="root" style="width: 100%; height: 100%"></div>
|
|
13
|
+
<script>
|
|
14
|
+
window.package = "@ORGANIZATION/PROJECT";
|
|
15
|
+
window.simulate = false;
|
|
16
|
+
window.e2e = false;
|
|
17
|
+
</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/editor",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@mui/material": "^5.15.6",
|
|
41
41
|
"@stackblitz/sdk": "^1.11.0",
|
|
42
|
-
"@typia/interface": "12.0.0
|
|
42
|
+
"@typia/interface": "^12.0.0",
|
|
43
43
|
"js-yaml": "^4.1.0",
|
|
44
44
|
"prettier": "^3.8.1",
|
|
45
45
|
"react-mui-fileuploader": "^0.5.2",
|
|
46
|
-
"typia": "12.0.0
|
|
47
|
-
"@nestia/migrate": "^11.0.
|
|
46
|
+
"typia": "^12.0.0",
|
|
47
|
+
"@nestia/migrate": "^11.0.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^9.13.0",
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { Typography } from "@mui/material";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import { NestiaEditorIframe } from "./NestiaEditorIframe";
|
|
5
|
-
import { NestiaEditorUploader } from "./NestiaEditorUploader";
|
|
6
|
-
|
|
7
|
-
export function NestiaEditorApplication() {
|
|
8
|
-
const [ready, setReady] = React.useState(false);
|
|
9
|
-
const [asset, setAsset] = React.useState<IAsset | null>(null);
|
|
10
|
-
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
(async () => {
|
|
13
|
-
try {
|
|
14
|
-
setAsset(await getAsset());
|
|
15
|
-
} catch {
|
|
16
|
-
setAsset(null);
|
|
17
|
-
}
|
|
18
|
-
setReady(true);
|
|
19
|
-
})().catch(() => {});
|
|
20
|
-
}, []);
|
|
21
|
-
if (ready === false) return <></>;
|
|
22
|
-
|
|
23
|
-
return asset !== null ? (
|
|
24
|
-
<NestiaEditorIframe
|
|
25
|
-
swagger={asset.url}
|
|
26
|
-
package={asset.package}
|
|
27
|
-
simulate={asset.simulate}
|
|
28
|
-
e2e={asset.e2e}
|
|
29
|
-
mode={asset.mode}
|
|
30
|
-
/>
|
|
31
|
-
) : (
|
|
32
|
-
<div
|
|
33
|
-
style={{
|
|
34
|
-
padding: 25,
|
|
35
|
-
}}
|
|
36
|
-
>
|
|
37
|
-
<Typography variant="h4">Nestia Editor</Typography>
|
|
38
|
-
<hr />
|
|
39
|
-
<br />
|
|
40
|
-
<NestiaEditorUploader />
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async function getAsset(): Promise<IAsset | null> {
|
|
46
|
-
const index: number = window.location.href.indexOf("?");
|
|
47
|
-
const query: URLSearchParams = new URLSearchParams(
|
|
48
|
-
index === -1 ? "" : window.location.href.substring(index + 1),
|
|
49
|
-
);
|
|
50
|
-
if (query.has("uploader")) return null;
|
|
51
|
-
|
|
52
|
-
const url: string | null =
|
|
53
|
-
query.get("url") ??
|
|
54
|
-
(await findSwagger("./swagger.json")) ??
|
|
55
|
-
(await findSwagger("./swagger.yaml"));
|
|
56
|
-
if (url === null) return null;
|
|
57
|
-
|
|
58
|
-
const mode: string | null = query.get("mode");
|
|
59
|
-
const packageName: string | null =
|
|
60
|
-
query.get("package") ?? (window as any).package;
|
|
61
|
-
const keyword: boolean | string | null =
|
|
62
|
-
query.get("keyword") ?? (window as any).keyword;
|
|
63
|
-
const simulate: boolean | string | null =
|
|
64
|
-
query.get("simulate") ?? (window as any).simulate;
|
|
65
|
-
const e2e: boolean | string | null = query.get("e2e") ?? (window as any).e2e;
|
|
66
|
-
return {
|
|
67
|
-
mode: mode === "nest" ? "nest" : "sdk",
|
|
68
|
-
package: packageName ?? "@ORGANIZATION/PROJECT",
|
|
69
|
-
url,
|
|
70
|
-
keyword:
|
|
71
|
-
keyword !== null
|
|
72
|
-
? keyword === true || keyword === "true" || keyword === "1"
|
|
73
|
-
: false,
|
|
74
|
-
simulate:
|
|
75
|
-
simulate !== null
|
|
76
|
-
? simulate === true || simulate === "true" || simulate === "1"
|
|
77
|
-
: false,
|
|
78
|
-
e2e: e2e !== null ? e2e === true || e2e === "true" || e2e === "1" : false,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async function findSwagger(file: string): Promise<string | null> {
|
|
83
|
-
const response: Response = await fetch(file);
|
|
84
|
-
return response.status === 200 ? file : null;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
interface IAsset {
|
|
88
|
-
mode: "nest" | "sdk";
|
|
89
|
-
package: string;
|
|
90
|
-
url: string;
|
|
91
|
-
keyword: boolean;
|
|
92
|
-
simulate: boolean;
|
|
93
|
-
e2e: boolean;
|
|
94
|
-
}
|
|
1
|
+
import { Typography } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { NestiaEditorIframe } from "./NestiaEditorIframe";
|
|
5
|
+
import { NestiaEditorUploader } from "./NestiaEditorUploader";
|
|
6
|
+
|
|
7
|
+
export function NestiaEditorApplication() {
|
|
8
|
+
const [ready, setReady] = React.useState(false);
|
|
9
|
+
const [asset, setAsset] = React.useState<IAsset | null>(null);
|
|
10
|
+
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
(async () => {
|
|
13
|
+
try {
|
|
14
|
+
setAsset(await getAsset());
|
|
15
|
+
} catch {
|
|
16
|
+
setAsset(null);
|
|
17
|
+
}
|
|
18
|
+
setReady(true);
|
|
19
|
+
})().catch(() => {});
|
|
20
|
+
}, []);
|
|
21
|
+
if (ready === false) return <></>;
|
|
22
|
+
|
|
23
|
+
return asset !== null ? (
|
|
24
|
+
<NestiaEditorIframe
|
|
25
|
+
swagger={asset.url}
|
|
26
|
+
package={asset.package}
|
|
27
|
+
simulate={asset.simulate}
|
|
28
|
+
e2e={asset.e2e}
|
|
29
|
+
mode={asset.mode}
|
|
30
|
+
/>
|
|
31
|
+
) : (
|
|
32
|
+
<div
|
|
33
|
+
style={{
|
|
34
|
+
padding: 25,
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<Typography variant="h4">Nestia Editor</Typography>
|
|
38
|
+
<hr />
|
|
39
|
+
<br />
|
|
40
|
+
<NestiaEditorUploader />
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function getAsset(): Promise<IAsset | null> {
|
|
46
|
+
const index: number = window.location.href.indexOf("?");
|
|
47
|
+
const query: URLSearchParams = new URLSearchParams(
|
|
48
|
+
index === -1 ? "" : window.location.href.substring(index + 1),
|
|
49
|
+
);
|
|
50
|
+
if (query.has("uploader")) return null;
|
|
51
|
+
|
|
52
|
+
const url: string | null =
|
|
53
|
+
query.get("url") ??
|
|
54
|
+
(await findSwagger("./swagger.json")) ??
|
|
55
|
+
(await findSwagger("./swagger.yaml"));
|
|
56
|
+
if (url === null) return null;
|
|
57
|
+
|
|
58
|
+
const mode: string | null = query.get("mode");
|
|
59
|
+
const packageName: string | null =
|
|
60
|
+
query.get("package") ?? (window as any).package;
|
|
61
|
+
const keyword: boolean | string | null =
|
|
62
|
+
query.get("keyword") ?? (window as any).keyword;
|
|
63
|
+
const simulate: boolean | string | null =
|
|
64
|
+
query.get("simulate") ?? (window as any).simulate;
|
|
65
|
+
const e2e: boolean | string | null = query.get("e2e") ?? (window as any).e2e;
|
|
66
|
+
return {
|
|
67
|
+
mode: mode === "nest" ? "nest" : "sdk",
|
|
68
|
+
package: packageName ?? "@ORGANIZATION/PROJECT",
|
|
69
|
+
url,
|
|
70
|
+
keyword:
|
|
71
|
+
keyword !== null
|
|
72
|
+
? keyword === true || keyword === "true" || keyword === "1"
|
|
73
|
+
: false,
|
|
74
|
+
simulate:
|
|
75
|
+
simulate !== null
|
|
76
|
+
? simulate === true || simulate === "true" || simulate === "1"
|
|
77
|
+
: false,
|
|
78
|
+
e2e: e2e !== null ? e2e === true || e2e === "true" || e2e === "1" : false,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function findSwagger(file: string): Promise<string | null> {
|
|
83
|
+
const response: Response = await fetch(file);
|
|
84
|
+
return response.status === 200 ? file : null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
interface IAsset {
|
|
88
|
+
mode: "nest" | "sdk";
|
|
89
|
+
package: string;
|
|
90
|
+
url: string;
|
|
91
|
+
keyword: boolean;
|
|
92
|
+
simulate: boolean;
|
|
93
|
+
e2e: boolean;
|
|
94
|
+
}
|