@tager/admin-blog 0.3.43 → 1.0.2
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/constants/paths.d.ts +6 -14
- package/dist/constants/routes.d.ts +5 -5
- package/dist/dev/App.vue.d.ts +5 -0
- package/dist/dev/config.d.ts +2 -0
- package/dist/dev/env.d.ts +1 -0
- package/dist/dev/main.d.ts +3 -0
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/useFetchCategories.d.ts +3 -6
- package/dist/hooks/useFetchCategory.d.ts +7 -8
- package/dist/hooks/useFetchModuleConfig.d.ts +3 -6
- package/dist/hooks/useFetchPosts.d.ts +3 -6
- package/dist/index.mjs +2355 -0
- package/dist/locales/apply.d.ts +1 -0
- package/dist/locales/en.d.ts +92 -86
- package/dist/locales/ru.d.ts +3 -3
- package/dist/main.d.ts +3 -4
- package/dist/services/requests.d.ts +60 -59
- package/dist/style.css +1 -0
- package/dist/typings/common.d.ts +1 -1
- package/dist/typings/model.d.ts +106 -106
- package/dist/utils/common.d.ts +2 -2
- package/dist/utils/paths.d.ts +8 -0
- package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +53 -116
- package/dist/views/Categories/CategoryForm/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +7 -7
- package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +26 -57
- package/dist/views/Categories/CategoryList/hooks/index.d.ts +1 -1
- package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +19 -16
- package/dist/views/Categories/CategoryList/index.d.ts +1 -1
- package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +32 -32
- package/dist/views/Posts/PostForm/PostForm.vue.d.ts +2768 -9398
- package/dist/views/Posts/PostForm/index.d.ts +1 -1
- package/dist/views/Posts/PostList/PostList.helpers.d.ts +8 -7
- package/dist/views/Posts/PostList/PostList.vue.d.ts +40 -78
- package/dist/views/Posts/PostList/hooks/index.d.ts +1 -1
- package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +27 -24
- package/dist/views/Posts/PostList/index.d.ts +1 -1
- package/package.json +51 -49
- package/src/constants/paths.ts +0 -22
- package/src/constants/routes.ts +9 -9
- package/src/dev/App.vue +56 -0
- package/src/dev/config.ts +23 -0
- package/src/dev/env.ts +17 -0
- package/src/dev/main.ts +49 -0
- package/src/hooks/useFetchCategories.ts +2 -7
- package/src/hooks/useFetchCategory.ts +3 -6
- package/src/hooks/useFetchModuleConfig.ts +2 -7
- package/src/hooks/useFetchPosts.ts +4 -6
- package/src/locales/apply.ts +9 -0
- package/src/locales/en.ts +10 -4
- package/src/locales/ru.ts +11 -3
- package/src/main.ts +3 -8
- package/src/services/requests.ts +1 -0
- package/src/utils/paths.ts +23 -0
- package/src/views/Categories/CategoryForm/CategoryForm.vue +81 -65
- package/src/views/Categories/CategoryList/CategoryList.helpers.ts +1 -1
- package/src/views/Categories/CategoryList/CategoryList.vue +86 -58
- package/src/views/Categories/CategoryList/hooks/useAdvancedSearch.ts +9 -12
- package/src/views/Posts/PostForm/PostForm.vue +265 -225
- package/src/views/Posts/PostList/PostList.helpers.ts +27 -2
- package/src/views/Posts/PostList/PostList.vue +203 -192
- package/src/views/Posts/PostList/hooks/useAdvancedSearch.ts +22 -30
- package/CHANGELOG.md +0 -13
- package/dist/constants/menu.d.ts +0 -5
- package/dist/dev.d.ts +0 -1
- package/dist/index.esm.js +0 -5294
- package/dist/index.umd.js +0 -5321
- package/dist/router/index.d.ts +0 -4
- package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +0 -5
- package/dist/views/Posts/PostForm/components/TabList/index.d.ts +0 -2
- package/src/constants/menu.ts +0 -31
- package/src/dev.ts +0 -34
- package/src/router/index.ts +0 -40
- package/src/typings/sfc.d.ts +0 -12
- package/src/typings/shims-tsx.d.ts +0 -13
- package/src/typings/shims-vue.d.ts +0 -11
- package/src/typings/translate.d.ts +0 -10
- package/src/views/App.vue +0 -22
- package/src/views/Home.vue +0 -31
- package/src/views/Posts/PostForm/components/TabList/TabList.types.ts +0 -5
- package/src/views/Posts/PostForm/components/TabList/TabList.vue +0 -92
- package/src/views/Posts/PostForm/components/TabList/index.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function applyTranslations(): void;
|
package/dist/locales/en.d.ts
CHANGED
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
declare const EN: {
|
|
2
|
-
yes: string;
|
|
3
|
-
no: string;
|
|
4
|
-
blog: string;
|
|
5
|
-
posts: string;
|
|
6
|
-
categories: string;
|
|
7
|
-
createPost: string;
|
|
8
|
-
createCategory: string;
|
|
9
|
-
home: string;
|
|
10
|
-
allPosts: string;
|
|
11
|
-
postForm: string;
|
|
12
|
-
allCategories: string;
|
|
13
|
-
categoryForm: string;
|
|
14
|
-
success: string;
|
|
15
|
-
error: string;
|
|
16
|
-
newPost: string;
|
|
17
|
-
edit: string;
|
|
18
|
-
remove: string;
|
|
19
|
-
postsByCategory: string;
|
|
20
|
-
name: string;
|
|
21
|
-
image: string;
|
|
22
|
-
language: string;
|
|
23
|
-
languages: string;
|
|
24
|
-
date: string;
|
|
25
|
-
dateOfPublication: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
export declare const EN: {
|
|
2
|
+
yes: string;
|
|
3
|
+
no: string;
|
|
4
|
+
blog: string;
|
|
5
|
+
posts: string;
|
|
6
|
+
categories: string;
|
|
7
|
+
createPost: string;
|
|
8
|
+
createCategory: string;
|
|
9
|
+
home: string;
|
|
10
|
+
allPosts: string;
|
|
11
|
+
postForm: string;
|
|
12
|
+
allCategories: string;
|
|
13
|
+
categoryForm: string;
|
|
14
|
+
success: string;
|
|
15
|
+
error: string;
|
|
16
|
+
newPost: string;
|
|
17
|
+
edit: string;
|
|
18
|
+
remove: string;
|
|
19
|
+
postsByCategory: string;
|
|
20
|
+
name: string;
|
|
21
|
+
image: string;
|
|
22
|
+
language: string;
|
|
23
|
+
languages: string;
|
|
24
|
+
date: string;
|
|
25
|
+
dateOfPublication: string;
|
|
26
|
+
dateOfPublicationFrom: string;
|
|
27
|
+
dateOfPublicationTo: string;
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
From: string;
|
|
31
|
+
To: string;
|
|
32
|
+
category: string;
|
|
33
|
+
actions: string;
|
|
34
|
+
updatePost: string;
|
|
35
|
+
title: string;
|
|
36
|
+
link: string;
|
|
37
|
+
excerpt: string;
|
|
38
|
+
body: string;
|
|
39
|
+
defaultCategory: string;
|
|
40
|
+
coverImage: string;
|
|
41
|
+
innerImage: string;
|
|
42
|
+
innerImageMobile: string;
|
|
43
|
+
tags: string;
|
|
44
|
+
relatedPosts: string;
|
|
45
|
+
blogPostWasSuccessfullyCreated: string;
|
|
46
|
+
blogPostWasSuccessfullyUpdated: string;
|
|
47
|
+
blogPostCreationWasFailed: string;
|
|
48
|
+
blogPostUpdateWasFailed: string;
|
|
49
|
+
common: string;
|
|
50
|
+
images: string;
|
|
51
|
+
relations: string;
|
|
52
|
+
additionalFields: string;
|
|
53
|
+
viewPost: string;
|
|
54
|
+
blogCategories: string;
|
|
55
|
+
newCategory: string;
|
|
56
|
+
moveUp: string;
|
|
57
|
+
moveDown: string;
|
|
58
|
+
createBlogCategory: string;
|
|
59
|
+
updateBlogCategory: string;
|
|
60
|
+
pageTitle: string;
|
|
61
|
+
pageDescription: string;
|
|
62
|
+
openGraphImage: string;
|
|
63
|
+
blogCategoryWasSuccessfullyCreated: string;
|
|
64
|
+
blogCategoryWasSuccessfullyUpdated: string;
|
|
65
|
+
blogCategoryCreationWasFailed: string;
|
|
66
|
+
blogCategoryUpdateWasFailed: string;
|
|
67
|
+
clone: string;
|
|
68
|
+
cloneConfirm: string;
|
|
69
|
+
cloneSuccess: string;
|
|
70
|
+
cloneFailure: string;
|
|
71
|
+
tabs: {
|
|
72
|
+
common: string;
|
|
73
|
+
seo: string;
|
|
74
|
+
};
|
|
75
|
+
parentCategory: string;
|
|
76
|
+
noParent: string;
|
|
77
|
+
status: string;
|
|
78
|
+
statusPublished: string;
|
|
79
|
+
statusDraft: string;
|
|
80
|
+
statusArchived: string;
|
|
81
|
+
scheduleArchive: string;
|
|
82
|
+
schedulePublish: string;
|
|
83
|
+
archiveAt: string;
|
|
84
|
+
publishAt: string;
|
|
85
|
+
archiveAtLabel: string;
|
|
86
|
+
publishAtLabel: string;
|
|
87
|
+
sortDateTimeAsc: string;
|
|
88
|
+
sortDateTimeDesc: string;
|
|
89
|
+
sortTitleAsc: string;
|
|
90
|
+
sortTitleDesc: string;
|
|
91
|
+
sortStatus: string;
|
|
92
|
+
};
|
package/dist/locales/ru.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import EN from './en';
|
|
2
|
-
declare const RU: typeof EN;
|
|
3
|
-
export default RU;
|
|
1
|
+
import { EN } from './en';
|
|
2
|
+
export declare const RU: typeof EN;
|
|
3
|
+
export default RU;
|
package/dist/main.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './constants/routes';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './services/requests';
|
|
1
|
+
export * from './constants/routes';
|
|
2
|
+
export * from './utils/paths';
|
|
3
|
+
export * from './services/requests';
|
|
@@ -1,59 +1,60 @@
|
|
|
1
|
-
import { Nullable, ResponseBody } from '@tager/admin-services';
|
|
2
|
-
import { FieldShortType, OutgoingValueUnion } from '@tager/admin-dynamic-field';
|
|
3
|
-
import { Category, ModuleConfig, PostShort, PostFull, CategoryPayload } from '../typings/model';
|
|
4
|
-
/** Blog Posts */
|
|
5
|
-
export declare function getPosts(params?: {
|
|
6
|
-
query?: string;
|
|
7
|
-
pageNumber?: number;
|
|
8
|
-
pageSize?: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export declare function
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export declare
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export declare function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export declare function
|
|
52
|
-
export declare function
|
|
53
|
-
export declare function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
import { Nullable, ResponseBody } from '@tager/admin-services';
|
|
2
|
+
import { FieldShortType, OutgoingValueUnion } from '@tager/admin-dynamic-field';
|
|
3
|
+
import { Category, ModuleConfig, PostShort, PostFull, CategoryPayload } from '../typings/model';
|
|
4
|
+
/** Blog Posts */
|
|
5
|
+
export declare function getPosts(params?: {
|
|
6
|
+
query?: string;
|
|
7
|
+
pageNumber?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
sort?: string;
|
|
10
|
+
}): Promise<ResponseBody<PostShort[]>>;
|
|
11
|
+
export declare function getBlogPostCount(): Promise<ResponseBody<{
|
|
12
|
+
count: number;
|
|
13
|
+
}>>;
|
|
14
|
+
export declare function getPost(postId: number | string): Promise<ResponseBody<PostFull>>;
|
|
15
|
+
export declare function clonePost(postId: number | string): Promise<ResponseBody<PostFull>>;
|
|
16
|
+
export interface PostCreationPayload {
|
|
17
|
+
title: string;
|
|
18
|
+
urlAlias: string;
|
|
19
|
+
excerpt: string;
|
|
20
|
+
body: string;
|
|
21
|
+
datetime: string;
|
|
22
|
+
coverImage: Nullable<string>;
|
|
23
|
+
image: Nullable<string>;
|
|
24
|
+
imageMobile: Nullable<string>;
|
|
25
|
+
status: string;
|
|
26
|
+
pageTitle: string;
|
|
27
|
+
pageDescription: string;
|
|
28
|
+
openGraphImage: Nullable<string>;
|
|
29
|
+
categories: number[];
|
|
30
|
+
language: Nullable<string>;
|
|
31
|
+
relatedPosts: number[];
|
|
32
|
+
tags: string[];
|
|
33
|
+
additionalFields: FieldShortType<OutgoingValueUnion>[];
|
|
34
|
+
archiveAt: Nullable<string>;
|
|
35
|
+
publishAt: Nullable<string>;
|
|
36
|
+
}
|
|
37
|
+
export declare function createBlogPost(payload: PostCreationPayload): Promise<ResponseBody<PostFull>>;
|
|
38
|
+
export declare type PostUpdatePayload = PostCreationPayload & {
|
|
39
|
+
urlAlias: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function updateBlogPost(postId: number | string, payload: PostUpdatePayload): Promise<ResponseBody<PostFull>>;
|
|
42
|
+
export declare function deleteBlogPost(postId: number | string): Promise<{
|
|
43
|
+
success: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
/** Blog Categories */
|
|
46
|
+
export declare function getCategories(params?: {
|
|
47
|
+
query?: string;
|
|
48
|
+
pageNumber?: number;
|
|
49
|
+
pageSize?: number;
|
|
50
|
+
}): Promise<ResponseBody<Category[]>>;
|
|
51
|
+
export declare function getCategory(categoryId: number | string): Promise<ResponseBody<Category>>;
|
|
52
|
+
export declare function createCategory(payload: CategoryPayload): Promise<ResponseBody<Category>>;
|
|
53
|
+
export declare function updateCategory(categoryId: number | string, payload: CategoryPayload): Promise<ResponseBody<Category>>;
|
|
54
|
+
export declare function deleteCategory(categoryId: number | string): Promise<{
|
|
55
|
+
success: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
export declare function moveCategory(categoryId: number | string, direction: 'up' | 'down'): Promise<{
|
|
58
|
+
success: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
export declare function getModuleConfig(): Promise<ResponseBody<ModuleConfig>>;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.filters[data-v-02162423]{margin-bottom:1rem;width:100%;display:grid;gap:1rem;grid-template-columns:1fr 1fr}.filters[data-v-02162423]:not(:first-child){margin-top:1rem}.status span[data-v-02162423]{display:block}.status span[data-v-02162423]:nth-child(2){display:block;margin-top:5px;font-size:.8rem}.status span:nth-child(2) i[data-v-02162423]{display:block}.status[data-v-22282a12]{display:flex;align-items:flex-end}.status-value[data-v-22282a12]{flex-basis:50%}.status-checkbox[data-v-22282a12]{margin-left:20px;padding-bottom:8px}.status-date[data-v-22282a12]{margin-left:20px;flex:1 1 1px}
|
package/dist/typings/common.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type Values<T> = T[keyof T];
|
|
1
|
+
export declare type Values<T> = T[keyof T];
|
package/dist/typings/model.d.ts
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { Nullable, FileType } from '@tager/admin-services';
|
|
2
|
-
import { FieldConfigUnion, FieldShortType, IncomingValueUnion } from '@tager/admin-dynamic-field';
|
|
3
|
-
import { OptionType, ShortCodeItemType, SingleFileInputValueType } from '@tager/admin-ui';
|
|
4
|
-
export interface SeoInfo {
|
|
5
|
-
readonly pageTitle: Nullable<string>;
|
|
6
|
-
readonly pageDescription: Nullable<string>;
|
|
7
|
-
readonly pageKeywords: Nullable<string>;
|
|
8
|
-
readonly openGraphTitle: Nullable<string>;
|
|
9
|
-
readonly openGraphDescription: Nullable<string>;
|
|
10
|
-
readonly openGraphImage: Nullable<FileType>;
|
|
11
|
-
}
|
|
12
|
-
export interface Category extends SeoInfo {
|
|
13
|
-
readonly id: number;
|
|
14
|
-
readonly name: string;
|
|
15
|
-
readonly isDefault: boolean;
|
|
16
|
-
readonly language: string;
|
|
17
|
-
readonly url: string;
|
|
18
|
-
readonly urlTemplate: string;
|
|
19
|
-
readonly urlAlias: string;
|
|
20
|
-
readonly postsCount: string;
|
|
21
|
-
readonly parent: Nullable<{
|
|
22
|
-
id: Nullable<number>;
|
|
23
|
-
name: string;
|
|
24
|
-
}>;
|
|
25
|
-
readonly depth: number;
|
|
26
|
-
}
|
|
27
|
-
export interface PostShort {
|
|
28
|
-
readonly id: number;
|
|
29
|
-
readonly title: string;
|
|
30
|
-
readonly url: string;
|
|
31
|
-
readonly excerpt: string;
|
|
32
|
-
readonly status: string;
|
|
33
|
-
readonly language: string;
|
|
34
|
-
readonly categories: Category[];
|
|
35
|
-
readonly datetime: string;
|
|
36
|
-
readonly image: Nullable<FileType>;
|
|
37
|
-
}
|
|
38
|
-
export interface PostFull extends SeoInfo {
|
|
39
|
-
readonly id: number;
|
|
40
|
-
readonly language: string;
|
|
41
|
-
readonly title: string;
|
|
42
|
-
readonly url: string;
|
|
43
|
-
readonly urlTemplate: string;
|
|
44
|
-
readonly urlAlias: string;
|
|
45
|
-
readonly datetime: string | null;
|
|
46
|
-
readonly status: string;
|
|
47
|
-
readonly excerpt: string;
|
|
48
|
-
readonly image: Nullable<FileType>;
|
|
49
|
-
readonly imageMobile: Nullable<FileType>;
|
|
50
|
-
readonly categories: Category[];
|
|
51
|
-
readonly body: string;
|
|
52
|
-
readonly coverImage: Nullable<FileType>;
|
|
53
|
-
readonly relatedPosts: Pick<PostShort, 'id' | 'title'>[];
|
|
54
|
-
readonly tags: string[];
|
|
55
|
-
readonly additionalFields: FieldShortType<IncomingValueUnion>[];
|
|
56
|
-
readonly archiveAt: Nullable<string>;
|
|
57
|
-
readonly publishAt: Nullable<string>;
|
|
58
|
-
}
|
|
59
|
-
export interface Language {
|
|
60
|
-
readonly id: string;
|
|
61
|
-
readonly name: string;
|
|
62
|
-
}
|
|
63
|
-
export interface DefaultCategory {
|
|
64
|
-
readonly id: number;
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly language: string;
|
|
67
|
-
}
|
|
68
|
-
export interface FileScenarios {
|
|
69
|
-
readonly cover: Nullable<string>;
|
|
70
|
-
readonly image: Nullable<string>;
|
|
71
|
-
readonly imageMobile: Nullable<string>;
|
|
72
|
-
readonly content: Nullable<string>;
|
|
73
|
-
readonly openGraph: Nullable<string>;
|
|
74
|
-
}
|
|
75
|
-
export interface ModuleConfig {
|
|
76
|
-
readonly urlPostTemplate: Nullable<string>;
|
|
77
|
-
readonly urlCategoryTemplate: Nullable<string>;
|
|
78
|
-
readonly languages: Language[];
|
|
79
|
-
readonly defaultCategories: DefaultCategory[];
|
|
80
|
-
readonly fields: FieldConfigUnion[];
|
|
81
|
-
readonly shortcodes: ShortCodeItemType[];
|
|
82
|
-
readonly fileScenarios: FileScenarios;
|
|
83
|
-
}
|
|
84
|
-
export interface CategoryFormValues {
|
|
85
|
-
language: Nullable<OptionType>;
|
|
86
|
-
name: string;
|
|
87
|
-
parent: OptionType<Nullable<number>>;
|
|
88
|
-
urlAlias: string;
|
|
89
|
-
isDefault: boolean;
|
|
90
|
-
pageTitle: Nullable<string>;
|
|
91
|
-
pageDescription: Nullable<string>;
|
|
92
|
-
pageKeywords: Nullable<string>;
|
|
93
|
-
openGraphTitle: Nullable<string>;
|
|
94
|
-
openGraphDescription: Nullable<string>;
|
|
95
|
-
openGraphImage: Nullable<SingleFileInputValueType>;
|
|
96
|
-
}
|
|
97
|
-
export interface CategoryPayload {
|
|
98
|
-
language: Nullable<string>;
|
|
99
|
-
name: string;
|
|
100
|
-
parent: Nullable<number>;
|
|
101
|
-
urlAlias: Nullable<string>;
|
|
102
|
-
isDefault: boolean;
|
|
103
|
-
pageTitle: Nullable<string>;
|
|
104
|
-
pageDescription: Nullable<string>;
|
|
105
|
-
openGraphImage: Nullable<string>;
|
|
106
|
-
}
|
|
1
|
+
import { Nullable, FileType } from '@tager/admin-services';
|
|
2
|
+
import { FieldConfigUnion, FieldShortType, IncomingValueUnion } from '@tager/admin-dynamic-field';
|
|
3
|
+
import { OptionType, ShortCodeItemType, SingleFileInputValueType } from '@tager/admin-ui';
|
|
4
|
+
export interface SeoInfo {
|
|
5
|
+
readonly pageTitle: Nullable<string>;
|
|
6
|
+
readonly pageDescription: Nullable<string>;
|
|
7
|
+
readonly pageKeywords: Nullable<string>;
|
|
8
|
+
readonly openGraphTitle: Nullable<string>;
|
|
9
|
+
readonly openGraphDescription: Nullable<string>;
|
|
10
|
+
readonly openGraphImage: Nullable<FileType>;
|
|
11
|
+
}
|
|
12
|
+
export interface Category extends SeoInfo {
|
|
13
|
+
readonly id: number;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly isDefault: boolean;
|
|
16
|
+
readonly language: string;
|
|
17
|
+
readonly url: string;
|
|
18
|
+
readonly urlTemplate: string;
|
|
19
|
+
readonly urlAlias: string;
|
|
20
|
+
readonly postsCount: string;
|
|
21
|
+
readonly parent: Nullable<{
|
|
22
|
+
id: Nullable<number>;
|
|
23
|
+
name: string;
|
|
24
|
+
}>;
|
|
25
|
+
readonly depth: number;
|
|
26
|
+
}
|
|
27
|
+
export interface PostShort {
|
|
28
|
+
readonly id: number;
|
|
29
|
+
readonly title: string;
|
|
30
|
+
readonly url: string;
|
|
31
|
+
readonly excerpt: string;
|
|
32
|
+
readonly status: string;
|
|
33
|
+
readonly language: string;
|
|
34
|
+
readonly categories: Category[];
|
|
35
|
+
readonly datetime: string;
|
|
36
|
+
readonly image: Nullable<FileType>;
|
|
37
|
+
}
|
|
38
|
+
export interface PostFull extends SeoInfo {
|
|
39
|
+
readonly id: number;
|
|
40
|
+
readonly language: string;
|
|
41
|
+
readonly title: string;
|
|
42
|
+
readonly url: string;
|
|
43
|
+
readonly urlTemplate: string;
|
|
44
|
+
readonly urlAlias: string;
|
|
45
|
+
readonly datetime: string | null;
|
|
46
|
+
readonly status: string;
|
|
47
|
+
readonly excerpt: string;
|
|
48
|
+
readonly image: Nullable<FileType>;
|
|
49
|
+
readonly imageMobile: Nullable<FileType>;
|
|
50
|
+
readonly categories: Category[];
|
|
51
|
+
readonly body: string;
|
|
52
|
+
readonly coverImage: Nullable<FileType>;
|
|
53
|
+
readonly relatedPosts: Pick<PostShort, 'id' | 'title'>[];
|
|
54
|
+
readonly tags: string[];
|
|
55
|
+
readonly additionalFields: FieldShortType<IncomingValueUnion>[];
|
|
56
|
+
readonly archiveAt: Nullable<string>;
|
|
57
|
+
readonly publishAt: Nullable<string>;
|
|
58
|
+
}
|
|
59
|
+
export interface Language {
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
}
|
|
63
|
+
export interface DefaultCategory {
|
|
64
|
+
readonly id: number;
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly language: string;
|
|
67
|
+
}
|
|
68
|
+
export interface FileScenarios {
|
|
69
|
+
readonly cover: Nullable<string>;
|
|
70
|
+
readonly image: Nullable<string>;
|
|
71
|
+
readonly imageMobile: Nullable<string>;
|
|
72
|
+
readonly content: Nullable<string>;
|
|
73
|
+
readonly openGraph: Nullable<string>;
|
|
74
|
+
}
|
|
75
|
+
export interface ModuleConfig {
|
|
76
|
+
readonly urlPostTemplate: Nullable<string>;
|
|
77
|
+
readonly urlCategoryTemplate: Nullable<string>;
|
|
78
|
+
readonly languages: Language[];
|
|
79
|
+
readonly defaultCategories: DefaultCategory[];
|
|
80
|
+
readonly fields: FieldConfigUnion[];
|
|
81
|
+
readonly shortcodes: ShortCodeItemType[];
|
|
82
|
+
readonly fileScenarios: FileScenarios;
|
|
83
|
+
}
|
|
84
|
+
export interface CategoryFormValues {
|
|
85
|
+
language: Nullable<OptionType>;
|
|
86
|
+
name: string;
|
|
87
|
+
parent: OptionType<Nullable<number>>;
|
|
88
|
+
urlAlias: string;
|
|
89
|
+
isDefault: boolean;
|
|
90
|
+
pageTitle: Nullable<string>;
|
|
91
|
+
pageDescription: Nullable<string>;
|
|
92
|
+
pageKeywords: Nullable<string>;
|
|
93
|
+
openGraphTitle: Nullable<string>;
|
|
94
|
+
openGraphDescription: Nullable<string>;
|
|
95
|
+
openGraphImage: Nullable<SingleFileInputValueType>;
|
|
96
|
+
}
|
|
97
|
+
export interface CategoryPayload {
|
|
98
|
+
language: Nullable<string>;
|
|
99
|
+
name: string;
|
|
100
|
+
parent: Nullable<number>;
|
|
101
|
+
urlAlias: Nullable<string>;
|
|
102
|
+
isDefault: boolean;
|
|
103
|
+
pageTitle: Nullable<string>;
|
|
104
|
+
pageDescription: Nullable<string>;
|
|
105
|
+
openGraphImage: Nullable<string>;
|
|
106
|
+
}
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function generateNumberArray(length: number): Array<number>;
|
|
2
|
-
export declare function getNameWithDepth(name: string, depth: number): string;
|
|
1
|
+
export declare function generateNumberArray(length: number): Array<number>;
|
|
2
|
+
export declare function getNameWithDepth(name: string, depth: number): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function getBlogPostListUrl(): "/blog/posts";
|
|
2
|
+
export declare function getBlogPostFormUrl(params: {
|
|
3
|
+
postId: number | string;
|
|
4
|
+
}): string;
|
|
5
|
+
export declare function getBlogCategoryListUrl(): "/blog/categories";
|
|
6
|
+
export declare function getBlogCategoryFormUrl(params: {
|
|
7
|
+
categoryId: number | string;
|
|
8
|
+
}): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TFunction } from 'i18next';
|
|
2
|
-
import { Nullable } from '@tager/admin-services';
|
|
3
|
-
import { OptionType } from '@tager/admin-ui';
|
|
4
|
-
import { Category, CategoryFormValues, CategoryPayload } from '../../../typings/model';
|
|
5
|
-
export declare function convertCategoryToFormValues(category: Nullable<Category>, languageOptionList: OptionType[], t: TFunction): CategoryFormValues;
|
|
6
|
-
export declare function convertCategoryFormValuesToPayload(values: CategoryFormValues): CategoryPayload;
|
|
7
|
-
export declare function convertCategoryListToOptions(categoryList: Category[], languageId: Nullable<string>, t: TFunction): OptionType<Nullable<number>>[];
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
2
|
+
import { Nullable } from '@tager/admin-services';
|
|
3
|
+
import { OptionType } from '@tager/admin-ui';
|
|
4
|
+
import { Category, CategoryFormValues, CategoryPayload } from '../../../typings/model';
|
|
5
|
+
export declare function convertCategoryToFormValues(category: Nullable<Category>, languageOptionList: OptionType[], t: TFunction): CategoryFormValues;
|
|
6
|
+
export declare function convertCategoryFormValuesToPayload(values: CategoryFormValues): CategoryPayload;
|
|
7
|
+
export declare function convertCategoryListToOptions(categoryList: Category[], languageId: Nullable<string>, t: TFunction): OptionType<Nullable<number>>[];
|