a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added new icons for highlight and highlight color settings, made a baindaid for issue where highlight 1 in theme settings will show as white if you hanve't manually set a color

celine a3061e59 8c36c736

+61 -27
+23 -1
components/Icons.tsx
··· 170 170 ); 171 171 }; 172 172 173 + export const PaintSmall = (props: Props) => { 174 + return ( 175 + <svg 176 + width="24" 177 + height="24" 178 + viewBox="0 0 24 24" 179 + fill="none" 180 + xmlns="http://www.w3.org/2000/svg" 181 + {...props} 182 + > 183 + <path 184 + fillRule="evenodd" 185 + clipRule="evenodd" 186 + d="M17.545 2.03711C18.0103 1.00481 19.2243 0.545164 20.2566 1.01047C21.2796 1.47157 21.7402 2.66796 21.2956 3.69412L19.1929 9.45438L20.5347 9.93008L20.5592 9.94077C20.6127 9.96415 20.6666 9.98739 20.721 10.0108L20.7212 10.0109C21.1799 10.2086 21.6675 10.4187 22.1615 10.8231L22.1797 10.838L22.197 10.854C22.4009 11.0435 22.7647 11.4088 22.7844 11.9802L22.7853 12.007L22.6746 14.9893C22.6647 15.2569 22.5129 15.4989 22.2762 15.6243C22.1485 15.6919 22.0066 15.72 21.8673 15.7093C21.8308 16.8034 21.702 17.8645 21.5991 18.5225C21.4884 19.3524 21.3215 20.1796 21.0733 20.961C20.828 21.733 20.499 22.5001 20.1288 22.9761C20.0336 23.0985 19.8687 23.2261 19.7118 23.1459C19.2381 22.9038 18.5342 22.6482 17.6329 22.3271C16.7275 22.0045 15.798 21.731 15.1487 21.6436C14.96 21.6182 14.6875 21.6111 14.3178 21.6014H14.3177C14.1693 21.5975 14.0051 21.5932 13.8243 21.5872C13.2125 21.5667 12.4545 21.5259 11.5942 21.4047C9.82836 21.156 8.60773 20.4813 7.52071 19.4778C7.47411 19.4348 7.4326 19.3759 7.40921 19.3424C7.37804 19.2977 7.34146 19.2418 7.30109 19.1778C7.21998 19.0493 7.11654 18.8774 6.99815 18.6752C6.46251 17.76 5.91861 16.8296 5.42837 15.8769C5.68022 15.9192 5.94738 15.9453 6.21718 15.9522C6.70426 15.9647 7.27091 15.9158 7.78688 15.7402C7.76372 15.921 7.71497 16.0955 7.65654 16.3046C7.61639 16.4483 7.57168 16.6083 7.52755 16.798C7.47978 17.0033 7.53877 17.2189 7.68443 17.3714C8.88339 18.6261 10.0285 18.7848 11.2532 18.9546L11.2535 18.9546L11.2537 18.9547C11.4191 18.9776 11.5859 19.0007 11.7545 19.0268C11.8765 19.0456 12.0014 19.0279 12.1133 18.9759C12.5823 18.758 12.9477 18.551 13.2866 18.2266C13.3773 18.1398 13.4639 18.0466 13.5489 17.9459C13.5859 18.1342 13.5935 18.2831 13.5805 18.3685C13.549 18.5749 13.6227 18.7835 13.7769 18.9243C13.9311 19.0651 14.1457 19.1195 14.3485 19.0694L14.3496 19.0692L14.3512 19.0688L14.355 19.0678L14.3651 19.0652C14.3728 19.0631 14.3826 19.0604 14.3941 19.0571C14.4172 19.0505 14.4479 19.0411 14.4844 19.0288C14.5564 19.0045 14.6543 18.9675 14.764 18.9149C14.7692 18.9341 14.7739 18.9525 14.7782 18.9702C14.7986 19.0553 14.8081 19.1221 14.8124 19.1632C14.8146 19.1837 14.8154 19.1977 14.8157 19.2041L14.8159 19.2071C14.8189 19.4571 14.9707 19.6816 15.2023 19.7773C15.6151 19.9477 15.9458 20.0775 16.2281 20.1882C16.8851 20.446 17.2797 20.6008 17.8349 20.926C18.0084 21.0276 18.2194 21.0507 18.4159 20.9791C18.5799 20.9193 18.6828 20.8124 18.7347 20.7499C18.8381 20.6253 18.9024 20.475 18.9421 20.3705C19.0298 20.1399 19.1061 19.831 19.1712 19.5186C19.2416 19.1807 19.0247 18.8497 18.6868 18.7793C18.3489 18.7088 18.0179 18.9257 17.9475 19.2636C17.9269 19.3622 17.9066 19.453 17.8868 19.5353C17.4814 19.3362 17.0899 19.1826 16.6065 18.9929L16.6062 18.9928L16.6056 18.9926C16.4227 18.9208 16.2265 18.8438 16.0114 18.7572C16.0061 18.7318 16.0001 18.7055 15.9936 18.6784C15.9246 18.3911 15.7888 18.009 15.5212 17.6078C15.4082 17.4383 15.2197 17.3345 15.0161 17.3297C14.9059 17.3271 14.7988 17.3536 14.7045 17.4044C14.6988 17.3837 14.693 17.3631 14.6871 17.3428C14.5771 16.9639 14.406 16.562 14.1991 16.2786C14.0767 16.111 13.8791 16.0151 13.6717 16.0226C13.4643 16.0301 13.2741 16.1401 13.1642 16.3162C12.8318 16.8485 12.6277 17.1271 12.4223 17.3235C12.2559 17.4828 12.0686 17.6072 11.7537 17.7625C11.6353 17.7449 11.5213 17.7286 11.4113 17.7129L11.4111 17.7128C10.3163 17.5562 9.61596 17.456 8.8345 16.7484L8.83913 16.7322C8.99429 16.1921 9.17976 15.5465 8.9115 14.5582C8.85292 14.3424 8.68352 14.1743 8.46726 14.1175C8.251 14.0606 8.02084 14.1236 7.86369 14.2827C7.5945 14.5552 6.99175 14.7216 6.24922 14.7026C5.90156 14.6937 5.56958 14.6444 5.30348 14.5727C5.17069 14.5369 5.06259 14.4978 4.98131 14.46C4.94107 14.4413 4.91076 14.4246 4.8891 14.4108C4.86799 14.3975 4.85923 14.3896 4.85871 14.3891C4.80247 14.3361 4.73897 14.2954 4.67163 14.2672C4.63444 14.1786 4.59797 14.0899 4.56227 14.0009C4.52504 13.9247 4.49127 13.8495 4.461 13.7756C4.40527 13.6394 4.43532 13.4831 4.5376 13.3774C4.63987 13.2716 4.79502 13.2363 4.933 13.2874C5.33612 13.4367 6.08305 13.5564 6.88889 13.1865C7.71385 12.6215 8.17915 12.2497 8.53906 11.8685C8.78217 11.6111 8.98664 11.3396 9.22419 10.9786C9.0925 10.8833 8.99355 10.7464 8.94558 10.5869C8.87546 10.3536 8.92301 10.1008 9.07308 9.9089L10.7924 7.71071C11.1743 7.19792 11.8415 6.98559 12.4502 7.18474L12.4592 7.1877L15.2201 8.13004L17.5359 2.05733L17.545 2.03711ZM14.1983 18.4628C14.3481 19.0695 14.3483 19.0695 14.3485 19.0694L14.1983 18.4628ZM9.949 12.1255C10.0069 12.1557 10.0612 12.1897 10.1101 12.2282C10.2169 12.312 10.2673 12.4809 10.323 12.6672C10.4391 13.0558 10.5779 13.5206 11.2975 13.45C11.648 13.4156 11.8039 13.6766 11.9932 13.9936C12.1879 14.3197 12.4181 14.7051 12.932 14.8893C13.2101 14.9889 13.4464 14.9041 13.7283 14.8029C14.0567 14.6851 14.4469 14.545 15.0372 14.6482C15.5689 14.7412 15.8051 15.2291 16.0567 15.7489C16.3243 16.3016 16.6093 16.8904 17.2857 17.0788C17.5455 17.1511 17.8618 17.0759 18.2116 16.9927L18.2116 16.9926C18.3236 16.966 18.4391 16.9385 18.5572 16.9148C18.6974 16.5232 18.7577 16.1782 18.8403 15.6558C18.8943 15.3148 19.2143 15.0821 19.5553 15.136C19.8962 15.1899 20.1289 15.51 20.075 15.851C20.0168 16.2194 19.965 16.5237 19.8905 16.8207C20.0272 16.7772 20.1489 16.7146 20.2606 16.6571C20.3723 16.5997 20.474 16.5474 20.5707 16.5244C20.6072 16.0423 20.6304 15.531 20.6271 15.0336L19.9364 14.6011L10.4284 11.4179C10.2648 11.676 10.11 11.9083 9.949 12.1255ZM16.6402 8.61577C17.0087 8.76279 17.2011 9.17466 17.0715 9.5544C16.9377 9.94641 16.5114 10.1557 16.1194 10.0219L11.9909 8.61289L11.9881 8.61673L10.9087 9.99681L20.497 13.207C20.5531 13.2258 20.6068 13.2511 20.6569 13.2825L21.2238 13.6374L21.2822 12.0628C21.2768 12.056 21.2698 12.0476 21.2607 12.0375C21.2434 12.0182 21.2214 11.9958 21.1929 11.9688C20.8764 11.7139 20.5822 11.5862 20.1156 11.3836L19.9832 11.326L17.9781 10.6152C17.7895 10.5483 17.6354 10.4089 17.5502 10.2278C17.4649 10.0467 17.4556 9.83912 17.5242 9.65113L19.9044 3.13084L19.9158 3.10572C20.0406 2.82867 19.9173 2.50285 19.6402 2.37797C19.3685 2.2555 19.0499 2.37177 18.92 2.6376L16.6402 8.61577ZM5.72497 6.8019C5.88261 6.69921 6.06745 6.65506 6.26506 6.67555C6.65339 6.71583 6.96541 6.8179 7.19313 6.99738C7.43255 7.18609 7.54331 7.4323 7.57277 7.67941C7.60062 7.91295 7.55589 8.14161 7.50374 8.32554C7.46269 8.4703 7.40873 8.6132 7.36784 8.72149L7.36783 8.72151L7.36783 8.72151C7.23724 9.06734 6.97245 9.32403 6.67966 9.5384C6.50064 9.66948 6.29848 9.80439 6.07846 9.85449C6.02554 9.86654 5.8803 9.89539 5.73544 9.81848C5.58199 9.737 5.48622 9.59723 5.42723 9.48641C5.36347 9.36666 5.31489 9.22757 5.27842 9.08563C5.20529 8.80103 5.16916 8.45885 5.18001 8.13036C5.19064 7.80839 5.24766 7.45849 5.39291 7.18158C5.46715 7.04004 5.57336 6.90066 5.72497 6.8019ZM4.98801 12.6228C3.93111 12.6827 3.00103 12.614 2.35337 12.2276C1.9708 11.9994 1.68886 11.772 1.5072 11.4199C1.33599 11.088 1.27528 10.6823 1.22372 10.1633C1.15755 9.49705 1.45636 8.95573 1.95681 8.67757C2.4447 8.40639 3.07561 8.4103 3.65401 8.70292C3.95402 8.85469 4.11264 9.08193 4.20091 9.34141C4.25986 9.5147 4.29201 9.72435 4.32174 9.91813C4.32999 9.97195 4.33806 10.0245 4.34646 10.0748C4.4282 10.5638 4.58056 11.198 5.25504 12.0085C5.34563 12.1174 5.36716 12.268 5.3107 12.3979C5.25423 12.5278 5.12941 12.6148 4.98801 12.6228Z" 187 + fill="currentColor" 188 + /> 189 + </svg> 190 + ); 191 + }; 192 + 173 193 export const ShareSmall = (props: Props) => { 174 194 return ( 175 195 <svg ··· 402 422 {...props} 403 423 > 404 424 <path 405 - d="M6 19.6364V4H8.3592V10.7951H16.1545V4H18.5213V19.6364H16.1545V12.8184H8.3592V19.6364H6Z" 425 + fillRule="evenodd" 426 + clipRule="evenodd" 427 + d="M20.5 12C20.5 16.6944 16.6944 20.5 12 20.5C7.30558 20.5 3.5 16.6944 3.5 12C3.5 7.93802 6.34926 4.54153 10.1582 3.70008L9.84791 4.18297C9.77021 4.3039 9.72889 4.44461 9.72888 4.58836L9.72851 10.0094L8.63101 11.7402C8.62242 11.7538 8.61431 11.7675 8.60666 11.7815C8.60016 11.7908 8.59388 11.8004 8.58781 11.8101C8.38051 12.1418 8.46302 12.6162 8.76836 13.1359L7.24363 15.6498C6.74131 16.4779 7.3311 17.5381 8.29965 17.548L11.6224 17.5818C12.2379 17.5881 12.8114 17.2706 13.1328 16.7456L13.4985 16.148C13.9182 16.1939 14.2769 16.1567 14.5378 16.0308C14.6916 15.9756 14.8266 15.8704 14.9178 15.7265L16.0178 13.9918L20.4981 11.8165C20.4994 11.8775 20.5 11.9387 20.5 12ZM20.3169 10.2369L15.1709 12.7355C15.0456 12.7963 14.9397 12.8909 14.8651 13.0086L14.3138 13.878C14.2071 13.7494 14.0889 13.6201 13.9603 13.4913C13.554 13.0742 13.0329 12.6692 12.5492 12.3837C12.4992 12.3542 12.4466 12.3239 12.3919 12.2929C12.0663 12.101 11.7406 11.938 11.4239 11.8053C11.2273 11.719 11.024 11.6386 10.8321 11.5784C10.7486 11.5522 10.6549 11.5258 10.5563 11.505L11.1119 10.6287C11.188 10.5086 11.2285 10.3694 11.2285 10.2272L11.2289 4.80862L12.0696 3.50028C12.4231 3.50311 12.7716 3.52754 13.1136 3.57229C13.0973 3.59203 13.082 3.61297 13.0679 3.63511L12.2981 4.84369C12.2341 4.94402 12.2002 5.06052 12.2002 5.17948V7.82698C12.2002 8.17215 12.48 8.45198 12.8252 8.45198C13.1704 8.45198 13.4502 8.17215 13.4502 7.82698V5.36164L14.1222 4.3067C14.225 4.14534 14.2445 3.95474 14.1919 3.7853C17.2663 4.60351 19.6556 7.10172 20.3169 10.2369ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM12.6338 9.14563C12.979 9.14563 13.2588 9.42545 13.2588 9.77063V10.2416C13.2588 10.5868 12.979 10.8666 12.6338 10.8666C12.2886 10.8666 12.0088 10.5868 12.0088 10.2416V9.77063C12.0088 9.42545 12.2886 9.14563 12.6338 9.14563ZM12.7875 14.4388C12.5032 14.1651 12.1383 13.8821 11.7882 13.6755C11.5214 13.5181 11.1621 13.3284 10.8268 13.1808C10.733 13.1395 10.6444 13.103 10.5629 13.072L8.75514 16.0525L11.6391 16.0819C11.727 16.0828 11.809 16.0374 11.8549 15.9625L12.7875 14.4388Z" 406 428 fill="currentColor" 407 429 /> 408 430 </svg>
+1 -3
components/ThemeManager/ThemeProvider.tsx
··· 22 22 "theme/primary": "#272727", 23 23 "theme/accent-background": "#0000FF", 24 24 "theme/accent-text": "#FFFFFF", 25 - // this is affecting the default set in the Highlight settings. It needs to refelct the caluclated value 26 - // seems like a pain in the butt tho. 27 - "theme/highlight-1": "#0000FF", 25 + "theme/highlight-1": "#FFFFFF", 28 26 "theme/highlight-2": "#EDD280", 29 27 "theme/highlight-3": "#9FC4C2", 30 28 };
+25 -21
components/ThemeManager/ThemeSetter.tsx
··· 232 232 233 233 export const ColorPicker = (props: { 234 234 label?: string; 235 - value: Color; 235 + value: Color | undefined; 236 236 alpha?: boolean; 237 237 setValue: (c: Color) => void; 238 238 openPicker: pickers; ··· 267 267 /> 268 268 <strong className="">{props.label}</strong> 269 269 <div className="flex gap-1"> 270 - <ColorField className="w-fit gap-1"> 271 - <Input 272 - onFocus={(e) => { 273 - e.currentTarget.setSelectionRange( 274 - 1, 275 - e.currentTarget.value.length, 276 - ); 277 - props.setOpenPicker(props.thisPicker); 278 - }} 279 - onKeyDown={(e) => { 280 - if (e.key === "Enter") { 281 - e.currentTarget.blur(); 282 - } else return; 283 - }} 284 - onBlur={(e) => { 285 - props.setValue(parseColor(e.currentTarget.value)); 286 - }} 287 - className="w-[72px] bg-transparent outline-none" 288 - /> 289 - </ColorField> 270 + {props.value === undefined ? ( 271 + <div>default</div> 272 + ) : ( 273 + <ColorField className="w-fit gap-1"> 274 + <Input 275 + onFocus={(e) => { 276 + e.currentTarget.setSelectionRange( 277 + 1, 278 + e.currentTarget.value.length, 279 + ); 280 + props.setOpenPicker(props.thisPicker); 281 + }} 282 + onKeyDown={(e) => { 283 + if (e.key === "Enter") { 284 + e.currentTarget.blur(); 285 + } else return; 286 + }} 287 + onBlur={(e) => { 288 + props.setValue(parseColor(e.currentTarget.value)); 289 + }} 290 + className="w-[72px] bg-transparent outline-none" 291 + /> 292 + </ColorField> 293 + )} 290 294 {props.alpha && ( 291 295 <> 292 296 <Separator classname="my-1" />
+12 -2
components/Toolbar/HighlightButton.tsx
··· 29 29 import { useColorAttribute } from "components/ThemeManager/useColorAttribute"; 30 30 import { useParams } from "next/navigation"; 31 31 import { rangeHasMark } from "src/utils/prosemirror/rangeHasMark"; 32 + import { PaintSmall } from "components/Icons"; 32 33 33 34 export const HighlightColorButton = (props: { 34 35 color: "1" | "2" | "3"; ··· 93 94 let backgroundImage = useEntity(rootEntity, "theme/background-image"); 94 95 let backgroundRepeat = useEntity(rootEntity, "theme/background-image-repeat"); 95 96 97 + let color = useEntity(rootEntity, "theme/highlight-1"); 96 98 let highlight1Value = useColorAttribute(rootEntity, "theme/highlight-1"); 97 99 let highlight2Value = useColorAttribute(rootEntity, "theme/highlight-2"); 98 100 let highlight3Value = useColorAttribute(rootEntity, "theme/highlight-3"); 99 101 102 + console.log(color?.data.value + " | " + highlight1Value); 103 + 100 104 return ( 101 105 <Popover.Root> 102 - <Popover.Trigger>settings</Popover.Trigger> 106 + <Popover.Trigger> 107 + <PaintSmall /> 108 + </Popover.Trigger> 103 109 <Popover.Portal> 104 110 <Popover.Content 105 111 className="themeSetterWrapper z-20 w-80 h-fit max-h-[80vh] bg-white rounded-md border border-border flex" ··· 124 130 > 125 131 <ColorPicker 126 132 label="Highlight 1" 127 - value={highlight1Value} 133 + value={ 134 + color?.data.value === undefined 135 + ? undefined 136 + : highlight1Value 137 + } 128 138 setValue={set("theme/highlight-1")} 129 139 thisPicker={"highlight-1"} 130 140 openPicker={openPicker}