@pooder/kit 0.0.2 → 2.0.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 +26 -9
- package/dist/index.d.mts +29 -6
- package/dist/index.d.ts +29 -6
- package/dist/index.js +405 -62
- package/dist/index.mjs +435 -68
- package/package.json +2 -2
- package/src/background.ts +183 -173
- package/src/dieline.ts +580 -424
- package/src/film.ts +163 -155
- package/src/geometry.ts +251 -244
- package/src/hole.ts +493 -413
- package/src/image.ts +304 -146
- package/src/index.ts +8 -7
- package/src/mirror.ts +91 -0
- package/src/ruler.ts +255 -238
- package/src/white-ink.ts +329 -302
- package/tsconfig.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
# @pooder/kit
|
|
2
|
-
|
|
3
|
-
## 0.0
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
# @pooder/kit
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- update
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @pooder/core@0.1.0
|
|
13
|
+
|
|
14
|
+
## 1.0.0
|
|
15
|
+
|
|
16
|
+
### Major Changes
|
|
17
|
+
|
|
18
|
+
- fix
|
|
19
|
+
|
|
20
|
+
## 0.0.2
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- changeset release
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @pooder/core@0.0.2
|
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ declare class BackgroundTool implements Extension<BackgroundToolOptions> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface DielineToolOptions {
|
|
20
|
-
shape:
|
|
20
|
+
shape: "rect" | "circle" | "ellipse";
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
23
|
radius: number;
|
|
@@ -27,13 +27,14 @@ interface DielineToolOptions {
|
|
|
27
27
|
};
|
|
28
28
|
borderLength?: number;
|
|
29
29
|
offset: number;
|
|
30
|
-
style:
|
|
30
|
+
style: "solid" | "dashed";
|
|
31
31
|
insideColor: string;
|
|
32
32
|
outsideColor: string;
|
|
33
|
+
showBleedLines?: boolean;
|
|
33
34
|
}
|
|
34
35
|
type DielineConfig = DielineToolOptions;
|
|
35
36
|
interface DielineGeometry {
|
|
36
|
-
shape:
|
|
37
|
+
shape: "rect" | "circle" | "ellipse";
|
|
37
38
|
x: number;
|
|
38
39
|
y: number;
|
|
39
40
|
width: number;
|
|
@@ -76,11 +77,12 @@ declare class FilmTool implements Extension<FilmToolOptions> {
|
|
|
76
77
|
interface HoleToolOptions {
|
|
77
78
|
innerRadius: number;
|
|
78
79
|
outerRadius: number;
|
|
79
|
-
style:
|
|
80
|
+
style: "solid" | "dashed";
|
|
80
81
|
holes?: Array<{
|
|
81
82
|
x: number;
|
|
82
83
|
y: number;
|
|
83
84
|
}>;
|
|
85
|
+
constraintTarget?: "original" | "bleed";
|
|
84
86
|
}
|
|
85
87
|
declare class HoleTool implements Extension<HoleToolOptions> {
|
|
86
88
|
name: string;
|
|
@@ -92,6 +94,7 @@ declare class HoleTool implements Extension<HoleToolOptions> {
|
|
|
92
94
|
onUnmount(editor: Editor): void;
|
|
93
95
|
onDestroy(editor: Editor): void;
|
|
94
96
|
private getDielineGeometry;
|
|
97
|
+
enforceConstraints(editor: Editor): void;
|
|
95
98
|
private setup;
|
|
96
99
|
private teardown;
|
|
97
100
|
onUpdate(editor: Editor, state: EditorState): void;
|
|
@@ -104,9 +107,15 @@ declare class HoleTool implements Extension<HoleToolOptions> {
|
|
|
104
107
|
interface ImageToolOptions {
|
|
105
108
|
url: string;
|
|
106
109
|
opacity: number;
|
|
110
|
+
width?: number;
|
|
111
|
+
height?: number;
|
|
112
|
+
angle?: number;
|
|
113
|
+
left?: number;
|
|
114
|
+
top?: number;
|
|
107
115
|
}
|
|
108
116
|
declare class ImageTool implements Extension<ImageToolOptions> {
|
|
109
117
|
name: string;
|
|
118
|
+
private _loadingUrl;
|
|
110
119
|
options: ImageToolOptions;
|
|
111
120
|
schema: Record<keyof ImageToolOptions, OptionSchema>;
|
|
112
121
|
onMount(editor: Editor): void;
|
|
@@ -142,7 +151,7 @@ declare class WhiteInkTool implements Extension<WhiteInkToolOptions> {
|
|
|
142
151
|
}
|
|
143
152
|
|
|
144
153
|
interface RulerToolOptions {
|
|
145
|
-
unit:
|
|
154
|
+
unit: "px" | "mm" | "cm" | "in";
|
|
146
155
|
thickness: number;
|
|
147
156
|
backgroundColor: string;
|
|
148
157
|
textColor: string;
|
|
@@ -164,4 +173,18 @@ declare class RulerTool implements Extension<RulerToolOptions> {
|
|
|
164
173
|
commands: Record<string, Command>;
|
|
165
174
|
}
|
|
166
175
|
|
|
167
|
-
|
|
176
|
+
interface MirrorToolOptions {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
}
|
|
179
|
+
declare class MirrorTool implements Extension<MirrorToolOptions> {
|
|
180
|
+
name: string;
|
|
181
|
+
options: MirrorToolOptions;
|
|
182
|
+
schema: Record<keyof MirrorToolOptions, OptionSchema>;
|
|
183
|
+
onMount(editor: Editor): void;
|
|
184
|
+
onUpdate(editor: Editor): void;
|
|
185
|
+
onUnmount(editor: Editor): void;
|
|
186
|
+
private applyMirror;
|
|
187
|
+
commands: Record<string, Command>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { BackgroundTool, type DielineConfig, type DielineGeometry, DielineTool, type DielineToolOptions, FilmTool, HoleTool, type HoleToolOptions, ImageTool, MirrorTool, type MirrorToolOptions, RulerTool, type RulerToolOptions, WhiteInkTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare class BackgroundTool implements Extension<BackgroundToolOptions> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface DielineToolOptions {
|
|
20
|
-
shape:
|
|
20
|
+
shape: "rect" | "circle" | "ellipse";
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
23
|
radius: number;
|
|
@@ -27,13 +27,14 @@ interface DielineToolOptions {
|
|
|
27
27
|
};
|
|
28
28
|
borderLength?: number;
|
|
29
29
|
offset: number;
|
|
30
|
-
style:
|
|
30
|
+
style: "solid" | "dashed";
|
|
31
31
|
insideColor: string;
|
|
32
32
|
outsideColor: string;
|
|
33
|
+
showBleedLines?: boolean;
|
|
33
34
|
}
|
|
34
35
|
type DielineConfig = DielineToolOptions;
|
|
35
36
|
interface DielineGeometry {
|
|
36
|
-
shape:
|
|
37
|
+
shape: "rect" | "circle" | "ellipse";
|
|
37
38
|
x: number;
|
|
38
39
|
y: number;
|
|
39
40
|
width: number;
|
|
@@ -76,11 +77,12 @@ declare class FilmTool implements Extension<FilmToolOptions> {
|
|
|
76
77
|
interface HoleToolOptions {
|
|
77
78
|
innerRadius: number;
|
|
78
79
|
outerRadius: number;
|
|
79
|
-
style:
|
|
80
|
+
style: "solid" | "dashed";
|
|
80
81
|
holes?: Array<{
|
|
81
82
|
x: number;
|
|
82
83
|
y: number;
|
|
83
84
|
}>;
|
|
85
|
+
constraintTarget?: "original" | "bleed";
|
|
84
86
|
}
|
|
85
87
|
declare class HoleTool implements Extension<HoleToolOptions> {
|
|
86
88
|
name: string;
|
|
@@ -92,6 +94,7 @@ declare class HoleTool implements Extension<HoleToolOptions> {
|
|
|
92
94
|
onUnmount(editor: Editor): void;
|
|
93
95
|
onDestroy(editor: Editor): void;
|
|
94
96
|
private getDielineGeometry;
|
|
97
|
+
enforceConstraints(editor: Editor): void;
|
|
95
98
|
private setup;
|
|
96
99
|
private teardown;
|
|
97
100
|
onUpdate(editor: Editor, state: EditorState): void;
|
|
@@ -104,9 +107,15 @@ declare class HoleTool implements Extension<HoleToolOptions> {
|
|
|
104
107
|
interface ImageToolOptions {
|
|
105
108
|
url: string;
|
|
106
109
|
opacity: number;
|
|
110
|
+
width?: number;
|
|
111
|
+
height?: number;
|
|
112
|
+
angle?: number;
|
|
113
|
+
left?: number;
|
|
114
|
+
top?: number;
|
|
107
115
|
}
|
|
108
116
|
declare class ImageTool implements Extension<ImageToolOptions> {
|
|
109
117
|
name: string;
|
|
118
|
+
private _loadingUrl;
|
|
110
119
|
options: ImageToolOptions;
|
|
111
120
|
schema: Record<keyof ImageToolOptions, OptionSchema>;
|
|
112
121
|
onMount(editor: Editor): void;
|
|
@@ -142,7 +151,7 @@ declare class WhiteInkTool implements Extension<WhiteInkToolOptions> {
|
|
|
142
151
|
}
|
|
143
152
|
|
|
144
153
|
interface RulerToolOptions {
|
|
145
|
-
unit:
|
|
154
|
+
unit: "px" | "mm" | "cm" | "in";
|
|
146
155
|
thickness: number;
|
|
147
156
|
backgroundColor: string;
|
|
148
157
|
textColor: string;
|
|
@@ -164,4 +173,18 @@ declare class RulerTool implements Extension<RulerToolOptions> {
|
|
|
164
173
|
commands: Record<string, Command>;
|
|
165
174
|
}
|
|
166
175
|
|
|
167
|
-
|
|
176
|
+
interface MirrorToolOptions {
|
|
177
|
+
enabled: boolean;
|
|
178
|
+
}
|
|
179
|
+
declare class MirrorTool implements Extension<MirrorToolOptions> {
|
|
180
|
+
name: string;
|
|
181
|
+
options: MirrorToolOptions;
|
|
182
|
+
schema: Record<keyof MirrorToolOptions, OptionSchema>;
|
|
183
|
+
onMount(editor: Editor): void;
|
|
184
|
+
onUpdate(editor: Editor): void;
|
|
185
|
+
onUnmount(editor: Editor): void;
|
|
186
|
+
private applyMirror;
|
|
187
|
+
commands: Record<string, Command>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { BackgroundTool, type DielineConfig, type DielineGeometry, DielineTool, type DielineToolOptions, FilmTool, HoleTool, type HoleToolOptions, ImageTool, MirrorTool, type MirrorToolOptions, RulerTool, type RulerToolOptions, WhiteInkTool };
|