@ostack.tech/kform-scaffolder 0.31.0 → 0.31.2

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/kform-scaffolder CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- npx http-server@latest "$(dirname $(realpath -- "$0"))/webapp" -o "$@"
3
+ npx http-server@latest "$(dirname $(realpath -- "$0"))/webapp/" -o "$@"
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useDroppable, useDraggable, useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter, DragOverlay } from "@dnd-kit/core";
3
- import * as React from "react";
3
+ import { useRef, createContext, useContext, useCallback, useMemo, useLayoutEffect as useLayoutEffect$1, useState } from "react";
4
4
  import { create } from "zustand";
5
5
  import { persist } from "zustand/middleware";
6
6
  import { fileOpen, fileSave, supported } from "browser-fs-access";
@@ -335,7 +335,7 @@ const PACKAGE_PLACEHOLDER = "package.suffix";
335
335
  const NAME_PLACEHOLDER = "ClassName";
336
336
  function PackageNameInput() {
337
337
  const { useSchematic, setSchematic, parentPackage } = useSchematicBuilderContext();
338
- const pkgRef = React.useRef(null);
338
+ const pkgRef = useRef(null);
339
339
  const packageSuffix = useSchematic((schematic) => schematic.packageSuffix);
340
340
  const name = useSchematic((schematic) => schematic.name);
341
341
  return /* @__PURE__ */ jsxs("div", { className: "builder-package-name", children: [
@@ -1097,9 +1097,9 @@ function scaffold(schematic, scaffolders, options) {
1097
1097
  executable: file.executable
1098
1098
  }));
1099
1099
  }
1100
- const SchematicBuilderContext = React.createContext(null);
1100
+ const SchematicBuilderContext = createContext(null);
1101
1101
  function useSchematicBuilderContext() {
1102
- const context = React.useContext(SchematicBuilderContext);
1102
+ const context = useContext(SchematicBuilderContext);
1103
1103
  if (context === null) {
1104
1104
  throw new Error("Schematic builder not in context.");
1105
1105
  }
@@ -1190,7 +1190,7 @@ function useScaffolder() {
1190
1190
  scaffoldingData,
1191
1191
  getRootSchematic
1192
1192
  } = useSchematicBuilderContext();
1193
- return React.useCallback(() => {
1193
+ return useCallback(() => {
1194
1194
  const schematic = getRootSchematic();
1195
1195
  let actualScaffolders = typeof scaffolders === "function" ? scaffolders(schematic) : scaffolders;
1196
1196
  const actualScaffoldingData = typeof scaffoldingData === "function" ? scaffoldingData(schematic) : scaffoldingData;
@@ -1269,7 +1269,7 @@ function useConfig(configName, defaultValue) {
1269
1269
  const configValue = useSchematic(
1270
1270
  (schematic) => schematic.config?.[configName] ?? defaultValue
1271
1271
  );
1272
- const setConfigValue = React.useCallback(
1272
+ const setConfigValue = useCallback(
1273
1273
  (configValue2) => setSchematic((schematic) => ({
1274
1274
  config: {
1275
1275
  ...schematic.config,
@@ -1278,7 +1278,7 @@ function useConfig(configName, defaultValue) {
1278
1278
  })),
1279
1279
  [configName, setSchematic]
1280
1280
  );
1281
- return React.useMemo(
1281
+ return useMemo(
1282
1282
  () => [configValue, setConfigValue],
1283
1283
  [configValue, setConfigValue]
1284
1284
  );
@@ -1369,7 +1369,7 @@ function scaffoldValidator(schematic, data) {
1369
1369
  formClass: schematic.name
1370
1370
  });
1371
1371
  }
1372
- const useLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : () => {
1372
+ const useLayoutEffect = typeof document !== "undefined" ? useLayoutEffect$1 : () => {
1373
1373
  };
1374
1374
  function useMeasure(element, setMeasurement) {
1375
1375
  useLayoutEffect(() => {
@@ -1392,10 +1392,8 @@ function useMeasure(element, setMeasurement) {
1392
1392
  function SchematicBuilderConfig({
1393
1393
  children
1394
1394
  }) {
1395
- const [anchorEl, setAnchorEl] = React.useState(
1396
- null
1397
- );
1398
- const [popoverEl, setPopoverEl] = React.useState(null);
1395
+ const [anchorEl, setAnchorEl] = useState(null);
1396
+ const [popoverEl, setPopoverEl] = useState(null);
1399
1397
  useMeasure(anchorEl, (measurement) => {
1400
1398
  if (popoverEl && measurement) {
1401
1399
  popoverEl.style.setProperty("--anchor-top", `${measurement.top}px`);
@@ -1460,7 +1458,7 @@ function SchematicBuilder({
1460
1458
  /* @__PURE__ */ jsx(UseTableValuesSerializerConfig, {})
1461
1459
  ] })
1462
1460
  }) {
1463
- const [useSchematic] = React.useState(
1461
+ const [useSchematic] = useState(
1464
1462
  () => create(
1465
1463
  persist(
1466
1464
  () => createSchematic({
@@ -1473,14 +1471,16 @@ function SchematicBuilder({
1473
1471
  )
1474
1472
  )
1475
1473
  );
1476
- const schematicKindsMap = React.useMemo(
1474
+ const schematicKindsMap = useMemo(
1477
1475
  () => new Map(
1478
1476
  schematicKinds.sort((t1, t2) => t1.kind.localeCompare(t2.kind)).map((t) => [t.kind, t])
1479
1477
  ),
1480
1478
  [schematicKinds]
1481
1479
  );
1482
- const latestSchematicFileHandleRef = React.useRef(null);
1483
- const [draggedSchematic, setDraggedSchematic] = React.useState(null);
1480
+ const latestSchematicFileHandleRef = useRef(
1481
+ null
1482
+ );
1483
+ const [draggedSchematic, setDraggedSchematic] = useState(null);
1484
1484
  const sensors = useSensors(
1485
1485
  useSensor(PointerSensor, {
1486
1486
  activationConstraint: { distance: 10, delay: 400, tolerance: 20 }