Spaces:
Sleeping
Sleeping
Upload 82 files
Browse files- bot_telegram/sessions/bot_session.session +0 -0
- bot_telegram/sessions/bot_session.session-journal +0 -0
- components/MarkdownRenderer.tsx +14 -107
- package-lock.json +30 -1
- package.json +3 -1
bot_telegram/sessions/bot_session.session
CHANGED
|
Binary files a/bot_telegram/sessions/bot_session.session and b/bot_telegram/sessions/bot_session.session differ
|
|
|
bot_telegram/sessions/bot_session.session-journal
ADDED
|
Binary file (4.62 kB). View file
|
|
|
components/MarkdownRenderer.tsx
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
import React, { useState, useEffect, useRef } from 'react';
|
| 2 |
import ReactMarkdown from 'react-markdown';
|
| 3 |
import remarkGfm from 'remark-gfm';
|
|
|
|
| 4 |
import rehypeRaw from 'rehype-raw';
|
| 5 |
-
import
|
| 6 |
-
import { Copy, Check, Edit2 } from 'lucide-react';
|
| 7 |
import { subscribeToStyleConfig } from '../services/codeStyleService';
|
| 8 |
import { CopyButton } from './CopyButton';
|
| 9 |
import { CustomBlockquote } from './CustomBlockquote';
|
|
|
|
|
|
|
| 10 |
|
| 11 |
interface MarkdownRendererProps {
|
| 12 |
content: string;
|
|
@@ -51,7 +53,7 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, onB
|
|
| 51 |
};
|
| 52 |
|
| 53 |
return (
|
| 54 |
-
<div ref={containerRef} className="markdown-
|
| 55 |
{showCopyButton && (
|
| 56 |
<button
|
| 57 |
onClick={handleCopy}
|
|
@@ -61,45 +63,18 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, onB
|
|
| 61 |
{copied ? <Check size={16} /> : <Copy size={16} />}
|
| 62 |
</button>
|
| 63 |
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
<ReactMarkdown
|
| 65 |
-
remarkPlugins={[remarkGfm]}
|
| 66 |
rehypePlugins={[rehypeRaw]}
|
| 67 |
components={{
|
| 68 |
-
h1: ({ children }) => (
|
| 69 |
-
<h1 className="text-3xl font-bold text-white mb-4 pb-2 border-b border-white/10">
|
| 70 |
-
{children}
|
| 71 |
-
</h1>
|
| 72 |
-
),
|
| 73 |
-
h2: ({ children }) => (
|
| 74 |
-
<h2 className="text-2xl font-bold text-white mb-3 pb-2 border-b border-white/10 mt-6">
|
| 75 |
-
{children}
|
| 76 |
-
</h2>
|
| 77 |
-
),
|
| 78 |
-
h3: ({ children }) => (
|
| 79 |
-
<h3 className="text-xl font-bold text-white mb-2 mt-4">
|
| 80 |
-
{children}
|
| 81 |
-
</h3>
|
| 82 |
-
),
|
| 83 |
-
h4: ({ children }) => (
|
| 84 |
-
<h4 className="text-lg font-semibold text-white mb-2 mt-3">
|
| 85 |
-
{children}
|
| 86 |
-
</h4>
|
| 87 |
-
),
|
| 88 |
-
h5: ({ children }) => (
|
| 89 |
-
<h5 className="text-base font-semibold text-white mb-2 mt-3">
|
| 90 |
-
{children}
|
| 91 |
-
</h5>
|
| 92 |
-
),
|
| 93 |
-
h6: ({ children }) => (
|
| 94 |
-
<h6 className="text-sm font-semibold text-gray-300 mb-2 mt-3">
|
| 95 |
-
{children}
|
| 96 |
-
</h6>
|
| 97 |
-
),
|
| 98 |
-
p: ({ children }) => (
|
| 99 |
-
<p className="text-gray-300 mb-4 leading-relaxed [&>img]:inline-block [&>a>img]:inline-block">
|
| 100 |
-
{children}
|
| 101 |
-
</p>
|
| 102 |
-
),
|
| 103 |
div: ({ align, children, className, style, ...props }: any) => {
|
| 104 |
const isCenter = align === 'center';
|
| 105 |
return (
|
|
@@ -112,21 +87,6 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, onB
|
|
| 112 |
</div>
|
| 113 |
);
|
| 114 |
},
|
| 115 |
-
ul: ({ children }) => (
|
| 116 |
-
<ul className="list-disc list-inside text-gray-300 mb-4 space-y-1 ml-4">
|
| 117 |
-
{children}
|
| 118 |
-
</ul>
|
| 119 |
-
),
|
| 120 |
-
ol: ({ children }) => (
|
| 121 |
-
<ol className="list-decimal list-inside text-gray-300 mb-4 space-y-1 ml-4">
|
| 122 |
-
{children}
|
| 123 |
-
</ol>
|
| 124 |
-
),
|
| 125 |
-
li: ({ children }) => (
|
| 126 |
-
<li className="text-gray-300">
|
| 127 |
-
{children}
|
| 128 |
-
</li>
|
| 129 |
-
),
|
| 130 |
blockquote: ({ children, ...props }) => (
|
| 131 |
<div
|
| 132 |
onDoubleClick={(e) => handleBlockDoubleClick(e, 'quote')}
|
|
@@ -186,59 +146,6 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, onB
|
|
| 186 |
</div>
|
| 187 |
);
|
| 188 |
},
|
| 189 |
-
a: ({ href, children }) => (
|
| 190 |
-
<a
|
| 191 |
-
href={href}
|
| 192 |
-
target="_blank"
|
| 193 |
-
rel="noopener noreferrer"
|
| 194 |
-
className="text-primary hover:underline"
|
| 195 |
-
>
|
| 196 |
-
{children}
|
| 197 |
-
</a>
|
| 198 |
-
),
|
| 199 |
-
hr: () => (
|
| 200 |
-
<hr className="border-white/10 my-6" />
|
| 201 |
-
),
|
| 202 |
-
table: ({ children }) => (
|
| 203 |
-
<div className="overflow-x-auto mb-4">
|
| 204 |
-
<table className="min-w-full border border-white/10 rounded-lg overflow-hidden">
|
| 205 |
-
{children}
|
| 206 |
-
</table>
|
| 207 |
-
</div>
|
| 208 |
-
),
|
| 209 |
-
thead: ({ children }) => (
|
| 210 |
-
<thead className="bg-white/5">
|
| 211 |
-
{children}
|
| 212 |
-
</thead>
|
| 213 |
-
),
|
| 214 |
-
tbody: ({ children }) => (
|
| 215 |
-
<tbody className="divide-y divide-white/10">
|
| 216 |
-
{children}
|
| 217 |
-
</tbody>
|
| 218 |
-
),
|
| 219 |
-
tr: ({ children }) => (
|
| 220 |
-
<tr>
|
| 221 |
-
{children}
|
| 222 |
-
</tr>
|
| 223 |
-
),
|
| 224 |
-
th: ({ children }) => (
|
| 225 |
-
<th className="px-4 py-2 text-left text-white font-semibold border border-white/10">
|
| 226 |
-
{children}
|
| 227 |
-
</th>
|
| 228 |
-
),
|
| 229 |
-
td: ({ children }) => (
|
| 230 |
-
<td className="px-4 py-2 text-gray-300 border border-white/10">
|
| 231 |
-
{children}
|
| 232 |
-
</td>
|
| 233 |
-
),
|
| 234 |
-
img: ({ src, alt, ...props }) => (
|
| 235 |
-
<img
|
| 236 |
-
src={src}
|
| 237 |
-
alt={alt}
|
| 238 |
-
className="max-w-full inline-block align-middle"
|
| 239 |
-
{...props as any}
|
| 240 |
-
/>
|
| 241 |
-
),
|
| 242 |
}}
|
| 243 |
>
|
| 244 |
{content}
|
|
|
|
| 1 |
import React, { useState, useEffect, useRef } from 'react';
|
| 2 |
import ReactMarkdown from 'react-markdown';
|
| 3 |
import remarkGfm from 'remark-gfm';
|
| 4 |
+
import remarkAlert from 'remark-github-blockquote-alert';
|
| 5 |
import rehypeRaw from 'rehype-raw';
|
| 6 |
+
import { Copy, Check } from 'lucide-react';
|
|
|
|
| 7 |
import { subscribeToStyleConfig } from '../services/codeStyleService';
|
| 8 |
import { CopyButton } from './CopyButton';
|
| 9 |
import { CustomBlockquote } from './CustomBlockquote';
|
| 10 |
+
import 'github-markdown-css/github-markdown-dark.css';
|
| 11 |
+
import 'remark-github-blockquote-alert/alert.css';
|
| 12 |
|
| 13 |
interface MarkdownRendererProps {
|
| 14 |
content: string;
|
|
|
|
| 53 |
};
|
| 54 |
|
| 55 |
return (
|
| 56 |
+
<div ref={containerRef} className="markdown-body bg-transparent relative group" style={{ backgroundColor: 'transparent' }}>
|
| 57 |
{showCopyButton && (
|
| 58 |
<button
|
| 59 |
onClick={handleCopy}
|
|
|
|
| 63 |
{copied ? <Check size={16} /> : <Copy size={16} />}
|
| 64 |
</button>
|
| 65 |
)}
|
| 66 |
+
<style>{`
|
| 67 |
+
.markdown-body table tr {
|
| 68 |
+
background-color: transparent !important;
|
| 69 |
+
}
|
| 70 |
+
.markdown-body table tr:nth-child(2n) {
|
| 71 |
+
background-color: rgba(255,255,255,0.02) !important;
|
| 72 |
+
}
|
| 73 |
+
`}</style>
|
| 74 |
<ReactMarkdown
|
| 75 |
+
remarkPlugins={[remarkGfm, remarkAlert]}
|
| 76 |
rehypePlugins={[rehypeRaw]}
|
| 77 |
components={{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
div: ({ align, children, className, style, ...props }: any) => {
|
| 79 |
const isCenter = align === 'center';
|
| 80 |
return (
|
|
|
|
| 87 |
</div>
|
| 88 |
);
|
| 89 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
blockquote: ({ children, ...props }) => (
|
| 91 |
<div
|
| 92 |
onDoubleClick={(e) => handleBlockDoubleClick(e, 'quote')}
|
|
|
|
| 146 |
</div>
|
| 147 |
);
|
| 148 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}}
|
| 150 |
>
|
| 151 |
{content}
|
package-lock.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
| 18 |
"@types/react-syntax-highlighter": "^15.5.13",
|
| 19 |
"firebase": "^12.6.0",
|
| 20 |
"framer-motion": "^12.23.25",
|
|
|
|
| 21 |
"lucide-react": "^0.554.0",
|
| 22 |
"react": "^19.2.0",
|
| 23 |
"react-dom": "^19.2.0",
|
|
@@ -26,7 +27,8 @@
|
|
| 26 |
"react-syntax-highlighter": "^16.1.0",
|
| 27 |
"rehype-raw": "^7.0.0",
|
| 28 |
"rehype-sanitize": "^6.0.0",
|
| 29 |
-
"remark-gfm": "^4.0.1"
|
|
|
|
| 30 |
},
|
| 31 |
"devDependencies": {
|
| 32 |
"@types/node": "^22.14.0",
|
|
@@ -3287,6 +3289,18 @@
|
|
| 3287 |
"node": "6.* || 8.* || >= 10.*"
|
| 3288 |
}
|
| 3289 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3290 |
"node_modules/hast-util-from-parse5": {
|
| 3291 |
"version": "8.0.3",
|
| 3292 |
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
|
|
@@ -5274,6 +5288,21 @@
|
|
| 5274 |
"url": "https://opencollective.com/unified"
|
| 5275 |
}
|
| 5276 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5277 |
"node_modules/remark-parse": {
|
| 5278 |
"version": "11.0.0",
|
| 5279 |
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
|
|
|
|
| 18 |
"@types/react-syntax-highlighter": "^15.5.13",
|
| 19 |
"firebase": "^12.6.0",
|
| 20 |
"framer-motion": "^12.23.25",
|
| 21 |
+
"github-markdown-css": "^5.9.0",
|
| 22 |
"lucide-react": "^0.554.0",
|
| 23 |
"react": "^19.2.0",
|
| 24 |
"react-dom": "^19.2.0",
|
|
|
|
| 27 |
"react-syntax-highlighter": "^16.1.0",
|
| 28 |
"rehype-raw": "^7.0.0",
|
| 29 |
"rehype-sanitize": "^6.0.0",
|
| 30 |
+
"remark-gfm": "^4.0.1",
|
| 31 |
+
"remark-github-blockquote-alert": "^2.1.0"
|
| 32 |
},
|
| 33 |
"devDependencies": {
|
| 34 |
"@types/node": "^22.14.0",
|
|
|
|
| 3289 |
"node": "6.* || 8.* || >= 10.*"
|
| 3290 |
}
|
| 3291 |
},
|
| 3292 |
+
"node_modules/github-markdown-css": {
|
| 3293 |
+
"version": "5.9.0",
|
| 3294 |
+
"resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-5.9.0.tgz",
|
| 3295 |
+
"integrity": "sha512-tmT5sY+zvg2302XLYEfH2mtkViIM1SWf2nvYoF5N1ZsO0V6B2qZTiw3GOzw4vpjLygK/KG35qRlPFweHqfzz5w==",
|
| 3296 |
+
"license": "MIT",
|
| 3297 |
+
"engines": {
|
| 3298 |
+
"node": ">=10"
|
| 3299 |
+
},
|
| 3300 |
+
"funding": {
|
| 3301 |
+
"url": "https://github.com/sponsors/sindresorhus"
|
| 3302 |
+
}
|
| 3303 |
+
},
|
| 3304 |
"node_modules/hast-util-from-parse5": {
|
| 3305 |
"version": "8.0.3",
|
| 3306 |
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
|
|
|
|
| 5288 |
"url": "https://opencollective.com/unified"
|
| 5289 |
}
|
| 5290 |
},
|
| 5291 |
+
"node_modules/remark-github-blockquote-alert": {
|
| 5292 |
+
"version": "2.1.0",
|
| 5293 |
+
"resolved": "https://registry.npmjs.org/remark-github-blockquote-alert/-/remark-github-blockquote-alert-2.1.0.tgz",
|
| 5294 |
+
"integrity": "sha512-J392jmIP684d7iGsENN0uguL10IGbRdc8bTUSrd/jOLzdWkwg721Fj3JPQGN8tF6fTIrE5HHOIA3nBuwuaeuPQ==",
|
| 5295 |
+
"license": "MIT",
|
| 5296 |
+
"dependencies": {
|
| 5297 |
+
"unist-util-visit": "^5.0.0"
|
| 5298 |
+
},
|
| 5299 |
+
"engines": {
|
| 5300 |
+
"node": ">=16"
|
| 5301 |
+
},
|
| 5302 |
+
"funding": {
|
| 5303 |
+
"url": "https://jaywcjlove.github.io/#/sponsor"
|
| 5304 |
+
}
|
| 5305 |
+
},
|
| 5306 |
"node_modules/remark-parse": {
|
| 5307 |
"version": "11.0.0",
|
| 5308 |
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
|
package.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
"@types/react-syntax-highlighter": "^15.5.13",
|
| 20 |
"firebase": "^12.6.0",
|
| 21 |
"framer-motion": "^12.23.25",
|
|
|
|
| 22 |
"lucide-react": "^0.554.0",
|
| 23 |
"react": "^19.2.0",
|
| 24 |
"react-dom": "^19.2.0",
|
|
@@ -27,7 +28,8 @@
|
|
| 27 |
"react-syntax-highlighter": "^16.1.0",
|
| 28 |
"rehype-raw": "^7.0.0",
|
| 29 |
"rehype-sanitize": "^6.0.0",
|
| 30 |
-
"remark-gfm": "^4.0.1"
|
|
|
|
| 31 |
},
|
| 32 |
"devDependencies": {
|
| 33 |
"@types/node": "^22.14.0",
|
|
|
|
| 19 |
"@types/react-syntax-highlighter": "^15.5.13",
|
| 20 |
"firebase": "^12.6.0",
|
| 21 |
"framer-motion": "^12.23.25",
|
| 22 |
+
"github-markdown-css": "^5.9.0",
|
| 23 |
"lucide-react": "^0.554.0",
|
| 24 |
"react": "^19.2.0",
|
| 25 |
"react-dom": "^19.2.0",
|
|
|
|
| 28 |
"react-syntax-highlighter": "^16.1.0",
|
| 29 |
"rehype-raw": "^7.0.0",
|
| 30 |
"rehype-sanitize": "^6.0.0",
|
| 31 |
+
"remark-gfm": "^4.0.1",
|
| 32 |
+
"remark-github-blockquote-alert": "^2.1.0"
|
| 33 |
},
|
| 34 |
"devDependencies": {
|
| 35 |
"@types/node": "^22.14.0",
|