@bbki.ng/site 5.4.54 → 5.5.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/CHANGELOG.md +19 -0
- package/package.json +2 -2
- package/src/blog/app.tsx +23 -2
- package/src/blog/components/article/index.tsx +1 -2
- package/src/blog/hooks/use_blog_context.ts +14 -0
- package/src/blog/hooks/use_posts.ts +12 -5
- package/src/blog/pages/streaming/index.tsx +13 -12
- package/src/blog/types/blog-context.ts +6 -0
- package/src/core/components/SlotComp.tsx +20 -0
- package/src/core/hooks/useSlotComp.ts +20 -0
- package/src/core/pluginManager.ts +80 -0
- package/src/core/registry.ts +97 -0
- package/src/plugins/manifest.ts +8 -0
- package/src/plugins/test/components/emoji.tsx +8 -0
- package/src/plugins/test/index.ts +22 -0
- package/src/types/hostApi.ts +17 -0
- package/src/types/plugin.ts +13 -0
- package/src/types/slots.ts +2 -0
- package/tsconfig.json +2 -1
- package/vite.config.js +1 -0
- package/src/blog/types/articles.ts +0 -6
- package/src/blog/types/color.ts +0 -21
- package/src/blog/types/cusdis.ts +0 -4
- package/src/blog/types/oss.ts +0 -15
- package/src/blog/types/photo.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @bbki.ng/site
|
|
2
2
|
|
|
3
|
+
## 5.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2caf775: add blog plugin
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [2caf775]
|
|
12
|
+
- @bbki.ng/ui@0.2.0
|
|
13
|
+
|
|
14
|
+
## 5.4.55
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- e08565d: update nav
|
|
19
|
+
- Updated dependencies [e08565d]
|
|
20
|
+
- @bbki.ng/ui@0.1.29
|
|
21
|
+
|
|
3
22
|
## 5.4.54
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "code behind bbki.ng",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react-dom": "^18.0.0",
|
|
15
15
|
"react-router-dom": "6",
|
|
16
16
|
"swr": "^2.2.5",
|
|
17
|
-
"@bbki.ng/ui": "0.
|
|
17
|
+
"@bbki.ng/ui": "0.2.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@eslint/compat": "^1.0.0",
|
package/src/blog/app.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
|
2
2
|
import { Outlet, Route, Routes } from 'react-router-dom';
|
|
3
3
|
import { Cover, Streaming } from './pages';
|
|
4
4
|
import { Nav, NotFound, Page, Grid, ErrorBoundary, Container } from '@bbki.ng/ui';
|
|
@@ -12,6 +12,8 @@ import { GlobalLoadingContext } from '@/context/global_loading_state_provider';
|
|
|
12
12
|
import { BotRedirect } from '@/pages/bot';
|
|
13
13
|
import { BBContext } from '@/context/bbcontext';
|
|
14
14
|
import { useDynamicLogo } from './hooks/use_dynamic_logo';
|
|
15
|
+
import { Slot } from '../core/components/SlotComp';
|
|
16
|
+
import { pluginManager } from '#/core/pluginManager';
|
|
15
17
|
|
|
16
18
|
const Layout = () => {
|
|
17
19
|
const paths = usePaths();
|
|
@@ -32,7 +34,18 @@ const Layout = () => {
|
|
|
32
34
|
/>
|
|
33
35
|
}
|
|
34
36
|
main={
|
|
35
|
-
<Grid
|
|
37
|
+
<Grid
|
|
38
|
+
leftAside={
|
|
39
|
+
<div className="py-32 px-6">
|
|
40
|
+
<Slot name="leftCol" data={paths} />
|
|
41
|
+
</div>
|
|
42
|
+
}
|
|
43
|
+
rightAside={
|
|
44
|
+
<div className="py-32 px-6">
|
|
45
|
+
<Slot name="rightCol" data={paths} />
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
48
|
+
>
|
|
36
49
|
<Container className="py-32">
|
|
37
50
|
<ErrorBoundary>
|
|
38
51
|
<Outlet />
|
|
@@ -45,6 +58,14 @@ const Layout = () => {
|
|
|
45
58
|
};
|
|
46
59
|
|
|
47
60
|
export const App = () => {
|
|
61
|
+
// useEffect(() => {
|
|
62
|
+
// pluginManager.loadPlugin('test');
|
|
63
|
+
|
|
64
|
+
// return () => {
|
|
65
|
+
// pluginManager.disablePlugin('test');
|
|
66
|
+
// };
|
|
67
|
+
// }, []);
|
|
68
|
+
|
|
48
69
|
return (
|
|
49
70
|
<SWR>
|
|
50
71
|
<BBContext>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ROUTES } from '@/constants';
|
|
2
|
+
import { Article, Link } from '@bbki.ng/ui';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { useNavigate } from 'react-router-dom';
|
|
6
5
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalLoadingContext } from '@/context/global_loading_state_provider';
|
|
2
|
+
import { IBlogContext } from '@/types/blog-context';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { useLocation } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
export const useBlogContext = (): IBlogContext => {
|
|
7
|
+
const globalLoading = useContext(GlobalLoadingContext);
|
|
8
|
+
const location = useLocation();
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
gloalLoading: globalLoading.isLoading,
|
|
12
|
+
location,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -26,11 +26,18 @@ export const usePosts = (name: string = '', suspense?: boolean) => {
|
|
|
26
26
|
const titleList =
|
|
27
27
|
isLoading || error || !data
|
|
28
28
|
? []
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
: [
|
|
30
|
+
...data.map((p: any) => ({
|
|
31
|
+
name: p.title,
|
|
32
|
+
to: p.title,
|
|
33
|
+
children: p.title,
|
|
34
|
+
})),
|
|
35
|
+
{
|
|
36
|
+
name: 'cd ~',
|
|
37
|
+
to: '/',
|
|
38
|
+
children: 'cd ~',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
34
41
|
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
setIsLoading(isLoading);
|
|
@@ -3,8 +3,9 @@ import { useStreaming, StreamingItem } from '@/hooks/use_streaming';
|
|
|
3
3
|
import { formatStreamingData } from '@/utils/streaming';
|
|
4
4
|
import { Button, Panel } from '@bbki.ng/ui';
|
|
5
5
|
import { useScrollBtnVisibility } from './useScrollBtnVisibility';
|
|
6
|
-
import
|
|
6
|
+
import { Link } from '@bbki.ng/ui';
|
|
7
7
|
import { ArrowDownIcon } from './arrow-down';
|
|
8
|
+
import classNames from 'classnames';
|
|
8
9
|
|
|
9
10
|
// Extend JSX IntrinsicElements for the web component
|
|
10
11
|
declare global {
|
|
@@ -79,17 +80,17 @@ const Streaming = () => {
|
|
|
79
80
|
{formattedData}
|
|
80
81
|
</bb-msg-history>
|
|
81
82
|
</Panel>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
<Link
|
|
84
|
+
className={classNames('w-fit relative opacity-0 transition-all duration-300 mt-16', {
|
|
85
|
+
'opacity-100': scrolled,
|
|
86
|
+
'opacity-0': showScrollBtn,
|
|
87
|
+
'pointer-events-none': showScrollBtn || !scrolled,
|
|
88
|
+
})}
|
|
89
|
+
to="/"
|
|
90
|
+
style={{ left: -4 }}
|
|
91
|
+
>
|
|
92
|
+
cd ..
|
|
93
|
+
</Link>
|
|
93
94
|
</>
|
|
94
95
|
);
|
|
95
96
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SlotName } from 'src/types/slots';
|
|
3
|
+
import { useSlotComp } from '../hooks/useSlotComp';
|
|
4
|
+
|
|
5
|
+
export interface ISlotProps {
|
|
6
|
+
name: SlotName;
|
|
7
|
+
data?: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Slot: React.FC<ISlotProps> = ({ name, data }) => {
|
|
11
|
+
const components = useSlotComp(name);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
{components.map((Component, index) => (
|
|
16
|
+
<Component key={index} data={data} />
|
|
17
|
+
))}
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SlotName } from 'src/types/slots';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { registry } from '../registry';
|
|
4
|
+
|
|
5
|
+
export const useSlotComp = (slotName: SlotName) => {
|
|
6
|
+
const [components, setComponents] = useState<React.ComponentType<any>[]>([]);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const unsubscribe = registry.subscribe(() => {
|
|
10
|
+
const comps = registry.getComponents(slotName);
|
|
11
|
+
setComponents(comps);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return () => {
|
|
15
|
+
unsubscribe();
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
|
|
19
|
+
return components;
|
|
20
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { IHostContext } from '#/types/hostApi';
|
|
2
|
+
import { registry } from './registry';
|
|
3
|
+
import type { SlotName, HookPoint } from '#/types/slots';
|
|
4
|
+
import { IPlugin } from '#/types/plugin';
|
|
5
|
+
|
|
6
|
+
class PluginManager {
|
|
7
|
+
private activePlugins: Map<string, IPlugin> = new Map();
|
|
8
|
+
|
|
9
|
+
private createHostContext(): IHostContext {
|
|
10
|
+
return {
|
|
11
|
+
api: {
|
|
12
|
+
registerMiddleware: (point: HookPoint, fn: Function, pluginId: string, weight = 0) => {
|
|
13
|
+
registry.registerMiddleware(point, fn, pluginId, weight);
|
|
14
|
+
},
|
|
15
|
+
registerSlot: (
|
|
16
|
+
slotName: SlotName,
|
|
17
|
+
component: React.ComponentType<any>,
|
|
18
|
+
pluginId: string,
|
|
19
|
+
weight = 0
|
|
20
|
+
) => {
|
|
21
|
+
registry.registerComponent(slotName, component, pluginId, weight);
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private loading = new Set<string>();
|
|
28
|
+
|
|
29
|
+
// enable abort ctrl
|
|
30
|
+
async loadPlugin(pluginId: string) {
|
|
31
|
+
if (this.activePlugins.has(pluginId)) {
|
|
32
|
+
console.warn(`Plugin ${pluginId} is already loaded.`);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (this.loading.has(pluginId)) {
|
|
37
|
+
console.warn(`Plugin ${pluginId} is loading...`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// try load plugin
|
|
42
|
+
this.loading.add(pluginId);
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const module = await import(`../plugins/${pluginId}`);
|
|
46
|
+
|
|
47
|
+
const p: IPlugin = module.default;
|
|
48
|
+
|
|
49
|
+
const ctx = this.createHostContext();
|
|
50
|
+
|
|
51
|
+
if (p.onInstall) {
|
|
52
|
+
p.onInstall(ctx);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this.activePlugins.set(pluginId, p);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error(`Failed to load plugin ${pluginId}:`, error);
|
|
58
|
+
} finally {
|
|
59
|
+
this.loading.delete(pluginId);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async disablePlugin(pluginId: string) {
|
|
64
|
+
const plugin = this.activePlugins.get(pluginId);
|
|
65
|
+
if (!plugin) {
|
|
66
|
+
console.warn(`Plugin ${pluginId} is not loaded.`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (plugin.onDisable) {
|
|
71
|
+
await plugin.onDisable();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
this.activePlugins.delete(pluginId);
|
|
75
|
+
|
|
76
|
+
registry.unregisterAllByPluginId(plugin.id);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const pluginManager = new PluginManager();
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { SlotName, HookPoint } from 'src/types/slots';
|
|
2
|
+
|
|
3
|
+
export interface ISlotEntry {
|
|
4
|
+
id: string;
|
|
5
|
+
component: React.ComponentType<any>;
|
|
6
|
+
pluginId: string;
|
|
7
|
+
weight: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IMiddlewareEntry {
|
|
11
|
+
id: string;
|
|
12
|
+
fn: Function;
|
|
13
|
+
pluginId: string;
|
|
14
|
+
weight?: number;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class Registry {
|
|
18
|
+
private slots = new Map<SlotName, ISlotEntry[]>();
|
|
19
|
+
|
|
20
|
+
private listeners = new Set<() => void>();
|
|
21
|
+
|
|
22
|
+
private middlewares = new Map<HookPoint, IMiddlewareEntry[]>();
|
|
23
|
+
|
|
24
|
+
private broadcastChange() {
|
|
25
|
+
this.listeners.forEach(listener => listener());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
subscribe(listener: () => void) {
|
|
29
|
+
this.listeners.add(listener);
|
|
30
|
+
return () => this.listeners.delete(listener);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
registerComponent(slot: SlotName, component: React.ComponentType, pluginId: string, weight = 0) {
|
|
34
|
+
const existing = this.slots.get(slot) || [];
|
|
35
|
+
|
|
36
|
+
const newEntry: ISlotEntry = {
|
|
37
|
+
id: `${pluginId}-${component.name || 'comp'}`,
|
|
38
|
+
pluginId,
|
|
39
|
+
component,
|
|
40
|
+
weight,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 插入并按权重排序(权重大的在前)
|
|
44
|
+
const newList = [...existing, newEntry].sort((a, b) => b.weight - a.weight);
|
|
45
|
+
this.slots.set(slot, newList);
|
|
46
|
+
|
|
47
|
+
this.broadcastChange();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
unregisterAllByPluginId(pluginId: string) {
|
|
51
|
+
// 1. 清理 UI 槽位
|
|
52
|
+
this.slots.forEach((entries, slotName) => {
|
|
53
|
+
const filtered = entries.filter(entry => entry.pluginId !== pluginId);
|
|
54
|
+
this.slots.set(slotName, filtered);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// 2. 清理中间件
|
|
58
|
+
this.middlewares.forEach((entries, point) => {
|
|
59
|
+
const filtered = entries.filter(entry => entry.pluginId !== pluginId);
|
|
60
|
+
this.middlewares.set(point, filtered);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
console.log(`[Registry] All resources for plugin "${pluginId}" have been cleared.`);
|
|
64
|
+
|
|
65
|
+
this.broadcastChange();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
registerMiddleware(hookPoint: HookPoint, fn: Function, pluginId: string, weight = 0) {
|
|
69
|
+
const existing = this.middlewares.get(hookPoint) || [];
|
|
70
|
+
|
|
71
|
+
const newEntry: IMiddlewareEntry = {
|
|
72
|
+
id: `${pluginId}-${fn.name || 'middleware'}`,
|
|
73
|
+
pluginId,
|
|
74
|
+
fn,
|
|
75
|
+
weight,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// 插入并按权重排序(权重大的在前)
|
|
79
|
+
const newList = [...existing, newEntry].sort((a, b) => (b.weight || 0) - (a.weight || 0));
|
|
80
|
+
this.middlewares.set(hookPoint, newList);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getComponents(slotName: SlotName): React.ComponentType<any>[] {
|
|
84
|
+
return (this.slots.get(slotName) || []).map(entry => entry.component);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async runMiddleware<T>(point: HookPoint, data: T): Promise<T> {
|
|
88
|
+
const fns = (this.middlewares.get(point) || []).map(entry => entry.fn);
|
|
89
|
+
let result = data;
|
|
90
|
+
for (const fn of fns) {
|
|
91
|
+
result = await fn(result);
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const registry = new Registry();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IHostContext } from '#/types/hostApi';
|
|
2
|
+
import { IPlugin } from '#/types/plugin';
|
|
3
|
+
import { Emoji } from './components/emoji';
|
|
4
|
+
|
|
5
|
+
class TestPlugin implements IPlugin {
|
|
6
|
+
id: string = 'test';
|
|
7
|
+
name: string = 'Test Plugin';
|
|
8
|
+
description?: string | undefined;
|
|
9
|
+
version: string = '0.1.0';
|
|
10
|
+
author?: string | undefined;
|
|
11
|
+
|
|
12
|
+
onInstall?: ((ctx: IHostContext) => void) | undefined = (ctx: IHostContext) => {
|
|
13
|
+
ctx.api.registerSlot('leftCol', Emoji, this.id);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
onDisable?: (() => Promise<void> | void) | undefined;
|
|
17
|
+
onDestroy?: (() => void) | undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const testPlugin = new TestPlugin();
|
|
21
|
+
|
|
22
|
+
export default testPlugin;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HookPoint, SlotName } from './slots';
|
|
2
|
+
|
|
3
|
+
export interface IHostApi {
|
|
4
|
+
registerMiddleware: (point: HookPoint, fn: Function, pluginId: string, weight?: number) => void;
|
|
5
|
+
registerSlot: (
|
|
6
|
+
slotName: SlotName,
|
|
7
|
+
component: React.ComponentType<any>,
|
|
8
|
+
pluginId: string,
|
|
9
|
+
weight?: number
|
|
10
|
+
) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type PluginInitializer = (api: IHostApi) => void;
|
|
14
|
+
|
|
15
|
+
export interface IHostContext {
|
|
16
|
+
api: IHostApi;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IHostContext } from './hostApi';
|
|
2
|
+
|
|
3
|
+
export interface IPlugin {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
version: string;
|
|
8
|
+
author?: string;
|
|
9
|
+
|
|
10
|
+
onInstall?: (ctx: IHostContext) => void;
|
|
11
|
+
onDisable?: () => Promise<void> | void;
|
|
12
|
+
onDestroy?: () => void;
|
|
13
|
+
}
|
package/tsconfig.json
CHANGED
package/vite.config.js
CHANGED
package/src/blog/types/color.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export enum TextColors {
|
|
2
|
-
GRAY = 'text-gray-400',
|
|
3
|
-
RED = 'text-red-500',
|
|
4
|
-
BLUE = 'text-blue-600',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum BgColors {
|
|
8
|
-
WHITE_GRAY = 'bg-gray-50',
|
|
9
|
-
LIGHT_GRAY = 'bg-gray-100',
|
|
10
|
-
GRAY = 'bg-gray-400',
|
|
11
|
-
RED = 'bg-red-500',
|
|
12
|
-
BLUE = 'bg-blue-600',
|
|
13
|
-
LIGHT_BLUE = 'bg-blue-300',
|
|
14
|
-
WHITE_BLUE = 'bg-blue-100',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum HoveredTextColors {
|
|
18
|
-
GRAY = 'hover:bg-gray-100',
|
|
19
|
-
RED = 'hover:bg-red-100',
|
|
20
|
-
BLUR = 'hover:bg-blue-100',
|
|
21
|
-
}
|
package/src/blog/types/cusdis.ts
DELETED
package/src/blog/types/oss.ts
DELETED
package/src/blog/types/photo.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ossProcessType } from '@/types/oss';
|
|
2
|
-
|
|
3
|
-
export interface Photo {
|
|
4
|
-
src: string;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
processType?: ossProcessType;
|
|
8
|
-
avgColor?: string;
|
|
9
|
-
thumbnailSrc?: string;
|
|
10
|
-
renderedWidth?: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PhotoProject {
|
|
14
|
-
name: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
images: Photo[];
|
|
17
|
-
}
|