@backstage/plugin-search-react 1.7.13 → 1.7.14-next.1
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 +28 -0
- package/alpha/package.json +1 -1
- package/dist/alpha.d.ts +2 -2
- package/dist/alpha.esm.js +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage/plugin-search-react
|
|
2
2
|
|
|
3
|
+
## 1.7.14-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6349099: Added config input type to the extensions
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.6.8-next.1
|
|
10
|
+
- @backstage/plugin-search-common@1.2.14-next.0
|
|
11
|
+
- @backstage/core-components@0.14.10-next.0
|
|
12
|
+
- @backstage/core-plugin-api@1.9.3
|
|
13
|
+
- @backstage/theme@0.5.6
|
|
14
|
+
- @backstage/types@1.1.1
|
|
15
|
+
- @backstage/version-bridge@1.0.8
|
|
16
|
+
|
|
17
|
+
## 1.7.14-next.0
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 31bfc44: Updated alpha definitions of extension data references.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/frontend-plugin-api@0.6.8-next.0
|
|
24
|
+
- @backstage/core-components@0.14.10-next.0
|
|
25
|
+
- @backstage/core-plugin-api@1.9.3
|
|
26
|
+
- @backstage/theme@0.5.6
|
|
27
|
+
- @backstage/types@1.1.1
|
|
28
|
+
- @backstage/version-bridge@1.0.8
|
|
29
|
+
- @backstage/plugin-search-common@1.2.13
|
|
30
|
+
|
|
3
31
|
## 1.7.13
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.d.ts
CHANGED
|
@@ -51,13 +51,13 @@ type SearchResultItemExtensionOptions<TConfig extends {
|
|
|
51
51
|
/** @alpha */
|
|
52
52
|
declare function createSearchResultListItemExtension<TConfig extends {
|
|
53
53
|
noTrack?: boolean;
|
|
54
|
-
}>(options: SearchResultItemExtensionOptions<TConfig>): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig>;
|
|
54
|
+
}>(options: SearchResultItemExtensionOptions<TConfig>): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig & {}, TConfig & {}>;
|
|
55
55
|
/** @alpha */
|
|
56
56
|
declare namespace createSearchResultListItemExtension {
|
|
57
57
|
const itemDataRef: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
|
|
58
58
|
predicate?: SearchResultItemExtensionPredicate | undefined;
|
|
59
59
|
component: SearchResultItemExtensionComponent;
|
|
60
|
-
}, {}>;
|
|
60
|
+
}, "search.search-result-list-item.item", {}>;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export { type BaseSearchResultListItemProps, type SearchResultItemExtensionComponent, type SearchResultItemExtensionOptions, type SearchResultItemExtensionPredicate, createSearchResultListItemExtension };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -42,7 +42,7 @@ function createSearchResultListItemExtension(options) {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
((createSearchResultListItemExtension2) => {
|
|
45
|
-
createSearchResultListItemExtension2.itemDataRef = createExtensionDataRef("search.search-result-list-item.item");
|
|
45
|
+
createSearchResultListItemExtension2.itemDataRef = createExtensionDataRef().with({ id: "search.search-result-list-item.item" });
|
|
46
46
|
})(createSearchResultListItemExtension || (createSearchResultListItemExtension = {}));
|
|
47
47
|
|
|
48
48
|
export { createSearchResultListItemExtension };
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.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';\n\nimport { ListItemProps } from '@material-ui/core/ListItem';\n\nimport {\n ExtensionBoundary,\n PortableSchema,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport { SearchDocument, SearchResult } from '@backstage/plugin-search-common';\n\nimport { SearchResultListItemExtension } from './extensions';\n\n/** @alpha */\nexport type BaseSearchResultListItemProps<T = {}> = T & {\n rank?: number;\n result?: SearchDocument;\n} & Omit<ListItemProps, 'button'>;\n\n/** @alpha */\nexport type SearchResultItemExtensionComponent = <\n P extends BaseSearchResultListItemProps,\n>(\n props: P,\n) => JSX.Element | null;\n\n/** @alpha */\nexport type SearchResultItemExtensionPredicate = (\n result: SearchResult,\n) => boolean;\n\n/** @alpha */\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/** @alpha */\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/** @alpha */\nexport namespace createSearchResultListItemExtension {\n export const itemDataRef = createExtensionDataRef<{\n predicate?: SearchResultItemExtensionPredicate;\n component: SearchResultItemExtensionComponent;\n }>('search.search-result-list-item.item');\n}\n"],"names":["createSearchResultListItemExtension"],"mappings":";;;;AAmFO,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,EAAA,CAAE,QAAQ,KAAK,CAAA;AAAA,KACnC,CAAA;AAAA,GACH,CAAA;AAEN,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,yBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,QAAA,EAAU,QAAQ,QAAY,IAAA;AAAA,MAC5B,EAAI,EAAA,aAAA;AAAA,MACJ,KAAO,EAAA,OAAA;AAAA,KACT;AAAA,IACA,YAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,MAAM,mCAAoC,CAAA,WAAA;AAAA,KAC5C;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,IAAA,EAAQ,EAAA;AACxB,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,OAAA,CACG,SAAU,CAAA,EAAE,MAAO,EAAC,CACpB,CAAA,IAAA,CAAK,CAAc,SAAA,MAAA,EAAE,OAAS,EAAA,SAAA,EAAY,CAAA,CAAA;AAAA,OAC/C,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,IAAM,EAAA;AAAA,UACJ,WAAW,OAAQ,CAAA,SAAA;AAAA,UACnB,SAAW,EAAA,CAAA,KAAA,qBACR,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IACjB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,YAAC,6BAAA;AAAA,YAAA;AAAA,cACC,MAAM,KAAM,CAAA,IAAA;AAAA,cACZ,QAAQ,KAAM,CAAA,MAAA;AAAA,cACd,SAAS,MAAO,CAAA,OAAA;AAAA,aAAA;AAAA,4BAEhB,KAAA,CAAA,aAAA,CAAC,kBAAoB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAAA,WAEnC,CAAA;AAAA,SAEJ;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,oCAAV,KAAA;AACE,EAAMA,oCAAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.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';\n\nimport { ListItemProps } from '@material-ui/core/ListItem';\n\nimport {\n ExtensionBoundary,\n PortableSchema,\n createExtension,\n createExtensionDataRef,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport { SearchDocument, SearchResult } from '@backstage/plugin-search-common';\n\nimport { SearchResultListItemExtension } from './extensions';\n\n/** @alpha */\nexport type BaseSearchResultListItemProps<T = {}> = T & {\n rank?: number;\n result?: SearchDocument;\n} & Omit<ListItemProps, 'button'>;\n\n/** @alpha */\nexport type SearchResultItemExtensionComponent = <\n P extends BaseSearchResultListItemProps,\n>(\n props: P,\n) => JSX.Element | null;\n\n/** @alpha */\nexport type SearchResultItemExtensionPredicate = (\n result: SearchResult,\n) => boolean;\n\n/** @alpha */\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/** @alpha */\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/** @alpha */\nexport namespace createSearchResultListItemExtension {\n export const itemDataRef = createExtensionDataRef<{\n predicate?: SearchResultItemExtensionPredicate;\n component: SearchResultItemExtensionComponent;\n }>().with({ id: 'search.search-result-list-item.item' });\n}\n"],"names":["createSearchResultListItemExtension"],"mappings":";;;;AAmFO,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,EAAA,CAAE,QAAQ,KAAK,CAAA;AAAA,KACnC,CAAA;AAAA,GACH,CAAA;AAEN,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,yBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,QAAA,EAAU,QAAQ,QAAY,IAAA;AAAA,MAC5B,EAAI,EAAA,aAAA;AAAA,MACJ,KAAO,EAAA,OAAA;AAAA,KACT;AAAA,IACA,YAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,MAAM,mCAAoC,CAAA,WAAA;AAAA,KAC5C;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,IAAA,EAAQ,EAAA;AACxB,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,OAAA,CACG,SAAU,CAAA,EAAE,MAAO,EAAC,CACpB,CAAA,IAAA,CAAK,CAAc,SAAA,MAAA,EAAE,OAAS,EAAA,SAAA,EAAY,CAAA,CAAA;AAAA,OAC/C,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,IAAM,EAAA;AAAA,UACJ,WAAW,OAAQ,CAAA,SAAA;AAAA,UACnB,SAAW,EAAA,CAAA,KAAA,qBACR,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IACjB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,YAAC,6BAAA;AAAA,YAAA;AAAA,cACC,MAAM,KAAM,CAAA,IAAA;AAAA,cACZ,QAAQ,KAAM,CAAA,MAAA;AAAA,cACd,SAAS,MAAO,CAAA,OAAA;AAAA,aAAA;AAAA,4BAEhB,KAAA,CAAA,aAAA,CAAC,kBAAoB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA;AAAA,WAEnC,CAAA;AAAA,SAEJ;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,oCAAV,KAAA;AACE,EAAMA,oCAAAA,CAAA,cAAc,sBAGxB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,uCAAuC,CAAA,CAAA;AAAA,CAJxC,EAAA,mCAAA,KAAA,mCAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-search-react",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.14-next.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library",
|
|
6
6
|
"pluginId": "search",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"test": "backstage-cli package test"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@backstage/core-components": "^0.14.
|
|
57
|
+
"@backstage/core-components": "^0.14.10-next.0",
|
|
58
58
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
59
|
-
"@backstage/frontend-plugin-api": "^0.6.
|
|
60
|
-
"@backstage/plugin-search-common": "^1.2.
|
|
59
|
+
"@backstage/frontend-plugin-api": "^0.6.8-next.1",
|
|
60
|
+
"@backstage/plugin-search-common": "^1.2.14-next.0",
|
|
61
61
|
"@backstage/theme": "^0.5.6",
|
|
62
62
|
"@backstage/types": "^1.1.1",
|
|
63
63
|
"@backstage/version-bridge": "^1.0.8",
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"react-use": "^17.3.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@backstage/cli": "^0.
|
|
74
|
-
"@backstage/core-app-api": "^1.14.0",
|
|
75
|
-
"@backstage/frontend-app-api": "^0.7.
|
|
76
|
-
"@backstage/frontend-test-utils": "^0.1.
|
|
77
|
-
"@backstage/test-utils": "^1.5.
|
|
73
|
+
"@backstage/cli": "^0.27.0-next.1",
|
|
74
|
+
"@backstage/core-app-api": "^1.14.2-next.0",
|
|
75
|
+
"@backstage/frontend-app-api": "^0.7.5-next.1",
|
|
76
|
+
"@backstage/frontend-test-utils": "^0.1.12-next.1",
|
|
77
|
+
"@backstage/test-utils": "^1.5.10-next.1",
|
|
78
78
|
"@testing-library/dom": "^10.0.0",
|
|
79
79
|
"@testing-library/jest-dom": "^6.0.0",
|
|
80
80
|
"@testing-library/react": "^15.0.0",
|