1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 09:35:02 +09:00
This commit is contained in:
Andrew Simachev 2024-02-07 10:11:55 +01:00
commit e0e9f59e07
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
49 changed files with 244 additions and 199 deletions

View file

@ -1,11 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<rect y="0.0302734" width="18" height="18" rx="3" fill="#8C9EA5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.98438 0H10.9844V1H9V2H7V1H8.98438V0ZM9 3V2H11V3H9ZM9 4H7V3H9V4ZM9 5V4H11V5H9ZM9 6H7V5H9V6ZM9 7V6H11V7H9ZM9 8H7V7H9V8ZM9 8H11V8.98438V9V15H7V8.98438H9V8ZM10 14V13H8V14H10Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 0H12V1H10V0ZM10 2H8V1H10V2ZM10 3V2H12V3H10ZM10 4H8V3H10V4ZM10 5V4H12V5H10ZM10 6H8V5H10V6ZM10 7V6H12V7H10ZM10 7V8H8V7H10ZM8 9.5C8 9.22386 8.22386 9 8.5 9H11.5C11.7761 9 12 9.22386 12 9.5V14.5C12 14.7761 11.7761 15 11.5 15H8.5C8.22386 15 8 14.7761 8 14.5V9.5ZM9 14.0026V13.0052H11V14.0026H9Z" fill="#949494"/>
</svg>

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 832 B

Before After
Before After

View file

@ -1,4 +1,7 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#AB50CC"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 3.96973L9 2.96973L9.00779 3.96973H9V10.4695C8.58217 10.1557 8.0628 9.96973 7.5 9.96973C6.11929 9.96973 5 11.089 5 12.4697C5 13.8504 6.11929 14.9697 7.5 14.9697C8.88071 14.9697 10 13.8504 10 12.4697V5.16723L14 5.96973V3.96973Z" fill="white"/>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path d="M10.5 12.5C10.5 13.3284 9.82843 14 9 14C8.17157 14 7.5 13.3284 7.5 12.5C7.5 11.6716 8.17157 11 9 11C9.82843 11 10.5 11.6716 10.5 12.5Z" fill="#E51CA0"/>
<path d="M10 7H10.5V12.5H10V7Z" fill="#E51CA0"/>
<path d="M10 6L13 6.5V8L10 7.5V6Z" fill="#E51CA0"/>
</svg>

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 734 B

Before After
Before After

View file

@ -1,5 +1,6 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#0FC8BA"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.48049 6.96973L2.5 14.9697H9.5H12.5H15.5L12.5 9.96973L10.9665 12.5256L7.48049 6.96973Z" fill="white"/>
<path opacity="0.70106" d="M12 6.96973C13.1046 6.96973 14 6.0743 14 4.96973C14 3.86516 13.1046 2.96973 12 2.96973C10.8954 2.96973 10 3.86516 10 4.96973C10 6.0743 10.8954 6.96973 12 6.96973Z" fill="white"/>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 1.5C18 0.671573 17.3284 0 16.5 0H3.5C2.67157 0 2 0.671573 2 1.5V18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 18.5C2 18.7761 2.67157 19 3.5 19H16.5C17.3284 19 18 18.7761 18 18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5Z" fill="#EBEBEB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9998 8L13.9688 13.0008L9.99968 13.0003L10 13.0008H6L8 10L8.94713 11.421L10.9998 8Z" fill="#0FC8BA"/>
<path opacity="0.70106" d="M7.98438 8C7.43209 8 6.98438 7.55228 6.98438 7C6.98438 6.44772 7.43209 6 7.98438 6C8.53666 6 8.98438 6.44772 8.98438 7C8.98438 7.55228 8.53666 8 7.98438 8Z" fill="#0FC8BA"/>
</svg>

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 826 B

Before After
Before After

View file

@ -1,6 +1,6 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#3E58EB"/>
<ellipse cx="9.5876" cy="9.60272" rx="6.51537" ry="3.25769" transform="rotate(-45 9.5876 9.60272)" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.4253 5.44639L11.426 5.44573C9.77039 3.79011 7.08611 3.79011 5.43049 5.44573C3.79468 7.08154 3.77512 9.72157 5.37181 11.3814C5.38378 11.3946 5.3961 11.4076 5.40877 11.4202C6.23658 12.2481 8.24979 11.577 9.90541 9.92137C11.5468 8.28002 12.2205 6.2872 11.4253 5.44639Z" fill="#3E58EB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.37181 11.3814C3.77512 9.72157 3.79468 7.08154 5.43049 5.44573C6.84253 4.03369 9.00282 3.82595 10.635 4.8225C10.892 4.97938 11.1358 5.16611 11.3616 5.38268C11.3833 5.40342 11.4047 5.42444 11.426 5.44573L11.4253 5.44639C12.2205 6.2872 11.5468 8.28002 9.90541 9.92137C8.24979 11.577 6.23658 12.2481 5.40877 11.4202C5.3961 11.4076 5.38378 11.3946 5.37181 11.3814ZM10.691 6.12526C9.42383 4.88781 7.39343 4.897 6.1376 6.15283C4.88772 7.40272 4.8727 9.42011 6.09249 10.6881L6.10296 10.699L6.11311 10.7102L6.11588 10.7131C6.11766 10.7149 6.32946 10.8871 7.03043 10.6534C7.66797 10.4409 8.45647 9.9561 9.1983 9.21426C9.9335 8.47907 10.4166 7.69762 10.632 7.06248C10.8686 6.36488 10.7051 6.14022 10.6988 6.13348L10.691 6.12526Z" fill="white"/>
</svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.7929 11.3712C6.91515 11.5579 7.05828 11.7349 7.2223 11.8989C7.87569 12.5188 9.42658 11.9949 10.7038 10.7177C11.9915 9.42996 12.5135 7.86413 11.8696 7.22028C11.8604 7.2111 11.8511 7.20215 11.8415 7.19344C11.6893 7.04667 11.5265 6.9174 11.3556 6.80563C12.48 6.33844 13.4843 6.32839 14.0407 6.88475C15.0301 7.87424 14.228 10.2807 12.249 12.2597C10.27 14.2386 7.8636 15.0408 6.87411 14.0513C6.31858 13.4958 6.32778 12.4936 6.7929 11.3712Z" fill="#3E58EB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.22266 11.899L7.22221 11.8995C7.20676 11.884 7.19148 11.8684 7.1764 11.8527C6.95089 11.6183 6.76685 11.3587 6.62426 11.0832C5.9817 9.84174 6.18102 8.27748 7.22221 7.23628C8.49551 5.96299 10.5511 5.94874 11.8419 7.19355C11.8514 7.20226 11.8608 7.21121 11.87 7.22039C12.5138 7.86424 11.9919 9.43007 10.7042 10.7178C9.42694 11.995 7.87605 12.5189 7.22266 11.899ZM7.88838 11.1504C7.03236 10.2504 7.04601 8.8267 7.92932 7.94339C8.81291 7.0598 10.2374 7.04643 11.1371 7.9032C11.1476 7.94181 11.1717 8.08458 11.0627 8.41141C10.9105 8.86812 10.555 9.45279 9.99708 10.0107C9.44397 10.5638 8.86412 10.9184 8.40857 11.0727C8.07043 11.1873 7.92467 11.1601 7.88838 11.1504Z" fill="#3E58EB"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

@ -1,11 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<rect y="-0.0625" width="18" height="18" rx="3" fill="#F55522"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.48869 2.97059C8.75037 2.94823 8.98475 3.13214 9.02527 3.39164C9.36707 5.58068 9.90366 7.11804 10.7707 8.27895C11.6328 9.43314 12.8595 10.2656 14.6807 10.9713C14.9231 11.0652 15.0531 11.3293 14.9797 11.5787C14.9063 11.8281 14.654 11.9796 14.3993 11.9273C12.468 11.5303 10.8846 11.4732 9.32795 11.8347C7.76722 12.1972 6.19166 12.99 4.29233 14.3588C4.07795 14.5133 3.78036 14.4743 3.61303 14.2698C3.44569 14.0652 3.4664 13.7658 3.66029 13.5863C5.37023 12.0029 6.46908 10.5643 7.13877 8.99516C7.80833 7.42636 8.0658 5.6876 8.03132 3.47657C8.02722 3.21396 8.227 2.99295 8.48869 2.97059ZM8.82143 6.72768C8.66549 7.6689 8.41779 8.5459 8.05851 9.3877C7.71432 10.1941 7.27136 10.9598 6.71839 11.7129C7.52394 11.3265 8.30885 11.0448 9.10175 10.8606C9.97984 10.6567 10.8571 10.575 11.7706 10.5974C11.0636 10.1082 10.4681 9.54484 9.96953 8.87735C9.49955 8.2481 9.12412 7.53732 8.82143 6.72768Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="18" height="18" fill="white"/>
</clipPath>
</defs>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.47833 6.00183C9.74004 5.9795 9.97441 6.16348 10.0149 6.423C10.2408 7.87215 10.5926 8.86823 11.1476 9.61244C11.6975 10.3499 12.4848 10.8901 13.6809 11.3543C13.9232 11.4484 14.0531 11.7124 13.9796 11.9618C13.9061 12.2111 13.6538 12.3626 13.3992 12.3102C12.1267 12.0482 11.0969 12.0132 10.0898 12.2475C9.07867 12.4826 8.04873 12.9989 6.79262 13.9055C6.57835 14.0601 6.28073 14.0213 6.11326 13.8169C5.94578 13.6125 5.96626 13.3131 6.16001 13.1334C7.28923 12.0862 8.00471 11.1442 8.43912 10.1248C8.87342 9.1057 9.04367 7.96985 9.0209 6.50781C9.01681 6.24518 9.21662 6.02416 9.47833 6.00183ZM9.77179 9.24398C9.66986 9.6843 9.534 10.1063 9.35907 10.5168C9.19774 10.8954 9.00487 11.2601 8.77842 11.6172C9.14062 11.4721 9.50036 11.3579 9.8633 11.2735C10.3034 11.1711 10.7425 11.1139 11.1901 11.0966C10.873 10.8338 10.5926 10.541 10.3459 10.2103C10.1253 9.91438 9.93557 9.59332 9.77179 9.24398Z" fill="#F55522"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before After
Before After

View file

@ -1,5 +1,6 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#F55522"/>
<path d="M9 8.98917C9 8.98917 9 5.06542 9 2.96973C12.3137 2.96973 15 5.66472 15 8.98917C11.4 8.98917 9 8.98917 9 8.98917Z" fill="white"/>
<path opacity="0.7" fill-rule="evenodd" clip-rule="evenodd" d="M8 3.01416C5.16229 3.49178 3 5.96775 3 8.95038C3 12.2748 5.68629 14.9698 9 14.9698C11.954 14.9698 14.4093 12.8282 14.9077 10.0082H8V3.01416Z" fill="white"/>
</svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path opacity="0.35" d="M14 10C14 12.2091 12.2091 14 10 14C7.79086 14 6 12.2091 6 10C6 7.79086 7.79086 6 10 6C12.2091 6 14 7.79086 14 10Z" fill="#F55522"/>
<path d="M10.0005 9.9822C10.0005 9.9822 10.0005 7.36668 10.0005 5.96973C12.2094 5.96973 14 7.76617 14 9.9822C11.6003 9.9822 10.0005 9.9822 10.0005 9.9822Z" fill="#F55522"/>
</svg>

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 800 B

Before After
Before After

View file

@ -1,9 +1,16 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#5DD400"/>
<rect x="4" y="8" width="4" height="2" fill="white"/>
<rect x="10" y="8" width="4" height="2" fill="white"/>
<rect x="4" y="4" width="4" height="2" fill="white"/>
<rect x="10" y="4" width="4" height="2" fill="white"/>
<rect x="4" y="12" width="4" height="2" fill="white"/>
<rect x="10" y="12" width="4" height="2" fill="white"/>
</svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5H2C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path d="M6 6H8V7H6V6Z" fill="#5DD400"/>
<path d="M12 6H14.0156V7H12V6Z" fill="#5DD400"/>
<path d="M6 8H8V9H6V8Z" fill="#5DD400"/>
<path d="M12 8H14.0156V9H12V8Z" fill="#5DD400"/>
<path d="M6 10H8V11H6V10Z" fill="#5DD400"/>
<path d="M12 10H14.0156V11H12V10Z" fill="#5DD400"/>
<path d="M6 12H8V13H6V12Z" fill="#5DD400"/>
<path d="M9 6H11V7H9V6Z" fill="#5DD400"/>
<path d="M9 8H11V9H9V8Z" fill="#5DD400"/>
<path d="M9 10H11V11H9V10Z" fill="#5DD400"/>
<path d="M9 12H11V13H9V12Z" fill="#5DD400"/>
<path d="M12 12H14.0156V13H12V12Z" fill="#5DD400"/>
</svg>

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 958 B

Before After
Before After

View file

@ -1,7 +1,8 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#2AA7EE"/>
<rect x="4" y="4" width="10" height="1" fill="white"/>
<rect x="4" y="7" width="10" height="1" fill="white"/>
<rect x="4" y="10" width="10" height="1" fill="white"/>
<rect x="4" y="13" width="7.5" height="1" fill="white"/>
</svg>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path d="M6 6H14V7H6V6Z" fill="#2AA7EE"/>
<path d="M6 8H14V9H6V8Z" fill="#2AA7EE"/>
<path d="M6 10H14V11H6V10Z" fill="#2AA7EE"/>
<path d="M6 12H12V13H6V12Z" fill="#2AA7EE"/>
</svg>

Before

Width:  |  Height:  |  Size: 379 B

After

Width:  |  Height:  |  Size: 645 B

Before After
Before After

View file

@ -1,4 +1,5 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18" height="18" rx="3" fill="#2AA7EE"/>
<path d="M13.9688 8.96959L6.54688 4.68457V13.2546L13.9688 8.96959Z" fill="white"/>
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#F2F2F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#EBEBEB"/>
<path d="M13.9688 9.94801L8 6.50195V13.3941L13.9688 9.94801Z" fill="#2AA7EE"/>
</svg>

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 550 B

Before After
Before After

View file

@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 0H12V1H10V0ZM10 2H8V1H10V2ZM10 3V2H12V3H10ZM10 4H8V3H10V4ZM10 5V4H12V5H10ZM10 6H8V5H10V6ZM10 7V6H12V7H10ZM10 7V8H8V7H10ZM8 9.5C8 9.22386 8.22386 9 8.5 9H11.5C11.7761 9 12 9.22386 12 9.5V14.5C12 14.7761 11.7761 15 11.5 15H8.5C8.22386 15 8 14.7761 8 14.5V9.5ZM9 14.0156V13.0156H11V14.0156H9Z" fill="#8D8D8D"/>
</svg>

After

Width:  |  Height:  |  Size: 832 B

View file

@ -0,0 +1,7 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path d="M10.5 12.5C10.5 13.3284 9.82843 14 9 14C8.17157 14 7.5 13.3284 7.5 12.5C7.5 11.6716 8.17157 11 9 11C9.82843 11 10.5 11.6716 10.5 12.5Z" fill="#E51CA0"/>
<path d="M10 7H10.5V12.5H10V7Z" fill="#E51CA0"/>
<path d="M10 6L13 6.5V8L10 7.5V6Z" fill="#E51CA0"/>
</svg>

After

Width:  |  Height:  |  Size: 734 B

View file

@ -0,0 +1,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 1.5C18 0.671573 17.3284 0 16.5 0H3.5C2.67157 0 2 0.671573 2 1.5V18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 18.5C2 18.7761 2.67157 19 3.5 19H16.5C17.3284 19 18 18.7761 18 18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5Z" fill="#3F3F3F"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9998 8L13.9688 13.0008L9.99968 13.0003L10 13.0008H6L8 10L8.94713 11.421L10.9998 8Z" fill="#0FC8BA"/>
<path opacity="0.70106" d="M7.98438 8C7.43209 8 6.98438 7.55228 6.98438 7C6.98438 6.44772 7.43209 6 7.98438 6C8.53666 6 8.98438 6.44772 8.98438 7C8.98438 7.55228 8.53666 8 7.98438 8Z" fill="#0FC8BA"/>
</svg>

After

Width:  |  Height:  |  Size: 826 B

View file

@ -0,0 +1,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.79266 11.3715C6.91491 11.5581 7.05804 11.7351 7.22206 11.8991C7.87544 12.519 9.42633 11.9952 10.7036 10.7179C11.9913 9.43021 12.5132 7.86438 11.8694 7.22053C11.8602 7.21134 11.8508 7.2024 11.8413 7.19368C11.6891 7.04691 11.5262 6.91764 11.3553 6.80588C12.4797 6.33869 13.4841 6.32863 14.0404 6.88499C15.0299 7.87449 14.2278 10.2809 12.2488 12.2599C10.2698 14.2389 7.86336 15.041 6.87386 14.0515C6.31834 13.496 6.32753 12.4939 6.79266 11.3715Z" fill="#3E58EB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.22242 11.8993L7.22197 11.8997C7.20651 11.8842 7.19124 11.8687 7.17615 11.853C6.95065 11.6185 6.7666 11.3589 6.62401 11.0834C5.98146 9.84199 6.18078 8.27772 7.22197 7.23653C8.49526 5.96323 10.5508 5.94899 11.8416 7.19379C11.8512 7.2025 11.8606 7.21145 11.8697 7.22064C12.5136 7.86449 11.9916 9.43032 10.7039 10.718C9.4267 11.9953 7.87581 12.5191 7.22242 11.8993ZM7.88813 11.1506C7.03211 10.2506 7.04576 8.82695 7.92908 7.94363C8.81266 7.06005 10.2372 7.04667 11.1369 7.90345C11.1474 7.94205 11.1714 8.08483 11.0625 8.41165C10.9103 8.86836 10.5547 9.45303 9.99684 10.0109C9.44373 10.564 8.86388 10.9186 8.40833 11.073C8.07018 11.1875 7.92443 11.1604 7.88813 11.1506Z" fill="#3E58EB"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

5
dist/img/theme/dark/icon/file/pdf.svg vendored Normal file
View file

@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.47833 6.00183C9.74004 5.9795 9.97441 6.16348 10.0149 6.423C10.2408 7.87215 10.5926 8.86823 11.1476 9.61244C11.6975 10.3499 12.4848 10.8901 13.6809 11.3543C13.9232 11.4484 14.0531 11.7124 13.9796 11.9618C13.9061 12.2111 13.6538 12.3626 13.3992 12.3102C12.1267 12.0482 11.0969 12.0132 10.0898 12.2475C9.07867 12.4826 8.04873 12.9989 6.79262 13.9055C6.57835 14.0601 6.28073 14.0213 6.11326 13.8169C5.94578 13.6125 5.96626 13.3131 6.16001 13.1334C7.28923 12.0862 8.0047 11.1442 8.43912 10.1248C8.87342 9.1057 9.04367 7.96985 9.0209 6.50781C9.01681 6.24518 9.21662 6.02416 9.47833 6.00183ZM9.77179 9.24398C9.66986 9.6843 9.534 10.1063 9.35907 10.5168C9.19774 10.8954 9.00487 11.2601 8.77842 11.6172C9.14062 11.4721 9.50035 11.3579 9.8633 11.2735C10.3034 11.1711 10.7425 11.1139 11.1901 11.0966C10.873 10.8338 10.5926 10.541 10.3459 10.2103C10.1253 9.91438 9.93557 9.59332 9.77179 9.24398Z" fill="#F55522"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,6 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path opacity="0.35" d="M14 10C14 12.2091 12.2091 14 10 14C7.79086 14 6 12.2091 6 10C6 7.79086 7.79086 6 10 6C12.2091 6 14 7.79086 14 10Z" fill="#F55522"/>
<path d="M10.0005 9.9822C10.0005 9.9822 10.0005 7.36668 10.0005 5.96973C12.2094 5.96973 14 7.76617 14 9.9822C11.6003 9.9822 10.0005 9.9822 10.0005 9.9822Z" fill="#F55522"/>
</svg>

After

Width:  |  Height:  |  Size: 801 B

16
dist/img/theme/dark/icon/file/table.svg vendored Normal file
View file

@ -0,0 +1,16 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5H2C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path d="M6 6H8V7H6V6Z" fill="#5DD400"/>
<path d="M12 6H14.0156V7H12V6Z" fill="#5DD400"/>
<path d="M6 8H8V9H6V8Z" fill="#5DD400"/>
<path d="M12 8H14.0156V9H12V8Z" fill="#5DD400"/>
<path d="M6 10H8V11H6V10Z" fill="#5DD400"/>
<path d="M12 10H14.0156V11H12V10Z" fill="#5DD400"/>
<path d="M6 12H8V13H6V12Z" fill="#5DD400"/>
<path d="M9 6H11V7H9V6Z" fill="#5DD400"/>
<path d="M9 8H11V9H9V8Z" fill="#5DD400"/>
<path d="M9 10H11V11H9V10Z" fill="#5DD400"/>
<path d="M9 12H11V13H9V12Z" fill="#5DD400"/>
<path d="M12 12H14.0156V13H12V12Z" fill="#5DD400"/>
</svg>

After

Width:  |  Height:  |  Size: 957 B

View file

@ -0,0 +1,8 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path d="M6 6H14V7H6V6Z" fill="#2AA7EE"/>
<path d="M6 8H14V9H6V8Z" fill="#2AA7EE"/>
<path d="M6 10H14V11H6V10Z" fill="#2AA7EE"/>
<path d="M6 12H12V13H6V12Z" fill="#2AA7EE"/>
</svg>

After

Width:  |  Height:  |  Size: 645 B

View file

@ -0,0 +1,5 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1.5C2 0.671573 2.67157 0 3.5 0H16.5C17.3284 0 18 0.671573 18 1.5V18.5C18 19.3284 17.3284 20 16.5 20H3.5C2.67157 20 2 19.3284 2 18.5V1.5Z" fill="#2B2B2B"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18 18.5C18 18.7761 17.3284 19 16.5 19H3.5C2.67157 19 2 18.7761 2 18.5C2 19.3284 2.67157 20 3.5 20H16.5C17.3284 20 18 19.3284 18 18.5Z" fill="#3F3F3F"/>
<path d="M13.9688 9.94801L8 6.50195V13.3941L13.9688 9.94801Z" fill="#2AA7EE"/>
</svg>

After

Width:  |  Height:  |  Size: 550 B

View file

@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 3.5C4.39543 3.5 3.5 4.39543 3.5 5.5V13.4393L7.46967 9.46967L8 8.93934L8.53033 9.46967L11 11.9393L12.4697 10.4697L13 9.93934L13.5303 10.4697L16.5 13.4393V5.5C16.5 4.39543 15.6046 3.5 14.5 3.5H5.5ZM16.304 15.3646L13 12.0607L11.5303 13.5303L11 14.0607L10.4697 13.5303L8 11.0607L3.69604 15.3646C4.01855 16.0363 4.70512 16.5 5.5 16.5H14.5C15.2949 16.5 15.9815 16.0363 16.304 15.3646ZM2 5.5C2 3.567 3.567 2 5.5 2H14.5C16.433 2 18 3.567 18 5.5V14.5C18 16.433 16.433 18 14.5 18H5.5C3.567 18 2 16.433 2 14.5V5.5ZM13 8.5C13.8284 8.5 14.5 7.82843 14.5 7C14.5 6.17157 13.8284 5.5 13 5.5C12.1716 5.5 11.5 6.17157 11.5 7C11.5 7.82843 12.1716 8.5 13 8.5Z" fill="#B6B6B6"/>
</svg>

After

Width:  |  Height:  |  Size: 815 B

View file

@ -42,16 +42,6 @@
.icon.layout.c-relation { background-image: url('~img/icon/object/relation.svg'); }
.icon.layout.c-note { background-image: url('~img/icon/object/note.svg'); }
.icon.iconFile.other { background-image: url('~img/icon/file/other.svg') !important; }
.icon.iconFile.image { background-image: url('~img/icon/file/image.svg') !important; }
.icon.iconFile.video { background-image: url('~img/icon/file/video.svg') !important; }
.icon.iconFile.text { background-image: url('~img/icon/file/text.svg') !important; }
.icon.iconFile.archive { background-image: url('~img/icon/file/archive.svg') !important; }
.icon.iconFile.audio { background-image: url('~img/icon/file/audio.svg') !important; }
.icon.iconFile.pdf { background-image: url('~img/icon/file/pdf.svg') !important; }
.icon.iconFile.presentation { background-image: url('~img/icon/file/presentation.svg') !important; }
.icon.iconFile.table { background-image: url('~img/icon/file/table.svg') !important; }
.icon.view.c0 { background-image: url('~img/icon/dataview/view/grid.svg'); }
.icon.view.c1 { background-image: url('~img/icon/dataview/view/list.svg'); }
.icon.view.c2 { background-image: url('~img/icon/dataview/view/gallery.svg'); }

View file

@ -85,6 +85,7 @@
.icon.pencil { background-image: url('~img/icon/menu/action/pencil0.svg'); }
.icon.createWidget { background-image: url('~img/icon/menu/action/createWidget0.svg'); }
.icon.clipboard { background-image: url('~img/icon/menu/action/clipboard0.svg'); }
.icon.image { background-image: url('~img/icon/menu/action/image0.svg'); }
.icon.coverChange { background-image: url('~img/icon/cover/change.svg'); }
.icon.coverPosition { background-image: url('~img/icon/cover/position.svg'); }

View file

@ -157,7 +157,6 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
getView: this.getView,
getTarget: this.getTarget,
getSources: this.getSources,
getRecord: this.getRecord,
getRecords: this.getRecords,
getKeys: this.getKeys,
getIdPrefix: this.getIdPrefix,
@ -475,7 +474,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
return this.applyObjectOrder('', UtilCommon.objectCopy(records));
};
getRecord (recordId: string) {
getRecord (id: string) {
const view = this.getView();
if (!view) {
return {};
@ -483,7 +482,7 @@ const BlockDataview = observer(class BlockDataview extends React.Component<Props
const keys = this.getKeys(view.id);
const subId = this.getSubId();
const item = detailStore.get(subId, recordId, keys);
const item = detailStore.get(subId, id, keys);
const { layout, isReadonly, isDeleted, snippet } = item;
if (item.name == translate('defaultNamePage')) {

View file

@ -12,8 +12,7 @@ const CellCheckbox = observer(class CellCheckbox extends React.Component<I.Cell>
};
render () {
const { recordId, getRecord, withLabel, withName, relation } = this.props;
const record = getRecord(recordId);
const { withLabel, withName, relation, record } = this.props;
if (!record) {
return null;
@ -43,8 +42,7 @@ const CellCheckbox = observer(class CellCheckbox extends React.Component<I.Cell>
};
getValue () {
const { relation, getRecord, recordId } = this.props;
const record = getRecord(recordId);
const { relation, record } = this.props;
return Boolean(record[relation.relationKey]);
};

View file

@ -22,8 +22,7 @@ const CellFile = observer(class CellFile extends React.Component<I.Cell, State>
};
render () {
const { subId, relation, recordId, getRecord, iconSize, placeholder, elementMapper, arrayLimit } = this.props;
const record = getRecord(recordId);
const { subId, relation, record, iconSize, placeholder, elementMapper, arrayLimit } = this.props;
if (!record) {
return null;

View file

@ -40,17 +40,15 @@ const Cell = observer(class Cell extends React.Component<Props> {
};
render () {
const { elementId, relationKey, recordId, onClick, idPrefix, getRecord } = this.props;
const { elementId, relationKey, record, onClick, idPrefix } = this.props;
const relation = this.getRelation();
const record = getRecord(recordId);
if (!relation || !record) {
return null;
};
const id = Relation.cellId(idPrefix, relation.relationKey, recordId);
const id = Relation.cellId(idPrefix, relation.relationKey, record.id);
const canEdit = this.canCellEdit();
const cn = [
'cellContent',
'c-' + relation.relationKey,
@ -135,9 +133,8 @@ const Cell = observer(class Cell extends React.Component<Props> {
};
checkValue (): boolean {
const { recordId, getRecord } = this.props;
const { record } = this.props;
const relation = this.getRelation();
const record = getRecord(recordId);
if (relation.relationKey == 'name') {
return true;
@ -149,16 +146,15 @@ const Cell = observer(class Cell extends React.Component<Props> {
onClick (e: any) {
e.stopPropagation();
const { rootId, subId, block, recordId, getRecord, maxWidth, menuClassName, menuClassNameWrap, idPrefix, pageContainer, cellPosition, placeholder } = this.props;
const { rootId, subId, block, maxWidth, menuClassName, menuClassNameWrap, idPrefix, pageContainer, cellPosition, placeholder } = this.props;
const relation = this.getRelation();
const record = getRecord(recordId);
if (!relation || !record) {
return;
};
const { config } = commonStore;
const cellId = Relation.cellId(idPrefix, relation.relationKey, recordId);
const cellId = Relation.cellId(idPrefix, relation.relationKey, record.id);
const value = record[relation.relationKey] || '';
if (!this.canCellEdit()) {
@ -441,7 +437,7 @@ const Cell = observer(class Cell extends React.Component<Props> {
};
onChange (value: any, callBack?: (message: any) => void) {
const { onCellChange, recordId } = this.props;
const { onCellChange, record } = this.props;
const relation = this.getRelation();
if (!relation) {
@ -450,14 +446,14 @@ const Cell = observer(class Cell extends React.Component<Props> {
value = Relation.formatValue(relation, value, true);
if (onCellChange) {
onCellChange(recordId, relation.relationKey, value, callBack);
onCellChange(record.id, relation.relationKey, value, callBack);
};
};
onMouseEnter (e: any) {
const { onMouseEnter, showTooltip, tooltipX, tooltipY, idPrefix, recordId, withName } = this.props;
const { onMouseEnter, showTooltip, tooltipX, tooltipY, idPrefix, record, withName } = this.props;
const relation = this.getRelation();
const cell = $(`#${Relation.cellId(idPrefix, relation.relationKey, recordId)}`);
const cell = $(`#${Relation.cellId(idPrefix, relation.relationKey, record.id)}`);
if (onMouseEnter) {
onMouseEnter(e);
@ -485,14 +481,13 @@ const Cell = observer(class Cell extends React.Component<Props> {
};
canCellEdit (): boolean {
const { readonly, getRecord, recordId } = this.props;
const { readonly, record } = this.props;
if (readonly) {
return false;
};
const relation = this.getRelation();
const record = getRecord(recordId);
if (!relation || !record || relation.isReadonlyValue || record.isReadonly) {
return false;

View file

@ -40,8 +40,7 @@ const CellObject = observer(class CellObject extends React.Component<I.Cell, Sta
render () {
const { isEditing } = this.state;
const { getRecord, recordId, relation, iconSize, elementMapper, arrayLimit, readonly } = this.props;
const record = getRecord(recordId);
const { record, relation, iconSize, elementMapper, arrayLimit, readonly } = this.props;
const cn = [ 'wrap' ];
if (!relation || !record) {
@ -216,8 +215,7 @@ const CellObject = observer(class CellObject extends React.Component<I.Cell, Sta
};
getItems (): any[] {
const { relation, getRecord, recordId, subId } = this.props;
const record = getRecord(recordId);
const { relation, record, subId } = this.props;
if (!relation || !record) {
return [];

View file

@ -36,9 +36,8 @@ const CellSelect = observer(class CellSelect extends React.Component<I.Cell, Sta
};
render () {
const { relation, getRecord, recordId, elementMapper, arrayLimit } = this.props;
const { relation, record, elementMapper, arrayLimit } = this.props;
const { isEditing } = this.state;
const record = getRecord(recordId);
const placeholder = this.props.placeholder || translate(`placeholderCell${relation.format}`);
const isSelect = relation.format == I.RelationType.Select;
const cn = [ 'wrap' ];
@ -344,11 +343,14 @@ const CellSelect = observer(class CellSelect extends React.Component<I.Cell, Sta
};
getItems (): any[] {
const { relation, getRecord, recordId } = this.props;
const record = getRecord(recordId);
const { relation, record } = this.props;
if (!relation || !record) {
return [];
};
let items = record && relation ? Relation.getOptions(record[relation.relationKey]) : [];
items.filter(it => it && !it._empty_ && !it.isArchived && !it.isDeleted);
items = items.filter(it => it && !it._empty_ && !it.isArchived && !it.isDeleted);
return items;
};

View file

@ -41,8 +41,7 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
render () {
const { isEditing } = this.state;
const { showRelativeDates } = commonStore;
const { recordId, relation, getView, getRecord, textLimit, isInline, iconSize, placeholder, shortUrl, canEdit } = this.props;
const record = getRecord(recordId);
const { record, relation, getView, textLimit, isInline, iconSize, placeholder, shortUrl, canEdit } = this.props;
if (!record || !relation) {
return null;
@ -230,8 +229,7 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
};
componentDidMount () {
const { relation, recordId, getRecord } = this.props;
const record = getRecord(recordId);
const { relation, record } = this.props;
this._isMounted = true;
this.setValue(Relation.formatValue(relation, record[relation.relationKey], true));
@ -239,9 +237,8 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
componentDidUpdate () {
const { isEditing } = this.state;
const { id, relation, recordId, viewType, cellPosition, getView, getRecord } = this.props;
const { id, relation, viewType, record, cellPosition, getView } = this.props;
const cell = $(`#${id}`);
const record = getRecord(recordId);
this.setValue(Relation.formatValue(relation, record[relation.relationKey], true));
@ -255,7 +252,7 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
};
if (viewType != I.ViewType.Grid) {
card = $(`#record-${recordId}`);
card = $(`#record-${record.id}`);
};
if (isEditing) {
@ -394,8 +391,7 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
};
onBlur (e: any) {
const { relation, onChange, recordId, getRecord } = this.props;
const record = getRecord(recordId);
const { relation, record, onChange } = this.props;
if (!this.ref || keyboard.isBlurDisabled || !record) {
return;
@ -438,18 +434,17 @@ const CellText = observer(class CellText extends React.Component<I.Cell, State>
};
onIconSelect (icon: string) {
UtilObject.setIcon(this.props.recordId, icon, '');
UtilObject.setIcon(this.props.record.id, icon, '');
};
onIconUpload (objectId: string) {
UtilObject.setIcon(this.props.recordId, '', objectId);
UtilObject.setIcon(this.props.record.id, '', objectId);
};
onCheckbox () {
const { recordId, getRecord } = this.props;
const record = getRecord(recordId);
const { record } = this.props;
UtilObject.setDone(recordId, !record.done, () => {
UtilObject.setDone(record.id, !record.done, () => {
if (this._isMounted) {
this.forceUpdate();
};

View file

@ -7,7 +7,6 @@ import { Cell } from 'Component';
interface Props extends I.ViewComponent {
id: string;
groupId: string;
recordId: string;
onDragStartCard?: (e: any, groupId: any, record: any) => void;
};
@ -17,7 +16,7 @@ const Card = observer(class Card extends React.Component<Props> {
node: any = null;
render () {
const { rootId, block, groupId, id, recordId, getView, onContext, onRef, onDragStartCard, getIdPrefix, isInline, getVisibleRelations } = this.props;
const { rootId, block, groupId, id, getView, onContext, onRef, onDragStartCard, getIdPrefix, isInline, getVisibleRelations } = this.props;
const view = getView();
const relations = getVisibleRelations();
const idPrefix = getIdPrefix();
@ -29,13 +28,13 @@ const Card = observer(class Card extends React.Component<Props> {
let content = (
<div className="cardContent">
{relations.map((relation: any, i: number) => {
const id = Relation.cellId(idPrefix, relation.relationKey, recordId);
const id = Relation.cellId(idPrefix, relation.relationKey, record.id);
return (
<Cell
elementId={id}
key={'board-cell-' + view.id + relation.relationKey}
{...this.props}
getRecord={() => record}
record={record}
subId={subId}
ref={ref => onRef(ref, Relation.cellId(idPrefix, relation.relationKey, record.id))}
relationKey={relation.relationKey}
@ -119,7 +118,7 @@ const Card = observer(class Card extends React.Component<Props> {
};
onCellClick (e: React.MouseEvent, vr: I.ViewRelation) {
const { onCellClick, recordId } = this.props;
const { onCellClick, record } = this.props;
const relation = dbStore.getRelationByKey(vr.relationKey);
if (!relation || ![ I.RelationType.Url, I.RelationType.Phone, I.RelationType.Email, I.RelationType.Checkbox ].includes(relation.format)) {
@ -129,7 +128,7 @@ const Card = observer(class Card extends React.Component<Props> {
e.preventDefault();
e.stopPropagation();
onCellClick(e, relation.relationKey, recordId);
onCellClick(e, relation.relationKey, record.id);
};
resize () {

View file

@ -83,8 +83,7 @@ const Column = observer(class Column extends React.Component<Props> {
block={block}
relationKey={view.groupRelationKey}
viewType={I.ViewType.Board}
getRecord={() => head}
recordId=""
record={head}
readonly={true}
arrayLimit={4}
withName={true}
@ -109,7 +108,7 @@ const Column = observer(class Column extends React.Component<Props> {
{...this.props}
id={item.id}
groupId={id}
recordId={item.id}
record={item}
/>
))}

View file

@ -81,9 +81,16 @@ const ViewGallery = observer(class ViewGallery extends React.Component<I.ViewCom
const row = (id: string) => {
if (id == 'add-record') {
return <CardAdd key={'gallery-card-' + view.id + id} />;
return <CardAdd key={`gallery-card-${view.id + id}`} />;
} else {
return <Card key={'gallery-card-' + view.id + id} {...this.props} recordId={id} getCoverObject={this.getCoverObject} />;
return (
<Card
key={`gallery-card-${view.id + id}`}
{...this.props}
record={detailStore.get(subId, id, getKeys(view.id))}
getCoverObject={this.getCoverObject}
/>
);
};
};
@ -305,7 +312,7 @@ const ViewGallery = observer(class ViewGallery extends React.Component<I.ViewCom
};
getCoverObject (id: string): any {
const { rootId, block, getView, getRecord } = this.props;
const { rootId, block, getView, getKeys } = this.props;
const view = getView();
if (!view.coverRelationKey) {
@ -313,7 +320,7 @@ const ViewGallery = observer(class ViewGallery extends React.Component<I.ViewCom
};
const subId = dbStore.getSubId(rootId, block.id);
const record = getRecord(id);
const record = detailStore.get(subId, id, getKeys(view.id));
const value = Relation.getArrayValue(record[view.coverRelationKey]);
const fileLayouts = UtilObject.getFileLayouts();

View file

@ -1,13 +1,11 @@
import * as React from 'react';
import $ from 'jquery';
import { observer } from 'mobx-react';
import { Cell, Cover, Icon, MediaAudio, MediaVideo, DropTarget } from 'Component';
import { Cell, Cover, MediaAudio, MediaVideo, DropTarget } from 'Component';
import { I, UtilCommon, UtilData, UtilObject, Relation, keyboard } from 'Lib';
import { commonStore, detailStore, dbStore } from 'Store';
import Constant from 'json/constant.json';
import { commonStore, dbStore } from 'Store';
interface Props extends I.ViewComponent {
recordId: string;
style?: any;
};
@ -24,12 +22,11 @@ const Card = observer(class Card extends React.Component<Props> {
};
render () {
const { rootId, block, recordId, getView, getRecord, onRef, style, onContext, getIdPrefix, getVisibleRelations, isInline, isCollection } = this.props;
const { rootId, block, record, getView, onRef, style, onContext, getIdPrefix, getVisibleRelations, isInline, isCollection } = this.props;
const view = getView();
const { cardSize, coverFit, hideIcon } = view;
const relations = getVisibleRelations();
const idPrefix = getIdPrefix();
const record = getRecord(recordId);
const cn = [ 'card', UtilData.layoutClass(record.id, record.layout), UtilData.cardSizeClass(cardSize) ];
const subId = dbStore.getSubId(rootId, block.id);
const cover = this.getCover();
@ -48,7 +45,7 @@ const Card = observer(class Card extends React.Component<Props> {
<div className="inner">
{relations.map(relation => {
const id = Relation.cellId(idPrefix, relation.relationKey, recordId);
const id = Relation.cellId(idPrefix, relation.relationKey, record.id);
return (
<Cell
elementId={id}
@ -137,19 +134,18 @@ const Card = observer(class Card extends React.Component<Props> {
};
onDragStart (e: any) {
const { isCollection, recordId, onDragRecordStart } = this.props;
const { isCollection, record, onDragRecordStart } = this.props;
if (isCollection) {
onDragRecordStart(e, recordId);
onDragRecordStart(e, record.id);
};
};
onClick (e: any) {
e.preventDefault();
const { recordId, getRecord, onContext, dataset } = this.props;
const { record, onContext, dataset } = this.props;
const { selection } = dataset || {};
const record = getRecord(recordId);
const cb = {
0: () => {
keyboard.withCommand(e) ? UtilObject.openWindow(record) : UtilObject.openPopup(record);
@ -168,7 +164,7 @@ const Card = observer(class Card extends React.Component<Props> {
};
onCellClick (e: React.MouseEvent, vr: I.ViewRelation) {
const { onCellClick, recordId } = this.props;
const { onCellClick, record } = this.props;
const relation = dbStore.getRelationByKey(vr.relationKey);
if (!relation || ![ I.RelationType.Url, I.RelationType.Phone, I.RelationType.Email, I.RelationType.Checkbox ].includes(relation.format)) {
@ -178,12 +174,12 @@ const Card = observer(class Card extends React.Component<Props> {
e.preventDefault();
e.stopPropagation();
onCellClick(e, relation.relationKey, recordId);
onCellClick(e, relation.relationKey, record.id);
};
getCover (): any {
const { recordId, getCoverObject } = this.props;
const cover = getCoverObject(recordId);
const { record, getCoverObject } = this.props;
const cover = getCoverObject(record.id);
return cover ? this.mediaCover(cover) : null;
};

View file

@ -5,7 +5,7 @@ import arrayMove from 'array-move';
import $ from 'jquery';
import { Icon, LoadMore } from 'Component';
import { I, C, UtilCommon, translate, keyboard, Relation } from 'Lib';
import { dbStore, menuStore, blockStore } from 'Store';
import { dbStore, menuStore, blockStore, detailStore } from 'Store';
import HeadRow from './grid/head/row';
import BodyRow from './grid/body/row';
import Constant from 'json/constant.json';
@ -31,9 +31,10 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
};
render () {
const { rootId, block, isPopup, isInline, className, getView, onRecordAdd, getEmpty, getRecords, getLimit, getVisibleRelations } = this.props;
const { rootId, block, isPopup, isInline, className, getView, getKeys, onRecordAdd, getEmpty, getRecords, getLimit, getVisibleRelations } = this.props;
const view = getView();
const relations = getVisibleRelations();
const subId = dbStore.getSubId(rootId, block.id);
const records = getRecords();
const { offset, total } = dbStore.getMeta(dbStore.getSubId(rootId, block.id), '');
const limit = getLimit();
@ -55,7 +56,7 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
key={'grid-row-' + view.id + index}
{...this.props}
readonly={!isAllowedObject}
recordId={id}
record={detailStore.get(subId, records[index], getKeys(view.id))}
cellPosition={this.cellPosition}
getColumnWidths={this.getColumnWidths}
/>
@ -89,7 +90,7 @@ const ViewGrid = observer(class ViewGrid extends React.Component<I.ViewComponent
key={'grid-row-' + view.id + index}
{...this.props}
readonly={!isAllowedObject}
recordId={records[index]}
record={detailStore.get(subId, records[index], getKeys(view.id))}
style={{ ...style, top: style.top + 2 }}
cellPosition={this.cellPosition}
getColumnWidths={this.getColumnWidths}

View file

@ -6,14 +6,13 @@ import { dbStore } from 'Store';
import Constant from 'json/constant.json';
interface Props {
record?: any;
rootId?: string;
block?: I.Block;
recordId: string;
relationKey: string;
readonly: boolean;
width: number;
className?: string;
getRecord(id: string): any;
getIdPrefix?(): string;
onRef?(ref: any, id: string): void;
onCellClick?(e: any, key: string, id?: string): void;
@ -32,16 +31,15 @@ const BodyCell = observer(class BodyCell extends React.Component<Props> {
};
render () {
const { rootId, block, className, relationKey, recordId, readonly, onRef, getRecord, onCellClick, onCellChange, getIdPrefix, canCellEdit } = this.props;
const { rootId, block, className, relationKey, readonly, record, onRef, onCellClick, onCellChange, getIdPrefix, canCellEdit } = this.props;
const relation: any = dbStore.getRelationByKey(relationKey) || {};
const cn = [ 'cell', `cell-key-${this.props.relationKey}`, Relation.className(relation.format), (!readonly ? 'canEdit' : '') ];
const idPrefix = getIdPrefix();
const id = Relation.cellId(idPrefix, relation.relationKey, recordId);
const id = Relation.cellId(idPrefix, relation.relationKey, record.id);
const width = Relation.width(this.props.width, relation.format);
const size = Constant.size.dataview.cell;
const subId = dbStore.getSubId(rootId, block.id);
const record = getRecord(recordId);
const canEdit = canCellEdit(relation.relationKey, recordId);
const canEdit = canCellEdit(relation.relationKey, record.id);
if (relation.relationKey == 'name') {
cn.push('isName');
@ -65,7 +63,7 @@ const BodyCell = observer(class BodyCell extends React.Component<Props> {
key={id}
id={id}
className={cn.join(' ')}
onClick={e => onCellClick(e, relation.relationKey, recordId)}
onClick={e => onCellClick(e, relation.relationKey, record.id)}
>
<Cell
ref={ref => {

View file

@ -5,7 +5,6 @@ import { DropTarget, Icon } from 'Component';
import Cell from './cell';
interface Props extends I.ViewComponent {
recordId: string;
style?: any;
cellPosition?: (cellId: string) => void;
onRef?(ref: any, id: string): void;
@ -15,9 +14,8 @@ interface Props extends I.ViewComponent {
const BodyRow = observer(class BodyRow extends React.Component<Props> {
render () {
const { rootId, recordId, block, getRecord, style, onContext, onDragRecordStart, getColumnWidths, isInline, getVisibleRelations, isCollection, onSelectToggle } = this.props;
const { rootId, record, block, style, onContext, onDragRecordStart, getColumnWidths, isInline, getVisibleRelations, isCollection, onSelectToggle } = this.props;
const relations = getVisibleRelations();
const record = getRecord(recordId);
const widths = getColumnWidths('', 0);
const str = relations.map(it => widths[it.relationKey] + 'px').concat([ 'auto' ]).join(' ');
const cn = [ 'row', UtilData.layoutClass('', record.layout), ];
@ -73,7 +71,7 @@ const BodyRow = observer(class BodyRow extends React.Component<Props> {
className="drag"
draggable={true}
onClick={e => onSelectToggle(e, record.id)}
onDragStart={e => onDragRecordStart(e, recordId)}
onDragStart={e => onDragRecordStart(e, record.id)}
onMouseEnter={() => keyboard.setSelectionClearDisabled(true)}
onMouseLeave={() => keyboard.setSelectionClearDisabled(false)}
/>
@ -86,7 +84,7 @@ const BodyRow = observer(class BodyRow extends React.Component<Props> {
return (
<div
id={`record-${recordId}`}
id={`record-${record.id}`}
className={cn.join(' ')}
style={style}
onContextMenu={e => onContext(e, record.id)}

View file

@ -2,7 +2,7 @@ import * as React from 'react';
import $ from 'jquery';
import { observer } from 'mobx-react';
import { AutoSizer, WindowScroller, List, InfiniteLoader } from 'react-virtualized';
import { dbStore } from 'Store';
import { dbStore, detailStore } from 'Store';
import { Icon, LoadMore } from 'Component';
import { I, translate, UtilCommon } from 'Lib';
import Row from './list/row';
@ -21,10 +21,11 @@ const ViewList = observer(class ViewList extends React.Component<I.ViewComponent
};
render () {
const { rootId, block, className, isPopup, isInline, getView, onRecordAdd, getLimit, getEmpty, getRecords } = this.props;
const { rootId, block, className, isPopup, isInline, getView, getKeys, onRecordAdd, getLimit, getEmpty, getRecords } = this.props;
const view = getView();
const records = getRecords();
const { offset, total } = dbStore.getMeta(dbStore.getSubId(rootId, block.id), '');
const subId = dbStore.getSubId(rootId, block.id);
const { offset, total } = dbStore.getMeta(subId, '');
const limit = getLimit();
const length = records.length;
const isAllowedObject = this.props.isAllowedObject();
@ -45,7 +46,7 @@ const ViewList = observer(class ViewList extends React.Component<I.ViewComponent
{...this.props}
style={{height: HEIGHT}}
readonly={!isAllowedObject}
recordId={id}
record={detailStore.get(subId, id)}
/>
))}
</div>
@ -74,10 +75,10 @@ const ViewList = observer(class ViewList extends React.Component<I.ViewComponent
rowHeight={HEIGHT}
onRowsRendered={onRowsRendered}
rowRenderer={({ key, index, style }) => (
<div className="listItem" key={'grid-row-' + view.id + index} style={style}>
<div className="listItem" key={`grid-row-${view.id + index}`} style={style}>
<Row
{...this.props}
recordId={records[index]}
record={detailStore.get(subId, records[index], getKeys(view.id))}
/>
</div>
)}

View file

@ -6,7 +6,6 @@ import { Cell, DropTarget, Icon } from 'Component';
import { dbStore } from 'Store';
interface Props extends I.ViewComponent {
recordId: string;
style?: any;
};
@ -16,12 +15,11 @@ const Row = observer(class Row extends React.Component<Props> {
node: any = null;
render () {
const { rootId, block, recordId, getView, onRef, style, getRecord, onContext, getIdPrefix, isInline, isCollection, onDragRecordStart, onSelectToggle } = this.props;
const { rootId, block, record, getView, onRef, style, onContext, getIdPrefix, isInline, isCollection, onDragRecordStart, onSelectToggle } = this.props;
const view = getView();
const relations = view.getVisibleRelations();
const idPrefix = getIdPrefix();
const subId = dbStore.getSubId(rootId, block.id);
const record = getRecord(recordId);
const cn = [ 'row' ];
// Subscriptions
@ -35,7 +33,7 @@ const Row = observer(class Row extends React.Component<Props> {
let content = (
<React.Fragment>
{relations.map((relation: any, i: number) => {
const id = Relation.cellId(idPrefix, relation.relationKey, recordId);
const id = Relation.cellId(idPrefix, relation.relationKey, record.id);
return (
<Cell
key={'list-cell-' + relation.relationKey}
@ -77,7 +75,7 @@ const Row = observer(class Row extends React.Component<Props> {
className="drag"
draggable={true}
onClick={e => onSelectToggle(e, record.id)}
onDragStart={e => onDragRecordStart(e, recordId)}
onDragStart={e => onDragRecordStart(e, record.id)}
onMouseEnter={() => keyboard.setSelectionClearDisabled(true)}
onMouseLeave={() => keyboard.setSelectionClearDisabled(false)}
/>
@ -118,9 +116,8 @@ const Row = observer(class Row extends React.Component<Props> {
onClick (e: any) {
e.preventDefault();
const { onContext, dataset, getRecord, recordId } = this.props;
const { onContext, dataset, record } = this.props;
const { selection } = dataset || {};
const record = getRecord(recordId);
const cb = {
0: () => {
keyboard.withCommand(e) ? UtilObject.openWindow(record) : UtilObject.openPopup(record);
@ -139,7 +136,7 @@ const Row = observer(class Row extends React.Component<Props> {
};
onCellClick (e: React.MouseEvent, vr: I.ViewRelation) {
const { onCellClick, recordId } = this.props;
const { onCellClick, record } = this.props;
const relation = dbStore.getRelationByKey(vr.relationKey);
if (!relation || ![ I.RelationType.Url, I.RelationType.Phone, I.RelationType.Email, I.RelationType.Checkbox ].includes(relation.format)) {
@ -149,7 +146,7 @@ const Row = observer(class Row extends React.Component<Props> {
e.preventDefault();
e.stopPropagation();
onCellClick(e, relation.relationKey, recordId);
onCellClick(e, relation.relationKey, record.id);
};
resize () {

View file

@ -194,8 +194,7 @@ const BlockFeatured = observer(class BlockFeatured extends React.Component<Props
subId={rootId}
block={block}
relationKey={relationKey}
getRecord={() => object}
recordId={object.id}
record={object}
viewType={I.ViewType.Grid}
pageContainer={UtilCommon.getCellContainer(isPopup ? 'popup' : 'page')}
iconSize={relation.format == I.RelationType.Object ? 20 : iconSize}

View file

@ -72,8 +72,7 @@ const BlockRelation = observer(class BlockRelation extends React.Component<I.Blo
subId={rootId}
block={block}
relationKey={relation.relationKey}
getRecord={() => detailStore.get(rootId, rootId, [ relation.relationKey ], true)}
recordId={rootId}
record={detailStore.get(rootId, rootId, [ relation.relationKey ], true)}
viewType={I.ViewType.Grid}
readonly={readonly || !allowedValue}
idPrefix={idPrefix}

View file

@ -125,8 +125,7 @@ const ListObject = observer(class ListObject extends React.Component<Props> {
subId={subId}
block={null}
relationKey={column.relationKey}
getRecord={() => item}
recordId={item.id}
record={item}
viewType={I.ViewType.Grid}
idPrefix={PREFIX}
iconSize={20}

View file

@ -83,8 +83,7 @@ const MenuBlockAdd = observer(class MenuBlockAdd extends React.Component<I.Menu>
subId={rootId}
block={block}
relationKey={item.relationKey}
getRecord={() => detailStore.get(rootId, rootId, [ item.relationKey ])}
recordId={rootId}
record={detailStore.get(rootId, rootId, [ item.relationKey ])}
viewType={I.ViewType.Grid}
idPrefix={idPrefix}
menuClassName="fromBlock"

View file

@ -73,8 +73,7 @@ const MenuGroupList = observer(class MenuGroupList extends React.Component<I.Men
block={block}
relationKey={view.groupRelationKey}
viewType={I.ViewType.Board}
getRecord={() => head}
recordId=""
record={head}
readonly={true}
arrayLimit={4}
withName={true}

View file

@ -91,8 +91,7 @@ const MenuItemRelationView = observer(class MenuItemRelationView extends React.C
subId={rootId}
block={block}
relationKey={relationKey}
getRecord={() => object}
recordId=""
record={object}
viewType={I.ViewType.Grid}
idPrefix={PREFIX}
menuClassName="fromBlock"

View file

@ -90,13 +90,8 @@ const FontSize = {
128: 72,
};
const File = {};
const Relation: any = { small: {}, big: {} };
for (const key of [ 'other', 'image', 'video', 'text', 'archive', 'audio', 'pdf', 'presentation', 'table' ]) {
File[key] = require(`img/icon/file/${key}.svg`).default;
};
for (const i in I.RelationType) {
const it = Number(i);
@ -252,7 +247,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
icon = <img src={commonStore.imageUrl(id, iconSize * 2)} className={icn.join(' ')} />;
} else {
icn = icn.concat([ 'iconFile', 'c' + iconSize ]);
icon = <img src={File[UtilFile.icon(object)]} className={icn.join(' ')} />;
icon = <img src={UtilFile.iconImage(object)} className={icn.join(' ')} />;
};
break;
};
@ -267,7 +262,7 @@ const IconObject = observer(class IconObject extends React.Component<Props> {
case I.ObjectLayout.File: {
icn = icn.concat([ 'iconFile', 'c' + iconSize ]);
icon = <img src={File[UtilFile.icon(object)]} className={icn.join(' ')} />;
icon = <img src={UtilFile.iconImage(object)} className={icn.join(' ')} />;
break;
};

View file

@ -3,7 +3,6 @@ import $ from 'jquery';
import { I, UtilCommon } from 'Lib';
import { commonStore } from 'Store';
import { observer } from 'mobx-react';
import Constant from 'json/constant.json';
interface Props {

View file

@ -112,10 +112,10 @@ export interface ViewComponent {
isCollection?: boolean;
className?: string;
refCells?: any;
record?: any;
onRef?(ref: any, id: string): void;
loadData(viewId: string, offset: number, clear: boolean, callBack?: (message: any) => void): void;
getRecords?(): string[];
getRecord(id: string): any;
getCoverObject?(id: string): any;
getView?(): View;
getSources?(): string[];
@ -190,7 +190,6 @@ export interface Cell {
idPrefix?: string;
relation?: any;
relationKey?: string;
recordId: string;
viewType: I.ViewType;
readonly?: boolean;
canOpen?: boolean;
@ -206,8 +205,8 @@ export interface Cell {
shortUrl?: boolean;
menuClassName?: string;
menuClassNameWrap?: string;
record?: any;
getView?(): View;
getRecord(id: string): any;
onChange?(value: any, callBack?: (message: any) => void): void;
onClick?(e: any): void;
onMouseEnter?(e: any): void;

View file

@ -1,5 +1,6 @@
import loadImage from 'blueimp-load-image';
import { UtilCommon, Relation } from 'Lib';
import { commonStore } from 'Store';
import Constant from 'json/constant.json';
const SIZE_UNIT = 1024;
@ -108,6 +109,16 @@ class UtilFile {
return icon;
};
iconPath (object: any) {
const tp = commonStore.getThemePath();
return `img/${tp}icon/file/${this.icon(object)}.svg`;
};
iconImage (object: any): string {
const tp = commonStore.getThemePath();
return require(`img/${tp}icon/file/${this.icon(object)}.svg`).default;
};
loadPreviewCanvas (file: any, param: any, success?: (canvas: any) => void) {
if (!file) {
return;

View file

@ -20,7 +20,7 @@ class UtilGraph {
};
case I.ObjectLayout.File: {
src = `img/icon/file/${UtilFile.icon(d)}.svg`;
src = UtilFile.iconPath(d);
break;
};
@ -28,7 +28,7 @@ class UtilGraph {
if (d.id) {
src = commonStore.imageUrl(d.id, 100);
} else {
src = `img/icon/file/${UtilFile.icon(d)}.svg`;
src = UtilFile.iconPath(d);
};
break;
};

View file

@ -374,13 +374,18 @@ class CommonStore {
Renderer.send('setBackground', c);
head.find('#link-prism').remove();
if (c == 'dark') {
if (c) {
head.append(`<link id="link-prism" rel="stylesheet" href="./css/theme/${c}/prism.css" />`);
};
$(window).trigger('updateTheme');
};
getThemePath () {
const c = this.getThemeClass();
return c ? `theme/${c}/` : '';
};
nativeThemeSet (isDark: boolean) {
this.nativeThemeIsDark = isDark;
};