@drodil/backstage-plugin-qeta-react 3.51.0 → 3.52.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/dist/components/AIAnswerCard/AIAnswerCard.esm.js +1 -1
- package/dist/components/AnswersContainer/AnswerList.esm.js +13 -34
- package/dist/components/AnswersContainer/AnswerList.esm.js.map +1 -1
- package/dist/components/AnswersContainer/AnswersContainer.esm.js +24 -29
- package/dist/components/AnswersContainer/AnswersContainer.esm.js.map +1 -1
- package/dist/components/Badges/UserBadges.esm.js +1 -1
- package/dist/components/CollectionsGrid/CollectionsGrid.esm.js +21 -19
- package/dist/components/CollectionsGrid/CollectionsGrid.esm.js.map +1 -1
- package/dist/components/CollectionsGrid/CollectionsGridContent.esm.js +26 -6
- package/dist/components/CollectionsGrid/CollectionsGridContent.esm.js.map +1 -1
- package/dist/components/EntitiesGrid/EntitiesGrid.esm.js +20 -17
- package/dist/components/EntitiesGrid/EntitiesGrid.esm.js.map +1 -1
- package/dist/components/EntitiesGrid/EntitiesGridContent.esm.js +24 -4
- package/dist/components/EntitiesGrid/EntitiesGridContent.esm.js.map +1 -1
- package/dist/components/FollowedLists/FollowedEntitiesList.esm.js +1 -1
- package/dist/components/FollowedLists/FollowedTagsList.esm.js +1 -1
- package/dist/components/FollowedLists/FollowedUsersList.esm.js +1 -1
- package/dist/components/HomePageCards/ImpactCard.esm.js +40 -4
- package/dist/components/HomePageCards/ImpactCard.esm.js.map +1 -1
- package/dist/components/HomePageCards/PostsCard.esm.js +1 -1
- package/dist/components/LeftMenu/LeftMenu.esm.js +37 -42
- package/dist/components/LeftMenu/LeftMenu.esm.js.map +1 -1
- package/dist/components/Links/Links.esm.js +1 -1
- package/dist/components/PostHighlightList/PostHighlightList.esm.js +1 -1
- package/dist/components/PostsContainer/PostList.esm.js +15 -30
- package/dist/components/PostsContainer/PostList.esm.js.map +1 -1
- package/dist/components/PostsContainer/PostsContainer.esm.js +8 -12
- package/dist/components/PostsContainer/PostsContainer.esm.js.map +1 -1
- package/dist/components/PostsGrid/PostsGrid.esm.js +8 -12
- package/dist/components/PostsGrid/PostsGrid.esm.js.map +1 -1
- package/dist/components/PostsGrid/PostsGridContent.esm.js +14 -30
- package/dist/components/PostsGrid/PostsGridContent.esm.js.map +1 -1
- package/dist/components/SuggestionsCard/SuggestionsCard.esm.js +35 -5
- package/dist/components/SuggestionsCard/SuggestionsCard.esm.js.map +1 -1
- package/dist/components/TagsAndEntities/EntityChip.esm.js +1 -1
- package/dist/components/TagsAndEntities/TagChip.esm.js +1 -1
- package/dist/components/TagsAndEntities/UserChip.esm.js +1 -1
- package/dist/components/TagsGrid/TagsGrid.esm.js +20 -17
- package/dist/components/TagsGrid/TagsGrid.esm.js.map +1 -1
- package/dist/components/TagsGrid/TagsGridContent.esm.js +40 -12
- package/dist/components/TagsGrid/TagsGridContent.esm.js.map +1 -1
- package/dist/components/TemplateList/TemplateForm.esm.js +1 -1
- package/dist/components/TemplateList/TemplateList.esm.js +1 -1
- package/dist/components/Timeline/Timeline.esm.js +83 -0
- package/dist/components/Timeline/Timeline.esm.js.map +1 -0
- package/dist/components/Timeline/TimelineItem.esm.js +162 -0
- package/dist/components/Timeline/TimelineItem.esm.js.map +1 -0
- package/dist/components/UsersGrid/UsersGrid.esm.js +24 -13
- package/dist/components/UsersGrid/UsersGrid.esm.js.map +1 -1
- package/dist/components/UsersGrid/UsersGridContent.esm.js +24 -4
- package/dist/components/UsersGrid/UsersGridContent.esm.js.map +1 -1
- package/dist/hooks/useCanReview.esm.js +11 -5
- package/dist/hooks/useCanReview.esm.js.map +1 -1
- package/dist/hooks/useGridPageSize.esm.js +55 -0
- package/dist/hooks/useGridPageSize.esm.js.map +1 -0
- package/dist/hooks/usePaginatedPosts.esm.js +22 -5
- package/dist/hooks/usePaginatedPosts.esm.js.map +1 -1
- package/dist/index.d.ts +64 -31
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/translation.esm.js +32 -5
- package/dist/translation.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/components/QetaPagination/QetaPagination.esm.js +0 -69
- package/dist/components/QetaPagination/QetaPagination.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePaginatedPosts.esm.js","sources":["../../src/hooks/usePaginatedPosts.ts"],"sourcesContent":["import { useAnalytics } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport {\n FilterKey,\n filterKeys,\n PostFilters,\n} from '../components/FilterPanel/FilterPanel';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { getFiltersWithDateRange } from '../utils';\nimport { filterTags, PostStatus } from '@drodil/backstage-plugin-qeta-common';\nimport { useQetaApi } from './useQetaApi';\n\nexport type PaginatedPostsProps = PostFilters & {\n author?: string;\n showFilters?: boolean;\n showTitle?: boolean;\n title?: string;\n favorite?: boolean;\n showAskButton?: boolean;\n showWriteButton?: boolean;\n showLinkButton?: boolean;\n showNoQuestionsBtn?: boolean;\n initialPageSize?: number;\n collectionId?: number;\n status?: PostStatus;\n};\n\nexport type PostFilterChange = {\n key: keyof PostFilters;\n value?: PostFilters[keyof PostFilters];\n};\n\nconst EXPANDED_LOCAL_STORAGE_KEY = 'qeta-post-filters-expanded';\n\nexport function usePaginatedPosts(props: PaginatedPostsProps) {\n const {\n type,\n tags,\n author,\n entities,\n entity,\n favorite,\n initialPageSize,\n status,\n } = props;\n const analytics = useAnalytics();\n const [page, setPage] = useState(1);\n const [pageCount, setPageCount] = useState(1);\n const [postsPerPage, setPostsPerPage] = useState(initialPageSize ?? 10);\n const [showFilterPanel, setShowFilterPanel] = useState(\n localStorage.getItem(EXPANDED_LOCAL_STORAGE_KEY) === 'true',\n );\n const [searchParams, setSearchParams] = useSearchParams();\n const [searchQuery, setSearchQuery] = useState('');\n const [filters, setFilters] = useState<PostFilters>({\n order: props.order ?? 'desc',\n orderBy: props.orderBy ?? 'created',\n noAnswers: props.noAnswers ?? 'false',\n noCorrectAnswer: props.noCorrectAnswer ?? 'false',\n noVotes: props.noVotes ?? 'false',\n searchQuery: props.searchQuery ?? '',\n entities: entities ?? (entity ? [entity] : undefined),\n tags: tags,\n dateRange: '',\n collectionId: props.collectionId,\n status,\n type,\n });\n\n useEffect(() => {\n localStorage.setItem(\n EXPANDED_LOCAL_STORAGE_KEY,\n showFilterPanel ? 'true' : 'false',\n );\n }, [showFilterPanel]);\n\n useEffect(() => {\n setFilters(prev => ({\n ...prev,\n tags: tags,\n entities: entities ?? (entity ? [entity] : undefined),\n type,\n status,\n collectionId: props.collectionId,\n }));\n setPage(1);\n }, [tags, entities, entity, type, status, props.collectionId]);\n\n const onPageChange = (value: number) => {\n setPage(value);\n setSearchParams(prev => {\n const newValue = prev;\n newValue.set('page', String(value));\n return newValue;\n });\n };\n\n const loadNextPage = () => {\n setPage(prev => prev + 1);\n };\n\n const onFilterChange = (changes: PostFilterChange | PostFilterChange[]) => {\n const changesArray = Array.isArray(changes) ? changes : [changes];\n setPage(1);\n setFilters(prev => {\n const newValue = { ...prev };\n for (const { key, value } of changesArray) {\n (newValue as any)[key] = value;\n }\n return newValue;\n });\n setSearchParams(prev => {\n const newValue = prev;\n for (const { key, value } of changesArray) {\n if (!filterKeys.includes(key as FilterKey)) {\n continue;\n }\n if (!value || value === 'false') {\n newValue.delete(key);\n } else if (Array.isArray(value)) {\n if (value.length === 0) {\n newValue.delete(key);\n } else {\n newValue.set(key, value.join(','));\n }\n } else if (typeof value === 'number') {\n newValue.set(key, String(value));\n } else if (value.length > 0) {\n newValue.set(key, value);\n } else {\n newValue.delete(key);\n }\n }\n return newValue;\n });\n };\n\n const onSearchQueryChange = (query: string) => {\n onPageChange(1);\n if (query) {\n analytics.captureEvent('qeta_search', query);\n }\n setSearchQuery(query);\n };\n\n useDebounce(\n () => {\n if (filters.searchQuery !== searchQuery) {\n setFilters({ ...filters, searchQuery: searchQuery });\n }\n },\n 400,\n [searchQuery],\n );\n\n useEffect(() => {\n let filtersApplied = false;\n searchParams.forEach((value, key) => {\n try {\n if (key === 'page') {\n const pv = Number.parseInt(value, 10);\n if (pv > 0) {\n setPage(pv);\n } else {\n setPage(1);\n }\n } else if (key === 'postsPerPage') {\n const qpp = Number.parseInt(value, 10);\n if (qpp > 0) setPostsPerPage(qpp);\n } else if (filterKeys.includes(key as FilterKey)) {\n filtersApplied = true;\n if (key === 'tags') {\n filters.tags = filterTags(value.split(',')) ?? [];\n } else if (key === 'entities') {\n filters.entities = value.split(',');\n } else {\n (filters as any)[key] = value;\n }\n }\n } catch (_e) {\n // NOOP\n }\n });\n setFilters(filters);\n if (filtersApplied) {\n setShowFilterPanel(true);\n }\n }, [searchParams, filters]);\n\n const {\n value: response,\n loading,\n error,\n retry,\n } = useQetaApi(\n api => {\n return api.getPosts({\n type,\n limit: postsPerPage,\n offset: (page - 1) * postsPerPage,\n includeEntities: true,\n includeAnswers: false,\n includeComments: false,\n includeAttachments: false,\n includeExperts: false,\n author,\n favorite,\n status,\n ...(getFiltersWithDateRange(filters) as any),\n });\n },\n [type, page, filters, postsPerPage],\n );\n\n useEffect(() => {\n if (response) {\n setPageCount(Math.ceil(response.total / postsPerPage));\n }\n }, [response, postsPerPage]);\n\n const onPageSizeChange = (value: number) => {\n if (response) {\n let newPage = page;\n while (newPage * value > response.total) {\n newPage -= 1;\n }\n onPageChange(Math.max(1, newPage));\n }\n setPostsPerPage(value);\n setSearchParams(prev => {\n const newValue = prev;\n newValue.set('postsPerPage', String(value));\n return newValue;\n });\n };\n\n return {\n page,\n setPage,\n postsPerPage,\n setPostsPerPage,\n showFilterPanel,\n setShowFilterPanel,\n searchParams,\n setSearchParams,\n searchQuery,\n setSearchQuery,\n filters,\n setFilters,\n onPageChange,\n onPageSizeChange,\n onFilterChange,\n onSearchQueryChange,\n response,\n loading,\n error,\n loadNextPage,\n pageCount,\n retry,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAiCA,MAAM,0BAA6B,GA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AA,CAAK,QAAS,CAAA,KAAA,GAAQ,YAAY,CAAC,CAAA;AAAA;AACvD,GACC,EAAA,CAAC,QAAU,EAAA,YAAY,CAAC,CAAA;AAE3B,EAAM,MAAA,gBAAA,GAAmB,CAAC,KAAkB,KAAA;AAC1C,IAAA,IAAI,QAAU,EAAA;AACZ,MAAA,IAAI,OAAU,GAAA,IAAA;AACd,MAAO,OAAA,OAAA,GAAU,KAAQ,GAAA,QAAA,CAAS,KAAO,EAAA;AACvC,QAAW,OAAA,IAAA,CAAA;AAAA;AAEb,MAAA,YAAA,CAAa,IAAK,CAAA,GAAA,CAAI,CAAG,EAAA,OAAO,CAAC,CAAA;AAAA;AAEnC,IAAA,eAAA,CAAgB,KAAK,CAAA;AACrB,IAAA,eAAA,CAAgB,CAAQ,IAAA,KAAA;AACtB,MAAA,MAAM,QAAW,GAAA,IAAA;AACjB,MAAA,QAAA,CAAS,GAAI,CAAA,cAAA,EAAgB,MAAO,CAAA,KAAK,CAAC,CAAA;AAC1C,MAAO,OAAA,QAAA;AAAA,KACR,CAAA;AAAA,GACH;AAEA,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"usePaginatedPosts.esm.js","sources":["../../src/hooks/usePaginatedPosts.ts"],"sourcesContent":["import { useAnalytics } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport {\n FilterKey,\n filterKeys,\n PostFilters,\n} from '../components/FilterPanel/FilterPanel';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { getFiltersWithDateRange } from '../utils';\nimport { filterTags, PostStatus } from '@drodil/backstage-plugin-qeta-common';\nimport { useQetaApi } from './useQetaApi';\n\nexport type PaginatedPostsProps = PostFilters & {\n author?: string;\n showFilters?: boolean;\n showTitle?: boolean;\n title?: string;\n favorite?: boolean;\n showAskButton?: boolean;\n showWriteButton?: boolean;\n showLinkButton?: boolean;\n showNoQuestionsBtn?: boolean;\n initialPageSize?: number;\n collectionId?: number;\n status?: PostStatus;\n};\n\nexport type PostFilterChange = {\n key: keyof PostFilters;\n value?: PostFilters[keyof PostFilters];\n};\n\nconst EXPANDED_LOCAL_STORAGE_KEY = 'qeta-post-filters-expanded';\n\nexport function usePaginatedPosts(props: PaginatedPostsProps) {\n const {\n type,\n tags,\n author,\n entities,\n entity,\n favorite,\n initialPageSize,\n status,\n } = props;\n const analytics = useAnalytics();\n const [page, setPage] = useState(1);\n const pageCount = 1; // No longer using pagination\n const [postsPerPage, setPostsPerPage] = useState(initialPageSize ?? 25);\n const [showFilterPanel, setShowFilterPanel] = useState(\n localStorage.getItem(EXPANDED_LOCAL_STORAGE_KEY) === 'true',\n );\n const [searchParams, setSearchParams] = useSearchParams();\n const [searchQuery, setSearchQuery] = useState('');\n const [filters, setFilters] = useState<PostFilters>({\n order: props.order ?? 'desc',\n orderBy: props.orderBy ?? 'created',\n noAnswers: props.noAnswers ?? 'false',\n noCorrectAnswer: props.noCorrectAnswer ?? 'false',\n noVotes: props.noVotes ?? 'false',\n searchQuery: props.searchQuery ?? '',\n entities: entities ?? (entity ? [entity] : undefined),\n tags: tags,\n dateRange: '',\n collectionId: props.collectionId,\n status,\n type,\n });\n\n const [posts, setPosts] = useState<any[]>([]);\n const [hasMore, setHasMore] = useState(true);\n const [total, setTotal] = useState(0);\n\n useEffect(() => {\n localStorage.setItem(\n EXPANDED_LOCAL_STORAGE_KEY,\n showFilterPanel ? 'true' : 'false',\n );\n }, [showFilterPanel]);\n\n useEffect(() => {\n setFilters(prev => ({\n ...prev,\n tags: tags,\n entities: entities ?? (entity ? [entity] : undefined),\n type,\n status,\n collectionId: props.collectionId,\n }));\n setPage(1);\n setPosts([]);\n }, [tags, entities, entity, type, status, props.collectionId]);\n\n const onPageChange = (value: number) => {\n setPage(value);\n setSearchParams(prev => {\n const newValue = prev;\n newValue.set('page', String(value));\n return newValue;\n });\n };\n\n const loadNextPage = () => {\n setPage(prev => prev + 1);\n };\n\n const onFilterChange = (changes: PostFilterChange | PostFilterChange[]) => {\n const changesArray = Array.isArray(changes) ? changes : [changes];\n setPage(1);\n setPosts([]);\n setFilters(prev => {\n const newValue = { ...prev };\n for (const { key, value } of changesArray) {\n (newValue as any)[key] = value;\n }\n return newValue;\n });\n setSearchParams(prev => {\n const newValue = prev;\n for (const { key, value } of changesArray) {\n if (!filterKeys.includes(key as FilterKey)) {\n continue;\n }\n if (!value || value === 'false') {\n newValue.delete(key);\n } else if (Array.isArray(value)) {\n if (value.length === 0) {\n newValue.delete(key);\n } else {\n newValue.set(key, value.join(','));\n }\n } else if (typeof value === 'number') {\n newValue.set(key, String(value));\n } else if (value.length > 0) {\n newValue.set(key, value);\n } else {\n newValue.delete(key);\n }\n }\n return newValue;\n });\n };\n\n const onSearchQueryChange = (query: string) => {\n onPageChange(1);\n setPosts([]);\n if (query) {\n analytics.captureEvent('qeta_search', query);\n }\n setSearchQuery(query);\n };\n\n useDebounce(\n () => {\n if (filters.searchQuery !== searchQuery) {\n setFilters({ ...filters, searchQuery: searchQuery });\n }\n },\n 400,\n [searchQuery],\n );\n\n useEffect(() => {\n let filtersApplied = false;\n searchParams.forEach((value, key) => {\n try {\n if (key === 'page') {\n const pv = Number.parseInt(value, 10);\n if (pv > 0) {\n setPage(pv);\n } else {\n setPage(1);\n setPosts([]);\n }\n } else if (key === 'postsPerPage') {\n const qpp = Number.parseInt(value, 10);\n if (qpp > 0) setPostsPerPage(qpp);\n } else if (filterKeys.includes(key as FilterKey)) {\n filtersApplied = true;\n if (key === 'tags') {\n filters.tags = filterTags(value.split(',')) ?? [];\n } else if (key === 'entities') {\n filters.entities = value.split(',');\n } else {\n (filters as any)[key] = value;\n }\n }\n } catch (_e) {\n // NOOP\n }\n });\n setFilters(filters);\n if (filtersApplied) {\n setShowFilterPanel(true);\n }\n }, [searchParams, filters]);\n\n const {\n value: response,\n loading,\n error,\n retry,\n } = useQetaApi(\n api => {\n return api.getPosts({\n type,\n limit: postsPerPage,\n offset: (page - 1) * postsPerPage,\n includeEntities: true,\n includeAnswers: false,\n includeComments: false,\n includeAttachments: false,\n includeExperts: false,\n author,\n favorite,\n status,\n ...(getFiltersWithDateRange(filters) as any),\n });\n },\n [type, page, filters, postsPerPage],\n );\n\n useEffect(() => {\n if (response) {\n if (page === 1) {\n setPosts(response.posts);\n } else {\n setPosts(prev => [...prev, ...response.posts]);\n }\n setHasMore(response.posts.length >= postsPerPage);\n setTotal(response.total);\n }\n }, [response, page, postsPerPage]);\n\n const onPageSizeChange = (value: number) => {\n if (response) {\n let newPage = page;\n while (newPage * value > response.total) {\n newPage -= 1;\n }\n onPageChange(Math.max(1, newPage));\n }\n setPostsPerPage(value);\n setSearchParams(prev => {\n const newValue = prev;\n newValue.set('postsPerPage', String(value));\n return newValue;\n });\n };\n\n return {\n page,\n setPage,\n postsPerPage,\n setPostsPerPage,\n showFilterPanel,\n setShowFilterPanel,\n searchParams,\n setSearchParams,\n searchQuery,\n setSearchQuery,\n filters,\n setFilters,\n onPageChange,\n onPageSizeChange,\n onFilterChange,\n onSearchQueryChange,\n response,\n posts,\n hasMore,\n total,\n loading,\n error,\n loadNextPage,\n pageCount,\n retry,\n fetchNextPage: loadNextPage,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAiCA,MAAM,0BAA6B,GAAA,4BAAA;AAE5B,SAAS,kBAAkB,KAA4B,EAAA;AAC5D,EAAM,MAAA;AAA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A,eAAA;AAAA,IACA,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,cAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAe,EAAA;AAAA,GACjB;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
|
2
2
|
import { IdentityApi } from '@backstage/core-plugin-api';
|
|
3
3
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
4
4
|
import * as _drodil_backstage_plugin_qeta_common from '@drodil/backstage-plugin-qeta-common';
|
|
5
|
-
import { QetaApi, PostType, PostStatus, PostResponse, Template, PostsResponse, AnswersResponse, AnswerResponse, Collection, Post, PostsQuery, CollectionResponse, TagResponse, Answer, Comment, Stat, Badge, TemplatesResponse, Article, UserResponse, AIQuery } from '@drodil/backstage-plugin-qeta-common';
|
|
5
|
+
import { QetaApi, TimelineItem, PostType, PostStatus, PostResponse, Template, PostsResponse, AnswersResponse, AnswerResponse, Collection, Post, PostsQuery, CollectionResponse, TagResponse, Answer, Comment, Stat, Badge, TemplatesResponse, Article, UserResponse, AIQuery } from '@drodil/backstage-plugin-qeta-common';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { Entity, UserEntity } from '@backstage/catalog-model';
|
|
8
8
|
import * as react from 'react';
|
|
@@ -44,6 +44,16 @@ declare const reviewRouteRef: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
|
44
44
|
|
|
45
45
|
declare const qetaApiRef: _backstage_frontend_plugin_api.ApiRef<QetaApi>;
|
|
46
46
|
|
|
47
|
+
interface TimelineProps {
|
|
48
|
+
loadMore?: boolean;
|
|
49
|
+
limit?: number;
|
|
50
|
+
}
|
|
51
|
+
declare const Timeline: (props: TimelineProps) => react_jsx_runtime.JSX.Element;
|
|
52
|
+
|
|
53
|
+
declare const TimelineItemCard: ({ item }: {
|
|
54
|
+
item: TimelineItem;
|
|
55
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
56
|
+
|
|
47
57
|
interface TagAndEntitiesFormValues {
|
|
48
58
|
tags?: string[];
|
|
49
59
|
entities?: Entity[];
|
|
@@ -157,17 +167,14 @@ declare const PostList: (props: {
|
|
|
157
167
|
loading: boolean;
|
|
158
168
|
error: any;
|
|
159
169
|
response?: PostsResponse;
|
|
160
|
-
onPageChange: (page: number) => void;
|
|
161
|
-
onPageSizeChange: (size: number) => void;
|
|
162
|
-
page: number;
|
|
163
|
-
pageSize: number;
|
|
164
|
-
pageCount: number;
|
|
165
170
|
entity?: string;
|
|
166
171
|
tags?: string[];
|
|
167
172
|
showNoQuestionsBtn?: boolean;
|
|
168
173
|
entityPage?: boolean;
|
|
169
174
|
type?: PostType;
|
|
170
175
|
showTypeLabel?: boolean;
|
|
176
|
+
hasMore?: boolean;
|
|
177
|
+
loadNextPage?: () => void;
|
|
171
178
|
}) => react_jsx_runtime.JSX.Element;
|
|
172
179
|
|
|
173
180
|
interface PostListItemProps {
|
|
@@ -182,13 +189,11 @@ declare const AnswerList: (props: {
|
|
|
182
189
|
loading: boolean;
|
|
183
190
|
error: any;
|
|
184
191
|
response?: AnswersResponse;
|
|
185
|
-
onPageChange: (page: number) => void;
|
|
186
|
-
onPageSizeChange: (size: number) => void;
|
|
187
|
-
page: number;
|
|
188
|
-
pageSize: number;
|
|
189
192
|
entity?: string;
|
|
190
193
|
tags?: string[];
|
|
191
194
|
entityPage?: boolean;
|
|
195
|
+
hasMore?: boolean;
|
|
196
|
+
loadNextPage?: () => void;
|
|
192
197
|
}) => react_jsx_runtime.JSX.Element;
|
|
193
198
|
|
|
194
199
|
interface AnswersContainerProps {
|
|
@@ -640,9 +645,13 @@ declare const useAI: () => {
|
|
|
640
645
|
|
|
641
646
|
declare const useCanReview: () => {
|
|
642
647
|
canReview: boolean;
|
|
648
|
+
canRead: boolean;
|
|
643
649
|
loading: boolean;
|
|
644
650
|
};
|
|
645
651
|
|
|
652
|
+
type GridType = 'posts' | 'tags' | 'entities' | 'users' | 'collections';
|
|
653
|
+
declare function useGridPageSize(gridType: GridType, basePageSize?: number): number;
|
|
654
|
+
|
|
646
655
|
/** @alpha */
|
|
647
656
|
declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"qeta", {
|
|
648
657
|
readonly "answer.questionTitle": "Q: {{question}}";
|
|
@@ -671,13 +680,28 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
671
680
|
readonly "statistics.topVotedAnswers.description": "People who have the highest rated answers";
|
|
672
681
|
readonly "statistics.topVotedCorrectAnswers.title": "Top voted correct answers";
|
|
673
682
|
readonly "statistics.topVotedCorrectAnswers.description": "People who have the highest rated correct answers";
|
|
674
|
-
readonly "code.aria": "Copy code to clipboard";
|
|
675
|
-
readonly "code.copied": "Code copied to clipboard";
|
|
676
683
|
readonly pluginName: "Q&A";
|
|
677
684
|
readonly "answerList.noAnswers": "No answers";
|
|
678
685
|
readonly "answerList.errorLoading": "Could not load answers";
|
|
679
686
|
readonly "answerList.limitSelect": "Answers per page";
|
|
687
|
+
readonly "timeline.title": "Timeline";
|
|
688
|
+
readonly "timeline.loadMore": "Load more";
|
|
689
|
+
readonly "timeline.loading": "Loading...";
|
|
690
|
+
readonly "timeline.postedQuestion": "posted question";
|
|
691
|
+
readonly "timeline.postedArticle": "posted article";
|
|
692
|
+
readonly "timeline.postedLink": "posted link";
|
|
693
|
+
readonly "timeline.updatedQuestion": "updated question";
|
|
694
|
+
readonly "timeline.updatedArticle": "updated article";
|
|
695
|
+
readonly "timeline.updatedLink": "updated link";
|
|
696
|
+
readonly "timeline.answered": "answered to";
|
|
697
|
+
readonly "timeline.commentedOnQuestion": "commented on question";
|
|
698
|
+
readonly "timeline.commentedOnArticle": "commented on article";
|
|
699
|
+
readonly "timeline.commentedOnLink": "commented on link";
|
|
700
|
+
readonly "timeline.createdCollection": "created collection";
|
|
701
|
+
readonly "timeline.noMoreItems": "No more items";
|
|
680
702
|
readonly "common.post": "post";
|
|
703
|
+
readonly "common.answer": "answer";
|
|
704
|
+
readonly "common.comment": "comment";
|
|
681
705
|
readonly "common.collection": "collection";
|
|
682
706
|
readonly "common.favorite": "Favorite";
|
|
683
707
|
readonly "common.obsolete": "Obsolete";
|
|
@@ -692,6 +716,7 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
692
716
|
readonly "common.questions": "questions";
|
|
693
717
|
readonly "common.articles": "articles";
|
|
694
718
|
readonly "common.search": "Search";
|
|
719
|
+
readonly "common.loading": "Loading...";
|
|
695
720
|
readonly "common.experts": "Experts";
|
|
696
721
|
readonly "common.tagExpert": "This user is an expert in this area";
|
|
697
722
|
readonly "common.comments": "Comments";
|
|
@@ -736,7 +761,6 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
736
761
|
readonly "common.followersLabel_one": "follower";
|
|
737
762
|
readonly "common.followersLabel_other": "followers";
|
|
738
763
|
readonly "common.unsaved_changes": "You have unsaved changes. Are you sure you want to leave?";
|
|
739
|
-
readonly "common.loading": "Loading...";
|
|
740
764
|
readonly "markdownEditor.write": "Write";
|
|
741
765
|
readonly "markdownEditor.preview": "Preview";
|
|
742
766
|
readonly "markdownEditor.uploadingImage": "Uploading image...";
|
|
@@ -750,8 +774,8 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
750
774
|
readonly "anonymousCheckbox.tooltip": "By enabling this, other users won't be able to see you as an author";
|
|
751
775
|
readonly "anonymousCheckbox.answerAnonymously": "Answer anonymously";
|
|
752
776
|
readonly "anonymousCheckbox.postAnonymously": "Post anonymously";
|
|
753
|
-
readonly "fileInput.label": "Header image";
|
|
754
777
|
readonly "fileInput.preview": "Preview image";
|
|
778
|
+
readonly "fileInput.label": "Header image";
|
|
755
779
|
readonly "fileInput.helperText": "URL of the header image to be used";
|
|
756
780
|
readonly "fileInput.uploadHeaderImage": "Upload image";
|
|
757
781
|
readonly "fileInput.dropHere": "Drop your image here";
|
|
@@ -856,9 +880,9 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
856
880
|
readonly "commentList.deleteLink": "delete";
|
|
857
881
|
readonly "markdown.toc": "Table of contents";
|
|
858
882
|
readonly "commentSection.post": "Post";
|
|
859
|
-
readonly "commentSection.input.placeholder": "Your comment";
|
|
860
883
|
readonly "commentSection.addComment": "Add a comment";
|
|
861
884
|
readonly "commentSection.leaveComment": "Leave a comment";
|
|
885
|
+
readonly "commentSection.input.placeholder": "Your comment";
|
|
862
886
|
readonly "tagChip.nonExistingTag": "This tag does not yet exist";
|
|
863
887
|
readonly "editTagModal.title": "Edit tag {{tag}}";
|
|
864
888
|
readonly "editTagModal.description": "Tag description";
|
|
@@ -959,16 +983,27 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
959
983
|
readonly "suggestionsCard.randomPost3": "Have you seen \"{{title}}\"?";
|
|
960
984
|
readonly "suggestionsCard.randomPost4": "Join the discussion on \"{{title}}\"";
|
|
961
985
|
readonly "suggestionsCard.randomPost5": "Check this out: \"{{title}}\"";
|
|
986
|
+
readonly "suggestionsCard.needsReview1": "\"{{title}}\" needs a content review";
|
|
987
|
+
readonly "suggestionsCard.needsReview2": "Please review \"{{title}}\" for accuracy";
|
|
988
|
+
readonly "suggestionsCard.needsReview3": "Content review needed: \"{{title}}\"";
|
|
989
|
+
readonly "suggestionsCard.needsReview4": "Can you verify \"{{title}}\" is still valid?";
|
|
990
|
+
readonly "suggestionsCard.needsReview5": "\"{{title}}\" is due for a review";
|
|
962
991
|
readonly "homePage.title": "Home";
|
|
963
992
|
readonly "impactCard.reputation": "Reputation";
|
|
964
993
|
readonly "impactCard.title": "Your impact";
|
|
965
994
|
readonly "impactCard.error": "Failed to load impact data";
|
|
966
995
|
readonly "impactCard.answers": "Answers";
|
|
996
|
+
readonly "impactCard.links": "Links";
|
|
967
997
|
readonly "impactCard.questions": "Questions";
|
|
998
|
+
readonly "impactCard.articles": "Articles";
|
|
968
999
|
readonly "impactCard.votes": "Votes";
|
|
969
1000
|
readonly "impactCard.views": "views";
|
|
970
1001
|
readonly "impactCard.followers": "Followers";
|
|
971
1002
|
readonly "impactCard.contributions": "Your contributions helped {{lastWeek}} people this week";
|
|
1003
|
+
readonly "impactCard.totalContributions": "Contributions";
|
|
1004
|
+
readonly "impactCard.answerScore": "Answer Score";
|
|
1005
|
+
readonly "impactCard.postScore": "Post Score";
|
|
1006
|
+
readonly "impactCard.correctAnswers": "Correct Answers";
|
|
972
1007
|
readonly "userBadges.title": "Badges";
|
|
973
1008
|
readonly "userBadges.error": "Failed to load badges";
|
|
974
1009
|
readonly "userBadges.noBadges": "No badges earned yet";
|
|
@@ -1028,7 +1063,6 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1028
1063
|
readonly "templateSelectList.selectButton": "Choose";
|
|
1029
1064
|
readonly "templateSelectList.genericQuestion": "Generic question";
|
|
1030
1065
|
readonly "templateSelectList.genericQuestionDescription": "Create a generic question";
|
|
1031
|
-
readonly "pagination.defaultTooltip": "Number of items";
|
|
1032
1066
|
readonly "collectionsPage.title": "Collections";
|
|
1033
1067
|
readonly "collectionsPage.search.label": "Search collection";
|
|
1034
1068
|
readonly "collectionsPage.search.placeholder": "Search...";
|
|
@@ -1062,6 +1096,8 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1062
1096
|
readonly "authorBox.updatedBy": "by";
|
|
1063
1097
|
readonly "authorBox.answeredAtTime": "Answered";
|
|
1064
1098
|
readonly "authorBox.correctAnswer": "Correct answer";
|
|
1099
|
+
readonly "code.aria": "Copy code to clipboard";
|
|
1100
|
+
readonly "code.copied": "Code copied to clipboard";
|
|
1065
1101
|
readonly "voteButtons.post.own": "You cannot vote your own {{type}}";
|
|
1066
1102
|
readonly "voteButtons.post.good": "This {{type}} is good";
|
|
1067
1103
|
readonly "voteButtons.post.bad": "This {{type}} is not good";
|
|
@@ -1105,16 +1141,16 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1105
1141
|
readonly "filterPanel.orderBy.links": "Links";
|
|
1106
1142
|
readonly "filterPanel.orderBy.questions": "Questions";
|
|
1107
1143
|
readonly "filterPanel.orderBy.articles": "Articles";
|
|
1108
|
-
readonly "filterPanel.orderBy.label": "Order by";
|
|
1109
1144
|
readonly "filterPanel.orderBy.votes": "Votes";
|
|
1110
1145
|
readonly "filterPanel.orderBy.clicks": "Clicks";
|
|
1111
1146
|
readonly "filterPanel.orderBy.views": "Views";
|
|
1112
1147
|
readonly "filterPanel.orderBy.followers": "Followers";
|
|
1148
|
+
readonly "filterPanel.orderBy.label": "Order by";
|
|
1113
1149
|
readonly "filterPanel.orderBy.rank": "Rank";
|
|
1114
1150
|
readonly "filterPanel.orderBy.trend": "Trend";
|
|
1115
1151
|
readonly "filterPanel.order.label": "Order";
|
|
1116
|
-
readonly "filterPanel.order.desc": "Descending";
|
|
1117
1152
|
readonly "filterPanel.order.asc": "Ascending";
|
|
1153
|
+
readonly "filterPanel.order.desc": "Descending";
|
|
1118
1154
|
readonly "filterPanel.filters.tag.label": "Tag";
|
|
1119
1155
|
readonly "filterPanel.filters.tag.placeholder": "Type or select tag";
|
|
1120
1156
|
readonly "filterPanel.filters.label": "Filters";
|
|
@@ -1123,8 +1159,8 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1123
1159
|
readonly "postsList.errorLoading": "Could not load {{itemType}}s";
|
|
1124
1160
|
readonly "postsList.postsPerPage": "{{itemType}}s per page";
|
|
1125
1161
|
readonly "postsContainer.title.favorite": "Your favorite {{itemType}}s";
|
|
1126
|
-
readonly "postsContainer.title.by": "{{itemType}}s by";
|
|
1127
1162
|
readonly "postsContainer.title.about": "{{itemType}}s about";
|
|
1163
|
+
readonly "postsContainer.title.by": "{{itemType}}s by";
|
|
1128
1164
|
readonly "postsContainer.title.tagged": "{{itemType}} tagged with {{tags}}";
|
|
1129
1165
|
readonly "postsContainer.search.label": "Search {{itemType}}";
|
|
1130
1166
|
readonly "postsContainer.search.placeholder": "Search...";
|
|
@@ -1191,11 +1227,14 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1191
1227
|
readonly "stats.links": "Links";
|
|
1192
1228
|
readonly "stats.questions": "Questions";
|
|
1193
1229
|
readonly "stats.articles": "Articles";
|
|
1230
|
+
readonly "stats.tooltip": "Chart Tooltip";
|
|
1194
1231
|
readonly "stats.comments": "Comments";
|
|
1195
1232
|
readonly "stats.votes": "Votes";
|
|
1196
1233
|
readonly "stats.views": "Views";
|
|
1197
1234
|
readonly "stats.followers": "Followers";
|
|
1198
|
-
readonly "stats.
|
|
1235
|
+
readonly "stats.answerScore": "Answer score";
|
|
1236
|
+
readonly "stats.postScore": "Post score";
|
|
1237
|
+
readonly "stats.correctAnswers": "Correct answers";
|
|
1199
1238
|
readonly "stats.noStats": "No statistics available. Check back later!";
|
|
1200
1239
|
readonly "stats.barChart": "Bar Chart";
|
|
1201
1240
|
readonly "stats.lineChart": "Line Chart";
|
|
@@ -1206,9 +1245,6 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1206
1245
|
readonly "stats.totalUsers": "Total users";
|
|
1207
1246
|
readonly "stats.totalTags": "Total tags";
|
|
1208
1247
|
readonly "stats.totalFollowers": "Total followers";
|
|
1209
|
-
readonly "stats.answerScore": "Answer score";
|
|
1210
|
-
readonly "stats.postScore": "Post score";
|
|
1211
|
-
readonly "stats.correctAnswers": "Correct answers";
|
|
1212
1248
|
readonly "collectionButton.follow": "Follow";
|
|
1213
1249
|
readonly "collectionButton.tooltip": "By following a collection, you will get notified when ever a new post is added to the collection";
|
|
1214
1250
|
readonly "collectionButton.unfollow": "Unfollow";
|
|
@@ -1236,10 +1272,6 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1236
1272
|
readonly "contentHealth.reviewHistory": "Review History";
|
|
1237
1273
|
readonly "reviewPage.title": "Review";
|
|
1238
1274
|
readonly "reviewPage.description": "Review posts that are possibly outdated.";
|
|
1239
|
-
readonly "reviewPage.dialog.title": "Mark Post as Obsolete";
|
|
1240
|
-
readonly "reviewPage.dialog.cancel": "Cancel";
|
|
1241
|
-
readonly "reviewPage.dialog.commentLabel": "Comment (Optional)";
|
|
1242
|
-
readonly "reviewPage.dialog.confirm": "Mark as Obsolete";
|
|
1243
1275
|
readonly "reviewPage.table.author": "Author";
|
|
1244
1276
|
readonly "reviewPage.table.score": "Health Score";
|
|
1245
1277
|
readonly "reviewPage.table.created": "Created";
|
|
@@ -1249,6 +1281,10 @@ declare const qetaTranslationRef: _backstage_frontend_plugin_api.TranslationRef<
|
|
|
1249
1281
|
readonly "reviewPage.errorLoading": "Could not load posts for review";
|
|
1250
1282
|
readonly "reviewPage.actions.markValid": "Mark Valid";
|
|
1251
1283
|
readonly "reviewPage.actions.markObsolete": "Mark Obsolete";
|
|
1284
|
+
readonly "reviewPage.dialog.title": "Mark Post as Obsolete";
|
|
1285
|
+
readonly "reviewPage.dialog.cancel": "Cancel";
|
|
1286
|
+
readonly "reviewPage.dialog.commentLabel": "Comment (Optional)";
|
|
1287
|
+
readonly "reviewPage.dialog.confirm": "Mark as Obsolete";
|
|
1252
1288
|
}>;
|
|
1253
1289
|
declare const qetaTranslations: _backstage_frontend_plugin_api.TranslationResource<"qeta">;
|
|
1254
1290
|
|
|
@@ -1264,8 +1300,6 @@ type QetaCommentSectionClassKey = 'root' | 'addCommentButton' | 'commentSection'
|
|
|
1264
1300
|
|
|
1265
1301
|
type QetaSearchBarClassKeys = 'root' | 'input' | 'iconButton' | 'divider' | 'searchIcon' | 'loadingIcon';
|
|
1266
1302
|
|
|
1267
|
-
type QetaPaginationClassKeys = 'root' | 'pageSizeSelect' | 'pagination';
|
|
1268
|
-
|
|
1269
1303
|
type QetaComponentsNameToClassKey = {
|
|
1270
1304
|
QetaArticleButtons: QetaArticleButtonsClassKey;
|
|
1271
1305
|
QetaMarkdownContent: QetaMarkdownContentClassKey;
|
|
@@ -1276,7 +1310,6 @@ type QetaComponentsNameToClassKey = {
|
|
|
1276
1310
|
QetaCommentList: QetaCommentListClassKey;
|
|
1277
1311
|
QetaCommentSection: QetaCommentSectionClassKey;
|
|
1278
1312
|
QetaSearchBar: QetaSearchBarClassKeys;
|
|
1279
|
-
QetaPagination: QetaPaginationClassKeys;
|
|
1280
1313
|
QetaQuestionCard: QuestionCardClassKeys;
|
|
1281
1314
|
QetaAnswerCard: AnswerCardClassKeys;
|
|
1282
1315
|
};
|
|
@@ -1284,4 +1317,4 @@ type QetaOverrides = Overrides & {
|
|
|
1284
1317
|
[Name in keyof QetaComponentsNameToClassKey]?: Partial<StyleRules<QetaComponentsNameToClassKey[Name]>>;
|
|
1285
1318
|
};
|
|
1286
1319
|
|
|
1287
|
-
export { AIAnswerCard, AddToCollectionButton, AnswerCard, AnswerForm, AnswerList, AnswerListItem, AnswersContainer, ArticleContent, AskQuestionButton, AuthorLink, BadgeChip, ButtonContainer, CollectionFollowButton, CollectionForm, CollectionsGrid, ContentHeader, ContentHeaderButton, ContentHeaderCard, type ContentHeaderCardProps, type ContentHeaderProps, CreateCollectionButton, CreateLinkButton, DeleteModal, DeletedBanner, DraftBanner, EntitiesGrid, EntityFollowButton, FaviconItem, FilterPanel, FollowedCollectionsList, FollowedEntitiesList, FollowedTagsList, FollowedUsersList, ImpactCard, LeftMenu, LeftMenuButton, LinkCard, MarkdownRenderer, ObsoleteBanner, ObsoleteModal, OpenLinkButton, PostForm, type PostGridProps, PostHighlightList, PostHighlightListContainer, PostHighlightListContent, PostList, PostListItem, PostsCard, PostsContainer, type PostsContainerProps, PostsGrid, PostsTable, QetaContext, type QetaContextProps, type QetaOverrides, QetaProvider, QuestionCard, type QuestionFormValues, QuestionsTable, RelativeTimeWithTooltip, SelectTemplateList, StatsChart, StatusChip, SuggestionsCard, type TagAndEntitiesFormValues, TagFollowButton, TagsGrid, type TemplateFormValues, TemplateList, TopRankingUsers, TrophyIcon, UpdatedByLink, UserBadges, UserFollowButton, UserLink, UsersGrid, ValidReviewModal, ViewToggle, type ViewType, WriteArticleButton, articleRouteRef, articlesRouteRef, askRouteRef, collectionCreateRouteRef, collectionEditRouteRef, collectionRouteRef, collectionsRouteRef, createLinkRouteRef, editArticleRouteRef, editLinkRouteRef, editQuestionRouteRef, entitiesRouteRef, entityRouteRef, favoriteQuestionsRouteRef, linkRouteRef, linksRouteRef, moderatorRouteRef, qetaApiRef, qetaRouteRef, qetaTranslationRef, qetaTranslations, questionRouteRef, questionsRouteRef, reviewRouteRef, statisticsRouteRef, tagRouteRef, tagsRouteRef, useAI, useCanReview, useCollectionsFollow, useEntityAuthor, useEntityFollow, useIdentityApi, useIsModerator, useQetaApi, useQetaContext, useTagsFollow, useUserFollow, useUserInfo, userRouteRef, usersRouteRef, writeRouteRef };
|
|
1320
|
+
export { AIAnswerCard, AddToCollectionButton, AnswerCard, AnswerForm, AnswerList, AnswerListItem, AnswersContainer, ArticleContent, AskQuestionButton, AuthorLink, BadgeChip, ButtonContainer, CollectionFollowButton, CollectionForm, CollectionsGrid, ContentHeader, ContentHeaderButton, ContentHeaderCard, type ContentHeaderCardProps, type ContentHeaderProps, CreateCollectionButton, CreateLinkButton, DeleteModal, DeletedBanner, DraftBanner, EntitiesGrid, EntityFollowButton, FaviconItem, FilterPanel, FollowedCollectionsList, FollowedEntitiesList, FollowedTagsList, FollowedUsersList, type GridType, ImpactCard, LeftMenu, LeftMenuButton, LinkCard, MarkdownRenderer, ObsoleteBanner, ObsoleteModal, OpenLinkButton, PostForm, type PostGridProps, PostHighlightList, PostHighlightListContainer, PostHighlightListContent, PostList, PostListItem, PostsCard, PostsContainer, type PostsContainerProps, PostsGrid, PostsTable, QetaContext, type QetaContextProps, type QetaOverrides, QetaProvider, QuestionCard, type QuestionFormValues, QuestionsTable, RelativeTimeWithTooltip, SelectTemplateList, StatsChart, StatusChip, SuggestionsCard, type TagAndEntitiesFormValues, TagFollowButton, TagsGrid, type TemplateFormValues, TemplateList, Timeline, TimelineItemCard, TopRankingUsers, TrophyIcon, UpdatedByLink, UserBadges, UserFollowButton, UserLink, UsersGrid, ValidReviewModal, ViewToggle, type ViewType, WriteArticleButton, articleRouteRef, articlesRouteRef, askRouteRef, collectionCreateRouteRef, collectionEditRouteRef, collectionRouteRef, collectionsRouteRef, createLinkRouteRef, editArticleRouteRef, editLinkRouteRef, editQuestionRouteRef, entitiesRouteRef, entityRouteRef, favoriteQuestionsRouteRef, linkRouteRef, linksRouteRef, moderatorRouteRef, qetaApiRef, qetaRouteRef, qetaTranslationRef, qetaTranslations, questionRouteRef, questionsRouteRef, reviewRouteRef, statisticsRouteRef, tagRouteRef, tagsRouteRef, useAI, useCanReview, useCollectionsFollow, useEntityAuthor, useEntityFollow, useGridPageSize, useIdentityApi, useIsModerator, useQetaApi, useQetaContext, useTagsFollow, useUserFollow, useUserInfo, userRouteRef, usersRouteRef, writeRouteRef };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { articleRouteRef, articlesRouteRef, askRouteRef, collectionCreateRouteRef, collectionEditRouteRef, collectionRouteRef, collectionsRouteRef, createLinkRouteRef, editArticleRouteRef, editLinkRouteRef, editQuestionRouteRef, entitiesRouteRef, entityRouteRef, favoriteQuestionsRouteRef, linkRouteRef, linksRouteRef, moderatorRouteRef, qetaRouteRef, questionRouteRef, questionsRouteRef, reviewRouteRef, statisticsRouteRef, tagRouteRef, tagsRouteRef, userRouteRef, usersRouteRef, writeRouteRef } from './routes.esm.js';
|
|
2
2
|
export { qetaApiRef } from './api.esm.js';
|
|
3
|
+
export { Timeline } from './components/Timeline/Timeline.esm.js';
|
|
4
|
+
export { TimelineItemCard } from './components/Timeline/TimelineItem.esm.js';
|
|
3
5
|
export { PostForm } from './components/PostForm/PostForm.esm.js';
|
|
4
6
|
export { PostsContainer } from './components/PostsContainer/PostsContainer.esm.js';
|
|
5
7
|
export { PostList } from './components/PostsContainer/PostList.esm.js';
|
|
@@ -78,5 +80,6 @@ export { useCollectionsFollow } from './hooks/useCollectionsFollow.esm.js';
|
|
|
78
80
|
export { useIsModerator } from './hooks/useIsModerator.esm.js';
|
|
79
81
|
export { useAI } from './hooks/useAI.esm.js';
|
|
80
82
|
export { useCanReview } from './hooks/useCanReview.esm.js';
|
|
83
|
+
export { useGridPageSize } from './hooks/useGridPageSize.esm.js';
|
|
81
84
|
export { qetaTranslationRef, qetaTranslations } from './translation.esm.js';
|
|
82
85
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -9,6 +9,23 @@ const qetaTranslationRef = createTranslationRef({
|
|
|
9
9
|
noAnswers: "No answers",
|
|
10
10
|
limitSelect: "Answers per page"
|
|
11
11
|
},
|
|
12
|
+
timeline: {
|
|
13
|
+
title: "Timeline",
|
|
14
|
+
loadMore: "Load more",
|
|
15
|
+
loading: "Loading...",
|
|
16
|
+
postedQuestion: "posted question",
|
|
17
|
+
postedArticle: "posted article",
|
|
18
|
+
postedLink: "posted link",
|
|
19
|
+
updatedQuestion: "updated question",
|
|
20
|
+
updatedArticle: "updated article",
|
|
21
|
+
updatedLink: "updated link",
|
|
22
|
+
answered: "answered to",
|
|
23
|
+
commentedOnQuestion: "commented on question",
|
|
24
|
+
commentedOnArticle: "commented on article",
|
|
25
|
+
commentedOnLink: "commented on link",
|
|
26
|
+
createdCollection: "created collection",
|
|
27
|
+
noMoreItems: "No more items"
|
|
28
|
+
},
|
|
12
29
|
common: {
|
|
13
30
|
post: "post",
|
|
14
31
|
experts: "Experts",
|
|
@@ -19,6 +36,8 @@ const qetaTranslationRef = createTranslationRef({
|
|
|
19
36
|
link: "link",
|
|
20
37
|
links: "links",
|
|
21
38
|
collection: "collection",
|
|
39
|
+
comment: "comment",
|
|
40
|
+
answer: "answer",
|
|
22
41
|
score: "{{score}} score",
|
|
23
42
|
comments: "Comments",
|
|
24
43
|
answers: "answers",
|
|
@@ -393,7 +412,12 @@ const qetaTranslationRef = createTranslationRef({
|
|
|
393
412
|
randomPost2: 'What do you think about "{{title}}"?',
|
|
394
413
|
randomPost3: 'Have you seen "{{title}}"?',
|
|
395
414
|
randomPost4: 'Join the discussion on "{{title}}"',
|
|
396
|
-
randomPost5: 'Check this out: "{{title}}"'
|
|
415
|
+
randomPost5: 'Check this out: "{{title}}"',
|
|
416
|
+
needsReview1: '"{{title}}" needs a content review',
|
|
417
|
+
needsReview2: 'Please review "{{title}}" for accuracy',
|
|
418
|
+
needsReview3: 'Content review needed: "{{title}}"',
|
|
419
|
+
needsReview4: 'Can you verify "{{title}}" is still valid?',
|
|
420
|
+
needsReview5: '"{{title}}" is due for a review'
|
|
397
421
|
},
|
|
398
422
|
homePage: {
|
|
399
423
|
title: "Home"
|
|
@@ -403,11 +427,17 @@ const qetaTranslationRef = createTranslationRef({
|
|
|
403
427
|
views: "views",
|
|
404
428
|
error: "Failed to load impact data",
|
|
405
429
|
contributions: "Your contributions helped {{lastWeek}} people this week",
|
|
430
|
+
totalContributions: "Contributions",
|
|
406
431
|
votes: "Votes",
|
|
407
432
|
questions: "Questions",
|
|
408
433
|
answers: "Answers",
|
|
434
|
+
articles: "Articles",
|
|
435
|
+
links: "Links",
|
|
409
436
|
followers: "Followers",
|
|
410
|
-
reputation: "Reputation"
|
|
437
|
+
reputation: "Reputation",
|
|
438
|
+
answerScore: "Answer Score",
|
|
439
|
+
postScore: "Post Score",
|
|
440
|
+
correctAnswers: "Correct Answers"
|
|
411
441
|
},
|
|
412
442
|
userBadges: {
|
|
413
443
|
title: "Badges",
|
|
@@ -512,9 +542,6 @@ const qetaTranslationRef = createTranslationRef({
|
|
|
512
542
|
genericQuestion: "Generic question",
|
|
513
543
|
genericQuestionDescription: "Create a generic question"
|
|
514
544
|
},
|
|
515
|
-
pagination: {
|
|
516
|
-
defaultTooltip: "Number of items"
|
|
517
|
-
},
|
|
518
545
|
collectionsPage: {
|
|
519
546
|
title: "Collections",
|
|
520
547
|
search: {
|