@velkayolanda/app_subjects 0.0.1
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/app_subjects.css +5 -0
- package/dist/es/StandaloneEntry.js +46413 -0
- package/dist/iife/StandaloneEntry.js +975 -0
- package/dist/umd/StandaloneEntry.js +975 -0
- package/package.json +45 -0
- package/src/App.jsx +18 -0
- package/src/AppNavbar.jsx +25 -0
- package/src/AppRouter.jsx +49 -0
- package/src/StandaloneEntry.jsx +15 -0
- package/src/index.css +47 -0
- package/src/index.js +0 -0
- package/src/main.jsx +10 -0
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@velkayolanda/app_subjects",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "vite",
|
|
12
|
+
"build": "vite build",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"preview": "vite preview",
|
|
15
|
+
"build:production": "NODE_ENV=production vite build",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"react": "^19.2.1",
|
|
20
|
+
"react-dom": "^19.2.1",
|
|
21
|
+
"react-router": "^7.0.2",
|
|
22
|
+
"bootstrap": "^5.3.3",
|
|
23
|
+
"@popperjs/core": "^2.11.8",
|
|
24
|
+
"@apollo/client": "^4.0.10",
|
|
25
|
+
|
|
26
|
+
"@hrbolek/uoisfrontend-template": "*",
|
|
27
|
+
"@hrbolek/uoisfrontend-shared": "*",
|
|
28
|
+
"@hrbolek/uoisfrontend-gql-shared": "*",
|
|
29
|
+
"@hrbolek/uoisfrontend-ug": "*",
|
|
30
|
+
"@hrbolek/uoisfrontend-requests": "*",
|
|
31
|
+
"@hrbolek/uoisfrontend-zp": "*"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@eslint/js": "^9.15.0",
|
|
35
|
+
"@types/react": "^19.2.7",
|
|
36
|
+
"@types/react-dom": "^19.2.3",
|
|
37
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
38
|
+
"eslint": "^9.15.0",
|
|
39
|
+
"eslint-plugin-react": "^7.37.2",
|
|
40
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
41
|
+
"eslint-plugin-react-refresh": "^0.4.14",
|
|
42
|
+
"globals": "^15.12.0",
|
|
43
|
+
"vite": "^6.0.1"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/App.jsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
2
|
+
|
|
3
|
+
import { AppRouter } from './AppRouter';
|
|
4
|
+
import { RootProviders } from '../../../packages/dynamic/src/Store';
|
|
5
|
+
|
|
6
|
+
export const GQLENDPOINT_ = "/api/gql"
|
|
7
|
+
// const getSdl = () => client.sdl()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line react/prop-types
|
|
11
|
+
export const App = ({ GQLENDPOINT=GQLENDPOINT_}) => {
|
|
12
|
+
return (
|
|
13
|
+
<RootProviders clientOptions={{ endpoint: GQLENDPOINT }}>
|
|
14
|
+
<AppRouter />
|
|
15
|
+
</RootProviders>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useSelector } from "react-redux"
|
|
2
|
+
import { useParams } from "react-router"
|
|
3
|
+
|
|
4
|
+
import { selectItemById } from "../../../packages/dynamic/src/Store";
|
|
5
|
+
// import { MyNavDropdown as GroupTypeNavDropdown } from "../../../packages/_template/src/GroupTypeGQLModel";
|
|
6
|
+
// import { MyNavDropdown as UserNavDropdown } from "../../../packages/_template/src/UserGQLModel";
|
|
7
|
+
// import { MyNavDropdown as GroupNavDropdown } from "../../../packages/_template/src/GroupGQLModel";
|
|
8
|
+
// import { MyNavDropdown as RoleNavDropdown } from "../../../packages/_template/src/RoleGQLModel";
|
|
9
|
+
// import { MyNavDropdown as RoleTypeNavDropdown } from "../../../packages/_template/src/RoleTypeGQLModel";
|
|
10
|
+
import { PageNavbar } from "../../../packages/_template/src/Base/Pages/PageNavbar";
|
|
11
|
+
|
|
12
|
+
export const AppNavbar = () => {
|
|
13
|
+
const { id } = useParams()
|
|
14
|
+
const item = useSelector((dataroot) => selectItemById(dataroot, id)) || {}
|
|
15
|
+
// console.log("AppNavbar", id, item)
|
|
16
|
+
return (
|
|
17
|
+
<PageNavbar item={item}>
|
|
18
|
+
{/* <UserNavDropdown item={item} />
|
|
19
|
+
<GroupNavDropdown item={item} />
|
|
20
|
+
<RoleNavDropdown item={item} />
|
|
21
|
+
<GroupTypeNavDropdown item={item} />
|
|
22
|
+
<RoleTypeNavDropdown item={item} /> */}
|
|
23
|
+
</PageNavbar>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createBrowserRouter,
|
|
3
|
+
Outlet,
|
|
4
|
+
RouterProvider,
|
|
5
|
+
} from "react-router-dom";
|
|
6
|
+
import { NavigationHistoryLinks, NavigationHistoryProvider } from '../../../packages/_template/src/Base/Helpers/NavigationHistoryProvider';
|
|
7
|
+
|
|
8
|
+
import { BaseRouterSegments } from "../../../packages/_template/src/Base/Pages/RouterSegment";
|
|
9
|
+
import {SubjectGQLModelRouterSegments} from '../../../packages/subjects/src/SubjectGQLModel/Pages/RouterSegment';
|
|
10
|
+
// import { GroupRouterSegments } from "../../../packages/_template/src/GroupGQLModel/Pages/RouterSegment";
|
|
11
|
+
// import { RoleTypeRouterSegments } from "../../../packages/_template/src/RoleTypeGQLModel/Pages";
|
|
12
|
+
// import { UserRouterSegments } from "../../../packages/_template/src/UserGQLModel/Pages/RouterSegment";
|
|
13
|
+
// import { GroupTypeRouterSegments } from "../../../packages/_template/src/GroupTypeGQLModel/Pages/RouterSegment";
|
|
14
|
+
// import { RoleRouterSegments } from "../../../packages/_template/src/RoleGQLModel/Pages";
|
|
15
|
+
// import { Page } from "../../../packages/_template/src/Base/Pages/Page";
|
|
16
|
+
import { AppNavbar } from "./AppNavbar";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const AppLayout = () => (
|
|
20
|
+
<NavigationHistoryProvider>
|
|
21
|
+
<AppNavbar />
|
|
22
|
+
<NavigationHistoryLinks />
|
|
23
|
+
<Outlet />
|
|
24
|
+
</NavigationHistoryProvider>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const Routes = [
|
|
28
|
+
{
|
|
29
|
+
path: "/", // root
|
|
30
|
+
element: <AppLayout />,
|
|
31
|
+
children: [
|
|
32
|
+
...SubjectGQLModelRouterSegments,
|
|
33
|
+
...BaseRouterSegments,
|
|
34
|
+
// ...GroupRouterSegments,
|
|
35
|
+
// ...RoleTypeRouterSegments,
|
|
36
|
+
// ...UserRouterSegments,
|
|
37
|
+
// ...GroupTypeRouterSegments,
|
|
38
|
+
// ...RoleRouterSegments,
|
|
39
|
+
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// console.log("Routes", Routes)
|
|
45
|
+
// console.log("Routes", GroupRouterSegments)
|
|
46
|
+
|
|
47
|
+
const router = createBrowserRouter(Routes);
|
|
48
|
+
|
|
49
|
+
export const AppRouter = () => <RouterProvider router={router} />;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// import React from "react"
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import { App } from "./App";
|
|
4
|
+
|
|
5
|
+
export function mount(el, props = {}) {
|
|
6
|
+
if (!el) throw new Error("MyApp.mount: missing mount element");
|
|
7
|
+
console.log("inside mount, doing to render")
|
|
8
|
+
createRoot(el).render(<App {...props} />);
|
|
9
|
+
console.log("inside mount, render finished")
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// pro IIFE build to přilepíme na window
|
|
13
|
+
if (typeof window !== "undefined") {
|
|
14
|
+
window.MyApp = { mount };
|
|
15
|
+
}
|
package/src/index.css
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@media screen {
|
|
2
|
+
.screen-only {
|
|
3
|
+
display: block;
|
|
4
|
+
}
|
|
5
|
+
.print-only {
|
|
6
|
+
display: none;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media print {
|
|
11
|
+
.screen-only {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
.print-only {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media print {
|
|
20
|
+
/* Start a new page before each section */
|
|
21
|
+
.page-break-before {
|
|
22
|
+
break-before: page;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Ensure a page break after the section */
|
|
26
|
+
.page-break-after {
|
|
27
|
+
break-after: page;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Prevent page breaks inside this container */
|
|
31
|
+
.no-page-break {
|
|
32
|
+
break-inside: avoid;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Fallback for older browsers */
|
|
36
|
+
.page-break-before {
|
|
37
|
+
page-break-before: always;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.page-break-after {
|
|
41
|
+
page-break-after: always;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.no-page-break {
|
|
45
|
+
page-break-inside: avoid;
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/index.js
ADDED
|
File without changes
|
package/src/main.jsx
ADDED