@wix/web5-core 1.57.2 → 1.59.0

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.
Files changed (87) hide show
  1. package/dist/cjs/client/applyThemeOverrides.js +89 -0
  2. package/dist/cjs/client/applyThemeOverrides.js.map +1 -0
  3. package/dist/cjs/client/clientBundleUrl.js +83 -0
  4. package/dist/cjs/client/clientBundleUrl.js.map +1 -0
  5. package/dist/cjs/client/mergeClientConfig.js +59 -0
  6. package/dist/cjs/client/mergeClientConfig.js.map +1 -0
  7. package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js +159 -0
  8. package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
  9. package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js +5 -2
  10. package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
  11. package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js +4 -1
  12. package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
  13. package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js +35 -2
  14. package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -1
  15. package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js +27 -1
  16. package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -1
  17. package/dist/cjs/component/componentDefinitions/index.js +14 -1
  18. package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
  19. package/dist/cjs/component/componentParser.js +38 -1
  20. package/dist/cjs/component/componentParser.js.map +1 -1
  21. package/dist/cjs/component/types.js.map +1 -1
  22. package/dist/cjs/components/ui/SearchSection.css +66 -9
  23. package/dist/cjs/components/ui/SearchSection.js +23 -19
  24. package/dist/cjs/components/ui/SearchSection.js.map +1 -1
  25. package/dist/cjs/hostScope.js.map +1 -1
  26. package/dist/cjs/index.js +23 -3
  27. package/dist/cjs/index.js.map +1 -1
  28. package/dist/cjs/styles/prompt-input-tokens.css +41 -34
  29. package/dist/cjs/utils/matchDebug.js +93 -0
  30. package/dist/cjs/utils/matchDebug.js.map +1 -0
  31. package/dist/esm/client/applyThemeOverrides.js +85 -0
  32. package/dist/esm/client/applyThemeOverrides.js.map +1 -0
  33. package/dist/esm/client/clientBundleUrl.js +75 -0
  34. package/dist/esm/client/clientBundleUrl.js.map +1 -0
  35. package/dist/esm/client/mergeClientConfig.js +55 -0
  36. package/dist/esm/client/mergeClientConfig.js.map +1 -0
  37. package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js +154 -0
  38. package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
  39. package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js +6 -3
  40. package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
  41. package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js +5 -2
  42. package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
  43. package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js +36 -3
  44. package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -1
  45. package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js +27 -1
  46. package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -1
  47. package/dist/esm/component/componentDefinitions/index.js +14 -1
  48. package/dist/esm/component/componentDefinitions/index.js.map +1 -1
  49. package/dist/esm/component/componentParser.js +38 -1
  50. package/dist/esm/component/componentParser.js.map +1 -1
  51. package/dist/esm/component/types.js.map +1 -1
  52. package/dist/esm/components/ui/SearchSection.css +66 -9
  53. package/dist/esm/components/ui/SearchSection.js +5 -1
  54. package/dist/esm/components/ui/SearchSection.js.map +1 -1
  55. package/dist/esm/hostScope.js.map +1 -1
  56. package/dist/esm/index.js +9 -1
  57. package/dist/esm/index.js.map +1 -1
  58. package/dist/esm/styles/prompt-input-tokens.css +41 -34
  59. package/dist/esm/utils/matchDebug.js +85 -0
  60. package/dist/esm/utils/matchDebug.js.map +1 -0
  61. package/dist/types/client/applyThemeOverrides.d.ts +19 -0
  62. package/dist/types/client/applyThemeOverrides.d.ts.map +1 -0
  63. package/dist/types/client/clientBundleUrl.d.ts +39 -0
  64. package/dist/types/client/clientBundleUrl.d.ts.map +1 -0
  65. package/dist/types/client/mergeClientConfig.d.ts +28 -0
  66. package/dist/types/client/mergeClientConfig.d.ts.map +1 -0
  67. package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts +51 -0
  68. package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts.map +1 -0
  69. package/dist/types/component/componentDefinitions/HeroEntitySectionDefinition.d.ts.map +1 -1
  70. package/dist/types/component/componentDefinitions/HeroSectionDefinition.d.ts.map +1 -1
  71. package/dist/types/component/componentDefinitions/NextStepsSectionDefinition.d.ts.map +1 -1
  72. package/dist/types/component/componentDefinitions/TextBlockSectionDefinition.d.ts.map +1 -1
  73. package/dist/types/component/componentDefinitions/index.d.ts +1 -0
  74. package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
  75. package/dist/types/component/componentParser.d.ts.map +1 -1
  76. package/dist/types/component/types.d.ts +7 -0
  77. package/dist/types/component/types.d.ts.map +1 -1
  78. package/dist/types/components/ui/SearchSection.d.ts.map +1 -1
  79. package/dist/types/hostScope.d.ts +11 -0
  80. package/dist/types/hostScope.d.ts.map +1 -1
  81. package/dist/types/index.d.ts +5 -1
  82. package/dist/types/index.d.ts.map +1 -1
  83. package/dist/types/utils/matchDebug.d.ts +38 -0
  84. package/dist/types/utils/matchDebug.d.ts.map +1 -0
  85. package/package.json +2 -2
  86. package/src/components/ui/SearchSection.css +66 -9
  87. package/src/styles/prompt-input-tokens.css +41 -34
@@ -1 +1 @@
1
- {"version":3,"names":["_parseUtils","require","_parts","HeroSectionDefinition","constructor","_defineProperty2","default","headline","content","buttons","id","text","variant","markdown","expected","onClick","image","parse","parts","firstImageSrc","lists","getPartsByType","list","item","_list$meta","meta","items","_item$meta","itemParts","nestedImage","buttonIndex","getLinks","map","l","i","_l$content","trim","href","length","trailingList","filteredItems","_list$meta2","_item$meta2","hasImage","some","p","type","push","allItemsAreLinks","listLinks","_item$meta3","_itemLinkParts$0$cont","itemLinkParts","filter","allText","extractListItemText","linkTexts","_l$content2","join","link","isFirstButton","lines","_item$meta4","h1Index","findIndex","_p$meta","level","blockquotes","leadingQuote","bq","_bq$meta","_bq$content","bqIndex","indexOf","raw","parseCalloutTag","undefined","headingText","badge","bodyText","exports"],"sources":["../../../../src/component/componentDefinitions/HeroSectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n bodyText,\n firstImageSrc,\n parseCalloutTag,\n extractListItemText,\n} from './parse-utils';\nimport type { Part, ListPart, LinkPart, ListItemPart } from '../../parts/parts';\nimport { getPartsByType, getLinks } from '../../parts/parts';\nimport type {\n HeroButton,\n HeroCompProps,\n HeroSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\n\nexport class HeroSectionDefinition\n implements SectionDefinition<HeroSectionComponent>\n{\n sectionType = 'hero' as const;\n singleInstance = true;\n patterns = [\n // Canonical hero shape: section descriptor, then the leading ECHO callout\n // (optional in the grammar — the orchestrator always emits it, but a missing\n // ECHO must not stop the hero from rendering), then an optional h3 badge,\n // then the h1. The callout and badge are independent slots so a hero can\n // carry both. The second `html_comment?` keeps the legacy ordering\n // (callout before the descriptor) matching for pages saved before this change.\n 'html_comment? > callout? > html_comment? > h3? > h1 > (image | t | link)* > list?',\n ];\n\n defaults: HeroCompProps = {\n headline: 'Build something amazing',\n content: 'Your platform for data-driven decisions.',\n buttons: [{ id: 'btn-0', text: 'Get started', variant: 'primary' }],\n };\n\n fixtures: SectionFixture<HeroCompProps>[] = [\n {\n markdown:\n '# Welcome\\n\\nBuild amazing things.\\n\\n[Get Started](/) [Learn More](/about)',\n expected: {\n headline: 'Welcome',\n content: 'Build amazing things.',\n buttons: [\n {\n id: 'btn-0',\n text: 'Get Started',\n variant: 'primary',\n onClick: '/',\n },\n {\n id: 'btn-1',\n text: 'Learn More',\n variant: 'secondary',\n onClick: '/about',\n },\n ],\n },\n },\n {\n markdown: `<!-- Hero Section -->\n\n# Welcome to Our Platform\n\n![Hero Image](hero.jpg)\n\nGet started today with our amazing features.\n\n[Get Started](/signup) [Learn More](/about)`,\n expected: {\n headline: 'Welcome to Our Platform',\n content: 'Get started today with our amazing features.',\n buttons: [\n {\n id: 'btn-0',\n text: 'Get Started',\n variant: 'primary',\n onClick: '/signup',\n },\n {\n id: 'btn-1',\n text: 'Learn More',\n variant: 'secondary',\n onClick: '/about',\n },\n ],\n image: 'hero.jpg',\n },\n },\n ];\n\n parse(parts: Part[]): HeroCompProps {\n let image = firstImageSrc(parts);\n const lists = getPartsByType<ListPart>(parts, 'list');\n\n if (!image) {\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const nestedImage = firstImageSrc(itemParts);\n if (nestedImage) {\n image = nestedImage;\n break;\n }\n }\n if (image) {\n break;\n }\n }\n }\n\n // Start with top-level links as buttons\n let buttonIndex = 0;\n const buttons: HeroButton[] = getLinks(parts).map(\n (l, i): HeroButton => ({\n id: `btn-${i}`,\n text: l.content?.trim() || 'Learn more',\n variant: i === 0 ? 'primary' : 'secondary',\n onClick: l.meta.href,\n }),\n );\n buttonIndex = buttons.length;\n\n // Process lists: filter out image-only items, then check if remaining\n // items are all link-only. If so, convert to buttons; otherwise keep as trailingList.\n let trailingList: string | undefined;\n if (lists.length > 0) {\n for (const list of lists) {\n // Filter out image-only items\n const filteredItems: ListItemPart[] = [];\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const hasImage = itemParts.some((p) => p.type === 'image');\n if (hasImage) {\n continue;\n }\n filteredItems.push(item);\n }\n\n if (filteredItems.length === 0) {\n continue;\n }\n\n // Check if ALL remaining items contain only links (no other text)\n let allItemsAreLinks = true;\n const listLinks: { text: string; href: string }[] = [];\n\n for (const item of filteredItems) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const itemLinkParts = itemParts.filter(\n (p): p is LinkPart => p.type === 'link',\n );\n\n if (itemLinkParts.length === 0) {\n allItemsAreLinks = false;\n break;\n }\n\n // Check if the item text is entirely link text (no extra content)\n const allText = extractListItemText(item).trim();\n const linkTexts = itemLinkParts\n .map((l) => l.content?.trim() || '')\n .join(' ')\n .trim();\n\n if (allText !== linkTexts) {\n allItemsAreLinks = false;\n break;\n }\n\n listLinks.push({\n text: itemLinkParts[0].content?.trim() || 'Learn more',\n href: itemLinkParts[0].meta.href,\n });\n }\n\n if (allItemsAreLinks && listLinks.length > 0) {\n // Convert link-only list items to buttons\n for (const link of listLinks) {\n const isFirstButton = buttons.length === 0;\n buttons.push({\n id: `btn-${buttonIndex++}`,\n text: link.text,\n variant: isFirstButton ? 'primary' : 'secondary',\n onClick: link.href,\n });\n }\n } else {\n // Keep as trailing list markdown\n const lines: string[] = [];\n for (const item of filteredItems) {\n const text =\n (item.meta?.markdown as string) || extractListItemText(item);\n if (text) {\n lines.push(`- ${text}`);\n }\n }\n if (lines.length > 0) {\n trailingList = lines.join('\\n');\n }\n }\n }\n }\n\n // The hero claims the leading callout before the h1 — the ECHO the\n // orchestrator emits as the hero's opening line, right after the section\n // descriptor. A trailing blockquote is not part of the hero pattern, so it\n // falls through to a downstream callout section instead.\n const h1Index = parts.findIndex(\n (p) => p.type === 'heading' && (p.meta as { level: number })?.level === 1,\n );\n const blockquotes = getPartsByType<Part>(parts, 'callout');\n let leadingQuote: string | undefined;\n\n for (const bq of blockquotes) {\n const bqIndex = parts.indexOf(bq);\n if (h1Index >= 0 && bqIndex > h1Index) {\n continue;\n }\n const raw = (bq.meta?.markdown as string)?.trim() || bq.content?.trim();\n if (!raw) {\n continue;\n }\n leadingQuote = parseCalloutTag(raw).text || undefined;\n }\n\n return {\n headline: headingText(parts, 1),\n badge: headingText(parts, 3) || undefined,\n content: bodyText(parts) || undefined,\n buttons: buttons.length > 0 ? buttons : undefined,\n image,\n trailingList,\n leadingQuote,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AASO,MAAME,qBAAqB,CAElC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,MAAM;IAAA,IAAAD,gBAAA,CAAAC,OAAA,0BACH,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBACV;IACT;IACA;IACA;IACA;IACA;IACA;IACA,mFAAmF,CACpF;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEyB;MACxBC,QAAQ,EAAE,yBAAyB;MACnCC,OAAO,EAAE,0CAA0C;MACnDC,OAAO,EAAE,CAAC;QAAEC,EAAE,EAAE,OAAO;QAAEC,IAAI,EAAE,aAAa;QAAEC,OAAO,EAAE;MAAU,CAAC;IACpE,CAAC;IAAA,IAAAP,gBAAA,CAAAC,OAAA,oBAE2C,CAC1C;MACEO,QAAQ,EACN,6EAA6E;MAC/EC,QAAQ,EAAE;QACRP,QAAQ,EAAE,SAAS;QACnBC,OAAO,EAAE,uBAAuB;QAChCC,OAAO,EAAE,CACP;UACEC,EAAE,EAAE,OAAO;UACXC,IAAI,EAAE,aAAa;UACnBC,OAAO,EAAE,SAAS;UAClBG,OAAO,EAAE;QACX,CAAC,EACD;UACEL,EAAE,EAAE,OAAO;UACXC,IAAI,EAAE,YAAY;UAClBC,OAAO,EAAE,WAAW;UACpBG,OAAO,EAAE;QACX,CAAC;MAEL;IACF,CAAC,EACD;MACEF,QAAQ,EAAE;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;MACtCC,QAAQ,EAAE;QACRP,QAAQ,EAAE,yBAAyB;QACnCC,OAAO,EAAE,8CAA8C;QACvDC,OAAO,EAAE,CACP;UACEC,EAAE,EAAE,OAAO;UACXC,IAAI,EAAE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ACsC,GAAG,EAAE;QACR;MACF;MACAN,YAAY,GAAG,IAAAO,2BAAe,EAACD,GAAG,CAAC,CAAC/D,IAAI,IAAIiE,SAAS;IACvD;IAEA,OAAO;MACLrE,QAAQ,EAAE,IAAAsE,uBAAW,EAAC3D,KAAK,EAAE,CAAC,CAAC;MAC/B4D,KAAK,EAAE,IAAAD,uBAAW,EAAC3D,KAAK,EAAE,CAAC,CAAC,IAAI0D,SAAS;MACzCpE,OAAO,EAAE,IAAAuE,oBAAQ,EAAC7D,KAAK,CAAC,IAAI0D,SAAS;MACrCnE,OAAO,EAAEA,OAAO,CAAC6B,MAAM,GAAG,CAAC,GAAG7B,OAAO,GAAGmE,SAAS;MACjD5D,KAAK;MACLuB,YAAY;MACZ6B;IACF,CAAC;EACH;AACF;AAACY,OAAA,CAAA7E,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_parseUtils","require","_parts","HeroSectionDefinition","constructor","_defineProperty2","default","headline","content","buttons","id","text","variant","markdown","expected","onClick","image","parse","parts","firstImageSrc","lists","getPartsByType","list","item","_list$meta","meta","items","_item$meta","itemParts","nestedImage","buttonIndex","getLinks","map","l","i","_l$content","trim","href","length","trailingList","filteredItems","_list$meta2","_item$meta2","hasImage","some","p","type","push","allItemsAreLinks","listLinks","_item$meta3","_itemLinkParts$0$cont","itemLinkParts","filter","allText","extractListItemText","linkTexts","_l$content2","join","link","isFirstButton","lines","_item$meta4","h1Index","findIndex","_p$meta","level","blockquotes","leadingQuote","bq","_bq$meta","_bq$content","bqIndex","indexOf","raw","parseCalloutTag","undefined","headingMarkdown","badge","headingText","bodyText","exports"],"sources":["../../../../src/component/componentDefinitions/HeroSectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n headingMarkdown,\n bodyText,\n firstImageSrc,\n parseCalloutTag,\n extractListItemText,\n} from './parse-utils';\nimport type { Part, ListPart, LinkPart, ListItemPart } from '../../parts/parts';\nimport { getPartsByType, getLinks } from '../../parts/parts';\nimport type {\n HeroButton,\n HeroCompProps,\n HeroSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\n\nexport class HeroSectionDefinition\n implements SectionDefinition<HeroSectionComponent>\n{\n sectionType = 'hero' as const;\n singleInstance = true;\n patterns = [\n // Canonical hero shape: section descriptor, then the leading ECHO callout\n // (optional in the grammar — the orchestrator always emits it, but a missing\n // ECHO must not stop the hero from rendering), then an optional h3 badge,\n // then the h1. The callout and badge are independent slots so a hero can\n // carry both. The second `html_comment?` keeps the legacy ordering\n // (callout before the descriptor) matching for pages saved before this change.\n 'html_comment? > callout? > html_comment? > h3? > h1 > (image | t | link)* > list?',\n ];\n\n defaults: HeroCompProps = {\n headline: 'Build something amazing',\n content: 'Your platform for data-driven decisions.',\n buttons: [{ id: 'btn-0', text: 'Get started', variant: 'primary' }],\n };\n\n fixtures: SectionFixture<HeroCompProps>[] = [\n {\n markdown:\n '# Welcome\\n\\nBuild amazing things.\\n\\n[Get Started](/) [Learn More](/about)',\n expected: {\n headline: 'Welcome',\n content: 'Build amazing things.',\n buttons: [\n {\n id: 'btn-0',\n text: 'Get Started',\n variant: 'primary',\n onClick: '/',\n },\n {\n id: 'btn-1',\n text: 'Learn More',\n variant: 'secondary',\n onClick: '/about',\n },\n ],\n },\n },\n {\n markdown: `<!-- Hero Section -->\n\n# Welcome to Our Platform\n\n![Hero Image](hero.jpg)\n\nGet started today with our amazing features.\n\n[Get Started](/signup) [Learn More](/about)`,\n expected: {\n headline: 'Welcome to Our Platform',\n content: 'Get started today with our amazing features.',\n buttons: [\n {\n id: 'btn-0',\n text: 'Get Started',\n variant: 'primary',\n onClick: '/signup',\n },\n {\n id: 'btn-1',\n text: 'Learn More',\n variant: 'secondary',\n onClick: '/about',\n },\n ],\n image: 'hero.jpg',\n },\n },\n ];\n\n parse(parts: Part[]): HeroCompProps {\n let image = firstImageSrc(parts);\n const lists = getPartsByType<ListPart>(parts, 'list');\n\n if (!image) {\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const nestedImage = firstImageSrc(itemParts);\n if (nestedImage) {\n image = nestedImage;\n break;\n }\n }\n if (image) {\n break;\n }\n }\n }\n\n // Start with top-level links as buttons\n let buttonIndex = 0;\n const buttons: HeroButton[] = getLinks(parts).map(\n (l, i): HeroButton => ({\n id: `btn-${i}`,\n text: l.content?.trim() || 'Learn more',\n variant: i === 0 ? 'primary' : 'secondary',\n onClick: l.meta.href,\n }),\n );\n buttonIndex = buttons.length;\n\n // Process lists: filter out image-only items, then check if remaining\n // items are all link-only. If so, convert to buttons; otherwise keep as trailingList.\n let trailingList: string | undefined;\n if (lists.length > 0) {\n for (const list of lists) {\n // Filter out image-only items\n const filteredItems: ListItemPart[] = [];\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const hasImage = itemParts.some((p) => p.type === 'image');\n if (hasImage) {\n continue;\n }\n filteredItems.push(item);\n }\n\n if (filteredItems.length === 0) {\n continue;\n }\n\n // Check if ALL remaining items contain only links (no other text)\n let allItemsAreLinks = true;\n const listLinks: { text: string; href: string }[] = [];\n\n for (const item of filteredItems) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const itemLinkParts = itemParts.filter(\n (p): p is LinkPart => p.type === 'link',\n );\n\n if (itemLinkParts.length === 0) {\n allItemsAreLinks = false;\n break;\n }\n\n // Check if the item text is entirely link text (no extra content)\n const allText = extractListItemText(item).trim();\n const linkTexts = itemLinkParts\n .map((l) => l.content?.trim() || '')\n .join(' ')\n .trim();\n\n if (allText !== linkTexts) {\n allItemsAreLinks = false;\n break;\n }\n\n listLinks.push({\n text: itemLinkParts[0].content?.trim() || 'Learn more',\n href: itemLinkParts[0].meta.href,\n });\n }\n\n if (allItemsAreLinks && listLinks.length > 0) {\n // Convert link-only list items to buttons\n for (const link of listLinks) {\n const isFirstButton = buttons.length === 0;\n buttons.push({\n id: `btn-${buttonIndex++}`,\n text: link.text,\n variant: isFirstButton ? 'primary' : 'secondary',\n onClick: link.href,\n });\n }\n } else {\n // Keep as trailing list markdown\n const lines: string[] = [];\n for (const item of filteredItems) {\n const text =\n (item.meta?.markdown as string) || extractListItemText(item);\n if (text) {\n lines.push(`- ${text}`);\n }\n }\n if (lines.length > 0) {\n trailingList = lines.join('\\n');\n }\n }\n }\n }\n\n // The hero claims the leading callout before the h1 — the ECHO the\n // orchestrator emits as the hero's opening line, right after the section\n // descriptor. A trailing blockquote is not part of the hero pattern, so it\n // falls through to a downstream callout section instead.\n const h1Index = parts.findIndex(\n (p) => p.type === 'heading' && (p.meta as { level: number })?.level === 1,\n );\n const blockquotes = getPartsByType<Part>(parts, 'callout');\n let leadingQuote: string | undefined;\n\n for (const bq of blockquotes) {\n const bqIndex = parts.indexOf(bq);\n if (h1Index >= 0 && bqIndex > h1Index) {\n continue;\n }\n const raw = (bq.meta?.markdown as string)?.trim() || bq.content?.trim();\n if (!raw) {\n continue;\n }\n leadingQuote = parseCalloutTag(raw).text || undefined;\n }\n\n return {\n // Markdown-preserving (not headingText): the hero title now carries the\n // bold+italic hook the ECHO callout used to own, so the FE needs the\n // formatting, not just the plain text. See FeatureComparisonHero.tsx.\n headline: headingMarkdown(parts, 1),\n badge: headingText(parts, 3) || undefined,\n content: bodyText(parts) || undefined,\n buttons: buttons.length > 0 ? buttons : undefined,\n image,\n trailingList,\n leadingQuote,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,MAAA,GAAAD,OAAA;AASO,MAAME,qBAAqB,CAElC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,MAAM;IAAA,IAAAD,gBAAA,CAAAC,OAAA,0BACH,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBACV;IACT;IACA;IACA;IACA;IACA;IACA;IACA,mFAAmF,CACpF;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEyB;MACxBC,QAAQ,E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;MACLuB,YAAY;MACZ6B;IACF,CAAC;EACH;AACF;AAACa,OAAA,CAAA9E,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -40,16 +40,39 @@ function inlineBodyMarkdown(parts) {
40
40
  class NextStepsSectionDefinition {
41
41
  constructor() {
42
42
  (0, _defineProperty2.default)(this, "sectionType", 'nextSteps');
43
- (0, _defineProperty2.default)(this, "patterns", ['(html_comment[section^="next"] | html_comment[semantic^="next"]) > h2 > image? > list{item[1-]:(icon | t)* > (t? > link)+}', '(html_comment[section^="next"] | html_comment[semantic^="next"]) > h2 > image? > (t | link)+']);
43
+ (0, _defineProperty2.default)(this, "patterns", [
44
+ // Framing sentence (`t?`) then one chip per bullet — the authored shape.
45
+ '(html_comment[section^="next"] | html_comment[semantic^="next"]) > h2 > image? > t? > list{item[1-]:(icon | t)* > (t? > link)+}',
46
+ // Legacy inline shape: chips embedded in the prose. Still arrives from
47
+ // sites whose next-steps prompt has not moved to the list shape.
48
+ '(html_comment[section^="next"] | html_comment[semantic^="next"]) > h2 > image? > (t | link)+']);
44
49
  (0, _defineProperty2.default)(this, "defaults", {
45
50
  title: 'Next Steps',
46
- body: '[Get started](/start)',
51
+ body: 'Where would you like to go next?',
47
52
  backgroundImage: undefined,
48
53
  steps: [{
49
54
  content: '[Get started](/start)'
50
55
  }]
51
56
  });
52
57
  (0, _defineProperty2.default)(this, "fixtures", [{
58
+ markdown: `<!-- section:next-steps, semantic:next_steps -->
59
+
60
+ ## Find the right care for mature, sensitive skin
61
+
62
+ Want to focus on rich hydrators and barrier builders?
63
+
64
+ - [hydrating creams →](web5://ask/hydrating+creams+for+mature+skin)
65
+ - [gentle resurfacing serums →](web5://ask/gentle+resurfacing+serums)`,
66
+ expected: {
67
+ title: 'Find the right care for mature, sensitive skin',
68
+ body: 'Want to focus on rich hydrators and barrier builders?',
69
+ steps: [{
70
+ content: '[hydrating creams →](web5://ask/hydrating+creams+for+mature+skin)'
71
+ }, {
72
+ content: '[gentle resurfacing serums →](web5://ask/gentle+resurfacing+serums)'
73
+ }]
74
+ }
75
+ }, {
53
76
  markdown: `<!-- section: next_steps -->
54
77
 
55
78
  ## Next Steps
@@ -71,10 +94,14 @@ class NextStepsSectionDefinition {
71
94
  const backgroundImage = (0, _parseUtils.firstImageSrc)(parts);
72
95
  const steps = [];
73
96
  let body;
97
+ let chipsInlineInBody = false;
74
98
 
75
99
  // Try list-based pattern first
76
100
  const lists = (0, _parts.getPartsByType)(parts, 'list');
77
101
  if (lists.length > 0) {
102
+ // The framing sentence is the only top-level prose — list items live
103
+ // under each list's meta.items, so bodyText never picks up a chip.
104
+ body = (0, _parseUtils.bodyText)(parts) || undefined;
78
105
  for (const list of lists) {
79
106
  for (const item of ((_list$meta = list.meta) == null ? void 0 : _list$meta.items) ?? []) {
80
107
  var _list$meta, _item$meta, _iconPart$meta;
@@ -104,6 +131,9 @@ class NextStepsSectionDefinition {
104
131
  }
105
132
  } else {
106
133
  body = inlineBodyMarkdown(parts);
134
+ // body carries the chips as inline links — flag it so renderers show the
135
+ // prose alone instead of repeating every chip as a row beneath it.
136
+ chipsInlineInBody = Boolean(body);
107
137
  }
108
138
 
109
139
  // Fallback: inline links pattern
@@ -125,6 +155,9 @@ class NextStepsSectionDefinition {
125
155
  ...(body ? {
126
156
  body
127
157
  } : {}),
158
+ ...(chipsInlineInBody ? {
159
+ chipsInlineInBody
160
+ } : {}),
128
161
  ...(backgroundImage ? {
129
162
  backgroundImage
130
163
  } : {}),
@@ -1 +1 @@
1
- {"version":3,"names":["_parseUtils","require","_parts","linkToMarkdown","link","_link$content","_link$meta","content","trim","meta","href","appendInlineToken","current","token","trimmed","test","inlineBodyMarkdown","parts","body","reduce","part","type","_part$meta","markdown","undefined","NextStepsSectionDefinition","constructor","_defineProperty2","default","title","backgroundImage","steps","expected","parse","headingText","firstImageSrc","lists","getPartsByType","length","list","item","_list$meta","items","_item$meta","_iconPart$meta","itemParts","iconPart","find","p","iconHint","contentFragments","push","_p$content","filter","Boolean","join","extractListItemText","links","getLinks","_link$content2","_link$meta2","text","exports"],"sources":["../../../../src/component/componentDefinitions/NextStepsSectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n extractListItemText,\n firstImageSrc,\n} from './parse-utils';\nimport {\n getPartsByType,\n getLinks,\n type Part,\n type ListPart,\n type LinkPart,\n type IconPart,\n} from '../../parts/parts';\nimport type {\n NextStepsCompProps,\n NextStepsSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\n\nfunction linkToMarkdown(link: LinkPart): string {\n return `[${link.content?.trim() || ''}](${link.meta?.href || ''})`;\n}\n\nfunction appendInlineToken(current: string, token: string): string {\n const trimmed = token.trim();\n if (!trimmed) {\n return current;\n }\n if (!current) {\n return trimmed;\n }\n if (/^[,.;:!?)]/.test(trimmed)) {\n return `${current}${trimmed}`;\n }\n return `${current} ${trimmed}`;\n}\n\nfunction inlineBodyMarkdown(parts: Part[]): string | undefined {\n const body = parts.reduce((current, part) => {\n if (part.type === 'link') {\n return appendInlineToken(current, linkToMarkdown(part as LinkPart));\n }\n if (part.type === 'text' || part.type === 'richText') {\n const markdown = (part.meta?.markdown as string | undefined)?.trim();\n return appendInlineToken(current, markdown || part.content || '');\n }\n return current;\n }, '');\n\n return body || undefined;\n}\n\nexport class NextStepsSectionDefinition\n implements SectionDefinition<NextStepsSectionComponent>\n{\n sectionType = 'nextSteps' as const;\n patterns = [\n '(html_comment[section^=\"next\"] | html_comment[semantic^=\"next\"]) > h2 > image? > list{item[1-]:(icon | t)* > (t? > link)+}',\n '(html_comment[section^=\"next\"] | html_comment[semantic^=\"next\"]) > h2 > image? > (t | link)+',\n ];\n\n defaults: NextStepsCompProps = {\n title: 'Next Steps',\n body: '[Get started](/start)',\n backgroundImage: undefined,\n steps: [{ content: '[Get started](/start)' }],\n };\n\n fixtures: SectionFixture<NextStepsCompProps>[] = [\n {\n markdown: `<!-- section: next_steps -->\n\n## Next Steps\n\n- Check out [Documentation](/docs)\n- Try [Examples](/examples)`,\n expected: {\n title: 'Next Steps',\n steps: [\n { content: 'Check out [Documentation](/docs)' },\n { content: 'Try [Examples](/examples)' },\n ],\n },\n },\n ];\n\n parse(parts: Part[]): NextStepsCompProps {\n const title = headingText(parts, 2) || 'Next Steps';\n const backgroundImage = firstImageSrc(parts);\n const steps: { content: string; iconHint?: string }[] = [];\n let body: string | undefined;\n\n // Try list-based pattern first\n const lists = getPartsByType<ListPart>(parts, 'list');\n if (lists.length > 0) {\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n\n const iconPart = itemParts.find((p) => p.type === 'icon') as\n | IconPart\n | undefined;\n const iconHint = (iconPart?.meta as { iconHint?: string })?.iconHint;\n\n const contentFragments: string[] = [];\n for (const p of itemParts) {\n if (p.type === 'link') {\n const link = p as LinkPart;\n contentFragments.push(linkToMarkdown(link));\n } else if (p.type === 'text' || p.type === 'richText') {\n contentFragments.push(p.content?.trim() || '');\n }\n }\n const content =\n contentFragments.filter(Boolean).join(' ') ||\n extractListItemText(item);\n if (content.trim()) {\n steps.push({\n content: content.trim(),\n ...(iconHint ? { iconHint } : {}),\n });\n }\n }\n }\n } else {\n body = inlineBodyMarkdown(parts);\n }\n\n // Fallback: inline links pattern\n if (steps.length === 0) {\n const links = getLinks(parts);\n for (const link of links) {\n const text = link.content?.trim();\n const href = link.meta?.href;\n if (text && href) {\n steps.push({ content: linkToMarkdown(link) });\n }\n }\n }\n\n return {\n title,\n ...(body ? { body } : {}),\n ...(backgroundImage ? { backgroundImage } : {}),\n steps,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAeA,SAASE,cAAcA,CAACC,IAAc,EAAU;EAAA,IAAAC,aAAA,EAAAC,UAAA;EAC9C,OAAO,IAAI,EAAAD,aAAA,GAAAD,IAAI,CAACG,OAAO,qBAAZF,aAAA,CAAcG,IAAI,CAAC,CAA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MACtB,MAAMmB,KAAK,GAAG,IAAAC,eAAQ,EAACzC,KAAK,CAAC;MAC7B,KAAK,MAAMb,IAAI,IAAIqD,KAAK,EAAE;QAAA,IAAAE,cAAA,EAAAC,WAAA;QACxB,MAAMC,IAAI,IAAAF,cAAA,GAAGvD,IAAI,CAACG,OAAO,qBAAZoD,cAAA,CAAcnD,IAAI,CAAC,CAAC;QACjC,MAAME,IAAI,IAAAkD,WAAA,GAAGxD,IAAI,CAACK,IAAI,qBAATmD,WAAA,CAAWlD,IAAI;QAC5B,IAAImD,IAAI,IAAInD,IAAI,EAAE;UAChBqB,KAAK,CAACoB,IAAI,CAAC;YAAE5C,OAAO,EAAEJ,cAAc,CAACC,IAAI;UAAE,CAAC,CAAC;QAC/C;MACF;IACF;IAEA,OAAO;MACLyB,KAAK;MACL,IAAIX,IAAI,GAAG;QAAEA;MAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACzB,IAAIY,eAAe,GAAG;QAAEA;MAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/CC;IACF,CAAC;EACH;AACF;AAAC+B,OAAA,CAAArC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_parseUtils","require","_parts","linkToMarkdown","link","_link$content","_link$meta","content","trim","meta","href","appendInlineToken","current","token","trimmed","test","inlineBodyMarkdown","parts","body","reduce","part","type","_part$meta","markdown","undefined","NextStepsSectionDefinition","constructor","_defineProperty2","default","title","backgroundImage","steps","expected","parse","headingText","firstImageSrc","chipsInlineInBody","lists","getPartsByType","length","bodyText","list","item","_list$meta","items","_item$meta","_iconPart$meta","itemParts","iconPart","find","p","iconHint","contentFragments","push","_p$content","filter","Boolean","join","extractListItemText","links","getLinks","_link$content2","_link$meta2","text","exports"],"sources":["../../../../src/component/componentDefinitions/NextStepsSectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n bodyText,\n extractListItemText,\n firstImageSrc,\n} from './parse-utils';\nimport {\n getPartsByType,\n getLinks,\n type Part,\n type ListPart,\n type LinkPart,\n type IconPart,\n} from '../../parts/parts';\nimport type {\n NextStepsCompProps,\n NextStepsSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\n\nfunction linkToMarkdown(link: LinkPart): string {\n return `[${link.content?.trim() || ''}](${link.meta?.href || ''})`;\n}\n\nfunction appendInlineToken(current: string, token: string): string {\n const trimmed = token.trim();\n if (!trimmed) {\n return current;\n }\n if (!current) {\n return trimmed;\n }\n if (/^[,.;:!?)]/.test(trimmed)) {\n return `${current}${trimmed}`;\n }\n return `${current} ${trimmed}`;\n}\n\nfunction inlineBodyMarkdown(parts: Part[]): string | undefined {\n const body = parts.reduce((current, part) => {\n if (part.type === 'link') {\n return appendInlineToken(current, linkToMarkdown(part as LinkPart));\n }\n if (part.type === 'text' || part.type === 'richText') {\n const markdown = (part.meta?.markdown as string | undefined)?.trim();\n return appendInlineToken(current, markdown || part.content || '');\n }\n return current;\n }, '');\n\n return body || undefined;\n}\n\nexport class NextStepsSectionDefinition\n implements SectionDefinition<NextStepsSectionComponent>\n{\n sectionType = 'nextSteps' as const;\n patterns = [\n // Framing sentence (`t?`) then one chip per bullet — the authored shape.\n '(html_comment[section^=\"next\"] | html_comment[semantic^=\"next\"]) > h2 > image? > t? > list{item[1-]:(icon | t)* > (t? > link)+}',\n // Legacy inline shape: chips embedded in the prose. Still arrives from\n // sites whose next-steps prompt has not moved to the list shape.\n '(html_comment[section^=\"next\"] | html_comment[semantic^=\"next\"]) > h2 > image? > (t | link)+',\n ];\n\n defaults: NextStepsCompProps = {\n title: 'Next Steps',\n body: 'Where would you like to go next?',\n backgroundImage: undefined,\n steps: [{ content: '[Get started](/start)' }],\n };\n\n fixtures: SectionFixture<NextStepsCompProps>[] = [\n {\n markdown: `<!-- section:next-steps, semantic:next_steps -->\n\n## Find the right care for mature, sensitive skin\n\nWant to focus on rich hydrators and barrier builders?\n\n- [hydrating creams →](web5://ask/hydrating+creams+for+mature+skin)\n- [gentle resurfacing serums →](web5://ask/gentle+resurfacing+serums)`,\n expected: {\n title: 'Find the right care for mature, sensitive skin',\n body: 'Want to focus on rich hydrators and barrier builders?',\n steps: [\n {\n content:\n '[hydrating creams →](web5://ask/hydrating+creams+for+mature+skin)',\n },\n {\n content:\n '[gentle resurfacing serums →](web5://ask/gentle+resurfacing+serums)',\n },\n ],\n },\n },\n {\n markdown: `<!-- section: next_steps -->\n\n## Next Steps\n\n- Check out [Documentation](/docs)\n- Try [Examples](/examples)`,\n expected: {\n title: 'Next Steps',\n steps: [\n { content: 'Check out [Documentation](/docs)' },\n { content: 'Try [Examples](/examples)' },\n ],\n },\n },\n ];\n\n parse(parts: Part[]): NextStepsCompProps {\n const title = headingText(parts, 2) || 'Next Steps';\n const backgroundImage = firstImageSrc(parts);\n const steps: { content: string; iconHint?: string }[] = [];\n let body: string | undefined;\n let chipsInlineInBody = false;\n\n // Try list-based pattern first\n const lists = getPartsByType<ListPart>(parts, 'list');\n if (lists.length > 0) {\n // The framing sentence is the only top-level prose — list items live\n // under each list's meta.items, so bodyText never picks up a chip.\n body = bodyText(parts) || undefined;\n\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n\n const iconPart = itemParts.find((p) => p.type === 'icon') as\n | IconPart\n | undefined;\n const iconHint = (iconPart?.meta as { iconHint?: string })?.iconHint;\n\n const contentFragments: string[] = [];\n for (const p of itemParts) {\n if (p.type === 'link') {\n const link = p as LinkPart;\n contentFragments.push(linkToMarkdown(link));\n } else if (p.type === 'text' || p.type === 'richText') {\n contentFragments.push(p.content?.trim() || '');\n }\n }\n const content =\n contentFragments.filter(Boolean).join(' ') ||\n extractListItemText(item);\n if (content.trim()) {\n steps.push({\n content: content.trim(),\n ...(iconHint ? { iconHint } : {}),\n });\n }\n }\n }\n } else {\n body = inlineBodyMarkdown(parts);\n // body carries the chips as inline links — flag it so renderers show the\n // prose alone instead of repeating every chip as a row beneath it.\n chipsInlineInBody = Boolean(body);\n }\n\n // Fallback: inline links pattern\n if (steps.length === 0) {\n const links = getLinks(parts);\n for (const link of links) {\n const text = link.content?.trim();\n const href = link.meta?.href;\n if (text && href) {\n steps.push({ content: linkToMarkdown(link) });\n }\n }\n }\n\n return {\n title,\n ...(body ? { body } : {}),\n ...(chipsInlineInBody ? { chipsInlineInBody } : {}),\n ...(backgroundImage ? { backgroundImage } : {}),\n steps,\n };\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AAeA,SAASE,cAAcA,CAACC,IAAc,EAAU;EAAA,IAAAC,aAAA,EAAAC,UAAA;EAC9C,OAAO,IAAI,EAAAD,aAAA,GAAAD,IAAI,CAACG,OAAO,qBAAZF,aAAA,CAAcG,IAAI,CAAC,CAAC,KAAI,EAAE,KAAK,EAAAF,UAAA,GAAAF,IAAI,CAACK,IAAI,qBAATH,UAAA,CAAWI,IAAI,KAAI,EAAE,GAAG;AACpE;AAEA,SAASC,iBAAiBA,CAACC,OAAe,EAAEC,KAAa,EAAU;EACjE,MAAMC,OAAO,GAAGD,KAAK,CAACL,IAAI,CAAC,CAAC;EAC5B,IAAI,CAACM,OAAO,EAAE;IACZ,OAAOF,OAAO;EAChB;EACA,IAAI,CAACA,OAAO,EAAE;IACZ,OAAOE,OAAO;EAChB;EACA,IAAI,YAAY,CAACC,IAAI,CAACD,OAAO,CAAC,EAAE;IAC9B,OAAO,GAAGF,OAAO,GAAGE,OAAO,EAAE;EAC/B;EACA,OAAO,GAAGF,OAAO,IAAIE,OAAO,EAAE;AAChC;AAEA,SAASE,kBAAkBA,CAACC,KAAa,EAAsB;EAC7D,MAAMC,IAAI,GAAGD,KAAK,CAACE,MAAM,CAAC,CAACP,OAAO,EAAEQ,IAAI,KAAK;IAC3C,IAAIA,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;MACxB,OAAOV,iBAAiB,CAACC,OAAO,EAAET,cAAc,CAACiB,IAAgB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IAAI,CAACK,IAAI,qBAATqD,WAAA,CAAWpD,IAAI;QAC5B,IAAIqD,IAAI,IAAIrD,IAAI,EAAE;UAChBqB,KAAK,CAACsB,IAAI,CAAC;YAAE9C,OAAO,EAAEJ,cAAc,CAACC,IAAI;UAAE,CAAC,CAAC;QAC/C;MACF;IACF;IAEA,OAAO;MACLyB,KAAK;MACL,IAAIX,IAAI,GAAG;QAAEA;MAAK,CAAC,GAAG,CAAC,CAAC,CAAC;MACzB,IAAIkB,iBAAiB,GAAG;QAAEA;MAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;MACnD,IAAIN,eAAe,GAAG;QAAEA;MAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/CC;IACF,CAAC;EACH;AACF;AAACiC,OAAA,CAAAvC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -9,7 +9,24 @@ var _diagnosticTypes = require("../diagnosticTypes");
9
9
  class TextBlockSectionDefinition {
10
10
  constructor() {
11
11
  (0, _defineProperty2.default)(this, "sectionType", 'textBlock');
12
- (0, _defineProperty2.default)(this, "patterns", ['html_comment? > h2 > t > callout']);
12
+ // The trailing callout is OPTIONAL. A heading plus running copy is the shape
13
+ // stores emit constantly for explainer content, and requiring the blockquote
14
+ // meant those blocks matched no definition at all and fell through to
15
+ // `FallbackSectionDefinition` — rendered as undifferentiated prose with no
16
+ // section treatment. `parse()` already tolerates a missing callout (it only
17
+ // rejects when title AND description are empty).
18
+ //
19
+ // NOTE for registry authors: with the callout optional this also matches a
20
+ // bare `h2 > t`, and a pattern matches a PREFIX of the block. Register
21
+ // `textBlock` BELOW every definition whose block opens `h2 > t` — entity,
22
+ // entityCollection, listItemsSection, featureCards, ctaBanner, comparison,
23
+ // kpi, nextSteps. Above them it claims the heading + intro paragraph off the
24
+ // front of the block and strands the list / links / table that follow
25
+ // (`EntitySectionDefinition` allows `h2 > (t | callout)* > links…`, and
26
+ // `listItemsSection` / `ctaBanner` are the same shape). `createSdkRegistry`
27
+ // and the client registries in this repo order it that way; a client
28
+ // registry living outside this repo has to do the same.
29
+ (0, _defineProperty2.default)(this, "patterns", ['html_comment? > h2 > t > callout?']);
13
30
  (0, _defineProperty2.default)(this, "defaults", {
14
31
  title: 'Text Block Title',
15
32
  description: 'Description text.',
@@ -44,6 +61,15 @@ The platform scales with your needs.
44
61
  text: 'Start small with Go, then expand to the full suite as your data maturity grows.'
45
62
  }
46
63
  }
64
+ }, {
65
+ markdown: `## How to choose between a clinical serum and a nourishing dry oil
66
+
67
+ Clinically tested serums with patented actives target visible reduction of marks and uneven tone, while dry oils focus on broad nourishment and a satin finish.`,
68
+ expected: {
69
+ title: 'How to choose between a clinical serum and a nourishing dry oil',
70
+ description: 'Clinically tested serums with patented actives target visible reduction of marks and uneven tone, while dry oils focus on broad nourishment and a satin finish.',
71
+ callout: undefined
72
+ }
47
73
  }]);
48
74
  }
49
75
  parse(parts, context) {
@@ -1 +1 @@
1
- {"version":3,"names":["_parseUtils","require","_diagnosticTypes","TextBlockSectionDefinition","constructor","_defineProperty2","default","title","description","callout","text","markdown","expected","parse","parts","context","headingMarkdown","bodyText","calloutFromParts","reportDiagnostic","DIAGNOSTIC_TYPES","SECTION_REJECTED","exports"],"sources":["../../../../src/component/componentDefinitions/TextBlockSectionDefinition.ts"],"sourcesContent":["import type { Part } from '../../parts/parts';\nimport { headingMarkdown, bodyText, calloutFromParts } from './parse-utils';\nimport type {\n TextBlockCompProps,\n TextBlockSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition, ParseContext } from '../section-definition';\nimport { DIAGNOSTIC_TYPES } from '../diagnosticTypes';\n\nexport class TextBlockSectionDefinition\n implements SectionDefinition<TextBlockSectionComponent>\n{\n sectionType = 'textBlock' as const;\n patterns = ['html_comment? > h2 > t > callout'];\n\n defaults: TextBlockCompProps = {\n title: 'Text Block Title',\n description: 'Description text.',\n callout: { text: 'A key insight or quote.' },\n };\n\n fixtures: SectionFixture<TextBlockCompProps>[] = [\n {\n markdown: `## Choosing the Right Liquid Data Option\n\nLiquid Data Go is designed for brands that want affordable, scalable access to syndicated POS, shopper, and pricing insights with minimal setup and no data expertise required.\n\n> If you mainly need fast, packaged insights in one category, Liquid Data Go is usually the right fit; if you need to integrate many datasets and support multiple enterprise workflows, the broader Liquid Data platform and its solutions become more relevant.`,\n expected: {\n title: 'Choosing the Right Liquid Data Option',\n description:\n 'Liquid Data Go is designed for brands that want affordable, scalable access to syndicated POS, shopper, and pricing insights with minimal setup and no data expertise required.',\n callout: {\n text: 'If you mainly need fast, packaged insights in one category, Liquid Data Go is usually the right fit; if you need to integrate many datasets and support multiple enterprise workflows, the broader Liquid Data platform and its solutions become more relevant.',\n },\n },\n },\n {\n markdown: `<!-- section: textBlock -->\n## Key Takeaway\n\nThe platform scales with your needs.\n\n> Start small with Go, then expand to the full suite as your data maturity grows.`,\n expected: {\n title: 'Key Takeaway',\n description: 'The platform scales with your needs.',\n callout: {\n text: 'Start small with Go, then expand to the full suite as your data maturity grows.',\n },\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): TextBlockCompProps | null {\n const title = headingMarkdown(parts, 2) || '';\n const description = bodyText(parts) || '';\n const callout = calloutFromParts(parts);\n\n if (!title && !description) {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.SECTION_REJECTED,\n 'textBlock: both title and description are empty',\n );\n return null;\n }\n\n return { title, description, callout };\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,gBAAA,GAAAD,OAAA;AAEO,MAAME,0BAA0B,CAEvC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,WAAW;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBACd,CAAC,kCAAkC,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEhB;MAC7BC,KAAK,EAAE,kBAAkB;MACzBC,WAAW,EAAE,mBAAmB;MAChCC,OAAO,EAAE;QAAEC,IAAI,EAAE;MAA0B;IAC7C,CAAC;IAAA,IAAAL,gBAAA,CAAAC,OAAA,oBAEgD,CAC/C;MACEK,QAAQ,EAAE;AAChB;AACA;AACA;AACA,kQAAkQ;MAC5PC,QAAQ,EAAE;QACRL,KAAK,EAAE,uCAAuC;QAC9CC,WAAW,EACT,iLAAiL;QACnLC,OAAO,EAAE;UACPC,IAAI,EAAE;QACR;MACF;IACF,CAAC,EACD;MACEC,QAAQ,EAAE;AAChB;AACA;AACA;AACA;AACA,kFAAkF;MAC5EC,QAAQ,EAAE;QACRL,KAAK,EAAE,cAAc;QACrBC,WAAW,EAAE,sCAAsC;QACnDC,OAAO,EAAE;UACPC,IAAI,EAAE;QACR;MACF;IACF,CAAC,CACF;EAAA;EAEDG,KAAKA,CAACC,KAAa,EAAEC,OAAsB,EAA6B;IACtE,MAAMR,KAAK,GAAG,IAAAS,2BAAe,EAACF,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE;IAC7C,MAAMN,WAAW,GAAG,IAAAS,oBAAQ,EAACH,KAAK,CAAC,IAAI,EAAE;IACzC,MAAML,OAAO,GAAG,IAAAS,4BAAgB,EAACJ,KAAK,CAAC;IAEvC,IAAI,CAACP,KAAK,IAAI,CAACC,WAAW,EAAE;MAC1BO,OAAO,YAAPA,OAAO,CAAEI,gBAAgB,YAAzBJ,OAAO,CAAEI,gBAAgB,CACvBC,iCAAgB,CAACC,gBAAgB,EACjC,iDACF,CAAC;MACD,OAAO,IAAI;IACb;IAEA,OAAO;MAAEd,KAAK;MAAEC,WAAW;MAAEC;IAAQ,CAAC;EACxC;AACF;AAACa,OAAA,CAAAnB,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_parseUtils","require","_diagnosticTypes","TextBlockSectionDefinition","constructor","_defineProperty2","default","title","description","callout","text","markdown","expected","undefined","parse","parts","context","headingMarkdown","bodyText","calloutFromParts","reportDiagnostic","DIAGNOSTIC_TYPES","SECTION_REJECTED","exports"],"sources":["../../../../src/component/componentDefinitions/TextBlockSectionDefinition.ts"],"sourcesContent":["import type { Part } from '../../parts/parts';\nimport { headingMarkdown, bodyText, calloutFromParts } from './parse-utils';\nimport type {\n TextBlockCompProps,\n TextBlockSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition, ParseContext } from '../section-definition';\nimport { DIAGNOSTIC_TYPES } from '../diagnosticTypes';\n\nexport class TextBlockSectionDefinition\n implements SectionDefinition<TextBlockSectionComponent>\n{\n sectionType = 'textBlock' as const;\n // The trailing callout is OPTIONAL. A heading plus running copy is the shape\n // stores emit constantly for explainer content, and requiring the blockquote\n // meant those blocks matched no definition at all and fell through to\n // `FallbackSectionDefinition` — rendered as undifferentiated prose with no\n // section treatment. `parse()` already tolerates a missing callout (it only\n // rejects when title AND description are empty).\n //\n // NOTE for registry authors: with the callout optional this also matches a\n // bare `h2 > t`, and a pattern matches a PREFIX of the block. Register\n // `textBlock` BELOW every definition whose block opens `h2 > t` — entity,\n // entityCollection, listItemsSection, featureCards, ctaBanner, comparison,\n // kpi, nextSteps. Above them it claims the heading + intro paragraph off the\n // front of the block and strands the list / links / table that follow\n // (`EntitySectionDefinition` allows `h2 > (t | callout)* > links…`, and\n // `listItemsSection` / `ctaBanner` are the same shape). `createSdkRegistry`\n // and the client registries in this repo order it that way; a client\n // registry living outside this repo has to do the same.\n patterns = ['html_comment? > h2 > t > callout?'];\n\n defaults: TextBlockCompProps = {\n title: 'Text Block Title',\n description: 'Description text.',\n callout: { text: 'A key insight or quote.' },\n };\n\n fixtures: SectionFixture<TextBlockCompProps>[] = [\n {\n markdown: `## Choosing the Right Liquid Data Option\n\nLiquid Data Go is designed for brands that want affordable, scalable access to syndicated POS, shopper, and pricing insights with minimal setup and no data expertise required.\n\n> If you mainly need fast, packaged insights in one category, Liquid Data Go is usually the right fit; if you need to integrate many datasets and support multiple enterprise workflows, the broader Liquid Data platform and its solutions become more relevant.`,\n expected: {\n title: 'Choosing the Right Liquid Data Option',\n description:\n 'Liquid Data Go is designed for brands that want affordable, scalable access to syndicated POS, shopper, and pricing insights with minimal setup and no data expertise required.',\n callout: {\n text: 'If you mainly need fast, packaged insights in one category, Liquid Data Go is usually the right fit; if you need to integrate many datasets and support multiple enterprise workflows, the broader Liquid Data platform and its solutions become more relevant.',\n },\n },\n },\n {\n markdown: `<!-- section: textBlock -->\n## Key Takeaway\n\nThe platform scales with your needs.\n\n> Start small with Go, then expand to the full suite as your data maturity grows.`,\n expected: {\n title: 'Key Takeaway',\n description: 'The platform scales with your needs.',\n callout: {\n text: 'Start small with Go, then expand to the full suite as your data maturity grows.',\n },\n },\n },\n {\n markdown: `## How to choose between a clinical serum and a nourishing dry oil\n\nClinically tested serums with patented actives target visible reduction of marks and uneven tone, while dry oils focus on broad nourishment and a satin finish.`,\n expected: {\n title: 'How to choose between a clinical serum and a nourishing dry oil',\n description:\n 'Clinically tested serums with patented actives target visible reduction of marks and uneven tone, while dry oils focus on broad nourishment and a satin finish.',\n callout: undefined,\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): TextBlockCompProps | null {\n const title = headingMarkdown(parts, 2) || '';\n const description = bodyText(parts) || '';\n const callout = calloutFromParts(parts);\n\n if (!title && !description) {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.SECTION_REJECTED,\n 'textBlock: both title and description are empty',\n );\n return null;\n }\n\n return { title, description, callout };\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,gBAAA,GAAAD,OAAA;AAEO,MAAME,0BAA0B,CAEvC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,uBACgB,WAAW;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBACW,CAAC,mCAAmC,CAAC;IAAA,IAAAD,gBAAA,CAAAC,OAAA,oBAEjB;MAC7BC,KAAK,EAAE,kBAAkB;MACzBC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A","ignoreList":[]}
@@ -16,6 +16,8 @@ var _FeatureCardsSectionDefinition = require("./FeatureCardsSectionDefinition");
16
16
  exports.FeatureCardsSectionDefinition = _FeatureCardsSectionDefinition.FeatureCardsSectionDefinition;
17
17
  var _EntitySectionDefinition = require("./EntitySectionDefinition");
18
18
  exports.EntitySectionDefinition = _EntitySectionDefinition.EntitySectionDefinition;
19
+ var _EntityCollectionSectionDefinition = require("./EntityCollectionSectionDefinition");
20
+ exports.EntityCollectionSectionDefinition = _EntityCollectionSectionDefinition.EntityCollectionSectionDefinition;
19
21
  var _CtaBannerSectionDefinition = require("./CtaBannerSectionDefinition");
20
22
  exports.CtaBannerSectionDefinition = _CtaBannerSectionDefinition.CtaBannerSectionDefinition;
21
23
  var _CalloutSectionDefinition = require("./CalloutSectionDefinition");
@@ -43,6 +45,17 @@ var _registry = require("../../registry");
43
45
  * Registration order determines evaluation priority — first match wins.
44
46
  */
45
47
  function createSdkRegistry() {
46
- return new _registry.ComponentRegistry(null).register(new _SkipNodesSectionDefinition.SkipNodesSectionDefinition()).register(new _SearchSectionDefinition.SearchSectionDefinition()).register(new _KpiSectionDefinition.KpiSectionDefinition()).register(new _NextStepsSectionDefinition.NextStepsSectionDefinition()).register(new _EntitySectionDefinition.EntitySectionDefinition()).register(new _HeroEntitySectionDefinition.HeroEntitySectionDefinition()).register(new _HeroSectionDefinition.HeroSectionDefinition()).register(new _FeatureCardsSectionDefinition.FeatureCardsSectionDefinition()).register(new _TextBlockSectionDefinition.TextBlockSectionDefinition()).register(new _listItemsSectionDefinition.ListItemsSectionDefinition()).register(new _FeatureSection9PlusDefinition.FeatureSection9PlusDefinition()).register(new _ComparisonSectionDefinition.ComparisonSectionDefinition()).register(new _HtmlCommentSectionDefinition.HtmlCommentSectionDefinition()).register(new _CtaBannerSectionDefinition.CtaBannerSectionDefinition()).register(new _CalloutSectionDefinition.CalloutSectionDefinition()).register(new _FallbackSectionDefinition.FallbackSectionDefinition()).register(new _ErrorSectionDefinition.ErrorSectionDefinition());
48
+ return new _registry.ComponentRegistry(null).register(new _SkipNodesSectionDefinition.SkipNodesSectionDefinition()).register(new _SearchSectionDefinition.SearchSectionDefinition()).register(new _KpiSectionDefinition.KpiSectionDefinition()).register(new _NextStepsSectionDefinition.NextStepsSectionDefinition())
49
+ // Collection entities are claimed by their own definition first — it is a
50
+ // strictly narrower match than EntitySectionDefinition, which would
51
+ // otherwise swallow collection, product and article blocks alike.
52
+ .register(new _EntityCollectionSectionDefinition.EntityCollectionSectionDefinition()).register(new _EntitySectionDefinition.EntitySectionDefinition()).register(new _HeroEntitySectionDefinition.HeroEntitySectionDefinition()).register(new _HeroSectionDefinition.HeroSectionDefinition()).register(new _FeatureCardsSectionDefinition.FeatureCardsSectionDefinition()).register(new _listItemsSectionDefinition.ListItemsSectionDefinition()).register(new _FeatureSection9PlusDefinition.FeatureSection9PlusDefinition()).register(new _ComparisonSectionDefinition.ComparisonSectionDefinition()).register(new _HtmlCommentSectionDefinition.HtmlCommentSectionDefinition()).register(new _CtaBannerSectionDefinition.CtaBannerSectionDefinition())
53
+ // textBlock comes after every definition whose block opens `h2 > t`
54
+ // (entity, listItems, featureCards, ctaBanner, comparison, …). Its
55
+ // trailing callout is optional, so its pattern also matches a bare
56
+ // `h2 > t`, and a pattern matches a PREFIX of the block — registered
57
+ // above those it would claim the heading + intro paragraph and strand
58
+ // the list / links / table that follow in a separate section.
59
+ .register(new _TextBlockSectionDefinition.TextBlockSectionDefinition()).register(new _CalloutSectionDefinition.CalloutSectionDefinition()).register(new _FallbackSectionDefinition.FallbackSectionDefinition()).register(new _ErrorSectionDefinition.ErrorSectionDefinition());
47
60
  }
48
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_ComparisonSectionDefinition","require","exports","ComparisonSectionDefinition","_TextBlockSectionDefinition","TextBlockSectionDefinition","_HeroSectionDefinition","HeroSectionDefinition","_HeroEntitySectionDefinition","HeroEntitySectionDefinition","_KpiSectionDefinition","KpiSectionDefinition","_FeatureCardsSectionDefinition","FeatureCardsSectionDefinition","_EntitySectionDefinition","EntitySectionDefinition","_CtaBannerSectionDefinition","CtaBannerSectionDefinition","_CalloutSectionDefinition","CalloutSectionDefinition","_NextStepsSectionDefinition","NextStepsSectionDefinition","_FeatureSection9PlusDefinition","FeatureSection9PlusDefinition","_listItemsSectionDefinition","ListItemsSectionDefinition","_SkipNodesSectionDefinition","SkipNodesSectionDefinition","_HtmlCommentSectionDefinition","HtmlCommentSectionDefinition","_SearchSectionDefinition","SearchSectionDefinition","_ErrorSectionDefinition","ErrorSectionDefinition","_FallbackSectionDefinition","FallbackSectionDefinition","_registry","createSdkRegistry","ComponentRegistry","register"],"sources":["../../../../src/component/componentDefinitions/index.ts"],"sourcesContent":["export type { SectionDefinition } from '../section-definition';\nexport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nexport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\nexport { HeroSectionDefinition } from './HeroSectionDefinition';\nexport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nexport { KpiSectionDefinition } from './KpiSectionDefinition';\nexport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nexport { EntitySectionDefinition } from './EntitySectionDefinition';\nexport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nexport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nexport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nexport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nexport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nexport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nexport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nexport { SearchSectionDefinition } from './SearchSectionDefinition';\nexport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nexport { FallbackSectionDefinition } from './FallbackSectionDefinition';\n\nimport { ComponentRegistry } from '../../registry';\nimport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nimport { SearchSectionDefinition } from './SearchSectionDefinition';\nimport { KpiSectionDefinition } from './KpiSectionDefinition';\nimport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nimport { EntitySectionDefinition } from './EntitySectionDefinition';\nimport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nimport { HeroSectionDefinition } from './HeroSectionDefinition';\nimport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nimport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nimport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nimport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nimport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nimport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nimport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nimport { FallbackSectionDefinition } from './FallbackSectionDefinition';\nimport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nimport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\n\n/**\n * Creates an SDK registry with all section definitions registered in the\n * same priority order as the app registry (createAppRegistry.ts).\n * Registration order determines evaluation priority — first match wins.\n */\nexport function createSdkRegistry(): ComponentRegistry<null> {\n return new ComponentRegistry<null>(null)\n .register(new SkipNodesSectionDefinition())\n .register(new SearchSectionDefinition())\n .register(new KpiSectionDefinition())\n .register(new NextStepsSectionDefinition())\n .register(new EntitySectionDefinition())\n .register(new HeroEntitySectionDefinition())\n .register(new HeroSectionDefinition())\n .register(new FeatureCardsSectionDefinition())\n .register(new TextBlockSectionDefinition())\n .register(new ListItemsSectionDefinition())\n .register(new FeatureSection9PlusDefinition())\n .register(new ComparisonSectionDefinition())\n .register(new HtmlCommentSectionDefinition())\n .register(new CtaBannerSectionDefinition())\n .register(new CalloutSectionDefinition())\n .register(new FallbackSectionDefinition())\n .register(new ErrorSectionDefinition());\n}\n"],"mappings":";;;;AACA,IAAAA,4BAAA,GAAAC,OAAA;AAA4EC,OAAA,CAAA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AC,CAC1CsB,QAAQ,CAAC,IAAIpB,kDAAwB,CAAC,CAAC,CAAC,CACxCoB,QAAQ,CAAC,IAAIJ,oDAAyB,CAAC,CAAC,CAAC,CACzCI,QAAQ,CAAC,IAAIN,8CAAsB,CAAC,CAAC,CAAC;AAC3C","ignoreList":[]}
1
+ {"version":3,"names":["_ComparisonSectionDefinition","require","exports","ComparisonSectionDefinition","_TextBlockSectionDefinition","TextBlockSectionDefinition","_HeroSectionDefinition","HeroSectionDefinition","_HeroEntitySectionDefinition","HeroEntitySectionDefinition","_KpiSectionDefinition","KpiSectionDefinition","_FeatureCardsSectionDefinition","FeatureCardsSectionDefinition","_EntitySectionDefinition","EntitySectionDefinition","_EntityCollectionSectionDefinition","EntityCollectionSectionDefinition","_CtaBannerSectionDefinition","CtaBannerSectionDefinition","_CalloutSectionDefinition","CalloutSectionDefinition","_NextStepsSectionDefinition","NextStepsSectionDefinition","_FeatureSection9PlusDefinition","FeatureSection9PlusDefinition","_listItemsSectionDefinition","ListItemsSectionDefinition","_SkipNodesSectionDefinition","SkipNodesSectionDefinition","_HtmlCommentSectionDefinition","HtmlCommentSectionDefinition","_SearchSectionDefinition","SearchSectionDefinition","_ErrorSectionDefinition","ErrorSectionDefinition","_FallbackSectionDefinition","FallbackSectionDefinition","_registry","createSdkRegistry","ComponentRegistry","register"],"sources":["../../../../src/component/componentDefinitions/index.ts"],"sourcesContent":["export type { SectionDefinition } from '../section-definition';\nexport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nexport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\nexport { HeroSectionDefinition } from './HeroSectionDefinition';\nexport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nexport { KpiSectionDefinition } from './KpiSectionDefinition';\nexport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nexport { EntitySectionDefinition } from './EntitySectionDefinition';\nexport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nexport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nexport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nexport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nexport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nexport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nexport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nexport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nexport { SearchSectionDefinition } from './SearchSectionDefinition';\nexport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nexport { FallbackSectionDefinition } from './FallbackSectionDefinition';\n\nimport { ComponentRegistry } from '../../registry';\nimport { SkipNodesSectionDefinition } from './SkipNodesSectionDefinition';\nimport { SearchSectionDefinition } from './SearchSectionDefinition';\nimport { KpiSectionDefinition } from './KpiSectionDefinition';\nimport { NextStepsSectionDefinition } from './NextStepsSectionDefinition';\nimport { EntitySectionDefinition } from './EntitySectionDefinition';\nimport { EntityCollectionSectionDefinition } from './EntityCollectionSectionDefinition';\nimport { HeroEntitySectionDefinition } from './HeroEntitySectionDefinition';\nimport { HeroSectionDefinition } from './HeroSectionDefinition';\nimport { FeatureCardsSectionDefinition } from './FeatureCardsSectionDefinition';\nimport { FeatureSection9PlusDefinition } from './FeatureSection9PlusDefinition';\nimport { ListItemsSectionDefinition } from './listItemsSectionDefinition';\nimport { ComparisonSectionDefinition } from './ComparisonSectionDefinition';\nimport { HtmlCommentSectionDefinition } from './HtmlCommentSectionDefinition';\nimport { CtaBannerSectionDefinition } from './CtaBannerSectionDefinition';\nimport { CalloutSectionDefinition } from './CalloutSectionDefinition';\nimport { FallbackSectionDefinition } from './FallbackSectionDefinition';\nimport { ErrorSectionDefinition } from './ErrorSectionDefinition';\nimport { TextBlockSectionDefinition } from './TextBlockSectionDefinition';\n\n/**\n * Creates an SDK registry with all section definitions registered in the\n * same priority order as the app registry (createAppRegistry.ts).\n * Registration order determines evaluation priority — first match wins.\n */\nexport function createSdkRegistry(): ComponentRegistry<null> {\n return (\n new ComponentRegistry<null>(null)\n .register(new SkipNodesSectionDefinition())\n .register(new SearchSectionDefinition())\n .register(new KpiSectionDefinition())\n .register(new NextStepsSectionDefinition())\n // Collection entities are claimed by their own definition first — it is a\n // strictly narrower match than EntitySectionDefinition, which would\n // otherwise swallow collection, product and article blocks alike.\n .register(new EntityCollectionSectionDefinition())\n .register(new EntitySectionDefinition())\n .register(new HeroEntitySectionDefinition())\n .register(new HeroSectionDefinition())\n .register(new FeatureCardsSectionDefinition())\n .register(new ListItemsSectionDefinition())\n .register(new FeatureSection9PlusDefinition())\n .register(new ComparisonSectionDefinition())\n .register(new HtmlCommentSectionDefinition())\n .register(new CtaBannerSectionDefinition())\n // textBlock comes after every definition whose block opens `h2 > t`\n // (entity, listItems, featureCards, ctaBanner, comparison, …). Its\n // trailing callout is optional, so its pattern also matches a bare\n // `h2 > t`, and a pattern matches a PREFIX of the block — registered\n // above those it would claim the heading + intro paragraph and strand\n // the list / links / table that follow in a separate section.\n .register(new TextBlockSectionDefinition())\n .register(new CalloutSectionDefinition())\n .register(new FallbackSectionDefinition())\n .register(new ErrorSectionDefinition())\n );\n}\n"],"mappings":";;;;AACA,IAAAA,4BAAA,GAAAC,OAAA;AAA4EC,OAAA,CAAAC,2BAAA,GAAAH,4BAAA,CAAAG,2BAAA;AAC5E,IAAAC,2BAAA,GAAAH,OAAA;AAA0EC,OAAA,CAAAG,0BAAA,GAAAD,2BAAA,CAAAC,0BAAA;AAC1E,IAAAC,sBAAA,GAAAL,OAAA;AAAgEC,OAAA,CAAAK,qBAAA,GAAAD,sBAAA,CAAAC,qBAAA;AAChE,IAAAC,4BAAA,GAAAP,OAAA;AAA4EC,OAAA,CAAAO,2BAAA,GAAAD,4BAAA,CAAAC,2BAAA;AAC5E,IAAAC,qBAAA,GAAAT,OAAA;AAA8DC,OAAA,CAAAS,oBAAA,GAAAD,qBAAA,CAAAC,oBAAA;AAC9D,IAAAC,8BAAA,GAAAX,OAAA;AAAgFC,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5LinkValidator");
13
13
  var _diagnosticTypes = require("./diagnosticTypes");
14
14
  var _componentTracking = require("../utils/componentTracking");
15
+ var _matchDebug = require("../utils/matchDebug");
15
16
  var _diagnosticsCollector = require("../utils/diagnosticsCollector");
16
17
  var _unifiedMarkdownParser = require("../utils/unifiedMarkdownParser");
17
18
  var _markdownPreprocessor = require("../utils/markdownPreprocessor");
@@ -37,8 +38,17 @@ var _propsExtractor = require("../utils/propsExtractor");
37
38
  function isEntityCompProps(props) {
38
39
  return typeof props === 'object' && props !== null && Array.isArray(props.items);
39
40
  }
41
+
42
+ /**
43
+ * Section types whose props are `EntityCompProps` and therefore participate in
44
+ * payload enrichment. `entityCollection` is `entity` narrowed to collection
45
+ * links — it produces the same props and arrives under the same
46
+ * `semantic: items` descriptor, so leaving it out would silently strip its
47
+ * items of their catalog data (image, title) and render the section blank.
48
+ */
49
+ const ENRICHABLE_ENTITY_SECTION_TYPES = new Set(['entity', 'entityCollection']);
40
50
  function isItemsFromContentSection(sectionType, semantic, serverSectionId) {
41
- if (sectionType !== 'entity') {
51
+ if (!ENRICHABLE_ENTITY_SECTION_TYPES.has(sectionType)) {
42
52
  return false;
43
53
  }
44
54
  const normalizedSemantic = semantic == null ? void 0 : semantic.toLowerCase().replace(/_/g, '-');
@@ -268,6 +278,15 @@ function tryParseComponent(nodes, sectionIndex, context) {
268
278
  setMeta: context.tracking ? (sectionType, key, value) => context.tracking.setMeta(sectionType, key, value) : undefined,
269
279
  getMeta: context.tracking ? (sectionType, key) => context.tracking.getMeta(sectionType, key) : undefined
270
280
  };
281
+
282
+ // Debug-only trace (`?web5DebugMatch=1`). The registry order line doubles as
283
+ // a "is my definition even registered?" check — a definition missing from it
284
+ // never reached `register()` (stale client bundle / web5-core version skew).
285
+ const trace = (0, _matchDebug.isMatchDebugEnabled)();
286
+ if (trace) {
287
+ (0, _matchDebug.logMatchDebug)(`block #${sectionIndex} [${nodes.map(n => n.type).join(', ')}]`);
288
+ (0, _matchDebug.logMatchDebug)(` registry order: ${definitions.map(d => d.sectionType).join(' > ')}`);
289
+ }
271
290
  for (const {
272
291
  sectionType,
273
292
  definition
@@ -277,12 +296,18 @@ function tryParseComponent(nodes, sectionIndex, context) {
277
296
  // render (the main app) — their markdown should fall through to the generic
278
297
  // sections there. Skip them unless this is a placement parse.
279
298
  if (!placement && registry.isPlacementOnly(sectionType)) {
299
+ if (trace) {
300
+ (0, _matchDebug.logMatchDebug)(` ${sectionType}: skipped (placement-only)`);
301
+ }
280
302
  continue;
281
303
  }
282
304
  for (const pattern of definition.patterns) {
283
305
  var _parts$find, _context$intent;
284
306
  const result = (0, _patternValidator.validatePattern)(nodes, pattern);
285
307
  if (!result.valid) {
308
+ if (trace) {
309
+ (0, _matchDebug.logMatchDebug)(` ${sectionType}: no match — ${result.error ?? 'pattern did not match'}\n pattern: ${pattern}`);
310
+ }
286
311
  continue;
287
312
  }
288
313
  let parsedNodes = result.astEndIndex !== undefined && result.astEndIndex >= 0 ? result.astEndIndex + 1 : result.endIndex >= 0 ? result.endIndex + 1 : 1;
@@ -305,8 +330,14 @@ function tryParseComponent(nodes, sectionIndex, context) {
305
330
  };
306
331
  let props = definition.parse(parts, parseContext);
307
332
  if (props === null) {
333
+ if (trace) {
334
+ (0, _matchDebug.logMatchDebug)(` ${sectionType}: pattern matched ${parsedNodes} node(s) but parse() returned null — falling through`);
335
+ }
308
336
  continue;
309
337
  }
338
+ if (trace) {
339
+ (0, _matchDebug.logMatchDebug)(` ${sectionType}: MATCHED ${parsedNodes} node(s) via ${pattern}`);
340
+ }
310
341
  const leadingHtmlCommentMeta = (_parts$find = parts.find(p => p.type === 'htmlComment' && p.meta)) == null ? void 0 : _parts$find.meta;
311
342
  const semantic = leadingHtmlCommentMeta == null ? void 0 : leadingHtmlCommentMeta.semantic;
312
343
  const serverSectionId = leadingHtmlCommentMeta == null ? void 0 : leadingHtmlCommentMeta.id;
@@ -320,6 +351,9 @@ function tryParseComponent(nodes, sectionIndex, context) {
320
351
  });
321
352
  }
322
353
  if (definition.singleInstance && context.tracking && context.tracking.getComponentCount(sectionType) > 0) {
354
+ if (trace) {
355
+ (0, _matchDebug.logMatchDebug)(` ${sectionType}: dropped (singleInstance, already rendered once)`);
356
+ }
323
357
  continue;
324
358
  }
325
359
  const isNullComponent = definition.nullComponent === true;
@@ -367,6 +401,9 @@ function tryParseComponent(nodes, sectionIndex, context) {
367
401
  };
368
402
  }
369
403
  }
404
+ if (trace) {
405
+ (0, _matchDebug.logMatchDebug)(' no definition claimed this block');
406
+ }
370
407
  return {};
371
408
  }
372
409
  //# sourceMappingURL=componentParser.js.map