@hrbolek/uoisfrontend-template 0.6.1 → 0.6.2
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/cjs/index.js +447 -0
- package/dist/es/index.js +11055 -0
- package/dist/umd/index.js +447 -0
- package/package.json +5 -1
- package/index.html +0 -104
- package/vite.config.js +0 -47
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hrbolek/uoisfrontend-template",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"_main": "src/index.js",
|
|
9
9
|
"_module": "src/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
10
14
|
"scripts": {
|
|
11
15
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
16
|
"dev": "vite",
|
package/index.html
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>GQL Model Viewer</title>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
8
|
-
<script>
|
|
9
|
-
// Node-like shim pro knihovny, které čekají process.env
|
|
10
|
-
globalThis.process = globalThis.process || { env: {} };
|
|
11
|
-
globalThis.process.env = globalThis.process.env || {};
|
|
12
|
-
globalThis.process.env.NODE_ENV = globalThis.process.env.NODE_ENV || "development" || "production";
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
16
|
-
|
|
17
|
-
<!-- <script src="https://unpkg.com/react@19"></script>
|
|
18
|
-
<script src="https://unpkg.com/react-dom@19"></script> -->
|
|
19
|
-
|
|
20
|
-
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js"></script>
|
|
21
|
-
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js"></script>
|
|
22
|
-
|
|
23
|
-
<script src="https://unpkg.com/@reduxjs/toolkit@1.9.3/dist/redux-toolkit.umd.js"></script>
|
|
24
|
-
|
|
25
|
-
<!-- Babel (modern verze) -->
|
|
26
|
-
<script src="https://unpkg.com/@babel/standalone@7.25.0/babel.min.js"></script>
|
|
27
|
-
|
|
28
|
-
<!-- HTM (React JSX alternativa) -->
|
|
29
|
-
<script src="https://unpkg.com/htm@3.1.1/dist/htm.umd.js" crossorigin></script>
|
|
30
|
-
|
|
31
|
-
</head>
|
|
32
|
-
|
|
33
|
-
<body>
|
|
34
|
-
|
|
35
|
-
<div id="log-root_"></div>
|
|
36
|
-
<div id="root"></div>
|
|
37
|
-
<div id="log-output"></div>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<script type="text/babel" data-type="module" data-presets="react">
|
|
42
|
-
const { useState, useMemo } = React;
|
|
43
|
-
import { CardCapsule, LeftColumn, MiddleColumn, Row } from "./dist/es"
|
|
44
|
-
|
|
45
|
-
function htmlLog(...args) {
|
|
46
|
-
const el = document.getElementById('log-output');
|
|
47
|
-
if (!el) return;
|
|
48
|
-
|
|
49
|
-
const line = document.createElement('div');
|
|
50
|
-
|
|
51
|
-
line.textContent = args
|
|
52
|
-
.map(arg => typeof arg === 'object'
|
|
53
|
-
? JSON.stringify(arg, null, 2)
|
|
54
|
-
: String(arg)
|
|
55
|
-
)
|
|
56
|
-
.join(' ');
|
|
57
|
-
|
|
58
|
-
el.appendChild(line);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const originalLog = console.log;
|
|
62
|
-
|
|
63
|
-
console.log = (...args) => {
|
|
64
|
-
originalLog(...args);
|
|
65
|
-
htmlLog(...args);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const Counter = () => {
|
|
69
|
-
const [counter, setCounter] = useState(0)
|
|
70
|
-
const Plus = () => {
|
|
71
|
-
console.log(counter, '=>', counter + 1)
|
|
72
|
-
setCounter(prev=>prev+1)
|
|
73
|
-
}
|
|
74
|
-
return (
|
|
75
|
-
<button className="btn btn-sm btn-outline-primary" onClick={Plus}>
|
|
76
|
-
{counter} + 1
|
|
77
|
-
</button>
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const MyApp = () => {
|
|
82
|
-
console.log("MyApp")
|
|
83
|
-
return (
|
|
84
|
-
<CardCapsule title={<> demo <Counter /> </>}>
|
|
85
|
-
<Row>
|
|
86
|
-
<LeftColumn>
|
|
87
|
-
<CardCapsule title="Left">
|
|
88
|
-
Hello world <Counter />
|
|
89
|
-
</CardCapsule>
|
|
90
|
-
</LeftColumn>
|
|
91
|
-
<MiddleColumn>
|
|
92
|
-
<CardCapsule title="Middle">
|
|
93
|
-
Hello world <Counter />
|
|
94
|
-
</CardCapsule>
|
|
95
|
-
</MiddleColumn>
|
|
96
|
-
</Row>
|
|
97
|
-
</CardCapsule>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
// console.log("mount", mount)
|
|
101
|
-
ReactDOM.createRoot(document.getElementById("root")).render(<MyApp />);
|
|
102
|
-
</script>
|
|
103
|
-
</body>
|
|
104
|
-
</html>
|
package/vite.config.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import react from "@vitejs/plugin-react";
|
|
3
|
-
import path from "path";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [react()],
|
|
7
|
-
|
|
8
|
-
resolve: {
|
|
9
|
-
alias: {
|
|
10
|
-
// Když někdo v tomhle balíku (nebo jeho deps) udělá
|
|
11
|
-
// import '@hrbolek/uoisfrontend-gql-shared'
|
|
12
|
-
// → vezme se přímo src/index.js, ne package.json/main/dist
|
|
13
|
-
// "@hrbolek/uoisfrontend-template": path.resolve(__dirname, "src"),
|
|
14
|
-
"@hrbolek/uoisfrontend-template": path.resolve(__dirname, "src/index.js"),
|
|
15
|
-
"@hrbolek/uoisfrontend-dynamic": path.resolve(__dirname, "../../packages/dynamic/src/index.js"),
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
build: {
|
|
20
|
-
lib: {
|
|
21
|
-
entry: path.resolve(__dirname, "src/index.js"),
|
|
22
|
-
name: "UoisfrontendGqlShared",
|
|
23
|
-
formats: ["es", "cjs", "umd"],
|
|
24
|
-
fileName: (format, name) => `${format}/${name}.js`,
|
|
25
|
-
},
|
|
26
|
-
rollupOptions: {
|
|
27
|
-
external: [
|
|
28
|
-
"react",
|
|
29
|
-
"react-dom",
|
|
30
|
-
"react-redux",
|
|
31
|
-
"react-bootstrap",
|
|
32
|
-
"react-router-dom",
|
|
33
|
-
"@reduxjs/toolkit",
|
|
34
|
-
],
|
|
35
|
-
output: {
|
|
36
|
-
globals: {
|
|
37
|
-
react: "React",
|
|
38
|
-
"react-dom": "ReactDOM",
|
|
39
|
-
"react-redux": "ReactRedux",
|
|
40
|
-
"react-bootstrap": "ReactBootstrap",
|
|
41
|
-
"react-router-dom": "ReactRouterDOM",
|
|
42
|
-
"@reduxjs/toolkit": "RTK",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|