pxengine 0.1.92 → 0.1.93

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/dist/index.mjs CHANGED
@@ -34352,11 +34352,12 @@ ActionButton.displayName = "ActionButton";
34352
34352
  // src/molecules/generic/FormCard/FormCard.tsx
34353
34353
  import React87, { useState as useState7 } from "react";
34354
34354
  import { jsx as jsx96, jsxs as jsxs58 } from "react/jsx-runtime";
34355
+ var humanizeKey = (key) => key.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
34355
34356
  var FormCard = React87.memo(
34356
34357
  ({
34357
34358
  title,
34358
- fields,
34359
- data,
34359
+ fields = [],
34360
+ data = {},
34360
34361
  editingFields: externalEditingFields,
34361
34362
  changedFields = {},
34362
34363
  savingFields = {},
@@ -34393,6 +34394,9 @@ var FormCard = React87.memo(
34393
34394
  const activeEditingFields = isExternallyControlled ? externalEditingFields || {} : internalEditingFields;
34394
34395
  const resolvedSavingFields = Object.keys(savingFields).length > 0 ? savingFields : internalSavingFields;
34395
34396
  const activeData = internalData;
34397
+ const effectiveFields = Array.isArray(fields) && fields.length > 0 ? fields : Object.keys(activeData || {}).filter(
34398
+ (k) => !k.startsWith("_") && activeData[k] != null && typeof activeData[k] !== "function"
34399
+ ).map((key) => ({ key, label: humanizeKey(key) }));
34396
34400
  const handleFieldEdit = (key) => {
34397
34401
  if (externalOnFieldEdit) {
34398
34402
  externalOnFieldEdit(key);
@@ -34443,7 +34447,7 @@ var FormCard = React87.memo(
34443
34447
  const text = [
34444
34448
  title,
34445
34449
  "",
34446
- ...fields.map((field) => {
34450
+ ...effectiveFields.map((field) => {
34447
34451
  const value = activeData[field.key];
34448
34452
  return `${field.label}: ${flattenValue(value)}`;
34449
34453
  })
@@ -34490,7 +34494,7 @@ var FormCard = React87.memo(
34490
34494
  }
34491
34495
  }
34492
34496
  ),
34493
- fields.map((field, index) => /* @__PURE__ */ jsx96(
34497
+ effectiveFields.map((field, index) => /* @__PURE__ */ jsx96(
34494
34498
  EditableField,
34495
34499
  {
34496
34500
  label: field.label,
@@ -34509,7 +34513,7 @@ var FormCard = React87.memo(
34509
34513
  renderEdit: field.renderEdit,
34510
34514
  showIndex: showTimeline,
34511
34515
  index,
34512
- totalFields: fields.length
34516
+ totalFields: effectiveFields.length
34513
34517
  },
34514
34518
  field.key
34515
34519
  ))
@@ -40005,7 +40009,7 @@ var WebSearchJobCard = ({
40005
40009
  /* @__PURE__ */ jsx149("div", { className: "w-2 h-2 rounded-full bg-amber-500 animate-pulse flex-shrink-0" }),
40006
40010
  /* @__PURE__ */ jsx149("span", { className: "text-xs text-zinc-400", children: step })
40007
40011
  ] }),
40008
- phase === "ai_generation" && searchesTotal > 0 && /* @__PURE__ */ jsxs110("div", { className: "pt-1", children: [
40012
+ searchesTotal > 0 && /* @__PURE__ */ jsxs110("div", { className: "pt-1", children: [
40009
40013
  /* @__PURE__ */ jsxs110("div", { className: "flex items-center justify-between mb-1.5", children: [
40010
40014
  /* @__PURE__ */ jsx149("span", { className: "text-xs text-zinc-500", children: "Web searches" }),
40011
40015
  /* @__PURE__ */ jsxs110("span", { className: "text-xs text-zinc-500 tabular-nums", children: [
@@ -40019,7 +40023,7 @@ var WebSearchJobCard = ({
40019
40023
  {
40020
40024
  className: cn(
40021
40025
  "flex-1 h-1 rounded-full transition-all duration-300",
40022
- i < searchesCompleted ? "bg-amber-500" : i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
40026
+ i < searchesCompleted ? "bg-amber-500" : phase === "ai_generation" && i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
40023
40027
  )
40024
40028
  },
40025
40029
  i