delta-comic-core 0.0.6 → 0.0.9

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.
@@ -14,7 +14,7 @@ export declare class ConfigPointer<T extends ConfigDescription = ConfigDescripti
14
14
  export declare const appConfig: ConfigPointer<{
15
15
  recordHistory: {
16
16
  type: "switch";
17
- defaultValue: false;
17
+ defaultValue: true;
18
18
  info: string;
19
19
  };
20
20
  showAIProject: {
package/dist/index.d.ts CHANGED
@@ -2277,7 +2277,7 @@ export declare const Store: {
2277
2277
  appConfig: ConfigPointer<{
2278
2278
  recordHistory: {
2279
2279
  type: "switch";
2280
- defaultValue: false;
2280
+ defaultValue: true;
2281
2281
  info: string;
2282
2282
  };
2283
2283
  showAIProject: {
package/dist/pack.tgz CHANGED
Binary file
@@ -3,7 +3,7 @@ import { ProcessInstance } from '../struct/image';
3
3
  import { CommentRow } from '../struct/comment';
4
4
  import { UserCardComp } from '../struct/user';
5
5
  import { RStream, RPromiseContent } from '../utils/data';
6
- import { Item, RawItem } from '../struct/item';
6
+ import { Item, RawItem, Author } from '../struct/item';
7
7
  import { Component, MaybeRefOrGetter } from 'vue';
8
8
  import { ConfigPointer } from '../config';
9
9
  export type PluginDefineResult = {
@@ -27,14 +27,27 @@ export interface PluginConfig {
27
27
  * 传入`Store.ConfigPointer`
28
28
  */
29
29
  config?: ConfigPointer[];
30
+ subscribe?: Record<string, PluginConfigSubscribe>;
31
+ }
32
+ export interface PluginConfigSubscribe {
33
+ getUpdateList(olds: {
34
+ author: Author;
35
+ list: Item[];
36
+ }[], signal?: AbortSignal): PromiseLike<{
37
+ isUpdated: boolean;
38
+ whichUpdated: Author[];
39
+ }>;
40
+ onAdd?(author: Author): any;
41
+ onRemove?(author: Author): any;
42
+ getListStream(author: Author): RStream<Item>;
30
43
  }
31
44
  export interface PluginOtherProgress {
32
45
  call: (setDescription: (description: string) => void) => PromiseLike<any>;
33
46
  name: string;
34
47
  }
35
48
  export interface PluginConfigUser {
36
- edit: Component;
37
- card: UserCardComp;
49
+ edit?: Component;
50
+ card?: UserCardComp;
38
51
  /**
39
52
  * 1. download
40
53
  * 2. upload (收藏那些云端未收藏的漫画)
@@ -47,6 +60,13 @@ export interface PluginConfigUser {
47
60
  * 在用户界面,在历史记录那个板块的下方,你希望展示的自己的板块
48
61
  */
49
62
  userActionPages?: PluginUserActionPage[];
63
+ authorActions?: Record<string, AuthorAction>;
64
+ authorIcon?: Record<string, Component>;
65
+ }
66
+ export interface AuthorAction {
67
+ call(author: Author): any;
68
+ name: string;
69
+ icon?: Component;
50
70
  }
51
71
  export interface PluginUserActionPage {
52
72
  title?: string;
@@ -121,10 +141,10 @@ export interface PluginConfigSearchMethod {
121
141
  }[];
122
142
  defaultSort: string;
123
143
  getStream(input: string, sort: string): RStream<Item>;
124
- getAutoComplete(input: string, signal: AbortSignal): PromiseLike<{
144
+ getAutoComplete(input: string, signal: AbortSignal): PromiseLike<({
125
145
  text: string;
126
146
  value: string;
127
- }[]>;
147
+ } | Component)[]>;
128
148
  }
129
149
  export interface PluginConfigApi {
130
150
  forks: () => (PromiseLike<string[]> | string[]);
@@ -1,6 +1,7 @@
1
1
  import { Component, StyleValue } from 'vue';
2
2
  import { RStream } from '../utils/data';
3
3
  import { uni } from '.';
4
+ import { AudioSrc, MediaSrc, TextTrackInit } from 'vidstack';
4
5
  import { PluginConfigSearchCategory, PluginConfigSearchHotPageLevelboard, PluginConfigSearchHotPageMainList, PluginConfigSearchHotPageTopButton, PluginConfigSearchTabbar } from '../plugin/define';
5
6
  import * as item from './item';
6
7
  import * as ep from './ep';
@@ -83,3 +84,12 @@ export type ItemCardComp = Component<{
83
84
  smallTopInfo(): void;
84
85
  cover(): void;
85
86
  }>;
87
+ export type VideoConfig = {
88
+ textTrack?: TextTrackInit[];
89
+ } & (Exclude<MediaSrc, string | AudioSrc>[]);
90
+ export declare abstract class ContentImagePage extends ContentPage {
91
+ images: import('../utils/data').PromiseWithResolvers<uni.image.Image[]>;
92
+ }
93
+ export declare abstract class ContentVideoPage extends ContentPage {
94
+ videos: import('../utils/data').PromiseWithResolvers<uni.content.VideoConfig>;
95
+ }
@@ -2,6 +2,7 @@ import { Struct, MetaData } from '../utils/data';
2
2
  import { default as dayjs } from 'dayjs';
3
3
  import { ContentType, ContentType_ } from './content';
4
4
  import { Ep, RawEp } from './ep';
5
+ import { Component } from 'vue';
5
6
  import * as image from "./image";
6
7
  export interface Category {
7
8
  name: string;
@@ -12,13 +13,24 @@ export interface Category {
12
13
  sort: string;
13
14
  };
14
15
  }
16
+ export interface Author {
17
+ label: string;
18
+ icon: image.RawImage | string;
19
+ description: string;
20
+ /**
21
+ * 为空则不可订阅
22
+ * 否则传入的为`defineConfig`中定义的`subscribe.type`
23
+ */ subscribe?: string;
24
+ actions?: string[];
25
+ $$meta?: MetaData;
26
+ }
15
27
  export interface RawItem {
16
28
  cover: image.RawImage;
17
29
  title: string;
18
30
  id: string;
19
31
  /** @alias tags */
20
32
  categories: Category[];
21
- author: string[];
33
+ author: Author[];
22
34
  viewNumber?: number;
23
35
  likeNumber?: number;
24
36
  commentNumber?: number;
@@ -36,6 +48,9 @@ export interface RawItem {
36
48
  customIsSafe?: boolean;
37
49
  }
38
50
  export declare abstract class Item extends Struct<RawItem> implements RawItem {
51
+ static authorIcon: import('vue').ShallowReactive<Map<string, Component>>;
52
+ static getAuthorIcon(plugin: string, name: string): Component | undefined;
53
+ static setAuthorIcon(plugin: string, name: string, icon: Component): void;
39
54
  abstract like(signal?: AbortSignal): PromiseLike<boolean>;
40
55
  abstract report(signal?: AbortSignal): PromiseLike<any>;
41
56
  abstract sendComment(text: string, signal?: AbortSignal): PromiseLike<any>;
@@ -45,7 +60,7 @@ export declare abstract class Item extends Struct<RawItem> implements RawItem {
45
60
  title: string;
46
61
  id: string;
47
62
  categories: Category[];
48
- author: string[];
63
+ author: Author[];
49
64
  viewNumber?: number;
50
65
  likeNumber?: number;
51
66
  commentNumber?: number;
@@ -1,3 +1,4 @@
1
+ import { AuthorAction, PluginConfigSubscribe } from '../plugin/define';
1
2
  import { uni } from '.';
2
3
  import { Image, RawImage } from './image';
3
4
  import { Component } from 'vue';
@@ -10,6 +11,12 @@ export interface RawUser {
10
11
  export declare abstract class User {
11
12
  static userBase: import('vue').ShallowReactive<Map<string, uni.user.User>>;
12
13
  static userEditorBase: import('vue').ShallowReactive<Map<string, Component>>;
14
+ static subscribes: import('vue').ShallowReactive<Map<string, PluginConfigSubscribe>>;
15
+ static setSubscribes(plugin: string, type: string, config: PluginConfigSubscribe): void;
16
+ static getSubscribes(plugin: string, type: string): PluginConfigSubscribe | undefined;
17
+ static authorActions: import('vue').ShallowReactive<Map<string, AuthorAction>>;
18
+ static setAuthorActions(plugin: string, type: string, config: AuthorAction): void;
19
+ static getAuthorActions(plugin: string, type: string): AuthorAction | undefined;
13
20
  constructor(v: RawUser);
14
21
  avatar?: Image;
15
22
  name: string;
@@ -13,6 +13,9 @@ export type SharedFunctions = {
13
13
  addRecent(item: uni.item.Item): PromiseLike<any>;
14
14
  routeToContent(contentType_: uni.content.ContentType_, id: string, ep: string, preload?: uni.content.PreloadValue): PromiseLike<any>;
15
15
  routeToSearch(input: string, source?: string, sort?: string): PromiseLike<any>;
16
+ addAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
17
+ removeAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<void>;
18
+ getIsAuthorSubscribe(author: uni.item.Author, plugin: string): PromiseLike<boolean>;
16
19
  };
17
20
  export declare class SharedFunction {
18
21
  private static sharedFunctions;
@@ -38,7 +38,9 @@ export declare namespace utilInterceptors {
38
38
  const _ = 1;
39
39
  }
40
40
  export type Requester = ReturnType<typeof createAxios>;
41
- export declare const createAxios: (fork: () => Promise<string> | string, config?: CreateAxiosDefaults, middle?: (axios: AxiosInstance) => AxiosInstance) => {
41
+ export declare const createAxios: (fork: () => Promise<string> | string, config?: CreateAxiosDefaults & Partial<{
42
+ noPassClientError: boolean;
43
+ }>, middle?: (axios: AxiosInstance) => AxiosInstance) => {
42
44
  get: <T>(url: string, config?: AxiosRequestConfig) => Promise<T>;
43
45
  post: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
44
46
  postForm: <T>(url: string, data?: any, config?: AxiosRequestConfig) => Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delta-comic-core",
3
- "version": "0.0.6",
3
+ "version": "0.0.9",
4
4
  "description": "我曾亲眼见证神的熟视无睹.",
5
5
  "homepage": "https://github.com/wenxig/delta-comic-core",
6
6
  "repository": {
@@ -18,12 +18,13 @@
18
18
  "@vueuse/core": "14.0.0",
19
19
  "dayjs": "^1.11.18",
20
20
  "mitt": "^3.0.1",
21
- "tailwindcss-safe-area-capacitor": "^0.5.1"
21
+ "tailwindcss-safe-area-capacitor": "^0.5.1",
22
+ "vidstack": "^1.12.13"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "axios": "^1.12.2",
25
- "es-toolkit": "^1.40.0",
26
26
  "crypto-js": "4.2.0",
27
+ "es-toolkit": "^1.40.0",
27
28
  "motion-v": "1.7.3",
28
29
  "naive-ui": "2.43.1",
29
30
  "pinia": "^3.0.3",
@@ -41,7 +42,7 @@
41
42
  "lightningcss": "^1.30.2",
42
43
  "tailwindcss": "^4.1.14",
43
44
  "unplugin-vue-components": "30.0.0",
44
- "vite": "npm:rolldown-vite@^7.1.19",
45
+ "vite": "npm:rolldown-vite@^7.1.20",
45
46
  "vite-plugin-dts": "^4.5.4",
46
47
  "vue-component-type-helpers": "^3.1.1"
47
48
  },