@bbki.ng/site 5.8.3 → 5.8.5
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 +14 -0
- package/package.json +2 -2
- package/src/app/app.tsx +4 -8
- package/src/app/components/BaseLayout.tsx +2 -3
- package/src/app/components/cover/index.tsx +23 -15
- package/src/app/hooks/use_plugin_entries.ts +21 -26
- package/src/core/hooks/use_plugins.ts +11 -1
- package/src/core/plugin-system/services/systemUIService.ts +28 -34
- package/src/core/shared-service/contract/IUIService.ts +9 -6
- package/src/plugins/store/components/ArrowCom.tsx +15 -0
- package/src/plugins/store/components/ArrowSvg.tsx +1133 -0
- package/src/plugins/store/components/storeIcon.tsx +16 -0
- package/src/plugins/store/index.ts +6 -1
- package/src/types/slots.ts +0 -17
- package/src/utils/index.tsx +0 -20
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Link } from '@bbki.ng/ui';
|
|
2
|
+
|
|
3
|
+
const CupIcon = () => (
|
|
4
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
|
|
5
|
+
<path d="M8.75 8h6.5a.75.75 0 0 1 .75.75v6.5a.75.75 0 0 1-.75.75h-6.5a.75.75 0 0 1-.75-.75v-6.5A.75.75 0 0 1 8.75 8Zm.75 6.5h5v-5h-5Z"></path>
|
|
6
|
+
<path d="M15.25 1a.75.75 0 0 1 .75.75V4h2.25c.966 0 1.75.784 1.75 1.75V8h2.25a.75.75 0 0 1 0 1.5H20v5h2.25a.75.75 0 0 1 0 1.5H20v2.25A1.75 1.75 0 0 1 18.25 20H16v2.25a.75.75 0 0 1-1.5 0V20h-5v2.25a.75.75 0 0 1-1.5 0V20H5.75A1.75 1.75 0 0 1 4 18.25V16H1.75a.75.75 0 0 1 0-1.5H4v-5H1.75a.75.75 0 0 1 0-1.5H4V5.75C4 4.784 4.784 4 5.75 4H8V1.75a.75.75 0 0 1 1.5 0V4h5V1.75a.75.75 0 0 1 .75-.75Zm3 17.5a.25.25 0 0 0 .25-.25V5.75a.25.25 0 0 0-.25-.25H5.75a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25Z"></path>
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export const StoreIcon = () => {
|
|
11
|
+
return (
|
|
12
|
+
<Link to="/store" className="flex items-center">
|
|
13
|
+
<CupIcon />
|
|
14
|
+
</Link>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -2,6 +2,8 @@ import { BBPlugin } from '#/core/plugin-system/bbplugin';
|
|
|
2
2
|
import { IHostContext } from '#/types/hostApi';
|
|
3
3
|
import { PluginID } from '#/types/plugin';
|
|
4
4
|
|
|
5
|
+
import { ArrowCom } from './components/ArrowCom';
|
|
6
|
+
import { StoreIcon } from './components/storeIcon';
|
|
5
7
|
import { StorePage } from './components/storePage';
|
|
6
8
|
import { StoreCtx } from './context';
|
|
7
9
|
|
|
@@ -20,10 +22,13 @@ export class StorePlugin extends BBPlugin {
|
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
systemUIService.registerSlot('nav-right', StoreIcon, this.id);
|
|
26
|
+
|
|
27
|
+
systemUIService.registerSlot('centerEntryArea', ArrowCom, this.id);
|
|
28
|
+
|
|
23
29
|
systemUIService.registerPluginEntry(
|
|
24
30
|
{
|
|
25
31
|
path: '/store',
|
|
26
|
-
label: 'cd ./store',
|
|
27
32
|
pageComponent: StoreCtx.withCtx(
|
|
28
33
|
{
|
|
29
34
|
install: ctx.store?.installPlugin || (async () => false),
|
package/src/types/slots.ts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
export type SlotName =
|
|
2
|
-
| 'leftCol'
|
|
3
|
-
| 'rightCol'
|
|
4
|
-
| 'articleActionRow'
|
|
5
|
-
| 'logo'
|
|
6
|
-
| 'route'
|
|
7
|
-
| 'pageFooter'
|
|
8
|
-
| 'articleTitle';
|
|
9
|
-
|
|
10
|
-
export type HookPoint =
|
|
11
|
-
| 'filterPosts'
|
|
12
|
-
| 'transformPostContent'
|
|
13
|
-
| 'transformBreadcrumbPath'
|
|
14
|
-
| 'transformTitleList'
|
|
15
|
-
| 'extendedRoutes'
|
|
16
|
-
| 'transformCoverEntry';
|
|
17
|
-
|
|
18
1
|
export interface IComPropsRegisteredToSlot {
|
|
19
2
|
data: unknown;
|
|
20
3
|
}
|
package/src/utils/index.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PathRouteProps } from 'react-router-dom';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { IPluginEntry } from '#/types/plugin';
|
|
5
|
-
import { IComPropsRegisteredToSlot } from '#/types/slots';
|
|
6
|
-
|
|
7
|
-
export const buildEntrySlotCom = (entry: IPluginEntry) => {
|
|
8
|
-
const Component = (props: IComPropsRegisteredToSlot) => {
|
|
9
|
-
const route = props.data as Omit<PathRouteProps, 'element'>;
|
|
10
|
-
if (route.path === entry.path) {
|
|
11
|
-
const Com = entry.pageComponent;
|
|
12
|
-
return <Com data={props.data} />;
|
|
13
|
-
}
|
|
14
|
-
return null;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
Component.displayName = `EntrySlotCom(${entry.path})`;
|
|
18
|
-
|
|
19
|
-
return Component;
|
|
20
|
-
};
|