From 0ed5f88e04378851f71da18522ae1c15d2715035 Mon Sep 17 00:00:00 2001 From: SharkPool <139097378+SharkPool-SP@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:32:04 -0800 Subject: [PATCH 1/5] Update selectable-shapes.js --- src/helper/selectable-shapes.js | 746 ++++++++++++++------------------ 1 file changed, 336 insertions(+), 410 deletions(-) diff --git a/src/helper/selectable-shapes.js b/src/helper/selectable-shapes.js index c4ce728b02..321a38b1f1 100644 --- a/src/helper/selectable-shapes.js +++ b/src/helper/selectable-shapes.js @@ -1,429 +1,355 @@ import log from '../log/log'; -// TODO: would be nice if these could be automatically used for the icons -const selectablePaths = { - blank: '', - sussy: 'm 77 0 h 28 a 20 20 0 0 1 20 20 v 0 a 20 20 0 0 1 -20 20 V 40 H 77 V 112 A 1 1 0 0 1 42 111 A 1 1 0 0 0 16 112 A 1 1 0 0 1 -18 111 V 74 H -29 C -35 74 -36 73 -36 67 V 5 C -36 -1 -35 -2 -29 -2 H -18 A 1 1 0 0 1 76 0', - speechBubble: 'M204.14966,175.04472c-0.31482,-15.49173 8.58161,-20.45314 15.2824,-20.45314c8.15418,0 26.20534,-0.47063 40.10194,0c6.7857,0.22981 16.64329,5.37466 16.31655,20.45314c-0.30922,14.27018 -11.32079,18.61465 -16.43145,18.61465c-4.65217,0 -12.43125,0 -21.25748,0c-2.33362,0 -8.8706,12.31777 -19.5339,11.95015c-7.56289,-0.26073 4.2991,-11.95015 1.26396,-11.95015c-9.00032,0 -15.52291,-7.83267 -15.74202,-18.61465z', - thinkingBubble: 'M181.625,163.75c0,-9.03599 8.31115,-16.7148 19.88037,-19.50356c3.78813,-8.33365 14.94537,-14.37144 28.11963,-14.37144c10.60583,0 19.90445,3.91305 25.10344,9.78682c1.5942,-0.18873 3.22977,-0.28682 4.89656,-0.28682c7.20482,0 13.82617,1.83268 19.04507,4.89724c0.96891,-0.09722 1.95499,-0.14724 2.95493,-0.14724c13.66905,0 24.75,9.34606 24.75,20.875c0,6.80117 -3.85625,12.84269 -9.82521,16.65396c2.12223,2.1898 3.32521,4.69056 3.32521,7.34604c0,8.62945 -12.70392,15.625 -28.375,15.625c-5.79983,0 -11.19324,-0.9582 -15.68664,-2.60279c-5.37837,3.48673 -12.44651,5.60279 -20.18836,5.60279c-2.14277,0 -4.23392,-0.1621 -6.25193,-0.4705c0.00128,0.04563 0.00193,0.09136 0.00193,0.13717c0,4.55635 -6.37994,8.25 -14.25,8.25c-7.87006,0 -14.25,-3.69365 -14.25,-8.25c0,-1.85573 1.0583,-3.56835 2.84455,-4.9466c-12.33446,-0.48405 -22.09455,-6.7775 -22.09455,-14.47006c0,-4.13493 2.81999,-7.8656 7.34397,-10.50709c-4.57145,-3.63277 -7.34397,-8.39897 -7.34397,-13.61791zM202.125,220.66667c0,2.96853 -3.52576,5.375 -7.875,5.375c-4.34924,0 -7.875,-2.40647 -7.875,-5.375c0,-2.96853 3.52576,-5.375 7.875,-5.375c4.34924,0 7.875,2.40647 7.875,5.375zM183.375,226c0,2.27818 -2.18261,4.125 -4.875,4.125c-2.69239,0 -4.875,-1.84682 -4.875,-4.125c0,-2.27818 2.18261,-4.125 4.875,-4.125c2.69239,0 4.875,1.84682 4.875,4.125z', - squareBubble: 'M 189 156 C 189 152 192 149 201 149 L 280 149 C 288 149 291 152 291 156 L 291 190.1874 C 291 195 288 198 282.5854 198.259 L 237.8872 198.259 C 234.5436 198.259 225.1776 213.7976 209.8995 213.3339 C 199.0636 213.005 216.0591 198.259 211.7105 198.259 L 198 198.259 C 192 198 189 195 189 189.9301 Z', - shoutBubble: 'M227.11094,208.57049c-5.92772,5.58295 -15.6124,15.76793 -29.02488,15.33964c-11.40942,-0.36435 0.9565,-15.09531 2.93147,-18.17751c3.24637,-5.06637 1.63986,-8.52859 1.63986,-8.52859l-21.47242,5.86044l4.84649,-13.34467l-21.15795,-1.09108l23.26277,-13.82792l-20.14297,-9.34374l22.87578,-5.70891l-10.25508,-14.51162l19.58978,8.2709l-1.70024,-12.65976l16.59077,13.46143l1.10608,-13.38683l15.56167,11.24624l12.10608,-16.09172l5.91725,15.89507l18.12276,-12.77889l-3.24144,15.28333l22.11413,-10.58546l-4.54409,17.01121l23.95449,-11.29693l-8.61338,14.50991l16.14654,3.46186l-20.56767,7.84186l21.96975,8.07507l-23.41162,4.65774l18.31315,10.48796l-30.03068,-1.02513l3.75565,11.52599l-26.77205,-10.86823l-7.93841,9.53141l-12.67597,-9.86071c0,0 -3.17514,4.90084 -9.25562,10.62767z', - smile: 'M218.60708,180c0,-11.81499 9.57794,-21.39292 21.39292,-21.39292c11.81499,0 21.39292,9.57794 21.39292,21.39292c0,11.81499 -9.57794,21.39293 -21.39292,21.39293c-11.81499,0 -21.39292,-9.57794 -21.39292,-21.39293zM239.89701,196.60775c14.70959,0.07281 16.22782,-13.7612 16.22782,-13.7612h-31.54689c0,0 1.12947,13.69096 15.31907,13.7612zM247.80316,176.22994c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.8933 -2.8933,-2.8933c-1.59793,0 -2.8933,1.29538 -2.8933,2.8933c0,1.59793 1.29538,2.8933 2.8933,2.8933zM232.19685,176.22994c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.8933 -2.8933,-2.8933c-1.59793,0 -2.8933,1.29538 -2.8933,2.8933c0,1.59793 1.29538,2.8933 2.8933,2.8933z', - frown: 'M218.60708,180c0,-11.81499 9.57794,-21.39292 21.39292,-21.39292c11.81499,0 21.39293,9.57794 21.39293,21.39292c0,11.81499 -9.57794,21.39292 -21.39293,21.39292c-11.81498,0 -21.39292,-9.57794 -21.39292,-21.39292zM247.80316,176.22993c1.59793,0 2.89331,-1.29538 2.89331,-2.8933c0,-1.59793 -1.29537,-2.89331 -2.89331,-2.89331c-1.59793,0 -2.8933,1.29538 -2.8933,2.89331c0,1.59793 1.29537,2.8933 2.8933,2.8933zM232.19685,176.22993c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.89331 -2.8933,-2.89331c-1.59793,0 -2.8933,1.29538 -2.8933,2.89331c0,1.59793 1.29538,2.8933 2.8933,2.8933zM226.26564,193.49228h28.1715c0,0 -1.35578,-10.96285 -14.49151,-10.90515c-12.67137,0.05566 -13.67999,10.90515 -13.67999,10.90515z', - codeblock: 'M191.07407,156c0,-2.20914 1.79086,-4 4,-4h8c2,0 3,1 4,2l4,4c1,1 2,2 4,2h12c2,0 3,-1 4,-2l4,-4c1,-1 2,-2 4,-2h45.85186c2.20914,0 4,1.79086 4,4v40c0,2.20914 -1.79086,4 -4,4h-45.85186c-2,0 -3,1 -4,2l-4,4c-1,1 -2,2 -4,2h-12c-2,0 -3,-1 -4,-2l-4,-4c-1,-1 -2,-2 -4,-2h-8c-2.20914,0 -4,-1.79086 -4,-4z', - codeblockHat: 'M 0.54 2.093 C 3.214 -0.191 6.978 0.899 8.068 2.093 L 11.667 2.093 Q 11.851 2.076 11.949 2.297 L 11.949 5.526 Q 11.925 5.747 11.741 5.809 L 4.177 5.809 C 3.904 5.969 3.725 6.335 3.43 6.439 L 2.359 6.439 C 2.051 6.337 1.897 5.975 1.598 5.83 L 0.797 5.83 Q 0.588 5.708 0.548 5.563 Z', - codeblockEndCap: 'M 0.554 6.094 Q 0.584 5.901 0.777 5.824 L 1.602 5.824 C 1.892 5.98 2.04 6.333 2.358 6.442 L 3.409 6.446 C 3.748 6.361 3.847 5.966 4.203 5.824 L 6.289 5.824 Q 6.515 5.885 6.561 6.1 L 6.561 9.253 Q 6.521 9.502 6.283 9.569 L 0.837 9.569 Q 0.614 9.538 0.554 9.308 Z', - codeblockReporter: 'M 11.864 6.638 L 15.403 6.644 C 17.396 6.894 17.338 9.532 15.403 9.765 L 11.864 9.77 C 10.045 9.643 9.778 6.905 11.864 6.638 Z', - codeblockBoolean: 'M 11.967 13.517 L 16.615 13.509 L 18.188 15.076 L 16.615 16.642 L 11.967 16.635 L 10.393 15.076 Z', - cloud: 'M158.70156,190.30055c5.28613,-2.83052 11.70216,-2.80297 14.45107,-3.01001c1.11791,-2.76161 17.92516,-32.66635 39.60873,-32.32664c21.75534,0.41423 30.07396,15.16631 40.51872,23.33781c12.96693,-9.11314 22.14689,-12.62033 35.86057,-9.23745c12.88406,3.27521 19.41273,22.07303 19.93181,22.83242c0.25097,0.37125 7.32687,-4.86498 13.30369,-3.82602c7.68158,1.33529 10.15773,16.75568 8.47916,16.75568c-2.13284,0 -176.99884,-0.27065 -181.13536,0.21264c-4.02823,-3.61485 4.21405,-12.184 8.98161,-14.73843z', - cloud2: 'M 13 18 A 1 1 0 0 1 13 6 A 1 1 0 0 1 29 6 A 1 0.75 0 0 1 39 6 A 1 1 0 0 1 39 18 Z', - heart: 'M182.17524,160.22928c-0.06174,-6.9356 0.38429,-9.6077 2.28538,-13.6958c0.21863,-0.47017 0.44452,-0.93216 0.67758,-1.38588c0.041,-0.08369 0.0824,-0.16634 0.12422,-0.24792c0.8012,-1.56302 1.70465,-3.01791 2.69546,-4.36451c2.87826,-3.97624 6.46849,-7.08113 10.70447,-9.24389c4.19614,-2.14228 6.35284,-3.1423 13.00539,-3.25541c0.73674,-0.02848 1.47326,-0.03072 2.20779,-0.0067c5.51272,0.05908 7.5834,0.72925 10.6475,2.33132c5.98584,2.56127 11.11488,7.22077 14.1395,13.99129l1.33748,2.99387l1.33748,-2.99387c3.02461,-6.77051 8.15365,-11.43 14.13948,-13.99128c3.06411,-1.60208 5.13479,-2.27226 10.64753,-2.33133c0.73452,-0.02402 1.47103,-0.02178 2.20776,0.0067c6.65256,0.11311 8.80926,1.11313 13.0054,3.25541c4.23591,2.16272 7.8261,5.26755 10.70433,9.24371c0.99086,1.34665 1.89437,2.8016 2.6956,4.36469c0.04183,0.08159 0.08324,0.16426 0.12425,0.24797c0.23305,0.45371 0.45893,0.91567 0.67755,1.38583c1.90109,4.0881 2.34712,6.7602 2.28538,13.6958c-0.00127,0.14305 -0.00303,0.28572 -0.00528,0.42802c0.10329,5.40072 -0.53917,10.86793 -1.9823,14.87168c-3.9932,11.0782 -11.61727,19.5239 -29.30813,32.466c-11.60195,8.4878 -24.70011,21.3299 -25.60268,23.1336c-0.49,0.97911 -1.36275,0.97911 -1.85275,0c-0.90257,-1.8037 -14.00072,-14.6458 -25.60268,-23.1336c-17.69086,-12.9421 -25.31493,-21.3878 -29.30813,-32.466c-1.44313,-4.00376 -2.0856,-9.47098 -1.9823,-14.87171c-0.00225,-0.14229 -0.004,-0.28495 -0.00528,-0.42799z', - check: 'M165.25,196.6109l22.7173,-22.8612l30.6088,24.281l71.6857,-83.9057l24.4882,22.1844l-94.7184,109.5656z', - cross: 'M199.65003,179.64477l-79.5,-77l38.00987,-40.68564l79.49013,76.68564l80.09184,-78.14413l39.93685,39.28777l-78.5287,79.35636l80.69993,77.78108l-39.28229,39.59957l-80.18174,-77.08931l-77.03078,80.06325l-41.49233,-38.94156z', - chevronArrow: 'M 0 0 L 4 0 L 6 3 L 4 6 L 0 6 L 2 3 Z', - pentagonArrow: 'M 0 0 L 4 0 L 6 3 L 4 6 L 0 6 Z', - lightningBolt: 'M 3.787 2.769 L 10.034 0.384 L 12.03 5.879 L 11.019 6.423 L 14.077 11.348 L 12.729 11.892 L 16.177 19.927 L 9.204 13.163 L 10.811 12.54 L 6.457 8.238 L 8.349 7.357 Z', - lightningBolt2: 'M 6.327 0.618 L 14.129 0.618 L 11.122 7.434 L 14.233 7.434 L 6.379 19.539 L 7.857 9.767 L 4.694 9.767 Z', - gear: 'M355.56099,206.36652c-2.17425,0.17536 -4.04645,1.55018 -4.8852,3.55905l-11.25255,27.1569c-0.83875,2.00887 -0.46805,4.31979 0.9361,5.96795l22.3104,26.09412c3.66639,4.29046 3.43237,10.68715 -0.57539,14.69491l-18.25396,18.25396c-3.99777,3.99777 -10.40445,4.24178 -14.69491,0.5654l-26.09412,-22.3104c-1.63818,-1.40415 -3.95908,-1.77485 -5.95797,-0.9361l-27.16626,11.25255c-2.00887,0.83875 -3.38369,2.72093 -3.55905,4.89518l-2.66227,34.20699c-0.43872,5.63657 -5.13857,9.99506 -10.79449,9.99506h-25.82077c-5.65592,0 -10.35577,-4.35911 -10.79449,-9.99506l-2.67163,-34.20699c-0.166,-2.17487 -1.54082,-4.05644 -3.54969,-4.89518l-27.16626,-11.25255c-2.00887,-0.83875 -4.31043,-0.46805 -5.96795,0.9361l-26.08413,22.3104c-4.29046,3.67638 -10.68715,3.43237 -14.69491,-0.5654l-18.25396,-18.25396c-3.99777,-4.00776 -4.24178,-10.40445 -0.57539,-14.69491l22.3104,-26.09412c1.40415,-1.64816 1.77485,-3.95908 0.9361,-5.96795l-11.25255,-27.1569c-0.8194,-2.00887 -2.72093,-3.38369 -4.87584,-3.55905l-34.22633,-2.66227c-5.63595,-0.43934 -9.98507,-5.14855 -9.98507,-10.80447v-25.81079c0,-5.65592 4.34912,-10.35577 9.98507,-10.80447l34.22571,-2.67038c2.15553,-0.166 4.05644,-1.53146 4.87584,-3.54969l11.25255,-27.1569c0.83875,-2.00887 0.46805,-4.30981 -0.9361,-5.95797l-22.3104,-26.09412c-3.66639,-4.30045 -3.42238,-10.69713 0.57539,-14.69491l18.25396,-18.25396c4.00776,-3.99777 10.40445,-4.25177 14.69491,-0.57539l26.08413,22.3104c1.65815,1.41414 3.95908,1.77485 5.96795,0.94609l27.16626,-11.26254c2.00887,-0.82876 3.38369,-2.72031 3.54969,-4.8852l2.67163,-34.20699c0.43872,-5.64593 5.13857,-9.99506 10.79449,-9.99506h25.82077c5.6553,0 10.35514,4.34912 10.79386,9.99319l2.66227,34.20699c0.17536,2.1549 1.55018,4.05644 3.55905,4.8852l27.16626,11.26254c1.99889,0.82876 4.30981,0.46805 5.95797,-0.94609l26.09412,-22.3104c4.29046,-3.67638 10.69713,-3.42238 14.69491,0.57539l18.25396,18.25396c4.00776,3.99777 4.24178,10.39446 0.57539,14.69491l-22.3104,26.09412c-1.4235,1.64816 -1.77485,3.9491 -0.9361,5.95797l11.25255,27.1569c0.83875,2.01886 2.71095,3.38369 4.8852,3.54969l34.21635,2.67163c5.63595,0.4487 9.98507,5.14855 9.98507,10.80447v25.82077c0,5.64593 -4.34912,10.35577 -9.98507,10.79449zM278.18542,218.18448c10.19975,-10.20911 15.81636,-23.76323 15.81636,-38.19478c0,-14.42157 -5.6166,-27.98566 -15.81636,-38.17543c-10.19975,-10.20974 -23.75386,-15.81636 -38.18542,-15.81636c-14.42219,0 -27.98566,5.60724 -38.18542,15.81636c-10.19975,10.18977 -15.81636,23.75386 -15.81636,38.17543c0,14.43155 5.6166,27.98566 15.81636,38.19478c10.19975,10.18977 23.76385,15.80637 38.18542,15.80637c14.43155,0 27.98566,-5.6166 38.18542,-15.80637z', - trapezoid: 'M 0 4 L 4 0 L 12 0 L 16 4 Z', - parallelogram: 'M 0 4 L 4 0 L 12 0 L 8 4 Z', - kite: 'M 0 4 L 4 0 L 8 4 L 4 12 Z', - fineman: 'M279.11508,185.745c-1.6966,3.204 -3.2904,7.867 -5.5968,10.7655c-1.0552,1.326 -2.4643,2.334 -3.5804,3.6092c-4.8915,5.5887 -9.2072,12.2896 -16.8603,14.6515c-1.422,0.4389 -2.9744,0.119 -4.4625,0.1361c-5.1267,0.059 -10.0508,5.3321 -14.8705,3.1868c-1.8615,-0.8286 -8.787,-1.8762 -10.6075,-2.7912c-1.506,-0.757 0.1421,-7.033 -1.256,-7.9744c-1.3297,-0.8955 -2.11,-2.4181 -3.2504,-3.5448c-0.3338,-0.3298 -6.2398,-5.4131 -6.7988,-6.6552c-0.81717,-1.81566 -1.09038,-3.62653 -1.17502,-5.46147c-1.3766,0.80315 -2.62347,1.91949 -4.15618,2.34537c-1.4506,0.4031 -3.0694,0.4408 -4.5164,0.0254c-8.6871,-2.4944 -5.9867,-15.5864 -3.3957,-21.95c1.8299,-4.4941 4.0739,-9.3912 7.0918,-13.2651c1.217,-1.5622 3.0424,-2.5541 4.3761,-4.018c0.7182,-0.7882 1.0233,-1.9342 1.8461,-2.6125c1.106,-0.9119 2.5337,-1.3416 3.7892,-2.0335c4.9733,-2.7408 9.6646,-4.9652 14.9498,-7.0813c7.2911,-2.9454 15.9349,-1.4641 23.371,0.1816c1.0722,0.2373 2.2339,0.1288 3.2486,0.5491c3.685,1.5264 5.0611,4.8449 7.9949,7.1687c0.7921,0.6273 5.568,3.7781 6.5521,4.6268c3.288,2.8359 4.7025,6.0578 7.0854,9.4147c0.1895,0.2307 0.3659,0.4735 0.5345,0.7232c1.285,1.6696 2.7787,3.1875 3.9054,4.9667c0,0 1.6892,2.7027 -0.5386,4.6822c-0.42573,0.62184 -1.1019,1.17609 -2.17578,1.36827c-0.00404,2.96432 -1.17068,6.3419 -1.50402,8.98633zM240.53818,174.9073c2.071,0 3.75,-1.6789 3.75,-3.75c0,-2.0711 -1.679,-3.75 -3.75,-3.75c-2.0711,0 -3.75,1.6789 -3.75,3.75c0,2.0711 1.6789,3.75 3.75,3.75zM275.15348,184.1381c2.0711,0 3.75,-1.6789 3.75,-3.75c0,-2.0711 -1.6789,-3.75 -3.75,-3.75c-2.071,0 -3.75,1.6789 -3.75,3.75c0,2.0711 1.679,3.75 3.75,3.75zM263.18718,195.6157l-0.3007,0.5823c-1.0607,1.0607 -1.8421,2.4427 -3.0962,3.2658c-1.4785,0.9703 -5.8341,0.2488 -7.3291,0.2512c-2.0854,0.0034 -5.8991,0.3437 -7.8123,-0.2393c-0.995,-0.3031 -1.6423,-1.3094 -2.587,-1.7448c-0.6173,-0.2846 -1.4509,0.022 -2.0051,-0.3717c-0.5058,-0.3593 -0.4529,-1.179 -0.8494,-1.6563c-1.3927,-1.6766 -5.4087,-4.3908 -5.7359,-7.0634c-0.1179,-0.9621 0.2756,-1.9189 0.4134,-2.8783c0,0 0.3732,-3.7314 -3.3582,-4.1045c-3.7314,-0.3732 -4.1046,3.3582 -4.1046,3.3582c-0.1185,1.6047 -0.6347,3.2294 -0.3557,4.8141c0.8558,4.861 4.3602,7.2383 7.3409,10.6288c0.8152,0.9273 1.2332,2.2274 2.2276,2.9592c0.9599,0.7063 2.3011,0.6594 3.3795,1.1668c1.2486,0.5874 2.2405,1.7206 3.5669,2.1013c2.5046,0.7187 7.1623,0.5259 9.8799,0.5299c3.6721,0.0054 7.7509,0.5945 11.1325,-1.2872c0.4769,-0.2654 3.932,-3.7625 4.5961,-4.4265l1.2378,-1.7254c0,0 2.0801,-3.1202 -1.0401,-5.2003c-3.1202,-2.0801 -5.2003,1.0401 -5.2003,1.0401z', - pin: 'M 21 28 A 1 1 0 0 1 79 28 Q 78 45 65 61 Q 52 78 50 100 Q 48 78 35 61 Q 22 45 21 28 Z M 40 28 A 1 1 0 0 0 60 28 A 1 1 0 0 0 40 28', - pinPush: 'M 7.379 3.051 Q 7.143 0.48 10.139 0.406 Q 13.444 0.48 13.165 3.006 Q 12.915 3.741 12.005 4.064 L 12.152 7.722 Q 14.957 8.662 14.752 11.306 Q 14.472 13.829 10.051 13.803 Q 5.248 13.48 5.541 10.748 Q 5.615 8.706 8.068 7.531 L 8.318 3.917 Q 7.596 3.581 7.379 3.051 Z M 9.587 13.764 L 9.435 18.06 C 10.121 20.37 9.551 20.308 10.389 18.123 L 10.565 13.794 Q 10.046 13.828 9.587 13.764 Z', - eye: 'M212.7952,179.99996c0,0 7.27068,-15.89135 27.2048,-15.80732c20.22188,0.08524 27.2048,15.80732 27.2048,15.80732c0,0 -7.1276,15.78741 -27.2048,15.80732c-19.93533,0.01977 -27.2048,-15.80732 -27.2048,-15.80732zM239.92857,190.14286c5.52285,0 10,-4.47715 10,-10c0,-5.52285 -4.47715,-10 -10,-10c-5.52285,0 -10,4.47715 -10,10c0,5.52285 4.47715,10 10,10z M235,180c0,-2.80087 2.27056,-5.07143 5.07143,-5.07143c2.80087,0 5.07143,2.27056 5.07143,5.07143c0,2.80087 -2.27056,5.07143 -5.07143,5.07143c-2.80087,0 -5.07143,-2.27056 -5.07143,-5.07143z', - bookmark: 'M 0 0 L 8 0 L 8 12 L 4 8 L 0 12 Z', - note: 'M 0 0 L 8 0 L 8 8 L 2 8 L 0 6 Z M 0 6 L 2 6 L 2 8 Z', - paper: 'M 0 0 L 601 0 L 841 240 L 841 1190 L 0 1190 Z M 841 240 L 601 240 L 601 0 Z', - lock: 'M 0.5 9 A 1 1 0 0 1 15.5 9 L 13.5 9 A 1 1 0 0 0 2.5 9 L 0.5 9 Z M 0 9 L 16 9 L 16 18 L 0 18 Z', - lockOpened: 'M 0.5 6 A 1 1 0 0 1 15.5 6 L 15.5 9 L 13.5 9 L 13.5 6 A 1 1 0 0 0 2.5 6 L 0.5 6 Z M 0 9 L 16 9 L 16 18 L 0 18 Z', - inbox: 'M 0 0 L 4 0 L 6 1 L 10 1 L 12 0 L 16 0 L 16 3 L 0 3 L 0 0 L 3 -3 L 13 -3 L 16 0 L 12 0 L 10 1 L 6 1 L 4 0 Z', - triangleRightAngle: 'M 1 1 L 8 8 L 1 8 L 1 1 Z', - person: 'M 0 0 A 1 1 0 0 0 3 0 A 1 1 0 0 0 0 0 Z M -1 4 A 1 1 0 0 1 4 4 Z', - crescentMoon: 'M196.70596,180c0,-27.2559 22.09528,-49.35118 49.35118,-49.35118c14.86178,0 28.18921,6.56931 37.23689,16.96252c-7.36039,-6.19606 -16.86269,-9.9291 -27.23689,-9.9291c-23.37145,0 -42.31776,18.9463 -42.31776,42.31776c0,23.37145 18.9463,42.31776 42.31776,42.31776c10.3742,0 19.8765,-3.73304 27.23689,-9.9291c-9.04768,10.39321 -22.37512,16.96252 -37.23689,16.96252c-27.2559,0 -49.35118,-22.09528 -49.35118,-49.35118z', - sun: 'M 208.8889 180 C 208.8889 162.8178 222.8178 148.8889 240 148.8889 C 257.1822 148.8889 271.1111 162.8178 271.1111 180 C 271.1111 197.1822 257.1822 211.1111 240 211.1111 C 222.8178 211.1111 208.8889 197.1822 208.8889 180 Z M 240 140.981 C 236.007 140.981 232.77 137.3993 232.77 132.981 V 98.1516 C 232.77 93.7333 236.007 90.1516 240 90.1516 V 90.1516 C 243.993 90.1516 247.23 93.7333 247.23 98.1516 V 132.981 C 247.23 137.3993 243.993 140.981 240 140.981 Z M 240 218.9805 C 243.993 218.9805 247.23 222.5622 247.23 226.9805 V 261.8099 C 247.23 266.2281 243.993 269.8099 240 269.8099 V 269.8099 C 236.007 269.8099 232.77 266.2281 232.77 261.8099 V 226.9805 C 232.77 222.5622 236.007 218.9805 240 218.9805 Z M 201.0003 179.9807 C 201.0003 183.9738 197.4186 187.2108 193.0003 187.2108 H 158.1709 C 153.7526 187.2108 150.1709 183.9738 150.1709 179.9807 V 179.9807 C 150.1709 175.9877 153.7526 172.7507 158.1709 172.7507 H 193.0003 C 197.4186 172.7507 201.0003 175.9877 201.0003 179.9807 Z M 278.9997 179.9807 C 278.9997 175.9877 282.5815 172.7507 286.9997 172.7507 H 321.8291 C 326.2474 172.7507 329.8291 175.9877 329.8291 179.9807 V 179.9807 C 329.8291 183.9738 326.2474 187.2108 321.8291 187.2108 H 286.9997 C 282.5815 187.2108 278.9997 183.9738 278.9997 179.9807 Z M 212.423 152.4038 C 209.5995 155.2273 204.778 154.9835 201.6538 151.8593 L 177.0257 127.2312 C 173.9015 124.107 173.6577 119.2855 176.4812 116.4619 V 116.4619 C 179.3047 113.6384 184.1263 113.8822 187.2505 117.0064 L 211.8786 141.6345 C 215.0028 144.7587 215.2465 149.5802 212.423 152.4038 Z M 267.577 207.5577 C 270.4005 204.7342 275.222 204.9779 278.3462 208.1021 L 302.9743 232.7302 C 306.0985 235.8544 306.3423 240.676 303.5188 243.4995 V 243.4995 C 300.6953 246.323 295.8737 246.0793 292.7495 242.9551 L 268.1214 218.327 C 264.9972 215.2028 264.7535 210.3812 267.577 207.5577 Z M 212.423 207.5577 C 215.2465 210.3812 215.0028 215.2028 211.8786 218.327 L 187.2505 242.9551 C 184.1263 246.0793 179.3047 246.323 176.4812 243.4995 V 243.4995 C 173.6577 240.676 173.9015 235.8544 177.0257 232.7302 L 201.6538 208.1021 C 204.778 204.9779 209.5995 204.7342 212.423 207.5577 Z M 267.577 152.4038 C 264.7535 149.5803 264.9972 144.7587 268.1214 141.6345 L 292.7495 117.0064 C 295.8737 113.8822 300.6953 113.6384 303.5188 116.462 V 116.462 C 306.3423 119.2855 306.0985 124.107 302.9743 127.2312 L 278.3462 151.8593 C 275.222 154.9835 270.4005 155.2273 267.577 152.4038 Z', - musicNote: 'M 13.3 6.7 L 36.9 0.9 L 36.9 28.2 A 1 0.84 0 0 1 24.2 28.2 Q 24.3 23.6 29.2 22.4 Q 33 21.6 34.7 23.6 L 34.7 9.2 L 15.6 13.9 L 15.6 33.8 A 1 0.8 0 0 1 2.8 33.4 Q 2.9 28.8 8.2 27.6 Q 11.3 26.8 13.3 28.9 Z', - musicNote2: 'M 21 0.8 Q 30.9 1.2 30 10.5 Q 29.6 16.1 33.8 18.3 Q 29.1 17.2 27.2 12 Q 24.9 5.9 22.6 5.5 L 22.6 34.9 A 1 0.75 4 0 1 8.9 33.4 Q 9.5 27.9 15.9 27.4 Q 20 27.3 21 29.4 Z', - musicNote3: 'M 19.2 37.3 A 1 1 0 0 0 18.1 32.5 Q 15.2 33.3 16.6 36.5 Q 17.9 38.9 20.5 38.7 Q 24.4 38.5 24.7 34.4 Q 24.8 32.9 23.9 29.6 Q 27.8 27.5 27.1 23 Q 26.3 19 21.6 18.7 L 20.8 15.5 Q 25.7 9.6 24.4 4.2 Q 22.4 -1.3 19.4 2.9 Q 17.2 6.2 18.9 12.6 Q 13 17.9 13.1 22.5 Q 13.3 28.9 21 30.2 Q 21.8 30.3 22.5 30.1 Q 25 38.4 19.2 37.3 Z M 22.2 21.9 Q 25.3 22.4 24.9 25.7 Q 24.7 27.5 23.6 28 Z M 20 11.6 Q 18.9 4.8 22.7 4.5 Q 23.7 8.4 20 11.6 Z M 20.8 27.6 Q 18.9 26 19.3 23.9 Q 19.6 22.7 20.9 22 L 22.3 28.6 Q 19.1 29.3 16.9 26.9 Q 14.5 23.7 16.3 20.5 Q 17.8 18.2 19.7 16.7 L 20.3 19.1 Q 16.9 21 17 23.9 Q 17.3 27.5 20.8 27.6 Z', +// Hopefully later on, the values of the keys in this object can be translated. +const categories = { + "shapes": "Shapes", + "symbols": "Symbols", + "objects": "Objects", + "speech": "Speech", + "blocks": "Blocks", + "custom": "Custom", // Used when an object doesn't define a category, mutated into object's data +}; + +const categorizeShapes = (shapes) => { + const categorized = {}; + for (const categoryId in categories) categorized[categoryId] = []; + + for (const shape of shapes) { + let targetCategory = shape.category || "custom"; + if (!categorized[targetCategory]) { + log.warn(`Invalid shape category: ${targetCategory}`); + targetCategory = "custom"; + } + categorized[targetCategory].push(shape); + } + return categorized; }; /* - TEMPLATE: + TEMPLATE: { - id: "item", - name: "item", - strokeWidth: 5, - icon: '', - }, - - Generate icon: - 1. Set fill color to none - 2. Clear the costume - 3. Draw the shape using shape tool (make it look the way it should if drawn properly) - 4. Run atob(vm.getExportedCostumeBase64(vm.editingTarget.sprite.costumes[0])) + id: "item", + name: "item", + strokeWidth: x, + path: "", + } */ -// Hopefully later on, the values of the keys in this object can be translated. -const categories = { - "shapes": "Shapes", - "symbols": "Symbols", - "objects": "Objects", - "speech": "Speech", - "blocks": "Blocks", - "custom": "Custom", // Used when an object doesn't define a category, mutated into object's data -}; const selectableShapes = [ - { - id: "triangleRightAngle", - name: "Right Triangle", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "chevronArrow", - name: "Chevron Arrow", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "pentagonArrow", - name: "Pentagon Arrow", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "trapezoid", - name: "Trapezoid", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "parallelogram", - name: "Parallelogram", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "kite", - name: "Kite", - category: "shapes", - strokeWidth: 6, - icon: `` - }, - { - id: "check", - name: "Checkmark", - category: "symbols", - strokeWidth: 11, - icon: '', - }, - { - id: "cross", - name: "Multiply", - category: "symbols", - strokeWidth: 16, - icon: '', - }, - { - id: "heart", - name: "Heart", - category: "symbols", - strokeWidth: 9, - icon: '', - }, - { - id: "pin", - name: "Pin", - category: "symbols", - strokeWidth: 6, - icon: `` - }, - { - id: "smile", - name: "Smile", - category: "symbols", - strokeWidth: 3, - icon: `` - }, - { - id: "frown", - name: "Frown", - category: "symbols", - strokeWidth: 3, - icon: `` - }, - { - id: "person", - name: "Person", - category: "symbols", - strokeWidth: 6, - icon: `` - }, - { - id: "sun", - name: "Sun", - category: "symbols", - strokeWidth: 4, - icon: `` - }, - { - id: "crescentMoon", - name: "Crescent Moon", - category: "symbols", - strokeWidth: 6, - icon: `\x3C!--rotationCenter:43.294038055506434:49.35118499999999-->` - }, - { - id: "musicNote", - name: "Slanted Beamed Note", - category: "symbols", - strokeWidth: 5, - icon: `` - }, - { - id: "musicNote2", - name: "Eighth Note", - category: "symbols", - strokeWidth: 5, - icon: `` - }, - { - id: "musicNote3", - name: "Treble Clef", - category: "symbols", - strokeWidth: 4, - icon: `` - }, - { - id: "sussy", - name: "Sussy", - category: "symbols", - strokeWidth: 14, - icon: `sussyCreated with Sketch.jk its made with https://yqnn.github.io/svg-path-editor/ stupeit` - }, - { - id: "fineman", - name: "Fine Man", - category: "symbols", - strokeWidth: 6, - icon: `` - }, - { - id: "gear", - name: "Gear", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "lightningBolt", - name: "Lightning Bolt", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "lightningBolt2", - name: "Bolt", - category: "objects", - strokeWidth: 8, - icon: `` - }, - { - id: "cloud", - name: "Cloud", - category: "objects", - strokeWidth: 11, - icon: '', - }, - { - id: "cloud2", - name: "Cloud 2", - category: "objects", - strokeWidth: 8, - icon: '', - }, - { - id: "pinPush", - name: "Push Pin", - category: "objects", - strokeWidth: 7, - icon: `` - }, - { - id: "bookmark", - name: "Bookmark", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "note", - name: "Note", - category: "objects", - strokeWidth: 5, - icon: `` - }, - { - id: "paper", - name: "Paper", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "eye", - name: "Eye", - category: "objects", - strokeWidth: 4, - icon: `` - }, - { - id: "lock", - name: "Lock", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "lockOpened", - name: "Open Lock", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "inbox", - name: "Inbox", - category: "objects", - strokeWidth: 6, - icon: `` - }, - { - id: "speechBubble", - name: "Speech Bubble", - category: "speech", - strokeWidth: 5, - icon: `` - }, - { - id: "thinkingBubble", - name: "Thinking Bubble", - category: "speech", - strokeWidth: 10, - icon: `` - }, - { - id: "shoutBubble", - name: "Shout Bubble", - category: "speech", - strokeWidth: 8, - icon: `` - }, - { - id: "squareBubble", - name: "Square Bubble", - category: "speech", - strokeWidth: 8, - icon: `` - }, - { - id: "codeblock", - name: "Code Block", - category: "blocks", - strokeWidth: 9, - icon: '', - }, - { - id: "codeblockHat", - name: "Hat Block", - category: "blocks", - strokeWidth: 6, - icon: `` - }, - { - id: "codeblockEndCap", - name: "End-Cap Block", - category: "blocks", - strokeWidth: 6, - icon: `` - }, - { - id: "codeblockReporter", - name: "Reporter Block", - category: "blocks", - strokeWidth: 6, - icon: `` - }, - { - id: "codeblockBoolean", - name: "Boolean Block", - category: "blocks", - strokeWidth: 6, - icon: `` - }, + { + id: "triangleRightAngle", + name: "Right Triangle", + category: "shapes", + strokeWidth: 6, + path: "M 1 1 L 8 8 L 1 8 L 1 1 Z" + }, + { + id: "chevronArrow", + name: "Chevron Arrow", + category: "shapes", + strokeWidth: 6, + path: "M 0 0 L 4 0 L 6 3 L 4 6 L 0 6 L 2 3 Z" + }, + { + id: "pentagonArrow", + name: "Pentagon Arrow", + category: "shapes", + strokeWidth: 6, + path: "M 0 0 L 4 0 L 6 3 L 4 6 L 0 6 Z" + }, + { + id: "trapezoid", + name: "Trapezoid", + category: "shapes", + strokeWidth: 6, + path: "M 0 4 L 4 0 L 12 0 L 16 4 Z" + }, + { + id: "parallelogram", + name: "Parallelogram", + category: "shapes", + strokeWidth: 6, + path: "M 0 4 L 4 0 L 12 0 L 8 4 Z" + }, + { + id: "kite", + name: "Kite", + category: "shapes", + strokeWidth: 6, + path: "M 0 4 L 4 0 L 8 4 L 4 12 Z" + }, + { + id: "check", + name: "Checkmark", + category: "symbols", + strokeWidth: 11, + path: "M165.25,196.6109l22.7173,-22.8612l30.6088,24.281l71.6857,-83.9057l24.4882,22.1844l-94.7184,109.5656z" + }, + { + id: "cross", + name: "Multiply", + category: "symbols", + strokeWidth: 16, + path: "M199.65003,179.64477l-79.5,-77l38.00987,-40.68564l79.49013,76.68564l80.09184,-78.14413l39.93685,39.28777l-78.5287,79.35636l80.69993,77.78108l-39.28229,39.59957l-80.18174,-77.08931l-77.03078,80.06325l-41.49233,-38.94156z" + }, + { + id: "heart", + name: "Heart", + category: "symbols", + strokeWidth: 9, + path: "M182.17524,160.22928c-0.06174,-6.9356 0.38429,-9.6077 2.28538,-13.6958c0.21863,-0.47017 0.44452,-0.93216 0.67758,-1.38588c0.041,-0.08369 0.0824,-0.16634 0.12422,-0.24792c0.8012,-1.56302 1.70465,-3.01791 2.69546,-4.36451c2.87826,-3.97624 6.46849,-7.08113 10.70447,-9.24389c4.19614,-2.14228 6.35284,-3.1423 13.00539,-3.25541c0.73674,-0.02848 1.47326,-0.03072 2.20779,-0.0067c5.51272,0.05908 7.5834,0.72925 10.6475,2.33132c5.98584,2.56127 11.11488,7.22077 14.1395,13.99129l1.33748,2.99387l1.33748,-2.99387c3.02461,-6.77051 8.15365,-11.43 14.13948,-13.99128c3.06411,-1.60208 5.13479,-2.27226 10.64753,-2.33133c0.73452,-0.02402 1.47103,-0.02178 2.20776,0.0067c6.65256,0.11311 8.80926,1.11313 13.0054,3.25541c4.23591,2.16272 7.8261,5.26755 10.70433,9.24371c0.99086,1.34665 1.89437,2.8016 2.6956,4.36469c0.04183,0.08159 0.08324,0.16426 0.12425,0.24797c0.23305,0.45371 0.45893,0.91567 0.67755,1.38583c1.90109,4.0881 2.34712,6.7602 2.28538,13.6958c-0.00127,0.14305 -0.00303,0.28572 -0.00528,0.42802c0.10329,5.40072 -0.53917,10.86793 -1.9823,14.87168c-3.9932,11.0782 -11.61727,19.5239 -29.30813,32.466c-11.60195,8.4878 -24.70011,21.3299 -25.60268,23.1336c-0.49,0.97911 -1.36275,0.97911 -1.85275,0c-0.90257,-1.8037 -14.00072,-14.6458 -25.60268,-23.1336c-17.69086,-12.9421 -25.31493,-21.3878 -29.30813,-32.466c-1.44313,-4.00376 -2.0856,-9.47098 -1.9823,-14.87171c-0.00225,-0.14229 -0.004,-0.28495 -0.00528,-0.42799z" + }, + { + id: "pin", + name: "Pin", + category: "symbols", + strokeWidth: 6, + path: "M 21 28 A 1 1 0 0 1 79 28 Q 78 45 65 61 Q 52 78 50 100 Q 48 78 35 61 Q 22 45 21 28 Z M 40 28 A 1 1 0 0 0 60 28 A 1 1 0 0 0 40 28" + }, + { + id: "smile", + name: "Smile", + category: "symbols", + strokeWidth: 3, + path: "M218.60708,180c0,-11.81499 9.57794,-21.39292 21.39292,-21.39292c11.81499,0 21.39292,9.57794 21.39292,21.39292c0,11.81499 -9.57794,21.39293 -21.39292,21.39293c-11.81499,0 -21.39292,-9.57794 -21.39292,-21.39293zM239.89701,196.60775c14.70959,0.07281 16.22782,-13.7612 16.22782,-13.7612h-31.54689c0,0 1.12947,13.69096 15.31907,13.7612zM247.80316,176.22994c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.8933 -2.8933,-2.8933c-1.59793,0 -2.8933,1.29538 -2.8933,2.8933c0,1.59793 1.29538,2.8933 2.8933,2.8933zM232.19685,176.22994c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.8933 -2.8933,-2.8933c-1.59793,0 -2.8933,1.29538 -2.8933,2.8933c0,1.59793 1.29538,2.8933 2.8933,2.8933z" + }, + { + id: "frown", + name: "Frown", + category: "symbols", + strokeWidth: 3, + path: "M218.60708,180c0,-11.81499 9.57794,-21.39292 21.39292,-21.39292c11.81499,0 21.39293,9.57794 21.39293,21.39292c0,11.81499 -9.57794,21.39292 -21.39293,21.39292c-11.81498,0 -21.39292,-9.57794 -21.39292,-21.39292zM247.80316,176.22993c1.59793,0 2.89331,-1.29538 2.89331,-2.8933c0,-1.59793 -1.29537,-2.89331 -2.89331,-2.89331c-1.59793,0 -2.8933,1.29538 -2.8933,2.89331c0,1.59793 1.29537,2.8933 2.8933,2.8933zM232.19685,176.22993c1.59793,0 2.8933,-1.29538 2.8933,-2.8933c0,-1.59793 -1.29538,-2.89331 -2.8933,-2.89331c-1.59793,0 -2.8933,1.29538 -2.8933,2.89331c0,1.59793 1.29538,2.8933 2.8933,2.8933zM226.26564,193.49228h28.1715c0,0 -1.35578,-10.96285 -14.49151,-10.90515c-12.67137,0.05566 -13.67999,10.90515 -13.67999,10.90515z" + }, + { + id: "person", + name: "Person", + category: "symbols", + strokeWidth: 6, + path: "M 0 0 A 1 1 0 0 0 3 0 A 1 1 0 0 0 0 0 Z M -1 4 A 1 1 0 0 1 4 4 Z" + }, + { + id: "sun", + name: "Sun", + category: "symbols", + strokeWidth: 4, + path: "M 208.8889 180 C 208.8889 162.8178 222.8178 148.8889 240 148.8889 C 257.1822 148.8889 271.1111 162.8178 271.1111 180 C 271.1111 197.1822 257.1822 211.1111 240 211.1111 C 222.8178 211.1111 208.8889 197.1822 208.8889 180 Z M 240 140.981 C 236.007 140.981 232.77 137.3993 232.77 132.981 V 98.1516 C 232.77 93.7333 236.007 90.1516 240 90.1516 V 90.1516 C 243.993 90.1516 247.23 93.7333 247.23 98.1516 V 132.981 C 247.23 137.3993 243.993 140.981 240 140.981 Z M 240 218.9805 C 243.993 218.9805 247.23 222.5622 247.23 226.9805 V 261.8099 C 247.23 266.2281 243.993 269.8099 240 269.8099 V 269.8099 C 236.007 269.8099 232.77 266.2281 232.77 261.8099 V 226.9805 C 232.77 222.5622 236.007 218.9805 240 218.9805 Z M 201.0003 179.9807 C 201.0003 183.9738 197.4186 187.2108 193.0003 187.2108 H 158.1709 C 153.7526 187.2108 150.1709 183.9738 150.1709 179.9807 V 179.9807 C 150.1709 175.9877 153.7526 172.7507 158.1709 172.7507 H 193.0003 C 197.4186 172.7507 201.0003 175.9877 201.0003 179.9807 Z M 278.9997 179.9807 C 278.9997 175.9877 282.5815 172.7507 286.9997 172.7507 H 321.8291 C 326.2474 172.7507 329.8291 175.9877 329.8291 179.9807 V 179.9807 C 329.8291 183.9738 326.2474 187.2108 321.8291 187.2108 H 286.9997 C 282.5815 187.2108 278.9997 183.9738 278.9997 179.9807 Z M 212.423 152.4038 C 209.5995 155.2273 204.778 154.9835 201.6538 151.8593 L 177.0257 127.2312 C 173.9015 124.107 173.6577 119.2855 176.4812 116.4619 V 116.4619 C 179.3047 113.6384 184.1263 113.8822 187.2505 117.0064 L 211.8786 141.6345 C 215.0028 144.7587 215.2465 149.5802 212.423 152.4038 Z M 267.577 207.5577 C 270.4005 204.7342 275.222 204.9779 278.3462 208.1021 L 302.9743 232.7302 C 306.0985 235.8544 306.3423 240.676 303.5188 243.4995 V 243.4995 C 300.6953 246.323 295.8737 246.0793 292.7495 242.9551 L 268.1214 218.327 C 264.9972 215.2028 264.7535 210.3812 267.577 207.5577 Z M 212.423 207.5577 C 215.2465 210.3812 215.0028 215.2028 211.8786 218.327 L 187.2505 242.9551 C 184.1263 246.0793 179.3047 246.323 176.4812 243.4995 V 243.4995 C 173.6577 240.676 173.9015 235.8544 177.0257 232.7302 L 201.6538 208.1021 C 204.778 204.9779 209.5995 204.7342 212.423 207.5577 Z M 267.577 152.4038 C 264.7535 149.5803 264.9972 144.7587 268.1214 141.6345 L 292.7495 117.0064 C 295.8737 113.8822 300.6953 113.6384 303.5188 116.462 V 116.462 C 306.3423 119.2855 306.0985 124.107 302.9743 127.2312 L 278.3462 151.8593 C 275.222 154.9835 270.4005 155.2273 267.577 152.4038 Z" + }, + { + id: "crescentMoon", + name: "Crescent Moon", + category: "symbols", + strokeWidth: 6, + path: "M196.70596,180c0,-27.2559 22.09528,-49.35118 49.35118,-49.35118c14.86178,0 28.18921,6.56931 37.23689,16.96252c-7.36039,-6.19606 -16.86269,-9.9291 -27.23689,-9.9291c-23.37145,0 -42.31776,18.9463 -42.31776,42.31776c0,23.37145 18.9463,42.31776 42.31776,42.31776c10.3742,0 19.8765,-3.73304 27.23689,-9.9291c-9.04768,10.39321 -22.37512,16.96252 -37.23689,16.96252c-27.2559,0 -49.35118,-22.09528 -49.35118,-49.35118z" + }, + { + id: "musicNote", + name: "Slanted Beamed Note", + category: "symbols", + strokeWidth: 5, + path: "M 13.3 6.7 L 36.9 0.9 L 36.9 28.2 A 1 0.84 0 0 1 24.2 28.2 Q 24.3 23.6 29.2 22.4 Q 33 21.6 34.7 23.6 L 34.7 9.2 L 15.6 13.9 L 15.6 33.8 A 1 0.8 0 0 1 2.8 33.4 Q 2.9 28.8 8.2 27.6 Q 11.3 26.8 13.3 28.9 Z" + }, + { + id: "musicNote2", + name: "Eighth Note", + category: "symbols", + strokeWidth: 5, + path: "M 21 0.8 Q 30.9 1.2 30 10.5 Q 29.6 16.1 33.8 18.3 Q 29.1 17.2 27.2 12 Q 24.9 5.9 22.6 5.5 L 22.6 34.9 A 1 0.75 4 0 1 8.9 33.4 Q 9.5 27.9 15.9 27.4 Q 20 27.3 21 29.4 Z" + }, + { + id: "musicNote3", + name: "Treble Clef", + category: "symbols", + strokeWidth: 4, + path: "M 19.2 37.3 A 1 1 0 0 0 18.1 32.5 Q 15.2 33.3 16.6 36.5 Q 17.9 38.9 20.5 38.7 Q 24.4 38.5 24.7 34.4 Q 24.8 32.9 23.9 29.6 Q 27.8 27.5 27.1 23 Q 26.3 19 21.6 18.7 L 20.8 15.5 Q 25.7 9.6 24.4 4.2 Q 22.4 -1.3 19.4 2.9 Q 17.2 6.2 18.9 12.6 Q 13 17.9 13.1 22.5 Q 13.3 28.9 21 30.2 Q 21.8 30.3 22.5 30.1 Q 25 38.4 19.2 37.3 Z M 22.2 21.9 Q 25.3 22.4 24.9 25.7 Q 24.7 27.5 23.6 28 Z M 20 11.6 Q 18.9 4.8 22.7 4.5 Q 23.7 8.4 20 11.6 Z M 20.8 27.6 Q 18.9 26 19.3 23.9 Q 19.6 22.7 20.9 22 L 22.3 28.6 Q 19.1 29.3 16.9 26.9 Q 14.5 23.7 16.3 20.5 Q 17.8 18.2 19.7 16.7 L 20.3 19.1 Q 16.9 21 17 23.9 Q 17.3 27.5 20.8 27.6 Z" + }, + { + id: "sussy", + name: "Sussy", + category: "symbols", + strokeWidth: 14, + path: "m 77 0 h 28 a 20 20 0 0 1 20 20 v 0 a 20 20 0 0 1 -20 20 V 40 H 77 V 112 A 1 1 0 0 1 42 111 A 1 1 0 0 0 16 112 A 1 1 0 0 1 -18 111 V 74 H -29 C -35 74 -36 73 -36 67 V 5 C -36 -1 -35 -2 -29 -2 H -18 A 1 1 0 0 1 76 0" + }, + { + id: "fineman", + name: "Fine Man", + category: "symbols", + strokeWidth: 6, + path: "M279.11508,185.745c-1.6966,3.204 -3.2904,7.867 -5.5968,10.7655c-1.0552,1.326 -2.4643,2.334 -3.5804,3.6092c-4.8915,5.5887 -9.2072,12.2896 -16.8603,14.6515c-1.422,0.4389 -2.9744,0.119 -4.4625,0.1361c-5.1267,0.059 -10.0508,5.3321 -14.8705,3.1868c-1.8615,-0.8286 -8.787,-1.8762 -10.6075,-2.7912c-1.506,-0.757 0.1421,-7.033 -1.256,-7.9744c-1.3297,-0.8955 -2.11,-2.4181 -3.2504,-3.5448c-0.3338,-0.3298 -6.2398,-5.4131 -6.7988,-6.6552c-0.81717,-1.81566 -1.09038,-3.62653 -1.17502,-5.46147c-1.3766,0.80315 -2.62347,1.91949 -4.15618,2.34537c-1.4506,0.4031 -3.0694,0.4408 -4.5164,0.0254c-8.6871,-2.4944 -5.9867,-15.5864 -3.3957,-21.95c1.8299,-4.4941 4.0739,-9.3912 7.0918,-13.2651c1.217,-1.5622 3.0424,-2.5541 4.3761,-4.018c0.7182,-0.7882 1.0233,-1.9342 1.8461,-2.6125c1.106,-0.9119 2.5337,-1.3416 3.7892,-2.0335c4.9733,-2.7408 9.6646,-4.9652 14.9498,-7.0813c7.2911,-2.9454 15.9349,-1.4641 23.371,0.1816c1.0722,0.2373 2.2339,0.1288 3.2486,0.5491c3.685,1.5264 5.0611,4.8449 7.9949,7.1687c0.7921,0.6273 5.568,3.7781 6.5521,4.6268c3.288,2.8359 4.7025,6.0578 7.0854,9.4147c0.1895,0.2307 0.3659,0.4735 0.5345,0.7232c1.285,1.6696 2.7787,3.1875 3.9054,4.9667c0,0 1.6892,2.7027 -0.5386,4.6822c-0.42573,0.62184 -1.1019,1.17609 -2.17578,1.36827c-0.00404,2.96432 -1.17068,6.3419 -1.50402,8.98633zM240.53818,174.9073c2.071,0 3.75,-1.6789 3.75,-3.75c0,-2.0711 -1.679,-3.75 -3.75,-3.75c-2.0711,0 -3.75,1.6789 -3.75,3.75c0,2.0711 1.6789,3.75 3.75,3.75zM275.15348,184.1381c2.0711,0 3.75,-1.6789 3.75,-3.75c0,-2.0711 -1.6789,-3.75 -3.75,-3.75c-2.071,0 -3.75,1.6789 -3.75,3.75c0,2.0711 1.679,3.75 3.75,3.75zM263.18718,195.6157l-0.3007,0.5823c-1.0607,1.0607 -1.8421,2.4427 -3.0962,3.2658c-1.4785,0.9703 -5.8341,0.2488 -7.3291,0.2512c-2.0854,0.0034 -5.8991,0.3437 -7.8123,-0.2393c-0.995,-0.3031 -1.6423,-1.3094 -2.587,-1.7448c-0.6173,-0.2846 -1.4509,0.022 -2.0051,-0.3717c-0.5058,-0.3593 -0.4529,-1.179 -0.8494,-1.6563c-1.3927,-1.6766 -5.4087,-4.3908 -5.7359,-7.0634c-0.1179,-0.9621 0.2756,-1.9189 0.4134,-2.8783c0,0 0.3732,-3.7314 -3.3582,-4.1045c-3.7314,-0.3732 -4.1046,3.3582 -4.1046,3.3582c-0.1185,1.6047 -0.6347,3.2294 -0.3557,4.8141c0.8558,4.861 4.3602,7.2383 7.3409,10.6288c0.8152,0.9273 1.2332,2.2274 2.2276,2.9592c0.9599,0.7063 2.3011,0.6594 3.3795,1.1668c1.2486,0.5874 2.2405,1.7206 3.5669,2.1013c2.5046,0.7187 7.1623,0.5259 9.8799,0.5299c3.6721,0.0054 7.7509,0.5945 11.1325,-1.2872c0.4769,-0.2654 3.932,-3.7625 4.5961,-4.4265l1.2378,-1.7254c0,0 2.0801,-3.1202 -1.0401,-5.2003c-3.1202,-2.0801 -5.2003,1.0401 -5.2003,1.0401z" + }, + { + id: "gear", + name: "Gear", + category: "objects", + strokeWidth: 6, + path: "M355.56099,206.36652c-2.17425,0.17536 -4.04645,1.55018 -4.8852,3.55905l-11.25255,27.1569c-0.83875,2.00887 -0.46805,4.31979 0.9361,5.96795l22.3104,26.09412c3.66639,4.29046 3.43237,10.68715 -0.57539,14.69491l-18.25396,18.25396c-3.99777,3.99777 -10.40445,4.24178 -14.69491,0.5654l-26.09412,-22.3104c-1.63818,-1.40415 -3.95908,-1.77485 -5.95797,-0.9361l-27.16626,11.25255c-2.00887,0.83875 -3.38369,2.72093 -3.55905,4.89518l-2.66227,34.20699c-0.43872,5.63657 -5.13857,9.99506 -10.79449,9.99506h-25.82077c-5.65592,0 -10.35577,-4.35911 -10.79449,-9.99506l-2.67163,-34.20699c-0.166,-2.17487 -1.54082,-4.05644 -3.54969,-4.89518l-27.16626,-11.25255c-2.00887,-0.83875 -4.31043,-0.46805 -5.96795,0.9361l-26.08413,22.3104c-4.29046,3.67638 -10.68715,3.43237 -14.69491,-0.5654l-18.25396,-18.25396c-3.99777,-4.00776 -4.24178,-10.40445 -0.57539,-14.69491l22.3104,-26.09412c1.40415,-1.64816 1.77485,-3.95908 0.9361,-5.96795l-11.25255,-27.1569c-0.8194,-2.00887 -2.72093,-3.38369 -4.87584,-3.55905l-34.22633,-2.66227c-5.63595,-0.43934 -9.98507,-5.14855 -9.98507,-10.80447v-25.81079c0,-5.65592 4.34912,-10.35577 9.98507,-10.80447l34.22571,-2.67038c2.15553,-0.166 4.05644,-1.53146 4.87584,-3.54969l11.25255,-27.1569c0.83875,-2.00887 0.46805,-4.30981 -0.9361,-5.95797l-22.3104,-26.09412c-3.66639,-4.30045 -3.42238,-10.69713 0.57539,-14.69491l18.25396,-18.25396c4.00776,-3.99777 10.40445,-4.25177 14.69491,-0.57539l26.08413,22.3104c1.65815,1.41414 3.95908,1.77485 5.96795,0.94609l27.16626,-11.26254c2.00887,-0.82876 3.38369,-2.72031 3.54969,-4.8852l2.67163,-34.20699c0.43872,-5.64593 5.13857,-9.99506 10.79449,-9.99506h25.82077c5.6553,0 10.35514,4.34912 10.79386,9.99319l2.66227,34.20699c0.17536,2.1549 1.55018,4.05644 3.55905,4.8852l27.16626,11.26254c1.99889,0.82876 4.30981,0.46805 5.95797,-0.94609l26.09412,-22.3104c4.29046,-3.67638 10.69713,-3.42238 14.69491,0.57539l18.25396,18.25396c4.00776,3.99777 4.24178,10.39446 0.57539,14.69491l-22.3104,26.09412c-1.4235,1.64816 -1.77485,3.9491 -0.9361,5.95797l11.25255,27.1569c0.83875,2.01886 2.71095,3.38369 4.8852,3.54969l34.21635,2.67163c5.63595,0.4487 9.98507,5.14855 9.98507,10.80447v25.82077c0,5.64593 -4.34912,10.35577 -9.98507,10.79449zM278.18542,218.18448c10.19975,-10.20911 15.81636,-23.76323 15.81636,-38.19478c0,-14.42157 -5.6166,-27.98566 -15.81636,-38.17543c-10.19975,-10.20974 -23.75386,-15.81636 -38.18542,-15.81636c-14.42219,0 -27.98566,5.60724 -38.18542,15.81636c-10.19975,10.18977 -15.81636,23.75386 -15.81636,38.17543c0,14.43155 5.6166,27.98566 15.81636,38.19478c10.19975,10.18977 23.76385,15.80637 38.18542,15.80637c14.43155,0 27.98566,-5.6166 38.18542,-15.80637z" + }, + { + id: "lightningBolt", + name: "Lightning Bolt", + category: "objects", + strokeWidth: 6, + path: "M 3.787 2.769 L 10.034 0.384 L 12.03 5.879 L 11.019 6.423 L 14.077 11.348 L 12.729 11.892 L 16.177 19.927 L 9.204 13.163 L 10.811 12.54 L 6.457 8.238 L 8.349 7.357 Z" + }, + { + id: "lightningBolt2", + name: "Bolt", + category: "objects", + strokeWidth: 8, + path: "M 6.327 0.618 L 14.129 0.618 L 11.122 7.434 L 14.233 7.434 L 6.379 19.539 L 7.857 9.767 L 4.694 9.767 Z" + }, + { + id: "cloud", + name: "Cloud", + category: "objects", + strokeWidth: 11, + path: "M158.70156,190.30055c5.28613,-2.83052 11.70216,-2.80297 14.45107,-3.01001c1.11791,-2.76161 17.92516,-32.66635 39.60873,-32.32664c21.75534,0.41423 30.07396,15.16631 40.51872,23.33781c12.96693,-9.11314 22.14689,-12.62033 35.86057,-9.23745c12.88406,3.27521 19.41273,22.07303 19.93181,22.83242c0.25097,0.37125 7.32687,-4.86498 13.30369,-3.82602c7.68158,1.33529 10.15773,16.75568 8.47916,16.75568c-2.13284,0 -176.99884,-0.27065 -181.13536,0.21264c-4.02823,-3.61485 4.21405,-12.184 8.98161,-14.73843z" + }, + { + id: "cloud2", + name: "Cloud 2", + category: "objects", + strokeWidth: 8, + path: "M 13 18 A 1 1 0 0 1 13 6 A 1 1 0 0 1 29 6 A 1 0.75 0 0 1 39 6 A 1 1 0 0 1 39 18 Z" + }, + { + id: "pinPush", + name: "Push Pin", + category: "objects", + strokeWidth: 7, + path: "M 7.379 3.051 Q 7.143 0.48 10.139 0.406 Q 13.444 0.48 13.165 3.006 Q 12.915 3.741 12.005 4.064 L 12.152 7.722 Q 14.957 8.662 14.752 11.306 Q 14.472 13.829 10.051 13.803 Q 5.248 13.48 5.541 10.748 Q 5.615 8.706 8.068 7.531 L 8.318 3.917 Q 7.596 3.581 7.379 3.051 Z M 9.587 13.764 L 9.435 18.06 C 10.121 20.37 9.551 20.308 10.389 18.123 L 10.565 13.794 Q 10.046 13.828 9.587 13.764 Z" + }, + { + id: "bookmark", + name: "Bookmark", + category: "objects", + strokeWidth: 6, + path: "M 0 0 L 8 0 L 8 12 L 4 8 L 0 12 Z" + }, + { + id: "note", + name: "Note", + category: "objects", + strokeWidth: 5, + path: "M 0 0 L 8 0 L 8 8 L 2 8 L 0 6 Z M 0 6 L 2 6 L 2 8 Z" + }, + { + id: "paper", + name: "Paper", + category: "objects", + strokeWidth: 6, + path: "M 0 0 L 601 0 L 841 240 L 841 1190 L 0 1190 Z M 841 240 L 601 240 L 601 0 Z" + }, + { + id: "eye", + name: "Eye", + category: "objects", + strokeWidth: 4, + path: "M212.7952,179.99996c0,0 7.27068,-15.89135 27.2048,-15.80732c20.22188,0.08524 27.2048,15.80732 27.2048,15.80732c0,0 -7.1276,15.78741 -27.2048,15.80732c-19.93533,0.01977 -27.2048,-15.80732 -27.2048,-15.80732zM239.92857,190.14286c5.52285,0 10,-4.47715 10,-10c0,-5.52285 -4.47715,-10 -10,-10c-5.52285,0 -10,4.47715 -10,10c0,5.52285 4.47715,10 10,10z M235,180c0,-2.80087 2.27056,-5.07143 5.07143,-5.07143c2.80087,0 5.07143,2.27056 5.07143,5.07143c0,2.80087 -2.27056,5.07143 -5.07143,5.07143c-2.80087,0 -5.07143,-2.27056 -5.07143,-5.07143z" + }, + { + id: "lock", + name: "Lock", + category: "objects", + strokeWidth: 6, + path: "M 0.5 9 A 1 1 0 0 1 15.5 9 L 13.5 9 A 1 1 0 0 0 2.5 9 L 0.5 9 Z M 0 9 L 16 9 L 16 18 L 0 18 Z" + }, + { + id: "lockOpened", + name: "Open Lock", + category: "objects", + strokeWidth: 6, + path: "M 0.5 6 A 1 1 0 0 1 15.5 6 L 15.5 9 L 13.5 9 L 13.5 6 A 1 1 0 0 0 2.5 6 L 0.5 6 Z M 0 9 L 16 9 L 16 18 L 0 18 Z" + }, + { + id: "inbox", + name: "Inbox", + category: "objects", + strokeWidth: 6, + path: "M 0 0 L 4 0 L 6 1 L 10 1 L 12 0 L 16 0 L 16 3 L 0 3 L 0 0 L 3 -3 L 13 -3 L 16 0 L 12 0 L 10 1 L 6 1 L 4 0 Z" + }, + { + id: "speechBubble", + name: "Speech Bubble", + category: "speech", + strokeWidth: 5, + path: "M204.14966,175.04472c-0.31482,-15.49173 8.58161,-20.45314 15.2824,-20.45314c8.15418,0 26.20534,-0.47063 40.10194,0c6.7857,0.22981 16.64329,5.37466 16.31655,20.45314c-0.30922,14.27018 -11.32079,18.61465 -16.43145,18.61465c-4.65217,0 -12.43125,0 -21.25748,0c-2.33362,0 -8.8706,12.31777 -19.5339,11.95015c-7.56289,-0.26073 4.2991,-11.95015 1.26396,-11.95015c-9.00032,0 -15.52291,-7.83267 -15.74202,-18.61465z" + }, + { + id: "thinkingBubble", + name: "Thinking Bubble", + category: "speech", + strokeWidth: 10, + path: "M181.625,163.75c0,-9.03599 8.31115,-16.7148 19.88037,-19.50356c3.78813,-8.33365 14.94537,-14.37144 28.11963,-14.37144c10.60583,0 19.90445,3.91305 25.10344,9.78682c1.5942,-0.18873 3.22977,-0.28682 4.89656,-0.28682c7.20482,0 13.82617,1.83268 19.04507,4.89724c0.96891,-0.09722 1.95499,-0.14724 2.95493,-0.14724c13.66905,0 24.75,9.34606 24.75,20.875c0,6.80117 -3.85625,12.84269 -9.82521,16.65396c2.12223,2.1898 3.32521,4.69056 3.32521,7.34604c0,8.62945 -12.70392,15.625 -28.375,15.625c-5.79983,0 -11.19324,-0.9582 -15.68664,-2.60279c-5.37837,3.48673 -12.44651,5.60279 -20.18836,5.60279c-2.14277,0 -4.23392,-0.1621 -6.25193,-0.4705c0.00128,0.04563 0.00193,0.09136 0.00193,0.13717c0,4.55635 -6.37994,8.25 -14.25,8.25c-7.87006,0 -14.25,-3.69365 -14.25,-8.25c0,-1.85573 1.0583,-3.56835 2.84455,-4.9466c-12.33446,-0.48405 -22.09455,-6.7775 -22.09455,-14.47006c0,-4.13493 2.81999,-7.8656 7.34397,-10.50709c-4.57145,-3.63277 -7.34397,-8.39897 -7.34397,-13.61791zM202.125,220.66667c0,2.96853 -3.52576,5.375 -7.875,5.375c-4.34924,0 -7.875,-2.40647 -7.875,-5.375c0,-2.96853 3.52576,-5.375 7.875,-5.375c4.34924,0 7.875,2.40647 7.875,5.375zM183.375,226c0,2.27818 -2.18261,4.125 -4.875,4.125c-2.69239,0 -4.875,-1.84682 -4.875,-4.125c0,-2.27818 2.18261,-4.125 4.875,-4.125c2.69239,0 4.875,1.84682 4.875,4.125z" + }, + { + id: "shoutBubble", + name: "Shout Bubble", + category: "speech", + strokeWidth: 8, + path: "M227.11094,208.57049c-5.92772,5.58295 -15.6124,15.76793 -29.02488,15.33964c-11.40942,-0.36435 0.9565,-15.09531 2.93147,-18.17751c3.24637,-5.06637 1.63986,-8.52859 1.63986,-8.52859l-21.47242,5.86044l4.84649,-13.34467l-21.15795,-1.09108l23.26277,-13.82792l-20.14297,-9.34374l22.87578,-5.70891l-10.25508,-14.51162l19.58978,8.2709l-1.70024,-12.65976l16.59077,13.46143l1.10608,-13.38683l15.56167,11.24624l12.10608,-16.09172l5.91725,15.89507l18.12276,-12.77889l-3.24144,15.28333l22.11413,-10.58546l-4.54409,17.01121l23.95449,-11.29693l-8.61338,14.50991l16.14654,3.46186l-20.56767,7.84186l21.96975,8.07507l-23.41162,4.65774l18.31315,10.48796l-30.03068,-1.02513l3.75565,11.52599l-26.77205,-10.86823l-7.93841,9.53141l-12.67597,-9.86071c0,0 -3.17514,4.90084 -9.25562,10.62767z" + }, + { + id: "squareBubble", + name: "Square Bubble", + category: "speech", + strokeWidth: 8, + path: "M 189 156 C 189 152 192 149 201 149 L 280 149 C 288 149 291 152 291 156 L 291 190.1874 C 291 195 288 198 282.5854 198.259 L 237.8872 198.259 C 234.5436 198.259 225.1776 213.7976 209.8995 213.3339 C 199.0636 213.005 216.0591 198.259 211.7105 198.259 L 198 198.259 C 192 198 189 195 189 189.9301 Z" + }, + { + id: "codeblock", + name: "Code Block", + category: "blocks", + strokeWidth: 9, + path: "M191.07407,156c0,-2.20914 1.79086,-4 4,-4h8c2,0 3,1 4,2l4,4c1,1 2,2 4,2h12c2,0 3,-1 4,-2l4,-4c1,-1 2,-2 4,-2h45.85186c2.20914,0 4,1.79086 4,4v40c0,2.20914 -1.79086,4 -4,4h-45.85186c-2,0 -3,1 -4,2l-4,4c-1,1 -2,2 -4,2h-12c-2,0 -3,-1 -4,-2l-4,-4c-1,-1 -2,-2 -4,-2h-8c-2.20914,0 -4,-1.79086 -4,-4z" + }, + { + id: "codeblockHat", + name: "Hat Block", + category: "blocks", + strokeWidth: 6, + path: "M 0.54 2.093 C 3.214 -0.191 6.978 0.899 8.068 2.093 L 11.667 2.093 Q 11.851 2.076 11.949 2.297 L 11.949 5.526 Q 11.925 5.747 11.741 5.809 L 4.177 5.809 C 3.904 5.969 3.725 6.335 3.43 6.439 L 2.359 6.439 C 2.051 6.337 1.897 5.975 1.598 5.83 L 0.797 5.83 Q 0.588 5.708 0.548 5.563 Z" + }, + { + id: "codeblockEndCap", + name: "End-Cap Block", + category: "blocks", + strokeWidth: 6, + path: "M 0.554 6.094 Q 0.584 5.901 0.777 5.824 L 1.602 5.824 C 1.892 5.98 2.04 6.333 2.358 6.442 L 3.409 6.446 C 3.748 6.361 3.847 5.966 4.203 5.824 L 6.289 5.824 Q 6.515 5.885 6.561 6.1 L 6.561 9.253 Q 6.521 9.502 6.283 9.569 L 0.837 9.569 Q 0.614 9.538 0.554 9.308 Z" + }, + { + id: "codeblockReporter", + name: "Reporter Block", + category: "blocks", + strokeWidth: 6, + path: "M 11.864 6.638 L 15.403 6.644 C 17.396 6.894 17.338 9.532 15.403 9.765 L 11.864 9.77 C 10.045 9.643 9.778 6.905 11.864 6.638 Z" + }, + { + id: "codeblockBoolean", + name: "Boolean Block", + category: "blocks", + strokeWidth: 6, + path: "M 11.967 13.517 L 16.615 13.509 L 18.188 15.076 L 16.615 16.642 L 11.967 16.635 L 10.393 15.076 Z" + } ]; -const generateShapeSVG = shapeObject => { - const strokeColor = '#575e75'; - const icon = shapeObject.icon; - // extract viewbox - const viewBoxStart = icon.substring(icon.indexOf('viewBox="') + 9); - const viewBoxString = viewBoxStart - .substring(0, viewBoxStart.indexOf('"')); - // extract fill color - const fillColorStart = icon.substring(icon.indexOf('fill="') + 6); - const fillColorString = fillColorStart - .substring(0, fillColorStart.indexOf('"')); - // extract stroke width - const strokeWidthStart = icon.substring(icon.indexOf('stroke-width="') + 14); - const strokeWidthString = strokeWidthStart - .substring(0, strokeWidthStart.indexOf('"')); - // extract viewbox to array - const viewBox = viewBoxString - .replace(/ /gmi, ',') - .split(',') - .map(value => value.trim()) - .map(num => Number(num)); - const newViewBox = [ - viewBox[0] - 1.5, - viewBox[1] - 1.5, - viewBox[2] + (1.5 * 2), - viewBox[3] + (1.5 * 2) - ].join(','); - const newIcon = icon - .replace(`viewBox="${viewBoxString}"`, `viewBox="${newViewBox}"`) - .replace(/stroke="[^"]*"/, `stroke="${strokeColor}"`) - .replace(`fill="${fillColorString}"`, 'fill="none"') - .replace(`stroke-width="${strokeWidthString}"`, `stroke-width="${shapeObject.strokeWidth}"`); - return `${newIcon}`; -}; -const categorizeShapes = (shapes) => { - const categorized = {}; - for (const categoryId in categories) { - categorized[categoryId] = []; - } - for (const shape of shapes) { - let targetCategory = shape.category || "custom"; - if (!categorized[targetCategory]) { - log.warn(`Invalid shape category: ${targetCategory}`); - targetCategory = "custom"; - } - categorized[targetCategory].push(shape); - } - return categorized; +const selectablePaths = Object.fromEntries( + selectableShapes.map((shape) => [shape.id, shape.path]) +); + +const generateShapeSVG = (shapeObj) => { + const strokeColor = "#575e75"; + const path = new paper.Path(shapeObj.path); + const bounds = path.getBounds(); + const viewbox = `${bounds.x} ${bounds.y} ${bounds.width} ${bounds.height}`; + + return ``; + + ``; }; export { selectableShapes, selectablePaths, categories, - generateShapeSVG, categorizeShapes, -}; \ No newline at end of file +}; From 1c357a45d1504304708eca677c72737d3d3b1ee7 Mon Sep 17 00:00:00 2001 From: SharkPool <139097378+SharkPool-SP@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:33:32 -0800 Subject: [PATCH 2/5] Delete src/components/triangle-mode/temporary.png --- src/components/triangle-mode/temporary.png | Bin 2049 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/components/triangle-mode/temporary.png diff --git a/src/components/triangle-mode/temporary.png b/src/components/triangle-mode/temporary.png deleted file mode 100644 index db8d4c733ef1fa3f2832970ae6dda0caa827a4c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2049 zcmV+c2>$npP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D2bM`hK~#8N?OSVX zR7Dit-4@Djd6kwbbPEDHh#~R}QCSLQX(?b7F)C=ln3xcPAx4ez17l)*{W3~4s8NY% z{G$oTqtG|B5~GF|5{aRTKO`Wp0s<}Fw!7nZcFu0^o!;G2*k|1@`MP)SIeTa3oSAdZ z%x-NNWRSuC8g_n7EQEC6Z#L++wc7o`dr3m#4Itzw{G9>1!7Jb~@NBXTkr)U$uGC%k zb(O2kSL;x2$yt(d z2MtU}&jD9?r*ZHhUUcM>5gMQ~8yw1?8blCsB&PZ<^0t)$h$QnAH~tCTHQ;dmj^r^?RZFFv2N(?jbOXpOU5^FABM~ z#_8?0800@-E3JQ{EF@pxKGcZMPT(h{DUjYU$P>D!>zt*2$X*9$FLKxKzTn6=Wd6L-ErM z+4EqpXN8>RaX0?1&lED=Vt4Hh$n#h;O@MM2Q+tm-AbL;UhP;3^6=-iD`*QWCn~9DO+%TKt)m-REn6cRNq@oXDWpuAI6$yD8qTM?oaEV zrTBnn?t|Psb5ahJw}pI?rmb-R#C@)1S0S6un${392i!y%K>z%?tg(TLqRKZRPvNW} z@X2U4;3^U!JCibs)AgJK-#50kG9i1 zo2+9=QV=2VvB#*Sy^}R>9%@E?rq3uM)fbSLfhmv`l=qj@>5kq}nh}sKy5)`v=|+L{ za|FZw0{K|hOd?eNuG2foY42mmovb-w1_Iw7kln+Y zw+?lb_Mz3D0<+*J$nRjyBtXbD^X0eJ$`q6$vS^vJI~(%1soz|&rTP;IV^l5OU(W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jfE Date: Wed, 12 Nov 2025 01:33:41 -0800 Subject: [PATCH 3/5] Delete src/components/arrow-mode/temporary.png --- src/components/arrow-mode/temporary.png | Bin 6022 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/components/arrow-mode/temporary.png diff --git a/src/components/arrow-mode/temporary.png b/src/components/arrow-mode/temporary.png deleted file mode 100644 index a183b630224fe406ab83a1c608684057acd7439d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6022 zcmds5`CC)h);@?zy((%!P(aX16;wpjD2hoOgA^HMmO*hq6A=)Km=MN_NWfT}K|#gJ z5C##!0YeZB6cMRIKvAZkQVv5J;Xn)txofAr&(nY5`+mrib7?Q6D@^4%*_d1;a|Y(-r%s!1J`w zo!;RXrd^AE8ucN02QWVBu!l=T$|9v-n@`9 zWIS|;Rr2Q7uLmb3|4^*#pM}wmV_4Gv?cbFlfoh^zf~%6Oj4;}`SM2(@cpx~MfAQp+ z^QtxW-uF^*aqdl$R@|$=F{-EK4NF9gpl!9dRlDM(0tmh+b z@=p|1nO;lMtUg@&isczF_a%~i-k+KUmNS-iAS6ssP#Mhz)dlbcZW&D0bZd26Zh6$R8T&@_!KO}5JYsXnhxJ{xG zz3pM8C=KkIXMT>aEPXi=0+*k3qbtp(3bl?;pzJyLFHweq?!4 z*C>R*f93a45qD-RiiOdzokZ=LEaaWk@Ph2@_Xx?`$elfT#usqTQSp6z_ugfQeYTc| z$>hZdlVM#Ux1Lvr1bNyZT3Ta@r29_0grZxgjvi;?(W*p1w2GDcu{TDb@SKrNDVUYq zg1|*@dhs>4)Up3nS5&`!H{$L%QbaM|hy<#0>~zo8=c_G}Ybdg%Ek@t#`XY(^SEmqY zsJv9(r4E0u_3gXak-pjJZSZ4(eDb5!NYJ+<&cveQ-iYm1-zz-)QwG|0!y6ruZNn5K z|DHR&1y1MH@t?G-#4X#rwHrj-b;ZAs;<2&@sb$IcXW#RUN5KAVx8Uzp3C9kL_baId)Q9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SP@users.noreply.github.com> Date: Wed, 12 Nov 2025 01:33:50 -0800 Subject: [PATCH 4/5] Delete src/components/sussy-mode/temporary.png --- src/components/sussy-mode/temporary.png | Bin 4735 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/components/sussy-mode/temporary.png diff --git a/src/components/sussy-mode/temporary.png b/src/components/sussy-mode/temporary.png deleted file mode 100644 index e95074ab890377788498ef6adab5ea8baf92641f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4735 zcmV-_5`gWAP)00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D5)?^9K~!i%)mmw9 zT-SMi?z!vSSvW%uDej9%?UE(iiEP=irN(Itqp8uw=!O(1@}ZyGf8Z|#3KVT%wS@!2 zXzMhso5V@&#Bk%fPHb6=En2j!CDcla+i;tOv(Mf8o_k4(DFkUGOz$wu;$`Yvf#PQT?)%RX{B#bY$-7T zMk-!DvDY(2r7x{LG*&*f+ZgRuhUP*CCs?>vIkQvlPOJN;1j%C_+_GxUCY)T@DeCrI zTwt!$p3@FY3aV|*CG5Fa?fhW%lkMThuINXu&=M?S7~{$Edk3VJqPlBF8JuI1XXir3 z^$tO^<+i-knioVaIOCU9cmgpI1drxr(HaXIBnpdG1uQiR}d_4t3HS zEM&F6mWnUn2R$=90W^NlcV^Yb|hVD2~AG z1VOgRwfL~+B56x%EhxQdT8tY(a_L>pfzL-n5hz~JO)*-fkvJg`5vuhyRslCq&I2&sZ9i;C;Iwqu!I)nJv9 zkk4Ro(j80dvv#M$B9NHmT8yU$*`e7!hrqBEsrdG}EAaRIIXD8RuS4+MbI4nO%Uaj$ zz&`h(hq?}S#ky265>le7tVtrRDcH7IGfFk9l&RzA6?TfTLW(8yfhMUXB!q0&Hl(Vdnu2`WV*}icoSz9&$8sa* zB^P%=*&$GNJ-F_2Vr-)A5gh$`*RxOVJi4Q$yz=t=@(df3%UQs(vNtfoAP;B z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-bw2bXvZOeyx&vQN3e($Z>AHFwy@wpcl9z0Xisw9n(g7r4q{u6x{ z&~5sKollKyR}-+PWAq86e;?6jA!uBB0(qP>1M78kzJsnS+{E+yF#FqZp9brLc<*5l zs9!5blH>b&&V98hHK0_&+|8FI@d>zaT+}{!S%2q0vLAozZzi93tJFFpNP<1VY9FBX zCL9vQ(@90Fh3afjIX9 zk5}PdWTChF{1bcr=g-@29MlRCo)78?oPRm|{!7-)r(R3%8>u#BDJb0~W=+Dl3Tu&n zAml?=2zVj{9pOU=?eHU5Tn-+3i%!*c8P#hrZuw5t0j(br9qN_M)N`J%m{301GQPKa z Date: Wed, 12 Nov 2025 02:05:01 -0800 Subject: [PATCH 5/5] Update text-tool.js --- src/helper/tools/text-tool.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helper/tools/text-tool.js b/src/helper/tools/text-tool.js index fe5f18aa67..f290a70b31 100644 --- a/src/helper/tools/text-tool.js +++ b/src/helper/tools/text-tool.js @@ -183,7 +183,8 @@ class TextTool extends paper.Tool { tx = -this.element.parentElement.clientWidth; } if ((this.alignment === "center") && this.element.parentElement) { - tx = -this.element.parentElement.clientWidth / 2; + const bounds = this.textBox.getBounds(); + tx = bounds.x / (1 + paper.view.zoom * 0.5); } // The transform origin in paper is x at justification side, y at the baseline of the text. // The offset from (0, 0) to the upper left corner is recorded by internalBounds