@wix/web5-core 1.57.2 → 1.58.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/clientBundleUrl.js +40 -0
- package/dist/cjs/client/clientBundleUrl.js.map +1 -0
- package/dist/cjs/client/mergeClientConfig.js +59 -0
- package/dist/cjs/client/mergeClientConfig.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js +159 -0
- package/dist/cjs/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/index.js +7 -1
- package/dist/cjs/component/componentDefinitions/index.js.map +1 -1
- package/dist/cjs/component/componentParser.js +38 -1
- package/dist/cjs/component/componentParser.js.map +1 -1
- package/dist/cjs/components/ui/SearchSection.css +66 -9
- package/dist/cjs/components/ui/SearchSection.js +23 -19
- package/dist/cjs/components/ui/SearchSection.js.map +1 -1
- package/dist/cjs/index.js +15 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles/prompt-input-tokens.css +41 -34
- package/dist/cjs/utils/matchDebug.js +93 -0
- package/dist/cjs/utils/matchDebug.js.map +1 -0
- package/dist/esm/client/clientBundleUrl.js +36 -0
- package/dist/esm/client/clientBundleUrl.js.map +1 -0
- package/dist/esm/client/mergeClientConfig.js +55 -0
- package/dist/esm/client/mergeClientConfig.js.map +1 -0
- package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js +154 -0
- package/dist/esm/component/componentDefinitions/EntityCollectionSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/index.js +7 -1
- package/dist/esm/component/componentDefinitions/index.js.map +1 -1
- package/dist/esm/component/componentParser.js +38 -1
- package/dist/esm/component/componentParser.js.map +1 -1
- package/dist/esm/components/ui/SearchSection.css +66 -9
- package/dist/esm/components/ui/SearchSection.js +5 -1
- package/dist/esm/components/ui/SearchSection.js.map +1 -1
- package/dist/esm/index.js +8 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles/prompt-input-tokens.css +41 -34
- package/dist/esm/utils/matchDebug.js +85 -0
- package/dist/esm/utils/matchDebug.js.map +1 -0
- package/dist/types/client/clientBundleUrl.d.ts +17 -0
- package/dist/types/client/clientBundleUrl.d.ts.map +1 -0
- package/dist/types/client/mergeClientConfig.d.ts +28 -0
- package/dist/types/client/mergeClientConfig.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts +51 -0
- package/dist/types/component/componentDefinitions/EntityCollectionSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/index.d.ts +1 -0
- package/dist/types/component/componentDefinitions/index.d.ts.map +1 -1
- package/dist/types/component/componentParser.d.ts.map +1 -1
- package/dist/types/components/ui/SearchSection.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/matchDebug.d.ts +38 -0
- package/dist/types/utils/matchDebug.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/ui/SearchSection.css +66 -9
- package/src/styles/prompt-input-tokens.css +41 -34
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","validatePattern","nodesToParts","isWeb5ImageUrl","findInvalidWeb5Links","DIAGNOSTIC_TYPES","ComponentTracking","DiagnosticsCollector","parseAstToMarkdown","parseMarkdownToAst","preprocessMarkdown","getIntentFromMarkdown","getContextualImageFilename","createPageSection","isEntityCompProps","props","Array","isArray","items","isItemsFromContentSection","sectionType","semantic","serverSectionId","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","createElement","componentName","displayName","name","parseMarkdownToComponents","pageMarkdown","options","_clientConfig$feature","clientConfig","enrichEntityProps","clientId","intentInfo","providedIntent","payload","disableContextualImages","explicitDisableImages","preprocessedMarkdown","diagnostics","preprocessDiagnostics","knownIntents","getKnownIntents","validIntents","undefined","allNodes","children","nodes","tracking","diagnosticsCollector","d","report","diagnosticType","type","sectionIndex","details","original","normalized","features","disableContextualImagesEnrichment","context","intent","currentGlobalIndex","startIndex","parsedCount","tryParseComponent","endIndex","addRange","splice","link","label","reason","LEGACY_PROTOCOL_LINK","INVALID_LINK_FORMAT","BROKEN_WEB5_LINK","nodeType","url","combinedSections","definitions","getAllDefinitions","allowedKeywords","allowedImageSearchKeywords","baseParseContext","getContextualImage","contentParts","result","filename","getComponentCount","setMeta","key","value","getMeta","definition","isPlacementOnly","pattern","patterns","_parts$find","_context$intent","valid","parsedNodes","astEndIndex","maxNodes","maxConsumedNodes","matchedNodes","parts","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 {\n DiagnosticsCollector,\n} from '../utils/diagnosticsCollector';\nimport {\n parseAstToMarkdown,\n parseMarkdownToAst,\n} from '../utils/unifiedMarkdownParser';\nimport { preprocessMarkdown } from '../utils/markdownPreprocessor';\nimport { getIntentFromMarkdown, type IntentInfo } 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 {\n EntityCompProps,\n GeneralTextCompProps,\n} 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\nfunction isItemsFromContentSection(\n sectionType: string,\n semantic?: string,\n serverSectionId?: string,\n): boolean {\n if (sectionType !== 'entity') {\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 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 continue;\n }\n for (const pattern of definition.patterns) {\n const result = validatePattern(nodes, pattern);\n if (!result.valid) {\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 continue;\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 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 return {};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,gBAAgB,QAA6B,mBAAmB;AACzE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SACEC,oBAAoB,QACf,+BAA+B;AACtC,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,gCAAgC;AACvC,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,qBAAqB,QAAyB,0BAA0B;AACjF,SAASC,0BAA0B,QAAQ,gCAAgC;AAC3E,SAASC,iBAAiB,QAAQ,yBAAyB;AA8C3D,SAASC,iBAAiBA,CAACC,KAAc,EAA4B;EACnE,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACdC,KAAK,CAACC,OAAO,CAAEF,KAAK,CAAqBG,KAAK,CAAC;AAEnD;AAEA,SAASC,yBAAyBA,CAChCC,WAAmB,EACnBC,QAAiB,EACjBC,eAAwB,EACf;EACT,IAAIF,WAAW,KAAK,QAAQ,EAAE;IAC5B,OAAO,KAAK;EACd;EACA,MAAMG,kBAAkB,GAAGF,QAAQ,oBAARA,QAAQ,CAAEG,WAAW,CAAC,CAAC,CAACC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;EACrE,MAAMC,YAAY,GAAGJ,eAAe,oBAAfA,eAAe,CAAEE,WAAW,CAAC,CAAC,C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,CAAClD,WAAW,EAAE;QACrD2F,MAAM;QACN1F,QAAQ;QACR8B,SAAS;QACTC;MACF,CAAC,CAAC;MACF,MAAMmH,sBAAsB,GAAGrH,QAAQ,CAACsH,qBAAqB,CAC3DpJ,WAAW,EACX;QAAE2F,MAAM;QAAE1F,QAAQ;QAAE8B,SAAS;QAAEC;MAAY,CAC7C,CAAC;MACD,MAAMV,SAAS,gBAAG1C,KAAK,CAACwE,aAAa,CAAC8F,SAAS,EAAEvJ,KAAK,CAAC;MACvD,MAAM0D,aAAa,GACjB6F,SAAS,CAAC5F,WAAW,IAAI4F,SAAS,CAAC3F,IAAI,IAAImB,SAAS;MAEtD,MAAM/B,OAAO,GAAGlD,iBAAiB,CAAC;QAChCO,WAAW;QACXqD,aAAa;QACbpD,QAAQ;QACRsB,gBAAgB,EAAE4H,sBAAsB,oBAAtBA,sBAAsB,CAAE5H,gBAAgB;QAC1DgB,KAAK,EAAE6C,YAAY;QACnB0D,EAAE,EAAE5I,eAAe;QACnBoB,SAAS;QACTF,cAAc,EAAE,EAAE;QAClBI,UAAU,EAAE;UACV,GAAG7B,KAAK;UACR0J,iBAAiB,EAAE;YACjBC,aAAa,EAAEnC,MAAM,CAACmC,aAAa;YACnCpB,WAAW,EAAEf,MAAM,CAACe,WAAW;YAC/BlC,QAAQ,EAAEmB,MAAM,CAACnB;UACnB;QACF;MACF,CAAC,CAAC;MAEF,OAAO;QAAErD,OAAO;QAAEmD,WAAW,EAAEmC;MAAY,CAAC;IAC9C;EACF;EAEA,OAAO,CAAC,CAAC;AACX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","validatePattern","nodesToParts","isWeb5ImageUrl","findInvalidWeb5Links","DIAGNOSTIC_TYPES","ComponentTracking","isMatchDebugEnabled","logMatchDebug","DiagnosticsCollector","parseAstToMarkdown","parseMarkdownToAst","preprocessMarkdown","getIntentFromMarkdown","getContextualImageFilename","createPageSection","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","createElement","componentName","displayName","name","parseMarkdownToComponents","pageMarkdown","options","_clientConfig$feature","clientConfig","enrichEntityProps","clientId","intentInfo","providedIntent","payload","disableContextualImages","explicitDisableImages","preprocessedMarkdown","diagnostics","preprocessDiagnostics","knownIntents","getKnownIntents","validIntents","undefined","allNodes","children","nodes","tracking","diagnosticsCollector","d","report","diagnosticType","type","sectionIndex","details","original","normalized","features","disableContextualImagesEnrichment","context","intent","currentGlobalIndex","startIndex","parsedCount","tryParseComponent","endIndex","addRange","splice","link","label","reason","LEGACY_PROTOCOL_LINK","INVALID_LINK_FORMAT","BROKEN_WEB5_LINK","nodeType","url","combinedSections","definitions","getAllDefinitions","allowedKeywords","allowedImageSearchKeywords","baseParseContext","getContextualImage","contentParts","result","filename","getComponentCount","setMeta","key","value","getMeta","trace","n","definition","isPlacementOnly","pattern","patterns","_parts$find","_context$intent","valid","error","parsedNodes","astEndIndex","maxNodes","maxConsumedNodes","matchedNodes","parts","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":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,gBAAgB,QAA6B,mBAAmB;AACzE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,mBAAmB,EAAEC,aAAa,QAAQ,qBAAqB;AACxE,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,gCAAgC;AACvC,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SACEC,qBAAqB,QAEhB,0BAA0B;AACjC,SAASC,0BAA0B,QAAQ,gCAAgC;AAC3E,SAASC,iBAAiB,QAAQ,yBAAyB;AA2C3D,SAASC,iBAAiBA,CAACC,KAAc,EAA4B;EACnE,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBA,KAAK,KAAK,IAAI,IACdC,KAAK,CAACC,OAAO,CAAEF,KAAK,CAAqBG,KAAK,CAAC;AAEnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,GAAG,IAAIC,GAAG,CAAC,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAE/E,SAASC,yBAAyBA,CAChCC,WAAmB,EACnBC,QAAiB,EACjBC,eAAwB,EACf;EACT,IAAI,CAACL,+BAA+B,CAACM,GAAG,CAACH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Q,CAACyH,qBAAqB,CAC3DxJ,WAAW,EACX;QAAE4F,MAAM;QAAE3F,QAAQ;QAAE+B,SAAS;QAAEC;MAAY,CAC7C,CAAC;MACD,MAAMV,SAAS,gBAAG/C,KAAK,CAAC6E,aAAa,CAACiG,SAAS,EAAE7J,KAAK,CAAC;MACvD,MAAM6D,aAAa,GACjBgG,SAAS,CAAC/F,WAAW,IAAI+F,SAAS,CAAC9F,IAAI,IAAImB,SAAS;MAEtD,MAAM/B,OAAO,GAAGrD,iBAAiB,CAAC;QAChCS,WAAW;QACXsD,aAAa;QACbrD,QAAQ;QACRuB,gBAAgB,EAAE+H,sBAAsB,oBAAtBA,sBAAsB,CAAE/H,gBAAgB;QAC1DgB,KAAK,EAAE6C,YAAY;QACnB6D,EAAE,EAAEhJ,eAAe;QACnBqB,SAAS;QACTF,cAAc,EAAE,EAAE;QAClBI,UAAU,EAAE;UACV,GAAGhC,KAAK;UACRgK,iBAAiB,EAAE;YACjBC,aAAa,EAAEtC,MAAM,CAACsC,aAAa;YACnCpB,WAAW,EAAElB,MAAM,CAACkB,WAAW;YAC/BrC,QAAQ,EAAEmB,MAAM,CAACnB;UACnB;QACF;MACF,CAAC,CAAC;MAEF,OAAO;QAAErD,OAAO;QAAEmD,WAAW,EAAEsC;MAAY,CAAC;IAC9C;EACF;EAEA,IAAIV,KAAK,EAAE;IACT3I,aAAa,CAAC,oCAAoC,CAAC;EACrD;EAEA,OAAO,CAAC,CAAC;AACX","ignoreList":[]}
|
|
@@ -152,15 +152,20 @@
|
|
|
152
152
|
flex-direction: column-reverse;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
/* Chips stack vertically above the pill, left-aligned to it, and share the
|
|
156
|
+
pill's width so the two edges line up as it expands on focus. */
|
|
155
157
|
.web5-prompt-shell__chips {
|
|
156
158
|
display: flex;
|
|
157
|
-
flex-
|
|
158
|
-
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
flex-wrap: nowrap;
|
|
161
|
+
align-items: flex-start;
|
|
162
|
+
justify-content: flex-start;
|
|
159
163
|
gap: var(--pi-chip-gap);
|
|
160
164
|
margin: 0 auto;
|
|
161
165
|
width: 100%;
|
|
162
|
-
max-width:
|
|
166
|
+
max-width: var(--pi-content-max-w);
|
|
163
167
|
overflow: hidden;
|
|
168
|
+
/* `max-width` omitted for the same reason as `.web5-prompt-search__inner`. */
|
|
164
169
|
transition: transform var(--pi-transition-medium),
|
|
165
170
|
opacity var(--pi-transition-medium), max-height var(--pi-transition-medium);
|
|
166
171
|
pointer-events: auto;
|
|
@@ -169,10 +174,45 @@
|
|
|
169
174
|
.web5-prompt-shell__chips--visible {
|
|
170
175
|
transform: translateY(0);
|
|
171
176
|
opacity: 1;
|
|
172
|
-
max-height:
|
|
177
|
+
max-height: 260px;
|
|
173
178
|
overflow: visible;
|
|
174
179
|
}
|
|
175
180
|
|
|
181
|
+
/* Each chip rises into place, the one nearest the pill first. */
|
|
182
|
+
@keyframes web5-prompt-chip-float-up {
|
|
183
|
+
from {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
transform: translateY(12px);
|
|
186
|
+
}
|
|
187
|
+
to {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
transform: translateY(0);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.web5-prompt-shell__chips--visible .web5-prompt-chip {
|
|
194
|
+
animation: web5-prompt-chip-float-up 400ms cubic-bezier(0.22, 0.61, 0.36, 1)
|
|
195
|
+
both;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(1) {
|
|
199
|
+
animation-delay: 400ms;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(2) {
|
|
203
|
+
animation-delay: 300ms;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.web5-prompt-shell__chips--visible .web5-prompt-chip:nth-child(n + 3) {
|
|
207
|
+
animation-delay: 200ms;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (prefers-reduced-motion: reduce) {
|
|
211
|
+
.web5-prompt-shell__chips--visible .web5-prompt-chip {
|
|
212
|
+
animation: none;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
176
216
|
.web5-prompt-shell__chips--hidden {
|
|
177
217
|
transform: translateY(1rem);
|
|
178
218
|
opacity: 0;
|
|
@@ -189,6 +229,7 @@
|
|
|
189
229
|
border: 1px solid var(--pi-chip-border, transparent);
|
|
190
230
|
border-radius: var(--pi-chip-radius);
|
|
191
231
|
background: var(--pi-chip-bg);
|
|
232
|
+
backdrop-filter: blur(var(--pi-chip-blur));
|
|
192
233
|
box-shadow: var(--pi-chip-shadow);
|
|
193
234
|
color: var(--pi-chip-text);
|
|
194
235
|
font-family: var(--pi-field-font-family);
|
|
@@ -209,7 +250,7 @@
|
|
|
209
250
|
/* Inset ring so the focus indicator isn't clipped by the chips container's overflow: hidden */
|
|
210
251
|
.web5-prompt-chip:focus-visible {
|
|
211
252
|
outline: none;
|
|
212
|
-
box-shadow: inset 0 0 0 2px
|
|
253
|
+
box-shadow: inset 0 0 0 2px var(--pi-chip-focus-ring), var(--pi-chip-shadow);
|
|
213
254
|
}
|
|
214
255
|
|
|
215
256
|
.web5-prompt-search {
|
|
@@ -220,12 +261,26 @@
|
|
|
220
261
|
|
|
221
262
|
.web5-prompt-search__inner {
|
|
222
263
|
position: relative;
|
|
223
|
-
width: min(100%,
|
|
264
|
+
/* `width: 100%` + a plain-length `max-width`, not `width: min(100%, …)`:
|
|
265
|
+
Chrome cannot interpolate between two min() values, which would freeze the
|
|
266
|
+
focus transition below at 0 progress. */
|
|
267
|
+
width: 100%;
|
|
268
|
+
max-width: var(--pi-content-max-w);
|
|
224
269
|
min-width: min(100%, var(--pi-content-min-w));
|
|
225
270
|
margin-inline: auto;
|
|
271
|
+
/* `max-width` is deliberately NOT transitioned: with a transition declared on
|
|
272
|
+
it, Chrome never runs the swap and the pill stays pinned at the idle width
|
|
273
|
+
(verified against the seed widget, which shares this rule shape). The widen
|
|
274
|
+
is therefore instant rather than the mock's 250ms ease. */
|
|
226
275
|
pointer-events: auto;
|
|
227
276
|
}
|
|
228
277
|
|
|
278
|
+
/* Focus widens the pill (and the chip column above it) from the idle width. */
|
|
279
|
+
.web5-prompt-shell--focused .web5-prompt-search__inner,
|
|
280
|
+
.web5-prompt-shell--focused .web5-prompt-shell__chips {
|
|
281
|
+
max-width: var(--pi-content-max-w-focused);
|
|
282
|
+
}
|
|
283
|
+
|
|
229
284
|
.web5-prompt-field-wrap {
|
|
230
285
|
position: relative;
|
|
231
286
|
display: flex;
|
|
@@ -243,6 +298,7 @@
|
|
|
243
298
|
border: var(--pi-field-border-width) solid var(--pi-field-border);
|
|
244
299
|
border-radius: var(--pi-field-radius-pill);
|
|
245
300
|
background: var(--pi-field-bg);
|
|
301
|
+
backdrop-filter: blur(var(--pi-field-blur));
|
|
246
302
|
box-shadow: var(--pi-field-shadow);
|
|
247
303
|
transition: min-height var(--pi-transition-medium),
|
|
248
304
|
border-radius var(--pi-transition-medium),
|
|
@@ -264,7 +320,8 @@
|
|
|
264
320
|
min-width: 0;
|
|
265
321
|
min-height: var(--pi-field-line-height);
|
|
266
322
|
max-height: calc(var(--pi-field-max-h) - var(--pi-field-line-height));
|
|
267
|
-
|
|
323
|
+
/* Clear the absolutely-positioned submit button. */
|
|
324
|
+
padding: 0 calc(var(--pi-submit-size) + 8px) 0 0;
|
|
268
325
|
border: 0;
|
|
269
326
|
outline: none;
|
|
270
327
|
background: transparent;
|
|
@@ -481,12 +538,12 @@
|
|
|
481
538
|
font-size: max(16px, var(--pi-field-font-size));
|
|
482
539
|
}
|
|
483
540
|
|
|
541
|
+
/* Keeps the chip fill: `--pi-chip-text` is light, so a transparent chip on
|
|
542
|
+
the white mobile panel would be unreadable. */
|
|
484
543
|
.web5-prompt-chip {
|
|
485
544
|
width: 100%;
|
|
486
545
|
justify-content: flex-start;
|
|
487
546
|
padding: 10px 18px;
|
|
488
|
-
background: transparent;
|
|
489
|
-
box-shadow: none;
|
|
490
547
|
font-size: 16px;
|
|
491
548
|
line-height: 20px;
|
|
492
549
|
white-space: normal;
|
|
@@ -245,7 +245,11 @@ export const SearchSection = /*#__PURE__*/forwardRef(function SearchSection(_ref
|
|
|
245
245
|
};
|
|
246
246
|
const showHint = inputValue === '' && !isFocused && !isCollapsed;
|
|
247
247
|
return /*#__PURE__*/React.createElement("div", {
|
|
248
|
-
className: cn('web5-prompt-shell', isCollapsed && 'web5-prompt-shell--collapsed',
|
|
248
|
+
className: cn('web5-prompt-shell', isCollapsed && 'web5-prompt-shell--collapsed',
|
|
249
|
+
// Widens the pill while the field or a chip holds focus. Driven by
|
|
250
|
+
// `hasFocusInside` rather than `isFocused` so clicking a chip (which
|
|
251
|
+
// preventDefaults its mousedown) doesn't collapse the width mid-click.
|
|
252
|
+
hasFocusInside && !isCollapsed && 'web5-prompt-shell--focused', className)
|
|
249
253
|
}, /*#__PURE__*/React.createElement("div", {
|
|
250
254
|
className: "web5-prompt-shell__stage"
|
|
251
255
|
}, /*#__PURE__*/React.createElement("button", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useEffect","useImperativeHandle","useState","useRef","useCallback","useLayoutEffect","cn","isWeb5Url","ArrowDownIcon","createElement","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","d","MicrophoneIcon","props","_extends","ArrowRightIcon","PromptSendIcon","SearchSection","_ref","ref","onSubmit","placeholder","submitLabel","collapsedLabel","onCollapsedChange","chips","chipDisplayMode","chipPosition","onVoiceInput","progressMessage","className","contextBanner","hasContext","canSubmitEmpty","hasContent","isBottomZoneVisible","onChipClick","onFocusChange","inputValue","setInputValue","isFocused","setIsFocused","hasFocusInside","setHasFocusInside","isMultiline","setIsMultiline","isCollapsed","setIsCollapsed","inputRef","hasExpandedWhileZoneVisibleRef","previouslyFocusedElementRef","showChips","length","effectiveCollapsedLabel","replace","handleSubmit","trimmedValue","trim","element","current","computedStyles","window","getComputedStyle","lineHeight","Number","parseFloat","hasValue","style","nextHeight","Math","min","max","scrollHeight","hasFocusInsideRef","onFocusChangeRef","focusInput","active","document","activeElement","HTMLElement","body","requestAnimationFrame","_inputRef$current","focus","_inputRef$current2","blurInput","_inputRef$current3","blur","handleKeyDown","e","key","_inputRef$current4","preventDefault","prev","shiftKey","handleInputChange","target","value","handleInputFocus","relatedTarget","handleContentFocus","handleContentBlur","next","currentTarget","contains","role","canSubmit","chipsMarkup","map","chip","label","href","onMouseDown","onClick","_inputRef$current5","tabIndex","handleExpandClick","showHint","type","onFocus","onBlur","rows","onChange","onKeyDown","undefined","disabled","Fragment"],"sources":["../../../../src/components/ui/SearchSection.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n useRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\nimport { cn } from '../../lib/utils';\nimport { isWeb5Url } from '../../types/link-types';\n\nexport interface ScrollChip {\n label: string;\n href: string;\n iconHint?: string;\n}\n\nexport interface SearchSectionProps {\n onSubmit?: (value: string) => void;\n placeholder?: string;\n /**\n * When set, the submit control renders as a labeled CTA button (text +\n * right arrow) instead of the icon-only send button. Used by the empty\n * state (e.g. \"Find Your Pair\").\n */\n submitLabel?: string;\n collapsedLabel?: string;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n chips?: ScrollChip[];\n chipDisplayMode?: 'focus' | 'always';\n chipPosition?: 'top' | 'bottom';\n onVoiceInput?: () => void;\n progressMessage?: string;\n className?: string;\n contextBanner?: React.ReactNode;\n hasContext?: boolean;\n canSubmitEmpty?: boolean;\n hasContent?: boolean;\n isBottomZoneVisible?: boolean;\n onChipClick?: (e: React.MouseEvent<HTMLAnchorElement>, href: string) => void;\n onFocusChange?: (focused: boolean) => void;\n}\n\nexport interface SearchSectionHandle {\n focusInput: () => void;\n blurInput: () => void;\n}\n\nconst ArrowDownIcon: React.FC = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n);\n\nconst MicrophoneIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path\n d=\"M19 10v2a7 7 0 0 1-14 0v-2M12 19v3\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n </svg>\n);\n\nconst ArrowRightIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n);\n\nconst PromptSendIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n {...props}\n >\n <path\n d=\"M13.0306 7.53114C12.9609 7.60106 12.8781 7.65654 12.787 7.69439C12.6958 7.73224 12.5981 7.75173 12.4993 7.75173C12.4006 7.75173 12.3029 7.73224 12.2117 7.69439C12.1206 7.65654 12.0378 7.60106 11.9681 7.53114L8.74997 4.31301V13.5005C8.74997 13.6994 8.67095 13.8902 8.5303 14.0308C8.38965 14.1715 8.19888 14.2505 7.99997 14.2505C7.80106 14.2505 7.61029 14.1715 7.46964 14.0308C7.32899 13.8902 7.24997 13.6994 7.24997 13.5005V4.31301L4.0306 7.53114C3.8897 7.67203 3.69861 7.75119 3.49935 7.75119C3.30009 7.75119 3.10899 7.67203 2.9681 7.53114C2.8272 7.39024 2.74805 7.19915 2.74805 6.99989C2.74805 6.80063 2.8272 6.60953 2.9681 6.46864L7.4681 1.96864C7.53778 1.89872 7.62057 1.84324 7.71173 1.80539C7.8029 1.76753 7.90064 1.74805 7.99935 1.74805C8.09806 1.74805 8.1958 1.76753 8.28696 1.80539C8.37813 1.84324 8.46092 1.89872 8.5306 1.96864L13.0306 6.46864C13.1005 6.53832 13.156 6.62111 13.1938 6.71227C13.2317 6.80344 13.2512 6.90118 13.2512 6.99989C13.2512 7.0986 13.2317 7.19634 13.1938 7.2875C13.156 7.37867 13.1005 7.46146 13.0306 7.53114Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const SearchSection = forwardRef<\n SearchSectionHandle,\n SearchSectionProps\n>(function SearchSection(\n {\n onSubmit,\n placeholder = 'Talk to us',\n submitLabel,\n collapsedLabel,\n onCollapsedChange,\n chips = [],\n chipDisplayMode = 'focus',\n chipPosition = 'top',\n onVoiceInput,\n progressMessage,\n className = '',\n contextBanner,\n hasContext,\n canSubmitEmpty = false,\n hasContent = false,\n isBottomZoneVisible = false,\n onChipClick,\n onFocusChange,\n },\n ref,\n) {\n const [inputValue, setInputValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [isMultiline, setIsMultiline] = useState(false);\n const [isCollapsed, setIsCollapsed] = useState(false);\n const inputRef = useRef<HTMLTextAreaElement>(null);\n const hasExpandedWhileZoneVisibleRef = useRef(false);\n const previouslyFocusedElementRef = useRef<HTMLElement | null>(null);\n const showChips =\n chips.length > 0 &&\n !hasContext &&\n (chipDisplayMode === 'always' || hasFocusInside);\n const effectiveCollapsedLabel =\n collapsedLabel ?? placeholder.replace(/\\.\\.\\.$/, '');\n\n const handleSubmit = useCallback(() => {\n const trimmedValue = inputValue.trim();\n if (trimmedValue || canSubmitEmpty) {\n onSubmit?.(trimmedValue);\n setInputValue('');\n }\n }, [canSubmitEmpty, inputValue, onSubmit]);\n\n useLayoutEffect(() => {\n const element = inputRef.current;\n if (!element) {\n return;\n }\n\n const computedStyles = window.getComputedStyle(element);\n const lineHeight = Number.parseFloat(computedStyles.lineHeight) || 32;\n\n const hasValue = inputValue.trim().length > 0;\n element.style.height = 'auto';\n const nextHeight = hasValue\n ? Math.min(Math.max(element.scrollHeight, lineHeight), 175)\n : lineHeight;\n element.style.height = `${nextHeight}px`;\n setIsMultiline(hasValue && nextHeight > lineHeight);\n }, [inputValue]);\n\n useEffect(() => {\n if (progressMessage || !hasContent) {\n setIsCollapsed(false);\n hasExpandedWhileZoneVisibleRef.current = false;\n return;\n }\n\n if (!isBottomZoneVisible) {\n hasExpandedWhileZoneVisibleRef.current = false;\n setIsCollapsed(false);\n return;\n }\n\n if (!hasExpandedWhileZoneVisibleRef.current) {\n setIsCollapsed(true);\n }\n }, [hasContent, isBottomZoneVisible, progressMessage]);\n\n useEffect(() => {\n onCollapsedChange?.(isCollapsed);\n }, [isCollapsed, onCollapsedChange]);\n\n const hasFocusInsideRef = useRef(hasFocusInside);\n hasFocusInsideRef.current = hasFocusInside;\n const onFocusChangeRef = useRef(onFocusChange);\n onFocusChangeRef.current = onFocusChange;\n\n useEffect(() => {\n onFocusChange?.(hasFocusInside);\n }, [hasFocusInside, onFocusChange]);\n\n useEffect(() => {\n return () => {\n if (hasFocusInsideRef.current) {\n onFocusChangeRef.current?.(false);\n }\n };\n }, []);\n\n const focusInput = useCallback(() => {\n const active = document.activeElement;\n if (\n active instanceof HTMLElement &&\n active !== inputRef.current &&\n active !== document.body\n ) {\n previouslyFocusedElementRef.current = active;\n }\n if (isCollapsed) {\n hasExpandedWhileZoneVisibleRef.current = true;\n setIsCollapsed(false);\n window.requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n } else {\n inputRef.current?.focus();\n }\n }, [isCollapsed]);\n\n const blurInput = useCallback(() => {\n inputRef.current?.blur();\n }, []);\n\n useImperativeHandle(ref, () => ({ focusInput, blurInput }), [\n focusInput,\n blurInput,\n ]);\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n const prev = previouslyFocusedElementRef.current;\n previouslyFocusedElementRef.current = null;\n inputRef.current?.blur();\n prev?.focus?.();\n return;\n }\n if (\n e.key === 'Enter' &&\n !e.shiftKey &&\n (inputValue.trim() || canSubmitEmpty)\n ) {\n e.preventDefault();\n handleSubmit();\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setInputValue(e.target.value);\n };\n\n const handleInputFocus = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(true);\n if (\n e.relatedTarget instanceof HTMLElement &&\n e.relatedTarget !== inputRef.current\n ) {\n previouslyFocusedElementRef.current = e.relatedTarget;\n }\n };\n\n const handleContentFocus = () => {\n setHasFocusInside(true);\n };\n\n const handleContentBlur = (e: React.FocusEvent<HTMLDivElement>) => {\n const next = e.relatedTarget as Node | null;\n if (!next || !e.currentTarget.contains(next)) {\n setHasFocusInside(false);\n }\n };\n\n if (progressMessage) {\n return (\n <div\n className={cn('web5-prompt-progress', className)}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <div className=\"web5-prompt-progress__indicator\" aria-hidden=\"true\">\n <ArrowDownIcon />\n </div>\n <div className=\"web5-prompt-progress__message\">{progressMessage}</div>\n </div>\n );\n }\n\n const canSubmit = inputValue.trim().length > 0 || canSubmitEmpty;\n const chipsMarkup =\n chips.length > 0 ? (\n <div\n className={cn(\n 'web5-prompt-shell__chips',\n chipPosition === 'bottom'\n ? 'web5-prompt-shell__chips--bottom'\n : 'web5-prompt-shell__chips--top',\n showChips\n ? 'web5-prompt-shell__chips--visible'\n : 'web5-prompt-shell__chips--hidden',\n )}\n aria-hidden={isCollapsed || !showChips}\n >\n {chips.map((chip) => (\n <a\n key={chip.label}\n href={isWeb5Url(chip.href) ? '#' : chip.href}\n onMouseDown={(e) => e.preventDefault()}\n onClick={(e) => {\n e.preventDefault();\n onChipClick?.(e, chip.href);\n setInputValue('');\n inputRef.current?.blur();\n }}\n tabIndex={!isCollapsed && showChips ? 0 : -1}\n // `has-custom-focus` opts out of Wix Thunderbolt's global keyboard focus ring\n // so our inset :focus-visible ring isn't overwritten when embedded in a Wix site.\n className=\"web5-prompt-chip has-custom-focus\"\n >\n {chip.label}\n <PromptSendIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n </a>\n ))}\n </div>\n ) : null;\n\n const handleExpandClick = () => {\n focusInput();\n };\n\n const showHint = inputValue === '' && !isFocused && !isCollapsed;\n\n return (\n <div\n className={cn(\n 'web5-prompt-shell',\n isCollapsed && 'web5-prompt-shell--collapsed',\n className,\n )}\n >\n <div className=\"web5-prompt-shell__stage\">\n <button\n type=\"button\"\n className=\"web5-prompt-shell__collapsed-button has-custom-focus\"\n onClick={handleExpandClick}\n aria-label={effectiveCollapsedLabel}\n aria-hidden={!isCollapsed}\n tabIndex={isCollapsed ? 0 : -1}\n >\n {effectiveCollapsedLabel}\n </button>\n\n <div\n className=\"web5-prompt-shell__content\"\n aria-hidden={isCollapsed}\n onFocus={handleContentFocus}\n onBlur={handleContentBlur}\n >\n {contextBanner}\n <div className=\"web5-prompt-shell__panel\">\n <div\n className={cn(\n 'web5-prompt-shell__stack',\n chipPosition === 'top' && 'web5-prompt-shell__stack--chips-top',\n )}\n >\n <div className=\"web5-prompt-search\" role=\"search\">\n <div className=\"web5-prompt-search__inner\">\n <div\n className={cn(\n 'web5-prompt-field',\n isFocused && 'web5-prompt-field--focused',\n isMultiline && 'web5-prompt-field--multiline',\n )}\n >\n <textarea\n ref={inputRef}\n rows={1}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={handleInputFocus}\n onBlur={() => setIsFocused(false)}\n placeholder={placeholder}\n aria-label=\"Search or ask a question\"\n aria-keyshortcuts=\"/ Control+K\"\n className=\"web5-prompt-input has-custom-focus placeholder:text-search-input-hint\"\n tabIndex={isCollapsed ? -1 : undefined}\n />\n\n <div className=\"web5-prompt-actions\">\n {showHint && (\n <span className=\"web5-prompt-hint\" aria-hidden=\"true\">\n Press <kbd className=\"web5-prompt-hint__key\">/</kbd>{' '}\n to search\n </span>\n )}\n {onVoiceInput && (\n <button\n type=\"button\"\n onClick={onVoiceInput}\n className=\"web5-prompt-voice\"\n aria-label=\"Voice input\"\n tabIndex={isCollapsed ? -1 : undefined}\n >\n <MicrophoneIcon />\n </button>\n )}\n <button\n type=\"button\"\n onClick={handleSubmit}\n className={cn(\n 'web5-prompt-submit',\n submitLabel && 'web5-prompt-submit--labeled',\n canSubmit && 'web5-prompt-submit--active',\n )}\n aria-label={submitLabel ?? 'Submit'}\n disabled={!canSubmit || isCollapsed}\n tabIndex={isCollapsed ? -1 : undefined}\n >\n {submitLabel ? (\n <>\n <span className=\"web5-prompt-submit__label\">\n {submitLabel}\n </span>\n <ArrowRightIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n </>\n ) : (\n <PromptSendIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {chipsMarkup}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,QAAQ,EACRC,MAAM,EACNC,WAAW,EACXC,eAAe,QACV,OAAO;AACd,SAAS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;IACtBE,SAAS,EAAC,mBAAmB;IAC7B,cAAW,aAAa;IACxBqF,QAAQ,EAAErE,WAAW,GAAG,CAAC,CAAC,GAAG8E;EAAU,gBAEvCtI,KAAA,CAAAW,aAAA,CAACW,cAAc,MAAE,CACX,CACT,eACDtB,KAAA,CAAAW,aAAA;IACEqH,IAAI,EAAC,QAAQ;IACbL,OAAO,EAAE1D,YAAa;IACtBzB,SAAS,EAAEhC,EAAE,CACX,oBAAoB,EACpBwB,WAAW,IAAI,6BAA6B,EAC5CoF,SAAS,IAAI,4BACf,CAAE;IACF,cAAYpF,WAAW,IAAI,QAAS;IACpCuG,QAAQ,EAAE,CAACnB,SAAS,IAAI5D,WAAY;IACpCqE,QAAQ,EAAErE,WAAW,GAAG,CAAC,CAAC,GAAG8E;EAAU,GAEtCtG,WAAW,gBACVhC,KAAA,CAAAW,aAAA,CAAAX,KAAA,CAAAwI,QAAA,qBACExI,KAAA,CAAAW,aAAA;IAAM6B,SAAS,EAAC;EAA2B,GACxCR,WACG,CAAC,eACPhC,KAAA,CAAAW,aAAA,CAACc,cAAc;IACb,eAAY,MAAM;IAClBe,SAAS,EAAC;EAAuB,CAClC,CACD,CAAC,gBAEHxC,KAAA,CAAAW,aAAA,CAACe,cAAc;IACb,eAAY,MAAM;IAClBc,SAAS,EAAC;EAAuB,CAClC,CAEG,CACL,CACF,CACF,CACF,CAAC,EAEL6E,WACE,CACF,CACF,CACF,CACF,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useEffect","useImperativeHandle","useState","useRef","useCallback","useLayoutEffect","cn","isWeb5Url","ArrowDownIcon","createElement","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","d","MicrophoneIcon","props","_extends","ArrowRightIcon","PromptSendIcon","SearchSection","_ref","ref","onSubmit","placeholder","submitLabel","collapsedLabel","onCollapsedChange","chips","chipDisplayMode","chipPosition","onVoiceInput","progressMessage","className","contextBanner","hasContext","canSubmitEmpty","hasContent","isBottomZoneVisible","onChipClick","onFocusChange","inputValue","setInputValue","isFocused","setIsFocused","hasFocusInside","setHasFocusInside","isMultiline","setIsMultiline","isCollapsed","setIsCollapsed","inputRef","hasExpandedWhileZoneVisibleRef","previouslyFocusedElementRef","showChips","length","effectiveCollapsedLabel","replace","handleSubmit","trimmedValue","trim","element","current","computedStyles","window","getComputedStyle","lineHeight","Number","parseFloat","hasValue","style","nextHeight","Math","min","max","scrollHeight","hasFocusInsideRef","onFocusChangeRef","focusInput","active","document","activeElement","HTMLElement","body","requestAnimationFrame","_inputRef$current","focus","_inputRef$current2","blurInput","_inputRef$current3","blur","handleKeyDown","e","key","_inputRef$current4","preventDefault","prev","shiftKey","handleInputChange","target","value","handleInputFocus","relatedTarget","handleContentFocus","handleContentBlur","next","currentTarget","contains","role","canSubmit","chipsMarkup","map","chip","label","href","onMouseDown","onClick","_inputRef$current5","tabIndex","handleExpandClick","showHint","type","onFocus","onBlur","rows","onChange","onKeyDown","undefined","disabled","Fragment"],"sources":["../../../../src/components/ui/SearchSection.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n useRef,\n useCallback,\n useLayoutEffect,\n} from 'react';\nimport { cn } from '../../lib/utils';\nimport { isWeb5Url } from '../../types/link-types';\n\nexport interface ScrollChip {\n label: string;\n href: string;\n iconHint?: string;\n}\n\nexport interface SearchSectionProps {\n onSubmit?: (value: string) => void;\n placeholder?: string;\n /**\n * When set, the submit control renders as a labeled CTA button (text +\n * right arrow) instead of the icon-only send button. Used by the empty\n * state (e.g. \"Find Your Pair\").\n */\n submitLabel?: string;\n collapsedLabel?: string;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n chips?: ScrollChip[];\n chipDisplayMode?: 'focus' | 'always';\n chipPosition?: 'top' | 'bottom';\n onVoiceInput?: () => void;\n progressMessage?: string;\n className?: string;\n contextBanner?: React.ReactNode;\n hasContext?: boolean;\n canSubmitEmpty?: boolean;\n hasContent?: boolean;\n isBottomZoneVisible?: boolean;\n onChipClick?: (e: React.MouseEvent<HTMLAnchorElement>, href: string) => void;\n onFocusChange?: (focused: boolean) => void;\n}\n\nexport interface SearchSectionHandle {\n focusInput: () => void;\n blurInput: () => void;\n}\n\nconst ArrowDownIcon: React.FC = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M12 5v14\" />\n <path d=\"m19 12-7 7-7-7\" />\n </svg>\n);\n\nconst MicrophoneIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z\" />\n <path\n d=\"M19 10v2a7 7 0 0 1-14 0v-2M12 19v3\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n fill=\"none\"\n />\n </svg>\n);\n\nconst ArrowRightIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n);\n\nconst PromptSendIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n {...props}\n >\n <path\n d=\"M13.0306 7.53114C12.9609 7.60106 12.8781 7.65654 12.787 7.69439C12.6958 7.73224 12.5981 7.75173 12.4993 7.75173C12.4006 7.75173 12.3029 7.73224 12.2117 7.69439C12.1206 7.65654 12.0378 7.60106 11.9681 7.53114L8.74997 4.31301V13.5005C8.74997 13.6994 8.67095 13.8902 8.5303 14.0308C8.38965 14.1715 8.19888 14.2505 7.99997 14.2505C7.80106 14.2505 7.61029 14.1715 7.46964 14.0308C7.32899 13.8902 7.24997 13.6994 7.24997 13.5005V4.31301L4.0306 7.53114C3.8897 7.67203 3.69861 7.75119 3.49935 7.75119C3.30009 7.75119 3.10899 7.67203 2.9681 7.53114C2.8272 7.39024 2.74805 7.19915 2.74805 6.99989C2.74805 6.80063 2.8272 6.60953 2.9681 6.46864L7.4681 1.96864C7.53778 1.89872 7.62057 1.84324 7.71173 1.80539C7.8029 1.76753 7.90064 1.74805 7.99935 1.74805C8.09806 1.74805 8.1958 1.76753 8.28696 1.80539C8.37813 1.84324 8.46092 1.89872 8.5306 1.96864L13.0306 6.46864C13.1005 6.53832 13.156 6.62111 13.1938 6.71227C13.2317 6.80344 13.2512 6.90118 13.2512 6.99989C13.2512 7.0986 13.2317 7.19634 13.1938 7.2875C13.156 7.37867 13.1005 7.46146 13.0306 7.53114Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport const SearchSection = forwardRef<\n SearchSectionHandle,\n SearchSectionProps\n>(function SearchSection(\n {\n onSubmit,\n placeholder = 'Talk to us',\n submitLabel,\n collapsedLabel,\n onCollapsedChange,\n chips = [],\n chipDisplayMode = 'focus',\n chipPosition = 'top',\n onVoiceInput,\n progressMessage,\n className = '',\n contextBanner,\n hasContext,\n canSubmitEmpty = false,\n hasContent = false,\n isBottomZoneVisible = false,\n onChipClick,\n onFocusChange,\n },\n ref,\n) {\n const [inputValue, setInputValue] = useState('');\n const [isFocused, setIsFocused] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [isMultiline, setIsMultiline] = useState(false);\n const [isCollapsed, setIsCollapsed] = useState(false);\n const inputRef = useRef<HTMLTextAreaElement>(null);\n const hasExpandedWhileZoneVisibleRef = useRef(false);\n const previouslyFocusedElementRef = useRef<HTMLElement | null>(null);\n const showChips =\n chips.length > 0 &&\n !hasContext &&\n (chipDisplayMode === 'always' || hasFocusInside);\n const effectiveCollapsedLabel =\n collapsedLabel ?? placeholder.replace(/\\.\\.\\.$/, '');\n\n const handleSubmit = useCallback(() => {\n const trimmedValue = inputValue.trim();\n if (trimmedValue || canSubmitEmpty) {\n onSubmit?.(trimmedValue);\n setInputValue('');\n }\n }, [canSubmitEmpty, inputValue, onSubmit]);\n\n useLayoutEffect(() => {\n const element = inputRef.current;\n if (!element) {\n return;\n }\n\n const computedStyles = window.getComputedStyle(element);\n const lineHeight = Number.parseFloat(computedStyles.lineHeight) || 32;\n\n const hasValue = inputValue.trim().length > 0;\n element.style.height = 'auto';\n const nextHeight = hasValue\n ? Math.min(Math.max(element.scrollHeight, lineHeight), 175)\n : lineHeight;\n element.style.height = `${nextHeight}px`;\n setIsMultiline(hasValue && nextHeight > lineHeight);\n }, [inputValue]);\n\n useEffect(() => {\n if (progressMessage || !hasContent) {\n setIsCollapsed(false);\n hasExpandedWhileZoneVisibleRef.current = false;\n return;\n }\n\n if (!isBottomZoneVisible) {\n hasExpandedWhileZoneVisibleRef.current = false;\n setIsCollapsed(false);\n return;\n }\n\n if (!hasExpandedWhileZoneVisibleRef.current) {\n setIsCollapsed(true);\n }\n }, [hasContent, isBottomZoneVisible, progressMessage]);\n\n useEffect(() => {\n onCollapsedChange?.(isCollapsed);\n }, [isCollapsed, onCollapsedChange]);\n\n const hasFocusInsideRef = useRef(hasFocusInside);\n hasFocusInsideRef.current = hasFocusInside;\n const onFocusChangeRef = useRef(onFocusChange);\n onFocusChangeRef.current = onFocusChange;\n\n useEffect(() => {\n onFocusChange?.(hasFocusInside);\n }, [hasFocusInside, onFocusChange]);\n\n useEffect(() => {\n return () => {\n if (hasFocusInsideRef.current) {\n onFocusChangeRef.current?.(false);\n }\n };\n }, []);\n\n const focusInput = useCallback(() => {\n const active = document.activeElement;\n if (\n active instanceof HTMLElement &&\n active !== inputRef.current &&\n active !== document.body\n ) {\n previouslyFocusedElementRef.current = active;\n }\n if (isCollapsed) {\n hasExpandedWhileZoneVisibleRef.current = true;\n setIsCollapsed(false);\n window.requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n } else {\n inputRef.current?.focus();\n }\n }, [isCollapsed]);\n\n const blurInput = useCallback(() => {\n inputRef.current?.blur();\n }, []);\n\n useImperativeHandle(ref, () => ({ focusInput, blurInput }), [\n focusInput,\n blurInput,\n ]);\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n const prev = previouslyFocusedElementRef.current;\n previouslyFocusedElementRef.current = null;\n inputRef.current?.blur();\n prev?.focus?.();\n return;\n }\n if (\n e.key === 'Enter' &&\n !e.shiftKey &&\n (inputValue.trim() || canSubmitEmpty)\n ) {\n e.preventDefault();\n handleSubmit();\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setInputValue(e.target.value);\n };\n\n const handleInputFocus = (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(true);\n if (\n e.relatedTarget instanceof HTMLElement &&\n e.relatedTarget !== inputRef.current\n ) {\n previouslyFocusedElementRef.current = e.relatedTarget;\n }\n };\n\n const handleContentFocus = () => {\n setHasFocusInside(true);\n };\n\n const handleContentBlur = (e: React.FocusEvent<HTMLDivElement>) => {\n const next = e.relatedTarget as Node | null;\n if (!next || !e.currentTarget.contains(next)) {\n setHasFocusInside(false);\n }\n };\n\n if (progressMessage) {\n return (\n <div\n className={cn('web5-prompt-progress', className)}\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <div className=\"web5-prompt-progress__indicator\" aria-hidden=\"true\">\n <ArrowDownIcon />\n </div>\n <div className=\"web5-prompt-progress__message\">{progressMessage}</div>\n </div>\n );\n }\n\n const canSubmit = inputValue.trim().length > 0 || canSubmitEmpty;\n const chipsMarkup =\n chips.length > 0 ? (\n <div\n className={cn(\n 'web5-prompt-shell__chips',\n chipPosition === 'bottom'\n ? 'web5-prompt-shell__chips--bottom'\n : 'web5-prompt-shell__chips--top',\n showChips\n ? 'web5-prompt-shell__chips--visible'\n : 'web5-prompt-shell__chips--hidden',\n )}\n aria-hidden={isCollapsed || !showChips}\n >\n {chips.map((chip) => (\n <a\n key={chip.label}\n href={isWeb5Url(chip.href) ? '#' : chip.href}\n onMouseDown={(e) => e.preventDefault()}\n onClick={(e) => {\n e.preventDefault();\n onChipClick?.(e, chip.href);\n setInputValue('');\n inputRef.current?.blur();\n }}\n tabIndex={!isCollapsed && showChips ? 0 : -1}\n // `has-custom-focus` opts out of Wix Thunderbolt's global keyboard focus ring\n // so our inset :focus-visible ring isn't overwritten when embedded in a Wix site.\n className=\"web5-prompt-chip has-custom-focus\"\n >\n {chip.label}\n <PromptSendIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n </a>\n ))}\n </div>\n ) : null;\n\n const handleExpandClick = () => {\n focusInput();\n };\n\n const showHint = inputValue === '' && !isFocused && !isCollapsed;\n\n return (\n <div\n className={cn(\n 'web5-prompt-shell',\n isCollapsed && 'web5-prompt-shell--collapsed',\n // Widens the pill while the field or a chip holds focus. Driven by\n // `hasFocusInside` rather than `isFocused` so clicking a chip (which\n // preventDefaults its mousedown) doesn't collapse the width mid-click.\n hasFocusInside && !isCollapsed && 'web5-prompt-shell--focused',\n className,\n )}\n >\n <div className=\"web5-prompt-shell__stage\">\n <button\n type=\"button\"\n className=\"web5-prompt-shell__collapsed-button has-custom-focus\"\n onClick={handleExpandClick}\n aria-label={effectiveCollapsedLabel}\n aria-hidden={!isCollapsed}\n tabIndex={isCollapsed ? 0 : -1}\n >\n {effectiveCollapsedLabel}\n </button>\n\n <div\n className=\"web5-prompt-shell__content\"\n aria-hidden={isCollapsed}\n onFocus={handleContentFocus}\n onBlur={handleContentBlur}\n >\n {contextBanner}\n <div className=\"web5-prompt-shell__panel\">\n <div\n className={cn(\n 'web5-prompt-shell__stack',\n chipPosition === 'top' && 'web5-prompt-shell__stack--chips-top',\n )}\n >\n <div className=\"web5-prompt-search\" role=\"search\">\n <div className=\"web5-prompt-search__inner\">\n <div\n className={cn(\n 'web5-prompt-field',\n isFocused && 'web5-prompt-field--focused',\n isMultiline && 'web5-prompt-field--multiline',\n )}\n >\n <textarea\n ref={inputRef}\n rows={1}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={handleInputFocus}\n onBlur={() => setIsFocused(false)}\n placeholder={placeholder}\n aria-label=\"Search or ask a question\"\n aria-keyshortcuts=\"/ Control+K\"\n className=\"web5-prompt-input has-custom-focus placeholder:text-search-input-hint\"\n tabIndex={isCollapsed ? -1 : undefined}\n />\n\n <div className=\"web5-prompt-actions\">\n {showHint && (\n <span className=\"web5-prompt-hint\" aria-hidden=\"true\">\n Press <kbd className=\"web5-prompt-hint__key\">/</kbd>{' '}\n to search\n </span>\n )}\n {onVoiceInput && (\n <button\n type=\"button\"\n onClick={onVoiceInput}\n className=\"web5-prompt-voice\"\n aria-label=\"Voice input\"\n tabIndex={isCollapsed ? -1 : undefined}\n >\n <MicrophoneIcon />\n </button>\n )}\n <button\n type=\"button\"\n onClick={handleSubmit}\n className={cn(\n 'web5-prompt-submit',\n submitLabel && 'web5-prompt-submit--labeled',\n canSubmit && 'web5-prompt-submit--active',\n )}\n aria-label={submitLabel ?? 'Submit'}\n disabled={!canSubmit || isCollapsed}\n tabIndex={isCollapsed ? -1 : undefined}\n >\n {submitLabel ? (\n <>\n <span className=\"web5-prompt-submit__label\">\n {submitLabel}\n </span>\n <ArrowRightIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n </>\n ) : (\n <PromptSendIcon\n aria-hidden=\"true\"\n className=\"web5-prompt-send-icon\"\n />\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n\n {chipsMarkup}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n});\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,QAAQ,EACRC,MAAM,EACNC,WAAW,EACXC,eAAe,QACV,OAAO;AACd,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,wBAAwB;AAuClD,MAAMC,aAAuB,GAAGA,CAAA,kBAC9BV,KAAA,CAAAW,aAAA;EACEC,KAAK,EAAC,4BAA4B;EAClCC,KAAK,EAAC,IAAI;EACVC,MAAM,EAAC,IAAI;EACXC,OAAO,EAAC,WAAW;EACnBC,IAAI,EAAC,MAAM;EACXC,MAAM,EAAC,cAAc;EACrBC,WAAW,EAAC,GAAG;EACfC,aAAa,EAAC,OAAO;EACrBC,cAAc,EAAC,OAAO;EACtB,eAAY;AAAM,gBAElBpB,KAAA,CAAAW,aAAA;EAAMU,CAAC,EAAC;AAAU,CAAE,CAAC,eACrBrB,KAAA,CAAAW,aAAA;EAAMU,CAAC,EAAC;AAAgB,CAAE,CACvB,CACN;AAED,MAAMC,cAAuD,GAAIC,KAAK,iBACpEvB,KAAA,CAAAW,aAAA,QAAAa,QAAA;EACEZ,KAAK,EAAC,4BAA4B;EAClCC,KAAK,EAAC,IAAI;EACVC,MAAM,EAAC,IAAI;EACXC,OAAO,EAAC,WAAW;EACnBC,IAAI,EAAC,cAAc;EACnBC,MAAM,EAAC,MAAM;EACb,eAAY;AAAM,GACdM,KAAK,gBAETvB,KAAA,CAAAW,aAAA;EAAMU,CAAC,EAAC;AAAsD,CAAE,CAAC,eACjErB,KAAA,CAAAW,aAAA;EACEU,CAAC,EAAC,oCAAoC;EACtCJ,MAAM,EAAC,cAAc;EACrBC,W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ACF,CAAC,EAEL6E,WACE,CACF,CACF,CACF,CACF,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
package/dist/esm/index.js
CHANGED
|
@@ -17,7 +17,7 @@ export { DIAGNOSTIC_TYPES } from './component/diagnosticTypes.js';
|
|
|
17
17
|
export { buildImageSearchFilter } from './image/imageSearchFilterTypes.js';
|
|
18
18
|
export { ImageSearchFilterToken, backgroundFilter } from './image/imageSearchFilters.js';
|
|
19
19
|
// Section definition classes + createSdkRegistry
|
|
20
|
-
export { HeroSectionDefinition, HeroEntitySectionDefinition, KpiSectionDefinition, FeatureCardsSectionDefinition, EntitySectionDefinition, ComparisonSectionDefinition, TextBlockSectionDefinition, CtaBannerSectionDefinition, CalloutSectionDefinition, NextStepsSectionDefinition, FeatureSection9PlusDefinition, ListItemsSectionDefinition, SkipNodesSectionDefinition, HtmlCommentSectionDefinition, SearchSectionDefinition, ErrorSectionDefinition, FallbackSectionDefinition, createSdkRegistry } from './component/componentDefinitions/index.js';
|
|
20
|
+
export { HeroSectionDefinition, HeroEntitySectionDefinition, KpiSectionDefinition, FeatureCardsSectionDefinition, EntitySectionDefinition, EntityCollectionSectionDefinition, ComparisonSectionDefinition, TextBlockSectionDefinition, CtaBannerSectionDefinition, CalloutSectionDefinition, NextStepsSectionDefinition, FeatureSection9PlusDefinition, ListItemsSectionDefinition, SkipNodesSectionDefinition, HtmlCommentSectionDefinition, SearchSectionDefinition, ErrorSectionDefinition, FallbackSectionDefinition, createSdkRegistry } from './component/componentDefinitions/index.js';
|
|
21
21
|
|
|
22
22
|
// Registry
|
|
23
23
|
export { ComponentRegistry } from './registry/index.js';
|
|
@@ -134,6 +134,12 @@ export { loadClientBundle } from './client/loadClientBundle.js';
|
|
|
134
134
|
// `embed-placement` so the trusted-host gate can't drift between them.
|
|
135
135
|
export { getClientBundleOverride, isTrustedBundleHost } from './client/clientBundleOverride.js';
|
|
136
136
|
|
|
137
|
+
// Client-UMD URL resolution (DL #094 per-msid, DL #129 per-template) and the
|
|
138
|
+
// universal bundle←backend config merge (DL #129 Q3/Q7) — shared by
|
|
139
|
+
// `web50-server-ui` and `embed-placement`, the two client-bundle load sites.
|
|
140
|
+
export { resolveClientBundleUrl } from './client/clientBundleUrl.js';
|
|
141
|
+
export { mergeClientConfig } from './client/mergeClientConfig.js';
|
|
142
|
+
|
|
137
143
|
// Placement renderer + DI helper (DL #088 D3.2, D3.4)
|
|
138
144
|
export { PlacementResponseRenderer, PlacementSmoothHeight } from './components/placement/PlacementResponseRenderer.js';
|
|
139
145
|
export { buildPlacementDependencies } from './components/placement/buildPlacementDependencies.js';
|
|
@@ -149,6 +155,7 @@ export { createPageSection, generateSectionId, generateId, findImageInNode, find
|
|
|
149
155
|
export { DiagnosticsCollector } from './utils/diagnosticsCollector.js';
|
|
150
156
|
export { REFRESH_PROMPTS_UNTIL_KEY, REFRESH_PROMPTS_WINDOW_MS, getRefreshPromptsExpiry, shouldRefreshPrompts, enableRefreshPrompts, disableRefreshPrompts } from './utils/refreshPrompts.js';
|
|
151
157
|
export { BACKEND_ENVIRONMENT_KEY, BACKEND_ENVIRONMENT_QUERY_PARAM, DEFAULT_BACKEND_ENVIRONMENT, getBackendEnvironment, setBackendEnvironment, usesStagingBackend } from './utils/backendEnvironment.js';
|
|
158
|
+
export { MATCH_DEBUG_KEY, MATCH_DEBUG_QUERY_PARAM, isMatchDebugEnabled, setMatchDebug, resetMatchDebugCache, logMatchDebug } from './utils/matchDebug.js';
|
|
152
159
|
export { createWixAuthFetch } from './client/wixAuthFetch.js';
|
|
153
160
|
export { getOrCreateSessionId, getSessionId, getChatId, startNewChatId, setChatId, resetChatIdForTests } from './utils/sessionManager.js';
|
|
154
161
|
|