pxengine 0.1.152 → 0.1.154

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 CHANGED
@@ -11196,7 +11196,30 @@ __export(molecules_exports, {
11196
11196
  var FENCE_TAG_ALIASES = {
11197
11197
  "google-sheets": "GoogleSheetsCard",
11198
11198
  "google-sheets-connect": "GoogleSheetsConnectCard",
11199
- "google-sheets-list": "GoogleSheetsListCard"
11199
+ "google-sheets-list": "GoogleSheetsListCard",
11200
+ // The creators widget is registered as "CreatorWidget" and its canonical
11201
+ // fence tag is `creator-widget`. Agents (notably on smaller models like
11202
+ // Haiku) frequently emit near-synonym tags — `creator-list`, `creators`,
11203
+ // `creator-grid` — for the same widget. Without these aliases such a tag
11204
+ // kebab→PascalCases to a non-existent component ("CreatorList"), so the
11205
+ // block resolves to neither a built-in nor an organism and renders the
11206
+ // "Couldn't load this widget" placeholder. Map the synonyms to the one
11207
+ // real component so the creators widget renders regardless of the exact
11208
+ // tag the model chose. (DEV-342)
11209
+ "creator-list": "CreatorWidget",
11210
+ "creators": "CreatorWidget",
11211
+ "creator-grid": "CreatorWidget",
11212
+ "creator_list": "CreatorWidget",
11213
+ // Acronym-cased components: kebab→PascalCase title-cases each part
11214
+ // independently ("mcq" → "Mcq", "mcq-card" → "McqCard"), which does not match
11215
+ // the exported acronym name "MCQCard". The agent emits the `mcq` fence tag
11216
+ // (see server global_enforcement rules), so without this alias the block
11217
+ // fails to resolve and renders a "component not found" placeholder.
11218
+ mcq: "MCQCard",
11219
+ "mcq-card": "MCQCard",
11220
+ "mcq_card": "MCQCard",
11221
+ "kpi-stats-card": "KPIStatsCard",
11222
+ "kpi-metric-card": "KPIMetricCard"
11200
11223
  };
11201
11224
  function resolveFenceTagComponent(tag) {
11202
11225
  if (FENCE_TAG_ALIASES[tag]) return FENCE_TAG_ALIASES[tag];
@@ -20668,9 +20691,20 @@ var KeywordBundlesDisplay = ({ value }) => {
20668
20691
  }) });
20669
20692
  };
20670
20693
  var DEFAULT_PLATFORMS = ["Instagram", "YouTube", "TikTok"];
20694
+ var normalizePlatformOptions = (options) => {
20695
+ const raw = Array.isArray(options) ? options : typeof options === "string" && options.trim() !== "" ? options.split(",") : null;
20696
+ if (!raw) return null;
20697
+ const cleaned = Array.from(
20698
+ new Set(
20699
+ raw.map((o) => typeof o === "string" ? o.trim() : String(o?.label ?? o?.value ?? o ?? "").trim()).filter(Boolean)
20700
+ )
20701
+ );
20702
+ return cleaned.length > 0 ? cleaned : null;
20703
+ };
20671
20704
  var PlatformSelectEdit = ({
20672
20705
  value,
20673
- onChange
20706
+ onChange,
20707
+ options
20674
20708
  }) => {
20675
20709
  const selectedPlatforms = (0, import_react85.useMemo)(() => {
20676
20710
  if (Array.isArray(value)) return value;
@@ -20691,10 +20725,10 @@ var PlatformSelectEdit = ({
20691
20725
  onChange([...selectedPlatforms, platform]);
20692
20726
  }
20693
20727
  };
20694
- const options = (0, import_react85.useMemo)(() => {
20695
- return DEFAULT_PLATFORMS;
20696
- }, []);
20697
- return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-wrap gap-4 py-2", children: options.map((platform) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
20728
+ const resolvedOptions = (0, import_react85.useMemo)(() => {
20729
+ return normalizePlatformOptions(options) ?? DEFAULT_PLATFORMS;
20730
+ }, [options]);
20731
+ return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex flex-wrap gap-4 py-2", children: resolvedOptions.map((platform) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
20698
20732
  "label",
20699
20733
  {
20700
20734
  className: "flex items-center gap-2 cursor-pointer group",
@@ -20817,7 +20851,8 @@ function buildCampaignSeedFields(data) {
20817
20851
  PlatformSelectEdit,
20818
20852
  {
20819
20853
  value: v,
20820
- onChange
20854
+ onChange,
20855
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
20821
20856
  }
20822
20857
  )
20823
20858
  };
@@ -20982,7 +21017,8 @@ function buildSearchSpecFields(data) {
20982
21017
  PlatformSelectEdit,
20983
21018
  {
20984
21019
  value: v,
20985
- onChange
21020
+ onChange,
21021
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
20986
21022
  }
20987
21023
  )
20988
21024
  };
@@ -22325,7 +22361,14 @@ var CampaignConceptCard = import_react90.default.memo(
22325
22361
  return {
22326
22362
  ...field,
22327
22363
  renderDisplay: (v) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(PlatformSelectDisplay, { value: v }),
22328
- renderEdit: (v, onChange) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(PlatformSelectEdit, { value: v, onChange })
22364
+ renderEdit: (v, onChange) => /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(
22365
+ PlatformSelectEdit,
22366
+ {
22367
+ value: v,
22368
+ onChange,
22369
+ options: data.platform_options || data.available_platforms || data.platforms_list || []
22370
+ }
22371
+ )
22329
22372
  };
22330
22373
  }
22331
22374
  if (field.key === "description" || field.key === "creator_strategy" || field.key === "creatorStrategy") {
@@ -27013,9 +27056,27 @@ var resolveComponent = (identifier) => {
27013
27056
  if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
27014
27057
  Comp = ui_exports[normalized] || ui_exports[identifier] || null;
27015
27058
  }
27059
+ if (!Comp && !CONTEXT_DEPENDENT_COMPONENTS.has(normalized)) {
27060
+ Comp = resolveByCaseInsensitiveName(normalized);
27061
+ }
27016
27062
  COMPONENT_LOOKUP_CACHE.set(identifier, Comp);
27017
27063
  return Comp;
27018
27064
  };
27065
+ var CASE_INSENSITIVE_INDEX = null;
27066
+ var resolveByCaseInsensitiveName = (normalized) => {
27067
+ if (!CASE_INSENSITIVE_INDEX) {
27068
+ CASE_INSENSITIVE_INDEX = /* @__PURE__ */ new Map();
27069
+ for (const source of [atoms_exports, molecules_exports]) {
27070
+ for (const [exportName, comp] of Object.entries(source)) {
27071
+ if (typeof comp === "function" || typeof comp === "object") {
27072
+ CASE_INSENSITIVE_INDEX.set(exportName.toLowerCase(), comp);
27073
+ }
27074
+ }
27075
+ }
27076
+ }
27077
+ const key = normalized.toLowerCase();
27078
+ return CASE_INSENSITIVE_INDEX.get(key) || CASE_INSENSITIVE_INDEX.get(`${key}card`) || null;
27079
+ };
27019
27080
  var CONTEXT_DEPENDENT_COMPONENTS = /* @__PURE__ */ new Set([
27020
27081
  // Form components - require FormField + FormItem context
27021
27082
  "FormLabel",