pxengine 0.1.24 → 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.cjs CHANGED
@@ -34049,11 +34049,10 @@ var EditableField = import_react54.default.memo(
34049
34049
  "h4",
34050
34050
  {
34051
34051
  className: "px-2 py-1 tracking-widest bg-background bg-purple200 text-purpleText dark:text-purple-400 text-[10px] font-bold rounded uppercase",
34052
- style: { fontFamily: "Noto Sans, sans-serif" },
34053
34052
  children: label
34054
34053
  }
34055
34054
  ),
34056
- !isEditingProp && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-green-600 dark:text-green-500", children: [
34055
+ !isEditingProp && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-green-500 dark:text-green-500", children: [
34057
34056
  "Suggested by an Agent",
34058
34057
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
34059
34058
  Pencil,
@@ -34231,7 +34230,7 @@ var FormCard = import_react56.default.memo(
34231
34230
  "div",
34232
34231
  {
34233
34232
  className: cn(
34234
- "relative w-full rounded-[20px] bg-background dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6",
34233
+ "relative w-full rounded-[20px] bg-background dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6 font-noto",
34235
34234
  className
34236
34235
  ),
34237
34236
  onMouseEnter: () => setShowCopyButton(true),
@@ -34251,7 +34250,6 @@ var FormCard = import_react56.default.memo(
34251
34250
  "h3",
34252
34251
  {
34253
34252
  className: "text-gray900 mb-12",
34254
- style: { fontFamily: "Noto Sans, sans-serif" },
34255
34253
  children: title
34256
34254
  }
34257
34255
  ),
@@ -35381,11 +35379,19 @@ var CampaignSeedCard = import_react60.default.memo(
35381
35379
  className,
35382
35380
  fields: providedFields,
35383
35381
  data,
35382
+ onAction,
35384
35383
  ...formCardProps
35385
35384
  }) => {
35386
35385
  const fields = (0, import_react60.useMemo)(() => {
35387
35386
  return providedFields || buildCampaignSeedFields(data);
35388
35387
  }, [providedFields, data]);
35388
+ const handleProceed = () => {
35389
+ onAction?.({
35390
+ type: "brief_confirmation",
35391
+ value: "Continue to concepts",
35392
+ data
35393
+ });
35394
+ };
35389
35395
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35390
35396
  FormCard,
35391
35397
  {
@@ -35393,6 +35399,8 @@ var CampaignSeedCard = import_react60.default.memo(
35393
35399
  data,
35394
35400
  title: formCardProps.title || "Campaign Brief",
35395
35401
  fields,
35402
+ proceedLabel: "Continue to concepts",
35403
+ onProceed: handleProceed,
35396
35404
  showTimeline: true,
35397
35405
  className: cn("font-noto", className),
35398
35406
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-[10px] font-semibold py-4 pr-6", children: [
@@ -35474,12 +35482,20 @@ var SearchSpecCard = import_react61.default.memo(
35474
35482
  fields: providedFields,
35475
35483
  data,
35476
35484
  specData,
35485
+ onAction,
35477
35486
  ...formCardProps
35478
35487
  }) => {
35479
35488
  const resolvedData = data || specData;
35480
35489
  const fields = (0, import_react61.useMemo)(() => {
35481
35490
  return providedFields || buildSearchSpecFields(resolvedData ?? {});
35482
35491
  }, [providedFields, resolvedData]);
35492
+ const handleProceed = () => {
35493
+ onAction?.({
35494
+ type: "search_spec_confirmation",
35495
+ value: "Continue with search",
35496
+ data: resolvedData
35497
+ });
35498
+ };
35483
35499
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35484
35500
  FormCard,
35485
35501
  {
@@ -35487,6 +35503,8 @@ var SearchSpecCard = import_react61.default.memo(
35487
35503
  data: resolvedData ?? {},
35488
35504
  title: formCardProps.title || "Search Specification",
35489
35505
  fields,
35506
+ proceedLabel: "Continue with search",
35507
+ onProceed: handleProceed,
35490
35508
  className,
35491
35509
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1", children: [
35492
35510
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CircleCheck, { className: "h-4 w-4" }),
@@ -36204,10 +36222,11 @@ var CampaignConceptCard = import_react64.default.memo(
36204
36222
  onToggle,
36205
36223
  data,
36206
36224
  fields: providedFields,
36207
- title,
36225
+ title: propsTitle,
36208
36226
  selectionStatus,
36209
36227
  isLatestMessage = true,
36210
36228
  className,
36229
+ onAction,
36211
36230
  ...formCardProps
36212
36231
  }) => {
36213
36232
  const [internalIsOpen, setInternalIsOpen] = (0, import_react64.useState)(false);
@@ -36219,38 +36238,101 @@ var CampaignConceptCard = import_react64.default.memo(
36219
36238
  setInternalIsOpen(!internalIsOpen);
36220
36239
  }
36221
36240
  };
36241
+ const cardTitle = propsTitle || data.title || data.name || data.concept_name || data.conceptName || "Campaign Concept";
36242
+ const handleProceed = () => {
36243
+ onAction?.({
36244
+ type: "concept_selection",
36245
+ value: typeof cardTitle === "string" ? cardTitle : JSON.stringify(cardTitle),
36246
+ data
36247
+ });
36248
+ };
36222
36249
  const fields = (0, import_react64.useMemo)(() => {
36223
36250
  const baseFields = providedFields || generateFieldsFromData(data);
36224
36251
  return baseFields.map((field) => {
36225
- if (field.key === "budgetAllocation") {
36252
+ if (field.key === "budgetAllocation" || field.key === "budget_allocation") {
36226
36253
  return {
36227
36254
  ...field,
36255
+ label: "Budget Allocation",
36228
36256
  renderDisplay: (val) => {
36229
- if (!Array.isArray(val)) return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { children: val });
36230
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "space-y-2", children: val.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex items-center gap-2 text-xs font-medium", children: [
36231
- /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("span", { children: [
36232
- idx + 1,
36233
- "."
36234
- ] }),
36235
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "bg-background bg-gray400 border border-white/10 px-2 py-0.5 rounded text-gray-300", children: item.label }),
36236
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-gray-400", children: "=" }),
36237
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "bg-background bg-gray400 border border-white/10 px-2 py-0.5 rounded text-gray-300", children: item.value })
36238
- ] }, idx)) });
36257
+ if (val && typeof val === "object" && !Array.isArray(val)) {
36258
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex flex-wrap gap-2 pt-1", children: Object.entries(val).map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
36259
+ "div",
36260
+ {
36261
+ className: "flex items-center gap-1.5 bg-background bg-gray400 border border-white/10 px-2 py-1 rounded shadow-sm",
36262
+ children: [
36263
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("span", { className: "text-[10px] text-gray-400 font-bold uppercase tracking-tight", children: [
36264
+ k.replace(/_/g, " "),
36265
+ ":"
36266
+ ] }),
36267
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-xs text-white font-medium", children: String(v) })
36268
+ ]
36269
+ },
36270
+ k
36271
+ )) });
36272
+ }
36273
+ if (Array.isArray(val)) {
36274
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex flex-wrap gap-2 pt-1", children: val.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
36275
+ "div",
36276
+ {
36277
+ className: "flex items-center gap-1.5 bg-background bg-gray400 border border-white/10 px-2 py-1 rounded shadow-sm",
36278
+ children: [
36279
+ item.label && /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("span", { className: "text-[10px] text-gray-400 font-bold uppercase tracking-tight", children: [
36280
+ item.label,
36281
+ ":"
36282
+ ] }),
36283
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-xs text-white font-medium", children: String(item.value || item) })
36284
+ ]
36285
+ },
36286
+ idx
36287
+ )) });
36288
+ }
36289
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-gray-300 text-sm", children: val ? String(val) : "-" });
36239
36290
  }
36240
36291
  };
36241
36292
  }
36242
- if (field.key === "estimatedCreators") {
36293
+ if (field.key === "estimatedCreators" || field.key === "estimated_creators") {
36243
36294
  return {
36244
36295
  ...field,
36296
+ label: "Estimated Creators",
36245
36297
  renderDisplay: (val) => {
36246
- if (!Array.isArray(val)) return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-white font-medium", children: val });
36247
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex gap-2", children: val.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("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)) });
36298
+ if (Array.isArray(val)) {
36299
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex gap-2 pt-1", children: val.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
36300
+ "div",
36301
+ {
36302
+ className: "bg-background bg-purple200 border border-purple100/20 px-2 py-0.5 rounded text-white text-xs font-medium",
36303
+ children: String(v)
36304
+ },
36305
+ idx
36306
+ )) });
36307
+ }
36308
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-white font-medium", children: val ? String(val) : "-" });
36309
+ }
36310
+ };
36311
+ }
36312
+ if (field.key === "platforms") {
36313
+ return {
36314
+ ...field,
36315
+ renderDisplay: (val) => {
36316
+ const platforms = Array.isArray(val) ? val : typeof val === "string" ? val.split(/,\s*/) : [val];
36317
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "flex flex-wrap gap-1.5 pt-1", children: platforms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
36318
+ "div",
36319
+ {
36320
+ 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",
36321
+ children: String(p)
36322
+ },
36323
+ String(p)
36324
+ )) });
36248
36325
  }
36249
36326
  };
36250
36327
  }
36251
36328
  return {
36252
36329
  ...field,
36253
- renderDisplay: (val) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-gray-300 text-sm", children: val })
36330
+ renderDisplay: (val) => {
36331
+ if (typeof val === "object" && val !== null) {
36332
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("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) });
36333
+ }
36334
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "text-gray-300 text-sm", children: String(val) });
36335
+ }
36254
36336
  };
36255
36337
  });
36256
36338
  }, [providedFields, data]);
@@ -36270,13 +36352,19 @@ var CampaignConceptCard = import_react64.default.memo(
36270
36352
  onClick: handleToggle,
36271
36353
  children: [
36272
36354
  /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex flex-col gap-2", children: [
36273
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h3", { className: "text-lg font-semibold text-white tracking-wide", children: title || data.title }),
36355
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("h3", { className: "text-lg font-semibold text-white tracking-wide", children: typeof cardTitle === "object" ? JSON.stringify(cardTitle) : String(cardTitle) }),
36274
36356
  isRecommended && /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: "inline-flex text-[10px] font-bold uppercase tracking-widest text-[#22C55E]", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { className: "bg-[#22C55E]/10 px-2 py-0.5 rounded border border-[#22C55E]/20", children: "Recommended" }) })
36275
36357
  ] }),
36276
- /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { className: cn(
36277
- "p-2 rounded-lg bg-white/5 border border-white/10 text-gray-400 transition-transform duration-300",
36278
- isOpen && "rotate-180"
36279
- ), children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ChevronDown, { className: "h-4 w-4" }) })
36358
+ /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
36359
+ "div",
36360
+ {
36361
+ className: cn(
36362
+ "p-2 rounded-lg bg-white/5 border border-white/10 text-gray-400 transition-transform duration-300",
36363
+ isOpen && "rotate-180"
36364
+ ),
36365
+ children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ChevronDown, { className: "h-4 w-4" })
36366
+ }
36367
+ )
36280
36368
  ]
36281
36369
  }
36282
36370
  ),
@@ -36292,10 +36380,12 @@ var CampaignConceptCard = import_react64.default.memo(
36292
36380
  FormCard,
36293
36381
  {
36294
36382
  ...formCardProps,
36295
- title: title || data.title || "Campaign Concept",
36383
+ title: typeof cardTitle === "object" ? JSON.stringify(cardTitle) : String(cardTitle),
36296
36384
  data,
36297
36385
  fields,
36298
36386
  showTimeline: true,
36387
+ proceedLabel: "Continue with this concept",
36388
+ onProceed: handleProceed,
36299
36389
  className: "bg-transparent border-none shadow-none mb-0 p-0",
36300
36390
  footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-[10px] font-semibold py-4 pr-6", children: [
36301
36391
  /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(CircleCheck, { className: "h-3.5 w-3.5" }),