From 2ad2e969f3ab66e71d400c3631e35f7bbe60e2ea Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sat, 11 Jul 2026 21:10:53 +0200 Subject: [PATCH] tgui fixes (#19602) * tgui fixes * typing * use direct paths --- biome.json | 2 +- bun.lock | 24 +- package.json | 4 +- tgui/bun.lock | 96 +++++--- tgui/package.json | 6 +- tgui/packages/tgui-dev-server/link/server.ts | 4 +- tgui/packages/tgui-panel/package.json | 2 +- tgui/packages/tgui-setup/package.json | 2 +- .../BorgHypo/BorgHypoRecipeDisplay.tsx | 2 +- .../CharacterDirectoryViewCharacter.tsx | 2 +- .../ChemDispenser/ChemDispenserBeaker.tsx | 5 +- .../ChemMaster/ChemMasterBeaker.tsx | 60 ++--- .../ChemMaster/ChemMasterBuffer.tsx | 5 +- .../ChemMaster/ChemMasterCustomization.tsx | 3 +- .../ChemMasterProductionChemical.tsx | 3 +- .../ChemMasterProductionCondiment.tsx | 3 +- .../tgui/interfaces/ChemMaster/index.tsx | 10 +- .../interfaces/ChessCheckers/PlayerMenu.tsx | 5 +- .../tgui/interfaces/ColorPickerModal.tsx | 44 ++-- .../tgui/interfaces/DNAModifier/index.tsx | 3 +- .../interfaces/Fabrication/DesignBrowser.tsx | 2 +- .../GeneralRecordsViewGeneral.tsx | 3 +- .../interfaces/GeneralRecords/functions.ts | 3 +- .../tgui/interfaces/GeneralRecords/index.tsx | 9 +- .../tgui/interfaces/ICAssembly/Plane.tsx | 6 +- .../tgui/interfaces/MaterialStack.tsx | 205 ------------------ .../MaterialStack/RecipeElement.tsx | 104 +++++++++ .../interfaces/MaterialStack/RecipeList.tsx | 53 +++++ .../interfaces/MaterialStack/functions.ts | 31 +++ .../tgui/interfaces/MaterialStack/index.tsx | 35 +++ .../tgui/interfaces/MaterialStack/types.ts | 14 ++ .../MedicalRecordsViewMedical.tsx | 3 +- .../tgui/interfaces/MedicalRecords/index.tsx | 13 +- .../MessageMonitor/MessageMonitorHack.tsx | 3 +- .../MessageMonitor/MessageMonitorLogin.tsx | 3 +- .../tgui/interfaces/MessageMonitor/index.tsx | 3 +- .../ModifyRobot/ModifyRobotNoModule.tsx | 3 +- .../tgui/interfaces/Newscaster/index.tsx | 3 +- .../tgui/interfaces/SecurityRecords/index.tsx | 9 +- .../interfaces/SpaceBattle/PlayerMenu.tsx | 5 +- .../interfaces/SpawnPanel/CreateObject.tsx | 4 +- .../CreateObjectAdvancedSettings.tsx | 4 +- .../SpawnPanel/CreateObjectSettings.tsx | 4 +- .../tgui/interfaces/SpawnPanel/index.tsx | 4 +- .../tgui/interfaces/SpawnPanel/types.ts | 20 +- .../tgui/interfaces/Techweb/helpers.ts | 2 +- .../interfaces/common/ChemicalContents.tsx | 71 ++++-- tgui/packages/tgui/package.json | 6 +- tools/build/build.ts | 3 - 49 files changed, 497 insertions(+), 416 deletions(-) delete mode 100644 tgui/packages/tgui/interfaces/MaterialStack.tsx create mode 100644 tgui/packages/tgui/interfaces/MaterialStack/RecipeElement.tsx create mode 100644 tgui/packages/tgui/interfaces/MaterialStack/RecipeList.tsx create mode 100644 tgui/packages/tgui/interfaces/MaterialStack/functions.ts create mode 100644 tgui/packages/tgui/interfaces/MaterialStack/index.tsx create mode 100644 tgui/packages/tgui/interfaces/MaterialStack/types.ts diff --git a/biome.json b/biome.json index 583dc8a933..190c0eea10 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.5.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.3/schema.json", "assist": { "actions": { "source": { diff --git a/bun.lock b/bun.lock index 9b3e4c04cd..3c4ddc8538 100644 --- a/bun.lock +++ b/bun.lock @@ -4,30 +4,30 @@ "workspaces": { "": { "devDependencies": { - "@biomejs/biome": "^2.5.1", - "prettier": "^3.9.1", + "@biomejs/biome": "^2.5.3", + "prettier": "^3.9.5", }, }, }, "packages": { - "@biomejs/biome": ["@biomejs/biome@2.5.1", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.5.1", "@biomejs/cli-darwin-x64": "2.5.1", "@biomejs/cli-linux-arm64": "2.5.1", "@biomejs/cli-linux-arm64-musl": "2.5.1", "@biomejs/cli-linux-x64": "2.5.1", "@biomejs/cli-linux-x64-musl": "2.5.1", "@biomejs/cli-win32-arm64": "2.5.1", "@biomejs/cli-win32-x64": "2.5.1" }, "bin": { "biome": "bin/biome" } }, "sha512-IXWLCxKmae+rI7LOHS1B3EbVisQ6GRAWbhN9msa6KjNCyFWrvKZWR4oUdinaNssrV852OrSHuSPa95h1GPJc7Q=="], + "@biomejs/biome": ["@biomejs/biome@2.5.3", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.5.3", "@biomejs/cli-darwin-x64": "2.5.3", "@biomejs/cli-linux-arm64": "2.5.3", "@biomejs/cli-linux-arm64-musl": "2.5.3", "@biomejs/cli-linux-x64": "2.5.3", "@biomejs/cli-linux-x64-musl": "2.5.3", "@biomejs/cli-win32-arm64": "2.5.3", "@biomejs/cli-win32-x64": "2.5.3" }, "bin": { "biome": "bin/biome" } }, "sha512-MrJswFdei9EfDwwUy2tQrPDpK0AO+RmMFvBoaaJ6ayBc3sUbHdCE+XG5N8vp+5So41ZupZJQm0roHFFhMGVD7A=="], - "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.5.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-npqDzvqv7vFaWRiNN1Te71siRgPaqS9MpqgYCdP/CrUbkJ7ApezaeaKjueKHRN/JH/6lRjJQAHi8acQDCAz22w=="], + "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.5.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-QhYP9muVQ0nUO5zztFuPbEwi4+94sJWVjaZds9aMi1l/KNZBiUjdiSUrGHsTaMGDXrYl+r4AS2sUKfgH3w+V3g=="], - "@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.5.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-RgwTqPAM8g2tn1j+b5oRjF/DbSBX8a4gwojtuG9XuhfK7GgomvZ9+T+tqjXiVbjLEeGJOoL6VEk8mvRTVeSybw=="], + "@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.5.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-NC1Ss13UaW7QZX+y8j44bF7AP0jSJdBl6iRhe0MAkvaSqZy+mWg3GaXsrb+eSoHoGDBtaXWEbMVV0iVN2cZ7cQ=="], - "@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.5.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-yhV35CzZh38VyMvTEXi3JTjxZBs++oCKK9KG8vB6VI5+uvQvZNR3BFWEKKzuOmx9DJJj7sQpZ4LQJcmbGTs3+Q=="], + "@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.5.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-ksx1KWeyYW18ILL04msF/J4ZBtBDN33znYK8Z/aNv/vlBVxL9/g3mGP+omgHJKy4+KWbK87vcmmpmurfNjSgiA=="], - "@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.5.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-WMcvMLgByyTqVxGlq918NBBYliq9FRR9GAQVETHb+VjGVqXCZFfHlZHC1FX4ibuYY/Hg6TJE3rHU0xVrdJXNRw=="], + "@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.5.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-fccix0w6xp6csCXgxeC0dU/3ecgRQal0y+cv2SP9ajNlhe7Yrk2Ug7UDe2j9AT9ZDYitkXpvUKgZjjuoYeP4Vg=="], - "@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-J/7uHSX7NfoYDI7HijAkd8lnQIOrRb2W7j3X+tw4R+N5ExvXGsyXFiGdQcfcxfOmNQmZVSQOCDk757fwpzqQcg=="], + "@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.5.3", "", { "os": "linux", "cpu": "x64" }, "sha512-yMkJtilsgvILDcVkh187aVLTb64xYsrxYajx5kym+r1ULkO5HUOfu9AYKLGQbOVLwJtT2utNw7hhFNg+17mUYA=="], - "@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-ANTowtlLmPYm5yeMckWY8Xzb9Ix+JJP3tgHR/n6xRj1VWyIzzWtfRfih9hv9VmClwadpBvZduISZIbBsIlYG3A=="], + "@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.5.3", "", { "os": "linux", "cpu": "x64" }, "sha512-O/yU9YKRUiHhmcjF2f38PSjseVk3G4VLWYc0G2HWpzdBVREV6G8IGWIVEFf7MFPfWIzNUIvPsEjeAZQIOgnLcQ=="], - "@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.5.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-zgXnKNgWPC4iPF7Y1lR3STUeCUuZRpD6IiOrC7TZTlh0Lx6FiVUT05myuMQHQ9D+1cc7uyMldi4forE6lp0ivQ=="], + "@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.5.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-cX5z+GYwRcqEok0AH3KSfQGgqYd0Nomfp6Fbe1uiTtELE38hdH2k842wQ9wLNaF/JJ7r4rjJQ4VR+ce+fRmQbw=="], - "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.5.1", "", { "os": "win32", "cpu": "x64" }, "sha512-6uxpR9hvaglANkZemeSiN/FhYgkGasrEGn267eXIWvjrjJ2LhDlk251IhjVJq6MXzkV2/bcXwLwSroLyPtqRZg=="], + "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.5.3", "", { "os": "win32", "cpu": "x64" }, "sha512-ExSaJWi4/u6+GXCszlSKpWSjKNbDseAYqqkCznsCsZ/4uidZ/BEqsCc5/3ctlq6dfIubdIIRSVLC/PG9xPl70Q=="], - "prettier": ["prettier@3.9.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-ppiDo2CSwexck1eyZUwJHg/N3nf1+6IRCv7W/VJ5vaLnVCmB7+3CdRfMwoCHBBX6xTrREDTksZ4OZl5SSf4zXA=="], + "prettier": ["prettier@3.9.5", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg=="], } } diff --git a/package.json b/package.json index 26334452e8..9a2a48218e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "devDependencies": { - "@biomejs/biome": "^2.5.1", - "prettier": "^3.9.1" + "@biomejs/biome": "^2.5.3", + "prettier": "^3.9.5" }, "scripts": { "tgui:fix": "biome check --write --unsafe tgui", diff --git a/tgui/bun.lock b/tgui/bun.lock index c809ff4c71..bf1caa7122 100644 --- a/tgui/bun.lock +++ b/tgui/bun.lock @@ -6,8 +6,8 @@ "name": "tgui-workspace", "devDependencies": { "@happy-dom/global-registrator": "^20.10.6", - "@rspack/cli": "^2.1.2", - "@rspack/core": "^2.1.2", + "@rspack/cli": "^2.1.3", + "@rspack/core": "^2.1.3", "@testing-library/react": "^16.3.2", "@types/bun": "^1.3.14", "@types/react": "^19.2.17", @@ -17,7 +17,7 @@ "css-loader": "^7.1.4", "sass-embedded": "^1.100.0", "sass-loader": "^17.0.0", - "typescript": "^6.0.3", + "typescript": "^7.0.2", }, }, "packages/common": { @@ -42,13 +42,13 @@ "dependencies": { "common": "workspace:*", "dateformat": "^5.0.3", - "dompurify": "^3.4.11", + "dompurify": "^3.4.12", "es-toolkit": "^1.49.0", "highlight.js": "^11.11.1", "jotai": "^2.20.1", "js-yaml": "^5.2.1", - "marked": "^18.0.5", - "marked-base-url": "^1.1.9", + "marked": "^18.0.6", + "marked-base-url": "^1.1.10", "marked-smartypants": "^1.1.12", "react": "^19.2.7", "react-dom": "^19.2.7", @@ -71,7 +71,7 @@ "version": "6.0.0", "dependencies": { "common": "workspace:*", - "dompurify": "^3.4.11", + "dompurify": "^3.4.12", "es-toolkit": "^1.49.0", "jotai": "^2.20.1", "react": "^19.2.7", @@ -98,7 +98,7 @@ "version": "0.0.1", "dependencies": { "clean-css-cli": "^5.6.3", - "terser": "^5.48.0", + "terser": "^5.49.0", }, }, }, @@ -181,35 +181,35 @@ "@pkgjs/parseargs": ["@pkgjs/parseargs@0.11.0", "", {}, "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg=="], - "@rspack/binding": ["@rspack/binding@2.1.2", "", { "optionalDependencies": { "@rspack/binding-darwin-arm64": "2.1.2", "@rspack/binding-darwin-x64": "2.1.2", "@rspack/binding-linux-arm64-gnu": "2.1.2", "@rspack/binding-linux-arm64-musl": "2.1.2", "@rspack/binding-linux-riscv64-gnu": "2.1.2", "@rspack/binding-linux-riscv64-musl": "2.1.2", "@rspack/binding-linux-x64-gnu": "2.1.2", "@rspack/binding-linux-x64-musl": "2.1.2", "@rspack/binding-wasm32-wasi": "2.1.2", "@rspack/binding-win32-arm64-msvc": "2.1.2", "@rspack/binding-win32-ia32-msvc": "2.1.2", "@rspack/binding-win32-x64-msvc": "2.1.2" } }, "sha512-/mFcRSUW7Pl19KeaBIujJvZYNJQu0wD5D3aa5h+Qcph26v7nmLYlX7eajIHGi8tt2qTZX1lXifw2KLIXKwYaRQ=="], + "@rspack/binding": ["@rspack/binding@2.1.3", "", { "optionalDependencies": { "@rspack/binding-darwin-arm64": "2.1.3", "@rspack/binding-darwin-x64": "2.1.3", "@rspack/binding-linux-arm64-gnu": "2.1.3", "@rspack/binding-linux-arm64-musl": "2.1.3", "@rspack/binding-linux-riscv64-gnu": "2.1.3", "@rspack/binding-linux-riscv64-musl": "2.1.3", "@rspack/binding-linux-x64-gnu": "2.1.3", "@rspack/binding-linux-x64-musl": "2.1.3", "@rspack/binding-wasm32-wasi": "2.1.3", "@rspack/binding-win32-arm64-msvc": "2.1.3", "@rspack/binding-win32-ia32-msvc": "2.1.3", "@rspack/binding-win32-x64-msvc": "2.1.3" } }, "sha512-4UGXJqUHmm36tWG1GgFZz3p8sQ5JuSgWI+gq1xPPoihS41uYJL3cXuJnirTeWsmVrusmYZTQhgU3tl3VYGcJYg=="], - "@rspack/binding-darwin-arm64": ["@rspack/binding-darwin-arm64@2.1.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-IYcxareUOYJZz+uNMSIwn+iDRiVyjZNOjoxO/zL4OFaPK8Ncrw0ka/9DqL9Gd7OpnAXN1zK3uS8yD0O1yIYI3Q=="], + "@rspack/binding-darwin-arm64": ["@rspack/binding-darwin-arm64@2.1.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-oOGI0RSL89Ehu9T22rugmfUY9OC2eBqLMeWRYsu7bhlUrjoXeVfGBBSEXCse666BQ1sAiM8hD/k7nqVria/okQ=="], - "@rspack/binding-darwin-x64": ["@rspack/binding-darwin-x64@2.1.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-aoifkILvx/XEHyvg8yW57xu95nx7f9f/3ah1+RguHSNKcJMcoCep9VX1Ct1N0ftqg8MC0JUObc7xWL5W14hmjA=="], + "@rspack/binding-darwin-x64": ["@rspack/binding-darwin-x64@2.1.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-sVqWXNiFTMXAyN362y6IA+eJc8LXZKfHdhEJ/zDuMmRp+u2IvhgaF8tk3vX/OmeB9jydVjySijuiqk8No/FoCA=="], - "@rspack/binding-linux-arm64-gnu": ["@rspack/binding-linux-arm64-gnu@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-My4m40tyJSgiCEf3bB2KIEX710q3nZg99LIjy+8Zxgi3oZTkg1bFmFRusFU5U4eN5408zfSqDDGvjDE3Yv7o4w=="], + "@rspack/binding-linux-arm64-gnu": ["@rspack/binding-linux-arm64-gnu@2.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-aCy9Zli/2Qf+Ee5otXfFQ6mhv5fEyn0wIoBVmouqtJoqOO21et6UTtJ+LHLsMDolwGLyHERAljeSFSmYX3/O5A=="], - "@rspack/binding-linux-arm64-musl": ["@rspack/binding-linux-arm64-musl@2.1.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-yt+GGWUH7WPE8K97cRc8OpZhH7Pbj1vU+lkvKbDtF/rR8X9a/bJsA/nBqyUV2oBKOVbrp5I8rFZlnDskMqgvKw=="], + "@rspack/binding-linux-arm64-musl": ["@rspack/binding-linux-arm64-musl@2.1.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-flIE7eluz0d21Fn28EVm3vPwoJooOSqtmjLFVSuOMcoCbwV9clfor195oIrAppp/W7dL/3XquFuVfrsa01Jy8Q=="], - "@rspack/binding-linux-riscv64-gnu": ["@rspack/binding-linux-riscv64-gnu@2.1.2", "", { "os": "linux", "cpu": "none" }, "sha512-uys8Jyw8Z3ralvICbN/L/nZfy5qELIwpOY72rhIqhoDYwFcL4fmMaY7WsvUcJOjCB2rqOcWPaWKuF2oPvo9iDQ=="], + "@rspack/binding-linux-riscv64-gnu": ["@rspack/binding-linux-riscv64-gnu@2.1.3", "", { "os": "linux", "cpu": "none" }, "sha512-yojg8elye1nhsNeGncw0NrZ4pMGF7NVebR80CLg72TXyzfYwFJlFTdU5yUYb1Gy+JXIvrSCwzQt2QkyiEvmkfg=="], - "@rspack/binding-linux-riscv64-musl": ["@rspack/binding-linux-riscv64-musl@2.1.2", "", { "os": "linux", "cpu": "none" }, "sha512-JYNVQwqCaRGQWvjHQYzZkIzQiwllMaJwh4Rdu3ww6W2OJcJUqT08sL1pkOtU0iCxT4VUYiRRcp93VGTGpHr8fg=="], + "@rspack/binding-linux-riscv64-musl": ["@rspack/binding-linux-riscv64-musl@2.1.3", "", { "os": "linux", "cpu": "none" }, "sha512-6PvbXb3FOK4X3S5QGvoSW/sqExmsvAoPnQ/YSFrXvTphkXFezA7wnobmGBHT8JQP31hcFRzJHIZSIOKktzSzzg=="], - "@rspack/binding-linux-x64-gnu": ["@rspack/binding-linux-x64-gnu@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-KDoPy0Msf/JLhxgPPrJQzZeB4Qpqd32em8AP5lSW2s6jR5I35dHgAe9xc2A++EQtnSrU4GTn6DBvFC7q84SihQ=="], + "@rspack/binding-linux-x64-gnu": ["@rspack/binding-linux-x64-gnu@2.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-lMXjoGKf0SnviH596fmTszgtnXLHmWOoE90G8grG9MvKVa3pelRmfps5ewZL9s8ENf3NXRfOxIhIf/M9as6MqA=="], - "@rspack/binding-linux-x64-musl": ["@rspack/binding-linux-x64-musl@2.1.2", "", { "os": "linux", "cpu": "x64" }, "sha512-66hWmIGvn4zCKAYXJE9Bp5SNSLYnLFq2Ke/efE+ZtWy43Dd5vk9AAOmThVGBwdwmIxmGtHGCp+cAuS4G0wu0TA=="], + "@rspack/binding-linux-x64-musl": ["@rspack/binding-linux-x64-musl@2.1.3", "", { "os": "linux", "cpu": "x64" }, "sha512-0esT35v7pW2ZsJTMc/zDUHwpNXlPqyUCyuiLJvrAAUcdENrgOVe4DmFrgVJ2hwqI4GjeN1VBnGRJ8c+edAHH5w=="], - "@rspack/binding-wasm32-wasi": ["@rspack/binding-wasm32-wasi@2.1.2", "", { "dependencies": { "@emnapi/core": "1.11.1", "@emnapi/runtime": "1.11.1", "@napi-rs/wasm-runtime": "1.1.6" }, "cpu": "none" }, "sha512-EB4SqH8DW/E/OmqssNQvnIVGQiVUyYNlA/pcc6Ia4MlTNwu6eNDppcNLrToH+kSZpL4CpHSFfSM3eIsSuar2Rw=="], + "@rspack/binding-wasm32-wasi": ["@rspack/binding-wasm32-wasi@2.1.3", "", { "dependencies": { "@emnapi/core": "1.11.1", "@emnapi/runtime": "1.11.1", "@napi-rs/wasm-runtime": "1.1.6" }, "cpu": "none" }, "sha512-UsrDjD59UEP0mhfN/Z+uTc3vLgiUvIr+mn92WC1sbQi9gtZohTYvaQYFhWuMkBqsACGcmZp704JAbbSrVrVYCA=="], - "@rspack/binding-win32-arm64-msvc": ["@rspack/binding-win32-arm64-msvc@2.1.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-T6Fs/g32MRja/UpCq4AdyPRj8tA0cOkcEa4PrAcn/ztUgK8b/qMVxj5mhMI+n7k+kHZQnpeB1Q4HqdSJi6OocA=="], + "@rspack/binding-win32-arm64-msvc": ["@rspack/binding-win32-arm64-msvc@2.1.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-42RS/SwKBTkNvXIPZXqTn0yEFN8zwGRfRe/ly0GDvPp/KxpLMFWxJmLxgtoLompU+0UCGvV4KpcBENt3oWs6BA=="], - "@rspack/binding-win32-ia32-msvc": ["@rspack/binding-win32-ia32-msvc@2.1.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-OtxkFVz14mVL4QK8QriSELn9B6PaYGHw1jGJwVDEzpu2ZxSHCTQPz9dVE1ekYtREEqZUkRU7Fp7VfhJSmjTt2Q=="], + "@rspack/binding-win32-ia32-msvc": ["@rspack/binding-win32-ia32-msvc@2.1.3", "", { "os": "win32", "cpu": "ia32" }, "sha512-thk43H1JHHbetNF3txcsGXeOwZi2m6Luf/uVUqNORXjxr5VV8woHAgaAx4QXVZRg70z1VDjd8mBWnHBnKI0FGA=="], - "@rspack/binding-win32-x64-msvc": ["@rspack/binding-win32-x64-msvc@2.1.2", "", { "os": "win32", "cpu": "x64" }, "sha512-Am+nx9fLF3nzgD/K05Bs1Bb+WO8SFLWAYRbXkymaL1r+RQxjRj7jd5ap2PhGOCcfaNA4yVWkAFvmFP92eRu7bQ=="], + "@rspack/binding-win32-x64-msvc": ["@rspack/binding-win32-x64-msvc@2.1.3", "", { "os": "win32", "cpu": "x64" }, "sha512-ObaUcj+BHo/aBL1weyM3orApaHyAR5Phr3YNEpQEifxjZbNKM1iO5X5prN4OqEv3H+7o5e/Wh9Fy3N7Vvd+psA=="], - "@rspack/cli": ["@rspack/cli@2.1.2", "", { "peerDependencies": { "@rspack/core": "^2.0.0-0", "@rspack/dev-server": "^2.0.0-0" }, "optionalPeers": ["@rspack/dev-server"], "bin": { "rspack": "./bin/rspack.js" } }, "sha512-GTBsKuaeqDii6NaGPkQwvycMSjqMUMMRGiAwH0sXsFIn8X7sFa4xpoL7pIhbebVBDGzYhUBqWzNQFuL5u2FeoQ=="], + "@rspack/cli": ["@rspack/cli@2.1.3", "", { "peerDependencies": { "@rspack/core": "^2.0.0-0", "@rspack/dev-server": "^2.0.0-0" }, "optionalPeers": ["@rspack/dev-server"], "bin": { "rspack": "./bin/rspack.js" } }, "sha512-TUhLdSfXiSD5D4A85pW7m4vCC/MtPk00+OK1qVtM2OGad/xTPNUtkOrvOz9CEaOLW3L7vkwo+dHc5fqkFEsFPQ=="], - "@rspack/core": ["@rspack/core@2.1.2", "", { "dependencies": { "@rspack/binding": "2.1.2" }, "peerDependencies": { "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", "@swc/helpers": "^0.5.23" }, "optionalPeers": ["@module-federation/runtime-tools", "@swc/helpers"] }, "sha512-crpNQKhHfnzrIl4Sa4fjH30Ho5aAPgyqpmJZ41SkUFOzyKHdZKYfE5LF3CMh7MiFQFPPxiiKf5BcpxmtZZx4MQ=="], + "@rspack/core": ["@rspack/core@2.1.3", "", { "dependencies": { "@rspack/binding": "2.1.3" }, "peerDependencies": { "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0", "@swc/helpers": "^0.5.23" }, "optionalPeers": ["@module-federation/runtime-tools", "@swc/helpers"] }, "sha512-1iGnxLrP+iyY0ZSjLZeQTaxrISpQz4yLyqJPmaF/l4uw27/dBcrloszAeLOJQ9jiv7EJtU0T5zB+LOFPpivIxA=="], "@testing-library/dom": ["@testing-library/dom@10.4.1", "", { "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", "aria-query": "5.3.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "picocolors": "1.1.1", "pretty-format": "^27.0.2" } }, "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg=="], @@ -241,6 +241,46 @@ "@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], + "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], + + "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="], + + "@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="], + + "@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="], + + "@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="], + + "@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="], + + "@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="], + + "@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="], + + "@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="], + + "@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="], + + "@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="], + + "@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="], + + "@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="], + + "@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="], + + "@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="], + + "@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="], + + "@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="], + + "@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="], + + "@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="], + + "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], + "@xmldom/xmldom": ["@xmldom/xmldom@0.9.10", "", {}, "sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw=="], "a-sync-waterfall": ["a-sync-waterfall@1.0.1", "", {}, "sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA=="], @@ -369,7 +409,7 @@ "domhandler": ["domhandler@5.0.3", "", { "dependencies": { "domelementtype": "^2.3.0" } }, "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w=="], - "dompurify": ["dompurify@3.4.11", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-zhlUV12GsaRzMsf9q5M254YhA4+VuF0fG+QFqu6aYpoGlKtz+w8//jBcGVYBgQkR5GHjUomejY84AV+/uPbWdw=="], + "dompurify": ["dompurify@3.4.12", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg=="], "domutils": ["domutils@3.2.2", "", { "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", "domhandler": "^5.0.3" } }, "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw=="], @@ -527,9 +567,9 @@ "make-fetch-happen": ["make-fetch-happen@14.0.3", "", { "dependencies": { "@npmcli/agent": "^3.0.0", "cacache": "^19.0.1", "http-cache-semantics": "^4.1.1", "minipass": "^7.0.2", "minipass-fetch": "^4.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^1.0.0", "proc-log": "^5.0.0", "promise-retry": "^2.0.1", "ssri": "^12.0.0" } }, "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ=="], - "marked": ["marked@18.0.5", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-S6GcvALHg6K4ohtu4E7x0a1AqhAjp6cV8KhLSyN9qVapnzJkusVBxZRcIU9AeYsbe6P1hKDusSbEOzGyyuce6w=="], + "marked": ["marked@18.0.6", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-MrV5puXBfuiy6wl6DLaq3BtIJQAJToAd5zt/ZKhRfGRAuFPALE7/4Y7jnxRQoEgK/pBgurGqLyAuRgZ2xOjr6w=="], - "marked-base-url": ["marked-base-url@1.1.9", "", { "peerDependencies": { "marked": ">= 4 < 19" } }, "sha512-TqSI1Wni8aaIMwEe6YFv6uMBnNR1KICzLCEho29fmBrnb0RDvn+/nAU8BiWjpky/C/9zNG+L6TuOrfJBaajs3A=="], + "marked-base-url": ["marked-base-url@1.1.10", "", { "peerDependencies": { "marked": ">= 4 < 19" } }, "sha512-Szoa+MAjZg1eiDiYrzK3JwJrgRPG7gvVyf858eOonKJKJB2JGP+Z6V83gvH85labGN1VHPgANq3Jk4V47u9xAA=="], "marked-smartypants": ["marked-smartypants@1.1.12", "", { "dependencies": { "smartypants": "^0.2.2" }, "peerDependencies": { "marked": ">=4 <19" } }, "sha512-Z0QL2GpihbSeG5aaCrQxMEoqvngMftF/gq1SrdlCnbecUSrX3HYgPtCZzCW+OyNe2ideQqaFdxfGryqQX1MBDA=="], @@ -767,7 +807,7 @@ "tar": ["tar@7.5.19", "", { "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", "minipass": "^7.1.2", "minizlib": "^3.1.0", "yallist": "^5.0.0" } }, "sha512-4LeEWl96twnS2Q7Bz4MGqgazLqO+hJN63GZxXoIqh1T3VweYD997gbU1ItNsQafqqXTXd5WFyFdReLtwvRBNiw=="], - "terser": ["terser@5.48.0", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q=="], + "terser": ["terser@5.49.0", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-SNiDnXyHSrxVcIOtVbULzcTmniUiwcV7Nwdyj1twVubeTmbjoa8p69KKDpfkdoOavuM4/GRm1+ykI8qqnavHoA=="], "tgfont": ["tgfont@workspace:packages/tgfont"], @@ -807,7 +847,7 @@ "type-fest": ["type-fest@0.7.1", "", {}, "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg=="], - "typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], "undici": ["undici@6.27.0", "", {}, "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg=="], diff --git a/tgui/package.json b/tgui/package.json index 05b3f08d73..ec5f9abf7c 100644 --- a/tgui/package.json +++ b/tgui/package.json @@ -4,8 +4,8 @@ "type": "module", "devDependencies": { "@happy-dom/global-registrator": "^20.10.6", - "@rspack/cli": "^2.1.2", - "@rspack/core": "^2.1.2", + "@rspack/cli": "^2.1.3", + "@rspack/core": "^2.1.3", "@testing-library/react": "^16.3.2", "@types/bun": "^1.3.14", "@types/react": "^19.2.17", @@ -15,7 +15,7 @@ "css-loader": "^7.1.4", "sass-embedded": "^1.100.0", "sass-loader": "^17.0.0", - "typescript": "^6.0.3" + "typescript": "^7.0.2" }, "packageManager": "bun@1.3.3", "private": true, diff --git a/tgui/packages/tgui-dev-server/link/server.ts b/tgui/packages/tgui-dev-server/link/server.ts index f4479525e3..1cbc512668 100644 --- a/tgui/packages/tgui-dev-server/link/server.ts +++ b/tgui/packages/tgui-dev-server/link/server.ts @@ -3,10 +3,10 @@ import type { ServerWebSocket } from 'bun'; import { createLogger, directLog } from '../logging'; import { retrace } from './retrace'; -interface LinkSocketData { +type LinkSocketData = { id: string; createdAt: number; -} +}; let server: Bun.Server; diff --git a/tgui/packages/tgui-panel/package.json b/tgui/packages/tgui-panel/package.json index 7b6e1964ed..dced757647 100644 --- a/tgui/packages/tgui-panel/package.json +++ b/tgui/packages/tgui-panel/package.json @@ -3,7 +3,7 @@ "version": "6.0.0", "dependencies": { "common": "workspace:*", - "dompurify": "^3.4.11", + "dompurify": "^3.4.12", "es-toolkit": "^1.49.0", "jotai": "^2.20.1", "react": "^19.2.7", diff --git a/tgui/packages/tgui-setup/package.json b/tgui/packages/tgui-setup/package.json index 76cae810b4..cc41c6e903 100644 --- a/tgui/packages/tgui-setup/package.json +++ b/tgui/packages/tgui-setup/package.json @@ -9,6 +9,6 @@ }, "dependencies": { "clean-css-cli": "^5.6.3", - "terser": "^5.48.0" + "terser": "^5.49.0" } } diff --git a/tgui/packages/tgui/interfaces/BorgHypo/BorgHypoRecipeDisplay.tsx b/tgui/packages/tgui/interfaces/BorgHypo/BorgHypoRecipeDisplay.tsx index c5f54967fb..26b7400f09 100644 --- a/tgui/packages/tgui/interfaces/BorgHypo/BorgHypoRecipeDisplay.tsx +++ b/tgui/packages/tgui/interfaces/BorgHypo/BorgHypoRecipeDisplay.tsx @@ -1,6 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { formatUnits } from 'tgui/interfaces/common/ChemicalContents'; import { Box, Section, Stack } from 'tgui-core/components'; -import { formatUnits } from '../common/ChemicalContents'; import type { Data } from './types'; export const BorgHypoRecipeDisplay = (props) => { diff --git a/tgui/packages/tgui/interfaces/CharacterDirectory/CharacterDirectoryViewCharacter.tsx b/tgui/packages/tgui/interfaces/CharacterDirectory/CharacterDirectoryViewCharacter.tsx index 0f5ed021c6..249e010b66 100644 --- a/tgui/packages/tgui/interfaces/CharacterDirectory/CharacterDirectoryViewCharacter.tsx +++ b/tgui/packages/tgui/interfaces/CharacterDirectory/CharacterDirectoryViewCharacter.tsx @@ -1,5 +1,5 @@ +import { MarkdownSpoilerText } from 'tgui/interfaces/common/SpoilerText'; import { Box, Button, Section, Table } from 'tgui-core/components'; -import { MarkdownSpoilerText } from '../common/SpoilerText'; import { getTagColor } from './constants'; import { validateLink } from './functions'; import type { mobEntry } from './types'; diff --git a/tgui/packages/tgui/interfaces/ChemDispenser/ChemDispenserBeaker.tsx b/tgui/packages/tgui/interfaces/ChemDispenser/ChemDispenserBeaker.tsx index 6892a7c7f8..d1ddb023c1 100644 --- a/tgui/packages/tgui/interfaces/ChemDispenser/ChemDispenserBeaker.tsx +++ b/tgui/packages/tgui/interfaces/ChemDispenser/ChemDispenserBeaker.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { BeakerContents } from 'tgui/interfaces/common/ChemicalContents'; import { Box, Button, Section, Stack } from 'tgui-core/components'; - -import { BeakerContents } from '../common/ChemicalContents'; import { removeAmounts } from './constants'; import type { Data } from './types'; @@ -52,7 +51,7 @@ export const ChemDispenserBeaker = (props) => { } > ( diff --git a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBeaker.tsx b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBeaker.tsx index 52a772eb71..0cedd9d1bb 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBeaker.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBeaker.tsx @@ -1,9 +1,8 @@ import { useBackend } from 'tgui/backend'; +import { BeakerContents } from 'tgui/interfaces/common/ChemicalContents'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, Section, Stack } from 'tgui-core/components'; import type { BooleanLike } from 'tgui-core/react'; - -import { BeakerContents } from '../common/ChemicalContents'; -import { modalOpen } from '../common/ComplexModal'; import { transferAmounts } from './constants'; import type { reagent } from './types'; @@ -15,33 +14,36 @@ export const ChemMasterBeaker = (props: { const { act } = useBackend(); const { beaker, beakerReagents, bufferNonEmpty } = props; - const headerButton = (<> {bufferNonEmpty ? ( - act('eject')} - > - Eject and Keep Buffer - + const headerButton = bufferNonEmpty ? ( + <> + act('eject')} + > + Eject and Keep Buffer + + act('ejectandclear')} + > + Eject and Clear Buffer + + ) : ( - - )} - {bufferNonEmpty ? ( - act('ejectandclear')} - > - Eject and Clear Buffer - - ) : ( - - )} - + <> + + + ); return ( diff --git a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBuffer.tsx b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBuffer.tsx index 497977855d..1df345c363 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBuffer.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterBuffer.tsx @@ -1,9 +1,8 @@ import { useBackend } from 'tgui/backend'; +import { BufferContents } from 'tgui/interfaces/common/ChemicalContents'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, Section, Stack } from 'tgui-core/components'; import type { BooleanLike } from 'tgui-core/react'; - -import { BufferContents } from '../common/ChemicalContents'; -import { modalOpen } from '../common/ComplexModal'; import { transferAmounts } from './constants'; import type { reagent } from './types'; diff --git a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterCustomization.tsx b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterCustomization.tsx index 963b442f47..02c64ce910 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterCustomization.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterCustomization.tsx @@ -1,9 +1,8 @@ import { useBackend } from 'tgui/backend'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, Section } from 'tgui-core/components'; import type { BooleanLike } from 'tgui-core/react'; -import { modalOpen } from '../common/ComplexModal'; - export const ChemMasterCustomization = (props: { loaded_pill_bottle: BooleanLike; loaded_pill_bottle_name: string; diff --git a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionChemical.tsx b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionChemical.tsx index 10c9ae8e85..81149ab1be 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionChemical.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionChemical.tsx @@ -1,8 +1,7 @@ +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, LabeledList } from 'tgui-core/components'; import { classes } from 'tgui-core/react'; -import { modalOpen } from '../common/ComplexModal'; - export const ChemMasterProductionChemical = (props: { pillsprite: string; bottlesprite: string; diff --git a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionCondiment.tsx b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionCondiment.tsx index 9047dd1f7f..e01c180b13 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionCondiment.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/ChemMasterProductionCondiment.tsx @@ -1,8 +1,7 @@ import { useBackend } from 'tgui/backend'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Button } from 'tgui-core/components'; -import { modalOpen } from '../common/ComplexModal'; - export const ChemMasterProductionCondiment = (props) => { const { act } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/ChemMaster/index.tsx b/tgui/packages/tgui/interfaces/ChemMaster/index.tsx index 51053cdece..d35f99f484 100644 --- a/tgui/packages/tgui/interfaces/ChemMaster/index.tsx +++ b/tgui/packages/tgui/interfaces/ChemMaster/index.tsx @@ -1,10 +1,9 @@ import { useBackend } from 'tgui/backend'; -import { Window } from 'tgui/layouts'; - import { ComplexModal, modalRegisterBodyOverride, -} from '../common/ComplexModal'; +} from 'tgui/interfaces/common/ComplexModal'; +import { Window } from 'tgui/layouts'; import { analyzeModalBodyOverride } from './ChemMasterAnalyzeModalBodyOverride'; import { ChemMasterBeaker } from './ChemMasterBeaker'; import { ChemMasterBuffer } from './ChemMasterBuffer'; @@ -35,10 +34,7 @@ export const ChemMaster = (props) => { beakerReagents={beaker_reagents} bufferNonEmpty={buffer_reagents.length > 0} /> - + 0} diff --git a/tgui/packages/tgui/interfaces/ChessCheckers/PlayerMenu.tsx b/tgui/packages/tgui/interfaces/ChessCheckers/PlayerMenu.tsx index 105e928597..bd83b10d48 100644 --- a/tgui/packages/tgui/interfaces/ChessCheckers/PlayerMenu.tsx +++ b/tgui/packages/tgui/interfaces/ChessCheckers/PlayerMenu.tsx @@ -1,6 +1,9 @@ import { useBackend } from 'tgui/backend'; +import { + AnimatedArrows, + AnimatedArrowsLeft, +} from 'tgui/interfaces/common/AnimatedArrows'; import { Box, Button, Section, Stack } from 'tgui-core/components'; -import { AnimatedArrows, AnimatedArrowsLeft } from '../common/AnimatedArrows'; import { VorePanelTooltip } from '../VorePanel/VorePanelElements/VorePanelTooltip'; import { gameTooltip } from './constants'; import { gameStateToText, stateToColor } from './functions'; diff --git a/tgui/packages/tgui/interfaces/ColorPickerModal.tsx b/tgui/packages/tgui/interfaces/ColorPickerModal.tsx index b6097f3cb9..5a05d6f1b2 100644 --- a/tgui/packages/tgui/interfaces/ColorPickerModal.tsx +++ b/tgui/packages/tgui/interfaces/ColorPickerModal.tsx @@ -174,7 +174,7 @@ export const ColorPickerModal: React.FC = () => { ); }; -interface ColorPresetsProps { +type ColorPresetsProps = { setColor: (color: HsvaColor) => void; setShowPresets: (show: boolean) => void; presetList?: string[][]; @@ -182,7 +182,7 @@ interface ColorPresetsProps { onSelectedPreset: React.Dispatch>; allowEditing?: boolean; onAllowEditing?: React.Dispatch>; -} +}; const ColorPresets: React.FC = React.memo( ({ @@ -275,7 +275,7 @@ const ColorPresets: React.FC = React.memo( }, ); -interface ColorSelectorProps { +type ColorSelectorProps = { color: HsvaColor; setColor: React.Dispatch>; defaultColor: string; @@ -284,7 +284,7 @@ interface ColorSelectorProps { onSelectedPreset: React.Dispatch>; allowEditing?: boolean; onAllowEditing?: React.Dispatch>; -} +}; export const ColorSelector: React.FC = React.memo( ({ @@ -399,10 +399,10 @@ export const ColorSelector: React.FC = React.memo( }, ); -interface RowProps { +type RowProps = { color: HsvaColor; handleChange: (c: Partial) => void; -} +}; const HueRow: React.FC = React.memo(({ color, handleChange }) => ( @@ -467,10 +467,10 @@ const ValueRow: React.FC = React.memo(({ color, handleChange }) => ( )); -interface RGBRowProps { +type RGBRowProps = { color: HsvaColor; handleChange: (c: HsvaColor) => void; -} +}; const RedRow: React.FC = React.memo(({ color, handleChange }) => { const rgb = hsvaToRgba(color); @@ -549,13 +549,13 @@ const BlueRow: React.FC = React.memo(({ color, handleChange }) => { ); }); -interface TextSetterProps { +type TextSetterProps = { value: number; callback: (value: number) => void; min?: number; max?: number; unit?: string; -} +}; const TextSetter: React.FC = React.memo( ({ value, callback, min = 0, max = 100, unit }) => { @@ -573,13 +573,13 @@ const TextSetter: React.FC = React.memo( }, ); -interface HexColorInputProps { +type HexColorInputProps = { prefixed?: boolean; alpha?: boolean; color: string; fluid?: boolean; onChange: (newColor: string) => void; -} +}; const HexColorInput: React.FC = React.memo( ({ alpha, color, fluid, onChange, ...rest }) => { @@ -641,10 +641,10 @@ const HexColorInput: React.FC = React.memo( }, ); -interface SaturationValueProps { +type SaturationValueProps = { hsva: HsvaColor; onChange: (newColor: Partial) => void; -} +}; const SaturationValue: React.FC = React.memo( ({ hsva, onChange }) => { @@ -698,11 +698,11 @@ const SaturationValue: React.FC = React.memo( }, ); -interface HueProps { +type HueProps = { className?: string; hue: number; onChange: (newHue: Partial) => void; -} +}; const Hue: React.FC = React.memo(({ className, hue, onChange }) => { const handleMove = (interaction: Interaction) => { @@ -737,11 +737,11 @@ const Hue: React.FC = React.memo(({ className, hue, onChange }) => { ); }); -interface SaturationProps { +type SaturationProps = { className?: string; color: HsvaColor; onChange: (newSaturation: Partial) => void; -} +}; const Saturation: React.FC = React.memo( ({ className, color, onChange }) => { @@ -795,11 +795,11 @@ const Saturation: React.FC = React.memo( }, ); -interface ValueProps { +type ValueProps = { className?: string; color: HsvaColor; onChange: (newValue: Partial) => void; -} +}; const Value: React.FC = React.memo( ({ className, color, onChange }) => { @@ -852,12 +852,12 @@ const Value: React.FC = React.memo( }, ); -interface RGBSliderProps { +type RGBSliderProps = { className?: string; color: HsvaColor; onChange: (newValue: HsvaColor) => void; target: 'r' | 'g' | 'b'; -} +}; const RGBSlider: React.FC = React.memo( ({ className, color, onChange, target }) => { diff --git a/tgui/packages/tgui/interfaces/DNAModifier/index.tsx b/tgui/packages/tgui/interfaces/DNAModifier/index.tsx index 43c100a25c..9f9437ba2c 100644 --- a/tgui/packages/tgui/interfaces/DNAModifier/index.tsx +++ b/tgui/packages/tgui/interfaces/DNAModifier/index.tsx @@ -1,8 +1,7 @@ import { useBackend } from 'tgui/backend'; +import { ComplexModal } from 'tgui/interfaces/common/ComplexModal'; import { Window } from 'tgui/layouts'; import { Stack } from 'tgui-core/components'; - -import { ComplexModal } from '../common/ComplexModal'; import { DNAModifierIrradiating } from './DNAModifierIrradiating'; import { DNAModifierMain } from './DNAModifierMain'; import { DNAModifierOccupant } from './DNAModifierOccupant'; diff --git a/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx b/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx index 1c6ab5ab10..e97f0ad290 100644 --- a/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx +++ b/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx @@ -1,6 +1,7 @@ import { sortBy } from 'es-toolkit'; import type { ReactNode } from 'react'; import { useSharedState } from 'tgui/backend'; +import { SearchBar } from 'tgui/interfaces/common/SearchBar'; import { Dimmer, Icon, @@ -9,7 +10,6 @@ import { VirtualList, } from 'tgui-core/components'; import { classes } from 'tgui-core/react'; -import { SearchBar } from '../common/SearchBar'; import type { Design, MaterialMap } from './Types'; /** diff --git a/tgui/packages/tgui/interfaces/GeneralRecords/GeneralRecordsViewGeneral.tsx b/tgui/packages/tgui/interfaces/GeneralRecords/GeneralRecordsViewGeneral.tsx index 0986f1be18..355a31a256 100644 --- a/tgui/packages/tgui/interfaces/GeneralRecords/GeneralRecordsViewGeneral.tsx +++ b/tgui/packages/tgui/interfaces/GeneralRecords/GeneralRecordsViewGeneral.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, Image, LabeledList, Section } from 'tgui-core/components'; - -import { modalOpen } from '../common/ComplexModal'; import { doEdit } from './functions'; import type { Data } from './types'; diff --git a/tgui/packages/tgui/interfaces/GeneralRecords/functions.ts b/tgui/packages/tgui/interfaces/GeneralRecords/functions.ts index 81485e7296..664ff96268 100644 --- a/tgui/packages/tgui/interfaces/GeneralRecords/functions.ts +++ b/tgui/packages/tgui/interfaces/GeneralRecords/functions.ts @@ -1,7 +1,6 @@ +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { flow } from 'tgui-core/fp'; import { createSearch } from 'tgui-core/string'; - -import { modalOpen } from '../common/ComplexModal'; import type { field, record } from './types'; export function doEdit(field: field) { diff --git a/tgui/packages/tgui/interfaces/GeneralRecords/index.tsx b/tgui/packages/tgui/interfaces/GeneralRecords/index.tsx index cfea45b883..cf95b5f8c4 100644 --- a/tgui/packages/tgui/interfaces/GeneralRecords/index.tsx +++ b/tgui/packages/tgui/interfaces/GeneralRecords/index.tsx @@ -1,11 +1,10 @@ import { useBackend } from 'tgui/backend'; +import { ComplexModal } from 'tgui/interfaces/common/ComplexModal'; +import { LoginInfo } from 'tgui/interfaces/common/LoginInfo'; +import { LoginScreen } from 'tgui/interfaces/common/LoginScreen'; +import { TemporaryNotice } from 'tgui/interfaces/common/TemporaryNotice'; import { Window } from 'tgui/layouts'; import { Section } from 'tgui-core/components'; - -import { ComplexModal } from '../common/ComplexModal'; -import { LoginInfo } from '../common/LoginInfo'; -import { LoginScreen } from '../common/LoginScreen'; -import { TemporaryNotice } from '../common/TemporaryNotice'; import { GeneralRecordsList } from './GeneralRecordsList'; import { GeneralRecordsMaintenance, diff --git a/tgui/packages/tgui/interfaces/ICAssembly/Plane.tsx b/tgui/packages/tgui/interfaces/ICAssembly/Plane.tsx index 1c6e4cab41..6fba595aa4 100644 --- a/tgui/packages/tgui/interfaces/ICAssembly/Plane.tsx +++ b/tgui/packages/tgui/interfaces/ICAssembly/Plane.tsx @@ -1,11 +1,13 @@ import { Component } from 'react'; import { resolveAsset } from 'tgui/assets'; import { useBackend, useSharedState } from 'tgui/backend'; +import { + type Connection, + Connections, +} from 'tgui/interfaces/common/Connections'; // TODO: Replace when tgui-core is fixed https://github.com/tgstation/tgui-core/issues/25 import { InfinitePlane } from 'tgui-core/components'; import { decodeHtmlEntities } from 'tgui-core/string'; - -import { type Connection, Connections } from '../common/Connections'; import { CircuitComponent } from './CircuitComponent'; import type { PortProps } from './Port'; import { diff --git a/tgui/packages/tgui/interfaces/MaterialStack.tsx b/tgui/packages/tgui/interfaces/MaterialStack.tsx deleted file mode 100644 index 0d58db1cc0..0000000000 --- a/tgui/packages/tgui/interfaces/MaterialStack.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import { useState } from 'react'; -import { useBackend } from 'tgui/backend'; -import { Window } from 'tgui/layouts'; -import { - Box, - Button, - Collapsible, - Input, - Section, - Stack, - Table, -} from 'tgui-core/components'; -import { createSearch } from 'tgui-core/string'; - -type Data = { amount: number; recipes: Record[] }; - -type recipe = { - res_amount: number; - max_res_amount: number; - req_amount: number; - ref: string; -}; - -export const MaterialStack = (props) => { - const { data } = useBackend(); - - const { amount, recipes } = data; - const [searchText, setSearchText] = useState(''); - - return ( - - -
- - - setSearchText(val)} - /> - - - - - -
-
-
- ); -}; - -const RecipeList = (props: { - recipes: Record[]; - searchText: string; -}) => { - const { recipes, searchText } = props; - - const sortedKeys = Object.keys(recipes).sort(); - - const searcher = createSearch(searchText, (recipe) => { - return recipe; - }); - - const filteredKeys = sortedKeys.filter(searcher); - - // Shunt all categories to the top. - // We're not using this for now, keeping it here in case someone really hates color coding later. - // let nonCategories = sortedKeys.filter(item => recipes[item].ref !== undefined); - // let categories = sortedKeys.filter(item => recipes[item].ref === undefined); - - // categories.unshift("--DIVIDER--"); - - // let newSortedKeys = nonCategories.concat(categories); - - return filteredKeys.map((title, index) => { - // if (title === "--DIVIDER--") { - // return ( - // - // - // - // ); - // } - const recipe = recipes[title]; - if (recipe.ref === undefined) { - return ( - - - - - - ); - } else { - return ; - } - }); -}; - -const buildMultiplier = (recipe: recipe, amount: number) => { - if (recipe.req_amount > amount) { - return 0; - } - - return Math.floor(amount / recipe.req_amount); -}; - -const Multipliers = (props) => { - const { act, data } = useBackend(); - - const { recipe, maxMultiplier } = props; - - const maxM = Math.min( - maxMultiplier, - Math.floor(recipe.max_res_amount / recipe.res_amount), - ); - - const multipliers = [5, 10, 25]; - - const finalResult: React.JSX.Element[] = []; - - for (const multiplier of multipliers) { - if (maxM >= multiplier) { - finalResult.push( - , - ); - } - } - - if (multipliers.indexOf(maxM) === -1) { - finalResult.push( - , - ); - } - - return finalResult; -}; - -const Recipe = (props: { recipe: recipe; title: string }) => { - const { act, data } = useBackend(); - - const { amount } = data; - - const { recipe, title } = props; - - const { res_amount, max_res_amount, req_amount, ref } = recipe; - - let buttonName = title; - buttonName += ' ('; - buttonName += `${req_amount} `; - buttonName += `sheet${req_amount > 1 ? 's' : ''}`; - buttonName += ')'; - - if (res_amount > 1) { - buttonName = `${res_amount}x ${buttonName}`; - } - - const maxMultiplier = buildMultiplier(recipe, amount); - - return ( - - - - - - - {max_res_amount > 1 && maxMultiplier > 1 && ( - - - - )} - -
-
- ); -}; diff --git a/tgui/packages/tgui/interfaces/MaterialStack/RecipeElement.tsx b/tgui/packages/tgui/interfaces/MaterialStack/RecipeElement.tsx new file mode 100644 index 0000000000..5661decb5e --- /dev/null +++ b/tgui/packages/tgui/interfaces/MaterialStack/RecipeElement.tsx @@ -0,0 +1,104 @@ +import { useBackend } from 'tgui/backend'; +import { Box, Button, Table } from 'tgui-core/components'; +import { buildMultiplier } from './functions'; +import type { Data, Recipe } from './types'; + +export const RecipeElement = (props: { recipe: Recipe; title: string }) => { + const { act, data } = useBackend(); + + const { amount } = data; + + const { recipe, title } = props; + + const { res_amount, max_res_amount, req_amount, ref } = recipe; + + let buttonName = title; + buttonName += ' ('; + buttonName += `${req_amount} `; + buttonName += `sheet${req_amount > 1 ? 's' : ''}`; + buttonName += ')'; + + if (res_amount > 1) { + buttonName = `${res_amount}x ${buttonName}`; + } + + const maxMultiplier = buildMultiplier(recipe, amount); + + return ( + + + + + + + {max_res_amount > 1 && maxMultiplier > 1 && ( + + + + )} + +
+
+ ); +}; + +const Multipliers = (props) => { + const { act, data } = useBackend(); + + const { recipe, maxMultiplier } = props; + + const maxM = Math.min( + maxMultiplier, + Math.floor(recipe.max_res_amount / recipe.res_amount), + ); + + const multipliers = [5, 10, 25]; + + const finalResult: React.JSX.Element[] = []; + + for (const multiplier of multipliers) { + if (maxM >= multiplier) { + finalResult.push( + , + ); + } + } + + if (multipliers.indexOf(maxM) === -1) { + finalResult.push( + , + ); + } + + return finalResult; +}; diff --git a/tgui/packages/tgui/interfaces/MaterialStack/RecipeList.tsx b/tgui/packages/tgui/interfaces/MaterialStack/RecipeList.tsx new file mode 100644 index 0000000000..ecec293cac --- /dev/null +++ b/tgui/packages/tgui/interfaces/MaterialStack/RecipeList.tsx @@ -0,0 +1,53 @@ +import { Box, Collapsible } from 'tgui-core/components'; +import { createSearch } from 'tgui-core/string'; +import { isRecipe, treeSearch } from './functions'; +import { RecipeElement } from './RecipeElement'; +import type { RecipeTree } from './types'; + +export const RecipeList = (props: { + recipes: RecipeTree; + searchText: string; +}) => { + const { recipes, searchText } = props; + + const sortedKeys = Object.keys(recipes).sort(); + + const searcher = createSearch(searchText, (recipe) => { + return recipe; + }); + + const filteredKeys = sortedKeys.filter((title) => + treeSearch(title, recipes[title], searcher), + ); + + // Shunt all categories to the top. + // We're not using this for now, keeping it here in case someone really hates color coding later. + // let nonCategories = sortedKeys.filter(item => recipes[item].ref !== undefined); + // let categories = sortedKeys.filter(item => recipes[item].ref === undefined); + + // categories.unshift("--DIVIDER--"); + + // let newSortedKeys = nonCategories.concat(categories); + + return filteredKeys.map((title, index) => { + // if (title === "--DIVIDER--") { + // return ( + // + // + // + // ); + // } + const recipe = recipes[title]; + if (isRecipe(recipe)) { + return ; + } else { + return ( + + + + + + ); + } + }); +}; diff --git a/tgui/packages/tgui/interfaces/MaterialStack/functions.ts b/tgui/packages/tgui/interfaces/MaterialStack/functions.ts new file mode 100644 index 0000000000..de0c379402 --- /dev/null +++ b/tgui/packages/tgui/interfaces/MaterialStack/functions.ts @@ -0,0 +1,31 @@ +import type { Recipe, RecipeNode } from './types'; + +export function isRecipe(node: RecipeNode): node is Recipe { + return 'ref' in node; +} + +export function treeSearch( + title: string, + node: RecipeNode, + search: (s: string) => boolean, +): boolean { + if (search(title)) { + return true; + } + + if (isRecipe(node)) { + return false; + } + + return Object.entries(node).some(([childTitle, child]) => + treeSearch(childTitle, child, search), + ); +} + +export function buildMultiplier(recipe: Recipe, amount: number) { + if (recipe.req_amount > amount) { + return 0; + } + + return Math.floor(amount / recipe.req_amount); +} diff --git a/tgui/packages/tgui/interfaces/MaterialStack/index.tsx b/tgui/packages/tgui/interfaces/MaterialStack/index.tsx new file mode 100644 index 0000000000..85f1e683a3 --- /dev/null +++ b/tgui/packages/tgui/interfaces/MaterialStack/index.tsx @@ -0,0 +1,35 @@ +import { useState } from 'react'; +import { useBackend } from 'tgui/backend'; +import { Window } from 'tgui/layouts'; +import { Input, Section, Stack } from 'tgui-core/components'; +import { RecipeList } from './RecipeList'; +import type { Data } from './types'; + +export const MaterialStack = (props) => { + const { data } = useBackend(); + + const { amount, recipes } = data; + const [searchText, setSearchText] = useState(''); + + return ( + + +
+ + + setSearchText(val)} + /> + + + + + +
+
+
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/MaterialStack/types.ts b/tgui/packages/tgui/interfaces/MaterialStack/types.ts new file mode 100644 index 0000000000..a4596fe9e4 --- /dev/null +++ b/tgui/packages/tgui/interfaces/MaterialStack/types.ts @@ -0,0 +1,14 @@ +export type Recipe = { + res_amount: number; + max_res_amount: number; + req_amount: number; + ref: string; +}; + +export type RecipeTree = { + [key: string]: Recipe | RecipeTree; +}; + +export type RecipeNode = Recipe | RecipeTree; + +export type Data = { amount: number; recipes: RecipeTree }; diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx index fd99770308..8ae60dd90a 100644 --- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { modalOpen } from 'tgui/interfaces/common/ComplexModal'; import { Box, Button, LabeledList, Section } from 'tgui-core/components'; - -import { modalOpen } from '../common/ComplexModal'; import { doEdit } from '../GeneralRecords/functions'; import type { Data } from './types'; diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx index 2f95bbb1ba..d8aee76454 100644 --- a/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx +++ b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx @@ -1,14 +1,13 @@ import { useBackend } from 'tgui/backend'; -import { Window } from 'tgui/layouts'; -import { Section, Stack } from 'tgui-core/components'; - import { ComplexModal, modalRegisterBodyOverride, -} from '../common/ComplexModal'; -import { LoginInfo } from '../common/LoginInfo'; -import { LoginScreen } from '../common/LoginScreen'; -import { TemporaryNotice } from '../common/TemporaryNotice'; +} from 'tgui/interfaces/common/ComplexModal'; +import { LoginInfo } from 'tgui/interfaces/common/LoginInfo'; +import { LoginScreen } from 'tgui/interfaces/common/LoginScreen'; +import { TemporaryNotice } from 'tgui/interfaces/common/TemporaryNotice'; +import { Window } from 'tgui/layouts'; +import { Section, Stack } from 'tgui-core/components'; import { MedicalRecordsList } from './MedicalRecordsList'; import { MedicalRecordsMedbots } from './MedicalRecordsMedbots'; import { diff --git a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorHack.tsx b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorHack.tsx index c9945a5bb6..8599dabd78 100644 --- a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorHack.tsx +++ b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorHack.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { FullscreenNotice } from 'tgui/interfaces/common/FullscreenNotice'; import { Box } from 'tgui-core/components'; - -import { FullscreenNotice } from '../common/FullscreenNotice'; import type { Data } from './types'; export const MessageMonitorHack = (props) => { diff --git a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorLogin.tsx b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorLogin.tsx index cece1fafb0..64140c8e79 100644 --- a/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorLogin.tsx +++ b/tgui/packages/tgui/interfaces/MessageMonitor/MessageMonitorLogin.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { FullscreenNotice } from 'tgui/interfaces/common/FullscreenNotice'; import { Box, Button, Icon, Input } from 'tgui-core/components'; - -import { FullscreenNotice } from '../common/FullscreenNotice'; import type { Data } from './types'; export const MessageMonitorLogin = (props) => { diff --git a/tgui/packages/tgui/interfaces/MessageMonitor/index.tsx b/tgui/packages/tgui/interfaces/MessageMonitor/index.tsx index fc77b2cc84..7ccbe43cf8 100644 --- a/tgui/packages/tgui/interfaces/MessageMonitor/index.tsx +++ b/tgui/packages/tgui/interfaces/MessageMonitor/index.tsx @@ -1,8 +1,7 @@ import { useBackend } from 'tgui/backend'; +import { TemporaryNotice } from 'tgui/interfaces/common/TemporaryNotice'; import { Window } from 'tgui/layouts'; import { Box } from 'tgui-core/components'; - -import { TemporaryNotice } from '../common/TemporaryNotice'; import { MessageMonitorContent } from './MessageMonitorContent'; import { MessageMonitorHack } from './MessageMonitorHack'; import { MessageMonitorLogin } from './MessageMonitorLogin'; diff --git a/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx b/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx index 51121ce5ec..b226ff8c48 100644 --- a/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx +++ b/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx @@ -1,7 +1,6 @@ import { useBackend } from 'tgui/backend'; +import { RankIcon } from 'tgui/interfaces/common/RankIcon'; import { Button, Icon, NoticeBox, Section, Stack } from 'tgui-core/components'; - -import { RankIcon } from '../common/RankIcon'; import type { Target } from './types'; export const ModifyRobotNoModule = (props: { target: Target }) => { diff --git a/tgui/packages/tgui/interfaces/Newscaster/index.tsx b/tgui/packages/tgui/interfaces/Newscaster/index.tsx index 5950946a55..b53c858395 100644 --- a/tgui/packages/tgui/interfaces/Newscaster/index.tsx +++ b/tgui/packages/tgui/interfaces/Newscaster/index.tsx @@ -1,8 +1,7 @@ import { useSharedState } from 'tgui/backend'; +import { TemporaryNotice } from 'tgui/interfaces/common/TemporaryNotice'; import { Window } from 'tgui/layouts'; import { Box } from 'tgui-core/components'; - -import { TemporaryNotice } from '../common/TemporaryNotice'; import { NEWSCASTER_SCREEN_MAIN, NEWSCASTER_SCREEN_NEWCHANNEL, diff --git a/tgui/packages/tgui/interfaces/SecurityRecords/index.tsx b/tgui/packages/tgui/interfaces/SecurityRecords/index.tsx index 60ad4a2fd2..e11f79555e 100644 --- a/tgui/packages/tgui/interfaces/SecurityRecords/index.tsx +++ b/tgui/packages/tgui/interfaces/SecurityRecords/index.tsx @@ -1,11 +1,10 @@ import { useBackend } from 'tgui/backend'; +import { ComplexModal } from 'tgui/interfaces/common/ComplexModal'; +import { LoginInfo } from 'tgui/interfaces/common/LoginInfo'; +import { LoginScreen } from 'tgui/interfaces/common/LoginScreen'; +import { TemporaryNotice } from 'tgui/interfaces/common/TemporaryNotice'; import { Window } from 'tgui/layouts'; import { Section } from 'tgui-core/components'; - -import { ComplexModal } from '../common/ComplexModal'; -import { LoginInfo } from '../common/LoginInfo'; -import { LoginScreen } from '../common/LoginScreen'; -import { TemporaryNotice } from '../common/TemporaryNotice'; import { SecurityRecordsList } from './SecurityRecordsList'; import { SecurityRecordsMaintenance, diff --git a/tgui/packages/tgui/interfaces/SpaceBattle/PlayerMenu.tsx b/tgui/packages/tgui/interfaces/SpaceBattle/PlayerMenu.tsx index 0554edd104..35e8a4c850 100644 --- a/tgui/packages/tgui/interfaces/SpaceBattle/PlayerMenu.tsx +++ b/tgui/packages/tgui/interfaces/SpaceBattle/PlayerMenu.tsx @@ -1,6 +1,9 @@ import { useBackend } from 'tgui/backend'; +import { + AnimatedArrows, + AnimatedArrowsLeft, +} from 'tgui/interfaces/common/AnimatedArrows'; import { Box, Button, Section, Stack } from 'tgui-core/components'; -import { AnimatedArrows, AnimatedArrowsLeft } from '../common/AnimatedArrows'; import { VorePanelTooltip } from '../VorePanel/VorePanelElements/VorePanelTooltip'; import { gameStateToText, gameTooltip } from './constants'; import { stateToColor } from './functions'; diff --git a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObject.tsx b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObject.tsx index 3123ef023a..12b2bd68e6 100644 --- a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObject.tsx +++ b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObject.tsx @@ -28,14 +28,14 @@ type SpawnPanelData = { preferences?: SpawnPanelPreferences; }; -interface SpawnPreferences { +type SpawnPreferences = { hide_icons: boolean; hide_mappings: boolean; sort_by: string; search_text: string; search_by: string; selected_atom?: string; -} +}; export function CreateObject(props: CreateObjectProps) { const { act, data } = useBackend(); diff --git a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectAdvancedSettings.tsx b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectAdvancedSettings.tsx index d15fce9d7b..ba9132eb1b 100644 --- a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectAdvancedSettings.tsx +++ b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectAdvancedSettings.tsx @@ -12,10 +12,10 @@ type SpawnPanelData = { apply_icon_override?: boolean; }; -interface CreateObjectAdvancedSettingsProps { +type CreateObjectAdvancedSettingsProps = { iconSettings: IconSettings; onIconSettingsChange: (settings: Partial) => void; -} +}; export function CreateObjectAdvancedSettings( props: CreateObjectAdvancedSettingsProps, diff --git a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectSettings.tsx b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectSettings.tsx index 9ac66f499c..641ed0aed0 100644 --- a/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectSettings.tsx +++ b/tgui/packages/tgui/interfaces/SpawnPanel/CreateObjectSettings.tsx @@ -28,11 +28,11 @@ export type SpawnPanelData = { precise_mode: string; }; -interface CreateObjectSettingsProps { +type CreateObjectSettingsProps = { onCreateObject?: (obj: Record) => void; setAdvancedSettings: (value: boolean) => void; iconSettings: IconSettings; -} +}; export function CreateObjectSettings(props: CreateObjectSettingsProps) { const { onCreateObject, setAdvancedSettings, iconSettings } = props; diff --git a/tgui/packages/tgui/interfaces/SpawnPanel/index.tsx b/tgui/packages/tgui/interfaces/SpawnPanel/index.tsx index 6cca2be9fb..95d25a48ea 100644 --- a/tgui/packages/tgui/interfaces/SpawnPanel/index.tsx +++ b/tgui/packages/tgui/interfaces/SpawnPanel/index.tsx @@ -9,12 +9,12 @@ import { CreateObject } from './CreateObject'; import { CreateObjectAdvancedSettings } from './CreateObjectAdvancedSettings'; import type { CreateObjectData } from './types'; -export interface IconSettings { +export type IconSettings = { icon: string | null; iconState: string | null; iconSize: number; applyIcon?: boolean; -} +}; export function SpawnPanel() { const [data, setData] = useState(); diff --git a/tgui/packages/tgui/interfaces/SpawnPanel/types.ts b/tgui/packages/tgui/interfaces/SpawnPanel/types.ts index ae35c387e0..c7497a23da 100644 --- a/tgui/packages/tgui/interfaces/SpawnPanel/types.ts +++ b/tgui/packages/tgui/interfaces/SpawnPanel/types.ts @@ -1,6 +1,6 @@ import type { BooleanLike } from 'tgui-core/react'; -export interface SpawnPreferences { +export type SpawnPreferences = { hide_icons: boolean; hide_mappings: boolean; sort_by: string; @@ -12,30 +12,30 @@ export interface SpawnPreferences { object_count: number; dir: number; object_name: string; -} +}; -export interface SpawnPanelPreferences { +export type SpawnPanelPreferences = { hide_icons: boolean; hide_mappings: boolean; sort_by: string; search_text: string; search_by: string; -} +}; -export interface AtomData { +export type AtomData = { icon: string; icon_state: string; name: string; description?: string; mapping: BooleanLike; type: 'Objects' | 'Turfs' | 'Mobs'; -} +}; -export interface CreateObjectData { +export type CreateObjectData = { atoms: Record; -} +}; -export interface CreateObjectProps { +export type CreateObjectProps = { objList: CreateObjectData; setAdvancedSettings: (value: boolean) => void; iconSettings: { @@ -50,4 +50,4 @@ export interface CreateObjectProps { iconSize: number; }>, ) => void; -} +}; diff --git a/tgui/packages/tgui/interfaces/Techweb/helpers.ts b/tgui/packages/tgui/interfaces/Techweb/helpers.ts index cd8db1f195..b9649365cc 100644 --- a/tgui/packages/tgui/interfaces/Techweb/helpers.ts +++ b/tgui/packages/tgui/interfaces/Techweb/helpers.ts @@ -1,5 +1,5 @@ import { useBackend } from 'tgui/backend'; -import { buildIconData } from '../common/TechWebRecipeIcon'; +import { buildIconData } from 'tgui/interfaces/common/TechWebRecipeIcon'; import type { NodeCache, TechWebData } from './types'; type Cost = { diff --git a/tgui/packages/tgui/interfaces/common/ChemicalContents.tsx b/tgui/packages/tgui/interfaces/common/ChemicalContents.tsx index d9d9d4fd61..1b5c5763db 100644 --- a/tgui/packages/tgui/interfaces/common/ChemicalContents.tsx +++ b/tgui/packages/tgui/interfaces/common/ChemicalContents.tsx @@ -1,12 +1,18 @@ +import type { Reagent } from 'tgui/interfaces/ChemDispenser/types'; import { Box, Stack } from 'tgui-core/components'; -export const formatUnits = (a) => `${a} unit${a === 1 ? '' : 's'}`; +export function formatUnits(a: number) { + return `${a} unit${a === 1 ? '' : 's'}`; +} /** * Displays a beaker's contents - * @property {object} props */ -export const BeakerContents = (props) => { +export const BeakerContents = (props: { + beakerLoaded: boolean; + beakerContents: Reagent[]; + buttons: (chemical: Reagent, i: number) => React.JSX.Element; +}) => { const { beakerLoaded, beakerContents = [], buttons } = props; return ( @@ -15,36 +21,53 @@ export const BeakerContents = (props) => { The beaker is empty. ))} {beakerContents.map((chemical, i) => ( - - - - {formatUnits(chemical.volume)} of {chemical.name} - - {!!buttons && {buttons(chemical, i)}} - - + ))} ); }; -/** Like above, but for buffer contents */ -export const BufferContents = (props) => { + +export const BufferContents = (props: { + bufferContents: Reagent[]; + buttons: (chemical: Reagent, i: number) => React.JSX.Element; +}) => { const { bufferContents = [], buttons } = props; return ( - {(bufferContents.length === 0 && ( - The buffer is empty. - ))} + {bufferContents.length === 0 && ( + The buffer is empty. + )} {bufferContents.map((chemical, i) => ( - - - - {formatUnits(chemical.volume)} of {chemical.name} - - {!!buttons && {buttons(chemical, i)}} - - + ))} ); }; + +const ChemEntry = (props: { + chemical: Reagent; + buttons: (chemical: Reagent, i: number) => React.JSX.Element; + index: number; +}) => { + const { chemical, buttons, index } = props; + return ( + + + + {formatUnits(chemical.volume)} of {chemical.name} + + {!!buttons && {buttons(chemical, index)}} + + + ); +}; diff --git a/tgui/packages/tgui/package.json b/tgui/packages/tgui/package.json index f9f0a8f76f..23fe482a8c 100644 --- a/tgui/packages/tgui/package.json +++ b/tgui/packages/tgui/package.json @@ -4,13 +4,13 @@ "dependencies": { "common": "workspace:*", "dateformat": "^5.0.3", - "dompurify": "^3.4.11", + "dompurify": "^3.4.12", "es-toolkit": "^1.49.0", "highlight.js": "^11.11.1", "jotai": "^2.20.1", "js-yaml": "^5.2.1", - "marked": "^18.0.5", - "marked-base-url": "^1.1.9", + "marked": "^18.0.6", + "marked-base-url": "^1.1.10", "marked-smartypants": "^1.1.12", "react": "^19.2.7", "react-dom": "^19.2.7", diff --git a/tools/build/build.ts b/tools/build/build.ts index db806a92ea..66d707763e 100644 --- a/tools/build/build.ts +++ b/tools/build/build.ts @@ -293,9 +293,6 @@ export const BunTarget = new Juke.Target({ export const BiomeInstallTarget = new Juke.Target({ dependsOn: [BunTarget], inputs: ['package.json', 'bun.lock'], - onlyWhen: () => { - return Juke.glob('node_modules/@biomejs/**').length === 0; - }, executes: () => { return bunRoot('install'); },