@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.
- package/CHANGELOG.md +8 -0
- package/package.json +3 -3
- package/dist/types/core/useGamepad.d.ts +0 -16
- package/dist/types/core/usePointerPressure.d.ts +0 -88
- package/dist/types/game/AnimationPreviewPlayer.d.ts +0 -30
- package/dist/types/game/CollisionEditor.d.ts +0 -102
- package/dist/types/game/GameAssetExportPanel.d.ts +0 -20
- package/dist/types/game/IsometricEditor.d.ts +0 -22
- package/dist/types/game/IsometricTilePanel.d.ts +0 -18
- package/dist/types/game/gameAssetExport.d.ts +0 -160
- package/dist/types/game/isometricTiles.d.ts +0 -250
- package/dist/types/game/useAnimationPreview.d.ts +0 -63
- package/dist/types/game/useCollisionEditor.d.ts +0 -96
- package/dist/types/game/useGameAssetExport.d.ts +0 -82
- package/dist/types/photo/BatchProcessingPanel.d.ts +0 -13
- package/dist/types/photo/FaceDetectionPanel.d.ts +0 -19
- package/dist/types/photo/PerspectiveCorrectionPanel.d.ts +0 -17
- package/dist/types/photo/RawFilePanel.d.ts +0 -15
- package/dist/types/photo/StyleTransferPanel.d.ts +0 -16
- package/dist/types/photo/aiStyleTransfer.d.ts +0 -58
- package/dist/types/photo/batchProcessing.d.ts +0 -95
- package/dist/types/photo/faceDetection.d.ts +0 -103
- package/dist/types/photo/index.d.ts +0 -17
- package/dist/types/photo/perspectiveCorrection.d.ts +0 -124
- package/dist/types/photo/rawFileSupport.d.ts +0 -124
- package/dist/types/pixel/PaletteExtractorPanel.d.ts +0 -17
- package/dist/types/pixel/TileMapPanel.d.ts +0 -15
- package/dist/types/pixel/paletteExtractor.d.ts +0 -73
- package/dist/types/pixel/pixelAnimationPresets.d.ts +0 -79
- package/dist/types/pixel/pixelEffectsEngine.d.ts +0 -91
- package/dist/types/pixel/pixelEquipmentSystem.d.ts +0 -145
- package/dist/types/pixel/pixelSpriteTemplates.d.ts +0 -54
- package/dist/types/pixel/tileMapMode.d.ts +0 -122
- package/dist/types/vector/PathSimplificationPanel.d.ts +0 -16
- package/dist/types/vector/PdfExportPanel.d.ts +0 -20
- package/dist/types/vector/TextOnPathPanel.d.ts +0 -26
- package/dist/types/vector/VectorFilterPanel.d.ts +0 -20
- package/dist/types/vector/VectorPatternPanel.d.ts +0 -22
- package/dist/types/vector/pathSimplification.d.ts +0 -135
- package/dist/types/vector/pdfExport.d.ts +0 -65
- package/dist/types/vector/textOnPath.d.ts +0 -145
- package/dist/types/vector/vectorPatternFills.d.ts +0 -102
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PDF Export for VectorEditor
|
|
3
|
-
* Export SVG/vector graphics to PDF format
|
|
4
|
-
*/
|
|
5
|
-
export interface PdfExportOptions {
|
|
6
|
-
/** Page width in points (72 points = 1 inch) */
|
|
7
|
-
width?: number;
|
|
8
|
-
/** Page height in points */
|
|
9
|
-
height?: number;
|
|
10
|
-
/** Page format preset */
|
|
11
|
-
format?: PdfPageFormat;
|
|
12
|
-
/** Page orientation */
|
|
13
|
-
orientation?: 'portrait' | 'landscape';
|
|
14
|
-
/** Page margins in points */
|
|
15
|
-
margins?: {
|
|
16
|
-
top: number;
|
|
17
|
-
right: number;
|
|
18
|
-
bottom: number;
|
|
19
|
-
left: number;
|
|
20
|
-
};
|
|
21
|
-
/** Document title */
|
|
22
|
-
title?: string;
|
|
23
|
-
/** Document author */
|
|
24
|
-
author?: string;
|
|
25
|
-
/** Document subject */
|
|
26
|
-
subject?: string;
|
|
27
|
-
/** Document keywords */
|
|
28
|
-
keywords?: string[];
|
|
29
|
-
/** PDF compression */
|
|
30
|
-
compress?: boolean;
|
|
31
|
-
/** Image quality (0-1) for embedded images */
|
|
32
|
-
imageQuality?: number;
|
|
33
|
-
/** Scale factor for content */
|
|
34
|
-
scale?: number;
|
|
35
|
-
/** Background color (null for transparent) */
|
|
36
|
-
backgroundColor?: string | null;
|
|
37
|
-
/** Include fonts */
|
|
38
|
-
embedFonts?: boolean;
|
|
39
|
-
/** PDF/A compliance */
|
|
40
|
-
pdfaCompliance?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export type PdfPageFormat = 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6' | 'a7' | 'a8' | 'a9' | 'a10' | 'b0' | 'b1' | 'b2' | 'b3' | 'b4' | 'b5' | 'b6' | 'b7' | 'b8' | 'b9' | 'b10' | 'letter' | 'legal' | 'tabloid' | 'ledger' | 'executive' | 'custom';
|
|
43
|
-
export interface PdfExportResult {
|
|
44
|
-
/** PDF blob */
|
|
45
|
-
blob: Blob;
|
|
46
|
-
/** PDF as base64 data URL */
|
|
47
|
-
dataUrl: string;
|
|
48
|
-
/** File size in bytes */
|
|
49
|
-
size: number;
|
|
50
|
-
/** Number of pages */
|
|
51
|
-
pages: number;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Export SVG to PDF
|
|
55
|
-
*/
|
|
56
|
-
export declare function exportToPdf(svg: SVGElement | string, options?: PdfExportOptions): Promise<PdfExportResult>;
|
|
57
|
-
/**
|
|
58
|
-
* Download PDF
|
|
59
|
-
*/
|
|
60
|
-
export declare function downloadPdf(result: PdfExportResult, filename?: string): void;
|
|
61
|
-
/**
|
|
62
|
-
* Export SVG element to PDF and download
|
|
63
|
-
*/
|
|
64
|
-
export declare function exportAndDownload(svg: SVGElement | string, filename?: string, options?: PdfExportOptions): Promise<void>;
|
|
65
|
-
export default exportToPdf;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Text On Path
|
|
3
|
-
* Utilities for placing and rendering text along SVG paths
|
|
4
|
-
*/
|
|
5
|
-
export interface TextOnPathOptions {
|
|
6
|
-
/** The text content */
|
|
7
|
-
text: string;
|
|
8
|
-
/** SVG path data (d attribute) */
|
|
9
|
-
pathData: string;
|
|
10
|
-
/** Font family */
|
|
11
|
-
fontFamily?: string;
|
|
12
|
-
/** Font size in pixels */
|
|
13
|
-
fontSize?: number;
|
|
14
|
-
/** Font weight */
|
|
15
|
-
fontWeight?: number | 'normal' | 'bold' | 'lighter' | 'bolder';
|
|
16
|
-
/** Font style */
|
|
17
|
-
fontStyle?: 'normal' | 'italic' | 'oblique';
|
|
18
|
-
/** Text fill color */
|
|
19
|
-
fill?: string;
|
|
20
|
-
/** Text stroke color */
|
|
21
|
-
stroke?: string;
|
|
22
|
-
/** Text stroke width */
|
|
23
|
-
strokeWidth?: number;
|
|
24
|
-
/** Starting offset along path (0-1 or pixels) */
|
|
25
|
-
startOffset?: number | string;
|
|
26
|
-
/** Text anchor */
|
|
27
|
-
textAnchor?: 'start' | 'middle' | 'end';
|
|
28
|
-
/** Dominant baseline */
|
|
29
|
-
dominantBaseline?: 'auto' | 'middle' | 'hanging' | 'central' | 'alphabetic';
|
|
30
|
-
/** Letter spacing */
|
|
31
|
-
letterSpacing?: number;
|
|
32
|
-
/** Side of path for text */
|
|
33
|
-
side?: 'left' | 'right';
|
|
34
|
-
/** Text direction */
|
|
35
|
-
direction?: 'ltr' | 'rtl';
|
|
36
|
-
/** Spacing method */
|
|
37
|
-
method?: 'align' | 'stretch';
|
|
38
|
-
/** Spacing behavior */
|
|
39
|
-
spacing?: 'auto' | 'exact';
|
|
40
|
-
/** Unique ID for the path (auto-generated if not provided) */
|
|
41
|
-
pathId?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface TextOnPathResult {
|
|
44
|
-
/** Complete SVG markup */
|
|
45
|
-
svg: string;
|
|
46
|
-
/** Just the defs section (for embedding) */
|
|
47
|
-
defs: string;
|
|
48
|
-
/** Just the text element (for embedding) */
|
|
49
|
-
textElement: string;
|
|
50
|
-
/** Path length in pixels */
|
|
51
|
-
pathLength: number;
|
|
52
|
-
/** Text width in pixels (approximate) */
|
|
53
|
-
textWidth: number;
|
|
54
|
-
/** Whether text fits on path */
|
|
55
|
-
textFits: boolean;
|
|
56
|
-
}
|
|
57
|
-
export interface PathPoint {
|
|
58
|
-
x: number;
|
|
59
|
-
y: number;
|
|
60
|
-
angle: number;
|
|
61
|
-
t: number;
|
|
62
|
-
}
|
|
63
|
-
export interface TextOnPathAnimation {
|
|
64
|
-
/** Animation duration in ms */
|
|
65
|
-
duration?: number;
|
|
66
|
-
/** Animation easing */
|
|
67
|
-
easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
|
|
68
|
-
/** Animation direction */
|
|
69
|
-
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
70
|
-
/** Repeat count (Infinity for infinite) */
|
|
71
|
-
repeatCount?: number | 'indefinite';
|
|
72
|
-
/** Start offset range [from, to] */
|
|
73
|
-
offsetRange?: [number | string, number | string];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Parse SVG path data into segments
|
|
77
|
-
*/
|
|
78
|
-
export declare function parsePathData(d: string): PathSegment[];
|
|
79
|
-
interface PathSegment {
|
|
80
|
-
type: 'M' | 'L' | 'C' | 'Q' | 'A' | 'Z';
|
|
81
|
-
x: number;
|
|
82
|
-
y: number;
|
|
83
|
-
x0?: number;
|
|
84
|
-
y0?: number;
|
|
85
|
-
x1?: number;
|
|
86
|
-
y1?: number;
|
|
87
|
-
x2?: number;
|
|
88
|
-
y2?: number;
|
|
89
|
-
rx?: number;
|
|
90
|
-
ry?: number;
|
|
91
|
-
xAxisRotation?: number;
|
|
92
|
-
largeArcFlag?: number;
|
|
93
|
-
sweepFlag?: number;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Calculate total path length
|
|
97
|
-
*/
|
|
98
|
-
export declare function calculatePathLength(pathData: string): number;
|
|
99
|
-
/**
|
|
100
|
-
* Sample points along a path
|
|
101
|
-
*/
|
|
102
|
-
export declare function samplePath(pathData: string, numSamples: number): PathPoint[];
|
|
103
|
-
/**
|
|
104
|
-
* Generate SVG text on path
|
|
105
|
-
*/
|
|
106
|
-
export declare function generateTextOnPath(options: TextOnPathOptions): TextOnPathResult;
|
|
107
|
-
/**
|
|
108
|
-
* Generate animated text on path
|
|
109
|
-
*/
|
|
110
|
-
export declare function generateAnimatedTextOnPath(options: TextOnPathOptions, animation: TextOnPathAnimation): string;
|
|
111
|
-
export declare const PATH_PRESETS: {
|
|
112
|
-
/** Straight horizontal line */
|
|
113
|
-
horizontal: (width: number) => string;
|
|
114
|
-
/** Arc (semicircle) */
|
|
115
|
-
arc: (width: number, height: number) => string;
|
|
116
|
-
/** Full wave */
|
|
117
|
-
wave: (width: number, amplitude: number, frequency?: number) => string;
|
|
118
|
-
/** Circle */
|
|
119
|
-
circle: (cx: number, cy: number, r: number) => string;
|
|
120
|
-
/** Ellipse */
|
|
121
|
-
ellipse: (cx: number, cy: number, rx: number, ry: number) => string;
|
|
122
|
-
/** Spiral */
|
|
123
|
-
spiral: (cx: number, cy: number, startR: number, endR: number, turns?: number) => string;
|
|
124
|
-
/** Heart shape */
|
|
125
|
-
heart: (cx: number, cy: number, size: number) => string;
|
|
126
|
-
/** Star shape (for text around star points) */
|
|
127
|
-
star: (cx: number, cy: number, outerR: number, innerR: number, points?: number) => string;
|
|
128
|
-
};
|
|
129
|
-
export interface UseTextOnPathState {
|
|
130
|
-
text: string;
|
|
131
|
-
pathData: string;
|
|
132
|
-
options: Partial<TextOnPathOptions>;
|
|
133
|
-
}
|
|
134
|
-
export interface UseTextOnPathReturn {
|
|
135
|
-
state: UseTextOnPathState;
|
|
136
|
-
result: TextOnPathResult | null;
|
|
137
|
-
setText: (text: string) => void;
|
|
138
|
-
setPath: (pathData: string) => void;
|
|
139
|
-
setOptions: (options: Partial<TextOnPathOptions>) => void;
|
|
140
|
-
usePresetPath: (preset: keyof typeof PATH_PRESETS, ...args: number[]) => void;
|
|
141
|
-
getSvg: () => string;
|
|
142
|
-
getAnimatedSvg: (animation: TextOnPathAnimation) => string;
|
|
143
|
-
}
|
|
144
|
-
export declare function useTextOnPath(initialText?: string, initialPath?: string): UseTextOnPathReturn;
|
|
145
|
-
export default useTextOnPath;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vectorPatternFills — SVG Pattern fill system for VectorEditor
|
|
3
|
-
*
|
|
4
|
-
* Features:
|
|
5
|
-
* - Built-in pattern presets (stripes, dots, checkers, etc.)
|
|
6
|
-
* - Custom pattern creation from shapes
|
|
7
|
-
* - Pattern transformations (scale, rotate, offset)
|
|
8
|
-
* - Image-based patterns
|
|
9
|
-
* - Export as SVG <pattern> definitions
|
|
10
|
-
*/
|
|
11
|
-
export type PatternType = 'stripes-h' | 'stripes-v' | 'stripes-d' | 'stripes-d-rev' | 'dots' | 'dots-offset' | 'checker' | 'grid' | 'grid-dots' | 'hexagons' | 'triangles' | 'zigzag' | 'waves' | 'crosses' | 'diamonds' | 'custom';
|
|
12
|
-
export interface PatternFill {
|
|
13
|
-
/** Pattern type */
|
|
14
|
-
type: PatternType;
|
|
15
|
-
/** Unique ID for SVG reference */
|
|
16
|
-
id: string;
|
|
17
|
-
/** Pattern name */
|
|
18
|
-
name: string;
|
|
19
|
-
/** Primary color (foreground) */
|
|
20
|
-
foreground: string;
|
|
21
|
-
/** Secondary color (background) */
|
|
22
|
-
background: string;
|
|
23
|
-
/** Pattern cell width */
|
|
24
|
-
width: number;
|
|
25
|
-
/** Pattern cell height */
|
|
26
|
-
height: number;
|
|
27
|
-
/** Rotation angle (degrees) */
|
|
28
|
-
rotation: number;
|
|
29
|
-
/** Scale factor */
|
|
30
|
-
scale: number;
|
|
31
|
-
/** X offset */
|
|
32
|
-
offsetX: number;
|
|
33
|
-
/** Y offset */
|
|
34
|
-
offsetY: number;
|
|
35
|
-
/** Stroke width for line-based patterns */
|
|
36
|
-
strokeWidth: number;
|
|
37
|
-
/** Opacity (0-1) */
|
|
38
|
-
opacity: number;
|
|
39
|
-
/** Custom SVG content (for custom type) */
|
|
40
|
-
customSvg?: string;
|
|
41
|
-
/** Image URL (for image-based patterns) */
|
|
42
|
-
imageUrl?: string;
|
|
43
|
-
}
|
|
44
|
-
export declare const DEFAULT_PATTERN: PatternFill;
|
|
45
|
-
export interface PatternPreset {
|
|
46
|
-
type: PatternType;
|
|
47
|
-
name: string;
|
|
48
|
-
/** NiceIcon name (the preset picker draws a live swatch of the pattern itself). */
|
|
49
|
-
icon: string;
|
|
50
|
-
defaultWidth: number;
|
|
51
|
-
defaultHeight: number;
|
|
52
|
-
defaultStrokeWidth: number;
|
|
53
|
-
}
|
|
54
|
-
export declare const PATTERN_PRESETS: PatternPreset[];
|
|
55
|
-
export declare const generatePatternId: () => string;
|
|
56
|
-
/**
|
|
57
|
-
* Generate SVG pattern content for a given pattern type
|
|
58
|
-
*/
|
|
59
|
-
export declare function generatePatternContent(pattern: PatternFill): string;
|
|
60
|
-
/**
|
|
61
|
-
* Generate complete SVG <pattern> element
|
|
62
|
-
*/
|
|
63
|
-
export declare function generateSvgPattern(pattern: PatternFill): string;
|
|
64
|
-
/**
|
|
65
|
-
* Get URL reference for pattern
|
|
66
|
-
*/
|
|
67
|
-
export declare function getPatternUrl(pattern: PatternFill): string;
|
|
68
|
-
/**
|
|
69
|
-
* Create a new pattern with default values
|
|
70
|
-
*/
|
|
71
|
-
export declare function createPattern(type: PatternType): PatternFill;
|
|
72
|
-
/**
|
|
73
|
-
* Clone a pattern with new ID
|
|
74
|
-
*/
|
|
75
|
-
export declare function clonePattern(pattern: PatternFill): PatternFill;
|
|
76
|
-
/**
|
|
77
|
-
* Create pattern from image file
|
|
78
|
-
*/
|
|
79
|
-
export declare function createImagePattern(imageUrl: string, width: number, height: number): PatternFill;
|
|
80
|
-
/**
|
|
81
|
-
* Load image and create pattern from it
|
|
82
|
-
*/
|
|
83
|
-
export declare function loadImagePattern(file: File): Promise<PatternFill>;
|
|
84
|
-
/**
|
|
85
|
-
* Render pattern preview to canvas
|
|
86
|
-
*/
|
|
87
|
-
export declare function renderPatternPreview(pattern: PatternFill, width: number, height: number): HTMLCanvasElement;
|
|
88
|
-
/**
|
|
89
|
-
* Generate pattern preview as data URL
|
|
90
|
-
*/
|
|
91
|
-
export declare function getPatternPreviewDataUrl(pattern: PatternFill, width?: number, height?: number): Promise<string>;
|
|
92
|
-
export interface PatternLibrary {
|
|
93
|
-
patterns: PatternFill[];
|
|
94
|
-
add: (pattern: PatternFill) => void;
|
|
95
|
-
remove: (id: string) => void;
|
|
96
|
-
get: (id: string) => PatternFill | undefined;
|
|
97
|
-
update: (id: string, updates: Partial<PatternFill>) => void;
|
|
98
|
-
toJSON: () => string;
|
|
99
|
-
fromJSON: (json: string) => void;
|
|
100
|
-
}
|
|
101
|
-
export declare function createPatternLibrary(initial?: PatternFill[]): PatternLibrary;
|
|
102
|
-
export default generateSvgPattern;
|