@wix/web5-core 1.58.0 → 1.60.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.
- package/dist/cjs/client/applyThemeOverrides.js +89 -0
- package/dist/cjs/client/applyThemeOverrides.js.map +1 -0
- package/dist/cjs/client/clientBundleUrl.js +43 -0
- package/dist/cjs/client/clientBundleUrl.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js +33 -1
- package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js +9 -5
- package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js +5 -2
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js +4 -1
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js +35 -2
- package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js +27 -1
- package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/index.js +8 -1
- package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js +10 -5
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
- package/dist/cjs/component/componentDefinitions/parse-utils.js +45 -8
- package/dist/cjs/component/componentDefinitions/parse-utils.js.map +1 -1
- package/dist/cjs/component/componentParser.js +15 -0
- package/dist/cjs/component/componentParser.js.map +1 -1
- package/dist/cjs/component/section-definition.js +14 -0
- package/dist/cjs/component/section-definition.js.map +1 -1
- package/dist/cjs/component/types.js.map +1 -1
- package/dist/cjs/components/ui/MarkdownText.js +41 -42
- package/dist/cjs/components/ui/MarkdownText.js.map +1 -1
- package/dist/cjs/components/ui/UnifiedLink.js +22 -10
- package/dist/cjs/components/ui/UnifiedLink.js.map +1 -1
- package/dist/cjs/hostScope.js.map +1 -1
- package/dist/cjs/index.js +13 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/markdownPreprocessor.js +162 -8
- package/dist/cjs/utils/markdownPreprocessor.js.map +1 -1
- package/dist/esm/client/applyThemeOverrides.js +85 -0
- package/dist/esm/client/applyThemeOverrides.js.map +1 -0
- package/dist/esm/client/clientBundleUrl.js +39 -0
- package/dist/esm/client/clientBundleUrl.js.map +1 -1
- package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js +34 -1
- package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js +10 -6
- package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js +6 -3
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js +5 -2
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js +36 -3
- package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js +27 -1
- package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/index.js +8 -1
- package/dist/esm/component/componentDefinitions/index.js.map +1 -1
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js +11 -6
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -1
- package/dist/esm/component/componentDefinitions/parse-utils.js +44 -8
- package/dist/esm/component/componentDefinitions/parse-utils.js.map +1 -1
- package/dist/esm/component/componentParser.js +15 -0
- package/dist/esm/component/componentParser.js.map +1 -1
- package/dist/esm/component/section-definition.js +13 -1
- package/dist/esm/component/section-definition.js.map +1 -1
- package/dist/esm/component/types.js.map +1 -1
- package/dist/esm/components/ui/MarkdownText.js +8 -9
- package/dist/esm/components/ui/MarkdownText.js.map +1 -1
- package/dist/esm/components/ui/UnifiedLink.js +7 -1
- package/dist/esm/components/ui/UnifiedLink.js.map +1 -1
- package/dist/esm/hostScope.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/markdownPreprocessor.js +160 -8
- package/dist/esm/utils/markdownPreprocessor.js.map +1 -1
- package/dist/types/client/applyThemeOverrides.d.ts +19 -0
- package/dist/types/client/applyThemeOverrides.d.ts.map +1 -0
- package/dist/types/client/clientBundleUrl.d.ts +22 -0
- package/dist/types/client/clientBundleUrl.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts +2 -2
- package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/FeatureSection9PlusDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/HeroEntitySectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/HeroSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/NextStepsSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/TextBlockSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts.map +1 -1
- package/dist/types/component/componentDefinitions/parse-utils.d.ts +10 -0
- package/dist/types/component/componentDefinitions/parse-utils.d.ts.map +1 -1
- package/dist/types/component/componentParser.d.ts.map +1 -1
- package/dist/types/component/section-definition.d.ts +13 -1
- package/dist/types/component/section-definition.d.ts.map +1 -1
- package/dist/types/component/types.d.ts +7 -0
- package/dist/types/component/types.d.ts.map +1 -1
- package/dist/types/components/ui/MarkdownText.d.ts +13 -0
- package/dist/types/components/ui/MarkdownText.d.ts.map +1 -1
- package/dist/types/components/ui/UnifiedLink.d.ts +1 -1
- package/dist/types/components/ui/UnifiedLink.d.ts.map +1 -1
- package/dist/types/hostScope.d.ts +11 -0
- package/dist/types/hostScope.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/markdownPreprocessor.d.ts +30 -5
- package/dist/types/utils/markdownPreprocessor.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -19,6 +19,7 @@ var _markdownPreprocessor = require("../utils/markdownPreprocessor");
|
|
|
19
19
|
var _intentExtractor = require("../utils/intentExtractor");
|
|
20
20
|
var _contentKeywordMatcher = require("../utils/contentKeywordMatcher");
|
|
21
21
|
var _propsExtractor = require("../utils/propsExtractor");
|
|
22
|
+
var _sectionDefinition = require("./section-definition");
|
|
22
23
|
/**
|
|
23
24
|
* Markdown → component orchestrator. Lifted from
|
|
24
25
|
* `web50-server-ui/src/utils/componentParser.ts` per DL #088 B9.5.
|
|
@@ -329,6 +330,20 @@ function tryParseComponent(nodes, sectionIndex, context) {
|
|
|
329
330
|
} : undefined
|
|
330
331
|
};
|
|
331
332
|
let props = definition.parse(parts, parseContext);
|
|
333
|
+
|
|
334
|
+
// The definition claimed the block and then decided its content is not
|
|
335
|
+
// worth rendering. Consume the nodes and emit no component — returning
|
|
336
|
+
// `null` here instead would let the same heading and table fall through
|
|
337
|
+
// to the raw-markdown fallback, which is the outcome the drop exists to
|
|
338
|
+
// avoid.
|
|
339
|
+
if (props === _sectionDefinition.DROP_SECTION) {
|
|
340
|
+
if (trace) {
|
|
341
|
+
(0, _matchDebug.logMatchDebug)(` ${sectionType}: matched ${parsedNodes} node(s) but parse() dropped the section — rendering nothing`);
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
parsedCount: parsedNodes
|
|
345
|
+
};
|
|
346
|
+
}
|
|
332
347
|
if (props === null) {
|
|
333
348
|
if (trace) {
|
|
334
349
|
(0, _matchDebug.logMatchDebug)(` ${sectionType}: pattern matched ${parsedNodes} node(s) but parse() returned null — falling through`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_patternValidator","_astToParts","_linkTypes","_web5LinkValidator","_diagnosticTypes","_componentTracking","_matchDebug","_diagnosticsCollector","_unifiedMarkdownParser","_markdownPreprocessor","_intentExtractor","_contentKeywordMatcher","_propsExtractor","isEntityCompProps","props","Array","isArray","items","ENRICHABLE_ENTITY_SECTION_TYPES","Set","isItemsFromContentSection","sectionType","semantic","serverSectionId","has","normalizedSemantic","toLowerCase","replace","normalizedId","includes","mergeSectionsWithStableReferences","existingSections","newSections","length","merged","i","_existing$sourceMarkd","_updated$sourceMarkdo","existing","updated","push","existingLength","sourceMarkdown","updatedLength","component","componentOptions","debugProps","isSkeleton","newSectionsToAdd","slice","combineAdjacentGeneralTextSections","sections","registry","placement","placementId","combined","currentSection","sectionsToCombine","j","mergedSection","mergeGeneralTextSections","index","Error","mergedSourceMarkdown","map","section","filter","markdown","trim","join","mergedProps","FallbackComponent","resolveSection","mergedComponent","React","createElement","createPageSection","componentName","displayName","name","parseMarkdownToComponents","pageMarkdown","options","_clientConfig$feature","clientConfig","enrichEntityProps","clientId","intentInfo","providedIntent","payload","disableContextualImages","explicitDisableImages","preprocessedMarkdown","diagnostics","preprocessDiagnostics","preprocessMarkdown","knownIntents","getKnownIntents","getIntentFromMarkdown","validIntents","undefined","allNodes","parseMarkdownToAst","children","nodes","tracking","ComponentTracking","diagnosticsCollector","DiagnosticsCollector","d","report","diagnosticType","type","sectionIndex","details","original","normalized","features","disableContextualImagesEnrichment","context","intent","currentGlobalIndex","startIndex","parsedCount","tryParseComponent","parseAstToMarkdown","endIndex","addRange","splice","link","findInvalidWeb5Links","label","reason","DIAGNOSTIC_TYPES","LEGACY_PROTOCOL_LINK","INVALID_LINK_FORMAT","BROKEN_WEB5_LINK","nodeType","url","combinedSections","definitions","getAllDefinitions","allowedKeywords","allowedImageSearchKeywords","baseParseContext","getContextualImage","contentParts","result","getContextualImageFilename","isWeb5ImageUrl","filename","getComponentCount","setMeta","key","value","getMeta","trace","isMatchDebugEnabled","logMatchDebug","n","definition","isPlacementOnly","pattern","patterns","_parts$find","_context$intent","validatePattern","valid","error","parsedNodes","astEndIndex","maxNodes","maxConsumedNodes","matchedNodes","parts","nodesToParts","parseContext","reportDiagnostic","parse","leadingHtmlCommentMeta","find","p","meta","id","singleInstance","isNullComponent","nullComponent","Component","resolvedSectionOptions","resolveSectionOptions","patternValidation","astStartIndex"],"sources":["../../../src/component/componentParser.ts"],"sourcesContent":["/**\n * Markdown → component orchestrator. Lifted from\n * `web50-server-ui/src/utils/componentParser.ts` per DL #088 B9.5.\n *\n * The lift replaces three app-side singletons with options:\n * - `getAppRegistry()` → `options.registry`\n * - `getClientConfigSync(clientId)` → `options.clientConfig`\n * - `setLastDiagnosticsCollector(...)` → returned in the result object\n *\n * Adds a `placement` option that flows into every `registry.resolveSection`\n * call so the placement bundle can pick the placement variant of each section.\n *\n * The app-side `componentParser.ts` is a thin wrapper around this orchestrator\n * that pre-binds its singletons and a product-payload enrichment callback.\n */\nimport type { RootContent } from 'mdast';\nimport React from 'react';\n\nimport { validatePattern } from '../patternValidator';\nimport { nodesToParts } from '../match/astToParts';\nimport { isWeb5ImageUrl } from '../types/link-types';\nimport { findInvalidWeb5Links } from '../utils/web5LinkValidator';\nimport { DIAGNOSTIC_TYPES, type DiagnosticType } from './diagnosticTypes';\nimport { ComponentTracking } from '../utils/componentTracking';\nimport { isMatchDebugEnabled, logMatchDebug } from '../utils/matchDebug';\nimport { DiagnosticsCollector } from '../utils/diagnosticsCollector';\nimport {\n parseAstToMarkdown,\n parseMarkdownToAst,\n} from '../utils/unifiedMarkdownParser';\nimport { preprocessMarkdown } from '../utils/markdownPreprocessor';\nimport {\n getIntentFromMarkdown,\n type IntentInfo,\n} from '../utils/intentExtractor';\nimport { getContextualImageFilename } from '../utils/contentKeywordMatcher';\nimport { createPageSection } from '../utils/propsExtractor';\nimport type { PageSection } from '../types/page-section';\nimport type { ApiPayloadItem } from '../types/entity';\nimport type { ComponentRegistry } from '../registry';\nimport type { EntityCompProps, GeneralTextCompProps } from './types';\nimport type { SectionDefinition, ParseContext } from './section-definition';\nimport type {\n EnrichEntityProps,\n ParserClientConfig,\n ParserContext,\n} from './parser-types';\n\nexport type { ComponentMatch, ParserContext } from './parser-types';\n\nexport interface ParseMarkdownOptions {\n /** Required — replaces the app-side `getAppRegistry()` singleton. */\n registry: ComponentRegistry<React.FC<any>>;\n /** Replaces `getClientConfigSync(clientId)` — caller resolves it first. */\n clientConfig?: ParserClientConfig | null;\n /** When true, resolveSection prefers placement variants (DL #088 D3.1). */\n placement?: boolean;\n /**\n * Placement slot id (the `data-web5-placement` value) — forwarded to\n * `resolveSection` so a section can resolve a per-placement variant. Only\n * meaningful with `placement: true`.\n */\n placementId?: string;\n /** App-specific payload-to-entity enrichment; omitted by the placement bundle. */\n enrichEntityProps?: EnrichEntityProps;\n /** Reuse an existing collector (e.g. for streaming) instead of creating one. */\n diagnosticsCollector?: DiagnosticsCollector;\n clientId?: string;\n intentInfo?: IntentInfo | null;\n payload?: ApiPayloadItem[];\n disableContextualImages?: boolean;\n}\n\nexport interface ParseMarkdownResult {\n sections: PageSection[];\n tracking: ComponentTracking;\n diagnosticsCollector: DiagnosticsCollector;\n}\n\nfunction isEntityCompProps(props: unknown): props is EntityCompProps {\n return (\n typeof props === 'object' &&\n props !== null &&\n Array.isArray((props as EntityCompProps).items)\n );\n}\n\n/**\n * Section types whose props are `EntityCompProps` and therefore participate in\n * payload enrichment. `entityCollection` is `entity` narrowed to collection\n * links — it produces the same props and arrives under the same\n * `semantic: items` descriptor, so leaving it out would silently strip its\n * items of their catalog data (image, title) and render the section blank.\n */\nconst ENRICHABLE_ENTITY_SECTION_TYPES = new Set(['entity', 'entityCollection']);\n\nfunction isItemsFromContentSection(\n sectionType: string,\n semantic?: string,\n serverSectionId?: string,\n): boolean {\n if (!ENRICHABLE_ENTITY_SECTION_TYPES.has(sectionType)) {\n return false;\n }\n const normalizedSemantic = semantic?.toLowerCase().replace(/_/g, '-');\n const normalizedId = serverSectionId?.toLowerCase().replace(/_/g, '-');\n return (\n normalizedSemantic === 'items' ||\n normalizedSemantic === 'items-from-content' ||\n normalizedId?.includes('items-from-content') === true\n );\n}\n\n/**\n * Merges new sections with existing sections, maintaining stable references\n * for unchanged sections to prevent unnecessary rerenders.\n */\nexport function mergeSectionsWithStableReferences(\n existingSections: PageSection[],\n newSections: PageSection[],\n): PageSection[] {\n if (existingSections.length === 0) {\n return newSections;\n }\n if (newSections.length < existingSections.length) {\n return newSections;\n }\n\n const merged: PageSection[] = [];\n\n for (let i = 0; i < existingSections.length; i++) {\n const existing = existingSections[i];\n const updated = newSections[i];\n\n if (!updated) {\n merged.push(existing);\n continue;\n }\n\n const existingLength = existing.sourceMarkdown?.length || 0;\n const updatedLength = updated.sourceMarkdown?.length || 0;\n\n if (existingLength === updatedLength) {\n existing.sourceMarkdown = updated.sourceMarkdown;\n existing.component = updated.component;\n existing.componentOptions = updated.componentOptions;\n existing.debugProps = updated.debugProps;\n // V3 (DL #106): a skeleton and its real section both have empty\n // sourceMarkdown, so without carrying this flag the slot would stay a\n // skeleton forever (its real component never rendering).\n existing.isSkeleton = updated.isSkeleton;\n merged.push(existing);\n } else {\n merged.push(updated);\n }\n }\n\n if (newSections.length > existingSections.length) {\n const newSectionsToAdd = newSections.slice(existingSections.length);\n merged.push(...newSectionsToAdd);\n }\n\n return merged;\n}\n\nfunction combineAdjacentGeneralTextSections(\n sections: PageSection[],\n registry: ComponentRegistry<React.FC<any>>,\n placement?: boolean,\n placementId?: string,\n): PageSection[] {\n if (sections.length === 0) {\n return sections;\n }\n\n const combined: PageSection[] = [];\n let i = 0;\n\n while (i < sections.length) {\n const currentSection = sections[i];\n if (currentSection.sectionType === 'fallback') {\n const sectionsToCombine: PageSection[] = [currentSection];\n let j = i + 1;\n\n while (j < sections.length && sections[j].sectionType === 'fallback') {\n sectionsToCombine.push(sections[j]);\n j++;\n }\n\n if (sectionsToCombine.length > 1) {\n const mergedSection = mergeGeneralTextSections(\n sectionsToCombine,\n combined.length,\n registry,\n placement,\n placementId,\n );\n combined.push(mergedSection);\n i = j;\n } else {\n combined.push(currentSection);\n i++;\n }\n } else {\n combined.push(currentSection);\n i++;\n }\n }\n\n return combined;\n}\n\nfunction mergeGeneralTextSections(\n sections: PageSection[],\n index: number,\n registry: ComponentRegistry<React.FC<any>>,\n placement?: boolean,\n placementId?: string,\n): PageSection {\n if (sections.length === 0) {\n throw new Error('Cannot merge empty sections array');\n }\n if (sections.length === 1) {\n return sections[0];\n }\n\n const mergedSourceMarkdown = sections\n .map((section) => section.sourceMarkdown || '')\n .filter((markdown) => markdown.trim().length > 0)\n .join('\\n\\n');\n\n const mergedProps: GeneralTextCompProps = {\n markdown: mergedSourceMarkdown,\n };\n\n const FallbackComponent = registry.resolveSection('fallback', {\n placement,\n placementId,\n });\n const mergedComponent = React.createElement(FallbackComponent, mergedProps);\n\n return createPageSection({\n sectionType: 'fallback',\n componentName:\n (FallbackComponent as React.FC).displayName || FallbackComponent.name,\n index,\n component: mergedComponent,\n sourceMarkdown: mergedSourceMarkdown,\n debugProps: mergedProps,\n });\n}\n\nexport function parseMarkdownToComponents(\n pageMarkdown: string,\n options: ParseMarkdownOptions,\n): ParseMarkdownResult {\n const {\n registry,\n clientConfig,\n placement,\n placementId,\n enrichEntityProps,\n clientId,\n intentInfo: providedIntent,\n payload,\n disableContextualImages: explicitDisableImages,\n } = options;\n\n const { markdown: preprocessedMarkdown, diagnostics: preprocessDiagnostics } =\n preprocessMarkdown(pageMarkdown);\n\n // Validate the emitted intent against this client's own registered intents\n // (its taxonomy), falling back to core's DEFAULT_INTENTS when the registry\n // declares none.\n const knownIntents = registry.getKnownIntents();\n const intentInfo =\n providedIntent ??\n getIntentFromMarkdown(preprocessedMarkdown, {\n validIntents: knownIntents.length > 0 ? knownIntents : undefined,\n });\n\n const allNodes: RootContent[] = [\n ...parseMarkdownToAst(preprocessedMarkdown).children,\n ];\n const nodes: RootContent[] = [...allNodes];\n\n const sections: PageSection[] = [];\n const tracking = new ComponentTracking();\n const diagnosticsCollector =\n options.diagnosticsCollector ?? new DiagnosticsCollector();\n\n for (const d of preprocessDiagnostics) {\n diagnosticsCollector.report({\n diagnosticType: d.type as DiagnosticType,\n sectionType: 'preprocessor',\n sectionIndex: -1,\n details: `${d.original} → ${d.normalized}`,\n });\n }\n\n const disableContextualImages =\n explicitDisableImages ??\n clientConfig?.features?.disableContextualImagesEnrichment ??\n false;\n\n const context: ParserContext = {\n registry,\n clientConfig,\n placement,\n placementId,\n enrichEntityProps,\n clientId,\n intent: intentInfo,\n tracking,\n disableContextualImages,\n diagnosticsCollector,\n payload,\n };\n let currentGlobalIndex = 0;\n\n while (nodes.length > 0) {\n const startIndex = currentGlobalIndex;\n const { section, parsedCount } = tryParseComponent(\n nodes,\n sections.length,\n context,\n );\n\n if (!parsedCount) {\n break;\n }\n\n if (section) {\n section.sourceMarkdown = parseAstToMarkdown(nodes.slice(0, parsedCount));\n sections.push(section);\n\n const endIndex = startIndex + parsedCount;\n tracking.addRange(\n section.sectionType,\n startIndex,\n endIndex,\n sections.length - 1,\n );\n } else {\n const endIndex = startIndex + parsedCount;\n tracking.addRange('', startIndex, endIndex, -1);\n }\n\n currentGlobalIndex += parsedCount;\n nodes.splice(0, parsedCount);\n }\n\n for (const link of findInvalidWeb5Links(allNodes)) {\n let diagnosticType: DiagnosticType;\n let label: string;\n switch (link.reason) {\n case 'legacy':\n diagnosticType = DIAGNOSTIC_TYPES.LEGACY_PROTOCOL_LINK;\n label = 'legacy protocol';\n break;\n case 'empty':\n diagnosticType = DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT;\n label = 'empty href';\n break;\n default:\n diagnosticType = DIAGNOSTIC_TYPES.BROKEN_WEB5_LINK;\n label = 'web5://';\n break;\n }\n diagnosticsCollector.report({\n diagnosticType,\n sectionType: 'parser',\n sectionIndex: -1,\n details: `Invalid ${label} URL in ${link.nodeType}: ${link.url}`.slice(\n 0,\n 200,\n ),\n });\n }\n\n const combinedSections = combineAdjacentGeneralTextSections(\n sections,\n registry,\n placement,\n placementId,\n );\n\n return {\n sections: combinedSections,\n tracking,\n diagnosticsCollector,\n };\n}\n\nexport function tryParseComponent(\n nodes: RootContent[],\n sectionIndex: number,\n context: ParserContext,\n): { section?: PageSection; parsedCount?: number } {\n if (!nodes?.length) {\n return {};\n }\n\n const registry = context.registry;\n const placement = context.placement;\n const placementId = context.placementId;\n const definitions = registry.getAllDefinitions();\n\n const clientConfig = context.clientConfig ?? null;\n const allowedKeywords = clientConfig?.allowedImageSearchKeywords ?? [];\n const disableContextualImages = context.disableContextualImages ?? false;\n\n const baseParseContext: ParseContext = {\n getContextualImage:\n disableContextualImages || allowedKeywords.length === 0\n ? undefined\n : (contentParts) => {\n const result = getContextualImageFilename(\n contentParts,\n allowedKeywords,\n '',\n context.tracking,\n );\n return isWeb5ImageUrl(result.filename) ? result : null;\n },\n getComponentCount: context.tracking\n ? (sectionType) => context.tracking!.getComponentCount(sectionType)\n : undefined,\n setMeta: context.tracking\n ? (sectionType, key, value) =>\n context.tracking!.setMeta(sectionType, key, value)\n : undefined,\n getMeta: context.tracking\n ? (sectionType, key) => context.tracking!.getMeta(sectionType, key)\n : undefined,\n };\n\n // Debug-only trace (`?web5DebugMatch=1`). The registry order line doubles as\n // a \"is my definition even registered?\" check — a definition missing from it\n // never reached `register()` (stale client bundle / web5-core version skew).\n const trace = isMatchDebugEnabled();\n if (trace) {\n logMatchDebug(\n `block #${sectionIndex} [${nodes.map((n) => n.type).join(', ')}]`,\n );\n logMatchDebug(\n ` registry order: ${definitions.map((d) => d.sectionType).join(' > ')}`,\n );\n }\n\n for (const { sectionType, definition } of definitions) {\n // Placement-only definitions (registered with `{ placement: true }`\n // variants and no non-placement variant) must not match in a non-placement\n // render (the main app) — their markdown should fall through to the generic\n // sections there. Skip them unless this is a placement parse.\n if (!placement && registry.isPlacementOnly(sectionType)) {\n if (trace) {\n logMatchDebug(` ${sectionType}: skipped (placement-only)`);\n }\n continue;\n }\n for (const pattern of definition.patterns) {\n const result = validatePattern(nodes, pattern);\n if (!result.valid) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: no match — ${\n result.error ?? 'pattern did not match'\n }\\n pattern: ${pattern}`,\n );\n }\n continue;\n }\n\n let parsedNodes =\n result.astEndIndex !== undefined && result.astEndIndex >= 0\n ? result.astEndIndex + 1\n : result.endIndex >= 0\n ? result.endIndex + 1\n : 1;\n\n const maxNodes = (\n definition as SectionDefinition & { maxConsumedNodes?: number }\n ).maxConsumedNodes;\n if (typeof maxNodes === 'number' && parsedNodes > maxNodes) {\n parsedNodes = maxNodes;\n }\n\n const matchedNodes = nodes.slice(0, parsedNodes);\n const parts = nodesToParts(matchedNodes);\n const parseContext: ParseContext = {\n ...baseParseContext,\n reportDiagnostic: context.diagnosticsCollector\n ? (type, details) => {\n context.diagnosticsCollector!.report({\n diagnosticType: type,\n sectionType,\n sectionIndex,\n details: details.slice(0, 200),\n });\n }\n : undefined,\n };\n let props = definition.parse(parts, parseContext);\n\n if (props === null) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: pattern matched ${parsedNodes} node(s) but parse() returned null — falling through`,\n );\n }\n continue;\n }\n\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: MATCHED ${parsedNodes} node(s) via ${pattern}`,\n );\n }\n\n const leadingHtmlCommentMeta = parts.find(\n (p) => p.type === 'htmlComment' && p.meta,\n )?.meta;\n const semantic = leadingHtmlCommentMeta?.semantic as string | undefined;\n const serverSectionId = leadingHtmlCommentMeta?.id as string | undefined;\n\n if (\n isEntityCompProps(props) &&\n isItemsFromContentSection(sectionType, semantic, serverSectionId) &&\n context.enrichEntityProps\n ) {\n props = context.enrichEntityProps(props, {\n payload: context.payload,\n clientConfig,\n sectionType,\n semantic,\n serverSectionId,\n });\n }\n\n if (\n definition.singleInstance &&\n context.tracking &&\n context.tracking.getComponentCount(sectionType) > 0\n ) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: dropped (singleInstance, already rendered once)`,\n );\n }\n continue;\n }\n\n const isNullComponent =\n (definition as SectionDefinition & { nullComponent?: boolean })\n .nullComponent === true;\n if (isNullComponent) {\n return { parsedCount: parsedNodes };\n }\n\n const intent = context.intent?.intent;\n const Component = registry.resolveSection(sectionType, {\n intent,\n semantic,\n placement,\n placementId,\n });\n const resolvedSectionOptions = registry.resolveSectionOptions(\n sectionType,\n { intent, semantic, placement, placementId },\n );\n const component = React.createElement(Component, props);\n const componentName =\n Component.displayName || Component.name || undefined;\n\n const section = createPageSection({\n sectionType,\n componentName,\n semantic,\n componentOptions: resolvedSectionOptions?.componentOptions,\n index: sectionIndex,\n id: serverSectionId,\n component,\n sourceMarkdown: '',\n debugProps: {\n ...props,\n patternValidation: {\n astStartIndex: result.astStartIndex,\n astEndIndex: result.astEndIndex,\n endIndex: result.endIndex,\n },\n },\n });\n\n return { section, parsedCount: parsedNodes };\n }\n }\n\n if (trace) {\n logMatchDebug(' no definition claimed this block');\n }\n\n return {};\n}\n"],"mappings":";;;;;;;AAgBA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,sBAAA,GAAAT,OAAA;AAIA,IAAAU,qBAAA,GAAAV,OAAA;AACA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C,aAAa,EAAE5C,MAAM,CAAC4C,aAAa;YACnCrB,WAAW,EAAEvB,MAAM,CAACuB,WAAW;YAC/B5C,QAAQ,EAAEqB,MAAM,CAACrB;UACnB;QACF;MACF,CAAC,CAAC;MAEF,OAAO;QAAE7D,OAAO;QAAE0D,WAAW,EAAE8C;MAAY,CAAC;IAC9C;EACF;EAEA,IAAIb,KAAK,EAAE;IACT,IAAAE,yBAAa,EAAC,oCAAoC,CAAC;EACrD;EAEA,OAAO,CAAC,CAAC;AACX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_patternValidator","_astToParts","_linkTypes","_web5LinkValidator","_diagnosticTypes","_componentTracking","_matchDebug","_diagnosticsCollector","_unifiedMarkdownParser","_markdownPreprocessor","_intentExtractor","_contentKeywordMatcher","_propsExtractor","_sectionDefinition","isEntityCompProps","props","Array","isArray","items","ENRICHABLE_ENTITY_SECTION_TYPES","Set","isItemsFromContentSection","sectionType","semantic","serverSectionId","has","normalizedSemantic","toLowerCase","replace","normalizedId","includes","mergeSectionsWithStableReferences","existingSections","newSections","length","merged","i","_existing$sourceMarkd","_updated$sourceMarkdo","existing","updated","push","existingLength","sourceMarkdown","updatedLength","component","componentOptions","debugProps","isSkeleton","newSectionsToAdd","slice","combineAdjacentGeneralTextSections","sections","registry","placement","placementId","combined","currentSection","sectionsToCombine","j","mergedSection","mergeGeneralTextSections","index","Error","mergedSourceMarkdown","map","section","filter","markdown","trim","join","mergedProps","FallbackComponent","resolveSection","mergedComponent","React","createElement","createPageSection","componentName","displayName","name","parseMarkdownToComponents","pageMarkdown","options","_clientConfig$feature","clientConfig","enrichEntityProps","clientId","intentInfo","providedIntent","payload","disableContextualImages","explicitDisableImages","preprocessedMarkdown","diagnostics","preprocessDiagnostics","preprocessMarkdown","knownIntents","getKnownIntents","getIntentFromMarkdown","validIntents","undefined","allNodes","parseMarkdownToAst","children","nodes","tracking","ComponentTracking","diagnosticsCollector","DiagnosticsCollector","d","report","diagnosticType","type","sectionIndex","details","original","normalized","features","disableContextualImagesEnrichment","context","intent","currentGlobalIndex","startIndex","parsedCount","tryParseComponent","parseAstToMarkdown","endIndex","addRange","splice","link","findInvalidWeb5Links","label","reason","DIAGNOSTIC_TYPES","LEGACY_PROTOCOL_LINK","INVALID_LINK_FORMAT","BROKEN_WEB5_LINK","nodeType","url","combinedSections","definitions","getAllDefinitions","allowedKeywords","allowedImageSearchKeywords","baseParseContext","getContextualImage","contentParts","result","getContextualImageFilename","isWeb5ImageUrl","filename","getComponentCount","setMeta","key","value","getMeta","trace","isMatchDebugEnabled","logMatchDebug","n","definition","isPlacementOnly","pattern","patterns","_parts$find","_context$intent","validatePattern","valid","error","parsedNodes","astEndIndex","maxNodes","maxConsumedNodes","matchedNodes","parts","nodesToParts","parseContext","reportDiagnostic","parse","DROP_SECTION","leadingHtmlCommentMeta","find","p","meta","id","singleInstance","isNullComponent","nullComponent","Component","resolvedSectionOptions","resolveSectionOptions","patternValidation","astStartIndex"],"sources":["../../../src/component/componentParser.ts"],"sourcesContent":["/**\n * Markdown → component orchestrator. Lifted from\n * `web50-server-ui/src/utils/componentParser.ts` per DL #088 B9.5.\n *\n * The lift replaces three app-side singletons with options:\n * - `getAppRegistry()` → `options.registry`\n * - `getClientConfigSync(clientId)` → `options.clientConfig`\n * - `setLastDiagnosticsCollector(...)` → returned in the result object\n *\n * Adds a `placement` option that flows into every `registry.resolveSection`\n * call so the placement bundle can pick the placement variant of each section.\n *\n * The app-side `componentParser.ts` is a thin wrapper around this orchestrator\n * that pre-binds its singletons and a product-payload enrichment callback.\n */\nimport type { RootContent } from 'mdast';\nimport React from 'react';\n\nimport { validatePattern } from '../patternValidator';\nimport { nodesToParts } from '../match/astToParts';\nimport { isWeb5ImageUrl } from '../types/link-types';\nimport { findInvalidWeb5Links } from '../utils/web5LinkValidator';\nimport { DIAGNOSTIC_TYPES, type DiagnosticType } from './diagnosticTypes';\nimport { ComponentTracking } from '../utils/componentTracking';\nimport { isMatchDebugEnabled, logMatchDebug } from '../utils/matchDebug';\nimport { DiagnosticsCollector } from '../utils/diagnosticsCollector';\nimport {\n parseAstToMarkdown,\n parseMarkdownToAst,\n} from '../utils/unifiedMarkdownParser';\nimport { preprocessMarkdown } from '../utils/markdownPreprocessor';\nimport {\n getIntentFromMarkdown,\n type IntentInfo,\n} from '../utils/intentExtractor';\nimport { getContextualImageFilename } from '../utils/contentKeywordMatcher';\nimport { createPageSection } from '../utils/propsExtractor';\nimport type { PageSection } from '../types/page-section';\nimport type { ApiPayloadItem } from '../types/entity';\nimport type { ComponentRegistry } from '../registry';\nimport type { EntityCompProps, GeneralTextCompProps } from './types';\nimport type { SectionDefinition, ParseContext } from './section-definition';\nimport { DROP_SECTION } from './section-definition';\nimport type {\n EnrichEntityProps,\n ParserClientConfig,\n ParserContext,\n} from './parser-types';\n\nexport type { ComponentMatch, ParserContext } from './parser-types';\n\nexport interface ParseMarkdownOptions {\n /** Required — replaces the app-side `getAppRegistry()` singleton. */\n registry: ComponentRegistry<React.FC<any>>;\n /** Replaces `getClientConfigSync(clientId)` — caller resolves it first. */\n clientConfig?: ParserClientConfig | null;\n /** When true, resolveSection prefers placement variants (DL #088 D3.1). */\n placement?: boolean;\n /**\n * Placement slot id (the `data-web5-placement` value) — forwarded to\n * `resolveSection` so a section can resolve a per-placement variant. Only\n * meaningful with `placement: true`.\n */\n placementId?: string;\n /** App-specific payload-to-entity enrichment; omitted by the placement bundle. */\n enrichEntityProps?: EnrichEntityProps;\n /** Reuse an existing collector (e.g. for streaming) instead of creating one. */\n diagnosticsCollector?: DiagnosticsCollector;\n clientId?: string;\n intentInfo?: IntentInfo | null;\n payload?: ApiPayloadItem[];\n disableContextualImages?: boolean;\n}\n\nexport interface ParseMarkdownResult {\n sections: PageSection[];\n tracking: ComponentTracking;\n diagnosticsCollector: DiagnosticsCollector;\n}\n\nfunction isEntityCompProps(props: unknown): props is EntityCompProps {\n return (\n typeof props === 'object' &&\n props !== null &&\n Array.isArray((props as EntityCompProps).items)\n );\n}\n\n/**\n * Section types whose props are `EntityCompProps` and therefore participate in\n * payload enrichment. `entityCollection` is `entity` narrowed to collection\n * links — it produces the same props and arrives under the same\n * `semantic: items` descriptor, so leaving it out would silently strip its\n * items of their catalog data (image, title) and render the section blank.\n */\nconst ENRICHABLE_ENTITY_SECTION_TYPES = new Set(['entity', 'entityCollection']);\n\nfunction isItemsFromContentSection(\n sectionType: string,\n semantic?: string,\n serverSectionId?: string,\n): boolean {\n if (!ENRICHABLE_ENTITY_SECTION_TYPES.has(sectionType)) {\n return false;\n }\n const normalizedSemantic = semantic?.toLowerCase().replace(/_/g, '-');\n const normalizedId = serverSectionId?.toLowerCase().replace(/_/g, '-');\n return (\n normalizedSemantic === 'items' ||\n normalizedSemantic === 'items-from-content' ||\n normalizedId?.includes('items-from-content') === true\n );\n}\n\n/**\n * Merges new sections with existing sections, maintaining stable references\n * for unchanged sections to prevent unnecessary rerenders.\n */\nexport function mergeSectionsWithStableReferences(\n existingSections: PageSection[],\n newSections: PageSection[],\n): PageSection[] {\n if (existingSections.length === 0) {\n return newSections;\n }\n if (newSections.length < existingSections.length) {\n return newSections;\n }\n\n const merged: PageSection[] = [];\n\n for (let i = 0; i < existingSections.length; i++) {\n const existing = existingSections[i];\n const updated = newSections[i];\n\n if (!updated) {\n merged.push(existing);\n continue;\n }\n\n const existingLength = existing.sourceMarkdown?.length || 0;\n const updatedLength = updated.sourceMarkdown?.length || 0;\n\n if (existingLength === updatedLength) {\n existing.sourceMarkdown = updated.sourceMarkdown;\n existing.component = updated.component;\n existing.componentOptions = updated.componentOptions;\n existing.debugProps = updated.debugProps;\n // V3 (DL #106): a skeleton and its real section both have empty\n // sourceMarkdown, so without carrying this flag the slot would stay a\n // skeleton forever (its real component never rendering).\n existing.isSkeleton = updated.isSkeleton;\n merged.push(existing);\n } else {\n merged.push(updated);\n }\n }\n\n if (newSections.length > existingSections.length) {\n const newSectionsToAdd = newSections.slice(existingSections.length);\n merged.push(...newSectionsToAdd);\n }\n\n return merged;\n}\n\nfunction combineAdjacentGeneralTextSections(\n sections: PageSection[],\n registry: ComponentRegistry<React.FC<any>>,\n placement?: boolean,\n placementId?: string,\n): PageSection[] {\n if (sections.length === 0) {\n return sections;\n }\n\n const combined: PageSection[] = [];\n let i = 0;\n\n while (i < sections.length) {\n const currentSection = sections[i];\n if (currentSection.sectionType === 'fallback') {\n const sectionsToCombine: PageSection[] = [currentSection];\n let j = i + 1;\n\n while (j < sections.length && sections[j].sectionType === 'fallback') {\n sectionsToCombine.push(sections[j]);\n j++;\n }\n\n if (sectionsToCombine.length > 1) {\n const mergedSection = mergeGeneralTextSections(\n sectionsToCombine,\n combined.length,\n registry,\n placement,\n placementId,\n );\n combined.push(mergedSection);\n i = j;\n } else {\n combined.push(currentSection);\n i++;\n }\n } else {\n combined.push(currentSection);\n i++;\n }\n }\n\n return combined;\n}\n\nfunction mergeGeneralTextSections(\n sections: PageSection[],\n index: number,\n registry: ComponentRegistry<React.FC<any>>,\n placement?: boolean,\n placementId?: string,\n): PageSection {\n if (sections.length === 0) {\n throw new Error('Cannot merge empty sections array');\n }\n if (sections.length === 1) {\n return sections[0];\n }\n\n const mergedSourceMarkdown = sections\n .map((section) => section.sourceMarkdown || '')\n .filter((markdown) => markdown.trim().length > 0)\n .join('\\n\\n');\n\n const mergedProps: GeneralTextCompProps = {\n markdown: mergedSourceMarkdown,\n };\n\n const FallbackComponent = registry.resolveSection('fallback', {\n placement,\n placementId,\n });\n const mergedComponent = React.createElement(FallbackComponent, mergedProps);\n\n return createPageSection({\n sectionType: 'fallback',\n componentName:\n (FallbackComponent as React.FC).displayName || FallbackComponent.name,\n index,\n component: mergedComponent,\n sourceMarkdown: mergedSourceMarkdown,\n debugProps: mergedProps,\n });\n}\n\nexport function parseMarkdownToComponents(\n pageMarkdown: string,\n options: ParseMarkdownOptions,\n): ParseMarkdownResult {\n const {\n registry,\n clientConfig,\n placement,\n placementId,\n enrichEntityProps,\n clientId,\n intentInfo: providedIntent,\n payload,\n disableContextualImages: explicitDisableImages,\n } = options;\n\n const { markdown: preprocessedMarkdown, diagnostics: preprocessDiagnostics } =\n preprocessMarkdown(pageMarkdown);\n\n // Validate the emitted intent against this client's own registered intents\n // (its taxonomy), falling back to core's DEFAULT_INTENTS when the registry\n // declares none.\n const knownIntents = registry.getKnownIntents();\n const intentInfo =\n providedIntent ??\n getIntentFromMarkdown(preprocessedMarkdown, {\n validIntents: knownIntents.length > 0 ? knownIntents : undefined,\n });\n\n const allNodes: RootContent[] = [\n ...parseMarkdownToAst(preprocessedMarkdown).children,\n ];\n const nodes: RootContent[] = [...allNodes];\n\n const sections: PageSection[] = [];\n const tracking = new ComponentTracking();\n const diagnosticsCollector =\n options.diagnosticsCollector ?? new DiagnosticsCollector();\n\n for (const d of preprocessDiagnostics) {\n diagnosticsCollector.report({\n diagnosticType: d.type as DiagnosticType,\n sectionType: 'preprocessor',\n sectionIndex: -1,\n details: `${d.original} → ${d.normalized}`,\n });\n }\n\n const disableContextualImages =\n explicitDisableImages ??\n clientConfig?.features?.disableContextualImagesEnrichment ??\n false;\n\n const context: ParserContext = {\n registry,\n clientConfig,\n placement,\n placementId,\n enrichEntityProps,\n clientId,\n intent: intentInfo,\n tracking,\n disableContextualImages,\n diagnosticsCollector,\n payload,\n };\n let currentGlobalIndex = 0;\n\n while (nodes.length > 0) {\n const startIndex = currentGlobalIndex;\n const { section, parsedCount } = tryParseComponent(\n nodes,\n sections.length,\n context,\n );\n\n if (!parsedCount) {\n break;\n }\n\n if (section) {\n section.sourceMarkdown = parseAstToMarkdown(nodes.slice(0, parsedCount));\n sections.push(section);\n\n const endIndex = startIndex + parsedCount;\n tracking.addRange(\n section.sectionType,\n startIndex,\n endIndex,\n sections.length - 1,\n );\n } else {\n const endIndex = startIndex + parsedCount;\n tracking.addRange('', startIndex, endIndex, -1);\n }\n\n currentGlobalIndex += parsedCount;\n nodes.splice(0, parsedCount);\n }\n\n for (const link of findInvalidWeb5Links(allNodes)) {\n let diagnosticType: DiagnosticType;\n let label: string;\n switch (link.reason) {\n case 'legacy':\n diagnosticType = DIAGNOSTIC_TYPES.LEGACY_PROTOCOL_LINK;\n label = 'legacy protocol';\n break;\n case 'empty':\n diagnosticType = DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT;\n label = 'empty href';\n break;\n default:\n diagnosticType = DIAGNOSTIC_TYPES.BROKEN_WEB5_LINK;\n label = 'web5://';\n break;\n }\n diagnosticsCollector.report({\n diagnosticType,\n sectionType: 'parser',\n sectionIndex: -1,\n details: `Invalid ${label} URL in ${link.nodeType}: ${link.url}`.slice(\n 0,\n 200,\n ),\n });\n }\n\n const combinedSections = combineAdjacentGeneralTextSections(\n sections,\n registry,\n placement,\n placementId,\n );\n\n return {\n sections: combinedSections,\n tracking,\n diagnosticsCollector,\n };\n}\n\nexport function tryParseComponent(\n nodes: RootContent[],\n sectionIndex: number,\n context: ParserContext,\n): { section?: PageSection; parsedCount?: number } {\n if (!nodes?.length) {\n return {};\n }\n\n const registry = context.registry;\n const placement = context.placement;\n const placementId = context.placementId;\n const definitions = registry.getAllDefinitions();\n\n const clientConfig = context.clientConfig ?? null;\n const allowedKeywords = clientConfig?.allowedImageSearchKeywords ?? [];\n const disableContextualImages = context.disableContextualImages ?? false;\n\n const baseParseContext: ParseContext = {\n getContextualImage:\n disableContextualImages || allowedKeywords.length === 0\n ? undefined\n : (contentParts) => {\n const result = getContextualImageFilename(\n contentParts,\n allowedKeywords,\n '',\n context.tracking,\n );\n return isWeb5ImageUrl(result.filename) ? result : null;\n },\n getComponentCount: context.tracking\n ? (sectionType) => context.tracking!.getComponentCount(sectionType)\n : undefined,\n setMeta: context.tracking\n ? (sectionType, key, value) =>\n context.tracking!.setMeta(sectionType, key, value)\n : undefined,\n getMeta: context.tracking\n ? (sectionType, key) => context.tracking!.getMeta(sectionType, key)\n : undefined,\n };\n\n // Debug-only trace (`?web5DebugMatch=1`). The registry order line doubles as\n // a \"is my definition even registered?\" check — a definition missing from it\n // never reached `register()` (stale client bundle / web5-core version skew).\n const trace = isMatchDebugEnabled();\n if (trace) {\n logMatchDebug(\n `block #${sectionIndex} [${nodes.map((n) => n.type).join(', ')}]`,\n );\n logMatchDebug(\n ` registry order: ${definitions.map((d) => d.sectionType).join(' > ')}`,\n );\n }\n\n for (const { sectionType, definition } of definitions) {\n // Placement-only definitions (registered with `{ placement: true }`\n // variants and no non-placement variant) must not match in a non-placement\n // render (the main app) — their markdown should fall through to the generic\n // sections there. Skip them unless this is a placement parse.\n if (!placement && registry.isPlacementOnly(sectionType)) {\n if (trace) {\n logMatchDebug(` ${sectionType}: skipped (placement-only)`);\n }\n continue;\n }\n for (const pattern of definition.patterns) {\n const result = validatePattern(nodes, pattern);\n if (!result.valid) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: no match — ${\n result.error ?? 'pattern did not match'\n }\\n pattern: ${pattern}`,\n );\n }\n continue;\n }\n\n let parsedNodes =\n result.astEndIndex !== undefined && result.astEndIndex >= 0\n ? result.astEndIndex + 1\n : result.endIndex >= 0\n ? result.endIndex + 1\n : 1;\n\n const maxNodes = (\n definition as SectionDefinition & { maxConsumedNodes?: number }\n ).maxConsumedNodes;\n if (typeof maxNodes === 'number' && parsedNodes > maxNodes) {\n parsedNodes = maxNodes;\n }\n\n const matchedNodes = nodes.slice(0, parsedNodes);\n const parts = nodesToParts(matchedNodes);\n const parseContext: ParseContext = {\n ...baseParseContext,\n reportDiagnostic: context.diagnosticsCollector\n ? (type, details) => {\n context.diagnosticsCollector!.report({\n diagnosticType: type,\n sectionType,\n sectionIndex,\n details: details.slice(0, 200),\n });\n }\n : undefined,\n };\n let props = definition.parse(parts, parseContext);\n\n // The definition claimed the block and then decided its content is not\n // worth rendering. Consume the nodes and emit no component — returning\n // `null` here instead would let the same heading and table fall through\n // to the raw-markdown fallback, which is the outcome the drop exists to\n // avoid.\n if (props === DROP_SECTION) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: matched ${parsedNodes} node(s) but parse() dropped the section — rendering nothing`,\n );\n }\n return { parsedCount: parsedNodes };\n }\n\n if (props === null) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: pattern matched ${parsedNodes} node(s) but parse() returned null — falling through`,\n );\n }\n continue;\n }\n\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: MATCHED ${parsedNodes} node(s) via ${pattern}`,\n );\n }\n\n const leadingHtmlCommentMeta = parts.find(\n (p) => p.type === 'htmlComment' && p.meta,\n )?.meta;\n const semantic = leadingHtmlCommentMeta?.semantic as string | undefined;\n const serverSectionId = leadingHtmlCommentMeta?.id as string | undefined;\n\n if (\n isEntityCompProps(props) &&\n isItemsFromContentSection(sectionType, semantic, serverSectionId) &&\n context.enrichEntityProps\n ) {\n props = context.enrichEntityProps(props, {\n payload: context.payload,\n clientConfig,\n sectionType,\n semantic,\n serverSectionId,\n });\n }\n\n if (\n definition.singleInstance &&\n context.tracking &&\n context.tracking.getComponentCount(sectionType) > 0\n ) {\n if (trace) {\n logMatchDebug(\n ` ${sectionType}: dropped (singleInstance, already rendered once)`,\n );\n }\n continue;\n }\n\n const isNullComponent =\n (definition as SectionDefinition & { nullComponent?: boolean })\n .nullComponent === true;\n if (isNullComponent) {\n return { parsedCount: parsedNodes };\n }\n\n const intent = context.intent?.intent;\n const Component = registry.resolveSection(sectionType, {\n intent,\n semantic,\n placement,\n placementId,\n });\n const resolvedSectionOptions = registry.resolveSectionOptions(\n sectionType,\n { intent, semantic, placement, placementId },\n );\n const component = React.createElement(Component, props);\n const componentName =\n Component.displayName || Component.name || undefined;\n\n const section = createPageSection({\n sectionType,\n componentName,\n semantic,\n componentOptions: resolvedSectionOptions?.componentOptions,\n index: sectionIndex,\n id: serverSectionId,\n component,\n sourceMarkdown: '',\n debugProps: {\n ...props,\n patternValidation: {\n astStartIndex: result.astStartIndex,\n astEndIndex: result.astEndIndex,\n endIndex: result.endIndex,\n },\n },\n });\n\n return { section, parsedCount: parsedNodes };\n }\n }\n\n if (trace) {\n logMatchDebug(' no definition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Q;QACR+B,SAAS;QACTC;MACF,CAAC,CAAC;MACF,MAAMuI,sBAAsB,GAAGzI,QAAQ,CAAC0I,qBAAqB,CAC3DzK,WAAW,EACX;QAAEmG,MAAM;QAAElG,QAAQ;QAAE+B,SAAS;QAAEC;MAAY,CAC7C,CAAC;MACD,MAAMV,SAAS,gBAAG8B,cAAK,CAACC,aAAa,CAACiH,SAAS,EAAE9K,KAAK,CAAC;MACvD,MAAM+D,aAAa,GACjB+G,SAAS,CAAC9G,WAAW,IAAI8G,SAAS,CAAC7G,IAAI,IAAIqB,SAAS;MAEtD,MAAMnC,OAAO,GAAG,IAAAW,iCAAiB,EAAC;QAChCvD,WAAW;QACXwD,aAAa;QACbvD,QAAQ;QACRuB,gBAAgB,EAAEgJ,sBAAsB,oBAAtBA,sBAAsB,CAAEhJ,gBAAgB;QAC1DgB,KAAK,EAAEoD,YAAY;QACnBuE,EAAE,EAAEjK,eAAe;QACnBqB,SAAS;QACTF,cAAc,EAAE,EAAE;QAClBI,UAAU,EAAE;UACV,GAAGhC,KAAK;UACRiL,iBAAiB,EAAE;YACjBC,aAAa,EAAE7C,MAAM,CAAC6C,aAAa;YACnCtB,WAAW,EAAEvB,MAAM,CAACuB,WAAW;YAC/B5C,QAAQ,EAAEqB,MAAM,CAACrB;UACnB;QACF;MACF,CAAC,CAAC;MAEF,OAAO;QAAE7D,OAAO;QAAE0D,WAAW,EAAE8C;MAAY,CAAC;IAC9C;EACF;EAEA,IAAIb,KAAK,EAAE;IACT,IAAAE,yBAAa,EAAC,oCAAoC,CAAC;EACrD;EAEA,OAAO,CAAC,CAAC;AACX","ignoreList":[]}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports.DROP_SECTION = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Sentinel a `parse()` may return: this block IS mine — consume its nodes — but
|
|
7
|
+
* render nothing.
|
|
8
|
+
*
|
|
9
|
+
* Distinct from `null`, which *rejects* the match and lets the block fall through
|
|
10
|
+
* to the next definition, and ultimately to `FallbackSectionDefinition`, which
|
|
11
|
+
* would re-render the same heading and table as raw markdown. Return this instead
|
|
12
|
+
* when a section matched but its content is unusable and showing a degraded
|
|
13
|
+
* version is worse than showing nothing at all.
|
|
14
|
+
*/
|
|
15
|
+
const DROP_SECTION = exports.DROP_SECTION = Symbol('web5:drop-section');
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
18
|
//# sourceMappingURL=section-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/component/section-definition.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Part } from '../parts/parts';\nimport type { PropsOf, SectionFixture } from './types';\nimport type { DiagnosticType } from './diagnosticTypes';\n\nexport interface ContextualImageResult {\n filename: string;\n alt: string;\n isFromText: boolean;\n}\n\nexport interface ParseContext {\n /** Returns a contextual image://keyword URL based on content keywords. null = no match. */\n getContextualImage?: (\n contentParts: (string | undefined | null)[],\n ) => ContextualImageResult | null;\n /** Returns how many times a given sectionType has been matched so far in this parse run. */\n getComponentCount?: (sectionType: string) => number;\n /** Store a value scoped to a sectionType for the duration of the parse run. */\n setMeta?: (sectionType: string, key: string, value: unknown) => void;\n /** Retrieve a value previously stored via setMeta. */\n getMeta?: (sectionType: string, key: string) => unknown;\n /** Report a markdown diagnostic (e.g. broken link, invalid format). */\n reportDiagnostic?: (type: DiagnosticType, details: string) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionDefinition<T extends FC<any> = FC<any>> {\n sectionType: string;\n patterns: string[];\n singleInstance?: boolean;\n /** Cap the number of AST nodes consumed per match (e.g., 1 for the fallback parser). */\n maxConsumedNodes?: number;\n defaults?: PropsOf<T>;\n fixtures: SectionFixture<PropsOf<T>>[];\n parse(parts: Part[], context?: ParseContext): PropsOf<T> | null;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DROP_SECTION","exports","Symbol"],"sources":["../../../src/component/section-definition.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Part } from '../parts/parts';\nimport type { PropsOf, SectionFixture } from './types';\nimport type { DiagnosticType } from './diagnosticTypes';\n\nexport interface ContextualImageResult {\n filename: string;\n alt: string;\n isFromText: boolean;\n}\n\nexport interface ParseContext {\n /** Returns a contextual image://keyword URL based on content keywords. null = no match. */\n getContextualImage?: (\n contentParts: (string | undefined | null)[],\n ) => ContextualImageResult | null;\n /** Returns how many times a given sectionType has been matched so far in this parse run. */\n getComponentCount?: (sectionType: string) => number;\n /** Store a value scoped to a sectionType for the duration of the parse run. */\n setMeta?: (sectionType: string, key: string, value: unknown) => void;\n /** Retrieve a value previously stored via setMeta. */\n getMeta?: (sectionType: string, key: string) => unknown;\n /** Report a markdown diagnostic (e.g. broken link, invalid format). */\n reportDiagnostic?: (type: DiagnosticType, details: string) => void;\n}\n\n/**\n * Sentinel a `parse()` may return: this block IS mine — consume its nodes — but\n * render nothing.\n *\n * Distinct from `null`, which *rejects* the match and lets the block fall through\n * to the next definition, and ultimately to `FallbackSectionDefinition`, which\n * would re-render the same heading and table as raw markdown. Return this instead\n * when a section matched but its content is unusable and showing a degraded\n * version is worse than showing nothing at all.\n */\nexport const DROP_SECTION: unique symbol = Symbol('web5:drop-section');\nexport type DropSection = typeof DROP_SECTION;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionDefinition<T extends FC<any> = FC<any>> {\n sectionType: string;\n patterns: string[];\n singleInstance?: boolean;\n /** Cap the number of AST nodes consumed per match (e.g., 1 for the fallback parser). */\n maxConsumedNodes?: number;\n defaults?: PropsOf<T>;\n fixtures: SectionFixture<PropsOf<T>>[];\n parse(parts: Part[], context?: ParseContext): PropsOf<T> | null | DropSection;\n}\n"],"mappings":";;;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAA2B,GAAAC,OAAA,CAAAD,YAAA,GAAGE,MAAM,CAAC,mBAAmB,CAAC;;AAGtE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/component/types.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Callout } from '../types/callout';\n\n/** Props extracted from markdown (base layer). */\nexport interface BaseCompProps {}\nexport interface SlotCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\nexport interface SectionCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\n/** Section props with a slot. TSlot enforces which slot component this section accepts. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionCompPropsWithSlot<TSlot extends FC<any> = FC<any>>\n extends SectionCompProps {\n slot?: TSlot;\n}\n\n// ----------------------\n// Base Components\n// ----------------------\n\nexport interface TextCompProps extends BaseCompProps {\n content: string;\n variant?: 'h1' | 'h2' | 'body' | 'caption';\n}\n\nexport interface ButtonCompProps extends BaseCompProps {\n label: string;\n variant?: 'primary' | 'secondary' | 'ghost';\n onClick?: string;\n}\n\nexport interface ImageCompProps extends BaseCompProps {\n src: string;\n alt: string;\n ratio?: '16:9' | '4:3' | '1:1' | '9:16' | '3:4';\n}\n\nexport interface BadgeCompProps extends BaseCompProps {\n label: string;\n color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\n// ----------------------\n// Hero Button (aligned to HeroSection1Button)\n// ----------------------\n\nexport interface HeroButton {\n id: string;\n text: string;\n variant?: 'primary' | 'secondary';\n onClick?: string;\n}\n\n// ----------------------\n// Slot Components\n// ----------------------\n\nexport interface KpiItemCompProps extends SlotCompProps {\n title: string;\n description: string;\n icon?: string;\n}\n\n/** Feature item — aligned to web50-server-ui Feature interface */\nexport interface FeatureItemCompProps extends SlotCompProps {\n title?: string;\n description?: string;\n icon?: string;\n}\n\n/** Feature card — aligned to web50-server-ui FeatureCard */\nexport interface FeatureCardCompProps extends SlotCompProps {\n title: string;\n description: string;\n imageUrl?: string;\n imageFromText?: boolean;\n linkText?: string;\n linkHref?: string;\n callout?: Callout;\n}\n\n/** Resolved entity data (populated at runtime via useResolveGenericEntityData) */\nexport interface EntityItemData {\n url: string;\n title: string;\n type: string;\n description?: string;\n excerpt?: string;\n imageUrl?: string;\n date?: string;\n publishDate?: string;\n author?: string;\n cmsItemId?: string;\n usage?: number;\n tags?: string[];\n /** Product vendor / brand name (e.g. \"HOKA\") */\n vendor?: string;\n /** Formatted price string (e.g. \"542.00 NIS\") */\n price?: string;\n /** Secondary product image URL — shown on hover */\n secondaryImageUrl?: string;\n /** Available sizes for the product */\n sizes?: string[];\n /** Original price before discount (formatted, e.g. \"494.00 NIS\") — shown with strikethrough */\n compareAtPrice?: string;\n /** Discount percentage (e.g. \"30% OFF\") */\n discountPercent?: string;\n /** Product variants with IDs and availability — used for add-to-cart and size display */\n variants?: {\n label: string;\n variantId: string;\n available: boolean;\n selectedOptions?: { name: string; value: string }[];\n price?: string;\n compareAtPrice?: string;\n }[];\n /** All product image URLs (not just featured + secondary) */\n allImages?: string[];\n /** Product option groups (e.g. Size, Color) with their available values */\n options?: { name: string; values: string[] }[];\n}\n\n/** Single entity item within an entity section */\nexport interface EntityItem {\n entityId: string;\n linkText?: string;\n entityType: string;\n entityUrl: string;\n description?: string;\n imageUrl?: string;\n /** Per-item callout from a blockquote inside the list item */\n callout?: Callout;\n /** Resolved at runtime via useResolveGenericEntityData hook; not produced by parse() */\n data?: EntityItemData;\n}\n\n// ---------------------------------------------------------------------------\n// Deprecated aliases — kept for seed-components compilation\n// ---------------------------------------------------------------------------\n/** @deprecated Use EntityItemData */\nexport type GenericEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type SolutionEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type BlogEntityData = EntityItemData;\n/** @deprecated Use EntityItem */\nexport type GenericEntityCompProps = EntityItem;\n\n/** Comparison row — aligned to web50-server-ui ComparisonRow */\nexport interface ComparisonRow {\n feature: string;\n iconHint?: string;\n values: (boolean | string)[];\n}\n\nexport interface ComparisonColumn {\n label: string;\n href?: string;\n entityId?: string;\n entityType?: string;\n}\n\n/** @deprecated Use Callout from types/callout instead */\nexport interface AiNarrativeCompProps extends SlotCompProps {\n content: string;\n}\n\n// ----------------------\n// Section Components\n// ----------------------\n\n/** Hero — aligned to HeroSection1Props */\nexport interface HeroCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n buttons?: HeroButton[];\n image?: string;\n trailingList?: string;\n leadingQuote?: string;\n}\n\n/**\n * Entity hero — a hero section whose body carries one or more web5 entity\n * links (`web5://entity/...`). Shares the hero framing fields with\n * {@link HeroCompProps} but, instead of CTA buttons, surfaces the entities as\n * resolvable {@link EntityItem}s for rich rendering.\n */\nexport interface HeroEntityCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n image?: string;\n leadingQuote?: string;\n items: EntityItem[];\n}\n\n/** KPI — aligned to KpiSectionProps */\nexport interface KpiCompProps\n extends SectionCompPropsWithSlot<KpiItemComponent> {\n title: string;\n items: KpiItemCompProps[];\n}\n\n/** Feature cards — aligned to FeatureCardsSectionProps */\nexport interface FeatureCardsCompProps extends SectionCompProps {\n cards: FeatureCardCompProps[];\n}\n\n/** Unified entity section — replaces EntityCompProps, SolutionEntityCompProps, BlogEntityCompProps */\nexport interface EntityCompProps extends SectionCompProps {\n title: string;\n description?: string;\n items: EntityItem[];\n}\n\n/** Comparison — aligned to ComparisonSection1Props */\nexport interface ComparisonCompProps extends SectionCompProps {\n title: string;\n description?: string;\n columnLabels: string[];\n columns?: ComparisonColumn[];\n rows: ComparisonRow[];\n featureColumnLabel?: string;\n ctaText?: string;\n ctaHref?: string;\n}\n\n/** General text — aligned to GeneralTextSectionProps (used by Fallback) */\nexport interface GeneralTextCompProps extends SectionCompProps {\n markdown: string;\n}\n\n/** Callout — aligned to CalloutSectionProps */\nexport interface CalloutCompProps extends SectionCompProps {\n callouts: Callout[];\n title?: string;\n relatedLinks?: { text: string; url: string }[];\n}\n\n/** Next steps — aligned to NextStepsSectionProps */\nexport interface NextStepsCompProps extends SectionCompProps {\n title: string;\n body?: string;\n backgroundImage?: string;\n steps: { content: string; iconHint?: string }[];\n}\n\n/** Feature section 9+ — aligned to FeatureSection9PlusProps */\nexport interface FeatureSection9PlusCompProps extends SectionCompProps {\n title: string;\n description?: string;\n features: { title?: string; description: string; iconHint?: string }[];\n}\n\n/** List items section — title + a list of feature items. */\nexport interface ListItemsSectionCompProps extends SectionCompProps {\n title: string;\n features: { title?: string; description: string }[];\n}\n\nexport type ListItemsSectionComponent = FC<ListItemsSectionCompProps>;\n\n/** Error — aligned to ErrorSection */\nexport interface ErrorCompProps extends SectionCompProps {\n type: import('../errors/conversationErrorTypes').ConversationErrorType;\n}\n\n/** Skip/HTML/Search — null-component parsers */\nexport interface NullCompProps extends SectionCompProps {}\n\n/** @deprecated Use EntityCompProps */\nexport type SolutionEntityCompProps = EntityCompProps;\n/** @deprecated Use EntityCompProps */\nexport type BlogEntityCompProps = EntityCompProps;\n\n/** CTA Banner — dark purple gradient card with headline, description, and pill link buttons */\nexport interface CtaBannerCompProps extends SectionCompProps {\n headline: string;\n description?: string;\n links: { text: string; href: string }[];\n /** Contextual background image — resolved from allowed keywords during parse() */\n imageUrl?: string;\n imageFromText?: boolean;\n}\n\nexport type CtaBannerSectionComponent = FC<CtaBannerCompProps>;\n\n/** Text block — heading + body with an optional pullquote callout on the side */\nexport interface TextBlockCompProps extends SectionCompProps {\n title: string;\n description: string;\n}\n\n/** Personalized narrative — standalone section with no parse() definition */\nexport interface PersonalizedNarrativeCompProps extends SectionCompProps {\n title: string;\n content?: string;\n}\n\n// --------------------------------\n// Types of component - all components\n// --------------------------------\n\nexport type Component = BaseComponent | SlotComponent | SectionComponent;\n\nexport type BaseComponent = FC<BaseCompProps>;\nexport type SlotComponent = FC<SlotCompProps>;\nexport type SectionComponent = FC<SectionCompProps>;\n\n// Base Components\nexport type TextComponent = FC<TextCompProps>;\nexport type ButtonComponent = FC<ButtonCompProps>;\nexport type ImageComponent = FC<ImageCompProps>;\nexport type BadgeComponent = FC<BadgeCompProps>;\n\n// Slot Components\nexport type KpiItemComponent = FC<KpiItemCompProps>;\nexport type FeatureItemComponent = FC<FeatureItemCompProps>;\nexport type FeatureCardComponent = FC<FeatureCardCompProps>;\n/** @deprecated Use FC<EntityItem> */\nexport type GenericEntityComponent = FC<EntityItem>;\nexport type AiNarrativeComponent = FC<AiNarrativeCompProps>;\n\n// Section Components\nexport type ComparisonSectionComponent = FC<ComparisonCompProps>;\nexport type GeneralTextSectionComponent = FC<GeneralTextCompProps>;\nexport type TextBlockSectionComponent = FC<TextBlockCompProps>;\nexport type HeroSectionComponent = FC<HeroCompProps>;\nexport type HeroEntitySectionComponent = FC<HeroEntityCompProps>;\n\n// section components with slots\nexport type KpiSectionComponent = FC<KpiCompProps>;\nexport type FeatureCardsSectionComponent = FC<FeatureCardsCompProps>;\nexport type EntitySectionComponent = FC<EntityCompProps>;\n\n// New section component types for Phase 4\nexport type CalloutSectionComponent = FC<CalloutCompProps>;\nexport type NextStepsSectionComponent = FC<NextStepsCompProps>;\nexport type FeatureSection9PlusSectionComponent =\n FC<FeatureSection9PlusCompProps>;\nexport type NullSectionComponent = FC<NullCompProps>;\nexport type ErrorSectionComponent = FC<ErrorCompProps>;\nexport type SolutionEntitySectionComponent = FC<SolutionEntityCompProps>;\nexport type BlogEntitySectionComponent = FC<BlogEntityCompProps>;\nexport type PersonalizedNarrativeSectionComponent =\n FC<PersonalizedNarrativeCompProps>;\n\nexport type PropsOf<T> = T extends (props: infer P) => unknown ? P : never;\n\nexport interface SectionFixture<TProps> {\n markdown: string;\n expected: Partial<TProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/component/types.ts"],"sourcesContent":["import type { FC } from 'react';\nimport type { Callout } from '../types/callout';\n\n/** Props extracted from markdown (base layer). */\nexport interface BaseCompProps {}\nexport interface SlotCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\nexport interface SectionCompProps extends BaseCompProps {\n callout?: Callout;\n}\n\n/** Section props with a slot. TSlot enforces which slot component this section accepts. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface SectionCompPropsWithSlot<TSlot extends FC<any> = FC<any>>\n extends SectionCompProps {\n slot?: TSlot;\n}\n\n// ----------------------\n// Base Components\n// ----------------------\n\nexport interface TextCompProps extends BaseCompProps {\n content: string;\n variant?: 'h1' | 'h2' | 'body' | 'caption';\n}\n\nexport interface ButtonCompProps extends BaseCompProps {\n label: string;\n variant?: 'primary' | 'secondary' | 'ghost';\n onClick?: string;\n}\n\nexport interface ImageCompProps extends BaseCompProps {\n src: string;\n alt: string;\n ratio?: '16:9' | '4:3' | '1:1' | '9:16' | '3:4';\n}\n\nexport interface BadgeCompProps extends BaseCompProps {\n label: string;\n color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n}\n\n// ----------------------\n// Hero Button (aligned to HeroSection1Button)\n// ----------------------\n\nexport interface HeroButton {\n id: string;\n text: string;\n variant?: 'primary' | 'secondary';\n onClick?: string;\n}\n\n// ----------------------\n// Slot Components\n// ----------------------\n\nexport interface KpiItemCompProps extends SlotCompProps {\n title: string;\n description: string;\n icon?: string;\n}\n\n/** Feature item — aligned to web50-server-ui Feature interface */\nexport interface FeatureItemCompProps extends SlotCompProps {\n title?: string;\n description?: string;\n icon?: string;\n}\n\n/** Feature card — aligned to web50-server-ui FeatureCard */\nexport interface FeatureCardCompProps extends SlotCompProps {\n title: string;\n description: string;\n imageUrl?: string;\n imageFromText?: boolean;\n linkText?: string;\n linkHref?: string;\n callout?: Callout;\n}\n\n/** Resolved entity data (populated at runtime via useResolveGenericEntityData) */\nexport interface EntityItemData {\n url: string;\n title: string;\n type: string;\n description?: string;\n excerpt?: string;\n imageUrl?: string;\n date?: string;\n publishDate?: string;\n author?: string;\n cmsItemId?: string;\n usage?: number;\n tags?: string[];\n /** Product vendor / brand name (e.g. \"HOKA\") */\n vendor?: string;\n /** Formatted price string (e.g. \"542.00 NIS\") */\n price?: string;\n /** Secondary product image URL — shown on hover */\n secondaryImageUrl?: string;\n /** Available sizes for the product */\n sizes?: string[];\n /** Original price before discount (formatted, e.g. \"494.00 NIS\") — shown with strikethrough */\n compareAtPrice?: string;\n /** Discount percentage (e.g. \"30% OFF\") */\n discountPercent?: string;\n /** Product variants with IDs and availability — used for add-to-cart and size display */\n variants?: {\n label: string;\n variantId: string;\n available: boolean;\n selectedOptions?: { name: string; value: string }[];\n price?: string;\n compareAtPrice?: string;\n }[];\n /** All product image URLs (not just featured + secondary) */\n allImages?: string[];\n /** Product option groups (e.g. Size, Color) with their available values */\n options?: { name: string; values: string[] }[];\n}\n\n/** Single entity item within an entity section */\nexport interface EntityItem {\n entityId: string;\n linkText?: string;\n entityType: string;\n entityUrl: string;\n description?: string;\n imageUrl?: string;\n /** Per-item callout from a blockquote inside the list item */\n callout?: Callout;\n /** Resolved at runtime via useResolveGenericEntityData hook; not produced by parse() */\n data?: EntityItemData;\n}\n\n// ---------------------------------------------------------------------------\n// Deprecated aliases — kept for seed-components compilation\n// ---------------------------------------------------------------------------\n/** @deprecated Use EntityItemData */\nexport type GenericEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type SolutionEntityData = EntityItemData;\n/** @deprecated Use EntityItemData */\nexport type BlogEntityData = EntityItemData;\n/** @deprecated Use EntityItem */\nexport type GenericEntityCompProps = EntityItem;\n\n/** Comparison row — aligned to web50-server-ui ComparisonRow */\nexport interface ComparisonRow {\n feature: string;\n iconHint?: string;\n values: (boolean | string)[];\n}\n\nexport interface ComparisonColumn {\n label: string;\n href?: string;\n entityId?: string;\n entityType?: string;\n}\n\n/** @deprecated Use Callout from types/callout instead */\nexport interface AiNarrativeCompProps extends SlotCompProps {\n content: string;\n}\n\n// ----------------------\n// Section Components\n// ----------------------\n\n/** Hero — aligned to HeroSection1Props */\nexport interface HeroCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n buttons?: HeroButton[];\n image?: string;\n trailingList?: string;\n leadingQuote?: string;\n}\n\n/**\n * Entity hero — a hero section whose body carries one or more web5 entity\n * links (`web5://entity/...`). Shares the hero framing fields with\n * {@link HeroCompProps} but, instead of CTA buttons, surfaces the entities as\n * resolvable {@link EntityItem}s for rich rendering.\n */\nexport interface HeroEntityCompProps extends SectionCompProps {\n headline: string;\n badge?: string | { text: string; showIndicator?: boolean };\n content?: string;\n image?: string;\n leadingQuote?: string;\n items: EntityItem[];\n}\n\n/** KPI — aligned to KpiSectionProps */\nexport interface KpiCompProps\n extends SectionCompPropsWithSlot<KpiItemComponent> {\n title: string;\n items: KpiItemCompProps[];\n}\n\n/** Feature cards — aligned to FeatureCardsSectionProps */\nexport interface FeatureCardsCompProps extends SectionCompProps {\n cards: FeatureCardCompProps[];\n}\n\n/** Unified entity section — replaces EntityCompProps, SolutionEntityCompProps, BlogEntityCompProps */\nexport interface EntityCompProps extends SectionCompProps {\n title: string;\n description?: string;\n items: EntityItem[];\n}\n\n/** Comparison — aligned to ComparisonSection1Props */\nexport interface ComparisonCompProps extends SectionCompProps {\n title: string;\n description?: string;\n columnLabels: string[];\n columns?: ComparisonColumn[];\n rows: ComparisonRow[];\n featureColumnLabel?: string;\n ctaText?: string;\n ctaHref?: string;\n}\n\n/** General text — aligned to GeneralTextSectionProps (used by Fallback) */\nexport interface GeneralTextCompProps extends SectionCompProps {\n markdown: string;\n}\n\n/** Callout — aligned to CalloutSectionProps */\nexport interface CalloutCompProps extends SectionCompProps {\n callouts: Callout[];\n title?: string;\n relatedLinks?: { text: string; url: string }[];\n}\n\n/** Next steps — aligned to NextStepsSectionProps */\nexport interface NextStepsCompProps extends SectionCompProps {\n title: string;\n body?: string;\n /**\n * True when the chips are already rendered inline inside `body`. Renderers\n * must show `body` alone in that case — listing `steps` as well repeats every\n * chip. `steps` stays populated either way; it is the machine-readable chip\n * list (the scroll chips under the answer are built from it).\n */\n chipsInlineInBody?: boolean;\n backgroundImage?: string;\n steps: { content: string; iconHint?: string }[];\n}\n\n/** Feature section 9+ — aligned to FeatureSection9PlusProps */\nexport interface FeatureSection9PlusCompProps extends SectionCompProps {\n title: string;\n description?: string;\n features: { title?: string; description: string; iconHint?: string }[];\n}\n\n/** List items section — title + a list of feature items. */\nexport interface ListItemsSectionCompProps extends SectionCompProps {\n title: string;\n features: { title?: string; description: string }[];\n}\n\nexport type ListItemsSectionComponent = FC<ListItemsSectionCompProps>;\n\n/** Error — aligned to ErrorSection */\nexport interface ErrorCompProps extends SectionCompProps {\n type: import('../errors/conversationErrorTypes').ConversationErrorType;\n}\n\n/** Skip/HTML/Search — null-component parsers */\nexport interface NullCompProps extends SectionCompProps {}\n\n/** @deprecated Use EntityCompProps */\nexport type SolutionEntityCompProps = EntityCompProps;\n/** @deprecated Use EntityCompProps */\nexport type BlogEntityCompProps = EntityCompProps;\n\n/** CTA Banner — dark purple gradient card with headline, description, and pill link buttons */\nexport interface CtaBannerCompProps extends SectionCompProps {\n headline: string;\n description?: string;\n links: { text: string; href: string }[];\n /** Contextual background image — resolved from allowed keywords during parse() */\n imageUrl?: string;\n imageFromText?: boolean;\n}\n\nexport type CtaBannerSectionComponent = FC<CtaBannerCompProps>;\n\n/** Text block — heading + body with an optional pullquote callout on the side */\nexport interface TextBlockCompProps extends SectionCompProps {\n title: string;\n description: string;\n}\n\n/** Personalized narrative — standalone section with no parse() definition */\nexport interface PersonalizedNarrativeCompProps extends SectionCompProps {\n title: string;\n content?: string;\n}\n\n// --------------------------------\n// Types of component - all components\n// --------------------------------\n\nexport type Component = BaseComponent | SlotComponent | SectionComponent;\n\nexport type BaseComponent = FC<BaseCompProps>;\nexport type SlotComponent = FC<SlotCompProps>;\nexport type SectionComponent = FC<SectionCompProps>;\n\n// Base Components\nexport type TextComponent = FC<TextCompProps>;\nexport type ButtonComponent = FC<ButtonCompProps>;\nexport type ImageComponent = FC<ImageCompProps>;\nexport type BadgeComponent = FC<BadgeCompProps>;\n\n// Slot Components\nexport type KpiItemComponent = FC<KpiItemCompProps>;\nexport type FeatureItemComponent = FC<FeatureItemCompProps>;\nexport type FeatureCardComponent = FC<FeatureCardCompProps>;\n/** @deprecated Use FC<EntityItem> */\nexport type GenericEntityComponent = FC<EntityItem>;\nexport type AiNarrativeComponent = FC<AiNarrativeCompProps>;\n\n// Section Components\nexport type ComparisonSectionComponent = FC<ComparisonCompProps>;\nexport type GeneralTextSectionComponent = FC<GeneralTextCompProps>;\nexport type TextBlockSectionComponent = FC<TextBlockCompProps>;\nexport type HeroSectionComponent = FC<HeroCompProps>;\nexport type HeroEntitySectionComponent = FC<HeroEntityCompProps>;\n\n// section components with slots\nexport type KpiSectionComponent = FC<KpiCompProps>;\nexport type FeatureCardsSectionComponent = FC<FeatureCardsCompProps>;\nexport type EntitySectionComponent = FC<EntityCompProps>;\n\n// New section component types for Phase 4\nexport type CalloutSectionComponent = FC<CalloutCompProps>;\nexport type NextStepsSectionComponent = FC<NextStepsCompProps>;\nexport type FeatureSection9PlusSectionComponent =\n FC<FeatureSection9PlusCompProps>;\nexport type NullSectionComponent = FC<NullCompProps>;\nexport type ErrorSectionComponent = FC<ErrorCompProps>;\nexport type SolutionEntitySectionComponent = FC<SolutionEntityCompProps>;\nexport type BlogEntitySectionComponent = FC<BlogEntityCompProps>;\nexport type PersonalizedNarrativeSectionComponent =\n FC<PersonalizedNarrativeCompProps>;\n\nexport type PropsOf<T> = T extends (props: infer P) => unknown ? P : never;\n\nexport interface SectionFixture<TProps> {\n markdown: string;\n expected: Partial<TProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
7
7
|
var _reactMarkdown = _interopRequireDefault(require("react-markdown"));
|
|
8
8
|
var _remarkGfm = _interopRequireDefault(require("remark-gfm"));
|
|
9
9
|
var _entityLinkParser = require("../../utils/entityLinkParser");
|
|
10
|
+
var _markdownPreprocessor = require("../../utils/markdownPreprocessor");
|
|
10
11
|
var _linkTypes = require("../../types/link-types");
|
|
11
12
|
var _utils = require("../../lib/utils");
|
|
12
13
|
var _useWeb5Link = require("../../hooks/useWeb5Link");
|
|
@@ -28,7 +29,8 @@ function decodeWeb5Path(path) {
|
|
|
28
29
|
const MarkdownText = ({
|
|
29
30
|
children: markdownChildren,
|
|
30
31
|
className = '',
|
|
31
|
-
codeClassName = 'bg-muted px-1 py-0.5 rounded text-xs font-mono'
|
|
32
|
+
codeClassName = 'bg-muted px-1 py-0.5 rounded text-xs font-mono',
|
|
33
|
+
inline = false
|
|
32
34
|
}) => {
|
|
33
35
|
const {
|
|
34
36
|
isActionRegistered
|
|
@@ -36,12 +38,7 @@ const MarkdownText = ({
|
|
|
36
38
|
const {
|
|
37
39
|
reportDiagnostic
|
|
38
40
|
} = (0, _ComponentDependenciesContext.useComponentDependencies)();
|
|
39
|
-
|
|
40
|
-
// Fix malformed markdown links with space between ] and ( e.g. [text] (url) → [text](url)
|
|
41
|
-
const fixMalformedLinks = markdown => {
|
|
42
|
-
return markdown.replace(/\]\s+\(/g, '](');
|
|
43
|
-
};
|
|
44
|
-
const processedMarkdown = fixMalformedLinks(markdownChildren);
|
|
41
|
+
const processedMarkdown = (0, _markdownPreprocessor.fixMalformedLinks)(markdownChildren);
|
|
45
42
|
// Custom URL transform: only render valid URLs (react-markdown v9+ strips non-http by default)
|
|
46
43
|
const urlTransform = url => {
|
|
47
44
|
const validated = (0, _entityLinkParser.validateLinkUrl)(url);
|
|
@@ -50,12 +47,14 @@ const MarkdownText = ({
|
|
|
50
47
|
}
|
|
51
48
|
return validated;
|
|
52
49
|
};
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const Wrapper = inline ? 'span' : 'div';
|
|
51
|
+
const wrapperClassName = inline ? className || undefined : (0, _utils.cn)('prose prose-slate max-w-none', className);
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, {
|
|
53
|
+
className: wrapperClassName,
|
|
55
54
|
__self: void 0,
|
|
56
55
|
__source: {
|
|
57
56
|
fileName: _jsxFileName,
|
|
58
|
-
lineNumber:
|
|
57
|
+
lineNumber: 80,
|
|
59
58
|
columnNumber: 5
|
|
60
59
|
}
|
|
61
60
|
}, /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, {
|
|
@@ -64,13 +63,13 @@ const MarkdownText = ({
|
|
|
64
63
|
components: {
|
|
65
64
|
p: ({
|
|
66
65
|
children
|
|
67
|
-
}) => /*#__PURE__*/_react.default.createElement("p", {
|
|
66
|
+
}) => inline ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children) : /*#__PURE__*/_react.default.createElement("p", {
|
|
68
67
|
className: "mb-4 leading-relaxed",
|
|
69
68
|
__self: void 0,
|
|
70
69
|
__source: {
|
|
71
70
|
fileName: _jsxFileName,
|
|
72
|
-
lineNumber:
|
|
73
|
-
columnNumber:
|
|
71
|
+
lineNumber: 89,
|
|
72
|
+
columnNumber: 15
|
|
74
73
|
}
|
|
75
74
|
}, children),
|
|
76
75
|
code: ({
|
|
@@ -84,7 +83,7 @@ const MarkdownText = ({
|
|
|
84
83
|
__self: void 0,
|
|
85
84
|
__source: {
|
|
86
85
|
fileName: _jsxFileName,
|
|
87
|
-
lineNumber:
|
|
86
|
+
lineNumber: 95,
|
|
88
87
|
columnNumber: 17
|
|
89
88
|
}
|
|
90
89
|
}, children);
|
|
@@ -94,7 +93,7 @@ const MarkdownText = ({
|
|
|
94
93
|
__self: void 0,
|
|
95
94
|
__source: {
|
|
96
95
|
fileName: _jsxFileName,
|
|
97
|
-
lineNumber:
|
|
96
|
+
lineNumber: 106,
|
|
98
97
|
columnNumber: 15
|
|
99
98
|
}
|
|
100
99
|
}, children);
|
|
@@ -107,7 +106,7 @@ const MarkdownText = ({
|
|
|
107
106
|
__self: void 0,
|
|
108
107
|
__source: {
|
|
109
108
|
fileName: _jsxFileName,
|
|
110
|
-
lineNumber:
|
|
109
|
+
lineNumber: 113,
|
|
111
110
|
columnNumber: 15
|
|
112
111
|
}
|
|
113
112
|
}, children);
|
|
@@ -119,7 +118,7 @@ const MarkdownText = ({
|
|
|
119
118
|
__self: void 0,
|
|
120
119
|
__source: {
|
|
121
120
|
fileName: _jsxFileName,
|
|
122
|
-
lineNumber:
|
|
121
|
+
lineNumber: 118,
|
|
123
122
|
columnNumber: 33
|
|
124
123
|
}
|
|
125
124
|
}, children),
|
|
@@ -130,7 +129,7 @@ const MarkdownText = ({
|
|
|
130
129
|
__self: void 0,
|
|
131
130
|
__source: {
|
|
132
131
|
fileName: _jsxFileName,
|
|
133
|
-
lineNumber:
|
|
132
|
+
lineNumber: 120,
|
|
134
133
|
columnNumber: 13
|
|
135
134
|
}
|
|
136
135
|
}, children),
|
|
@@ -141,7 +140,7 @@ const MarkdownText = ({
|
|
|
141
140
|
__self: void 0,
|
|
142
141
|
__source: {
|
|
143
142
|
fileName: _jsxFileName,
|
|
144
|
-
lineNumber:
|
|
143
|
+
lineNumber: 123,
|
|
145
144
|
columnNumber: 13
|
|
146
145
|
}
|
|
147
146
|
}, children),
|
|
@@ -152,7 +151,7 @@ const MarkdownText = ({
|
|
|
152
151
|
__self: void 0,
|
|
153
152
|
__source: {
|
|
154
153
|
fileName: _jsxFileName,
|
|
155
|
-
lineNumber:
|
|
154
|
+
lineNumber: 128,
|
|
156
155
|
columnNumber: 13
|
|
157
156
|
}
|
|
158
157
|
}, children),
|
|
@@ -163,7 +162,7 @@ const MarkdownText = ({
|
|
|
163
162
|
__self: void 0,
|
|
164
163
|
__source: {
|
|
165
164
|
fileName: _jsxFileName,
|
|
166
|
-
lineNumber:
|
|
165
|
+
lineNumber: 133,
|
|
167
166
|
columnNumber: 13
|
|
168
167
|
}
|
|
169
168
|
}, children),
|
|
@@ -174,7 +173,7 @@ const MarkdownText = ({
|
|
|
174
173
|
__self: void 0,
|
|
175
174
|
__source: {
|
|
176
175
|
fileName: _jsxFileName,
|
|
177
|
-
lineNumber:
|
|
176
|
+
lineNumber: 138,
|
|
178
177
|
columnNumber: 13
|
|
179
178
|
}
|
|
180
179
|
}, children),
|
|
@@ -185,7 +184,7 @@ const MarkdownText = ({
|
|
|
185
184
|
__self: void 0,
|
|
186
185
|
__source: {
|
|
187
186
|
fileName: _jsxFileName,
|
|
188
|
-
lineNumber:
|
|
187
|
+
lineNumber: 143,
|
|
189
188
|
columnNumber: 13
|
|
190
189
|
}
|
|
191
190
|
}, children),
|
|
@@ -196,7 +195,7 @@ const MarkdownText = ({
|
|
|
196
195
|
__self: void 0,
|
|
197
196
|
__source: {
|
|
198
197
|
fileName: _jsxFileName,
|
|
199
|
-
lineNumber:
|
|
198
|
+
lineNumber: 148,
|
|
200
199
|
columnNumber: 13
|
|
201
200
|
}
|
|
202
201
|
}, children),
|
|
@@ -207,7 +206,7 @@ const MarkdownText = ({
|
|
|
207
206
|
__self: void 0,
|
|
208
207
|
__source: {
|
|
209
208
|
fileName: _jsxFileName,
|
|
210
|
-
lineNumber:
|
|
209
|
+
lineNumber: 153,
|
|
211
210
|
columnNumber: 13
|
|
212
211
|
}
|
|
213
212
|
}, children),
|
|
@@ -218,14 +217,14 @@ const MarkdownText = ({
|
|
|
218
217
|
__self: void 0,
|
|
219
218
|
__source: {
|
|
220
219
|
fileName: _jsxFileName,
|
|
221
|
-
lineNumber:
|
|
220
|
+
lineNumber: 158,
|
|
222
221
|
columnNumber: 13
|
|
223
222
|
}
|
|
224
223
|
}, /*#__PURE__*/_react.default.createElement(_table.Table, {
|
|
225
224
|
__self: void 0,
|
|
226
225
|
__source: {
|
|
227
226
|
fileName: _jsxFileName,
|
|
228
|
-
lineNumber:
|
|
227
|
+
lineNumber: 159,
|
|
229
228
|
columnNumber: 15
|
|
230
229
|
}
|
|
231
230
|
}, children)),
|
|
@@ -235,7 +234,7 @@ const MarkdownText = ({
|
|
|
235
234
|
__self: void 0,
|
|
236
235
|
__source: {
|
|
237
236
|
fileName: _jsxFileName,
|
|
238
|
-
lineNumber:
|
|
237
|
+
lineNumber: 162,
|
|
239
238
|
columnNumber: 36
|
|
240
239
|
}
|
|
241
240
|
}, children),
|
|
@@ -245,7 +244,7 @@ const MarkdownText = ({
|
|
|
245
244
|
__self: void 0,
|
|
246
245
|
__source: {
|
|
247
246
|
fileName: _jsxFileName,
|
|
248
|
-
lineNumber:
|
|
247
|
+
lineNumber: 163,
|
|
249
248
|
columnNumber: 36
|
|
250
249
|
}
|
|
251
250
|
}, children),
|
|
@@ -255,7 +254,7 @@ const MarkdownText = ({
|
|
|
255
254
|
__self: void 0,
|
|
256
255
|
__source: {
|
|
257
256
|
fileName: _jsxFileName,
|
|
258
|
-
lineNumber:
|
|
257
|
+
lineNumber: 164,
|
|
259
258
|
columnNumber: 33
|
|
260
259
|
}
|
|
261
260
|
}, children),
|
|
@@ -265,7 +264,7 @@ const MarkdownText = ({
|
|
|
265
264
|
__self: void 0,
|
|
266
265
|
__source: {
|
|
267
266
|
fileName: _jsxFileName,
|
|
268
|
-
lineNumber:
|
|
267
|
+
lineNumber: 165,
|
|
269
268
|
columnNumber: 33
|
|
270
269
|
}
|
|
271
270
|
}, children),
|
|
@@ -275,7 +274,7 @@ const MarkdownText = ({
|
|
|
275
274
|
__self: void 0,
|
|
276
275
|
__source: {
|
|
277
276
|
fileName: _jsxFileName,
|
|
278
|
-
lineNumber:
|
|
277
|
+
lineNumber: 166,
|
|
279
278
|
columnNumber: 33
|
|
280
279
|
}
|
|
281
280
|
}, children),
|
|
@@ -286,7 +285,7 @@ const MarkdownText = ({
|
|
|
286
285
|
__self: void 0,
|
|
287
286
|
__source: {
|
|
288
287
|
fileName: _jsxFileName,
|
|
289
|
-
lineNumber:
|
|
288
|
+
lineNumber: 168,
|
|
290
289
|
columnNumber: 13
|
|
291
290
|
}
|
|
292
291
|
}, children),
|
|
@@ -297,7 +296,7 @@ const MarkdownText = ({
|
|
|
297
296
|
__self: void 0,
|
|
298
297
|
__source: {
|
|
299
298
|
fileName: _jsxFileName,
|
|
300
|
-
lineNumber:
|
|
299
|
+
lineNumber: 173,
|
|
301
300
|
columnNumber: 13
|
|
302
301
|
}
|
|
303
302
|
}, children),
|
|
@@ -308,7 +307,7 @@ const MarkdownText = ({
|
|
|
308
307
|
__self: void 0,
|
|
309
308
|
__source: {
|
|
310
309
|
fileName: _jsxFileName,
|
|
311
|
-
lineNumber:
|
|
310
|
+
lineNumber: 177,
|
|
312
311
|
columnNumber: 33
|
|
313
312
|
}
|
|
314
313
|
}, children),
|
|
@@ -326,7 +325,7 @@ const MarkdownText = ({
|
|
|
326
325
|
__self: void 0,
|
|
327
326
|
__source: {
|
|
328
327
|
fileName: _jsxFileName,
|
|
329
|
-
lineNumber:
|
|
328
|
+
lineNumber: 193,
|
|
330
329
|
columnNumber: 19
|
|
331
330
|
}
|
|
332
331
|
}, children);
|
|
@@ -338,7 +337,7 @@ const MarkdownText = ({
|
|
|
338
337
|
__self: void 0,
|
|
339
338
|
__source: {
|
|
340
339
|
fileName: _jsxFileName,
|
|
341
|
-
lineNumber:
|
|
340
|
+
lineNumber: 199,
|
|
342
341
|
columnNumber: 15
|
|
343
342
|
}
|
|
344
343
|
}, children);
|
|
@@ -348,7 +347,7 @@ const MarkdownText = ({
|
|
|
348
347
|
__self: void 0,
|
|
349
348
|
__source: {
|
|
350
349
|
fileName: _jsxFileName,
|
|
351
|
-
lineNumber:
|
|
350
|
+
lineNumber: 204,
|
|
352
351
|
columnNumber: 21
|
|
353
352
|
}
|
|
354
353
|
}),
|
|
@@ -370,7 +369,7 @@ const MarkdownText = ({
|
|
|
370
369
|
__self: void 0,
|
|
371
370
|
__source: {
|
|
372
371
|
fileName: _jsxFileName,
|
|
373
|
-
lineNumber:
|
|
372
|
+
lineNumber: 215,
|
|
374
373
|
columnNumber: 17
|
|
375
374
|
}
|
|
376
375
|
});
|
|
@@ -389,7 +388,7 @@ const MarkdownText = ({
|
|
|
389
388
|
__self: void 0,
|
|
390
389
|
__source: {
|
|
391
390
|
fileName: _jsxFileName,
|
|
392
|
-
lineNumber:
|
|
391
|
+
lineNumber: 236,
|
|
393
392
|
columnNumber: 15
|
|
394
393
|
}
|
|
395
394
|
}, /*#__PURE__*/_react.default.createElement(_OptimizedImage.OptimizedImage, {
|
|
@@ -401,7 +400,7 @@ const MarkdownText = ({
|
|
|
401
400
|
__self: void 0,
|
|
402
401
|
__source: {
|
|
403
402
|
fileName: _jsxFileName,
|
|
404
|
-
lineNumber:
|
|
403
|
+
lineNumber: 237,
|
|
405
404
|
columnNumber: 17
|
|
406
405
|
}
|
|
407
406
|
}));
|
|
@@ -410,7 +409,7 @@ const MarkdownText = ({
|
|
|
410
409
|
__self: void 0,
|
|
411
410
|
__source: {
|
|
412
411
|
fileName: _jsxFileName,
|
|
413
|
-
lineNumber:
|
|
412
|
+
lineNumber: 81,
|
|
414
413
|
columnNumber: 7
|
|
415
414
|
}
|
|
416
415
|
}, processedMarkdown));
|