Skip to content

Commit

Permalink
Merge branch 'master' into KIT-2606_headless_react_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrajamanickam-coveo committed Aug 23, 2023
2 parents 9f6c551 + c75c586 commit 1dfa9ff
Show file tree
Hide file tree
Showing 49 changed files with 1,728 additions and 2,615 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ reports/*.xml
sarifs
**.cy.ts.mp4
.cspellcache
utils/translation-gpt/temporary.json
scripts/translation-gpt/temporary.json

# CI Release
topology.json
Expand Down
2,492 changes: 667 additions & 1,825 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/atomic-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"@angular/platform-browser": "16.0.2",
"@angular/platform-browser-dynamic": "16.0.2",
"@angular/router": "16.0.2",
"@coveo/atomic": "2.40.2",
"@coveo/atomic": "2.41.0",
"rxjs": "7.5.6"
},
"peerDependencies": {
"@coveo/headless": "2.26.1"
"@coveo/headless": "2.27.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "16.0.2",
Expand All @@ -39,6 +39,6 @@
"ncp": "2.0.0",
"ng-packagr": "16.0.1",
"typescript": "4.9.5",
"@coveo/headless": "2.26.1"
"@coveo/headless": "2.27.0"
}
}
6 changes: 6 additions & 0 deletions packages/atomic-angular/projects/atomic-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.13.0 (2023-08-21)

### Features

- **atomic, headless:** add numberOfValues property in automatic facet generator ([#3101](https://github.com/coveo/ui-kit/issues/3101)) ([8fcd1ed](https://github.com/coveo/ui-kit/commits/8fcd1edba96c2226ddc9fca6c3774e9842f3bca2))

# 2.12.0 (2023-08-09)

### Features
Expand Down
6 changes: 3 additions & 3 deletions packages/atomic-angular/projects/atomic-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@coveo/atomic-angular",
"version": "2.12.3",
"version": "2.13.0",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "14 - 16",
"@angular/core": "14 - 16",
"@coveo/headless": "2.26.1"
"@coveo/headless": "2.27.0"
},
"dependencies": {
"@coveo/atomic": "2.40.2",
"@coveo/atomic": "2.41.0",
"tslib": "2.4.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export declare interface AtomicAutomaticFacetGenerator extends Components.Atomic

@ProxyCmp({
defineCustomElementFn: undefined,
inputs: ['areCollapsed', 'desiredCount']
inputs: ['areCollapsed', 'desiredCount', 'numberOfValues']
})
@Component({
selector: 'atomic-automatic-facet-generator',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
inputs: ['areCollapsed', 'desiredCount']
inputs: ['areCollapsed', 'desiredCount', 'numberOfValues']
})
export class AtomicAutomaticFacetGenerator {
protected el: HTMLElement;
Expand Down
4 changes: 2 additions & 2 deletions packages/atomic-hosted-page/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@coveo/atomic-hosted-page",
"description": "Web Component used to inject a Coveo Hosted Search Page in the DOM.",
"version": "0.3.26",
"version": "0.3.27",
"repository": {
"type": "git",
"url": "https://github.com/coveo/ui-kit.git",
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"dependencies": {
"@coveo/bueno": "0.43.7",
"@coveo/headless": "2.26.1",
"@coveo/headless": "2.27.0",
"@stencil/core": "2.17.3"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/atomic-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@coveo/atomic-react",
"sideEffects": false,
"version": "2.5.6",
"version": "2.5.7",
"description": "React specific wrapper for the Atomic component library",
"repository": {
"type": "git",
Expand All @@ -28,10 +28,10 @@
"recommendation/"
],
"dependencies": {
"@coveo/atomic": "2.40.2"
"@coveo/atomic": "2.41.0"
},
"devDependencies": {
"@coveo/headless": "2.26.1",
"@coveo/headless": "2.27.0",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-replace": "^4.0.0",
Expand All @@ -47,7 +47,7 @@
"rollup-plugin-terser": "^7.0.2"
},
"peerDependencies": {
"@coveo/headless": "2.26.1",
"@coveo/headless": "2.27.0",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
Expand Down
6 changes: 6 additions & 0 deletions packages/atomic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2.41.0 (2023-08-21)

### Features

- **atomic, headless:** add numberOfValues property in automatic facet generator ([#3101](https://github.com/coveo/ui-kit/issues/3101)) ([8fcd1ed](https://github.com/coveo/ui-kit/commits/8fcd1edba96c2226ddc9fca6c3774e9842f3bca2))

## 2.40.2 (2023-08-16)

### Bug Fixes
Expand Down
4 changes: 3 additions & 1 deletion packages/atomic/cypress/e2e/search-interface.cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ describe('Search Interface Component', () => {
// - searchHub = 'testing hub'
// - pipeline = 'testing';
// - userDisplayname = 'Alice Smith';

const accessToken =
// eslint-disable-next-line @cspell/spellchecker
'eyJhbGciOiJIUzI1NiJ9.eyJwaXBlbGluZSI6InRlc3RpbmciLCJzZWFyY2hIdWIiOiJ0ZXN0aW5nIGh1YiIsInY4Ijp0cnVlLCJvcmdhbml6YXRpb24iOiJzZWFyY2h1aXNhbXBsZXMiLCJ1c2VySWRzIjpbeyJhdXRoQ29va2llIjoiIiwicHJvdmlkZXIiOiJFbWFpbCBTZWN1cml0eSBQcm92aWRlciIsIm5hbWUiOiJhc21pdGhAZXhhbXBsZS5jb20iLCJ0eXBlIjoiVXNlciIsImluZm9zIjp7fX1dLCJyb2xlcyI6WyJxdWVyeUV4ZWN1dG9yIl0sInVzZXJEaXNwbGF5TmFtZSI6IkFsaWNlIFNtaXRoIiwiZXhwIjoxNjQ2NzUzNDM0LCJpYXQiOjE2NDY2NjcwMzR9.p70UUYXKmg3sHU961G1Vmwp45qp8EgxvHisPMk-RUPw';
const tokenPipeline = 'testing';
const tokenSearchHub = 'testing hub';
Expand Down Expand Up @@ -261,7 +263,7 @@ describe('Search Interface Component', () => {
it('should work with lowercase regions', () => {
setLanguageAndWait('zh-tw');

QuerySummarySelectors.text().should('contain', '结果数');
QuerySummarySelectors.text().should('contain', '結果數');
});

it('should support adding a non-existing language', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/atomic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coveo/atomic",
"version": "2.40.2",
"version": "2.41.0",
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
"homepage": "https://docs.coveo.com/en/atomic/latest/",
"repository": {
Expand Down Expand Up @@ -63,7 +63,7 @@
},
"devDependencies": {
"@babel/core": "7.18.10",
"@coveo/headless": "2.26.1",
"@coveo/headless": "2.27.0",
"@fullhuman/postcss-purgecss": "4.1.3",
"@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-replace": "2.4.2",
Expand Down Expand Up @@ -96,7 +96,7 @@
"tailwindcss": "3.3.3"
},
"peerDependencies": {
"@coveo/headless": "2.26.1"
"@coveo/headless": "2.27.0"
},
"license": "Apache-2.0",
"engines": {
Expand Down
16 changes: 14 additions & 2 deletions packages/atomic/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ export namespace Components {
*/
"areCollapsed": boolean;
/**
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired count of automatic facets. Must be a positive integer.
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired count of automatic facets. Minimum: `1` Maximum: `10`
* @defaultValue `5`
*/
"desiredCount": number;
/**
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired number of automatically generated facet values. Minimum: `1`
* @defaultValue `8`
*/
"numberOfValues": number;
}
interface AtomicAutomaticFacetSlotContent {
"isThereStaticFacets": boolean;
Expand Down Expand Up @@ -3040,9 +3046,15 @@ declare namespace LocalJSX {
*/
"areCollapsed"?: boolean;
/**
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired count of automatic facets. Must be a positive integer.
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired count of automatic facets. Minimum: `1` Maximum: `10`
* @defaultValue `5`
*/
"desiredCount": number;
/**
* @beta - This prop is part of the automatic facets feature. Automatic facets are currently in beta testing and should be available soon. The desired number of automatically generated facet values. Minimum: `1`
* @defaultValue `8`
*/
"numberOfValues"?: number;
}
interface AtomicAutomaticFacetSlotContent {
"isThereStaticFacets": boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export class AtomicAutomaticFacetGenerator implements InitializableComponent {
* Automatic facets are currently in beta testing and should be available soon.
*
* The desired count of automatic facets.
* Must be a positive integer.
*
* Minimum: `1`
* Maximum: `10`
* @defaultValue `5`
*/
@Prop() public desiredCount!: number;

Expand All @@ -61,13 +64,27 @@ export class AtomicAutomaticFacetGenerator implements InitializableComponent {
*/
@Prop() public areCollapsed = true;

/**
* @beta - This prop is part of the automatic facets feature.
* Automatic facets are currently in beta testing and should be available soon.
*
* The desired number of automatically generated facet values.
*
* Minimum: `1`
* @defaultValue `8`
*/
@Prop() public numberOfValues = 8;

public initialize() {
this.validateProps();
this.searchStatus = buildSearchStatus(this.bindings.engine);
this.automaticFacetGenerator = buildAutomaticFacetGenerator(
this.bindings.engine,
{
desiredCount: this.desiredCount,
options: {
desiredCount: this.desiredCount,
numberOfValues: this.numberOfValues,
},
}
);
}
Expand Down Expand Up @@ -96,7 +113,10 @@ export class AtomicAutomaticFacetGenerator implements InitializableComponent {
});
if (!this.searchStatus.state.firstSearchExecuted) {
return Array.from({length: this.desiredCount}, () => (
<FacetPlaceholder numberOfValues={8} isCollapsed={this.areCollapsed} /> //TODO: Change '8' to variable whenever adding the 'numberOfValues' attribute in the AF query
<FacetPlaceholder
numberOfValues={this.numberOfValues}
isCollapsed={this.areCollapsed}
/>
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ export class AtomicAutomaticFacetSlotContent implements InitializableComponent {
public initialize() {
const desiredCount =
this.bindings.engine.state.automaticFacetSet?.desiredCount;
const numberOfValues =
this.bindings.engine.state.automaticFacetSet?.numberOfValues;
if (desiredCount) {
this.automaticFacetGenerator = buildAutomaticFacetGenerator(
this.bindings.engine,
{desiredCount}
{
options: {
desiredCount,
numberOfValues,
},
}
);
}
this.searchStatus = buildSearchStatus(this.bindings.engine);
Expand Down
Loading

0 comments on commit 1dfa9ff

Please sign in to comment.