update - clean
This commit is contained in:
152
reader/dist/assets/index-CnZdeEjV.js
vendored
152
reader/dist/assets/index-CnZdeEjV.js
vendored
File diff suppressed because one or more lines are too long
1
reader/dist/assets/index-D8a8nrqF.css
vendored
1
reader/dist/assets/index-D8a8nrqF.css
vendored
File diff suppressed because one or more lines are too long
17
reader/dist/index.html
vendored
17
reader/dist/index.html
vendored
@@ -1,17 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="bg">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Конспект</title>
|
||||
<script type="module" crossorigin src="/assets/index-CnZdeEjV.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D8a8nrqF.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1
reader/dist/vite.svg
vendored
1
reader/dist/vite.svg
vendored
@@ -1 +0,0 @@
|
||||
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 31.357 31.357" xml:space="preserve"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <g> <g> <path d="M15.679,0C7.033,0,0.001,7.033,0.001,15.678c0,8.646,7.032,15.68,15.678,15.68c8.644,0,15.677-7.033,15.677-15.68 C31.356,7.033,24.323,0,15.679,0z M15.679,28.861c-7.27,0-13.183-5.913-13.183-13.184c0-7.268,5.913-13.183,13.183-13.183 c7.269,0,13.182,5.915,13.182,13.183C28.861,22.948,22.948,28.861,15.679,28.861z"></path> <path d="M19.243,12.368V7.33c0-0.868-0.703-1.57-1.57-1.57h-3.396c-0.867,0-1.569,0.703-1.569,1.57v5.038h-5.04 c-0.867,0-1.569,0.703-1.569,1.57v3.468c0,0.867,0.702,1.57,1.569,1.57h5.039v5.037c0,0.867,0.702,1.57,1.569,1.57h3.397 c0.866,0,1.569-0.703,1.569-1.57v-5.037h5.038c0.867,0,1.57-0.703,1.57-1.57v-3.468c0-0.868-0.703-1.57-1.57-1.57H19.243z"></path> </g> </g> </g></svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -17,6 +17,7 @@
|
||||
"react-dom": "^19.0.0",
|
||||
"react-pdf": "^9.2.1",
|
||||
"react-router": "^7.5.0",
|
||||
"socket.io-client": "^4.8.1",
|
||||
"tailwindcss": "^4.1.2",
|
||||
"zustand": "^5.0.3"
|
||||
},
|
||||
|
||||
88
reader/pnpm-lock.yaml
generated
88
reader/pnpm-lock.yaml
generated
@@ -29,6 +29,9 @@ importers:
|
||||
react-router:
|
||||
specifier: ^7.5.0
|
||||
version: 7.5.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
|
||||
socket.io-client:
|
||||
specifier: ^4.8.1
|
||||
version: 4.8.1
|
||||
tailwindcss:
|
||||
specifier: ^4.1.2
|
||||
version: 4.1.2
|
||||
@@ -482,6 +485,9 @@ packages:
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@socket.io/component-emitter@3.1.2':
|
||||
resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==}
|
||||
|
||||
'@tailwindcss/node@4.1.2':
|
||||
resolution: {integrity: sha512-ZwFnxH+1z8Ehh8bNTMX3YFrYdzAv7JLY5X5X7XSFY+G9QGJVce/P9xb2mh+j5hKt8NceuHmdtllJvAHWKtsNrQ==}
|
||||
|
||||
@@ -695,6 +701,15 @@ packages:
|
||||
csstype@3.1.3:
|
||||
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
||||
|
||||
debug@4.3.7:
|
||||
resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
|
||||
engines: {node: '>=6.0'}
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
peerDependenciesMeta:
|
||||
supports-color:
|
||||
optional: true
|
||||
|
||||
debug@4.4.0:
|
||||
resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
|
||||
engines: {node: '>=6.0'}
|
||||
@@ -737,6 +752,13 @@ packages:
|
||||
end-of-stream@1.4.4:
|
||||
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
|
||||
|
||||
engine.io-client@6.6.3:
|
||||
resolution: {integrity: sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==}
|
||||
|
||||
engine.io-parser@5.2.3:
|
||||
resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
|
||||
enhanced-resolve@5.18.1:
|
||||
resolution: {integrity: sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
@@ -1292,6 +1314,14 @@ packages:
|
||||
simple-get@4.0.1:
|
||||
resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}
|
||||
|
||||
socket.io-client@4.8.1:
|
||||
resolution: {integrity: sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
|
||||
socket.io-parser@4.2.4:
|
||||
resolution: {integrity: sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
|
||||
source-map-js@1.2.1:
|
||||
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -1410,6 +1440,22 @@ packages:
|
||||
wrappy@1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
|
||||
ws@8.17.1:
|
||||
resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
peerDependencies:
|
||||
bufferutil: ^4.0.1
|
||||
utf-8-validate: '>=5.0.2'
|
||||
peerDependenciesMeta:
|
||||
bufferutil:
|
||||
optional: true
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
|
||||
xmlhttprequest-ssl@2.1.2:
|
||||
resolution: {integrity: sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==}
|
||||
engines: {node: '>=0.4.0'}
|
||||
|
||||
yallist@3.1.1:
|
||||
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
|
||||
|
||||
@@ -1765,6 +1811,8 @@ snapshots:
|
||||
'@rollup/rollup-win32-x64-msvc@4.39.0':
|
||||
optional: true
|
||||
|
||||
'@socket.io/component-emitter@3.1.2': {}
|
||||
|
||||
'@tailwindcss/node@4.1.2':
|
||||
dependencies:
|
||||
enhanced-resolve: 5.18.1
|
||||
@@ -1980,6 +2028,10 @@ snapshots:
|
||||
|
||||
csstype@3.1.3: {}
|
||||
|
||||
debug@4.3.7:
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
|
||||
debug@4.4.0:
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
@@ -2013,6 +2065,20 @@ snapshots:
|
||||
once: 1.4.0
|
||||
optional: true
|
||||
|
||||
engine.io-client@6.6.3:
|
||||
dependencies:
|
||||
'@socket.io/component-emitter': 3.1.2
|
||||
debug: 4.3.7
|
||||
engine.io-parser: 5.2.3
|
||||
ws: 8.17.1
|
||||
xmlhttprequest-ssl: 2.1.2
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
|
||||
engine.io-parser@5.2.3: {}
|
||||
|
||||
enhanced-resolve@5.18.1:
|
||||
dependencies:
|
||||
graceful-fs: 4.2.11
|
||||
@@ -2577,6 +2643,24 @@ snapshots:
|
||||
simple-concat: 1.0.1
|
||||
optional: true
|
||||
|
||||
socket.io-client@4.8.1:
|
||||
dependencies:
|
||||
'@socket.io/component-emitter': 3.1.2
|
||||
debug: 4.3.7
|
||||
engine.io-client: 6.6.3
|
||||
socket.io-parser: 4.2.4
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
|
||||
socket.io-parser@4.2.4:
|
||||
dependencies:
|
||||
'@socket.io/component-emitter': 3.1.2
|
||||
debug: 4.3.7
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
source-map-js@1.2.1: {}
|
||||
|
||||
string_decoder@1.3.0:
|
||||
@@ -2668,6 +2752,10 @@ snapshots:
|
||||
wrappy@1.0.2:
|
||||
optional: true
|
||||
|
||||
ws@8.17.1: {}
|
||||
|
||||
xmlhttprequest-ssl@2.1.2: {}
|
||||
|
||||
yallist@3.1.1: {}
|
||||
|
||||
yocto-queue@0.1.0: {}
|
||||
|
||||
@@ -19,6 +19,93 @@ import {
|
||||
VRuleIcon,
|
||||
} from "./icons/Icons";
|
||||
import ResourcePage from "./ResourcePage.jsx";
|
||||
import io from "socket.io-client";
|
||||
|
||||
const socket = io("http://localhost:3000");
|
||||
|
||||
const DIVIDER_AT = 16;
|
||||
|
||||
function SocketTest() {
|
||||
const [booleanArray, setBooleanArray] = useState(new Array(10).fill(false));
|
||||
const [isConnected, setIsConnected] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// Connection status
|
||||
socket.on("connect", () => {
|
||||
setIsConnected(true);
|
||||
console.log("Connected to server");
|
||||
});
|
||||
|
||||
socket.on("disconnect", () => {
|
||||
setIsConnected(false);
|
||||
console.log("Disconnected from server");
|
||||
});
|
||||
|
||||
// Listen for array updates
|
||||
socket.on("arrayChanged", (newArray) => {
|
||||
setBooleanArray(newArray);
|
||||
});
|
||||
|
||||
// Cleanup on unmount
|
||||
return () => {
|
||||
socket.off("connect");
|
||||
socket.off("disconnect");
|
||||
socket.off("arrayChanged");
|
||||
};
|
||||
}, []);
|
||||
|
||||
const toggleValue = (index) => {
|
||||
const newValue = !booleanArray[index];
|
||||
|
||||
// Emit update to server
|
||||
socket.emit("setArrayValue", { index, value: newValue });
|
||||
};
|
||||
|
||||
const refreshArray = () => {
|
||||
socket.emit("getArray");
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ padding: "20px" }}>
|
||||
<h1>Socket.IO Boolean Array</h1>
|
||||
|
||||
<div style={{ marginBottom: "20px" }}>
|
||||
Status:{" "}
|
||||
<span style={{ color: isConnected ? "green" : "red" }}>
|
||||
{isConnected ? "Connected" : "Disconnected"}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button onClick={refreshArray} style={{ marginBottom: "20px" }}>
|
||||
Refresh Array
|
||||
</button>
|
||||
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(5, 100px)", gap: "10px" }}>
|
||||
{booleanArray.map((value, index) => (
|
||||
<button
|
||||
key={index}
|
||||
onClick={() => toggleValue(index)}
|
||||
style={{
|
||||
padding: "20px",
|
||||
backgroundColor: value ? "#4CAF50" : "#f44336",
|
||||
color: "white",
|
||||
border: "none",
|
||||
borderRadius: "4px",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
{index}: {value.toString()}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: "20px" }}>
|
||||
<h3>Current Array:</h3>
|
||||
<pre>{JSON.stringify(booleanArray)}</pre>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
@@ -36,6 +123,7 @@ export function App() {
|
||||
<Route path=":topicId" element={<FileReader />} />
|
||||
</Route>
|
||||
<Route path="/edit" element={<ResourcePage />} />
|
||||
<Route path="/socket" element={<SocketTest />} />
|
||||
</Routes>
|
||||
</BrowserRouter>
|
||||
);
|
||||
@@ -100,26 +188,31 @@ export function TopicListView() {
|
||||
className={`flex-1 overflow-y-scroll ${selectedTopic === null ? "pb-[92px]" : "pb-[156px]"}`}
|
||||
>
|
||||
{selectedSubject.topics.map((topic, topicIdx) => (
|
||||
<Link
|
||||
key={topic.id}
|
||||
ref={(node) => {
|
||||
itemRefs.current[topicIdx] = node;
|
||||
}}
|
||||
to={`/${topic.id}`}
|
||||
onClick={() => selectTopic(topicIdx)}
|
||||
className={`flex px-2 py-1 rounded-md cursor-pointer border-l-4 ${topic.id === selectedTopic?.id ? "bg-blue-100 border-blue-500" : "border-transparent hover:bg-gray-100"}`}
|
||||
>
|
||||
<div
|
||||
className={`w-6 flex-shrink-0 flex font-medium justify-end ${topic.id === selectedTopic?.id ? "text-blue-600" : "text-blue-800"}`}
|
||||
<>
|
||||
{topicIdx === DIVIDER_AT && (
|
||||
<hr className="my-4 border-t border-dotted border-gray-400" />
|
||||
)}
|
||||
<Link
|
||||
key={topic.id}
|
||||
ref={(node) => {
|
||||
itemRefs.current[topicIdx] = node;
|
||||
}}
|
||||
to={`/${topic.id}`}
|
||||
onClick={() => selectTopic(topicIdx)}
|
||||
className={`flex px-2 py-1 rounded-md cursor-pointer border-l-4 ${topic.id === selectedTopic?.id ? "bg-blue-100 border-blue-500" : "border-transparent hover:bg-gray-100"}`}
|
||||
>
|
||||
{topic.sequence}
|
||||
</div>
|
||||
<span
|
||||
className={`ml-2 leading-5 ${topic.id === selectedTopic?.id ? "font-medium" : "font-normal"} ${config.wrapTopicTitles ? "truncate" : ""}`}
|
||||
>
|
||||
{topic.title}
|
||||
</span>
|
||||
</Link>
|
||||
<div
|
||||
className={`w-6 flex-shrink-0 flex font-medium justify-end ${topic.id === selectedTopic?.id ? "text-blue-600" : "text-blue-800"}`}
|
||||
>
|
||||
{topic.sequence}
|
||||
</div>
|
||||
<span
|
||||
className={`ml-2 leading-5 ${topic.id === selectedTopic?.id ? "font-medium" : "font-normal"} ${config.wrapTopicTitles ? "truncate" : ""}`}
|
||||
>
|
||||
{topic.title}
|
||||
</span>
|
||||
</Link>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
<div className="absolute bottom-0 sm:p-4 px-2 py-0 w-full flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user