opencroc 1.8.2 → 1.8.3
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/package.json +1 -1
- package/dist/web/index.html +0 -12
- package/dist/web/public/botreview/char_0.png +0 -0
- package/dist/web/public/botreview/char_1.png +0 -0
- package/dist/web/public/botreview/char_2.png +0 -0
- package/dist/web/public/botreview/coffee-machine.gif +0 -0
- package/dist/web/public/botreview/server.gif +0 -0
- package/dist/web/public/botreview/walls.png +0 -0
- package/dist/web/public/star/desk-v3.webp +0 -0
- package/dist/web/public/star/office_bg_small.webp +0 -0
- package/dist/web/public/star/star-idle-v5.png +0 -0
- package/dist/web/public/star/star-working-spritesheet-grid.webp +0 -0
- package/dist/web/src/app/AppLayout.tsx +0 -34
- package/dist/web/src/app/AppRouter.tsx +0 -46
- package/dist/web/src/app/bootstrap.tsx +0 -22
- package/dist/web/src/app/routes.tsx +0 -52
- package/dist/web/src/features/office/runtime/index.ts +0 -1
- package/dist/web/src/features/office/runtime/mount.ts +0 -809
- package/dist/web/src/features/pixel/runtime/index.ts +0 -1
- package/dist/web/src/features/pixel/runtime/mount.ts +0 -728
- package/dist/web/src/features/studio/runtime/index.ts +0 -1
- package/dist/web/src/features/studio/runtime/mount.ts +0 -664
- package/dist/web/src/features/three/engine/index.ts +0 -1
- package/dist/web/src/main.tsx +0 -7
- package/dist/web/src/pages/office/index.ts +0 -1
- package/dist/web/src/pages/office/page.tsx +0 -283
- package/dist/web/src/pages/pixel/index.ts +0 -1
- package/dist/web/src/pages/pixel/page.tsx +0 -564
- package/dist/web/src/pages/studio/index.ts +0 -1
- package/dist/web/src/pages/studio/page.tsx +0 -446
- package/dist/web/src/runtime/agents.ts +0 -738
- package/dist/web/src/runtime/camera.ts +0 -132
- package/dist/web/src/runtime/dataviz.ts +0 -312
- package/dist/web/src/runtime/effects.ts +0 -482
- package/dist/web/src/runtime/engine.ts +0 -528
- package/dist/web/src/runtime/office.ts +0 -932
- package/dist/web/src/runtime/state.ts +0 -37
- package/dist/web/src/runtime/ui.ts +0 -388
- package/dist/web/src/shared/assets.ts +0 -4
- package/dist/web/src/shared/navigation.ts +0 -47
- package/dist/web/src/styles/app-layout.css +0 -19
- package/dist/web/src/styles/office.css +0 -268
- package/dist/web/tsconfig.json +0 -28
- package/dist/web/vite.config.ts +0 -93
package/package.json
CHANGED
package/dist/web/index.html
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN" data-theme="light">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
6
|
-
<title>OpenCroc Studio</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<div id="root"></div>
|
|
10
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useEffect, type PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { AppRoute } from './routes';
|
|
4
|
-
|
|
5
|
-
type AppLayoutProps = PropsWithChildren<{
|
|
6
|
-
route: AppRoute;
|
|
7
|
-
}>;
|
|
8
|
-
|
|
9
|
-
export default function AppLayout({ route, children }: AppLayoutProps) {
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
document.body.dataset.appRoute = route.id;
|
|
12
|
-
document.body.dataset.routeVariant = route.variant;
|
|
13
|
-
document.documentElement.dataset.appRoute = route.id;
|
|
14
|
-
document.documentElement.dataset.routeVariant = route.variant;
|
|
15
|
-
|
|
16
|
-
return () => {
|
|
17
|
-
delete document.body.dataset.appRoute;
|
|
18
|
-
delete document.body.dataset.routeVariant;
|
|
19
|
-
delete document.documentElement.dataset.appRoute;
|
|
20
|
-
delete document.documentElement.dataset.routeVariant;
|
|
21
|
-
};
|
|
22
|
-
}, [route.id, route.variant]);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
className="app-layout"
|
|
27
|
-
data-route-id={route.id}
|
|
28
|
-
data-route-variant={route.variant}
|
|
29
|
-
aria-label={route.description}
|
|
30
|
-
>
|
|
31
|
-
{children}
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Suspense, useEffect, useSyncExternalStore } from 'react';
|
|
2
|
-
|
|
3
|
-
import { getCurrentAppPath, navigate, subscribeNavigation } from '@shared/navigation';
|
|
4
|
-
import AppLayout from './AppLayout';
|
|
5
|
-
import { resolveAppRoute } from './routes';
|
|
6
|
-
import '../styles/app-layout.css';
|
|
7
|
-
|
|
8
|
-
function RouterFallback() {
|
|
9
|
-
return (
|
|
10
|
-
<div
|
|
11
|
-
style={{
|
|
12
|
-
width: '100%',
|
|
13
|
-
height: '100%',
|
|
14
|
-
display: 'grid',
|
|
15
|
-
placeItems: 'center',
|
|
16
|
-
background: '#050510',
|
|
17
|
-
color: '#f1f5f9',
|
|
18
|
-
fontFamily: 'system-ui, sans-serif',
|
|
19
|
-
}}
|
|
20
|
-
>
|
|
21
|
-
Loading OpenCroc Studio...
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default function AppRouter() {
|
|
27
|
-
const pathname = useSyncExternalStore(subscribeNavigation, getCurrentAppPath, () => '/');
|
|
28
|
-
const route = resolveAppRoute(pathname);
|
|
29
|
-
const RouteComponent = route.component;
|
|
30
|
-
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
document.title = route.title;
|
|
33
|
-
|
|
34
|
-
if (route.path !== pathname) {
|
|
35
|
-
navigate(route.path, { replace: true });
|
|
36
|
-
}
|
|
37
|
-
}, [pathname, route.path, route.title]);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<Suspense fallback={<RouterFallback />}>
|
|
41
|
-
<AppLayout route={route}>
|
|
42
|
-
<RouteComponent />
|
|
43
|
-
</AppLayout>
|
|
44
|
-
</Suspense>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
|
|
4
|
-
type BootstrapOptions = {
|
|
5
|
-
app: ReactElement;
|
|
6
|
-
missingMessage: string;
|
|
7
|
-
containerId?: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export function bootstrapApp({
|
|
11
|
-
app,
|
|
12
|
-
missingMessage,
|
|
13
|
-
containerId = 'root',
|
|
14
|
-
}: BootstrapOptions): void {
|
|
15
|
-
const container = document.getElementById(containerId);
|
|
16
|
-
|
|
17
|
-
if (!container) {
|
|
18
|
-
throw new Error(missingMessage);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
createRoot(container).render(app);
|
|
22
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { lazy, type ComponentType, type LazyExoticComponent } from 'react';
|
|
2
|
-
|
|
3
|
-
import { normalizeAppPath } from '@shared/navigation';
|
|
4
|
-
|
|
5
|
-
export type AppRoute = {
|
|
6
|
-
id: string;
|
|
7
|
-
path: string;
|
|
8
|
-
title: string;
|
|
9
|
-
navLabel: string;
|
|
10
|
-
description: string;
|
|
11
|
-
variant: 'office' | 'graph' | 'pixel';
|
|
12
|
-
component: LazyExoticComponent<ComponentType>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const OfficePage = lazy(() => import('@pages/office'));
|
|
16
|
-
const StudioPage = lazy(() => import('@pages/studio'));
|
|
17
|
-
const PixelPage = lazy(() => import('@pages/pixel'));
|
|
18
|
-
|
|
19
|
-
export const appRoutes: AppRoute[] = [
|
|
20
|
-
{
|
|
21
|
-
id: 'office',
|
|
22
|
-
path: '/',
|
|
23
|
-
title: 'OpenCroc Studio',
|
|
24
|
-
navLabel: '3D Office',
|
|
25
|
-
description: 'OpenCroc Studio office runtime view',
|
|
26
|
-
variant: 'office',
|
|
27
|
-
component: OfficePage,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'studio',
|
|
31
|
-
path: '/studio',
|
|
32
|
-
title: 'OpenCroc Studio Graph',
|
|
33
|
-
navLabel: 'Knowledge Graph',
|
|
34
|
-
description: 'OpenCroc Studio knowledge graph view',
|
|
35
|
-
variant: 'graph',
|
|
36
|
-
component: StudioPage,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
id: 'pixel',
|
|
40
|
-
path: '/pixel',
|
|
41
|
-
title: 'OpenCroc Studio Pixel',
|
|
42
|
-
navLabel: 'Pixel View',
|
|
43
|
-
description: 'OpenCroc Studio pixel operations view',
|
|
44
|
-
variant: 'pixel',
|
|
45
|
-
component: PixelPage,
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
export function resolveAppRoute(pathname: string): AppRoute {
|
|
50
|
-
const normalizedPath = normalizeAppPath(pathname);
|
|
51
|
-
return appRoutes.find((route) => route.path === normalizedPath) || appRoutes[0];
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mountOfficeRuntime } from './mount';
|