pxengine 0.1.21 → 0.1.23
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 +278 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +272 -128
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +8 -3
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -33772,7 +33772,7 @@ var EditableField = React85.memo(
|
|
|
33772
33772
|
"div",
|
|
33773
33773
|
{
|
|
33774
33774
|
className: cn(
|
|
33775
|
-
"relative z-10 group flex flex-col gap-2 p-3 bg-
|
|
33775
|
+
"relative z-10 group flex flex-col gap-2 p-3 bg-background dark:bg-gray700 rounded-md mb-8",
|
|
33776
33776
|
className
|
|
33777
33777
|
),
|
|
33778
33778
|
children: [
|
|
@@ -33780,7 +33780,7 @@ var EditableField = React85.memo(
|
|
|
33780
33780
|
/* @__PURE__ */ jsx94(
|
|
33781
33781
|
"h4",
|
|
33782
33782
|
{
|
|
33783
|
-
className: "px-2 py-1 tracking-widest bg-
|
|
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
33784
|
style: { fontFamily: "Noto Sans, sans-serif" },
|
|
33785
33785
|
children: label
|
|
33786
33786
|
}
|
|
@@ -33963,7 +33963,7 @@ var FormCard = React87.memo(
|
|
|
33963
33963
|
"div",
|
|
33964
33964
|
{
|
|
33965
33965
|
className: cn(
|
|
33966
|
-
"relative w-full rounded-[20px] bg-background dark:bg-
|
|
33966
|
+
"relative w-full rounded-[20px] bg-background dark:bg-gray100 border border-gray400 shadow-lg overflow-hidden mb-6",
|
|
33967
33967
|
className
|
|
33968
33968
|
),
|
|
33969
33969
|
onMouseEnter: () => setShowCopyButton(true),
|
|
@@ -34548,83 +34548,6 @@ function generateFieldsFromData(data) {
|
|
|
34548
34548
|
});
|
|
34549
34549
|
}
|
|
34550
34550
|
|
|
34551
|
-
// src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx
|
|
34552
|
-
import { jsx as jsx106, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
34553
|
-
var CampaignSeedCard = React90.memo(
|
|
34554
|
-
({
|
|
34555
|
-
selectionStatus,
|
|
34556
|
-
isLatestMessage = true,
|
|
34557
|
-
className,
|
|
34558
|
-
fields: providedFields,
|
|
34559
|
-
data,
|
|
34560
|
-
...formCardProps
|
|
34561
|
-
}) => {
|
|
34562
|
-
const fields = useMemo4(() => {
|
|
34563
|
-
return providedFields || generateFieldsFromData(data);
|
|
34564
|
-
}, [providedFields, data]);
|
|
34565
|
-
return /* @__PURE__ */ jsxs66("div", { className: "flex flex-col gap-2 mb-10", children: [
|
|
34566
|
-
/* @__PURE__ */ jsx106(
|
|
34567
|
-
FormCard,
|
|
34568
|
-
{
|
|
34569
|
-
...formCardProps,
|
|
34570
|
-
data,
|
|
34571
|
-
title: formCardProps.title || "Campaign Brief",
|
|
34572
|
-
fields,
|
|
34573
|
-
className,
|
|
34574
|
-
footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ jsxs66("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1 mb-6", children: [
|
|
34575
|
-
/* @__PURE__ */ jsx106(CircleCheck, { className: "h-4 w-4" }),
|
|
34576
|
-
/* @__PURE__ */ jsx106("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
|
|
34577
|
-
] }) : formCardProps.footer
|
|
34578
|
-
}
|
|
34579
|
-
),
|
|
34580
|
-
!isLatestMessage && selectionStatus && /* @__PURE__ */ jsx106("div", { className: "flex justify-center mt-4", children: /* @__PURE__ */ jsx106(
|
|
34581
|
-
"button",
|
|
34582
|
-
{
|
|
34583
|
-
className: cn(
|
|
34584
|
-
"flex items-center gap-2 px-6 py-2.5 border rounded-full text-sm transition-all active:scale-95",
|
|
34585
|
-
"bg-purpleLight dark:bg-purple200 hover:bg-purpleText1 dark:hover:bg-purple100 text-purpleText2 dark:text-purpleText border-purpleText1 dark:border-purpleText dark:hover:text-white"
|
|
34586
|
-
),
|
|
34587
|
-
children: "Continue"
|
|
34588
|
-
}
|
|
34589
|
-
) })
|
|
34590
|
-
] });
|
|
34591
|
-
}
|
|
34592
|
-
);
|
|
34593
|
-
CampaignSeedCard.displayName = "CampaignSeedCard";
|
|
34594
|
-
|
|
34595
|
-
// src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
|
|
34596
|
-
import React91, { useMemo as useMemo5 } from "react";
|
|
34597
|
-
import { jsx as jsx107, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
34598
|
-
var SearchSpecCard = React91.memo(
|
|
34599
|
-
({
|
|
34600
|
-
selectionStatus,
|
|
34601
|
-
isLatestMessage = true,
|
|
34602
|
-
className,
|
|
34603
|
-
fields: providedFields,
|
|
34604
|
-
data,
|
|
34605
|
-
...formCardProps
|
|
34606
|
-
}) => {
|
|
34607
|
-
const fields = useMemo5(() => {
|
|
34608
|
-
return providedFields || generateFieldsFromData(data);
|
|
34609
|
-
}, [providedFields, data]);
|
|
34610
|
-
return /* @__PURE__ */ jsx107(
|
|
34611
|
-
FormCard,
|
|
34612
|
-
{
|
|
34613
|
-
...formCardProps,
|
|
34614
|
-
data,
|
|
34615
|
-
title: formCardProps.title || "Search Specification",
|
|
34616
|
-
fields,
|
|
34617
|
-
className,
|
|
34618
|
-
footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ jsxs67("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1", children: [
|
|
34619
|
-
/* @__PURE__ */ jsx107(CircleCheck, { className: "h-4 w-4" }),
|
|
34620
|
-
/* @__PURE__ */ jsx107("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
|
|
34621
|
-
] }) : formCardProps.footer
|
|
34622
|
-
}
|
|
34623
|
-
);
|
|
34624
|
-
}
|
|
34625
|
-
);
|
|
34626
|
-
SearchSpecCard.displayName = "SearchSpecCard";
|
|
34627
|
-
|
|
34628
34551
|
// src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
|
|
34629
34552
|
import { useState as useState8, useRef as useRef5, useEffect as useEffect6 } from "react";
|
|
34630
34553
|
|
|
@@ -34833,7 +34756,7 @@ var countriesWithFlags = Object.fromEntries(
|
|
|
34833
34756
|
);
|
|
34834
34757
|
|
|
34835
34758
|
// src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
|
|
34836
|
-
import { jsx as
|
|
34759
|
+
import { jsx as jsx106, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
34837
34760
|
var CountrySelectEdit = ({
|
|
34838
34761
|
value,
|
|
34839
34762
|
onChange
|
|
@@ -34851,16 +34774,16 @@ var CountrySelectEdit = ({
|
|
|
34851
34774
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
34852
34775
|
}, []);
|
|
34853
34776
|
const inputValue = Array.isArray(value) ? value : [];
|
|
34854
|
-
return /* @__PURE__ */
|
|
34855
|
-
/* @__PURE__ */
|
|
34856
|
-
/* @__PURE__ */
|
|
34777
|
+
return /* @__PURE__ */ jsxs66("div", { className: "space-y-3", children: [
|
|
34778
|
+
/* @__PURE__ */ jsxs66("div", { className: "relative", ref: dropdownRef, children: [
|
|
34779
|
+
/* @__PURE__ */ jsxs66(
|
|
34857
34780
|
"div",
|
|
34858
34781
|
{
|
|
34859
34782
|
className: "flex-1 bg-white border border-gray200 rounded-md px-3 py-2 text-sm cursor-pointer flex items-center justify-between font-medium hover:border-purple500 transition-colors",
|
|
34860
34783
|
onClick: () => setIsDropdownOpen(!isDropdownOpen),
|
|
34861
34784
|
children: [
|
|
34862
|
-
/* @__PURE__ */
|
|
34863
|
-
/* @__PURE__ */
|
|
34785
|
+
/* @__PURE__ */ jsx106("span", { className: "text-gray-700", children: inputValue.length > 0 ? `${inputValue.length} ${inputValue.length === 1 ? "country" : "countries"} selected` : "Select countries..." }),
|
|
34786
|
+
/* @__PURE__ */ jsx106(
|
|
34864
34787
|
ChevronDown,
|
|
34865
34788
|
{
|
|
34866
34789
|
className: cn(
|
|
@@ -34872,8 +34795,8 @@ var CountrySelectEdit = ({
|
|
|
34872
34795
|
]
|
|
34873
34796
|
}
|
|
34874
34797
|
),
|
|
34875
|
-
isDropdownOpen && /* @__PURE__ */
|
|
34876
|
-
/* @__PURE__ */
|
|
34798
|
+
isDropdownOpen && /* @__PURE__ */ jsxs66("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-gray200 rounded-lg shadow-xl z-50 max-h-60 overflow-hidden animate-in fade-in slide-in-from-top-1", children: [
|
|
34799
|
+
/* @__PURE__ */ jsx106("div", { className: "p-2 border-b border-gray-100", children: /* @__PURE__ */ jsx106(
|
|
34877
34800
|
"input",
|
|
34878
34801
|
{
|
|
34879
34802
|
type: "text",
|
|
@@ -34884,9 +34807,9 @@ var CountrySelectEdit = ({
|
|
|
34884
34807
|
onClick: (e) => e.stopPropagation()
|
|
34885
34808
|
}
|
|
34886
34809
|
) }),
|
|
34887
|
-
/* @__PURE__ */
|
|
34810
|
+
/* @__PURE__ */ jsx106("div", { className: "max-h-40 overflow-y-auto p-1", children: countries.filter(
|
|
34888
34811
|
(country) => country.name.toLowerCase().includes(searchTerm.toLowerCase()) || country.code.toLowerCase().includes(searchTerm.toLowerCase())
|
|
34889
|
-
).map((country) => /* @__PURE__ */
|
|
34812
|
+
).map((country) => /* @__PURE__ */ jsxs66(
|
|
34890
34813
|
"div",
|
|
34891
34814
|
{
|
|
34892
34815
|
className: cn(
|
|
@@ -34907,31 +34830,31 @@ var CountrySelectEdit = ({
|
|
|
34907
34830
|
}
|
|
34908
34831
|
},
|
|
34909
34832
|
children: [
|
|
34910
|
-
/* @__PURE__ */
|
|
34911
|
-
/* @__PURE__ */
|
|
34912
|
-
/* @__PURE__ */
|
|
34833
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
|
|
34834
|
+
/* @__PURE__ */ jsx106("span", { className: "text-sm text-gray-700", children: country.name }),
|
|
34835
|
+
/* @__PURE__ */ jsx106("span", { className: "text-xs text-gray-400 font-mono", children: country.code })
|
|
34913
34836
|
] }),
|
|
34914
|
-
inputValue.includes(country.code) && /* @__PURE__ */
|
|
34837
|
+
inputValue.includes(country.code) && /* @__PURE__ */ jsx106(Check, { className: "h-4 w-4 text-purple500" })
|
|
34915
34838
|
]
|
|
34916
34839
|
},
|
|
34917
34840
|
country.code
|
|
34918
34841
|
)) })
|
|
34919
34842
|
] })
|
|
34920
34843
|
] }),
|
|
34921
|
-
inputValue.length > 0 && /* @__PURE__ */
|
|
34844
|
+
inputValue.length > 0 && /* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-1.5", children: inputValue.map((countryCode) => /* @__PURE__ */ jsxs66(
|
|
34922
34845
|
Badge2,
|
|
34923
34846
|
{
|
|
34924
34847
|
variant: "secondary",
|
|
34925
34848
|
className: "bg-purple50 text-purple700 border-purple100 hover:bg-purple100 cursor-default flex items-center gap-1 pr-1",
|
|
34926
34849
|
children: [
|
|
34927
34850
|
countryCode,
|
|
34928
|
-
/* @__PURE__ */
|
|
34851
|
+
/* @__PURE__ */ jsxs66(
|
|
34929
34852
|
"button",
|
|
34930
34853
|
{
|
|
34931
34854
|
onClick: () => onChange(inputValue.filter((c) => c !== countryCode)),
|
|
34932
34855
|
className: "hover:bg-purple200 rounded-full p-0.5 transition-colors",
|
|
34933
34856
|
children: [
|
|
34934
|
-
/* @__PURE__ */
|
|
34857
|
+
/* @__PURE__ */ jsx106(ChevronDown, { className: "h-3 w-3 rotate-45" }),
|
|
34935
34858
|
" "
|
|
34936
34859
|
]
|
|
34937
34860
|
}
|
|
@@ -34944,9 +34867,9 @@ var CountrySelectEdit = ({
|
|
|
34944
34867
|
};
|
|
34945
34868
|
var CountrySelectDisplay = ({ value }) => {
|
|
34946
34869
|
if (!value || !Array.isArray(value) || value.length === 0) {
|
|
34947
|
-
return /* @__PURE__ */
|
|
34870
|
+
return /* @__PURE__ */ jsx106("span", { className: "text-muted-foreground italic", children: "Not specified" });
|
|
34948
34871
|
}
|
|
34949
|
-
return /* @__PURE__ */
|
|
34872
|
+
return /* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-1.5", children: value.map((countryCode) => /* @__PURE__ */ jsx106(
|
|
34950
34873
|
Badge2,
|
|
34951
34874
|
{
|
|
34952
34875
|
variant: "outline",
|
|
@@ -34968,22 +34891,22 @@ var KeywordBundlesEdit = ({
|
|
|
34968
34891
|
groups[p].push({ bundle: b, index: idx });
|
|
34969
34892
|
});
|
|
34970
34893
|
const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
|
|
34971
|
-
return /* @__PURE__ */
|
|
34972
|
-
/* @__PURE__ */
|
|
34973
|
-
/* @__PURE__ */
|
|
34894
|
+
return /* @__PURE__ */ jsx106("div", { className: "space-y-6 pt-2", children: sortedPriorities.map((priority) => /* @__PURE__ */ jsxs66("div", { className: "space-y-3", children: [
|
|
34895
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
|
|
34896
|
+
/* @__PURE__ */ jsxs66(Badge2, { className: "bg-purple500 hover:bg-purple500", children: [
|
|
34974
34897
|
"Priority ",
|
|
34975
34898
|
priority
|
|
34976
34899
|
] }),
|
|
34977
|
-
/* @__PURE__ */
|
|
34900
|
+
/* @__PURE__ */ jsx106("div", { className: "h-px flex-1 bg-gray-100" })
|
|
34978
34901
|
] }),
|
|
34979
|
-
groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */
|
|
34902
|
+
groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */ jsx106(
|
|
34980
34903
|
"div",
|
|
34981
34904
|
{
|
|
34982
34905
|
className: "bg-gray-50/50 border border-gray-100 rounded-xl p-4 transition-all hover:bg-gray-50 hover:border-gray-200 shadow-sm",
|
|
34983
|
-
children: /* @__PURE__ */
|
|
34984
|
-
/* @__PURE__ */
|
|
34985
|
-
/* @__PURE__ */
|
|
34986
|
-
/* @__PURE__ */
|
|
34906
|
+
children: /* @__PURE__ */ jsxs66("div", { className: "flex flex-col gap-3", children: [
|
|
34907
|
+
/* @__PURE__ */ jsx106("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Keywords" }),
|
|
34908
|
+
/* @__PURE__ */ jsxs66("div", { className: "space-y-3", children: [
|
|
34909
|
+
/* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-1.5", children: Array.isArray(bundle.keywords) && bundle.keywords.map((keyword, kIndex) => /* @__PURE__ */ jsxs66(
|
|
34987
34910
|
Badge2,
|
|
34988
34911
|
{
|
|
34989
34912
|
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",
|
|
@@ -34999,12 +34922,12 @@ var KeywordBundlesEdit = ({
|
|
|
34999
34922
|
},
|
|
35000
34923
|
children: [
|
|
35001
34924
|
keyword,
|
|
35002
|
-
/* @__PURE__ */
|
|
34925
|
+
/* @__PURE__ */ jsx106("span", { className: "ml-1 opacity-0 group-hover:opacity-100 transition-opacity", children: "\xD7" })
|
|
35003
34926
|
]
|
|
35004
34927
|
},
|
|
35005
34928
|
kIndex
|
|
35006
34929
|
)) }),
|
|
35007
|
-
/* @__PURE__ */
|
|
34930
|
+
/* @__PURE__ */ jsx106("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx106(
|
|
35008
34931
|
"input",
|
|
35009
34932
|
{
|
|
35010
34933
|
type: "text",
|
|
@@ -35028,9 +34951,9 @@ var KeywordBundlesEdit = ({
|
|
|
35028
34951
|
}
|
|
35029
34952
|
) })
|
|
35030
34953
|
] }),
|
|
35031
|
-
/* @__PURE__ */
|
|
35032
|
-
/* @__PURE__ */
|
|
35033
|
-
/* @__PURE__ */
|
|
34954
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex flex-col gap-1.5 mt-1", children: [
|
|
34955
|
+
/* @__PURE__ */ jsx106("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Priority Level (1-5)" }),
|
|
34956
|
+
/* @__PURE__ */ jsx106(
|
|
35034
34957
|
"input",
|
|
35035
34958
|
{
|
|
35036
34959
|
type: "number",
|
|
@@ -35058,7 +34981,7 @@ var KeywordBundlesEdit = ({
|
|
|
35058
34981
|
var KeywordBundlesDisplay = ({ value }) => {
|
|
35059
34982
|
const bundles = Array.isArray(value) ? value : [];
|
|
35060
34983
|
if (bundles.length === 0)
|
|
35061
|
-
return /* @__PURE__ */
|
|
34984
|
+
return /* @__PURE__ */ jsx106("span", { className: "text-gray-500 italic text-sm", children: "Not specified" });
|
|
35062
34985
|
const groups = {};
|
|
35063
34986
|
bundles.forEach((b) => {
|
|
35064
34987
|
const p = Number(b?.priority) || 1;
|
|
@@ -35067,20 +34990,20 @@ var KeywordBundlesDisplay = ({ value }) => {
|
|
|
35067
34990
|
groups[p].push(...keywords);
|
|
35068
34991
|
});
|
|
35069
34992
|
const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
|
|
35070
|
-
return /* @__PURE__ */
|
|
34993
|
+
return /* @__PURE__ */ jsx106("div", { className: "space-y-4 pt-2", children: sortedPriorities.map((priority) => {
|
|
35071
34994
|
const deduped = Array.from(new Set(groups[priority]));
|
|
35072
|
-
return /* @__PURE__ */
|
|
35073
|
-
/* @__PURE__ */
|
|
35074
|
-
/* @__PURE__ */
|
|
34995
|
+
return /* @__PURE__ */ jsxs66("div", { className: "space-y-2", children: [
|
|
34996
|
+
/* @__PURE__ */ jsxs66("div", { className: "flex items-center gap-2", children: [
|
|
34997
|
+
/* @__PURE__ */ jsxs66("span", { className: "text-[10px] uppercase tracking-widest text-purple-400 font-bold", children: [
|
|
35075
34998
|
"Priority ",
|
|
35076
34999
|
priority
|
|
35077
35000
|
] }),
|
|
35078
|
-
/* @__PURE__ */
|
|
35001
|
+
/* @__PURE__ */ jsx106("div", { className: "h-[1px] flex-1 bg-white/10" })
|
|
35079
35002
|
] }),
|
|
35080
|
-
/* @__PURE__ */
|
|
35003
|
+
/* @__PURE__ */ jsx106("div", { className: "flex flex-wrap gap-2", children: deduped.map((keyword) => /* @__PURE__ */ jsx106(
|
|
35081
35004
|
"div",
|
|
35082
35005
|
{
|
|
35083
|
-
className: "px-2 py-1 rounded bg-
|
|
35006
|
+
className: "px-2 py-1 rounded bg-background bg-gray400 border border-white/10 text-gray-300 text-xs font-medium",
|
|
35084
35007
|
children: keyword
|
|
35085
35008
|
},
|
|
35086
35009
|
keyword
|
|
@@ -35089,6 +35012,224 @@ var KeywordBundlesDisplay = ({ value }) => {
|
|
|
35089
35012
|
}) });
|
|
35090
35013
|
};
|
|
35091
35014
|
|
|
35015
|
+
// src/molecules/creator-discovery/CampaignSeedCard/CampaignSeedCard.tsx
|
|
35016
|
+
import { jsx as jsx107, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
35017
|
+
var ObjectDisplay = ({ value }) => {
|
|
35018
|
+
if (!value || typeof value !== "object") return null;
|
|
35019
|
+
return /* @__PURE__ */ jsx107("div", { className: "space-y-1 pt-1", children: Object.entries(value).map(([k, v]) => /* @__PURE__ */ jsxs67("div", { className: "flex gap-2 text-sm", children: [
|
|
35020
|
+
/* @__PURE__ */ jsxs67("span", { className: "text-muted-foreground capitalize min-w-[120px]", children: [
|
|
35021
|
+
k.replace(/_/g, " "),
|
|
35022
|
+
":"
|
|
35023
|
+
] }),
|
|
35024
|
+
/* @__PURE__ */ jsx107("span", { className: "text-foreground font-medium", children: Array.isArray(v) ? v.join(", ") : String(v) })
|
|
35025
|
+
] }, k)) });
|
|
35026
|
+
};
|
|
35027
|
+
var StringArrayDisplay = ({ value }) => {
|
|
35028
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
35029
|
+
return /* @__PURE__ */ jsx107("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
|
|
35030
|
+
return /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx107(Badge2, { variant: "outline", className: "text-xs", children: item }, item)) });
|
|
35031
|
+
};
|
|
35032
|
+
function buildCampaignSeedFields(data) {
|
|
35033
|
+
if (!data || typeof data !== "object") return [];
|
|
35034
|
+
return Object.keys(data).map((key) => {
|
|
35035
|
+
const value = data[key];
|
|
35036
|
+
if (key === "keyword_bundles" || key === "keywordBundles") {
|
|
35037
|
+
return {
|
|
35038
|
+
key,
|
|
35039
|
+
label: "Keyword Bundles",
|
|
35040
|
+
type: "custom",
|
|
35041
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(KeywordBundlesDisplay, { value: v })
|
|
35042
|
+
};
|
|
35043
|
+
}
|
|
35044
|
+
if (key === "geography") {
|
|
35045
|
+
return {
|
|
35046
|
+
key,
|
|
35047
|
+
label: "Geography",
|
|
35048
|
+
type: "custom",
|
|
35049
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(CountrySelectDisplay, { value: v })
|
|
35050
|
+
};
|
|
35051
|
+
}
|
|
35052
|
+
if (key === "platforms" && Array.isArray(value)) {
|
|
35053
|
+
return {
|
|
35054
|
+
key,
|
|
35055
|
+
label: "Platforms",
|
|
35056
|
+
type: "custom",
|
|
35057
|
+
renderDisplay: (v) => {
|
|
35058
|
+
const platforms = Array.isArray(v) ? v : [v];
|
|
35059
|
+
return /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-2", children: platforms.map((p) => /* @__PURE__ */ jsx107(
|
|
35060
|
+
BadgeAtom,
|
|
35061
|
+
{
|
|
35062
|
+
id: `platform-${p}`,
|
|
35063
|
+
type: "badge",
|
|
35064
|
+
label: p,
|
|
35065
|
+
variant: "outline",
|
|
35066
|
+
className: "bg-background bg-purple200 border-gray400 text-white font-medium"
|
|
35067
|
+
},
|
|
35068
|
+
p
|
|
35069
|
+
)) });
|
|
35070
|
+
}
|
|
35071
|
+
};
|
|
35072
|
+
}
|
|
35073
|
+
if (Array.isArray(value) && value.every((v) => typeof v === "string")) {
|
|
35074
|
+
const label = key.split(/_|(?=[A-Z])/).map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
35075
|
+
return {
|
|
35076
|
+
key,
|
|
35077
|
+
label,
|
|
35078
|
+
type: "custom",
|
|
35079
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(StringArrayDisplay, { value: v })
|
|
35080
|
+
};
|
|
35081
|
+
}
|
|
35082
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && "min" in value && "max" in value) {
|
|
35083
|
+
const label = key.split(/_|(?=[A-Z])/).map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
35084
|
+
return {
|
|
35085
|
+
key,
|
|
35086
|
+
label,
|
|
35087
|
+
type: "custom",
|
|
35088
|
+
renderDisplay: (v) => {
|
|
35089
|
+
if (typeof v === "object" && v !== null) {
|
|
35090
|
+
return /* @__PURE__ */ jsx107("span", { className: "text-white font-medium", children: `${v.min?.toLocaleString()} - ${v.max?.toLocaleString()}` });
|
|
35091
|
+
}
|
|
35092
|
+
return /* @__PURE__ */ jsx107("span", { className: "text-white font-medium", children: v });
|
|
35093
|
+
}
|
|
35094
|
+
};
|
|
35095
|
+
}
|
|
35096
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
35097
|
+
const label = key.split(/_|(?=[A-Z])/).map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
35098
|
+
return {
|
|
35099
|
+
key,
|
|
35100
|
+
label,
|
|
35101
|
+
type: "custom",
|
|
35102
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx107(ObjectDisplay, { value: v })
|
|
35103
|
+
};
|
|
35104
|
+
}
|
|
35105
|
+
const [generated] = generateFieldsFromData({ [key]: value });
|
|
35106
|
+
return generated;
|
|
35107
|
+
});
|
|
35108
|
+
}
|
|
35109
|
+
var CampaignSeedCard = React90.memo(
|
|
35110
|
+
({
|
|
35111
|
+
selectionStatus,
|
|
35112
|
+
isLatestMessage = true,
|
|
35113
|
+
className,
|
|
35114
|
+
fields: providedFields,
|
|
35115
|
+
data,
|
|
35116
|
+
...formCardProps
|
|
35117
|
+
}) => {
|
|
35118
|
+
const fields = useMemo4(() => {
|
|
35119
|
+
return providedFields || buildCampaignSeedFields(data);
|
|
35120
|
+
}, [providedFields, data]);
|
|
35121
|
+
return /* @__PURE__ */ jsx107("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx107(
|
|
35122
|
+
FormCard,
|
|
35123
|
+
{
|
|
35124
|
+
...formCardProps,
|
|
35125
|
+
data,
|
|
35126
|
+
title: formCardProps.title || "Campaign Brief",
|
|
35127
|
+
fields,
|
|
35128
|
+
showTimeline: true,
|
|
35129
|
+
className: cn("font-noto", className),
|
|
35130
|
+
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: [
|
|
35131
|
+
/* @__PURE__ */ jsx107(CircleCheck, { className: "h-3.5 w-3.5" }),
|
|
35132
|
+
/* @__PURE__ */ jsx107("span", { children: selectionStatus === "agent" ? "Suggested by Agent" : "Selected by you" })
|
|
35133
|
+
] }) : formCardProps.footer
|
|
35134
|
+
}
|
|
35135
|
+
) });
|
|
35136
|
+
}
|
|
35137
|
+
);
|
|
35138
|
+
CampaignSeedCard.displayName = "CampaignSeedCard";
|
|
35139
|
+
|
|
35140
|
+
// src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
|
|
35141
|
+
import React91, { useMemo as useMemo5 } from "react";
|
|
35142
|
+
import { jsx as jsx108, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
35143
|
+
var ObjectDisplay2 = ({ value }) => {
|
|
35144
|
+
if (!value || typeof value !== "object") return null;
|
|
35145
|
+
return /* @__PURE__ */ jsx108("div", { className: "space-y-1 pt-1", children: Object.entries(value).map(([k, v]) => /* @__PURE__ */ jsxs68("div", { className: "flex gap-2 text-sm", children: [
|
|
35146
|
+
/* @__PURE__ */ jsxs68("span", { className: "text-muted-foreground capitalize min-w-[120px]", children: [
|
|
35147
|
+
k.replace(/_/g, " "),
|
|
35148
|
+
":"
|
|
35149
|
+
] }),
|
|
35150
|
+
/* @__PURE__ */ jsx108("span", { className: "text-foreground font-medium", children: Array.isArray(v) ? v.join(", ") : String(v) })
|
|
35151
|
+
] }, k)) });
|
|
35152
|
+
};
|
|
35153
|
+
var StringArrayDisplay2 = ({ value }) => {
|
|
35154
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
35155
|
+
return /* @__PURE__ */ jsx108("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
|
|
35156
|
+
return /* @__PURE__ */ jsx108("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ jsx108(Badge2, { variant: "outline", className: "text-xs", children: item }, item)) });
|
|
35157
|
+
};
|
|
35158
|
+
function buildSearchSpecFields(data) {
|
|
35159
|
+
if (!data || typeof data !== "object") return [];
|
|
35160
|
+
return Object.keys(data).map((key) => {
|
|
35161
|
+
const value = data[key];
|
|
35162
|
+
if (key === "keyword_bundles") {
|
|
35163
|
+
return {
|
|
35164
|
+
key,
|
|
35165
|
+
label: "Keyword Bundles",
|
|
35166
|
+
type: "custom",
|
|
35167
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(KeywordBundlesDisplay, { value: v }),
|
|
35168
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(KeywordBundlesEdit, { value: v, onChange })
|
|
35169
|
+
};
|
|
35170
|
+
}
|
|
35171
|
+
if (key === "geography") {
|
|
35172
|
+
return {
|
|
35173
|
+
key,
|
|
35174
|
+
label: "Geography",
|
|
35175
|
+
type: "custom",
|
|
35176
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(CountrySelectDisplay, { value: v }),
|
|
35177
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(CountrySelectEdit, { value: v, onChange })
|
|
35178
|
+
};
|
|
35179
|
+
}
|
|
35180
|
+
if (key === "platforms" && Array.isArray(value)) {
|
|
35181
|
+
return {
|
|
35182
|
+
key,
|
|
35183
|
+
label: "Platforms",
|
|
35184
|
+
type: "custom",
|
|
35185
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(StringArrayDisplay2, { value: v })
|
|
35186
|
+
};
|
|
35187
|
+
}
|
|
35188
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && !("min" in value && "max" in value)) {
|
|
35189
|
+
const label = key.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
35190
|
+
return {
|
|
35191
|
+
key,
|
|
35192
|
+
label,
|
|
35193
|
+
type: "custom",
|
|
35194
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(ObjectDisplay2, { value: v })
|
|
35195
|
+
};
|
|
35196
|
+
}
|
|
35197
|
+
const [generated] = generateFieldsFromData({ [key]: value });
|
|
35198
|
+
return generated;
|
|
35199
|
+
});
|
|
35200
|
+
}
|
|
35201
|
+
var SearchSpecCard = React91.memo(
|
|
35202
|
+
({
|
|
35203
|
+
selectionStatus,
|
|
35204
|
+
isLatestMessage = true,
|
|
35205
|
+
className,
|
|
35206
|
+
fields: providedFields,
|
|
35207
|
+
data,
|
|
35208
|
+
specData,
|
|
35209
|
+
...formCardProps
|
|
35210
|
+
}) => {
|
|
35211
|
+
const resolvedData = data || specData;
|
|
35212
|
+
const fields = useMemo5(() => {
|
|
35213
|
+
return providedFields || buildSearchSpecFields(resolvedData ?? {});
|
|
35214
|
+
}, [providedFields, resolvedData]);
|
|
35215
|
+
return /* @__PURE__ */ jsx108(
|
|
35216
|
+
FormCard,
|
|
35217
|
+
{
|
|
35218
|
+
...formCardProps,
|
|
35219
|
+
data: resolvedData ?? {},
|
|
35220
|
+
title: formCardProps.title || "Search Specification",
|
|
35221
|
+
fields,
|
|
35222
|
+
className,
|
|
35223
|
+
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
|
+
/* @__PURE__ */ jsx108(CircleCheck, { className: "h-4 w-4" }),
|
|
35225
|
+
/* @__PURE__ */ jsx108("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
|
|
35226
|
+
] }) : formCardProps.footer
|
|
35227
|
+
}
|
|
35228
|
+
);
|
|
35229
|
+
}
|
|
35230
|
+
);
|
|
35231
|
+
SearchSpecCard.displayName = "SearchSpecCard";
|
|
35232
|
+
|
|
35092
35233
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35093
35234
|
import React92 from "react";
|
|
35094
35235
|
import { jsx as jsx109, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
@@ -35108,15 +35249,17 @@ var MCQCard = React92.memo(
|
|
|
35108
35249
|
disabled = false
|
|
35109
35250
|
}) => {
|
|
35110
35251
|
const [selectedOption, setSelectedOption] = React92.useState(propsSelectedOption);
|
|
35252
|
+
const [isProceeded, setIsProceeded] = React92.useState(false);
|
|
35111
35253
|
React92.useEffect(() => {
|
|
35112
35254
|
if (propsSelectedOption) {
|
|
35113
35255
|
setSelectedOption(propsSelectedOption);
|
|
35256
|
+
setIsProceeded(true);
|
|
35114
35257
|
}
|
|
35115
35258
|
}, [propsSelectedOption]);
|
|
35116
35259
|
const handleOptionClick = (key, e) => {
|
|
35117
35260
|
e.preventDefault();
|
|
35118
35261
|
e.stopPropagation();
|
|
35119
|
-
if (isLatestMessage && !isLoading && !disabled) {
|
|
35262
|
+
if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
|
|
35120
35263
|
setSelectedOption(key);
|
|
35121
35264
|
onSelect?.(key);
|
|
35122
35265
|
}
|
|
@@ -35124,8 +35267,9 @@ var MCQCard = React92.memo(
|
|
|
35124
35267
|
const handleProceed = (e) => {
|
|
35125
35268
|
e.preventDefault();
|
|
35126
35269
|
e.stopPropagation();
|
|
35127
|
-
if ((selectedOption || recommended) && !disabled) {
|
|
35270
|
+
if ((selectedOption || recommended) && !disabled && !isProceeded) {
|
|
35128
35271
|
const result = selectedOption || recommended || "";
|
|
35272
|
+
setIsProceeded(true);
|
|
35129
35273
|
onProceed?.(result);
|
|
35130
35274
|
onAction?.({
|
|
35131
35275
|
type: "mcq_selection",
|
|
@@ -35134,7 +35278,7 @@ var MCQCard = React92.memo(
|
|
|
35134
35278
|
});
|
|
35135
35279
|
}
|
|
35136
35280
|
};
|
|
35137
|
-
const isInteractionDisabled = disabled || !isLatestMessage;
|
|
35281
|
+
const isInteractionDisabled = disabled || !isLatestMessage || isProceeded;
|
|
35138
35282
|
return /* @__PURE__ */ jsxs69(
|
|
35139
35283
|
"div",
|
|
35140
35284
|
{
|
|
@@ -35717,7 +35861,7 @@ var CreatorSearch = React93.memo(
|
|
|
35717
35861
|
type: "badge",
|
|
35718
35862
|
label: p,
|
|
35719
35863
|
variant: "outline",
|
|
35720
|
-
className: "bg-
|
|
35864
|
+
className: "bg-background bg-gray200 border-gray400 text-white font-medium"
|
|
35721
35865
|
},
|
|
35722
35866
|
p
|
|
35723
35867
|
)) });
|
|
@@ -35820,9 +35964,9 @@ var CampaignConceptCard = React94.memo(
|
|
|
35820
35964
|
idx + 1,
|
|
35821
35965
|
"."
|
|
35822
35966
|
] }),
|
|
35823
|
-
/* @__PURE__ */ jsx121("div", { className: "bg-
|
|
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 }),
|
|
35824
35968
|
/* @__PURE__ */ jsx121("span", { className: "text-gray-400", children: "=" }),
|
|
35825
|
-
/* @__PURE__ */ jsx121("div", { className: "bg-
|
|
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 })
|
|
35826
35970
|
] }, idx)) });
|
|
35827
35971
|
}
|
|
35828
35972
|
};
|
|
@@ -35832,7 +35976,7 @@ var CampaignConceptCard = React94.memo(
|
|
|
35832
35976
|
...field,
|
|
35833
35977
|
renderDisplay: (val) => {
|
|
35834
35978
|
if (!Array.isArray(val)) return /* @__PURE__ */ jsx121("span", { className: "text-white font-medium", children: val });
|
|
35835
|
-
return /* @__PURE__ */ jsx121("div", { className: "flex gap-2", children: val.map((v, idx) => /* @__PURE__ */ jsx121("div", { className: "bg-
|
|
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)) });
|
|
35836
35980
|
}
|
|
35837
35981
|
};
|
|
35838
35982
|
}
|