@nestia/editor 11.1.0 → 11.2.0

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.
@@ -41,189 +41,75 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
- var __generator = (this && this.__generator) || function (thisArg, body) {
45
- 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);
46
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47
- function verb(n) { return function (v) { return step([n, v]); }; }
48
- function step(op) {
49
- if (f) throw new TypeError("Generator is already executing.");
50
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
51
- 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;
52
- if (y = 0, t) op = [op[0] & 2, t.value];
53
- switch (op[0]) {
54
- case 0: case 1: t = op; break;
55
- case 4: _.label++; return { value: op[1], done: false };
56
- case 5: _.label++; y = op[1]; op = [0]; continue;
57
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
58
- default:
59
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63
- if (t[2]) _.ops.pop();
64
- _.trys.pop(); continue;
65
- }
66
- op = body.call(thisArg, _);
67
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69
- }
70
- };
71
- var __values = (this && this.__values) || function(o) {
72
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
73
- if (m) return m.call(o);
74
- if (o && typeof o.length === "number") return {
75
- next: function () {
76
- if (o && i >= o.length) o = void 0;
77
- return { value: o && o[i++], done: !o };
78
- }
79
- };
80
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
81
- };
82
44
  Object.defineProperty(exports, "__esModule", { value: true });
83
45
  exports.NestiaEditorModule = void 0;
84
- var fs = __importStar(require("fs"));
46
+ const fs = __importStar(require("fs"));
85
47
  var NestiaEditorModule;
86
48
  (function (NestiaEditorModule) {
87
- var _this = this;
88
- NestiaEditorModule.setup = function (props) { return __awaiter(_this, void 0, void 0, function () {
89
- var prefix, adaptor, staticFiles, _a, _b, _c, _d, _loop_1, staticFiles_1, staticFiles_1_1, f, _e, _f, p;
90
- var _g, _h, e_1, _j, e_2, _k;
91
- return __generator(this, function (_l) {
92
- switch (_l.label) {
93
- case 0:
94
- prefix = "/" +
95
- [getGlobalPrefix(props.application), props.path]
96
- .join("/")
97
- .split("/")
98
- .filter(function (str) { return str.length !== 0; })
99
- .join("/");
100
- adaptor = props.application.getHttpAdapter();
101
- _g = {
102
- path: "/index.html",
103
- type: "text/html"
104
- };
105
- return [4 /*yield*/, getIndex(props)];
106
- case 1:
107
- _a = [
108
- (_g.content = _l.sent(),
109
- _g)
110
- ];
111
- _h = {
112
- path: "/swagger.json",
113
- type: "application/json"
114
- };
115
- _c = (_b = JSON).stringify;
116
- if (!(typeof props.swagger === "string")) return [3 /*break*/, 3];
117
- return [4 /*yield*/, getSwagger(props.swagger)];
118
- case 2:
119
- _d = _l.sent();
120
- return [3 /*break*/, 4];
121
- case 3:
122
- _d = props.swagger;
123
- _l.label = 4;
124
- case 4:
125
- _a = _a.concat([
126
- (_h.content = _c.apply(_b, [_d, null,
127
- 2]),
128
- _h)
129
- ]);
130
- return [4 /*yield*/, getJavaScript()];
131
- case 5:
132
- staticFiles = _a.concat([
133
- _l.sent()
134
- ]);
135
- _loop_1 = function (f) {
136
- adaptor.get(prefix + f.path, function (_, res) {
137
- res.type(f.type);
138
- return res.send(f.content);
139
- });
140
- };
141
- try {
142
- for (staticFiles_1 = __values(staticFiles), staticFiles_1_1 = staticFiles_1.next(); !staticFiles_1_1.done; staticFiles_1_1 = staticFiles_1.next()) {
143
- f = staticFiles_1_1.value;
144
- _loop_1(f);
145
- }
146
- }
147
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
148
- finally {
149
- try {
150
- if (staticFiles_1_1 && !staticFiles_1_1.done && (_j = staticFiles_1.return)) _j.call(staticFiles_1);
151
- }
152
- finally { if (e_1) throw e_1.error; }
153
- }
154
- try {
155
- for (_e = __values(["", "/"]), _f = _e.next(); !_f.done; _f = _e.next()) {
156
- p = _f.value;
157
- adaptor.get(prefix + p, function (_, res) {
158
- return res.redirect(prefix + "/index.html");
159
- });
160
- }
161
- }
162
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
163
- finally {
164
- try {
165
- if (_f && !_f.done && (_k = _e.return)) _k.call(_e);
166
- }
167
- finally { if (e_2) throw e_2.error; }
168
- }
169
- return [2 /*return*/];
170
- }
171
- });
172
- }); };
173
- var getGlobalPrefix = function (app) {
49
+ NestiaEditorModule.setup = (props) => __awaiter(this, void 0, void 0, function* () {
50
+ const prefix = "/" +
51
+ [getGlobalPrefix(props.application), props.path]
52
+ .join("/")
53
+ .split("/")
54
+ .filter((str) => str.length !== 0)
55
+ .join("/");
56
+ const adaptor = props.application.getHttpAdapter();
57
+ const staticFiles = [
58
+ {
59
+ path: "/index.html",
60
+ type: "text/html",
61
+ content: yield getIndex(props),
62
+ },
63
+ {
64
+ path: "/swagger.json",
65
+ type: "application/json",
66
+ content: JSON.stringify(typeof props.swagger === "string"
67
+ ? yield getSwagger(props.swagger)
68
+ : props.swagger, null, 2),
69
+ },
70
+ yield getJavaScript(),
71
+ ];
72
+ for (const f of staticFiles) {
73
+ adaptor.get(prefix + f.path, (_, res) => {
74
+ res.type(f.type);
75
+ return res.send(f.content);
76
+ });
77
+ }
78
+ for (const p of ["", "/"])
79
+ adaptor.get(prefix + p, (_, res) => {
80
+ return res.redirect(prefix + "/index.html");
81
+ });
82
+ });
83
+ const getGlobalPrefix = (app) => {
174
84
  var _a;
175
85
  return typeof ((_a = app.config) === null || _a === void 0 ? void 0 : _a.globalPrefix) === "string"
176
86
  ? app.config.globalPrefix
177
87
  : "";
178
88
  };
179
89
  })(NestiaEditorModule || (exports.NestiaEditorModule = NestiaEditorModule = {}));
180
- var getIndex = function (props) { return __awaiter(void 0, void 0, void 0, function () {
181
- var content;
182
- var _a;
183
- return __generator(this, function (_b) {
184
- switch (_b.label) {
185
- case 0: return [4 /*yield*/, fs.promises.readFile("".concat(__dirname, "/../dist/index.html"), "utf8")];
186
- case 1:
187
- content = _b.sent();
188
- return [2 /*return*/, content
189
- .replace("\"@ORGANIZATION/PROJECT\"", JSON.stringify((_a = props.package) !== null && _a !== void 0 ? _a : "@ORGANIZATION/PROJECT"))
190
- .replace("window.simulate = false", "window.simulate = ".concat(!!props.simulate))
191
- .replace("window.e2e = false", "window.e2e = ".concat(!!props.e2e))];
192
- }
193
- });
194
- }); };
195
- var getJavaScript = function () { return __awaiter(void 0, void 0, void 0, function () {
196
- var directory, path;
90
+ const getIndex = (props) => __awaiter(void 0, void 0, void 0, function* () {
197
91
  var _a;
198
- return __generator(this, function (_b) {
199
- switch (_b.label) {
200
- case 0: return [4 /*yield*/, fs.promises.readdir("".concat(__dirname, "/../dist/assets"))];
201
- case 1:
202
- directory = _b.sent();
203
- path = directory[0];
204
- if (path === undefined)
205
- throw new Error("Unreachable code, no JS file exists.");
206
- _a = {
207
- path: "/assets/".concat(path),
208
- type: "application/javascript"
209
- };
210
- return [4 /*yield*/, fs.promises.readFile("".concat(__dirname, "/../dist/assets/").concat(path), "utf8")];
211
- case 2: return [2 /*return*/, (_a.content = _b.sent(),
212
- _a)];
213
- }
214
- });
215
- }); };
216
- var getSwagger = function (url) { return __awaiter(void 0, void 0, void 0, function () {
217
- var response;
218
- return __generator(this, function (_a) {
219
- switch (_a.label) {
220
- case 0: return [4 /*yield*/, fetch(url)];
221
- case 1:
222
- response = _a.sent();
223
- if (response.status !== 200)
224
- throw new Error("Failed to fetch Swagger document from ".concat(url));
225
- return [2 /*return*/, response.json()];
226
- }
227
- });
228
- }); };
92
+ const content = yield fs.promises.readFile(`${__dirname}/../dist/index.html`, "utf8");
93
+ return content
94
+ .replace(`"@ORGANIZATION/PROJECT"`, JSON.stringify((_a = props.package) !== null && _a !== void 0 ? _a : "@ORGANIZATION/PROJECT"))
95
+ .replace("window.simulate = false", `window.simulate = ${!!props.simulate}`)
96
+ .replace("window.e2e = false", `window.e2e = ${!!props.e2e}`);
97
+ });
98
+ const getJavaScript = () => __awaiter(void 0, void 0, void 0, function* () {
99
+ const directory = yield fs.promises.readdir(`${__dirname}/../dist/assets`);
100
+ const path = directory[0];
101
+ if (path === undefined)
102
+ throw new Error("Unreachable code, no JS file exists.");
103
+ return {
104
+ path: `/assets/${path}`,
105
+ type: "application/javascript",
106
+ content: yield fs.promises.readFile(`${__dirname}/../dist/assets/${path}`, "utf8"),
107
+ };
108
+ });
109
+ const getSwagger = (url) => __awaiter(void 0, void 0, void 0, function* () {
110
+ const response = yield fetch(url);
111
+ if (response.status !== 200)
112
+ throw new Error(`Failed to fetch Swagger document from ${url}`);
113
+ return response.json();
114
+ });
229
115
  //# sourceMappingURL=NestiaEditorModule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaEditorModule.js","sourceRoot":"","sources":["../src/NestiaEditorModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,qCAAyB;AAEzB,IAAiB,kBAAkB,CAyDlC;AAzDD,WAAiB,k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AC,MAAM,KAAK,GAAG;QACzB,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC,CAAA,CAAC"}
@@ -8,128 +8,71 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
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
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
55
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
56
13
  };
57
14
  Object.defineProperty(exports, "__esModule", { value: true });
58
15
  exports.NestiaEditorUploader = NestiaEditorUploader;
59
- var jsx_runtime_1 = require("react/jsx-runtime");
60
- var material_1 = require("@mui/material");
61
- var sdk_1 = __importDefault(require("@stackblitz/sdk"));
62
- var react_1 = __importDefault(require("react"));
63
- var NestiaEditorComposer_1 = require("./internal/NestiaEditorComposer");
64
- var NestiaEditorFileUploader_1 = require("./internal/NestiaEditorFileUploader");
16
+ const jsx_runtime_1 = require("react/jsx-runtime");
17
+ const material_1 = require("@mui/material");
18
+ const sdk_1 = __importDefault(require("@stackblitz/sdk"));
19
+ const react_1 = __importDefault(require("react"));
20
+ const NestiaEditorComposer_1 = require("./internal/NestiaEditorComposer");
21
+ const NestiaEditorFileUploader_1 = require("./internal/NestiaEditorFileUploader");
65
22
  function NestiaEditorUploader(props) {
66
- var _this = this;
67
23
  // PARAMETERS
68
- var _a = __read(react_1.default.useState("sdk"), 2), mode = _a[0], setMode = _a[1];
69
- var _b = __read(react_1.default.useState(true), 2), keyword = _b[0], setKeyword = _b[1];
70
- var _c = __read(react_1.default.useState(true), 2), simulate = _c[0], setSimulate = _c[1];
71
- var _d = __read(react_1.default.useState(true), 2), e2e = _d[0], setE2e = _d[1];
72
- var _f = __read(react_1.default.useState("@ORGINIZATION/PROJECT"), 2), name = _f[0], setName = _f[1];
24
+ const [mode, setMode] = react_1.default.useState("sdk");
25
+ const [keyword, setKeyword] = react_1.default.useState(true);
26
+ const [simulate, setSimulate] = react_1.default.useState(true);
27
+ const [e2e, setE2e] = react_1.default.useState(true);
28
+ const [name, setName] = react_1.default.useState("@ORGINIZATION/PROJECT");
73
29
  // RESULT
74
- var _g = __read(react_1.default.useState(null), 2), document = _g[0], setDocument = _g[1];
75
- var _h = __read(react_1.default.useState(false), 2), progress = _h[0], setProgress = _h[1];
76
- var handleError = function (error) {
30
+ const [document, setDocument] = react_1.default.useState(null);
31
+ const [progress, setProgress] = react_1.default.useState(false);
32
+ const handleError = (error) => {
77
33
  if (props.onError)
78
34
  props.onError(error);
79
35
  else
80
36
  alert(error);
81
37
  };
82
- var handleSwagger = function (document, error) {
38
+ const handleSwagger = (document, error) => {
83
39
  setDocument(document);
84
40
  if (error !== null)
85
41
  handleError(error);
86
42
  };
87
- var generate = function () { return __awaiter(_this, void 0, void 0, function () {
88
- var result, exp_1;
43
+ const generate = () => __awaiter(this, void 0, void 0, function* () {
89
44
  var _a, _b;
90
- return __generator(this, function (_c) {
91
- switch (_c.label) {
92
- case 0:
93
- if (document === null)
94
- return [2 /*return*/];
95
- setProgress(true);
96
- _c.label = 1;
97
- case 1:
98
- _c.trys.push([1, 3, , 4]);
99
- return [4 /*yield*/, NestiaEditorComposer_1.NestiaEditorComposer[mode]({
100
- document: document,
101
- keyword: keyword,
102
- e2e: e2e,
103
- simulate: simulate,
104
- package: name,
105
- })];
106
- case 2:
107
- result = _c.sent();
108
- if (result.success === true) {
109
- sdk_1.default.openProject({
110
- title: (_b = (_a = document.info) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : "Nestia Editor",
111
- template: "node",
112
- files: result.data.files,
113
- }, {
114
- newWindow: true,
115
- openFile: result.data.openFile,
116
- startScript: result.data.startScript,
117
- });
118
- }
119
- else {
120
- handleError(JSON.stringify(result.errors, null, 2));
121
- }
122
- return [3 /*break*/, 4];
123
- case 3:
124
- exp_1 = _c.sent();
125
- handleError(exp_1 instanceof Error ? exp_1.message : "unknown error");
126
- return [3 /*break*/, 4];
127
- case 4:
128
- setProgress(false);
129
- return [2 /*return*/];
45
+ if (document === null)
46
+ return;
47
+ setProgress(true);
48
+ try {
49
+ const result = yield NestiaEditorComposer_1.NestiaEditorComposer[mode]({
50
+ document,
51
+ keyword,
52
+ e2e,
53
+ simulate,
54
+ package: name,
55
+ });
56
+ if (result.success === true) {
57
+ sdk_1.default.openProject({
58
+ title: (_b = (_a = document.info) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : "Nestia Editor",
59
+ template: "node",
60
+ files: result.data.files,
61
+ }, {
62
+ newWindow: true,
63
+ openFile: result.data.openFile,
64
+ startScript: result.data.startScript,
65
+ });
66
+ }
67
+ else {
68
+ handleError(JSON.stringify(result.errors, null, 2));
130
69
  }
131
- });
132
- }); };
133
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(NestiaEditorFileUploader_1.NestiaEditorFileUploader, { onChange: handleSwagger }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, style: { paddingLeft: 15 }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { onChange: function (e) { return setName(e.target.value); }, defaultValue: name, label: "Package Name", variant: "outlined" }), (0, jsx_runtime_1.jsx)(material_1.FormLabel, { style: { paddingTop: 20 }, children: " Mode " }), (0, jsx_runtime_1.jsxs)(material_1.RadioGroup, { defaultValue: mode, onChange: function (_e, value) { return setMode(value); }, style: { paddingLeft: 15 }, children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: "sdk", control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "Software Development Kit" }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: "nest", control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "NestJS Project" })] }), (0, jsx_runtime_1.jsx)(material_1.FormLabel, { style: { paddingTop: 20 }, children: " Options " }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "Keyword Parameter", style: { paddingTop: 5, paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: keyword, onChange: function () { return setKeyword(!keyword); } }) }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "Mockup Simulator", style: { paddingTop: 5, paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: simulate, onChange: function () { return setSimulate(!simulate); } }) }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "E2E Test Functions", style: { paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: e2e, onChange: function () { return setE2e(!e2e); } }) })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(material_1.Button, { component: "a", fullWidth: true, variant: "contained", color: "info", size: "large", disabled: progress === true || document === null, onClick: function () { return generate(); }, children: progress ? "Generating..." : "Generate Editor" })] }));
70
+ }
71
+ catch (exp) {
72
+ handleError(exp instanceof Error ? exp.message : "unknown error");
73
+ }
74
+ setProgress(false);
75
+ });
76
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(NestiaEditorFileUploader_1.NestiaEditorFileUploader, { onChange: handleSwagger }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, style: { paddingLeft: 15 }, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { onChange: (e) => setName(e.target.value), defaultValue: name, label: "Package Name", variant: "outlined" }), (0, jsx_runtime_1.jsx)(material_1.FormLabel, { style: { paddingTop: 20 }, children: " Mode " }), (0, jsx_runtime_1.jsxs)(material_1.RadioGroup, { defaultValue: mode, onChange: (_e, value) => setMode(value), style: { paddingLeft: 15 }, children: [(0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: "sdk", control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "Software Development Kit" }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: "nest", control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: "NestJS Project" })] }), (0, jsx_runtime_1.jsx)(material_1.FormLabel, { style: { paddingTop: 20 }, children: " Options " }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "Keyword Parameter", style: { paddingTop: 5, paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: keyword, onChange: () => setKeyword(!keyword) }) }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "Mockup Simulator", style: { paddingTop: 5, paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: simulate, onChange: () => setSimulate(!simulate) }) }), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { label: "E2E Test Functions", style: { paddingLeft: 15 }, control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: e2e, onChange: () => setE2e(!e2e) }) })] }), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)(material_1.Button, { component: "a", fullWidth: true, variant: "contained", color: "info", size: "large", disabled: progress === true || document === null, onClick: () => generate(), children: progress ? "Generating..." : "Generate Editor" })] }));
134
77
  }
135
78
  //# sourceMappingURL=NestiaEditorUploader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NestiaEditorUploader.js","sourceRoot":"","sources":["../src/NestiaEditorUploader.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,oDAmIC;;AApJD,0CASuB;AACvB,wDAA4C;AAE5C,gDAA0B;AAE1B,wEAA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