@pooder/kit 3.5.0 → 4.1.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 +17 -0
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +295 -40
- package/dist/index.mjs +295 -40
- package/package.json +2 -2
- package/src/CanvasService.ts +89 -65
- package/src/background.ts +230 -230
- package/src/constraints.ts +158 -0
- package/src/coordinate.ts +106 -106
- package/src/dieline.ts +47 -22
- package/src/feature.ts +99 -31
- package/src/film.ts +194 -194
- package/src/geometry.ts +80 -27
- package/src/image.ts +512 -471
- package/src/mirror.ts +128 -128
- package/src/ruler.ts +500 -500
- package/src/tracer.ts +570 -570
- package/src/white-ink.ts +373 -373
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @pooder/kit
|
|
2
2
|
|
|
3
|
+
## 4.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Restriction strategy
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- Virtual Features
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @pooder/core@2.0.0
|
|
19
|
+
|
|
3
20
|
## 3.5.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service } from '@pooder/core';
|
|
1
|
+
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus } from '@pooder/core';
|
|
2
2
|
import { Canvas, Group, FabricObject } from 'fabric';
|
|
3
3
|
|
|
4
4
|
declare class BackgroundTool implements Extension {
|
|
@@ -27,7 +27,7 @@ type Unit = "px" | "mm" | "cm" | "in";
|
|
|
27
27
|
|
|
28
28
|
type FeatureOperation = "add" | "subtract";
|
|
29
29
|
type FeatureShape = "rect" | "circle";
|
|
30
|
-
interface
|
|
30
|
+
interface DielineFeature {
|
|
31
31
|
id: string;
|
|
32
32
|
groupId?: string;
|
|
33
33
|
operation: FeatureOperation;
|
|
@@ -38,9 +38,14 @@ interface EdgeFeature {
|
|
|
38
38
|
height?: number;
|
|
39
39
|
radius?: number;
|
|
40
40
|
rotation?: number;
|
|
41
|
-
|
|
41
|
+
placement?: "edge" | "internal";
|
|
42
42
|
color?: string;
|
|
43
43
|
strokeDash?: number[];
|
|
44
|
+
skipCut?: boolean;
|
|
45
|
+
constraints?: {
|
|
46
|
+
type: string;
|
|
47
|
+
params?: any;
|
|
48
|
+
};
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
interface DielineGeometry {
|
|
@@ -76,7 +81,7 @@ interface DielineState {
|
|
|
76
81
|
insideColor: string;
|
|
77
82
|
outsideColor: string;
|
|
78
83
|
showBleedLines: boolean;
|
|
79
|
-
features:
|
|
84
|
+
features: DielineFeature[];
|
|
80
85
|
pathData?: string;
|
|
81
86
|
}
|
|
82
87
|
declare class DielineTool implements Extension {
|
|
@@ -135,15 +140,18 @@ declare class FeatureTool implements Extension {
|
|
|
135
140
|
private canvasService?;
|
|
136
141
|
private context?;
|
|
137
142
|
private isUpdatingConfig;
|
|
143
|
+
private isToolActive;
|
|
138
144
|
private handleMoving;
|
|
139
145
|
private handleModified;
|
|
140
146
|
private handleDielineChange;
|
|
141
147
|
private currentGeometry;
|
|
142
148
|
constructor(options?: Partial<{
|
|
143
|
-
features:
|
|
149
|
+
features: DielineFeature[];
|
|
144
150
|
}>);
|
|
145
151
|
activate(context: ExtensionContext): void;
|
|
146
152
|
deactivate(context: ExtensionContext): void;
|
|
153
|
+
private onToolActivated;
|
|
154
|
+
private updateVisibility;
|
|
147
155
|
contribute(): {
|
|
148
156
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
149
157
|
};
|
|
@@ -178,8 +186,11 @@ declare class ImageTool implements Extension {
|
|
|
178
186
|
private canvasService?;
|
|
179
187
|
private context?;
|
|
180
188
|
private isUpdatingConfig;
|
|
189
|
+
private isToolActive;
|
|
181
190
|
activate(context: ExtensionContext): void;
|
|
182
191
|
deactivate(context: ExtensionContext): void;
|
|
192
|
+
private onToolActivated;
|
|
193
|
+
private updateInteractivity;
|
|
183
194
|
contribute(): {
|
|
184
195
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
185
196
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
@@ -288,7 +299,10 @@ declare class MirrorTool implements Extension {
|
|
|
288
299
|
|
|
289
300
|
declare class CanvasService implements Service {
|
|
290
301
|
canvas: Canvas;
|
|
302
|
+
private eventBus?;
|
|
291
303
|
constructor(el: HTMLCanvasElement | string | Canvas, options?: any);
|
|
304
|
+
setEventBus(eventBus: EventBus): void;
|
|
305
|
+
private setupEvents;
|
|
292
306
|
dispose(): void;
|
|
293
307
|
/**
|
|
294
308
|
* Get a layer (Group) by its ID.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service } from '@pooder/core';
|
|
1
|
+
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus } from '@pooder/core';
|
|
2
2
|
import { Canvas, Group, FabricObject } from 'fabric';
|
|
3
3
|
|
|
4
4
|
declare class BackgroundTool implements Extension {
|
|
@@ -27,7 +27,7 @@ type Unit = "px" | "mm" | "cm" | "in";
|
|
|
27
27
|
|
|
28
28
|
type FeatureOperation = "add" | "subtract";
|
|
29
29
|
type FeatureShape = "rect" | "circle";
|
|
30
|
-
interface
|
|
30
|
+
interface DielineFeature {
|
|
31
31
|
id: string;
|
|
32
32
|
groupId?: string;
|
|
33
33
|
operation: FeatureOperation;
|
|
@@ -38,9 +38,14 @@ interface EdgeFeature {
|
|
|
38
38
|
height?: number;
|
|
39
39
|
radius?: number;
|
|
40
40
|
rotation?: number;
|
|
41
|
-
|
|
41
|
+
placement?: "edge" | "internal";
|
|
42
42
|
color?: string;
|
|
43
43
|
strokeDash?: number[];
|
|
44
|
+
skipCut?: boolean;
|
|
45
|
+
constraints?: {
|
|
46
|
+
type: string;
|
|
47
|
+
params?: any;
|
|
48
|
+
};
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
interface DielineGeometry {
|
|
@@ -76,7 +81,7 @@ interface DielineState {
|
|
|
76
81
|
insideColor: string;
|
|
77
82
|
outsideColor: string;
|
|
78
83
|
showBleedLines: boolean;
|
|
79
|
-
features:
|
|
84
|
+
features: DielineFeature[];
|
|
80
85
|
pathData?: string;
|
|
81
86
|
}
|
|
82
87
|
declare class DielineTool implements Extension {
|
|
@@ -135,15 +140,18 @@ declare class FeatureTool implements Extension {
|
|
|
135
140
|
private canvasService?;
|
|
136
141
|
private context?;
|
|
137
142
|
private isUpdatingConfig;
|
|
143
|
+
private isToolActive;
|
|
138
144
|
private handleMoving;
|
|
139
145
|
private handleModified;
|
|
140
146
|
private handleDielineChange;
|
|
141
147
|
private currentGeometry;
|
|
142
148
|
constructor(options?: Partial<{
|
|
143
|
-
features:
|
|
149
|
+
features: DielineFeature[];
|
|
144
150
|
}>);
|
|
145
151
|
activate(context: ExtensionContext): void;
|
|
146
152
|
deactivate(context: ExtensionContext): void;
|
|
153
|
+
private onToolActivated;
|
|
154
|
+
private updateVisibility;
|
|
147
155
|
contribute(): {
|
|
148
156
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
149
157
|
};
|
|
@@ -178,8 +186,11 @@ declare class ImageTool implements Extension {
|
|
|
178
186
|
private canvasService?;
|
|
179
187
|
private context?;
|
|
180
188
|
private isUpdatingConfig;
|
|
189
|
+
private isToolActive;
|
|
181
190
|
activate(context: ExtensionContext): void;
|
|
182
191
|
deactivate(context: ExtensionContext): void;
|
|
192
|
+
private onToolActivated;
|
|
193
|
+
private updateInteractivity;
|
|
183
194
|
contribute(): {
|
|
184
195
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
185
196
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
@@ -288,7 +299,10 @@ declare class MirrorTool implements Extension {
|
|
|
288
299
|
|
|
289
300
|
declare class CanvasService implements Service {
|
|
290
301
|
canvas: Canvas;
|
|
302
|
+
private eventBus?;
|
|
291
303
|
constructor(el: HTMLCanvasElement | string | Canvas, options?: any);
|
|
304
|
+
setEventBus(eventBus: EventBus): void;
|
|
305
|
+
private setupEvents;
|
|
292
306
|
dispose(): void;
|
|
293
307
|
/**
|
|
294
308
|
* Get a layer (Group) by its ID.
|