@nice2dev/ui-graphics 1.3.12 → 1.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +3 -3
  3. package/dist/types/core/useGamepad.d.ts +0 -16
  4. package/dist/types/core/usePointerPressure.d.ts +0 -88
  5. package/dist/types/game/AnimationPreviewPlayer.d.ts +0 -30
  6. package/dist/types/game/CollisionEditor.d.ts +0 -102
  7. package/dist/types/game/GameAssetExportPanel.d.ts +0 -20
  8. package/dist/types/game/IsometricEditor.d.ts +0 -22
  9. package/dist/types/game/IsometricTilePanel.d.ts +0 -18
  10. package/dist/types/game/gameAssetExport.d.ts +0 -160
  11. package/dist/types/game/isometricTiles.d.ts +0 -250
  12. package/dist/types/game/useAnimationPreview.d.ts +0 -63
  13. package/dist/types/game/useCollisionEditor.d.ts +0 -96
  14. package/dist/types/game/useGameAssetExport.d.ts +0 -82
  15. package/dist/types/photo/BatchProcessingPanel.d.ts +0 -13
  16. package/dist/types/photo/FaceDetectionPanel.d.ts +0 -19
  17. package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +0 -17
  18. package/dist/types/photo/RawFilePanel.d.ts +0 -15
  19. package/dist/types/photo/StyleTransferPanel.d.ts +0 -16
  20. package/dist/types/photo/aiStyleTransfer.d.ts +0 -58
  21. package/dist/types/photo/batchProcessing.d.ts +0 -95
  22. package/dist/types/photo/faceDetection.d.ts +0 -103
  23. package/dist/types/photo/index.d.ts +0 -17
  24. package/dist/types/photo/perspectiveCorrection.d.ts +0 -124
  25. package/dist/types/photo/rawFileSupport.d.ts +0 -124
  26. package/dist/types/pixel/PaletteExtractorPanel.d.ts +0 -17
  27. package/dist/types/pixel/TileMapPanel.d.ts +0 -15
  28. package/dist/types/pixel/paletteExtractor.d.ts +0 -73
  29. package/dist/types/pixel/pixelAnimationPresets.d.ts +0 -79
  30. package/dist/types/pixel/pixelEffectsEngine.d.ts +0 -91
  31. package/dist/types/pixel/pixelEquipmentSystem.d.ts +0 -145
  32. package/dist/types/pixel/pixelSpriteTemplates.d.ts +0 -54
  33. package/dist/types/pixel/tileMapMode.d.ts +0 -122
  34. package/dist/types/vector/PathSimplificationPanel.d.ts +0 -16
  35. package/dist/types/vector/PdfExportPanel.d.ts +0 -20
  36. package/dist/types/vector/TextOnPathPanel.d.ts +0 -26
  37. package/dist/types/vector/VectorFilterPanel.d.ts +0 -20
  38. package/dist/types/vector/VectorPatternPanel.d.ts +0 -22
  39. package/dist/types/vector/pathSimplification.d.ts +0 -135
  40. package/dist/types/vector/pdfExport.d.ts +0 -65
  41. package/dist/types/vector/textOnPath.d.ts +0 -145
  42. package/dist/types/vector/vectorPatternFills.d.ts +0 -102
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @nice2dev/ui-graphics — Changelog
2
2
 
3
+ ## 1.3.14
4
+
5
+ No changes in this release.
6
+
7
+ ## 1.3.13
8
+
9
+ No changes in this release.
10
+
3
11
  ## 1.3.12
4
12
 
5
13
  No changes in this release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui-graphics",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "Nice2Dev Graphics Editors — Pixel, Vector, Photo and Animation editors for React",
5
5
  "author": "NiceToDev <contact@nicetodev.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -71,8 +71,8 @@
71
71
  "react-dom": ">=17.0.0"
72
72
  },
73
73
  "devDependencies": {
74
- "@nice2dev/ui": "^1.3.12",
75
- "@nice2dev/ui-core": "^1.3.12",
74
+ "@nice2dev/ui": "^1.3.14",
75
+ "@nice2dev/ui-core": "^1.3.14",
76
76
  "@rollup/plugin-commonjs": "^29.0.3",
77
77
  "@rollup/plugin-node-resolve": "^16.0.3",
78
78
  "@rollup/plugin-typescript": "^12.3.0",
@@ -1,16 +0,0 @@
1
- /**
2
- * useGamepad — consolidated into `@nice2dev/ui-core` (the dependency-free home,
3
- * so any package can use it). This module re-exports the canonical hook and
4
- * types; the small `GamepadIndicator` UI below stays here as it is
5
- * ui-graphics-specific chrome.
6
- */
7
- import React from 'react';
8
- export { useGamepad, createNavigationActions, PS_BUTTON_ALIASES, GAMEPAD_BUTTONS, } from '@nice2dev/ui-core';
9
- export type { GamepadButton, GamepadAxis, GamepadState, GamepadAction, UseGamepadOptions, NavigationActions, } from '@nice2dev/ui-core';
10
- export interface GamepadIndicatorProps {
11
- connected: boolean;
12
- id?: string;
13
- showId?: boolean;
14
- }
15
- /** Simple indicator showing gamepad connection status. */
16
- export declare const GamepadIndicator: ({ connected, id, showId }: GamepadIndicatorProps) => React.JSX.Element | null;
@@ -1,88 +0,0 @@
1
- /**
2
- * usePointerPressure — Hook for graphic tablet/stylus pressure sensitivity
3
- *
4
- * Provides pressure, tilt, and twist data from supported devices.
5
- * Falls back gracefully for mouse input.
6
- */
7
- export interface PointerPressureState {
8
- /** Is a stylus/pen currently active? */
9
- isStylus: boolean;
10
- /** Pressure value from 0 to 1 (mouse always returns 0.5) */
11
- pressure: number;
12
- /** Tilt angle on X axis (-90 to 90 degrees) */
13
- tiltX: number;
14
- /** Tilt angle on Y axis (-90 to 90 degrees) */
15
- tiltY: number;
16
- /** Twist angle of the stylus (0 to 360 degrees) */
17
- twist: number;
18
- /** Tangential pressure (for airbrush styluses) */
19
- tangentialPressure: number;
20
- /** Width of contact point (for touch) */
21
- width: number;
22
- /** Height of contact point (for touch) */
23
- height: number;
24
- /** Current pointer type: 'mouse', 'pen', 'touch', 'eraser' */
25
- pointerType: 'mouse' | 'pen' | 'touch' | 'eraser';
26
- /** Current position */
27
- x: number;
28
- y: number;
29
- /** Is button pressed? */
30
- isPressed: boolean;
31
- /** Which buttons are pressed (bitmask) */
32
- buttons: number;
33
- }
34
- export interface UsePointerPressureOptions {
35
- /** Target element ref */
36
- elementRef: React.RefObject<HTMLElement | null>;
37
- /** Enable pressure simulation for mouse (default: true) */
38
- simulatePressure?: boolean;
39
- /** Pressure curve for simulation: linear, ease-in, ease-out */
40
- pressureCurve?: 'linear' | 'ease-in' | 'ease-out' | 'custom';
41
- /** Custom pressure curve function (input: speed 0-1, output: pressure 0-1) */
42
- customPressureCurve?: (speed: number) => number;
43
- /** Enable pressure smoothing (default: true) */
44
- smoothing?: boolean;
45
- /** Smoothing factor 0-1 (default: 0.3) */
46
- smoothingFactor?: number;
47
- /** Callbacks */
48
- onPressureChange?: (pressure: number) => void;
49
- onDown?: (state: PointerPressureState) => void;
50
- onMove?: (state: PointerPressureState) => void;
51
- onUp?: (state: PointerPressureState) => void;
52
- }
53
- export declare function usePointerPressure(options: UsePointerPressureOptions): PointerPressureState;
54
- export interface BrushSizeOptions {
55
- minSize: number;
56
- maxSize: number;
57
- pressure: number;
58
- /** How much pressure affects size (0-1, default 1) */
59
- pressureSensitivity?: number;
60
- /** Pressure curve: 'linear' | 'squared' | 'sqrt' */
61
- curve?: 'linear' | 'squared' | 'sqrt';
62
- }
63
- /** Calculate brush size based on pressure */
64
- export declare function calculateBrushSize(options: BrushSizeOptions): number;
65
- /** Calculate brush opacity based on pressure */
66
- export declare function calculateBrushOpacity(pressure: number, minOpacity?: number, maxOpacity?: number, sensitivity?: number): number;
67
- /** Calculate brush rotation angle based on tilt */
68
- export declare function calculateBrushAngle(tiltX: number, tiltY: number): number;
69
- /** Calculate brush squash based on tilt (for calligraphy) */
70
- export declare function calculateBrushSquash(tiltX: number, tiltY: number): number;
71
- export interface PressureIndicatorProps {
72
- pressure: number;
73
- isStylus: boolean;
74
- showValues?: boolean;
75
- tiltX?: number;
76
- tiltY?: number;
77
- }
78
- /** Visual indicator for current pressure */
79
- export declare const PressureIndicator: ({ pressure, isStylus, showValues, tiltX, tiltY, }: PressureIndicatorProps) => import("react").JSX.Element;
80
- export interface SmoothPoint {
81
- x: number;
82
- y: number;
83
- pressure: number;
84
- }
85
- /** Catmull-Rom spline smoothing for stroke points */
86
- export declare function smoothStroke(points: SmoothPoint[], tension?: number, segments?: number): SmoothPoint[];
87
- /** Moving average smoothing */
88
- export declare function movingAverageSmooth(points: SmoothPoint[], windowSize?: number): SmoothPoint[];
@@ -1,30 +0,0 @@
1
- /**
2
- * AnimationPreviewPlayer — UI component for animation preview in GameAsset2dEditor
3
- *
4
- * Features:
5
- * - Canvas-based animation rendering with zoom
6
- * - Playback controls (play/pause/stop/step)
7
- * - Timeline scrubber with frame indicators
8
- * - Speed control (0.25x - 4x)
9
- * - Onion skinning toggle
10
- * - State machine parameter controls
11
- * - Transition visualization
12
- */
13
- import React from 'react';
14
- import type { SpriteSheet, AnimationStateMachine } from './gameAssetTypes';
15
- export interface AnimationPreviewPlayerProps {
16
- spriteSheets: SpriteSheet[];
17
- stateMachines: AnimationStateMachine[];
18
- selectedAnimationId?: string | null;
19
- selectedStateMachineId?: string | null;
20
- width?: number;
21
- height?: number;
22
- backgroundColor?: string;
23
- showTimeline?: boolean;
24
- showStateGraph?: boolean;
25
- className?: string;
26
- onFrameChange?: (frameIndex: number) => void;
27
- onStateChange?: (stateId: string) => void;
28
- }
29
- export declare function AnimationPreviewPlayer({ spriteSheets, stateMachines, selectedAnimationId, selectedStateMachineId, width, height, backgroundColor, showTimeline, showStateGraph: _showStateGraph, className, onFrameChange, onStateChange, }: AnimationPreviewPlayerProps): React.JSX.Element;
30
- export default AnimationPreviewPlayer;
@@ -1,102 +0,0 @@
1
- /**
2
- * CollisionEditor — Shape-based collision mask editor for GameAsset2dEditor
3
- *
4
- * Features:
5
- * - Multiple collision shape types: box, circle, polygon, capsule
6
- * - Visual editing with drag handles
7
- * - Collision layer assignment
8
- * - Per-frame collision shapes for animations
9
- * - Collision body types: static, dynamic, kinematic
10
- * - Physics material properties
11
- */
12
- import React from 'react';
13
- export type CollisionShapeType = 'box' | 'circle' | 'polygon' | 'capsule' | 'edge';
14
- export type CollisionBodyType = 'static' | 'dynamic' | 'kinematic' | 'trigger';
15
- export interface CollisionShape {
16
- id: string;
17
- /** Display name */
18
- name?: string;
19
- type: CollisionShapeType;
20
- enabled: boolean;
21
- x: number;
22
- y: number;
23
- width: number;
24
- height: number;
25
- rotation: number;
26
- radius?: number;
27
- vertices?: {
28
- x: number;
29
- y: number;
30
- }[];
31
- capsuleDirection?: 'horizontal' | 'vertical';
32
- layer: number;
33
- mask: number[];
34
- isTrigger: boolean;
35
- /** Frame index for animation (optional) */
36
- frameIndex?: number;
37
- }
38
- export interface CollisionBody {
39
- id: string;
40
- name: string;
41
- bodyType: CollisionBodyType;
42
- shapes: CollisionShape[];
43
- density: number;
44
- friction: number;
45
- restitution: number;
46
- linearDamping: number;
47
- angularDamping: number;
48
- fixedRotation: boolean;
49
- gravityScale: number;
50
- }
51
- export interface CollisionEditorProps {
52
- /** Collision body being edited */
53
- body: CollisionBody | null;
54
- /** Preview image (sprite/tile) */
55
- previewImage: HTMLCanvasElement | HTMLImageElement | null;
56
- /** Called when body changes */
57
- onChange: (body: CollisionBody) => void;
58
- /** Width of the preview area */
59
- width?: number;
60
- /** Height of the preview area */
61
- height?: number;
62
- /** Grid size for snapping */
63
- gridSize?: number;
64
- className?: string;
65
- }
66
- export declare function createDefaultShape(type: CollisionShapeType): CollisionShape;
67
- export declare function createDefaultBody(): CollisionBody;
68
- export declare const COLLISION_LAYERS: readonly [{
69
- readonly id: 0;
70
- readonly name: "Default";
71
- readonly color: "#4a9fff";
72
- }, {
73
- readonly id: 1;
74
- readonly name: "Player";
75
- readonly color: "var(--nice-success-light, #4ade80)";
76
- }, {
77
- readonly id: 2;
78
- readonly name: "Enemy";
79
- readonly color: "var(--nice-danger, #ef4444)";
80
- }, {
81
- readonly id: 3;
82
- readonly name: "Ground";
83
- readonly color: "#a16207";
84
- }, {
85
- readonly id: 4;
86
- readonly name: "Platform";
87
- readonly color: "var(--nice-accent, #8b5cf6)";
88
- }, {
89
- readonly id: 5;
90
- readonly name: "Projectile";
91
- readonly color: "var(--nice-warning, #f59e0b)";
92
- }, {
93
- readonly id: 6;
94
- readonly name: "Pickup";
95
- readonly color: "#22d3d8";
96
- }, {
97
- readonly id: 7;
98
- readonly name: "Trigger";
99
- readonly color: "var(--nice-color-accent-pink, #ec4899)";
100
- }];
101
- export declare function CollisionEditor({ body, previewImage, onChange, width, height, gridSize: _gridSize, className, }: CollisionEditorProps): React.JSX.Element;
102
- export default CollisionEditor;
@@ -1,20 +0,0 @@
1
- /**
2
- * GameAssetExportPanel
3
- * UI for exporting game assets to various formats
4
- */
5
- import React from 'react';
6
- import type { GameAssetExportOptions, ExportResult } from './gameAssetExport';
7
- export interface GameAssetExportPanelProps {
8
- /** Asset data to export */
9
- asset: GameAssetExportOptions;
10
- /** Called when export starts */
11
- onExportStart?: () => void;
12
- /** Called when export completes */
13
- onExportComplete?: (results: ExportResult[]) => void;
14
- /** Called on export error */
15
- onExportError?: (error: Error) => void;
16
- /** Custom class name */
17
- className?: string;
18
- }
19
- export declare const GameAssetExportPanel: React.FC<GameAssetExportPanelProps>;
20
- export default GameAssetExportPanel;
@@ -1,22 +0,0 @@
1
- /**
2
- * IsometricEditor
3
- * Visual editor for 2.5D isometric tile maps
4
- */
5
- import React from 'react';
6
- import type { IsometricTileset, IsometricMap } from './isometricTiles';
7
- export interface IsometricEditorProps {
8
- /** Initial tileset */
9
- tileset?: IsometricTileset;
10
- /** Initial map */
11
- initialMap?: IsometricMap;
12
- /** Canvas width */
13
- width?: number;
14
- /** Canvas height */
15
- height?: number;
16
- /** Called when map changes */
17
- onChange?: (map: IsometricMap) => void;
18
- /** Custom class name */
19
- className?: string;
20
- }
21
- export declare const IsometricEditor: React.FC<IsometricEditorProps>;
22
- export default IsometricEditor;
@@ -1,18 +0,0 @@
1
- /**
2
- * IsometricTilePanel
3
- * Settings panel for isometric tile configuration and export
4
- */
5
- import React from 'react';
6
- import type { IsometricConfig, IsometricMap } from './isometricTiles';
7
- export interface IsometricTilePanelProps {
8
- /** Current configuration */
9
- config: IsometricConfig;
10
- /** Called when config changes */
11
- onConfigChange: (config: IsometricConfig) => void;
12
- /** Current map (for export) */
13
- map?: IsometricMap;
14
- /** Custom class name */
15
- className?: string;
16
- }
17
- export declare const IsometricTilePanel: React.FC<IsometricTilePanelProps>;
18
- export default IsometricTilePanel;
@@ -1,160 +0,0 @@
1
- /**
2
- * GameAsset Export Formats
3
- * Export utilities for Tiled, Godot, Unity, and other game engines
4
- */
5
- import type { CollisionShape } from './CollisionEditor';
6
- export interface GameAssetExportOptions {
7
- /** Asset name */
8
- name: string;
9
- /** Image width */
10
- width: number;
11
- /** Image height */
12
- height: number;
13
- /** Image file path (relative) */
14
- imagePath: string;
15
- /** Collision shapes */
16
- collisions?: CollisionShape[];
17
- /** Animation frames */
18
- frames?: AnimationFrameData[];
19
- /** Sprite metadata */
20
- sprite?: SpriteMetadata;
21
- /** Tile size for tile-based export */
22
- tileSize?: {
23
- width: number;
24
- height: number;
25
- };
26
- /** Custom properties */
27
- properties?: Record<string, unknown>;
28
- }
29
- export interface AnimationFrameData {
30
- /** Frame index */
31
- index: number;
32
- /** Frame duration in milliseconds */
33
- duration: number;
34
- /** Frame region in sprite sheet */
35
- region: {
36
- x: number;
37
- y: number;
38
- width: number;
39
- height: number;
40
- };
41
- /** Frame collision shapes (overrides default) */
42
- collisions?: CollisionShape[];
43
- /** Frame anchor/pivot point */
44
- anchor?: {
45
- x: number;
46
- y: number;
47
- };
48
- }
49
- export interface SpriteMetadata {
50
- /** Pivot point (normalized 0-1) */
51
- pivot: {
52
- x: number;
53
- y: number;
54
- };
55
- /** Pixels per unit */
56
- pixelsPerUnit: number;
57
- /** Border for 9-slice */
58
- border?: {
59
- left: number;
60
- right: number;
61
- top: number;
62
- bottom: number;
63
- };
64
- /** Filter mode */
65
- filterMode?: 'point' | 'bilinear' | 'trilinear';
66
- /** Wrap mode */
67
- wrapMode?: 'clamp' | 'repeat' | 'mirror';
68
- }
69
- export interface ExportResult {
70
- /** File name */
71
- fileName: string;
72
- /** File content */
73
- content: string;
74
- /** MIME type */
75
- mimeType: string;
76
- }
77
- export interface TiledExportOptions extends GameAssetExportOptions {
78
- /** First global ID */
79
- firstgid?: number;
80
- /** Tile count */
81
- tileCount?: number;
82
- /** Columns in tileset */
83
- columns?: number;
84
- /** Spacing between tiles */
85
- spacing?: number;
86
- /** Margin around tileset */
87
- margin?: number;
88
- /** Object alignment */
89
- objectAlignment?: 'unspecified' | 'topleft' | 'top' | 'topright' | 'left' | 'center' | 'right' | 'bottomleft' | 'bottom' | 'bottomright';
90
- }
91
- /**
92
- * Export as Tiled tileset (TSX format)
93
- */
94
- export declare function exportToTiled(options: TiledExportOptions): ExportResult;
95
- export interface GodotExportOptions extends GameAssetExportOptions {
96
- /** Godot version (3 or 4) */
97
- godotVersion?: 3 | 4;
98
- /** Resource UID (Godot 4) */
99
- uid?: string;
100
- /** Atlas texture */
101
- atlas?: boolean;
102
- }
103
- /**
104
- * Export as Godot SpriteFrames resource
105
- */
106
- export declare function exportToGodot(options: GodotExportOptions): ExportResult[];
107
- export interface UnityExportOptions extends GameAssetExportOptions {
108
- /** Generate .meta file */
109
- generateMeta?: boolean;
110
- /** Unity GUID */
111
- guid?: string;
112
- /** Sprite mode */
113
- spriteMode?: 'single' | 'multiple';
114
- /** Pixels per unit */
115
- pixelsPerUnit?: number;
116
- /** Filter mode */
117
- filterMode?: 'point' | 'bilinear' | 'trilinear';
118
- /** Sprite packing tag */
119
- packingTag?: string;
120
- }
121
- /**
122
- * Export for Unity (meta file + scriptable object data)
123
- */
124
- export declare function exportToUnity(options: UnityExportOptions): ExportResult[];
125
- /**
126
- * Export as generic JSON (for custom importers)
127
- */
128
- export declare function exportToJson(options: GameAssetExportOptions): ExportResult;
129
- export interface PhaserExportOptions extends GameAssetExportOptions {
130
- /** Phaser version (2 or 3) */
131
- phaserVersion?: 2 | 3;
132
- /** Physics system */
133
- physics?: 'arcade' | 'matter' | 'p2';
134
- }
135
- /**
136
- * Export for Phaser (JSON Atlas format)
137
- */
138
- export declare function exportToPhaser(options: PhaserExportOptions): ExportResult[];
139
- /**
140
- * Export for Construct 2/3 (c2addon/c3addon compatible JSON)
141
- */
142
- export declare function exportToConstruct(options: GameAssetExportOptions): ExportResult;
143
- export type ExportFormat = 'tiled' | 'godot' | 'unity' | 'phaser' | 'construct' | 'json';
144
- export interface ExportManagerOptions {
145
- format: ExportFormat;
146
- options: GameAssetExportOptions;
147
- formatOptions?: Partial<TiledExportOptions | GodotExportOptions | UnityExportOptions | PhaserExportOptions>;
148
- }
149
- /**
150
- * Export game asset to specified format
151
- */
152
- export declare function exportGameAsset(config: ExportManagerOptions): ExportResult[];
153
- /**
154
- * Download export results as files
155
- */
156
- export declare function downloadExportResults(results: ExportResult[]): void;
157
- /**
158
- * Zip export results (requires JSZip)
159
- */
160
- export declare function zipExportResults(results: ExportResult[], _zipName: string): Promise<Blob>;