Commit graph

200 commits

Author SHA1 Message Date
Claude
1af7e761b9
fix: Move control styles to presentational components
- Moved brightness control styles from container SASS to BrightnessControlsComponent
- Moved zoom control styles from container SASS to ZoomControlsComponent
- Fixed Angular view encapsulation issue preventing styles from applying
- Added @brianpooe/ngx-pinch-zoom path mapping to tsconfig.json
- Updated app component to import from @brianpooe/ngx-pinch-zoom

This fixes the issue where control icons were not visible due to Angular's
view encapsulation preventing parent component styles from applying to
child presentational components. Each component now contains its own styles.
2025-11-16 14:15:21 +00:00
Claude
cbb2a5532f
fix: Preserve layout styles in destroy() method
- Removed removeBasicStyles() call from destroy()
- Keeps layout styles (display: flex, alignItems, justifyContent) intact
- Only resets zoom state and removes event listeners
- Component remains visually correct after calling destroy()

This allows destroy() to be used as a manual reset method without
breaking the component's visual layout. The component can now be
safely reset without removing essential flex container styles.
2025-11-16 14:08:33 +00:00
Claude
40b485d624
fix: Reset zoom state properly in destroy() method
- Added zoom state reset (scale=1, moveX=0, moveY=0) before cleanup
- Explicitly sets transform to 'none' and transition to 'none'
- Prevents image from appearing enlarged/overflowed after destroy
- Ensures clean state restoration before removing event listeners

This fixes the issue where calling destroy() would enlarge the image
and cause overflow instead of properly resetting the component state.
2025-11-16 13:59:55 +00:00
Claude
7dbc12c185
fix: Add zoneless mode guards to prevent initialization errors
- Added null checks in getImageElement() for this.element
- Updated getImageHeight() and getImageWidth() to use optional chaining
- Added guards in isDragging() for this.element and this.parentElement
- Returns safe defaults (0, false, undefined) when service not initialized

This fixes TypeError in zoneless mode where computed signals are evaluated
immediately during template rendering, before ngOnInit() runs. The guards
ensure methods return safe values until the service is properly initialized.

Critical for Angular 20 zoneless change detection compatibility.
2025-11-16 13:48:06 +00:00
Claude
10c0dde307
fix: Use official provideZonelessChangeDetection API
- Added explicit provideZonelessChangeDetection() from @angular/core
- Follows official Angular 20 zoneless documentation
- Explicit configuration is better than implicit defaults
- Enables zoneless mode for optimal performance with signals
2025-11-16 13:41:39 +00:00
Claude
46c5cbda65
refactor: Use stable zoneless mode for Angular 20
- Removed provideZonelessChangeDetection() call
- In Angular 20+, zoneless is stable and default when no zone provider specified
- No Zone.js dependency needed - cleaner and more performant
- Aligns with official Angular 20 zoneless documentation
2025-11-16 13:37:15 +00:00
Claude
02151446cb
fix: Configure example app for Angular 20 zoneless mode
- Added provideZonelessChangeDetection() to enable zoneless mode
- Resolves NG0908 error (Angular requires Zone.js)
- Modern approach that works perfectly with signals-based library
- No Zone.js dependency needed for the example app
2025-11-16 13:34:59 +00:00
Claude
27bd5d7326
docs: Update documentation and modernize example app
Documentation updates:
- Corrected library README to reflect IvyPinchService and TouchesService are Angular services, not utility classes
- Updated CHANGELOG to accurately describe service architecture
- All services now correctly documented as using Angular's DI system

Example app modernization:
- Converted AppComponent to standalone component (removed NgModule)
- Updated to use Angular 20 signals (signal() for state)
- Updated main.ts to use bootstrapApplication instead of bootstrapModule
- Fixed template to call signal values as functions
- Added JSDoc documentation

All features demonstrated:
- Click-to-zoom functionality
- Brightness control
- Combined workflows (click-to-zoom + brightness)
- All configuration options
- Programmatic control methods
2025-11-16 10:03:44 +00:00
Claude
f4d8717cc9
docs: Update credits to properly attribute complete contributor chain
- Added original author: Nikita Drozhzhin (drozhzhin-n-e/ngx-pinch-zoom)
- Added Angular 19/20 fork contributors: Konstantin Schütte and Björn Schmidt (medDV-GmbH)
- Structured credits to show development lineage: Original → Fork → Current
- Updated all three documentation files with consistent attribution
2025-11-16 09:49:14 +00:00
Claude
ef3c6365db
refactor: Convert IvyPinch and Touches to proper Angular services
Converted core utility classes to Angular services with @Injectable decorators
for better consistency with Angular best practices and modern DI patterns.

**Breaking Changes:**

This is a fresh start with no backward compatibility.

1. **IvyPinch → IvyPinchService**
   - Added @Injectable() decorator
   - Constructor removed, replaced with init(properties, callback) method
   - Now injected via Angular DI instead of instantiated with 'new'
   - Injected TouchesService instead of creating new Touches instance
   - Provided at component level for proper instance scoping

2. **Touches → TouchesService**
   - Added @Injectable() decorator
   - Constructor removed, replaced with init(properties) method
   - Now injected via Angular DI instead of instantiated with 'new'
   - Provided at component level for proper instance scoping

3. **PinchZoomComponent Updates**
   - Added IvyPinchService and TouchesService to providers array
   - Injected services via inject() function
   - Changed from 'new IvyPinch()' to 'ivyPinchService.init()'
   - Updated all references from this.pinchZoom to this.ivyPinchService

4. **Removed Backward Compatibility**
   - Deleted ivypinch.ts (re-export shim)
   - Deleted touches.ts (re-export shim)
   - Clean break for fresh start with Angular 20 patterns

**Benefits:**

- Fully consistent with Angular service architecture
- Better dependency injection throughout
- Each component gets properly scoped service instances
- Cleaner, more testable code
- No ambiguity about utility classes vs services
- Professional Angular patterns from top to bottom

**Technical Details:**

Services are provided at component level (not root) to ensure each
PinchZoomComponent instance gets its own IvyPinchService and TouchesService
with isolated state.

All builds passing (library + example app).
2025-11-16 09:33:14 +00:00
Claude
6e751e0dd5
docs: Clarify core logic attribution and modernization scope
Updated documentation to more accurately reflect what was preserved from the
original library versus what was rebuilt for Angular 20.

**Key Changes:**

**package.json:**
- Updated description to clarify "rebuilt with modern signals" rather than
  "complete rewrite"
- Emphasizes core logic is "adapted from original" with "extensive enhancements"

**README.md Credits Section:**
Now clearly separated into two parts:

1. **What's From the Original:**
   - Core pinch-to-zoom mathematics and transform algorithms (IvyPinch)
   - Touch and mouse gesture detection logic (Touches)
   - Original zoom/pan calculations and constraints

2. **What's New in This Version:**
   - Complete Angular 20 signals API migration
   - Professional architecture (models/, services/, containers/, presentational/)
   - Smart/Dumb component pattern
   - New features: brightness control, click-to-zoom
   - Service-based state management
   - 778 lines of JSDoc documentation

**CHANGELOG.md:**
- Changed from "Complete Rewrite" to "Major Modernization"
- Added explanation: "core zoom/pan mathematics from the original library have
  been preserved and enhanced, while the Angular implementation has been
  completely rebuilt"
- Credits section now explicitly lists what was retained from original

**Library README.md:**
- Added "Core Logic Attribution" section
- Added "Modernization & New Features" section
- Clearer separation of original work vs new work

**Rationale:**

This is more accurate and gives proper credit to the original developers for
their excellent core zoom algorithms while still highlighting the significant
work done to:
- Migrate to Angular 20 signals
- Redesign the architecture
- Add new features (brightness, click-to-zoom)
- Add comprehensive documentation

The core math and gesture detection logic from Nikita Drozhzhin's original
work remains the foundation, enhanced with modern Angular patterns and new
capabilities.
2025-11-16 09:20:42 +00:00
Claude
97a68341ff
chore: Add @brianpooe scope to package name
Updated package name from `ngx-pinch-zoom` to `@brianpooe/ngx-pinch-zoom`
to properly scope the package under the @brianpooe npm organization.

**Changes:**

- projects/ngx-pinch-zoom/package.json: name → @brianpooe/ngx-pinch-zoom
- README.md: All import examples updated to use scoped package name
- CHANGELOG.md: Installation command updated
- projects/ngx-pinch-zoom/README.md: Import examples updated
- ivypinch.ts: Deprecation notice updated with scoped package name
- touches.ts: Deprecation notice updated with scoped package name

Library builds successfully as @brianpooe/ngx-pinch-zoom.
2025-11-16 09:15:54 +00:00
Claude
40fac72bc0
docs: Update ownership, credits, and architecture documentation
This commit updates all documentation to reflect the complete Angular 20 rewrite
and establishes proper attribution for the original library authors.

**Package Changes:**

1. **package.json**
   - Changed name from @meddv/ngx-pinch-zoom to ngx-pinch-zoom
   - Updated author to Brian Pooe
   - Removed contributors (moved to Credits section in docs)
   - Updated repository URLs to brianpooe/ngx-pinch-zoom
   - Enhanced description highlighting modern architecture
   - Added keywords: Angular signals, smart components, anomaly detection

2. **Main README.md**
   - Updated all import examples from @meddv/ngx-pinch-zoom to ngx-pinch-zoom
   - Added comprehensive Architecture section with folder structure
   - Added Design Patterns section (Smart/Dumb, Services, Signals, DI)
   - Added detailed Credits section acknowledging original authors:
     * Nikita Drozhzhin - Original creator
     * Konstantin Schütte - Angular 19 fork maintainer
     * Björn Schmidt - Angular 19 fork contributor
   - Updated GitHub issues link to brianpooe repository

3. **CHANGELOG.md**
   - Updated version date to 2025-11-16
   - Changed title to "Complete Rewrite: Angular 20 + Professional Architecture"
   - Reorganized features to highlight new capabilities:
     * Click to Zoom for anomaly detection
     * Brightness Control
     * Professional Architecture
     * Smart/Dumb Components
   - Added Architecture Changes section with folder structure
   - Added comprehensive Credits section with original authors
   - Updated migration guide npm install command

4. **Library README.md** (projects/ngx-pinch-zoom/README.md)
   - Complete rewrite with focus on architecture and quality
   - Added detailed folder structure documentation
   - Added Design Patterns section explaining:
     * Smart/Dumb Component Pattern
     * Service-Based Architecture
     * Signal-Based Reactivity
     * Modern Dependency Injection
   - Added Code Quality section (778 lines JSDoc, strict mode, etc.)
   - Added Use Cases section (anomaly detection, medical imaging, etc.)
   - Added Credits section with full attribution

5. **Deprecated Re-export Files**
   - Updated @deprecated comments in ivypinch.ts and touches.ts
   - Changed import examples from @meddv/ngx-pinch-zoom to ngx-pinch-zoom

**Key Documentation Themes:**

- Emphasizes this is a **complete rewrite**, not just an update
- Proper attribution to original authors in Credits sections
- Highlights professional Angular architecture patterns
- Documents the clean folder structure (models/, services/, components/)
- Explains smart/dumb component pattern explicitly
- Shows real-world use cases (anomaly detection, defect inspection)

All references to @meddv and medDV-GmbH have been removed from ownership
positions and properly attributed in Credits sections.
2025-11-16 09:13:35 +00:00
Claude
4ca19ec858
refactor: Implement clean Angular architecture with explicit folder structure
This commit restructures the library to follow Angular best practices with clear
separation of concerns and explicit smart/dumb component organization.

**Directory Structure Changes:**

models/
├── interfaces.model.ts (moved from interfaces.ts)
├── properties.model.ts (moved from properties.ts)
├── zoom-config.model.ts (existing)
├── transform-state.model.ts (existing)
├── brightness-state.model.ts (existing)
├── click-to-zoom.model.ts (existing)
└── index.ts (barrel export)

services/
├── brightness.service.ts (existing)
├── zoom-state.service.ts (existing)
├── ivy-pinch.service.ts (moved from ivypinch.ts)
├── touches.service.ts (moved from touches.ts)
└── index.ts (barrel export)

components/
├── containers/
│   └── pinch-zoom/
│       ├── pinch-zoom.container.ts (renamed from pinch-zoom.component.ts)
│       ├── pinch-zoom.container.html (renamed from pinch-zoom.component.html)
│       └── pinch-zoom.container.sass (renamed from pinch-zoom.component.sass)
└── presentational/
    ├── zoom-controls/
    │   └── zoom-controls.component.ts
    └── brightness-controls/
        └── brightness-controls.component.ts

**Key Changes:**

1. **Models Organization**: All data models, interfaces, and types moved to models/
   - interfaces.ts → models/interfaces.model.ts
   - properties.ts → models/properties.model.ts

2. **Services Organization**: Core logic moved to services/
   - ivypinch.ts → services/ivy-pinch.service.ts (utility class)
   - touches.ts → services/touches.service.ts (utility class)
   - Removed @Injectable decorators (classes instantiated with 'new')
   - Renamed TouchProperties to avoid naming conflict

3. **Components Organization**: Explicit smart/dumb component separation
   - Smart (Container) components: components/containers/
   - Dumb (Presentational) components: components/presentational/
   - Renamed files with .container.* suffix for clarity

4. **Backward Compatibility**: Legacy import paths maintained via re-exports
   - ivypinch.ts → re-exports from services/ivy-pinch.service.ts
   - touches.ts → re-exports from services/touches.service.ts

5. **Public API**: Simplified exports through barrel files
   - Models exported from ./lib/models
   - Services exported from ./lib/services
   - Components exported from ./lib/components

**Benefits:**

- Clear separation of concerns (models, services, components)
- Explicit smart/dumb component pattern
- Professional Angular project structure
- Improved maintainability and discoverability
- Backward compatible with existing imports

All builds passing (library + example app).
2025-11-16 09:03:25 +00:00
Claude
4c59f2b9fd
docs(ivypinch): Add comprehensive JSDoc documentation and remove duplicate file
Consolidated ivypinch.ts and ivypinch.improved.ts into a single, well-documented file.

**Changes:**

1. **Added comprehensive JSDoc documentation to ivypinch.ts:**
   - File-level @fileoverview with architecture description
   - Section headers for code organization (8 major sections)
   - JSDoc comments for all properties (30+ documented)
   - JSDoc comments for all methods (50+ documented)
   - Algorithm explanations for complex methods (pinch, pan, wheel zoom)
   - Mathematical formulas with inline examples
   - @param and @returns tags for all methods
   - @public/@private visibility markers
   - Cross-references using {@link} tags
   - Usage examples in @example blocks

2. **Documentation Highlights:**
   - **Transform mathematics**: Matrix format, hardware acceleration benefits
   - **Fixed-point zooming**: How pinch center stays visually fixed
   - **Two pinch modes**: Fixed vs. draggable pinch with trade-offs
   - **Pan constraints**: Algorithm for preventing gaps at edges
   - **Wheel zoom**: Snapping behavior and cursor-centered zooming
   - **Coordinate calculations**: Touch vs. mouse event handling
   - **Public API**: Detailed docs for component integration

3. **Removed ivypinch.improved.ts:**
   - Eliminated duplicate file to maintain single source of truth
   - Prevents sync issues between two copies
   - All educational content now in production file
   - IDE tooltips will show documentation
   - TypeDoc can generate API docs from JSDoc

4. **Fixed property initialization order:**
   - Moved defaultMaxScale before maxScale
   - Resolved TypeScript initialization error

**Benefits:**

 Single source of truth (no duplicate files to sync)
 IDE tooltips show documentation on hover
 Better developer onboarding
 TypeDoc-ready for API documentation generation
 No bundle size impact (JSDoc stripped at build time)
 Easier to maintain (update docs with code)
 Professional documentation standards

**File Stats:**
- Lines: 1,559 (781 original + 778 JSDoc)
- Properties documented: 30+
- Methods documented: 50+
- Code sections: 8 major areas
- No runtime impact (comments don't affect bundle)

All builds passing (library + app). Documentation quality matches enterprise standards.
2025-11-15 20:20:55 +00:00
Claude
2d9b6c25fe
refactor: Implement Angular service-based architecture with smart/dumb components
Restructured the ngx-pinch-zoom library following Angular best practices:

**Architecture Changes:**

1. **Models Layer** (new):
   - zoom-config.model.ts - Configuration interfaces for zoom behavior
   - transform-state.model.ts - Transform state and metadata interfaces
   - brightness-state.model.ts - Brightness configuration and state
   - click-to-zoom.model.ts - Click-to-zoom configuration and events
   - All models exported via barrel file for clean imports

2. **Services Layer** (new):
   - BrightnessService (@Injectable)
     * Signal-based reactive brightness state management
     * Computed state with atMin/atMax bounds checking
     * Increase/decrease/setValue/reset methods
     * Configuration management with min/max/step

   - ZoomStateService (@Injectable)
     * Signal-based reactive zoom/transform state management
     * Computed extended state with isZoomedIn, atMaxScale, atMinScale
     * Transform state updates and limit management
     * Exposes readonly signals for reactive consumption

3. **Components Layer** (refactored):
   - ZoomControlsComponent (dumb/presentational)
     * Pure component with no business logic
     * Input: isZoomedIn signal
     * Output: toggle event
     * Accessibility: ARIA labels, keyboard support

   - BrightnessControlsComponent (dumb/presentational)
     * Pure component with no business logic
     * Inputs: atMin, atMax signals
     * Outputs: increase, decrease events
     * Accessibility: ARIA labels, keyboard support

   - PinchZoomComponent (smart/container)
     * Orchestrates services and child components
     * Injects BrightnessService and ZoomStateService
     * Delegates brightness logic to BrightnessService
     * Uses child components for UI rendering
     * Effects for reactive state synchronization

**Benefits:**

 Separation of Concerns - Clear boundaries between presentation and business logic
 Testability - Services can be unit tested in isolation, components easily mocked
 Reusability - Services and dumb components can be reused across the application
 Type Safety - Strong TypeScript interfaces throughout all layers
 Reactive Patterns - Signal-based state with computed values
 Maintainability - Easier to locate and fix bugs, simpler to add features
 Angular Best Practices - Dependency injection, smart/dumb pattern, service layer

**Technical Details:**

- Smart/Dumb component pattern for better separation of concerns
- Dependency Injection for all services (scoped to component instance)
- Signal-based reactive state management (Angular 20+)
- Effects for state synchronization and side effects
- Computed signals for derived state
- Barrel exports for clean import paths
- Backward compatible - all existing interfaces preserved
- Bundle size: 272.62 kB (minimal increase of ~6 kB for architecture improvements)

**Files Changed:**
- Modified: pinch-zoom.component.ts (refactored to use services)
- Modified: pinch-zoom.component.html (uses child components)
- Modified: public-api.ts (exports new models, services, components)
- Added: 4 model files + index
- Added: 2 service files + index
- Added: 2 component files + index

All builds passing (app + library). No breaking changes to public API.
2025-11-15 19:55:43 +00:00
Claude
a9a2f414ad
docs(examples): Add comprehensive demos for click-to-zoom and brightness features
Enhanced the demo application with complete examples for the newly implemented features:

New Examples Added:
- enableClickToZoom: Basic click-to-zoom functionality demonstration
- clickToZoomScale: Custom zoom scale (3.5x) demonstration
- enableBrightnessControl: Brightness adjustment controls
- brightnessStep: Custom brightness increment (0.2) demonstration
- minBrightness/maxBrightness: Brightness range limits (0.5-1.5)
- Combined demo: Click-to-zoom + brightness for anomaly detection workflows

Updates:
- Fixed all property bindings to use camelCase (Angular 20 signals requirement)
  - transition-duration → transitionDuration
  - limit-zoom → limitZoom
  - auto-zoom-out → autoZoomOut
  - double-tap → doubleTap
  - double-tap-scale → doubleTapScale
- Added brightness state tracking in app.component.ts
- Added onBrightnessChanged event handler

The combined example showcases the complete workflow for defect inspection
and anomaly detection, demonstrating how both features work together.
2025-11-15 19:36:46 +00:00
Claude
dcc0f95818
docs: Add comprehensive click-to-zoom documentation
Add real-world implementation example of click-to-zoom feature to maintainer documentation:

**IMPLEMENTATION_GUIDE.md:**
- Complete step-by-step implementation guide showing how click-to-zoom was added
- Explains each component (input signals, IvyPinch method, template, CSS)
- Includes code snippets from actual implementation
- Shows real-world usage for anomaly detection use case
- Provides testing checklist

**docs/README.md:**
- Added click-to-zoom to "Where do I find...?" quick reference table
- Added to "How do I...?" task guide
- Helps maintainers quickly locate click-to-zoom documentation

This serves as a template for future feature additions and helps maintainers understand how to add similar interactive features to the library.
2025-11-15 16:43:32 +00:00
Claude
1b7ed5adff
feat: Add click-to-zoom functionality for precise inspection
Implement click-to-zoom feature perfect for anomaly detection and defect inspection workflows:

**New Input Signals:**
- enableClickToZoom: Enable/disable click-to-zoom (default: false)
- clickToZoomScale: Target zoom scale when clicking (default: 2.5)

**Implementation:**
- Click any point on image to zoom to that exact location
- Click again to zoom out back to original view
- Cursor changes to zoom-in icon when feature is enabled
- Smooth animated transitions
- Respects zoom limits (min/max scale)
- Works alongside existing touch/pinch zoom

**Use Cases:**
- Anomaly detection: Click suspicious areas to examine closely
- Defect inspection: Quickly zoom to specific spots
- Detail review: Fast workflow for inspecting multiple points

**Technical Details:**
- Added IvyPinch.zoomToPoint(clientX, clientY, targetScale) method
- Calculates click position relative to element bounds
- Applies zoom transform centered on clicked point
- Component wrapper method handles event and configuration
- CSS cursor feedback for better UX

Updated documentation with usage examples and testing scenarios.
2025-11-15 16:39:01 +00:00
Claude
c0546dbf46
style: Apply prettier formatting
Apply consistent code formatting with prettier to all project files
2025-11-15 16:14:34 +00:00
Claude
5194dde20b
docs: Add brightness control documentation
Document the new brightness control feature across all documentation:
- Update README.md with brightness examples and API documentation
- Add brightness control to QUICK_REFERENCE.md signal architecture
- Include brightness in testing scenarios and configuration tests
- Document new input signals: enableBrightnessControl, brightnessStep, minBrightness, maxBrightness
- Document new output signal: brightnessChanged
- Document new methods: brightnessIn(), brightnessOut(), resetBrightness()
- Document new computed signals: brightness(), isBrightnessControl(), isBrightnessAtMin(), isBrightnessAtMax()
- Add CSS filter effects pattern example to QUICK_REFERENCE.md
2025-11-15 16:14:26 +00:00
Claude
41ef9989e2
feat: Add brightness control functionality with signals
Add comprehensive brightness control feature with the following capabilities:
- Input signals for configuration (enableBrightnessControl, brightnessStep, minBrightness, maxBrightness)
- brightnessChanged output signal for reactive updates
- brightnessIn() and brightnessOut() methods for adjusting brightness
- resetBrightness() method to restore default value
- UI controls positioned at bottom center alongside zoom controls
- Keyboard accessibility (Enter/Space) and ARIA labels
- Visual feedback with disabled states at min/max brightness
- CSS brightness filter applied via reactive effect
2025-11-15 16:07:36 +00:00
Claude
a6524480d5
fix: Critical bug fixes and improvements
Fixed multiple critical bugs and improved code quality based on
comprehensive code review.

🔴 Critical Fixes:

1. Fix memory leak in event listeners (touches.ts)
   - Problem: Event listeners were never actually removed on destroy
   - Cause: method.bind(this) creates new function reference each time
   - Solution: Store bound handlers in Map for proper removal
   - Impact: Prevents memory leaks when components are destroyed
   - Files: touches.ts:52, 93-140, 142-165

2. Fix template signal syntax (pinch-zoom.component.html)
   - Problem: Signals not called in template bindings
   - Fixed: isDragging -> isDragging()
   - Fixed: isZoomedIn -> isZoomedIn()
   - Impact: Critical - features were broken, dragging class never applied
   - Files: pinch-zoom.component.html:1, 9

⚠️ Medium Fixes:

3. Fix constructor early return (ivypinch.ts)
   - Problem: Constructor returned early if element missing
   - Solution: Throw error instead of early return
   - Impact: Better error reporting, prevents silent failures
   - Files: ivypinch.ts:40-46

4. Improve TypeScript type safety (ivypinch.ts)
   - Problem: Using definite assignment assertion (maxScale!)
   - Solution: Initialize maxScale with default value
   - Impact: Better null safety, clearer code
   - Files: ivypinch.ts:14, 25-26

💡 Improvements:

5. Add accessibility features (pinch-zoom.component.html)
   - Added keyboard support (Enter and Space keys)
   - Added ARIA labels for screen readers
   - Added role="button" and tabindex="0"
   - Impact: Better accessibility for all users
   - Files: pinch-zoom.component.html:11-15

Technical Details:

Memory Leak Fix:
- Added boundHandlers Map to store event listener references
- toggleEventListeners now stores/retrieves handlers correctly
- addEventListeners/removeEventListeners use same pattern
- Dynamic listeners prefixed with 'dynamic-' key

Before:
const boundMethod = method.bind(this);
element.addEventListener('event', boundMethod);
// Later:
element.removeEventListener('event', method.bind(this)); //  Different ref!

After:
const boundMethod = method.bind(this);
this.boundHandlers.set('event', boundMethod);
element.addEventListener('event', boundMethod);
// Later:
const boundMethod = this.boundHandlers.get('event');
element.removeEventListener('event', boundMethod); //  Same ref!

Testing:
 Library builds successfully
 All TypeScript strict mode checks pass
 No compilation errors

Breaking Changes: None

Fixes: #memory-leak #signal-syntax #type-safety
2025-11-15 15:57:54 +00:00
Claude
76949aaf48
docs: Convert all diagrams to Mermaid.js with GitHub dark mode colors
Updated all text-based diagrams to use Mermaid.js syntax with colors
optimized for GitHub dark mode viewing.

Changes:
- QUICK_REFERENCE.md: 2 diagrams converted
  • Data Flow (graph LR with color-coded stages)
  • Touch Event Flow (flowchart TD with detailed state tracking)

- ARCHITECTURE.md: 6 diagrams converted
  • High-Level Architecture (graph TB with subgraphs)
  • Complete User Interaction Flow (sequenceDiagram)
  • Signal Reactivity Flow (flowchart TD)
  • Gesture Detection State Machine (stateDiagram-v2)
  • Component Lifecycle (flowchart TD with feedback loops)
  • Event Listener Lifecycle (flowchart TD)

- docs/README.md: 3 diagrams converted
  • The Big Picture (flowchart TD)
  • Component Hierarchy (graph TD)
  • Data Flow (flowchart TD)

Color Palette (GitHub dark mode optimized):
- Blue (#58a6ff): Logic, calculations, core functions
- Green (#3fb950): Success states, event handlers, initialization
- Yellow/Orange (#d29922): Computed signals, state updates
- Purple (#a371f7): User actions, signals, reactivity
- Pink (#db61a2): Events, callbacks, emissions
- Red (#f85149): DOM updates, destruction, browser events

Benefits:
 Interactive diagrams render on GitHub
 Consistent color coding across all documentation
 Better readability in dark mode
 Professional visual presentation
 Easier to understand complex flows
2025-11-15 15:41:12 +00:00
Claude
0d933efbf1
docs: Add comprehensive maintainer documentation
Added complete documentation suite for library maintainers:

Documentation Files:
- docs/README.md - Documentation index and learning paths
- docs/QUICK_REFERENCE.md - Fast lookup guide with code locations
- docs/ARCHITECTURE.md - Deep technical dive into system design
- docs/IMPLEMENTATION_GUIDE.md - Step-by-step examples for features/fixes

Enhanced Code Readability:
- ivypinch.improved.ts - Heavily commented reference version
  - 800+ lines of inline documentation
  - Section-organized code structure
  - Mathematical formulas explained
  - Every state variable documented
  - Method purposes and algorithms detailed

Documentation Coverage:
 Component architecture and data flow
 Signal-based reactivity patterns
 Transform mathematics with formulas
 Touch gesture detection algorithms
 Event system and state machines
 Constraint system (zoom/pan limits)
 Performance optimization techniques
 Common bug fixes with solutions
 Feature implementation examples
 Debugging techniques and tools
 Testing strategies

This documentation enables new maintainers to:
- Understand how the library works internally
- Add new features following established patterns
- Fix bugs efficiently with debugging guides
- Optimize performance with best practices
- Navigate the codebase quickly

For maintainers: Start with docs/README.md for learning paths
2025-11-15 15:22:38 +00:00
Claude
8cdeea738d
feat: Upgrade to Angular 20 with signals and comprehensive modernization
This is a major update that modernizes the ngx-pinch-zoom library with Angular 20
and the signals API, while removing unnecessary dependencies and bloat.

## Major Changes

### Angular 20 + Signals Migration
- Upgraded all Angular dependencies to 20.0.0
- Migrated all @Input() properties to input() signals
- Migrated all @Output() EventEmitters to output() signals
- Converted component getters to computed() signals
- Implemented effects for reactive property changes
- Updated to use inject() for dependency injection

### Removed Bloat
- Removed Cypress testing framework and all related files
- Removed Karma/Jasmine testing infrastructure
- Removed ESLint and unnecessary linting dependencies
- Removed polyfills.ts (not needed for modern browsers)
- Removed all *.spec.ts test files
- Cleaned up configuration files

### TypeScript & Build Improvements
- Updated to TypeScript 5.8 with strict mode enabled
- Fixed all strict mode type errors in touches.ts and ivypinch.ts
- Updated tsconfig with modern settings (bundler module resolution)
- Simplified angular.json configuration
- Updated to latest ng-packagr (20.0.0)

### Documentation
- Complete rewrite of README.md with Angular 20 examples
- Added CONTRIBUTING.md with comprehensive maintainer guide
- Added CHANGELOG.md documenting all changes
- Included migration guide and architecture documentation
- Added usage examples with signals

### Dependencies Updated
- @angular/*: 19.0.0 → 20.0.0
- typescript: 5.5.4 → 5.8.0
- rxjs: 7.5.2 → 7.8.0
- ng-packagr: 19.0.0 → 20.0.0
- prettier: 2.7.1 → 3.0.0
- And many more...

## Files Changed
- Modified: pinch-zoom.component.ts (signals migration)
- Modified: ivypinch.ts (type safety improvements)
- Modified: touches.ts (strict mode fixes)
- Modified: package.json (simplified dependencies)
- Modified: angular.json (simplified configuration)
- Modified: tsconfig.json (modern settings)
- Added: CONTRIBUTING.md, CHANGELOG.md
- Removed: Cypress, Karma, ESLint configs and files

## Breaking Changes
- Requires Angular 20.0.0+
- Requires TypeScript 5.8.0+
- Requires Node.js 18.19.1+
- Computed properties must be called as functions: component.scale()

## Testing
- Library builds successfully with no errors
- All TypeScript strict mode errors resolved
- Ready for manual testing with demo app

BREAKING CHANGE: This version requires Angular 20+ and TypeScript 5.8+
2025-11-15 14:18:05 +00:00
dependabot[bot]
2726492b0b
build(deps-dev): bump form-data from 4.0.1 to 4.0.4 (#66)
---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 14:06:55 +02:00
dependabot[bot]
240ce29eb4
build(deps): bump vite and @angular-devkit/build-angular (#65)
---
updated-dependencies:
- dependency-name: vite
  dependency-version: 
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-version: 19.0.4
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 14:06:45 +02:00
dependabot[bot]
230738fe65
build(deps): bump on-headers and compression (#64)
Bumps [on-headers](https://github.com/jshttp/on-headers) and [compression](https://github.com/expressjs/compression). These dependencies needed to be updated together.

Updates `on-headers` from 1.0.2 to 1.1.0
- [Release notes](https://github.com/jshttp/on-headers/releases)
- [Changelog](https://github.com/jshttp/on-headers/blob/master/HISTORY.md)
- [Commits](https://github.com/jshttp/on-headers/compare/v1.0.2...v1.1.0)

Updates `compression` from 1.7.5 to 1.8.1
- [Release notes](https://github.com/expressjs/compression/releases)
- [Changelog](https://github.com/expressjs/compression/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/compression/compare/1.7.5...v1.8.1)

---
updated-dependencies:
- dependency-name: on-headers
  dependency-version: 1.1.0
  dependency-type: indirect
- dependency-name: compression
  dependency-version: 1.8.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-21 09:58:22 +02:00
Björn Schmidt
7be6f5844d fix package-json 2025-06-05 14:53:37 +02:00
dependabot[bot]
e26372d0f9
build(deps): bump webpack-dev-server and @angular-devkit/build-angular (#62)
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to 5.2.1 and updates ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `webpack-dev-server` from 5.1.0 to 5.2.1
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v5.1.0...v5.2.1)

Updates `@angular-devkit/build-angular` from 19.0.4 to 20.0.1
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/19.0.4...20.0.1)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-version: 5.2.1
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-version: 20.0.1
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-05 14:39:44 +02:00
Björn Schmidt
6402f1aba8 v20.0.0 2025-06-05 14:37:56 +02:00
Manuel Heidrich
05d166bca2
Update package to support Angular 20 (#61)
* Set angular peer dependencies to 19 or higher

* Update readme
2025-06-05 14:36:25 +02:00
Björn Schmidt
e10cae08a2 feat: #58 - added zoomChanged eventemitter as output 2025-06-04 11:30:08 +02:00
Björn Schmidt
906f70044a v19.0.1 2025-06-04 09:56:32 +02:00
Björn Schmidt
b32ff3906b doc: #57 - documentation is now more accurate 2025-06-04 09:22:18 +02:00
Manuel Heidrich
c10b01034a
Enable dragging while pinching (#59) 2025-06-04 09:10:51 +02:00
Manuel Heidrich
1ec35a96d5
Implement zoom in and out methods (#60) 2025-06-04 08:58:47 +02:00
dependabot[bot]
27197f43cb
build(deps): bump vite and @angular-devkit/build-angular (#56)
Removes [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). It's no longer used after updating ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Removes `vite`

Updates `@angular-devkit/build-angular` from 19.0.4 to 19.0.4
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/19.0.4...19.0.4)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 08:18:03 +01:00
Björn Schmidt
227a3373d3 feat: Angular 19 Support, Switched to Standalone Component 2024-12-11 09:13:24 +01:00
Björn Schmidt
ab7df9ae4a Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/multi-d66d039ac5'
# Conflicts:
#	package-lock.json
2024-12-11 08:39:17 +01:00
Björn Schmidt
7da8ace028 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/multi-d54fdff7c2'
# Conflicts:
#	package-lock.json
2024-12-11 08:38:52 +01:00
Björn Schmidt
00ab17dc3f Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/multi-cf87d80143' 2024-12-11 08:38:18 +01:00
Björn Schmidt
7cdbd0c585 Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/multi-9423f4c335' 2024-12-11 08:38:09 +01:00
dependabot[bot]
4ee0505200
Bump cookie, socket.io and express
Bumps [cookie](https://github.com/jshttp/cookie), [socket.io](https://github.com/socketio/socket.io) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `cookie` from 0.4.2 to 0.7.2
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Commits](https://github.com/jshttp/cookie/compare/v0.4.2...v0.7.2)

Updates `socket.io` from 4.7.2 to 4.8.0
- [Release notes](https://github.com/socketio/socket.io/releases)
- [Changelog](https://github.com/socketio/socket.io/blob/main/CHANGELOG.md)
- [Commits](https://github.com/socketio/socket.io/compare/4.7.2...socket.io@4.8.0)

Updates `express` from 4.19.2 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: indirect
- dependency-name: socket.io
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-10 17:19:32 +00:00
dependabot[bot]
86466a7f58
Bump body-parser and express
Bumps [body-parser](https://github.com/expressjs/body-parser) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `body-parser` from 1.20.2 to 1.20.3
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3)

Updates `express` from 4.19.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-20 23:36:44 +00:00
dependabot[bot]
8aa6b4f5ca
Bump vite and @angular-devkit/build-angular
Removes [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). It's no longer used after updating ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Removes `vite`

Updates `@angular-devkit/build-angular` from 18.2.2 to 18.2.5
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/18.2.2...18.2.5)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-19 18:51:35 +00:00
dependabot[bot]
1da572d361
Bump send and express
Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `send` from 0.18.0 to 0.19.0
- [Release notes](https://github.com/pillarjs/send/releases)
- [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md)
- [Commits](https://github.com/pillarjs/send/compare/0.18.0...0.19.0)

Updates `express` from 4.19.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: send
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 08:18:40 +00:00
dependabot[bot]
46700d09df
Bump serve-static and express
Bumps [serve-static](https://github.com/expressjs/serve-static) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `serve-static` from 1.15.0 to 1.16.2
- [Release notes](https://github.com/expressjs/serve-static/releases)
- [Changelog](https://github.com/expressjs/serve-static/blob/v1.16.2/HISTORY.md)
- [Commits](https://github.com/expressjs/serve-static/compare/v1.15.0...v1.16.2)

Updates `express` from 4.19.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: serve-static
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 07:52:54 +00:00
dependabot[bot]
349123e3da
Bump webpack and @angular-devkit/build-angular (#49)
Bumps [webpack](https://github.com/webpack/webpack) to 5.94.0 and updates ancestor dependency [@angular-devkit/build-angular](https://github.com/angular/angular-cli). These dependencies need to be updated together.


Updates `webpack` from 5.91.0 to 5.94.0
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.91.0...v5.94.0)

Updates `@angular-devkit/build-angular` from 18.0.2 to 18.2.2
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/18.0.2...18.2.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
- dependency-name: "@angular-devkit/build-angular"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 10:06:22 +02:00