@ostack.tech/kform-scaffolder 0.31.5 → 0.31.6
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.
|
@@ -86,9 +86,7 @@ function LoadSchematic() {
|
|
|
86
86
|
description: "Form schematic",
|
|
87
87
|
id: name
|
|
88
88
|
});
|
|
89
|
-
|
|
90
|
-
latestSchematicFileHandleRef.current = file.handle;
|
|
91
|
-
}
|
|
89
|
+
latestSchematicFileHandleRef.current = file.handle ?? null;
|
|
92
90
|
const content = JSON.parse(await file.text());
|
|
93
91
|
setSchematic(() => content);
|
|
94
92
|
} catch (err) {
|
|
@@ -127,7 +125,7 @@ function SaveSchematic() {
|
|
|
127
125
|
);
|
|
128
126
|
if (supported) {
|
|
129
127
|
alert(
|
|
130
|
-
`Schematic saved successfully as “${latestSchematicFileHandleRef.current
|
|
128
|
+
`Schematic saved successfully as “${latestSchematicFileHandleRef.current?.name ?? "unknown"}”.`
|
|
131
129
|
);
|
|
132
130
|
}
|
|
133
131
|
} catch (err) {
|
|
@@ -211,7 +209,6 @@ function useScaffolder() {
|
|
|
211
209
|
schematicKinds
|
|
212
210
|
]);
|
|
213
211
|
}
|
|
214
|
-
let latestZipFileHandle = null;
|
|
215
212
|
function ScaffoldToZip() {
|
|
216
213
|
const { getRootSchematic, name } = useSchematicBuilderContext();
|
|
217
214
|
const scaffold2 = useScaffolder();
|
|
@@ -233,7 +230,7 @@ function ScaffoldToZip() {
|
|
|
233
230
|
unixPermissions: executable ? "755" : void 0
|
|
234
231
|
});
|
|
235
232
|
}
|
|
236
|
-
|
|
233
|
+
const fileHandle = await fileSave(
|
|
237
234
|
zip.generateAsync({ platform: "UNIX", type: "blob" }),
|
|
238
235
|
{
|
|
239
236
|
fileName: `${schematic.name}.zip`,
|
|
@@ -241,12 +238,11 @@ function ScaffoldToZip() {
|
|
|
241
238
|
mimeTypes: ["application/zip"],
|
|
242
239
|
description: "Form scaffolding",
|
|
243
240
|
id: name
|
|
244
|
-
}
|
|
245
|
-
latestZipFileHandle
|
|
241
|
+
}
|
|
246
242
|
);
|
|
247
243
|
if (supported) {
|
|
248
244
|
alert(
|
|
249
|
-
`Project scaffolded successfully in “${
|
|
245
|
+
`Project scaffolded successfully in “${fileHandle?.name ?? "unknown"}”.`
|
|
250
246
|
);
|
|
251
247
|
}
|
|
252
248
|
} catch (err) {
|