From bcec956511eb15d235689ac848a491449416ee77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Tue, 1 Oct 2024 15:06:26 +0300 Subject: [PATCH 1/4] feat: added code formater for selected view --- package.json | 2 ++ .../App/SideBar/SelectedNodeView/Default/index.tsx | 7 ++++++- src/utils/apiUrlFromSwarmHost/index.ts | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e577cada5..dbcd74d78 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "lsat-js": "^2.0.6", "moment": "^2.29.4", "postprocessing": "^6.31.0", + "prism-react-renderer": "^2.4.0", "process": "^0.11.10", "r3f-perf": "6.7.0", "react": "^18.2.0", @@ -48,6 +49,7 @@ "react-player": "^2.11.2", "react-router-dom": "6.23.1", "react-spinners": "^0.13.3", + "react-syntax-highlighter": "^15.5.0", "react-toastify": "^10.0.4", "reactflow": "^11.9.2", "recharts": "^2.4.3", diff --git a/src/components/App/SideBar/SelectedNodeView/Default/index.tsx b/src/components/App/SideBar/SelectedNodeView/Default/index.tsx index 225d94c66..2cab72474 100644 --- a/src/components/App/SideBar/SelectedNodeView/Default/index.tsx +++ b/src/components/App/SideBar/SelectedNodeView/Default/index.tsx @@ -2,6 +2,8 @@ import Button from '@mui/material/Button' import clsx from 'clsx' import moment from 'moment' import { useEffect, useRef, useState } from 'react' +import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter' +import { okaidia } from 'react-syntax-highlighter/dist/esm/styles/prism' import styled from 'styled-components' import { Divider } from '~/components/common/Divider' import { Flex } from '~/components/common/Flex' @@ -136,7 +138,10 @@ const NodeDetail = ({ label, value, hasAudio, isPlaying, togglePlay }: Props) => {isPlaying ? : } )} - {highlightSearchTerm(String(value), searchTerm)} + {false && {highlightSearchTerm(String(value), searchTerm)}} + + {String(value)} + diff --git a/src/utils/apiUrlFromSwarmHost/index.ts b/src/utils/apiUrlFromSwarmHost/index.ts index 763fefd2e..842a537e8 100644 --- a/src/utils/apiUrlFromSwarmHost/index.ts +++ b/src/utils/apiUrlFromSwarmHost/index.ts @@ -22,7 +22,7 @@ export function apiUrlFromSwarmHost(): string | undefined { url = `https://${finalHost}` } } else if (origin.includes('localhost')) { - url = 'https://bitcoin.sphinx.chat' + url = 'https://boltwall.swarm38.sphinx.chat' } return `${url}/api` From 45d8a012f303ca36a4feaa120c815b3a97ff3bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Tue, 1 Oct 2024 15:11:45 +0300 Subject: [PATCH 2/4] feat: revert url --- src/utils/apiUrlFromSwarmHost/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/apiUrlFromSwarmHost/index.ts b/src/utils/apiUrlFromSwarmHost/index.ts index 842a537e8..763fefd2e 100644 --- a/src/utils/apiUrlFromSwarmHost/index.ts +++ b/src/utils/apiUrlFromSwarmHost/index.ts @@ -22,7 +22,7 @@ export function apiUrlFromSwarmHost(): string | undefined { url = `https://${finalHost}` } } else if (origin.includes('localhost')) { - url = 'https://boltwall.swarm38.sphinx.chat' + url = 'https://bitcoin.sphinx.chat' } return `${url}/api` From 783f21e314a9531a850264c3b928875f9568cd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Tue, 1 Oct 2024 15:14:07 +0300 Subject: [PATCH 3/4] feat: update yarn lock --- yarn.lock | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 229 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 3a1dea9aa..d60e2e467 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1545,6 +1545,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.3.1": + version: 7.25.6 + resolution: "@babel/runtime@npm:7.25.6" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: ee1a69d3ac7802803f5ee6a96e652b78b8addc28c6a38c725a4ad7d61a059d9e6cb9f6550ed2f63cce67a1bd82e0b1ef66a1079d895be6bfb536a5cfbd9ccc32 + languageName: node + linkType: hard + "@babel/template@npm:^7.22.15, @babel/template@npm:^7.3.3": version: 7.22.15 resolution: "@babel/template@npm:7.22.15" @@ -4385,6 +4394,15 @@ __metadata: languageName: node linkType: hard +"@types/hast@npm:^2.0.0": + version: 2.3.10 + resolution: "@types/hast@npm:2.3.10" + dependencies: + "@types/unist": ^2 + checksum: 41531b7fbf590b02452996fc63272479c20a07269e370bd6514982cbcd1819b4b84d3ea620f2410d1b9541a23d08ce2eeb0a592145d05e00e249c3d56700d460 + languageName: node + linkType: hard + "@types/hast@npm:^3.0.0": version: 3.0.3 resolution: "@types/hast@npm:3.0.3" @@ -4559,6 +4577,13 @@ __metadata: languageName: node linkType: hard +"@types/prismjs@npm:^1.26.0": + version: 1.26.4 + resolution: "@types/prismjs@npm:1.26.4" + checksum: ae33fa6be38b15b11d211806c2ad034bb2d794ca4897bed4eff574114d9d0ae99c89a7489fc04b2655472413ba430e30deb5c26b190261218928cf2ee9f414d1 + languageName: node + linkType: hard + "@types/prop-types@npm:*, @types/prop-types@npm:^15.7.11": version: 15.7.11 resolution: "@types/prop-types@npm:15.7.11" @@ -4717,6 +4742,13 @@ __metadata: languageName: node linkType: hard +"@types/unist@npm:^2": + version: 2.0.11 + resolution: "@types/unist@npm:2.0.11" + checksum: 6d436e832bc35c6dde9f056ac515ebf2b3384a1d7f63679d12358766f9b313368077402e9c1126a14d827f10370a5485e628bf61aa91117cf4fc882423191a4e + languageName: node + linkType: hard + "@types/unist@npm:^2.0.0": version: 2.0.10 resolution: "@types/unist@npm:2.0.10" @@ -6246,6 +6278,13 @@ __metadata: languageName: node linkType: hard +"character-entities-legacy@npm:^1.0.0": + version: 1.1.4 + resolution: "character-entities-legacy@npm:1.1.4" + checksum: fe03a82c154414da3a0c8ab3188e4237ec68006cbcd681cf23c7cfb9502a0e76cd30ab69a2e50857ca10d984d57de3b307680fff5328ccd427f400e559c3a811 + languageName: node + linkType: hard + "character-entities-legacy@npm:^3.0.0": version: 3.0.0 resolution: "character-entities-legacy@npm:3.0.0" @@ -6253,6 +6292,13 @@ __metadata: languageName: node linkType: hard +"character-entities@npm:^1.0.0": + version: 1.2.4 + resolution: "character-entities@npm:1.2.4" + checksum: e1545716571ead57beac008433c1ff69517cd8ca5b336889321c5b8ff4a99c29b65589a701e9c086cda8a5e346a67295e2684f6c7ea96819fe85cbf49bf8686d + languageName: node + linkType: hard + "character-entities@npm:^2.0.0": version: 2.0.2 resolution: "character-entities@npm:2.0.2" @@ -6260,6 +6306,13 @@ __metadata: languageName: node linkType: hard +"character-reference-invalid@npm:^1.0.0": + version: 1.1.4 + resolution: "character-reference-invalid@npm:1.1.4" + checksum: 20274574c70e05e2f81135f3b93285536bc8ff70f37f0809b0d17791a832838f1e49938382899ed4cb444e5bbd4314ca1415231344ba29f4222ce2ccf24fea0b + languageName: node + linkType: hard + "character-reference-invalid@npm:^2.0.0": version: 2.0.1 resolution: "character-reference-invalid@npm:2.0.1" @@ -6489,6 +6542,13 @@ __metadata: languageName: node linkType: hard +"comma-separated-tokens@npm:^1.0.0": + version: 1.0.8 + resolution: "comma-separated-tokens@npm:1.0.8" + checksum: 0adcb07174fa4d08cf0f5c8e3aec40a36b5ff0c2c720e5e23f50fe02e6789d1d00a67036c80e0c1e1539f41d3e7f0101b074039dd833b4e4a59031b659d6ca0d + languageName: node + linkType: hard + "comma-separated-tokens@npm:^2.0.0": version: 2.0.3 resolution: "comma-separated-tokens@npm:2.0.3" @@ -8425,6 +8485,15 @@ __metadata: languageName: node linkType: hard +"fault@npm:^1.0.0": + version: 1.0.4 + resolution: "fault@npm:1.0.4" + dependencies: + format: ^0.2.0 + checksum: 5ac610d8b09424e0f2fa8cf913064372f2ee7140a203a79957f73ed557c0e79b1a3d096064d7f40bde8132a69204c1fe25ec23634c05c6da2da2039cff26c4e7 + languageName: node + linkType: hard + "fb-watchman@npm:^2.0.0": version: 2.0.2 resolution: "fb-watchman@npm:2.0.2" @@ -8624,6 +8693,13 @@ __metadata: languageName: node linkType: hard +"format@npm:^0.2.0": + version: 0.2.2 + resolution: "format@npm:0.2.2" + checksum: 646a60e1336250d802509cf24fb801e43bd4a70a07510c816fa133aa42cdbc9c21e66e9cc0801bb183c5b031c9d68be62e7fbb6877756e52357850f92aa28799 + languageName: node + linkType: hard + "formdata-polyfill@npm:^4.0.10": version: 4.0.10 resolution: "formdata-polyfill@npm:4.0.10" @@ -9096,6 +9172,13 @@ __metadata: languageName: node linkType: hard +"hast-util-parse-selector@npm:^2.0.0": + version: 2.2.5 + resolution: "hast-util-parse-selector@npm:2.2.5" + checksum: 22ee4afbd11754562144cb3c4f3ec52524dafba4d90ee52512902d17cf11066d83b38f7bdf6ca571bbc2541f07ba30db0d234657b6ecb8ca4631587466459605 + languageName: node + linkType: hard + "hast-util-to-jsx-runtime@npm:^2.0.0": version: 2.3.0 resolution: "hast-util-to-jsx-runtime@npm:2.3.0" @@ -9128,6 +9211,26 @@ __metadata: languageName: node linkType: hard +"hastscript@npm:^6.0.0": + version: 6.0.0 + resolution: "hastscript@npm:6.0.0" + dependencies: + "@types/hast": ^2.0.0 + comma-separated-tokens: ^1.0.0 + hast-util-parse-selector: ^2.0.0 + property-information: ^5.0.0 + space-separated-tokens: ^1.0.0 + checksum: 5e50b85af0d2cb7c17979cb1ddca75d6b96b53019dd999b39e7833192c9004201c3cee6445065620ea05d0087d9ae147a4844e582d64868be5bc6b0232dfe52d + languageName: node + linkType: hard + +"highlight.js@npm:^10.4.1, highlight.js@npm:~10.7.0": + version: 10.7.3 + resolution: "highlight.js@npm:10.7.3" + checksum: defeafcd546b535d710d8efb8e650af9e3b369ef53e28c3dc7893eacfe263200bba4c5fcf43524ae66d5c0c296b1af0870523ceae3e3104d24b7abf6374a4fea + languageName: node + linkType: hard + "hmac-drbg@npm:^1.0.1": version: 1.0.1 resolution: "hmac-drbg@npm:1.0.1" @@ -9451,6 +9554,13 @@ __metadata: languageName: node linkType: hard +"is-alphabetical@npm:^1.0.0": + version: 1.0.4 + resolution: "is-alphabetical@npm:1.0.4" + checksum: 6508cce44fd348f06705d377b260974f4ce68c74000e7da4045f0d919e568226dc3ce9685c5a2af272195384df6930f748ce9213fc9f399b5d31b362c66312cb + languageName: node + linkType: hard + "is-alphabetical@npm:^2.0.0": version: 2.0.1 resolution: "is-alphabetical@npm:2.0.1" @@ -9458,6 +9568,16 @@ __metadata: languageName: node linkType: hard +"is-alphanumerical@npm:^1.0.0": + version: 1.0.4 + resolution: "is-alphanumerical@npm:1.0.4" + dependencies: + is-alphabetical: ^1.0.0 + is-decimal: ^1.0.0 + checksum: e2e491acc16fcf5b363f7c726f666a9538dba0a043665740feb45bba1652457a73441e7c5179c6768a638ed396db3437e9905f403644ec7c468fb41f4813d03f + languageName: node + linkType: hard + "is-alphanumerical@npm:^2.0.0": version: 2.0.1 resolution: "is-alphanumerical@npm:2.0.1" @@ -9569,6 +9689,13 @@ __metadata: languageName: node linkType: hard +"is-decimal@npm:^1.0.0": + version: 1.0.4 + resolution: "is-decimal@npm:1.0.4" + checksum: ed483a387517856dc395c68403a10201fddcc1b63dc56513fbe2fe86ab38766120090ecdbfed89223d84ca8b1cd28b0641b93cb6597b6e8f4c097a7c24e3fb96 + languageName: node + linkType: hard + "is-decimal@npm:^2.0.0": version: 2.0.1 resolution: "is-decimal@npm:2.0.1" @@ -9640,6 +9767,13 @@ __metadata: languageName: node linkType: hard +"is-hexadecimal@npm:^1.0.0": + version: 1.0.4 + resolution: "is-hexadecimal@npm:1.0.4" + checksum: a452e047587b6069332d83130f54d30da4faf2f2ebaa2ce6d073c27b5703d030d58ed9e0b729c8e4e5b52c6f1dab26781bb77b7bc6c7805f14f320e328ff8cd5 + languageName: node + linkType: hard + "is-hexadecimal@npm:^2.0.0": version: 2.0.1 resolution: "is-hexadecimal@npm:2.0.1" @@ -11194,6 +11328,16 @@ __metadata: languageName: node linkType: hard +"lowlight@npm:^1.17.0": + version: 1.20.0 + resolution: "lowlight@npm:1.20.0" + dependencies: + fault: ^1.0.0 + highlight.js: ~10.7.0 + checksum: 14a1815d6bae202ddee313fc60f06d46e5235c02fa483a77950b401d85b4c1e12290145ccd17a716b07f9328bd5864aa2d402b6a819ff3be7c833d9748ff8ba7 + languageName: node + linkType: hard + "lru-cache@npm:^10.0.1, lru-cache@npm:^9.1.1 || ^10.0.0": version: 10.1.0 resolution: "lru-cache@npm:10.1.0" @@ -12604,6 +12748,20 @@ __metadata: languageName: node linkType: hard +"parse-entities@npm:^2.0.0": + version: 2.0.0 + resolution: "parse-entities@npm:2.0.0" + dependencies: + character-entities: ^1.0.0 + character-entities-legacy: ^1.0.0 + character-reference-invalid: ^1.0.0 + is-alphanumerical: ^1.0.0 + is-decimal: ^1.0.0 + is-hexadecimal: ^1.0.0 + checksum: 7addfd3e7d747521afac33c8121a5f23043c6973809756920d37e806639b4898385d386fcf4b3c8e2ecf1bc28aac5ae97df0b112d5042034efbe80f44081ebce + languageName: node + linkType: hard + "parse-entities@npm:^4.0.0": version: 4.0.1 resolution: "parse-entities@npm:4.0.1" @@ -12845,6 +13003,32 @@ __metadata: languageName: node linkType: hard +"prism-react-renderer@npm:^2.4.0": + version: 2.4.0 + resolution: "prism-react-renderer@npm:2.4.0" + dependencies: + "@types/prismjs": ^1.26.0 + clsx: ^2.0.0 + peerDependencies: + react: ">=16.0.0" + checksum: d15d944a8cbf05f7b04deecd2cf4ffb08229a6027918641b6f046cd8ab24b65ca4ebe4ac8e95a53a7d7cefb1bba8df3ce394fe4f1d75418e34fa92553dc63ef7 + languageName: node + linkType: hard + +"prismjs@npm:^1.27.0": + version: 1.29.0 + resolution: "prismjs@npm:1.29.0" + checksum: 007a8869d4456ff8049dc59404e32d5666a07d99c3b0e30a18bd3b7676dfa07d1daae9d0f407f20983865fd8da56de91d09cb08e6aa61f5bc420a27c0beeaf93 + languageName: node + linkType: hard + +"prismjs@npm:~1.27.0": + version: 1.27.0 + resolution: "prismjs@npm:1.27.0" + checksum: 85c7f4a3e999073502cc9e1882af01e3709706369ec254b60bff1149eda701f40d02512acab956012dc7e61cfd61743a3a34c1bd0737e8dbacd79141e5698bbc + languageName: node + linkType: hard + "proc-log@npm:^3.0.0": version: 3.0.0 resolution: "proc-log@npm:3.0.0" @@ -12913,6 +13097,15 @@ __metadata: languageName: node linkType: hard +"property-information@npm:^5.0.0": + version: 5.6.0 + resolution: "property-information@npm:5.6.0" + dependencies: + xtend: ^4.0.0 + checksum: fcf87c6542e59a8bbe31ca0b3255a4a63ac1059b01b04469680288998bcfa97f341ca989566adbb63975f4d85339030b82320c324a511532d390910d1c583893 + languageName: node + linkType: hard + "property-information@npm:^6.0.0": version: 6.4.0 resolution: "property-information@npm:6.4.0" @@ -13337,6 +13530,21 @@ __metadata: languageName: node linkType: hard +"react-syntax-highlighter@npm:^15.5.0": + version: 15.5.0 + resolution: "react-syntax-highlighter@npm:15.5.0" + dependencies: + "@babel/runtime": ^7.3.1 + highlight.js: ^10.4.1 + lowlight: ^1.17.0 + prismjs: ^1.27.0 + refractor: ^3.6.0 + peerDependencies: + react: ">= 0.14.0" + checksum: c082b48f30f8ba8d0c55ed1d761910630860077c7ff5793c4c912adcb5760df06436ed0ad62be0de28113aac9ad2af55eccd995f8eee98df53382e4ced2072fb + languageName: node + linkType: hard + "react-toastify@npm:^10.0.4": version: 10.0.4 resolution: "react-toastify@npm:10.0.4" @@ -13552,6 +13760,17 @@ __metadata: languageName: node linkType: hard +"refractor@npm:^3.6.0": + version: 3.6.0 + resolution: "refractor@npm:3.6.0" + dependencies: + hastscript: ^6.0.0 + parse-entities: ^2.0.0 + prismjs: ~1.27.0 + checksum: 39b01c4168c77c5c8486f9bf8907bbb05f257f15026057ba5728535815a2d90eed620468a4bfbb2b8ceefbb3ce3931a1be8b17152dbdbc8b0eef92450ff750a2 + languageName: node + linkType: hard + "regenerate-unicode-properties@npm:^10.1.0": version: 10.1.1 resolution: "regenerate-unicode-properties@npm:10.1.1" @@ -14310,6 +14529,13 @@ __metadata: languageName: node linkType: hard +"space-separated-tokens@npm:^1.0.0": + version: 1.1.5 + resolution: "space-separated-tokens@npm:1.1.5" + checksum: 8ef68f1cfa8ccad316b7f8d0df0919d0f1f6d32101e8faeee34ea3a923ce8509c1ad562f57388585ee4951e92d27afa211ed0a077d3d5995b5ba9180331be708 + languageName: node + linkType: hard + "space-separated-tokens@npm:^2.0.0": version: 2.0.2 resolution: "space-separated-tokens@npm:2.0.2" @@ -14451,6 +14677,7 @@ __metadata: node-fetch: ^3.3.2 postprocessing: ^6.31.0 prettier: ^2.7.1 + prism-react-renderer: ^2.4.0 process: ^0.11.10 prop-types: ^15.8.1 r3f-perf: 6.7.0 @@ -14467,6 +14694,7 @@ __metadata: react-player: ^2.11.2 react-router-dom: 6.23.1 react-spinners: ^0.13.3 + react-syntax-highlighter: ^15.5.0 react-toastify: ^10.0.4 reactflow: ^11.9.2 recharts: ^2.4.3 @@ -16280,7 +16508,7 @@ __metadata: languageName: node linkType: hard -"xtend@npm:^4.0.2": +"xtend@npm:^4.0.0, xtend@npm:^4.0.2": version: 4.0.2 resolution: "xtend@npm:4.0.2" checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a From f61c29fabe20a302a77ada0e5b5c8783438d4bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=83=D0=BB?= Date: Tue, 1 Oct 2024 15:21:47 +0300 Subject: [PATCH 4/4] feat: add packages --- package.json | 1 + yarn.lock | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/package.json b/package.json index dbcd74d78..fae465cba 100644 --- a/package.json +++ b/package.json @@ -187,6 +187,7 @@ "@types/react-dom": "^18.2.7", "@types/react-input-mask": "3.0.2", "@types/react-lottie": "^1.2.10", + "@types/react-syntax-highlighter": "^15.5.13", "@types/styled-components": "^5.1.25", "@types/three": "^0.150.2", "@typescript-eslint/eslint-plugin": "^5.27.1", diff --git a/yarn.lock b/yarn.lock index d60e2e467..9098f8c25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4636,6 +4636,15 @@ __metadata: languageName: node linkType: hard +"@types/react-syntax-highlighter@npm:^15.5.13": + version: 15.5.13 + resolution: "@types/react-syntax-highlighter@npm:15.5.13" + dependencies: + "@types/react": "*" + checksum: 55f751c140eb6641b16a5644af3b6fc25223957141085758ae6898948e70eaca33d8276e86e75d5d60939aff63af1d20278aba0d3a25483266f9deee1eb468e3 + languageName: node + linkType: hard + "@types/react-transition-group@npm:^4.4.10, @types/react-transition-group@npm:^4.4.8": version: 4.4.10 resolution: "@types/react-transition-group@npm:4.4.10" @@ -14635,6 +14644,7 @@ __metadata: "@types/react-dom": ^18.2.7 "@types/react-input-mask": 3.0.2 "@types/react-lottie": ^1.2.10 + "@types/react-syntax-highlighter": ^15.5.13 "@types/styled-components": ^5.1.25 "@types/three": ^0.150.2 "@typescript-eslint/eslint-plugin": ^5.27.1