@nestia/editor 11.0.0-dev.20260305 → 11.0.0-dev.20260312

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.
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __read = (this && this.__read) || function (o, n) {
39
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
40
+ if (!m) return o;
41
+ var i = m.call(o), r, ar = [], e;
42
+ try {
43
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
44
+ }
45
+ catch (error) { e = { error: error }; }
46
+ finally {
47
+ try {
48
+ if (r && !r.done && (m = i["return"])) m.call(i);
49
+ }
50
+ finally { if (e) throw e.error; }
51
+ }
52
+ return ar;
53
+ };
54
+ var __importDefault = (this && this.__importDefault) || function (mod) {
55
+ return (mod && mod.__esModule) ? mod : { "default": mod };
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.NestiaEditorFileUploader = NestiaEditorFileUploader;
59
+ var jsx_runtime_1 = require("react/jsx-runtime");
60
+ var js_yaml_1 = require("js-yaml");
61
+ var react_1 = __importDefault(require("react"));
62
+ // @ts-ignore
63
+ var react_mui_fileuploader_1 = __importDefault(require("react-mui-fileuploader"));
64
+ function NestiaEditorFileUploader(props) {
65
+ var _this = this;
66
+ var _a = __read(react_1.default.useState([]), 2), elements = _a[0], setElements = _a[1];
67
+ var onChange = function (array) { return __awaiter(_this, void 0, void 0, function () {
68
+ var file, buffer, content, extension, json;
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ if (array.length === 0) {
73
+ props.onChange(null, null);
74
+ return [2 /*return*/];
75
+ }
76
+ file = array[array.length - 1];
77
+ return [4 /*yield*/, file.arrayBuffer()];
78
+ case 1:
79
+ buffer = _a.sent();
80
+ content = new TextDecoder().decode(buffer);
81
+ extension = file.name.split(".").pop();
82
+ try {
83
+ json = extension === "json" ? JSON.parse(content) : (0, js_yaml_1.load)(content);
84
+ props.onChange(json, null);
85
+ }
86
+ catch (_b) {
87
+ props.onChange(null, extension === "json" ? "Invalid JSON file" : "Invalid YAML file");
88
+ return [2 /*return*/];
89
+ }
90
+ if (array.length > 1)
91
+ setElements([file]);
92
+ return [2 /*return*/];
93
+ }
94
+ });
95
+ }); };
96
+ return ((0, jsx_runtime_1.jsx)(react_mui_fileuploader_1.default, { defaultFiles: elements, onFilesChange: onChange, acceptedType: ".json, .yaml", getBase64: false, multiFile: false, maxUploadFiles: 1, title: "Swagger file uploader", header: "Drag and drop a Swagger file here", buttonLabel: "Click Here", rightLabel: "to select swagger.json/yaml file", buttonRemoveLabel: "Clear" }));
97
+ }
98
+ //# sourceMappingURL=NestiaEditorFileUploader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestiaEditorFileUploader.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorFileUploader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,4DA+CC;;AAtDD,mCAA+B;AAC/B,gDAA0B;AAC1B,aAAa;AACb,kFAAgD;AAIhD,SAAgB,wBAAwB,CACtC,KAAsC;IADxC,iBA+CC;IA5CO,IAAA,KAAA,OAA0B,eAAK,CAAC,QAAQ,CAAsB,EAAE,CAAC,IAAA,EAAhE,QAAQ,QAAA,EAAE,WAAW,QAA2C,CAAC;IACxE,IAAM,QAAQ,GAAG,UAAO,KAA0B;;;;;oBAChD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACvB,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;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0,0 +1 @@
1
+ export {};
package/lib/main.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var jsx_runtime_1 = require("react/jsx-runtime");
4
+ var react_1 = require("react");
5
+ var client_1 = require("react-dom/client");
6
+ var NestiaEditorApplication_1 = require("./NestiaEditorApplication");
7
+ (0, client_1.createRoot)(document.getElementById("root")).render((0, jsx_runtime_1.jsx)(react_1.StrictMode, { children: (0, jsx_runtime_1.jsx)(NestiaEditorApplication_1.NestiaEditorApplication, {}) }));
8
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":";;;AAAA,+BAAmC;AACnC,2CAA8C;AAE9C,qEAAoE;AAEpE,IAAA,mBAAU,EAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAE,CAAC,CAAC,MAAM,CACjD,uBAAC,kBAAU,cACT,uBAAC,iDAAuB,KAAG,GAChB,CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/editor",
3
- "version": "11.0.0-dev.20260305",
3
+ "version": "11.0.0-dev.20260312",
4
4
  "main": "lib/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -35,12 +35,12 @@
35
35
  "dependencies": {
36
36
  "@mui/material": "^5.15.6",
37
37
  "@stackblitz/sdk": "^1.11.0",
38
- "@typia/interface": "12.0.0-dev.20260303-2",
38
+ "@typia/interface": "12.0.0-dev.20260312-2",
39
39
  "js-yaml": "^4.1.0",
40
40
  "prettier": "^3.8.1",
41
41
  "react-mui-fileuploader": "^0.5.2",
42
- "typia": "12.0.0-dev.20260303-2",
43
- "@nestia/migrate": "^11.0.0-dev.20260305"
42
+ "typia": "12.0.0-dev.20260312-2",
43
+ "@nestia/migrate": "^11.0.0-dev.20260312"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@eslint/js": "^9.13.0",
@@ -1,4 +1,9 @@
1
- import type { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
1
+ import type {
2
+ OpenApiV3,
3
+ OpenApiV3_1,
4
+ OpenApiV3_2,
5
+ SwaggerV2,
6
+ } from "@typia/interface";
2
7
  import * as fs from "fs";
3
8
 
4
9
  export namespace NestiaEditorModule {
@@ -9,7 +14,8 @@ export namespace NestiaEditorModule {
9
14
  | string
10
15
  | SwaggerV2.IDocument
11
16
  | OpenApiV3.IDocument
12
- | OpenApiV3_1.IDocument;
17
+ | OpenApiV3_1.IDocument
18
+ | OpenApiV3_2.IDocument;
13
19
  package?: string;
14
20
  simulate?: boolean;
15
21
  e2e?: boolean;
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./NestiaEditorIframe";
2
- export * from "./NestiaEditorUploader";
1
+ export * from "./NestiaEditorIframe";
2
+ export * from "./NestiaEditorUploader";
@@ -1,5 +1,10 @@
1
1
  import { NestiaMigrateApplication } from "@nestia/migrate";
2
- import { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
2
+ import {
3
+ OpenApiV3,
4
+ OpenApiV3_1,
5
+ OpenApiV3_2,
6
+ SwaggerV2,
7
+ } from "@typia/interface";
3
8
  import * as prettierEsTreePlugin from "prettier/plugins/estree";
4
9
  import * as prettierTsPlugin from "prettier/plugins/typescript";
5
10
  import { format } from "prettier/standalone";
@@ -7,7 +12,11 @@ import { IValidation } from "typia";
7
12
 
8
13
  export namespace NestiaEditorComposer {
9
14
  export interface IProps {
10
- document: SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument;
15
+ document:
16
+ | SwaggerV2.IDocument
17
+ | OpenApiV3.IDocument
18
+ | OpenApiV3_1.IDocument
19
+ | OpenApiV3_2.IDocument;
11
20
  e2e: boolean;
12
21
  keyword: boolean;
13
22
  simulate: boolean;
package/src/vite-env.d.ts CHANGED
@@ -1 +1 @@
1
- /// <reference types="vite/client" />
1
+ /// <reference types="vite/client" />