@tager/admin-blog 0.3.41 → 1.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.
Files changed (84) hide show
  1. package/dist/constants/paths.d.ts +6 -14
  2. package/dist/constants/routes.d.ts +5 -5
  3. package/dist/dev/App.vue.d.ts +5 -0
  4. package/dist/dev/config.d.ts +2 -0
  5. package/dist/dev/env.d.ts +1 -0
  6. package/dist/dev/main.d.ts +3 -0
  7. package/dist/hooks/index.d.ts +4 -4
  8. package/dist/hooks/useFetchCategories.d.ts +3 -6
  9. package/dist/hooks/useFetchCategory.d.ts +7 -8
  10. package/dist/hooks/useFetchModuleConfig.d.ts +3 -6
  11. package/dist/hooks/useFetchPosts.d.ts +3 -6
  12. package/dist/index.mjs +2363 -0
  13. package/dist/locales/apply.d.ts +1 -0
  14. package/dist/locales/en.d.ts +87 -80
  15. package/dist/locales/ru.d.ts +3 -3
  16. package/dist/main.d.ts +3 -4
  17. package/dist/services/requests.d.ts +59 -57
  18. package/dist/style.css +1 -0
  19. package/dist/typings/common.d.ts +1 -1
  20. package/dist/typings/model.d.ts +106 -104
  21. package/dist/utils/common.d.ts +2 -2
  22. package/dist/utils/paths.d.ts +8 -0
  23. package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +7 -7
  24. package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +53 -116
  25. package/dist/views/Categories/CategoryForm/index.d.ts +1 -1
  26. package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +7 -7
  27. package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +26 -57
  28. package/dist/views/Categories/CategoryList/hooks/index.d.ts +1 -1
  29. package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +19 -16
  30. package/dist/views/Categories/CategoryList/index.d.ts +1 -1
  31. package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +32 -30
  32. package/dist/views/Posts/PostForm/PostForm.vue.d.ts +2768 -9394
  33. package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +5 -5
  34. package/dist/views/Posts/PostForm/components/TabList/TabList.vue.d.ts +23 -0
  35. package/dist/views/Posts/PostForm/components/TabList/index.d.ts +2 -2
  36. package/dist/views/Posts/PostForm/index.d.ts +1 -1
  37. package/dist/views/Posts/PostList/PostList.helpers.d.ts +7 -7
  38. package/dist/views/Posts/PostList/PostList.vue.d.ts +38 -71
  39. package/dist/views/Posts/PostList/hooks/index.d.ts +1 -1
  40. package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +27 -24
  41. package/dist/views/Posts/PostList/index.d.ts +1 -1
  42. package/package.json +51 -49
  43. package/src/constants/paths.ts +0 -22
  44. package/src/constants/routes.ts +9 -9
  45. package/src/dev/App.vue +56 -0
  46. package/src/dev/config.ts +23 -0
  47. package/src/dev/env.ts +17 -0
  48. package/src/dev/main.ts +49 -0
  49. package/src/hooks/useFetchCategories.ts +2 -7
  50. package/src/hooks/useFetchCategory.ts +3 -6
  51. package/src/hooks/useFetchModuleConfig.ts +2 -7
  52. package/src/hooks/useFetchPosts.ts +2 -5
  53. package/src/locales/apply.ts +9 -0
  54. package/src/locales/en.ts +10 -3
  55. package/src/locales/ru.ts +11 -2
  56. package/src/main.ts +3 -8
  57. package/src/services/requests.ts +2 -0
  58. package/src/typings/model.ts +2 -0
  59. package/src/utils/paths.ts +23 -0
  60. package/src/views/Categories/CategoryForm/CategoryForm.vue +81 -61
  61. package/src/views/Categories/CategoryList/CategoryList.helpers.ts +1 -1
  62. package/src/views/Categories/CategoryList/CategoryList.vue +86 -58
  63. package/src/views/Categories/CategoryList/hooks/useAdvancedSearch.ts +9 -12
  64. package/src/views/Posts/PostForm/PostForm.helpers.ts +15 -7
  65. package/src/views/Posts/PostForm/PostForm.vue +191 -112
  66. package/src/views/Posts/PostForm/components/TabList/TabList.vue +2 -2
  67. package/src/views/Posts/PostList/PostList.helpers.ts +9 -10
  68. package/src/views/Posts/PostList/PostList.vue +138 -105
  69. package/src/views/Posts/PostList/hooks/useAdvancedSearch.ts +22 -30
  70. package/CHANGELOG.md +0 -13
  71. package/dist/constants/menu.d.ts +0 -5
  72. package/dist/dev.d.ts +0 -1
  73. package/dist/index.esm.js +0 -5144
  74. package/dist/index.umd.js +0 -5171
  75. package/dist/router/index.d.ts +0 -4
  76. package/src/constants/menu.ts +0 -31
  77. package/src/dev.ts +0 -34
  78. package/src/router/index.ts +0 -40
  79. package/src/typings/sfc.d.ts +0 -12
  80. package/src/typings/shims-tsx.d.ts +0 -13
  81. package/src/typings/shims-vue.d.ts +0 -11
  82. package/src/typings/translate.d.ts +0 -10
  83. package/src/views/App.vue +0 -22
  84. package/src/views/Home.vue +0 -31
@@ -1,4 +0,0 @@
1
- import { CustomRouteConfig } from '@tager/admin-layout';
2
- export declare const HOME_ROUTE: CustomRouteConfig;
3
- declare const router: import("vue-router").default;
4
- export default router;
@@ -1,31 +0,0 @@
1
- import { MenuItemType } from '@tager/admin-layout';
2
- import { TranslateFunction } from '@tager/admin-services';
3
-
4
- import {
5
- getBlogCategoryFormUrl,
6
- getBlogCategoryListUrl,
7
- getBlogPostFormUrl,
8
- getBlogPostListUrl,
9
- } from './paths';
10
-
11
- export function getBlogMenuItem(params: {
12
- t: TranslateFunction;
13
- }): MenuItemType {
14
- return {
15
- id: 'blog',
16
- text: params.t('blog:blog'),
17
- icon: 'viewList',
18
- children: [
19
- {
20
- text: params.t('blog:createPost'),
21
- url: getBlogPostFormUrl({ postId: 'create' }),
22
- },
23
- { text: params.t('blog:posts'), url: getBlogPostListUrl() },
24
- {
25
- text: params.t('blog:createCategory'),
26
- url: getBlogCategoryFormUrl({ categoryId: 'create' }),
27
- },
28
- { text: params.t('blog:categories'), url: getBlogCategoryListUrl() },
29
- ],
30
- };
31
- }
package/src/dev.ts DELETED
@@ -1,34 +0,0 @@
1
- import Vue, { CreateElement } from 'vue';
2
- import VueCompositionApi, { createApp } from '@vue/composition-api';
3
-
4
- import { configStore, i18n } from '@tager/admin-services';
5
- import { AdminUiPlugin } from '@tager/admin-ui';
6
- import { AdminLayoutPlugin } from '@tager/admin-layout';
7
-
8
- import '@tager/admin-ui/dist/admin-ui.css';
9
-
10
- import router from './router';
11
- import config from './config/config.json';
12
- import App from './views/App.vue';
13
- import EN from './locales/en';
14
- import RU from './locales/ru';
15
-
16
- configStore.setConfig(config);
17
-
18
- Vue.use(VueCompositionApi);
19
-
20
- i18n.addTranslations('en', 'blog', EN);
21
- i18n.addTranslations('ru', 'blog', RU);
22
-
23
- i18n.init({ debug: false }).then(() => {
24
- const app = createApp({
25
- router,
26
- render: (h: CreateElement) => h(App),
27
- });
28
-
29
- app.use(i18n.getPlugin());
30
- app.use(AdminUiPlugin);
31
- app.use(AdminLayoutPlugin);
32
-
33
- app.mount('#app');
34
- });
@@ -1,40 +0,0 @@
1
- import {
2
- createRouter,
3
- CustomRoute,
4
- CustomRouteConfig,
5
- } from '@tager/admin-layout';
6
-
7
- import Home from '@/views/Home.vue';
8
-
9
- import {
10
- BLOG_CATEGORY_FORM_ROUTE,
11
- BLOG_CATEGORY_LIST_ROUTE,
12
- BLOG_POST_FORM_ROUTE,
13
- BLOG_POST_LIST_ROUTE,
14
- } from '../constants/routes';
15
-
16
- export const HOME_ROUTE: CustomRouteConfig = {
17
- path: '/',
18
- component: Home,
19
- name: 'Home',
20
- meta: {
21
- getBreadcrumbs: (route: CustomRoute) => [
22
- { url: '/', text: route.name ?? '' },
23
- ],
24
- },
25
- };
26
-
27
- const router = createRouter(
28
- {
29
- routes: [
30
- HOME_ROUTE,
31
- BLOG_POST_LIST_ROUTE,
32
- BLOG_POST_FORM_ROUTE,
33
- BLOG_CATEGORY_LIST_ROUTE,
34
- BLOG_CATEGORY_FORM_ROUTE,
35
- ],
36
- },
37
- { useTitleSync: false }
38
- );
39
-
40
- export default router;
@@ -1,12 +0,0 @@
1
- /** Reference: https://stackoverflow.com/a/53999913 */
2
- // 1. Make sure to import 'vue' before declaring augmented types
3
- import Vue from 'vue';
4
-
5
- // 2. Specify a file with the types you want to augment
6
- // Vue has the constructor type in types/vue.d.ts
7
- declare module 'vue/types/vue' {
8
- // 3. Declare augmentation for Vue
9
- interface Vue {
10
- $style: { [key: string]: string };
11
- }
12
- }
@@ -1,13 +0,0 @@
1
- import Vue, { VNode } from 'vue';
2
-
3
- declare global {
4
- namespace JSX {
5
- // tslint:disable no-empty-interface
6
- interface Element extends VNode {}
7
- // tslint:disable no-empty-interface
8
- interface ElementClass extends Vue {}
9
- interface IntrinsicElements {
10
- [elem: string]: any;
11
- }
12
- }
13
- }
@@ -1,11 +0,0 @@
1
- declare module '*.vue' {
2
- // eslint-disable-next-line import/order
3
- import Vue from 'vue';
4
- export default Vue;
5
- }
6
-
7
- declare module '*.svg' {
8
- import Vue, { VueConstructor } from 'vue';
9
- const content: VueConstructor<Vue>;
10
- export default content;
11
- }
@@ -1,10 +0,0 @@
1
- import { TFunction } from 'i18next';
2
-
3
- declare module 'vue/types/vue' {
4
- interface Vue {
5
- $t: TFunction;
6
- }
7
- interface VueConstructor {
8
- $t: TFunction;
9
- }
10
- }
package/src/views/App.vue DELETED
@@ -1,22 +0,0 @@
1
- <template>
2
- <page-layout :sidebar-menu-list="sidebarMenuList">
3
- <router-view />
4
- </page-layout>
5
- </template>
6
-
7
- <script lang="ts">
8
- import { defineComponent, SetupContext } from '@vue/composition-api';
9
-
10
- import { getBlogMenuItem } from '../constants/menu';
11
-
12
- export default defineComponent({
13
- name: 'App',
14
- setup(props, context: SetupContext) {
15
- const blogMenuItem = getBlogMenuItem({ t: context.root.$t });
16
-
17
- return {
18
- sidebarMenuList: [blogMenuItem],
19
- };
20
- },
21
- });
22
- </script>
@@ -1,31 +0,0 @@
1
- <template>
2
- <navigation-grid :nav-items="navItemList" />
3
- </template>
4
-
5
- <script lang="ts">
6
- import { defineComponent, ref } from '@vue/composition-api';
7
-
8
- import { NavigationGridItem } from '@tager/admin-ui';
9
-
10
- import { getBlogCategoryListUrl, getBlogPostListUrl } from '../constants/paths';
11
-
12
- export default defineComponent({
13
- name: 'Home',
14
- setup(props, context) {
15
- const navItemList = ref<NavigationGridItem[]>([
16
- {
17
- name: context.root.$t('blog:blog'),
18
- linkList: [
19
- { url: getBlogPostListUrl(), text: context.root.$t('blog:posts') },
20
- {
21
- url: getBlogCategoryListUrl(),
22
- text: context.root.$t('blog:categories'),
23
- },
24
- ],
25
- },
26
- ]);
27
-
28
- return { navItemList };
29
- },
30
- });
31
- </script>