pxengine 0.1.90 → 0.1.92
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 +45 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +45 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3202,6 +3202,8 @@ interface PresentationJobCardProps {
|
|
|
3202
3202
|
*/
|
|
3203
3203
|
shareUrl?: string;
|
|
3204
3204
|
className?: string;
|
|
3205
|
+
/** Organization brand theme — when provided, the card adopts its colors. */
|
|
3206
|
+
theme?: WidgetTheme;
|
|
3205
3207
|
onAction?: (action: string, payload?: any) => void;
|
|
3206
3208
|
sendMessage?: (message: string) => void;
|
|
3207
3209
|
/**
|
|
@@ -3568,6 +3570,10 @@ interface MCQCardProps {
|
|
|
3568
3570
|
* A molecule for Multiple Choice Questions.
|
|
3569
3571
|
* Self-contained: when `sessionId` + `sendMessage` are provided,
|
|
3570
3572
|
* it manages its own persistence and agent communication.
|
|
3573
|
+
*
|
|
3574
|
+
* Honors an optional `theme` (WidgetTheme): when provided, the card adopts the
|
|
3575
|
+
* organization's brand colors via inline styles that override the default
|
|
3576
|
+
* Tailwind palette. With no theme it renders exactly as before.
|
|
3571
3577
|
*/
|
|
3572
3578
|
declare const MCQCard: React__default.NamedExoticComponent<MCQCardProps & {
|
|
3573
3579
|
disableContinueInDiscovery?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -3202,6 +3202,8 @@ interface PresentationJobCardProps {
|
|
|
3202
3202
|
*/
|
|
3203
3203
|
shareUrl?: string;
|
|
3204
3204
|
className?: string;
|
|
3205
|
+
/** Organization brand theme — when provided, the card adopts its colors. */
|
|
3206
|
+
theme?: WidgetTheme;
|
|
3205
3207
|
onAction?: (action: string, payload?: any) => void;
|
|
3206
3208
|
sendMessage?: (message: string) => void;
|
|
3207
3209
|
/**
|
|
@@ -3568,6 +3570,10 @@ interface MCQCardProps {
|
|
|
3568
3570
|
* A molecule for Multiple Choice Questions.
|
|
3569
3571
|
* Self-contained: when `sessionId` + `sendMessage` are provided,
|
|
3570
3572
|
* it manages its own persistence and agent communication.
|
|
3573
|
+
*
|
|
3574
|
+
* Honors an optional `theme` (WidgetTheme): when provided, the card adopts the
|
|
3575
|
+
* organization's brand colors via inline styles that override the default
|
|
3576
|
+
* Tailwind palette. With no theme it renders exactly as before.
|
|
3571
3577
|
*/
|
|
3572
3578
|
declare const MCQCard: React__default.NamedExoticComponent<MCQCardProps & {
|
|
3573
3579
|
disableContinueInDiscovery?: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -38925,9 +38925,12 @@ var PresentationJobCard = ({
|
|
|
38925
38925
|
authToken,
|
|
38926
38926
|
shareUrl,
|
|
38927
38927
|
className,
|
|
38928
|
+
theme,
|
|
38928
38929
|
onComplete,
|
|
38929
38930
|
onFailed
|
|
38930
38931
|
}) => {
|
|
38932
|
+
const t = th(theme);
|
|
38933
|
+
const accentGradient = theme?.gradient;
|
|
38931
38934
|
const [status, setStatus] = useState10(initialStatus);
|
|
38932
38935
|
const [title, setTitle] = useState10(initialTitle);
|
|
38933
38936
|
const [slideCount, setSlideCount] = useState10(initialSlideCount ?? 0);
|
|
@@ -39091,22 +39094,30 @@ var PresentationJobCard = ({
|
|
|
39091
39094
|
}
|
|
39092
39095
|
};
|
|
39093
39096
|
return /* @__PURE__ */ jsxs108("div", { className: cn("w-full", className), children: [
|
|
39094
|
-
/* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
|
|
39097
|
+
/* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
|
|
39095
39098
|
/* @__PURE__ */ jsx147(
|
|
39096
39099
|
"div",
|
|
39097
39100
|
{
|
|
39098
39101
|
className: "h-[3px] bg-gradient-to-r from-indigo-500 via-purple-500 to-indigo-500 bg-[length:200%_100%] animate-[gradient-shift_2s_ease-in-out_infinite]",
|
|
39099
39102
|
style: {
|
|
39100
39103
|
backgroundSize: "200% 100%",
|
|
39101
|
-
animation: "gradient-shift 2s ease-in-out infinite"
|
|
39104
|
+
animation: "gradient-shift 2s ease-in-out infinite",
|
|
39105
|
+
...accentGradient ? { backgroundImage: accentGradient } : {}
|
|
39102
39106
|
}
|
|
39103
39107
|
}
|
|
39104
39108
|
),
|
|
39105
39109
|
/* @__PURE__ */ jsxs108("div", { className: "p-5", children: [
|
|
39106
39110
|
/* @__PURE__ */ jsxs108("div", { className: "flex items-start gap-3", children: [
|
|
39107
|
-
/* @__PURE__ */ jsx147(
|
|
39111
|
+
/* @__PURE__ */ jsx147(
|
|
39112
|
+
"div",
|
|
39113
|
+
{
|
|
39114
|
+
className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0",
|
|
39115
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder },
|
|
39116
|
+
children: /* @__PURE__ */ jsx147("span", { className: "text-lg", children: getPhaseIcon() })
|
|
39117
|
+
}
|
|
39118
|
+
),
|
|
39108
39119
|
/* @__PURE__ */ jsxs108("div", { className: "flex-1 min-w-0", children: [
|
|
39109
|
-
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title || "Creating Presentation" }),
|
|
39120
|
+
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title || "Creating Presentation" }),
|
|
39110
39121
|
/* @__PURE__ */ jsxs108("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
|
|
39111
39122
|
slidesTotal > 0 ? `${slidesTotal} slides` : "Presentation",
|
|
39112
39123
|
" \xB7 In progress"
|
|
@@ -39119,7 +39130,10 @@ var PresentationJobCard = ({
|
|
|
39119
39130
|
"div",
|
|
39120
39131
|
{
|
|
39121
39132
|
className: "h-full bg-gradient-to-r from-indigo-500 to-purple-500 rounded-full transition-all duration-500 ease-out",
|
|
39122
|
-
style: {
|
|
39133
|
+
style: {
|
|
39134
|
+
width: `${Math.max(pct, 2)}%`,
|
|
39135
|
+
...accentGradient ? { backgroundImage: accentGradient } : t.accentBg
|
|
39136
|
+
}
|
|
39123
39137
|
}
|
|
39124
39138
|
) }),
|
|
39125
39139
|
/* @__PURE__ */ jsxs108("span", { className: "absolute right-0 -top-5 text-xs text-zinc-500 font-medium tabular-nums", children: [
|
|
@@ -39128,7 +39142,7 @@ var PresentationJobCard = ({
|
|
|
39128
39142
|
] })
|
|
39129
39143
|
] }),
|
|
39130
39144
|
/* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2", children: [
|
|
39131
|
-
/* @__PURE__ */ jsx147("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse" }),
|
|
39145
|
+
/* @__PURE__ */ jsx147("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse", style: t.accentBg }),
|
|
39132
39146
|
/* @__PURE__ */ jsx147("span", { className: "text-xs text-zinc-400", children: step })
|
|
39133
39147
|
] }),
|
|
39134
39148
|
phase === "ai_generation" && slidesTotal > 0 && /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2 pt-1", children: [
|
|
@@ -39172,14 +39186,21 @@ var PresentationJobCard = ({
|
|
|
39172
39186
|
const total = slideCount || 1;
|
|
39173
39187
|
const hasHtml = Boolean(formats.html_url);
|
|
39174
39188
|
return /* @__PURE__ */ jsxs108(Fragment5, { children: [
|
|
39175
|
-
/* @__PURE__ */ jsx147("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", children: [
|
|
39176
|
-
/* @__PURE__ */ jsx147("div", { className: "h-[3px]", style: { background: "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
|
|
39189
|
+
/* @__PURE__ */ jsx147("div", { className: cn("w-full", className), children: /* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
|
|
39190
|
+
/* @__PURE__ */ jsx147("div", { className: "h-[3px]", style: { background: accentGradient || "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
|
|
39177
39191
|
/* @__PURE__ */ jsxs108("div", { className: "p-5", children: [
|
|
39178
39192
|
/* @__PURE__ */ jsxs108("div", { className: "flex items-start gap-3", children: [
|
|
39179
|
-
/* @__PURE__ */ jsx147(
|
|
39193
|
+
/* @__PURE__ */ jsx147(
|
|
39194
|
+
"div",
|
|
39195
|
+
{
|
|
39196
|
+
className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0 text-indigo-400",
|
|
39197
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder, ...t.accent },
|
|
39198
|
+
children: /* @__PURE__ */ jsx147(SlidesIcon, {})
|
|
39199
|
+
}
|
|
39200
|
+
),
|
|
39180
39201
|
/* @__PURE__ */ jsxs108("div", { className: "flex-1 min-w-0", children: [
|
|
39181
|
-
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", children: title }),
|
|
39182
|
-
/* @__PURE__ */ jsxs108("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
|
|
39202
|
+
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title }),
|
|
39203
|
+
/* @__PURE__ */ jsxs108("p", { className: "text-xs text-zinc-500 mt-0.5", style: t.muted, children: [
|
|
39183
39204
|
slideCount ? `${slideCount} slides` : "Presentation",
|
|
39184
39205
|
" \xB7 Ready to export"
|
|
39185
39206
|
] })
|
|
@@ -39217,6 +39238,7 @@ var PresentationJobCard = ({
|
|
|
39217
39238
|
{
|
|
39218
39239
|
onClick: () => setShowExport(true),
|
|
39219
39240
|
className: "flex items-center gap-1.5 px-2.5 h-7 bg-indigo-600 hover:bg-indigo-500 active:bg-indigo-700 text-white text-xs font-medium rounded-lg transition-colors",
|
|
39241
|
+
style: { ...t.accentBg, ...t.accentText },
|
|
39220
39242
|
children: [
|
|
39221
39243
|
/* @__PURE__ */ jsx147(DownloadIcon, {}),
|
|
39222
39244
|
/* @__PURE__ */ jsx147("span", { children: "Export" })
|
|
@@ -41097,6 +41119,7 @@ var MCQCard = React111.memo(
|
|
|
41097
41119
|
onAction,
|
|
41098
41120
|
disabled = false,
|
|
41099
41121
|
disableContinueInDiscovery,
|
|
41122
|
+
theme,
|
|
41100
41123
|
// Self-contained props
|
|
41101
41124
|
sessionId,
|
|
41102
41125
|
sendMessage,
|
|
@@ -41106,8 +41129,7 @@ var MCQCard = React111.memo(
|
|
|
41106
41129
|
}) => {
|
|
41107
41130
|
const resolvedQuestion = question || allProps.Question || allProps.q || "";
|
|
41108
41131
|
const resolvedOptions = options || allProps.Options || allProps.opts || {};
|
|
41109
|
-
const
|
|
41110
|
-
console.log("[MCQCard] FULL PROPS:", { allProps, resolvedQuestion, resolvedOptions: Object.keys(resolvedOptions || {}), resolvedRecommended });
|
|
41132
|
+
const t = th(theme);
|
|
41111
41133
|
const [selectedOption, setSelectedOption] = React111.useState(propsSelectedOption);
|
|
41112
41134
|
const [isProceeded, setIsProceeded] = React111.useState(false);
|
|
41113
41135
|
const fetchedSessionRef = React111.useRef("");
|
|
@@ -41132,24 +41154,20 @@ var MCQCard = React111.memo(
|
|
|
41132
41154
|
if (propsSelectedOption) return;
|
|
41133
41155
|
fetchedSessionRef.current = fetchKey;
|
|
41134
41156
|
const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
|
|
41135
|
-
console.log("[MCQCard] Fetching with key:", questionKey, "(question:", resolvedQuestion, ")");
|
|
41136
41157
|
fetchSelections(sessionId).then((selections) => {
|
|
41137
|
-
console.log("[MCQCard] Got selections:", selections);
|
|
41138
41158
|
const stored = selections[questionKey] || selections[resolvedQuestion] || selections[`mcq_${sessionId}`];
|
|
41139
41159
|
if (stored) {
|
|
41140
|
-
console.log("[MCQCard] Setting selected:", stored);
|
|
41141
41160
|
setSelectedOption(stored);
|
|
41142
41161
|
setIsProceeded(true);
|
|
41143
41162
|
}
|
|
41144
|
-
}).catch((
|
|
41163
|
+
}).catch(() => {
|
|
41164
|
+
});
|
|
41145
41165
|
}, [sessionId, propsSelectedOption, resolvedQuestion, buildQuestionKey]);
|
|
41146
41166
|
const isDiscovery = disableContinueInDiscovery !== void 0 ? disableContinueInDiscovery : typeof window !== "undefined" && window.location.pathname.includes("creator-discovery");
|
|
41147
41167
|
const handleOptionClick = (key, e) => {
|
|
41148
41168
|
e.preventDefault();
|
|
41149
41169
|
e.stopPropagation();
|
|
41150
|
-
console.log("[MCQCard] Option clicked:", key, "Can select:", isLatestMessage && !isLoading && !disabled && !isProceeded);
|
|
41151
41170
|
if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
|
|
41152
|
-
console.log("[MCQCard] Setting selected to:", key);
|
|
41153
41171
|
setSelectedOption(key);
|
|
41154
41172
|
onSelect?.(key);
|
|
41155
41173
|
}
|
|
@@ -41167,7 +41185,6 @@ var MCQCard = React111.memo(
|
|
|
41167
41185
|
setIsProceeded(true);
|
|
41168
41186
|
if (sessionId && resolvedQuestion) {
|
|
41169
41187
|
const questionKey = buildQuestionKey(sessionId, resolvedQuestion);
|
|
41170
|
-
console.log("[MCQCard] Persisting:", questionKey, result);
|
|
41171
41188
|
await persistSelection(sessionId, questionKey, result);
|
|
41172
41189
|
}
|
|
41173
41190
|
if (sendMessage) {
|
|
@@ -41195,8 +41212,9 @@ A: ${label}`);
|
|
|
41195
41212
|
"p-4 rounded-lg border border-gray400 bg-cardSurface w-full",
|
|
41196
41213
|
className
|
|
41197
41214
|
),
|
|
41215
|
+
style: t.root,
|
|
41198
41216
|
children: [
|
|
41199
|
-
/* @__PURE__ */ jsx153("div", { className: "mb-4", children: /* @__PURE__ */ jsx153("p", { className: "text-sm text-cardText", children: resolvedQuestion || "Select an option:" }) }),
|
|
41217
|
+
/* @__PURE__ */ jsx153("div", { className: "mb-4", children: /* @__PURE__ */ jsx153("p", { className: "text-sm text-cardText", style: t.text, children: resolvedQuestion || "Select an option:" }) }),
|
|
41200
41218
|
/* @__PURE__ */ jsx153("div", { className: "space-y-2.5 mb-4", children: optionsEntries.map(([key, label]) => {
|
|
41201
41219
|
const isSelected = selectedOption === key;
|
|
41202
41220
|
const isRecommended = key === recommended;
|
|
@@ -41211,6 +41229,7 @@ A: ${label}`);
|
|
|
41211
41229
|
!selectedOption && !isOptionsDisabled && "hover:border-gray500",
|
|
41212
41230
|
(isLoading || isOptionsDisabled) && "opacity-50 cursor-not-allowed"
|
|
41213
41231
|
),
|
|
41232
|
+
style: isSelected ? { ...t.surface, ...t.accentBorder } : t.surface,
|
|
41214
41233
|
children: /* @__PURE__ */ jsxs114("div", { className: "flex items-start gap-3", children: [
|
|
41215
41234
|
/* @__PURE__ */ jsx153("div", { className: "mt-0.5 flex-shrink-0", children: /* @__PURE__ */ jsx153(
|
|
41216
41235
|
"div",
|
|
@@ -41222,12 +41241,13 @@ A: ${label}`);
|
|
|
41222
41241
|
!selectedOption && !isOptionsDisabled && "hover:border-gold"
|
|
41223
41242
|
)
|
|
41224
41243
|
),
|
|
41225
|
-
|
|
41244
|
+
style: isSelected ? t.accentBorder : void 0,
|
|
41245
|
+
children: isSelected && /* @__PURE__ */ jsx153("div", { className: "w-2 h-2 rounded-full bg-gold", style: t.accentBg })
|
|
41226
41246
|
}
|
|
41227
41247
|
) }),
|
|
41228
41248
|
/* @__PURE__ */ jsxs114("div", { className: "flex-1 min-w-0", children: [
|
|
41229
|
-
isRecommended && /* @__PURE__ */ jsx153("p", { className: "text-xs font-semibold text-gold mb-1", children: "Recommended" }),
|
|
41230
|
-
/* @__PURE__ */ jsx153("p", { className: "text-sm text-cardText", children: label })
|
|
41249
|
+
isRecommended && /* @__PURE__ */ jsx153("p", { className: "text-xs font-semibold text-gold mb-1", style: t.accent, children: "Recommended" }),
|
|
41250
|
+
/* @__PURE__ */ jsx153("p", { className: "text-sm text-cardText", style: t.text, children: label })
|
|
41231
41251
|
] })
|
|
41232
41252
|
] })
|
|
41233
41253
|
},
|
|
@@ -41244,6 +41264,7 @@ A: ${label}`);
|
|
|
41244
41264
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
41245
41265
|
"bg-cardSurface hover:bg-cardSurface/80 text-gold border-cardBorder"
|
|
41246
41266
|
),
|
|
41267
|
+
style: { ...t.surface, ...t.accent },
|
|
41247
41268
|
children: isLoading ? "Sending..." : "Continue"
|
|
41248
41269
|
}
|
|
41249
41270
|
) })
|