pxengine 0.1.45 → 0.1.47

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.mjs CHANGED
@@ -34667,6 +34667,39 @@ function generateFieldsFromData(data) {
34667
34667
  return config;
34668
34668
  });
34669
34669
  }
34670
+ function generateFieldsFromPropDefinitions(propDefs, data) {
34671
+ if (!propDefs || !Array.isArray(propDefs)) return [];
34672
+ return propDefs.filter((def) => def.editable === true).map((def) => {
34673
+ const value = data?.[def.name];
34674
+ const editType = def.editConfig?.editFieldType || inferFieldType(value);
34675
+ const config = {
34676
+ key: def.name,
34677
+ label: def.description || normalizeLabel(def.name),
34678
+ type: editType
34679
+ };
34680
+ if (def.editConfig?.placeholder) {
34681
+ config.placeholder = def.editConfig.placeholder;
34682
+ }
34683
+ if (def.editConfig?.options) {
34684
+ config.options = def.editConfig.options;
34685
+ }
34686
+ if (def.editConfig?.sliderConfig) {
34687
+ config.sliderConfig = {
34688
+ min: def.editConfig.sliderConfig.min,
34689
+ max: def.editConfig.sliderConfig.max,
34690
+ step: def.editConfig.sliderConfig.step
34691
+ };
34692
+ }
34693
+ if (def.editConfig?.numberConfig) {
34694
+ config.numberConfig = {
34695
+ min: def.editConfig.numberConfig.min,
34696
+ max: def.editConfig.numberConfig.max,
34697
+ step: def.editConfig.numberConfig.step
34698
+ };
34699
+ }
34700
+ return config;
34701
+ });
34702
+ }
34670
34703
 
34671
34704
  // src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
34672
34705
  import { useState as useState8, useRef as useRef5, useEffect as useEffect6, useMemo as useMemo4 } from "react";
@@ -37849,23 +37882,43 @@ function UIComponentSelector({
37849
37882
  "div",
37850
37883
  {
37851
37884
  className: cn(
37852
- "rounded-xl border border-[var(--border-color)] bg-[var(--card-background)] overflow-hidden",
37885
+ "my-3 rounded-xl border border-border bg-card overflow-hidden shadow-sm",
37853
37886
  className
37854
37887
  ),
37855
37888
  style: FONT_STYLE6,
37856
37889
  children: [
37857
- /* @__PURE__ */ jsxs90("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.02]", children: [
37858
- /* @__PURE__ */ jsx132("h3", { className: "text-sm font-semibold text-[var(--foreground)]", children: "Select UI Components" }),
37859
- /* @__PURE__ */ jsx132("p", { className: "text-xs text-[var(--foreground)]/50 mt-0.5", children: "Choose which visual components this agent can use in its responses." })
37860
- ] }),
37890
+ /* @__PURE__ */ jsx132("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-2", children: [
37891
+ /* @__PURE__ */ jsx132("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ jsxs90(
37892
+ "svg",
37893
+ {
37894
+ width: "12",
37895
+ height: "12",
37896
+ viewBox: "0 0 24 24",
37897
+ fill: "none",
37898
+ stroke: "currentColor",
37899
+ strokeWidth: "2",
37900
+ className: "text-interactive",
37901
+ children: [
37902
+ /* @__PURE__ */ jsx132("rect", { x: "3", y: "3", width: "7", height: "7" }),
37903
+ /* @__PURE__ */ jsx132("rect", { x: "14", y: "3", width: "7", height: "7" }),
37904
+ /* @__PURE__ */ jsx132("rect", { x: "3", y: "14", width: "7", height: "7" }),
37905
+ /* @__PURE__ */ jsx132("rect", { x: "14", y: "14", width: "7", height: "7" })
37906
+ ]
37907
+ }
37908
+ ) }),
37909
+ /* @__PURE__ */ jsxs90("div", { children: [
37910
+ /* @__PURE__ */ jsx132("h3", { className: "text-xs font-semibold text-foreground", children: "Select UI Components" }),
37911
+ /* @__PURE__ */ jsx132("p", { className: "text-[10px] text-muted-foreground mt-0.5", children: "Choose which visual components this agent can use in its responses." })
37912
+ ] })
37913
+ ] }) }),
37861
37914
  /* @__PURE__ */ jsx132("div", { className: "px-4 py-3 space-y-4", children: categoryOrder.map((category) => /* @__PURE__ */ jsxs90("div", { children: [
37862
- /* @__PURE__ */ jsx132("h4", { className: "text-xs font-medium text-[var(--foreground)]/50 uppercase tracking-wider mb-2", children: category }),
37915
+ /* @__PURE__ */ jsx132("h4", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: category }),
37863
37916
  /* @__PURE__ */ jsx132("div", { className: "space-y-1.5", children: grouped[category].map((comp) => /* @__PURE__ */ jsxs90(
37864
37917
  "label",
37865
37918
  {
37866
37919
  className: cn(
37867
- "flex items-start gap-3 px-3 py-2 rounded-lg cursor-pointer transition-colors",
37868
- submitted || !isLatestMessage ? "cursor-default opacity-70" : "hover:bg-[var(--foreground)]/[0.03]",
37920
+ "flex items-start gap-3 px-3 py-2 rounded-lg cursor-pointer transition-all",
37921
+ submitted || !isLatestMessage ? "cursor-default opacity-60" : "hover:bg-muted/80",
37869
37922
  selected.has(comp.name) && !submitted && "bg-interactive/5 border border-interactive/20",
37870
37923
  selected.has(comp.name) && submitted && "bg-interactive/5"
37871
37924
  ),
@@ -37875,7 +37928,7 @@ function UIComponentSelector({
37875
37928
  {
37876
37929
  className: cn(
37877
37930
  "mt-0.5 w-4 h-4 rounded border flex items-center justify-center shrink-0 transition-colors",
37878
- selected.has(comp.name) ? "bg-interactive border-interactive" : "border-[var(--foreground)]/20"
37931
+ selected.has(comp.name) ? "bg-interactive border-interactive" : "border-muted-foreground/30"
37879
37932
  ),
37880
37933
  onClick: (e) => {
37881
37934
  e.preventDefault();
@@ -37907,7 +37960,7 @@ function UIComponentSelector({
37907
37960
  ),
37908
37961
  /* @__PURE__ */ jsxs90("div", { className: "flex-1 min-w-0", children: [
37909
37962
  /* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-1", children: [
37910
- /* @__PURE__ */ jsx132("span", { className: "text-sm font-medium text-[var(--foreground)]", children: comp.display_name }),
37963
+ /* @__PURE__ */ jsx132("span", { className: "text-sm font-medium text-foreground", children: comp.display_name }),
37911
37964
  comp.recommended && /* @__PURE__ */ jsx132("span", { className: "px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20", children: "Recommended" }),
37912
37965
  onPreview && /* @__PURE__ */ jsx132(
37913
37966
  "button",
@@ -37918,7 +37971,7 @@ function UIComponentSelector({
37918
37971
  e.stopPropagation();
37919
37972
  onPreview(comp.name);
37920
37973
  },
37921
- className: "shrink-0 p-0.5 rounded hover:bg-[var(--foreground)]/10 transition-colors",
37974
+ className: "shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
37922
37975
  title: `Preview ${comp.display_name}`,
37923
37976
  children: /* @__PURE__ */ jsxs90(
37924
37977
  "svg",
@@ -37931,7 +37984,7 @@ function UIComponentSelector({
37931
37984
  strokeWidth: "2",
37932
37985
  strokeLinecap: "round",
37933
37986
  strokeLinejoin: "round",
37934
- className: "text-[var(--foreground)]/40 hover:text-interactive",
37987
+ className: "text-muted-foreground hover:text-interactive",
37935
37988
  children: [
37936
37989
  /* @__PURE__ */ jsx132("circle", { cx: "12", cy: "12", r: "10" }),
37937
37990
  /* @__PURE__ */ jsx132("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
@@ -37942,15 +37995,15 @@ function UIComponentSelector({
37942
37995
  }
37943
37996
  )
37944
37997
  ] }),
37945
- /* @__PURE__ */ jsx132("span", { className: "ml-0 text-xs text-[var(--foreground)]/50", children: comp.description })
37998
+ /* @__PURE__ */ jsx132("span", { className: "ml-0 text-xs text-muted-foreground", children: comp.description })
37946
37999
  ] })
37947
38000
  ]
37948
38001
  },
37949
38002
  comp.name
37950
38003
  )) })
37951
38004
  ] }, category)) }),
37952
- !submitted && isLatestMessage && /* @__PURE__ */ jsxs90("div", { className: "px-4 py-3 border-t border-[var(--border-color)] flex items-center justify-between", children: [
37953
- /* @__PURE__ */ jsxs90("span", { className: "text-xs text-[var(--foreground)]/50", children: [
38005
+ !submitted && isLatestMessage && /* @__PURE__ */ jsxs90("div", { className: "px-4 py-3 border-t border-border/60 flex items-center justify-between bg-muted/30", children: [
38006
+ /* @__PURE__ */ jsxs90("span", { className: "text-xs text-muted-foreground", children: [
37954
38007
  selected.size,
37955
38008
  " selected"
37956
38009
  ] }),
@@ -37962,7 +38015,8 @@ function UIComponentSelector({
37962
38015
  children: "Continue"
37963
38016
  }
37964
38017
  )
37965
- ] })
38018
+ ] }),
38019
+ submitted && /* @__PURE__ */ jsx132("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx132("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
37966
38020
  ]
37967
38021
  }
37968
38022
  );
@@ -38215,17 +38269,17 @@ var MultiAgentUISelector = ({
38215
38269
  "div",
38216
38270
  {
38217
38271
  className: cn(
38218
- "text-foreground hover:bg-muted/50 hover:text-foreground my-3 rounded-xl border border-[var(--border-color)] bg-[var(--card-background)] overflow-hidden shadow-sm",
38272
+ "my-3 rounded-xl border border-border bg-card overflow-hidden shadow-sm",
38219
38273
  className
38220
38274
  ),
38221
38275
  style: FONT_STYLE9,
38222
38276
  children: [
38223
- /* @__PURE__ */ jsx135("div", { className: "px-4 py-3 border-b border-[var(--border-color)] bg-[var(--foreground)]/[0.02]", children: /* @__PURE__ */ jsxs93("div", { className: "flex items-center gap-2", children: [
38224
- /* @__PURE__ */ jsx135("div", { className: "w-4 h-4 rounded bg-interactive/20 flex items-center justify-center", children: /* @__PURE__ */ jsxs93(
38277
+ /* @__PURE__ */ jsx135("div", { className: "px-4 py-3 border-b border-border/60 bg-muted/40", children: /* @__PURE__ */ jsxs93("div", { className: "flex items-center gap-2", children: [
38278
+ /* @__PURE__ */ jsx135("div", { className: "w-5 h-5 rounded-md bg-interactive/15 flex items-center justify-center", children: /* @__PURE__ */ jsxs93(
38225
38279
  "svg",
38226
38280
  {
38227
- width: "10",
38228
- height: "10",
38281
+ width: "12",
38282
+ height: "12",
38229
38283
  viewBox: "0 0 24 24",
38230
38284
  fill: "none",
38231
38285
  stroke: "currentColor",
@@ -38239,15 +38293,15 @@ var MultiAgentUISelector = ({
38239
38293
  ]
38240
38294
  }
38241
38295
  ) }),
38242
- /* @__PURE__ */ jsx135("span", { className: "text-xs font-semibold text-[var(--foreground)]", children: "UI Components per Stage" })
38296
+ /* @__PURE__ */ jsx135("span", { className: "text-xs font-semibold text-foreground", children: "UI Components per Stage" })
38243
38297
  ] }) }),
38244
- /* @__PURE__ */ jsx135("div", { className: "flex gap-1 border-b border-[var(--border-color)] px-4 py-2 bg-[var(--foreground)]/[0.01]", children: stages.map((stage) => /* @__PURE__ */ jsx135(
38298
+ /* @__PURE__ */ jsx135("div", { className: "flex gap-1 border-b border-border/60 px-4 py-2 bg-muted/20", children: stages.map((stage) => /* @__PURE__ */ jsx135(
38245
38299
  "button",
38246
38300
  {
38247
38301
  onClick: () => setActiveStageId(stage.id),
38248
38302
  className: cn(
38249
38303
  "px-3 py-1.5 text-[11px] font-medium rounded-full transition-colors",
38250
- activeStageId === stage.id ? "bg-interactive text-white" : "text-[var(--foreground)]/50 hover:text-[var(--foreground)] hover:bg-[var(--foreground)]/[0.05]"
38304
+ activeStageId === stage.id ? "bg-interactive text-white" : "text-muted-foreground hover:text-foreground hover:bg-muted"
38251
38305
  ),
38252
38306
  children: stage.name
38253
38307
  },
@@ -38255,9 +38309,9 @@ var MultiAgentUISelector = ({
38255
38309
  )) }),
38256
38310
  /* @__PURE__ */ jsxs93("div", { className: "px-4 py-3", children: [
38257
38311
  activeStage && /* @__PURE__ */ jsxs93("div", { className: "flex items-center justify-between mb-3", children: [
38258
- /* @__PURE__ */ jsxs93("p", { className: "text-[10px] text-[var(--foreground)]/40", children: [
38312
+ /* @__PURE__ */ jsxs93("p", { className: "text-[10px] text-muted-foreground", children: [
38259
38313
  "Select components for ",
38260
- /* @__PURE__ */ jsx135("strong", { children: activeStage.name }),
38314
+ /* @__PURE__ */ jsx135("strong", { className: "text-foreground", children: activeStage.name }),
38261
38315
  " (",
38262
38316
  activeStage.agent_name,
38263
38317
  ")"
@@ -38271,19 +38325,19 @@ var MultiAgentUISelector = ({
38271
38325
  children: "Select All"
38272
38326
  }
38273
38327
  ),
38274
- /* @__PURE__ */ jsx135("span", { className: "text-[var(--foreground)]/20", children: "|" }),
38328
+ /* @__PURE__ */ jsx135("span", { className: "text-muted-foreground/40", children: "|" }),
38275
38329
  /* @__PURE__ */ jsx135(
38276
38330
  "button",
38277
38331
  {
38278
38332
  onClick: () => clearAll(activeStageId),
38279
- className: "text-[10px] text-[var(--foreground)]/40 hover:text-[var(--foreground)]/60 font-medium",
38333
+ className: "text-[10px] text-muted-foreground hover:text-foreground font-medium",
38280
38334
  children: "Clear"
38281
38335
  }
38282
38336
  )
38283
38337
  ] })
38284
38338
  ] }),
38285
38339
  Object.entries(grouped).map(([category, comps]) => /* @__PURE__ */ jsxs93("div", { className: "mb-3", children: [
38286
- /* @__PURE__ */ jsx135("p", { className: "text-[10px] font-semibold text-[var(--foreground)]/40 uppercase tracking-wide mb-1.5", children: category }),
38340
+ /* @__PURE__ */ jsx135("p", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5", children: category }),
38287
38341
  /* @__PURE__ */ jsx135("div", { className: "grid grid-cols-2 gap-1.5", children: comps.map((comp) => {
38288
38342
  const isSelected = selections[activeStageId]?.has(comp.name) || false;
38289
38343
  return /* @__PURE__ */ jsxs93(
@@ -38300,7 +38354,7 @@ var MultiAgentUISelector = ({
38300
38354
  },
38301
38355
  className: cn(
38302
38356
  "text-left p-2.5 rounded-lg border text-[11px] transition-all overflow-hidden cursor-pointer",
38303
- isSelected ? "border-interactive bg-interactive/5" : "border-[var(--border-color)] hover:border-interactive/50",
38357
+ isSelected ? "border-interactive bg-interactive/5" : "border-border hover:border-interactive/50",
38304
38358
  (submitted || !isLatestMessage) && "opacity-60 cursor-default"
38305
38359
  ),
38306
38360
  children: [
@@ -38310,7 +38364,7 @@ var MultiAgentUISelector = ({
38310
38364
  {
38311
38365
  className: cn(
38312
38366
  "w-3.5 h-3.5 rounded border flex items-center justify-center shrink-0",
38313
- isSelected ? "bg-interactive border-interactive" : "border-[var(--foreground)]/20"
38367
+ isSelected ? "bg-interactive border-interactive" : "border-muted-foreground/30"
38314
38368
  ),
38315
38369
  children: isSelected && /* @__PURE__ */ jsx135(
38316
38370
  "svg",
@@ -38326,7 +38380,7 @@ var MultiAgentUISelector = ({
38326
38380
  )
38327
38381
  }
38328
38382
  ),
38329
- /* @__PURE__ */ jsx135("span", { className: "font-medium text-[var(--foreground)]", children: comp.display_name }),
38383
+ /* @__PURE__ */ jsx135("span", { className: "font-medium text-foreground", children: comp.display_name }),
38330
38384
  comp.recommended && /* @__PURE__ */ jsx135("span", { className: "px-1 py-px text-[8px] font-semibold uppercase tracking-wider rounded-full bg-emerald-500/10 text-emerald-600 border border-emerald-500/20 leading-tight", children: "Rec" }),
38331
38385
  onPreview && /* @__PURE__ */ jsx135(
38332
38386
  "button",
@@ -38336,7 +38390,7 @@ var MultiAgentUISelector = ({
38336
38390
  e.stopPropagation();
38337
38391
  onPreview(comp.name);
38338
38392
  },
38339
- className: "ml-auto shrink-0 p-0.5 rounded hover:bg-[var(--foreground)]/10 transition-colors",
38393
+ className: "ml-auto shrink-0 p-0.5 rounded hover:bg-muted transition-colors",
38340
38394
  title: `Preview ${comp.display_name}`,
38341
38395
  children: /* @__PURE__ */ jsxs93(
38342
38396
  "svg",
@@ -38349,7 +38403,7 @@ var MultiAgentUISelector = ({
38349
38403
  strokeWidth: "2",
38350
38404
  strokeLinecap: "round",
38351
38405
  strokeLinejoin: "round",
38352
- className: "text-[var(--foreground)]/40 hover:text-[var(--primary-color)]",
38406
+ className: "text-muted-foreground hover:text-primary",
38353
38407
  children: [
38354
38408
  /* @__PURE__ */ jsx135("circle", { cx: "12", cy: "12", r: "10" }),
38355
38409
  /* @__PURE__ */ jsx135("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
@@ -38360,7 +38414,7 @@ var MultiAgentUISelector = ({
38360
38414
  }
38361
38415
  )
38362
38416
  ] }),
38363
- /* @__PURE__ */ jsx135("p", { className: "text-[10px] text-[var(--foreground)]/40 mt-0.5 ml-5 whitespace-normal", children: comp.description })
38417
+ /* @__PURE__ */ jsx135("p", { className: "text-[10px] text-muted-foreground mt-0.5 ml-5 whitespace-normal", children: comp.description })
38364
38418
  ]
38365
38419
  },
38366
38420
  comp.name
@@ -38368,7 +38422,7 @@ var MultiAgentUISelector = ({
38368
38422
  }) })
38369
38423
  ] }, category))
38370
38424
  ] }),
38371
- !submitted && isLatestMessage && /* @__PURE__ */ jsx135("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx135(
38425
+ !submitted && isLatestMessage && /* @__PURE__ */ jsx135("div", { className: "px-4 py-3 border-t border-border/60 bg-muted/30", children: /* @__PURE__ */ jsx135(
38372
38426
  "button",
38373
38427
  {
38374
38428
  onClick: handleContinue,
@@ -38376,7 +38430,7 @@ var MultiAgentUISelector = ({
38376
38430
  children: "Continue"
38377
38431
  }
38378
38432
  ) }),
38379
- submitted && /* @__PURE__ */ jsx135("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx135("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5 ", children: "Selections confirmed" }) })
38433
+ submitted && /* @__PURE__ */ jsx135("div", { className: "px-4 pb-3", children: /* @__PURE__ */ jsx135("div", { className: "text-[10px] text-emerald-600 font-medium text-center py-1.5", children: "Selections confirmed" }) })
38380
38434
  ]
38381
38435
  }
38382
38436
  );
@@ -40658,6 +40712,8 @@ export {
40658
40712
  VideoAtom,
40659
40713
  WorkflowVisualizer,
40660
40714
  cn,
40715
+ generateFieldsFromData,
40716
+ generateFieldsFromPropDefinitions,
40661
40717
  useCreatorWidgetPolling
40662
40718
  };
40663
40719
  /*! Bundled license information: