Skip to content

Commit

Permalink
fix patch and bad imports
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Jul 10, 2024
1 parent faca001 commit 78a8caa
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 74 deletions.
16 changes: 8 additions & 8 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, GeneratedAnswerStyle, InlineLink, InteractiveCitation, InteractiveResult, LogLevel as LogLevel1, PlatformEnvironment as PlatformEnvironment2, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
import { CategoryFacet, CommerceEngine, DateFacet, InteractiveProduct, LogLevel, NumericFacet, PlatformEnvironment, Product, ProductListing, ProductListingSummaryState, ProductTemplate, ProductTemplateCondition, RegularFacet, Search, SearchSummaryState, Summary } from "@coveo/headless/commerce";
import { Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
import { CommerceBindings as Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
import { Range } from "./components/commerce/facets/facet-number-input/atomic-commerce-facet-number-input";
import { i18n } from "i18next";
import { CommerceInitializationOptions } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
Expand All @@ -16,11 +16,11 @@ import { ItemDisplayBasicLayout, ItemDisplayDensity, ItemDisplayImageSize, ItemD
import { ItemRenderingFunction } from "./components/common/item-list/item-list-common";
import { RedirectionPayload } from "./components/search/atomic-search-box/redirection-payload";
import { AriaLabelGenerator } from "./components/commerce/search-box-suggestions/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products";
import { AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
import { unknown as AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
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, InsightFacetSortCriterion, InsightFoldedResult, InsightGeneratedAnswerStyle, InsightInteractiveResult, InsightLogLevel, InsightRangeFacetRangeAlgorithm, InsightRangeFacetSortCriterion, InsightResult, InsightResultTemplate, InsightResultTemplateCondition, PlatformEnvironmentInsight } from "./components/insight";
import { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, GeneratedAnswerStyle as InsightGeneratedAnswerStyle, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, PlatformEnvironment as PlatformEnvironmentInsight } from "./components/insight";
import { i18nCompatibilityVersion } from "./components/common/interface/i18n";
import { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface";
import { AtomicInsightStore } from "./components/insight/atomic-insight-interface/store";
Expand All @@ -29,15 +29,15 @@ import { Section } from "./components/common/atomic-layout-section/sections";
import { AtomicCommonStore, AtomicCommonStoreData } from "./components/common/interface/store";
import { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children";
import { PlatformEnvironment as PlatformEnvironment1, RecommendationEngine } from "@coveo/headless/recommendation";
import { RecsInteractiveResult, RecsLogLevel, RecsResult, RecsResultTemplate, RecsResultTemplateCondition } from "./components/recommendations";
import { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations";
import { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
import { AtomicRecsStore } from "./components/recommendations/atomic-recs-interface/store";
import { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface";
import { AriaLabelGenerator as AriaLabelGenerator1 } from "./components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results";
import { InitializationOptions } from "./components/search/atomic-search-interface/atomic-search-interface";
export { AutomaticFacet, CategoryFacetSortCriterion, DateFilterRange, DateRangeRequest, FacetResultsMustMatch, FacetSortCriterion, FoldedResult, GeneratedAnswer, GeneratedAnswerCitation, GeneratedAnswerStyle, InlineLink, InteractiveCitation, InteractiveResult, LogLevel as LogLevel1, PlatformEnvironment as PlatformEnvironment2, RangeFacetRangeAlgorithm, RangeFacetSortCriterion, Result, ResultTemplate, ResultTemplateCondition, SearchEngine, SearchStatus } from "@coveo/headless";
export { CategoryFacet, CommerceEngine, DateFacet, InteractiveProduct, LogLevel, NumericFacet, PlatformEnvironment, Product, ProductListing, ProductListingSummaryState, ProductTemplate, ProductTemplateCondition, RegularFacet, Search, SearchSummaryState, Summary } from "@coveo/headless/commerce";
export { Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
export { CommerceBindings as Bindings } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
export { Range } from "./components/commerce/facets/facet-number-input/atomic-commerce-facet-number-input";
export { i18n } from "i18next";
export { CommerceInitializationOptions } from "./components/commerce/atomic-commerce-interface/atomic-commerce-interface";
Expand All @@ -46,11 +46,11 @@ export { ItemDisplayBasicLayout, ItemDisplayDensity, ItemDisplayImageSize, ItemD
export { ItemRenderingFunction } from "./components/common/item-list/item-list-common";
export { RedirectionPayload } from "./components/search/atomic-search-box/redirection-payload";
export { AriaLabelGenerator } from "./components/commerce/search-box-suggestions/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products";
export { AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
export { unknown as AnyBindings, i18nCompatibilityVersion as i18nCompatibilityVersion1, ItemDisplayBasicLayout as ItemDisplayBasicLayout1, ItemDisplayDensity as ItemDisplayDensity1, ItemDisplayImageSize as ItemDisplayImageSize1, ItemRenderingFunction as ItemRenderingFunction1, ItemTarget as ItemTarget1 } from "./components";
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, InsightFacetSortCriterion, InsightFoldedResult, InsightGeneratedAnswerStyle, InsightInteractiveResult, InsightLogLevel, InsightRangeFacetRangeAlgorithm, InsightRangeFacetSortCriterion, InsightResult, InsightResultTemplate, InsightResultTemplateCondition, PlatformEnvironmentInsight } from "./components/insight";
export { InsightEngine, FacetSortCriterion as InsightFacetSortCriterion, FoldedResult as InsightFoldedResult, GeneratedAnswerStyle as InsightGeneratedAnswerStyle, InteractiveResult as InsightInteractiveResult, LogLevel as InsightLogLevel, RangeFacetRangeAlgorithm as InsightRangeFacetRangeAlgorithm, RangeFacetSortCriterion as InsightRangeFacetSortCriterion, Result as InsightResult, ResultTemplate as InsightResultTemplate, ResultTemplateCondition as InsightResultTemplateCondition, PlatformEnvironment as PlatformEnvironmentInsight } from "./components/insight";
export { i18nCompatibilityVersion } from "./components/common/interface/i18n";
export { InsightInitializationOptions } from "./components/insight/atomic-insight-interface/atomic-insight-interface";
export { AtomicInsightStore } from "./components/insight/atomic-insight-interface/store";
Expand All @@ -59,7 +59,7 @@ export { Section } from "./components/common/atomic-layout-section/sections";
export { AtomicCommonStore, AtomicCommonStoreData } from "./components/common/interface/store";
export { SelectChildProductEventArgs } from "./components/commerce/product-template-components/atomic-product-children/atomic-product-children";
export { PlatformEnvironment as PlatformEnvironment1, RecommendationEngine } from "@coveo/headless/recommendation";
export { RecsInteractiveResult, RecsLogLevel, RecsResult, RecsResultTemplate, RecsResultTemplateCondition } from "./components/recommendations";
export { InteractiveResult as RecsInteractiveResult, LogLevel as RecsLogLevel, Result as RecsResult, ResultTemplate as RecsResultTemplate, ResultTemplateCondition as RecsResultTemplateCondition } from "./components/recommendations";
export { RecsInitializationOptions } from "./components/recommendations/atomic-recs-interface/atomic-recs-interface";
export { AtomicRecsStore } from "./components/recommendations/atomic-recs-interface/store";
export { Bindings as Bindings1 } from "./components/search/atomic-search-interface/atomic-search-interface";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {Product, ProductTemplatesHelpers} from '@coveo/headless/commerce';
import {Component, h, Prop, Element, State, Method} from '@stencil/core';
import {Bindings} from '../../../../components';
import {
InitializeBindings,
InitializableComponent,
InitializeBindings,
} from '../../../../utils/initialization-utils';
import {filterProtocol} from '../../../../utils/xss-utils';
import {ImageCarousel} from '../../../common/image-carousel/image-carousel';
import {CommerceBindings as Bindings} from '../../atomic-commerce-interface/atomic-commerce-interface';
import {ProductContext} from '../product-template-decorators';

type Image = {
Expand All @@ -23,7 +23,7 @@ type Image = {
styleUrl: 'atomic-product-image.pcss',
shadow: true,
})
export class AtomicProductImage implements InitializableComponent {
export class AtomicProductImage implements InitializableComponent<Bindings> {
@InitializeBindings() public bindings!: Bindings;
@ProductContext() private product!: Product;
@Element() private host!: HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
loadIPXActionsHistoryActions,
} from '@coveo/headless';
import {Component, h, Prop, Element} from '@stencil/core';
import {Bindings} from '../../../components';
import {buildCustomEvent} from '../../../utils/event-utils';
import {
InitializableComponent,
Expand All @@ -16,6 +15,7 @@ import {getDefaultSlotFromHost} from '../../../utils/slot-utils';
import {AnyUnfoldedItem} from '../../common/interface/item';
import {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';
import {LinkWithItemAnalytics} from '../../common/item-link/item-link';
import {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';
import {
ResultContext,
InteractiveResultContext,
Expand All @@ -32,8 +32,10 @@ import {
styleUrl: 'atomic-ipx-result-link.pcss',
shadow: false,
})
export class AtomicIPXResultLink implements InitializableComponent {
@InitializeBindings() public bindings!: Bindings;
export class AtomicIPXResultLink
implements InitializableComponent<RecsBindings>
{
@InitializeBindings() public bindings!: RecsBindings;
public error!: Error;

@ResultContext() private result!: AnyUnfoldedItem;
Expand Down
3 changes: 2 additions & 1 deletion packages/atomic/src/utils/result-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Result,
ResultTemplatesHelpers,
} from '@coveo/headless';
import {RecsBindings} from '../components/recommendations/atomic-recs-interface/atomic-recs-interface';
import {Bindings} from '../components/search/atomic-search-interface/atomic-search-interface';

/**
Expand Down Expand Up @@ -52,7 +53,7 @@ export function bindLogDocumentOpenOnResult(
export function buildStringTemplateFromResult(
template: string,
result: Result,
bindings: Bindings
bindings: Bindings | RecsBindings
) {
return template.replace(/\${(.*?)}/g, (value: string) => {
const key = value.substring(2, value.length - 1);
Expand Down
59 changes: 0 additions & 59 deletions patches/@stencil+core+4.15.0.patch

This file was deleted.

52 changes: 52 additions & 0 deletions patches/@stencil+core+4.19.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/node_modules/@stencil/core/compiler/stencil.js b/node_modules/@stencil/core/compiler/stencil.js
index 9fb2fba..92f2ee7 100644
--- a/node_modules/@stencil/core/compiler/stencil.js
+++ b/node_modules/@stencil/core/compiler/stencil.js
@@ -257144,7 +257144,7 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program, classNod
importAliasMap.get("AttachInternals")
);
}
- const updatedClassFields = handleClassFields(classNode, filteredMethodsAndFields, typeChecker, importAliasMap);
+ const updatedClassFields = handleClassFields(classNode, filteredMethodsAndFields, typeChecker, importAliasMap, filteredMethodsAndFields);
validateMethods(diagnostics, classMembers);
const currentDecorators = retrieveTsDecorators(classNode);
return typescript_5_4_5_bundle_cache_min_default.factory.updateClassDeclaration(
@@ -257184,9 +257184,6 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
member2.body
);
} else if (typescript_5_4_5_bundle_cache_min_default.isPropertyDeclaration(member2)) {
- if (shouldInitializeInConstructor(member2, importAliasMap)) {
- return member2;
- } else {
const modifiers = retrieveTsModifiers(member2);
return typescript_5_4_5_bundle_cache_min_default.factory.updatePropertyDeclaration(
member2,
@@ -257196,7 +257193,6 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
member2.type,
member2.initializer
);
- }
} else {
const err2 = buildError(diagnostics);
err2.messageText = "Unknown class member encountered!";
@@ -257220,10 +257216,9 @@ var filterDecorators = (decorators, excludeList) => {
}
return decorators;
};
-function handleClassFields(classNode, classMembers, typeChecker, importAliasMap) {
+function handleClassFields(classNode, classMembers, typeChecker, importAliasMap, updatedClassMembers) {
var _a;
const statements = [];
- const updatedClassMembers = [];
for (const member2 of classMembers) {
if (shouldInitializeInConstructor(member2, importAliasMap) && typescript_5_4_5_bundle_cache_min_default.isPropertyDeclaration(member2)) {
const memberName = tsPropDeclNameAsString(member2, typeChecker);
@@ -257238,8 +257233,6 @@ function handleClassFields(classNode, classMembers, typeChecker, importAliasMap)
)
)
);
- } else {
- updatedClassMembers.push(member2);
}
}
if (statements.length === 0) {

0 comments on commit 78a8caa

Please sign in to comment.