pxengine 0.1.23 → 0.1.25

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.d.cts CHANGED
@@ -1766,9 +1766,13 @@ interface CampaignSeedCardProps extends Omit<FormCardProps, "fields"> {
1766
1766
  */
1767
1767
  isLatestMessage?: boolean;
1768
1768
  /**
1769
- * Optional field configuration to override dynamic generation
1770
- */
1769
+ * Optional field configuration to override dynamic generation
1770
+ */
1771
1771
  fields?: FieldConfig[];
1772
+ /**
1773
+ * Optional action handler
1774
+ */
1775
+ onAction?: (action: any) => void;
1772
1776
  }
1773
1777
 
1774
1778
  /**
@@ -1798,9 +1802,13 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
1798
1802
  */
1799
1803
  fields?: FieldConfig[];
1800
1804
  /**
1801
- * Alias for data — the agent schema uses specData as the prop name
1802
- */
1805
+ * Alias for data — the agent schema uses specData as the prop name
1806
+ */
1803
1807
  specData?: Record<string, any>;
1808
+ /**
1809
+ * Optional action handler
1810
+ */
1811
+ onAction?: (action: any) => void;
1804
1812
  }
1805
1813
 
1806
1814
  /**
@@ -2007,6 +2015,10 @@ interface CampaignConceptCardProps extends Omit<FormCardProps, "fields" | "title
2007
2015
  * Whether this is the latest message
2008
2016
  */
2009
2017
  isLatestMessage?: boolean;
2018
+ /**
2019
+ * Optional action handler
2020
+ */
2021
+ onAction?: (action: any) => void;
2010
2022
  }
2011
2023
 
2012
2024
  /**
package/dist/index.d.ts CHANGED
@@ -1766,9 +1766,13 @@ interface CampaignSeedCardProps extends Omit<FormCardProps, "fields"> {
1766
1766
  */
1767
1767
  isLatestMessage?: boolean;
1768
1768
  /**
1769
- * Optional field configuration to override dynamic generation
1770
- */
1769
+ * Optional field configuration to override dynamic generation
1770
+ */
1771
1771
  fields?: FieldConfig[];
1772
+ /**
1773
+ * Optional action handler
1774
+ */
1775
+ onAction?: (action: any) => void;
1772
1776
  }
1773
1777
 
1774
1778
  /**
@@ -1798,9 +1802,13 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
1798
1802
  */
1799
1803
  fields?: FieldConfig[];
1800
1804
  /**
1801
- * Alias for data — the agent schema uses specData as the prop name
1802
- */
1805
+ * Alias for data — the agent schema uses specData as the prop name
1806
+ */
1803
1807
  specData?: Record<string, any>;
1808
+ /**
1809
+ * Optional action handler
1810
+ */
1811
+ onAction?: (action: any) => void;
1804
1812
  }
1805
1813
 
1806
1814
  /**
@@ -2007,6 +2015,10 @@ interface CampaignConceptCardProps extends Omit<FormCardProps, "fields" | "title
2007
2015
  * Whether this is the latest message
2008
2016
  */
2009
2017
  isLatestMessage?: boolean;
2018
+ /**
2019
+ * Optional action handler
2020
+ */
2021
+ onAction?: (action: any) => void;
2010
2022
  }
2011
2023
 
2012
2024
  /**
package/dist/index.mjs CHANGED
@@ -33781,11 +33781,10 @@ var EditableField = React85.memo(
33781
33781
  "h4",
33782
33782
  {
33783
33783
  className: "px-2 py-1 tracking-widest bg-background bg-purple200 text-purpleText dark:text-purple-400 text-[10px] font-bold rounded uppercase",
33784
- style: { fontFamily: "Noto Sans, sans-serif" },
33785
33784
  children: label
33786
33785
  }
33787
33786
  ),
33788
- !isEditingProp && /* @__PURE__ */ jsxs54("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-green-600 dark:text-green-500", children: [
33787
+ !isEditingProp && /* @__PURE__ */ jsxs54("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-green-500 dark:text-green-500", children: [
33789
33788
  "Suggested by an Agent",
33790
33789
  /* @__PURE__ */ jsx94(
33791
33790
  Pencil,
@@ -33963,7 +33962,7 @@ var FormCard = React87.memo(
33963
33962
  "div",
33964
33963
  {
33965
33964
  className: cn(
33966
- "relative w-full rounded-[20px] bg-background dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6",
33965
+ "relative w-full rounded-[20px] bg-background dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6 font-noto",
33967
33966
  className
33968
33967
  ),
33969
33968
  onMouseEnter: () => setShowCopyButton(true),
@@ -33983,7 +33982,6 @@ var FormCard = React87.memo(
33983
33982
  "h3",
33984
33983
  {
33985
33984
  className: "text-gray900 mb-12",
33986
- style: { fontFamily: "Noto Sans, sans-serif" },
33987
33985
  children: title
33988
33986
  }
33989
33987
  ),
@@ -35113,11 +35111,19 @@ var CampaignSeedCard = React90.memo(
35113
35111
  className,
35114
35112
  fields: providedFields,
35115
35113
  data,
35114
+ onAction,
35116
35115
  ...formCardProps
35117
35116
  }) => {
35118
35117
  const fields = useMemo4(() => {
35119
35118
  return providedFields || buildCampaignSeedFields(data);
35120
35119
  }, [providedFields, data]);
35120
+ const handleProceed = () => {
35121
+ onAction?.({
35122
+ type: "brief_confirmation",
35123
+ value: "Continue to concepts",
35124
+ data
35125
+ });
35126
+ };
35121
35127
  return /* @__PURE__ */ jsx107("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx107(
35122
35128
  FormCard,
35123
35129
  {
@@ -35125,6 +35131,8 @@ var CampaignSeedCard = React90.memo(
35125
35131
  data,
35126
35132
  title: formCardProps.title || "Campaign Brief",
35127
35133
  fields,
35134
+ proceedLabel: "Continue to concepts",
35135
+ onProceed: handleProceed,
35128
35136
  showTimeline: true,
35129
35137
  className: cn("font-noto", className),
35130
35138
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ jsxs67("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-[10px] font-semibold py-4 pr-6", children: [
@@ -35206,12 +35214,20 @@ var SearchSpecCard = React91.memo(
35206
35214
  fields: providedFields,
35207
35215
  data,
35208
35216
  specData,
35217
+ onAction,
35209
35218
  ...formCardProps
35210
35219
  }) => {
35211
35220
  const resolvedData = data || specData;
35212
35221
  const fields = useMemo5(() => {
35213
35222
  return providedFields || buildSearchSpecFields(resolvedData ?? {});
35214
35223
  }, [providedFields, resolvedData]);
35224
+ const handleProceed = () => {
35225
+ onAction?.({
35226
+ type: "search_spec_confirmation",
35227
+ value: "Continue with search",
35228
+ data: resolvedData
35229
+ });
35230
+ };
35215
35231
  return /* @__PURE__ */ jsx108(
35216
35232
  FormCard,
35217
35233
  {
@@ -35219,6 +35235,8 @@ var SearchSpecCard = React91.memo(
35219
35235
  data: resolvedData ?? {},
35220
35236
  title: formCardProps.title || "Search Specification",
35221
35237
  fields,
35238
+ proceedLabel: "Continue with search",
35239
+ onProceed: handleProceed,
35222
35240
  className,
35223
35241
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ jsxs68("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1", children: [
35224
35242
  /* @__PURE__ */ jsx108(CircleCheck, { className: "h-4 w-4" }),
@@ -35936,10 +35954,11 @@ var CampaignConceptCard = React94.memo(
35936
35954
  onToggle,
35937
35955
  data,
35938
35956
  fields: providedFields,
35939
- title,
35957
+ title: propsTitle,
35940
35958
  selectionStatus,
35941
35959
  isLatestMessage = true,
35942
35960
  className,
35961
+ onAction,
35943
35962
  ...formCardProps
35944
35963
  }) => {
35945
35964
  const [internalIsOpen, setInternalIsOpen] = useState9(false);
@@ -35951,38 +35970,101 @@ var CampaignConceptCard = React94.memo(
35951
35970
  setInternalIsOpen(!internalIsOpen);
35952
35971
  }
35953
35972
  };
35973
+ const cardTitle = propsTitle || data.title || data.name || data.concept_name || data.conceptName || "Campaign Concept";
35974
+ const handleProceed = () => {
35975
+ onAction?.({
35976
+ type: "concept_selection",
35977
+ value: typeof cardTitle === "string" ? cardTitle : JSON.stringify(cardTitle),
35978
+ data
35979
+ });
35980
+ };
35954
35981
  const fields = useMemo7(() => {
35955
35982
  const baseFields = providedFields || generateFieldsFromData(data);
35956
35983
  return baseFields.map((field) => {
35957
- if (field.key === "budgetAllocation") {
35984
+ if (field.key === "budgetAllocation" || field.key === "budget_allocation") {
35958
35985
  return {
35959
35986
  ...field,
35987
+ label: "Budget Allocation",
35960
35988
  renderDisplay: (val) => {
35961
- if (!Array.isArray(val)) return /* @__PURE__ */ jsx121("span", { children: val });
35962
- return /* @__PURE__ */ jsx121("div", { className: "space-y-2", children: val.map((item, idx) => /* @__PURE__ */ jsxs80("div", { className: "flex items-center gap-2 text-xs font-medium", children: [
35963
- /* @__PURE__ */ jsxs80("span", { children: [
35964
- idx + 1,
35965
- "."
35966
- ] }),
35967
- /* @__PURE__ */ jsx121("div", { className: "bg-background bg-gray400 border border-white/10 px-2 py-0.5 rounded text-gray-300", children: item.label }),
35968
- /* @__PURE__ */ jsx121("span", { className: "text-gray-400", children: "=" }),
35969
- /* @__PURE__ */ jsx121("div", { className: "bg-background bg-gray400 border border-white/10 px-2 py-0.5 rounded text-gray-300", children: item.value })
35970
- ] }, idx)) });
35989
+ if (val && typeof val === "object" && !Array.isArray(val)) {
35990
+ return /* @__PURE__ */ jsx121("div", { className: "flex flex-wrap gap-2 pt-1", children: Object.entries(val).map(([k, v]) => /* @__PURE__ */ jsxs80(
35991
+ "div",
35992
+ {
35993
+ className: "flex items-center gap-1.5 bg-background bg-gray400 border border-white/10 px-2 py-1 rounded shadow-sm",
35994
+ children: [
35995
+ /* @__PURE__ */ jsxs80("span", { className: "text-[10px] text-gray-400 font-bold uppercase tracking-tight", children: [
35996
+ k.replace(/_/g, " "),
35997
+ ":"
35998
+ ] }),
35999
+ /* @__PURE__ */ jsx121("span", { className: "text-xs text-white font-medium", children: String(v) })
36000
+ ]
36001
+ },
36002
+ k
36003
+ )) });
36004
+ }
36005
+ if (Array.isArray(val)) {
36006
+ return /* @__PURE__ */ jsx121("div", { className: "flex flex-wrap gap-2 pt-1", children: val.map((item, idx) => /* @__PURE__ */ jsxs80(
36007
+ "div",
36008
+ {
36009
+ className: "flex items-center gap-1.5 bg-background bg-gray400 border border-white/10 px-2 py-1 rounded shadow-sm",
36010
+ children: [
36011
+ item.label && /* @__PURE__ */ jsxs80("span", { className: "text-[10px] text-gray-400 font-bold uppercase tracking-tight", children: [
36012
+ item.label,
36013
+ ":"
36014
+ ] }),
36015
+ /* @__PURE__ */ jsx121("span", { className: "text-xs text-white font-medium", children: String(item.value || item) })
36016
+ ]
36017
+ },
36018
+ idx
36019
+ )) });
36020
+ }
36021
+ return /* @__PURE__ */ jsx121("span", { className: "text-gray-300 text-sm", children: val ? String(val) : "-" });
35971
36022
  }
35972
36023
  };
35973
36024
  }
35974
- if (field.key === "estimatedCreators") {
36025
+ if (field.key === "estimatedCreators" || field.key === "estimated_creators") {
35975
36026
  return {
35976
36027
  ...field,
36028
+ label: "Estimated Creators",
35977
36029
  renderDisplay: (val) => {
35978
- if (!Array.isArray(val)) return /* @__PURE__ */ jsx121("span", { className: "text-white font-medium", children: val });
35979
- return /* @__PURE__ */ jsx121("div", { className: "flex gap-2", children: val.map((v, idx) => /* @__PURE__ */ jsx121("div", { className: "bg-background bg-gray400 border border-white/10 px-2 py-0.5 rounded text-white text-xs font-medium", children: v }, idx)) });
36030
+ if (Array.isArray(val)) {
36031
+ return /* @__PURE__ */ jsx121("div", { className: "flex gap-2 pt-1", children: val.map((v, idx) => /* @__PURE__ */ jsx121(
36032
+ "div",
36033
+ {
36034
+ className: "bg-background bg-purple200 border border-purple100/20 px-2 py-0.5 rounded text-white text-xs font-medium",
36035
+ children: String(v)
36036
+ },
36037
+ idx
36038
+ )) });
36039
+ }
36040
+ return /* @__PURE__ */ jsx121("span", { className: "text-white font-medium", children: val ? String(val) : "-" });
36041
+ }
36042
+ };
36043
+ }
36044
+ if (field.key === "platforms") {
36045
+ return {
36046
+ ...field,
36047
+ renderDisplay: (val) => {
36048
+ const platforms = Array.isArray(val) ? val : typeof val === "string" ? val.split(/,\s*/) : [val];
36049
+ return /* @__PURE__ */ jsx121("div", { className: "flex flex-wrap gap-1.5 pt-1", children: platforms.map((p) => /* @__PURE__ */ jsx121(
36050
+ "div",
36051
+ {
36052
+ className: "px-2 py-0.5 rounded-full bg-blue-500/10 border border-blue-500/20 text-blue-400 text-[10px] font-bold uppercase",
36053
+ children: String(p)
36054
+ },
36055
+ String(p)
36056
+ )) });
35980
36057
  }
35981
36058
  };
35982
36059
  }
35983
36060
  return {
35984
36061
  ...field,
35985
- renderDisplay: (val) => /* @__PURE__ */ jsx121("span", { className: "text-gray-300 text-sm", children: val })
36062
+ renderDisplay: (val) => {
36063
+ if (typeof val === "object" && val !== null) {
36064
+ return /* @__PURE__ */ jsx121("div", { className: "text-gray-300 text-xs font-mono bg-black/20 p-2 rounded border border-white/5 mt-1 overflow-auto max-h-24", children: JSON.stringify(val, null, 2) });
36065
+ }
36066
+ return /* @__PURE__ */ jsx121("span", { className: "text-gray-300 text-sm", children: String(val) });
36067
+ }
35986
36068
  };
35987
36069
  });
35988
36070
  }, [providedFields, data]);
@@ -36002,13 +36084,19 @@ var CampaignConceptCard = React94.memo(
36002
36084
  onClick: handleToggle,
36003
36085
  children: [
36004
36086
  /* @__PURE__ */ jsxs80("div", { className: "flex flex-col gap-2", children: [
36005
- /* @__PURE__ */ jsx121("h3", { className: "text-lg font-semibold text-white tracking-wide", children: title || data.title }),
36087
+ /* @__PURE__ */ jsx121("h3", { className: "text-lg font-semibold text-white tracking-wide", children: typeof cardTitle === "object" ? JSON.stringify(cardTitle) : String(cardTitle) }),
36006
36088
  isRecommended && /* @__PURE__ */ jsx121("div", { className: "inline-flex text-[10px] font-bold uppercase tracking-widest text-[#22C55E]", children: /* @__PURE__ */ jsx121("span", { className: "bg-[#22C55E]/10 px-2 py-0.5 rounded border border-[#22C55E]/20", children: "Recommended" }) })
36007
36089
  ] }),
36008
- /* @__PURE__ */ jsx121("div", { className: cn(
36009
- "p-2 rounded-lg bg-white/5 border border-white/10 text-gray-400 transition-transform duration-300",
36010
- isOpen && "rotate-180"
36011
- ), children: /* @__PURE__ */ jsx121(ChevronDown, { className: "h-4 w-4" }) })
36090
+ /* @__PURE__ */ jsx121(
36091
+ "div",
36092
+ {
36093
+ className: cn(
36094
+ "p-2 rounded-lg bg-white/5 border border-white/10 text-gray-400 transition-transform duration-300",
36095
+ isOpen && "rotate-180"
36096
+ ),
36097
+ children: /* @__PURE__ */ jsx121(ChevronDown, { className: "h-4 w-4" })
36098
+ }
36099
+ )
36012
36100
  ]
36013
36101
  }
36014
36102
  ),
@@ -36024,10 +36112,12 @@ var CampaignConceptCard = React94.memo(
36024
36112
  FormCard,
36025
36113
  {
36026
36114
  ...formCardProps,
36027
- title: title || data.title || "Campaign Concept",
36115
+ title: typeof cardTitle === "object" ? JSON.stringify(cardTitle) : String(cardTitle),
36028
36116
  data,
36029
36117
  fields,
36030
36118
  showTimeline: true,
36119
+ proceedLabel: "Continue with this concept",
36120
+ onProceed: handleProceed,
36031
36121
  className: "bg-transparent border-none shadow-none mb-0 p-0",
36032
36122
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ jsxs80("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-[10px] font-semibold py-4 pr-6", children: [
36033
36123
  /* @__PURE__ */ jsx121(CircleCheck, { className: "h-3.5 w-3.5" }),