@wix/web5-core 1.56.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/README.md +8 -0
- package/dist/cjs/client/clientBundleOverride.js +48 -0
- package/dist/cjs/client/clientBundleOverride.js.map +1 -0
- package/dist/cjs/client/devEnvironment.js +4 -0
- package/dist/cjs/client/devEnvironment.js.map +1 -0
- package/dist/cjs/client/loadClientBundle.js +85 -0
- package/dist/cjs/client/loadClientBundle.js.map +1 -0
- package/dist/cjs/client/wixAuthFetch.js +73 -0
- package/dist/cjs/client/wixAuthFetch.js.map +1 -0
- package/dist/cjs/clients.js +15 -0
- package/dist/cjs/clients.js.map +1 -0
- package/dist/cjs/color/colorUtils.js +126 -0
- package/dist/cjs/color/colorUtils.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/CalloutSectionDefinition.js +67 -0
- package/dist/cjs/component/componentDefinitions/CalloutSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js +141 -0
- package/dist/cjs/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/CtaBannerSectionDefinition.js +85 -0
- package/dist/cjs/component/componentDefinitions/CtaBannerSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/EntitySectionDefinition.js +171 -0
- package/dist/cjs/component/componentDefinitions/EntitySectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/ErrorSectionDefinition.js +81 -0
- package/dist/cjs/component/componentDefinitions/ErrorSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/FallbackSectionDefinition.js +29 -0
- package/dist/cjs/component/componentDefinitions/FallbackSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/FeatureCardsSectionDefinition.js +119 -0
- package/dist/cjs/component/componentDefinitions/FeatureCardsSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js +75 -0
- package/dist/cjs/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js +124 -0
- package/dist/cjs/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js +209 -0
- package/dist/cjs/component/componentDefinitions/HeroSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/HtmlCommentSectionDefinition.js +19 -0
- package/dist/cjs/component/componentDefinitions/HtmlCommentSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/KpiSectionDefinition.js +114 -0
- package/dist/cjs/component/componentDefinitions/KpiSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js +136 -0
- package/dist/cjs/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/SearchSectionDefinition.js +18 -0
- package/dist/cjs/component/componentDefinitions/SearchSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/SkipNodesSectionDefinition.js +20 -0
- package/dist/cjs/component/componentDefinitions/SkipNodesSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js +65 -0
- package/dist/cjs/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/index.js +48 -0
- package/dist/cjs/component/componentDefinitions/index.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js +86 -0
- package/dist/cjs/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/parse-utils.js +434 -0
- package/dist/cjs/component/componentDefinitions/parse-utils.js.map +1 -0
- package/dist/cjs/component/componentDefinitions/specHelpers.js +36 -0
- package/dist/cjs/component/componentDefinitions/specHelpers.js.map +1 -0
- package/dist/cjs/component/componentParser.js +365 -0
- package/dist/cjs/component/componentParser.js.map +1 -0
- package/dist/cjs/component/diagnosticTypes.js +30 -0
- package/dist/cjs/component/diagnosticTypes.js.map +1 -0
- package/dist/cjs/component/parser-types.js +4 -0
- package/dist/cjs/component/parser-types.js.map +1 -0
- package/dist/cjs/component/section-definition.js +4 -0
- package/dist/cjs/component/section-definition.js.map +1 -0
- package/dist/cjs/component/types.js +4 -0
- package/dist/cjs/component/types.js.map +1 -0
- package/dist/cjs/components/placement/PlacementPayloadContext.js +29 -0
- package/dist/cjs/components/placement/PlacementPayloadContext.js.map +1 -0
- package/dist/cjs/components/placement/PlacementResponseRenderer.css +269 -0
- package/dist/cjs/components/placement/PlacementResponseRenderer.js +259 -0
- package/dist/cjs/components/placement/PlacementResponseRenderer.js.map +1 -0
- package/dist/cjs/components/placement/buildPlacementDependencies.js +214 -0
- package/dist/cjs/components/placement/buildPlacementDependencies.js.map +1 -0
- package/dist/cjs/components/ui/BottomContainer.js +26 -0
- package/dist/cjs/components/ui/BottomContainer.js.map +1 -0
- package/dist/cjs/components/ui/CalloutBlock.js +156 -0
- package/dist/cjs/components/ui/CalloutBlock.js.map +1 -0
- package/dist/cjs/components/ui/Disclaimer.css +35 -0
- package/dist/cjs/components/ui/Disclaimer.js +56 -0
- package/dist/cjs/components/ui/Disclaimer.js.map +1 -0
- package/dist/cjs/components/ui/FeedbackBar.css +267 -0
- package/dist/cjs/components/ui/FeedbackBar.js +417 -0
- package/dist/cjs/components/ui/FeedbackBar.js.map +1 -0
- package/dist/cjs/components/ui/Loader.js +73 -0
- package/dist/cjs/components/ui/Loader.js.map +1 -0
- package/dist/cjs/components/ui/MarkdownText.js +419 -0
- package/dist/cjs/components/ui/MarkdownText.js.map +1 -0
- package/dist/cjs/components/ui/OptimizedImage.js +414 -0
- package/dist/cjs/components/ui/OptimizedImage.js.map +1 -0
- package/dist/cjs/components/ui/PlacementLoader.css +101 -0
- package/dist/cjs/components/ui/PlacementLoader.js +62 -0
- package/dist/cjs/components/ui/PlacementLoader.js.map +1 -0
- package/dist/cjs/components/ui/PromptEntryEmptyState.css +172 -0
- package/dist/cjs/components/ui/PromptEntryEmptyState.js +96 -0
- package/dist/cjs/components/ui/PromptEntryEmptyState.js.map +1 -0
- package/dist/cjs/components/ui/SearchSection.css +538 -0
- package/dist/cjs/components/ui/SearchSection.js +550 -0
- package/dist/cjs/components/ui/SearchSection.js.map +1 -0
- package/dist/cjs/components/ui/SectionSkeleton.css +109 -0
- package/dist/cjs/components/ui/SectionSkeleton.js +190 -0
- package/dist/cjs/components/ui/SectionSkeleton.js.map +1 -0
- package/dist/cjs/components/ui/SmartIcon.js +122 -0
- package/dist/cjs/components/ui/SmartIcon.js.map +1 -0
- package/dist/cjs/components/ui/UnifiedLink.js +169 -0
- package/dist/cjs/components/ui/UnifiedLink.js.map +1 -0
- package/dist/cjs/components/ui/UserQuery.js +348 -0
- package/dist/cjs/components/ui/UserQuery.js.map +1 -0
- package/dist/cjs/components/ui/icons/ArrowTopRightIcon.js +37 -0
- package/dist/cjs/components/ui/icons/ArrowTopRightIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/ArrowUpIcon.js +61 -0
- package/dist/cjs/components/ui/icons/ArrowUpIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/CheckIcon.js +37 -0
- package/dist/cjs/components/ui/icons/CheckIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/CommentIcon.js +34 -0
- package/dist/cjs/components/ui/icons/CommentIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/PlusIcon.js +51 -0
- package/dist/cjs/components/ui/icons/PlusIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/RedoIcon.js +51 -0
- package/dist/cjs/components/ui/icons/RedoIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/ShareIcon.js +81 -0
- package/dist/cjs/components/ui/icons/ShareIcon.js.map +1 -0
- package/dist/cjs/components/ui/icons/UndoIcon.js +51 -0
- package/dist/cjs/components/ui/icons/UndoIcon.js.map +1 -0
- package/dist/cjs/components/ui/table.js +159 -0
- package/dist/cjs/components/ui/table.js.map +1 -0
- package/dist/cjs/context/ChipsContext.js +12 -0
- package/dist/cjs/context/ChipsContext.js.map +1 -0
- package/dist/cjs/context/ComponentDependenciesContext.js +32 -0
- package/dist/cjs/context/ComponentDependenciesContext.js.map +1 -0
- package/dist/cjs/entity/defaultExtractor.js +117 -0
- package/dist/cjs/entity/defaultExtractor.js.map +1 -0
- package/dist/cjs/entity/enrichEntitiesFromPayload.js +39 -0
- package/dist/cjs/entity/enrichEntitiesFromPayload.js.map +1 -0
- package/dist/cjs/entity/fetchEntityListData.js +78 -0
- package/dist/cjs/entity/fetchEntityListData.js.map +1 -0
- package/dist/cjs/entity/index.js +41 -0
- package/dist/cjs/entity/index.js.map +1 -0
- package/dist/cjs/entity/types.js +4 -0
- package/dist/cjs/entity/types.js.map +1 -0
- package/dist/cjs/errors/conversationErrorTypes.js +56 -0
- package/dist/cjs/errors/conversationErrorTypes.js.map +1 -0
- package/dist/cjs/errors/errorTemplates.js +86 -0
- package/dist/cjs/errors/errorTemplates.js.map +1 -0
- package/dist/cjs/errors/index.js +13 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/external-types.d.js +2 -0
- package/dist/cjs/external-types.d.js.map +1 -0
- package/dist/cjs/featureToggles/FeatureToggleContext.js +44 -0
- package/dist/cjs/featureToggles/FeatureToggleContext.js.map +1 -0
- package/dist/cjs/hooks/useConversation.js +10 -0
- package/dist/cjs/hooks/useConversation.js.map +1 -0
- package/dist/cjs/hooks/useDebugImageContext.js +10 -0
- package/dist/cjs/hooks/useDebugImageContext.js.map +1 -0
- package/dist/cjs/hooks/useEntityTransforms.js +10 -0
- package/dist/cjs/hooks/useEntityTransforms.js.map +1 -0
- package/dist/cjs/hooks/useMarkdownUtils.js +10 -0
- package/dist/cjs/hooks/useMarkdownUtils.js.map +1 -0
- package/dist/cjs/hooks/useResolveGenericEntityData.js +10 -0
- package/dist/cjs/hooks/useResolveGenericEntityData.js.map +1 -0
- package/dist/cjs/hooks/useResolveSearchSpringEntityData.js +146 -0
- package/dist/cjs/hooks/useResolveSearchSpringEntityData.js.map +1 -0
- package/dist/cjs/hooks/useResolveShopifyEntityData.js +190 -0
- package/dist/cjs/hooks/useResolveShopifyEntityData.js.map +1 -0
- package/dist/cjs/hooks/useResolvedImageSources.js +160 -0
- package/dist/cjs/hooks/useResolvedImageSources.js.map +1 -0
- package/dist/cjs/hooks/useWeb5Link.js +10 -0
- package/dist/cjs/hooks/useWeb5Link.js.map +1 -0
- package/dist/cjs/image/contextualImageTypes.js +4 -0
- package/dist/cjs/image/contextualImageTypes.js.map +1 -0
- package/dist/cjs/image/imageSearchFilterTypes.js +19 -0
- package/dist/cjs/image/imageSearchFilterTypes.js.map +1 -0
- package/dist/cjs/image/imageSearchFilters.js +22 -0
- package/dist/cjs/image/imageSearchFilters.js.map +1 -0
- package/dist/cjs/index.js +285 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/utils.js +33 -0
- package/dist/cjs/lib/utils.js.map +1 -0
- package/dist/cjs/markdownBlocks.js +645 -0
- package/dist/cjs/markdownBlocks.js.map +1 -0
- package/dist/cjs/match/astToParts.js +374 -0
- package/dist/cjs/match/astToParts.js.map +1 -0
- package/dist/cjs/match/extractProps.js +654 -0
- package/dist/cjs/match/extractProps.js.map +1 -0
- package/dist/cjs/match/index.js +11 -0
- package/dist/cjs/match/index.js.map +1 -0
- package/dist/cjs/match/matchAllSections.js +34 -0
- package/dist/cjs/match/matchAllSections.js.map +1 -0
- package/dist/cjs/match/matchMarkdown.js +39 -0
- package/dist/cjs/match/matchMarkdown.js.map +1 -0
- package/dist/cjs/parts/parts.js +183 -0
- package/dist/cjs/parts/parts.js.map +1 -0
- package/dist/cjs/patternAnalyzer/conflictDetector.js +103 -0
- package/dist/cjs/patternAnalyzer/conflictDetector.js.map +1 -0
- package/dist/cjs/patternAnalyzer/index.js +40 -0
- package/dist/cjs/patternAnalyzer/index.js.map +1 -0
- package/dist/cjs/patternAnalyzer/markdownGenerator.js +347 -0
- package/dist/cjs/patternAnalyzer/markdownGenerator.js.map +1 -0
- package/dist/cjs/patternAnalyzer/mergeDetector.js +505 -0
- package/dist/cjs/patternAnalyzer/mergeDetector.js.map +1 -0
- package/dist/cjs/patternAnalyzer/parserValidator.js +56 -0
- package/dist/cjs/patternAnalyzer/parserValidator.js.map +1 -0
- package/dist/cjs/patternAnalyzer/patternWriter.js +106 -0
- package/dist/cjs/patternAnalyzer/patternWriter.js.map +1 -0
- package/dist/cjs/patternAnalyzer/run.js +140 -0
- package/dist/cjs/patternAnalyzer/run.js.map +1 -0
- package/dist/cjs/patternAnalyzer/types.js +4 -0
- package/dist/cjs/patternAnalyzer/types.js.map +1 -0
- package/dist/cjs/patternValidator/ERROR_MESSAGES.md +110 -0
- package/dist/cjs/patternValidator/README.md +757 -0
- package/dist/cjs/patternValidator/automaton.js +349 -0
- package/dist/cjs/patternValidator/automaton.js.map +1 -0
- package/dist/cjs/patternValidator/index.js +196 -0
- package/dist/cjs/patternValidator/index.js.map +1 -0
- package/dist/cjs/patternValidator/lexer.js +218 -0
- package/dist/cjs/patternValidator/lexer.js.map +1 -0
- package/dist/cjs/patternValidator/matcher.js +722 -0
- package/dist/cjs/patternValidator/matcher.js.map +1 -0
- package/dist/cjs/patternValidator/parser.js +533 -0
- package/dist/cjs/patternValidator/parser.js.map +1 -0
- package/dist/cjs/patternValidator/types.js +4 -0
- package/dist/cjs/patternValidator/types.js.map +1 -0
- package/dist/cjs/patternValidator/validator.test.js +1277 -0
- package/dist/cjs/patternValidator/validator.test.js.map +1 -0
- package/dist/cjs/registry/ComponentRegistry.js +438 -0
- package/dist/cjs/registry/ComponentRegistry.js.map +1 -0
- package/dist/cjs/registry/Intent.js +19 -0
- package/dist/cjs/registry/Intent.js.map +1 -0
- package/dist/cjs/registry/index.js +9 -0
- package/dist/cjs/registry/index.js.map +1 -0
- package/dist/cjs/registry/types.js +4 -0
- package/dist/cjs/registry/types.js.map +1 -0
- package/dist/cjs/services/cart/addToCart.js +147 -0
- package/dist/cjs/services/cart/addToCart.js.map +1 -0
- package/dist/cjs/services/cart/index.js +7 -0
- package/dist/cjs/services/cart/index.js.map +1 -0
- package/dist/cjs/services/searchspring/index.js +10 -0
- package/dist/cjs/services/searchspring/index.js.map +1 -0
- package/dist/cjs/services/searchspring/searchSpringClient.js +49 -0
- package/dist/cjs/services/searchspring/searchSpringClient.js.map +1 -0
- package/dist/cjs/services/searchspring/transformSSProduct.js +70 -0
- package/dist/cjs/services/searchspring/transformSSProduct.js.map +1 -0
- package/dist/cjs/services/searchspring/types.js +4 -0
- package/dist/cjs/services/searchspring/types.js.map +1 -0
- package/dist/cjs/services/shopify/globals.d.js +4 -0
- package/dist/cjs/services/shopify/globals.d.js.map +1 -0
- package/dist/cjs/services/shopify/index.js +22 -0
- package/dist/cjs/services/shopify/index.js.map +1 -0
- package/dist/cjs/services/shopify/queries.js +214 -0
- package/dist/cjs/services/shopify/queries.js.map +1 -0
- package/dist/cjs/services/shopify/resolveStoreDomain.js +28 -0
- package/dist/cjs/services/shopify/resolveStoreDomain.js.map +1 -0
- package/dist/cjs/services/shopify/shopifyEntityResolver.js +109 -0
- package/dist/cjs/services/shopify/shopifyEntityResolver.js.map +1 -0
- package/dist/cjs/services/shopify/shopifyStorefrontClient.js +58 -0
- package/dist/cjs/services/shopify/shopifyStorefrontClient.js.map +1 -0
- package/dist/cjs/services/shopify/transformShopifyEntity.js +137 -0
- package/dist/cjs/services/shopify/transformShopifyEntity.js.map +1 -0
- package/dist/cjs/services/shopify/types.js +4 -0
- package/dist/cjs/services/shopify/types.js.map +1 -0
- package/dist/cjs/styles/base-tokens.css +152 -0
- package/dist/cjs/styles/base-utilities.css +424 -0
- package/dist/cjs/styles/components.css +6 -0
- package/dist/cjs/styles/prompt-input-tokens.css +136 -0
- package/dist/cjs/styles/tailwind-theme.css +138 -0
- package/dist/cjs/test-types.d.js +2 -0
- package/dist/cjs/test-types.d.js.map +1 -0
- package/dist/cjs/testUtils.js +25 -0
- package/dist/cjs/testUtils.js.map +1 -0
- package/dist/cjs/types/answerUpdatedEvent.js +20 -0
- package/dist/cjs/types/answerUpdatedEvent.js.map +1 -0
- package/dist/cjs/types/blog.js +4 -0
- package/dist/cjs/types/blog.js.map +1 -0
- package/dist/cjs/types/callout.js +6 -0
- package/dist/cjs/types/callout.js.map +1 -0
- package/dist/cjs/types/dependencies.js +4 -0
- package/dist/cjs/types/dependencies.js.map +1 -0
- package/dist/cjs/types/entity.js +4 -0
- package/dist/cjs/types/entity.js.map +1 -0
- package/dist/cjs/types/link-types.js +62 -0
- package/dist/cjs/types/link-types.js.map +1 -0
- package/dist/cjs/types/page-section.js +4 -0
- package/dist/cjs/types/page-section.js.map +1 -0
- package/dist/cjs/types/placement.js +4 -0
- package/dist/cjs/types/placement.js.map +1 -0
- package/dist/cjs/types/redirectEvent.js +27 -0
- package/dist/cjs/types/redirectEvent.js.map +1 -0
- package/dist/cjs/types/userQueryEvent.js +19 -0
- package/dist/cjs/types/userQueryEvent.js.map +1 -0
- package/dist/cjs/utils/analyticsEvents.js +91 -0
- package/dist/cjs/utils/analyticsEvents.js.map +1 -0
- package/dist/cjs/utils/componentTracking.js +90 -0
- package/dist/cjs/utils/componentTracking.js.map +1 -0
- package/dist/cjs/utils/contentKeywordMatcher.js +56 -0
- package/dist/cjs/utils/contentKeywordMatcher.js.map +1 -0
- package/dist/cjs/utils/conversationApi.js +52 -0
- package/dist/cjs/utils/conversationApi.js.map +1 -0
- package/dist/cjs/utils/conversationMode.js +23 -0
- package/dist/cjs/utils/conversationMode.js.map +1 -0
- package/dist/cjs/utils/diagnosticsCollector.js +58 -0
- package/dist/cjs/utils/diagnosticsCollector.js.map +1 -0
- package/dist/cjs/utils/entityLinkParser.js +256 -0
- package/dist/cjs/utils/entityLinkParser.js.map +1 -0
- package/dist/cjs/utils/htmlCommentParser.js +122 -0
- package/dist/cjs/utils/htmlCommentParser.js.map +1 -0
- package/dist/cjs/utils/image-utils.js +49 -0
- package/dist/cjs/utils/image-utils.js.map +1 -0
- package/dist/cjs/utils/intentExtractor.js +47 -0
- package/dist/cjs/utils/intentExtractor.js.map +1 -0
- package/dist/cjs/utils/markdownPreprocessor.js +268 -0
- package/dist/cjs/utils/markdownPreprocessor.js.map +1 -0
- package/dist/cjs/utils/navigationStack.js +35 -0
- package/dist/cjs/utils/navigationStack.js.map +1 -0
- package/dist/cjs/utils/nodeMatchers.js +43 -0
- package/dist/cjs/utils/nodeMatchers.js.map +1 -0
- package/dist/cjs/utils/propsExtractor.js +66 -0
- package/dist/cjs/utils/propsExtractor.js.map +1 -0
- package/dist/cjs/utils/sessionManager.js +161 -0
- package/dist/cjs/utils/sessionManager.js.map +1 -0
- package/dist/cjs/utils/unifiedMarkdownParser.js +44 -0
- package/dist/cjs/utils/unifiedMarkdownParser.js.map +1 -0
- package/dist/cjs/utils/web5LinkValidator.js +56 -0
- package/dist/cjs/utils/web5LinkValidator.js.map +1 -0
- package/dist/cjs/utils/web5LinkValidator.test.js +115 -0
- package/dist/cjs/utils/web5LinkValidator.test.js.map +1 -0
- package/dist/esm/client/clientBundleOverride.js +43 -0
- package/dist/esm/client/clientBundleOverride.js.map +1 -0
- package/dist/esm/client/devEnvironment.js +2 -0
- package/dist/esm/client/devEnvironment.js.map +1 -0
- package/dist/esm/client/loadClientBundle.js +82 -0
- package/dist/esm/client/loadClientBundle.js.map +1 -0
- package/dist/esm/client/wixAuthFetch.js +68 -0
- package/dist/esm/client/wixAuthFetch.js.map +1 -0
- package/dist/esm/clients.js +11 -0
- package/dist/esm/clients.js.map +1 -0
- package/dist/esm/color/colorUtils.js +118 -0
- package/dist/esm/color/colorUtils.js.map +1 -0
- package/dist/esm/component/componentDefinitions/CalloutSectionDefinition.js +61 -0
- package/dist/esm/component/componentDefinitions/CalloutSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js +135 -0
- package/dist/esm/component/componentDefinitions/ComparisonSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/CtaBannerSectionDefinition.js +79 -0
- package/dist/esm/component/componentDefinitions/CtaBannerSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/EntitySectionDefinition.js +165 -0
- package/dist/esm/component/componentDefinitions/EntitySectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/ErrorSectionDefinition.js +75 -0
- package/dist/esm/component/componentDefinitions/ErrorSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/FallbackSectionDefinition.js +23 -0
- package/dist/esm/component/componentDefinitions/FallbackSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/FeatureCardsSectionDefinition.js +113 -0
- package/dist/esm/component/componentDefinitions/FeatureCardsSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js +69 -0
- package/dist/esm/component/componentDefinitions/FeatureSection9PlusDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js +119 -0
- package/dist/esm/component/componentDefinitions/HeroEntitySectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js +203 -0
- package/dist/esm/component/componentDefinitions/HeroSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/HtmlCommentSectionDefinition.js +13 -0
- package/dist/esm/component/componentDefinitions/HtmlCommentSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/KpiSectionDefinition.js +108 -0
- package/dist/esm/component/componentDefinitions/KpiSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js +130 -0
- package/dist/esm/component/componentDefinitions/NextStepsSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/SearchSectionDefinition.js +12 -0
- package/dist/esm/component/componentDefinitions/SearchSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/SkipNodesSectionDefinition.js +14 -0
- package/dist/esm/component/componentDefinitions/SkipNodesSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js +59 -0
- package/dist/esm/component/componentDefinitions/TextBlockSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/index.js +45 -0
- package/dist/esm/component/componentDefinitions/index.js.map +1 -0
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js +80 -0
- package/dist/esm/component/componentDefinitions/listItemsSectionDefinition.js.map +1 -0
- package/dist/esm/component/componentDefinitions/parse-utils.js +412 -0
- package/dist/esm/component/componentDefinitions/parse-utils.js.map +1 -0
- package/dist/esm/component/componentDefinitions/specHelpers.js +31 -0
- package/dist/esm/component/componentDefinitions/specHelpers.js.map +1 -0
- package/dist/esm/component/componentParser.js +358 -0
- package/dist/esm/component/componentParser.js.map +1 -0
- package/dist/esm/component/diagnosticTypes.js +26 -0
- package/dist/esm/component/diagnosticTypes.js.map +1 -0
- package/dist/esm/component/parser-types.js +2 -0
- package/dist/esm/component/parser-types.js.map +1 -0
- package/dist/esm/component/section-definition.js +2 -0
- package/dist/esm/component/section-definition.js.map +1 -0
- package/dist/esm/component/types.js +2 -0
- package/dist/esm/component/types.js.map +1 -0
- package/dist/esm/components/placement/PlacementPayloadContext.js +24 -0
- package/dist/esm/components/placement/PlacementPayloadContext.js.map +1 -0
- package/dist/esm/components/placement/PlacementResponseRenderer.css +269 -0
- package/dist/esm/components/placement/PlacementResponseRenderer.js +173 -0
- package/dist/esm/components/placement/PlacementResponseRenderer.js.map +1 -0
- package/dist/esm/components/placement/buildPlacementDependencies.js +212 -0
- package/dist/esm/components/placement/buildPlacementDependencies.js.map +1 -0
- package/dist/esm/components/ui/BottomContainer.js +14 -0
- package/dist/esm/components/ui/BottomContainer.js.map +1 -0
- package/dist/esm/components/ui/CalloutBlock.js +118 -0
- package/dist/esm/components/ui/CalloutBlock.js.map +1 -0
- package/dist/esm/components/ui/Disclaimer.css +35 -0
- package/dist/esm/components/ui/Disclaimer.js +32 -0
- package/dist/esm/components/ui/Disclaimer.js.map +1 -0
- package/dist/esm/components/ui/FeedbackBar.css +267 -0
- package/dist/esm/components/ui/FeedbackBar.js +221 -0
- package/dist/esm/components/ui/FeedbackBar.js.map +1 -0
- package/dist/esm/components/ui/Loader.js +43 -0
- package/dist/esm/components/ui/Loader.js.map +1 -0
- package/dist/esm/components/ui/MarkdownText.js +283 -0
- package/dist/esm/components/ui/MarkdownText.js.map +1 -0
- package/dist/esm/components/ui/OptimizedImage.js +354 -0
- package/dist/esm/components/ui/OptimizedImage.js.map +1 -0
- package/dist/esm/components/ui/PlacementLoader.css +101 -0
- package/dist/esm/components/ui/PlacementLoader.js +28 -0
- package/dist/esm/components/ui/PlacementLoader.js.map +1 -0
- package/dist/esm/components/ui/PromptEntryEmptyState.css +172 -0
- package/dist/esm/components/ui/PromptEntryEmptyState.js +36 -0
- package/dist/esm/components/ui/PromptEntryEmptyState.js.map +1 -0
- package/dist/esm/components/ui/SearchSection.css +538 -0
- package/dist/esm/components/ui/SearchSection.js +317 -0
- package/dist/esm/components/ui/SearchSection.js.map +1 -0
- package/dist/esm/components/ui/SectionSkeleton.css +109 -0
- package/dist/esm/components/ui/SectionSkeleton.js +100 -0
- package/dist/esm/components/ui/SectionSkeleton.js.map +1 -0
- package/dist/esm/components/ui/SmartIcon.js +91 -0
- package/dist/esm/components/ui/SmartIcon.js.map +1 -0
- package/dist/esm/components/ui/UnifiedLink.js +105 -0
- package/dist/esm/components/ui/UnifiedLink.js.map +1 -0
- package/dist/esm/components/ui/UserQuery.js +167 -0
- package/dist/esm/components/ui/UserQuery.js.map +1 -0
- package/dist/esm/components/ui/icons/ArrowTopRightIcon.js +17 -0
- package/dist/esm/components/ui/icons/ArrowTopRightIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/ArrowUpIcon.js +29 -0
- package/dist/esm/components/ui/icons/ArrowUpIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/CheckIcon.js +17 -0
- package/dist/esm/components/ui/icons/CheckIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/CommentIcon.js +15 -0
- package/dist/esm/components/ui/icons/CommentIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/PlusIcon.js +25 -0
- package/dist/esm/components/ui/icons/PlusIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/RedoIcon.js +25 -0
- package/dist/esm/components/ui/icons/RedoIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/ShareIcon.js +37 -0
- package/dist/esm/components/ui/icons/ShareIcon.js.map +1 -0
- package/dist/esm/components/ui/icons/UndoIcon.js +25 -0
- package/dist/esm/components/ui/icons/UndoIcon.js.map +1 -0
- package/dist/esm/components/ui/table.js +92 -0
- package/dist/esm/components/ui/table.js.map +1 -0
- package/dist/esm/context/ChipsContext.js +7 -0
- package/dist/esm/context/ChipsContext.js.map +1 -0
- package/dist/esm/context/ComponentDependenciesContext.js +19 -0
- package/dist/esm/context/ComponentDependenciesContext.js.map +1 -0
- package/dist/esm/entity/defaultExtractor.js +111 -0
- package/dist/esm/entity/defaultExtractor.js.map +1 -0
- package/dist/esm/entity/enrichEntitiesFromPayload.js +35 -0
- package/dist/esm/entity/enrichEntitiesFromPayload.js.map +1 -0
- package/dist/esm/entity/fetchEntityListData.js +76 -0
- package/dist/esm/entity/fetchEntityListData.js.map +1 -0
- package/dist/esm/entity/index.js +29 -0
- package/dist/esm/entity/index.js.map +1 -0
- package/dist/esm/entity/types.js +2 -0
- package/dist/esm/entity/types.js.map +1 -0
- package/dist/esm/errors/conversationErrorTypes.js +50 -0
- package/dist/esm/errors/conversationErrorTypes.js.map +1 -0
- package/dist/esm/errors/errorTemplates.js +81 -0
- package/dist/esm/errors/errorTemplates.js.map +1 -0
- package/dist/esm/errors/index.js +3 -0
- package/dist/esm/errors/index.js.map +1 -0
- package/dist/esm/external-types.d.js +2 -0
- package/dist/esm/external-types.d.js.map +1 -0
- package/dist/esm/featureToggles/FeatureToggleContext.js +30 -0
- package/dist/esm/featureToggles/FeatureToggleContext.js.map +1 -0
- package/dist/esm/hooks/useConversation.js +6 -0
- package/dist/esm/hooks/useConversation.js.map +1 -0
- package/dist/esm/hooks/useDebugImageContext.js +6 -0
- package/dist/esm/hooks/useDebugImageContext.js.map +1 -0
- package/dist/esm/hooks/useEntityTransforms.js +6 -0
- package/dist/esm/hooks/useEntityTransforms.js.map +1 -0
- package/dist/esm/hooks/useMarkdownUtils.js +6 -0
- package/dist/esm/hooks/useMarkdownUtils.js.map +1 -0
- package/dist/esm/hooks/useResolveGenericEntityData.js +6 -0
- package/dist/esm/hooks/useResolveGenericEntityData.js.map +1 -0
- package/dist/esm/hooks/useResolveSearchSpringEntityData.js +146 -0
- package/dist/esm/hooks/useResolveSearchSpringEntityData.js.map +1 -0
- package/dist/esm/hooks/useResolveShopifyEntityData.js +191 -0
- package/dist/esm/hooks/useResolveShopifyEntityData.js.map +1 -0
- package/dist/esm/hooks/useResolvedImageSources.js +169 -0
- package/dist/esm/hooks/useResolvedImageSources.js.map +1 -0
- package/dist/esm/hooks/useWeb5Link.js +6 -0
- package/dist/esm/hooks/useWeb5Link.js.map +1 -0
- package/dist/esm/image/contextualImageTypes.js +2 -0
- package/dist/esm/image/contextualImageTypes.js.map +1 -0
- package/dist/esm/image/imageSearchFilterTypes.js +15 -0
- package/dist/esm/image/imageSearchFilterTypes.js.map +1 -0
- package/dist/esm/image/imageSearchFilters.js +18 -0
- package/dist/esm/image/imageSearchFilters.js.map +1 -0
- package/dist/esm/index.js +152 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/utils.js +33 -0
- package/dist/esm/lib/utils.js.map +1 -0
- package/dist/esm/markdownBlocks.js +641 -0
- package/dist/esm/markdownBlocks.js.map +1 -0
- package/dist/esm/match/astToParts.js +371 -0
- package/dist/esm/match/astToParts.js.map +1 -0
- package/dist/esm/match/extractProps.js +634 -0
- package/dist/esm/match/extractProps.js.map +1 -0
- package/dist/esm/match/index.js +4 -0
- package/dist/esm/match/index.js.map +1 -0
- package/dist/esm/match/matchAllSections.js +31 -0
- package/dist/esm/match/matchAllSections.js.map +1 -0
- package/dist/esm/match/matchMarkdown.js +36 -0
- package/dist/esm/match/matchMarkdown.js.map +1 -0
- package/dist/esm/parts/parts.js +171 -0
- package/dist/esm/parts/parts.js.map +1 -0
- package/dist/esm/patternAnalyzer/conflictDetector.js +99 -0
- package/dist/esm/patternAnalyzer/conflictDetector.js.map +1 -0
- package/dist/esm/patternAnalyzer/index.js +36 -0
- package/dist/esm/patternAnalyzer/index.js.map +1 -0
- package/dist/esm/patternAnalyzer/markdownGenerator.js +344 -0
- package/dist/esm/patternAnalyzer/markdownGenerator.js.map +1 -0
- package/dist/esm/patternAnalyzer/mergeDetector.js +504 -0
- package/dist/esm/patternAnalyzer/mergeDetector.js.map +1 -0
- package/dist/esm/patternAnalyzer/parserValidator.js +52 -0
- package/dist/esm/patternAnalyzer/parserValidator.js.map +1 -0
- package/dist/esm/patternAnalyzer/patternWriter.js +102 -0
- package/dist/esm/patternAnalyzer/patternWriter.js.map +1 -0
- package/dist/esm/patternAnalyzer/run.js +138 -0
- package/dist/esm/patternAnalyzer/run.js.map +1 -0
- package/dist/esm/patternAnalyzer/types.js +2 -0
- package/dist/esm/patternAnalyzer/types.js.map +1 -0
- package/dist/esm/patternValidator/ERROR_MESSAGES.md +110 -0
- package/dist/esm/patternValidator/README.md +757 -0
- package/dist/esm/patternValidator/automaton.js +345 -0
- package/dist/esm/patternValidator/automaton.js.map +1 -0
- package/dist/esm/patternValidator/index.js +190 -0
- package/dist/esm/patternValidator/index.js.map +1 -0
- package/dist/esm/patternValidator/lexer.js +214 -0
- package/dist/esm/patternValidator/lexer.js.map +1 -0
- package/dist/esm/patternValidator/matcher.js +717 -0
- package/dist/esm/patternValidator/matcher.js.map +1 -0
- package/dist/esm/patternValidator/parser.js +531 -0
- package/dist/esm/patternValidator/parser.js.map +1 -0
- package/dist/esm/patternValidator/types.js +2 -0
- package/dist/esm/patternValidator/types.js.map +1 -0
- package/dist/esm/patternValidator/validator.test.js +1275 -0
- package/dist/esm/patternValidator/validator.test.js.map +1 -0
- package/dist/esm/registry/ComponentRegistry.js +435 -0
- package/dist/esm/registry/ComponentRegistry.js.map +1 -0
- package/dist/esm/registry/Intent.js +15 -0
- package/dist/esm/registry/Intent.js.map +1 -0
- package/dist/esm/registry/index.js +3 -0
- package/dist/esm/registry/index.js.map +1 -0
- package/dist/esm/registry/types.js +2 -0
- package/dist/esm/registry/types.js.map +1 -0
- package/dist/esm/services/cart/addToCart.js +146 -0
- package/dist/esm/services/cart/addToCart.js.map +1 -0
- package/dist/esm/services/cart/index.js +2 -0
- package/dist/esm/services/cart/index.js.map +1 -0
- package/dist/esm/services/searchspring/index.js +3 -0
- package/dist/esm/services/searchspring/index.js.map +1 -0
- package/dist/esm/services/searchspring/searchSpringClient.js +44 -0
- package/dist/esm/services/searchspring/searchSpringClient.js.map +1 -0
- package/dist/esm/services/searchspring/transformSSProduct.js +66 -0
- package/dist/esm/services/searchspring/transformSSProduct.js.map +1 -0
- package/dist/esm/services/searchspring/types.js +2 -0
- package/dist/esm/services/searchspring/types.js.map +1 -0
- package/dist/esm/services/shopify/globals.d.js +7 -0
- package/dist/esm/services/shopify/globals.d.js.map +1 -0
- package/dist/esm/services/shopify/index.js +6 -0
- package/dist/esm/services/shopify/index.js.map +1 -0
- package/dist/esm/services/shopify/queries.js +210 -0
- package/dist/esm/services/shopify/queries.js.map +1 -0
- package/dist/esm/services/shopify/resolveStoreDomain.js +25 -0
- package/dist/esm/services/shopify/resolveStoreDomain.js.map +1 -0
- package/dist/esm/services/shopify/shopifyEntityResolver.js +105 -0
- package/dist/esm/services/shopify/shopifyEntityResolver.js.map +1 -0
- package/dist/esm/services/shopify/shopifyStorefrontClient.js +52 -0
- package/dist/esm/services/shopify/shopifyStorefrontClient.js.map +1 -0
- package/dist/esm/services/shopify/transformShopifyEntity.js +130 -0
- package/dist/esm/services/shopify/transformShopifyEntity.js.map +1 -0
- package/dist/esm/services/shopify/types.js +2 -0
- package/dist/esm/services/shopify/types.js.map +1 -0
- package/dist/esm/styles/base-tokens.css +152 -0
- package/dist/esm/styles/base-utilities.css +424 -0
- package/dist/esm/styles/components.css +6 -0
- package/dist/esm/styles/prompt-input-tokens.css +136 -0
- package/dist/esm/styles/tailwind-theme.css +138 -0
- package/dist/esm/test-types.d.js +2 -0
- package/dist/esm/test-types.d.js.map +1 -0
- package/dist/esm/testUtils.js +20 -0
- package/dist/esm/testUtils.js.map +1 -0
- package/dist/esm/types/answerUpdatedEvent.js +16 -0
- package/dist/esm/types/answerUpdatedEvent.js.map +1 -0
- package/dist/esm/types/blog.js +2 -0
- package/dist/esm/types/blog.js.map +1 -0
- package/dist/esm/types/callout.js +2 -0
- package/dist/esm/types/callout.js.map +1 -0
- package/dist/esm/types/dependencies.js +2 -0
- package/dist/esm/types/dependencies.js.map +1 -0
- package/dist/esm/types/entity.js +2 -0
- package/dist/esm/types/entity.js.map +1 -0
- package/dist/esm/types/link-types.js +52 -0
- package/dist/esm/types/link-types.js.map +1 -0
- package/dist/esm/types/page-section.js +2 -0
- package/dist/esm/types/page-section.js.map +1 -0
- package/dist/esm/types/placement.js +2 -0
- package/dist/esm/types/placement.js.map +1 -0
- package/dist/esm/types/redirectEvent.js +23 -0
- package/dist/esm/types/redirectEvent.js.map +1 -0
- package/dist/esm/types/userQueryEvent.js +15 -0
- package/dist/esm/types/userQueryEvent.js.map +1 -0
- package/dist/esm/utils/analyticsEvents.js +84 -0
- package/dist/esm/utils/analyticsEvents.js.map +1 -0
- package/dist/esm/utils/componentTracking.js +84 -0
- package/dist/esm/utils/componentTracking.js.map +1 -0
- package/dist/esm/utils/contentKeywordMatcher.js +50 -0
- package/dist/esm/utils/contentKeywordMatcher.js.map +1 -0
- package/dist/esm/utils/conversationApi.js +45 -0
- package/dist/esm/utils/conversationApi.js.map +1 -0
- package/dist/esm/utils/conversationMode.js +18 -0
- package/dist/esm/utils/conversationMode.js.map +1 -0
- package/dist/esm/utils/diagnosticsCollector.js +52 -0
- package/dist/esm/utils/diagnosticsCollector.js.map +1 -0
- package/dist/esm/utils/entityLinkParser.js +246 -0
- package/dist/esm/utils/entityLinkParser.js.map +1 -0
- package/dist/esm/utils/htmlCommentParser.js +117 -0
- package/dist/esm/utils/htmlCommentParser.js.map +1 -0
- package/dist/esm/utils/image-utils.js +45 -0
- package/dist/esm/utils/image-utils.js.map +1 -0
- package/dist/esm/utils/intentExtractor.js +45 -0
- package/dist/esm/utils/intentExtractor.js.map +1 -0
- package/dist/esm/utils/markdownPreprocessor.js +257 -0
- package/dist/esm/utils/markdownPreprocessor.js.map +1 -0
- package/dist/esm/utils/navigationStack.js +27 -0
- package/dist/esm/utils/navigationStack.js.map +1 -0
- package/dist/esm/utils/nodeMatchers.js +38 -0
- package/dist/esm/utils/nodeMatchers.js.map +1 -0
- package/dist/esm/utils/propsExtractor.js +58 -0
- package/dist/esm/utils/propsExtractor.js.map +1 -0
- package/dist/esm/utils/sessionManager.js +151 -0
- package/dist/esm/utils/sessionManager.js.map +1 -0
- package/dist/esm/utils/unifiedMarkdownParser.js +36 -0
- package/dist/esm/utils/unifiedMarkdownParser.js.map +1 -0
- package/dist/esm/utils/web5LinkValidator.js +52 -0
- package/dist/esm/utils/web5LinkValidator.js.map +1 -0
- package/dist/esm/utils/web5LinkValidator.test.js +113 -0
- package/dist/esm/utils/web5LinkValidator.test.js.map +1 -0
- package/dist/types/client/clientBundleOverride.d.ts +26 -0
- package/dist/types/client/clientBundleOverride.d.ts.map +1 -0
- package/dist/types/client/devEnvironment.d.ts +24 -0
- package/dist/types/client/devEnvironment.d.ts.map +1 -0
- package/dist/types/client/loadClientBundle.d.ts +27 -0
- package/dist/types/client/loadClientBundle.d.ts.map +1 -0
- package/dist/types/client/wixAuthFetch.d.ts +12 -0
- package/dist/types/client/wixAuthFetch.d.ts.map +1 -0
- package/dist/types/clients.d.ts +10 -0
- package/dist/types/clients.d.ts.map +1 -0
- package/dist/types/color/colorUtils.d.ts +9 -0
- package/dist/types/color/colorUtils.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/CalloutSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/CalloutSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/ComparisonSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/CtaBannerSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/CtaBannerSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/EntitySectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/EntitySectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/ErrorSectionDefinition.d.ts +12 -0
- package/dist/types/component/componentDefinitions/ErrorSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/FallbackSectionDefinition.d.ts +16 -0
- package/dist/types/component/componentDefinitions/FallbackSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/FeatureCardsSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/FeatureCardsSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/FeatureSection9PlusDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/FeatureSection9PlusDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/HeroEntitySectionDefinition.d.ts +23 -0
- package/dist/types/component/componentDefinitions/HeroEntitySectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/HeroSectionDefinition.d.ts +12 -0
- package/dist/types/component/componentDefinitions/HeroSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/HtmlCommentSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/HtmlCommentSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/KpiSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/KpiSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/NextStepsSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/NextStepsSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/SearchSectionDefinition.d.ts +10 -0
- package/dist/types/component/componentDefinitions/SearchSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/SkipNodesSectionDefinition.d.ts +12 -0
- package/dist/types/component/componentDefinitions/SkipNodesSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/TextBlockSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/TextBlockSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/index.d.ts +26 -0
- package/dist/types/component/componentDefinitions/index.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts +11 -0
- package/dist/types/component/componentDefinitions/listItemsSectionDefinition.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/parse-utils.d.ts +88 -0
- package/dist/types/component/componentDefinitions/parse-utils.d.ts.map +1 -0
- package/dist/types/component/componentDefinitions/specHelpers.d.ts +16 -0
- package/dist/types/component/componentDefinitions/specHelpers.d.ts.map +1 -0
- package/dist/types/component/componentParser.d.ts +63 -0
- package/dist/types/component/componentParser.d.ts.map +1 -0
- package/dist/types/component/diagnosticTypes.d.ts +23 -0
- package/dist/types/component/diagnosticTypes.d.ts.map +1 -0
- package/dist/types/component/parser-types.d.ts +71 -0
- package/dist/types/component/parser-types.d.ts.map +1 -0
- package/dist/types/component/section-definition.d.ts +32 -0
- package/dist/types/component/section-definition.d.ts.map +1 -0
- package/dist/types/component/types.d.ts +315 -0
- package/dist/types/component/types.d.ts.map +1 -0
- package/dist/types/components/placement/PlacementPayloadContext.d.ts +20 -0
- package/dist/types/components/placement/PlacementPayloadContext.d.ts.map +1 -0
- package/dist/types/components/placement/PlacementResponseRenderer.d.ts +106 -0
- package/dist/types/components/placement/PlacementResponseRenderer.d.ts.map +1 -0
- package/dist/types/components/placement/buildPlacementDependencies.d.ts +44 -0
- package/dist/types/components/placement/buildPlacementDependencies.d.ts.map +1 -0
- package/dist/types/components/ui/BottomContainer.d.ts +9 -0
- package/dist/types/components/ui/BottomContainer.d.ts.map +1 -0
- package/dist/types/components/ui/CalloutBlock.d.ts +9 -0
- package/dist/types/components/ui/CalloutBlock.d.ts.map +1 -0
- package/dist/types/components/ui/Disclaimer.d.ts +21 -0
- package/dist/types/components/ui/Disclaimer.d.ts.map +1 -0
- package/dist/types/components/ui/FeedbackBar.d.ts +41 -0
- package/dist/types/components/ui/FeedbackBar.d.ts.map +1 -0
- package/dist/types/components/ui/Loader.d.ts +9 -0
- package/dist/types/components/ui/Loader.d.ts.map +1 -0
- package/dist/types/components/ui/MarkdownText.d.ts +9 -0
- package/dist/types/components/ui/MarkdownText.d.ts.map +1 -0
- package/dist/types/components/ui/OptimizedImage.d.ts +59 -0
- package/dist/types/components/ui/OptimizedImage.d.ts.map +1 -0
- package/dist/types/components/ui/PlacementLoader.d.ts +15 -0
- package/dist/types/components/ui/PlacementLoader.d.ts.map +1 -0
- package/dist/types/components/ui/PromptEntryEmptyState.d.ts +21 -0
- package/dist/types/components/ui/PromptEntryEmptyState.d.ts.map +1 -0
- package/dist/types/components/ui/SearchSection.d.ts +37 -0
- package/dist/types/components/ui/SearchSection.d.ts.map +1 -0
- package/dist/types/components/ui/SectionSkeleton.d.ts +27 -0
- package/dist/types/components/ui/SectionSkeleton.d.ts.map +1 -0
- package/dist/types/components/ui/SmartIcon.d.ts +19 -0
- package/dist/types/components/ui/SmartIcon.d.ts.map +1 -0
- package/dist/types/components/ui/UnifiedLink.d.ts +22 -0
- package/dist/types/components/ui/UnifiedLink.d.ts.map +1 -0
- package/dist/types/components/ui/UserQuery.d.ts +33 -0
- package/dist/types/components/ui/UserQuery.d.ts.map +1 -0
- package/dist/types/components/ui/icons/ArrowTopRightIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/ArrowTopRightIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/ArrowUpIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/ArrowUpIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/CheckIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/CheckIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/CommentIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/CommentIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/PlusIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/PlusIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/RedoIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/RedoIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/ShareIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/ShareIcon.d.ts.map +1 -0
- package/dist/types/components/ui/icons/UndoIcon.d.ts +3 -0
- package/dist/types/components/ui/icons/UndoIcon.d.ts.map +1 -0
- package/dist/types/components/ui/table.d.ts +11 -0
- package/dist/types/components/ui/table.d.ts.map +1 -0
- package/dist/types/context/ChipsContext.d.ts +8 -0
- package/dist/types/context/ChipsContext.d.ts.map +1 -0
- package/dist/types/context/ComponentDependenciesContext.d.ts +8 -0
- package/dist/types/context/ComponentDependenciesContext.d.ts.map +1 -0
- package/dist/types/entity/defaultExtractor.d.ts +14 -0
- package/dist/types/entity/defaultExtractor.d.ts.map +1 -0
- package/dist/types/entity/enrichEntitiesFromPayload.d.ts +27 -0
- package/dist/types/entity/enrichEntitiesFromPayload.d.ts.map +1 -0
- package/dist/types/entity/fetchEntityListData.d.ts +20 -0
- package/dist/types/entity/fetchEntityListData.d.ts.map +1 -0
- package/dist/types/entity/index.d.ts +16 -0
- package/dist/types/entity/index.d.ts.map +1 -0
- package/dist/types/entity/types.d.ts +13 -0
- package/dist/types/entity/types.d.ts.map +1 -0
- package/dist/types/errors/conversationErrorTypes.d.ts +20 -0
- package/dist/types/errors/conversationErrorTypes.d.ts.map +1 -0
- package/dist/types/errors/errorTemplates.d.ts +27 -0
- package/dist/types/errors/errorTemplates.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +3 -0
- package/dist/types/errors/index.d.ts.map +1 -0
- package/dist/types/featureToggles/FeatureToggleContext.d.ts +18 -0
- package/dist/types/featureToggles/FeatureToggleContext.d.ts.map +1 -0
- package/dist/types/hooks/useConversation.d.ts +3 -0
- package/dist/types/hooks/useConversation.d.ts.map +1 -0
- package/dist/types/hooks/useDebugImageContext.d.ts +2 -0
- package/dist/types/hooks/useDebugImageContext.d.ts.map +1 -0
- package/dist/types/hooks/useEntityTransforms.d.ts +3 -0
- package/dist/types/hooks/useEntityTransforms.d.ts.map +1 -0
- package/dist/types/hooks/useMarkdownUtils.d.ts +3 -0
- package/dist/types/hooks/useMarkdownUtils.d.ts.map +1 -0
- package/dist/types/hooks/useResolveGenericEntityData.d.ts +11 -0
- package/dist/types/hooks/useResolveGenericEntityData.d.ts.map +1 -0
- package/dist/types/hooks/useResolveSearchSpringEntityData.d.ts +20 -0
- package/dist/types/hooks/useResolveSearchSpringEntityData.d.ts.map +1 -0
- package/dist/types/hooks/useResolveShopifyEntityData.d.ts +21 -0
- package/dist/types/hooks/useResolveShopifyEntityData.d.ts.map +1 -0
- package/dist/types/hooks/useResolvedImageSources.d.ts +6 -0
- package/dist/types/hooks/useResolvedImageSources.d.ts.map +1 -0
- package/dist/types/hooks/useWeb5Link.d.ts +3 -0
- package/dist/types/hooks/useWeb5Link.d.ts.map +1 -0
- package/dist/types/image/contextualImageTypes.d.ts +17 -0
- package/dist/types/image/contextualImageTypes.d.ts.map +1 -0
- package/dist/types/image/imageSearchFilterTypes.d.ts +14 -0
- package/dist/types/image/imageSearchFilterTypes.d.ts.map +1 -0
- package/dist/types/image/imageSearchFilters.d.ts +16 -0
- package/dist/types/image/imageSearchFilters.d.ts.map +1 -0
- package/dist/types/index.d.ts +88 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +3 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/markdownBlocks.d.ts +44 -0
- package/dist/types/markdownBlocks.d.ts.map +1 -0
- package/dist/types/match/astToParts.d.ts +15 -0
- package/dist/types/match/astToParts.d.ts.map +1 -0
- package/dist/types/match/extractProps.d.ts +207 -0
- package/dist/types/match/extractProps.d.ts.map +1 -0
- package/dist/types/match/index.d.ts +4 -0
- package/dist/types/match/index.d.ts.map +1 -0
- package/dist/types/match/matchAllSections.d.ts +15 -0
- package/dist/types/match/matchAllSections.d.ts.map +1 -0
- package/dist/types/match/matchMarkdown.d.ts +25 -0
- package/dist/types/match/matchMarkdown.d.ts.map +1 -0
- package/dist/types/parts/parts.d.ts +144 -0
- package/dist/types/parts/parts.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/conflictDetector.d.ts +19 -0
- package/dist/types/patternAnalyzer/conflictDetector.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/index.d.ts +10 -0
- package/dist/types/patternAnalyzer/index.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/markdownGenerator.d.ts +9 -0
- package/dist/types/patternAnalyzer/markdownGenerator.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/mergeDetector.d.ts +14 -0
- package/dist/types/patternAnalyzer/mergeDetector.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/parserValidator.d.ts +13 -0
- package/dist/types/patternAnalyzer/parserValidator.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/patternWriter.d.ts +8 -0
- package/dist/types/patternAnalyzer/patternWriter.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/run.d.ts +2 -0
- package/dist/types/patternAnalyzer/run.d.ts.map +1 -0
- package/dist/types/patternAnalyzer/types.d.ts +59 -0
- package/dist/types/patternAnalyzer/types.d.ts.map +1 -0
- package/dist/types/patternValidator/automaton.d.ts +3 -0
- package/dist/types/patternValidator/automaton.d.ts.map +1 -0
- package/dist/types/patternValidator/index.d.ts +48 -0
- package/dist/types/patternValidator/index.d.ts.map +1 -0
- package/dist/types/patternValidator/lexer.d.ts +3 -0
- package/dist/types/patternValidator/lexer.d.ts.map +1 -0
- package/dist/types/patternValidator/matcher.d.ts +14 -0
- package/dist/types/patternValidator/matcher.d.ts.map +1 -0
- package/dist/types/patternValidator/parser.d.ts +14 -0
- package/dist/types/patternValidator/parser.d.ts.map +1 -0
- package/dist/types/patternValidator/types.d.ts +125 -0
- package/dist/types/patternValidator/types.d.ts.map +1 -0
- package/dist/types/patternValidator/validator.test.d.ts +2 -0
- package/dist/types/patternValidator/validator.test.d.ts.map +1 -0
- package/dist/types/registry/ComponentRegistry.d.ts +64 -0
- package/dist/types/registry/ComponentRegistry.d.ts.map +1 -0
- package/dist/types/registry/Intent.d.ts +12 -0
- package/dist/types/registry/Intent.d.ts.map +1 -0
- package/dist/types/registry/index.d.ts +4 -0
- package/dist/types/registry/index.d.ts.map +1 -0
- package/dist/types/registry/types.d.ts +99 -0
- package/dist/types/registry/types.d.ts.map +1 -0
- package/dist/types/services/cart/addToCart.d.ts +26 -0
- package/dist/types/services/cart/addToCart.d.ts.map +1 -0
- package/dist/types/services/cart/index.d.ts +2 -0
- package/dist/types/services/cart/index.d.ts.map +1 -0
- package/dist/types/services/searchspring/index.d.ts +4 -0
- package/dist/types/services/searchspring/index.d.ts.map +1 -0
- package/dist/types/services/searchspring/searchSpringClient.d.ts +13 -0
- package/dist/types/services/searchspring/searchSpringClient.d.ts.map +1 -0
- package/dist/types/services/searchspring/transformSSProduct.d.ts +7 -0
- package/dist/types/services/searchspring/transformSSProduct.d.ts.map +1 -0
- package/dist/types/services/searchspring/types.d.ts +48 -0
- package/dist/types/services/searchspring/types.d.ts.map +1 -0
- package/dist/types/services/shopify/index.d.ts +7 -0
- package/dist/types/services/shopify/index.d.ts.map +1 -0
- package/dist/types/services/shopify/queries.d.ts +13 -0
- package/dist/types/services/shopify/queries.d.ts.map +1 -0
- package/dist/types/services/shopify/resolveStoreDomain.d.ts +14 -0
- package/dist/types/services/shopify/resolveStoreDomain.d.ts.map +1 -0
- package/dist/types/services/shopify/shopifyEntityResolver.d.ts +21 -0
- package/dist/types/services/shopify/shopifyEntityResolver.d.ts.map +1 -0
- package/dist/types/services/shopify/shopifyStorefrontClient.d.ts +19 -0
- package/dist/types/services/shopify/shopifyStorefrontClient.d.ts.map +1 -0
- package/dist/types/services/shopify/transformShopifyEntity.d.ts +11 -0
- package/dist/types/services/shopify/transformShopifyEntity.d.ts.map +1 -0
- package/dist/types/services/shopify/types.d.ts +109 -0
- package/dist/types/services/shopify/types.d.ts.map +1 -0
- package/dist/types/testUtils.d.ts +7 -0
- package/dist/types/testUtils.d.ts.map +1 -0
- package/dist/types/types/answerUpdatedEvent.d.ts +29 -0
- package/dist/types/types/answerUpdatedEvent.d.ts.map +1 -0
- package/dist/types/types/blog.d.ts +22 -0
- package/dist/types/types/blog.d.ts.map +1 -0
- package/dist/types/types/callout.d.ts +7 -0
- package/dist/types/types/callout.d.ts.map +1 -0
- package/dist/types/types/dependencies.d.ts +191 -0
- package/dist/types/types/dependencies.d.ts.map +1 -0
- package/dist/types/types/entity.d.ts +38 -0
- package/dist/types/types/entity.d.ts.map +1 -0
- package/dist/types/types/link-types.d.ts +38 -0
- package/dist/types/types/link-types.d.ts.map +1 -0
- package/dist/types/types/page-section.d.ts +27 -0
- package/dist/types/types/page-section.d.ts.map +1 -0
- package/dist/types/types/placement.d.ts +94 -0
- package/dist/types/types/placement.d.ts.map +1 -0
- package/dist/types/types/redirectEvent.d.ts +42 -0
- package/dist/types/types/redirectEvent.d.ts.map +1 -0
- package/dist/types/types/userQueryEvent.d.ts +24 -0
- package/dist/types/types/userQueryEvent.d.ts.map +1 -0
- package/dist/types/utils/analyticsEvents.d.ts +24 -0
- package/dist/types/utils/analyticsEvents.d.ts.map +1 -0
- package/dist/types/utils/componentTracking.d.ts +55 -0
- package/dist/types/utils/componentTracking.d.ts.map +1 -0
- package/dist/types/utils/contentKeywordMatcher.d.ts +14 -0
- package/dist/types/utils/contentKeywordMatcher.d.ts.map +1 -0
- package/dist/types/utils/conversationApi.d.ts +26 -0
- package/dist/types/utils/conversationApi.d.ts.map +1 -0
- package/dist/types/utils/conversationMode.d.ts +16 -0
- package/dist/types/utils/conversationMode.d.ts.map +1 -0
- package/dist/types/utils/diagnosticsCollector.d.ts +33 -0
- package/dist/types/utils/diagnosticsCollector.d.ts.map +1 -0
- package/dist/types/utils/entityLinkParser.d.ts +97 -0
- package/dist/types/utils/entityLinkParser.d.ts.map +1 -0
- package/dist/types/utils/htmlCommentParser.d.ts +13 -0
- package/dist/types/utils/htmlCommentParser.d.ts.map +1 -0
- package/dist/types/utils/image-utils.d.ts +10 -0
- package/dist/types/utils/image-utils.d.ts.map +1 -0
- package/dist/types/utils/intentExtractor.d.ts +11 -0
- package/dist/types/utils/intentExtractor.d.ts.map +1 -0
- package/dist/types/utils/markdownPreprocessor.d.ts +95 -0
- package/dist/types/utils/markdownPreprocessor.d.ts.map +1 -0
- package/dist/types/utils/navigationStack.d.ts +6 -0
- package/dist/types/utils/navigationStack.d.ts.map +1 -0
- package/dist/types/utils/nodeMatchers.d.ts +10 -0
- package/dist/types/utils/nodeMatchers.d.ts.map +1 -0
- package/dist/types/utils/propsExtractor.d.ts +51 -0
- package/dist/types/utils/propsExtractor.d.ts.map +1 -0
- package/dist/types/utils/sessionManager.d.ts +57 -0
- package/dist/types/utils/sessionManager.d.ts.map +1 -0
- package/dist/types/utils/unifiedMarkdownParser.d.ts +9 -0
- package/dist/types/utils/unifiedMarkdownParser.d.ts.map +1 -0
- package/dist/types/utils/web5LinkValidator.d.ts +14 -0
- package/dist/types/utils/web5LinkValidator.d.ts.map +1 -0
- package/dist/types/utils/web5LinkValidator.test.d.ts +2 -0
- package/dist/types/utils/web5LinkValidator.test.d.ts.map +1 -0
- package/package.json +103 -0
- package/src/styles/base-tokens.css +152 -0
- package/src/styles/base-utilities.css +424 -0
- package/src/styles/components.css +6 -0
- package/src/styles/prompt-input-tokens.css +136 -0
- package/src/styles/tailwind-theme.css +138 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["rgbToHsl","_ref","r","g","b","max","Math","min","h","s","l","d","hslToRgb","_ref2","v","round","hue2rgb","p","q","t","ensureMinLightness","rgb","minL","toRgb","c","deriveDarkColor","palette","minDarkness","length","darkest","lowestL","i","maxLightness","deriveDarkGradient","sorted","sort","a","enforce","stop1","stop2","deriveLightColor","minLightness","lightest","highestL"],"sources":["../../../src/color/colorUtils.ts"],"sourcesContent":["export type RGB = [number, number, number];\n\nexport function rgbToHsl([r, g, b]: RGB): [number, number, number] {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h = 0,\n s = 0;\n const l = (max + min) / 2;\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n if (max === r) {\n h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n } else if (max === g) {\n h = ((b - r) / d + 2) / 6;\n } else {\n h = ((r - g) / d + 4) / 6;\n }\n }\n return [h * 360, s * 100, l * 100];\n}\n\nexport function hslToRgb([h, s, l]: [number, number, number]): RGB {\n h /= 360;\n s /= 100;\n l /= 100;\n if (s === 0) {\n const v = Math.round(l * 255);\n return [v, v, v];\n }\n const hue2rgb = (p: number, q: number, t: number) => {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n return [\n Math.round(hue2rgb(p, q, h + 1 / 3) * 255),\n Math.round(hue2rgb(p, q, h) * 255),\n Math.round(hue2rgb(p, q, h - 1 / 3) * 255),\n ];\n}\n\nexport function ensureMinLightness(rgb: RGB, minL: number): RGB {\n const [h, s, l] = rgbToHsl(rgb);\n if (l >= minL) {\n return rgb;\n }\n return hslToRgb([h, s, minL]);\n}\n\nexport function toRgb(c: RGB): string {\n return `rgb(${c[0]}, ${c[1]}, ${c[2]})`;\n}\n\nexport function deriveDarkColor(palette: RGB[], minDarkness: number): RGB {\n if (!palette.length) {\n return [0, 0, 0];\n }\n let darkest = palette[0];\n let lowestL = rgbToHsl(palette[0])[2];\n for (let i = 1; i < palette.length; i++) {\n const l = rgbToHsl(palette[i])[2];\n if (l < lowestL) {\n lowestL = l;\n darkest = palette[i];\n }\n }\n const [h, s, l] = rgbToHsl(darkest);\n const maxLightness = 100 - minDarkness;\n if (l <= maxLightness) {\n return darkest;\n }\n return hslToRgb([h, s, maxLightness]);\n}\n\nexport function deriveDarkGradient(\n palette: RGB[],\n minDarkness: number,\n): [string, string] {\n if (!palette.length) {\n return ['rgb(0, 0, 0)', 'rgb(0, 0, 0)'];\n }\n\n const sorted = [...palette].sort((a, b) => rgbToHsl(a)[2] - rgbToHsl(b)[2]);\n\n const maxLightness = 100 - minDarkness;\n\n const enforce = (rgb: RGB): RGB => {\n const [h, s, l] = rgbToHsl(rgb);\n return l <= maxLightness ? rgb : hslToRgb([h, s, maxLightness]);\n };\n\n const stop1 = enforce(sorted[0]);\n const stop2 = enforce(sorted.length > 1 ? sorted[1] : sorted[0]);\n\n return [toRgb(stop1), toRgb(stop2)];\n}\n\nexport function deriveLightColor(palette: RGB[], minLightness: number): RGB {\n if (!palette.length) {\n return [240, 240, 240];\n }\n let lightest = palette[0];\n let highestL = rgbToHsl(palette[0])[2];\n for (let i = 1; i < palette.length; i++) {\n const l = rgbToHsl(palette[i])[2];\n if (l > highestL) {\n highestL = l;\n lightest = palette[i];\n }\n }\n const [h, s, l] = rgbToHsl(lightest);\n if (l >= minLightness) {\n return lightest;\n }\n return hslToRgb([h, s, minLightness]);\n}\n"],"mappings":"AAEA,OAAO,SAASA,QAAQA,CAAAC,IAAA,EAA2C;EAAA,IAA1C,CAACC,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAM,GAAAH,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Ef,KAAK,CAACgB,KAAK,CAAC,CAAC;AACrC;AAEA,OAAO,SAASC,gBAAgBA,CAACd,OAAc,EAAEe,YAAoB,EAAO;EAC1E,IAAI,CAACf,OAAO,CAACE,MAAM,EAAE;IACnB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EACxB;EACA,IAAIc,QAAQ,GAAGhB,OAAO,CAAC,CAAC,CAAC;EACzB,IAAIiB,QAAQ,GAAG3C,QAAQ,CAAC0B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACtC,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,OAAO,CAACE,MAAM,EAAEG,CAAC,EAAE,EAAE;IACvC,MAAMrB,CAAC,GAAGV,QAAQ,CAAC0B,OAAO,CAACK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,IAAIrB,CAAC,GAAGiC,QAAQ,EAAE;MAChBA,QAAQ,GAAGjC,CAAC;MACZgC,QAAQ,GAAGhB,OAAO,CAACK,CAAC,CAAC;IACvB;EACF;EACA,MAAM,CAACvB,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAC,GAAGV,QAAQ,CAAC0C,QAAQ,CAAC;EACpC,IAAIhC,CAAC,IAAI+B,YAAY,EAAE;IACrB,OAAOC,QAAQ;EACjB;EACA,OAAO9B,QAAQ,CAAC,CAACJ,CAAC,EAAEC,CAAC,EAAEgC,YAAY,CAAC,CAAC;AACvC","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { parseCalloutTag } from './parse-utils.js';
|
|
3
|
+
import { getPartsByType, getLinks } from '../../parts/parts.js';
|
|
4
|
+
export class CalloutSectionDefinition {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "sectionType", 'callout');
|
|
7
|
+
_defineProperty(this, "patterns", ['html_comment? > callout+']);
|
|
8
|
+
_defineProperty(this, "defaults", {
|
|
9
|
+
callouts: [{
|
|
10
|
+
text: 'This is a callout.'
|
|
11
|
+
}]
|
|
12
|
+
});
|
|
13
|
+
_defineProperty(this, "fixtures", [{
|
|
14
|
+
markdown: '> This is a callout blockquote.',
|
|
15
|
+
expected: {
|
|
16
|
+
callouts: [{
|
|
17
|
+
text: 'This is a callout blockquote.'
|
|
18
|
+
}]
|
|
19
|
+
}
|
|
20
|
+
}]);
|
|
21
|
+
}
|
|
22
|
+
parse(parts) {
|
|
23
|
+
const callouts = [];
|
|
24
|
+
const relatedLinks = [];
|
|
25
|
+
const seenUrls = new Set();
|
|
26
|
+
const calloutParts = getPartsByType(parts, 'callout');
|
|
27
|
+
for (const c of calloutParts) {
|
|
28
|
+
var _c$meta, _c$content;
|
|
29
|
+
const text = ((_c$meta = c.meta) == null || (_c$meta = _c$meta.markdown) == null ? void 0 : _c$meta.trim()) || ((_c$content = c.content) == null ? void 0 : _c$content.trim());
|
|
30
|
+
if (text) {
|
|
31
|
+
const parsed = parseCalloutTag(text);
|
|
32
|
+
if (parsed.text) {
|
|
33
|
+
callouts.push({
|
|
34
|
+
text: parsed.text,
|
|
35
|
+
kind: parsed.kind
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Extract links from all parts
|
|
42
|
+
const links = getLinks(parts);
|
|
43
|
+
for (const link of links) {
|
|
44
|
+
var _link$meta, _link$content;
|
|
45
|
+
const href = (_link$meta = link.meta) == null ? void 0 : _link$meta.href;
|
|
46
|
+
const text = (_link$content = link.content) == null ? void 0 : _link$content.trim();
|
|
47
|
+
if (text && href && !seenUrls.has(href)) {
|
|
48
|
+
seenUrls.add(href);
|
|
49
|
+
relatedLinks.push({
|
|
50
|
+
text,
|
|
51
|
+
url: href
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
callouts,
|
|
57
|
+
relatedLinks: relatedLinks.length > 0 ? relatedLinks : undefined
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=CalloutSectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["parseCalloutTag","getPartsByType","getLinks","CalloutSectionDefinition","constructor","_defineProperty","callouts","text","markdown","expected","parse","parts","relatedLinks","seenUrls","Set","calloutParts","c","_c$meta","_c$content","meta","trim","content","parsed","push","kind","links","link","_link$meta","_link$content","href","has","add","url","length","undefined"],"sources":["../../../../src/component/componentDefinitions/CalloutSectionDefinition.ts"],"sourcesContent":["import { parseCalloutTag } from './parse-utils';\nimport { getPartsByType, getLinks, type Part } from '../../parts/parts';\nimport type { Callout } from '../../types/callout';\nimport type {\n CalloutCompProps,\n CalloutSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\n\nexport class CalloutSectionDefinition\n implements SectionDefinition<CalloutSectionComponent>\n{\n sectionType = 'callout' as const;\n patterns = ['html_comment? > callout+'];\n\n defaults: CalloutCompProps = {\n callouts: [{ text: 'This is a callout.' }],\n };\n\n fixtures: SectionFixture<CalloutCompProps>[] = [\n {\n markdown: '> This is a callout blockquote.',\n expected: {\n callouts: [{ text: 'This is a callout blockquote.' }],\n },\n },\n ];\n\n parse(parts: Part[]): CalloutCompProps {\n const callouts: Callout[] = [];\n const relatedLinks: { text: string; url: string }[] = [];\n const seenUrls = new Set<string>();\n\n const calloutParts = getPartsByType<Part>(parts, 'callout');\n for (const c of calloutParts) {\n const text = (c.meta?.markdown as string)?.trim() || c.content?.trim();\n if (text) {\n const parsed = parseCalloutTag(text);\n if (parsed.text) {\n callouts.push({ text: parsed.text, kind: parsed.kind });\n }\n }\n }\n\n // Extract links from all parts\n const links = getLinks(parts);\n for (const link of links) {\n const href = link.meta?.href;\n const text = link.content?.trim();\n if (text && href && !seenUrls.has(href)) {\n seenUrls.add(href);\n relatedLinks.push({ text, url: href });\n }\n }\n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iB,IAAI,EAAEF,MAAM,CAACE;UAAK,CAAC,CAAC;QACzD;MACF;IACF;;IAEA;IACA,MAAMC,KAAK,GAAGvB,QAAQ,CAACS,KAAK,CAAC;IAC7B,KAAK,MAAMe,IAAI,IAAID,KAAK,EAAE;MAAA,IAAAE,UAAA,EAAAC,aAAA;MACxB,MAAMC,IAAI,IAAAF,UAAA,GAAGD,IAAI,CAACP,IAAI,qBAATQ,UAAA,CAAWE,IAAI;MAC5B,MAAMtB,IAAI,IAAAqB,aAAA,GAAGF,IAAI,CAACL,OAAO,qBAAZO,aAAA,CAAcR,IAAI,CAAC,CAAC;MACjC,IAAIb,IAAI,IAAIsB,IAAI,IAAI,CAAChB,QAAQ,CAACiB,GAAG,CAACD,IAAI,CAAC,EAAE;QACvChB,QAAQ,CAACkB,GAAG,CAACF,IAAI,CAAC;QAClBjB,YAAY,CAACW,IAAI,CAAC;UAAEhB,IAAI;UAAEyB,GAAG,EAAEH;QAAK,CAAC,CAAC;MACxC;IACF;IAEA,OAAO;MACLvB,QAAQ;MACRM,YAAY,EAAEA,YAAY,CAACqB,MAAM,GAAG,CAAC,GAAGrB,YAAY,GAAGsB;IACzD,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { headingText, bodyText, firstLink, parseTableValue } from './parse-utils.js';
|
|
3
|
+
import { getPartsByType } from '../../parts/parts.js';
|
|
4
|
+
import { DIAGNOSTIC_TYPES } from '../diagnosticTypes.js';
|
|
5
|
+
export class ComparisonSectionDefinition {
|
|
6
|
+
constructor() {
|
|
7
|
+
_defineProperty(this, "sectionType", 'comparison');
|
|
8
|
+
_defineProperty(this, "patterns", ['html_comment[section^="comparison"] > (h2 | h3 | h4 | t) > html_comment? > t* > table > (t | link)?']);
|
|
9
|
+
_defineProperty(this, "defaults", {
|
|
10
|
+
title: 'Comparison',
|
|
11
|
+
columnLabels: ['Option A', 'Option B'],
|
|
12
|
+
rows: [{
|
|
13
|
+
feature: 'Price',
|
|
14
|
+
values: ['$10', '$20']
|
|
15
|
+
}, {
|
|
16
|
+
feature: 'Storage',
|
|
17
|
+
values: ['100GB', '1TB']
|
|
18
|
+
}]
|
|
19
|
+
});
|
|
20
|
+
_defineProperty(this, "fixtures", [{
|
|
21
|
+
markdown: `<!-- section: comparison -->
|
|
22
|
+
## Compare Plans
|
|
23
|
+
|
|
24
|
+
| Feature | Basic | Pro |
|
|
25
|
+
|---------|-------|-----|
|
|
26
|
+
| Users | 5 | Unlimited |
|
|
27
|
+
| Storage | 100GB | 1TB |`,
|
|
28
|
+
expected: {
|
|
29
|
+
title: 'Compare Plans',
|
|
30
|
+
featureColumnLabel: 'Feature',
|
|
31
|
+
columnLabels: ['Basic', 'Pro'],
|
|
32
|
+
rows: [{
|
|
33
|
+
feature: 'Users',
|
|
34
|
+
values: ['5', 'Unlimited']
|
|
35
|
+
}, {
|
|
36
|
+
feature: 'Storage',
|
|
37
|
+
values: ['100GB', '1TB']
|
|
38
|
+
}]
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
markdown: `<!-- section: comparison -->
|
|
42
|
+
## Platform Comparison
|
|
43
|
+
|
|
44
|
+
See how our platform stacks up against the competition.
|
|
45
|
+
|
|
46
|
+
| Feature | Our Platform | Competitor |
|
|
47
|
+
|---------|--------------|------------|
|
|
48
|
+
| Storage | 1TB | 100GB |
|
|
49
|
+
| Users | Unlimited | 5 |
|
|
50
|
+
| Support | 24/7 Priority | Email Only |
|
|
51
|
+
|
|
52
|
+
[Get started](#signup)`,
|
|
53
|
+
expected: {
|
|
54
|
+
title: 'Platform Comparison',
|
|
55
|
+
description: 'See how our platform stacks up against the competition.',
|
|
56
|
+
featureColumnLabel: 'Feature',
|
|
57
|
+
columnLabels: ['Our Platform', 'Competitor'],
|
|
58
|
+
rows: [{
|
|
59
|
+
feature: 'Storage',
|
|
60
|
+
values: ['1TB', '100GB']
|
|
61
|
+
}, {
|
|
62
|
+
feature: 'Users',
|
|
63
|
+
values: ['Unlimited', '5']
|
|
64
|
+
}, {
|
|
65
|
+
feature: 'Support',
|
|
66
|
+
values: ['24/7 Priority', 'Email Only']
|
|
67
|
+
}],
|
|
68
|
+
ctaText: 'Get started',
|
|
69
|
+
ctaHref: '#signup'
|
|
70
|
+
}
|
|
71
|
+
}]);
|
|
72
|
+
}
|
|
73
|
+
parse(parts, context) {
|
|
74
|
+
var _tableParts$;
|
|
75
|
+
const title = headingText(parts, 2) || headingText(parts, 3) || headingText(parts, 4) || 'Comparison';
|
|
76
|
+
const description = bodyText(parts) || undefined;
|
|
77
|
+
|
|
78
|
+
// Table meta from nodesToParts: { columnLabels, featureColumnLabel, rows: { feature, values }[] }
|
|
79
|
+
const tableParts = getPartsByType(parts, 'table');
|
|
80
|
+
const tableMeta = (_tableParts$ = tableParts[0]) == null ? void 0 : _tableParts$.meta;
|
|
81
|
+
let columnLabels;
|
|
82
|
+
let columns;
|
|
83
|
+
let featureColumnLabel;
|
|
84
|
+
let rows;
|
|
85
|
+
if ((tableMeta == null ? void 0 : tableMeta.columnLabels) !== undefined) {
|
|
86
|
+
// SDK nodesToParts format
|
|
87
|
+
columnLabels = tableMeta.columnLabels;
|
|
88
|
+
columns = tableMeta.columns;
|
|
89
|
+
featureColumnLabel = tableMeta.featureColumnLabel || undefined;
|
|
90
|
+
rows = (tableMeta.rows ?? []).map(row => ({
|
|
91
|
+
feature: row.feature,
|
|
92
|
+
...(row.iconHint ? {
|
|
93
|
+
iconHint: row.iconHint
|
|
94
|
+
} : {}),
|
|
95
|
+
values: row.values.map(parseTableValue)
|
|
96
|
+
}));
|
|
97
|
+
} else {
|
|
98
|
+
// Legacy partsConverter format: { headers: string[], rows: string[][] }
|
|
99
|
+
const allHeaders = (tableMeta == null ? void 0 : tableMeta.headers) ?? [];
|
|
100
|
+
const rawRows = (tableMeta == null ? void 0 : tableMeta.rows) ?? [];
|
|
101
|
+
featureColumnLabel = allHeaders[0] || undefined;
|
|
102
|
+
columnLabels = allHeaders.slice(1);
|
|
103
|
+
columns = columnLabels.map(label => ({
|
|
104
|
+
label
|
|
105
|
+
}));
|
|
106
|
+
rows = rawRows.map(row => ({
|
|
107
|
+
feature: row[0] ?? '',
|
|
108
|
+
values: row.slice(1).map(parseTableValue)
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Extract CTA from link parts
|
|
113
|
+
const link = firstLink(parts);
|
|
114
|
+
const ctaText = (link == null ? void 0 : link.text) || undefined;
|
|
115
|
+
const ctaHref = (link == null ? void 0 : link.href) || undefined;
|
|
116
|
+
|
|
117
|
+
// Filter out rows where all values are empty (e.g. trailing non-table text parsed as a row)
|
|
118
|
+
const filteredRows = rows.filter(row => row.values.some(v => v !== ''));
|
|
119
|
+
const droppedCount = rows.length - filteredRows.length;
|
|
120
|
+
if (droppedCount > 0) {
|
|
121
|
+
context == null || context.reportDiagnostic == null || context.reportDiagnostic(DIAGNOSTIC_TYPES.ITEMS_DROPPED, `comparison: ${droppedCount} row(s) dropped (all values empty)`);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
title,
|
|
125
|
+
description,
|
|
126
|
+
columnLabels,
|
|
127
|
+
columns,
|
|
128
|
+
rows: filteredRows,
|
|
129
|
+
featureColumnLabel,
|
|
130
|
+
ctaText,
|
|
131
|
+
ctaHref
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=ComparisonSectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["headingText","bodyText","firstLink","parseTableValue","getPartsByType","DIAGNOSTIC_TYPES","ComparisonSectionDefinition","constructor","_defineProperty","title","columnLabels","rows","feature","values","markdown","expected","featureColumnLabel","description","ctaText","ctaHref","parse","parts","context","_tableParts$","undefined","tableParts","tableMeta","meta","columns","map","row","iconHint","allHeaders","headers","rawRows","slice","label","link","text","href","filteredRows","filter","some","v","droppedCount","length","reportDiagnostic","ITEMS_DROPPED"],"sources":["../../../../src/component/componentDefinitions/ComparisonSectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n bodyText,\n firstLink,\n parseTableValue,\n} from './parse-utils';\nimport { getPartsByType, type Part } from '../../parts/parts';\nimport type {\n ComparisonColumn,\n ComparisonCompProps,\n ComparisonRow,\n ComparisonSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition, ParseContext } from '../section-definition';\nimport { DIAGNOSTIC_TYPES } from '../diagnosticTypes';\n\nexport class ComparisonSectionDefinition\n implements SectionDefinition<ComparisonSectionComponent>\n{\n sectionType = 'comparison' as const;\n patterns = [\n 'html_comment[section^=\"comparison\"] > (h2 | h3 | h4 | t) > html_comment? > t* > table > (t | link)?',\n ];\n\n defaults: ComparisonCompProps = {\n title: 'Comparison',\n columnLabels: ['Option A', 'Option B'],\n rows: [\n { feature: 'Price', values: ['$10', '$20'] },\n { feature: 'Storage', values: ['100GB', '1TB'] },\n ],\n };\n\n fixtures: SectionFixture<ComparisonCompProps>[] = [\n {\n markdown: `<!-- section: comparison -->\n## Compare Plans\n\n| Feature | Basic | Pro |\n|---------|-------|-----|\n| Users | 5 | Unlimited |\n| Storage | 100GB | 1TB |`,\n expected: {\n title: 'Compare Plans',\n featureColumnLabel: 'Feature',\n columnLabels: ['Basic', 'Pro'],\n rows: [\n { feature: 'Users', values: ['5', 'Unlimited'] },\n { feature: 'Storage', values: ['100GB', '1TB'] },\n ],\n },\n },\n {\n markdown: `<!-- section: comparison -->\n## Platform Comparison\n\nSee how our platform stacks up against the competition.\n\n| Feature | Our Platform | Competitor |\n|---------|--------------|------------|\n| Storage | 1TB | 100GB |\n| Users | Unlimited | 5 |\n| Support | 24/7 Priority | Email Only |\n\n[Get started](#signup)`,\n expected: {\n title: 'Platform Comparison',\n description: 'See how our platform stacks up against the competition.',\n featureColumnLabel: 'Feature',\n columnLabels: ['Our Platform', 'Competitor'],\n rows: [\n { feature: 'Storage', values: ['1TB', '100GB'] },\n { feature: 'Users', values: ['Unlimited', '5'] },\n { feature: 'Support', values: ['24/7 Priority', 'Email Only'] },\n ],\n ctaText: 'Get started',\n ctaHref: '#signup',\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): ComparisonCompProps {\n const title =\n headingText(parts, 2) ||\n headingText(parts, 3) ||\n headingText(parts, 4) ||\n 'Comparison';\n const description = bodyText(parts) || undefined;\n\n // Table meta from nodesToParts: { columnLabels, featureColumnLabel, rows: { feature, values }[] }\n const tableParts = getPartsByType<Part>(parts, 'table');\n const tableMeta = tableParts[0]?.meta as\n | {\n columnLabels?: string[];\n columns?: ComparisonColumn[];\n featureColumnLabel?: string;\n rows?: { feature: string; iconHint?: string; values: string[] }[];\n // Legacy format from partsConverter\n headers?: string[];\n }\n | undefined;\n\n let columnLabels: string[];\n let columns: ComparisonColumn[] | undefined;\n let featureColumnLabel: string | undefined;\n let rows: ComparisonRow[];\n\n if (tableMeta?.columnLabels !== undefined) {\n // SDK nodesToParts format\n columnLabels = tableMeta.columnLabels;\n columns = tableMeta.columns;\n featureColumnLabel = tableMeta.featureColumnLabel || undefined;\n rows = (tableMeta.rows ?? []).map((row) => ({\n feature: row.feature,\n ...(row.iconHint ? { iconHint: row.iconHint } : {}),\n values: row.values.map(parseTableValue),\n }));\n } else {\n // Legacy partsConverter format: { headers: string[], rows: string[][] }\n const allHeaders = tableMeta?.headers ?? [];\n const rawRows = (tableMeta as any)?.rows ?? [];\n featureColumnLabel = allHeaders[0] || undefined;\n columnLabels = allHeaders.slice(1);\n columns = columnLabels.map((label) => ({ label }));\n rows = rawRows.map((row: string[]) => ({\n feature: row[0] ?? '',\n values: row.slice(1).map(parseTableValue),\n }));\n }\n\n // Extract CTA from link parts\n const link = firstLink(parts);\n const ctaText = link?.text || undefined;\n const ctaHref = link?.href || undefined;\n\n // Filter out rows where all values are empty (e.g. trailing non-table text parsed as a row)\n const filteredRows = rows.filter((row) => row.values.some((v) => v !== ''));\n const droppedCount = rows.length - filteredRows.length;\n if (droppedCount > 0) {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.ITEMS_DROPPED,\n `comparison: ${droppedCount} row(s) dropped (all values empty)`,\n );\n }\n\n return {\n title,\n description,\n columnLabels,\n columns,\n rows: filteredRows,\n featureColumnLabel,\n ctaText,\n ctaHref,\n };\n }\n}\n"],"mappings":";AAAA,SACEA,WAAW,EACXC,QAAQ,EACRC,SAAS,EACTC,eAAe,QACV,eAAe;AACtB,SAASC,cAAc,QAAmB,mBAAmB;AAS7D,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,OAAO,MAAMC,2BAA2B,CAExC;EAAAC,YAAA;IAAAC,eAAA,sBACgB,YAAY;IAAAA,eAAA,mBACf,CACT,qGAAqG,CACtG;IAAAA,eAAA,mBAE+B;MAC9BC,KAAK,EAAE,YAAY;MACnBC,YAAY,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;MACtCC,IAAI,EAAE,CACJ;QAAEC,OAAO,EAAE,OAAO;QAAEC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK;MAAE,CAAC,EAC5C;QAAED,OAAO,EAAE,SAAS;QAAEC,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK;MAAE,CAAC;IAEpD,CAAC;IAAAL,eAAA,mBAEiD,CAChD;MACEM,QAAQ,EAAE;AAChB;AACA;AACA;AACA;AACA;AACA,0BAA0B;MACpBC,QAAQ,EAAE;QACRN,KAAK,EAAE,eAAe;QACtBO,kBAAkB,EAAE,SAAS;QAC7BN,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;QAC9BC,IAAI,EAAE,CACJ;UAAEC,OAAO,EAAE,OAAO;UAAEC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW;QAAE,CAAC,EAChD;UAAED,OAAO,EAAE,SAAS;UAAEC,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK;QAAE,CAAC;MAEpD;IACF,CAAC,EACD;MACEC,QAAQ,EAAE;AACh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,CAAAkB,IAAI,oBAAJA,IAAI,CAAEE,IAAI,KAAIf,SAAS;;IAEvC;IACA,MAAMgB,YAAY,GAAG7B,IAAI,CAAC8B,MAAM,CAAEX,GAAG,IAAKA,GAAG,CAACjB,MAAM,CAAC6B,IAAI,CAAEC,CAAC,IAAKA,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3E,MAAMC,YAAY,GAAGjC,IAAI,CAACkC,MAAM,GAAGL,YAAY,CAACK,MAAM;IACtD,IAAID,YAAY,GAAG,CAAC,EAAE;MACpBtB,OAAO,YAAPA,OAAO,CAAEwB,gBAAgB,YAAzBxB,OAAO,CAAEwB,gBAAgB,CACvBzC,gBAAgB,CAAC0C,aAAa,EAC9B,eAAeH,YAAY,oCAC7B,CAAC;IACH;IAEA,OAAO;MACLnC,KAAK;MACLQ,WAAW;MACXP,YAAY;MACZkB,OAAO;MACPjB,IAAI,EAAE6B,YAAY;MAClBxB,kBAAkB;MAClBE,OAAO;MACPC;IACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { headingText, bodyText } from './parse-utils.js';
|
|
3
|
+
import { getPartsByType, getLinks } from '../../parts/parts.js';
|
|
4
|
+
export class CtaBannerSectionDefinition {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "sectionType", 'ctaBanner');
|
|
7
|
+
_defineProperty(this, "patterns", ['html_comment > h2 > t > list{item[1-]: t? > link}', 'html_comment > h2 > t > link+']);
|
|
8
|
+
_defineProperty(this, "defaults", {
|
|
9
|
+
headline: 'Find more research',
|
|
10
|
+
links: [{
|
|
11
|
+
text: 'Search reports',
|
|
12
|
+
href: 'web5://search/reports'
|
|
13
|
+
}]
|
|
14
|
+
});
|
|
15
|
+
_defineProperty(this, "fixtures", [{
|
|
16
|
+
markdown: `<!-- section:items-from-search, id:items-from-search-more-insights, semantic:items_for_search, reason:offer search for other reports -->
|
|
17
|
+
## Find more Circana research
|
|
18
|
+
Search Circana's resources for topic-specific reports and data.
|
|
19
|
+
- [Search additional reports](web5://search/Circana+reports+and+insights)`,
|
|
20
|
+
expected: {
|
|
21
|
+
headline: 'Find more Circana research',
|
|
22
|
+
description: "Search Circana's resources for topic-specific reports and data.",
|
|
23
|
+
links: [{
|
|
24
|
+
text: 'Search additional reports',
|
|
25
|
+
href: 'web5://search/Circana+reports+and+insights'
|
|
26
|
+
}]
|
|
27
|
+
}
|
|
28
|
+
}]);
|
|
29
|
+
}
|
|
30
|
+
parse(parts, context) {
|
|
31
|
+
const headline = headingText(parts, 2) || '';
|
|
32
|
+
const description = bodyText(parts) || undefined;
|
|
33
|
+
const allLinks = [];
|
|
34
|
+
|
|
35
|
+
// Pattern 1: links inside list items
|
|
36
|
+
const lists = getPartsByType(parts, 'list');
|
|
37
|
+
for (const list of lists) {
|
|
38
|
+
for (const item of ((_list$meta = list.meta) == null ? void 0 : _list$meta.items) ?? []) {
|
|
39
|
+
var _list$meta, _item$meta;
|
|
40
|
+
const itemParts = ((_item$meta = item.meta) == null ? void 0 : _item$meta.parts) ?? [];
|
|
41
|
+
for (const link of getLinks(itemParts)) {
|
|
42
|
+
var _link$content, _link$meta;
|
|
43
|
+
const text = (_link$content = link.content) == null ? void 0 : _link$content.trim();
|
|
44
|
+
const href = (_link$meta = link.meta) == null ? void 0 : _link$meta.href;
|
|
45
|
+
if (text && href) {
|
|
46
|
+
allLinks.push({
|
|
47
|
+
text,
|
|
48
|
+
href
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Pattern 2: links directly in top-level parts (no list wrapper)
|
|
56
|
+
if (allLinks.length === 0) {
|
|
57
|
+
for (const link of getLinks(parts)) {
|
|
58
|
+
var _link$content2, _link$meta2;
|
|
59
|
+
const text = (_link$content2 = link.content) == null ? void 0 : _link$content2.trim();
|
|
60
|
+
const href = (_link$meta2 = link.meta) == null ? void 0 : _link$meta2.href;
|
|
61
|
+
if (text && href) {
|
|
62
|
+
allLinks.push({
|
|
63
|
+
text,
|
|
64
|
+
href
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const imageResult = context == null || context.getContextualImage == null ? void 0 : context.getContextualImage([headline, description]);
|
|
70
|
+
return {
|
|
71
|
+
headline,
|
|
72
|
+
description,
|
|
73
|
+
links: allLinks,
|
|
74
|
+
imageUrl: imageResult == null ? void 0 : imageResult.filename,
|
|
75
|
+
imageFromText: imageResult == null ? void 0 : imageResult.isFromText
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=CtaBannerSectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["headingText","bodyText","getPartsByType","getLinks","CtaBannerSectionDefinition","constructor","_defineProperty","headline","links","text","href","markdown","expected","description","parse","parts","context","undefined","allLinks","lists","list","item","_list$meta","meta","items","_item$meta","itemParts","link","_link$content","_link$meta","content","trim","push","length","_link$content2","_link$meta2","imageResult","getContextualImage","imageUrl","filename","imageFromText","isFromText"],"sources":["../../../../src/component/componentDefinitions/CtaBannerSectionDefinition.ts"],"sourcesContent":["import { headingText, bodyText } from './parse-utils';\nimport {\n getPartsByType,\n getLinks,\n type Part,\n type ListPart,\n} from '../../parts/parts';\nimport type {\n CtaBannerCompProps,\n CtaBannerSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition, ParseContext } from '../section-definition';\n\nexport class CtaBannerSectionDefinition\n implements SectionDefinition<CtaBannerSectionComponent>\n{\n sectionType = 'ctaBanner' as const;\n\n patterns = [\n 'html_comment > h2 > t > list{item[1-]: t? > link}',\n 'html_comment > h2 > t > link+',\n ];\n\n defaults: CtaBannerCompProps = {\n headline: 'Find more research',\n links: [{ text: 'Search reports', href: 'web5://search/reports' }],\n };\n\n fixtures: SectionFixture<CtaBannerCompProps>[] = [\n {\n markdown: `<!-- section:items-from-search, id:items-from-search-more-insights, semantic:items_for_search, reason:offer search for other reports -->\n## Find more Circana research\nSearch Circana's resources for topic-specific reports and data.\n- [Search additional reports](web5://search/Circana+reports+and+insights)`,\n expected: {\n headline: 'Find more Circana research',\n description:\n \"Search Circana's resources for topic-specific reports and data.\",\n links: [\n {\n text: 'Search additional reports',\n href: 'web5://search/Circana+reports+and+insights',\n },\n ],\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): CtaBannerCompProps {\n const headline = headingText(parts, 2) || '';\n const description = bodyText(parts) || undefined;\n\n const allLinks: { text: string; href: string }[] = [];\n\n // Pattern 1: links inside list items\n const lists = getPartsByType<ListPart>(parts, 'list');\n for (const list of lists) {\n for (const item of list.meta?.items ?? []) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n for (const link of getLinks(itemParts)) {\n const text = link.content?.trim();\n const href = link.meta?.href;\n if (text && href) {\n allLinks.push({ text, href });\n }\n }\n }\n }\n\n // Pattern 2: links directly in top-level parts (no list wrapper)\n if (allLinks.length === 0) {\n for (const link of getLinks(parts)) {\n const text = link.content?.trim();\n const href = link.meta?.href;\n if (text && href) {\n allLinks.push({ text, href });\n }\n }\n }\n\n const imageResult = context?.getContextualImage?.([headline, description]);\n\n return {\n headline,\n description,\n links: allLinks,\n imageUrl: imageResult?.filename,\n imageFromText: imageResult?.isFromText,\n };\n }\n}\n"],"mappings":";AAAA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,eAAe;AACrD,SACEC,cAAc,EACdC,QAAQ,QAGH,mBAAmB;AAQ1B,OAAO,MAAMC,0BAA0B,CAEvC;EAAAC,YAAA;IAAAC,eAAA,sBACgB,WAAW;IAAAA,eAAA,mBAEd,CACT,mDAAmD,EACnD,+BAA+B,CAChC;IAAAA,eAAA,mBAE8B;MAC7BC,QAAQ,EAAE,oBAAoB;MAC9BC,KAAK,EAAE,CAAC;QAAEC,IAAI,EAAE,gBAAgB;QAAEC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IAAI,CAAC;cAAEvB,IAAI;cAAEC;YAAK,CAAC,CAAC;UAC/B;QACF;MACF;IACF;;IAEA;IACA,IAAIQ,QAAQ,CAACe,MAAM,KAAK,CAAC,EAAE;MACzB,KAAK,MAAMN,IAAI,IAAIxB,QAAQ,CAACY,KAAK,CAAC,EAAE;QAAA,IAAAmB,cAAA,EAAAC,WAAA;QAClC,MAAM1B,IAAI,IAAAyB,cAAA,GAAGP,IAAI,CAACG,OAAO,qBAAZI,cAAA,CAAcH,IAAI,CAAC,CAAC;QACjC,MAAMrB,IAAI,IAAAyB,WAAA,GAAGR,IAAI,CAACJ,IAAI,qBAATY,WAAA,CAAWzB,IAAI;QAC5B,IAAID,IAAI,IAAIC,IAAI,EAAE;UAChBQ,QAAQ,CAACc,IAAI,CAAC;YAAEvB,IAAI;YAAEC;UAAK,CAAC,CAAC;QAC/B;MACF;IACF;IAEA,MAAM0B,WAAW,GAAGpB,OAAO,YAAPA,OAAO,CAAEqB,kBAAkB,oBAA3BrB,OAAO,CAAEqB,kBAAkB,CAAG,CAAC9B,QAAQ,EAAEM,WAAW,CAAC,CAAC;IAE1E,OAAO;MACLN,QAAQ;MACRM,WAAW;MACXL,KAAK,EAAEU,QAAQ;MACfoB,QAAQ,EAAEF,WAAW,oBAAXA,WAAW,CAAEG,QAAQ;MAC/BC,aAAa,EAAEJ,WAAW,oBAAXA,WAAW,CAAEK;IAC9B,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { headingText, entitySectionBodyText, parseEntityUrl, extractEntityRefs, calloutFromParts, firstImageSrc } from './parse-utils.js';
|
|
3
|
+
import { getPartsByType, getLinks } from '../../parts/parts.js';
|
|
4
|
+
import { DIAGNOSTIC_TYPES } from '../diagnosticTypes.js';
|
|
5
|
+
export class EntitySectionDefinition {
|
|
6
|
+
constructor() {
|
|
7
|
+
_defineProperty(this, "sectionType", 'entity');
|
|
8
|
+
_defineProperty(this, "patterns", [
|
|
9
|
+
// Top-level links with optional images, descriptions, nested lists.
|
|
10
|
+
// Section-level intro/callout live in the head (before the first link);
|
|
11
|
+
// text/callout after a link belong to that item.
|
|
12
|
+
// (covers Solution pattern 1, Blog pattern 1)
|
|
13
|
+
'html_comment* > h2 > html_comment* > (t | callout)* > html_comment* > ((link[entityType] | link[web5Type="search"]) > image? > (t | callout)* > list{item[1-]:t+}?)[1-]',
|
|
14
|
+
// List items with entity links, images, optional extra link, text, optional per-item callout.
|
|
15
|
+
// A trailing section-level callout is intentionally left out so it falls
|
|
16
|
+
// through to the downstream CalloutSection.
|
|
17
|
+
// (covers Solution patterns 2-3, Blog patterns 2-3)
|
|
18
|
+
'html_comment* > h2 > html_comment* > t? > html_comment* > list{item[1-]:(link[entityType] | link[web5Type="search"]) > image? > link? > (t | callout)*}',
|
|
19
|
+
// Simple flat list (original EntitySectionDefinition pattern)
|
|
20
|
+
'html_comment* > h2 > html_comment* > list{item[1-]:link[entityType] > image* > t*}']);
|
|
21
|
+
_defineProperty(this, "defaults", {
|
|
22
|
+
title: 'Entities',
|
|
23
|
+
items: [{
|
|
24
|
+
entityId: 'example-1',
|
|
25
|
+
entityType: 'solution',
|
|
26
|
+
entityUrl: 'entity://solution/example-1',
|
|
27
|
+
linkText: 'Example Entity'
|
|
28
|
+
}]
|
|
29
|
+
});
|
|
30
|
+
_defineProperty(this, "fixtures", [{
|
|
31
|
+
markdown: '## Solutions\n\n- [Marketing Mix](entity://solution/marketing-mix) Optimize your marketing spend\n- [Forecasting](entity://solution/forecasting) Predict future trends',
|
|
32
|
+
expected: {
|
|
33
|
+
title: 'Solutions',
|
|
34
|
+
items: [{
|
|
35
|
+
entityId: 'marketing-mix',
|
|
36
|
+
entityType: 'solution',
|
|
37
|
+
entityUrl: 'entity://solution/marketing-mix',
|
|
38
|
+
linkText: 'Marketing Mix',
|
|
39
|
+
description: 'Optimize your marketing spend'
|
|
40
|
+
}, {
|
|
41
|
+
entityId: 'forecasting',
|
|
42
|
+
entityType: 'solution',
|
|
43
|
+
entityUrl: 'entity://solution/forecasting',
|
|
44
|
+
linkText: 'Forecasting',
|
|
45
|
+
description: 'Predict future trends'
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
// A trailing list item with an empty href used to break the entire
|
|
50
|
+
// section match (entity pattern requires `link[entityType]` per item).
|
|
51
|
+
// The empty-href link is now dropped, the well-formed items still match.
|
|
52
|
+
markdown: '## Core Solutions\n\n- [Measurement](web5://entity/solution/odffFzCwYkXqoGrO3AWEqw) Measurement platform\n- [Survey](web5://entity/solution/l_9OCHEwkLxeMmAwD1OBzw) Survey tools\n- [Liquid Data Engage]()',
|
|
53
|
+
expected: {
|
|
54
|
+
title: 'Core Solutions',
|
|
55
|
+
items: [{
|
|
56
|
+
entityId: 'odffFzCwYkXqoGrO3AWEqw',
|
|
57
|
+
entityType: 'solution',
|
|
58
|
+
entityUrl: 'web5://entity/solution/odffFzCwYkXqoGrO3AWEqw',
|
|
59
|
+
linkText: 'Measurement',
|
|
60
|
+
description: 'Measurement platform'
|
|
61
|
+
}, {
|
|
62
|
+
entityId: 'l_9OCHEwkLxeMmAwD1OBzw',
|
|
63
|
+
entityType: 'solution',
|
|
64
|
+
entityUrl: 'web5://entity/solution/l_9OCHEwkLxeMmAwD1OBzw',
|
|
65
|
+
linkText: 'Survey',
|
|
66
|
+
description: 'Survey tools'
|
|
67
|
+
}]
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
}
|
|
71
|
+
parse(parts, context) {
|
|
72
|
+
const title = headingText(parts, 2) || 'Entities';
|
|
73
|
+
const description = entitySectionBodyText(parts) || undefined;
|
|
74
|
+
|
|
75
|
+
// Section-level description/callout come only from the "head" — the parts
|
|
76
|
+
// before the first top-level entity link. Anything after a link is per-item
|
|
77
|
+
// content (handled by extractEntityRefs) and must not leak into the section
|
|
78
|
+
// header. For list-based patterns there is no top-level entity link, so
|
|
79
|
+
// headParts === parts and behavior is unchanged.
|
|
80
|
+
const firstEntityLinkIdx = parts.findIndex(p => {
|
|
81
|
+
var _meta;
|
|
82
|
+
return p.type === 'link' && parseEntityUrl((_meta = p.meta) == null ? void 0 : _meta.href) !== null;
|
|
83
|
+
});
|
|
84
|
+
const headParts = firstEntityLinkIdx >= 0 ? parts.slice(0, firstEntityLinkIdx) : parts;
|
|
85
|
+
const callout = calloutFromParts(headParts);
|
|
86
|
+
|
|
87
|
+
// Primary path: extractEntityRefs handles both list-item and top-level links
|
|
88
|
+
const entityRefs = extractEntityRefs(parts);
|
|
89
|
+
let items;
|
|
90
|
+
if (entityRefs.length > 0) {
|
|
91
|
+
items = entityRefs.map(e => ({
|
|
92
|
+
entityId: e.entityId,
|
|
93
|
+
entityType: e.entityType,
|
|
94
|
+
linkText: e.linkText || undefined,
|
|
95
|
+
entityUrl: e.entityUrl,
|
|
96
|
+
description: e.description || undefined,
|
|
97
|
+
imageUrl: e.markdownImageUrl,
|
|
98
|
+
callout: e.callout
|
|
99
|
+
}));
|
|
100
|
+
} else {
|
|
101
|
+
// Fallback: try direct link extraction (simple flat-list case)
|
|
102
|
+
items = [];
|
|
103
|
+
const links = getLinks(parts);
|
|
104
|
+
for (const link of links) {
|
|
105
|
+
const parsed = parseEntityUrl(link.meta.href);
|
|
106
|
+
if (parsed) {
|
|
107
|
+
var _link$content;
|
|
108
|
+
items.push({
|
|
109
|
+
entityId: parsed.entityId,
|
|
110
|
+
entityType: parsed.entityType,
|
|
111
|
+
entityUrl: link.meta.href,
|
|
112
|
+
linkText: ((_link$content = link.content) == null ? void 0 : _link$content.trim()) || undefined
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
context == null || context.reportDiagnostic == null || context.reportDiagnostic(DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT, `entity: link skipped, invalid entity URL: ${link.meta.href}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Also check links inside list items
|
|
120
|
+
if (items.length === 0) {
|
|
121
|
+
const lists = getPartsByType(parts, 'list');
|
|
122
|
+
for (const list of lists) {
|
|
123
|
+
var _list$meta;
|
|
124
|
+
const listItems = ((_list$meta = list.meta) == null ? void 0 : _list$meta.items) ?? [];
|
|
125
|
+
for (const item of listItems) {
|
|
126
|
+
var _item$meta;
|
|
127
|
+
const itemParts = ((_item$meta = item.meta) == null ? void 0 : _item$meta.parts) ?? [];
|
|
128
|
+
const itemLinks = itemParts.filter(p => p.type === 'link');
|
|
129
|
+
for (const link of itemLinks) {
|
|
130
|
+
const parsed = parseEntityUrl(link.meta.href);
|
|
131
|
+
if (parsed) {
|
|
132
|
+
var _link$content2;
|
|
133
|
+
const descParts = itemParts.filter(p => p !== link && p.type === 'text').map(p => {
|
|
134
|
+
var _p$content;
|
|
135
|
+
return (_p$content = p.content) == null ? void 0 : _p$content.trim();
|
|
136
|
+
}).filter(Boolean);
|
|
137
|
+
items.push({
|
|
138
|
+
entityId: parsed.entityId,
|
|
139
|
+
entityType: parsed.entityType,
|
|
140
|
+
entityUrl: link.meta.href,
|
|
141
|
+
linkText: ((_link$content2 = link.content) == null ? void 0 : _link$content2.trim()) || undefined,
|
|
142
|
+
description: descParts.join(' ') || undefined,
|
|
143
|
+
imageUrl: firstImageSrc(itemParts)
|
|
144
|
+
});
|
|
145
|
+
} else {
|
|
146
|
+
context == null || context.reportDiagnostic == null || context.reportDiagnostic(DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT, `entity: link skipped, invalid entity URL: ${link.meta.href}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (items.length === 0) {
|
|
154
|
+
context == null || context.reportDiagnostic == null || context.reportDiagnostic(DIAGNOSTIC_TYPES.SECTION_REJECTED, 'entity: no entity links found');
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
callout,
|
|
161
|
+
items
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=EntitySectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["headingText","entitySectionBodyText","parseEntityUrl","extractEntityRefs","calloutFromParts","firstImageSrc","getPartsByType","getLinks","DIAGNOSTIC_TYPES","EntitySectionDefinition","constructor","_defineProperty","title","items","entityId","entityType","entityUrl","linkText","markdown","expected","description","parse","parts","context","undefined","firstEntityLinkIdx","findIndex","p","_meta","type","meta","href","headParts","slice","callout","entityRefs","length","map","e","imageUrl","markdownImageUrl","links","link","parsed","_link$content","push","content","trim","reportDiagnostic","INVALID_LINK_FORMAT","lists","list","_list$meta","listItems","item","_item$meta","itemParts","itemLinks","filter","_link$content2","descParts","_p$content","Boolean","join","SECTION_REJECTED"],"sources":["../../../../src/component/componentDefinitions/EntitySectionDefinition.ts"],"sourcesContent":["import {\n headingText,\n entitySectionBodyText,\n parseEntityUrl,\n extractEntityRefs,\n calloutFromParts,\n firstImageSrc,\n} from './parse-utils';\nimport {\n getPartsByType,\n getLinks,\n type Part,\n type ListPart,\n type LinkPart,\n} from '../../parts/parts';\nimport type {\n EntityCompProps,\n EntityItem,\n EntitySectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition, ParseContext } from '../section-definition';\nimport { DIAGNOSTIC_TYPES } from '../diagnosticTypes';\n\nexport class EntitySectionDefinition\n implements SectionDefinition<EntitySectionComponent>\n{\n sectionType = 'entity' as const;\n patterns = [\n // Top-level links with optional images, descriptions, nested lists.\n // Section-level intro/callout live in the head (before the first link);\n // text/callout after a link belong to that item.\n // (covers Solution pattern 1, Blog pattern 1)\n 'html_comment* > h2 > html_comment* > (t | callout)* > html_comment* > ((link[entityType] | link[web5Type=\"search\"]) > image? > (t | callout)* > list{item[1-]:t+}?)[1-]',\n\n // List items with entity links, images, optional extra link, text, optional per-item callout.\n // A trailing section-level callout is intentionally left out so it falls\n // through to the downstream CalloutSection.\n // (covers Solution patterns 2-3, Blog patterns 2-3)\n 'html_comment* > h2 > html_comment* > t? > html_comment* > list{item[1-]:(link[entityType] | link[web5Type=\"search\"]) > image? > link? > (t | callout)*}',\n\n // Simple flat list (original EntitySectionDefinition pattern)\n 'html_comment* > h2 > html_comment* > list{item[1-]:link[entityType] > image* > t*}',\n ];\n\n defaults: EntityCompProps = {\n title: 'Entities',\n items: [\n {\n entityId: 'example-1',\n entityType: 'solution',\n entityUrl: 'entity://solution/example-1',\n linkText: 'Example Entity',\n },\n ],\n };\n\n fixtures: SectionFixture<EntityCompProps>[] = [\n {\n markdown:\n '## Solutions\\n\\n- [Marketing Mix](entity://solution/marketing-mix) Optimize your marketing spend\\n- [Forecasting](entity://solution/forecasting) Predict future trends',\n expected: {\n title: 'Solutions',\n items: [\n {\n entityId: 'marketing-mix',\n entityType: 'solution',\n entityUrl: 'entity://solution/marketing-mix',\n linkText: 'Marketing Mix',\n description: 'Optimize your marketing spend',\n },\n {\n entityId: 'forecasting',\n entityType: 'solution',\n entityUrl: 'entity://solution/forecasting',\n linkText: 'Forecasting',\n description: 'Predict future trends',\n },\n ],\n },\n },\n {\n // A trailing list item with an empty href used to break the entire\n // section match (entity pattern requires `link[entityType]` per item).\n // The empty-href link is now dropped, the well-formed items still match.\n markdown:\n '## Core Solutions\\n\\n- [Measurement](web5://entity/solution/odffFzCwYkXqoGrO3AWEqw) Measurement platform\\n- [Survey](web5://entity/solution/l_9OCHEwkLxeMmAwD1OBzw) Survey tools\\n- [Liquid Data Engage]()',\n expected: {\n title: 'Core Solutions',\n items: [\n {\n entityId: 'odffFzCwYkXqoGrO3AWEqw',\n entityType: 'solution',\n entityUrl: 'web5://entity/solution/odffFzCwYkXqoGrO3AWEqw',\n linkText: 'Measurement',\n description: 'Measurement platform',\n },\n {\n entityId: 'l_9OCHEwkLxeMmAwD1OBzw',\n entityType: 'solution',\n entityUrl: 'web5://entity/solution/l_9OCHEwkLxeMmAwD1OBzw',\n linkText: 'Survey',\n description: 'Survey tools',\n },\n ],\n },\n },\n ];\n\n parse(parts: Part[], context?: ParseContext): EntityCompProps | null {\n const title = headingText(parts, 2) || 'Entities';\n const description = entitySectionBodyText(parts) || undefined;\n\n // Section-level description/callout come only from the \"head\" — the parts\n // before the first top-level entity link. Anything after a link is per-item\n // content (handled by extractEntityRefs) and must not leak into the section\n // header. For list-based patterns there is no top-level entity link, so\n // headParts === parts and behavior is unchanged.\n const firstEntityLinkIdx = parts.findIndex(\n (p) =>\n p.type === 'link' &&\n parseEntityUrl((p as LinkPart).meta?.href) !== null,\n );\n const headParts =\n firstEntityLinkIdx >= 0 ? parts.slice(0, firstEntityLinkIdx) : parts;\n const callout = calloutFromParts(headParts);\n\n // Primary path: extractEntityRefs handles both list-item and top-level links\n const entityRefs = extractEntityRefs(parts);\n\n let items: EntityItem[];\n\n if (entityRefs.length > 0) {\n items = entityRefs.map((e) => ({\n entityId: e.entityId,\n entityType: e.entityType,\n linkText: e.linkText || undefined,\n entityUrl: e.entityUrl,\n description: e.description || undefined,\n imageUrl: e.markdownImageUrl,\n callout: e.callout,\n }));\n } else {\n // Fallback: try direct link extraction (simple flat-list case)\n items = [];\n const links = getLinks(parts);\n for (const link of links) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed) {\n items.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n entityUrl: link.meta.href,\n linkText: link.content?.trim() || undefined,\n });\n } else {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT,\n `entity: link skipped, invalid entity URL: ${link.meta.href}`,\n );\n }\n }\n\n // Also check links inside list items\n if (items.length === 0) {\n const lists = getPartsByType<ListPart>(parts, 'list');\n for (const list of lists) {\n const listItems = list.meta?.items ?? [];\n for (const item of listItems) {\n const itemParts = (item.meta?.parts ?? []) as Part[];\n const itemLinks = itemParts.filter(\n (p): p is LinkPart => p.type === 'link',\n );\n for (const link of itemLinks) {\n const parsed = parseEntityUrl(link.meta.href);\n if (parsed) {\n const descParts = itemParts\n .filter((p) => p !== link && p.type === 'text')\n .map((p) => p.content?.trim())\n .filter(Boolean);\n items.push({\n entityId: parsed.entityId,\n entityType: parsed.entityType,\n entityUrl: link.meta.href,\n linkText: link.content?.trim() || undefined,\n description: descParts.join(' ') || undefined,\n imageUrl: firstImageSrc(itemParts),\n });\n } else {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.INVALID_LINK_FORMAT,\n `entity: link skipped, invalid entity URL: ${link.meta.href}`,\n );\n }\n }\n }\n }\n }\n }\n\n if (items.length === 0) {\n context?.reportDiagnostic?.(\n DIAGNOSTIC_TYPES.SECTION_REJECTED,\n 'entity: no entity links found',\n );\n return null;\n }\n\n return { title, description, callout, items };\n }\n}\n"],"mappings":";AAAA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,EAChBC,aAAa,QACR,eAAe;AACtB,SACEC,cAAc,EACdC,QAAQ,QAIH,mBAAmB;AAQ1B,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,OAAO,MAAMC,uBAAuB,CAEpC;EAAAC,YAAA;IAAAC,eAAA,sBACgB,QAAQ;IAAAA,eAAA,mBACX;IACT;IACA;IACA;IACA;IACA,yKAAyK;IAEzK;IACA;IACA;IACA;IACA,yJAAyJ;IAEzJ;IACA,oFAAoF,CACrF;IAAAA,eAAA,mBAE2B;MAC1BC,KAAK,EAAE,UAAU;MACjBC,KAAK,EAAE,CACL;QACEC,QAAQ,EAAE,WAAW;QACrBC,UAAU,EAAE,UAAU;QACtBC,SAAS,EAAE,6BAA6B;QACxCC,QAAQ,EAAE;MACZ,CAAC;IAEL,CAAC;IAAAN,eAAA,mBAE6C,CAC5C;MACEO,QAAQ,EACN,wKAAwK;MAC1KC,QAAQ,EAAE;QACRP,KAAK,EAAE,WAAW;QAClBC,KAAK,EAAE,CACL;UACEC,QAAQ,E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D,KAAK,CAACgC,IAAI,CAAC;kBACT/B,QAAQ,EAAE6B,MAAM,CAAC7B,QAAQ;kBACzBC,UAAU,EAAE4B,MAAM,CAAC5B,UAAU;kBAC7BC,SAAS,EAAE0B,IAAI,CAACZ,IAAI,CAACC,IAAI;kBACzBd,QAAQ,EAAE,EAAA0C,cAAA,GAAAjB,IAAI,CAACI,OAAO,qBAAZa,cAAA,CAAcZ,IAAI,CAAC,CAAC,KAAIvB,SAAS;kBAC3CJ,WAAW,EAAEwC,SAAS,CAACG,IAAI,CAAC,GAAG,CAAC,IAAIvC,SAAS;kBAC7Ce,QAAQ,EAAElC,aAAa,CAACmD,SAAS;gBACnC,CAAC,CAAC;cACJ,CAAC,MAAM;gBACLjC,OAAO,YAAPA,OAAO,CAAEyB,gBAAgB,YAAzBzB,OAAO,CAAEyB,gBAAgB,CACvBxC,gBAAgB,CAACyC,mBAAmB,EACpC,6CAA6CP,IAAI,CAACZ,IAAI,CAACC,IAAI,EAC7D,CAAC;cACH;YACF;UACF;QACF;MACF;IACF;IAEA,IAAIlB,KAAK,CAACuB,MAAM,KAAK,CAAC,EAAE;MACtBb,OAAO,YAAPA,OAAO,CAAEyB,gBAAgB,YAAzBzB,OAAO,CAAEyB,gBAAgB,CACvBxC,gBAAgB,CAACwD,gBAAgB,EACjC,+BACF,CAAC;MACD,OAAO,IAAI;IACb;IAEA,OAAO;MAAEpD,KAAK;MAAEQ,WAAW;MAAEc,OAAO;MAAErB;IAAM,CAAC;EAC/C;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { bodyText } from './parse-utils.js';
|
|
3
|
+
const ERROR_PATTERNS = [{
|
|
4
|
+
pattern: /Error: conversation-404/i,
|
|
5
|
+
type: 'conversation-404'
|
|
6
|
+
}, {
|
|
7
|
+
pattern: /Error: conversation-403/i,
|
|
8
|
+
type: 'conversation-403'
|
|
9
|
+
}, {
|
|
10
|
+
pattern: /Error: conversation-500/i,
|
|
11
|
+
type: 'conversation-500'
|
|
12
|
+
}, {
|
|
13
|
+
pattern: /Error: conversation-generic-network-error/i,
|
|
14
|
+
type: 'conversation-generic-network-error'
|
|
15
|
+
}, {
|
|
16
|
+
pattern: /Error: conversation-timeout/i,
|
|
17
|
+
type: 'conversation-timeout'
|
|
18
|
+
}, {
|
|
19
|
+
pattern: /Error: conversation-partial-load/i,
|
|
20
|
+
type: 'conversation-partial-load'
|
|
21
|
+
}, {
|
|
22
|
+
pattern: /Error: conversation-streaming-error/i,
|
|
23
|
+
type: 'conversation-streaming-error'
|
|
24
|
+
}, {
|
|
25
|
+
pattern: /Error: conversation-llm-empty-response/i,
|
|
26
|
+
type: 'conversation-llm-empty-response'
|
|
27
|
+
}, {
|
|
28
|
+
pattern: /Error: history-load-error/i,
|
|
29
|
+
type: 'history-load-error'
|
|
30
|
+
}, {
|
|
31
|
+
pattern: /^error/i,
|
|
32
|
+
type: 'conversation-llm-error-text'
|
|
33
|
+
}, {
|
|
34
|
+
pattern: /Error/i,
|
|
35
|
+
type: 'conversation-llm-error-text'
|
|
36
|
+
}];
|
|
37
|
+
export class ErrorSectionDefinition {
|
|
38
|
+
constructor() {
|
|
39
|
+
_defineProperty(this, "sectionType", 'error');
|
|
40
|
+
_defineProperty(this, "patterns", ['t']);
|
|
41
|
+
_defineProperty(this, "maxConsumedNodes", 1);
|
|
42
|
+
_defineProperty(this, "defaults", {
|
|
43
|
+
type: 'conversation-llm-error-text'
|
|
44
|
+
});
|
|
45
|
+
_defineProperty(this, "fixtures", [{
|
|
46
|
+
markdown: 'Error: conversation-404',
|
|
47
|
+
expected: {
|
|
48
|
+
type: 'conversation-404'
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
markdown: 'Error: conversation-500',
|
|
52
|
+
expected: {
|
|
53
|
+
type: 'conversation-500'
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
}
|
|
57
|
+
parse(parts) {
|
|
58
|
+
const text = bodyText(parts);
|
|
59
|
+
if (!text) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
for (const {
|
|
63
|
+
pattern,
|
|
64
|
+
type
|
|
65
|
+
} of ERROR_PATTERNS) {
|
|
66
|
+
if (pattern.test(text)) {
|
|
67
|
+
return {
|
|
68
|
+
type
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=ErrorSectionDefinition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bodyText","ERROR_PATTERNS","pattern","type","ErrorSectionDefinition","constructor","_defineProperty","markdown","expected","parse","parts","text","test"],"sources":["../../../../src/component/componentDefinitions/ErrorSectionDefinition.ts"],"sourcesContent":["import { bodyText } from './parse-utils';\nimport type { Part } from '../../parts/parts';\nimport type {\n ErrorCompProps,\n ErrorSectionComponent,\n SectionFixture,\n} from '../types';\nimport type { SectionDefinition } from '../section-definition';\nimport type { ConversationErrorType } from '../../errors/conversationErrorTypes';\n\ninterface ErrorPattern {\n pattern: RegExp;\n type: ConversationErrorType;\n}\n\nconst ERROR_PATTERNS: ErrorPattern[] = [\n { pattern: /Error: conversation-404/i, type: 'conversation-404' },\n { pattern: /Error: conversation-403/i, type: 'conversation-403' },\n { pattern: /Error: conversation-500/i, type: 'conversation-500' },\n {\n pattern: /Error: conversation-generic-network-error/i,\n type: 'conversation-generic-network-error',\n },\n { pattern: /Error: conversation-timeout/i, type: 'conversation-timeout' },\n {\n pattern: /Error: conversation-partial-load/i,\n type: 'conversation-partial-load',\n },\n {\n pattern: /Error: conversation-streaming-error/i,\n type: 'conversation-streaming-error',\n },\n {\n pattern: /Error: conversation-llm-empty-response/i,\n type: 'conversation-llm-empty-response',\n },\n { pattern: /Error: history-load-error/i, type: 'history-load-error' },\n { pattern: /^error/i, type: 'conversation-llm-error-text' },\n { pattern: /Error/i, type: 'conversation-llm-error-text' },\n];\n\nexport class ErrorSectionDefinition\n implements SectionDefinition<ErrorSectionComponent>\n{\n sectionType = 'error' as const;\n patterns = ['t'];\n maxConsumedNodes = 1;\n\n defaults: ErrorCompProps = {\n type: 'conversation-llm-error-text',\n };\n\n fixtures: SectionFixture<ErrorCompProps>[] = [\n {\n markdown: 'Error: conversation-404',\n expected: { type: 'conversation-404' },\n },\n {\n markdown: 'Error: conversation-500',\n expected: { type: 'conversation-500' },\n },\n ];\n\n parse(parts: Part[]): ErrorCompProps | null {\n const text = bodyText(parts);\n if (!text) {\n return null;\n }\n\n for (const { pattern, type } of ERROR_PATTERNS) {\n if (pattern.test(text)) {\n return { type };\n }\n }\n\n return null;\n }\n}\n"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,eAAe;AAexC,MAAMC,cAA8B,GAAG,CACrC;EAAEC,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EAAED,OAAO,EAAE,0BAA0B;EAAEC,IAAI,EAAE;AAAmB,CAAC,EACjE;EACED,OAAO,EAAE,4CAA4C;EACrDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,8BAA8B;EAAEC,IAAI,EAAE;AAAuB,CAAC,EACzE;EACED,OAAO,EAAE,mCAAmC;EAC5CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,sCAAsC;EAC/CC,IAAI,EAAE;AACR,CAAC,EACD;EACED,OAAO,EAAE,yCAAyC;EAClDC,IAAI,EAAE;AACR,CAAC,EACD;EAAED,OAAO,EAAE,4BAA4B;EAAEC,IAAI,EAAE;AAAqB,CAAC,EACrE;EAAED,OAAO,EAAE,SAAS;EAAEC,IAAI,EAAE;AAA8B,CAAC,EAC3D;EAAED,OAAO,EAAE,QAAQ;EAAEC,IAAI,EAAE;AAA8B,CAAC,CAC3D;AA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