Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fpbrault committed Feb 28, 2025
1 parent 9c4d650 commit fab9acc
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {APP_INITIALIZER, ModuleWithProviders, NgModule, Provider} from '@angular


import {
AtomicIcon,
AtomicCommerceInterface,
AtomicComponentError,
AtomicAriaLive,
AtomicAutomaticFacet,
AtomicAutomaticFacetGenerator,
Expand Down Expand Up @@ -38,7 +40,6 @@ AtomicCommerceSearchBoxRecentQueries,
AtomicCommerceSortDropdown,
AtomicCommerceText,
AtomicCommerceTimeframeFacet,
AtomicComponentError,
AtomicDidYouMean,
AtomicExternal,
AtomicFacet,
Expand All @@ -50,7 +51,6 @@ AtomicFormatNumber,
AtomicFormatUnit,
AtomicGeneratedAnswer,
AtomicHtml,
AtomicIcon,
AtomicLayoutSection,
AtomicLoadMoreResults,
AtomicNoResults,
Expand Down Expand Up @@ -151,7 +151,9 @@ defineCustomElements(window);


const DECLARATIONS = [
AtomicIcon,
AtomicCommerceInterface,
AtomicComponentError,
AtomicAriaLive,
AtomicAutomaticFacet,
AtomicAutomaticFacetGenerator,
Expand Down Expand Up @@ -184,7 +186,6 @@ AtomicCommerceSearchBoxRecentQueries,
AtomicCommerceSortDropdown,
AtomicCommerceText,
AtomicCommerceTimeframeFacet,
AtomicComponentError,
AtomicDidYouMean,
AtomicExternal,
AtomicFacet,
Expand All @@ -196,7 +197,6 @@ AtomicFormatNumber,
AtomicFormatUnit,
AtomicGeneratedAnswer,
AtomicHtml,
AtomicIcon,
AtomicLayoutSection,
AtomicLoadMoreResults,
AtomicNoResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,28 +739,6 @@ export class AtomicCommerceTimeframeFacet {
export declare interface AtomicCommerceTimeframeFacet extends Components.AtomicCommerceTimeframeFacet {}


@ProxyCmp({
inputs: ['element', 'error']
})
@Component({
selector: 'atomic-component-error',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['element', 'error'],
})
export class AtomicComponentError {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
}
}


export declare interface AtomicComponentError extends Components.AtomicComponentError {}


@ProxyCmp({
inputs: ['automaticallyCorrectQuery', 'queryCorrectionMode']
})
Expand Down Expand Up @@ -1004,28 +982,6 @@ export class AtomicHtml {
export declare interface AtomicHtml extends Components.AtomicHtml {}


@ProxyCmp({
inputs: ['icon']
})
@Component({
selector: 'atomic-icon',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['icon'],
})
export class AtomicIcon {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
}
}


export declare interface AtomicIcon extends Components.AtomicIcon {}


@ProxyCmp({
inputs: ['maxWidth', 'minWidth', 'section']
})
Expand Down Expand Up @@ -3084,6 +3040,29 @@ export declare interface AtomicTimeframeFacet extends Components.AtomicTimeframe

//#region Lit Declarations

@ProxyCmp({
inputs: ['icon']
})
@Component({
selector: 'atomic-icon',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['icon']
})
export class AtomicIcon {
protected readonly el: HTMLElement;
constructor(c: ChangeDetectorRef, el: ElementRef, protected z: NgZone) {
c.detach();
this.el = el.nativeElement;
proxyOutputs(this, this.el, []);
}
}

export declare interface AtomicIcon extends LitAtomicIcon {

}

@ProxyCmp({
inputs: ['name', 'type', 'analytics', 'logLevel', 'i18n', 'language', 'engine', 'reflectStateInUrl', 'scrollContainer', 'languageAssetsPath', 'iconAssetsPath', 'CspNonce']
})
Expand All @@ -3107,5 +3086,28 @@ export declare interface AtomicCommerceInterface extends LitAtomicCommerceInterf

}

import type {AtomicCommerceInterface as LitAtomicCommerceInterface} from '@coveo/atomic/components';
@ProxyCmp({
inputs: ['element', 'error']
})
@Component({
selector: 'atomic-component-error',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['element', 'error']
})
export class AtomicComponentError {
protected readonly el: HTMLElement;
constructor(c: ChangeDetectorRef, el: ElementRef, protected z: NgZone) {
c.detach();
this.el = el.nativeElement;
proxyOutputs(this, this.el, []);
}
}

export declare interface AtomicComponentError extends LitAtomicComponentError {

}

import type {AtomicIcon as LitAtomicIcon, AtomicCommerceInterface as LitAtomicCommerceInterface, AtomicComponentError as LitAtomicComponentError} from '@coveo/atomic/components';
//#endregion Lit Declarations
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
/* tslint:disable */
/* auto-generated react proxies */
import { createReactComponent } from './react-component-lib/index.js';
import { createReactComponent } from './react-component-lib';

import type { JSX } from '@coveo/atomic';

import { defineCustomElements } from '@coveo/atomic/loader';
import { defineCustomElements } from '@coveo/atomic/dist/atomic/loader';

defineCustomElements();
export const AtomicCommerceBreadbox = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceBreadbox, HTMLAtomicCommerceBreadboxElement>('atomic-commerce-breadbox');
Expand Down Expand Up @@ -34,7 +34,6 @@ export const AtomicCommerceSearchBoxRecentQueries = /*@__PURE__*/createReactComp
export const AtomicCommerceSortDropdown = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceSortDropdown, HTMLAtomicCommerceSortDropdownElement>('atomic-commerce-sort-dropdown');
export const AtomicCommerceText = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceText, HTMLAtomicCommerceTextElement>('atomic-commerce-text');
export const AtomicCommerceTimeframeFacet = /*@__PURE__*/createReactComponent<JSX.AtomicCommerceTimeframeFacet, HTMLAtomicCommerceTimeframeFacetElement>('atomic-commerce-timeframe-facet');
export const AtomicIcon = /*@__PURE__*/createReactComponent<JSX.AtomicIcon, HTMLAtomicIconElement>('atomic-icon');
export const AtomicLayoutSection = /*@__PURE__*/createReactComponent<JSX.AtomicLayoutSection, HTMLAtomicLayoutSectionElement>('atomic-layout-section');
export const AtomicNumericRange = /*@__PURE__*/createReactComponent<JSX.AtomicNumericRange, HTMLAtomicNumericRangeElement>('atomic-numeric-range');
export const AtomicProduct = /*@__PURE__*/createReactComponent<JSX.AtomicProduct, HTMLAtomicProductElement>('atomic-product');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { createElement } from 'react';

import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils/index.js';
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';

export interface HTMLStencilElement extends HTMLElement {
componentOnReady(): Promise<this>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { OverlayEventDetail } from './interfaces.js';
import { StencilReactForwardedRef, attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils/index.js';
import { OverlayEventDetail } from './interfaces';
import { StencilReactForwardedRef, attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';

interface OverlayElement extends HTMLElement {
present: () => Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { createReactComponent } from './createComponent.js';
export { createOverlayComponent } from './createOverlayComponent.js';
export { createReactComponent } from './createComponent';
export { createOverlayComponent } from './createOverlayComponent';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelToDashCase } from './case.js';
import { camelToDashCase } from './case';

export const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import type { StyleReactProps } from '../interfaces.js';
import type { StyleReactProps } from '../interfaces';

export type StencilReactExternalProps<PropType, ElementType> = PropType &
Omit<React.HTMLAttributes<ElementType>, 'style'> &
Expand Down Expand Up @@ -46,5 +46,5 @@ export const defineCustomElement = (tagName: string, customElement: any) => {
}
};

export * from './attachProps.js';
export * from './case.js';
export * from './attachProps';
export * from './case';
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable */
/* tslint:disable */
/* auto-generated react proxies */
import { createReactComponent } from './react-component-lib/index.js';
import { createReactComponent } from './react-component-lib';

import type { JSX } from '@coveo/atomic';

import { defineCustomElements } from '@coveo/atomic/loader';
import { defineCustomElements } from '@coveo/atomic/dist/atomic/loader';

defineCustomElements();
export const AtomicAriaLive = /*@__PURE__*/createReactComponent<JSX.AtomicAriaLive, HTMLAtomicAriaLiveElement>('atomic-aria-live');
Expand All @@ -14,7 +14,6 @@ export const AtomicAutomaticFacetGenerator = /*@__PURE__*/createReactComponent<J
export const AtomicBreadbox = /*@__PURE__*/createReactComponent<JSX.AtomicBreadbox, HTMLAtomicBreadboxElement>('atomic-breadbox');
export const AtomicCategoryFacet = /*@__PURE__*/createReactComponent<JSX.AtomicCategoryFacet, HTMLAtomicCategoryFacetElement>('atomic-category-facet');
export const AtomicColorFacet = /*@__PURE__*/createReactComponent<JSX.AtomicColorFacet, HTMLAtomicColorFacetElement>('atomic-color-facet');
export const AtomicComponentError = /*@__PURE__*/createReactComponent<JSX.AtomicComponentError, HTMLAtomicComponentErrorElement>('atomic-component-error');
export const AtomicDidYouMean = /*@__PURE__*/createReactComponent<JSX.AtomicDidYouMean, HTMLAtomicDidYouMeanElement>('atomic-did-you-mean');
export const AtomicExternal = /*@__PURE__*/createReactComponent<JSX.AtomicExternal, HTMLAtomicExternalElement>('atomic-external');
export const AtomicFacet = /*@__PURE__*/createReactComponent<JSX.AtomicFacet, HTMLAtomicFacetElement>('atomic-facet');
Expand All @@ -25,7 +24,6 @@ export const AtomicFormatNumber = /*@__PURE__*/createReactComponent<JSX.AtomicFo
export const AtomicFormatUnit = /*@__PURE__*/createReactComponent<JSX.AtomicFormatUnit, HTMLAtomicFormatUnitElement>('atomic-format-unit');
export const AtomicGeneratedAnswer = /*@__PURE__*/createReactComponent<JSX.AtomicGeneratedAnswer, HTMLAtomicGeneratedAnswerElement>('atomic-generated-answer');
export const AtomicHtml = /*@__PURE__*/createReactComponent<JSX.AtomicHtml, HTMLAtomicHtmlElement>('atomic-html');
export const AtomicIcon = /*@__PURE__*/createReactComponent<JSX.AtomicIcon, HTMLAtomicIconElement>('atomic-icon');
export const AtomicLayoutSection = /*@__PURE__*/createReactComponent<JSX.AtomicLayoutSection, HTMLAtomicLayoutSectionElement>('atomic-layout-section');
export const AtomicLoadMoreResults = /*@__PURE__*/createReactComponent<JSX.AtomicLoadMoreResults, HTMLAtomicLoadMoreResultsElement>('atomic-load-more-results');
export const AtomicNoResults = /*@__PURE__*/createReactComponent<JSX.AtomicNoResults, HTMLAtomicNoResultsElement>('atomic-no-results');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { createElement } from 'react';

import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils/index.js';
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';

export interface HTMLStencilElement extends HTMLElement {
componentOnReady(): Promise<this>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';

import { OverlayEventDetail } from './interfaces.js';
import { StencilReactForwardedRef, attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils/index.js';
import { OverlayEventDetail } from './interfaces';
import { StencilReactForwardedRef, attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';

interface OverlayElement extends HTMLElement {
present: () => Promise<void>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { createReactComponent } from './createComponent.js';
export { createOverlayComponent } from './createOverlayComponent.js';
export { createReactComponent } from './createComponent';
export { createOverlayComponent } from './createOverlayComponent';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { camelToDashCase } from './case.js';
import { camelToDashCase } from './case';

export const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import type { StyleReactProps } from '../interfaces.js';
import type { StyleReactProps } from '../interfaces';

export type StencilReactExternalProps<PropType, ElementType> = PropType &
Omit<React.HTMLAttributes<ElementType>, 'style'> &
Expand Down Expand Up @@ -46,5 +46,5 @@ export const defineCustomElement = (tagName: string, customElement: any) => {
}
};

export * from './attachProps.js';
export * from './case.js';
export * from './attachProps';
export * from './case';
Loading

0 comments on commit fab9acc

Please sign in to comment.