@ostack.tech/kform-scaffolder 0.31.5 → 0.32.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.
@@ -16,19 +16,52 @@
16
16
 
17
17
  .builder-header {
18
18
  display: flex;
19
- justify-content: space-between;
20
- column-gap: 1rem;
19
+ gap: 0.5rem 1rem;
21
20
  flex-wrap: wrap;
21
+ align-items: baseline;
22
+ position: sticky;
23
+ top: 1rem;
24
+ z-index: 1;
25
+ margin-bottom: 1rem;
26
+
27
+ > * {
28
+ position: relative;
29
+ display: inline-block;
30
+ isolation: isolate;
31
+
32
+ &::after {
33
+ content: "";
34
+ position: absolute;
35
+ inset: -0.35rem -0.35rem;
36
+ border-radius: 0.5rem;
37
+ pointer-events: none;
38
+
39
+ background: color-mix(in srgb, Canvas 70%, transparent);
40
+ backdrop-filter: blur(12px);
41
+ -webkit-backdrop-filter: blur(12px);
42
+
43
+ z-index: -1;
44
+ }
45
+ }
22
46
  }
23
47
 
24
48
  .builder-title {
25
- margin: 0 0 0.5rem;
49
+ margin: 0;
50
+ }
51
+
52
+ .builder-version {
53
+ opacity: 0.65;
54
+
55
+ &::before {
56
+ content: "v";
57
+ }
26
58
  }
27
59
 
28
60
  .builder-actions {
29
61
  display: inline-flex;
62
+ align-self: center;
30
63
  gap: 0.5rem;
31
- margin-bottom: 1.5rem;
64
+ margin-left: auto;
32
65
  }
33
66
 
34
67
  .builder {
@@ -86,9 +86,7 @@ function LoadSchematic() {
86
86
  description: "Form schematic",
87
87
  id: name
88
88
  });
89
- if (file.handle) {
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.name}”.`
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
- latestZipFileHandle = await fileSave(
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 “${latestZipFileHandle.name}”.`
245
+ `Project scaffolded successfully in “${fileHandle?.name ?? "unknown"}”.`
250
246
  );
251
247
  }
252
248
  } catch (err) {
@@ -1533,7 +1529,8 @@ function SchematicBuilder({
1533
1529
  configs = /* @__PURE__ */ jsxs(Fragment, { children: [
1534
1530
  /* @__PURE__ */ jsx(UseFileBase64SerializerConfig, {}),
1535
1531
  /* @__PURE__ */ jsx(UseTableValuesSerializerConfig, {})
1536
- ] })
1532
+ ] }),
1533
+ version = "0.32.0"
1537
1534
  }) {
1538
1535
  const [useSchematic] = useState(
1539
1536
  () => create(
@@ -1612,6 +1609,7 @@ function SchematicBuilder({
1612
1609
  /* @__PURE__ */ jsxs("form", { className: "builder-root", children: [
1613
1610
  /* @__PURE__ */ jsxs("header", { className: "builder-header", children: [
1614
1611
  /* @__PURE__ */ jsx("h1", { className: "builder-title", children: title }),
1612
+ version && /* @__PURE__ */ jsx("div", { className: "builder-version", children: version }),
1615
1613
  /* @__PURE__ */ jsxs("div", { className: "builder-actions", children: [
1616
1614
  configs && /* @__PURE__ */ jsx(SchematicBuilderConfig, { children: configs }),
1617
1615
  actions