pxengine 0.1.21 → 0.1.22
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 +144 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +138 -73
- package/dist/index.mjs.map +1 -1
- package/dist/registry.json +7 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1797,6 +1797,10 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
|
|
|
1797
1797
|
* Optional field configuration to override dynamic generation
|
|
1798
1798
|
*/
|
|
1799
1799
|
fields?: FieldConfig[];
|
|
1800
|
+
/**
|
|
1801
|
+
* Alias for data — the agent schema uses specData as the prop name
|
|
1802
|
+
*/
|
|
1803
|
+
specData?: Record<string, any>;
|
|
1800
1804
|
}
|
|
1801
1805
|
|
|
1802
1806
|
/**
|
|
@@ -1804,7 +1808,7 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
|
|
|
1804
1808
|
*
|
|
1805
1809
|
* A domain-specific molecule for the Creator Discovery workflow.
|
|
1806
1810
|
* Encapsulates search settings like platforms, ranges, and custom keyword bundles.
|
|
1807
|
-
*
|
|
1811
|
+
* Uses smart field generation with proper renderers for all nested data types.
|
|
1808
1812
|
*/
|
|
1809
1813
|
declare const SearchSpecCard: React__default.NamedExoticComponent<SearchSpecCardProps>;
|
|
1810
1814
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1797,6 +1797,10 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
|
|
|
1797
1797
|
* Optional field configuration to override dynamic generation
|
|
1798
1798
|
*/
|
|
1799
1799
|
fields?: FieldConfig[];
|
|
1800
|
+
/**
|
|
1801
|
+
* Alias for data — the agent schema uses specData as the prop name
|
|
1802
|
+
*/
|
|
1803
|
+
specData?: Record<string, any>;
|
|
1800
1804
|
}
|
|
1801
1805
|
|
|
1802
1806
|
/**
|
|
@@ -1804,7 +1808,7 @@ interface SearchSpecCardProps extends Omit<FormCardProps, "fields"> {
|
|
|
1804
1808
|
*
|
|
1805
1809
|
* A domain-specific molecule for the Creator Discovery workflow.
|
|
1806
1810
|
* Encapsulates search settings like platforms, ranges, and custom keyword bundles.
|
|
1807
|
-
*
|
|
1811
|
+
* Uses smart field generation with proper renderers for all nested data types.
|
|
1808
1812
|
*/
|
|
1809
1813
|
declare const SearchSpecCard: React__default.NamedExoticComponent<SearchSpecCardProps>;
|
|
1810
1814
|
|
package/dist/index.mjs
CHANGED
|
@@ -34594,36 +34594,6 @@ CampaignSeedCard.displayName = "CampaignSeedCard";
|
|
|
34594
34594
|
|
|
34595
34595
|
// src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
|
|
34596
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
34597
|
|
|
34628
34598
|
// src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
|
|
34629
34599
|
import { useState as useState8, useRef as useRef5, useEffect as useEffect6 } from "react";
|
|
@@ -34833,7 +34803,7 @@ var countriesWithFlags = Object.fromEntries(
|
|
|
34833
34803
|
);
|
|
34834
34804
|
|
|
34835
34805
|
// src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
|
|
34836
|
-
import { jsx as
|
|
34806
|
+
import { jsx as jsx107, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
34837
34807
|
var CountrySelectEdit = ({
|
|
34838
34808
|
value,
|
|
34839
34809
|
onChange
|
|
@@ -34851,16 +34821,16 @@ var CountrySelectEdit = ({
|
|
|
34851
34821
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
34852
34822
|
}, []);
|
|
34853
34823
|
const inputValue = Array.isArray(value) ? value : [];
|
|
34854
|
-
return /* @__PURE__ */
|
|
34855
|
-
/* @__PURE__ */
|
|
34856
|
-
/* @__PURE__ */
|
|
34824
|
+
return /* @__PURE__ */ jsxs67("div", { className: "space-y-3", children: [
|
|
34825
|
+
/* @__PURE__ */ jsxs67("div", { className: "relative", ref: dropdownRef, children: [
|
|
34826
|
+
/* @__PURE__ */ jsxs67(
|
|
34857
34827
|
"div",
|
|
34858
34828
|
{
|
|
34859
34829
|
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
34830
|
onClick: () => setIsDropdownOpen(!isDropdownOpen),
|
|
34861
34831
|
children: [
|
|
34862
|
-
/* @__PURE__ */
|
|
34863
|
-
/* @__PURE__ */
|
|
34832
|
+
/* @__PURE__ */ jsx107("span", { className: "text-gray-700", children: inputValue.length > 0 ? `${inputValue.length} ${inputValue.length === 1 ? "country" : "countries"} selected` : "Select countries..." }),
|
|
34833
|
+
/* @__PURE__ */ jsx107(
|
|
34864
34834
|
ChevronDown,
|
|
34865
34835
|
{
|
|
34866
34836
|
className: cn(
|
|
@@ -34872,8 +34842,8 @@ var CountrySelectEdit = ({
|
|
|
34872
34842
|
]
|
|
34873
34843
|
}
|
|
34874
34844
|
),
|
|
34875
|
-
isDropdownOpen && /* @__PURE__ */
|
|
34876
|
-
/* @__PURE__ */
|
|
34845
|
+
isDropdownOpen && /* @__PURE__ */ jsxs67("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: [
|
|
34846
|
+
/* @__PURE__ */ jsx107("div", { className: "p-2 border-b border-gray-100", children: /* @__PURE__ */ jsx107(
|
|
34877
34847
|
"input",
|
|
34878
34848
|
{
|
|
34879
34849
|
type: "text",
|
|
@@ -34884,9 +34854,9 @@ var CountrySelectEdit = ({
|
|
|
34884
34854
|
onClick: (e) => e.stopPropagation()
|
|
34885
34855
|
}
|
|
34886
34856
|
) }),
|
|
34887
|
-
/* @__PURE__ */
|
|
34857
|
+
/* @__PURE__ */ jsx107("div", { className: "max-h-40 overflow-y-auto p-1", children: countries.filter(
|
|
34888
34858
|
(country) => country.name.toLowerCase().includes(searchTerm.toLowerCase()) || country.code.toLowerCase().includes(searchTerm.toLowerCase())
|
|
34889
|
-
).map((country) => /* @__PURE__ */
|
|
34859
|
+
).map((country) => /* @__PURE__ */ jsxs67(
|
|
34890
34860
|
"div",
|
|
34891
34861
|
{
|
|
34892
34862
|
className: cn(
|
|
@@ -34907,31 +34877,31 @@ var CountrySelectEdit = ({
|
|
|
34907
34877
|
}
|
|
34908
34878
|
},
|
|
34909
34879
|
children: [
|
|
34910
|
-
/* @__PURE__ */
|
|
34911
|
-
/* @__PURE__ */
|
|
34912
|
-
/* @__PURE__ */
|
|
34880
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
|
|
34881
|
+
/* @__PURE__ */ jsx107("span", { className: "text-sm text-gray-700", children: country.name }),
|
|
34882
|
+
/* @__PURE__ */ jsx107("span", { className: "text-xs text-gray-400 font-mono", children: country.code })
|
|
34913
34883
|
] }),
|
|
34914
|
-
inputValue.includes(country.code) && /* @__PURE__ */
|
|
34884
|
+
inputValue.includes(country.code) && /* @__PURE__ */ jsx107(Check, { className: "h-4 w-4 text-purple500" })
|
|
34915
34885
|
]
|
|
34916
34886
|
},
|
|
34917
34887
|
country.code
|
|
34918
34888
|
)) })
|
|
34919
34889
|
] })
|
|
34920
34890
|
] }),
|
|
34921
|
-
inputValue.length > 0 && /* @__PURE__ */
|
|
34891
|
+
inputValue.length > 0 && /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5", children: inputValue.map((countryCode) => /* @__PURE__ */ jsxs67(
|
|
34922
34892
|
Badge2,
|
|
34923
34893
|
{
|
|
34924
34894
|
variant: "secondary",
|
|
34925
34895
|
className: "bg-purple50 text-purple700 border-purple100 hover:bg-purple100 cursor-default flex items-center gap-1 pr-1",
|
|
34926
34896
|
children: [
|
|
34927
34897
|
countryCode,
|
|
34928
|
-
/* @__PURE__ */
|
|
34898
|
+
/* @__PURE__ */ jsxs67(
|
|
34929
34899
|
"button",
|
|
34930
34900
|
{
|
|
34931
34901
|
onClick: () => onChange(inputValue.filter((c) => c !== countryCode)),
|
|
34932
34902
|
className: "hover:bg-purple200 rounded-full p-0.5 transition-colors",
|
|
34933
34903
|
children: [
|
|
34934
|
-
/* @__PURE__ */
|
|
34904
|
+
/* @__PURE__ */ jsx107(ChevronDown, { className: "h-3 w-3 rotate-45" }),
|
|
34935
34905
|
" "
|
|
34936
34906
|
]
|
|
34937
34907
|
}
|
|
@@ -34944,9 +34914,9 @@ var CountrySelectEdit = ({
|
|
|
34944
34914
|
};
|
|
34945
34915
|
var CountrySelectDisplay = ({ value }) => {
|
|
34946
34916
|
if (!value || !Array.isArray(value) || value.length === 0) {
|
|
34947
|
-
return /* @__PURE__ */
|
|
34917
|
+
return /* @__PURE__ */ jsx107("span", { className: "text-muted-foreground italic", children: "Not specified" });
|
|
34948
34918
|
}
|
|
34949
|
-
return /* @__PURE__ */
|
|
34919
|
+
return /* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5", children: value.map((countryCode) => /* @__PURE__ */ jsx107(
|
|
34950
34920
|
Badge2,
|
|
34951
34921
|
{
|
|
34952
34922
|
variant: "outline",
|
|
@@ -34968,22 +34938,22 @@ var KeywordBundlesEdit = ({
|
|
|
34968
34938
|
groups[p].push({ bundle: b, index: idx });
|
|
34969
34939
|
});
|
|
34970
34940
|
const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
|
|
34971
|
-
return /* @__PURE__ */
|
|
34972
|
-
/* @__PURE__ */
|
|
34973
|
-
/* @__PURE__ */
|
|
34941
|
+
return /* @__PURE__ */ jsx107("div", { className: "space-y-6 pt-2", children: sortedPriorities.map((priority) => /* @__PURE__ */ jsxs67("div", { className: "space-y-3", children: [
|
|
34942
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
|
|
34943
|
+
/* @__PURE__ */ jsxs67(Badge2, { className: "bg-purple500 hover:bg-purple500", children: [
|
|
34974
34944
|
"Priority ",
|
|
34975
34945
|
priority
|
|
34976
34946
|
] }),
|
|
34977
|
-
/* @__PURE__ */
|
|
34947
|
+
/* @__PURE__ */ jsx107("div", { className: "h-px flex-1 bg-gray-100" })
|
|
34978
34948
|
] }),
|
|
34979
|
-
groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */
|
|
34949
|
+
groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */ jsx107(
|
|
34980
34950
|
"div",
|
|
34981
34951
|
{
|
|
34982
34952
|
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__ */
|
|
34953
|
+
children: /* @__PURE__ */ jsxs67("div", { className: "flex flex-col gap-3", children: [
|
|
34954
|
+
/* @__PURE__ */ jsx107("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Keywords" }),
|
|
34955
|
+
/* @__PURE__ */ jsxs67("div", { className: "space-y-3", children: [
|
|
34956
|
+
/* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-1.5", children: Array.isArray(bundle.keywords) && bundle.keywords.map((keyword, kIndex) => /* @__PURE__ */ jsxs67(
|
|
34987
34957
|
Badge2,
|
|
34988
34958
|
{
|
|
34989
34959
|
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 +34969,12 @@ var KeywordBundlesEdit = ({
|
|
|
34999
34969
|
},
|
|
35000
34970
|
children: [
|
|
35001
34971
|
keyword,
|
|
35002
|
-
/* @__PURE__ */
|
|
34972
|
+
/* @__PURE__ */ jsx107("span", { className: "ml-1 opacity-0 group-hover:opacity-100 transition-opacity", children: "\xD7" })
|
|
35003
34973
|
]
|
|
35004
34974
|
},
|
|
35005
34975
|
kIndex
|
|
35006
34976
|
)) }),
|
|
35007
|
-
/* @__PURE__ */
|
|
34977
|
+
/* @__PURE__ */ jsx107("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx107(
|
|
35008
34978
|
"input",
|
|
35009
34979
|
{
|
|
35010
34980
|
type: "text",
|
|
@@ -35028,9 +34998,9 @@ var KeywordBundlesEdit = ({
|
|
|
35028
34998
|
}
|
|
35029
34999
|
) })
|
|
35030
35000
|
] }),
|
|
35031
|
-
/* @__PURE__ */
|
|
35032
|
-
/* @__PURE__ */
|
|
35033
|
-
/* @__PURE__ */
|
|
35001
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex flex-col gap-1.5 mt-1", children: [
|
|
35002
|
+
/* @__PURE__ */ jsx107("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Priority Level (1-5)" }),
|
|
35003
|
+
/* @__PURE__ */ jsx107(
|
|
35034
35004
|
"input",
|
|
35035
35005
|
{
|
|
35036
35006
|
type: "number",
|
|
@@ -35058,7 +35028,7 @@ var KeywordBundlesEdit = ({
|
|
|
35058
35028
|
var KeywordBundlesDisplay = ({ value }) => {
|
|
35059
35029
|
const bundles = Array.isArray(value) ? value : [];
|
|
35060
35030
|
if (bundles.length === 0)
|
|
35061
|
-
return /* @__PURE__ */
|
|
35031
|
+
return /* @__PURE__ */ jsx107("span", { className: "text-gray-500 italic text-sm", children: "Not specified" });
|
|
35062
35032
|
const groups = {};
|
|
35063
35033
|
bundles.forEach((b) => {
|
|
35064
35034
|
const p = Number(b?.priority) || 1;
|
|
@@ -35067,17 +35037,17 @@ var KeywordBundlesDisplay = ({ value }) => {
|
|
|
35067
35037
|
groups[p].push(...keywords);
|
|
35068
35038
|
});
|
|
35069
35039
|
const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
|
|
35070
|
-
return /* @__PURE__ */
|
|
35040
|
+
return /* @__PURE__ */ jsx107("div", { className: "space-y-4 pt-2", children: sortedPriorities.map((priority) => {
|
|
35071
35041
|
const deduped = Array.from(new Set(groups[priority]));
|
|
35072
|
-
return /* @__PURE__ */
|
|
35073
|
-
/* @__PURE__ */
|
|
35074
|
-
/* @__PURE__ */
|
|
35042
|
+
return /* @__PURE__ */ jsxs67("div", { className: "space-y-2", children: [
|
|
35043
|
+
/* @__PURE__ */ jsxs67("div", { className: "flex items-center gap-2", children: [
|
|
35044
|
+
/* @__PURE__ */ jsxs67("span", { className: "text-[10px] uppercase tracking-widest text-purple-400 font-bold", children: [
|
|
35075
35045
|
"Priority ",
|
|
35076
35046
|
priority
|
|
35077
35047
|
] }),
|
|
35078
|
-
/* @__PURE__ */
|
|
35048
|
+
/* @__PURE__ */ jsx107("div", { className: "h-[1px] flex-1 bg-white/10" })
|
|
35079
35049
|
] }),
|
|
35080
|
-
/* @__PURE__ */
|
|
35050
|
+
/* @__PURE__ */ jsx107("div", { className: "flex flex-wrap gap-2", children: deduped.map((keyword) => /* @__PURE__ */ jsx107(
|
|
35081
35051
|
"div",
|
|
35082
35052
|
{
|
|
35083
35053
|
className: "px-2 py-1 rounded bg-[#1A1A1A] border border-white/10 text-gray-300 text-xs font-medium",
|
|
@@ -35089,6 +35059,98 @@ var KeywordBundlesDisplay = ({ value }) => {
|
|
|
35089
35059
|
}) });
|
|
35090
35060
|
};
|
|
35091
35061
|
|
|
35062
|
+
// src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
|
|
35063
|
+
import { jsx as jsx108, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
35064
|
+
var ObjectDisplay = ({ value }) => {
|
|
35065
|
+
if (!value || typeof value !== "object") return null;
|
|
35066
|
+
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: [
|
|
35067
|
+
/* @__PURE__ */ jsxs68("span", { className: "text-muted-foreground capitalize min-w-[120px]", children: [
|
|
35068
|
+
k.replace(/_/g, " "),
|
|
35069
|
+
":"
|
|
35070
|
+
] }),
|
|
35071
|
+
/* @__PURE__ */ jsx108("span", { className: "text-foreground font-medium", children: Array.isArray(v) ? v.join(", ") : String(v) })
|
|
35072
|
+
] }, k)) });
|
|
35073
|
+
};
|
|
35074
|
+
var StringArrayDisplay = ({ value }) => {
|
|
35075
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
35076
|
+
return /* @__PURE__ */ jsx108("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
|
|
35077
|
+
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)) });
|
|
35078
|
+
};
|
|
35079
|
+
function buildSearchSpecFields(data) {
|
|
35080
|
+
if (!data || typeof data !== "object") return [];
|
|
35081
|
+
return Object.keys(data).map((key) => {
|
|
35082
|
+
const value = data[key];
|
|
35083
|
+
if (key === "keyword_bundles") {
|
|
35084
|
+
return {
|
|
35085
|
+
key,
|
|
35086
|
+
label: "Keyword Bundles",
|
|
35087
|
+
type: "custom",
|
|
35088
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(KeywordBundlesDisplay, { value: v }),
|
|
35089
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(KeywordBundlesEdit, { value: v, onChange })
|
|
35090
|
+
};
|
|
35091
|
+
}
|
|
35092
|
+
if (key === "geography") {
|
|
35093
|
+
return {
|
|
35094
|
+
key,
|
|
35095
|
+
label: "Geography",
|
|
35096
|
+
type: "custom",
|
|
35097
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(CountrySelectDisplay, { value: v }),
|
|
35098
|
+
renderEdit: (v, onChange) => /* @__PURE__ */ jsx108(CountrySelectEdit, { value: v, onChange })
|
|
35099
|
+
};
|
|
35100
|
+
}
|
|
35101
|
+
if (key === "platforms" && Array.isArray(value)) {
|
|
35102
|
+
return {
|
|
35103
|
+
key,
|
|
35104
|
+
label: "Platforms",
|
|
35105
|
+
type: "custom",
|
|
35106
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(StringArrayDisplay, { value: v })
|
|
35107
|
+
};
|
|
35108
|
+
}
|
|
35109
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && !("min" in value && "max" in value)) {
|
|
35110
|
+
const label = key.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
35111
|
+
return {
|
|
35112
|
+
key,
|
|
35113
|
+
label,
|
|
35114
|
+
type: "custom",
|
|
35115
|
+
renderDisplay: (v) => /* @__PURE__ */ jsx108(ObjectDisplay, { value: v })
|
|
35116
|
+
};
|
|
35117
|
+
}
|
|
35118
|
+
const [generated] = generateFieldsFromData({ [key]: value });
|
|
35119
|
+
return generated;
|
|
35120
|
+
});
|
|
35121
|
+
}
|
|
35122
|
+
var SearchSpecCard = React91.memo(
|
|
35123
|
+
({
|
|
35124
|
+
selectionStatus,
|
|
35125
|
+
isLatestMessage = true,
|
|
35126
|
+
className,
|
|
35127
|
+
fields: providedFields,
|
|
35128
|
+
data,
|
|
35129
|
+
specData,
|
|
35130
|
+
...formCardProps
|
|
35131
|
+
}) => {
|
|
35132
|
+
const resolvedData = data || specData;
|
|
35133
|
+
const fields = useMemo5(() => {
|
|
35134
|
+
return providedFields || buildSearchSpecFields(resolvedData ?? {});
|
|
35135
|
+
}, [providedFields, resolvedData]);
|
|
35136
|
+
return /* @__PURE__ */ jsx108(
|
|
35137
|
+
FormCard,
|
|
35138
|
+
{
|
|
35139
|
+
...formCardProps,
|
|
35140
|
+
data: resolvedData ?? {},
|
|
35141
|
+
title: formCardProps.title || "Search Specification",
|
|
35142
|
+
fields,
|
|
35143
|
+
className,
|
|
35144
|
+
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: [
|
|
35145
|
+
/* @__PURE__ */ jsx108(CircleCheck, { className: "h-4 w-4" }),
|
|
35146
|
+
/* @__PURE__ */ jsx108("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
|
|
35147
|
+
] }) : formCardProps.footer
|
|
35148
|
+
}
|
|
35149
|
+
);
|
|
35150
|
+
}
|
|
35151
|
+
);
|
|
35152
|
+
SearchSpecCard.displayName = "SearchSpecCard";
|
|
35153
|
+
|
|
35092
35154
|
// src/molecules/creator-discovery/MCQCard/MCQCard.tsx
|
|
35093
35155
|
import React92 from "react";
|
|
35094
35156
|
import { jsx as jsx109, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
@@ -35108,15 +35170,17 @@ var MCQCard = React92.memo(
|
|
|
35108
35170
|
disabled = false
|
|
35109
35171
|
}) => {
|
|
35110
35172
|
const [selectedOption, setSelectedOption] = React92.useState(propsSelectedOption);
|
|
35173
|
+
const [isProceeded, setIsProceeded] = React92.useState(false);
|
|
35111
35174
|
React92.useEffect(() => {
|
|
35112
35175
|
if (propsSelectedOption) {
|
|
35113
35176
|
setSelectedOption(propsSelectedOption);
|
|
35177
|
+
setIsProceeded(true);
|
|
35114
35178
|
}
|
|
35115
35179
|
}, [propsSelectedOption]);
|
|
35116
35180
|
const handleOptionClick = (key, e) => {
|
|
35117
35181
|
e.preventDefault();
|
|
35118
35182
|
e.stopPropagation();
|
|
35119
|
-
if (isLatestMessage && !isLoading && !disabled) {
|
|
35183
|
+
if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
|
|
35120
35184
|
setSelectedOption(key);
|
|
35121
35185
|
onSelect?.(key);
|
|
35122
35186
|
}
|
|
@@ -35124,8 +35188,9 @@ var MCQCard = React92.memo(
|
|
|
35124
35188
|
const handleProceed = (e) => {
|
|
35125
35189
|
e.preventDefault();
|
|
35126
35190
|
e.stopPropagation();
|
|
35127
|
-
if ((selectedOption || recommended) && !disabled) {
|
|
35191
|
+
if ((selectedOption || recommended) && !disabled && !isProceeded) {
|
|
35128
35192
|
const result = selectedOption || recommended || "";
|
|
35193
|
+
setIsProceeded(true);
|
|
35129
35194
|
onProceed?.(result);
|
|
35130
35195
|
onAction?.({
|
|
35131
35196
|
type: "mcq_selection",
|
|
@@ -35134,7 +35199,7 @@ var MCQCard = React92.memo(
|
|
|
35134
35199
|
});
|
|
35135
35200
|
}
|
|
35136
35201
|
};
|
|
35137
|
-
const isInteractionDisabled = disabled || !isLatestMessage;
|
|
35202
|
+
const isInteractionDisabled = disabled || !isLatestMessage || isProceeded;
|
|
35138
35203
|
return /* @__PURE__ */ jsxs69(
|
|
35139
35204
|
"div",
|
|
35140
35205
|
{
|