Skip to content

Update version, add media import features, and enhance testing - #31

Open
NiceArti wants to merge 6 commits into
devfrom
main
Open

Update version, add media import features, and enhance testing#31
NiceArti wants to merge 6 commits into
devfrom
main

Conversation

@NiceArti

Copy link
Copy Markdown
Contributor

Summary

Synchronizes the dev branch with the latest changes from main.

This brings the active development branch up to date with the current 2.0.5 engine state before starting the next major Flowscape architecture and engine foundation work.

Motivation

The dev branch is currently behind main.

Future development should begin from the latest engine implementation to avoid branch divergence, duplicated work, and the accidental reintroduction of already resolved rendering, stroke, media, and testing issues.

Changes

  • Synchronize the engine package with version 2.0.5 and update the root versioning scripts.
  • Add extensive unit-test coverage for core systems, nodes, scenes, layers, UI modules, rulers, and guides.
  • Add ServiceMediaImport and MediaDropTarget for importing images and videos from files, URLs, clipboard data, and drag-and-drop interactions.
  • Consolidate vector node rendering through the shared shape renderer and remove redundant line, path, polygon, and star renderer implementations.
  • Refactor NodeLine, stroke path generation, stroke metrics, patterned strokes, line endings, and additional stroke areas.
  • Add shared canvas path utilities and improve image/video clipping behavior.
  • Remove the legacy internal style-sheet/color implementation and expose the new media services through the engine entry point.

Testing

All included changes already exist on main. This PR only synchronizes those changes into dev and does not introduce additional implementation changes.

The resulting dev branch should be validated by CI with:

  • Engine and workspace builds
  • Type checking
  • Linting
  • Unit tests
  • Playground verification for media import, line endings, patterned strokes, image rendering, and video rendering

Public API

  • No public API changes
  • Public API was added or changed
  • Breaking change

The public API adds exports for the new media import and drag-and-drop services.

The legacy style-sheet exports and dedicated renderer exports for line, path, polygon, and star nodes were removed. Consumers importing those APIs directly may require migration.

ShapeBase and stroke-related types were also extended to support dedicated stroke path commands and additional stroke areas.

Visual changes

Visual rendering behavior was updated for:

  • Line caps and endings
  • Solid, dashed, and dotted line strokes
  • Stroke alignment and generated stroke geometry
  • Image and video clipping

No additional screenshots are included because this PR synchronizes behavior already present on main.

Checklist

  • The project builds successfully
  • Type checking passes
  • Linting passes
  • Tests pass
  • Relevant behavior was tested in the Playground
  • New behavior has tests where practical
  • Documentation was updated where necessary
  • CHANGELOG.md was updated where necessary
  • No unrelated changes beyond the main to dev synchronization were included

- Implement tests for LayerBase, LayerBackground, LayerOverlay, LayerUI, and LayerWorld to verify their functionality and state management.
- Create tests for ManagerLayerUI and ModuleBaseLayerUI to ensure proper registration and lifecycle management of UI modules.
- Add tests for ModuleRulerUI to validate ruler behavior, guide management, and DOM interactions.
- Introduce tests for RulerGuideLine to check color parsing, thickness rounding, and reset functionality.
- Update turbo.json to ensure test dependencies are correctly configured.
- Added ServiceMediaImport for handling media import from various sources.
- Introduced MediaDropTarget to manage drag-and-drop media interactions.
- Updated playground main.ts to integrate media import and drop features.
- Refactored canvas rendering to support media content with clipping paths.
- Removed unused line, path, polygon, and star renderers to streamline codebase.
- Added utility functions for appending shape paths in canvas rendering.
- Enhanced media handling with metadata loading for images and videos.
- Updated engine exports to include new services and utilities.
- Added `toStrokePathCommands` method to `ShapeBase` for stroke path command retrieval.
- Moved stroke-related functions to dedicated files: `resolveStrokePathMetrics.ts` and `resolveStrokeStylePattern.ts`.
- Updated `ShapeStrokePath` type to include optional `additionalAreas`.
- Cleaned up imports and removed unused code in `index.ts`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant