From 2470ded4f45b43e90640de83c082ff706565606a Mon Sep 17 00:00:00 2001 From: alvitsit Date: Thu, 26 May 2022 15:58:06 +0400 Subject: [PATCH 1/2] fixed editor opening by url without version --- src/screens/Editor/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screens/Editor/index.tsx b/src/screens/Editor/index.tsx index 75cee51..8c2d46a 100644 --- a/src/screens/Editor/index.tsx +++ b/src/screens/Editor/index.tsx @@ -31,11 +31,11 @@ const {isExport} = window as any; const SCROLLBAR_WIDTH = 20; export const EditorScreen = () => { - const {key, version, history} = useContext(SharingContext); + const {key, history} = useContext(SharingContext); const [currentUrl, setCurrentUrl] = useState(null); const [viewMode, setViewMode] = useState(isExport ? 'doc' : 'editor'); const [jsightCode, setJsightCode] = useState( - key && version ? '' : localStorage.getItem('jsightCode') || initCats + key ? '' : localStorage.getItem('jsightCode') || initCats ); // left sidebar const [codeContentsSidebar] = useState(false); From b4a2610838576d780c0205b747117dcba07e366d Mon Sep 17 00:00:00 2001 From: alvitsit Date: Tue, 14 Jun 2022 18:35:48 +0400 Subject: [PATCH 2/2] creating html template on build --- createHtmlTemplate.js | 59 +++++++++ package.json | 2 +- src/assets/fonts/fontello/config.json | 114 +++++------------- src/assets/fonts/fontello/fontello.css | 20 ++- src/components/Button/Button.styles.scss | 2 +- .../DropdownMenu/DropdownMenu.styles.scss | 2 +- src/components/Editor/Editor.styles.scss | 3 +- .../MainContent/MainContent.styles.scss | 3 +- .../Modals/Contacts/Contacts.styles.scss | 2 +- .../SharingForm/SharingForm.styles.scss | 5 +- .../Notifications/Notifications.styles.scss | 3 +- .../Resource/ResourceMethods.styles.scss | 15 +-- .../ShareButton/ShareButton.styles.scss | 6 +- .../SidebarGroupItems.styles.scss | 4 +- src/hooks/useExport.ts | 95 ++------------- src/styles/_typography.scss | 8 +- 16 files changed, 143 insertions(+), 200 deletions(-) create mode 100644 createHtmlTemplate.js diff --git a/createHtmlTemplate.js b/createHtmlTemplate.js new file mode 100644 index 0000000..ae9ec11 --- /dev/null +++ b/createHtmlTemplate.js @@ -0,0 +1,59 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const fs = require('fs'); + +(async () => { + const scriptText = fs.readFileSync('build/static/js/export-main.js'); + const cssText = fs.readFileSync('build/static/css/export-main.css'); + + fs.writeFile( + 'build/index-template.html', + ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + JSight Online Editor + + + ${cssText ? `` : ''} + + +
+ + `, + function (err) { + if (err) throw err; + console.log('File is created successfully.'); + } + ); +})(); diff --git a/package.json b/package.json index 2049c15..f7303de 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "start": "react-app-rewired start", "one": "./scripts/save-export-js.sh", "build-export": "prettier --write ./src && GENERATE_SOURCEMAP=false REACT_VIEW_TYPE=doc react-app-rewired build && ./scripts/save-export-js.sh", - "build": "GENERATE_SOURCEMAP=false react-app-rewired build && ./scripts/return-export-js.sh", + "build": "GENERATE_SOURCEMAP=false react-app-rewired build && ./scripts/return-export-js.sh && node createHtmlTemplate.js", "test": "react-app-rewired test", "eject": "react-scripts eject" }, diff --git a/src/assets/fonts/fontello/config.json b/src/assets/fonts/fontello/config.json index 4b307df..6998aff 100644 --- a/src/assets/fonts/fontello/config.json +++ b/src/assets/fonts/fontello/config.json @@ -16,9 +16,7 @@ "path": "M583 940.8C615.5 908.3 615.5 855.8 583 823.3L259.6 500 583 176.7C615.5 144.2 615.5 91.7 583 59.2 550.5 26.7 498 26.7 465.5 59.2L83 441.7C50.5 474.2 50.5 526.7 83 559.2L465.5 941.7C497.1 973.3 550.5 973.3 583 940.8Z", "width": 643 }, - "search": [ - "arrow" - ] + "search": ["arrow"] }, { "uid": "98ef88aaf753f37c285637d84584199d", @@ -30,9 +28,7 @@ "path": "M6.6 976.2L325.2 23.8H455.6L137 976.2H6.6ZM401.6 976.2L720.1 23.8H850.6L532 976.2H401.6Z", "width": 857 }, - "search": [ - "code-comment" - ] + "search": ["code-comment"] }, { "uid": "c562e7b983825cfe727d3876882a1da6", @@ -44,9 +40,7 @@ "path": "M604.2 656.3H83.3C54.7 656.3 31.3 679.7 31.3 708.3 31.3 737 54.7 760.4 83.3 760.4H604.2C632.8 760.4 656.3 737 656.3 708.3 656.3 679.7 632.8 656.3 604.2 656.3ZM604.2 239.6H83.3C54.7 239.6 31.3 263 31.3 291.7 31.3 320.3 54.7 343.8 83.3 343.8H604.2C632.8 343.8 656.3 320.3 656.3 291.7 656.3 263 632.8 239.6 604.2 239.6ZM83.3 552.1H916.7C945.3 552.1 968.8 528.6 968.8 500 968.8 471.4 945.3 447.9 916.7 447.9H83.3C54.7 447.9 31.3 471.4 31.3 500 31.3 528.6 54.7 552.1 83.3 552.1ZM83.3 968.8H916.7C945.3 968.8 968.8 945.3 968.8 916.7 968.8 888 945.3 864.6 916.7 864.6H83.3C54.7 864.6 31.3 888 31.3 916.7 31.3 945.3 54.7 968.8 83.3 968.8ZM31.3 83.3C31.3 112 54.7 135.4 83.3 135.4H916.7C945.3 135.4 968.8 112 968.8 83.3 968.8 54.7 945.3 31.3 916.7 31.3H83.3C54.7 31.3 31.3 54.7 31.3 83.3Z", "width": 1000 }, - "search": [ - "list" - ] + "search": ["list"] }, { "uid": "5305f3be2aa63dae4e1cd5195311a055", @@ -58,9 +52,7 @@ "path": "M1452.4 416.7H119C73.2 416.7 35.7 454.2 35.7 500 35.7 545.8 73.2 583.3 119 583.3H1452.4C1498.2 583.3 1535.7 545.8 1535.7 500 1535.7 454.2 1498.2 416.7 1452.4 416.7ZM119 1000H952.4C998.2 1000 1035.7 962.5 1035.7 916.7 1035.7 870.8 998.2 833.3 952.4 833.3H119C73.2 833.3 35.7 870.8 35.7 916.7 35.7 962.5 73.2 1000 119 1000ZM1452.4 0H119C73.2 0 35.7 37.5 35.7 83.3V84.2C35.7 130 73.2 167.5 119 167.5H1452.4C1498.2 167.5 1535.7 130 1535.7 84.2V83.3C1535.7 37.5 1498.2 0 1452.4 0Z", "width": 1571 }, - "search": [ - "menu" - ] + "search": ["menu"] }, { "uid": "e443793f70357fd17f9526ea68fd7b39", @@ -72,9 +64,7 @@ "path": "M720.6 88.2H536.2C517.6 37.1 469.1 0 411.8 0 354.4 0 305.9 37.1 287.4 88.2H102.9C54.4 88.2 14.7 127.9 14.7 176.5V882.4C14.7 930.9 54.4 970.6 102.9 970.6H720.6C769.1 970.6 808.8 930.9 808.8 882.4V176.5C808.8 127.9 769.1 88.2 720.6 88.2ZM411.8 88.2C436 88.2 455.9 108.1 455.9 132.4 455.9 156.6 436 176.5 411.8 176.5 387.5 176.5 367.6 156.6 367.6 132.4 367.6 108.1 387.5 88.2 411.8 88.2ZM676.5 882.4H147.1C122.8 882.4 102.9 862.5 102.9 838.2V220.6C102.9 196.3 122.8 176.5 147.1 176.5H191.2V220.6C191.2 269.1 230.9 308.8 279.4 308.8H544.1C592.6 308.8 632.4 269.1 632.4 220.6V176.5H676.5C700.7 176.5 720.6 196.3 720.6 220.6V838.2C720.6 862.5 700.7 882.4 676.5 882.4Z", "width": 824 }, - "search": [ - "notebook" - ] + "search": ["notebook"] }, { "uid": "1f77d7958f41f1cc9084c3d7cfae831a", @@ -86,9 +76,7 @@ "path": "M871.5 549C873.5 533 875 517 875 500 875 483 873.5 467 871.5 451L977 368.5C986.5 361 989 347.5 983 336.5L883 163.5C877 152.5 863.5 148.5 852.5 152.5L728 202.5C702 182.5 674 166 643.5 153.5L624.5 21C623 9 612.5 0 600 0H400C387.5 0 377 9 375.5 21L356.5 153.5C326 166 298 183 272 202.5L147.5 152.5C136 148 123 152.5 117 163.5L17 336.5C10.5 347.5 13.5 361 23 368.5L128.5 451C126.5 467 125 483.5 125 500 125 516.5 126.5 533 128.5 549L23 631.5C13.5 639 11 652.5 17 663.5L117 836.5C123 847.5 136.5 851.5 147.5 847.5L272 797.5C298 817.5 326 834 356.5 846.5L375.5 979C377 991 387.5 1000 400 1000H600C612.5 1000 623 991 624.5 979L643.5 846.5C674 834 702 817 728 797.5L852.5 847.5C864 852 877 847.5 883 836.5L983 663.5C989 652.5 986.5 639 977 631.5L871.5 549ZM500 675C403.5 675 325 596.5 325 500 325 403.5 403.5 325 500 325 596.5 325 675 403.5 675 500 675 596.5 596.5 675 500 675Z", "width": 1000 }, - "search": [ - "settings" - ] + "search": ["settings"] }, { "uid": "356ba9ee22cd27c3a3ff463f009e7e90", @@ -100,9 +88,7 @@ "path": "M31.3 135.4V864.6C31.3 921.9 78.1 968.8 135.4 968.8H864.6C921.9 968.8 968.8 921.9 968.8 864.6V135.4C968.8 78.1 921.9 31.3 864.6 31.3H135.4C78.1 31.3 31.3 78.1 31.3 135.4ZM447.9 864.6H187.5C158.9 864.6 135.4 841.1 135.4 812.5V552.1H395.8C424.5 552.1 447.9 575.5 447.9 604.2V864.6ZM395.8 447.9H135.4V187.5C135.4 158.9 158.9 135.4 187.5 135.4H447.9V395.8C447.9 424.5 424.5 447.9 395.8 447.9ZM812.5 864.6H552.1V604.2C552.1 575.5 575.5 552.1 604.2 552.1H864.6V812.5C864.6 841.1 841.1 864.6 812.5 864.6ZM864.6 447.9H604.2C575.5 447.9 552.1 424.5 552.1 395.8V135.4H812.5C841.1 135.4 864.6 158.9 864.6 187.5V447.9Z", "width": 1000 }, - "search": [ - "table" - ] + "search": ["table"] }, { "uid": "53d606070bd5b481c094fe985df8d45b", @@ -114,9 +100,7 @@ "path": "M842.6 268.5H101.9C50.9 268.5 9.3 226.9 9.3 175.9V129.6C9.3 78.7 50.9 37 101.9 37H842.6C893.5 37 935.2 78.7 935.2 129.6V175.9C935.2 226.9 893.5 268.5 842.6 268.5ZM842.6 384.3H101.9C50.9 384.3 9.3 425.9 9.3 476.9V523.1C9.3 574.1 50.9 615.7 101.9 615.7H842.6C893.5 615.7 935.2 574.1 935.2 523.1V476.9C935.2 425.9 893.5 384.3 842.6 384.3ZM842.6 731.5H101.9C50.9 731.5 9.3 773.2 9.3 824.1V870.4C9.3 921.3 50.9 963 101.9 963H842.6C893.5 963 935.2 921.3 935.2 870.4V824.1C935.2 773.2 893.5 731.5 842.6 731.5Z", "width": 944 }, - "search": [ - "tabs" - ] + "search": ["tabs"] }, { "uid": "6442258c8048cb67b514ffa12c88dc80", @@ -128,9 +112,7 @@ "path": "M791.7 83.3H617.5C600 35 554.2 0 500 0 445.8 0 400 35 382.5 83.3H208.3C162.5 83.3 125 120.8 125 166.7V833.3C125 879.2 162.5 916.7 208.3 916.7H791.7C837.5 916.7 875 879.2 875 833.3V166.7C875 120.8 837.5 83.3 791.7 83.3ZM500 83.3C522.9 83.3 541.7 102.1 541.7 125 541.7 147.9 522.9 166.7 500 166.7 477.1 166.7 458.3 147.9 458.3 125 458.3 102.1 477.1 83.3 500 83.3ZM750 833.3H250C227.1 833.3 208.3 814.6 208.3 791.7V208.3C208.3 185.4 227.1 166.7 250 166.7H291.7V208.3C291.7 254.2 329.2 291.7 375 291.7H625C670.8 291.7 708.3 254.2 708.3 208.3V166.7H750C772.9 166.7 791.7 185.4 791.7 208.3V791.7C791.7 814.6 772.9 833.3 750 833.3ZM426.9 731.9C412.3 731.9 399.7 728.9 389.1 723 378.5 717.3 370.6 709.3 365.4 698.9 360.4 688.8 358.7 676.9 360.2 663.3L365.7 609.6C366.5 601.7 364.8 595.4 360.6 590.7 356.6 586 350.9 583.7 343.5 583.7H291.7V531.9H343.5C350.9 531.9 356.6 529.5 360.6 524.8 364.8 519.9 366.5 513.6 365.7 505.9L360.2 450C359 436.7 360.8 425.1 365.7 415.2 370.9 405.1 378.7 397.3 389.1 391.9 399.7 386.2 412.3 383.3 426.9 383.3H458.3V435.2H438C430.8 435.2 425.1 437.3 420.9 441.5 417 445.4 415.3 450.7 415.7 457.4L421.3 513.3C422.3 524.7 419 534.3 411.3 542.2 403.9 549.9 393.4 554.9 379.8 557.4 393.4 559.6 403.9 564.8 411.3 573 419 580.9 422.3 590.6 421.3 602.2L415.7 657.8C415 664.4 416.6 669.9 420.6 674.1 424.8 678 430.6 680 438 680H458.3V731.9H426.9ZM573.2 383.3C587.7 383.3 600.3 386.3 610.9 392.2 621.6 397.9 629.5 405.9 634.6 416.3 639.6 426.4 641.3 438.3 639.8 451.9L634.3 505.6C633.5 513.5 635.3 519.8 639.5 524.4 643.4 529.1 649.1 531.5 656.5 531.5H708.4V583.3H656.5C649.1 583.3 643.4 585.7 639.5 590.4 635.3 595.3 633.5 601.6 634.3 609.3L639.8 665.2C641.1 678.5 639.2 690.1 634.3 700 629.1 710.1 621.3 717.9 610.9 723.3 600.3 729 587.7 731.9 573.2 731.9H541.7V680H562.1C569.2 680 574.9 677.9 579.1 673.7 583 669.8 584.8 664.4 584.3 657.8L578.7 601.9C577.7 590.5 581.1 580.9 588.7 573 596.1 565.3 606.6 560.2 620.2 557.8 606.6 555.6 596.1 550.4 588.7 542.2 581.1 534.3 577.7 524.6 578.7 513L584.3 457.4C585 450.7 583.4 445.3 579.5 441.1 575.3 437.2 569.5 435.2 562.1 435.2H541.7V383.3H573.2Z", "width": 1000 }, - "search": [ - "notebook-braces" - ] + "search": ["notebook-braces"] }, { "uid": "892bffc40f9b133465a0e8ace8b83b78", @@ -142,9 +124,7 @@ "path": "M791.7 83.3H617.5C600 35 554.2 0 500 0 445.8 0 400 35 382.5 83.3H208.3C162.5 83.3 125 120.8 125 166.7V833.3C125 879.2 162.5 916.7 208.3 916.7H791.7C837.5 916.7 875 879.2 875 833.3V166.7C875 120.8 837.5 83.3 791.7 83.3ZM500 83.3C522.9 83.3 541.7 102.1 541.7 125 541.7 147.9 522.9 166.7 500 166.7 477.1 166.7 458.3 147.9 458.3 125 458.3 102.1 477.1 83.3 500 83.3ZM750 833.3H250C227.1 833.3 208.3 814.6 208.3 791.7V208.3C208.3 185.4 227.1 166.7 250 166.7H291.7V208.3C291.7 254.2 329.2 291.7 375 291.7H625C670.8 291.7 708.3 254.2 708.3 208.3V166.7H750C772.9 166.7 791.7 185.4 791.7 208.3V791.7C791.7 814.6 772.9 833.3 750 833.3ZM513.5 354.6C399.3 346.6 304.9 440.9 313 555.1 319.7 654.3 406.4 729.2 505.8 729.2H575C585.3 729.2 593.7 720.7 593.7 710.4 593.7 700.1 585.3 691.7 575 691.7H506.1C436.2 691.7 372.1 646.3 354.6 578.6 326.7 469.8 427.9 368.3 536.7 396.5 604.6 413.7 650 477.9 650 547.8V568.4C650 583.3 636.7 597.9 621.9 597.9 607 597.9 593.7 583.3 593.7 568.4V545C593.7 497.9 560.3 455.5 513.8 449 450.1 439.8 396.2 494.9 407.7 559.1 414.1 594.9 442 624.5 477.5 633 512 641 544.8 630 566.4 608 583 630.9 616.4 642.9 647 630.7 672.1 620.8 687.5 595.1 687.5 568.1V547.6C687.5 448 612.7 361.4 513.5 354.6V354.6ZM500 597.9C468.8 597.9 443.7 572.8 443.7 541.6 443.7 510.5 468.8 485.4 500 485.4 531.1 485.4 556.2 510.5 556.2 541.6 556.2 572.8 531.1 597.9 500 597.9Z", "width": 1000 }, - "search": [ - "notebook-email" - ] + "search": ["notebook-email"] }, { "uid": "f1a05346f0c12056170e03f557501902", @@ -156,9 +136,7 @@ "path": "M268.1 780.7C232.6 780.7 204.7 771.6 184.4 753.3 164.1 735 155.6 710.1 158.7 678.6L167.7 583.6C169.3 565.3 166.3 551.8 158.7 543 151.2 533.9 136.6 529.3 115.1 529.3H41.7V470.7H115.1C136.6 470.7 151.2 466.4 158.7 457.6 166.3 448.8 169.3 435.1 167.7 416.4L158.7 320.8C155.6 289.3 164.1 264.7 184.4 246.7 205.1 228.4 233 219.3 268.1 219.3H302.1V277.8H273.4C256.7 277.8 243.8 281.8 234.6 289.7 225.5 297.7 221.7 309.3 223.3 324.4L232.2 420C234.2 441.5 229.4 459 217.9 472.5 206.3 486.1 190.2 494.6 169.5 498.2 190.2 501.8 206.3 511.2 217.9 526.3 229.4 541 234.2 558.9 232.2 580L223.3 675.6C221.7 690.7 225.5 702.3 234.6 710.3 243.8 718.2 256.7 722.2 273.4 722.2H302.1V780.7H268.1ZM697.9 780.7V722.2H726.6C743.3 722.2 756.2 718.2 765.4 710.3 774.6 702.3 778.5 690.7 777.3 675.6L768.4 580C766 558.9 770.6 541 782.1 526.3 793.7 511.2 809.8 501.6 830.5 497.6 809.8 494.4 793.7 486.1 782.1 472.5 770.6 459 766 441.5 768.4 420L777.3 324.4C778.5 309.3 774.6 297.7 765.4 289.7 756.2 281.8 743.3 277.8 726.6 277.8H697.9V219.3H731.9C767 219.3 794.7 228.4 815 246.7 835.7 264.7 844.6 289.3 841.9 320.8L832.9 416.4C830.9 435.1 833.7 448.8 841.3 457.6 848.8 466.4 863.6 470.7 885.5 470.7H958.3V529.3H885.5C863.6 529.3 848.8 533.9 841.3 543 833.7 551.8 830.9 565.3 832.9 583.6L841.9 678.6C844.6 710.1 835.9 735 815.6 753.3 795.3 771.6 767.4 780.7 731.9 780.7H697.9ZM402.7 652.1V605H481.9V394.2L402.3 453.3V398.3L472.3 347.9H534V605H597.7V652.1H402.7Z", "width": 1000 }, - "search": [ - "braces-number" - ] + "search": ["braces-number"] }, { "uid": "22610249201d2c43f60b7b9272c26ca0", @@ -170,9 +148,7 @@ "path": "M268.1 780.7C232.6 780.7 204.7 771.6 184.4 753.3 164.1 735 155.6 710.1 158.7 678.6L167.7 583.6C169.3 565.3 166.3 551.8 158.7 543 151.2 533.9 136.6 529.3 115.1 529.3H41.7V470.7H115.1C136.6 470.7 151.2 466.4 158.7 457.6 166.3 448.8 169.3 435.1 167.7 416.4L158.7 320.8C155.6 289.3 164.1 264.7 184.4 246.7 205.1 228.4 233 219.3 268.1 219.3H302.1V277.8H273.4C256.7 277.8 243.8 281.8 234.6 289.7 225.5 297.7 221.7 309.3 223.3 324.4L232.2 420C234.2 441.5 229.4 459 217.9 472.5 206.3 486.1 190.2 494.6 169.5 498.2 190.2 501.8 206.3 511.2 217.9 526.3 229.4 541 234.2 558.9 232.2 580L223.3 675.6C221.7 690.7 225.5 702.3 234.6 710.3 243.8 718.2 256.7 722.2 273.4 722.2H302.1V780.7H268.1ZM697.9 780.7V722.2H726.6C743.3 722.2 756.2 718.2 765.4 710.3 774.6 702.3 778.5 690.7 777.3 675.6L768.4 580C766 558.9 770.6 541 782.1 526.3 793.7 511.2 809.8 501.6 830.5 497.6 809.8 494.4 793.7 486.1 782.1 472.5 770.6 459 766 441.5 768.4 420L777.3 324.4C778.5 309.3 774.6 297.7 765.4 289.7 756.2 281.8 743.3 277.8 726.6 277.8H697.9V219.3H731.9C767 219.3 794.7 228.4 815 246.7 835.7 264.7 844.6 289.3 841.9 320.8L832.9 416.4C830.9 435.1 833.7 448.8 841.3 457.6 848.8 466.4 863.6 470.7 885.5 470.7H958.3V529.3H885.5C863.6 529.3 848.8 533.9 841.3 543 833.7 551.8 830.9 565.3 832.9 583.6L841.9 678.6C844.6 710.1 835.9 735 815.6 753.3 795.3 771.6 767.4 780.7 731.9 780.7H697.9ZM329.8 540.3C316.5 540.3 306.7 537 300.4 530.3 294.6 523.6 291.7 514.9 291.7 504.1V495.9C291.7 485.1 294.6 476.4 300.4 469.7 306.7 463 316.5 459.7 329.8 459.7 343.1 459.7 352.7 463 358.5 469.7 364.8 476.4 367.9 485.1 367.9 495.9V504.1C367.9 514.9 364.8 523.6 358.5 530.3 352.7 537 343.1 540.3 329.8 540.3ZM500 540.3C486.7 540.3 476.9 537 470.6 530.3 464.8 523.6 461.9 514.9 461.9 504.1V495.9C461.9 485.1 464.8 476.4 470.6 469.7 476.9 463 486.7 459.7 500 459.7 513.3 459.7 522.9 463 528.7 469.7 535 476.4 538.1 485.1 538.1 495.9V504.1C538.1 514.9 535 523.6 528.7 530.3 522.9 537 513.3 540.3 500 540.3ZM670.2 540.3C656.9 540.3 647.1 537 640.9 530.3 635 523.6 632.1 514.9 632.1 504.1V495.9C632.1 485.1 635 476.4 640.9 469.7 647.1 463 656.9 459.7 670.2 459.7 683.6 459.7 693.1 463 699 469.7 705.2 476.4 708.3 485.1 708.3 495.9V504.1C708.3 514.9 705.2 523.6 699 530.3 693.1 537 683.6 540.3 670.2 540.3Z", "width": 1000 }, - "search": [ - "braces-dots" - ] + "search": ["braces-dots"] }, { "uid": "442ac2f919c38f37d5c1d7d222159e11", @@ -184,9 +160,7 @@ "path": "M526.9 126C298.5 109.8 109.8 298.5 126 526.9 139.5 725.3 312.8 875 511.5 875H650C670.6 875 687.5 858.1 687.5 837.5 687.5 816.9 670.6 800 650 800H512.3C372.4 800 244.1 709.2 209.2 573.8 153.3 356.3 355.9 153.3 573.4 209.6 709.2 244.1 800 372.4 800 512.3V553.6C800 583.2 773.4 612.4 743.7 612.4 714.1 612.4 687.5 583.2 687.5 553.6V506.7C687.5 412.5 620.7 327.8 527.7 314.6 400.1 296.3 292.5 406.5 315.4 534.8 328.1 606.4 384 665.7 454.9 682.6 523.9 698.7 589.6 676.6 632.7 632.7 666.1 678.5 732.8 702.5 794 678.1 844.2 658.2 875 606.8 875 552.8V511.9C875 312.8 725.3 139.5 526.9 126ZM499.9 612.4C437.7 612.4 387.4 562.2 387.4 499.9 387.4 437.7 437.7 387.4 499.9 387.4 562.2 387.4 612.4 437.7 612.4 499.9 612.4 562.2 562.2 612.4 499.9 612.4Z", "width": 1000 }, - "search": [ - "email" - ] + "search": ["email"] }, { "uid": "a546e6a69812f4fadd853cbf1f28fe4f", @@ -198,9 +172,7 @@ "path": "M56.7 536A500 500 0 0 1 590 2.7 484 484 0 0 1 917.3 163.3L828.7 214.7A386.7 386.7 0 0 0 652 114 400 400 0 0 0 166 597.3L76 648.7A506 506 0 0 1 56.7 536ZM190 838.7A524.7 524.7 0 0 0 569.3 1000H755.3A50 50 0 0 0 755.3 900H572A429.3 429.3 0 0 1 280.7 786.7ZM414.7 708.7A242 242 0 0 0 494 743.3 249.3 249.3 0 0 0 730.7 676.7 184.7 184.7 0 0 0 946 737.3 178 178 0 0 0 1054 570.7V516A524.7 524.7 0 0 0 1028.7 354L939.3 406A406.7 406.7 0 0 1 955.3 516.7V571.3A81.3 81.3 0 0 1 880 650 80.7 80.7 0 0 1 805.3 571.3V508.7C805.3 500.7 805.3 492.7 805.3 484.7L699.3 546A150.7 150.7 0 0 1 555.3 650 174 174 0 0 1 523.3 646.7ZM587.3 353.3A174 174 0 0 0 555.3 353.3 150.7 150.7 0 0 0 412 454L305.3 516A251.3 251.3 0 0 1 592 252.7 244 244 0 0 1 693.3 292ZM0 778L1058 166.7 1100 238.7 41.3 850Z", "width": 1100 }, - "search": [ - "strikethrough-email" - ] + "search": ["strikethrough-email"] }, { "uid": "6156d4e948550df20503c46cc6c183ee", @@ -212,9 +184,7 @@ "path": "M864.6 552.1H135.4C78.1 552.1 31.3 599 31.3 656.3V864.6C31.3 921.9 78.1 968.8 135.4 968.8H864.6C921.9 968.8 968.8 921.9 968.8 864.6V656.3C968.8 599 921.9 552.1 864.6 552.1ZM239.6 864.6C182.3 864.6 135.4 817.7 135.4 760.4 135.4 703.1 182.3 656.3 239.6 656.3 296.9 656.3 343.8 703.1 343.8 760.4 343.8 817.7 296.9 864.6 239.6 864.6ZM864.6 31.3H135.4C78.1 31.3 31.3 78.1 31.3 135.4V343.8C31.3 401 78.1 447.9 135.4 447.9H864.6C921.9 447.9 968.8 401 968.8 343.8V135.4C968.8 78.1 921.9 31.3 864.6 31.3ZM239.6 343.8C182.3 343.8 135.4 296.9 135.4 239.6 135.4 182.3 182.3 135.4 239.6 135.4 296.9 135.4 343.8 182.3 343.8 239.6 343.8 296.9 296.9 343.8 239.6 343.8Z", "width": 1000 }, - "search": [ - "server" - ] + "search": ["server"] }, { "uid": "5d0982f672cac52417ec91081b88262a", @@ -226,9 +196,7 @@ "path": "M791.7 791.7H208.3V208.3H500V125H208.3C162.1 125 125 162.5 125 208.3V791.7C125 837.5 162.1 875 208.3 875H791.7C837.5 875 875 837.5 875 791.7V500H791.7V791.7ZM583.3 125V208.3H732.9L323.3 617.9 382.1 676.7 791.7 267.1V416.7H875V125H583.3Z", "width": 1000 }, - "search": [ - "link" - ] + "search": ["link"] }, { "uid": "55e9c26b2cef3446f9d000c56885595d", @@ -240,9 +208,7 @@ "path": "M204.2 541.7C227.1 541.7 245.8 522.9 245.8 500 245.8 477.1 227.1 458.3 204.2 458.3 181.3 458.3 162.5 477.1 162.5 500 162.5 522.9 181.3 541.7 204.2 541.7ZM204.2 708.3C227.1 708.3 245.8 689.6 245.8 666.7 245.8 643.8 227.1 625 204.2 625 181.3 625 162.5 643.8 162.5 666.7 162.5 689.6 181.3 708.3 204.2 708.3ZM204.2 375C227.1 375 245.8 356.3 245.8 333.3 245.8 310.4 227.1 291.7 204.2 291.7 181.3 291.7 162.5 310.4 162.5 333.3 162.5 356.3 181.3 375 204.2 375ZM370.8 541.7H870.8C893.8 541.7 912.5 522.9 912.5 500 912.5 477.1 893.8 458.3 870.8 458.3H370.8C347.9 458.3 329.2 477.1 329.2 500 329.2 522.9 347.9 541.7 370.8 541.7ZM370.8 708.3H870.8C893.8 708.3 912.5 689.6 912.5 666.7 912.5 643.8 893.8 625 870.8 625H370.8C347.9 625 329.2 643.8 329.2 666.7 329.2 689.6 347.9 708.3 370.8 708.3ZM329.2 333.3C329.2 356.3 347.9 375 370.8 375H870.8C893.8 375 912.5 356.3 912.5 333.3 912.5 310.4 893.8 291.7 870.8 291.7H370.8C347.9 291.7 329.2 310.4 329.2 333.3ZM204.2 541.7C227.1 541.7 245.8 522.9 245.8 500 245.8 477.1 227.1 458.3 204.2 458.3 181.3 458.3 162.5 477.1 162.5 500 162.5 522.9 181.3 541.7 204.2 541.7ZM204.2 708.3C227.1 708.3 245.8 689.6 245.8 666.7 245.8 643.8 227.1 625 204.2 625 181.3 625 162.5 643.8 162.5 666.7 162.5 689.6 181.3 708.3 204.2 708.3ZM204.2 375C227.1 375 245.8 356.3 245.8 333.3 245.8 310.4 227.1 291.7 204.2 291.7 181.3 291.7 162.5 310.4 162.5 333.3 162.5 356.3 181.3 375 204.2 375ZM370.8 541.7H870.8C893.8 541.7 912.5 522.9 912.5 500 912.5 477.1 893.8 458.3 870.8 458.3H370.8C347.9 458.3 329.2 477.1 329.2 500 329.2 522.9 347.9 541.7 370.8 541.7ZM370.8 708.3H870.8C893.8 708.3 912.5 689.6 912.5 666.7 912.5 643.8 893.8 625 870.8 625H370.8C347.9 625 329.2 643.8 329.2 666.7 329.2 689.6 347.9 708.3 370.8 708.3ZM329.2 333.3C329.2 356.3 347.9 375 370.8 375H870.8C893.8 375 912.5 356.3 912.5 333.3 912.5 310.4 893.8 291.7 870.8 291.7H370.8C347.9 291.7 329.2 310.4 329.2 333.3Z", "width": 1050 }, - "search": [ - "icon-plain-list" - ] + "search": ["icon-plain-list"] }, { "uid": "3fc6b3bd1689a30c42520e984c316bc7", @@ -254,9 +220,7 @@ "path": "M762.5 237.9C746.3 221.7 720 221.7 703.8 237.9L500 441.2 296.3 237.5C280 221.2 253.8 221.2 237.5 237.5 221.3 253.7 221.3 280 237.5 296.3L441.3 500 237.5 703.8C221.3 720 221.3 746.3 237.5 762.5 253.8 778.8 280 778.8 296.3 762.5L500 558.8 703.8 762.5C720 778.8 746.3 778.8 762.5 762.5 778.8 746.3 778.8 720 762.5 703.8L558.8 500 762.5 296.3C778.3 280.4 778.3 253.7 762.5 237.9Z", "width": 1000 }, - "search": [ - "close" - ] + "search": ["close"] }, { "uid": "67a2af2bfd3423ece906dbd697504f71", @@ -268,9 +232,7 @@ "path": "M381.3 965.3L232 856 474.7 546.6 96 442.6 154.7 264 522.7 400 506.7 8H693.3L677.3 400 1045.3 264 1104 442.6 725.3 546.6 968 856 818.7 965.3 600 637.3 381.3 965.3Z", "width": 1167 }, - "search": [ - "star" - ] + "search": ["star"] }, { "uid": "c41b03180feb2ef0a249d21abc86356b", @@ -282,9 +244,7 @@ "path": "M688.3 366.7H600V88.9C600 58.3 575 33.3 544.5 33.3H322.2C291.7 33.3 266.7 58.3 266.7 88.9V366.7H178.3C128.9 366.7 103.9 426.7 138.9 461.7L393.9 716.7C415.6 738.3 450.6 738.3 472.2 716.7L727.2 461.7C762.2 426.7 737.8 366.7 688.3 366.7ZM44.4 922.2C44.4 952.8 69.5 977.8 100 977.8H766.7C797.2 977.8 822.2 952.8 822.2 922.2 822.2 891.7 797.2 866.7 766.7 866.7H100C69.5 866.7 44.4 891.7 44.4 922.2Z", "width": 867 }, - "search": [ - "download" - ] + "search": ["download"] }, { "uid": "8f13c3e3180a4413c82f39b91fba10fa", @@ -296,9 +256,7 @@ "path": "M714.3 53.6C416.7 53.6 162.5 238.7 59.5 500 162.5 761.3 416.7 946.4 714.3 946.4 1011.9 946.4 1266.1 761.3 1369 500 1266.1 238.7 1011.9 53.6 714.3 53.6ZM714.3 797.6C550 797.6 416.7 664.3 416.7 500 416.7 335.7 550 202.4 714.3 202.4 878.6 202.4 1011.9 335.7 1011.9 500 1011.9 664.3 878.6 797.6 714.3 797.6ZM714.3 321.4C615.5 321.4 535.7 401.2 535.7 500 535.7 598.8 615.5 678.6 714.3 678.6 813.1 678.6 892.9 598.8 892.9 500 892.9 401.2 813.1 321.4 714.3 321.4Z", "width": 1429 }, - "search": [ - "preview" - ] + "search": ["preview"] }, { "uid": "64b76bbabe65aab05df3236be00ba059", @@ -310,9 +268,7 @@ "path": "M791.7 333.3H716.2C697.5 300.8 671.7 272.9 640.4 251.7L679.2 212.9C695.4 196.7 695.4 170.4 679.2 154.2 662.9 137.9 636.7 137.9 620.4 154.2L559.2 215.4C540 210.8 520.4 208.3 500 208.3 479.6 208.3 460 210.8 441.2 215.4L379.6 154.2C363.3 137.9 337.1 137.9 320.8 154.2 304.6 170.4 304.6 196.7 320.8 212.9L359.2 251.7C328.3 272.9 302.5 300.8 283.7 333.3H208.3C185.4 333.3 166.7 352.1 166.7 375 166.7 397.9 185.4 416.7 208.3 416.7H253.7C251.7 430.4 250 444.2 250 458.3V500H208.3C185.4 500 166.7 518.8 166.7 541.7 166.7 564.6 185.4 583.3 208.3 583.3H250V625C250 639.2 251.7 652.9 253.7 666.7H208.3C185.4 666.7 166.7 685.4 166.7 708.3 166.7 731.3 185.4 750 208.3 750H283.7C327.1 824.6 407.5 875 500 875 592.5 875 672.9 824.6 716.2 750H791.7C814.6 750 833.3 731.3 833.3 708.3 833.3 685.4 814.6 666.7 791.7 666.7H746.2C748.3 652.9 750 639.2 750 625V583.3H791.7C814.6 583.3 833.3 564.6 833.3 541.7 833.3 518.8 814.6 500 791.7 500H750V458.3C750 444.2 748.3 430.4 746.2 416.7H791.7C814.6 416.7 833.3 397.9 833.3 375 833.3 352.1 814.6 333.3 791.7 333.3ZM541.7 666.7H458.3C435.4 666.7 416.7 647.9 416.7 625 416.7 602.1 435.4 583.3 458.3 583.3H541.7C564.6 583.3 583.3 602.1 583.3 625 583.3 647.9 564.6 666.7 541.7 666.7ZM541.7 500H458.3C435.4 500 416.7 481.3 416.7 458.3 416.7 435.4 435.4 416.7 458.3 416.7H541.7C564.6 416.7 583.3 435.4 583.3 458.3 583.3 481.3 564.6 500 541.7 500Z", "width": 1000 }, - "search": [ - "bug" - ] + "search": ["bug"] }, { "uid": "0a6ed3ec0fe5574348dc21adeb727402", @@ -324,9 +280,7 @@ "path": "M548.6 937.5C575.7 910.4 575.7 866.7 548.6 839.6L279.9 569.4H1333.3C1371.5 569.4 1402.8 538.2 1402.8 500 1402.8 461.8 1371.5 430.6 1333.3 430.6H279.9L549.3 161.1C576.4 134 576.4 90.3 549.3 63.2 522.2 36.1 478.5 36.1 451.4 63.2L62.5 451.4C35.4 478.5 35.4 522.2 62.5 549.3L450.7 937.5C477.8 963.9 522.2 963.9 548.6 937.5Z", "width": 1417 }, - "search": [ - "arrow-back" - ] + "search": ["arrow-back"] }, { "uid": "b4ed4b0aa29c7441e6dcae6246d65887", @@ -338,9 +292,7 @@ "path": "M750 541.7H541.7V750C541.7 772.9 522.9 791.7 500 791.7 477.1 791.7 458.3 772.9 458.3 750V541.7H250C227.1 541.7 208.3 522.9 208.3 500 208.3 477.1 227.1 458.3 250 458.3H458.3V250C458.3 227.1 477.1 208.3 500 208.3 522.9 208.3 541.7 227.1 541.7 250V458.3H750C772.9 458.3 791.7 477.1 791.7 500 791.7 522.9 772.9 541.7 750 541.7Z", "width": 1000 }, - "search": [ - "plus" - ] + "search": ["plus"] }, { "uid": "b14d8db41a71de1897a700b84a8d5757", @@ -352,9 +304,7 @@ "path": "M1108.4 368.9C1070.6 177.2 902.2 33.3 700 33.3 539.5 33.3 400 124.4 330.6 257.8 163.3 275.5 33.3 417.2 33.3 588.9 33.3 772.8 182.8 922.2 366.7 922.2H1088.9C1242.2 922.2 1366.7 797.8 1366.7 644.4 1366.7 497.8 1252.8 378.9 1108.4 368.9ZM811.1 533.3V755.5H588.9V533.3H422.2L680.6 275C691.7 263.9 708.9 263.9 720 275L977.8 533.3H811.1Z", "width": 1400 }, - "search": [ - "upload" - ] + "search": ["upload"] }, { "uid": "91744fd9f59dcce494c79df0765cf356", @@ -366,9 +316,7 @@ "path": "M633.3 11.1H144.5C95.6 11.1 55.6 51.1 55.6 100V677.8C55.6 702.2 75.6 722.2 100 722.2 124.5 722.2 144.5 702.2 144.5 677.8V144.5C144.5 120 164.5 100 188.9 100H633.3C657.8 100 677.8 80 677.8 55.6 677.8 31.1 657.8 11.1 633.3 11.1ZM811.1 188.9H322.2C273.3 188.9 233.3 228.9 233.3 277.8V900C233.3 948.9 273.3 988.9 322.2 988.9H811.1C860 988.9 900 948.9 900 900V277.8C900 228.9 860 188.9 811.1 188.9ZM766.7 900H366.7C342.2 900 322.2 880 322.2 855.6V322.2C322.2 297.8 342.2 277.8 366.7 277.8H766.7C791.1 277.8 811.1 297.8 811.1 322.2V855.6C811.1 880 791.1 900 766.7 900Z", "width": 933 }, - "search": [ - "copy" - ] + "search": ["copy"] }, { "uid": "d18327f9faedba7eeda714d3b27f73e1", @@ -380,9 +328,7 @@ "path": "M375 673.7L230.4 529.2C214.2 512.9 187.9 512.9 171.7 529.2 155.4 545.4 155.4 571.7 171.7 587.9L345.8 762.1C362.1 778.3 388.3 778.3 404.6 762.1L845.4 321.2C861.7 305 861.7 278.7 845.4 262.5 829.2 246.2 802.9 246.2 786.7 262.5L375 673.7Z", "width": 1000 }, - "search": [ - "check" - ] + "search": ["check"] }, { "uid": "ff4945dd09f065616159d101cfc60261", @@ -394,9 +340,7 @@ "path": "M115 966.7H951.7C1037.2 966.7 1090.6 873.9 1047.8 800L629.4 77.2C586.7 3.3 480 3.3 437.2 77.2L18.9 800C-23.9 873.9 29.4 966.7 115 966.7ZM533.3 577.8C502.8 577.8 477.8 552.8 477.8 522.2V411.1C477.8 380.6 502.8 355.6 533.3 355.6 563.9 355.6 588.9 380.6 588.9 411.1V522.2C588.9 552.8 563.9 577.8 533.3 577.8ZM588.9 800H477.8V688.9H588.9V800Z", "width": 1067 }, - "search": [ - "danger" - ] + "search": ["danger"] } ] -} \ No newline at end of file +} diff --git a/src/assets/fonts/fontello/fontello.css b/src/assets/fonts/fontello/fontello.css index dee0818..eb20066 100644 --- a/src/assets/fonts/fontello/fontello.css +++ b/src/assets/fonts/fontello/fontello.css @@ -126,8 +126,18 @@ .icon-arrow-back:before { content: '\e816'; } /* '' */ -.icon-plus:before { content: '\e817'; } /* '' */ -.icon-upload:before { content: '\e818'; } /* '' */ -.icon-copy:before { content: '\e819'; } /* '' */ -.icon-check:before { content: '\e81a'; } /* '' */ -.icon-danger:before { content: '\e81b'; } /* '' */ +.icon-plus:before { + content: '\e817'; +} /* '' */ +.icon-upload:before { + content: '\e818'; +} /* '' */ +.icon-copy:before { + content: '\e819'; +} /* '' */ +.icon-check:before { + content: '\e81a'; +} /* '' */ +.icon-danger:before { + content: '\e81b'; +} /* '' */ diff --git a/src/components/Button/Button.styles.scss b/src/components/Button/Button.styles.scss index 098e5b9..14bf980 100644 --- a/src/components/Button/Button.styles.scss +++ b/src/components/Button/Button.styles.scss @@ -13,7 +13,7 @@ border-bottom-right-radius: 0; } - .btn+.btn { + .btn + .btn { margin-left: -1px; } } diff --git a/src/components/Dropdown/DropdownMenu/DropdownMenu.styles.scss b/src/components/Dropdown/DropdownMenu/DropdownMenu.styles.scss index 3f85842..5a282a5 100644 --- a/src/components/Dropdown/DropdownMenu/DropdownMenu.styles.scss +++ b/src/components/Dropdown/DropdownMenu/DropdownMenu.styles.scss @@ -37,7 +37,7 @@ position: relative; } - [class^='icon-']+span { + [class^='icon-'] + span { margin-left: 1.2rem; } diff --git a/src/components/Editor/Editor.styles.scss b/src/components/Editor/Editor.styles.scss index a0b2735..5da84ae 100644 --- a/src/components/Editor/Editor.styles.scss +++ b/src/components/Editor/Editor.styles.scss @@ -10,7 +10,8 @@ } } -.errorLine, .errorLine+.line-numbers { +.errorLine, +.errorLine + .line-numbers { background: $secondary-red; opacity: 0.65; } diff --git a/src/components/MainContent/MainContent.styles.scss b/src/components/MainContent/MainContent.styles.scss index bb3cd00..186e0b6 100644 --- a/src/components/MainContent/MainContent.styles.scss +++ b/src/components/MainContent/MainContent.styles.scss @@ -23,7 +23,8 @@ } } - .resource-header, .reusable-header { + .resource-header, + .reusable-header { margin: 0 3rem 3.2rem; font-size: 2.8rem; line-height: 3.6rem; diff --git a/src/components/Modals/Contacts/Contacts.styles.scss b/src/components/Modals/Contacts/Contacts.styles.scss index 2f15e65..85383e7 100644 --- a/src/components/Modals/Contacts/Contacts.styles.scss +++ b/src/components/Modals/Contacts/Contacts.styles.scss @@ -36,7 +36,7 @@ .label { font-weight: 500; font-size: 1.6rem; - margin-bottom: .8rem; + margin-bottom: 0.8rem; } .value { diff --git a/src/components/Modals/SharingForm/SharingForm.styles.scss b/src/components/Modals/SharingForm/SharingForm.styles.scss index f2df8d3..709ada5 100644 --- a/src/components/Modals/SharingForm/SharingForm.styles.scss +++ b/src/components/Modals/SharingForm/SharingForm.styles.scss @@ -33,12 +33,13 @@ display: flex; margin-top: 0.8rem; - input, button { + input, + button { border: 1px solid $secondary-stroke; border-radius: 4px; } - >input:not(:last-child) { + > input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1 1 auto; diff --git a/src/components/Notifications/Notifications.styles.scss b/src/components/Notifications/Notifications.styles.scss index 66baf8b..f3fbbbb 100644 --- a/src/components/Notifications/Notifications.styles.scss +++ b/src/components/Notifications/Notifications.styles.scss @@ -7,7 +7,8 @@ .notification-success { &.success { background: rgba(255, 255, 255, 0.95); - box-shadow: 0 0 36px rgba(27, 17, 40, 0.08), 0 0 12px rgba(27, 17, 40, 0.04), 0 0 4px rgba(27, 17, 40, 0.02); + box-shadow: 0 0 36px rgba(27, 17, 40, 0.08), 0 0 12px rgba(27, 17, 40, 0.04), + 0 0 4px rgba(27, 17, 40, 0.02); border-radius: 21px; min-height: 0; color: $main-text; diff --git a/src/components/Resource/ResourceMethods.styles.scss b/src/components/Resource/ResourceMethods.styles.scss index 46196b6..df87bab 100644 --- a/src/components/Resource/ResourceMethods.styles.scss +++ b/src/components/Resource/ResourceMethods.styles.scss @@ -20,7 +20,7 @@ } &:not(.active) { - +button:not(.active) { + + button:not(.active) { margin-left: -1px; } } @@ -54,7 +54,7 @@ .method-label { color: #fff; &.get { - border-color: #0D739E; + border-color: #0d739e; background-color: $secondary-blue; } &.post { @@ -62,19 +62,19 @@ background-color: $secondary-green; } &.put { - border-color: #DAA431; + border-color: #daa431; background-color: $secondary-yellow; } &.patch { - border-color: #54A9A8; + border-color: #54a9a8; background-color: $secondary-azure; } &.delete { - border-color: #AD301E; + border-color: #ad301e; background-color: $secondary-red; } &.head { - border-color: #6925D8; + border-color: #6925d8; background-color: $main-purple; } &.options { @@ -95,7 +95,8 @@ } .reusable-resource { - .params-table, .code-view-wrapper { + .params-table, + .code-view-wrapper { margin-top: 1.2rem; } diff --git a/src/components/ShareButton/ShareButton.styles.scss b/src/components/ShareButton/ShareButton.styles.scss index 7d9b327..370c524 100644 --- a/src/components/ShareButton/ShareButton.styles.scss +++ b/src/components/ShareButton/ShareButton.styles.scss @@ -23,7 +23,7 @@ flex-direction: row; cursor: pointer; - +hr { + + hr { height: 1px; background-color: $secondary-stroke; } @@ -62,7 +62,7 @@ height: 3.2rem; background-color: $main-purple; - >div { + > div { display: flex; align-items: center; height: 100%; @@ -83,5 +83,3 @@ } } } - - diff --git a/src/components/SidebarContent/SidebarGroupItems.styles.scss b/src/components/SidebarContent/SidebarGroupItems.styles.scss index 532d811..545f755 100644 --- a/src/components/SidebarContent/SidebarGroupItems.styles.scss +++ b/src/components/SidebarContent/SidebarGroupItems.styles.scss @@ -3,7 +3,7 @@ .sidebar-items { margin-top: 3.65rem; - +.sidebar-items { + + .sidebar-items { margin-top: 2rem; } @@ -25,7 +25,7 @@ > ul { padding-left: 0; - margin-top: .4rem; + margin-top: 0.4rem; > li { padding: 1.4rem 0 1.2rem; diff --git a/src/hooks/useExport.ts b/src/hooks/useExport.ts index 3e02541..315553f 100644 --- a/src/hooks/useExport.ts +++ b/src/hooks/useExport.ts @@ -1,101 +1,28 @@ import {useContext} from 'react'; -import {find} from 'lodash'; import {JDocContext} from 'store'; export function useExport() { const jdocData = useContext(JDocContext); const renderHtml: () => Promise = async () => { - const styles = document.querySelectorAll('style'); - let stylesResult = ''; - for (let i = 0; i < styles.length; ++i) { - stylesResult += ``; - } - - const hostName = window.location.protocol + '//' + window.location.host; - - let scriptLink = ''; - let styleLink = ''; - if (process.env.NODE_ENV !== 'production') { - const scripts = document.querySelectorAll('script'); - scriptLink = find(scripts, (script) => script.src.indexOf('static/js') !== -1)?.src || ''; - const links = document.querySelectorAll('link'); - styleLink = find(links, (style) => style.href.indexOf('static/css') !== -1)?.href || ''; - } else { - scriptLink = hostName + '/static/js/export-main.js'; - styleLink = hostName + '/static/css/export-main.css'; - } + if (process.env.NODE_ENV === 'production') { + const hostName = window.location.protocol + '//' + window.location.host; + const htmlLink = hostName + '/index-template.html'; - if (scriptLink) { - const scriptText = await fetch(scriptLink).then(async (response) => { + const html = await fetch(htmlLink).then(async (response) => { if (response.ok) { return await response.text(); } + return ''; }); - let cssText: string | undefined = ''; - if (styleLink) { - cssText = await fetch(styleLink).then(async (response) => { - if (response.ok) { - return await response.text(); - } - }); - if (cssText) { - cssText = cssText.replaceAll('../../', `${hostName}/`); - } - } - - return ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JSight Online Editor - - - ${cssText ? `` : ''} - - -
- - - `; + return html + .replace('{{ jdoc }}', JSON.stringify(jdocData)) + .replaceAll('../../', `${hostName}/`); + } else { + console.log('Export does not work in development mode'); + return null; } - return null; }; const saveHtml = async () => { diff --git a/src/styles/_typography.scss b/src/styles/_typography.scss index 8ea6b96..db6b390 100644 --- a/src/styles/_typography.scss +++ b/src/styles/_typography.scss @@ -2,10 +2,10 @@ font-family: 'fontello'; src: url('../assets/fonts/fontello/fontello.eot'); src: url('../assets/fonts/fontello/fontello.eot?#iefix') format('embedded-opentype'), - url('../assets/fonts/fontello/fontello.woff2') format('woff2'), - url('../assets/fonts/fontello/fontello.woff') format('woff'), - url('../assets/fonts/fontello/fontello.ttf') format('truetype'), - url('../assets/fonts/fontello/fontello.svg#fontello') format('svg'); + url('../assets/fonts/fontello/fontello.woff2') format('woff2'), + url('../assets/fonts/fontello/fontello.woff') format('woff'), + url('../assets/fonts/fontello/fontello.ttf') format('truetype'), + url('../assets/fonts/fontello/fontello.svg#fontello') format('svg'); font-weight: normal; font-style: normal; }