pxengine 0.1.29 → 0.1.31
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 +243 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +243 -42
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -25272,7 +25272,7 @@ var InputAtom = ({
|
|
|
25272
25272
|
import { cva as cva3 } from "class-variance-authority";
|
|
25273
25273
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
25274
25274
|
var badgeVariants = cva3(
|
|
25275
|
-
"inline-flex items-center rounded-full border px-2.5 py-
|
|
25275
|
+
"inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
25276
25276
|
{
|
|
25277
25277
|
variants: {
|
|
25278
25278
|
variant: {
|
|
@@ -33788,7 +33788,7 @@ var EditableField = React85.memo(
|
|
|
33788
33788
|
"div",
|
|
33789
33789
|
{
|
|
33790
33790
|
className: cn(
|
|
33791
|
-
"relative z-10 group flex flex-col gap-2 p-3 bg-
|
|
33791
|
+
"relative z-10 group flex flex-col gap-2 p-3 bg-paperBackground rounded-md mb-8",
|
|
33792
33792
|
className
|
|
33793
33793
|
),
|
|
33794
33794
|
children: [
|
|
@@ -33800,13 +33800,14 @@ var EditableField = React85.memo(
|
|
|
33800
33800
|
children: label
|
|
33801
33801
|
}
|
|
33802
33802
|
),
|
|
33803
|
-
!isEditingProp && /* @__PURE__ */ jsxs54("span", { className: "inline-flex items-center gap-1 text-[
|
|
33803
|
+
!isEditingProp && /* @__PURE__ */ jsxs54("span", { className: "inline-flex items-center gap-1.5 text-[0.75rem] font-medium text-green-600 dark:text-green-500 bg-green-500/5 px-2 py-0.5 rounded-full ", children: [
|
|
33804
33804
|
"Suggested by an Agent",
|
|
33805
33805
|
/* @__PURE__ */ jsx94(
|
|
33806
|
-
|
|
33806
|
+
"span",
|
|
33807
33807
|
{
|
|
33808
|
-
className: "
|
|
33809
|
-
onClick: onEdit
|
|
33808
|
+
className: "flex items-center gap-1 cursor-pointer text-foreground hover:text-green-700 transition-colors ml-1 pl-1.5 ",
|
|
33809
|
+
onClick: onEdit,
|
|
33810
|
+
children: /* @__PURE__ */ jsx94(SquarePen, { className: "h-5 w-5" })
|
|
33810
33811
|
}
|
|
33811
33812
|
)
|
|
33812
33813
|
] })
|
|
@@ -33819,7 +33820,7 @@ var EditableField = React85.memo(
|
|
|
33819
33820
|
{
|
|
33820
33821
|
size: "icon",
|
|
33821
33822
|
variant: "outline",
|
|
33822
|
-
className: "h-8 w-8 text-
|
|
33823
|
+
className: "h-8 w-8 text-foreground rounded-lg",
|
|
33823
33824
|
onClick: onCancel,
|
|
33824
33825
|
disabled: isSaving,
|
|
33825
33826
|
children: /* @__PURE__ */ jsx94(X, { className: "h-4 w-4" })
|
|
@@ -33829,10 +33830,10 @@ var EditableField = React85.memo(
|
|
|
33829
33830
|
Button,
|
|
33830
33831
|
{
|
|
33831
33832
|
size: "icon",
|
|
33832
|
-
className: "h-8 w-8
|
|
33833
|
+
className: "h-8 w-8 text-foreground rounded-lg shadow-none",
|
|
33833
33834
|
onClick: handleSave,
|
|
33834
33835
|
disabled: isSaving,
|
|
33835
|
-
children: isSaving ? /* @__PURE__ */ jsx94(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx94(
|
|
33836
|
+
children: isSaving ? /* @__PURE__ */ jsx94(LoaderCircle, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx94(Save, { className: "h-4 w-4" })
|
|
33836
33837
|
}
|
|
33837
33838
|
)
|
|
33838
33839
|
] })
|
|
@@ -33840,9 +33841,10 @@ var EditableField = React85.memo(
|
|
|
33840
33841
|
"div",
|
|
33841
33842
|
{
|
|
33842
33843
|
className: cn(
|
|
33843
|
-
"relative flex items-
|
|
33844
|
-
"text-
|
|
33844
|
+
"relative flex items-start justify-between rounded-lg px-3 py-2",
|
|
33845
|
+
"text-base text-foreground/90 font-medium leading-relaxed"
|
|
33845
33846
|
),
|
|
33847
|
+
style: { fontFamily: "Noto Sans, sans-serif" },
|
|
33846
33848
|
children: /* @__PURE__ */ jsx94("div", { className: "flex-1", children: formattedValue() })
|
|
33847
33849
|
}
|
|
33848
33850
|
)
|
|
@@ -33953,12 +33955,12 @@ var FormCard = React87.memo(
|
|
|
33953
33955
|
title,
|
|
33954
33956
|
fields,
|
|
33955
33957
|
data,
|
|
33956
|
-
editingFields
|
|
33958
|
+
editingFields: externalEditingFields,
|
|
33957
33959
|
changedFields = {},
|
|
33958
33960
|
savingFields = {},
|
|
33959
|
-
onFieldEdit,
|
|
33960
|
-
onFieldSave,
|
|
33961
|
-
onFieldCancel,
|
|
33961
|
+
onFieldEdit: externalOnFieldEdit,
|
|
33962
|
+
onFieldSave: externalOnFieldSave,
|
|
33963
|
+
onFieldCancel: externalOnFieldCancel,
|
|
33962
33964
|
showTimeline = true,
|
|
33963
33965
|
proceedLabel,
|
|
33964
33966
|
onProceed,
|
|
@@ -33969,6 +33971,36 @@ var FormCard = React87.memo(
|
|
|
33969
33971
|
footer
|
|
33970
33972
|
}) => {
|
|
33971
33973
|
const [copied, setCopied] = useState7(false);
|
|
33974
|
+
const [internalEditingFields, setInternalEditingFields] = useState7({});
|
|
33975
|
+
const [internalData, setInternalData] = useState7(data);
|
|
33976
|
+
React87.useEffect(() => {
|
|
33977
|
+
setInternalData(data);
|
|
33978
|
+
}, [data]);
|
|
33979
|
+
const isExternallyControlled = !!(externalOnFieldEdit || externalOnFieldSave || externalOnFieldCancel);
|
|
33980
|
+
const editingFields = isExternallyControlled ? externalEditingFields || {} : internalEditingFields;
|
|
33981
|
+
const activeData = isExternallyControlled ? data : internalData;
|
|
33982
|
+
const handleFieldEdit = (key) => {
|
|
33983
|
+
if (isExternallyControlled) {
|
|
33984
|
+
externalOnFieldEdit?.(key);
|
|
33985
|
+
} else {
|
|
33986
|
+
setInternalEditingFields((prev) => ({ ...prev, [key]: true }));
|
|
33987
|
+
}
|
|
33988
|
+
};
|
|
33989
|
+
const handleFieldSave = (key, newValue) => {
|
|
33990
|
+
if (isExternallyControlled) {
|
|
33991
|
+
externalOnFieldSave?.(key, newValue);
|
|
33992
|
+
} else {
|
|
33993
|
+
setInternalData((prev) => ({ ...prev, [key]: newValue }));
|
|
33994
|
+
setInternalEditingFields((prev) => ({ ...prev, [key]: false }));
|
|
33995
|
+
}
|
|
33996
|
+
};
|
|
33997
|
+
const handleFieldCancel = (key) => {
|
|
33998
|
+
if (isExternallyControlled) {
|
|
33999
|
+
externalOnFieldCancel?.(key);
|
|
34000
|
+
} else {
|
|
34001
|
+
setInternalEditingFields((prev) => ({ ...prev, [key]: false }));
|
|
34002
|
+
}
|
|
34003
|
+
};
|
|
33972
34004
|
const handleCopyAll = () => {
|
|
33973
34005
|
const flattenValue = (val) => {
|
|
33974
34006
|
if (val === null || val === void 0) return "-";
|
|
@@ -33989,7 +34021,7 @@ var FormCard = React87.memo(
|
|
|
33989
34021
|
title,
|
|
33990
34022
|
"",
|
|
33991
34023
|
...fields.map((field) => {
|
|
33992
|
-
const value =
|
|
34024
|
+
const value = activeData[field.key];
|
|
33993
34025
|
return `${field.label}: ${flattenValue(value)}`;
|
|
33994
34026
|
})
|
|
33995
34027
|
].join("\n");
|
|
@@ -34002,7 +34034,7 @@ var FormCard = React87.memo(
|
|
|
34002
34034
|
"div",
|
|
34003
34035
|
{
|
|
34004
34036
|
className: cn(
|
|
34005
|
-
"relative w-full rounded-[20px] bg-
|
|
34037
|
+
"relative w-full rounded-[20px] bg-paperBackground dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6 font-noto",
|
|
34006
34038
|
className
|
|
34007
34039
|
),
|
|
34008
34040
|
children: [
|
|
@@ -34019,7 +34051,7 @@ var FormCard = React87.memo(
|
|
|
34019
34051
|
!hideTitle && title && /* @__PURE__ */ jsx96(
|
|
34020
34052
|
"h3",
|
|
34021
34053
|
{
|
|
34022
|
-
className: "text-gray900 dark:text-white mb-12 font-bold",
|
|
34054
|
+
className: "text-gray900 dark:text-white mb-12 text-[1rem] font-bold",
|
|
34023
34055
|
children: title
|
|
34024
34056
|
}
|
|
34025
34057
|
),
|
|
@@ -34039,16 +34071,16 @@ var FormCard = React87.memo(
|
|
|
34039
34071
|
EditableField,
|
|
34040
34072
|
{
|
|
34041
34073
|
label: field.label,
|
|
34042
|
-
value:
|
|
34074
|
+
value: activeData[field.key],
|
|
34043
34075
|
type: field.type,
|
|
34044
34076
|
config: field,
|
|
34045
34077
|
isEditing: editingFields[field.key],
|
|
34046
34078
|
isChanged: changedFields[field.key],
|
|
34047
34079
|
isSaving: savingFields[field.key],
|
|
34048
34080
|
isLatestMessage,
|
|
34049
|
-
onEdit: () =>
|
|
34050
|
-
onSave: (val) =>
|
|
34051
|
-
onCancel: () =>
|
|
34081
|
+
onEdit: () => handleFieldEdit(field.key),
|
|
34082
|
+
onSave: (val) => handleFieldSave(field.key, val),
|
|
34083
|
+
onCancel: () => handleFieldCancel(field.key),
|
|
34052
34084
|
renderDisplay: field.renderDisplay,
|
|
34053
34085
|
renderEdit: field.renderEdit,
|
|
34054
34086
|
showIndex: showTimeline,
|
|
@@ -34909,7 +34941,7 @@ var CountrySelectDisplay = ({ value }) => {
|
|
|
34909
34941
|
Badge2,
|
|
34910
34942
|
{
|
|
34911
34943
|
variant: "outline",
|
|
34912
|
-
className: "
|
|
34944
|
+
className: "text-foreground border-gray-200 py-1",
|
|
34913
34945
|
children: countryCode
|
|
34914
34946
|
},
|
|
34915
34947
|
countryCode
|
|
@@ -34929,7 +34961,7 @@ var KeywordBundlesEdit = ({
|
|
|
34929
34961
|
const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
|
|
34930
34962
|
return /* @__PURE__ */ jsx106("div", { className: "space-y-6 pt-2", children: sortedPriorities.map((priority) => /* @__PURE__ */ jsxs66("div", { className: "space-y-3", children: [
|
|
34931
34963
|
/* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
|
|
34932
|
-
/* @__PURE__ */ jsxs66(Badge2, { className: "bg-purple500 hover:bg-purple500", children: [
|
|
34964
|
+
/* @__PURE__ */ jsxs66(Badge2, { className: "bg-purple500 hover:bg-purple500 py-1", children: [
|
|
34933
34965
|
"Priority ",
|
|
34934
34966
|
priority
|
|
34935
34967
|
] }),
|
|
@@ -34945,7 +34977,7 @@ var KeywordBundlesEdit = ({
|
|
|
34945
34977
|
/* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-1.5", children: Array.isArray(bundle.keywords) && bundle.keywords.map((keyword, kIndex) => /* @__PURE__ */ jsxs66(
|
|
34946
34978
|
Badge2,
|
|
34947
34979
|
{
|
|
34948
|
-
className: "bg-white border-gray-200 text-gray-700 hover:bg-red-50 hover:text-red-600 hover:border-red-100 transition-all cursor-pointer group",
|
|
34980
|
+
className: "bg-white py-1 border-gray-200 text-gray-700 hover:bg-red-50 hover:text-red-600 hover:border-red-100 transition-all cursor-pointer group",
|
|
34949
34981
|
onClick: () => {
|
|
34950
34982
|
const updatedBundles = [...bundles];
|
|
34951
34983
|
updatedBundles[bundleIndex] = {
|
|
@@ -35039,7 +35071,7 @@ var KeywordBundlesDisplay = ({ value }) => {
|
|
|
35039
35071
|
/* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-2", children: deduped.map((keyword) => /* @__PURE__ */ jsx106(
|
|
35040
35072
|
"div",
|
|
35041
35073
|
{
|
|
35042
|
-
className: "px-2 py-1 rounded bg-background
|
|
35074
|
+
className: "px-2 py-1 rounded bg-background border text-gray-300 text-sm font-medium py-1",
|
|
35043
35075
|
children: keyword
|
|
35044
35076
|
},
|
|
35045
35077
|
keyword
|
|
@@ -35063,7 +35095,7 @@ var ObjectDisplay = ({ value }) => {
|
|
|
35063
35095
|
var StringArrayDisplay = ({ value }) => {
|
|
35064
35096
|
if (!Array.isArray(value) || value.length === 0)
|
|
35065
35097
|
return /* @__PURE__ */ jsx107("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
|
|
35066
|
-
return /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx107(Badge2, { variant: "outline", className: "text-
|
|
35098
|
+
return /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx107(Badge2, { variant: "outline", className: "text-sm border-gray-200 py-1", children: item }, item)) });
|
|
35067
35099
|
};
|
|
35068
35100
|
function buildCampaignSeedFields(data) {
|
|
35069
35101
|
if (!data || typeof data !== "object") return [];
|
|
@@ -35074,7 +35106,32 @@ function buildCampaignSeedFields(data) {
|
|
|
35074
35106
|
key,
|
|
35075
35107
|
label: "Keyword Bundles",
|
|
35076
35108
|
type: "custom",
|
|
35077
|
-
renderDisplay: (v) => /* @__PURE__ */ jsx107(KeywordBundlesDisplay, { value: v })
|
|
35109
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(KeywordBundlesDisplay, { value: v }),
|
|
35110
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx107(
|
|
35111
|
+
Textarea,
|
|
35112
|
+
{
|
|
35113
|
+
value: Array.isArray(v) ? v.map((b) => `${(b.keywords || []).join(", ")} (Priority: ${b.priority || 1})`).join("\n") : String(v || ""),
|
|
35114
|
+
onChange: (e) => {
|
|
35115
|
+
const lines = e.target.value.split("\n").filter(Boolean);
|
|
35116
|
+
const bundles = lines.map((line) => {
|
|
35117
|
+
const match2 = line.match(/(.*?)\s*\(Priority:\s*(\d+)\)/i);
|
|
35118
|
+
if (match2) {
|
|
35119
|
+
return {
|
|
35120
|
+
keywords: match2[1].split(",").map((s) => s.trim()).filter(Boolean),
|
|
35121
|
+
priority: parseInt(match2[2]) || 1
|
|
35122
|
+
};
|
|
35123
|
+
}
|
|
35124
|
+
return {
|
|
35125
|
+
keywords: line.split(",").map((s) => s.trim()).filter(Boolean),
|
|
35126
|
+
priority: 1
|
|
35127
|
+
};
|
|
35128
|
+
});
|
|
35129
|
+
onChange(bundles);
|
|
35130
|
+
},
|
|
35131
|
+
placeholder: "Keyword 1, Keyword 2 (Priority: 1)...",
|
|
35132
|
+
className: "min-h-[120px] bg-background border-gray-300"
|
|
35133
|
+
}
|
|
35134
|
+
)
|
|
35078
35135
|
};
|
|
35079
35136
|
}
|
|
35080
35137
|
if (key === "geography") {
|
|
@@ -35082,7 +35139,19 @@ function buildCampaignSeedFields(data) {
|
|
|
35082
35139
|
key,
|
|
35083
35140
|
label: "Geography",
|
|
35084
35141
|
type: "custom",
|
|
35085
|
-
renderDisplay: (v) => /* @__PURE__ */ jsx107(CountrySelectDisplay, { value: v })
|
|
35142
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(CountrySelectDisplay, { value: v }),
|
|
35143
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx107(
|
|
35144
|
+
Textarea,
|
|
35145
|
+
{
|
|
35146
|
+
value: Array.isArray(v) ? v.join(", ") : String(v || ""),
|
|
35147
|
+
onChange: (e) => {
|
|
35148
|
+
const items = e.target.value.split(",").map((s) => s.trim().toUpperCase()).filter(Boolean);
|
|
35149
|
+
onChange(items);
|
|
35150
|
+
},
|
|
35151
|
+
placeholder: "Enter country codes (US, GB, PK) separated by commas...",
|
|
35152
|
+
className: "min-h-[80px] bg-background border-gray-300"
|
|
35153
|
+
}
|
|
35154
|
+
)
|
|
35086
35155
|
};
|
|
35087
35156
|
}
|
|
35088
35157
|
if (key === "platforms" && Array.isArray(value)) {
|
|
@@ -35103,7 +35172,19 @@ function buildCampaignSeedFields(data) {
|
|
|
35103
35172
|
},
|
|
35104
35173
|
p
|
|
35105
35174
|
)) });
|
|
35106
|
-
}
|
|
35175
|
+
},
|
|
35176
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx107(
|
|
35177
|
+
Textarea,
|
|
35178
|
+
{
|
|
35179
|
+
value: Array.isArray(v) ? v.join(", ") : String(v || ""),
|
|
35180
|
+
onChange: (e) => {
|
|
35181
|
+
const items = e.target.value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
35182
|
+
onChange(items);
|
|
35183
|
+
},
|
|
35184
|
+
placeholder: "Enter platforms separated by commas...",
|
|
35185
|
+
className: "min-h-[80px] bg-background border-gray-300"
|
|
35186
|
+
}
|
|
35187
|
+
)
|
|
35107
35188
|
};
|
|
35108
35189
|
}
|
|
35109
35190
|
if (Array.isArray(value) && value.every((v) => typeof v === "string")) {
|
|
@@ -35135,7 +35216,26 @@ function buildCampaignSeedFields(data) {
|
|
|
35135
35216
|
key,
|
|
35136
35217
|
label,
|
|
35137
35218
|
type: "custom",
|
|
35138
|
-
renderDisplay: (v) => /* @__PURE__ */ jsx107(ObjectDisplay, { value: v })
|
|
35219
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(ObjectDisplay, { value: v }),
|
|
35220
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx107(
|
|
35221
|
+
Textarea,
|
|
35222
|
+
{
|
|
35223
|
+
value: Object.entries(v || {}).map(([k, val]) => `${k.replace(/_/g, " ")}: ${val}`).join("\n"),
|
|
35224
|
+
onChange: (e) => {
|
|
35225
|
+
const lines = e.target.value.split("\n").filter(Boolean);
|
|
35226
|
+
const newObj = {};
|
|
35227
|
+
lines.forEach((line) => {
|
|
35228
|
+
const [k, ...rest] = line.split(":");
|
|
35229
|
+
if (k) {
|
|
35230
|
+
newObj[k.trim().replace(/\s+/g, "_").toLowerCase()] = rest.join(":").trim();
|
|
35231
|
+
}
|
|
35232
|
+
});
|
|
35233
|
+
onChange(newObj);
|
|
35234
|
+
},
|
|
35235
|
+
placeholder: "Enter key: value pairs (one per line)...",
|
|
35236
|
+
className: "min-h-[120px] bg-background border-gray-300 font-mono text-xs"
|
|
35237
|
+
}
|
|
35238
|
+
)
|
|
35139
35239
|
};
|
|
35140
35240
|
}
|
|
35141
35241
|
const [generated] = generateFieldsFromData({ [key]: value });
|
|
@@ -35202,7 +35302,7 @@ var ObjectDisplay2 = ({ value }) => {
|
|
|
35202
35302
|
var StringArrayDisplay2 = ({ value }) => {
|
|
35203
35303
|
if (!Array.isArray(value) || value.length === 0)
|
|
35204
35304
|
return /* @__PURE__ */ jsx108("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
|
|
35205
|
-
return /* @__PURE__ */ jsx108("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx108(Badge2, { variant: "outline", className: "text-
|
|
35305
|
+
return /* @__PURE__ */ jsx108("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx108(Badge2, { variant: "outline", className: "text-sm border-gray-200 py-1", children: item }, item)) });
|
|
35206
35306
|
};
|
|
35207
35307
|
function buildSearchSpecFields(data) {
|
|
35208
35308
|
if (!data || typeof data !== "object") return [];
|
|
@@ -35226,12 +35326,25 @@ function buildSearchSpecFields(data) {
|
|
|
35226
35326
|
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(CountrySelectEdit, { value: v, onChange })
|
|
35227
35327
|
};
|
|
35228
35328
|
}
|
|
35229
|
-
if (key === "platforms" && Array.isArray(value)) {
|
|
35329
|
+
if ((key === "platforms" || key === "exclude_keywords" || key === "excludeKeywords") && Array.isArray(value)) {
|
|
35330
|
+
const label = key === "platforms" ? "Platforms" : "Exclude Keywords";
|
|
35230
35331
|
return {
|
|
35231
35332
|
key,
|
|
35232
|
-
label
|
|
35333
|
+
label,
|
|
35233
35334
|
type: "custom",
|
|
35234
|
-
renderDisplay: (v) => /* @__PURE__ */ jsx108(StringArrayDisplay2, { value: v })
|
|
35335
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(StringArrayDisplay2, { value: v }),
|
|
35336
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(
|
|
35337
|
+
Textarea,
|
|
35338
|
+
{
|
|
35339
|
+
value: Array.isArray(v) ? v.join(", ") : String(v || ""),
|
|
35340
|
+
onChange: (e) => {
|
|
35341
|
+
const items = e.target.value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
35342
|
+
onChange(items);
|
|
35343
|
+
},
|
|
35344
|
+
placeholder: `Enter ${label.toLowerCase()} separated by commas...`,
|
|
35345
|
+
className: "min-h-[100px] bg-background border-gray-300"
|
|
35346
|
+
}
|
|
35347
|
+
)
|
|
35235
35348
|
};
|
|
35236
35349
|
}
|
|
35237
35350
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && !("min" in value && "max" in value)) {
|
|
@@ -35240,7 +35353,26 @@ function buildSearchSpecFields(data) {
|
|
|
35240
35353
|
key,
|
|
35241
35354
|
label,
|
|
35242
35355
|
type: "custom",
|
|
35243
|
-
renderDisplay: (v) => /* @__PURE__ */ jsx108(ObjectDisplay2, { value: v })
|
|
35356
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(ObjectDisplay2, { value: v }),
|
|
35357
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(
|
|
35358
|
+
Textarea,
|
|
35359
|
+
{
|
|
35360
|
+
value: Object.entries(v || {}).map(([k, val]) => `${k.replace(/_/g, " ")}: ${val}`).join("\n"),
|
|
35361
|
+
onChange: (e) => {
|
|
35362
|
+
const lines = e.target.value.split("\n").filter(Boolean);
|
|
35363
|
+
const newObj = {};
|
|
35364
|
+
lines.forEach((line) => {
|
|
35365
|
+
const [k, ...rest] = line.split(":");
|
|
35366
|
+
if (k) {
|
|
35367
|
+
newObj[k.trim().replace(/\s+/g, "_").toLowerCase()] = rest.join(":").trim();
|
|
35368
|
+
}
|
|
35369
|
+
});
|
|
35370
|
+
onChange(newObj);
|
|
35371
|
+
},
|
|
35372
|
+
placeholder: "Enter key: value pairs (one per line)...",
|
|
35373
|
+
className: "min-h-[120px] bg-background border-gray-300 font-mono text-xs"
|
|
35374
|
+
}
|
|
35375
|
+
)
|
|
35244
35376
|
};
|
|
35245
35377
|
}
|
|
35246
35378
|
const [generated] = generateFieldsFromData({ [key]: value });
|
|
@@ -36124,7 +36256,26 @@ var CampaignConceptCard = React94.memo(
|
|
|
36124
36256
|
] }, k)) });
|
|
36125
36257
|
}
|
|
36126
36258
|
return /* @__PURE__ */ jsx121("span", { className: "text-muted-foreground text-sm", children: String(val) });
|
|
36127
|
-
}
|
|
36259
|
+
},
|
|
36260
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx121(
|
|
36261
|
+
Textarea,
|
|
36262
|
+
{
|
|
36263
|
+
value: typeof v === "object" ? Object.entries(v || {}).map(([k, val]) => `${k.replace(/_/g, " ")}: ${val}`).join("\n") : String(v || ""),
|
|
36264
|
+
onChange: (e) => {
|
|
36265
|
+
const lines = e.target.value.split("\n").filter(Boolean);
|
|
36266
|
+
const newObj = {};
|
|
36267
|
+
lines.forEach((line) => {
|
|
36268
|
+
if (line.includes(":")) {
|
|
36269
|
+
const [k, ...rest] = line.split(":");
|
|
36270
|
+
newObj[k.trim().replace(/\s+/g, "_").toLowerCase()] = rest.join(":").trim().replace("%", "");
|
|
36271
|
+
}
|
|
36272
|
+
});
|
|
36273
|
+
onChange(newObj);
|
|
36274
|
+
},
|
|
36275
|
+
placeholder: "Tier name: percentage (one per line)...",
|
|
36276
|
+
className: "min-h-[120px] bg-background border-gray-300 font-mono text-xs"
|
|
36277
|
+
}
|
|
36278
|
+
)
|
|
36128
36279
|
};
|
|
36129
36280
|
}
|
|
36130
36281
|
if (field.key === "estimatedCreators" || field.key === "estimated_creators") {
|
|
@@ -36157,14 +36308,40 @@ var CampaignConceptCard = React94.memo(
|
|
|
36157
36308
|
)) });
|
|
36158
36309
|
}
|
|
36159
36310
|
return /* @__PURE__ */ jsx121("span", { className: "text-txtColor font-medium", children: String(val) });
|
|
36160
|
-
}
|
|
36311
|
+
},
|
|
36312
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx121(
|
|
36313
|
+
Input,
|
|
36314
|
+
{
|
|
36315
|
+
value: typeof v === "object" ? `${v.min ?? 0}-${v.max ?? 0}` : String(v || ""),
|
|
36316
|
+
onChange: (e) => {
|
|
36317
|
+
const val = e.target.value;
|
|
36318
|
+
if (val.includes("-")) {
|
|
36319
|
+
const [min2, max2] = val.split("-").map((s) => parseInt(s.trim()) || 0);
|
|
36320
|
+
onChange({ min: min2, max: max2 });
|
|
36321
|
+
} else {
|
|
36322
|
+
onChange(val);
|
|
36323
|
+
}
|
|
36324
|
+
},
|
|
36325
|
+
placeholder: "Min-Max (e.g. 10-30)...",
|
|
36326
|
+
className: "bg-background border-gray-300"
|
|
36327
|
+
}
|
|
36328
|
+
)
|
|
36161
36329
|
};
|
|
36162
36330
|
}
|
|
36163
36331
|
if (field.key === "primary_kpi" || field.key === "primaryKpi") {
|
|
36164
36332
|
return {
|
|
36165
36333
|
...field,
|
|
36166
36334
|
label: field.label || "Primary KPI",
|
|
36167
|
-
renderDisplay: (val) => /* @__PURE__ */ jsx121("span", { className: "text-foreground text-sm", children: val ? String(val) : "-" })
|
|
36335
|
+
renderDisplay: (val) => /* @__PURE__ */ jsx121("span", { className: "text-foreground text-sm", children: val ? String(val) : "-" }),
|
|
36336
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx121(
|
|
36337
|
+
Input,
|
|
36338
|
+
{
|
|
36339
|
+
value: String(v || ""),
|
|
36340
|
+
onChange: (e) => onChange(e.target.value),
|
|
36341
|
+
placeholder: "Enter primary KPI...",
|
|
36342
|
+
className: "bg-background border-gray-300"
|
|
36343
|
+
}
|
|
36344
|
+
)
|
|
36168
36345
|
};
|
|
36169
36346
|
}
|
|
36170
36347
|
if (field.key === "secondary_kpis" || field.key === "secondaryKpis") {
|
|
@@ -36174,7 +36351,19 @@ var CampaignConceptCard = React94.memo(
|
|
|
36174
36351
|
renderDisplay: (val) => {
|
|
36175
36352
|
const display = Array.isArray(val) ? val.map(String).join(", ") : val ? String(val) : "-";
|
|
36176
36353
|
return /* @__PURE__ */ jsx121("span", { className: "text-foreground text-sm", children: display });
|
|
36177
|
-
}
|
|
36354
|
+
},
|
|
36355
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx121(
|
|
36356
|
+
Textarea,
|
|
36357
|
+
{
|
|
36358
|
+
value: Array.isArray(v) ? v.join(", ") : String(v || ""),
|
|
36359
|
+
onChange: (e) => {
|
|
36360
|
+
const items = e.target.value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
36361
|
+
onChange(items);
|
|
36362
|
+
},
|
|
36363
|
+
placeholder: "Enter KPIs separated by commas...",
|
|
36364
|
+
className: "min-h-[80px] bg-background border-gray-300"
|
|
36365
|
+
}
|
|
36366
|
+
)
|
|
36178
36367
|
};
|
|
36179
36368
|
}
|
|
36180
36369
|
if (field.key === "platforms" || field.key === "target_platforms" || field.key === "targetPlatforms") {
|
|
@@ -36191,7 +36380,19 @@ var CampaignConceptCard = React94.memo(
|
|
|
36191
36380
|
},
|
|
36192
36381
|
p
|
|
36193
36382
|
)) });
|
|
36194
|
-
}
|
|
36383
|
+
},
|
|
36384
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx121(
|
|
36385
|
+
Textarea,
|
|
36386
|
+
{
|
|
36387
|
+
value: Array.isArray(v) ? v.join(", ") : String(v || ""),
|
|
36388
|
+
onChange: (e) => {
|
|
36389
|
+
const items = e.target.value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
36390
|
+
onChange(items);
|
|
36391
|
+
},
|
|
36392
|
+
placeholder: "Enter platforms separated by commas...",
|
|
36393
|
+
className: "min-h-[80px] bg-background border-gray-300"
|
|
36394
|
+
}
|
|
36395
|
+
)
|
|
36195
36396
|
};
|
|
36196
36397
|
}
|
|
36197
36398
|
return {
|
|
@@ -36237,7 +36438,7 @@ var CampaignConceptCard = React94.memo(
|
|
|
36237
36438
|
/* @__PURE__ */ jsxs80("div", { className: "flex-1", children: [
|
|
36238
36439
|
/* @__PURE__ */ jsx121("h2", { className: "mb-1 py-1 text-txtColor font-bold", children: typeof cardTitle === "object" ? JSON.stringify(cardTitle) : String(cardTitle) }),
|
|
36239
36440
|
/* @__PURE__ */ jsxs80("div", { className: "flex flex-wrap gap-2", children: [
|
|
36240
|
-
isRecommended && /* @__PURE__ */ jsx121("div", { className: "inline-flex text-[10px] font-bold uppercase tracking-widest
|
|
36441
|
+
isRecommended && /* @__PURE__ */ jsx121("div", { className: "inline-flex text-[10px] font-bold uppercase tracking-widest", children: /* @__PURE__ */ jsx121("span", { className: "bg-green-600 text-white px-2 py-0.5 rounded border border-green-700", children: "Recommended" }) }),
|
|
36241
36442
|
!effectiveIsLatest && selectionStatus && /* @__PURE__ */ jsx121("div", { className: "inline-flex text-[10px] font-bold uppercase tracking-widest text-[#3B82F6]", children: /* @__PURE__ */ jsx121("span", { className: "bg-[#3B82F6]/10 px-2 py-0.5 rounded border border-[#3B82F6]/20", children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by You" }) })
|
|
36242
36443
|
] })
|
|
36243
36444
|
] }),
|