mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 16:31:04 +00:00
Two issues SonarCloud raised on main after #2821/#2822 merged: - **typescript:S8786** `SceneState.ts` `base64ToFile`: #2821's `/:([^;]*);/` is still flagged. The mime type is now read with `indexOf`: the text between the first `:` and the `;` after it, else `image/png`. Checked equal to the regex on `data:image/png;base64`, `data:;base64`, a header with no `:` or `;`, and several `:`. - **typescript:S6852** `MentionTextarea`: the `role="textbox"` editor gets `tabIndex={disabled ? -1 : 0}`. A `contentEditable` element was focusable already, so nothing changes for users. Typechecked locally against main (no new errors). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved image import handling so MIME types are identified more reliably, with PNG used as a fallback when the type cannot be determined. * Disabled text editors are no longer reachable through sequential keyboard navigation; enabled editors remain tabbable. * Physics support is initialized during editor setup after the required canvas and container elements are available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> - **typescript:S7059** `editor.ts`: `ensureAmmoLoaded()` (an async load) moves out of the `Editor` constructor to `EngineProvider`, the only place an `Editor` is built, right before `new Editor(...)`. The loader is a singleton, so the script is still appended once.