Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
*.ase binary
*.aseprite binary
*.moonsprite binary
*.ttf binary
*.woff binary
*.woff2 binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
.pnpm-store/
out/
website/dist/
/release/
coverage/
.vite/
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
- 项目默认始终处于当前 `dev.X` 的连续开发阶段,直到用户明确要求“发布 dev.X”“准备发布”或“生成开发版”。
- 工作流只有“dev.X 开发中”和“dev.X 发布”两个阶段,不设置中间稳定批次,也不因累计若干需求自动升级验证。
- 当前开发周期起点提交 SHA 是本周期的审计基线;发布时只审计该基线之后的累计变化。日常任务只验证 AI 本次实际修改的文件。
- `$moonsprite-code-architect` 只在用户明确要求整项目架构审计、重大里程碑架构复查或大型跨模块重构规划时调用,默认只读。普通需求、UI 修改和连续 Debug 不得自动调用,也不得恢复按需求自动分派子 Agent 的工作流。
- 除用户明确调用 `$moonsprite-code-architect` 外,所有普通需求、UI 修改、Debug、审查、测试和发布工作都由当前主 Agent 直接完成,禁止创建、分派或保留任何子 Agent。
- `$moonsprite-code-architect` 只在用户明确要求整项目架构审计、重大里程碑架构复查或大型跨模块重构规划时调用,默认只读;每次只允许创建一个架构师实例,且该实例禁止继续创建或分派后代 Agent。普通需求、UI 修改和连续 Debug 不得自动调用,也不得恢复按需求自动分派子 Agent 的工作流。

## 修改流程

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

| 版本 | 完整记录 |
| --- | --- |
| `DEV.5` | [查看 DEV.5 完整更新记录](docs/changelog/DEV.5.md) |
| `DEV.4` | [查看 DEV.4 完整更新记录](docs/changelog/DEV.4.md) |
| `DEV.3` | [查看 DEV.3 完整更新记录](docs/changelog/DEV.3.md) |
| `DEV.2` | [查看 DEV.2 完整更新记录](docs/changelog/DEV.2.md) |
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

MoonSprite 是原创实现。禁止提交复制自 Aseprite 或其他项目的源码、图标、主题和受保护资源。

## 贡献许可

除非另有书面协议,提交贡献即表示你有权提供该内容,并同意贡献内容按仓库当前的 MoonSprite Source-Available License 1.0 发布。你同时授予 MoonSprite 版权持有人永久、全球、非独占、免版税的权利,用于使用、修改、分发以及在官方商业二进制中销售包含该贡献的版本。你仍保留自己贡献内容的版权。

## 开发流程

1. 从 `main` 创建短期分支,名称使用 `feature/`、`fix/`、`refactor/` 或 `docs/` 前缀。
Expand Down
72 changes: 72 additions & 0 deletions EULA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# MoonSprite Official Binary End User License Agreement 1.0

Effective date: August 16, 2026

This agreement applies only to official MoonSprite binaries obtained from
MoonSprite's copyright holders or an authorized distribution channel. Steam or
another authorized store may impose additional platform terms.

## 1. License Grant

MoonSprite grants the licensed user a limited, non-exclusive,
non-transferable license to install and use the official binary on devices
controlled by that user. The licensed user may use MoonSprite for personal,
educational, and commercial creative work.

## 2. Seats and Organizations

Unless an organization, education, or site license says otherwise, one license
seat is required for each person who actively uses MoonSprite. A personal
license may not be shared between users. Contact the MoonSprite copyright
holders for classroom, lab, studio, or organization-wide licensing.

## 3. Restrictions

You may not redistribute, resell, sublicense, rent, lease, lend, share, or make
the official binary available to unlicensed users. You may not bypass store
access controls or present a modified build as an official MoonSprite release.
Reverse engineering is not restricted where applicable law expressly grants
that right.

## 4. Backups and Devices

You may keep reasonable backup copies and install the official binary on
multiple devices you control, provided only the licensed user uses those
copies. Authorized-store account rules continue to apply.

## 5. Artwork and Other Output

You retain all rights you otherwise hold in artwork, animation, documents,
exports, and other content created with MoonSprite. MoonSprite claims no
ownership of that output, and commercial use of the output is permitted.

## 6. Updates

Updates may be provided through authorized channels. This agreement does not
guarantee support, compatibility, future features, or free access to every
future major version.

## 7. Source Code and Third-party Components

Source code is licensed separately under LICENSE. Third-party components remain
under their own licenses as described in THIRD_PARTY_NOTICES.md and bundled
notices.

## 8. Ownership and Trademarks

MoonSprite and its original assets remain the property of their respective
copyright holders. This agreement grants no ownership interest or trademark
license.

## 9. Termination

This license terminates automatically if you materially violate this
agreement. On termination, you must stop using and delete unlicensed copies of
the official binary. Rights in user-created output are unaffected.

## 10. Disclaimer and Liability

THE OFFICIAL BINARY IS PROVIDED "AS IS" WITHOUT WARRANTIES OF ANY KIND. TO THE
MAXIMUM EXTENT PERMITTED BY LAW, THE COPYRIGHT HOLDERS SHALL NOT BE LIABLE FOR
INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING FROM
USE OF THE SOFTWARE.
107 changes: 92 additions & 15 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,98 @@
MIT License
MoonSprite Source-Available License 1.0

Effective date: August 16, 2026
Copyright (c) 2026 MoonSprite contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
This license applies to MoonSprite source code first published under this
license. It is a source-available license and is not an open-source license as
defined by the Open Source Initiative.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Definitions

"Software" means the MoonSprite source code, documentation, and original
assets distributed with this license.

"Source Form" means the preferred form for reading or modifying the Software.

"Binary Form" means any compiled, packaged, executable, installer, portable,
hosted, or otherwise directly usable form of the Software.

"Official Binary" means a Binary Form distributed by MoonSprite's copyright
holders or through a channel they have authorized, including an authorized
Steam release.

2. Source Form permissions

Subject to this license, you may:

a. inspect, study, and evaluate the Source Form;
b. modify the Source Form;
c. compile and run your own Binary Form for personal, educational, evaluation,
contribution, or internal development and testing purposes; and
d. redistribute the Source Form or patches to it, with or without changes, if
you include this license, preserve copyright and attribution notices, mark
material changes, provide the complete corresponding Source Form, and apply
this same license to the redistributed Software.

3. Binary Form restrictions

Except for private use allowed by Section 2(c), or under a separate written
commercial distribution agreement, you may not:

a. distribute, sell, sublicense, rent, lease, lend, or publicly provide any
Binary Form to another person or organization;
b. offer the Software as a hosted, streamed, portable, or managed application
service for another person or organization;
c. bypass an authorized distribution channel, payment requirement, license
check, or access control; or
d. present an unofficial build as an Official Binary.

Source availability does not grant a right to redistribute compiled builds.

4. Official Binaries

Official Binaries are licensed separately under the MoonSprite Official Binary
End User License Agreement (EULA.md) and any applicable authorized-store terms.
The EULA permits licensed users to create personal and commercial artwork.

5. User-created output

You retain all rights you otherwise hold in artwork, animation, documents,
exports, and other content created with the Software. This license does not
claim ownership of that output.

6. Trademarks

This license grants no right to use the MoonSprite name, logo, trade dress, or
other brand identifiers to endorse or identify a redistributed or modified
build. Factual attribution is permitted.

7. Third-party material

Third-party software, fonts, libraries, formats, and assets remain governed by
their own licenses. See THIRD_PARTY_NOTICES.md and the notices distributed with
those components.

8. Termination

Your rights under this license terminate automatically if you violate it. They
may be reinstated only when the violation is cured and the copyright holders
confirm reinstatement in writing.

9. Disclaimer of warranty

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.

10. Limitation of liability

TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE COPYRIGHT HOLDERS SHALL NOT BE
LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN
CONNECTION WITH THE SOFTWARE OR ITS USE.

11. Previously published MIT versions

Code and releases already published under the MIT License remain available
under those historical terms. This license does not revoke permissions already
granted for those versions. See LICENSE-MIT.
27 changes: 27 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Historical MIT License Notice

MoonSprite versions and commits already published under the MIT License before
August 16, 2026 remain available under the following terms. This file does not
apply to later source unless that source is explicitly marked as MIT licensed.

MIT License

Copyright (c) 2026 MoonSprite contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MoonSprite

MoonSprite 是面向 Windows 的原创开源像素画工作台,使用 Tauri 2、React、TypeScript、Zustand 和 Canvas 构建。项目采用 MIT License,与 Aseprite 无隶属关系,也不使用其源码、品牌或视觉资产。
MoonSprite 是面向 Windows 的原创源码可见像素画工作台,使用 Tauri 2、React、TypeScript、Zustand 和 Canvas 构建。项目与 Aseprite 无隶属关系,也不使用其源码、品牌或视觉资产。

当前界面渠道标识为 `DEV`;构建系统继续使用合法的内部 SemVer `0.1.0`。

Expand Down Expand Up @@ -51,6 +51,13 @@ pnpm build

运行时用户目录不会提交到仓库。内置示例工程位于 `src-tauri/resources/示例.moonsprite`。

## 许可

- 当前源码使用 [MoonSprite Source-Available License 1.0](LICENSE):允许查看、修改、个人编译与源码形式再分发,但未经书面授权不得分发编译后的 MoonSprite。
- Steam 及其他授权渠道的官方二进制使用 [MoonSprite Official Binary EULA](EULA.md),允许个人与商业创作,按用户席位授权。
- 已经以 MIT License 发布的历史版本继续保留原有权利,见 [LICENSE-MIT](LICENSE-MIT)。
- 第三方字体与依赖遵循各自许可,见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。

## 维护入口

- [文档索引](docs/README.md)
Expand Down
20 changes: 20 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Third-party Notices

MoonSprite includes third-party components that are not relicensed under the
MoonSprite Source-Available License or the MoonSprite Official Binary EULA.

## Bundled Fonts

- Fusion Pixel Font: SIL Open Font License 1.1. The license text is stored at
`src-tauri/resources/fonts/licenses/Fusion-Pixel-Font-OFL-1.1.txt`.
- Silkscreen: SIL Open Font License 1.1. The license text is stored at
`src-tauri/resources/fonts/licenses/Silkscreen-OFL-1.1.txt`.
- Tiny5: SIL Open Font License 1.1. The license text is stored at
`src-tauri/resources/fonts/licenses/Tiny5-OFL-1.1.txt`.

## Software Dependencies

JavaScript and Rust dependencies remain under the licenses declared by their
respective authors. Dependency versions are recorded in `pnpm-lock.yaml` and
`src-tauri/Cargo.lock`. Release packages must preserve all notices required by
those licenses.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
## 产品与架构

- [产品行为契约](product/behavior.md):用户可见能力和稳定规则。
- [UI 设计规范](ui-design-system.md):颜色、字号、间距、控件密度、像素图标和组件复用规则。
- [架构概览](architecture/overview.md):模块职责和依赖方向。
- [状态与历史](architecture/state-history.md):会话、dirty、撤销和视图状态。
- [坐标与渲染](architecture/coordinates-rendering.md):屏幕、视图、画布和图层坐标。
- [多语言架构](architecture/localization.md):语言资源、回退、持久化和新增语言门禁。
- [文件格式](file-format.md):`.moonsprite` v2 容器。
- [文件格式](file-format.md):`.moonsprite` v12 容器。

## 交互契约

Expand Down
58 changes: 58 additions & 0 deletions docs/adr/0008-sparse-raster-project-storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ADR-0008: Sparse Raster Project Storage

## Status

Accepted

## Context

Large MoonSprite projects may contain dozens of canvas-sized layer and cel
surfaces whose meaningful pixels occupy only a small fraction of each surface.
ZIP Deflate keeps the file compact on disk, but opening still expands every raw
surface before the editor can use it. A 4596 x 1767 project can therefore expand
hundreds of megabytes even when most tiles are transparent.

## Decision

- Project schema v5 may store each layer or cel as one `sparse-tiles-v1`
resource containing only nonzero 64 x 64 tiles. It does not create thousands
of ZIP entries.
- The writer compares sparse and raw byte counts per resource and keeps the
smaller representation. RGBA tile occupancy checks all four bytes so hidden
RGB values under zero alpha remain lossless; indexed occupancy treats ID 0 as
transparent.
- The reader validates the complete tile directory and reconstructs one
contiguous raster surface covering the stored tile bounds. Its canvas offset
and stable storage origin preserve document coordinates, while tools,
compositing, history, Store, and platform APIs continue to use the existing
contiguous-surface contract.
- Schema v1-v4 resources migrate as raw data in memory. Their first save writes
schema v5 and may choose sparse storage. Unknown encodings and malformed tile
containers are rejected.
- Incremental save continues to track one CRC and revision per raster resource.
Unchanged v5 resources reuse their original path, encoding, dimensions,
offsets, and compressed ZIP entry; changed compact surfaces are encoded from
their current runtime geometry.
- Opening registers the incremental-save baseline from the decoded manifest,
resource references, and ZIP CRCs without re-encoding all pixels. Worker
routing estimates expanded raster bytes from the manifest so a compact v5 ZIP
cannot move a large allocation back onto the UI thread.

## Consequences

Sparse large projects expand far fewer bytes from ZIP, can avoid allocating
transparent space outside each resource's stored tile bounds, and avoid a
second full raster scan after decoding. Projects whose content spans distant
tiles inside most layer bounding boxes may see little runtime-memory reduction;
this design is not a permanently tiled runtime. Runtime rendering and editing
preserve the existing pixel representation and visual output. Dense resources
can remain raw, and a saved v5 file requires a v5-aware reader even though v5
readers remain backward compatible with v1-v4.

## Alternatives

One ZIP entry per tile was rejected because thousands of central-directory
entries add metadata, lookup, and merge overhead. Keeping only raw resources was
rejected because Deflate reduces disk size but not expanded decode work. A
permanently tiled runtime model was deferred because it would cross drawing,
selection, undo, compositing, and cache ownership boundaries.
Loading
Loading