@drodil/backstage-plugin-qeta 3.59.10 → 4.0.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/README.md +6 -11
- package/config.schema.json +58 -0
- package/dist/components/ArticlePage/ArticlePage.esm.js +61 -15
- package/dist/components/ArticlePage/ArticlePage.esm.js.map +1 -1
- package/dist/components/ArticlesPage/ArticlesPage.esm.js +9 -22
- package/dist/components/ArticlesPage/ArticlesPage.esm.js.map +1 -1
- package/dist/components/AskPage/AskPage.esm.js +10 -7
- package/dist/components/AskPage/AskPage.esm.js.map +1 -1
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js +8 -5
- package/dist/components/CollectionCreatePage/CollectionCreatePage.esm.js.map +1 -1
- package/dist/components/CollectionPage/CollectionPage.esm.js +47 -87
- package/dist/components/CollectionPage/CollectionPage.esm.js.map +1 -1
- package/dist/components/CollectionsPage/CollectionsPage.esm.js +8 -5
- package/dist/components/CollectionsPage/CollectionsPage.esm.js.map +1 -1
- package/dist/components/ContentHealthCard/ContentHealthCard.esm.js +61 -89
- package/dist/components/ContentHealthCard/ContentHealthCard.esm.js.map +1 -1
- package/dist/components/ContentHealthCard/ContentHealthCard.module.css.esm.js +8 -0
- package/dist/components/ContentHealthCard/ContentHealthCard.module.css.esm.js.map +1 -0
- package/dist/components/ContentHealthCard/ReviewList.esm.js +27 -60
- package/dist/components/ContentHealthCard/ReviewList.esm.js.map +1 -1
- package/dist/components/ContentHealthCard/ReviewList.module.css.esm.js +8 -0
- package/dist/components/ContentHealthCard/ReviewList.module.css.esm.js.map +1 -0
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js +9 -6
- package/dist/components/CreateLinkPage/CreateLinkPage.esm.js.map +1 -1
- package/dist/components/EntityPage/EntityPage.esm.js +48 -58
- package/dist/components/EntityPage/EntityPage.esm.js.map +1 -1
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js +2 -3
- package/dist/components/EntityPostsContent/EntityPostsContent.esm.js.map +1 -1
- package/dist/components/FavoritePage/FavoritePage.esm.js +3 -14
- package/dist/components/FavoritePage/FavoritePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.esm.js +17 -60
- package/dist/components/HomePage/HomePage.esm.js.map +1 -1
- package/dist/components/HomePage/HomePage.module.css.esm.js +8 -0
- package/dist/components/HomePage/HomePage.module.css.esm.js.map +1 -0
- package/dist/components/LinkPage/LinkPage.esm.js +60 -61
- package/dist/components/LinkPage/LinkPage.esm.js.map +1 -1
- package/dist/components/LinksPage/LinksPage.esm.js +9 -16
- package/dist/components/LinksPage/LinksPage.esm.js.map +1 -1
- package/dist/components/ModeratorPage/ModeratorPage.esm.js +19 -29
- package/dist/components/ModeratorPage/ModeratorPage.esm.js.map +1 -1
- package/dist/components/ModeratorPage/ModeratorPage.module.css.esm.js +8 -0
- package/dist/components/ModeratorPage/ModeratorPage.module.css.esm.js.map +1 -0
- package/dist/components/QetaPage/QetaPage.esm.js +187 -239
- package/dist/components/QetaPage/QetaPage.esm.js.map +1 -1
- package/dist/components/QetaPage/QetaPage.module.css.esm.js +8 -0
- package/dist/components/QetaPage/QetaPage.module.css.esm.js.map +1 -0
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js +67 -78
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.esm.js.map +1 -1
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.module.css.esm.js +8 -0
- package/dist/components/QetaSearchResultListItem/QetaSearchResultListItem.module.css.esm.js.map +1 -0
- package/dist/components/QuestionPage/QuestionPage.esm.js +122 -97
- package/dist/components/QuestionPage/QuestionPage.esm.js.map +1 -1
- package/dist/components/QuestionsPage/QuestionsPage.esm.js +8 -5
- package/dist/components/QuestionsPage/QuestionsPage.esm.js.map +1 -1
- package/dist/components/ReviewPage/ReviewPage.esm.js +53 -18
- package/dist/components/ReviewPage/ReviewPage.esm.js.map +1 -1
- package/dist/components/RightContent/ArticlesRightContent.esm.js +2 -2
- package/dist/components/RightContent/ArticlesRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/DefaultRightContent.esm.js +2 -2
- package/dist/components/RightContent/DefaultRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/EntityRightContent.esm.js +2 -2
- package/dist/components/RightContent/EntityRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/LinkedPosts.esm.js +5 -19
- package/dist/components/RightContent/LinkedPosts.esm.js.map +1 -1
- package/dist/components/RightContent/LinkedPosts.module.css.esm.js +8 -0
- package/dist/components/RightContent/LinkedPosts.module.css.esm.js.map +1 -0
- package/dist/components/RightContent/LinksRightContent.esm.js +2 -2
- package/dist/components/RightContent/LinksRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/PostRightContent.esm.js +4 -4
- package/dist/components/RightContent/PostRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/QuestionsRightContent.esm.js +2 -2
- package/dist/components/RightContent/QuestionsRightContent.esm.js.map +1 -1
- package/dist/components/RightContent/RightContent.esm.js +46 -61
- package/dist/components/RightContent/RightContent.esm.js.map +1 -1
- package/dist/components/RightContent/RightContent.module.css.esm.js +8 -0
- package/dist/components/RightContent/RightContent.module.css.esm.js.map +1 -0
- package/dist/components/RightContent/SimilarQuestions.esm.js +3 -16
- package/dist/components/RightContent/SimilarQuestions.esm.js.map +1 -1
- package/dist/components/RightContent/SimilarQuestions.module.css.esm.js +8 -0
- package/dist/components/RightContent/SimilarQuestions.module.css.esm.js.map +1 -0
- package/dist/components/RightContent/TagRightContent.esm.js +2 -2
- package/dist/components/RightContent/TagRightContent.esm.js.map +1 -1
- package/dist/components/SettingsPage/SettingsPage.esm.js +198 -200
- package/dist/components/SettingsPage/SettingsPage.esm.js.map +1 -1
- package/dist/components/SettingsPage/SettingsPage.module.css.esm.js +8 -0
- package/dist/components/SettingsPage/SettingsPage.module.css.esm.js.map +1 -0
- package/dist/components/Statistics/GlobalStatsContent.esm.js +5 -5
- package/dist/components/Statistics/GlobalStatsContent.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.esm.js +21 -20
- package/dist/components/Statistics/StatisticsPage.esm.js.map +1 -1
- package/dist/components/Statistics/StatisticsPage.module.css.esm.js +8 -0
- package/dist/components/Statistics/StatisticsPage.module.css.esm.js.map +1 -0
- package/dist/components/TagPage/TagPage.esm.js +58 -87
- package/dist/components/TagPage/TagPage.esm.js.map +1 -1
- package/dist/components/TechDocsAskQuestionAddon/TechDocsAskQuestionAddon.esm.js +23 -32
- package/dist/components/TechDocsAskQuestionAddon/TechDocsAskQuestionAddon.esm.js.map +1 -1
- package/dist/components/TechDocsAskQuestionAddon/TechDocsAskQuestionAddon.module.css.esm.js +8 -0
- package/dist/components/TechDocsAskQuestionAddon/TechDocsAskQuestionAddon.module.css.esm.js.map +1 -0
- package/dist/components/UserPage/UserPage.esm.js +158 -234
- package/dist/components/UserPage/UserPage.esm.js.map +1 -1
- package/dist/components/UserPage/UserPage.module.css.esm.js +8 -0
- package/dist/components/UserPage/UserPage.module.css.esm.js.map +1 -0
- package/dist/components/UserPage/UserStatsContent.esm.js +5 -5
- package/dist/components/UserPage/UserStatsContent.esm.js.map +1 -1
- package/dist/components/UsersPage/UsersPage.esm.js +3 -9
- package/dist/components/UsersPage/UsersPage.esm.js.map +1 -1
- package/dist/components/WritePage/WritePage.esm.js +9 -6
- package/dist/components/WritePage/WritePage.esm.js.map +1 -1
- package/dist/index.d.ts +283 -77
- package/dist/index.esm.js +262 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/{package.json.esm.js → plugins/qeta/package.json.esm.js} +8 -13
- package/dist/{package.json.esm.js.map → plugins/qeta/package.json.esm.js.map} +1 -1
- package/package.json +9 -18
- package/dist/alpha.d.ts +0 -255
- package/dist/alpha.esm.js +0 -238
- package/dist/alpha.esm.js.map +0 -1
- package/dist/components/EntityCards/EntityPostsContainerCard.esm.js +0 -13
- package/dist/components/EntityCards/EntityPostsContainerCard.esm.js.map +0 -1
- package/dist/components/EntityCards/EntityPostsGridCard.esm.js +0 -20
- package/dist/components/EntityCards/EntityPostsGridCard.esm.js.map +0 -1
- package/dist/components/ReviewPage/index.esm.js +0 -6
- package/dist/components/ReviewPage/index.esm.js.map +0 -1
- package/dist/plugin.esm.js +0 -84
- package/dist/plugin.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WritePage.esm.js","sources":["../../../src/components/WritePage/WritePage.tsx"],"sourcesContent":["import { useParams, useSearchParams } from 'react-router-dom';\nimport { filterTags } from '@drodil/backstage-plugin-qeta-common';\nimport {\n
|
|
1
|
+
{"version":3,"file":"WritePage.esm.js","sources":["../../../src/components/WritePage/WritePage.tsx"],"sourcesContent":["import { useParams, useSearchParams } from 'react-router-dom';\nimport { filterTags } from '@drodil/backstage-plugin-qeta-common';\nimport {\n PostForm,\n qetaTranslationRef,\n useQetaConfig,\n} from '@drodil/backstage-plugin-qeta-react';\nimport { useEntityPresentation } from '@backstage/plugin-catalog-react';\nimport { Box, Header } from '@backstage/ui';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport const WritePage = () => {\n const { id } = useParams();\n const [searchParams] = useSearchParams();\n const entity = searchParams.get('entity') ?? undefined;\n const entityPage = searchParams.get('entityPage') === 'true';\n const tags = filterTags(searchParams.get('tags'));\n const { t } = useTranslationRef(qetaTranslationRef);\n const { disabled } = useQetaConfig();\n\n if (disabled.articles) {\n return null;\n }\n\n let title;\n if (id) {\n title = t('writePage.title.existingArticle');\n } else if (entity) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const representation = useEntityPresentation(entity);\n title = t('writePage.title.entityArticle', {\n entity: representation.primaryTitle,\n });\n } else {\n title = t('writePage.title.newArticle');\n }\n\n return (\n <>\n <Header title={title} />\n <Box>\n <PostForm\n id={id}\n entity={entity}\n entityPage={entityPage}\n tags={tags}\n type=\"article\"\n />\n </Box>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAWO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,EAAE,EAAA,EAAG,GAAI,SAAA,EAAU;AACzB,EAAA,MAAM,CAAC,YAAY,CAAA,GAAI,eAAA,EAAgB;AACvC,EAAA,MAAM,MAAA,GAAS,YAAA,CAAa,GAAA,CAAI,QAAQ,CAAA,IAAK,MAAA;AAC7C,EAAA,MAAM,UAAA,GAAa,YAAA,CAAa,GAAA,CAAI,YAAY,CAAA,KAAM,MAAA;AACtD,EAAA,MAAM,IAAA,GAAO,UAAA,CAAW,YAAA,CAAa,GAAA,CAAI,MAAM,CAAC,CAAA;AAChD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,kBAAkB,CAAA;AAClD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAI,aAAA,EAAc;AAEnC,EAAA,IAAI,SAAS,QAAA,EAAU;AACrB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI,EAAA,EAAI;AACN,IAAA,KAAA,GAAQ,EAAE,iCAAiC,CAAA;AAAA,EAC7C,WAAW,MAAA,EAAQ;AAEjB,IAAA,MAAM,cAAA,GAAiB,sBAAsB,MAAM,CAAA;AACnD,IAAA,KAAA,GAAQ,EAAE,+BAAA,EAAiC;AAAA,MACzC,QAAQ,cAAA,CAAe;AAAA,KACxB,CAAA;AAAA,EACH,CAAA,MAAO;AACL,IAAA,KAAA,GAAQ,EAAE,4BAA4B,CAAA;AAAA,EACxC;AAEA,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAO,KAAA,EAAc,CAAA;AAAA,wBACrB,GAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,MAAA;AAAA,QACA,UAAA;AAAA,QACA,IAAA;AAAA,QACA,IAAA,EAAK;AAAA;AAAA,KACP,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,82 +1,288 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { PluggableList } from 'unified';
|
|
1
|
+
import * as _backstage_plugin_search_react_alpha from '@backstage/plugin-search-react/alpha';
|
|
2
|
+
import * as _backstage_plugin_home_react_alpha from '@backstage/plugin-home-react/alpha';
|
|
3
|
+
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
5
4
|
import * as react from 'react';
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
5
|
+
import * as _backstage_filter_predicates from '@backstage/filter-predicates';
|
|
6
|
+
import * as _backstage_plugin_techdocs_react from '@backstage/plugin-techdocs-react';
|
|
7
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
8
|
+
import { Entity } from '@backstage/catalog-model';
|
|
9
|
+
import { Pluggable } from 'unified';
|
|
10
|
+
export { QetaMarkdownRehypePluginBlueprint, QetaMarkdownRemarkPluginBlueprint, QetaPageIntroElementBlueprint, qetaTranslationRef } from '@drodil/backstage-plugin-qeta-react';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
rowsPerPage?: number;
|
|
37
|
-
quickFilter?: string;
|
|
38
|
-
}>) => react_jsx_runtime.JSX.Element;
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Use PostsTableCard instead
|
|
41
|
-
*/
|
|
42
|
-
declare const QuestionsTableCard: (props: _backstage_plugin_home_react.CardExtensionProps<{
|
|
43
|
-
postType?: PostType;
|
|
44
|
-
rowsPerPage?: number;
|
|
45
|
-
quickFilter?: string;
|
|
46
|
-
}>) => react_jsx_runtime.JSX.Element;
|
|
12
|
+
interface QetaMarkdownPluginsApi {
|
|
13
|
+
getRehypePlugins(): Pluggable[];
|
|
14
|
+
getRemarkPlugins(): Pluggable[];
|
|
15
|
+
}
|
|
16
|
+
declare const qetaMarkdownPluginsApiRef: _backstage_frontend_plugin_api.ApiRef<QetaMarkdownPluginsApi>;
|
|
17
|
+
declare const qetaMarkdownPluginsApiExtension: _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
18
|
+
config: {};
|
|
19
|
+
configInput: {};
|
|
20
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
21
|
+
inputs: {
|
|
22
|
+
rehypePlugins: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<Pluggable, "qeta.markdown-plugin", {}>, {
|
|
23
|
+
singleton: false;
|
|
24
|
+
optional: false;
|
|
25
|
+
internal: false;
|
|
26
|
+
}>;
|
|
27
|
+
remarkPlugins: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<Pluggable, "qeta.markdown-plugin", {}>, {
|
|
28
|
+
singleton: false;
|
|
29
|
+
optional: false;
|
|
30
|
+
internal: false;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
kind: "api";
|
|
34
|
+
name: "addons";
|
|
35
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
36
|
+
}>;
|
|
47
37
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
38
|
+
* Backstage frontend plugin.
|
|
51
39
|
*/
|
|
52
|
-
declare const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
40
|
+
declare const qetaPlugin: _backstage_frontend_plugin_api.OverridableFrontendPlugin<{
|
|
41
|
+
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
42
|
+
}, {}, {
|
|
43
|
+
"addon:qeta/ask-question": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
44
|
+
kind: "addon";
|
|
45
|
+
name: "ask-question";
|
|
46
|
+
config: {};
|
|
47
|
+
configInput: {};
|
|
48
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_techdocs_react.TechDocsAddonOptions, "techdocs.addon", {}>;
|
|
49
|
+
inputs: {};
|
|
50
|
+
params: _backstage_plugin_techdocs_react.TechDocsAddonOptions;
|
|
51
|
+
}>;
|
|
52
|
+
"api:qeta": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
53
|
+
kind: "api";
|
|
54
|
+
name: undefined;
|
|
55
|
+
config: {};
|
|
56
|
+
configInput: {};
|
|
57
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
58
|
+
inputs: {};
|
|
59
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
60
|
+
}>;
|
|
61
|
+
"api:qeta/addons": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
62
|
+
config: {};
|
|
63
|
+
configInput: {};
|
|
64
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
65
|
+
inputs: {
|
|
66
|
+
rehypePlugins: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<Pluggable, "qeta.markdown-plugin", {}>, {
|
|
67
|
+
singleton: false;
|
|
68
|
+
optional: false;
|
|
69
|
+
internal: false;
|
|
70
|
+
}>;
|
|
71
|
+
remarkPlugins: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<Pluggable, "qeta.markdown-plugin", {}>, {
|
|
72
|
+
singleton: false;
|
|
73
|
+
optional: false;
|
|
74
|
+
internal: false;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
kind: "api";
|
|
78
|
+
name: "addons";
|
|
79
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
80
|
+
}>;
|
|
81
|
+
"entity-content:qeta/entity-posts-content": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
82
|
+
config: {
|
|
83
|
+
showFilters: boolean | undefined;
|
|
84
|
+
showTitle: boolean | undefined;
|
|
85
|
+
showAskButton: boolean | undefined;
|
|
86
|
+
showWriteButton: boolean | undefined;
|
|
87
|
+
showLinkButton: boolean | undefined;
|
|
88
|
+
showNoQuestionsBtn: boolean | undefined;
|
|
89
|
+
initialPageSize: number | undefined;
|
|
90
|
+
type: "question" | "article" | "link" | undefined;
|
|
91
|
+
view: "grid" | "list" | undefined;
|
|
92
|
+
relations: string[] | undefined;
|
|
93
|
+
path: string | undefined;
|
|
94
|
+
title: string | undefined;
|
|
95
|
+
filter: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
96
|
+
group: string | false | undefined;
|
|
97
|
+
icon: string | undefined;
|
|
98
|
+
};
|
|
99
|
+
configInput: {
|
|
100
|
+
showFilters?: boolean | undefined;
|
|
101
|
+
showTitle?: boolean | undefined;
|
|
102
|
+
showAskButton?: boolean | undefined;
|
|
103
|
+
showWriteButton?: boolean | undefined;
|
|
104
|
+
showLinkButton?: boolean | undefined;
|
|
105
|
+
showNoQuestionsBtn?: boolean | undefined;
|
|
106
|
+
initialPageSize?: number | undefined;
|
|
107
|
+
type?: "question" | "article" | "link" | undefined;
|
|
108
|
+
view?: "grid" | "list" | undefined;
|
|
109
|
+
relations?: string[] | undefined;
|
|
110
|
+
path?: string | undefined | undefined;
|
|
111
|
+
title?: string | undefined | undefined;
|
|
112
|
+
filter?: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
113
|
+
group?: string | false | undefined | undefined;
|
|
114
|
+
icon?: string | undefined | undefined;
|
|
115
|
+
};
|
|
116
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
117
|
+
optional: true;
|
|
118
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {
|
|
119
|
+
optional: true;
|
|
120
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
121
|
+
optional: true;
|
|
122
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "catalog.entity-content-group", {
|
|
123
|
+
optional: true;
|
|
124
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string | react.ReactElement<any, string | react.JSXElementConstructor<any>>, "catalog.entity-content-icon", {
|
|
125
|
+
optional: true;
|
|
126
|
+
}>;
|
|
127
|
+
inputs: {};
|
|
128
|
+
kind: "entity-content";
|
|
129
|
+
name: "entity-posts-content";
|
|
130
|
+
params: {
|
|
131
|
+
defaultPath?: [Error: `Use the 'path' param instead`];
|
|
132
|
+
path: string;
|
|
133
|
+
defaultTitle?: [Error: `Use the 'title' param instead`];
|
|
134
|
+
title: string;
|
|
135
|
+
defaultGroup?: [Error: `Use the 'group' param instead`];
|
|
136
|
+
group?: ("overview" | "documentation" | "development" | "deployment" | "operation" | "observability") | (string & {});
|
|
137
|
+
icon?: string | react.ReactElement;
|
|
138
|
+
loader: () => Promise<JSX.Element>;
|
|
139
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
140
|
+
filter?: string | _backstage_filter_predicates.FilterPredicate | ((entity: Entity) => boolean);
|
|
141
|
+
};
|
|
142
|
+
}>;
|
|
143
|
+
"entity-context-menu-item:qeta/ask-question-context-menu": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
144
|
+
kind: "entity-context-menu-item";
|
|
145
|
+
name: "ask-question-context-menu";
|
|
146
|
+
config: {
|
|
147
|
+
filter: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
148
|
+
};
|
|
149
|
+
configInput: {
|
|
150
|
+
filter?: _backstage_filter_predicates.FilterPredicate | undefined;
|
|
151
|
+
};
|
|
152
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {
|
|
153
|
+
optional: true;
|
|
154
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_catalog_react_alpha.EntityContextMenuItemData, "catalog.entity-context-menu-item-data", {}>;
|
|
155
|
+
inputs: {};
|
|
156
|
+
params: _backstage_plugin_catalog_react_alpha.EntityContextMenuItemParams;
|
|
157
|
+
}>;
|
|
158
|
+
"home-page-widget:qeta/home-posts-table": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
159
|
+
kind: "home-page-widget";
|
|
160
|
+
name: "home-posts-table";
|
|
161
|
+
config: {};
|
|
162
|
+
configInput: {};
|
|
163
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_home_react_alpha.HomePageWidgetData, "home.widget.data", {}>;
|
|
164
|
+
inputs: {};
|
|
165
|
+
params: _backstage_plugin_home_react_alpha.HomePageWidgetBlueprintParams;
|
|
166
|
+
}>;
|
|
167
|
+
"home-page-widget:qeta/home-posts-timeline": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
168
|
+
kind: "home-page-widget";
|
|
169
|
+
name: "home-posts-timeline";
|
|
170
|
+
config: {};
|
|
171
|
+
configInput: {};
|
|
172
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_plugin_home_react_alpha.HomePageWidgetData, "home.widget.data", {}>;
|
|
173
|
+
inputs: {};
|
|
174
|
+
params: _backstage_plugin_home_react_alpha.HomePageWidgetBlueprintParams;
|
|
175
|
+
}>;
|
|
176
|
+
"page:qeta": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
177
|
+
config: {
|
|
178
|
+
themeId: string | undefined;
|
|
179
|
+
path: string | undefined;
|
|
180
|
+
title: string | undefined;
|
|
181
|
+
};
|
|
182
|
+
configInput: {
|
|
183
|
+
themeId?: string | undefined;
|
|
184
|
+
path?: string | undefined | undefined;
|
|
185
|
+
title?: string | undefined | undefined;
|
|
186
|
+
};
|
|
187
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
188
|
+
optional: true;
|
|
189
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
|
|
190
|
+
optional: true;
|
|
191
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
192
|
+
optional: true;
|
|
193
|
+
}>;
|
|
194
|
+
inputs: {
|
|
195
|
+
pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
196
|
+
optional: true;
|
|
197
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
|
|
198
|
+
optional: true;
|
|
199
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
200
|
+
optional: true;
|
|
201
|
+
}>, {
|
|
202
|
+
singleton: false;
|
|
203
|
+
optional: false;
|
|
204
|
+
internal: false;
|
|
205
|
+
}>;
|
|
206
|
+
introElement: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>, {
|
|
207
|
+
singleton: true;
|
|
208
|
+
optional: true;
|
|
209
|
+
internal: false;
|
|
210
|
+
}>;
|
|
211
|
+
};
|
|
212
|
+
kind: "page";
|
|
213
|
+
name: undefined;
|
|
214
|
+
params: {
|
|
215
|
+
path: string;
|
|
216
|
+
title?: string;
|
|
217
|
+
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
218
|
+
loader?: () => Promise<react.JSX.Element>;
|
|
219
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
220
|
+
noHeader?: boolean;
|
|
221
|
+
};
|
|
222
|
+
}>;
|
|
223
|
+
"plugin-header-action:qeta/ask-question": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
224
|
+
kind: "plugin-header-action";
|
|
225
|
+
name: "ask-question";
|
|
226
|
+
config: {};
|
|
227
|
+
configInput: {};
|
|
228
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
|
|
229
|
+
inputs: {};
|
|
230
|
+
params: {
|
|
231
|
+
loader: () => Promise<JSX.Element>;
|
|
232
|
+
};
|
|
233
|
+
}>;
|
|
234
|
+
"plugin-header-action:qeta/create-link": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
235
|
+
kind: "plugin-header-action";
|
|
236
|
+
name: "create-link";
|
|
237
|
+
config: {};
|
|
238
|
+
configInput: {};
|
|
239
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
|
|
240
|
+
inputs: {};
|
|
241
|
+
params: {
|
|
242
|
+
loader: () => Promise<JSX.Element>;
|
|
243
|
+
};
|
|
244
|
+
}>;
|
|
245
|
+
"plugin-header-action:qeta/write-article": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
246
|
+
kind: "plugin-header-action";
|
|
247
|
+
name: "write-article";
|
|
248
|
+
config: {};
|
|
249
|
+
configInput: {};
|
|
250
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
|
|
251
|
+
inputs: {};
|
|
252
|
+
params: {
|
|
253
|
+
loader: () => Promise<JSX.Element>;
|
|
254
|
+
};
|
|
255
|
+
}>;
|
|
256
|
+
"search-filter-result-type:qeta/qeta": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
257
|
+
kind: "search-filter-result-type";
|
|
258
|
+
name: "qeta";
|
|
259
|
+
config: {};
|
|
260
|
+
configInput: {};
|
|
261
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
262
|
+
value: string;
|
|
263
|
+
name: string;
|
|
264
|
+
icon: react.JSX.Element;
|
|
265
|
+
}, "search.filters.result-types.type", {}>;
|
|
266
|
+
inputs: {};
|
|
267
|
+
params: _backstage_plugin_search_react_alpha.SearchFilterResultTypeBlueprintParams;
|
|
268
|
+
}>;
|
|
269
|
+
"search-result-list-item:qeta": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
270
|
+
kind: "search-result-list-item";
|
|
271
|
+
name: undefined;
|
|
272
|
+
config: {
|
|
273
|
+
noTrack: boolean;
|
|
274
|
+
};
|
|
275
|
+
configInput: {
|
|
276
|
+
noTrack?: boolean | undefined;
|
|
277
|
+
};
|
|
278
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
279
|
+
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate;
|
|
280
|
+
component: _backstage_plugin_search_react_alpha.SearchResultItemExtensionComponent;
|
|
281
|
+
icon?: react.JSX.Element;
|
|
282
|
+
}, "search.search-result-list-item.item", {}>;
|
|
283
|
+
inputs: {};
|
|
284
|
+
params: _backstage_plugin_search_react_alpha.SearchResultListItemBlueprintParams;
|
|
285
|
+
}>;
|
|
286
|
+
}>;
|
|
81
287
|
|
|
82
|
-
export {
|
|
288
|
+
export { qetaPlugin as default, qetaMarkdownPluginsApiExtension, qetaMarkdownPluginsApiRef };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,263 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ApiBlueprint, createExtensionInput, PageBlueprint, coreExtensionData, PluginHeaderActionBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { compatWrapper, convertLegacyRouteRef, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
4
|
+
import { markdownPlugin, qetaApiRef, qetaRouteRef, askRouteRef } from '@drodil/backstage-plugin-qeta-react';
|
|
5
|
+
export { QetaMarkdownRehypePluginBlueprint, QetaMarkdownRemarkPluginBlueprint, QetaPageIntroElementBlueprint, qetaTranslationRef } from '@drodil/backstage-plugin-qeta-react';
|
|
6
|
+
import { createApiRef, fetchApiRef, discoveryApiRef, configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';
|
|
7
|
+
import { QetaClient, getSupportedEntityKinds } from '@drodil/backstage-plugin-qeta-common';
|
|
8
|
+
import { RiQuestionAnswerLine } from '@remixicon/react';
|
|
9
|
+
import { EntityContentBlueprint, EntityContextMenuItemBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
10
|
+
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
11
|
+
import { SearchResultListItemBlueprint, SearchFilterResultTypeBlueprint } from '@backstage/plugin-search-react/alpha';
|
|
12
|
+
import { TechDocsAddonLocations } from '@backstage/plugin-techdocs-react';
|
|
13
|
+
import { AddonBlueprint } from '@backstage/plugin-techdocs-react/alpha';
|
|
14
|
+
import { TechDocsAskQuestionAddon } from './components/TechDocsAskQuestionAddon/TechDocsAskQuestionAddon.esm.js';
|
|
15
|
+
import { HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';
|
|
16
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
|
|
19
|
+
const qetaMarkdownPluginsApiRef = createApiRef({
|
|
20
|
+
id: "plugin.qeta.addons"
|
|
21
|
+
});
|
|
22
|
+
const qetaMarkdownPluginsApiExtension = ApiBlueprint.makeWithOverrides({
|
|
23
|
+
name: "addons",
|
|
24
|
+
inputs: {
|
|
25
|
+
rehypePlugins: createExtensionInput([markdownPlugin]),
|
|
26
|
+
remarkPlugins: createExtensionInput([markdownPlugin])
|
|
27
|
+
},
|
|
28
|
+
factory(originalFactory, { inputs }) {
|
|
29
|
+
const rehypePlugins = inputs.rehypePlugins.map(
|
|
30
|
+
(output) => output.get(markdownPlugin)
|
|
31
|
+
);
|
|
32
|
+
const remarkPlugins = inputs.remarkPlugins.map(
|
|
33
|
+
(output) => output.get(markdownPlugin)
|
|
34
|
+
);
|
|
35
|
+
return originalFactory(
|
|
36
|
+
(defineParams) => defineParams({
|
|
37
|
+
api: qetaMarkdownPluginsApiRef,
|
|
38
|
+
deps: {},
|
|
39
|
+
factory: () => ({
|
|
40
|
+
getRehypePlugins: () => rehypePlugins,
|
|
41
|
+
getRemarkPlugins: () => remarkPlugins
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const qetaApi = ApiBlueprint.make({
|
|
48
|
+
params: (defineParams) => defineParams({
|
|
49
|
+
api: qetaApiRef,
|
|
50
|
+
deps: {
|
|
51
|
+
discoveryApi: discoveryApiRef,
|
|
52
|
+
fetchApi: fetchApiRef
|
|
53
|
+
},
|
|
54
|
+
factory({ discoveryApi, fetchApi }) {
|
|
55
|
+
return new QetaClient({ discoveryApi, fetchApi });
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
const qetaPage = PageBlueprint.makeWithOverrides({
|
|
60
|
+
configSchema: {
|
|
61
|
+
themeId: z.string().optional()
|
|
62
|
+
},
|
|
63
|
+
inputs: {
|
|
64
|
+
introElement: createExtensionInput([coreExtensionData.reactElement], {
|
|
65
|
+
singleton: true,
|
|
66
|
+
optional: true
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
factory: (originalFactory, { config, inputs, apis }) => {
|
|
70
|
+
const introElement = inputs.introElement?.get(
|
|
71
|
+
coreExtensionData.reactElement
|
|
72
|
+
);
|
|
73
|
+
const pluginsApi = apis.get(qetaMarkdownPluginsApiRef);
|
|
74
|
+
const remarkPlugins = pluginsApi?.getRemarkPlugins();
|
|
75
|
+
const rehypePlugins = pluginsApi?.getRehypePlugins();
|
|
76
|
+
return originalFactory({
|
|
77
|
+
path: config.path ?? "/qeta",
|
|
78
|
+
title: config.title ?? "Q&A",
|
|
79
|
+
icon: /* @__PURE__ */ jsx(RiQuestionAnswerLine, {}),
|
|
80
|
+
routeRef: convertLegacyRouteRef(qetaRouteRef),
|
|
81
|
+
loader: () => import('./components/QetaPage/index.esm.js').then(
|
|
82
|
+
(m) => compatWrapper(
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
m.QetaPage,
|
|
85
|
+
{
|
|
86
|
+
themeId: config.themeId,
|
|
87
|
+
introElement,
|
|
88
|
+
remarkPlugins,
|
|
89
|
+
rehypePlugins
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
)
|
|
93
|
+
)
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const EntityPostsContent = EntityContentBlueprint.makeWithOverrides({
|
|
98
|
+
name: "entity-posts-content",
|
|
99
|
+
configSchema: {
|
|
100
|
+
showFilters: z.boolean().optional(),
|
|
101
|
+
showTitle: z.boolean().optional(),
|
|
102
|
+
showAskButton: z.boolean().optional(),
|
|
103
|
+
showWriteButton: z.boolean().optional(),
|
|
104
|
+
showLinkButton: z.boolean().optional(),
|
|
105
|
+
showNoQuestionsBtn: z.boolean().optional(),
|
|
106
|
+
initialPageSize: z.number().optional(),
|
|
107
|
+
type: z.enum(["question", "article", "link"]).optional(),
|
|
108
|
+
view: z.enum(["list", "grid"]).optional(),
|
|
109
|
+
relations: z.array(z.string()).optional()
|
|
110
|
+
},
|
|
111
|
+
inputs: {},
|
|
112
|
+
factory: (originalFactory, { config, apis }) => {
|
|
113
|
+
return originalFactory({
|
|
114
|
+
path: config.path ?? "/qeta",
|
|
115
|
+
title: config.title ?? "Q&A",
|
|
116
|
+
filter: (entity) => {
|
|
117
|
+
const configApi = apis.get(configApiRef);
|
|
118
|
+
const supportedKinds = getSupportedEntityKinds(configApi);
|
|
119
|
+
const entityKind = entity.kind.toLowerCase();
|
|
120
|
+
return supportedKinds?.includes(entityKind);
|
|
121
|
+
},
|
|
122
|
+
loader: async () => {
|
|
123
|
+
const pluginsApi = apis.get(qetaMarkdownPluginsApiRef);
|
|
124
|
+
const remarkPlugins = pluginsApi?.getRemarkPlugins();
|
|
125
|
+
const rehypePlugins = pluginsApi?.getRehypePlugins();
|
|
126
|
+
return import('./components/EntityPostsContent/EntityPostsContent.esm.js').then(
|
|
127
|
+
(m) => compatWrapper(
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
m.EntityPostsContent,
|
|
130
|
+
{
|
|
131
|
+
...config,
|
|
132
|
+
remarkPlugins,
|
|
133
|
+
rehypePlugins
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const qetaSearchResultItem = SearchResultListItemBlueprint.make({
|
|
143
|
+
params: {
|
|
144
|
+
predicate: (result) => result.type === "qeta",
|
|
145
|
+
component: () => import('./components/QetaSearchResultListItem/index.esm.js').then(
|
|
146
|
+
(m) => m.QetaSearchResultListItem
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
const qetaPostSearchFilterType = SearchFilterResultTypeBlueprint.make({
|
|
151
|
+
name: "qeta",
|
|
152
|
+
params: {
|
|
153
|
+
value: "qeta",
|
|
154
|
+
name: "Q&A",
|
|
155
|
+
icon: /* @__PURE__ */ jsx(RiQuestionAnswerLine, {})
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const techDocsAskQuestionAddon = AddonBlueprint.make({
|
|
159
|
+
name: "ask-question",
|
|
160
|
+
params: {
|
|
161
|
+
name: "AskQuestion",
|
|
162
|
+
location: TechDocsAddonLocations.Content,
|
|
163
|
+
component: TechDocsAskQuestionAddon
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const homePageTable = HomePageWidgetBlueprint.make({
|
|
167
|
+
name: "home-posts-table",
|
|
168
|
+
params: {
|
|
169
|
+
title: "Q&A posts",
|
|
170
|
+
description: "Shows latest Q&A posts",
|
|
171
|
+
components: () => import('./components/PostsTableCard/index.esm.js').then((m) => ({
|
|
172
|
+
Content: m.Content
|
|
173
|
+
})),
|
|
174
|
+
settings: {
|
|
175
|
+
schema: {
|
|
176
|
+
title: "Post settings",
|
|
177
|
+
type: "object",
|
|
178
|
+
properties: {
|
|
179
|
+
rowsPerPage: {
|
|
180
|
+
title: "Rows per page",
|
|
181
|
+
type: "number"
|
|
182
|
+
},
|
|
183
|
+
postType: {
|
|
184
|
+
title: "Post type",
|
|
185
|
+
type: "string",
|
|
186
|
+
enum: ["all", "question", "article", "link"]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
const homeTimeline = HomePageWidgetBlueprint.make({
|
|
194
|
+
name: "home-posts-timeline",
|
|
195
|
+
params: {
|
|
196
|
+
title: "Q&A timeline",
|
|
197
|
+
description: "Shows Q&A latest events",
|
|
198
|
+
components: () => import('./components/HomeTimeline/index.esm.js').then((m) => ({
|
|
199
|
+
Content: m.HomeTimeline
|
|
200
|
+
}))
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
const askQuestionAction = PluginHeaderActionBlueprint.make({
|
|
204
|
+
name: "ask-question",
|
|
205
|
+
params: {
|
|
206
|
+
loader: () => import('@drodil/backstage-plugin-qeta-react').then((m) => /* @__PURE__ */ jsx(m.AskQuestionButton, { compact: true }))
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
const writeArticleAction = PluginHeaderActionBlueprint.make({
|
|
210
|
+
name: "write-article",
|
|
211
|
+
params: {
|
|
212
|
+
loader: () => import('@drodil/backstage-plugin-qeta-react').then((m) => /* @__PURE__ */ jsx(m.WriteArticleButton, { compact: true }))
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
const createLinkAction = PluginHeaderActionBlueprint.make({
|
|
216
|
+
name: "create-link",
|
|
217
|
+
params: {
|
|
218
|
+
loader: () => import('@drodil/backstage-plugin-qeta-react').then((m) => /* @__PURE__ */ jsx(m.CreateLinkButton, { compact: true }))
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
const entityContextMenuItem = EntityContextMenuItemBlueprint.make({
|
|
222
|
+
name: "ask-question-context-menu",
|
|
223
|
+
params: {
|
|
224
|
+
icon: /* @__PURE__ */ jsx(RiQuestionAnswerLine, {}),
|
|
225
|
+
useProps() {
|
|
226
|
+
const { entity } = useEntity();
|
|
227
|
+
const configApi = useApi(configApiRef);
|
|
228
|
+
const supportedKinds = getSupportedEntityKinds(configApi);
|
|
229
|
+
const entityKind = entity.kind.toLowerCase();
|
|
230
|
+
const route = useRouteRef(askRouteRef);
|
|
231
|
+
return {
|
|
232
|
+
title: "Ask a question",
|
|
233
|
+
href: `${route()}/?entity=${stringifyEntityRef(entity)}`,
|
|
234
|
+
disabled: !supportedKinds?.includes(entityKind)
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
const qetaPlugin = createFrontendPlugin({
|
|
240
|
+
pluginId: "qeta",
|
|
241
|
+
info: { packageJson: () => import('./plugins/qeta/package.json.esm.js') },
|
|
242
|
+
routes: convertLegacyRouteRefs({
|
|
243
|
+
root: qetaRouteRef
|
|
244
|
+
}),
|
|
245
|
+
extensions: [
|
|
246
|
+
qetaApi,
|
|
247
|
+
qetaPage,
|
|
248
|
+
EntityPostsContent,
|
|
249
|
+
qetaSearchResultItem,
|
|
250
|
+
qetaPostSearchFilterType,
|
|
251
|
+
techDocsAskQuestionAddon,
|
|
252
|
+
qetaMarkdownPluginsApiExtension,
|
|
253
|
+
homePageTable,
|
|
254
|
+
homeTimeline,
|
|
255
|
+
entityContextMenuItem,
|
|
256
|
+
askQuestionAction,
|
|
257
|
+
writeArticleAction,
|
|
258
|
+
createLinkAction
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
export { qetaPlugin as default, qetaMarkdownPluginsApiExtension, qetaMarkdownPluginsApiRef };
|
|
8
263
|
//# sourceMappingURL=index.esm.js.map
|