pxengine 0.1.152 → 0.1.153

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.d.cts CHANGED
@@ -4218,9 +4218,15 @@ declare const KeywordBundlesEdit: ({ value, onChange, }: {
4218
4218
  declare const KeywordBundlesDisplay: ({ value }: {
4219
4219
  value: any;
4220
4220
  }) => react_jsx_runtime.JSX.Element;
4221
- declare const PlatformSelectEdit: ({ value, onChange, }: {
4221
+ declare const PlatformSelectEdit: ({ value, onChange, options, }: {
4222
4222
  value: any;
4223
4223
  onChange: (value: any) => void;
4224
+ /**
4225
+ * Dynamic platform choices supplied by the parent (from backend/schema data
4226
+ * such as `platform_options` / `available_platforms` / `platforms_list`).
4227
+ * When absent or empty, falls back to DEFAULT_PLATFORMS.
4228
+ */
4229
+ options?: any;
4224
4230
  }) => react_jsx_runtime.JSX.Element;
4225
4231
  declare const PlatformSelectDisplay: ({ value }: {
4226
4232
  value: any;
package/dist/index.d.ts CHANGED
@@ -4218,9 +4218,15 @@ declare const KeywordBundlesEdit: ({ value, onChange, }: {
4218
4218
  declare const KeywordBundlesDisplay: ({ value }: {
4219
4219
  value: any;
4220
4220
  }) => react_jsx_runtime.JSX.Element;
4221
- declare const PlatformSelectEdit: ({ value, onChange, }: {
4221
+ declare const PlatformSelectEdit: ({ value, onChange, options, }: {
4222
4222
  value: any;
4223
4223
  onChange: (value: any) => void;
4224
+ /**
4225
+ * Dynamic platform choices supplied by the parent (from backend/schema data
4226
+ * such as `platform_options` / `available_platforms` / `platforms_list`).
4227
+ * When absent or empty, falls back to DEFAULT_PLATFORMS.
4228
+ */
4229
+ options?: any;
4224
4230
  }) => react_jsx_runtime.JSX.Element;
4225
4231
  declare const PlatformSelectDisplay: ({ value }: {
4226
4232
  value: any;
package/dist/index.mjs CHANGED
@@ -10848,7 +10848,17 @@ __export(molecules_exports, {
10848
10848
  var FENCE_TAG_ALIASES = {
10849
10849
  "google-sheets": "GoogleSheetsCard",
10850
10850
  "google-sheets-connect": "GoogleSheetsConnectCard",
10851
- "google-sheets-list": "GoogleSheetsListCard"
10851
+ "google-sheets-list": "GoogleSheetsListCard",
10852
+ // Acronym-cased components: kebab→PascalCase title-cases each part
10853
+ // independently ("mcq" → "Mcq", "mcq-card" → "McqCard"), which does not match
10854
+ // the exported acronym name "MCQCard". The agent emits the `mcq` fence tag
10855
+ // (see server global_enforcement rules), so without this alias the block
10856
+ // fails to resolve and renders a "component not found" placeholder.
10857
+ mcq: "MCQCard",
10858
+ "mcq-card": "MCQCard",
10859
+ "mcq_card": "MCQCard",
10860
+ "kpi-stats-card": "KPIStatsCard",
10861
+ "kpi-metric-card": "KPIMetricCard"
10852
10862
  };
10853
10863
  function resolveFenceTagComponent(tag) {
10854
10864
  if (FENCE_TAG_ALIASES[tag]) return FENCE_TAG_ALIASES[tag];
@@ -20332,9 +20342,20 @@ var KeywordBundlesDisplay = ({ value }) => {
20332
20342
  }) });
20333
20343
  };
20334
20344
  var DEFAULT_PLATFORMS = ["Instagram", "YouTube", "TikTok"];
20345
+ var normalizePlatformOptions = (options) => {
20346
+ const raw = Array.isArray(options) ? options : typeof options === "string" && options.trim() !== "" ? options.split(",") : null;
20347
+ if (!raw) return null;
20348
+ const cleaned = Array.from(
20349
+ new Set(
20350
+ raw.map((o) => typeof o === "string" ? o.trim() : String(o?.label ?? o?.value ?? o ?? "").trim()).filter(Boolean)
20351
+ )
20352
+ );
20353
+ return cleaned.length > 0 ? cleaned : null;
20354
+ };
20335
20355
  var PlatformSelectEdit = ({
20336
20356
  value,
20337
- onChange
20357
+ onChange,
20358
+ options
20338
20359
  }) => {
20339
20360
  const selectedPlatforms = useMemo6(() => {
20340
20361
  if (Array.isArray(value)) return value;
@@ -20355,10 +20376,10 @@ var PlatformSelectEdit = ({
20355
20376
  onChange([...selectedPlatforms, platform]);
20356
20377
  }
20357
20378
  };
20358
- const options = useMemo6(() => {
20359
- return DEFAULT_PLATFORMS;
20360
- }, []);
20361
- return /* @__PURE__ */ jsx157("div", { className: "flex flex-wrap gap-4 py-2", children: options.map((platform) => /* @__PURE__ */ jsxs115(
20379
+ const resolvedOptions = useMemo6(() => {
20380
+ return normalizePlatformOptions(options) ?? DEFAULT_PLATFORMS;
20381
+ }, [options]);
20382
+ return /* @__PURE__ */ jsx157("div", { className: "flex flex-wrap gap-4 py-2", children: resolvedOptions.map((platform) => /* @__PURE__ */ jsxs115(
20362
20383
  "label",
20363
20384
  {
20364
20385
  className: "flex items-center gap-2 cursor-pointer group",
@@ -20481,7 +20502,8 @@ function buildCampaignSeedFields(data) {
20481
20502
  PlatformSelectEdit,
20482
20503
  {
20483
20504
  value: v,
20484
- onChange
20505
+ onChange,
20506
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
20485
20507
  }
20486
20508
  )
20487
20509
  };
@@ -20646,7 +20668,8 @@ function buildSearchSpecFields(data) {
20646
20668
  PlatformSelectEdit,
20647
20669
  {
20648
20670
  value: v,
20649
- onChange
20671
+ onChange,
20672
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
20650
20673
  }
20651
20674
  )
20652
20675
  };
@@ -21989,7 +22012,14 @@ var CampaignConceptCard = React116.memo(
21989
22012
  return {
21990
22013
  ...field,
21991
22014
  renderDisplay: (v) => /* @__PURE__ */ jsx172(PlatformSelectDisplay, { value: v }),
21992
- renderEdit: (v, onChange) => /* @__PURE__ */ jsx172(PlatformSelectEdit, { value: v, onChange })
22015
+ renderEdit: (v, onChange) => /* @__PURE__ */ jsx172(
22016
+ PlatformSelectEdit,
22017
+ {
22018
+ value: v,
22019
+ onChange,
22020
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
22021
+ }
22022
+ )
21993
22023
  };
21994
22024
  }
21995
22025
  if (field.key === "description" || field.key === "creator_strategy" || field.key === "creatorStrategy") {
@@ -26677,9 +26707,27 @@ var resolveComponent = (identifier) => {
26677
26707
  if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
26678
26708
  Comp = ui_exports[normalized] || ui_exports[identifier] || null;
26679
26709
  }
26710
+ if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
26711
+ Comp = resolveByCaseInsensitiveName(normalized);
26712
+ }
26680
26713
  COMPONENT_LOOKUP_CACHE.set(identifier, Comp);
26681
26714
  return Comp;
26682
26715
  };
26716
+ var CASE_INSENSITIVE_INDEX = null;
26717
+ var resolveByCaseInsensitiveName = (normalized) => {
26718
+ if (!CASE_INSENSITIVE_INDEX) {
26719
+ CASE_INSENSITIVE_INDEX = /* @__PURE__ */ new Map();
26720
+ for (const source of [atoms_exports, molecules_exports]) {
26721
+ for (const [exportName, comp] of Object.entries(source)) {
26722
+ if (typeof comp === "function" || typeof comp === "object") {
26723
+ CASE_INSENSITIVE_INDEX.set(exportName.toLowerCase(), comp);
26724
+ }
26725
+ }
26726
+ }
26727
+ }
26728
+ const key = normalized.toLowerCase();
26729
+ return CASE_INSENSITIVE_INDEX.get(key) || CASE_INSENSITIVE_INDEX.get(`${key}card`) || null;
26730
+ };
26683
26731
  var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
26684
26732
  // Form components - require FormField + FormItem context
26685
26733
  "FormLabel",