pxengine 0.1.91 → 0.1.93
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 +44 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +44 -18
- 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
|
/**
|
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
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -34352,11 +34352,12 @@ ActionButton.displayName = "ActionButton";
|
|
|
34352
34352
|
// src/molecules/generic/FormCard/FormCard.tsx
|
|
34353
34353
|
import React87, { useState as useState7 } from "react";
|
|
34354
34354
|
import { jsx as jsx96, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
34355
|
+
var humanizeKey = (key) => key.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
34355
34356
|
var FormCard = React87.memo(
|
|
34356
34357
|
({
|
|
34357
34358
|
title,
|
|
34358
|
-
fields,
|
|
34359
|
-
data,
|
|
34359
|
+
fields = [],
|
|
34360
|
+
data = {},
|
|
34360
34361
|
editingFields: externalEditingFields,
|
|
34361
34362
|
changedFields = {},
|
|
34362
34363
|
savingFields = {},
|
|
@@ -34393,6 +34394,9 @@ var FormCard = React87.memo(
|
|
|
34393
34394
|
const activeEditingFields = isExternallyControlled ? externalEditingFields || {} : internalEditingFields;
|
|
34394
34395
|
const resolvedSavingFields = Object.keys(savingFields).length > 0 ? savingFields : internalSavingFields;
|
|
34395
34396
|
const activeData = internalData;
|
|
34397
|
+
const effectiveFields = Array.isArray(fields) && fields.length > 0 ? fields : Object.keys(activeData || {}).filter(
|
|
34398
|
+
(k) => !k.startsWith("_") && activeData[k] != null && typeof activeData[k] !== "function"
|
|
34399
|
+
).map((key) => ({ key, label: humanizeKey(key) }));
|
|
34396
34400
|
const handleFieldEdit = (key) => {
|
|
34397
34401
|
if (externalOnFieldEdit) {
|
|
34398
34402
|
externalOnFieldEdit(key);
|
|
@@ -34443,7 +34447,7 @@ var FormCard = React87.memo(
|
|
|
34443
34447
|
const text = [
|
|
34444
34448
|
title,
|
|
34445
34449
|
"",
|
|
34446
|
-
...
|
|
34450
|
+
...effectiveFields.map((field) => {
|
|
34447
34451
|
const value = activeData[field.key];
|
|
34448
34452
|
return `${field.label}: ${flattenValue(value)}`;
|
|
34449
34453
|
})
|
|
@@ -34490,7 +34494,7 @@ var FormCard = React87.memo(
|
|
|
34490
34494
|
}
|
|
34491
34495
|
}
|
|
34492
34496
|
),
|
|
34493
|
-
|
|
34497
|
+
effectiveFields.map((field, index) => /* @__PURE__ */ jsx96(
|
|
34494
34498
|
EditableField,
|
|
34495
34499
|
{
|
|
34496
34500
|
label: field.label,
|
|
@@ -34509,7 +34513,7 @@ var FormCard = React87.memo(
|
|
|
34509
34513
|
renderEdit: field.renderEdit,
|
|
34510
34514
|
showIndex: showTimeline,
|
|
34511
34515
|
index,
|
|
34512
|
-
totalFields:
|
|
34516
|
+
totalFields: effectiveFields.length
|
|
34513
34517
|
},
|
|
34514
34518
|
field.key
|
|
34515
34519
|
))
|
|
@@ -38925,9 +38929,12 @@ var PresentationJobCard = ({
|
|
|
38925
38929
|
authToken,
|
|
38926
38930
|
shareUrl,
|
|
38927
38931
|
className,
|
|
38932
|
+
theme,
|
|
38928
38933
|
onComplete,
|
|
38929
38934
|
onFailed
|
|
38930
38935
|
}) => {
|
|
38936
|
+
const t = th(theme);
|
|
38937
|
+
const accentGradient = theme?.gradient;
|
|
38931
38938
|
const [status, setStatus] = useState10(initialStatus);
|
|
38932
38939
|
const [title, setTitle] = useState10(initialTitle);
|
|
38933
38940
|
const [slideCount, setSlideCount] = useState10(initialSlideCount ?? 0);
|
|
@@ -39091,22 +39098,30 @@ var PresentationJobCard = ({
|
|
|
39091
39098
|
}
|
|
39092
39099
|
};
|
|
39093
39100
|
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: [
|
|
39101
|
+
/* @__PURE__ */ jsxs108("div", { className: "bg-zinc-900 border border-zinc-800 rounded-2xl overflow-hidden", style: t.root, children: [
|
|
39095
39102
|
/* @__PURE__ */ jsx147(
|
|
39096
39103
|
"div",
|
|
39097
39104
|
{
|
|
39098
39105
|
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
39106
|
style: {
|
|
39100
39107
|
backgroundSize: "200% 100%",
|
|
39101
|
-
animation: "gradient-shift 2s ease-in-out infinite"
|
|
39108
|
+
animation: "gradient-shift 2s ease-in-out infinite",
|
|
39109
|
+
...accentGradient ? { backgroundImage: accentGradient } : {}
|
|
39102
39110
|
}
|
|
39103
39111
|
}
|
|
39104
39112
|
),
|
|
39105
39113
|
/* @__PURE__ */ jsxs108("div", { className: "p-5", children: [
|
|
39106
39114
|
/* @__PURE__ */ jsxs108("div", { className: "flex items-start gap-3", children: [
|
|
39107
|
-
/* @__PURE__ */ jsx147(
|
|
39115
|
+
/* @__PURE__ */ jsx147(
|
|
39116
|
+
"div",
|
|
39117
|
+
{
|
|
39118
|
+
className: "w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center flex-shrink-0",
|
|
39119
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder },
|
|
39120
|
+
children: /* @__PURE__ */ jsx147("span", { className: "text-lg", children: getPhaseIcon() })
|
|
39121
|
+
}
|
|
39122
|
+
),
|
|
39108
39123
|
/* @__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" }),
|
|
39124
|
+
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title || "Creating Presentation" }),
|
|
39110
39125
|
/* @__PURE__ */ jsxs108("p", { className: "text-xs text-zinc-500 mt-0.5", children: [
|
|
39111
39126
|
slidesTotal > 0 ? `${slidesTotal} slides` : "Presentation",
|
|
39112
39127
|
" \xB7 In progress"
|
|
@@ -39119,7 +39134,10 @@ var PresentationJobCard = ({
|
|
|
39119
39134
|
"div",
|
|
39120
39135
|
{
|
|
39121
39136
|
className: "h-full bg-gradient-to-r from-indigo-500 to-purple-500 rounded-full transition-all duration-500 ease-out",
|
|
39122
|
-
style: {
|
|
39137
|
+
style: {
|
|
39138
|
+
width: `${Math.max(pct, 2)}%`,
|
|
39139
|
+
...accentGradient ? { backgroundImage: accentGradient } : t.accentBg
|
|
39140
|
+
}
|
|
39123
39141
|
}
|
|
39124
39142
|
) }),
|
|
39125
39143
|
/* @__PURE__ */ jsxs108("span", { className: "absolute right-0 -top-5 text-xs text-zinc-500 font-medium tabular-nums", children: [
|
|
@@ -39128,7 +39146,7 @@ var PresentationJobCard = ({
|
|
|
39128
39146
|
] })
|
|
39129
39147
|
] }),
|
|
39130
39148
|
/* @__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" }),
|
|
39149
|
+
/* @__PURE__ */ jsx147("div", { className: "w-2 h-2 rounded-full bg-indigo-500 animate-pulse", style: t.accentBg }),
|
|
39132
39150
|
/* @__PURE__ */ jsx147("span", { className: "text-xs text-zinc-400", children: step })
|
|
39133
39151
|
] }),
|
|
39134
39152
|
phase === "ai_generation" && slidesTotal > 0 && /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2 pt-1", children: [
|
|
@@ -39172,14 +39190,21 @@ var PresentationJobCard = ({
|
|
|
39172
39190
|
const total = slideCount || 1;
|
|
39173
39191
|
const hasHtml = Boolean(formats.html_url);
|
|
39174
39192
|
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)" } }),
|
|
39193
|
+
/* @__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: [
|
|
39194
|
+
/* @__PURE__ */ jsx147("div", { className: "h-[3px]", style: { background: accentGradient || "linear-gradient(90deg, #8B7D5E, #C0AE82, #DCC99B)" } }),
|
|
39177
39195
|
/* @__PURE__ */ jsxs108("div", { className: "p-5", children: [
|
|
39178
39196
|
/* @__PURE__ */ jsxs108("div", { className: "flex items-start gap-3", children: [
|
|
39179
|
-
/* @__PURE__ */ jsx147(
|
|
39197
|
+
/* @__PURE__ */ jsx147(
|
|
39198
|
+
"div",
|
|
39199
|
+
{
|
|
39200
|
+
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",
|
|
39201
|
+
style: { ...t.accentSubtle(0.1), ...t.accentBorder, ...t.accent },
|
|
39202
|
+
children: /* @__PURE__ */ jsx147(SlidesIcon, {})
|
|
39203
|
+
}
|
|
39204
|
+
),
|
|
39180
39205
|
/* @__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: [
|
|
39206
|
+
/* @__PURE__ */ jsx147("h3", { className: "text-sm font-semibold text-zinc-100 truncate leading-tight", style: t.text, children: title }),
|
|
39207
|
+
/* @__PURE__ */ jsxs108("p", { className: "text-xs text-zinc-500 mt-0.5", style: t.muted, children: [
|
|
39183
39208
|
slideCount ? `${slideCount} slides` : "Presentation",
|
|
39184
39209
|
" \xB7 Ready to export"
|
|
39185
39210
|
] })
|
|
@@ -39217,6 +39242,7 @@ var PresentationJobCard = ({
|
|
|
39217
39242
|
{
|
|
39218
39243
|
onClick: () => setShowExport(true),
|
|
39219
39244
|
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",
|
|
39245
|
+
style: { ...t.accentBg, ...t.accentText },
|
|
39220
39246
|
children: [
|
|
39221
39247
|
/* @__PURE__ */ jsx147(DownloadIcon, {}),
|
|
39222
39248
|
/* @__PURE__ */ jsx147("span", { children: "Export" })
|
|
@@ -39983,7 +40009,7 @@ var WebSearchJobCard = ({
|
|
|
39983
40009
|
/* @__PURE__ */ jsx149("div", { className: "w-2 h-2 rounded-full bg-amber-500 animate-pulse flex-shrink-0" }),
|
|
39984
40010
|
/* @__PURE__ */ jsx149("span", { className: "text-xs text-zinc-400", children: step })
|
|
39985
40011
|
] }),
|
|
39986
|
-
|
|
40012
|
+
searchesTotal > 0 && /* @__PURE__ */ jsxs110("div", { className: "pt-1", children: [
|
|
39987
40013
|
/* @__PURE__ */ jsxs110("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
39988
40014
|
/* @__PURE__ */ jsx149("span", { className: "text-xs text-zinc-500", children: "Web searches" }),
|
|
39989
40015
|
/* @__PURE__ */ jsxs110("span", { className: "text-xs text-zinc-500 tabular-nums", children: [
|
|
@@ -39997,7 +40023,7 @@ var WebSearchJobCard = ({
|
|
|
39997
40023
|
{
|
|
39998
40024
|
className: cn(
|
|
39999
40025
|
"flex-1 h-1 rounded-full transition-all duration-300",
|
|
40000
|
-
i < searchesCompleted ? "bg-amber-500" : i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
|
|
40026
|
+
i < searchesCompleted ? "bg-amber-500" : phase === "ai_generation" && i === searchesCompleted ? "bg-amber-500/50 animate-pulse" : "bg-zinc-700"
|
|
40001
40027
|
)
|
|
40002
40028
|
},
|
|
40003
40029
|
i
|