@fluid-topics/ft-search-context 2.2.16 → 2.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,8 +3,11 @@ import { FtSearchStateManager } from "./store/FtSearchStateManager";
3
3
  import { FtSearchStateResourceRequest } from "./store/model";
4
4
  export * from "./store/model";
5
5
  export { FtSearchStateManager } from "./store/FtSearchStateManager";
6
- export declare class RegisterSearchComponentEvent extends Event {
7
- constructor();
6
+ export interface RegisterSearchComponentEventDetail {
7
+ registrationId?: string;
8
+ }
9
+ export declare class RegisterSearchComponentEvent extends CustomEvent<RegisterSearchComponentEventDetail> {
10
+ constructor(searchRegistrationId?: string);
8
11
  }
9
12
  export interface FtSearchComponentInterface {
10
13
  stateManager?: FtSearchStateManager;
@@ -5,12 +5,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { applyMixinOnce, FtLitElementRedux, hasChanged, } from "@fluid-topics/ft-wc-utils";
8
- import { state } from "lit/decorators.js";
8
+ import { property, state, } from "lit/decorators.js";
9
9
  export * from "./store/model";
10
10
  export { FtSearchStateManager } from "./store/FtSearchStateManager";
11
- export class RegisterSearchComponentEvent extends Event {
12
- constructor() {
13
- super("register-ft-search-component", { bubbles: true, composed: true });
11
+ export class RegisterSearchComponentEvent extends CustomEvent {
12
+ constructor(searchRegistrationId) {
13
+ super("register-ft-search-component", {
14
+ bubbles: true, composed: true, detail: {
15
+ registrationId: searchRegistrationId,
16
+ },
17
+ });
14
18
  }
15
19
  }
16
20
  const registerInterval = Symbol("registerInterval");
@@ -55,7 +59,7 @@ export const toFtSearchComponent = applyMixinOnce(Symbol("toFtSearchComponent"),
55
59
  }
56
60
  else {
57
61
  this[registerAttempts]++;
58
- this.dispatchEvent(new RegisterSearchComponentEvent());
62
+ this.dispatchEvent(new RegisterSearchComponentEvent(this.searchRegistrationId));
59
63
  }
60
64
  }
61
65
  disconnectedCallback() {
@@ -69,6 +73,9 @@ export const toFtSearchComponent = applyMixinOnce(Symbol("toFtSearchComponent"),
69
73
  __decorate([
70
74
  state({ hasChanged })
71
75
  ], FtSearchComponentClass.prototype, "neededSearchRequests", void 0);
76
+ __decorate([
77
+ property()
78
+ ], FtSearchComponentClass.prototype, "searchRegistrationId", void 0);
72
79
  return FtSearchComponentClass;
73
80
  });
74
81
  export class FtSearchComponent extends toFtSearchComponent(FtLitElementRedux) {
@@ -46,6 +46,7 @@ export declare class FtSearchStateManager extends FtStateManager {
46
46
  replaceFacet(oldId: string, newId?: string): void;
47
47
  private get facetIds();
48
48
  private set facetIds(value);
49
+ addPropagatedFacet(facetId: string): void;
49
50
  /** @deprecated */
50
51
  setFilter(key: string, values: string[]): void;
51
52
  setValueFilter(key: string, values: string[]): void;
@@ -243,6 +243,11 @@ export class FtSearchStateManager extends FtStateManager {
243
243
  const facets = uniqIds.map((id) => ({ id: id }));
244
244
  this.updateSearchRequest({ facets });
245
245
  }
246
+ addPropagatedFacet(facetId) {
247
+ const propagatedFacets = new Set(this.store.getState().propagatedFacets);
248
+ propagatedFacets.add(facetId);
249
+ this.store.actions.propagatedFacets([...propagatedFacets]);
250
+ }
246
251
  /** @deprecated */
247
252
  setFilter(key, values) {
248
253
  this.setValueFilter(key, values);
@@ -7,6 +7,7 @@ export interface FtSearchPageState {
7
7
  results: Array<FtSearchResultCluster> | undefined;
8
8
  announcements: Array<FtSearchResultAnnouncement> | undefined;
9
9
  facets: Array<FtSearchFacet> | undefined;
10
+ propagatedFacets: Array<string>;
10
11
  paging: FtSearchResultsPageInfo | undefined;
11
12
  spellcheck: FtSpellcheck | undefined;
12
13
  liveQuery: string;
@@ -30,6 +30,7 @@ export const createSearchPageStore = (id) => FtReduxStore.get({
30
30
  announcements: undefined,
31
31
  suggestResults: undefined,
32
32
  configuration: undefined,
33
+ propagatedFacets: [],
33
34
  },
34
35
  reducers: searchPageStateReducers,
35
36
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-context",
3
- "version": "2.2.16",
3
+ "version": "2.2.18",
4
4
  "description": "Context block for integrated search components",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "2.2.16",
23
- "@fluid-topics/ft-wc-utils": "2.2.16",
22
+ "@fluid-topics/ft-app-context": "2.2.18",
23
+ "@fluid-topics/ft-wc-utils": "2.2.18",
24
24
  "lit": "3.3.3"
25
25
  },
26
26
  "devDependencies": {
27
- "@fluid-topics/public-api": "1.0.142"
27
+ "@fluid-topics/public-api": "1.0.143"
28
28
  },
29
- "gitHead": "c461a5d4f16255f9dd084cb26b2f988702693e2f"
29
+ "gitHead": "0d86a22efcc09de35d3da8d470ae3f1d69f282bc"
30
30
  }