@webx-ui/module-blog 0.6.2 → 0.7.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/ArticleAuthor.d.ts +1 -1
- package/dist/AuthorPane.d.ts +21 -0
- package/dist/AuthorsPage.d.ts +15 -0
- package/dist/authors.d.ts +46 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1711 -1192
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +6 -5
- package/dist/style.css +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +5 -5
package/dist/ArticleAuthor.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
10
10
|
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
12
|
disabled: boolean;
|
|
13
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
14
|
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AuthorRow } from './authors';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** `null` — a profile not written yet. */
|
|
4
|
+
id: number | null;
|
|
5
|
+
/** False in the drawer a narrow screen opens this in. */
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
saved: (author: AuthorRow) => any;
|
|
10
|
+
created: (author: AuthorRow) => any;
|
|
11
|
+
back: () => any;
|
|
12
|
+
removed: (id: number) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSaved?: ((author: AuthorRow) => any) | undefined;
|
|
15
|
+
onCreated?: ((author: AuthorRow) => any) | undefined;
|
|
16
|
+
onBack?: (() => any) | undefined;
|
|
17
|
+
onRemoved?: ((id: number) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
inline: boolean;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The authors: every profile on the left, the one being written on the right (§19.5 of the blog
|
|
3
|
+
* spec) — the shape of the team, without its order and its bin: the people who write one site are
|
|
4
|
+
* a short list, and a profile that goes takes nothing with it but a name on a page.
|
|
5
|
+
*
|
|
6
|
+
* The search and the open profile live in the address, so a link to an author — the one the panel
|
|
7
|
+
* on the site and the article editor make — is a link to them in their list.
|
|
8
|
+
*/
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
base?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
base: string;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AdminContext } from '@webx-ui/module-admin';
|
|
2
|
+
import { ScreenModel } from '@webx-ui/schema';
|
|
3
|
+
/** A profile as the list and the head of its form show it (§19.5 of the blog spec). */
|
|
4
|
+
export interface AuthorRow {
|
|
5
|
+
id: number;
|
|
6
|
+
/** The name a reader sees, in the panel's language or the nearest there is. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The account the profile belongs to — whose articles these are. */
|
|
9
|
+
user: {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
} | null;
|
|
13
|
+
/** The profile asked for a page. */
|
|
14
|
+
is_public: boolean;
|
|
15
|
+
/** The page answers: the profile asked and the site allows author pages. */
|
|
16
|
+
open: boolean;
|
|
17
|
+
/** Where the page is in the panel's language, whether or not it answers. */
|
|
18
|
+
url: string | null;
|
|
19
|
+
photo: string | null;
|
|
20
|
+
articles_count: number;
|
|
21
|
+
}
|
|
22
|
+
/** One profile as its form opens it: the row, and the values of `blog.author-form`. */
|
|
23
|
+
export interface AuthorDetail {
|
|
24
|
+
author: AuthorRow;
|
|
25
|
+
values: ScreenModel;
|
|
26
|
+
}
|
|
27
|
+
/** An account a new profile can be made for. */
|
|
28
|
+
export interface AuthorAccount {
|
|
29
|
+
id: number;
|
|
30
|
+
name: string;
|
|
31
|
+
articles_count: number;
|
|
32
|
+
}
|
|
33
|
+
export interface AuthorsApi {
|
|
34
|
+
list(q?: string): Promise<AuthorRow[]>;
|
|
35
|
+
/** The accounts without a profile, the ones who wrote something first. */
|
|
36
|
+
accounts(): Promise<AuthorAccount[]>;
|
|
37
|
+
get(id: number): Promise<AuthorDetail>;
|
|
38
|
+
/** A profile for an account, out of the values of its form, in one request. */
|
|
39
|
+
create(userId: number, values: ScreenModel): Promise<AuthorDetail>;
|
|
40
|
+
/** Refused with a 422 under the name of the field. */
|
|
41
|
+
save(id: number, values: ScreenModel): Promise<AuthorDetail>;
|
|
42
|
+
/** The profile goes; the articles stay the account's. */
|
|
43
|
+
remove(id: number): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
/** Everything under `/blog/authors`, below the panel's API path. */
|
|
46
|
+
export declare function createAuthorsApi(admin: AdminContext): AuthorsApi;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export { blog, rubricsOptions, type BlogOptions } from './module';
|
|
2
2
|
export { createBlogApi, type BlogApi } from './api';
|
|
3
|
+
export { createAuthorsApi, type AuthorAccount, type AuthorDetail, type AuthorRow, type AuthorsApi, } from './authors';
|
|
3
4
|
export { blogMessages } from './messages';
|
|
4
5
|
export { articleEditorKey, provideArticleEditor, useArticleEditor, type ArticleEditorContext, } from './editor';
|
|
5
6
|
export { default as WxArticlesPage } from './ArticlesPage';
|
|
6
7
|
export { default as WxTagsPage } from './TagsPage';
|
|
8
|
+
export { default as WxAuthorsPage } from './AuthorsPage';
|
|
9
|
+
export { default as WxAuthorPane } from './AuthorPane';
|
|
7
10
|
export { default as WxTagCreateDialog } from './TagCreateDialog';
|
|
8
11
|
export { default as WxTagMergeDialog } from './TagMergeDialog';
|
|
9
12
|
export { default as WxArticleCreateDialog } from './ArticleCreateDialog';
|