mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-03 22:22:54 +00:00
Compare commits
4 Commits
0eec3753b4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ee08910abf | |||
| 9437f25d04 | |||
| 361921cf34 | |||
| 9c16455eae |
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
gtag('config', 'G-S982VZS08T', {
|
gtag('config', 'G-S982VZS08T', {
|
||||||
send_page_view: false,
|
send_page_view: false,
|
||||||
theme: localStorage.getItem('theme') || 'default',
|
theme: localStorage.getItem('theme') || 'default',
|
||||||
version: localStorage.getItem('schema_version') || '1.21.9',
|
version: localStorage.getItem('schema_version') || '26.1',
|
||||||
locale: localStorage.getItem('language') || 'en',
|
locale: localStorage.getItem('language') || 'en',
|
||||||
prefers_color_scheme: matchMedia('(prefers-color-scheme: light)').matches ? 'light' : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'none',
|
prefers_color_scheme: matchMedia('(prefers-color-scheme: light)').matches ? 'light' : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'none',
|
||||||
tree_view_mode: localStorage.getItem('misode_tree_view_mode') || 'default',
|
tree_view_mode: localStorage.getItem('misode_tree_view_mode') || 'default',
|
||||||
|
|||||||
Generated
+7
-6
@@ -3044,15 +3044,16 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.9",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
},
|
},
|
||||||
@@ -7267,9 +7268,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.15.9",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="
|
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw=="
|
||||||
},
|
},
|
||||||
"fraction.js": {
|
"fraction.js": {
|
||||||
"version": "4.3.6",
|
"version": "4.3.6",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const STRUCTURE = <svg width="28" height="22" viewBox="0 0 28 22" fill="none" xm
|
|||||||
export const Icons = {
|
export const Icons = {
|
||||||
home: <svg width="32" height="28" viewBox="0 0 32 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="6" rx="3" fill="#7CB45C"/><rect x="8" width="18" height="6" rx="3" fill="#4BA041"/><rect y="11" width="32" height="6" rx="3" fill="#AAA8A8"/><rect x="11" y="11" width="21" height="6" rx="3" fill="#91908F"/><rect x="11" y="22" width="21" height="6" rx="3" fill="#70B5C3"/><rect x="17" y="22" width="15" height="6" rx="3" fill="#4D989B"/></svg>,
|
home: <svg width="32" height="28" viewBox="0 0 32 28" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="26" height="6" rx="3" fill="#7CB45C"/><rect x="8" width="18" height="6" rx="3" fill="#4BA041"/><rect y="11" width="32" height="6" rx="3" fill="#AAA8A8"/><rect x="11" y="11" width="21" height="6" rx="3" fill="#91908F"/><rect x="11" y="22" width="21" height="6" rx="3" fill="#70B5C3"/><rect x="17" y="22" width="15" height="6" rx="3" fill="#4D989B"/></svg>,
|
||||||
report: <svg width="30" height="36" viewBox="0 0 30 36" xmlns="http://www.w3.org/2000/svg"><path d="M0 16C0 13.7909 1.79086 12 4 12V12C6.20914 12 8 13.7909 8 16V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V16Z" fill="#6ACC5D"/><path d="M11 4C11 1.79086 12.7909 0 15 0V0C17.2091 0 19 1.79086 19 4V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V4Z" fill="#FF4C4C"/><path d="M22 10C22 7.79086 23.7909 6 26 6V6C28.2091 6 30 7.79086 30 10V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V10Z" fill="#E5B442"/><path d="M0 23C0 20.7909 1.79086 19 4 19V19C6.20914 19 8 20.7909 8 23V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V23Z" fill="#2BAD1D"/><path d="M11 15C11 12.7909 12.7909 11 15 11V11C17.2091 11 19 12.7909 19 15V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V15Z" fill="#C10B0B"/><path d="M22 19C22 16.7909 23.7909 15 26 15V15C28.2091 15 30 16.7909 30 19V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V19Z" fill="#CC8E00"/></svg>,
|
report: <svg width="30" height="36" viewBox="0 0 30 36" xmlns="http://www.w3.org/2000/svg"><path d="M0 16C0 13.7909 1.79086 12 4 12V12C6.20914 12 8 13.7909 8 16V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V16Z" fill="#6ACC5D"/><path d="M11 4C11 1.79086 12.7909 0 15 0V0C17.2091 0 19 1.79086 19 4V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V4Z" fill="#FF4C4C"/><path d="M22 10C22 7.79086 23.7909 6 26 6V6C28.2091 6 30 7.79086 30 10V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V10Z" fill="#E5B442"/><path d="M0 23C0 20.7909 1.79086 19 4 19V19C6.20914 19 8 20.7909 8 23V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V23Z" fill="#2BAD1D"/><path d="M11 15C11 12.7909 12.7909 11 15 11V11C17.2091 11 19 12.7909 19 15V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V15Z" fill="#C10B0B"/><path d="M22 19C22 16.7909 23.7909 15 26 15V15C28.2091 15 30 16.7909 30 19V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V19Z" fill="#CC8E00"/></svg>,
|
||||||
sounds: <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#451475"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 10C3.5 8.27609 4.18482 6.62279 5.40381 5.40381C6.62279 4.18482 8.27609 3.5 10 3.5C11.7239 3.5 13.3772 4.18482 14.5962 5.40381C15.8152 6.62279 16.5 8.27609 16.5 10C16.5 11.7239 15.8152 13.3772 14.5962 14.5962C13.3772 15.8152 11.7239 16.5 10 16.5C8.27609 16.5 6.62279 15.8152 5.40381 14.5962C4.18482 13.3772 3.5 11.7239 3.5 10V10ZM10 2C7.87827 2 5.84344 2.84285 4.34315 4.34315C2.84285 5.84344 2 7.87827 2 10C2 12.1217 2.84285 14.1566 4.34315 15.6569C5.84344 17.1571 7.87827 18 10 18C12.1217 18 14.1566 17.1571 15.6569 15.6569C17.1571 14.1566 18 12.1217 18 10C18 7.87827 17.1571 5.84344 15.6569 4.34315C14.1566 2.84285 12.1217 2 10 2V2ZM8.379 7.227C8.34101 7.20412 8.29762 7.19175 8.25327 7.19117C8.20892 7.19059 8.16522 7.20181 8.12664 7.2237C8.08807 7.24558 8.05601 7.27733 8.03375 7.3157C8.0115 7.35406 7.99985 7.39765 8 7.442V12.559C8.00003 12.6033 8.0118 12.6467 8.03413 12.685C8.05646 12.7232 8.08854 12.7548 8.12708 12.7765C8.16563 12.7983 8.20926 12.8095 8.25352 12.8088C8.29778 12.8082 8.34108 12.7958 8.379 12.773L12.643 10.214C12.6798 10.1917 12.7103 10.1604 12.7315 10.1229C12.7526 10.0854 12.7638 10.043 12.7638 10C12.7638 9.95695 12.7526 9.91463 12.7315 9.87714C12.7103 9.83965 12.6798 9.80825 12.643 9.786L8.379 7.227Z" fill="#C5A5E6"/></svg>,
|
sound_explorer: <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="10" fill="#451475"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 10C3.5 8.27609 4.18482 6.62279 5.40381 5.40381C6.62279 4.18482 8.27609 3.5 10 3.5C11.7239 3.5 13.3772 4.18482 14.5962 5.40381C15.8152 6.62279 16.5 8.27609 16.5 10C16.5 11.7239 15.8152 13.3772 14.5962 14.5962C13.3772 15.8152 11.7239 16.5 10 16.5C8.27609 16.5 6.62279 15.8152 5.40381 14.5962C4.18482 13.3772 3.5 11.7239 3.5 10V10ZM10 2C7.87827 2 5.84344 2.84285 4.34315 4.34315C2.84285 5.84344 2 7.87827 2 10C2 12.1217 2.84285 14.1566 4.34315 15.6569C5.84344 17.1571 7.87827 18 10 18C12.1217 18 14.1566 17.1571 15.6569 15.6569C17.1571 14.1566 18 12.1217 18 10C18 7.87827 17.1571 5.84344 15.6569 4.34315C14.1566 2.84285 12.1217 2 10 2V2ZM8.379 7.227C8.34101 7.20412 8.29762 7.19175 8.25327 7.19117C8.20892 7.19059 8.16522 7.20181 8.12664 7.2237C8.08807 7.24558 8.05601 7.27733 8.03375 7.3157C8.0115 7.35406 7.99985 7.39765 8 7.442V12.559C8.00003 12.6033 8.0118 12.6467 8.03413 12.685C8.05646 12.7232 8.08854 12.7548 8.12708 12.7765C8.16563 12.7983 8.20926 12.8095 8.25352 12.8088C8.29778 12.8082 8.34108 12.7958 8.379 12.773L12.643 10.214C12.6798 10.1917 12.7103 10.1604 12.7315 10.1229C12.7526 10.0854 12.7638 10.043 12.7638 10C12.7638 9.95695 12.7526 9.91463 12.7315 9.87714C12.7103 9.83965 12.6798 9.80825 12.643 9.786L8.379 7.227Z" fill="#C5A5E6"/></svg>,
|
||||||
customized: <svg width="28" height="29" viewBox="0 0 28 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 16.5V11" stroke="#4BA041" stroke-width="2"/><rect x="15" y="6" width="6" height="6" rx="2" fill="#4BA041"/><path d="M9 11.5V5" stroke="#4BA041" stroke-width="2"/><rect x="6" width="6" height="6" rx="2" fill="#4BA041"/><path d="M24 24H8C5.79086 24 4 22.2091 4 20V8.99999C6 8.5 8 8.49999 9.5 9.99999C10.5 11 11.5 12.9368 13 14.4368C13.9499 15.3867 15.6497 15.9119 17.5 16C19 16.0714 21.078 15.3978 22 14.9368C23 14.4368 26 14 28 14.4368V20C28 22.2091 26.2091 24 24 24Z" fill="#91908F"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 26.2968H22C22.5869 26.2968 23.1444 26.1704 23.6465 25.9433C23.0189 27.3311 21.6222 28.2968 20 28.2968H4C1.79086 28.2968 0 26.5059 0 24.2968V13.2968C0.673018 13.1285 1.34604 13.0169 2 13V22.2968C2 24.5059 3.79086 26.2968 6 26.2968Z" fill="#4D989B"/></svg>,
|
customized: <svg width="28" height="29" viewBox="0 0 28 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 16.5V11" stroke="#4BA041" stroke-width="2"/><rect x="15" y="6" width="6" height="6" rx="2" fill="#4BA041"/><path d="M9 11.5V5" stroke="#4BA041" stroke-width="2"/><rect x="6" width="6" height="6" rx="2" fill="#4BA041"/><path d="M24 24H8C5.79086 24 4 22.2091 4 20V8.99999C6 8.5 8 8.49999 9.5 9.99999C10.5 11 11.5 12.9368 13 14.4368C13.9499 15.3867 15.6497 15.9119 17.5 16C19 16.0714 21.078 15.3978 22 14.9368C23 14.4368 26 14 28 14.4368V20C28 22.2091 26.2091 24 24 24Z" fill="#91908F"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 26.2968H22C22.5869 26.2968 23.1444 26.1704 23.6465 25.9433C23.0189 27.3311 21.6222 28.2968 20 28.2968H4C1.79086 28.2968 0 26.5059 0 24.2968V13.2968C0.673018 13.1285 1.34604 13.0169 2 13V22.2968C2 24.5059 3.79086 26.2968 6 26.2968Z" fill="#4D989B"/></svg>,
|
||||||
convert: <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.55 35.4698C10.9312 35.8188 11.4355 36.0087 11.9565 35.9997C12.4775 35.9907 12.9746 35.7833 13.3431 35.4214C13.7115 35.0595 13.9226 34.5712 13.9318 34.0595C13.941 33.5477 13.7476 33.0525 13.3924 32.678L8.7802 28.1479H32.0823C32.6157 28.1479 33.1272 27.9398 33.5044 27.5693C33.8815 27.1989 34.0934 26.6964 34.0934 26.1725C34.0934 25.6486 33.8815 25.1462 33.5044 24.7757C33.1272 24.4053 32.6157 24.1972 32.0823 24.1972H8.7802L13.3924 19.667C13.7476 19.2926 13.941 18.7973 13.9318 18.2856C13.9226 17.7738 13.7115 17.2855 13.3431 16.9236C12.9746 16.5617 12.4775 16.3544 11.9565 16.3454C11.4355 16.3363 10.9312 16.5263 10.55 16.8752L2.50552 24.7766C2.12891 25.147 1.91737 25.6491 1.91737 26.1725C1.91737 26.696 2.12891 27.1981 2.50552 27.5684L10.55 35.4698Z" fill="#8012C5"/><path d="M25.46 20.5674C25.2758 20.7615 25.0538 20.9171 24.8071 21.0251C24.5604 21.1331 24.294 21.1912 24.024 21.1958C23.7539 21.2005 23.4857 21.1517 23.2352 21.0524C22.9848 20.953 22.7573 20.8051 22.5663 20.6175C22.3753 20.4299 22.2247 20.2065 22.1236 19.9605C22.0224 19.7145 21.9727 19.451 21.9775 19.1857C21.9823 18.9205 22.0414 18.6589 22.1513 18.4166C22.2612 18.1742 22.4197 17.9561 22.6173 17.7753L27.2299 13.2447H3.9256C3.39217 13.2447 2.88058 13.0366 2.50339 12.6661C2.1262 12.2956 1.91429 11.7931 1.91429 11.2692C1.91429 10.7452 2.1262 10.2427 2.50339 9.87225C2.88058 9.50176 3.39217 9.29363 3.9256 9.29363H27.2299L22.6173 4.76306C22.2621 4.38856 22.0686 3.89324 22.0778 3.38144C22.087 2.86964 22.2981 2.38133 22.6666 2.01937C23.0351 1.65742 23.5323 1.45009 24.0533 1.44106C24.5744 1.43203 25.0787 1.622 25.46 1.97096L33.5052 9.87312C33.8819 10.2435 34.0934 10.7456 34.0934 11.2692C34.0934 11.7927 33.8819 12.2948 33.5052 12.6652L25.46 20.5674Z" fill="#E5B442"/>
|
convert: <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.55 35.4698C10.9312 35.8188 11.4355 36.0087 11.9565 35.9997C12.4775 35.9907 12.9746 35.7833 13.3431 35.4214C13.7115 35.0595 13.9226 34.5712 13.9318 34.0595C13.941 33.5477 13.7476 33.0525 13.3924 32.678L8.7802 28.1479H32.0823C32.6157 28.1479 33.1272 27.9398 33.5044 27.5693C33.8815 27.1989 34.0934 26.6964 34.0934 26.1725C34.0934 25.6486 33.8815 25.1462 33.5044 24.7757C33.1272 24.4053 32.6157 24.1972 32.0823 24.1972H8.7802L13.3924 19.667C13.7476 19.2926 13.941 18.7973 13.9318 18.2856C13.9226 17.7738 13.7115 17.2855 13.3431 16.9236C12.9746 16.5617 12.4775 16.3544 11.9565 16.3454C11.4355 16.3363 10.9312 16.5263 10.55 16.8752L2.50552 24.7766C2.12891 25.147 1.91737 25.6491 1.91737 26.1725C1.91737 26.696 2.12891 27.1981 2.50552 27.5684L10.55 35.4698Z" fill="#8012C5"/><path d="M25.46 20.5674C25.2758 20.7615 25.0538 20.9171 24.8071 21.0251C24.5604 21.1331 24.294 21.1912 24.024 21.1958C23.7539 21.2005 23.4857 21.1517 23.2352 21.0524C22.9848 20.953 22.7573 20.8051 22.5663 20.6175C22.3753 20.4299 22.2247 20.2065 22.1236 19.9605C22.0224 19.7145 21.9727 19.451 21.9775 19.1857C21.9823 18.9205 22.0414 18.6589 22.1513 18.4166C22.2612 18.1742 22.4197 17.9561 22.6173 17.7753L27.2299 13.2447H3.9256C3.39217 13.2447 2.88058 13.0366 2.50339 12.6661C2.1262 12.2956 1.91429 11.7931 1.91429 11.2692C1.91429 10.7452 2.1262 10.2427 2.50339 9.87225C2.88058 9.50176 3.39217 9.29363 3.9256 9.29363H27.2299L22.6173 4.76306C22.2621 4.38856 22.0686 3.89324 22.0778 3.38144C22.087 2.86964 22.2981 2.38133 22.6666 2.01937C23.0351 1.65742 23.5323 1.45009 24.0533 1.44106C24.5744 1.43203 25.0787 1.622 25.46 1.97096L33.5052 9.87312C33.8819 10.2435 34.0934 10.7456 34.0934 11.2692C34.0934 11.7927 33.8819 12.2948 33.5052 12.6652L25.46 20.5674Z" fill="#E5B442"/>
|
||||||
</svg>,
|
</svg>,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function FileCreation({ docAndNode, gen, method }: Props) {
|
|||||||
const { project } = useProject()
|
const { project } = useProject()
|
||||||
const { client } = useSpyglass()
|
const { client } = useSpyglass()
|
||||||
|
|
||||||
const [fileId, setFileId] = useState(gen.id === 'pack_mcmeta' ? 'pack' : '')
|
const [fileId, setFileId] = useState(gen.id === 'pack_mcmeta' ? 'pack' : gen.id === 'sounds' ? 'sounds' : '')
|
||||||
const [error, setError] = useState<string>()
|
const [error, setError] = useState<string>()
|
||||||
|
|
||||||
const changeFileId = (str: string) => {
|
const changeFileId = (str: string) => {
|
||||||
@@ -45,7 +45,9 @@ export function FileCreation({ docAndNode, gen, method }: Props) {
|
|||||||
const projectRoot = getProjectRoot(project)
|
const projectRoot = getProjectRoot(project)
|
||||||
const uri = gen.id === 'pack_mcmeta'
|
const uri = gen.id === 'pack_mcmeta'
|
||||||
? `${projectRoot}pack.mcmeta`
|
? `${projectRoot}pack.mcmeta`
|
||||||
: `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}${gen.ext ?? '.json'}`
|
: gen.id === 'sounds'
|
||||||
|
? `${projectRoot}assets/${id.namespace}/sounds.json`
|
||||||
|
: `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}${gen.ext ?? '.json'}`
|
||||||
Analytics.saveProjectFile(method)
|
Analytics.saveProjectFile(method)
|
||||||
const text = docAndNode.doc.getText()
|
const text = docAndNode.doc.getText()
|
||||||
client.fs.writeFile(uri, text).then(() => {
|
client.fs.writeFile(uri, text).then(() => {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ function Body({ type, optional, node, ctx }: Props<SimplifiedMcdocType>) {
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
return <div class="node-body">
|
return <div class="node-body">
|
||||||
<ListBody type={type} node={node} ctx={ctx} />
|
<ListBody type={type} optional={optional} node={node} ctx={ctx} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
if (type.kind === 'tuple') {
|
if (type.kind === 'tuple') {
|
||||||
@@ -849,7 +849,7 @@ function ListHead({ type, node, ctx }: Props<ListType | PrimitiveArrayType>) {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
function ListBody({ type: outerType, node, ctx }: Props<ListType | PrimitiveArrayType>) {
|
function ListBody({ type: outerType, optional, node, ctx }: Props<ListType | PrimitiveArrayType>) {
|
||||||
if (!JsonArrayNode.is(node)) {
|
if (!JsonArrayNode.is(node)) {
|
||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
@@ -892,6 +892,21 @@ function ListBody({ type: outerType, node, ctx }: Props<ListType | PrimitiveArra
|
|||||||
}
|
}
|
||||||
}, [type, node, ctx, canAdd])
|
}, [type, node, ctx, canAdd])
|
||||||
|
|
||||||
|
const makeListEdit: MakeEdit = useCallback((edit) => {
|
||||||
|
ctx.makeEdit(() => {
|
||||||
|
const newNode = edit(node.range)
|
||||||
|
if (JsonArrayNode.is(newNode) && newNode.children.length === 0 && optional && type.kind === 'list' && (type.lengthRange?.min ?? 0) > 0) {
|
||||||
|
// Remove entire list when empty list is not allowed and field is optional
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return newNode
|
||||||
|
})
|
||||||
|
}, [ctx, node, optional, type])
|
||||||
|
|
||||||
|
const listCtx = useMemo(() => {
|
||||||
|
return { ...ctx, makeEdit: makeListEdit }
|
||||||
|
}, [ctx, makeListEdit])
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
{node.children.map((item, index) => {
|
{node.children.map((item, index) => {
|
||||||
if (index === maxShown) {
|
if (index === maxShown) {
|
||||||
@@ -905,7 +920,7 @@ function ListBody({ type: outerType, node, ctx }: Props<ListType | PrimitiveArra
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
const key = index.toString()
|
const key = index.toString()
|
||||||
return <ListItem key={key} item={item} index={index} category={category} type={childType} isToggled={isToggled(key)} expand={expand(key)} collapse={collapse(key)} node={node} ctx={ctx} />
|
return <ListItem key={key} item={item} index={index} category={category} type={childType} isToggled={isToggled(key)} expand={expand(key)} collapse={collapse(key)} node={node} ctx={listCtx} />
|
||||||
})}
|
})}
|
||||||
{node.children.length > 0 && <div class="node-header">
|
{node.children.length > 0 && <div class="node-header">
|
||||||
<button class="add tooltipped tip-se" aria-label={locale('add_bottom')} onClick={() => onAddBottom()} disabled={!canAdd}>
|
<button class="add tooltipped tip-se" aria-label={locale('add_bottom')} onClick={() => onAddBottom()} disabled={!canAdd}>
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ export function ProjectProvider({ children }: { children: ComponentChildren }) {
|
|||||||
const { namespace, path } = Identifier.parse(file.id)
|
const { namespace, path } = Identifier.parse(file.id)
|
||||||
const uri = type === 'pack_mcmeta'
|
const uri = type === 'pack_mcmeta'
|
||||||
? `${projectRoot}data/pack.mcmeta`
|
? `${projectRoot}data/pack.mcmeta`
|
||||||
: `${projectRoot}data/${namespace}/${type}/${path}${gen.ext ?? '.json'}`
|
: type === 'sounds'
|
||||||
|
? `${projectRoot}assets/${namespace}/sounds.json`
|
||||||
|
: `${projectRoot}data/${namespace}/${type}/${path}${gen.ext ?? '.json'}`
|
||||||
return SpyglassClient.FS.writeFile(uri, JSON.stringify(file.data, null, 2))
|
return SpyglassClient.FS.writeFile(uri, JSON.stringify(file.data, null, 2))
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ function Tools() {
|
|||||||
<ToolCard title="Report Inspector" icon="report"
|
<ToolCard title="Report Inspector" icon="report"
|
||||||
link="https://misode.github.io/report/"
|
link="https://misode.github.io/report/"
|
||||||
desc="Analyse your performance reports" />
|
desc="Analyse your performance reports" />
|
||||||
<ToolCard title="Minecraft Sounds" icon="sounds"
|
<ToolCard title="Minecraft Sounds" icon="sound_explorer"
|
||||||
link="/sounds/"
|
link="/sounds/"
|
||||||
desc="Browse through and mix all the vanilla sounds" />
|
desc="Browse through and mix all the vanilla sounds" />
|
||||||
<ToolCard title="Transformation preview"
|
<ToolCard title="Transformation preview"
|
||||||
|
|||||||
@@ -256,6 +256,9 @@ export class SpyglassService {
|
|||||||
if (gen.id === 'pack_mcmeta') {
|
if (gen.id === 'pack_mcmeta') {
|
||||||
return `${UNSAVED_URI}pack.mcmeta`
|
return `${UNSAVED_URI}pack.mcmeta`
|
||||||
}
|
}
|
||||||
|
if (gen.id === 'sounds') {
|
||||||
|
return `${UNSAVED_URI}assets/minecraft/sounds.json`
|
||||||
|
}
|
||||||
const pack = gen.tags?.includes('assets') ? 'assets' : 'data'
|
const pack = gen.tags?.includes('assets') ? 'assets' : 'data'
|
||||||
return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft${gen.ext ?? '.json'}`
|
return `${UNSAVED_URI}${pack}/draft/${genPath(gen, this.version)}/draft${gen.ext ?? '.json'}`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import config from '../Config.js'
|
import config from '../Config.js'
|
||||||
|
|
||||||
export const VersionIds = ['1.15', '1.16', '1.17', '1.18', '1.18.2', '1.19', '1.19.3', '1.19.4', '1.20', '1.20.2', '1.20.3', '1.20.5', '1.21', '1.21.2', '1.21.4', '1.21.5', '1.21.6', '1.21.9', '1.21.11', '26.1'] as const
|
export const VersionIds = ['1.15', '1.16', '1.17', '1.18', '1.18.2', '1.19', '1.19.3', '1.19.4', '1.20', '1.20.2', '1.20.3', '1.20.5', '1.21', '1.21.2', '1.21.4', '1.21.5', '1.21.6', '1.21.9', '1.21.11', '26.1', '26.2'] as const
|
||||||
export type VersionId = typeof VersionIds[number]
|
export type VersionId = typeof VersionIds[number]
|
||||||
|
|
||||||
export const DEFAULT_VERSION: VersionId = '1.21.11'
|
export const DEFAULT_VERSION: VersionId = '26.1'
|
||||||
|
|
||||||
export function checkVersion(versionId: string, minVersionId: string | undefined, maxVersionId?: string) {
|
export function checkVersion(versionId: string, minVersionId: string | undefined, maxVersionId?: string) {
|
||||||
const version = config.versions.findIndex(v => v.id === versionId)
|
const version = config.versions.findIndex(v => v.id === versionId)
|
||||||
|
|||||||
+16
-2
@@ -213,9 +213,16 @@
|
|||||||
{
|
{
|
||||||
"id": "26.1",
|
"id": "26.1",
|
||||||
"ref": "26.1.1",
|
"ref": "26.1.1",
|
||||||
"name": "26.1 — 26.1.1",
|
"name": "26.1",
|
||||||
"pack_format": 101,
|
"pack_format": 101,
|
||||||
"show": true
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "26.2",
|
||||||
|
"dynamic": true,
|
||||||
|
"name": "26.2",
|
||||||
|
"pack_format": 102,
|
||||||
|
"show": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generators": [
|
"generators": [
|
||||||
@@ -388,7 +395,8 @@
|
|||||||
{
|
{
|
||||||
"id": "trade_set",
|
"id": "trade_set",
|
||||||
"url": "trade-set",
|
"url": "trade-set",
|
||||||
"minVersion": "26.1"
|
"minVersion": "26.1",
|
||||||
|
"wiki": "https://minecraft.wiki/w/Trade_set"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "text_component",
|
"id": "text_component",
|
||||||
@@ -772,6 +780,12 @@
|
|||||||
"minVersion": "1.21.2",
|
"minVersion": "1.21.2",
|
||||||
"wiki": "https://minecraft.wiki/w/Shader#Post-processing_effects"
|
"wiki": "https://minecraft.wiki/w/Shader#Post-processing_effects"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "sounds",
|
||||||
|
"url": "assets/sounds",
|
||||||
|
"tags": ["assets"],
|
||||||
|
"wiki": "https://minecraft.wiki/w/Sounds.json"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "ad_astra:planets",
|
"id": "ad_astra:planets",
|
||||||
"url": "ad-astra/planets",
|
"url": "ad-astra/planets",
|
||||||
|
|||||||
+2
-1
@@ -111,12 +111,13 @@
|
|||||||
"generator.not_found": "Cannot find generator \"%0%\"",
|
"generator.not_found": "Cannot find generator \"%0%\"",
|
||||||
"generator.ohthetreesyoullgrow:configured_feature": "OTTYG Feature",
|
"generator.ohthetreesyoullgrow:configured_feature": "OTTYG Feature",
|
||||||
"generator.sky_aesthetics:sky": "Custom Sky",
|
"generator.sky_aesthetics:sky": "Custom Sky",
|
||||||
"generator.pack_mcmeta": "pack.mcmeta",
|
"generator.pack_mcmeta": "Pack.mcmeta",
|
||||||
"generator.painting_variant": "Painting Variant",
|
"generator.painting_variant": "Painting Variant",
|
||||||
"generator.pig_variant": "Pig Variant",
|
"generator.pig_variant": "Pig Variant",
|
||||||
"generator.post_effect": "Post Effect",
|
"generator.post_effect": "Post Effect",
|
||||||
"generator.predicate": "Predicate",
|
"generator.predicate": "Predicate",
|
||||||
"generator.recipe": "Recipe",
|
"generator.recipe": "Recipe",
|
||||||
|
"generator.sounds": "Sounds.json",
|
||||||
"generator.switch_version": "Switch to %0%",
|
"generator.switch_version": "Switch to %0%",
|
||||||
"generator.tag/banner_pattern": "Banner Pattern Tag",
|
"generator.tag/banner_pattern": "Banner Pattern Tag",
|
||||||
"generator.tag/block": "Block Tag",
|
"generator.tag/block": "Block Tag",
|
||||||
|
|||||||
+10
-3
@@ -18,7 +18,7 @@
|
|||||||
"configure_layers": "Выбрать слой",
|
"configure_layers": "Выбрать слой",
|
||||||
"contributor.code": "Коддер",
|
"contributor.code": "Коддер",
|
||||||
"contributor.infrastructure": "Инфраструктура",
|
"contributor.infrastructure": "Инфраструктура",
|
||||||
"contributor.report": "QA",
|
"contributor.report": "Отчёт об ошибке",
|
||||||
"contributor.support": "Поддержка",
|
"contributor.support": "Поддержка",
|
||||||
"contributor.translation": "Переводчик",
|
"contributor.translation": "Переводчик",
|
||||||
"copied": "Скопировано!",
|
"copied": "Скопировано!",
|
||||||
@@ -154,7 +154,7 @@
|
|||||||
"preview.weather.rain": "Дождь",
|
"preview.weather.rain": "Дождь",
|
||||||
"preview.weather.thunder": "Гроза",
|
"preview.weather.thunder": "Гроза",
|
||||||
"preview.width": "Ширина",
|
"preview.width": "Ширина",
|
||||||
"project.cancel": "Отмена",
|
"project.cancel": "Отменить",
|
||||||
"project.create": "Создать новый проект",
|
"project.create": "Создать новый проект",
|
||||||
"project.delete": "Удалить проект",
|
"project.delete": "Удалить проект",
|
||||||
"project.delete_confirm.1": "Вы собираетесь удалить %0%",
|
"project.delete_confirm.1": "Вы собираетесь удалить %0%",
|
||||||
@@ -389,5 +389,12 @@
|
|||||||
"generator.loot-table-modifier:loot_modifier": "Модификатор выпадение",
|
"generator.loot-table-modifier:loot_modifier": "Модификатор выпадение",
|
||||||
"generator.tag/zombie_nautilus_variant": "Тэг варианта зомби-наутилуса",
|
"generator.tag/zombie_nautilus_variant": "Тэг варианта зомби-наутилуса",
|
||||||
"generator.zombie_nautilus_variant": "Вариант зомби-наутилуса",
|
"generator.zombie_nautilus_variant": "Вариант зомби-наутилуса",
|
||||||
"partner.loot-table-modifier": "Модификатор таблицы выпадения"
|
"partner.loot-table-modifier": "Модификатор таблицы выпадения",
|
||||||
|
"generator.tag/timeline": "Тег Временной Шкалы",
|
||||||
|
"generator.villager_trade": "Торг с жителем",
|
||||||
|
"generator.tag/villager_trade": "Тег Продаж Жителя",
|
||||||
|
"generator.timeline": "Временная Шкала",
|
||||||
|
"generator.sulfur_cube_archetype": "Архетип Серного Куба",
|
||||||
|
"generator.tag/trade_set": "Тег Набора Торговли",
|
||||||
|
"generator.trade_set": "Набор Торговли"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user