@pooder/kit 3.4.0 → 3.5.0
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 +6 -0
- package/dist/index.d.mts +51 -55
- package/dist/index.d.ts +51 -55
- package/dist/index.js +866 -858
- package/dist/index.mjs +865 -857
- package/package.json +1 -1
- package/src/CanvasService.ts +65 -65
- package/src/background.ts +230 -230
- package/src/coordinate.ts +106 -106
- package/src/dieline.ts +282 -218
- package/src/feature.ts +724 -0
- package/src/film.ts +194 -194
- package/src/geometry.ts +118 -370
- package/src/image.ts +471 -471
- package/src/index.ts +1 -1
- package/src/mirror.ts +128 -128
- package/src/ruler.ts +500 -500
- package/src/tracer.ts +570 -486
- package/src/white-ink.ts +373 -373
- package/src/hole.ts +0 -786
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -25,16 +25,22 @@ declare class BackgroundTool implements Extension {
|
|
|
25
25
|
|
|
26
26
|
type Unit = "px" | "mm" | "cm" | "in";
|
|
27
27
|
|
|
28
|
-
type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
type FeatureOperation = "add" | "subtract";
|
|
29
|
+
type FeatureShape = "rect" | "circle";
|
|
30
|
+
interface EdgeFeature {
|
|
31
|
+
id: string;
|
|
32
|
+
groupId?: string;
|
|
33
|
+
operation: FeatureOperation;
|
|
34
|
+
shape: FeatureShape;
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
radius?: number;
|
|
40
|
+
rotation?: number;
|
|
41
|
+
target?: "original" | "offset" | "both";
|
|
42
|
+
color?: string;
|
|
43
|
+
strokeDash?: number[];
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
interface DielineGeometry {
|
|
@@ -48,6 +54,29 @@ interface DielineGeometry {
|
|
|
48
54
|
offset: number;
|
|
49
55
|
borderLength?: number;
|
|
50
56
|
scale?: number;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
pathData?: string;
|
|
59
|
+
}
|
|
60
|
+
interface LineStyle {
|
|
61
|
+
width: number;
|
|
62
|
+
color: string;
|
|
63
|
+
dashLength: number;
|
|
64
|
+
style: "solid" | "dashed" | "hidden";
|
|
65
|
+
}
|
|
66
|
+
interface DielineState {
|
|
67
|
+
unit: Unit;
|
|
68
|
+
shape: "rect" | "circle" | "ellipse" | "custom";
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
radius: number;
|
|
72
|
+
offset: number;
|
|
73
|
+
padding: number | string;
|
|
74
|
+
mainLine: LineStyle;
|
|
75
|
+
offsetLine: LineStyle;
|
|
76
|
+
insideColor: string;
|
|
77
|
+
outsideColor: string;
|
|
78
|
+
showBleedLines: boolean;
|
|
79
|
+
features: EdgeFeature[];
|
|
51
80
|
pathData?: string;
|
|
52
81
|
}
|
|
53
82
|
declare class DielineTool implements Extension {
|
|
@@ -55,41 +84,10 @@ declare class DielineTool implements Extension {
|
|
|
55
84
|
metadata: {
|
|
56
85
|
name: string;
|
|
57
86
|
};
|
|
58
|
-
private
|
|
59
|
-
private shape;
|
|
60
|
-
private width;
|
|
61
|
-
private height;
|
|
62
|
-
private radius;
|
|
63
|
-
private offset;
|
|
64
|
-
private style;
|
|
65
|
-
private insideColor;
|
|
66
|
-
private outsideColor;
|
|
67
|
-
private showBleedLines;
|
|
68
|
-
private holes;
|
|
69
|
-
private position?;
|
|
70
|
-
private padding;
|
|
71
|
-
private pathData?;
|
|
87
|
+
private state;
|
|
72
88
|
private canvasService?;
|
|
73
89
|
private context?;
|
|
74
|
-
constructor(options?: Partial<
|
|
75
|
-
unit: Unit;
|
|
76
|
-
shape: "rect" | "circle" | "ellipse" | "custom";
|
|
77
|
-
width: number;
|
|
78
|
-
height: number;
|
|
79
|
-
radius: number;
|
|
80
|
-
position: {
|
|
81
|
-
x: number;
|
|
82
|
-
y: number;
|
|
83
|
-
};
|
|
84
|
-
padding: number | string;
|
|
85
|
-
offset: number;
|
|
86
|
-
style: "solid" | "dashed";
|
|
87
|
-
insideColor: string;
|
|
88
|
-
outsideColor: string;
|
|
89
|
-
showBleedLines: boolean;
|
|
90
|
-
holes: HoleData[];
|
|
91
|
-
pathData: string;
|
|
92
|
-
}>);
|
|
90
|
+
constructor(options?: Partial<DielineState>);
|
|
93
91
|
activate(context: ExtensionContext): void;
|
|
94
92
|
deactivate(context: ExtensionContext): void;
|
|
95
93
|
contribute(): {
|
|
@@ -128,13 +126,12 @@ declare class FilmTool implements Extension {
|
|
|
128
126
|
private updateFilm;
|
|
129
127
|
}
|
|
130
128
|
|
|
131
|
-
declare class
|
|
129
|
+
declare class FeatureTool implements Extension {
|
|
132
130
|
id: string;
|
|
133
131
|
metadata: {
|
|
134
132
|
name: string;
|
|
135
133
|
};
|
|
136
|
-
private
|
|
137
|
-
private constraintTarget;
|
|
134
|
+
private features;
|
|
138
135
|
private canvasService?;
|
|
139
136
|
private context?;
|
|
140
137
|
private isUpdatingConfig;
|
|
@@ -143,23 +140,22 @@ declare class HoleTool implements Extension {
|
|
|
143
140
|
private handleDielineChange;
|
|
144
141
|
private currentGeometry;
|
|
145
142
|
constructor(options?: Partial<{
|
|
146
|
-
|
|
147
|
-
constraintTarget: "original" | "bleed";
|
|
143
|
+
features: EdgeFeature[];
|
|
148
144
|
}>);
|
|
149
145
|
activate(context: ExtensionContext): void;
|
|
150
146
|
deactivate(context: ExtensionContext): void;
|
|
151
147
|
contribute(): {
|
|
152
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
153
148
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
154
149
|
};
|
|
150
|
+
private addFeature;
|
|
151
|
+
private addDoubleLayerHole;
|
|
152
|
+
private getGeometryForFeature;
|
|
155
153
|
private setup;
|
|
156
|
-
private initializeHoles;
|
|
157
154
|
private teardown;
|
|
158
|
-
private
|
|
159
|
-
private
|
|
155
|
+
private constrainPosition;
|
|
156
|
+
private syncFeatureFromCanvas;
|
|
160
157
|
private redraw;
|
|
161
|
-
enforceConstraints
|
|
162
|
-
private calculateConstrainedPosition;
|
|
158
|
+
private enforceConstraints;
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
interface ImageItem {
|
|
@@ -310,4 +306,4 @@ declare class CanvasService implements Service {
|
|
|
310
306
|
requestRenderAll(): void;
|
|
311
307
|
}
|
|
312
308
|
|
|
313
|
-
export { BackgroundTool, CanvasService, type DielineGeometry, DielineTool,
|
|
309
|
+
export { BackgroundTool, CanvasService, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LineStyle, MirrorTool, RulerTool, WhiteInkTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,16 +25,22 @@ declare class BackgroundTool implements Extension {
|
|
|
25
25
|
|
|
26
26
|
type Unit = "px" | "mm" | "cm" | "in";
|
|
27
27
|
|
|
28
|
-
type
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
type FeatureOperation = "add" | "subtract";
|
|
29
|
+
type FeatureShape = "rect" | "circle";
|
|
30
|
+
interface EdgeFeature {
|
|
31
|
+
id: string;
|
|
32
|
+
groupId?: string;
|
|
33
|
+
operation: FeatureOperation;
|
|
34
|
+
shape: FeatureShape;
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
radius?: number;
|
|
40
|
+
rotation?: number;
|
|
41
|
+
target?: "original" | "offset" | "both";
|
|
42
|
+
color?: string;
|
|
43
|
+
strokeDash?: number[];
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
interface DielineGeometry {
|
|
@@ -48,6 +54,29 @@ interface DielineGeometry {
|
|
|
48
54
|
offset: number;
|
|
49
55
|
borderLength?: number;
|
|
50
56
|
scale?: number;
|
|
57
|
+
strokeWidth?: number;
|
|
58
|
+
pathData?: string;
|
|
59
|
+
}
|
|
60
|
+
interface LineStyle {
|
|
61
|
+
width: number;
|
|
62
|
+
color: string;
|
|
63
|
+
dashLength: number;
|
|
64
|
+
style: "solid" | "dashed" | "hidden";
|
|
65
|
+
}
|
|
66
|
+
interface DielineState {
|
|
67
|
+
unit: Unit;
|
|
68
|
+
shape: "rect" | "circle" | "ellipse" | "custom";
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
radius: number;
|
|
72
|
+
offset: number;
|
|
73
|
+
padding: number | string;
|
|
74
|
+
mainLine: LineStyle;
|
|
75
|
+
offsetLine: LineStyle;
|
|
76
|
+
insideColor: string;
|
|
77
|
+
outsideColor: string;
|
|
78
|
+
showBleedLines: boolean;
|
|
79
|
+
features: EdgeFeature[];
|
|
51
80
|
pathData?: string;
|
|
52
81
|
}
|
|
53
82
|
declare class DielineTool implements Extension {
|
|
@@ -55,41 +84,10 @@ declare class DielineTool implements Extension {
|
|
|
55
84
|
metadata: {
|
|
56
85
|
name: string;
|
|
57
86
|
};
|
|
58
|
-
private
|
|
59
|
-
private shape;
|
|
60
|
-
private width;
|
|
61
|
-
private height;
|
|
62
|
-
private radius;
|
|
63
|
-
private offset;
|
|
64
|
-
private style;
|
|
65
|
-
private insideColor;
|
|
66
|
-
private outsideColor;
|
|
67
|
-
private showBleedLines;
|
|
68
|
-
private holes;
|
|
69
|
-
private position?;
|
|
70
|
-
private padding;
|
|
71
|
-
private pathData?;
|
|
87
|
+
private state;
|
|
72
88
|
private canvasService?;
|
|
73
89
|
private context?;
|
|
74
|
-
constructor(options?: Partial<
|
|
75
|
-
unit: Unit;
|
|
76
|
-
shape: "rect" | "circle" | "ellipse" | "custom";
|
|
77
|
-
width: number;
|
|
78
|
-
height: number;
|
|
79
|
-
radius: number;
|
|
80
|
-
position: {
|
|
81
|
-
x: number;
|
|
82
|
-
y: number;
|
|
83
|
-
};
|
|
84
|
-
padding: number | string;
|
|
85
|
-
offset: number;
|
|
86
|
-
style: "solid" | "dashed";
|
|
87
|
-
insideColor: string;
|
|
88
|
-
outsideColor: string;
|
|
89
|
-
showBleedLines: boolean;
|
|
90
|
-
holes: HoleData[];
|
|
91
|
-
pathData: string;
|
|
92
|
-
}>);
|
|
90
|
+
constructor(options?: Partial<DielineState>);
|
|
93
91
|
activate(context: ExtensionContext): void;
|
|
94
92
|
deactivate(context: ExtensionContext): void;
|
|
95
93
|
contribute(): {
|
|
@@ -128,13 +126,12 @@ declare class FilmTool implements Extension {
|
|
|
128
126
|
private updateFilm;
|
|
129
127
|
}
|
|
130
128
|
|
|
131
|
-
declare class
|
|
129
|
+
declare class FeatureTool implements Extension {
|
|
132
130
|
id: string;
|
|
133
131
|
metadata: {
|
|
134
132
|
name: string;
|
|
135
133
|
};
|
|
136
|
-
private
|
|
137
|
-
private constraintTarget;
|
|
134
|
+
private features;
|
|
138
135
|
private canvasService?;
|
|
139
136
|
private context?;
|
|
140
137
|
private isUpdatingConfig;
|
|
@@ -143,23 +140,22 @@ declare class HoleTool implements Extension {
|
|
|
143
140
|
private handleDielineChange;
|
|
144
141
|
private currentGeometry;
|
|
145
142
|
constructor(options?: Partial<{
|
|
146
|
-
|
|
147
|
-
constraintTarget: "original" | "bleed";
|
|
143
|
+
features: EdgeFeature[];
|
|
148
144
|
}>);
|
|
149
145
|
activate(context: ExtensionContext): void;
|
|
150
146
|
deactivate(context: ExtensionContext): void;
|
|
151
147
|
contribute(): {
|
|
152
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
153
148
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
154
149
|
};
|
|
150
|
+
private addFeature;
|
|
151
|
+
private addDoubleLayerHole;
|
|
152
|
+
private getGeometryForFeature;
|
|
155
153
|
private setup;
|
|
156
|
-
private initializeHoles;
|
|
157
154
|
private teardown;
|
|
158
|
-
private
|
|
159
|
-
private
|
|
155
|
+
private constrainPosition;
|
|
156
|
+
private syncFeatureFromCanvas;
|
|
160
157
|
private redraw;
|
|
161
|
-
enforceConstraints
|
|
162
|
-
private calculateConstrainedPosition;
|
|
158
|
+
private enforceConstraints;
|
|
163
159
|
}
|
|
164
160
|
|
|
165
161
|
interface ImageItem {
|
|
@@ -310,4 +306,4 @@ declare class CanvasService implements Service {
|
|
|
310
306
|
requestRenderAll(): void;
|
|
311
307
|
}
|
|
312
308
|
|
|
313
|
-
export { BackgroundTool, CanvasService, type DielineGeometry, DielineTool,
|
|
309
|
+
export { BackgroundTool, CanvasService, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LineStyle, MirrorTool, RulerTool, WhiteInkTool };
|