diff --git a/packages/atomic/src/components.d.ts b/packages/atomic/src/components.d.ts index 199cd500d50..07e23cdf3cb 100644 --- a/packages/atomic/src/components.d.ts +++ b/packages/atomic/src/components.d.ts @@ -21,7 +21,7 @@ import { unknown as AnyBindings, ItemDisplayBasicLayout as ItemDisplayBasicLayou import { AnyBindings as AnyBindings1 } from "./components/common/interface/bindings"; import { NumberInputType } from "./components/common/facets/facet-number-input/number-input-type"; import { NumericFilter, NumericFilterState, RelativeDateUnit } from "./components/common/types"; -import { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction } from "./components/insight"; +import { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction } from "@coveo/headless/insight"; import { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface"; import { InsightStore } from "./components/insight/atomic-insight-interface/store"; import { InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action"; @@ -31,8 +31,7 @@ import { CommerceStore } from "./components/commerce/atomic-commerce-interface/s import { CommerceRecommendationStore } from "./components/commerce/atomic-commerce-recommendation-interface/store"; import { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children"; import { TruncateAfter } from "./components/common/expandable-text/expandable-text"; -import { RecommendationEngine } from "@coveo/headless/recommendation"; -import { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations"; +import { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation"; import { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface"; import { RecsStore } from "./components/recommendations/atomic-recs-interface/store"; import { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface"; @@ -55,7 +54,7 @@ export { unknown as AnyBindings, ItemDisplayBasicLayout as ItemDisplayBasicLayou export { AnyBindings as AnyBindings1 } from "./components/common/interface/bindings"; export { NumberInputType } from "./components/common/facets/facet-number-input/number-input-type"; export { NumericFilter, NumericFilterState, RelativeDateUnit } from "./components/common/types"; -export { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction } from "./components/insight"; +export { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, UserAction as IUserAction } from "@coveo/headless/insight"; export { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface"; export { InsightStore } from "./components/insight/atomic-insight-interface/store"; export { InsightResultActionClickedEvent } from "./components/insight/atomic-insight-result-action/atomic-insight-result-action"; @@ -65,8 +64,7 @@ export { CommerceStore } from "./components/commerce/atomic-commerce-interface/s export { CommerceRecommendationStore } from "./components/commerce/atomic-commerce-recommendation-interface/store"; export { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children"; export { TruncateAfter } from "./components/common/expandable-text/expandable-text"; -export { RecommendationEngine } from "@coveo/headless/recommendation"; -export { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations"; +export { RecommendationEngine, InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "@coveo/headless/recommendation"; export { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface"; export { RecsStore } from "./components/recommendations/atomic-recs-interface/store"; export { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface"; diff --git a/packages/atomic/src/components/commerce/index.ts b/packages/atomic/src/components/commerce/index.ts new file mode 100644 index 00000000000..c4c89001dce --- /dev/null +++ b/packages/atomic/src/components/commerce/index.ts @@ -0,0 +1,5 @@ +// Export the class of the components migrated to Lit here, like this: +//export {AtomicCommerceBreadbox} from './atomic-commerce-breadbox/atomic-commerce-breadbox.js'; + +// TODO: Remove this line once at least one component is migrated to Lit. +export {}; diff --git a/packages/atomic/src/components/commerce/lazy-index.ts b/packages/atomic/src/components/commerce/lazy-index.ts new file mode 100644 index 00000000000..3a8e1fdd2ac --- /dev/null +++ b/packages/atomic/src/components/commerce/lazy-index.ts @@ -0,0 +1,6 @@ +export default { + // Add entries as such when new components are added/moved to Lit. + // 'atomic-commerce-breadbox': async () => await import('./atomic-commerce-breadbox/atomic-commerce-breadbox.js'), +} as Record Promise>; + +export type * from './index.js'; diff --git a/packages/atomic/src/components/common/interface/analytics-config.ts b/packages/atomic/src/components/common/interface/analytics-config.ts index cf5bd19657a..046a4290b65 100644 --- a/packages/atomic/src/components/common/interface/analytics-config.ts +++ b/packages/atomic/src/components/common/interface/analytics-config.ts @@ -4,9 +4,9 @@ import { EngineConfiguration, } from '@coveo/headless'; import {AnalyticsClientSendEventHook} from '@coveo/headless'; +import {InsightEngineConfiguration} from '@coveo/headless/insight'; +import {RecommendationEngineConfiguration} from '@coveo/headless/recommendation'; import {getAtomicEnvironment} from '../../../global/environment'; -import {InsightEngineConfiguration} from '../../insight'; -import {RecommendationEngineConfiguration} from '../../recommendations'; export type AnalyticsPayload = Parameters[1]; diff --git a/packages/atomic/src/components/common/interface/bindings.ts b/packages/atomic/src/components/common/interface/bindings.ts index d59a75b07f1..6c0239670f2 100644 --- a/packages/atomic/src/components/common/interface/bindings.ts +++ b/packages/atomic/src/components/common/interface/bindings.ts @@ -1,10 +1,10 @@ import type {SearchEngine} from '@coveo/headless'; import {CommerceEngine} from '@coveo/headless/commerce'; +import {InsightEngine} from '@coveo/headless/insight'; import type {RecommendationEngine} from '@coveo/headless/recommendation'; import {i18n} from 'i18next'; import {CommerceStore} from '../../commerce/atomic-commerce-interface/store'; import {CommerceRecommendationStore} from '../../commerce/atomic-commerce-recommendation-interface/store'; -import {InsightEngine} from '../../insight'; import {InsightStore} from '../../insight/atomic-insight-interface/store'; import {RecsStore} from '../../recommendations/atomic-recs-interface/store'; import {SearchStore} from '../../search/atomic-search-interface/store'; diff --git a/packages/atomic/src/components/common/interface/item.ts b/packages/atomic/src/components/common/interface/item.ts index ab9d8ba8bc5..86ce1aafc5c 100644 --- a/packages/atomic/src/components/common/interface/item.ts +++ b/packages/atomic/src/components/common/interface/item.ts @@ -1,6 +1,6 @@ import {FoldedResult, Result} from '@coveo/headless'; import {Product} from '@coveo/headless/commerce'; -import {InsightResult} from '../../insight'; +import {Result as InsightResult} from '@coveo/headless/insight'; export type AnyItem = FoldedResult | AnyUnfoldedItem | Product; export type AnyUnfoldedItem = Result | InsightResult; diff --git a/packages/atomic/src/components/index.ts b/packages/atomic/src/components/index.ts index a5fa9b02d4c..b4ba0bddaf1 100644 --- a/packages/atomic/src/components/index.ts +++ b/packages/atomic/src/components/index.ts @@ -1 +1,5 @@ export * from './search/index.js'; +export * from './insight/index.js'; +export * from './commerce/index.js'; +export * from './ipx/index.js'; +export * from './recommendations/index.js'; diff --git a/packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.tsx b/packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.tsx index 4659573457e..229e79c1ba9 100644 --- a/packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.tsx @@ -1,19 +1,19 @@ import {FacetResultsMustMatch} from '@coveo/headless'; -import {Component, h, State, Prop, Element, VNode} from '@stencil/core'; import { - buildInsightFacet, - buildInsightFacetConditionsManager, - buildInsightSearchStatus, - InsightCategoryFacetValueRequest, - InsightFacet, - InsightFacetConditionsManager, - InsightFacetOptions, - InsightFacetSortCriterion, - InsightFacetState, - InsightFacetValueRequest, - InsightSearchStatus, - InsightSearchStatusState, -} from '..'; + buildFacet as buildInsightFacet, + buildFacetConditionsManager as buildInsightFacetConditionsManager, + buildSearchStatus as buildInsightSearchStatus, + CategoryFacetValueRequest as InsightCategoryFacetValueRequest, + Facet as InsightFacet, + FacetConditionsManager as InsightFacetConditionsManager, + FacetOptions as InsightFacetOptions, + FacetSortCriterion as InsightFacetSortCriterion, + FacetState as InsightFacetState, + FacetValueRequest as InsightFacetValueRequest, + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, +} from '@coveo/headless/insight'; +import {Component, h, State, Prop, Element, VNode} from '@stencil/core'; import { AriaLiveRegion, FocusTargetController, diff --git a/packages/atomic/src/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tsx b/packages/atomic/src/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tsx index 7b05385f2f6..9fc06e3c7d8 100644 --- a/packages/atomic/src/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.tsx @@ -1,13 +1,13 @@ -import {Component, Element, State, Prop, Watch} from '@stencil/core'; import { - InsightSearchStatus, - InsightSearchStatusState, - buildInsightGeneratedAnswer, - buildInsightInteractiveCitation, - buildInsightSearchStatus, - InsightGeneratedAnswer, - InsightGeneratedAnswerState, -} from '..'; + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, + buildGeneratedAnswer as buildInsightGeneratedAnswer, + buildInteractiveCitation as buildInsightInteractiveCitation, + buildSearchStatus as buildInsightSearchStatus, + GeneratedAnswer as InsightGeneratedAnswer, + GeneratedAnswerState as InsightGeneratedAnswerState, +} from '@coveo/headless/insight'; +import {Component, Element, State, Prop, Watch} from '@stencil/core'; import {AriaLiveRegion} from '../../../utils/accessibility-utils'; import {debounce} from '../../../utils/debounce-utils'; import { diff --git a/packages/atomic/src/components/insight/atomic-insight-interface/analytics-config.ts b/packages/atomic/src/components/insight/atomic-insight-interface/analytics-config.ts index ca5f8174fe2..ec5a06db19f 100644 --- a/packages/atomic/src/components/insight/atomic-insight-interface/analytics-config.ts +++ b/packages/atomic/src/components/insight/atomic-insight-interface/analytics-config.ts @@ -1,4 +1,7 @@ -import {InsightAnalyticsConfiguration, InsightEngineConfiguration} from '..'; +import { + AnalyticsConfiguration as InsightAnalyticsConfiguration, + EngineConfiguration as InsightEngineConfiguration, +} from '@coveo/headless/insight'; import { AnalyticsPayload, augmentAnalyticsWithAtomicVersion, diff --git a/packages/atomic/src/components/insight/atomic-insight-interface/atomic-insight-interface.tsx b/packages/atomic/src/components/insight/atomic-insight-interface/atomic-insight-interface.tsx index 566b984d9a5..50cecfd5a50 100644 --- a/packages/atomic/src/components/insight/atomic-insight-interface/atomic-insight-interface.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-interface/atomic-insight-interface.tsx @@ -1,4 +1,11 @@ import {loadFieldActions} from '@coveo/headless/insight'; +import { + LogLevel as InsightLogLevel, + InsightEngine, + InsightEngineConfiguration, + buildInsightEngine, + buildResultsPerPage as buildInsightResultsPerPage, +} from '@coveo/headless/insight'; import { Component, Element, @@ -11,13 +18,6 @@ import { Watch, } from '@stencil/core'; import i18next, {i18n} from 'i18next'; -import { - InsightLogLevel, - InsightEngine, - InsightEngineConfiguration, - buildInsightEngine, - buildInsightResultsPerPage, -} from '..'; import {InitializeEvent} from '../../../utils/initialization-utils'; import {ArrayProp} from '../../../utils/props-utils'; import {CommonBindings, NonceBindings} from '../../common/interface/bindings'; diff --git a/packages/atomic/src/components/insight/atomic-insight-numeric-facet/atomic-insight-numeric-facet.tsx b/packages/atomic/src/components/insight/atomic-insight-numeric-facet/atomic-insight-numeric-facet.tsx index 10376a64311..8513d7f67c2 100644 --- a/packages/atomic/src/components/insight/atomic-insight-numeric-facet/atomic-insight-numeric-facet.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-numeric-facet/atomic-insight-numeric-facet.tsx @@ -1,25 +1,25 @@ import {Schema, StringValue} from '@coveo/bueno'; -import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import { - buildInsightFacetConditionsManager, - buildInsightNumericFacet, - buildInsightNumericFilter, - buildInsightNumericRange, - buildInsightSearchStatus, - InsightCategoryFacetValueRequest, - InsightFacetConditionsManager, - InsightFacetValueRequest, - InsightNumericFacet, - InsightNumericFacetState, - InsightNumericFilter, - InsightNumericFilterState, - InsightNumericRangeRequest, - InsightRangeFacetRangeAlgorithm, - InsightRangeFacetSortCriterion, - InsightSearchStatus, - InsightSearchStatusState, - loadInsightNumericFacetSetActions, -} from '..'; + buildFacetConditionsManager as buildInsightFacetConditionsManager, + buildNumericFacet as buildInsightNumericFacet, + buildNumericFilter as buildInsightNumericFilter, + buildNumericRange as buildInsightNumericRange, + buildSearchStatus as buildInsightSearchStatus, + CategoryFacetValueRequest as InsightCategoryFacetValueRequest, + FacetConditionsManager as InsightFacetConditionsManager, + FacetValueRequest as InsightFacetValueRequest, + NumericFacet as InsightNumericFacet, + NumericFacetState as InsightNumericFacetState, + NumericFilter as InsightNumericFilter, + NumericFilterState as InsightNumericFilterState, + NumericRangeRequest as InsightNumericRangeRequest, + RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, + RangeFacetSortCriterion as InsightRangeFacetSortCriterion, + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, + loadNumericFacetSetActions as loadInsightNumericFacetSetActions, +} from '@coveo/headless/insight'; +import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import {FocusTargetController} from '../../../utils/accessibility-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/insight/atomic-insight-pager/atomic-insight-pager.tsx b/packages/atomic/src/components/insight/atomic-insight-pager/atomic-insight-pager.tsx index 3ffadacf09e..1f5fba679f3 100644 --- a/packages/atomic/src/components/insight/atomic-insight-pager/atomic-insight-pager.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-pager/atomic-insight-pager.tsx @@ -1,12 +1,12 @@ -import {Component, Event, EventEmitter, h, Prop, State} from '@stencil/core'; import { - buildInsightPager, - buildInsightSearchStatus, - InsightPager, - InsightPagerState, - InsightSearchStatus, - InsightSearchStatusState, -} from '../'; + buildPager as buildInsightPager, + buildSearchStatus as buildInsightSearchStatus, + Pager as InsightPager, + PagerState as InsightPagerState, + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, +} from '@coveo/headless/insight'; +import {Component, Event, EventEmitter, h, Prop, State} from '@stencil/core'; import ArrowLeftIcon from '../../../images/arrow-left-rounded.svg'; import ArrowRightIcon from '../../../images/arrow-right-rounded.svg'; import {FocusTargetController} from '../../../utils/accessibility-utils'; diff --git a/packages/atomic/src/components/insight/atomic-insight-refine-modal/atomic-insight-refine-modal.tsx b/packages/atomic/src/components/insight/atomic-insight-refine-modal/atomic-insight-refine-modal.tsx index f6e3f6e1d00..b01c0582b8a 100644 --- a/packages/atomic/src/components/insight/atomic-insight-refine-modal/atomic-insight-refine-modal.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-refine-modal/atomic-insight-refine-modal.tsx @@ -1,12 +1,12 @@ -import {Component, h, State, Prop, Element, Watch, Host} from '@stencil/core'; import { - InsightQuerySummary, - InsightQuerySummaryState, - buildInsightQuerySummary, - InsightBreadcrumbManager, - InsightBreadcrumbManagerState, - buildInsightBreadcrumbManager, -} from '..'; + QuerySummary as InsightQuerySummary, + QuerySummaryState as InsightQuerySummaryState, + buildQuerySummary as buildInsightQuerySummary, + BreadcrumbManager as InsightBreadcrumbManager, + BreadcrumbManagerState as InsightBreadcrumbManagerState, + buildBreadcrumbManager as buildInsightBreadcrumbManager, +} from '@coveo/headless/insight'; +import {Component, h, State, Prop, Element, Watch, Host} from '@stencil/core'; import {rectEquals} from '../../../utils/dom-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/insight/atomic-insight-refine-toggle/atomic-insight-refine-toggle.tsx b/packages/atomic/src/components/insight/atomic-insight-refine-toggle/atomic-insight-refine-toggle.tsx index 6aeff8ec001..b44ba502ca6 100644 --- a/packages/atomic/src/components/insight/atomic-insight-refine-toggle/atomic-insight-refine-toggle.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-refine-toggle/atomic-insight-refine-toggle.tsx @@ -1,12 +1,12 @@ -import {Component, h, State, Element} from '@stencil/core'; import { - buildInsightBreadcrumbManager, - buildInsightSearchStatus, - InsightBreadcrumbManager, - InsightBreadcrumbManagerState, - InsightSearchStatus, - InsightSearchStatusState, -} from '..'; + buildBreadcrumbManager as buildInsightBreadcrumbManager, + buildSearchStatus as buildInsightSearchStatus, + BreadcrumbManager as InsightBreadcrumbManager, + BreadcrumbManagerState as InsightBreadcrumbManagerState, + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, +} from '@coveo/headless/insight'; +import {Component, h, State, Element} from '@stencil/core'; import FilterIcon from '../../../images/filter.svg'; import { InitializeBindings, diff --git a/packages/atomic/src/components/insight/atomic-insight-result/atomic-insight-result.tsx b/packages/atomic/src/components/insight/atomic-insight-result/atomic-insight-result.tsx index b1b3d1f0404..03a0d35d1d1 100644 --- a/packages/atomic/src/components/insight/atomic-insight-result/atomic-insight-result.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-result/atomic-insight-result.tsx @@ -1,5 +1,9 @@ +import { + Result as InsightResult, + InteractiveResult as InsightInteractiveResult, + FoldedResult as InsightFoldedResult, +} from '@coveo/headless/insight'; import {Component, h, Prop, Element, Listen, Host} from '@stencil/core'; -import {InsightResult, InsightInteractiveResult, InsightFoldedResult} from '..'; import {applyFocusVisiblePolyfill} from '../../../utils/initialization-utils'; import { DisplayConfig, diff --git a/packages/atomic/src/components/insight/atomic-insight-search-box/atomic-insight-search-box.tsx b/packages/atomic/src/components/insight/atomic-insight-search-box/atomic-insight-search-box.tsx index 16ecded04a9..a20f21ee969 100644 --- a/packages/atomic/src/components/insight/atomic-insight-search-box/atomic-insight-search-box.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-search-box/atomic-insight-search-box.tsx @@ -1,11 +1,11 @@ import {loadInsightSearchActions} from '@coveo/headless/insight'; -import {Component, Element, h, Prop, State} from '@stencil/core'; import { - buildInsightSearchBox, - InsightSearchBox, - InsightSearchBoxState, - InsightSuggestion, -} from '..'; + buildSearchBox as buildInsightSearchBox, + SearchBox as InsightSearchBox, + SearchBoxState as InsightSearchBoxState, + Suggestion as InsightSuggestion, +} from '@coveo/headless/insight'; +import {Component, Element, h, Prop, State} from '@stencil/core'; import SearchSlimIcon from '../../../images/search-slim.svg'; import {AriaLiveRegion} from '../../../utils/accessibility-utils'; import {hasKeyboard, isMacOS} from '../../../utils/device-utils'; diff --git a/packages/atomic/src/components/insight/atomic-insight-tab/atomic-insight-tab.tsx b/packages/atomic/src/components/insight/atomic-insight-tab/atomic-insight-tab.tsx index cc76136dc54..8fcb4e2966e 100644 --- a/packages/atomic/src/components/insight/atomic-insight-tab/atomic-insight-tab.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-tab/atomic-insight-tab.tsx @@ -1,6 +1,10 @@ import {Unsubscribe} from '@coveo/headless'; +import { + buildTab as buildInsightTab, + Tab as InsightTab, + TabState as InsightTabState, +} from '@coveo/headless/insight'; import {Component, h, Prop, State, Method, Element} from '@stencil/core'; -import {buildInsightTab, InsightTab, InsightTabState} from '..'; import { BindStateToController, InitializableComponent, diff --git a/packages/atomic/src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.tsx b/packages/atomic/src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.tsx index 7c6fa398536..492b8879e48 100644 --- a/packages/atomic/src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.tsx +++ b/packages/atomic/src/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.tsx @@ -1,23 +1,23 @@ -import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import { - buildInsightDateFacet, - buildInsightDateFilter, - buildInsightDateRange, - buildInsightFacetConditionsManager, - buildInsightSearchStatus, - deserializeInsightRelativeDate, - InsightDateFacet, - InsightDateFacetState, - InsightDateFilter, - InsightDateFilterState, - InsightDateRangeRequest, - InsightSearchStatus, - InsightSearchStatusState, - loadInsightDateFacetSetActions, - InsightRangeFacetSortCriterion, - InsightFacetValueRequest, - InsightCategoryFacetValueRequest, -} from '..'; + buildDateFacet as buildInsightDateFacet, + buildDateFilter as buildInsightDateFilter, + buildDateRange as buildInsightDateRange, + buildFacetConditionsManager as buildInsightFacetConditionsManager, + buildSearchStatus as buildInsightSearchStatus, + deserializeRelativeDate as deserializeInsightRelativeDate, + DateFacet as InsightDateFacet, + DateFacetState as InsightDateFacetState, + DateFilter as InsightDateFilter, + DateFilterState as InsightDateFilterState, + DateRangeRequest as InsightDateRangeRequest, + SearchStatus as InsightSearchStatus, + SearchStatusState as InsightSearchStatusState, + loadDateFacetSetActions as loadInsightDateFacetSetActions, + RangeFacetSortCriterion as InsightRangeFacetSortCriterion, + FacetValueRequest as InsightFacetValueRequest, + CategoryFacetValueRequest as InsightCategoryFacetValueRequest, +} from '@coveo/headless/insight'; +import {Component, Element, h, Listen, Prop, State} from '@stencil/core'; import {FocusTargetController} from '../../../utils/accessibility-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/insight/index.ts b/packages/atomic/src/components/insight/index.ts index 0febfc784fe..e222af309e2 100644 --- a/packages/atomic/src/components/insight/index.ts +++ b/packages/atomic/src/components/insight/index.ts @@ -1,110 +1,5 @@ -export { - AnalyticsConfiguration as InsightAnalyticsConfiguration, - LogLevel as InsightLogLevel, - InsightEngine, - InsightEngineConfiguration, - buildInsightEngine, - getSampleInsightEngineConfiguration, - ResultList as InsightResultList, - ResultListState as InsightResultListState, - buildResultList as buildInsightResultList, - Result as InsightResult, - ResultTemplate as InsightResultTemplate, - ResultTemplateCondition as InsightResultTemplateCondition, - ResultTemplatesManager as InsightResultTemplatesManager, - buildResultTemplatesManager as insightBuildResultTemplatesManager, - SearchBox as InsightSearchBox, - SearchBoxState as InsightSearchBoxState, - buildSearchBox as buildInsightSearchBox, - SearchStatus as InsightSearchStatus, - SearchStatusState as InsightSearchStatusState, - buildSearchStatus as buildInsightSearchStatus, - Facet as InsightFacet, - FacetState as InsightFacetState, - FacetSearchState as InsightFacetSearchState, - buildFacet as buildInsightFacet, - FacetOptions as InsightFacetOptions, - FacetValue as InsightFacetValue, - NumericRangeRequest as InsightNumericRangeRequest, - NumericFacet as InsightNumericFacet, - DateFacet as InsightDateFacet, - NumericFacetValue as InsightNumericFacetValue, - NumericFacetState as InsightNumericFacetState, - NumericFilter as InsightNumericFilter, - NumericFilterState as InsightNumericFilterState, - DateFacetValue as InsightDateFacetValue, - QuerySummary as InsightQuerySummary, - QuerySummaryState as InsightQuerySummaryState, - buildQuerySummary as buildInsightQuerySummary, - DateFacetState as InsightDateFacetState, - DateFilter as InsightDateFilter, - DateFilterState as InsightDateFilterState, - DateFacetOptions as InsightDateFacetOptions, - DateRangeOptions as InsightDateRangeOptions, - DateRangeRequest as InsightDateRangeRequest, - RelativeDate as InsightRelativeDate, - deserializeRelativeDate as deserializeInsightRelativeDate, - buildDateRange as buildInsightDateRange, - buildDateFacet as buildInsightDateFacet, - buildDateFilter as buildInsightDateFilter, - loadDateFacetSetActions as loadInsightDateFacetSetActions, - FacetSortCriterion as InsightFacetSortCriterion, - FacetValueRequest as InsightFacetValueRequest, - CategoryFacetValueRequest as InsightCategoryFacetValueRequest, - FacetConditionsManager as InsightFacetConditionsManager, - FacetConditionsManagerProps as InsightFacetConditionsManagerProps, - RangeFacetSortCriterion as InsightRangeFacetSortCriterion, - RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, - buildNumericFacet as buildInsightNumericFacet, - buildNumericFilter as buildInsightNumericFilter, - buildNumericRange as buildInsightNumericRange, - loadNumericFacetSetActions as loadInsightNumericFacetSetActions, - AnyFacetValuesCondition as InsightAnyFacetValuesCondition, - buildFacetConditionsManager as buildInsightFacetConditionsManager, - FacetManager as InsightFacetManager, - buildFacetManager as buildInsightFacetManager, - Tab as InsightTab, - TabState as InsightTabState, - buildTab as buildInsightTab, - BreadcrumbManagerState as InsightBreadcrumbManagerState, - BreadcrumbManager as InsightBreadcrumbManager, - buildBreadcrumbManager as buildInsightBreadcrumbManager, - Pager as InsightPager, - PagerState as InsightPagerState, - buildPager as buildInsightPager, - buildResultsPerPage as buildInsightResultsPerPage, - ResultsPerPageState as InsightResultsPerPageState, - ResultsPerPage as InsightResultsPerPage, - ResultTemplatesHelpers as InsightResultTemplatesHelpers, - buildInteractiveResult as buildInsightInteractiveResult, - InteractiveResult as InsightInteractiveResult, - loadQuerySetActions as loadInsightQuerySetActions, - PlatformEnvironment as PlatformEnvironmentInsight, - SmartSnippetState as InsightSmartSnippetState, - SmartSnippet as InsightSmartSnippet, - buildSmartSnippet as buildInsightSmartSnippet, - SmartSnippetFeedback as InsightSmartSnippetFeedback, - buildSmartSnippetQuestionsList as buildInsightSmartSnippetQuestionsList, - SmartSnippetQuestionsList as InsightSmartSnippetQuestionsList, - SmartSnippetQuestionsListState as InsightSmartSnippetQuestionsListState, - SmartSnippetRelatedQuestion as InsightSmartSnippetRelatedQuestion, - buildFoldedResultList as buildInsightFoldedResultList, - FoldedResultListOptions as InsightFoldedResultListOptions, - FoldedResult as InsightFoldedResult, - FoldedResultList as InsightFoldedResultList, - FoldedResultListState as InsightFoldedResultListState, - FoldedCollection as InsightFoldedCollection, - buildGeneratedAnswer as buildInsightGeneratedAnswer, - buildInteractiveCitation as buildInsightInteractiveCitation, - GeneratedAnswer as InsightGeneratedAnswer, - GeneratedAnswerState as InsightGeneratedAnswerState, - Suggestion as InsightSuggestion, - UserActionsState as InsightUserActionsState, - UserActionsProps as InsightUserActionsProps, - UserActions as InsightUserActions, - UserSession as InsightUserSession, - UserAction as InsightUserAction, - buildUserActions as buildInsightUserActions, - Quickview as InsightQuickview, - QuickviewState as InsightQuickviewState, -} from '@coveo/headless/insight'; +// Export the class of the components migrated to Lit here, like this: +//export {AtomicInsightFacet} from './atomic-insight-facet/atomic-insight-facet.js'; + +// TODO: Remove this line once at least one component is migrated to Lit. +export {}; diff --git a/packages/atomic/src/components/insight/lazy-index.ts b/packages/atomic/src/components/insight/lazy-index.ts new file mode 100644 index 00000000000..29bae6104f7 --- /dev/null +++ b/packages/atomic/src/components/insight/lazy-index.ts @@ -0,0 +1,6 @@ +export default { + // Add entries as such when new components are added/moved to Lit. + // 'atomic-insight-facet': async () => await import('./atomic-insight-facet/atomic-insight-facet.js'), +} as Record Promise>; + +export type * from './index.js'; diff --git a/packages/atomic/src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx b/packages/atomic/src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx index 1c4d90a7aef..0597d69a379 100644 --- a/packages/atomic/src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx +++ b/packages/atomic/src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx @@ -1,3 +1,13 @@ +import { + ResultsPerPageState as InsightResultsPerPageState, + ResultsPerPage as InsightResultsPerPage, + buildFoldedResultList as buildInsightFoldedResultList, + FoldedResultList as InsightFoldedResultList, + FoldedResultListState as InsightFoldedResultListState, + buildResultsPerPage as buildInsightResultsPerPage, + FoldedCollection as InsightFoldedCollection, + buildInteractiveResult as buildInsightInteractiveResult, +} from '@coveo/headless/insight'; import { Component, Element, @@ -7,16 +17,6 @@ import { Method, h, } from '@stencil/core'; -import { - InsightResultsPerPageState, - InsightResultsPerPage, - buildInsightFoldedResultList, - InsightFoldedResultList, - InsightFoldedResultListState, - buildInsightResultsPerPage, - InsightFoldedCollection, - buildInsightInteractiveResult, -} from '../..'; import {FocusTargetController} from '../../../../utils/accessibility-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/insight/result-lists/atomic-insight-result-list/atomic-insight-result-list.tsx b/packages/atomic/src/components/insight/result-lists/atomic-insight-result-list/atomic-insight-result-list.tsx index 342455b789c..09822982938 100644 --- a/packages/atomic/src/components/insight/result-lists/atomic-insight-result-list/atomic-insight-result-list.tsx +++ b/packages/atomic/src/components/insight/result-lists/atomic-insight-result-list/atomic-insight-result-list.tsx @@ -1,14 +1,14 @@ -import {Component, h, Element, State, Prop, Method} from '@stencil/core'; import { - InsightResultList, - InsightResultListState, - buildInsightResultList, - InsightResult, - buildInsightInteractiveResult, - buildInsightResultsPerPage, - InsightResultsPerPage, - InsightResultsPerPageState, -} from '../..'; + ResultList as InsightResultList, + ResultListState as InsightResultListState, + buildResultList as buildInsightResultList, + Result as InsightResult, + buildInteractiveResult as buildInsightInteractiveResult, + buildResultsPerPage as buildInsightResultsPerPage, + ResultsPerPage as InsightResultsPerPage, + ResultsPerPageState as InsightResultsPerPageState, +} from '@coveo/headless/insight'; +import {Component, h, Element, State, Prop, Method} from '@stencil/core'; import {FocusTargetController} from '../../../../utils/accessibility-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx b/packages/atomic/src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx index 607ddc67059..9ede0a2fa50 100644 --- a/packages/atomic/src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx +++ b/packages/atomic/src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx @@ -1,10 +1,10 @@ -import {Component, Element, State, h, Listen, Prop} from '@stencil/core'; import { - buildInsightInteractiveResult, - InsightFoldedResultListState, - InsightFoldedResult, - InsightFoldedResultList, -} from '../..'; + buildInteractiveResult as buildInsightInteractiveResult, + FoldedResultListState as InsightFoldedResultListState, + FoldedResult as InsightFoldedResult, + FoldedResultList as InsightFoldedResultList, +} from '@coveo/headless/insight'; +import {Component, Element, State, h, Listen, Prop} from '@stencil/core'; import {buildCustomEvent} from '../../../../utils/event-utils'; import { InitializableComponent, diff --git a/packages/atomic/src/components/insight/result-templates/atomic-insight-result-template/atomic-insight-result-template.tsx b/packages/atomic/src/components/insight/result-templates/atomic-insight-result-template/atomic-insight-result-template.tsx index f416d666417..bb89d1a8e80 100644 --- a/packages/atomic/src/components/insight/result-templates/atomic-insight-result-template/atomic-insight-result-template.tsx +++ b/packages/atomic/src/components/insight/result-templates/atomic-insight-result-template/atomic-insight-result-template.tsx @@ -1,5 +1,8 @@ +import { + ResultTemplate as InsightResultTemplate, + ResultTemplateCondition as InsightResultTemplateCondition, +} from '@coveo/headless/insight'; import {Component, Element, Prop, Method, State} from '@stencil/core'; -import {InsightResultTemplate, InsightResultTemplateCondition} from '../..'; import {MapProp} from '../../../../utils/props-utils'; import { makeDefinedConditions, diff --git a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-feedback-modal/atomic-insight-smart-snippet-feedback-modal.tsx b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-feedback-modal/atomic-insight-smart-snippet-feedback-modal.tsx index 24a35bc7b62..c82102e9c01 100644 --- a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-feedback-modal/atomic-insight-smart-snippet-feedback-modal.tsx +++ b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-feedback-modal/atomic-insight-smart-snippet-feedback-modal.tsx @@ -1,3 +1,8 @@ +import { + buildSmartSnippet as buildInsightSmartSnippet, + SmartSnippet as InsightSmartSnippet, + SmartSnippetFeedback as InsightSmartSnippetFeedback, +} from '@coveo/headless/insight'; import { Component, State, @@ -7,11 +12,6 @@ import { Event, EventEmitter, } from '@stencil/core'; -import { - buildInsightSmartSnippet, - InsightSmartSnippet, - InsightSmartSnippetFeedback, -} from '../..'; import { InitializableComponent, InitializeBindings, diff --git a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tsx b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tsx index 79f408132f4..c8fec67e6f3 100644 --- a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tsx +++ b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tsx @@ -1,10 +1,10 @@ -import {Component, Prop, State, Element} from '@stencil/core'; import { - buildInsightSmartSnippetQuestionsList, - InsightSmartSnippetQuestionsList, - InsightSmartSnippetQuestionsListState, - InsightSmartSnippetRelatedQuestion, -} from '../..'; + buildSmartSnippetQuestionsList as buildInsightSmartSnippetQuestionsList, + SmartSnippetQuestionsList as InsightSmartSnippetQuestionsList, + SmartSnippetQuestionsListState as InsightSmartSnippetQuestionsListState, + SmartSnippetRelatedQuestion as InsightSmartSnippetRelatedQuestion, +} from '@coveo/headless/insight'; +import {Component, Prop, State, Element} from '@stencil/core'; import { InitializableComponent, InitializeBindings, diff --git a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet/atomic-insight-smart-snippet.tsx b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet/atomic-insight-smart-snippet.tsx index 46ac1ac7008..54d2520bdad 100644 --- a/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet/atomic-insight-smart-snippet.tsx +++ b/packages/atomic/src/components/insight/smart-snippets/atomic-insight-smart-snippet/atomic-insight-smart-snippet.tsx @@ -1,9 +1,9 @@ -import {Component, Prop, State, Element} from '@stencil/core'; import { - buildInsightSmartSnippet, - InsightSmartSnippet, - InsightSmartSnippetState, -} from '../..'; + buildSmartSnippet as buildInsightSmartSnippet, + SmartSnippet as InsightSmartSnippet, + SmartSnippetState as InsightSmartSnippetState, +} from '@coveo/headless/insight'; +import {Component, Prop, State, Element} from '@stencil/core'; import { InitializableComponent, InitializeBindings, diff --git a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/atomic-insight-user-actions-session.tsx b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/atomic-insight-user-actions-session.tsx index e25c26df612..79663e3fdc2 100644 --- a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/atomic-insight-user-actions-session.tsx +++ b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/atomic-insight-user-actions-session.tsx @@ -1,5 +1,5 @@ +import {UserAction as IUserAction} from '@coveo/headless/insight'; import {Component, h, Prop, Watch, State} from '@stencil/core'; -import {InsightUserAction as IUserAction} from '../..'; import Flag from '../../../../images/flag.svg'; import ThreeDotsIcon from '../../../../images/three-dots.svg'; import {parseTimestampToDateDetails} from '../../../../utils/date-utils'; diff --git a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/user-action.tsx b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/user-action.tsx index 9e090f39e8a..e074b681e42 100644 --- a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/user-action.tsx +++ b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-session/user-action.tsx @@ -1,5 +1,5 @@ +import {UserAction as IUserAction} from '@coveo/headless/insight'; import {FunctionalComponent, h} from '@stencil/core'; -import {InsightUserAction as IUserAction} from '../..'; import BookmarkIcon from '../../../../images/bookmark.svg'; import DocumentIcon from '../../../../images/document.svg'; import PointIcon from '../../../../images/point.svg'; diff --git a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-timeline/atomic-insight-user-actions-timeline.tsx b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-timeline/atomic-insight-user-actions-timeline.tsx index 1136461670a..4019c701b46 100644 --- a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-timeline/atomic-insight-user-actions-timeline.tsx +++ b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-timeline/atomic-insight-user-actions-timeline.tsx @@ -1,10 +1,10 @@ -import {Component, h, State, Prop} from '@stencil/core'; import { - buildInsightUserActions, - InsightUserActions, - InsightUserActionsState, - InsightUserSession, -} from '../..'; + buildUserActions as buildInsightUserActions, + UserActions as InsightUserActions, + UserActionsState as InsightUserActionsState, + UserSession as InsightUserSession, +} from '@coveo/headless/insight'; +import {Component, h, State, Prop} from '@stencil/core'; import ArrowDownIcon from '../../../../images/big-arrow-down.svg'; import ArrowUpIcon from '../../../../images/big-arrow-up.svg'; import { diff --git a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.tsx b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.tsx index 178b2402d91..054dfdc942e 100644 --- a/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.tsx +++ b/packages/atomic/src/components/insight/user-actions/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.tsx @@ -1,9 +1,9 @@ -import {Component, h, Prop, Element, State} from '@stencil/core'; import { - buildInsightUserActions, - InsightUserActions, - InsightUserActionsState, -} from '../..'; + buildUserActions as buildInsightUserActions, + UserActions as InsightUserActions, + UserActionsState as InsightUserActionsState, +} from '@coveo/headless/insight'; +import {Component, h, Prop, Element, State} from '@stencil/core'; import Clockicon from '../../../../images/clock.svg'; import { BindStateToController, diff --git a/packages/atomic/src/components/ipx/atomic-ipx-recs-list/atomic-recs-list/atomic-ipx-recs-list.tsx b/packages/atomic/src/components/ipx/atomic-ipx-recs-list/atomic-recs-list/atomic-ipx-recs-list.tsx index d0cc7661fcb..b7761594861 100644 --- a/packages/atomic/src/components/ipx/atomic-ipx-recs-list/atomic-recs-list/atomic-ipx-recs-list.tsx +++ b/packages/atomic/src/components/ipx/atomic-ipx-recs-list/atomic-recs-list/atomic-ipx-recs-list.tsx @@ -8,6 +8,8 @@ import { RecommendationList, RecommendationListState, loadConfigurationActions, + Result as RecsResult, + buildInteractiveResult as buildRecsInteractiveResult, } from '@coveo/headless/recommendation'; import { Component, @@ -42,7 +44,6 @@ import {ItemDisplayGuard} from '../../../common/item-list/item-display-guard'; import {ItemListCommon} from '../../../common/item-list/item-list-common'; import {ItemTemplateProvider} from '../../../common/item-list/item-template-provider'; import {getItemListDisplayClasses} from '../../../common/layout/display-options'; -import {RecsResult, buildRecsInteractiveResult} from '../../../recommendations'; import {RecsBindings} from '../../../recommendations/atomic-recs-interface/atomic-recs-interface'; /** diff --git a/packages/atomic/src/components/ipx/index.ts b/packages/atomic/src/components/ipx/index.ts new file mode 100644 index 00000000000..946dd1f6785 --- /dev/null +++ b/packages/atomic/src/components/ipx/index.ts @@ -0,0 +1,5 @@ +// Export the class of the components migrated to Lit here, like this: +//export {AtomicIPXBody} from './atomic-ipx-body/atomic-ipx-body.js'; + +// TODO: Remove this line once at least one component is migrated to Lit. +export {}; diff --git a/packages/atomic/src/components/ipx/lazy-index.ts b/packages/atomic/src/components/ipx/lazy-index.ts new file mode 100644 index 00000000000..22c513b94be --- /dev/null +++ b/packages/atomic/src/components/ipx/lazy-index.ts @@ -0,0 +1,6 @@ +export default { + // Add entries as such when new components are added/moved to Lit. + // 'atomic-ipx-body': async () => await import('./atomic-ipx-body/atomic-ipx-body.js'), +} as Record Promise>; + +export type * from './index.js'; diff --git a/packages/atomic/src/components/lazy-index.ts b/packages/atomic/src/components/lazy-index.ts index 04883185c08..1c263eaba44 100644 --- a/packages/atomic/src/components/lazy-index.ts +++ b/packages/atomic/src/components/lazy-index.ts @@ -1,5 +1,15 @@ +import CommerceComponentMap from './commerce/lazy-index.js'; +import InsightComponentMap from './insight/lazy-index.js'; +import IpxComponentMap from './ipx/lazy-index.js'; +import RecommendationsComponentMap from './recommendations/lazy-index.js'; import SearchComponentMap from './search/lazy-index.js'; -export default {...SearchComponentMap}; +export default { + ...RecommendationsComponentMap, + ...IpxComponentMap, + ...InsightComponentMap, + ...CommerceComponentMap, + ...SearchComponentMap, +}; export type * from './index.js'; diff --git a/packages/atomic/src/components/recommendations/atomic-recs-interface/atomic-recs-interface.tsx b/packages/atomic/src/components/recommendations/atomic-recs-interface/atomic-recs-interface.tsx index 91b8da68a12..168525bc96b 100644 --- a/packages/atomic/src/components/recommendations/atomic-recs-interface/atomic-recs-interface.tsx +++ b/packages/atomic/src/components/recommendations/atomic-recs-interface/atomic-recs-interface.tsx @@ -6,6 +6,7 @@ import { buildRecommendationEngine, loadRecommendationActions, loadSearchConfigurationActions, + LogLevel as RecsLogLevel, } from '@coveo/headless/recommendation'; import { Component, @@ -19,7 +20,6 @@ import { setNonce, } from '@stencil/core'; import i18next, {i18n} from 'i18next'; -import {RecsLogLevel} from '..'; import {InitializeEvent} from '../../../utils/initialization-utils'; import {ArrayProp} from '../../../utils/props-utils'; import {CommonBindings} from '../../common/interface/bindings'; diff --git a/packages/atomic/src/components/recommendations/atomic-recs-list/atomic-recs-list.tsx b/packages/atomic/src/components/recommendations/atomic-recs-list/atomic-recs-list.tsx index 5c66e126e73..e2f93044e22 100644 --- a/packages/atomic/src/components/recommendations/atomic-recs-list/atomic-recs-list.tsx +++ b/packages/atomic/src/components/recommendations/atomic-recs-list/atomic-recs-list.tsx @@ -4,6 +4,8 @@ import { RecommendationList, RecommendationListState, loadConfigurationActions, + buildInteractiveResult as buildRecsInteractiveResult, + Result as RecsResult, } from '@coveo/headless/recommendation'; import { Component, @@ -15,7 +17,6 @@ import { Fragment, Watch, } from '@stencil/core'; -import {buildRecsInteractiveResult, RecsResult} from '..'; import {FocusTargetController} from '../../../utils/accessibility-utils'; import { BindStateToController, diff --git a/packages/atomic/src/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.tsx b/packages/atomic/src/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.tsx index 41b56daff5b..2b35ec1676b 100644 --- a/packages/atomic/src/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.tsx +++ b/packages/atomic/src/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.tsx @@ -1,5 +1,8 @@ +import { + ResultTemplateCondition as RecsResultTemplateCondition, + ResultTemplate as RecsResultTemplate, +} from '@coveo/headless/recommendation'; import {Component, Element, Prop, Method, State} from '@stencil/core'; -import {RecsResultTemplateCondition, RecsResultTemplate} from '..'; import {MapProp} from '../../../utils/props-utils'; import { makeDefinedConditions, diff --git a/packages/atomic/src/components/recommendations/atomic-recs-result/atomic-recs-result.tsx b/packages/atomic/src/components/recommendations/atomic-recs-result/atomic-recs-result.tsx index 249dc1732a1..333d0475403 100644 --- a/packages/atomic/src/components/recommendations/atomic-recs-result/atomic-recs-result.tsx +++ b/packages/atomic/src/components/recommendations/atomic-recs-result/atomic-recs-result.tsx @@ -1,5 +1,8 @@ +import { + InteractiveResult as RecsInteractiveResult, + Result as RecsResult, +} from '@coveo/headless/recommendation'; import {Component, h, Prop, Element, Listen, Host} from '@stencil/core'; -import {RecsInteractiveResult, RecsResult} from '..'; import {parentNodeToString} from '../../../utils/dom-utils'; import {applyFocusVisiblePolyfill} from '../../../utils/initialization-utils'; import { diff --git a/packages/atomic/src/components/recommendations/index.ts b/packages/atomic/src/components/recommendations/index.ts index 40d8ef37375..c26d3484a88 100644 --- a/packages/atomic/src/components/recommendations/index.ts +++ b/packages/atomic/src/components/recommendations/index.ts @@ -1,10 +1,5 @@ -export { - RecommendationEngineConfiguration, - Result as RecsResult, - InteractiveResult as RecsInteractiveResult, - buildInteractiveResult as buildRecsInteractiveResult, - ResultTemplateCondition as RecsResultTemplateCondition, - ResultTemplate as RecsResultTemplate, - ResultTemplatesHelpers as RecsResultTemplatesHelpers, - LogLevel as RecsLogLevel, -} from '@coveo/headless/recommendation'; +// Export the class of the components migrated to Lit here, like this: +//export {AtomicRecsError} from './atomic-recs-error/atomic-recs-error.js'; + +// TODO: Remove this line once at least one component is migrated to Lit. +export {}; diff --git a/packages/atomic/src/components/recommendations/lazy-index.ts b/packages/atomic/src/components/recommendations/lazy-index.ts new file mode 100644 index 00000000000..a605114aeff --- /dev/null +++ b/packages/atomic/src/components/recommendations/lazy-index.ts @@ -0,0 +1,6 @@ +export default { + // Add entries as such when new components are added/moved to Lit. + // 'atomic-recs-error': async () => await import('./atomic-recs-error/atomic-recs-error.js'), +} as Record Promise>; + +export type * from './index.js'; diff --git a/packages/atomic/stencil-proxy/cjs/loader.cjs.js b/packages/atomic/stencil-proxy/cjs/loader.cjs.js index 52a475e8647..7dfb1c3cb20 100644 --- a/packages/atomic/stencil-proxy/cjs/loader.cjs.js +++ b/packages/atomic/stencil-proxy/cjs/loader.cjs.js @@ -2,10 +2,30 @@ const exportModule = require('./_loader.cjs.js'); const searchComponents = import( '../atomic/components/components/search/lazy-index.js' ); +const commerceComponents = import( + '../atomic/components/components/commerce/lazy-index.js' +); +const insightComponents = import( + '../atomic/components/components/insight/lazy-index.js' +); +const ipxComponents = import( + '../atomic/components/components/ipx/lazy-index.js' +); +const recommendationsComponents = import( + '../atomic/components/components/recommendations/lazy-index.js' +); + +const allComponents = Promise.all([ + searchComponents, + commerceComponents, + insightComponents, + ipxComponents, + recommendationsComponents, +]); const originalDefineCustomElements = exportModule.defineCustomElements; exportModule.defineCustomElements = function (...args) { - searchComponents.then((module) => + allComponents.then((module) => Object.values(module).forEach((importFunction) => importFunction()) ); originalDefineCustomElements(...args); diff --git a/packages/atomic/stencil-proxy/esm/index.js b/packages/atomic/stencil-proxy/esm/index.js index 44a5dc8abbb..9f7b5b5eb84 100644 --- a/packages/atomic/stencil-proxy/esm/index.js +++ b/packages/atomic/stencil-proxy/esm/index.js @@ -2,3 +2,7 @@ import '../atomic/autoloader/index.esm.js'; export * from './_index.js'; export * as SearchComponentMap from '../atomic/components/components/search/lazy-index.js'; +export * as CommerceComponentMap from '../atomic/components/components/commerce/lazy-index.js'; +export * as InsightComponentMap from '../atomic/components/components/insight/lazy-index.js'; +export * as IpxComponentMap from '../atomic/components/components/ipx/lazy-index.js'; +export * as RecommendationsComponentMap from '../atomic/components/components/recommendations/lazy-index.js'; diff --git a/packages/atomic/stencil-proxy/esm/loader.js b/packages/atomic/stencil-proxy/esm/loader.js index 5bdd475b776..da75bec021d 100644 --- a/packages/atomic/stencil-proxy/esm/loader.js +++ b/packages/atomic/stencil-proxy/esm/loader.js @@ -1,8 +1,18 @@ +import commerceComponents from '../atomic/components/components/commerce/lazy-index.js'; +import insightComponents from '../atomic/components/components/insight/lazy-index.js'; +import ipxComponents from '../atomic/components/components/ipx/lazy-index.js'; +import recommendationsComponents from '../atomic/components/components/recommendations/lazy-index.js'; import searchComponents from '../atomic/components/components/search/lazy-index.js'; import {defineCustomElements as originalDefineCustomElements} from './_loader.js'; const defineCustomElements = function (...args) { - Object.values(searchComponents).forEach((importFunction) => importFunction()); + Object.values({ + ...recommendationsComponents, + ...ipxComponents, + ...insightComponents, + ...commerceComponents, + ...searchComponents, + }).forEach((importFunction) => importFunction()); originalDefineCustomElements(...args); };