@backstage/plugin-search-common 0.3.3 → 0.3.4-next.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/plugin-search-common
2
2
 
3
+ ## 0.3.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 3a74e203a8: Support generating highlighted matched terms in search result data
8
+ - Updated dependencies
9
+ - @backstage/plugin-permission-common@0.6.1-next.0
10
+
3
11
  ## 0.3.3
4
12
 
5
13
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -12,12 +12,36 @@ interface SearchQuery {
12
12
  types?: string[];
13
13
  pageCursor?: string;
14
14
  }
15
+ /**
16
+ * @beta
17
+ * Metadata for result relevant document fields with matched terms highlighted
18
+ * via wrapping in associated pre/post tags. The UI is expected to parse these
19
+ * field excerpts by replacing wrapping tags with applicable UI elements for rendering.
20
+ */
21
+ interface ResultHighlight {
22
+ /**
23
+ * Prefix tag for wrapping terms to be highlighted.
24
+ */
25
+ preTag: string;
26
+ /**
27
+ * Postfix tag for wrapping terms to be highlighted.
28
+ */
29
+ postTag: string;
30
+ fields: {
31
+ /**
32
+ * Matched document fields and associated excerpts containing highlighted
33
+ * terms wrapped in preTag and postTag to be parsed and rendered in the UI.
34
+ */
35
+ [field: string]: string;
36
+ };
37
+ }
15
38
  /**
16
39
  * @beta
17
40
  */
18
41
  interface Result<TDocument extends SearchDocument> {
19
42
  type: string;
20
43
  document: TDocument;
44
+ highlight?: ResultHighlight;
21
45
  }
22
46
  /**
23
47
  * @beta
@@ -170,4 +194,4 @@ interface SearchEngine {
170
194
  query(query: SearchQuery, options?: QueryRequestOptions): Promise<IndexableResultSet>;
171
195
  }
172
196
 
173
- export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet };
197
+ export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultHighlight, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-search-common",
3
3
  "description": "Common functionalities for Search, to be shared between various search-enabled plugins",
4
- "version": "0.3.3",
4
+ "version": "0.3.4-next.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "private": false,
@@ -39,16 +39,16 @@
39
39
  "url": "https://github.com/backstage/backstage/issues"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/plugin-permission-common": "^0.6.0",
42
+ "@backstage/plugin-permission-common": "^0.6.1-next.0",
43
43
  "@backstage/types": "^1.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/cli": "^0.17.0"
46
+ "@backstage/cli": "^0.17.1-next.2"
47
47
  },
48
48
  "jest": {
49
49
  "roots": [
50
50
  ".."
51
51
  ]
52
52
  },
53
- "gitHead": "e0e44c433319711c2fb8b175db411a621f7aaec2"
53
+ "gitHead": "cfbf5762d7d91eee18999306b21d63840400ee29"
54
54
  }