@wix/web5-core 1.63.6 → 1.63.8
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/cjs/component/componentDefinitions/CalloutSectionDefinition.js +102 -5
- package/dist/cjs/component/componentDefinitions/CalloutSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/index.js +8 -2
- package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/parse-utils.js +14 -6
- package/dist/cjs/component/componentDefinitions/parse-utils.js.map +1 -1
- package/dist/cjs/component/types.js.map +1 -1
- package/dist/cjs/hooks/useResolveSearchSpringEntityData.js +17 -1
- package/dist/cjs/hooks/useResolveSearchSpringEntityData.js.map +1 -1
- package/dist/cjs/hooks/useResolveShopifyEntityData.js +30 -9
- package/dist/cjs/hooks/useResolveShopifyEntityData.js.map +1 -1
- package/dist/cjs/index.js +4 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/shopify/transformShopifyEntity.js +27 -6
- package/dist/cjs/services/shopify/transformShopifyEntity.js.map +1 -1
- package/dist/cjs/types/callout.js +11 -1
- package/dist/cjs/types/callout.js.map +1 -1
- package/dist/esm/component/componentDefinitions/CalloutSectionDefinition.js +104 -6
- package/dist/esm/component/componentDefinitions/CalloutSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/index.js +8 -2
- package/dist/esm/component/componentDefinitions/index.js.map +1 -1
- package/dist/esm/component/componentDefinitions/parse-utils.js +14 -6
- package/dist/esm/component/componentDefinitions/parse-utils.js.map +1 -1
- package/dist/esm/component/types.js.map +1 -1
- package/dist/esm/hooks/useResolveSearchSpringEntityData.js +17 -1
- package/dist/esm/hooks/useResolveSearchSpringEntityData.js.map +1 -1
- package/dist/esm/hooks/useResolveShopifyEntityData.js +30 -9
- package/dist/esm/hooks/useResolveShopifyEntityData.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/shopify/transformShopifyEntity.js +27 -6
- package/dist/esm/services/shopify/transformShopifyEntity.js.map +1 -1
- package/dist/esm/types/callout.js +10 -0
- package/dist/esm/types/callout.js.map +1 -1
- package/dist/types/component/componentDefinitions/CalloutSectionDefinition.d.ts +37 -2
- package/dist/types/component/componentDefinitions/CalloutSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/parse-utils.d.ts +8 -1
- package/dist/types/component/componentDefinitions/parse-utils.d.ts.map +1 -1
- package/dist/types/component/types.d.ts +8 -0
- package/dist/types/component/types.d.ts.map +1 -1
- package/dist/types/hooks/useResolveSearchSpringEntityData.d.ts +11 -0
- package/dist/types/hooks/useResolveSearchSpringEntityData.d.ts.map +1 -1
- package/dist/types/hooks/useResolveShopifyEntityData.d.ts +11 -0
- package/dist/types/hooks/useResolveShopifyEntityData.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/services/shopify/transformShopifyEntity.d.ts +2 -2
- package/dist/types/services/shopify/transformShopifyEntity.d.ts.map +1 -1
- package/dist/types/types/callout.d.ts +11 -0
- package/dist/types/types/callout.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["formatShopifyDate","isoDate","date","Date","isNaN","getTime","undefined","day","getDate","month","toLocaleString","year","getFullYear","formatPrice","money","amount","parseFloat","formatted","toFixed","currencyCode","extractSizes","product","sizes","variants","edges","flatMap","e","node","selectedOptions","filter","o","name","toLowerCase","map","value","unique","Set","length","extractVariants","sizeOption","find","numericId","id","replace","label","title","variantId","available","availableForSale","price","compareAtPrice","getSecondaryImage","images","url","getAllImages","getCompareAtPrice","_product$compareAtPri","compare","compareAtPriceRange","minVariantPrice","min","priceRange","transformShopifyProduct","_product$featuredImag","_product$options","onlineStoreUrl","type","description","imageUrl","featuredImage","secondaryImageUrl","vendor","allImages","options","tags","transformShopifyCollection","collection","_collection$image","image","transformShopifyArticle","article","_article$image","_article$authorV","excerpt","publishDate","publishedAt","author","authorV2","transformShopifyEntityToItemData","entity","entityType"],"sources":["../../../../src/services/shopify/transformShopifyEntity.ts"],"sourcesContent":["import type { EntityItemData } from '../../component/types';\nimport type {\n ShopifyProduct,\n ShopifyCollection,\n ShopifyArticle,\n} from './types';\n\nfunction formatShopifyDate(isoDate: string): string | undefined {\n const date = new Date(isoDate);\n if (isNaN(date.getTime())) {\n return undefined;\n }\n const day = date.getDate();\n const month = date.toLocaleString('en-US', { month: 'short' });\n const year = date.getFullYear();\n return `${day} ${month} ${year}`;\n}\n\nfunction formatPrice(\n money: ShopifyProduct['priceRange']['minVariantPrice'],\n): string {\n const amount = parseFloat(money.amount);\n const formatted = amount.toFixed(2);\n return `${formatted} ${money.currencyCode}`;\n}\n\nfunction extractSizes(product: ShopifyProduct): string[] | undefined {\n const sizes = product.variants.edges.flatMap((e) =>\n e.node.selectedOptions\n .filter((o) => o.name.toLowerCase() === 'size')\n .map((o) => o.value),\n );\n const unique = [...new Set(sizes)];\n return unique.length > 0 ? unique : undefined;\n}\n\n/**\n * Extract variant ID → size label mapping for add-to-cart.\n * Shopify global IDs look like \"gid://shopify/ProductVariant/12345\" —\n * we extract just the numeric part for the Ajax API.\n */\nfunction extractVariants(product: ShopifyProduct): EntityItemData['variants'] {\n const variants = product.variants.edges.map((e) => {\n const sizeOption = e.node.selectedOptions.find(\n (o) => o.name.toLowerCase() === 'size',\n );\n const numericId = e.node.id.replace(\n /^gid:\\/\\/shopify\\/ProductVariant\\//,\n '',\n );\n return {\n label: sizeOption?.value || e.node.title,\n variantId: numericId,\n available: e.node.availableForSale,\n selectedOptions: e.node.selectedOptions.map((o) => ({\n name: o.name,\n value: o.value,\n })),\n price: formatPrice(e.node.price),\n compareAtPrice: e.node.compareAtPrice\n ? formatPrice(e.node.compareAtPrice)\n : undefined,\n };\n });\n return variants.length > 0 ? variants : undefined;\n}\n\nfunction getSecondaryImage(product: ShopifyProduct): string | undefined {\n const images = product.images.edges.map((e) => e.node.url);\n return images.length > 1 ? images[1] : undefined;\n}\n\nfunction getAllImages(product: ShopifyProduct): string[] | undefined {\n const images = product.images.edges.map((e) => e.node.url);\n return images.length > 0 ? images : undefined;\n}\n\nfunction getCompareAtPrice(product: ShopifyProduct): string | undefined {\n const compare = product.compareAtPriceRange?.minVariantPrice;\n if (!compare) {\n return undefined;\n }\n const min = product.priceRange.minVariantPrice;\n if (parseFloat(compare.amount) <= parseFloat(min.amount)) {\n return undefined;\n }\n return formatPrice(compare);\n}\n\nexport function transformShopifyProduct(\n product: ShopifyProduct,\n): EntityItemData {\n return {\n url: product.onlineStoreUrl || '',\n title: product.title,\n type: 'product',\n description: product.description,\n imageUrl: product.featuredImage?.url,\n secondaryImageUrl: getSecondaryImage(product),\n vendor: product.vendor,\n price: formatPrice(product.priceRange.minVariantPrice),\n compareAtPrice: getCompareAtPrice(product),\n sizes: extractSizes(product),\n variants: extractVariants(product),\n allImages: getAllImages(product),\n options: product.options?.length ? product.options : undefined,\n tags: product.tags.length ? product.tags : undefined,\n };\n}\n\nexport function transformShopifyCollection(\n collection: ShopifyCollection,\n): EntityItemData {\n return {\n url: collection.onlineStoreUrl || '',\n title: collection.title,\n type: 'collection',\n description: collection.description,\n imageUrl: collection.image?.url,\n };\n}\n\nexport function transformShopifyArticle(\n article: ShopifyArticle,\n): EntityItemData {\n return {\n url: article.onlineStoreUrl || '',\n title: article.title,\n type: 'article',\n description: article.excerpt || undefined,\n imageUrl: article.image?.url,\n publishDate: formatShopifyDate(article.publishedAt),\n author: article.authorV2?.name || undefined,\n tags: article.tags.length ? article.tags : undefined,\n };\n}\n\n/**\n * Transform any resolved Shopify entity to the standard EntityItemData shape.\n * Detects the entity type by checking for type-specific fields.\n */\nexport function transformShopifyEntityToItemData(\n entity: ShopifyProduct | ShopifyCollection | ShopifyArticle,\n entityType: string,\n): EntityItemData {\n switch (entityType.toLowerCase()) {\n case 'product':\n return transformShopifyProduct(entity as ShopifyProduct);\n case 'collection':\n return transformShopifyCollection(entity as ShopifyCollection);\n case 'article':\n return transformShopifyArticle(entity as ShopifyArticle);\n default:\n return {\n url: '',\n title: (entity as { title?: string }).title || '',\n type: entityType,\n };\n }\n}\n"],"mappings":";;;;;;;AAOA,SAASA,iBAAiBA,CAACC,OAAe,EAAsB;EAC9D,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,OAAO,CAAC;EAC9B,IAAIG,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,EAAE;IACzB,OAAOC,SAAS;EAClB;EACA,MAAMC,GAAG,GAAGL,IAAI,CAACM,OAAO,CAAC,CAAC;EAC1B,MAAMC,KAAK,GAAGP,IAAI,CAACQ,cAAc,CAAC,OAAO,EAAE;IAAED,KAAK,EAAE;EAAQ,CAAC,CAAC;EAC9D,MAAME,IAAI,GAAGT,IAAI,CAACU,WAAW,CAAC,CAAC;EAC/B,OAAO,GAAGL,GAAG,IAAIE,KAAK,IAAIE,IAAI,EAAE;AAClC;AAEA,SAASE,WAAWA,CAClBC,KAAsD,EAC9C;EACR,MAAMC,MAAM,GAAGC,UAAU,CAACF,KAAK,CAACC,MAAM,CAAC;EACvC,MAAME,SAAS,GAAGF,MAAM,CAACG,OAAO,CAAC,CAAC,CAAC;EACnC,OAAO,GAAGD,SAAS,IAAIH,KAAK,CAACK,YAAY,EAAE;AAC7C;AAEA,SAASC,YAAYA,CAACC,OAAuB,EAAwB;EACnE,MAAMC,KAAK,GAAGD,OAAO,CAACE,QAAQ,CAACC,KAAK,CAACC,OAAO,CAAEC,CAAC,IAC7CA,CAAC,CAACC,IAAI,CAACC,eAAe,CACnBC,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAC9CC,GAAG,CAAEH,CAAC,IAAKA,CAAC,CAACI,KAAK,CACvB,CAAC;EACD,MAAMC,MAAM,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O,CAACG,OAAO,IAAI7E,SAAS;IACzC8D,QAAQ,GAAAa,cAAA,GAAED,OAAO,CAACF,KAAK,qBAAbG,cAAA,CAAe5B,GAAG;IAC5B+B,WAAW,EAAEpF,iBAAiB,CAACgF,OAAO,CAACK,WAAW,CAAC;IACnDC,MAAM,EAAE,EAAAJ,gBAAA,GAAAF,OAAO,CAACO,QAAQ,qBAAhBL,gBAAA,CAAkBnD,IAAI,KAAIzB,SAAS;IAC3CoE,IAAI,EAAEM,OAAO,CAACN,IAAI,CAACrC,MAAM,GAAG2C,OAAO,CAACN,IAAI,GAAGpE;EAC7C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACO,SAASkF,gCAAgCA,CAC9CC,MAA2D,EAC3DC,UAAkB,EACF;EAChB,QAAQA,UAAU,CAAC1D,WAAW,CAAC,CAAC;IAC9B,KAAK,SAAS;MACZ,OAAO8B,uBAAuB,CAAC2B,MAAwB,CAAC;IAC1D,KAAK,YAAY;MACf,OAAOd,0BAA0B,CAACc,MAA2B,CAAC;IAChE,KAAK,SAAS;MACZ,OAAOV,uBAAuB,CAACU,MAAwB,CAAC;IAC1D;MACE,OAAO;QACLpC,GAAG,EAAE,EAAE;QACPR,KAAK,EAAG4C,MAAM,CAAwB5C,KAAK,IAAI,EAAE;QACjDqB,IAAI,EAAEwB;MACR,CAAC;EACL;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["formatShopifyDate","isoDate","date","Date","isNaN","getTime","undefined","day","getDate","month","toLocaleString","year","getFullYear","formatPrice","money","amount","parseFloat","formatted","toFixed","currencyCode","extractSizes","product","sizes","variants","edges","flatMap","e","node","selectedOptions","filter","o","name","toLowerCase","map","value","unique","Set","length","extractVariants","sizeOption","find","numericId","id","replace","label","title","variantId","available","availableForSale","price","compareAtPrice","getSecondaryImage","images","url","getAllImages","getCompareAtPrice","_product$compareAtPri","compare","compareAtPriceRange","minVariantPrice","min","priceRange","findLiveVariant","variant","transformShopifyProduct","_product$featuredImag","_product$options","matchedVariant","onlineStoreUrl","type","description","imageUrl","featuredImage","secondaryImageUrl","vendor","allImages","options","tags","transformShopifyCollection","collection","_collection$image","image","transformShopifyArticle","article","_article$image","_article$authorV","excerpt","publishDate","publishedAt","author","authorV2","transformShopifyEntityToItemData","entity","entityType"],"sources":["../../../../src/services/shopify/transformShopifyEntity.ts"],"sourcesContent":["import type { EntityItemData } from '../../component/types';\nimport type {\n ShopifyProduct,\n ShopifyCollection,\n ShopifyArticle,\n} from './types';\n\nfunction formatShopifyDate(isoDate: string): string | undefined {\n const date = new Date(isoDate);\n if (isNaN(date.getTime())) {\n return undefined;\n }\n const day = date.getDate();\n const month = date.toLocaleString('en-US', { month: 'short' });\n const year = date.getFullYear();\n return `${day} ${month} ${year}`;\n}\n\nfunction formatPrice(\n money: ShopifyProduct['priceRange']['minVariantPrice'],\n): string {\n const amount = parseFloat(money.amount);\n const formatted = amount.toFixed(2);\n return `${formatted} ${money.currencyCode}`;\n}\n\nfunction extractSizes(product: ShopifyProduct): string[] | undefined {\n const sizes = product.variants.edges.flatMap((e) =>\n e.node.selectedOptions\n .filter((o) => o.name.toLowerCase() === 'size')\n .map((o) => o.value),\n );\n const unique = [...new Set(sizes)];\n return unique.length > 0 ? unique : undefined;\n}\n\n/**\n * Extract variant ID → size label mapping for add-to-cart.\n * Shopify global IDs look like \"gid://shopify/ProductVariant/12345\" —\n * we extract just the numeric part for the Ajax API.\n */\nfunction extractVariants(product: ShopifyProduct): EntityItemData['variants'] {\n const variants = product.variants.edges.map((e) => {\n const sizeOption = e.node.selectedOptions.find(\n (o) => o.name.toLowerCase() === 'size',\n );\n const numericId = e.node.id.replace(\n /^gid:\\/\\/shopify\\/ProductVariant\\//,\n '',\n );\n return {\n label: sizeOption?.value || e.node.title,\n variantId: numericId,\n available: e.node.availableForSale,\n selectedOptions: e.node.selectedOptions.map((o) => ({\n name: o.name,\n value: o.value,\n })),\n price: formatPrice(e.node.price),\n compareAtPrice: e.node.compareAtPrice\n ? formatPrice(e.node.compareAtPrice)\n : undefined,\n };\n });\n return variants.length > 0 ? variants : undefined;\n}\n\nfunction getSecondaryImage(product: ShopifyProduct): string | undefined {\n const images = product.images.edges.map((e) => e.node.url);\n return images.length > 1 ? images[1] : undefined;\n}\n\nfunction getAllImages(product: ShopifyProduct): string[] | undefined {\n const images = product.images.edges.map((e) => e.node.url);\n return images.length > 0 ? images : undefined;\n}\n\nfunction getCompareAtPrice(product: ShopifyProduct): string | undefined {\n const compare = product.compareAtPriceRange?.minVariantPrice;\n if (!compare) {\n return undefined;\n }\n const min = product.priceRange.minVariantPrice;\n if (parseFloat(compare.amount) <= parseFloat(min.amount)) {\n return undefined;\n }\n return formatPrice(compare);\n}\n\n/**\n * The live entry for the variant the turn resolved, if the store still has it.\n * Both sides carry the bare numeric id — `extractVariants` strips the\n * `gid://shopify/ProductVariant/` prefix, and the turn never adds one.\n */\nfunction findLiveVariant(\n variants: EntityItemData['variants'],\n variantId: string | undefined,\n): NonNullable<EntityItemData['variants']>[number] | undefined {\n if (!variantId) {\n return undefined;\n }\n return variants?.find((variant) => variant.variantId === variantId);\n}\n\nexport function transformShopifyProduct(\n product: ShopifyProduct,\n variantId?: string,\n): EntityItemData {\n const variants = extractVariants(product);\n // The turn decided WHICH variant to show; the live fetch is here for what is\n // true about it right now. With no matched variant — or one the store has\n // since dropped — the product-level range is still the only answer we have.\n const matchedVariant = findLiveVariant(variants, variantId);\n\n return {\n url: product.onlineStoreUrl || '',\n title: product.title,\n type: 'product',\n description: product.description,\n imageUrl: product.featuredImage?.url,\n secondaryImageUrl: getSecondaryImage(product),\n vendor: product.vendor,\n price:\n matchedVariant?.price || formatPrice(product.priceRange.minVariantPrice),\n // Keyed on the variant, not on its value: an unmatched product falls back\n // to the product-level compare-at, but a matched variant that is simply\n // not on sale must not inherit one and print a false strikethrough.\n compareAtPrice: matchedVariant\n ? matchedVariant.compareAtPrice\n : getCompareAtPrice(product),\n available: matchedVariant?.available,\n sizes: extractSizes(product),\n variants,\n allImages: getAllImages(product),\n options: product.options?.length ? product.options : undefined,\n tags: product.tags.length ? product.tags : undefined,\n };\n}\n\nexport function transformShopifyCollection(\n collection: ShopifyCollection,\n): EntityItemData {\n return {\n url: collection.onlineStoreUrl || '',\n title: collection.title,\n type: 'collection',\n description: collection.description,\n imageUrl: collection.image?.url,\n };\n}\n\nexport function transformShopifyArticle(\n article: ShopifyArticle,\n): EntityItemData {\n return {\n url: article.onlineStoreUrl || '',\n title: article.title,\n type: 'article',\n description: article.excerpt || undefined,\n imageUrl: article.image?.url,\n publishDate: formatShopifyDate(article.publishedAt),\n author: article.authorV2?.name || undefined,\n tags: article.tags.length ? article.tags : undefined,\n };\n}\n\n/**\n * Transform any resolved Shopify entity to the standard EntityItemData shape.\n * Detects the entity type by checking for type-specific fields.\n */\nexport function transformShopifyEntityToItemData(\n entity: ShopifyProduct | ShopifyCollection | ShopifyArticle,\n entityType: string,\n variantId?: string,\n): EntityItemData {\n switch (entityType.toLowerCase()) {\n case 'product':\n return transformShopifyProduct(entity as ShopifyProduct, variantId);\n case 'collection':\n return transformShopifyCollection(entity as ShopifyCollection);\n case 'article':\n return transformShopifyArticle(entity as ShopifyArticle);\n default:\n return {\n url: '',\n title: (entity as { title?: string }).title || '',\n type: entityType,\n };\n }\n}\n"],"mappings":";;;;;;;AAOA,SAASA,iBAAiBA,CAACC,OAAe,EAAsB;EAC9D,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,OAAO,CAAC;EAC9B,IAAIG,KAAK,CAACF,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC,EAAE;IACzB,OAAOC,SAAS;EAClB;EACA,MAAMC,GAAG,GAAGL,IAAI,CAACM,OAAO,CAAC,CAAC;EAC1B,MAAMC,KAAK,GAAGP,IAAI,CAACQ,cAAc,CAAC,OAAO,EAAE;IAAED,KAAK,EAAE;EAAQ,CAAC,CAAC;EAC9D,MAAME,IAAI,GAAGT,IAAI,CAACU,WAAW,CAAC,CAAC;EAC/B,OAAO,GAAGL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BAAbG,cAAA,CAAe/B,GAAG;IAC5BkC,WAAW,EAAEvF,iBAAiB,CAACmF,OAAO,CAACK,WAAW,CAAC;IACnDC,MAAM,EAAE,EAAAJ,gBAAA,GAAAF,OAAO,CAACO,QAAQ,qBAAhBL,gBAAA,CAAkBtD,IAAI,KAAIzB,SAAS;IAC3CuE,IAAI,EAAEM,OAAO,CAACN,IAAI,CAACxC,MAAM,GAAG8C,OAAO,CAACN,IAAI,GAAGvE;EAC7C,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACO,SAASqF,gCAAgCA,CAC9CC,MAA2D,EAC3DC,UAAkB,EAClB/C,SAAkB,EACF;EAChB,QAAQ+C,UAAU,CAAC7D,WAAW,CAAC,CAAC;IAC9B,KAAK,SAAS;MACZ,OAAOgC,uBAAuB,CAAC4B,MAAM,EAAoB9C,SAAS,CAAC;IACrE,KAAK,YAAY;MACf,OAAOgC,0BAA0B,CAACc,MAA2B,CAAC;IAChE,KAAK,SAAS;MACZ,OAAOV,uBAAuB,CAACU,MAAwB,CAAC;IAC1D;MACE,OAAO;QACLvC,GAAG,EAAE,EAAE;QACPR,KAAK,EAAG+C,MAAM,CAAwB/C,KAAK,IAAI,EAAE;QACjDwB,IAAI,EAAEwB;MACR,CAAC;EACL;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.CALLOUT_KINDS = void 0;
|
|
4
|
+
exports.CALLOUT_SEMANTICS = exports.CALLOUT_KINDS = void 0;
|
|
5
5
|
const CALLOUT_KINDS = exports.CALLOUT_KINDS = ['NOTE', 'TIP', 'IMPORTANT', 'WARNING', 'CAUTION', 'ECHO'];
|
|
6
|
+
/**
|
|
7
|
+
* The kinds a callout descriptor may declare as `semantic:`, lowercase, as the
|
|
8
|
+
* orchestrator writes them: `<!-- section:callout, semantic:tip -->`.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately narrower than `CALLOUT_KINDS`. That list is the vocabulary of
|
|
11
|
+
* the legacy `> [!TYPE]` blockquote marker and has to keep every value it ever
|
|
12
|
+
* accepted, because historical pages and sites pinned to an older prompt still
|
|
13
|
+
* carry them. This list is what the current prompts are allowed to emit.
|
|
14
|
+
*/
|
|
15
|
+
const CALLOUT_SEMANTICS = exports.CALLOUT_SEMANTICS = ['note', 'tip'];
|
|
6
16
|
//# sourceMappingURL=callout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CALLOUT_KINDS","exports"],"sources":["../../../src/types/callout.ts"],"sourcesContent":["export const CALLOUT_KINDS = [\n 'NOTE',\n 'TIP',\n 'IMPORTANT',\n 'WARNING',\n 'CAUTION',\n 'ECHO',\n] as const;\n\nexport type CalloutKind = (typeof CALLOUT_KINDS)[number];\n\nexport interface Callout {\n text: string;\n kind?: string;\n}\n"],"mappings":";;;;AAAO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,CAC3B,MAAM,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,CACE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CALLOUT_KINDS","exports","CALLOUT_SEMANTICS"],"sources":["../../../src/types/callout.ts"],"sourcesContent":["export const CALLOUT_KINDS = [\n 'NOTE',\n 'TIP',\n 'IMPORTANT',\n 'WARNING',\n 'CAUTION',\n 'ECHO',\n] as const;\n\nexport type CalloutKind = (typeof CALLOUT_KINDS)[number];\n\n/**\n * The kinds a callout descriptor may declare as `semantic:`, lowercase, as the\n * orchestrator writes them: `<!-- section:callout, semantic:tip -->`.\n *\n * Deliberately narrower than `CALLOUT_KINDS`. That list is the vocabulary of\n * the legacy `> [!TYPE]` blockquote marker and has to keep every value it ever\n * accepted, because historical pages and sites pinned to an older prompt still\n * carry them. This list is what the current prompts are allowed to emit.\n */\nexport const CALLOUT_SEMANTICS = ['note', 'tip'] as const;\n\nexport type CalloutSemantic = (typeof CALLOUT_SEMANTICS)[number];\n\nexport interface Callout {\n text: string;\n kind?: string;\n}\n"],"mappings":";;;;AAAO,MAAMA,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,CAC3B,MAAM,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,MAAM,CACE;AAIV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,iBAAiB,GAAAD,OAAA,CAAAC,iBAAA,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU","ignoreList":[]}
|
|
@@ -1,16 +1,60 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { parseCalloutTag } from './parse-utils.js';
|
|
2
|
+
import { inlinePartsToMarkdown, parseCalloutTag } from './parse-utils.js';
|
|
3
3
|
import { getPartsByType, getLinks } from '../../parts/parts.js';
|
|
4
|
+
import { CALLOUT_SEMANTICS } from '../../types/callout.js';
|
|
5
|
+
import { DROP_SECTION } from '../section-definition.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Callout — the page's dialog layer, written by the orchestrator itself rather
|
|
9
|
+
* than by a per-section model.
|
|
10
|
+
*
|
|
11
|
+
* Two markdown forms reach this definition, and both must keep working:
|
|
12
|
+
*
|
|
13
|
+
* 1. **Descriptor + plain prose** (current). `semantic` carries the kind:
|
|
14
|
+
*
|
|
15
|
+
* <!-- section:callout, semantic:tip -->
|
|
16
|
+
* Prefer a gentle daily ritual? The 4 oz size is the one to sample with.
|
|
17
|
+
*
|
|
18
|
+
* 2. **GFM alert blockquote** (legacy). Still emitted by sites pinned to an
|
|
19
|
+
* older prompt, and present in every historical page, so it is parsed
|
|
20
|
+
* verbatim rather than migrated:
|
|
21
|
+
*
|
|
22
|
+
* <!-- section:callout -->
|
|
23
|
+
* > [!TIP] Prefer a gentle daily ritual? …
|
|
24
|
+
*
|
|
25
|
+
* The two forms differ in one way that matters. A blockquote collapses to a
|
|
26
|
+
* single `callout` part carrying the whole line in `meta.markdown`, so inline
|
|
27
|
+
* ask links survive for free and `getLinks` finds nothing to harvest. A
|
|
28
|
+
* paragraph is *unwrapped* into its inline children (`markdownBlocks.ts`), so
|
|
29
|
+
* prose with a link arrives as `t + link + t` — separate parts. Reading only
|
|
30
|
+
* the `t` parts would delete the link's url and label (DL #134's list bug) and
|
|
31
|
+
* `getLinks` would then re-surface it as a footer link, showing the visitor the
|
|
32
|
+
* same link twice. `inlinePartsToMarkdown` is what keeps the link inline, and
|
|
33
|
+
* the prose path deliberately harvests no `relatedLinks` at all.
|
|
34
|
+
*/
|
|
4
35
|
export class CalloutSectionDefinition {
|
|
5
36
|
constructor() {
|
|
6
37
|
_defineProperty(this, "sectionType", 'callout');
|
|
7
|
-
_defineProperty(this, "patterns", [
|
|
38
|
+
_defineProperty(this, "patterns", [
|
|
39
|
+
// Descriptor-led prose. `link` must be in the alternation or a callout
|
|
40
|
+
// carrying an ask link fails to match and falls through to the fallback.
|
|
41
|
+
'html_comment[section="callout"] > (t | link)+',
|
|
42
|
+
// Legacy blockquote.
|
|
43
|
+
'html_comment? > callout+']);
|
|
8
44
|
_defineProperty(this, "defaults", {
|
|
9
45
|
callouts: [{
|
|
10
46
|
text: 'This is a callout.'
|
|
11
47
|
}]
|
|
12
48
|
});
|
|
13
49
|
_defineProperty(this, "fixtures", [{
|
|
50
|
+
markdown: '<!-- section:callout, semantic:tip -->\nThis is a callout paragraph.',
|
|
51
|
+
expected: {
|
|
52
|
+
callouts: [{
|
|
53
|
+
text: 'This is a callout paragraph.',
|
|
54
|
+
kind: 'TIP'
|
|
55
|
+
}]
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
14
58
|
markdown: '> This is a callout blockquote.',
|
|
15
59
|
expected: {
|
|
16
60
|
callouts: [{
|
|
@@ -20,10 +64,45 @@ export class CalloutSectionDefinition {
|
|
|
20
64
|
}]);
|
|
21
65
|
}
|
|
22
66
|
parse(parts) {
|
|
67
|
+
const calloutParts = getPartsByType(parts, 'callout');
|
|
68
|
+
return calloutParts.length > 0 ? this.parseBlockquote(calloutParts, parts) : this.parseProse(parts);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Descriptor + plain prose. The kind comes from the descriptor's `semantic`,
|
|
73
|
+
* and every link in the body is inline prose — never a `relatedLinks` footer.
|
|
74
|
+
*/
|
|
75
|
+
parseProse(parts) {
|
|
76
|
+
var _parts$find;
|
|
77
|
+
const descriptor = (_parts$find = parts.find(p => p.type === 'htmlComment' && p.meta)) == null ? void 0 : _parts$find.meta;
|
|
78
|
+
|
|
79
|
+
// The pattern already gates on this; re-checking keeps a direct
|
|
80
|
+
// `parse()` call (and any future pattern edit) from mislabelling a
|
|
81
|
+
// different section's prose as a callout.
|
|
82
|
+
if ((descriptor == null ? void 0 : descriptor.section) !== 'callout') {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const text = inlinePartsToMarkdown(parts.filter(p => p.type !== 'htmlComment')).trim();
|
|
86
|
+
|
|
87
|
+
// Matched, but there is nothing to say. DROP_SECTION consumes the nodes
|
|
88
|
+
// and renders nothing; returning null would hand the descriptor to the
|
|
89
|
+
// fallback, which renders it as stray text.
|
|
90
|
+
if (!text) {
|
|
91
|
+
return DROP_SECTION;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
callouts: [{
|
|
95
|
+
text,
|
|
96
|
+
...(semanticToKind(descriptor.semantic) ?? {})
|
|
97
|
+
}]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Legacy GFM alert blockquote. */
|
|
102
|
+
parseBlockquote(calloutParts, parts) {
|
|
23
103
|
const callouts = [];
|
|
24
104
|
const relatedLinks = [];
|
|
25
105
|
const seenUrls = new Set();
|
|
26
|
-
const calloutParts = getPartsByType(parts, 'callout');
|
|
27
106
|
for (const c of calloutParts) {
|
|
28
107
|
var _c$meta, _c$content;
|
|
29
108
|
const text = ((_c$meta = c.meta) == null || (_c$meta = _c$meta.markdown) == null ? void 0 : _c$meta.trim()) || ((_c$content = c.content) == null ? void 0 : _c$content.trim());
|
|
@@ -37,10 +116,13 @@ export class CalloutSectionDefinition {
|
|
|
37
116
|
}
|
|
38
117
|
}
|
|
39
118
|
}
|
|
119
|
+
if (callouts.length === 0) {
|
|
120
|
+
return DROP_SECTION;
|
|
121
|
+
}
|
|
40
122
|
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
for (const link of
|
|
123
|
+
// A blockquote yields no sibling link parts, so anything found here arrived
|
|
124
|
+
// alongside the quote and is a genuine footer link.
|
|
125
|
+
for (const link of getLinks(parts)) {
|
|
44
126
|
var _link$meta, _link$content;
|
|
45
127
|
const href = (_link$meta = link.meta) == null ? void 0 : _link$meta.href;
|
|
46
128
|
const text = (_link$content = link.content) == null ? void 0 : _link$content.trim();
|
|
@@ -58,4 +140,20 @@ export class CalloutSectionDefinition {
|
|
|
58
140
|
};
|
|
59
141
|
}
|
|
60
142
|
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* `semantic:tip` → `{ kind: 'TIP' }`. Uppercased so the new form lands on the
|
|
146
|
+
* same vocabulary the legacy `[!TIP]` marker produced, which is what any
|
|
147
|
+
* kind-aware renderer already switches on. An unrecognised value carries no
|
|
148
|
+
* kind rather than an invented one.
|
|
149
|
+
*/
|
|
150
|
+
function semanticToKind(semantic) {
|
|
151
|
+
const value = semantic == null ? void 0 : semantic.trim().toLowerCase();
|
|
152
|
+
if (!value) {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
return CALLOUT_SEMANTICS.includes(value) ? {
|
|
156
|
+
kind: value.toUpperCase()
|
|
157
|
+
} : undefined;
|
|
158
|
+
}
|
|
61
159
|
//# sourceMappingURL=CalloutSectionDefinition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parseCalloutTag","getPartsByType","getLinks","CalloutSectionDefinition","constructor","_defineProperty","callouts","text","markdown","expected","parse","parts","
|
|
1
|
+
{"version":3,"names":["inlinePartsToMarkdown","parseCalloutTag","getPartsByType","getLinks","CALLOUT_SEMANTICS","DROP_SECTION","CalloutSectionDefinition","constructor","_defineProperty","callouts","text","markdown","expected","kind","parse","parts","calloutParts","length","parseBlockquote","parseProse","_parts$find","descriptor","find","p","type","meta","section","filter","trim","semanticToKind","semantic","relatedLinks","seenUrls","Set","c","_c$meta","_c$content","content","parsed","push","link","_link$meta","_link$content","href","has","add","url","undefined","value","toLowerCase","includes","toUpperCase"],"sources":["../../../../src/component/componentDefinitions/CalloutSectionDefinition.ts"],"sourcesContent":["import { inlinePartsToMarkdown, parseCalloutTag } from './parse-utils';\nimport { getPartsByType, getLinks, type Part } from '../../parts/parts';\nimport { CALLOUT_SEMANTICS, type Callout } from '../../types/callout';\nimport type {\n CalloutCompProps,\n CalloutSectionComponent,\n SectionFixture,\n} from '../types';\nimport {\n DROP_SECTION,\n type DropSection,\n type SectionDefinition,\n} from '../section-definition';\n\n/**\n * Callout — the page's dialog layer, written by the orchestrator itself rather\n * than by a per-section model.\n *\n * Two markdown forms reach this definition, and both must keep working:\n *\n * 1. **Descriptor + plain prose** (current). `semantic` carries the kind:\n *\n * <!-- section:callout, semantic:tip -->\n * Prefer a gentle daily ritual? The 4 oz size is the one to sample with.\n *\n * 2. **GFM alert blockquote** (legacy). Still emitted by sites pinned to an\n * older prompt, and present in every historical page, so it is parsed\n * verbatim rather than migrated:\n *\n * <!-- section:callout -->\n * > [!TIP] Prefer a gentle daily ritual? …\n *\n * The two forms differ in one way that matters. A blockquote collapses to a\n * single `callout` part carrying the whole line in `meta.markdown`, so inline\n * ask links survive for free and `getLinks` finds nothing to harvest. A\n * paragraph is *unwrapped* into its inline children (`markdownBlocks.ts`), so\n * prose with a link arrives as `t + link + t` — separate parts. Reading only\n * the `t` parts would delete the link's url and label (DL #134's list bug) and\n * `getLinks` would then re-surface it as a footer link, showing the visitor the\n * same link twice. `inlinePartsToMarkdown` is what keeps the link inline, and\n * the prose path deliberately harvests no `relatedLinks` at all.\n */\nexport class CalloutSectionDefinition\n implements SectionDefinition<CalloutSectionComponent>\n{\n sectionType = 'callout' as const;\n patterns = [\n // Descriptor-led prose. `link` must be in the alternation or a callout\n // carrying an ask link fails to match and falls through to the fallback.\n 'html_comment[section=\"callout\"] > (t | link)+',\n // Legacy blockquote.\n 'html_comment? > callout+',\n ];\n\n defaults: CalloutCompProps = {\n callouts: [{ text: 'This is a callout.' }],\n };\n\n fixtures: SectionFixture<CalloutCompProps>[] = [\n {\n markdown:\n '<!-- section:callout, semantic:tip -->\\nThis is a callout paragraph.',\n expected: {\n callouts: [{ text: 'This is a callout paragraph.', kind: 'TIP' }],\n },\n },\n {\n markdown: '> This is a callout blockquote.',\n expected: {\n callouts: [{ text: 'This is a callout blockquote.' }],\n },\n },\n ];\n\n parse(parts: Part[]): CalloutCompProps | null | DropSection {\n const calloutParts = getPartsByType<Part>(parts, 'callout');\n\n return calloutParts.length > 0\n ? this.parseBlockquote(calloutParts, parts)\n : this.parseProse(parts);\n }\n\n /**\n * Descriptor + plain prose. The kind comes from the descriptor's `semantic`,\n * and every link in the body is inline prose — never a `relatedLinks` footer.\n */\n private parseProse(parts: Part[]): CalloutCompProps | null | DropSection {\n const descriptor = parts.find((p) => p.type === 'htmlComment' && p.meta)\n ?.meta as Record<string, string> | undefined;\n\n // The pattern already gates on this; re-checking keeps a direct\n // `parse()` call (and any future pattern edit) from mislabelling a\n // different section's prose as a callout.\n if (descriptor?.section !== 'callout') {\n return null;\n }\n\n const text = inlinePartsToMarkdown(\n parts.filter((p) => p.type !== 'htmlComment'),\n ).trim();\n\n // Matched, but there is nothing to say. DROP_SECTION consumes the nodes\n // and renders nothing; returning null would hand the descriptor to the\n // fallback, which renders it as stray text.\n if (!text) {\n return DROP_SECTION;\n }\n\n return {\n callouts: [{ text, ...(semanticToKind(descriptor.semantic) ?? {}) }],\n };\n }\n\n /** Legacy GFM alert blockquote. */\n private parseBlockquote(\n calloutParts: Part[],\n parts: Part[],\n ): CalloutCompProps | null | DropSection {\n const callouts: Callout[] = [];\n const relatedLinks: { text: string; url: string }[] = [];\n const seenUrls = new Set<string>();\n\n for (const c of calloutParts) {\n const text = (c.meta?.markdown as string)?.trim() || c.content?.trim();\n if (text) {\n const parsed = parseCalloutTag(text);\n if (parsed.text) {\n callouts.push({ text: parsed.text, kind: parsed.kind });\n }\n }\n }\n\n if (callouts.length === 0) {\n return DROP_SECTION;\n }\n\n // A blockquote yields no sibling link parts, so anything found here arrived\n // alongside the quote and is a genuine footer link.\n for (const link of getLinks(parts)) {\n const href = link.meta?.href;\n const text = link.content?.trim();\n if (text && href && !seenUrls.has(href)) {\n seenUrls.add(href);\n relatedLinks.push({ text, url: href });\n }\n }\n\n return {\n callouts,\n relatedLinks: relatedLinks.length > 0 ? relatedLinks : undefined,\n };\n }\n}\n\n/**\n * `semantic:tip` → `{ kind: 'TIP' }`. Uppercased so the new form lands on the\n * same vocabulary the legacy `[!TIP]` marker produced, which is what any\n * kind-aware renderer already switches on. An unrecognised value carries no\n * kind rather than an invented one.\n */\nfunction semanticToKind(semantic?: string): { kind: string } | undefined {\n const value = semantic?.trim().toLowerCase();\n if (!value) {\n return undefined;\n }\n return (CALLOUT_SEMANTICS as readonly string[]).includes(value)\n ? { kind: value.toUpperCase() }\n : undefined;\n}\n"],"mappings":";AAAA,SAASA,qBAAqB,EAAEC,eAAe,QAAQ,eAAe;AACtE,SAASC,cAAc,EAAEC,QAAQ,QAAmB,mBAAmB;AACvE,SAASC,iBAAiB,QAAsB,qBAAqB;AAMrE,SACEC,YAAY,QAGP,uBAAuB;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,CAErC;EAAAC,YAAA;IAAAC,eAAA,sBACgB,SAAS;IAAAA,eAAA,mBACZ;IACT;IACA;IACA,+CAA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C,aAAA,GAAGF,IAAI,CAACH,OAAO,qBAAZK,aAAA,CAAcd,IAAI,CAAC,CAAC;MACjC,IAAIlB,IAAI,IAAIiC,IAAI,IAAI,CAACX,QAAQ,CAACY,GAAG,CAACD,IAAI,CAAC,EAAE;QACvCX,QAAQ,CAACa,GAAG,CAACF,IAAI,CAAC;QAClBZ,YAAY,CAACQ,IAAI,CAAC;UAAE7B,IAAI;UAAEoC,GAAG,EAAEH;QAAK,CAAC,CAAC;MACxC;IACF;IAEA,OAAO;MACLlC,QAAQ;MACRsB,YAAY,EAAEA,YAAY,CAACd,MAAM,GAAG,CAAC,GAAGc,YAAY,GAAGgB;IACzD,CAAC;EACH;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASlB,cAAcA,CAACC,QAAiB,EAAgC;EACvE,MAAMkB,KAAK,GAAGlB,QAAQ,oBAARA,QAAQ,CAAEF,IAAI,CAAC,CAAC,CAACqB,WAAW,CAAC,CAAC;EAC5C,IAAI,CAACD,KAAK,EAAE;IACV,OAAOD,SAAS;EAClB;EACA,OAAQ3C,iBAAiB,CAAuB8C,QAAQ,CAACF,KAAK,CAAC,GAC3D;IAAEnC,IAAI,EAAEmC,KAAK,CAACG,WAAW,CAAC;EAAE,CAAC,GAC7BJ,SAAS;AACf","ignoreList":[]}
|
|
@@ -46,13 +46,19 @@ export function createSdkRegistry() {
|
|
|
46
46
|
// Collection entities are claimed by their own definition first — it is a
|
|
47
47
|
// strictly narrower match than EntitySectionDefinition, which would
|
|
48
48
|
// otherwise swallow collection, product and article blocks alike.
|
|
49
|
-
.register(new EntityCollectionSectionDefinition()).register(new EntitySectionDefinition()).register(new HeroEntitySectionDefinition()).register(new HeroSectionDefinition()).register(new FeatureCardsSectionDefinition()).register(new ListItemsSectionDefinition()).register(new FeatureSection9PlusDefinition()).register(new ComparisonSectionDefinition())
|
|
49
|
+
.register(new EntityCollectionSectionDefinition()).register(new EntitySectionDefinition()).register(new HeroEntitySectionDefinition()).register(new HeroSectionDefinition()).register(new FeatureCardsSectionDefinition()).register(new ListItemsSectionDefinition()).register(new FeatureSection9PlusDefinition()).register(new ComparisonSectionDefinition())
|
|
50
|
+
// Callout sits above HtmlComment: a callout block opens with its own
|
|
51
|
+
// `<!-- section:callout -->` descriptor, and HtmlComment's bare
|
|
52
|
+
// `html_comment` pattern would match that comment alone. A pattern may
|
|
53
|
+
// match a PREFIX of a block, so HtmlComment would claim the descriptor
|
|
54
|
+
// and strand the prose below it in the fallback, unstyled.
|
|
55
|
+
.register(new CalloutSectionDefinition()).register(new HtmlCommentSectionDefinition()).register(new CtaBannerSectionDefinition())
|
|
50
56
|
// textBlock comes after every definition whose block opens `h2 > t`
|
|
51
57
|
// (entity, listItems, featureCards, ctaBanner, comparison, …). Its
|
|
52
58
|
// trailing callout is optional, so its pattern also matches a bare
|
|
53
59
|
// `h2 > t`, and a pattern matches a PREFIX of the block — registered
|
|
54
60
|
// above those it would claim the heading + intro paragraph and strand
|
|
55
61
|
// the list / links / table that follow in a separate section.
|
|
56
|
-
.register(new TextBlockSectionDefinition()).register(new
|
|
62
|
+
.register(new TextBlockSectionDefinition()).register(new FallbackSectionDefinition()).register(new ErrorSectionDefinition());
|
|
57
63
|
}
|
|
58
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComparisonSectionDefinition","TextBlockSectionDefinition","HeroSectionDefinition","HeroEntitySectionDefinition","KpiSectionDefinition","FeatureCardsSectionDefinition","EntitySectionDefinition","EntityCollectionSectionDefinition","CtaBannerSectionDefinition","CalloutSectionDefinition","NextStepsSectionDefinition","FeatureSection9PlusDefinition","ListItemsSectionDefinition","SkipNodesSectionDefinition","HtmlCommentSectionDefinition","SearchSectionDefinition","ErrorSectionDefinition","FallbackSectionDefinition","ComponentRegistry","createSdkRegistry","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
|
|
1
|
+
{"version":3,"names":["ComparisonSectionDefinition","TextBlockSectionDefinition","HeroSectionDefinition","HeroEntitySectionDefinition","KpiSectionDefinition","FeatureCardsSectionDefinition","EntitySectionDefinition","EntityCollectionSectionDefinition","CtaBannerSectionDefinition","CalloutSectionDefinition","NextStepsSectionDefinition","FeatureSection9PlusDefinition","ListItemsSectionDefinition","SkipNodesSectionDefinition","HtmlCommentSectionDefinition","SearchSectionDefinition","ErrorSectionDefinition","FallbackSectionDefinition","ComponentRegistry","createSdkRegistry","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 // Callout sits above HtmlComment: a callout block opens with its own\n // `<!-- section:callout -->` descriptor, and HtmlComment's bare\n // `html_comment` pattern would match that comment alone. A pattern may\n // match a PREFIX of a block, so HtmlComment would claim the descriptor\n // and strand the prose below it in the fallback, unstyled.\n .register(new CalloutSectionDefinition())\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 FallbackSectionDefinition())\n .register(new ErrorSectionDefinition())\n );\n}\n"],"mappings":"AACA,SAASA,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,iCAAiC,QAAQ,qCAAqC;AACvF,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASC,4BAA4B,QAAQ,gCAAgC;AAC7E,SAASC,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,SAASC,iBAAiB,QAAQ,gBAAgB;AAClD,SAASL,0BAA0B,QAAQ,8BAA8B;AACzE,SAASE,uBAAuB,QAAQ,2BAA2B;AACnE,SAASX,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASM,0BAA0B,QAAQ,8BAA8B;AACzE,SAASJ,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,iCAAiC,QAAQ,qCAAqC;AACvF,SAASJ,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASD,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASG,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASM,6BAA6B,QAAQ,iCAAiC;AAC/E,SAASC,0BAA0B,QAAQ,8BAA8B;AACzE,SAASZ,2BA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;EACA;EACA;EACA;EACA;EAAA,CACCY,QAAQ,CAAC,IAAInB,0BAA0B,CAAC,CAAC,CAAC,CAC1CmB,QAAQ,CAAC,IAAIH,yBAAyB,CAAC,CAAC,CAAC,CACzCG,QAAQ,CAAC,IAAIJ,sBAAsB,CAAC,CAAC,CAAC;AAE7C","ignoreList":[]}
|
|
@@ -220,23 +220,31 @@ function appendInlineToken(current, token) {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
* Serialize a run of inline parts back to markdown, preserving links
|
|
223
|
+
* Serialize a run of inline parts back to markdown, preserving links and
|
|
224
|
+
* inline emphasis.
|
|
224
225
|
*
|
|
225
226
|
* Concatenating `part.content` alone silently deletes links: a `link` part
|
|
226
227
|
* keeps its label in `content` and its url in `meta.href`, so a filter that
|
|
227
228
|
* reads only text parts turns `Read the [pricing page](/pricing) first` into
|
|
228
229
|
* `Read the first` — url and label both vanish, with nothing in the output to
|
|
229
230
|
* show anything was lost.
|
|
231
|
+
*
|
|
232
|
+
* `content` is also the *plain* text of a text part — `nodesToParts` strips
|
|
233
|
+
* inline formatting and keeps the original in `meta.markdown` whenever the two
|
|
234
|
+
* differ. Reading `content` therefore drops emphasis the same way it used to
|
|
235
|
+
* drop links: `The **4 oz size** is best` becomes `The 4 oz size is best`.
|
|
236
|
+
* Prefer `meta.markdown`, which is exactly the segment's own markdown.
|
|
230
237
|
*/
|
|
231
238
|
export function inlinePartsToMarkdown(parts) {
|
|
232
239
|
return parts.reduce((text, part) => {
|
|
240
|
+
var _part$meta;
|
|
233
241
|
if (part.type === 'link') {
|
|
234
242
|
var _meta2, _part$content;
|
|
235
243
|
const href = ((_meta2 = part.meta) == null ? void 0 : _meta2.href) ?? '';
|
|
236
244
|
const label = ((_part$content = part.content) == null ? void 0 : _part$content.trim()) ?? '';
|
|
237
245
|
return appendInlineToken(text, href ? `[${label}](${href})` : label);
|
|
238
246
|
}
|
|
239
|
-
return appendInlineToken(text, part.content ?? '');
|
|
247
|
+
return appendInlineToken(text, ((_part$meta = part.meta) == null ? void 0 : _part$meta.markdown) ?? part.content ?? '');
|
|
240
248
|
}, '');
|
|
241
249
|
}
|
|
242
250
|
export function extractListItemText(item) {
|
|
@@ -260,14 +268,14 @@ export function extractListItemText(item) {
|
|
|
260
268
|
*/
|
|
261
269
|
export function partsToMarkdown(sectionParts) {
|
|
262
270
|
const inline = part => {
|
|
263
|
-
var _part$
|
|
264
|
-
return ((_part$
|
|
271
|
+
var _part$meta2;
|
|
272
|
+
return ((_part$meta2 = part.meta) == null ? void 0 : _part$meta2.markdown) ?? part.content;
|
|
265
273
|
};
|
|
266
274
|
const lines = [];
|
|
267
275
|
for (const part of sectionParts) {
|
|
268
276
|
if (part.type === 'heading') {
|
|
269
|
-
var _part$
|
|
270
|
-
const level = ((_part$
|
|
277
|
+
var _part$meta3;
|
|
278
|
+
const level = ((_part$meta3 = part.meta) == null ? void 0 : _part$meta3.level) ?? 2;
|
|
271
279
|
lines.push(`${'#'.repeat(level)} ${inline(part)}`);
|
|
272
280
|
} else if (part.type === 'text' || part.type === 'richText') {
|
|
273
281
|
lines.push(inline(part));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getPartsByType","getHeading","getImages","getLinks","parseWeb5Url","Web5UrlType","isWeb5EntityUrl","str","p","_p$content","content","trim","markdownOrText","_p$meta","meta","markdown","normalizeEntityDescription","description","replace","stripMarkdown","md","headingText","parts","level","heading","headingMarkdown","_meta$markdown","bodyText","textParts","richTextParts","map","filter","Boolean","join","entitySectionBodyText","firstEntityLinkIndex","findIndex","_meta","type","isEntityHref","href","sectionParts","slice","linksToHeroButtons","links","length","lists","flatMap","l","_l$meta","items","item","_item$meta","i","_l$content","id","text","variant","onClick","firstImageSrc","_img$meta","images","img","src","undefined","firstLink","_link$content","link","blockquoteText","bqs","_p$meta2","calloutFromParts","_p$meta3","calloutParts","raw","parsed","parseCalloutTag","kind","listToMarkdown","lines","list","_list$meta","extractListItemText","push","parseEntityUrl","url","trimmedUrl","ENTITY","entityType","entityId","parseTableValue","value","normalized","toLowerCase","parseKpiItem","trimmed","boldMatch","match","title","afterBold","indexOf","appendInlineToken","current","token","test","inlinePartsToMarkdown","reduce","part","_meta2","_part$content","label","_item$meta2","partsToMarkdown","inline","_part$meta","_part$meta2","repeat","_list$meta2","_item$meta3","toUpperCase","generatePartId","Math","random","toString","extractNestedListItems","itemParts","nestedLists","features","nested","_list$meta3","extractEntityRefs","entities","_list$meta4","_item$meta4","entityLinks","_meta3","_link$content2","_images$","_p$content2","callout","_calloutParts$0$meta","parsed2","linkText","entityUrl","markdownImageUrl","markdownFeatures","topLinks","_l$meta2","some","e","_link$content3","linkIndex","j","_meta4","_p$content3","_meta5","_p$meta4","parsedCallout","_meta6"],"sources":["../../../../src/component/componentDefinitions/parse-utils.ts"],"sourcesContent":["import type {\n Part,\n ListPart,\n LinkPart,\n ListItemPart,\n ImagePart,\n} from '../../parts/parts';\nimport {\n getPartsByType,\n getHeading,\n getImages,\n getLinks,\n} from '../../parts/parts';\nimport { parseWeb5Url } from '../../utils/entityLinkParser';\nimport { Web5UrlType, isWeb5EntityUrl } from '../../types/link-types';\nimport type { Callout } from '../../types/callout';\nimport type { HeroButton } from '../types';\n\nfunction str(p: Part | undefined): string {\n return p?.content?.trim() ?? '';\n}\n\nfunction markdownOrText(p: Part): string {\n return ((p.meta?.markdown as string)?.trim() || str(p)).trim();\n}\n\nfunction normalizeEntityDescription(description: string): string {\n return description\n .replace(/^[\\s\\u2013\\u2014-]+/, '')\n .replace(/^[:\\s]+/, '')\n .trim();\n}\n\n/** Strip basic markdown formatting to get plain text */\nexport function stripMarkdown(md: string): string {\n return md\n .replace(/\\*\\*(.+?)\\*\\*/g, '$1')\n .replace(/__(.+?)__/g, '$1')\n .replace(/\\*(.+?)\\*/g, '$1')\n .replace(/_(.+?)_/g, '$1')\n .replace(/~~(.+?)~~/g, '$1')\n .replace(/`(.+?)`/g, '$1')\n .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, '$1')\n .trim();\n}\n\nexport function headingText(parts: Part[], level?: number): string {\n const heading = getHeading(parts, level);\n return str(heading);\n}\n\n/** Like headingText but preserves inline markdown formatting (bold, italic, etc.) */\nexport function headingMarkdown(parts: Part[], level?: number): string {\n const heading = getHeading(parts, level);\n if (!heading) {\n return '';\n }\n const meta = heading.meta as Record<string, unknown>;\n return (meta?.markdown as string)?.trim() || str(heading);\n}\n\nexport function bodyText(parts: Part[]): string {\n const textParts = getPartsByType<Part>(parts, 'text');\n const richTextParts = getPartsByType<Part>(parts, 'richText');\n return [...textParts, ...richTextParts]\n .map(markdownOrText)\n .filter(Boolean)\n .join('\\n\\n');\n}\n\n/**\n * Entity sections may be authored as one paragraph per entity:\n * `[Product](web5://entity/...) - why it matches`.\n * In that shape, text after the first entity link is item copy rather than\n * section copy, so only keep prose that appears before the first entity link.\n */\nexport function entitySectionBodyText(parts: Part[]): string {\n const firstEntityLinkIndex = parts.findIndex(\n (p) => p.type === 'link' && isEntityHref((p as LinkPart).meta?.href),\n );\n const sectionParts =\n firstEntityLinkIndex >= 0 ? parts.slice(0, firstEntityLinkIndex) : parts;\n\n return sectionParts\n .filter((p) => p.type === 'text' || p.type === 'richText')\n .map(markdownOrText)\n .filter(Boolean)\n .join('\\n\\n');\n}\n\n/** Build HeroButton[] from link parts — aligned to HeroSection1Button shape */\nexport function linksToHeroButtons(parts: Part[]): HeroButton[] {\n let links = getLinks(parts);\n if (!links.length) {\n const lists = getPartsByType<ListPart>(parts, 'list');\n links = lists.flatMap((l) =>\n (l.meta?.items ?? []).flatMap((item) =>\n ((item.meta?.parts ?? []) as Part[]).filter(\n (p): p is LinkPart => p.type === 'link',\n ),\n ),\n );\n }\n return links.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}\n\n/** Return just the src URL string of the first image part */\nexport function firstImageSrc(parts: Part[]): string | undefined {\n const images = getImages(parts);\n const img = images[0];\n return img?.meta?.src || undefined;\n}\n\n/** Return the first link as { text, href } */\nexport function firstLink(\n parts: Part[],\n): { text: string; href: string } | undefined {\n const links = getLinks(parts);\n const link = links[0];\n if (!link) {\n return undefined;\n }\n return { text: link.content?.trim() || '', href: link.meta.href };\n}\n\n/** Extract text content from blockquote parts, preserving markdown formatting when available */\nexport function blockquoteText(parts: Part[]): string | undefined {\n const bqs = getPartsByType<Part>(parts, 'blockquote');\n if (bqs.length === 0) {\n return undefined;\n }\n const text = bqs\n .map((p) => (p.meta?.markdown as string)?.trim() || str(p))\n .filter(Boolean)\n .join('\\n');\n return text || undefined;\n}\n\n/** Extract first callout from parts as a Callout object */\nexport function calloutFromParts(parts: Part[]): Callout | undefined {\n const calloutParts = getPartsByType<Part>(parts, 'callout');\n if (calloutParts.length === 0) {\n return undefined;\n }\n const p = calloutParts[0];\n const raw = (p.meta?.markdown as string)?.trim() || str(p);\n const parsed = parseCalloutTag(raw);\n return parsed.text ? { text: parsed.text, kind: parsed.kind } : undefined;\n}\n\n/** Convert list parts to a markdown-like string */\nexport function listToMarkdown(parts: Part[]): string | undefined {\n const lists = getPartsByType<ListPart>(parts, 'list');\n if (lists.length === 0) {\n return undefined;\n }\n const lines: string[] = [];\n for (const list of lists) {\n const items = list.meta?.items ?? [];\n for (const item of items) {\n const text = extractListItemText(item);\n if (text) {\n lines.push(`- ${text}`);\n }\n }\n }\n return lines.length > 0 ? lines.join('\\n') : undefined;\n}\n\n/**\n * Parse a web5://entity/ URL into entityType and entityId.\n * Delegates to the central `parseWeb5Url` parser.\n */\nexport function parseEntityUrl(\n url: string,\n): { entityType: string; entityId: string } | null {\n const trimmedUrl = url?.trim();\n if (!trimmedUrl || !isWeb5EntityUrl(trimmedUrl)) {\n return null;\n }\n const parsed = parseWeb5Url(trimmedUrl);\n if (\n parsed?.type !== Web5UrlType.ENTITY ||\n !parsed.entityType ||\n !parsed.entityId\n ) {\n return null;\n }\n return { entityType: parsed.entityType, entityId: parsed.entityId };\n}\n\n/**\n * Parse a table cell value into boolean or string.\n * Ported from web50-server-ui comparisonSectionParser.tsx.\n */\nexport function parseTableValue(value: string): boolean | string {\n const normalized = value.trim().toLowerCase();\n\n if (\n normalized === 'true' ||\n normalized === 'yes' ||\n normalized === '✓' ||\n normalized === 'check' ||\n normalized === 'y'\n ) {\n return true;\n }\n if (\n normalized === 'false' ||\n normalized === 'no' ||\n normalized === '✗' ||\n normalized === 'x' ||\n normalized === 'n' ||\n normalized === ''\n ) {\n return false;\n }\n\n return value.trim();\n}\n\n/**\n * Parse a KPI item from markdown text.\n * The first **bold** segment becomes the title; everything after it (leading \":\" stripped) is the description.\n */\nexport function parseKpiItem(\n markdown: string,\n): { title: string; description: string } | null {\n const trimmed = markdown.trim();\n if (!trimmed) {\n return null;\n }\n const boldMatch = trimmed.match(/\\*\\*(.+?)\\*\\*/);\n if (!boldMatch) {\n return null;\n }\n const title = boldMatch[1].trim();\n const afterBold = trimmed.slice(\n trimmed.indexOf(boldMatch[0]) + boldMatch[0].length,\n );\n const description = afterBold.replace(/^[:\\s]+/, '').trim();\n return { title, description };\n}\n\n/** Join inline tokens the way prose reads: single spaces, none before punctuation. */\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\n/**\n * Serialize a run of inline parts back to markdown, preserving links.\n *\n * Concatenating `part.content` alone silently deletes links: a `link` part\n * keeps its label in `content` and its url in `meta.href`, so a filter that\n * reads only text parts turns `Read the [pricing page](/pricing) first` into\n * `Read the first` — url and label both vanish, with nothing in the output to\n * show anything was lost.\n */\nexport function inlinePartsToMarkdown(parts: Part[]): string {\n return parts.reduce((text, part) => {\n if (part.type === 'link') {\n const href = (part as LinkPart).meta?.href ?? '';\n const label = part.content?.trim() ?? '';\n return appendInlineToken(text, href ? `[${label}](${href})` : label);\n }\n return appendInlineToken(text, part.content ?? '');\n }, '');\n}\n\nexport function extractListItemText(item: ListItemPart): string {\n if (item.content) {\n return item.content;\n }\n if (item.meta?.parts) {\n return (item.meta.parts as Part[])\n .map((p) => p.content)\n .filter(Boolean)\n .join(' ');\n }\n return '';\n}\n\n/**\n * Reconstruct markdown-like content from parts.\n *\n * `part.content` is the *plain* text — `nodesToParts` strips inline\n * formatting and preserves the original markdown (bold, italic, links) in\n * `part.meta.markdown` when they differ. Prefer it so markdown-rendering\n * consumers (e.g. the fallback section's ReactMarkdown) keep `**bold**`.\n */\nexport function partsToMarkdown(sectionParts: Part[]): string {\n const inline = (part: Part): string =>\n (part.meta?.markdown as string | undefined) ?? part.content;\n const lines: string[] = [];\n for (const part of sectionParts) {\n if (part.type === 'heading') {\n const level = (part.meta as { level: number })?.level ?? 2;\n lines.push(`${'#'.repeat(level)} ${inline(part)}`);\n } else if (part.type === 'text' || part.type === 'richText') {\n lines.push(inline(part));\n } else if (part.type === 'list') {\n const list = part as ListPart;\n for (const item of list.meta?.items ?? []) {\n lines.push(\n `- ${(item.meta?.markdown as string | undefined) ?? extractListItemText(item)}`,\n );\n }\n } else if (part.type === 'blockquote' || part.type === 'callout') {\n lines.push(`> ${inline(part)}`);\n }\n }\n return lines.join('\\n\\n');\n}\n\n/**\n * Extract callout kind tag from blockquote text.\n * Handles [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] GFM syntax.\n */\nexport function parseCalloutTag(text: string): { text: string; kind?: string } {\n const match = text.match(/^\\[!(\\w+)\\]\\s*(.*)/s);\n if (match) {\n return { kind: match[1].toUpperCase(), text: match[2].trim() };\n }\n return { text: text.trim() };\n}\n\n/** Generate a simple unique ID */\nexport function generatePartId(): string {\n return Math.random().toString(36).slice(2, 10);\n}\n\nfunction isEntityHref(href: string | undefined): boolean {\n return !!href && isWeb5EntityUrl(href);\n}\n\nexport interface EntityRef {\n entityId: string;\n entityType: string;\n linkText: string;\n entityUrl: string;\n description: string;\n markdownImageUrl?: string;\n markdownFeatures?: string[];\n callout?: Callout;\n}\n\n/**\n * Extract text from nested list items within a list item's parts.\n */\nfunction extractNestedListItems(itemParts: Part[]): string[] {\n const nestedLists = itemParts.filter((p): p is ListPart => p.type === 'list');\n const features: string[] = [];\n for (const list of nestedLists) {\n for (const nested of list.meta?.items ?? []) {\n const text = extractListItemText(nested);\n if (text) {\n features.push(text);\n }\n }\n }\n return features;\n}\n\n/**\n * Extract entity references from list items containing web5://entity/ links.\n * Also extracts markdownFeatures from nested list items within each entity item.\n */\nexport function extractEntityRefs(parts: Part[]): EntityRef[] {\n const entities: EntityRef[] = [];\n const lists = getPartsByType<ListPart>(parts, 'list');\n\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const entityLinks = itemParts.filter(\n (p): p is LinkPart =>\n p.type === 'link' && isEntityHref((p as LinkPart).meta?.href),\n );\n\n for (const link of entityLinks) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed) {\n const images = itemParts.filter(\n (p): p is ImagePart => p.type === 'image',\n );\n const textParts = itemParts.filter(\n (p) => p.type === 'text' && p.content?.trim(),\n );\n const description = normalizeEntityDescription(\n textParts.map(markdownOrText).join(' '),\n );\n const features = extractNestedListItems(itemParts);\n const calloutParts = itemParts.filter(\n (p) => p.type === 'callout' || p.type === 'blockquote',\n );\n let callout: Callout | undefined;\n if (calloutParts.length > 0) {\n const raw =\n (calloutParts[0].meta?.markdown as string)?.trim() ||\n str(calloutParts[0]);\n const parsed2 = parseCalloutTag(raw);\n if (parsed2.text) {\n callout = { text: parsed2.text, kind: parsed2.kind };\n }\n }\n entities.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n linkText: link.content?.trim() || '',\n entityUrl: link.meta.href,\n description,\n markdownImageUrl: images[0]?.meta?.src,\n markdownFeatures: features.length > 0 ? features : undefined,\n callout,\n });\n }\n }\n }\n }\n\n // Also check top-level links (with surrounding context for description/image/list)\n const topLinks = getLinks(parts).filter((l) => isEntityHref(l.meta?.href));\n for (const link of topLinks) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed && !entities.some((e) => e.entityId === parsed.entityId)) {\n // Look for description text and image after this link in the parts array\n const linkIndex = parts.indexOf(link);\n let description = '';\n let markdownImageUrl: string | undefined;\n let callout: Callout | undefined;\n const features: string[] = [];\n\n if (linkIndex >= 0) {\n // Scan following parts for description, image, callout, and list items\n for (let j = linkIndex + 1; j < parts.length; j++) {\n const p = parts[j];\n // Stop at next entity link\n if (p.type === 'link' && isEntityHref((p as LinkPart).meta?.href)) {\n break;\n }\n if (p.type === 'text' && p.content?.trim()) {\n const text = markdownOrText(p);\n description = description\n ? `${description} ${text}`\n : text;\n } else if (p.type === 'image' && !markdownImageUrl) {\n markdownImageUrl = (p as ImagePart).meta?.src;\n } else if (\n (p.type === 'callout' || p.type === 'blockquote') &&\n !callout\n ) {\n const raw = (p.meta?.markdown as string)?.trim() || str(p);\n const parsedCallout = parseCalloutTag(raw);\n if (parsedCallout.text) {\n callout = { text: parsedCallout.text, kind: parsedCallout.kind };\n }\n } else if (p.type === 'list') {\n for (const item of (p as ListPart).meta?.items ?? []) {\n const text = extractListItemText(item);\n if (text) {\n features.push(text);\n }\n }\n }\n }\n }\n\n entities.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n linkText: link.content?.trim() || '',\n entityUrl: link.meta.href,\n description: normalizeEntityDescription(description),\n markdownImageUrl,\n markdownFeatures: features.length > 0 ? features : undefined,\n callout,\n });\n }\n }\n\n return entities;\n}\n"],"mappings":"AAOA,SACEA,cAAc,EACdC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,mBAAmB;AAC1B,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,WAAW,EAAEC,eAAe,QAAQ,wBAAwB;AAIrE,SAASC,GAAGA,CAACC,CAAmB,EAAU;EAAA,IAAAC,UAAA;EACxC,OAAO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sB5G,KAAK,KAAI,EAAE,EAAE;cAAA,IAAA4G,MAAA;cACpD,MAAMtG,IAAI,GAAG0B,mBAAmB,CAAC/B,IAAI,CAAC;cACtC,IAAIK,IAAI,EAAE;gBACRuE,QAAQ,CAAC5C,IAAI,CAAC3B,IAAI,CAAC;cACrB;YACF;UACF;QACF;MACF;MAEA2E,QAAQ,CAAChD,IAAI,CAAC;QACZM,QAAQ,EAAEd,MAAM,CAACc,QAAQ;QACzBD,UAAU,EAAEb,MAAM,CAACa,UAAU;QAC7BsD,QAAQ,EAAE,EAAAQ,cAAA,GAAAnF,IAAI,CAACzD,OAAO,qBAAZ4I,cAAA,CAAc3I,IAAI,CAAC,CAAC,KAAI,EAAE;QACpCoI,SAAS,EAAE5E,IAAI,CAACrD,IAAI,CAAC0B,IAAI;QACzBvB,WAAW,EAAED,0BAA0B,CAACC,WAAW,CAAC;QACpD+H,gBAAgB;QAChBC,gBAAgB,EAAElB,QAAQ,CAAClF,MAAM,GAAG,CAAC,GAAGkF,QAAQ,GAAG/D,SAAS;QAC5D2E;MACF,CAAC,CAAC;IACJ;EACF;EAEA,OAAOR,QAAQ;AACjB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["getPartsByType","getHeading","getImages","getLinks","parseWeb5Url","Web5UrlType","isWeb5EntityUrl","str","p","_p$content","content","trim","markdownOrText","_p$meta","meta","markdown","normalizeEntityDescription","description","replace","stripMarkdown","md","headingText","parts","level","heading","headingMarkdown","_meta$markdown","bodyText","textParts","richTextParts","map","filter","Boolean","join","entitySectionBodyText","firstEntityLinkIndex","findIndex","_meta","type","isEntityHref","href","sectionParts","slice","linksToHeroButtons","links","length","lists","flatMap","l","_l$meta","items","item","_item$meta","i","_l$content","id","text","variant","onClick","firstImageSrc","_img$meta","images","img","src","undefined","firstLink","_link$content","link","blockquoteText","bqs","_p$meta2","calloutFromParts","_p$meta3","calloutParts","raw","parsed","parseCalloutTag","kind","listToMarkdown","lines","list","_list$meta","extractListItemText","push","parseEntityUrl","url","trimmedUrl","ENTITY","entityType","entityId","parseTableValue","value","normalized","toLowerCase","parseKpiItem","trimmed","boldMatch","match","title","afterBold","indexOf","appendInlineToken","current","token","test","inlinePartsToMarkdown","reduce","part","_part$meta","_meta2","_part$content","label","_item$meta2","partsToMarkdown","inline","_part$meta2","_part$meta3","repeat","_list$meta2","_item$meta3","toUpperCase","generatePartId","Math","random","toString","extractNestedListItems","itemParts","nestedLists","features","nested","_list$meta3","extractEntityRefs","entities","_list$meta4","_item$meta4","entityLinks","_meta3","_link$content2","_images$","_p$content2","callout","_calloutParts$0$meta","parsed2","linkText","entityUrl","markdownImageUrl","markdownFeatures","topLinks","_l$meta2","some","e","_link$content3","linkIndex","j","_meta4","_p$content3","_meta5","_p$meta4","parsedCallout","_meta6"],"sources":["../../../../src/component/componentDefinitions/parse-utils.ts"],"sourcesContent":["import type {\n Part,\n ListPart,\n LinkPart,\n ListItemPart,\n ImagePart,\n} from '../../parts/parts';\nimport {\n getPartsByType,\n getHeading,\n getImages,\n getLinks,\n} from '../../parts/parts';\nimport { parseWeb5Url } from '../../utils/entityLinkParser';\nimport { Web5UrlType, isWeb5EntityUrl } from '../../types/link-types';\nimport type { Callout } from '../../types/callout';\nimport type { HeroButton } from '../types';\n\nfunction str(p: Part | undefined): string {\n return p?.content?.trim() ?? '';\n}\n\nfunction markdownOrText(p: Part): string {\n return ((p.meta?.markdown as string)?.trim() || str(p)).trim();\n}\n\nfunction normalizeEntityDescription(description: string): string {\n return description\n .replace(/^[\\s\\u2013\\u2014-]+/, '')\n .replace(/^[:\\s]+/, '')\n .trim();\n}\n\n/** Strip basic markdown formatting to get plain text */\nexport function stripMarkdown(md: string): string {\n return md\n .replace(/\\*\\*(.+?)\\*\\*/g, '$1')\n .replace(/__(.+?)__/g, '$1')\n .replace(/\\*(.+?)\\*/g, '$1')\n .replace(/_(.+?)_/g, '$1')\n .replace(/~~(.+?)~~/g, '$1')\n .replace(/`(.+?)`/g, '$1')\n .replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, '$1')\n .trim();\n}\n\nexport function headingText(parts: Part[], level?: number): string {\n const heading = getHeading(parts, level);\n return str(heading);\n}\n\n/** Like headingText but preserves inline markdown formatting (bold, italic, etc.) */\nexport function headingMarkdown(parts: Part[], level?: number): string {\n const heading = getHeading(parts, level);\n if (!heading) {\n return '';\n }\n const meta = heading.meta as Record<string, unknown>;\n return (meta?.markdown as string)?.trim() || str(heading);\n}\n\nexport function bodyText(parts: Part[]): string {\n const textParts = getPartsByType<Part>(parts, 'text');\n const richTextParts = getPartsByType<Part>(parts, 'richText');\n return [...textParts, ...richTextParts]\n .map(markdownOrText)\n .filter(Boolean)\n .join('\\n\\n');\n}\n\n/**\n * Entity sections may be authored as one paragraph per entity:\n * `[Product](web5://entity/...) - why it matches`.\n * In that shape, text after the first entity link is item copy rather than\n * section copy, so only keep prose that appears before the first entity link.\n */\nexport function entitySectionBodyText(parts: Part[]): string {\n const firstEntityLinkIndex = parts.findIndex(\n (p) => p.type === 'link' && isEntityHref((p as LinkPart).meta?.href),\n );\n const sectionParts =\n firstEntityLinkIndex >= 0 ? parts.slice(0, firstEntityLinkIndex) : parts;\n\n return sectionParts\n .filter((p) => p.type === 'text' || p.type === 'richText')\n .map(markdownOrText)\n .filter(Boolean)\n .join('\\n\\n');\n}\n\n/** Build HeroButton[] from link parts — aligned to HeroSection1Button shape */\nexport function linksToHeroButtons(parts: Part[]): HeroButton[] {\n let links = getLinks(parts);\n if (!links.length) {\n const lists = getPartsByType<ListPart>(parts, 'list');\n links = lists.flatMap((l) =>\n (l.meta?.items ?? []).flatMap((item) =>\n ((item.meta?.parts ?? []) as Part[]).filter(\n (p): p is LinkPart => p.type === 'link',\n ),\n ),\n );\n }\n return links.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}\n\n/** Return just the src URL string of the first image part */\nexport function firstImageSrc(parts: Part[]): string | undefined {\n const images = getImages(parts);\n const img = images[0];\n return img?.meta?.src || undefined;\n}\n\n/** Return the first link as { text, href } */\nexport function firstLink(\n parts: Part[],\n): { text: string; href: string } | undefined {\n const links = getLinks(parts);\n const link = links[0];\n if (!link) {\n return undefined;\n }\n return { text: link.content?.trim() || '', href: link.meta.href };\n}\n\n/** Extract text content from blockquote parts, preserving markdown formatting when available */\nexport function blockquoteText(parts: Part[]): string | undefined {\n const bqs = getPartsByType<Part>(parts, 'blockquote');\n if (bqs.length === 0) {\n return undefined;\n }\n const text = bqs\n .map((p) => (p.meta?.markdown as string)?.trim() || str(p))\n .filter(Boolean)\n .join('\\n');\n return text || undefined;\n}\n\n/** Extract first callout from parts as a Callout object */\nexport function calloutFromParts(parts: Part[]): Callout | undefined {\n const calloutParts = getPartsByType<Part>(parts, 'callout');\n if (calloutParts.length === 0) {\n return undefined;\n }\n const p = calloutParts[0];\n const raw = (p.meta?.markdown as string)?.trim() || str(p);\n const parsed = parseCalloutTag(raw);\n return parsed.text ? { text: parsed.text, kind: parsed.kind } : undefined;\n}\n\n/** Convert list parts to a markdown-like string */\nexport function listToMarkdown(parts: Part[]): string | undefined {\n const lists = getPartsByType<ListPart>(parts, 'list');\n if (lists.length === 0) {\n return undefined;\n }\n const lines: string[] = [];\n for (const list of lists) {\n const items = list.meta?.items ?? [];\n for (const item of items) {\n const text = extractListItemText(item);\n if (text) {\n lines.push(`- ${text}`);\n }\n }\n }\n return lines.length > 0 ? lines.join('\\n') : undefined;\n}\n\n/**\n * Parse a web5://entity/ URL into entityType and entityId.\n * Delegates to the central `parseWeb5Url` parser.\n */\nexport function parseEntityUrl(\n url: string,\n): { entityType: string; entityId: string } | null {\n const trimmedUrl = url?.trim();\n if (!trimmedUrl || !isWeb5EntityUrl(trimmedUrl)) {\n return null;\n }\n const parsed = parseWeb5Url(trimmedUrl);\n if (\n parsed?.type !== Web5UrlType.ENTITY ||\n !parsed.entityType ||\n !parsed.entityId\n ) {\n return null;\n }\n return { entityType: parsed.entityType, entityId: parsed.entityId };\n}\n\n/**\n * Parse a table cell value into boolean or string.\n * Ported from web50-server-ui comparisonSectionParser.tsx.\n */\nexport function parseTableValue(value: string): boolean | string {\n const normalized = value.trim().toLowerCase();\n\n if (\n normalized === 'true' ||\n normalized === 'yes' ||\n normalized === '✓' ||\n normalized === 'check' ||\n normalized === 'y'\n ) {\n return true;\n }\n if (\n normalized === 'false' ||\n normalized === 'no' ||\n normalized === '✗' ||\n normalized === 'x' ||\n normalized === 'n' ||\n normalized === ''\n ) {\n return false;\n }\n\n return value.trim();\n}\n\n/**\n * Parse a KPI item from markdown text.\n * The first **bold** segment becomes the title; everything after it (leading \":\" stripped) is the description.\n */\nexport function parseKpiItem(\n markdown: string,\n): { title: string; description: string } | null {\n const trimmed = markdown.trim();\n if (!trimmed) {\n return null;\n }\n const boldMatch = trimmed.match(/\\*\\*(.+?)\\*\\*/);\n if (!boldMatch) {\n return null;\n }\n const title = boldMatch[1].trim();\n const afterBold = trimmed.slice(\n trimmed.indexOf(boldMatch[0]) + boldMatch[0].length,\n );\n const description = afterBold.replace(/^[:\\s]+/, '').trim();\n return { title, description };\n}\n\n/** Join inline tokens the way prose reads: single spaces, none before punctuation. */\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\n/**\n * Serialize a run of inline parts back to markdown, preserving links and\n * inline emphasis.\n *\n * Concatenating `part.content` alone silently deletes links: a `link` part\n * keeps its label in `content` and its url in `meta.href`, so a filter that\n * reads only text parts turns `Read the [pricing page](/pricing) first` into\n * `Read the first` — url and label both vanish, with nothing in the output to\n * show anything was lost.\n *\n * `content` is also the *plain* text of a text part — `nodesToParts` strips\n * inline formatting and keeps the original in `meta.markdown` whenever the two\n * differ. Reading `content` therefore drops emphasis the same way it used to\n * drop links: `The **4 oz size** is best` becomes `The 4 oz size is best`.\n * Prefer `meta.markdown`, which is exactly the segment's own markdown.\n */\nexport function inlinePartsToMarkdown(parts: Part[]): string {\n return parts.reduce((text, part) => {\n if (part.type === 'link') {\n const href = (part as LinkPart).meta?.href ?? '';\n const label = part.content?.trim() ?? '';\n return appendInlineToken(text, href ? `[${label}](${href})` : label);\n }\n return appendInlineToken(\n text,\n (part.meta?.markdown as string | undefined) ?? part.content ?? '',\n );\n }, '');\n}\n\nexport function extractListItemText(item: ListItemPart): string {\n if (item.content) {\n return item.content;\n }\n if (item.meta?.parts) {\n return (item.meta.parts as Part[])\n .map((p) => p.content)\n .filter(Boolean)\n .join(' ');\n }\n return '';\n}\n\n/**\n * Reconstruct markdown-like content from parts.\n *\n * `part.content` is the *plain* text — `nodesToParts` strips inline\n * formatting and preserves the original markdown (bold, italic, links) in\n * `part.meta.markdown` when they differ. Prefer it so markdown-rendering\n * consumers (e.g. the fallback section's ReactMarkdown) keep `**bold**`.\n */\nexport function partsToMarkdown(sectionParts: Part[]): string {\n const inline = (part: Part): string =>\n (part.meta?.markdown as string | undefined) ?? part.content;\n const lines: string[] = [];\n for (const part of sectionParts) {\n if (part.type === 'heading') {\n const level = (part.meta as { level: number })?.level ?? 2;\n lines.push(`${'#'.repeat(level)} ${inline(part)}`);\n } else if (part.type === 'text' || part.type === 'richText') {\n lines.push(inline(part));\n } else if (part.type === 'list') {\n const list = part as ListPart;\n for (const item of list.meta?.items ?? []) {\n lines.push(\n `- ${(item.meta?.markdown as string | undefined) ?? extractListItemText(item)}`,\n );\n }\n } else if (part.type === 'blockquote' || part.type === 'callout') {\n lines.push(`> ${inline(part)}`);\n }\n }\n return lines.join('\\n\\n');\n}\n\n/**\n * Extract callout kind tag from blockquote text.\n * Handles [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] GFM syntax.\n */\nexport function parseCalloutTag(text: string): { text: string; kind?: string } {\n const match = text.match(/^\\[!(\\w+)\\]\\s*(.*)/s);\n if (match) {\n return { kind: match[1].toUpperCase(), text: match[2].trim() };\n }\n return { text: text.trim() };\n}\n\n/** Generate a simple unique ID */\nexport function generatePartId(): string {\n return Math.random().toString(36).slice(2, 10);\n}\n\nfunction isEntityHref(href: string | undefined): boolean {\n return !!href && isWeb5EntityUrl(href);\n}\n\nexport interface EntityRef {\n entityId: string;\n entityType: string;\n linkText: string;\n entityUrl: string;\n description: string;\n markdownImageUrl?: string;\n markdownFeatures?: string[];\n callout?: Callout;\n}\n\n/**\n * Extract text from nested list items within a list item's parts.\n */\nfunction extractNestedListItems(itemParts: Part[]): string[] {\n const nestedLists = itemParts.filter((p): p is ListPart => p.type === 'list');\n const features: string[] = [];\n for (const list of nestedLists) {\n for (const nested of list.meta?.items ?? []) {\n const text = extractListItemText(nested);\n if (text) {\n features.push(text);\n }\n }\n }\n return features;\n}\n\n/**\n * Extract entity references from list items containing web5://entity/ links.\n * Also extracts markdownFeatures from nested list items within each entity item.\n */\nexport function extractEntityRefs(parts: Part[]): EntityRef[] {\n const entities: EntityRef[] = [];\n const lists = getPartsByType<ListPart>(parts, 'list');\n\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const entityLinks = itemParts.filter(\n (p): p is LinkPart =>\n p.type === 'link' && isEntityHref((p as LinkPart).meta?.href),\n );\n\n for (const link of entityLinks) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed) {\n const images = itemParts.filter(\n (p): p is ImagePart => p.type === 'image',\n );\n const textParts = itemParts.filter(\n (p) => p.type === 'text' && p.content?.trim(),\n );\n const description = normalizeEntityDescription(\n textParts.map(markdownOrText).join(' '),\n );\n const features = extractNestedListItems(itemParts);\n const calloutParts = itemParts.filter(\n (p) => p.type === 'callout' || p.type === 'blockquote',\n );\n let callout: Callout | undefined;\n if (calloutParts.length > 0) {\n const raw =\n (calloutParts[0].meta?.markdown as string)?.trim() ||\n str(calloutParts[0]);\n const parsed2 = parseCalloutTag(raw);\n if (parsed2.text) {\n callout = { text: parsed2.text, kind: parsed2.kind };\n }\n }\n entities.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n linkText: link.content?.trim() || '',\n entityUrl: link.meta.href,\n description,\n markdownImageUrl: images[0]?.meta?.src,\n markdownFeatures: features.length > 0 ? features : undefined,\n callout,\n });\n }\n }\n }\n }\n\n // Also check top-level links (with surrounding context for description/image/list)\n const topLinks = getLinks(parts).filter((l) => isEntityHref(l.meta?.href));\n for (const link of topLinks) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed && !entities.some((e) => e.entityId === parsed.entityId)) {\n // Look for description text and image after this link in the parts array\n const linkIndex = parts.indexOf(link);\n let description = '';\n let markdownImageUrl: string | undefined;\n let callout: Callout | undefined;\n const features: string[] = [];\n\n if (linkIndex >= 0) {\n // Scan following parts for description, image, callout, and list items\n for (let j = linkIndex + 1; j < parts.length; j++) {\n const p = parts[j];\n // Stop at next entity link\n if (p.type === 'link' && isEntityHref((p as LinkPart).meta?.href)) {\n break;\n }\n if (p.type === 'text' && p.content?.trim()) {\n const text = markdownOrText(p);\n description = description\n ? `${description} ${text}`\n : text;\n } else if (p.type === 'image' && !markdownImageUrl) {\n markdownImageUrl = (p as ImagePart).meta?.src;\n } else if (\n (p.type === 'callout' || p.type === 'blockquote') &&\n !callout\n ) {\n const raw = (p.meta?.markdown as string)?.trim() || str(p);\n const parsedCallout = parseCalloutTag(raw);\n if (parsedCallout.text) {\n callout = { text: parsedCallout.text, kind: parsedCallout.kind };\n }\n } else if (p.type === 'list') {\n for (const item of (p as ListPart).meta?.items ?? []) {\n const text = extractListItemText(item);\n if (text) {\n features.push(text);\n }\n }\n }\n }\n }\n\n entities.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n linkText: link.content?.trim() || '',\n entityUrl: link.meta.href,\n description: normalizeEntityDescription(description),\n markdownImageUrl,\n markdownFeatures: features.length > 0 ? features : undefined,\n callout,\n });\n }\n }\n\n return entities;\n}\n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