Skip to content

Commit 280ad30

Browse files
wernerbihlCopilot
andauthored
Feature/2026 04 11 (#2)
* feat: add font sources and update CSP for improved styling and security * feat: implement map resizing functionality in MapCanvas and update MapPanel to handle map options * refactor: improve readability of map resizing calculations in MapCanvas * feat: enhance map resizing interaction with hover effects and improved delta calculation * refactor: simplify background property formatting for resize grips in MapCanvas * refactor: enhance pixel manipulation functions for better blending and clearing in image editor * feat: enhance object properties handling and improve pencil tool functionality in image editor * refactor: streamline import statements and improve formatting in ObjectPropertiesDialog * feat: implement delete functionality for selected tiles, objects, and layers in MapPanel * refactor: improve code readability by formatting conditional statements and expressions in MapPanel * feat: add brush and blur size options to ToolSidebar and EditorToolbar Co-authored-by: Copilot <copilot@github.com> * feat: implement canvas resizing functionality and enhance image editor history management * feat: Implement text object functionality and editor - Refactored ObjectsPanel to use ObjectPropertiesDialogManager for managing object properties. - Added support for text objects in the project, including rendering, editing, and properties management. - Introduced TextObjectEditorOverlay for editing text objects directly on the canvas. - Created utility functions for handling text object properties and rendering. - Enhanced drawMapObjects to include text object rendering. - Added local font loading capabilities and presets for text objects. - Updated project normalization to include text object properties. - Introduced hooks for managing text object editing state. - Expanded type definitions to accommodate new text object features. Co-authored-by: Copilot <copilot@github.com> * refactor: improve code formatting and readability across multiple files * feat: add context menu functionality for map canvas with object editing options Co-authored-by: Copilot <copilot@github.com> * feat: enhance project import/export functionality with support for image layers and layer groups * refactor: improve code formatting for better readability in remapping functions * feat: Refactor map geometry handling and improve scene interaction - Introduced new map geometry utilities in `map-geometry.ts` for handling different map types (orthogonal, hexagonal). - Updated `use-scene-interaction.ts` to utilize new geometry functions for cell interactions and drawing previews. - Enhanced `MapPanel` to support new map types and geometry settings during map creation. - Modified fill region logic in `terrain.ts` to leverage new map geometry functions for adjacent cell calculations. - Updated project normalization to include new map geometry properties. - Added types for new map geometry in `map-geometry.ts` and updated related interfaces across the codebase. - Improved context menu interactions in `use-map-canvas-context-menu.ts` to use new cell retrieval methods. Co-authored-by: Copilot <copilot@github.com> * refactor: improve code formatting and readability across multiple components --------- Co-authored-by: Copilot <copilot@github.com>
1 parent 7a6c95e commit 280ad30

52 files changed

Lines changed: 4414 additions & 1112 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
- Always run "bun run lint" after making changes and correct all the errors you see, even if it was not a direct issue caused by current code changes
44
- Always comply with ARIA accessibility standards and make sure all inputs have an id and name field. If you are working on a file which doesn't comply with ARIA standards, add the necessary ARIA fields as part of user request, even if the changes does not fall within scope
55
- Do not inline typescript types and interfaces - move them to /src/types/
6+
- When working on a file, and it is more than 1000 lines of code then refactor it into smaller, easier to test and maintain files. There are no exceptions to this. Always do this even if it is outside the scope of what was asked
7+
- Always run `bun run build` after making code changes to verify that the build succeeds

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Reporting a Vulnerability
2+
3+
Please contact admin@2dtiler.com with information about the security vulnerability.
4+
5+
We highly appreciate any vulnerability feedback!

TODO.txt

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
Check why sentry is not working in prod
1+
Refactor files longer than 1000 lines of code
22

3-
Image/sprite Editor:
4-
Opacity not real opacity
5-
Allow palette importing from Lospec: https://api.2dtiler.com/lospec_palettes
6-
- https://lospec.com/palette-list/load?colorNumberFilterType=any&page=0&tag=&sortingType=newest
7-
8-
- Object properties are not saving
9-
- Delete button should delete the selected thing
10-
- Enable map export to serialize image layers
11-
- Add Text to Object Layer
12-
- Add map should allow options for Orientation: Orthogonal (Default), Isometric, Isometric (Staggered), Hexagonal (Staggered)
3+
Add Isometric map type
134

145
Import Options
15-
===================================
166
Export Options
177

188
AI Asset Generation:
@@ -28,6 +18,7 @@ Update README.md
2818
Ad Marketplace for selling/buying tilesets etc.
2919

3020
Exploration:
21+
Universal lpc spritesheet generator
3122
Ogmo Editor
3223
LDTK
3324
Pixelorama
@@ -37,7 +28,6 @@ Exploration:
3728
Libresprite
3829
Autotile
3930
SpriteFusion
40-
Universal lpc spritesheet generator
4131
Tilekit
4232
Tilesetter
4333
Tileforge
@@ -47,12 +37,15 @@ Exploration:
4737
Makko.ai
4838
Keep Notes
4939

40+
Text Layer custom fonts not working
41+
42+
Allow palette importing from Lospec: https://api.2dtiler.com/lospec_palettes
43+
- https://lospec.com/palette-list/load?colorNumberFilterType=any&page=0&tag=&sortingType=newest
44+
5045
Manage Tilesets
5146
Manage Maps
5247
Royalty free packs
5348
Add unit tests and add to CI/CD
54-
Write documentation for website. Use /nothing-design
55-
High touch animations
5649
Add tutorial video
5750
Add roadmap voting on home page
5851
Windows/Mac/Linux Apps

bun.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
88
<meta name="theme-color" content="#000000" />
99
<meta name="description" content="A 2D tile map editor" />
10-
<link rel="preconnect" href="https://fonts.googleapis.com" />
11-
<link
12-
rel="stylesheet"
13-
href="https://fonts.googleapis.com/css2?family=Doto:wght@400..700&family=Space+Grotesk:wght@300..700&family=Space+Mono:wght@400;700&display=swap"
14-
/>
1510
<!-- Security: CSP enforced via HTTP headers (_headers for production,
1611
server.headers in vite.config.ts for local dev). -->
1712
<title>2D Tiler</title>

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"deploy": "bun run build && wrangler pages deploy dist --project-name 2dtiler-app"
1212
},
1313
"dependencies": {
14+
"@fontsource/doto": "^5.2.10",
15+
"@fontsource/space-grotesk": "^5.2.10",
16+
"@fontsource/space-mono": "^5.2.9",
1417
"@msgpack/msgpack": "^3.1.3",
1518
"@sentry/react": "^10.47.0",
1619
"class-variance-authority": "^0.7.1",

public/_headers

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
# default-src: fall-back for anything not listed explicitly
2222
# script-src: self + Cloudflare Insights beacon
2323
# style-src: unsafe-inline required for Radix UI / Tailwind inline styles
24-
# plus Google Fonts stylesheet loading
2524
# img-src: data: / blob: for canvas exports; https: for remote images
26-
# font-src: self + Google Fonts font files
25+
# font-src: self-hosted app fonts + data: URIs
2726
# connect-src: Sentry ingest + Cloudflare Insights RUM endpoint + app APIs
2827
# worker-src: blob: for Vite-generated web workers
2928
# object-src: none (no Flash / plugins)
3029
# base-uri: self (prevent base-tag injection)
3130
# form-action: self (no external form submissions)
3231
# frame-ancestors: none (blocks clickjacking; supersedes X-Frame-Options)
3332
# upgrade-insecure-requests: force HTTP→HTTPS for sub-resources
34-
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; img-src 'self' data: blob: https:; font-src 'self' data: https://fonts.gstatic.com; connect-src 'self' https://o4510891797250048.ingest.us.sentry.io https://*.sentry.io https://cloudflareinsights.com https://api.openai.com https://api.together.xyz https://api.x.ai; worker-src 'self' blob:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests
33+
Content-Security-Policy: default-src 'self'; script-src 'self' https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https://o4510891797250048.ingest.us.sentry.io https://*.sentry.io https://cloudflareinsights.com https://api.openai.com https://api.together.xyz https://api.x.ai; worker-src 'self' blob:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests

0 commit comments

Comments
 (0)