@nestia/editor 0.1.3 → 0.2.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/lib/NestiaEditorApplication.js +141 -44
- package/lib/NestiaEditorApplication.js.map +1 -1
- package/lib/NestiaEditorIframe.js +199 -76
- package/lib/NestiaEditorIframe.js.map +1 -1
- package/lib/NestiaEditorUploader.js +117 -44
- package/lib/NestiaEditorUploader.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +18 -2
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +344 -0
- package/lib/index.mjs.map +1 -0
- package/lib/internal/NestiaEditorComposer.js +146 -50
- package/lib/internal/NestiaEditorComposer.js.map +1 -1
- package/lib/internal/NestiaEditorFileUploader.js +93 -25
- package/lib/internal/NestiaEditorFileUploader.js.map +1 -1
- package/lib/main.js +7 -5
- package/lib/main.js.map +1 -1
- package/package.json +69 -68
- package/src/NestiaEditorApplication.tsx +77 -75
- package/src/NestiaEditorIframe.tsx +11 -10
- package/src/NestiaEditorUploader.tsx +8 -8
- package/src/index.ts +2 -2
- package/src/main.tsx +10 -10
|
@@ -1,53 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.NestiaEditorComposer = void 0;
|
|
54
|
+
var migrate_1 = require("@nestia/migrate");
|
|
55
|
+
var estree_1 = __importDefault(require("prettier/plugins/estree"));
|
|
56
|
+
var typescript_1 = __importDefault(require("prettier/plugins/typescript"));
|
|
57
|
+
var standalone_1 = require("prettier/standalone");
|
|
58
|
+
var NestiaEditorComposer;
|
|
6
59
|
(function (NestiaEditorComposer) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
var _this = this;
|
|
61
|
+
NestiaEditorComposer.nest = function (props) {
|
|
62
|
+
return compose({
|
|
63
|
+
openFile: "README.md,test/start.ts",
|
|
64
|
+
startScript: ["build:test,test", ""],
|
|
65
|
+
migrate: function (app) { return app.nest(props); },
|
|
66
|
+
})(props);
|
|
67
|
+
};
|
|
68
|
+
NestiaEditorComposer.sdk = function (props) {
|
|
69
|
+
return compose({
|
|
70
|
+
openFile: "README.md,test/start.ts",
|
|
71
|
+
startScript: ["swagger", "hello"],
|
|
72
|
+
migrate: function (app) { return app.sdk(props); },
|
|
73
|
+
})(props);
|
|
74
|
+
};
|
|
75
|
+
var compose = function (config) {
|
|
76
|
+
return function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
77
|
+
var result, app, files, files_1, files_1_1, f, _a, e_1_1;
|
|
78
|
+
var e_1, _b;
|
|
79
|
+
return __generator(this, function (_c) {
|
|
80
|
+
switch (_c.label) {
|
|
81
|
+
case 0:
|
|
82
|
+
if (props.files !== undefined)
|
|
83
|
+
return [2 /*return*/, {
|
|
84
|
+
success: true,
|
|
85
|
+
data: {
|
|
86
|
+
files: props.files,
|
|
87
|
+
openFile: config.openFile,
|
|
88
|
+
startScript: config.startScript,
|
|
89
|
+
},
|
|
90
|
+
errors: [],
|
|
91
|
+
}];
|
|
92
|
+
return [4 /*yield*/, migrate_1.MigrateApplication.create(props.document)];
|
|
93
|
+
case 1:
|
|
94
|
+
result = _c.sent();
|
|
95
|
+
if (result.success === false)
|
|
96
|
+
return [2 /*return*/, result];
|
|
97
|
+
app = result.data;
|
|
98
|
+
files = config.migrate(app).files;
|
|
99
|
+
_c.label = 2;
|
|
100
|
+
case 2:
|
|
101
|
+
_c.trys.push([2, 7, 8, 9]);
|
|
102
|
+
files_1 = __values(files), files_1_1 = files_1.next();
|
|
103
|
+
_c.label = 3;
|
|
104
|
+
case 3:
|
|
105
|
+
if (!!files_1_1.done) return [3 /*break*/, 6];
|
|
106
|
+
f = files_1_1.value;
|
|
107
|
+
if (!(f.file.substring(f.file.length - 3) === ".ts")) return [3 /*break*/, 5];
|
|
108
|
+
_a = f;
|
|
109
|
+
return [4 /*yield*/, (0, standalone_1.format)(f.content, {
|
|
110
|
+
parser: "typescript",
|
|
111
|
+
plugins: [estree_1.default, typescript_1.default],
|
|
112
|
+
})];
|
|
113
|
+
case 4:
|
|
114
|
+
_a.content = _c.sent();
|
|
115
|
+
_c.label = 5;
|
|
116
|
+
case 5:
|
|
117
|
+
files_1_1 = files_1.next();
|
|
118
|
+
return [3 /*break*/, 3];
|
|
119
|
+
case 6: return [3 /*break*/, 9];
|
|
120
|
+
case 7:
|
|
121
|
+
e_1_1 = _c.sent();
|
|
122
|
+
e_1 = { error: e_1_1 };
|
|
123
|
+
return [3 /*break*/, 9];
|
|
124
|
+
case 8:
|
|
125
|
+
try {
|
|
126
|
+
if (files_1_1 && !files_1_1.done && (_b = files_1.return)) _b.call(files_1);
|
|
127
|
+
}
|
|
128
|
+
finally { if (e_1) throw e_1.error; }
|
|
129
|
+
return [7 /*endfinally*/];
|
|
130
|
+
case 9: return [2 /*return*/, {
|
|
131
|
+
success: true,
|
|
132
|
+
data: {
|
|
133
|
+
files: Object.fromEntries(files.map(function (f) {
|
|
134
|
+
return [
|
|
135
|
+
[f.location, f.location.length ? "/" : "", f.file].join(""),
|
|
136
|
+
f.content,
|
|
137
|
+
];
|
|
138
|
+
})),
|
|
139
|
+
openFile: config.openFile,
|
|
140
|
+
startScript: config.startScript,
|
|
141
|
+
},
|
|
142
|
+
errors: [],
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}); };
|
|
51
147
|
};
|
|
52
|
-
})(NestiaEditorComposer || (NestiaEditorComposer = {}));
|
|
148
|
+
})(NestiaEditorComposer || (exports.NestiaEditorComposer = NestiaEditorComposer = {}));
|
|
53
149
|
//# sourceMappingURL=NestiaEditorComposer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorComposer.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorComposer.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"NestiaEditorComposer.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorComposer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAqD;AAErD,mEAA2D;AAC3D,2EAA2D;AAC3D,kDAA6C;AAG7C,IAAiB,oBAAoB,CA6EpC;AA7ED,WAAiB,oBAAoB;;IAgBtB,yBAAI,GAAG,UAAC,KAAa;QAChC,OAAA,OAAO,CAAC;YACN,QAAQ,EAAE,yBAAyB;YACnC,WAAW,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC;YACpC,OAAO,EAAE,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAf,CAAe;SAClC,CAAC,CAAC,KAAK,CAAC;IAJT,CAIS,CAAC;IAEC,wBAAG,GAAG,UAAC,KAAa;QAC/B,OAAA,OAAO,CAAC;YACN,QAAQ,EAAE,yBAAyB;YACnC,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;YACjC,OAAO,EAAE,UAAC,GAAG,IAAK,OAAA,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAd,CAAc;SACjC,CAAC,CAAC,KAAK,CAAC;IAJT,CAIS,CAAC;IAEZ,IAAM,OAAO,GACX,UAAC,MAIA;QACD,OAAA,UAAO,KAAa;;;;;;wBAClB,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;4BAC3B,sBAAO;oCACL,OAAO,EAAE,IAAI;oCACb,IAAI,EAAE;wCACJ,KAAK,EAAE,KAAK,CAAC,KAAK;wCAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ;wCACzB,WAAW,EAA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BACD,MAAM,EAAE,EAAE;yBACoB,EAAC;;;aAClC;IAxCD,CAwCC,CAAC;AACN,CAAC,EA7EgB,oBAAoB,oCAApB,oBAAoB,QA6EpC"}
|
|
@@ -1,29 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 {
|
|
16
47
|
try {
|
|
17
|
-
|
|
18
|
-
props.onChange(json, null);
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
props.onChange(null, extension === "json" ? "Invalid JSON file" : "Invalid YAML file");
|
|
22
|
-
return;
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
49
|
}
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
var react_mui_fileuploader_1 = __importDefault(require("react-mui-fileuploader"));
|
|
63
|
+
function NestiaEditorFileUploader(props) {
|
|
64
|
+
var _this = this;
|
|
65
|
+
var _a = __read(react_1.default.useState([]), 2), elements = _a[0], setElements = _a[1];
|
|
66
|
+
var onChange = function (array) { return __awaiter(_this, void 0, void 0, function () {
|
|
67
|
+
var file, buffer, content, extension, json;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0:
|
|
71
|
+
if (array.length === 0) {
|
|
72
|
+
props.onChange(null, null);
|
|
73
|
+
return [2 /*return*/];
|
|
74
|
+
}
|
|
75
|
+
file = array[array.length - 1];
|
|
76
|
+
return [4 /*yield*/, file.arrayBuffer()];
|
|
77
|
+
case 1:
|
|
78
|
+
buffer = _a.sent();
|
|
79
|
+
content = new TextDecoder().decode(buffer);
|
|
80
|
+
extension = file.name.split(".").pop();
|
|
81
|
+
try {
|
|
82
|
+
json = extension === "json" ? JSON.parse(content) : (0, js_yaml_1.load)(content);
|
|
83
|
+
props.onChange(json, null);
|
|
84
|
+
}
|
|
85
|
+
catch (_b) {
|
|
86
|
+
props.onChange(null, extension === "json" ? "Invalid JSON file" : "Invalid YAML file");
|
|
87
|
+
return [2 /*return*/];
|
|
88
|
+
}
|
|
89
|
+
if (array.length > 1)
|
|
90
|
+
setElements([file]);
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}); };
|
|
95
|
+
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" }));
|
|
28
96
|
}
|
|
29
97
|
//# sourceMappingURL=NestiaEditorFileUploader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaEditorFileUploader.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorFileUploader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestiaEditorFileUploader.js","sourceRoot":"","sources":["../../src/internal/NestiaEditorFileUploader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4DA+CC;;AApDD,mCAA+B;AAC/B,gDAA0B;AAC1B,kFAAgD;AAGhD,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;wBAC3B,sBAAO;oBACT,CAAC;oBACK,IAAI,GAAsB,KAAK,CAAC,KAAK,CAAC,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|
5
|
-
|
|
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, {}) }));
|
|
6
8
|
//# sourceMappingURL=main.js.map
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"
|
|
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,68 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@nestia/editor",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build:lib": "
|
|
9
|
-
"build:static": "tsc -b && vite build",
|
|
10
|
-
"dev": "vite",
|
|
11
|
-
"lint": "eslint .",
|
|
12
|
-
"preview": "vite preview"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/samchon/nestia"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"openapi",
|
|
20
|
-
"swagger",
|
|
21
|
-
"generator",
|
|
22
|
-
"typescript",
|
|
23
|
-
"editor",
|
|
24
|
-
"sdk",
|
|
25
|
-
"nestjs",
|
|
26
|
-
"nestia"
|
|
27
|
-
],
|
|
28
|
-
"author": "Jeongho Nam",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"bugs": {
|
|
31
|
-
"url": "https://github.com/samchon/nestia/issues"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://nestia.io",
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@mui/material": "^5.15.6",
|
|
36
|
-
"@nestia/migrate": "^0.18.2",
|
|
37
|
-
"@stackblitz/sdk": "^1.11.0",
|
|
38
|
-
"js-yaml": "^4.1.0",
|
|
39
|
-
"prettier": "^3.3.3",
|
|
40
|
-
"react-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/react
|
|
49
|
-
"@
|
|
50
|
-
"
|
|
51
|
-
"eslint
|
|
52
|
-
"eslint-plugin-react-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"react
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"typescript
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@nestia/editor",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"typings": "lib/index.d.ts",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.mjs",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build:lib": "tsc --project tsconfig.lib.json && rollup -c",
|
|
9
|
+
"build:static": "tsc -b && vite build",
|
|
10
|
+
"dev": "vite",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"preview": "vite preview"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/samchon/nestia"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"openapi",
|
|
20
|
+
"swagger",
|
|
21
|
+
"generator",
|
|
22
|
+
"typescript",
|
|
23
|
+
"editor",
|
|
24
|
+
"sdk",
|
|
25
|
+
"nestjs",
|
|
26
|
+
"nestia"
|
|
27
|
+
],
|
|
28
|
+
"author": "Jeongho Nam",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/samchon/nestia/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://nestia.io",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@mui/material": "^5.15.6",
|
|
36
|
+
"@nestia/migrate": "^0.18.2",
|
|
37
|
+
"@stackblitz/sdk": "^1.11.0",
|
|
38
|
+
"js-yaml": "^4.1.0",
|
|
39
|
+
"prettier": "^3.3.3",
|
|
40
|
+
"react-mui-fileuploader": "^0.5.2",
|
|
41
|
+
"typia": "^6.11.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@eslint/js": "^9.13.0",
|
|
45
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
46
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
47
|
+
"@types/js-yaml": "^4.0.9",
|
|
48
|
+
"@types/react": "^18.3.11",
|
|
49
|
+
"@types/react-dom": "^18.3.1",
|
|
50
|
+
"@vitejs/plugin-react": "^4.3.3",
|
|
51
|
+
"eslint": "^9.13.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
53
|
+
"eslint-plugin-react-refresh": "^0.4.13",
|
|
54
|
+
"globals": "^15.11.0",
|
|
55
|
+
"react": "^18.3.1",
|
|
56
|
+
"react-dom": "^18.3.1",
|
|
57
|
+
"rollup": "^4.24.2",
|
|
58
|
+
"typescript": "^5.6.2",
|
|
59
|
+
"typescript-eslint": "^8.10.0",
|
|
60
|
+
"vite": "^5.4.9"
|
|
61
|
+
},
|
|
62
|
+
"files": [
|
|
63
|
+
"README.md",
|
|
64
|
+
"LICENSE",
|
|
65
|
+
"package.json",
|
|
66
|
+
"lib",
|
|
67
|
+
"src"
|
|
68
|
+
]
|
|
69
|
+
}
|