From 9e275e0167a74f64a079298697084f35b0a70be4 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Tue, 21 Jul 2026 13:01:14 +0200 Subject: [PATCH] new tools modules & sass opti --- README.md | 12 + tests/static-smoke.test.mjs | 48 + website/public/static/icons/abacus.svg | 2 + website/public/static/icons/drag.svg | 14 + website/public/static/icons/dropdown.svg | 6 + website/public/static/icons/flip.svg | 4 + .../games/mhwilds/cards/MonsterCard.jsx | 6 + .../toolboxes/modules/ChecklistModule.jsx | 14 +- .../toolboxes/modules/CountersModule.jsx | 55 + .../toolboxes/modules/LinksModule.jsx | 67 + .../toolboxes/modules/ScreenshotsModule.jsx | 88 +- .../src/features/toolboxes/modules/index.jsx | 276 +- website/src/main.jsx | 119 +- website/src/styles/_base.scss | 206 ++ website/src/styles/_cards.scss | 322 +++ website/src/styles/_games.scss | 41 + website/src/styles/_home.scss | 238 ++ website/src/styles/_icons.scss | 99 + website/src/styles/_mhwilds.scss | 444 ++++ website/src/styles/_overlays.scss | 267 ++ website/src/styles/_responsive.scss | 208 ++ website/src/styles/_shell.scss | 185 ++ website/src/styles/_toolboxes.scss | 640 +++++ website/src/styles/main.scss | 2277 +---------------- 24 files changed, 3266 insertions(+), 2372 deletions(-) create mode 100644 website/public/static/icons/abacus.svg create mode 100644 website/public/static/icons/drag.svg create mode 100644 website/public/static/icons/dropdown.svg create mode 100644 website/public/static/icons/flip.svg create mode 100644 website/src/features/toolboxes/modules/CountersModule.jsx create mode 100644 website/src/features/toolboxes/modules/LinksModule.jsx create mode 100644 website/src/styles/_base.scss create mode 100644 website/src/styles/_cards.scss create mode 100644 website/src/styles/_games.scss create mode 100644 website/src/styles/_home.scss create mode 100644 website/src/styles/_icons.scss create mode 100644 website/src/styles/_mhwilds.scss create mode 100644 website/src/styles/_overlays.scss create mode 100644 website/src/styles/_responsive.scss create mode 100644 website/src/styles/_shell.scss create mode 100644 website/src/styles/_toolboxes.scss diff --git a/README.md b/README.md index 955f823..8574003 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,8 @@ Chaque outil possède son propre fichier de composant : - `website/src/features/toolboxes/modules/NotepadModule.jsx` - `website/src/features/toolboxes/modules/ChecklistModule.jsx` - `website/src/features/toolboxes/modules/ScreenshotsModule.jsx` +- `website/src/features/toolboxes/modules/LinksModule.jsx` +- `website/src/features/toolboxes/modules/CountersModule.jsx` Pour ajouter ou maintenir un outil : @@ -126,7 +128,17 @@ Pour ajouter ou maintenir un outil : │ └── toolboxes/ │ └── modules/ └── styles/ + ├── _base.scss + ├── _cards.scss + ├── _games.scss + ├── _home.scss + ├── _icons.scss + ├── _mhwilds.scss + ├── _overlays.scss + ├── _responsive.scss + ├── _shell.scss ├── _tokens.scss + ├── _toolboxes.scss └── main.scss ``` diff --git a/tests/static-smoke.test.mjs b/tests/static-smoke.test.mjs index 8e55779..4d6dc60 100644 --- a/tests/static-smoke.test.mjs +++ b/tests/static-smoke.test.mjs @@ -14,6 +14,11 @@ test("react application defines the expected local toolbox primitives", async () const source = await readFile("website/src/main.jsx", "utf8"); const styles = await readFile("website/src/styles/main.scss", "utf8"); const styleTokens = await readFile("website/src/styles/_tokens.scss", "utf8"); + const styleBase = await readFile("website/src/styles/_base.scss", "utf8"); + const styleToolboxes = await readFile("website/src/styles/_toolboxes.scss", "utf8"); + const styleIcons = await readFile("website/src/styles/_icons.scss", "utf8"); + const styleMhwilds = await readFile("website/src/styles/_mhwilds.scss", "utf8"); + const styleResponsive = await readFile("website/src/styles/_responsive.scss", "utf8"); const iconComponent = await readFile("website/src/components/Icon.jsx", "utf8"); const gamesPage = await readFile("website/src/features/games/GamesPage.jsx", "utf8"); const gameRoute = await readFile("website/src/features/games/GameRoute.jsx", "utf8"); @@ -27,12 +32,25 @@ test("react application defines the expected local toolbox primitives", async () const notepadModule = await readFile("website/src/features/toolboxes/modules/NotepadModule.jsx", "utf8"); const checklistModule = await readFile("website/src/features/toolboxes/modules/ChecklistModule.jsx", "utf8"); const screenshotsModule = await readFile("website/src/features/toolboxes/modules/ScreenshotsModule.jsx", "utf8"); + const linksModule = await readFile("website/src/features/toolboxes/modules/LinksModule.jsx", "utf8"); + const countersModule = await readFile("website/src/features/toolboxes/modules/CountersModule.jsx", "utf8"); assert.match(source, /sokkog:toolboxes/); assert.match(source, /sokkog:game-toolbox-links/); assert.match(source, /styles\/main\.scss/); assert.match(styles, /@use "tokens"/); + assert.match(styles, /@use "toolboxes"/); + assert.match(styles, /@use "mhwilds"/); assert.match(styleTokens, /--gradient-brand/); + assert.match(styleBase, /\.card-icon-button,\n\.drawer-action-button/); + assert.match(styleBase, /\.import-icon-button/); + assert.match(styleToolboxes, /\.module-icon-abacus/); + assert.match(styleIcons, /ui-icon-drag/); + assert.match(styleIcons, /ui-icon-dropdown/); + assert.match(styleIcons, /ui-icon-flip/); + assert.match(styleMhwilds, /\.mhwilds-card/); + assert.match(styleMhwilds, /\.mhwilds-flip-indicator/); + assert.match(styleResponsive, /@media \(max-width: 760px\)/); assert.match(source, /features\/toolboxes\/modules\/index\.jsx/); assert.match(source, /features\/games\/GamesPage\.jsx/); assert.match(source, /features\/games\/GameRoute\.jsx/); @@ -44,17 +62,32 @@ test("react application defines the expected local toolbox primitives", async () assert.match(mhwildsListing, /export function MhwildsListing/); assert.match(mhwildsFilters, /export function MhwildsFilters/); assert.match(monsterCard, /export function MonsterCard/); + assert.match(monsterCard, /ui-icon-flip/); assert.match(endemicCard, /export function EndemicCard/); assert.match(damageTable, /rowIndex/); assert.match(moduleRegistry, /export const TOOLBOX_MODULES/); + assert.match(moduleRegistry, /export function AddToolControls/); assert.match(moduleRegistry, /export function ToolboxModules/); assert.match(moduleRegistry, /MODULE_COMPONENTS/); assert.match(moduleRegistry, /notepad:/); assert.match(moduleRegistry, /checklist:/); assert.match(moduleRegistry, /screenshots:/); + assert.match(moduleRegistry, /links:/); + assert.match(moduleRegistry, /counters:/); + assert.match(moduleRegistry, /editable: false/); + assert.match(moduleRegistry, /module-edit-button/); assert.match(notepadModule, /export function NotepadModule/); assert.match(checklistModule, /export function ChecklistModule/); assert.match(screenshotsModule, /export function ScreenshotsModule/); + assert.match(linksModule, /export function LinksModule/); + assert.match(countersModule, /export function CountersModule/); + assert.match(checklistModule, /editing &&/); + assert.match(screenshotsModule, /editing &&/); + assert.match(linksModule, /editing &&/); + assert.match(countersModule, /editing &&/); + assert.match(countersModule, /counter-actions/); + assert.match(linksModule, /normalizeUrl/); + assert.match(linksModule, /copyText/); assert.match(source, /DEFAULT_SITE_CONTENT/); assert.match(source, /\/data\/site\.json/); assert.match(source, /APP_STORAGE_LIMIT_BYTES/); @@ -63,17 +96,30 @@ test("react application defines the expected local toolbox primitives", async () assert.match(source, /role="progressbar"/); assert.match(source, /function createGlobalExportPayload/); assert.match(source, /async function importAllToolboxes/); + assert.match(source, /import-icon-button/); assert.match(source, /function LinkToolboxModal/); assert.doesNotMatch(source, /description: _description/); assert.match(source, /function CreateToolboxModal/); assert.match(source, /const getToolboxGameId/); assert.match(source, /dragon\.png/); assert.match(source, /getToolboxGame\(toolbox\)/); + assert.match(source, /toolbox-card-cover-link/); assert.match(source, /moduleColumns/); assert.match(source, /function ToolboxView/); assert.match(moduleRegistry, /onDragStart/); + assert.match(moduleRegistry, /onPointerDown/); + assert.match(moduleRegistry, /setPointerCapture/); + assert.match(moduleRegistry, /elementFromPoint/); + assert.match(moduleRegistry, /tool-add-card/); + assert.match(moduleRegistry, /tool-quick-add-button/); + assert.match(moduleRegistry, /tool-add-quick-toggle/); + assert.match(moduleRegistry, /Icon name="dropdown"/); + assert.match(moduleRegistry, /aria-expanded=\{quickOpen\}/); + assert.doesNotMatch(source, / setLabel(event.target.value)} /> - setQty(event.target.value)} aria-label="Quantité cible" /> - - + {editing && ( +
+ setLabel(event.target.value)} /> + setQty(event.target.value)} aria-label="Quantité cible" /> + +
+ )}