@backstage/plugin-search-react 0.0.0-nightly-20240820021901 → 0.0.0-nightly-20240821021909
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 +12 -4
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +1 -67
- package/dist/alpha.esm.js +0 -1
- package/dist/alpha.esm.js.map +1 -1
- package/package.json +9 -9
- package/dist/alpha/extensions.esm.js +0 -50
- package/dist/alpha/extensions.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# @backstage/plugin-search-react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20240821021909
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5446061: The `/alpha` export no longer export extension creators for the new frontend system, existing usage should be switched to use the equivalent extension blueprint instead. For more information see the [new frontend system 1.30 migration documentation](https://backstage.io/docs/frontend-system/architecture/migrations#130).
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.0.0-nightly-20240821021909
|
|
10
|
+
|
|
11
|
+
## 1.7.14
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
6
14
|
|
|
@@ -9,9 +17,9 @@
|
|
|
9
17
|
- 3123c16: Fix package metadata
|
|
10
18
|
- 6349099: Added config input type to the extensions
|
|
11
19
|
- Updated dependencies
|
|
12
|
-
- @backstage/frontend-plugin-api@0.
|
|
13
|
-
- @backstage/core-components@0.
|
|
14
|
-
- @backstage/plugin-search-common@
|
|
20
|
+
- @backstage/frontend-plugin-api@0.7.0
|
|
21
|
+
- @backstage/core-components@0.14.10
|
|
22
|
+
- @backstage/plugin-search-common@1.2.14
|
|
15
23
|
- @backstage/core-plugin-api@1.9.3
|
|
16
24
|
- @backstage/theme@0.5.6
|
|
17
25
|
- @backstage/types@1.1.1
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
3
|
-
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
|
4
3
|
import { ListItemProps } from '@material-ui/core/ListItem';
|
|
5
4
|
import { SearchDocument, SearchResult } from '@backstage/plugin-search-common';
|
|
6
5
|
|
|
@@ -52,69 +51,4 @@ declare const SearchResultListItemBlueprint: _backstage_frontend_plugin_api.Exte
|
|
|
52
51
|
}, "search.search-result-list-item.item", {}>;
|
|
53
52
|
}>;
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
* @alpha
|
|
57
|
-
* @deprecated Use {@link SearchResultListItemBlueprint} instead
|
|
58
|
-
*/
|
|
59
|
-
type SearchResultItemExtensionOptions<TConfig extends {
|
|
60
|
-
noTrack?: boolean;
|
|
61
|
-
}> = {
|
|
62
|
-
/**
|
|
63
|
-
* The extension namespace.
|
|
64
|
-
*/
|
|
65
|
-
namespace?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The extension name.
|
|
68
|
-
*/
|
|
69
|
-
name?: string;
|
|
70
|
-
/**
|
|
71
|
-
* The extension attachment point (e.g., search modal or page).
|
|
72
|
-
*/
|
|
73
|
-
attachTo?: {
|
|
74
|
-
id: string;
|
|
75
|
-
input: string;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Optional extension config schema.
|
|
79
|
-
*/
|
|
80
|
-
configSchema?: PortableSchema<TConfig>;
|
|
81
|
-
/**
|
|
82
|
-
* The extension component.
|
|
83
|
-
*/
|
|
84
|
-
component: (options: {
|
|
85
|
-
config: TConfig;
|
|
86
|
-
}) => Promise<SearchResultItemExtensionComponent>;
|
|
87
|
-
/**
|
|
88
|
-
* When an extension defines a predicate, it returns true if the result should be rendered by that extension.
|
|
89
|
-
* Defaults to a predicate that returns true, which means it renders all sorts of results.
|
|
90
|
-
*/
|
|
91
|
-
predicate?: SearchResultItemExtensionPredicate;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* Creates items for the search result list.
|
|
95
|
-
*
|
|
96
|
-
* @alpha
|
|
97
|
-
* @deprecated Use {@link SearchResultListItemBlueprint} instead
|
|
98
|
-
*/
|
|
99
|
-
declare function createSearchResultListItemExtension<TConfig extends {
|
|
100
|
-
noTrack?: boolean;
|
|
101
|
-
}>(options: SearchResultItemExtensionOptions<TConfig>): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig, TConfig, never, never, {
|
|
102
|
-
kind?: string | undefined;
|
|
103
|
-
namespace?: string | undefined;
|
|
104
|
-
name?: string | undefined;
|
|
105
|
-
}>;
|
|
106
|
-
/**
|
|
107
|
-
* @alpha
|
|
108
|
-
* @deprecated Use {@link SearchResultListItemBlueprint} instead
|
|
109
|
-
*/
|
|
110
|
-
declare namespace createSearchResultListItemExtension {
|
|
111
|
-
/**
|
|
112
|
-
* @deprecated Use {@link SearchResultListItemBlueprint#dataRefs.item} instead
|
|
113
|
-
*/
|
|
114
|
-
const itemDataRef: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
|
|
115
|
-
predicate?: SearchResultItemExtensionPredicate | undefined;
|
|
116
|
-
component: SearchResultItemExtensionComponent;
|
|
117
|
-
}, "search.search-result-list-item.item", {}>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { type BaseSearchResultListItemProps, type SearchResultItemExtensionComponent, type SearchResultItemExtensionOptions, type SearchResultItemExtensionPredicate, SearchResultListItemBlueprint, type SearchResultListItemBlueprintParams, createSearchResultListItemExtension };
|
|
54
|
+
export { type BaseSearchResultListItemProps, type SearchResultItemExtensionComponent, type SearchResultItemExtensionPredicate, SearchResultListItemBlueprint, type SearchResultListItemBlueprintParams };
|
package/dist/alpha.esm.js
CHANGED
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-search-react",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20240821021909",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library",
|
|
6
6
|
"pluginId": "search",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"test": "backstage-cli package test"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@backstage/core-components": "^0.
|
|
58
|
+
"@backstage/core-components": "^0.14.10",
|
|
59
59
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
60
|
-
"@backstage/frontend-plugin-api": "^0.0.0-nightly-
|
|
61
|
-
"@backstage/plugin-search-common": "^
|
|
60
|
+
"@backstage/frontend-plugin-api": "^0.0.0-nightly-20240821021909",
|
|
61
|
+
"@backstage/plugin-search-common": "^1.2.14",
|
|
62
62
|
"@backstage/theme": "^0.5.6",
|
|
63
63
|
"@backstage/types": "^1.1.1",
|
|
64
64
|
"@backstage/version-bridge": "^1.0.8",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"react-use": "^17.3.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@backstage/cli": "^0.
|
|
75
|
-
"@backstage/core-app-api": "^
|
|
76
|
-
"@backstage/frontend-app-api": "^0.0.0-nightly-
|
|
77
|
-
"@backstage/frontend-test-utils": "^0.0.0-nightly-
|
|
78
|
-
"@backstage/test-utils": "^
|
|
74
|
+
"@backstage/cli": "^0.27.0",
|
|
75
|
+
"@backstage/core-app-api": "^1.14.2",
|
|
76
|
+
"@backstage/frontend-app-api": "^0.0.0-nightly-20240821021909",
|
|
77
|
+
"@backstage/frontend-test-utils": "^0.0.0-nightly-20240821021909",
|
|
78
|
+
"@backstage/test-utils": "^1.5.10",
|
|
79
79
|
"@testing-library/dom": "^10.0.0",
|
|
80
80
|
"@testing-library/jest-dom": "^6.0.0",
|
|
81
81
|
"@testing-library/react": "^15.0.0",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React, { lazy } from 'react';
|
|
2
|
-
import { createSchemaFromZod, createExtension, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
3
|
-
import { SearchResultListItemExtension } from '../extensions.esm.js';
|
|
4
|
-
import { searchResultListItemDataRef } from './blueprints/types.esm.js';
|
|
5
|
-
|
|
6
|
-
function createSearchResultListItemExtension(options) {
|
|
7
|
-
const configSchema = "configSchema" in options ? options.configSchema : createSchemaFromZod(
|
|
8
|
-
(z) => z.object({
|
|
9
|
-
noTrack: z.boolean().default(false)
|
|
10
|
-
})
|
|
11
|
-
);
|
|
12
|
-
return createExtension({
|
|
13
|
-
kind: "search-result-list-item",
|
|
14
|
-
namespace: options.namespace,
|
|
15
|
-
name: options.name,
|
|
16
|
-
attachTo: options.attachTo ?? {
|
|
17
|
-
id: "page:search",
|
|
18
|
-
input: "items"
|
|
19
|
-
},
|
|
20
|
-
configSchema,
|
|
21
|
-
output: {
|
|
22
|
-
item: createSearchResultListItemExtension.itemDataRef
|
|
23
|
-
},
|
|
24
|
-
factory({ config, node }) {
|
|
25
|
-
const ExtensionComponent = lazy(
|
|
26
|
-
() => options.component({ config }).then((component) => ({ default: component }))
|
|
27
|
-
);
|
|
28
|
-
return {
|
|
29
|
-
item: {
|
|
30
|
-
predicate: options.predicate,
|
|
31
|
-
component: (props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(
|
|
32
|
-
SearchResultListItemExtension,
|
|
33
|
-
{
|
|
34
|
-
rank: props.rank,
|
|
35
|
-
result: props.result,
|
|
36
|
-
noTrack: config.noTrack
|
|
37
|
-
},
|
|
38
|
-
/* @__PURE__ */ React.createElement(ExtensionComponent, { ...props })
|
|
39
|
-
))
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
((createSearchResultListItemExtension2) => {
|
|
46
|
-
createSearchResultListItemExtension2.itemDataRef = searchResultListItemDataRef;
|
|
47
|
-
})(createSearchResultListItemExtension || (createSearchResultListItemExtension = {}));
|
|
48
|
-
|
|
49
|
-
export { createSearchResultListItemExtension };
|
|
50
|
-
//# sourceMappingURL=extensions.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.esm.js","sources":["../../src/alpha/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { lazy } from 'react';\nimport {\n ExtensionBoundary,\n PortableSchema,\n createExtension,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport {\n SearchResultItemExtensionComponent,\n SearchResultItemExtensionPredicate,\n} from './blueprints';\nimport { SearchResultListItemExtension } from '../extensions';\nimport { searchResultListItemDataRef } from './blueprints/types';\n\n/**\n * @alpha\n * @deprecated Use {@link SearchResultListItemBlueprint} instead\n */\nexport type SearchResultItemExtensionOptions<\n TConfig extends { noTrack?: boolean },\n> = {\n /**\n * The extension namespace.\n */\n namespace?: string;\n /**\n * The extension name.\n */\n name?: string;\n /**\n * The extension attachment point (e.g., search modal or page).\n */\n attachTo?: { id: string; input: string };\n /**\n * Optional extension config schema.\n */\n configSchema?: PortableSchema<TConfig>;\n /**\n * The extension component.\n */\n component: (options: {\n config: TConfig;\n }) => Promise<SearchResultItemExtensionComponent>;\n /**\n * When an extension defines a predicate, it returns true if the result should be rendered by that extension.\n * Defaults to a predicate that returns true, which means it renders all sorts of results.\n */\n predicate?: SearchResultItemExtensionPredicate;\n};\n\n/**\n * Creates items for the search result list.\n *\n * @alpha\n * @deprecated Use {@link SearchResultListItemBlueprint} instead\n */\nexport function createSearchResultListItemExtension<\n TConfig extends { noTrack?: boolean },\n>(options: SearchResultItemExtensionOptions<TConfig>) {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({\n noTrack: z.boolean().default(false),\n }),\n ) as PortableSchema<TConfig>);\n\n return createExtension({\n kind: 'search-result-list-item',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? {\n id: 'page:search',\n input: 'items',\n },\n configSchema,\n output: {\n item: createSearchResultListItemExtension.itemDataRef,\n },\n factory({ config, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .component({ config })\n .then(component => ({ default: component })),\n ) as unknown as SearchResultItemExtensionComponent;\n\n return {\n item: {\n predicate: options.predicate,\n component: props => (\n <ExtensionBoundary node={node}>\n <SearchResultListItemExtension\n rank={props.rank}\n result={props.result}\n noTrack={config.noTrack}\n >\n <ExtensionComponent {...props} />\n </SearchResultListItemExtension>\n </ExtensionBoundary>\n ),\n },\n };\n },\n });\n}\n\n/**\n * @alpha\n * @deprecated Use {@link SearchResultListItemBlueprint} instead\n */\nexport namespace createSearchResultListItemExtension {\n /**\n * @deprecated Use {@link SearchResultListItemBlueprint#dataRefs.item} instead\n */\n export const itemDataRef = searchResultListItemDataRef;\n}\n"],"names":["createSearchResultListItemExtension"],"mappings":";;;;;AAwEO,SAAS,oCAEd,OAAoD,EAAA;AACpD,EAAA,MAAM,YACJ,GAAA,cAAA,IAAkB,OACd,GAAA,OAAA,CAAQ,YACP,GAAA,mBAAA;AAAA,IAAoB,CAAA,CAAA,KACnB,EAAE,MAAO,CAAA;AAAA,MACP,OAAS,EAAA,CAAA,CAAE,OAAQ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