diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..2de38b0 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +last 5 versions, not dead diff --git a/.gitattributes b/.gitattributes index c5f949a..176a458 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1 @@ * text=auto -/msz text eol=lf -*.sh text eol=lf diff --git a/.gitignore b/.gitignore index c082441..e5b5f94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Assets +/public/assets +/assets/current.json + # Libraries /vendor /node_modules diff --git a/assets/README.md b/assets/README.md deleted file mode 100644 index 7ddbc9a..0000000 --- a/assets/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Misuzu Assets - -Subdirectories of the `css` and `js` folder are accessible through the web as `example.com/assets/.`. -Meaning `/assets/js/misuzu` is accessible as `/assets/misuzu.js`. -Files are concatenated recursively, files first then directories in alphabetical order. -Use `_` prefixes to raise things up. diff --git a/assets/assproc.js b/assets/assproc.js new file mode 100644 index 0000000..d4144b9 --- /dev/null +++ b/assets/assproc.js @@ -0,0 +1,100 @@ +const fs = require('fs'); +const path = require('path'); +const readline = require('readline'); +const utils = require('./utils.js'); + +exports.process = async function(root, options) { + const macroPrefix = options.prefix || '#'; + const entryPoint = options.entry || ''; + + root = fs.realpathSync(root); + + const included = []; + + const processFile = async function(fileName) { + const fullPath = path.join(root, fileName); + if(included.includes(fullPath)) + return ''; + included.push(fullPath); + + if(!fullPath.startsWith(root)) { + console.error('INVALID PATH: ' + fullPath); + return '/* *** INVALID PATH: ' + fullPath + ' */'; + } + + if(!fs.existsSync(fullPath)) { + console.error('FILE NOT FOUND: ' + fullPath); + return '/* *** FILE NOT FOUND: ' + fullPath + ' */'; + } + + const lines = readline.createInterface({ + input: fs.createReadStream(fullPath), + crlfDelay: Infinity, + }); + + let output = ''; + let lastWasEmpty = false; + + if(options.showPath) + output += "/* *** PATH: " + fullPath + " */\n"; + + for await(const line of lines) { + const lineTrimmed = utils.trim(line); + if(lineTrimmed === '') + continue; + + if(line.startsWith(macroPrefix)) { + const args = lineTrimmed.split(' '); + const macro = utils.trim(utils.trimStart(args.shift(), macroPrefix)); + + switch(macro) { + case 'comment': + break; + + case 'include': { + const includePath = utils.trimEnd(args.join(' '), ';'); + output += utils.trim(await processFile(includePath)); + output += "\n"; + break; + } + + default: + output += line; + output += "\n"; + break; + } + } else { + output += line; + output += "\n"; + } + } + + return output; + }; + + return await processFile(entryPoint); +}; + +exports.housekeep = function(assetsPath) { + const files = fs.readdirSync(assetsPath).map(fileName => { + const stats = fs.statSync(path.join(assetsPath, fileName)); + return { + name: fileName, + lastMod: stats.mtimeMs, + }; + }).sort((a, b) => b.lastMod - a.lastMod).map(info => info.name); + + const regex = /^(.+)-([a-f0-9]+)\.(.+)$/i; + const counts = {}; + + for(const fileName of files) { + const match = fileName.match(regex); + if(match) { + const name = match[1] + '-' + match[3]; + counts[name] = (counts[name] || 0) + 1; + + if(counts[name] > 5) + fs.unlinkSync(path.join(assetsPath, fileName)); + } else console.log(`Encountered file name in assets folder with unexpected format: ${fileName}`); + } +}; diff --git a/assets/css/misuzu/_msz.css b/assets/css/misuzu/_msz.css deleted file mode 100644 index afe7f67..0000000 --- a/assets/css/misuzu/_msz.css +++ /dev/null @@ -1,96 +0,0 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; - position: relative; - outline-style: none; -} - -html, -body { - width: 100%; - height: 100%; -} - -[hidden], -.hidden { - display: none !important; - visibility: hidden !important; -} - -:root { - --font-size: 12px; - --line-height: 20px; - --font-regular: Verdana, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif; - --font-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - - --site-max-width: 1200px; - --site-mobile-width: 800px; - --site-logo: url('/images/logos/imouto-default.png'); - - --header-height-desktop: 70px; - --header-height-mobile: 50px; - - --background-image: initial; - --background-colour: #111; - --background-colour-translucent-1: rgba(17, 17, 17, 0.1); - --background-colour-translucent-2: rgba(17, 17, 17, 0.2); - --background-colour-translucent-3: rgba(17, 17, 17, 0.3); - --background-colour-translucent-4: rgba(17, 17, 17, 0.4); - --background-colour-translucent-5: rgba(17, 17, 17, 0.5); - --background-colour-translucent-6: rgba(17, 17, 17, 0.6); - --background-colour-translucent-7: rgba(17, 17, 17, 0.7); - --background-colour-translucent-8: rgba(17, 17, 17, 0.8); - --background-colour-translucent-9: rgba(17, 17, 17, 0.9); - --background-pattern: url('/images/clouds.png') fixed; - - --container-colour: #161616; - - --text-colour: #fff; - --text-colour-inverted: #000; - - --user-colour: inherit; - --user-header: url('/images/pixel.png'); - --accent-colour: #8559a5; - --header-accent-colour: var(--accent-colour); -} - -html { - scrollbar-color: var(--accent-colour) var(--background-colour); -} - -.main { - display: flex; - flex-direction: column; - background-image: var(--background-image); - background-color: var(--background-colour); - font-size: var(--font-size); - line-height: var(--line-height); - font-family: var(--font-regular); - color: var(--text-colour); - background-attachment: fixed; - background-position: center center; -} -.main__wrapper { - max-width: var(--site-max-width); - width: 100%; - margin: 0 auto; - flex: 1 0 auto; -} - -.main--bg-blend { - background-color: var(--accent-colour); - background-blend-mode: multiply; -} -.main--bg-slide { animation: background-slide infinite linear 2s; } -.main--bg-cover { background-size: cover; } -.main--bg-contain { background-size: contain; } -.main--bg-stretch { background-size: 100% 100%; } -.main--bg-tile { background-size: auto; } - -.link { - color: var(--accent-colour); - text-decoration: none; -} -.link:hover, .link:focus { text-decoration: underline; } - diff --git a/assets/css/misuzu/_input/button.css b/assets/misuzu.css/_input/button.css similarity index 100% rename from assets/css/misuzu/_input/button.css rename to assets/misuzu.css/_input/button.css diff --git a/assets/css/misuzu/_input/checkbox.css b/assets/misuzu.css/_input/checkbox.css similarity index 100% rename from assets/css/misuzu/_input/checkbox.css rename to assets/misuzu.css/_input/checkbox.css diff --git a/assets/css/misuzu/_input/colour.css b/assets/misuzu.css/_input/colour.css similarity index 100% rename from assets/css/misuzu/_input/colour.css rename to assets/misuzu.css/_input/colour.css diff --git a/assets/css/misuzu/_input/select.css b/assets/misuzu.css/_input/select.css similarity index 100% rename from assets/css/misuzu/_input/select.css rename to assets/misuzu.css/_input/select.css diff --git a/assets/css/misuzu/_input/text.css b/assets/misuzu.css/_input/text.css similarity index 100% rename from assets/css/misuzu/_input/text.css rename to assets/misuzu.css/_input/text.css diff --git a/assets/css/misuzu/_input/textarea.css b/assets/misuzu.css/_input/textarea.css similarity index 100% rename from assets/css/misuzu/_input/textarea.css rename to assets/misuzu.css/_input/textarea.css diff --git a/assets/css/misuzu/_input/upload.css b/assets/misuzu.css/_input/upload.css similarity index 100% rename from assets/css/misuzu/_input/upload.css rename to assets/misuzu.css/_input/upload.css diff --git a/assets/css/misuzu/animations.css b/assets/misuzu.css/animations.css similarity index 100% rename from assets/css/misuzu/animations.css rename to assets/misuzu.css/animations.css diff --git a/assets/css/misuzu/auth/buttons.css b/assets/misuzu.css/auth/buttons.css similarity index 100% rename from assets/css/misuzu/auth/buttons.css rename to assets/misuzu.css/auth/buttons.css diff --git a/assets/css/misuzu/auth/container.css b/assets/misuzu.css/auth/container.css similarity index 100% rename from assets/css/misuzu/auth/container.css rename to assets/misuzu.css/auth/container.css diff --git a/assets/css/misuzu/auth/label.css b/assets/misuzu.css/auth/label.css similarity index 100% rename from assets/css/misuzu/auth/label.css rename to assets/misuzu.css/auth/label.css diff --git a/assets/css/misuzu/auth/login.css b/assets/misuzu.css/auth/login.css similarity index 100% rename from assets/css/misuzu/auth/login.css rename to assets/misuzu.css/auth/login.css diff --git a/assets/css/misuzu/auth/logout.css b/assets/misuzu.css/auth/logout.css similarity index 100% rename from assets/css/misuzu/auth/logout.css rename to assets/misuzu.css/auth/logout.css diff --git a/assets/css/misuzu/auth/register.css b/assets/misuzu.css/auth/register.css similarity index 100% rename from assets/css/misuzu/auth/register.css rename to assets/misuzu.css/auth/register.css diff --git a/assets/css/misuzu/auth/warning.css b/assets/misuzu.css/auth/warning.css similarity index 100% rename from assets/css/misuzu/auth/warning.css rename to assets/misuzu.css/auth/warning.css diff --git a/assets/css/misuzu/avatar.css b/assets/misuzu.css/avatar.css similarity index 100% rename from assets/css/misuzu/avatar.css rename to assets/misuzu.css/avatar.css diff --git a/assets/css/misuzu/bb.css b/assets/misuzu.css/bb.css similarity index 100% rename from assets/css/misuzu/bb.css rename to assets/misuzu.css/bb.css diff --git a/assets/css/misuzu/changelog/_changelog.css b/assets/misuzu.css/changelog/_changelog.css similarity index 100% rename from assets/css/misuzu/changelog/_changelog.css rename to assets/misuzu.css/changelog/_changelog.css diff --git a/assets/css/misuzu/changelog/change.css b/assets/misuzu.css/changelog/change.css similarity index 100% rename from assets/css/misuzu/changelog/change.css rename to assets/misuzu.css/changelog/change.css diff --git a/assets/css/misuzu/changelog/container.css b/assets/misuzu.css/changelog/container.css similarity index 100% rename from assets/css/misuzu/changelog/container.css rename to assets/misuzu.css/changelog/container.css diff --git a/assets/css/misuzu/changelog/entry.css b/assets/misuzu.css/changelog/entry.css similarity index 100% rename from assets/css/misuzu/changelog/entry.css rename to assets/misuzu.css/changelog/entry.css diff --git a/assets/css/misuzu/changelog/listing.css b/assets/misuzu.css/changelog/listing.css similarity index 100% rename from assets/css/misuzu/changelog/listing.css rename to assets/misuzu.css/changelog/listing.css diff --git a/assets/css/misuzu/changelog/log.css b/assets/misuzu.css/changelog/log.css similarity index 100% rename from assets/css/misuzu/changelog/log.css rename to assets/misuzu.css/changelog/log.css diff --git a/assets/css/misuzu/changelog/pagination.css b/assets/misuzu.css/changelog/pagination.css similarity index 100% rename from assets/css/misuzu/changelog/pagination.css rename to assets/misuzu.css/changelog/pagination.css diff --git a/assets/css/misuzu/comments/comment.css b/assets/misuzu.css/comments/comment.css similarity index 100% rename from assets/css/misuzu/comments/comment.css rename to assets/misuzu.css/comments/comment.css diff --git a/assets/css/misuzu/comments/comments.css b/assets/misuzu.css/comments/comments.css similarity index 100% rename from assets/css/misuzu/comments/comments.css rename to assets/misuzu.css/comments/comments.css diff --git a/assets/css/misuzu/confirm.css b/assets/misuzu.css/confirm.css similarity index 100% rename from assets/css/misuzu/confirm.css rename to assets/misuzu.css/confirm.css diff --git a/assets/css/misuzu/container.css b/assets/misuzu.css/container.css similarity index 100% rename from assets/css/misuzu/container.css rename to assets/misuzu.css/container.css diff --git a/assets/css/misuzu/eeprom.css b/assets/misuzu.css/eeprom.css similarity index 100% rename from assets/css/misuzu/eeprom.css rename to assets/misuzu.css/eeprom.css diff --git a/assets/css/misuzu/embed.css b/assets/misuzu.css/embed.css similarity index 100% rename from assets/css/misuzu/embed.css rename to assets/misuzu.css/embed.css diff --git a/assets/css/misuzu/emoticon.css b/assets/misuzu.css/emoticon.css similarity index 100% rename from assets/css/misuzu/emoticon.css rename to assets/misuzu.css/emoticon.css diff --git a/assets/css/misuzu/flags.css b/assets/misuzu.css/flags.css similarity index 100% rename from assets/css/misuzu/flags.css rename to assets/misuzu.css/flags.css diff --git a/assets/css/misuzu/footer.css b/assets/misuzu.css/footer.css similarity index 100% rename from assets/css/misuzu/footer.css rename to assets/misuzu.css/footer.css diff --git a/assets/css/misuzu/forum/actions.css b/assets/misuzu.css/forum/actions.css similarity index 100% rename from assets/css/misuzu/forum/actions.css rename to assets/misuzu.css/forum/actions.css diff --git a/assets/css/misuzu/forum/categories.css b/assets/misuzu.css/forum/categories.css similarity index 100% rename from assets/css/misuzu/forum/categories.css rename to assets/misuzu.css/forum/categories.css diff --git a/assets/css/misuzu/forum/confirm.css b/assets/misuzu.css/forum/confirm.css similarity index 100% rename from assets/css/misuzu/forum/confirm.css rename to assets/misuzu.css/forum/confirm.css diff --git a/assets/css/misuzu/forum/header.css b/assets/misuzu.css/forum/header.css similarity index 100% rename from assets/css/misuzu/forum/header.css rename to assets/misuzu.css/forum/header.css diff --git a/assets/css/misuzu/forum/leaderboard.css b/assets/misuzu.css/forum/leaderboard.css similarity index 100% rename from assets/css/misuzu/forum/leaderboard.css rename to assets/misuzu.css/forum/leaderboard.css diff --git a/assets/css/misuzu/forum/poll.css b/assets/misuzu.css/forum/poll.css similarity index 100% rename from assets/css/misuzu/forum/poll.css rename to assets/misuzu.css/forum/poll.css diff --git a/assets/css/misuzu/forum/post.css b/assets/misuzu.css/forum/post.css similarity index 100% rename from assets/css/misuzu/forum/post.css rename to assets/misuzu.css/forum/post.css diff --git a/assets/css/misuzu/forum/priority.css b/assets/misuzu.css/forum/priority.css similarity index 100% rename from assets/css/misuzu/forum/priority.css rename to assets/misuzu.css/forum/priority.css diff --git a/assets/css/misuzu/forum/status.css b/assets/misuzu.css/forum/status.css similarity index 100% rename from assets/css/misuzu/forum/status.css rename to assets/misuzu.css/forum/status.css diff --git a/assets/css/misuzu/forum/topics.css b/assets/misuzu.css/forum/topics.css similarity index 100% rename from assets/css/misuzu/forum/topics.css rename to assets/misuzu.css/forum/topics.css diff --git a/assets/css/misuzu/header.css b/assets/misuzu.css/header.css similarity index 100% rename from assets/css/misuzu/header.css rename to assets/misuzu.css/header.css diff --git a/assets/css/misuzu/home/landingv2-footer.css b/assets/misuzu.css/home/landingv2-footer.css similarity index 100% rename from assets/css/misuzu/home/landingv2-footer.css rename to assets/misuzu.css/home/landingv2-footer.css diff --git a/assets/css/misuzu/home/landingv2-header.css b/assets/misuzu.css/home/landingv2-header.css similarity index 100% rename from assets/css/misuzu/home/landingv2-header.css rename to assets/misuzu.css/home/landingv2-header.css diff --git a/assets/css/misuzu/home/landingv2.css b/assets/misuzu.css/home/landingv2.css similarity index 100% rename from assets/css/misuzu/home/landingv2.css rename to assets/misuzu.css/home/landingv2.css diff --git a/assets/css/misuzu/impersonate.css b/assets/misuzu.css/impersonate.css similarity index 100% rename from assets/css/misuzu/impersonate.css rename to assets/misuzu.css/impersonate.css diff --git a/assets/css/misuzu/landing.css b/assets/misuzu.css/landing.css similarity index 100% rename from assets/css/misuzu/landing.css rename to assets/misuzu.css/landing.css diff --git a/assets/misuzu.css/main.css b/assets/misuzu.css/main.css new file mode 100644 index 0000000..1b9db34 --- /dev/null +++ b/assets/misuzu.css/main.css @@ -0,0 +1,214 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + position: relative; + outline-style: none; +} + +html, +body { + width: 100%; + height: 100%; +} + +[hidden], +.hidden { + display: none !important; + visibility: hidden !important; +} + +:root { + --font-size: 12px; + --line-height: 20px; + --font-regular: Verdana, Geneva, 'Dejavu Sans', Arial, Helvetica, sans-serif; + --font-monospace: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + + --site-max-width: 1200px; + --site-mobile-width: 800px; + --site-logo: url('/images/logos/imouto-default.png'); + + --header-height-desktop: 70px; + --header-height-mobile: 50px; + + --background-image: initial; + --background-colour: #111; + --background-colour-translucent-1: rgba(17, 17, 17, 0.1); + --background-colour-translucent-2: rgba(17, 17, 17, 0.2); + --background-colour-translucent-3: rgba(17, 17, 17, 0.3); + --background-colour-translucent-4: rgba(17, 17, 17, 0.4); + --background-colour-translucent-5: rgba(17, 17, 17, 0.5); + --background-colour-translucent-6: rgba(17, 17, 17, 0.6); + --background-colour-translucent-7: rgba(17, 17, 17, 0.7); + --background-colour-translucent-8: rgba(17, 17, 17, 0.8); + --background-colour-translucent-9: rgba(17, 17, 17, 0.9); + --background-pattern: url('/images/clouds.png') fixed; + + --container-colour: #161616; + + --text-colour: #fff; + --text-colour-inverted: #000; + + --user-colour: inherit; + --user-header: url('/images/pixel.png'); + --accent-colour: #8559a5; + --header-accent-colour: var(--accent-colour); +} + +html { + scrollbar-color: var(--accent-colour) var(--background-colour); +} + +.main { + display: flex; + flex-direction: column; + background-image: var(--background-image); + background-color: var(--background-colour); + font-size: var(--font-size); + line-height: var(--line-height); + font-family: var(--font-regular); + color: var(--text-colour); + background-attachment: fixed; + background-position: center center; +} +.main__wrapper { + max-width: var(--site-max-width); + width: 100%; + margin: 0 auto; + flex: 1 0 auto; +} + +.main--bg-blend { + background-color: var(--accent-colour); + background-blend-mode: multiply; +} +.main--bg-slide { animation: background-slide infinite linear 2s; } +.main--bg-cover { background-size: cover; } +.main--bg-contain { background-size: contain; } +.main--bg-stretch { background-size: 100% 100%; } +.main--bg-tile { background-size: auto; } + +.link { + color: var(--accent-colour); + text-decoration: none; +} +.link:hover, .link:focus { text-decoration: underline; } + +@comment "convert all of the below into a proper inclusion structure"; + +@include animations.css; +@include avatar.css; +@include bb.css; +@include confirm.css; +@include container.css; +@include eeprom.css; +@include embed.css; +@include emoticon.css; +@include flags.css; +@include footer.css; +@include header.css; +@include impersonate.css; +@include landing.css; +@include main.css; +@include markdown.css; +@include messagebox.css; +@include navigation.css; +@include pagination.css; +@include permissions.css; +@include warning.css; + +@include _input/button.css; +@include _input/checkbox.css; +@include _input/colour.css; +@include _input/select.css; +@include _input/text.css; +@include _input/textarea.css; +@include _input/upload.css; + +@include auth/buttons.css; +@include auth/container.css; +@include auth/label.css; +@include auth/login.css; +@include auth/logout.css; +@include auth/register.css; +@include auth/warning.css; + +@include changelog/_changelog.css; +@include changelog/change.css; +@include changelog/container.css; +@include changelog/entry.css; +@include changelog/listing.css; +@include changelog/log.css; +@include changelog/pagination.css; + +@include comments/comment.css; +@include comments/comments.css; + +@include forum/actions.css; +@include forum/categories.css; +@include forum/confirm.css; +@include forum/header.css; +@include forum/leaderboard.css; +@include forum/poll.css; +@include forum/post.css; +@include forum/priority.css; +@include forum/status.css; +@include forum/topics.css; + +@include home/landingv2-footer.css; +@include home/landingv2-header.css; +@include home/landingv2.css; + +@include manage/_manage.css; +@include manage/blacklist.css; +@include manage/changelog-actions-tags.css; +@include manage/emote.css; +@include manage/emotes.css; +@include manage/navigation.css; +@include manage/role-item.css; +@include manage/roles.css; +@include manage/settings.css; +@include manage/statistic.css; +@include manage/statistics.css; +@include manage/tag.css; +@include manage/tags.css; +@include manage/user-item.css; +@include manage/user.css; +@include manage/users.css; + +@include news/container.css; +@include news/feeds.css; +@include news/list.css; +@include news/post.css; +@include news/preview.css; +@include news/sidebar.css; + +@include profile/about.css; +@include profile/accounts.css; +@include profile/birthdate.css; +@include profile/forum-activity.css; +@include profile/guidelines.css; +@include profile/header.css; +@include profile/profile.css; +@include profile/relations.css; +@include profile/signature.css; +@include profile/warning.css; + +@include search/anchor.css; +@include search/categories.css; +@include search/container.css; +@include search/header.css; +@include search/input.css; +@include search/none.css; + +@include settings/account-logs.css; +@include settings/account.css; +@include settings/data.css; +@include settings/login-attempts.css; +@include settings/role.css; +@include settings/sessions.css; +@include settings/settings.css; +@include settings/two-factor.css; + +@include user/usercard.css; +@include user/userlist.css; diff --git a/assets/css/misuzu/manage/_manage.css b/assets/misuzu.css/manage/_manage.css similarity index 100% rename from assets/css/misuzu/manage/_manage.css rename to assets/misuzu.css/manage/_manage.css diff --git a/assets/css/misuzu/manage/blacklist.css b/assets/misuzu.css/manage/blacklist.css similarity index 100% rename from assets/css/misuzu/manage/blacklist.css rename to assets/misuzu.css/manage/blacklist.css diff --git a/assets/css/misuzu/manage/changelog-actions-tags.css b/assets/misuzu.css/manage/changelog-actions-tags.css similarity index 100% rename from assets/css/misuzu/manage/changelog-actions-tags.css rename to assets/misuzu.css/manage/changelog-actions-tags.css diff --git a/assets/css/misuzu/manage/emote.css b/assets/misuzu.css/manage/emote.css similarity index 100% rename from assets/css/misuzu/manage/emote.css rename to assets/misuzu.css/manage/emote.css diff --git a/assets/css/misuzu/manage/emotes.css b/assets/misuzu.css/manage/emotes.css similarity index 100% rename from assets/css/misuzu/manage/emotes.css rename to assets/misuzu.css/manage/emotes.css diff --git a/assets/css/misuzu/manage/navigation.css b/assets/misuzu.css/manage/navigation.css similarity index 100% rename from assets/css/misuzu/manage/navigation.css rename to assets/misuzu.css/manage/navigation.css diff --git a/assets/css/misuzu/manage/role-item.css b/assets/misuzu.css/manage/role-item.css similarity index 100% rename from assets/css/misuzu/manage/role-item.css rename to assets/misuzu.css/manage/role-item.css diff --git a/assets/css/misuzu/manage/roles.css b/assets/misuzu.css/manage/roles.css similarity index 100% rename from assets/css/misuzu/manage/roles.css rename to assets/misuzu.css/manage/roles.css diff --git a/assets/css/misuzu/manage/settings.css b/assets/misuzu.css/manage/settings.css similarity index 100% rename from assets/css/misuzu/manage/settings.css rename to assets/misuzu.css/manage/settings.css diff --git a/assets/css/misuzu/manage/statistic.css b/assets/misuzu.css/manage/statistic.css similarity index 100% rename from assets/css/misuzu/manage/statistic.css rename to assets/misuzu.css/manage/statistic.css diff --git a/assets/css/misuzu/manage/statistics.css b/assets/misuzu.css/manage/statistics.css similarity index 100% rename from assets/css/misuzu/manage/statistics.css rename to assets/misuzu.css/manage/statistics.css diff --git a/assets/css/misuzu/manage/tag.css b/assets/misuzu.css/manage/tag.css similarity index 100% rename from assets/css/misuzu/manage/tag.css rename to assets/misuzu.css/manage/tag.css diff --git a/assets/css/misuzu/manage/tags.css b/assets/misuzu.css/manage/tags.css similarity index 100% rename from assets/css/misuzu/manage/tags.css rename to assets/misuzu.css/manage/tags.css diff --git a/assets/css/misuzu/manage/user-item.css b/assets/misuzu.css/manage/user-item.css similarity index 100% rename from assets/css/misuzu/manage/user-item.css rename to assets/misuzu.css/manage/user-item.css diff --git a/assets/css/misuzu/manage/user.css b/assets/misuzu.css/manage/user.css similarity index 100% rename from assets/css/misuzu/manage/user.css rename to assets/misuzu.css/manage/user.css diff --git a/assets/css/misuzu/manage/users.css b/assets/misuzu.css/manage/users.css similarity index 100% rename from assets/css/misuzu/manage/users.css rename to assets/misuzu.css/manage/users.css diff --git a/assets/css/misuzu/markdown.css b/assets/misuzu.css/markdown.css similarity index 100% rename from assets/css/misuzu/markdown.css rename to assets/misuzu.css/markdown.css diff --git a/assets/css/misuzu/messagebox.css b/assets/misuzu.css/messagebox.css similarity index 100% rename from assets/css/misuzu/messagebox.css rename to assets/misuzu.css/messagebox.css diff --git a/assets/css/misuzu/navigation.css b/assets/misuzu.css/navigation.css similarity index 100% rename from assets/css/misuzu/navigation.css rename to assets/misuzu.css/navigation.css diff --git a/assets/css/misuzu/news/container.css b/assets/misuzu.css/news/container.css similarity index 100% rename from assets/css/misuzu/news/container.css rename to assets/misuzu.css/news/container.css diff --git a/assets/css/misuzu/news/feeds.css b/assets/misuzu.css/news/feeds.css similarity index 100% rename from assets/css/misuzu/news/feeds.css rename to assets/misuzu.css/news/feeds.css diff --git a/assets/css/misuzu/news/list.css b/assets/misuzu.css/news/list.css similarity index 100% rename from assets/css/misuzu/news/list.css rename to assets/misuzu.css/news/list.css diff --git a/assets/css/misuzu/news/post.css b/assets/misuzu.css/news/post.css similarity index 100% rename from assets/css/misuzu/news/post.css rename to assets/misuzu.css/news/post.css diff --git a/assets/css/misuzu/news/preview.css b/assets/misuzu.css/news/preview.css similarity index 100% rename from assets/css/misuzu/news/preview.css rename to assets/misuzu.css/news/preview.css diff --git a/assets/css/misuzu/news/sidebar.css b/assets/misuzu.css/news/sidebar.css similarity index 100% rename from assets/css/misuzu/news/sidebar.css rename to assets/misuzu.css/news/sidebar.css diff --git a/assets/css/misuzu/pagination.css b/assets/misuzu.css/pagination.css similarity index 100% rename from assets/css/misuzu/pagination.css rename to assets/misuzu.css/pagination.css diff --git a/assets/css/misuzu/permissions.css b/assets/misuzu.css/permissions.css similarity index 100% rename from assets/css/misuzu/permissions.css rename to assets/misuzu.css/permissions.css diff --git a/assets/css/misuzu/profile/about.css b/assets/misuzu.css/profile/about.css similarity index 100% rename from assets/css/misuzu/profile/about.css rename to assets/misuzu.css/profile/about.css diff --git a/assets/css/misuzu/profile/accounts.css b/assets/misuzu.css/profile/accounts.css similarity index 100% rename from assets/css/misuzu/profile/accounts.css rename to assets/misuzu.css/profile/accounts.css diff --git a/assets/css/misuzu/profile/birthdate.css b/assets/misuzu.css/profile/birthdate.css similarity index 100% rename from assets/css/misuzu/profile/birthdate.css rename to assets/misuzu.css/profile/birthdate.css diff --git a/assets/css/misuzu/profile/forum-activity.css b/assets/misuzu.css/profile/forum-activity.css similarity index 100% rename from assets/css/misuzu/profile/forum-activity.css rename to assets/misuzu.css/profile/forum-activity.css diff --git a/assets/css/misuzu/profile/guidelines.css b/assets/misuzu.css/profile/guidelines.css similarity index 100% rename from assets/css/misuzu/profile/guidelines.css rename to assets/misuzu.css/profile/guidelines.css diff --git a/assets/css/misuzu/profile/header.css b/assets/misuzu.css/profile/header.css similarity index 100% rename from assets/css/misuzu/profile/header.css rename to assets/misuzu.css/profile/header.css diff --git a/assets/css/misuzu/profile/profile.css b/assets/misuzu.css/profile/profile.css similarity index 100% rename from assets/css/misuzu/profile/profile.css rename to assets/misuzu.css/profile/profile.css diff --git a/assets/css/misuzu/profile/relations.css b/assets/misuzu.css/profile/relations.css similarity index 100% rename from assets/css/misuzu/profile/relations.css rename to assets/misuzu.css/profile/relations.css diff --git a/assets/css/misuzu/profile/signature.css b/assets/misuzu.css/profile/signature.css similarity index 100% rename from assets/css/misuzu/profile/signature.css rename to assets/misuzu.css/profile/signature.css diff --git a/assets/css/misuzu/profile/warning.css b/assets/misuzu.css/profile/warning.css similarity index 100% rename from assets/css/misuzu/profile/warning.css rename to assets/misuzu.css/profile/warning.css diff --git a/assets/css/misuzu/search/anchor.css b/assets/misuzu.css/search/anchor.css similarity index 100% rename from assets/css/misuzu/search/anchor.css rename to assets/misuzu.css/search/anchor.css diff --git a/assets/css/misuzu/search/categories.css b/assets/misuzu.css/search/categories.css similarity index 100% rename from assets/css/misuzu/search/categories.css rename to assets/misuzu.css/search/categories.css diff --git a/assets/css/misuzu/search/container.css b/assets/misuzu.css/search/container.css similarity index 100% rename from assets/css/misuzu/search/container.css rename to assets/misuzu.css/search/container.css diff --git a/assets/css/misuzu/search/header.css b/assets/misuzu.css/search/header.css similarity index 100% rename from assets/css/misuzu/search/header.css rename to assets/misuzu.css/search/header.css diff --git a/assets/css/misuzu/search/input.css b/assets/misuzu.css/search/input.css similarity index 100% rename from assets/css/misuzu/search/input.css rename to assets/misuzu.css/search/input.css diff --git a/assets/css/misuzu/search/none.css b/assets/misuzu.css/search/none.css similarity index 100% rename from assets/css/misuzu/search/none.css rename to assets/misuzu.css/search/none.css diff --git a/assets/css/misuzu/settings/account-logs.css b/assets/misuzu.css/settings/account-logs.css similarity index 100% rename from assets/css/misuzu/settings/account-logs.css rename to assets/misuzu.css/settings/account-logs.css diff --git a/assets/css/misuzu/settings/account.css b/assets/misuzu.css/settings/account.css similarity index 100% rename from assets/css/misuzu/settings/account.css rename to assets/misuzu.css/settings/account.css diff --git a/assets/css/misuzu/settings/data.css b/assets/misuzu.css/settings/data.css similarity index 100% rename from assets/css/misuzu/settings/data.css rename to assets/misuzu.css/settings/data.css diff --git a/assets/css/misuzu/settings/login-attempts.css b/assets/misuzu.css/settings/login-attempts.css similarity index 100% rename from assets/css/misuzu/settings/login-attempts.css rename to assets/misuzu.css/settings/login-attempts.css diff --git a/assets/css/misuzu/settings/role.css b/assets/misuzu.css/settings/role.css similarity index 100% rename from assets/css/misuzu/settings/role.css rename to assets/misuzu.css/settings/role.css diff --git a/assets/css/misuzu/settings/sessions.css b/assets/misuzu.css/settings/sessions.css similarity index 100% rename from assets/css/misuzu/settings/sessions.css rename to assets/misuzu.css/settings/sessions.css diff --git a/assets/css/misuzu/settings/settings.css b/assets/misuzu.css/settings/settings.css similarity index 100% rename from assets/css/misuzu/settings/settings.css rename to assets/misuzu.css/settings/settings.css diff --git a/assets/css/misuzu/settings/two-factor.css b/assets/misuzu.css/settings/two-factor.css similarity index 100% rename from assets/css/misuzu/settings/two-factor.css rename to assets/misuzu.css/settings/two-factor.css diff --git a/assets/css/misuzu/user/usercard.css b/assets/misuzu.css/user/usercard.css similarity index 100% rename from assets/css/misuzu/user/usercard.css rename to assets/misuzu.css/user/usercard.css diff --git a/assets/css/misuzu/user/userlist.css b/assets/misuzu.css/user/userlist.css similarity index 100% rename from assets/css/misuzu/user/userlist.css rename to assets/misuzu.css/user/userlist.css diff --git a/assets/css/misuzu/warning.css b/assets/misuzu.css/warning.css similarity index 100% rename from assets/css/misuzu/warning.css rename to assets/misuzu.css/warning.css diff --git a/assets/js/misuzu/aembed.js b/assets/misuzu.js/aembed.js similarity index 99% rename from assets/js/misuzu/aembed.js rename to assets/misuzu.js/aembed.js index ee0fbd9..53e41bd 100644 --- a/assets/js/misuzu/aembed.js +++ b/assets/misuzu.js/aembed.js @@ -1,3 +1,6 @@ +#include utils.js +#include watcher.js + const MszAudioEmbedPlayerEvents = function() { return [ 'play', 'pause', 'stop', @@ -354,7 +357,6 @@ const MszAudioEmbedPlaceholder = function(metadata, options) { pub.insertBefore = function(ref) { $ib(ref, elem); }; pub.nuke = function() { $r(elem); - elem = null; }; pub.replaceElement = function(target) { $ib(target, elem); diff --git a/assets/js/misuzu/embed.js b/assets/misuzu.js/embed.js similarity index 98% rename from assets/js/misuzu/embed.js rename to assets/misuzu.js/embed.js index 467137e..39bfcaf 100644 --- a/assets/js/misuzu/embed.js +++ b/assets/misuzu.js/embed.js @@ -1,3 +1,9 @@ +#include utils.js +#include uiharu.js +#include aembed.js +#include iembed.js +#include vembed.js + var MszEmbed = (function() { let uiharu = undefined; diff --git a/assets/js/misuzu/events/christmas2019.js b/assets/misuzu.js/events/christmas2019.js similarity index 98% rename from assets/js/misuzu/events/christmas2019.js rename to assets/misuzu.js/events/christmas2019.js index 2bfa3c8..364f327 100644 --- a/assets/js/misuzu/events/christmas2019.js +++ b/assets/misuzu.js/events/christmas2019.js @@ -1,3 +1,5 @@ +#include utils.js + Misuzu.Events.Christmas2019 = function() { this.propName = propName = 'msz-christmas-' + (new Date).getFullYear().toString(); }; diff --git a/assets/js/misuzu/events/_events.js b/assets/misuzu.js/events/events.js similarity index 89% rename from assets/js/misuzu/events/_events.js rename to assets/misuzu.js/events/events.js index 9bfee0b..85b5998 100644 --- a/assets/js/misuzu/events/_events.js +++ b/assets/misuzu.js/events/events.js @@ -1,4 +1,7 @@ Misuzu.Events = {}; + +#include events/christmas2019.js + Misuzu.Events.getList = function() { return [ new Misuzu.Events.Christmas2019, diff --git a/assets/js/misuzu/forum/editor.js b/assets/misuzu.js/forum/editor.js similarity index 99% rename from assets/js/misuzu/forum/editor.js rename to assets/misuzu.js/forum/editor.js index 4c60ccd..f3c27c6 100644 --- a/assets/js/misuzu/forum/editor.js +++ b/assets/misuzu.js/forum/editor.js @@ -1,3 +1,5 @@ +#include forum/forum.js + Misuzu.Forum.Editor = {}; Misuzu.Forum.Editor.allowWindowClose = false; Misuzu.Forum.Editor.init = function() { diff --git a/assets/js/misuzu/forum/_forum.js b/assets/misuzu.js/forum/forum.js similarity index 100% rename from assets/js/misuzu/forum/_forum.js rename to assets/misuzu.js/forum/forum.js diff --git a/assets/js/misuzu/iembed.js b/assets/misuzu.js/iembed.js similarity index 97% rename from assets/js/misuzu/iembed.js rename to assets/misuzu.js/iembed.js index ba8c307..847258e 100644 --- a/assets/js/misuzu/iembed.js +++ b/assets/misuzu.js/iembed.js @@ -1,3 +1,5 @@ +#include utils.js + const MszImageEmbed = function(metadata, options, target) { options = options || {}; diff --git a/assets/js/misuzu/_main.js b/assets/misuzu.js/main.js similarity index 98% rename from assets/js/misuzu/_main.js rename to assets/misuzu.js/main.js index 1d9a161..2245e96 100644 --- a/assets/js/misuzu/_main.js +++ b/assets/misuzu.js/main.js @@ -1,3 +1,8 @@ +#include utils.js +#include embed.js +#include forum/editor.js +#include events/events.js + var Misuzu = function() { timeago.render($qa('time')); hljs.initHighlighting(); diff --git a/assets/js/misuzu/rng.js b/assets/misuzu.js/rng.js similarity index 100% rename from assets/js/misuzu/rng.js rename to assets/misuzu.js/rng.js diff --git a/assets/js/misuzu/uiharu.js b/assets/misuzu.js/uiharu.js similarity index 100% rename from assets/js/misuzu/uiharu.js rename to assets/misuzu.js/uiharu.js diff --git a/assets/js/misuzu/__extensions.js b/assets/misuzu.js/utils.js similarity index 98% rename from assets/js/misuzu/__extensions.js rename to assets/misuzu.js/utils.js index 20d761e..6e25ed7 100644 --- a/assets/js/misuzu/__extensions.js +++ b/assets/misuzu.js/utils.js @@ -125,6 +125,7 @@ const $e = function(info, attrs, child, created) { return elem; }; +const $er = (type, props, ...children) => $e({ tag: type, attrs: props, child: children }); const $ar = function(array, index) { array.splice(index, 1); diff --git a/assets/js/misuzu/vembed.js b/assets/misuzu.js/vembed.js similarity index 99% rename from assets/js/misuzu/vembed.js rename to assets/misuzu.js/vembed.js index 59960e4..f3a33a5 100644 --- a/assets/js/misuzu/vembed.js +++ b/assets/misuzu.js/vembed.js @@ -1,3 +1,7 @@ +#include utils.js +#include rng.js +#include watcher.js + const MszVideoEmbedPlayerEvents = function() { return [ 'play', 'pause', 'stop', @@ -890,7 +894,6 @@ const MszVideoEmbedPlaceholder = function(metadata, options) { pub.insertBefore = function(ref) { $ib(ref, elem); }; pub.nuke = function() { $r(elem); - elem = null; }; pub.replaceElement = function(target) { $ib(target, elem); diff --git a/assets/js/misuzu/watcher.js b/assets/misuzu.js/watcher.js similarity index 100% rename from assets/js/misuzu/watcher.js rename to assets/misuzu.js/watcher.js diff --git a/assets/utils.js b/assets/utils.js new file mode 100644 index 0000000..fb7a1dd --- /dev/null +++ b/assets/utils.js @@ -0,0 +1,31 @@ +const crypto = require('crypto'); + +const trim = function(str, chars, flags) { + if(chars === undefined) + chars = " \n\r\t\v\0"; + + let start = 0, + end = str.length; + + if(flags & 0x01) + while(start < end && chars.indexOf(str[start]) >= 0) + ++start; + + if(flags & 0x02) + while(end > start && chars.indexOf(str[end - 1]) >= 0) + --end; + + return (start > 0 || end < str.length) + ? str.substring(start, end) + : str; +}; + +exports.trimStart = (str, chars) => trim(str, chars, 0x01); +exports.trimEnd = (str, chars) => trim(str, chars, 0x02); +exports.trim = (str, chars) => trim(str, chars, 0x03); + +exports.shortHash = function(text) { + const hash = crypto.createHash('sha256'); + hash.update(text); + return hash.digest('hex').substring(0, 8); +}; diff --git a/build.js b/build.js new file mode 100644 index 0000000..5936544 --- /dev/null +++ b/build.js @@ -0,0 +1,89 @@ +const fs = require('fs'); +const swc = require('@swc/core'); +const path = require('path'); +const util = require('util'); +const postcss = require('postcss'); +const utils = require('./assets/utils.js'); +const assproc = require('./assets/assproc.js'); + +const rootDir = __dirname; +const modulesDir = path.join(rootDir, 'node_modules'); + +const assetsDir = path.join(rootDir, 'assets'); +const assetsCSS = path.join(assetsDir, 'misuzu.css'); +const assetsJS = path.join(assetsDir, 'misuzu.js'); +const assetsInfo = path.join(assetsDir, 'current.json'); + +const pubDir = path.join(rootDir, 'public'); +const pubIndex = path.join(pubDir, 'index.html'); +const pubAssets = '/assets'; +const pubAssetsFull = path.join(pubDir, pubAssets); +const pubAssetCSSFormat = '%s-%s.css'; +const pubAssetJSFormat = '%s-%s.js'; + +const isDebugBuild = fs.existsSync(path.join(rootDir, '.debug')); + +const swcJscOptions = { + target: 'es2016', + loose: false, + externalHelpers: false, + keepClassNames: true, + preserveAllComments: false, + transform: {}, + parser: { + syntax: 'ecmascript', + jsx: true, + dynamicImport: false, + privateMethod: false, + functionBind: false, + exportDefaultFrom: false, + exportNamespaceFrom: false, + decorators: false, + decoratorsBeforeExport: false, + topLevelAwait: true, + importMeta: false, + }, + transform: { + react: { + runtime: 'classic', + pragma: '$er', + }, + }, +}; + +const postcssPlugins = []; +if(!isDebugBuild) postcssPlugins.push(require('cssnano')); +postcssPlugins.push(require('autoprefixer')({ + remove: false, +})); + +fs.mkdirSync(pubAssetsFull, { recursive: true }); + +(async () => { + const mszCssName = await assproc.process(assetsCSS, { 'prefix': '@', 'entry': 'main.css' }) + .then(output => postcss(postcssPlugins).process(output, { from: assetsCSS }).then(output => { + const mszCssName = path.join(pubAssets, util.format(pubAssetCSSFormat, 'misuzu', utils.shortHash(output.css))); + fs.writeFileSync(path.join(pubDir, mszCssName), output.css); + return mszCssName; + })); + + const mszJsName = await assproc.process(assetsJS, { 'prefix': '#', 'entry': 'main.js' }) + .then(output => swc.transform(output, { + filename: 'misuzu.js', + sourceMaps: false, + isModule: false, + minify: !isDebugBuild, + jsc: swcJscOptions, + }).then(async output => { + const mszJsName = path.join(pubAssets, util.format(pubAssetJSFormat, 'misuzu', utils.shortHash(output.code))); + fs.writeFileSync(path.join(pubDir, mszJsName), output.code); + return mszJsName; + })); + + fs.writeFileSync(assetsInfo, JSON.stringify({ + mszjs: mszJsName, + mszcss: mszCssName, + })); + + assproc.housekeep(pubAssetsFull); +})(); diff --git a/misuzu.php b/misuzu.php index 419d36c..6896727 100644 --- a/misuzu.php +++ b/misuzu.php @@ -22,6 +22,7 @@ define('MSZ_LIBRARIES', MSZ_ROOT . '/lib'); define('MSZ_CONFIG', MSZ_ROOT . '/config'); define('MSZ_TEMPLATES', MSZ_ROOT . '/templates'); define('MSZ_MIGRATIONS', MSZ_ROOT . '/database'); +define('MSZ_ASSETS', MSZ_ROOT . '/assets'); define('MSZ_NDX_PATH', MSZ_LIBRARIES . '/index'); define('MSZ_NDX_PATH_DEV', MSZ_LIBRARIES . '/index-dev'); @@ -148,6 +149,11 @@ Template::set('globals', [ ], ]); +$mszAssetsInfo = json_decode(file_get_contents(MSZ_ASSETS . '/current.json')); +if(!empty($mszAssetsInfo)) + Template::set('assets', $mszAssetsInfo); +unset($mszAssetsInfo); + Template::addPath(MSZ_TEMPLATES); AuthToken::setSecretKey($cfg->getValue('auth.secret', IConfig::T_STR, 'meow')); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..d003265 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1139 @@ +{ + "name": "edgii.net", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@swc/core": "^1.3.69", + "autoprefixer": "^10.4.14", + "cssnano": "^6.0.1", + "postcss": "^8.4.26" + } + }, + "node_modules/@swc/core": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.3.69.tgz", + "integrity": "sha512-Khc/DE9D5+2tYTHgAIp5DZARbs8kldWg3b0Jp6l8FQLjelcLFmlQWSwKhVZrgv4oIbgZydIp8jInsvTalMHqnQ==", + "hasInstallScript": true, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/swc" + }, + "optionalDependencies": { + "@swc/core-darwin-arm64": "1.3.69", + "@swc/core-darwin-x64": "1.3.69", + "@swc/core-linux-arm-gnueabihf": "1.3.69", + "@swc/core-linux-arm64-gnu": "1.3.69", + "@swc/core-linux-arm64-musl": "1.3.69", + "@swc/core-linux-x64-gnu": "1.3.69", + "@swc/core-linux-x64-musl": "1.3.69", + "@swc/core-win32-arm64-msvc": "1.3.69", + "@swc/core-win32-ia32-msvc": "1.3.69", + "@swc/core-win32-x64-msvc": "1.3.69" + }, + "peerDependencies": { + "@swc/helpers": "^0.5.0" + }, + "peerDependenciesMeta": { + "@swc/helpers": { + "optional": true + } + } + }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.69.tgz", + "integrity": "sha512-IjZTf12zIPWkV3D7toaLDoJPSkLhQ4fDH8G6/yCJUI27cBFOI3L8LXqptYmISoN5yYdrcnNpdqdapD09JPuNJg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-darwin-x64": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.69.tgz", + "integrity": "sha512-/wBO0Rn5oS5dJI/L9kJRkPAdksVwl5H9nleW/NM3A40N98VV8T7h/i1nO051mxIjq0R6qXVGOWFbBoLrPYucJg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm-gnueabihf": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.69.tgz", + "integrity": "sha512-NShCjMv6Xn8ckMKBRqmprXvUF14+jXY0TcNKXwjYErzoIUFOnG72M36HxT4QEeAtKZ4Eg4CZFE4zlJ27fDp1gg==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-gnu": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.69.tgz", + "integrity": "sha512-VRPOJj4idopSHIj1bOVXX0SgaB18R8yZNunb7eXS5ZcjVxAcdvqyIz3RdQX1zaJFCGzcdPLzBRP32DZWWGE8Ng==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-arm64-musl": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.69.tgz", + "integrity": "sha512-QxeSiZqo5x1X8vq8oUWLibq+IZJcxl9vy0sLUmzdjF2b/Z+qxKP3gutxnb2tzJaHqPVBbEZaILERIGy1qWdumQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-gnu": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.69.tgz", + "integrity": "sha512-b+DUlVxYox3BwD3PyTwhLvqtu6TYZtW+S6O0FnttH11o4skHN0XyJ/cUZSI0X2biSmfDsizRDUt1PWPFM+F7SA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-linux-x64-musl": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.69.tgz", + "integrity": "sha512-QXjsI+f8n9XPZHUvmGgkABpzN4M9kdSbhqBOZmv3o0AsDGNCA4uVowQqgZoPFAqlJTpwHeDmrv5sQ13HN+LOGw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-arm64-msvc": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.69.tgz", + "integrity": "sha512-wn7A8Ws1fyviuCUB2Vg6IotiZeuqiO1Mz3d+YDae2EYyNpj1kNHvjBip8GHkfGzZG+jVrvG6NHsDo0KO/pGb8A==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-ia32-msvc": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.69.tgz", + "integrity": "sha512-LsFBXtXqxEcVaaOGEZ9X3qdMzobVoJqKv8DnksuDsWcBk+9WCeTz2u/iB+7yZ2HGuPXkCqTRqhFo6FX9aC00kQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@swc/core-win32-x64-msvc": { + "version": "1.3.69", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.69.tgz", + "integrity": "sha512-ieBscU0gUgKjaseFI07tAaGqHvKyweNknPeSYEZOasVZUczhD6fK2GRnVREhv2RB2qdKC/VGFBsgRDMgzq1VLw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=10" + } + }, + "node_modules/@trysound/sax": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", + "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/autoprefixer": { + "version": "10.4.14", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz", + "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + } + ], + "dependencies": { + "browserslist": "^4.21.5", + "caniuse-lite": "^1.0.30001464", + "fraction.js": "^4.2.0", + "normalize-range": "^0.1.2", + "picocolors": "^1.0.0", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + }, + "node_modules/browserslist": { + "version": "4.21.9", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.9.tgz", + "integrity": "sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001503", + "electron-to-chromium": "^1.4.431", + "node-releases": "^2.0.12", + "update-browserslist-db": "^1.0.11" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/caniuse-api": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-3.0.0.tgz", + "integrity": "sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==", + "dependencies": { + "browserslist": "^4.0.0", + "caniuse-lite": "^1.0.0", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001516", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001516.tgz", + "integrity": "sha512-Wmec9pCBY8CWbmI4HsjBeQLqDTqV91nFVR83DnZpYyRnPI1wePDsTg0bGLPC5VU/3OIZV1fmxEea1b+tFKe86g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==" + }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/css-declaration-sorter": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz", + "integrity": "sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==", + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.0.9" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-tree": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "dependencies": { + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cssnano": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.0.1.tgz", + "integrity": "sha512-fVO1JdJ0LSdIGJq68eIxOqFpIJrZqXUsBt8fkrBcztCQqAjQD51OhZp7tc0ImcbwXD4k7ny84QTV90nZhmqbkg==", + "dependencies": { + "cssnano-preset-default": "^6.0.1", + "lilconfig": "^2.1.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/cssnano" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/cssnano-preset-default": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.0.1.tgz", + "integrity": "sha512-7VzyFZ5zEB1+l1nToKyrRkuaJIx0zi/1npjvZfbBwbtNTzhLtlvYraK/7/uqmX2Wb2aQtd983uuGw79jAjLSuQ==", + "dependencies": { + "css-declaration-sorter": "^6.3.1", + "cssnano-utils": "^4.0.0", + "postcss-calc": "^9.0.0", + "postcss-colormin": "^6.0.0", + "postcss-convert-values": "^6.0.0", + "postcss-discard-comments": "^6.0.0", + "postcss-discard-duplicates": "^6.0.0", + "postcss-discard-empty": "^6.0.0", + "postcss-discard-overridden": "^6.0.0", + "postcss-merge-longhand": "^6.0.0", + "postcss-merge-rules": "^6.0.1", + "postcss-minify-font-values": "^6.0.0", + "postcss-minify-gradients": "^6.0.0", + "postcss-minify-params": "^6.0.0", + "postcss-minify-selectors": "^6.0.0", + "postcss-normalize-charset": "^6.0.0", + "postcss-normalize-display-values": "^6.0.0", + "postcss-normalize-positions": "^6.0.0", + "postcss-normalize-repeat-style": "^6.0.0", + "postcss-normalize-string": "^6.0.0", + "postcss-normalize-timing-functions": "^6.0.0", + "postcss-normalize-unicode": "^6.0.0", + "postcss-normalize-url": "^6.0.0", + "postcss-normalize-whitespace": "^6.0.0", + "postcss-ordered-values": "^6.0.0", + "postcss-reduce-initial": "^6.0.0", + "postcss-reduce-transforms": "^6.0.0", + "postcss-svgo": "^6.0.0", + "postcss-unique-selectors": "^6.0.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/cssnano-utils": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.0.tgz", + "integrity": "sha512-Z39TLP+1E0KUcd7LGyF4qMfu8ZufI0rDzhdyAMsa/8UyNUU8wpS0fhdBxbQbv32r64ea00h4878gommRVg2BHw==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==" + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.461", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.461.tgz", + "integrity": "sha512-1JkvV2sgEGTDXjdsaQCeSwYYuhLRphRpc+g6EHTFELJXEiznLt3/0pZ9JuAOQ5p2rI3YxKTbivtvajirIfhrEQ==" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/fraction.js": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", + "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://www.patreon.com/infusion" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==" + }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" + }, + "node_modules/mdn-data": { + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==" + }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/postcss": { + "version": "8.4.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.26.tgz", + "integrity": "sha512-jrXHFF8iTloAenySjM/ob3gSj7pCu0Ji49hnjqzsgSRa50hkWCKD0HQ+gMNJkW38jBI68MpAAg7ZWwHwX8NMMw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-calc": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", + "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", + "dependencies": { + "postcss-selector-parser": "^6.0.11", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.2" + } + }, + "node_modules/postcss-colormin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.0.0.tgz", + "integrity": "sha512-EuO+bAUmutWoZYgHn2T1dG1pPqHU6L4TjzPlu4t1wZGXQ/fxV16xg2EJmYi0z+6r+MGV1yvpx1BHkUaRrPa2bw==", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "colord": "^2.9.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-convert-values": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.0.0.tgz", + "integrity": "sha512-U5D8QhVwqT++ecmy8rnTb+RL9n/B806UVaS3m60lqle4YDFcpbS3ae5bTQIh3wOGUSDHSEtMYLs/38dNG7EYFw==", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-discard-comments": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.0.tgz", + "integrity": "sha512-p2skSGqzPMZkEQvJsgnkBhCn8gI7NzRH2683EEjrIkoMiwRELx68yoUJ3q3DGSGuQ8Ug9Gsn+OuDr46yfO+eFw==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-discard-duplicates": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.0.tgz", + "integrity": "sha512-bU1SXIizMLtDW4oSsi5C/xHKbhLlhek/0/yCnoMQany9k3nPBq+Ctsv/9oMmyqbR96HYHxZcHyK2HR5P/mqoGA==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-discard-empty": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.0.tgz", + "integrity": "sha512-b+h1S1VT6dNhpcg+LpyiUrdnEZfICF0my7HAKgJixJLW7BnNmpRH34+uw/etf5AhOlIhIAuXApSzzDzMI9K/gQ==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-discard-overridden": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.0.tgz", + "integrity": "sha512-4VELwssYXDFigPYAZ8vL4yX4mUepF/oCBeeIT4OXsJPYOtvJumyz9WflmJWTfDwCUcpDR+z0zvCWBXgTx35SVw==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-merge-longhand": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.0.tgz", + "integrity": "sha512-4VSfd1lvGkLTLYcxFuISDtWUfFS4zXe0FpF149AyziftPFQIWxjvFSKhA4MIxMe4XM3yTDgQMbSNgzIVxChbIg==", + "dependencies": { + "postcss-value-parser": "^4.2.0", + "stylehacks": "^6.0.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-merge-rules": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.0.1.tgz", + "integrity": "sha512-a4tlmJIQo9SCjcfiCcCMg/ZCEe0XTkl/xK0XHBs955GWg9xDX3NwP9pwZ78QUOWB8/0XCjZeJn98Dae0zg6AAw==", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "cssnano-utils": "^4.0.0", + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-minify-font-values": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.0.0.tgz", + "integrity": "sha512-zNRAVtyh5E8ndZEYXA4WS8ZYsAp798HiIQ1V2UF/C/munLp2r1UGHwf1+6JFu7hdEhJFN+W1WJQKBrtjhFgEnA==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-minify-gradients": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.0.tgz", + "integrity": "sha512-wO0F6YfVAR+K1xVxF53ueZJza3L+R3E6cp0VwuXJQejnNUH0DjcAFe3JEBeTY1dLwGa0NlDWueCA1VlEfiKgAA==", + "dependencies": { + "colord": "^2.9.1", + "cssnano-utils": "^4.0.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-minify-params": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.0.0.tgz", + "integrity": "sha512-Fz/wMQDveiS0n5JPcvsMeyNXOIMrwF88n7196puSuQSWSa+/Ofc1gDOSY2xi8+A4PqB5dlYCKk/WfqKqsI+ReQ==", + "dependencies": { + "browserslist": "^4.21.4", + "cssnano-utils": "^4.0.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-minify-selectors": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.0.tgz", + "integrity": "sha512-ec/q9JNCOC2CRDNnypipGfOhbYPuUkewGwLnbv6omue/PSASbHSU7s6uSQ0tcFRVv731oMIx8k0SP4ZX6be/0g==", + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-charset": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.0.tgz", + "integrity": "sha512-cqundwChbu8yO/gSWkuFDmKrCZ2vJzDAocheT2JTd0sFNA4HMGoKMfbk2B+J0OmO0t5GUkiAkSM5yF2rSLUjgQ==", + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-display-values": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.0.tgz", + "integrity": "sha512-Qyt5kMrvy7dJRO3OjF7zkotGfuYALETZE+4lk66sziWSPzlBEt7FrUshV6VLECkI4EN8Z863O6Nci4NXQGNzYw==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-positions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.0.tgz", + "integrity": "sha512-mPCzhSV8+30FZyWhxi6UoVRYd3ZBJgTRly4hOkaSifo0H+pjDYcii/aVT4YE6QpOil15a5uiv6ftnY3rm0igPg==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-repeat-style": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.0.tgz", + "integrity": "sha512-50W5JWEBiOOAez2AKBh4kRFm2uhrT3O1Uwdxz7k24aKtbD83vqmcVG7zoIwo6xI2FZ/HDlbrCopXhLeTpQib1A==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-string": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.0.tgz", + "integrity": "sha512-KWkIB7TrPOiqb8ZZz6homet2KWKJwIlysF5ICPZrXAylGe2hzX/HSf4NTX2rRPJMAtlRsj/yfkrWGavFuB+c0w==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-timing-functions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.0.tgz", + "integrity": "sha512-tpIXWciXBp5CiFs8sem90IWlw76FV4oi6QEWfQwyeREVwUy39VSeSqjAT7X0Qw650yAimYW5gkl2Gd871N5SQg==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-unicode": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.0.0.tgz", + "integrity": "sha512-ui5crYkb5ubEUDugDc786L/Me+DXp2dLg3fVJbqyAl0VPkAeALyAijF2zOsnZyaS1HyfPuMH0DwyY18VMFVNkg==", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-url": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.0.tgz", + "integrity": "sha512-98mvh2QzIPbb02YDIrYvAg4OUzGH7s1ZgHlD3fIdTHLgPLRpv1ZTKJDnSAKr4Rt21ZQFzwhGMXxpXlfrUBKFHw==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-normalize-whitespace": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.0.tgz", + "integrity": "sha512-7cfE1AyLiK0+ZBG6FmLziJzqQCpTQY+8XjMhMAz8WSBSCsCNNUKujgIgjCAmDT3cJ+3zjTXFkoD15ZPsckArVw==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-ordered-values": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.0.tgz", + "integrity": "sha512-K36XzUDpvfG/nWkjs6d1hRBydeIxGpKS2+n+ywlKPzx1nMYDYpoGbcjhj5AwVYJK1qV2/SDoDEnHzlPD6s3nMg==", + "dependencies": { + "cssnano-utils": "^4.0.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-reduce-initial": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.0.0.tgz", + "integrity": "sha512-s2UOnidpVuXu6JiiI5U+fV2jamAw5YNA9Fdi/GRK0zLDLCfXmSGqQtzpUPtfN66RtCbb9fFHoyZdQaxOB3WxVA==", + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-reduce-transforms": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.0.tgz", + "integrity": "sha512-FQ9f6xM1homnuy1wLe9lP1wujzxnwt1EwiigtWwuyf8FsqqXUDUp2Ulxf9A5yjlUOTdCJO6lonYjg1mgqIIi2w==", + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-svgo": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.0.tgz", + "integrity": "sha512-r9zvj/wGAoAIodn84dR/kFqwhINp5YsJkLoujybWG59grR/IHx+uQ2Zo+IcOwM0jskfYX3R0mo+1Kip1VSNcvw==", + "dependencies": { + "postcss-value-parser": "^4.2.0", + "svgo": "^3.0.2" + }, + "engines": { + "node": "^14 || ^16 || >= 18" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-unique-selectors": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.0.tgz", + "integrity": "sha512-EPQzpZNxOxP7777t73RQpZE5e9TrnCrkvp7AH7a0l89JmZiPnS82y216JowHXwpBCQitfyxrof9TK3rYbi7/Yw==", + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stylehacks": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.0.0.tgz", + "integrity": "sha512-+UT589qhHPwz6mTlCLSt/vMNTJx8dopeJlZAlBMJPWA3ORqu6wmQY7FBXf+qD+FsqoBJODyqNxOUP3jdntFRdw==", + "dependencies": { + "browserslist": "^4.21.4", + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/svgo": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.0.2.tgz", + "integrity": "sha512-Z706C1U2pb1+JGP48fbazf3KxHrWOsLme6Rv7imFBn5EnuanDW1GPaA/P1/dvObE670JDePC3mnj0k0B7P0jjQ==", + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "csso": "^5.0.5", + "picocolors": "^1.0.0" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..391b867 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "@swc/core": "^1.3.69", + "autoprefixer": "^10.4.14", + "cssnano": "^6.0.1", + "postcss": "^8.4.26" + } +} diff --git a/src/Http/Handlers/AssetsHandler.php b/src/Http/Handlers/AssetsHandler.php index 9b592f8..d942dfb 100644 --- a/src/Http/Handlers/AssetsHandler.php +++ b/src/Http/Handlers/AssetsHandler.php @@ -10,69 +10,11 @@ use Misuzu\Users\Assets\UserImageAssetInterface; use Misuzu\Users\Assets\UserAssetScalableInterface; final class AssetsHandler extends Handler { - private const TYPES = [ - 'js' => [ - 'root' => MSZ_ROOT . '/assets/js', - 'mime' => 'application/javascript; charset=utf-8', - ], - 'css' => [ - 'root' => MSZ_ROOT . '/assets/css', - 'mime' => 'text/css; charset=utf-8', - ], - ]; - public function __construct(MisuzuContext $context) { $GLOBALS['misuzuBypassLockdown'] = true; parent::__construct($context); } - private static function recurse(string $dir): string { - $str = ''; - $dir = rtrim(realpath($dir), '/') . '/*'; - $dirs = []; - - foreach(glob($dir) as $path) { - if(is_dir($path)) { - $dirs[] = $path; - continue; - } - - if(MSZ_DEBUG) - $str .= "/*** {$path} ***/\n"; - $str .= trim(file_get_contents($path)); - $str .= "\n\n"; - } - - foreach($dirs as $path) - $str .= self::recurse($path); - - return $str; - } - - public function serveComponent($response, $request, string $fileName) { - $name = pathinfo($fileName, PATHINFO_FILENAME); - $type = pathinfo($fileName, PATHINFO_EXTENSION); - - $entityTag = sprintf('%s.%s/%s', $name, $type, GitInfo::hash()); - - if(!MSZ_DEBUG && $name === 'debug') - return 404; - if(!MSZ_DEBUG && $request->getHeaderFirstLine('If-None-Match') === '"' . $entityTag . '"') - return 304; - - if(array_key_exists($type, self::TYPES)) { - $type = self::TYPES[$type]; - $path = ($type['root'] ?? '') . '/' . $name; - - if(is_dir($path)) { - $response->setContentType($type['mime'] ?? 'application/octet-stream'); - $response->setCacheControl(MSZ_DEBUG ? 'no-cache' : 'must-revalidate'); - $response->setEntityTag($entityTag); - return self::recurse($path); - } - } - } - private function canViewAsset($request, User $assetUser): bool { return !$assetUser->isBanned() || ( User::hasCurrent() diff --git a/src/MisuzuContext.php b/src/MisuzuContext.php index 3efe72b..0439140 100644 --- a/src/MisuzuContext.php +++ b/src/MisuzuContext.php @@ -126,7 +126,6 @@ class MisuzuContext { $this->router->get('/', $mszCompatHandler('Home', 'index')); - $this->router->get('/assets/:filename', $mszCompatHandler('Assets', 'serveComponent')); $this->router->get('/assets/avatar/:filename', $mszCompatHandler('Assets', 'serveAvatar')); $this->router->get('/assets/profile-background/:filename', $mszCompatHandler('Assets', 'serveProfileBackground')); diff --git a/templates/500.html b/templates/500.html index f47560c..4903f04 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,7 +1,7 @@ - + Error 500