@pooder/kit 5.0.4 → 5.2.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 +248 -267
- package/dist/index.d.ts +248 -267
- package/dist/index.js +6729 -5797
- package/dist/index.mjs +6690 -5741
- package/package.json +2 -2
- package/src/{background.ts → extensions/background.ts} +1 -1
- package/src/{dieline.ts → extensions/dieline.ts} +39 -17
- package/src/{feature.ts → extensions/feature.ts} +80 -67
- package/src/{film.ts → extensions/film.ts} +1 -1
- package/src/{geometry.ts → extensions/geometry.ts} +151 -105
- package/src/{image.ts → extensions/image.ts} +436 -93
- package/src/extensions/index.ts +11 -0
- package/src/{maskOps.ts → extensions/maskOps.ts} +28 -10
- package/src/{mirror.ts → extensions/mirror.ts} +1 -1
- package/src/{ruler.ts → extensions/ruler.ts} +5 -3
- package/src/extensions/sceneLayout.ts +140 -0
- package/src/{sceneLayoutModel.ts → extensions/sceneLayoutModel.ts} +17 -10
- package/src/extensions/sceneVisibility.ts +71 -0
- package/src/{size.ts → extensions/size.ts} +23 -13
- package/src/{tracer.ts → extensions/tracer.ts} +374 -45
- package/src/{white-ink.ts → extensions/white-ink.ts} +620 -236
- package/src/index.ts +2 -14
- package/src/{ViewportSystem.ts → services/ViewportSystem.ts} +5 -2
- package/src/services/index.ts +3 -0
- package/src/sceneLayout.ts +0 -121
- package/src/sceneVisibility.ts +0 -49
- /package/src/{bridgeSelection.ts → extensions/bridgeSelection.ts} +0 -0
- /package/src/{constraints.ts → extensions/constraints.ts} +0 -0
- /package/src/{edgeScale.ts → extensions/edgeScale.ts} +0 -0
- /package/src/{featureComplete.ts → extensions/featureComplete.ts} +0 -0
- /package/src/{wrappedOffsets.ts → extensions/wrappedOffsets.ts} +0 -0
- /package/src/{CanvasService.ts → services/CanvasService.ts} +0 -0
- /package/src/{renderSpec.ts → services/renderSpec.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @pooder/kit
|
|
2
2
|
|
|
3
|
+
## 5.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- image hatch overlay
|
|
8
|
+
|
|
9
|
+
## 5.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- service
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @pooder/core@2.2.0
|
|
19
|
+
|
|
3
20
|
## 5.0.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus,
|
|
1
|
+
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus, ServiceContext } from '@pooder/core';
|
|
2
2
|
import { Canvas, Group, FabricObject } from 'fabric';
|
|
3
3
|
|
|
4
4
|
declare class BackgroundTool implements Extension {
|
|
@@ -23,6 +23,146 @@ declare class BackgroundTool implements Extension {
|
|
|
23
23
|
private updateBackground;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
interface ImageItem {
|
|
27
|
+
id: string;
|
|
28
|
+
url: string;
|
|
29
|
+
opacity: number;
|
|
30
|
+
scale?: number;
|
|
31
|
+
angle?: number;
|
|
32
|
+
left?: number;
|
|
33
|
+
top?: number;
|
|
34
|
+
sourceUrl?: string;
|
|
35
|
+
committedUrl?: string;
|
|
36
|
+
}
|
|
37
|
+
declare class ImageTool implements Extension {
|
|
38
|
+
id: string;
|
|
39
|
+
metadata: {
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
private items;
|
|
43
|
+
private workingItems;
|
|
44
|
+
private hasWorkingChanges;
|
|
45
|
+
private loadResolvers;
|
|
46
|
+
private sourceSizeBySrc;
|
|
47
|
+
private canvasService?;
|
|
48
|
+
private context?;
|
|
49
|
+
private isUpdatingConfig;
|
|
50
|
+
private isToolActive;
|
|
51
|
+
private isImageSelectionActive;
|
|
52
|
+
private focusedImageId;
|
|
53
|
+
private renderSeq;
|
|
54
|
+
private dirtyTrackerDisposable?;
|
|
55
|
+
private cropShapeHatchPattern?;
|
|
56
|
+
private cropShapeHatchPatternColor?;
|
|
57
|
+
activate(context: ExtensionContext): void;
|
|
58
|
+
deactivate(context: ExtensionContext): void;
|
|
59
|
+
private onToolActivated;
|
|
60
|
+
private onSelectionChanged;
|
|
61
|
+
private onSelectionCleared;
|
|
62
|
+
private onSceneLayoutChanged;
|
|
63
|
+
private onSceneGeometryChanged;
|
|
64
|
+
private syncToolActiveFromWorkbench;
|
|
65
|
+
private isImageEditingVisible;
|
|
66
|
+
private isDebugEnabled;
|
|
67
|
+
private debug;
|
|
68
|
+
contribute(): {
|
|
69
|
+
[ContributionPointIds.TOOLS]: {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
interaction: string;
|
|
73
|
+
commands: {
|
|
74
|
+
begin: string;
|
|
75
|
+
commit: string;
|
|
76
|
+
rollback: string;
|
|
77
|
+
};
|
|
78
|
+
session: {
|
|
79
|
+
autoBegin: boolean;
|
|
80
|
+
leavePolicy: string;
|
|
81
|
+
};
|
|
82
|
+
}[];
|
|
83
|
+
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
84
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
85
|
+
};
|
|
86
|
+
private normalizeItem;
|
|
87
|
+
private normalizeItems;
|
|
88
|
+
private cloneItems;
|
|
89
|
+
private emitWorkingChange;
|
|
90
|
+
private generateId;
|
|
91
|
+
private hasImageItem;
|
|
92
|
+
private setImageFocus;
|
|
93
|
+
private addImageEntry;
|
|
94
|
+
private upsertImageEntry;
|
|
95
|
+
private addItemToWorkingSessionIfNeeded;
|
|
96
|
+
private updateImage;
|
|
97
|
+
private getConfig;
|
|
98
|
+
private updateConfig;
|
|
99
|
+
private getFrameRect;
|
|
100
|
+
private resolveDefaultFitArea;
|
|
101
|
+
private fitImageToDefaultArea;
|
|
102
|
+
private getImageObjects;
|
|
103
|
+
private getOverlayObjects;
|
|
104
|
+
private getImageObject;
|
|
105
|
+
private clearRenderedImages;
|
|
106
|
+
private purgeSourceSizeCacheForItem;
|
|
107
|
+
private rememberSourceSize;
|
|
108
|
+
private getSourceSize;
|
|
109
|
+
private getCoverScale;
|
|
110
|
+
private getFrameVisualConfig;
|
|
111
|
+
private toSceneGeometryLike;
|
|
112
|
+
private resolveSceneGeometryForOverlay;
|
|
113
|
+
private resolveCutShapeRadius;
|
|
114
|
+
private getCropShapeHatchPattern;
|
|
115
|
+
private buildCropShapeOverlaySpecs;
|
|
116
|
+
private resolveRenderImageState;
|
|
117
|
+
private computeCanvasProps;
|
|
118
|
+
private getCurrentSrc;
|
|
119
|
+
private applyImageControlVisibility;
|
|
120
|
+
private upsertImageObject;
|
|
121
|
+
private syncImageZOrder;
|
|
122
|
+
private buildOverlaySpecs;
|
|
123
|
+
private updateImages;
|
|
124
|
+
private updateImagesAsync;
|
|
125
|
+
private clampNormalized;
|
|
126
|
+
private onObjectModified;
|
|
127
|
+
private updateImageInWorking;
|
|
128
|
+
private updateImageInConfig;
|
|
129
|
+
private waitImageLoaded;
|
|
130
|
+
private refitImageToFrame;
|
|
131
|
+
private fitImageToArea;
|
|
132
|
+
private commitWorkingImagesAsCropped;
|
|
133
|
+
private exportCroppedImageByIds;
|
|
134
|
+
private exportUserCroppedImage;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class SizeTool implements Extension {
|
|
138
|
+
id: string;
|
|
139
|
+
metadata: {
|
|
140
|
+
name: string;
|
|
141
|
+
};
|
|
142
|
+
private context?;
|
|
143
|
+
private canvasService?;
|
|
144
|
+
activate(context: ExtensionContext): void;
|
|
145
|
+
deactivate(_context: ExtensionContext): void;
|
|
146
|
+
contribute(): {
|
|
147
|
+
[ContributionPointIds.TOOLS]: {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
interaction: string;
|
|
151
|
+
}[];
|
|
152
|
+
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
153
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
154
|
+
};
|
|
155
|
+
private getConfigService;
|
|
156
|
+
private ensureDefaults;
|
|
157
|
+
private emitStateChanged;
|
|
158
|
+
private getStateForUI;
|
|
159
|
+
private updateDimensions;
|
|
160
|
+
private setConstraintMode;
|
|
161
|
+
private setUnit;
|
|
162
|
+
private setCut;
|
|
163
|
+
private getSelectedImageSize;
|
|
164
|
+
}
|
|
165
|
+
|
|
26
166
|
interface Point {
|
|
27
167
|
x: number;
|
|
28
168
|
y: number;
|
|
@@ -138,28 +278,6 @@ declare class DielineTool implements Extension {
|
|
|
138
278
|
}): Promise<string | null>;
|
|
139
279
|
}
|
|
140
280
|
|
|
141
|
-
declare class FilmTool implements Extension {
|
|
142
|
-
id: string;
|
|
143
|
-
metadata: {
|
|
144
|
-
name: string;
|
|
145
|
-
};
|
|
146
|
-
private url;
|
|
147
|
-
private opacity;
|
|
148
|
-
private canvasService?;
|
|
149
|
-
constructor(options?: Partial<{
|
|
150
|
-
url: string;
|
|
151
|
-
opacity: number;
|
|
152
|
-
}>);
|
|
153
|
-
activate(context: ExtensionContext): void;
|
|
154
|
-
deactivate(context: ExtensionContext): void;
|
|
155
|
-
contribute(): {
|
|
156
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
157
|
-
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
158
|
-
};
|
|
159
|
-
private initLayer;
|
|
160
|
-
private updateFilm;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
281
|
interface ConstraintFeature extends DielineFeature {
|
|
164
282
|
constraints?: Array<{
|
|
165
283
|
type: string;
|
|
@@ -233,106 +351,83 @@ declare class FeatureTool implements Extension {
|
|
|
233
351
|
private enforceConstraints;
|
|
234
352
|
}
|
|
235
353
|
|
|
236
|
-
|
|
354
|
+
declare class FilmTool implements Extension {
|
|
237
355
|
id: string;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
356
|
+
metadata: {
|
|
357
|
+
name: string;
|
|
358
|
+
};
|
|
359
|
+
private url;
|
|
360
|
+
private opacity;
|
|
361
|
+
private canvasService?;
|
|
362
|
+
constructor(options?: Partial<{
|
|
363
|
+
url: string;
|
|
364
|
+
opacity: number;
|
|
365
|
+
}>);
|
|
366
|
+
activate(context: ExtensionContext): void;
|
|
367
|
+
deactivate(context: ExtensionContext): void;
|
|
368
|
+
contribute(): {
|
|
369
|
+
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
370
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
371
|
+
};
|
|
372
|
+
private initLayer;
|
|
373
|
+
private updateFilm;
|
|
246
374
|
}
|
|
247
|
-
|
|
375
|
+
|
|
376
|
+
declare class MirrorTool implements Extension {
|
|
248
377
|
id: string;
|
|
249
378
|
metadata: {
|
|
250
379
|
name: string;
|
|
251
380
|
};
|
|
252
|
-
private
|
|
253
|
-
private
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
381
|
+
private enabled;
|
|
382
|
+
private canvasService?;
|
|
383
|
+
constructor(options?: Partial<{
|
|
384
|
+
enabled: boolean;
|
|
385
|
+
}>);
|
|
386
|
+
toJSON(): {
|
|
387
|
+
enabled: boolean;
|
|
388
|
+
};
|
|
389
|
+
loadFromJSON(json: any): void;
|
|
390
|
+
activate(context: ExtensionContext): void;
|
|
391
|
+
deactivate(context: ExtensionContext): void;
|
|
392
|
+
contribute(): {
|
|
393
|
+
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
394
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
395
|
+
};
|
|
396
|
+
private applyMirror;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare class RulerTool implements Extension {
|
|
400
|
+
id: string;
|
|
401
|
+
metadata: {
|
|
402
|
+
name: string;
|
|
403
|
+
};
|
|
404
|
+
private thickness;
|
|
405
|
+
private gap;
|
|
406
|
+
private backgroundColor;
|
|
407
|
+
private textColor;
|
|
408
|
+
private lineColor;
|
|
409
|
+
private fontSize;
|
|
257
410
|
private canvasService?;
|
|
258
411
|
private context?;
|
|
259
|
-
private
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
412
|
+
private onCanvasResized;
|
|
413
|
+
constructor(options?: Partial<{
|
|
414
|
+
thickness: number;
|
|
415
|
+
backgroundColor: string;
|
|
416
|
+
textColor: string;
|
|
417
|
+
lineColor: string;
|
|
418
|
+
fontSize: number;
|
|
419
|
+
}>);
|
|
265
420
|
activate(context: ExtensionContext): void;
|
|
266
421
|
deactivate(context: ExtensionContext): void;
|
|
267
|
-
private onToolActivated;
|
|
268
|
-
private onSelectionChanged;
|
|
269
|
-
private onSelectionCleared;
|
|
270
|
-
private onSceneLayoutChanged;
|
|
271
|
-
private syncToolActiveFromWorkbench;
|
|
272
|
-
private isImageEditingVisible;
|
|
273
|
-
private isDebugEnabled;
|
|
274
|
-
private debug;
|
|
275
422
|
contribute(): {
|
|
276
|
-
[ContributionPointIds.TOOLS]: {
|
|
277
|
-
id: string;
|
|
278
|
-
name: string;
|
|
279
|
-
interaction: string;
|
|
280
|
-
commands: {
|
|
281
|
-
begin: string;
|
|
282
|
-
commit: string;
|
|
283
|
-
rollback: string;
|
|
284
|
-
};
|
|
285
|
-
session: {
|
|
286
|
-
autoBegin: boolean;
|
|
287
|
-
leavePolicy: string;
|
|
288
|
-
};
|
|
289
|
-
}[];
|
|
290
423
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
291
424
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
292
425
|
};
|
|
293
|
-
private
|
|
294
|
-
private
|
|
295
|
-
private
|
|
296
|
-
private
|
|
297
|
-
private
|
|
298
|
-
private hasImageItem;
|
|
299
|
-
private setImageFocus;
|
|
300
|
-
private addImageEntry;
|
|
301
|
-
private upsertImageEntry;
|
|
302
|
-
private addItemToWorkingSessionIfNeeded;
|
|
303
|
-
private updateImage;
|
|
304
|
-
private getConfig;
|
|
305
|
-
private updateConfig;
|
|
306
|
-
private getFrameRect;
|
|
307
|
-
private resolveDefaultFitArea;
|
|
308
|
-
private fitImageToDefaultArea;
|
|
309
|
-
private getImageObjects;
|
|
310
|
-
private getOverlayObjects;
|
|
311
|
-
private getImageObject;
|
|
312
|
-
private clearRenderedImages;
|
|
313
|
-
private purgeSourceSizeCacheForItem;
|
|
314
|
-
private rememberSourceSize;
|
|
315
|
-
private getSourceSize;
|
|
316
|
-
private getCoverScale;
|
|
317
|
-
private getFrameVisualConfig;
|
|
318
|
-
private resolveRenderImageState;
|
|
319
|
-
private computeCanvasProps;
|
|
320
|
-
private getCurrentSrc;
|
|
321
|
-
private upsertImageObject;
|
|
322
|
-
private syncImageZOrder;
|
|
323
|
-
private buildOverlaySpecs;
|
|
324
|
-
private updateImages;
|
|
325
|
-
private updateImagesAsync;
|
|
326
|
-
private clampNormalized;
|
|
327
|
-
private onObjectModified;
|
|
328
|
-
private updateImageInWorking;
|
|
329
|
-
private updateImageInConfig;
|
|
330
|
-
private waitImageLoaded;
|
|
331
|
-
private refitImageToFrame;
|
|
332
|
-
private fitImageToArea;
|
|
333
|
-
private commitWorkingImagesAsCropped;
|
|
334
|
-
private exportCroppedImageByIds;
|
|
335
|
-
private exportImageFrameUrl;
|
|
426
|
+
private getLayer;
|
|
427
|
+
private createLayer;
|
|
428
|
+
private destroyLayer;
|
|
429
|
+
private createArrowLine;
|
|
430
|
+
private updateRuler;
|
|
336
431
|
}
|
|
337
432
|
|
|
338
433
|
interface WhiteInkItem {
|
|
@@ -383,16 +478,19 @@ declare class WhiteInkTool implements Extension {
|
|
|
383
478
|
private onToolActivated;
|
|
384
479
|
private onSceneLayoutChanged;
|
|
385
480
|
private onObjectAdded;
|
|
481
|
+
private onObjectModified;
|
|
482
|
+
private onObjectRemoved;
|
|
483
|
+
private onImageWorkingChanged;
|
|
386
484
|
private migrateLegacyConfigIfNeeded;
|
|
387
485
|
private syncToolActiveFromWorkbench;
|
|
388
486
|
private isPreviewActive;
|
|
389
487
|
private isDebugEnabled;
|
|
390
488
|
private debug;
|
|
391
489
|
private resolveSourceUrl;
|
|
392
|
-
private clampOpacity;
|
|
393
490
|
private normalizeItem;
|
|
394
491
|
private normalizeItems;
|
|
395
492
|
private cloneItems;
|
|
493
|
+
private getEffectiveWhiteInkItem;
|
|
396
494
|
private generateId;
|
|
397
495
|
private getConfig;
|
|
398
496
|
private resolveReplaceTargetId;
|
|
@@ -407,134 +505,34 @@ declare class WhiteInkTool implements Extension {
|
|
|
407
505
|
private clearWhiteInks;
|
|
408
506
|
private completeWhiteInks;
|
|
409
507
|
private getFrameRect;
|
|
410
|
-
private
|
|
411
|
-
private
|
|
412
|
-
private
|
|
413
|
-
private
|
|
508
|
+
private getImageObjects;
|
|
509
|
+
private getPrimaryImageObject;
|
|
510
|
+
private getPrimaryImageSource;
|
|
511
|
+
private getCurrentSrc;
|
|
512
|
+
private getImageSnapshot;
|
|
513
|
+
private getImageElementFromObject;
|
|
414
514
|
private rememberSourceSize;
|
|
415
515
|
private getSourceSize;
|
|
416
|
-
private
|
|
417
|
-
private
|
|
418
|
-
private
|
|
419
|
-
private
|
|
420
|
-
private
|
|
516
|
+
private computeWhiteScaleAdjust;
|
|
517
|
+
private computeCoverOpacity;
|
|
518
|
+
private buildCloneImageSpec;
|
|
519
|
+
private buildFrameSpecs;
|
|
520
|
+
private applyImageVisibilityForWhiteInk;
|
|
521
|
+
private resolveRenderItems;
|
|
522
|
+
private resolveRenderSources;
|
|
523
|
+
private resolveDefaultInsertIndex;
|
|
421
524
|
private syncZOrder;
|
|
422
|
-
private
|
|
525
|
+
private clearRenderedWhiteInks;
|
|
526
|
+
private purgeSourceCaches;
|
|
423
527
|
private updateWhiteInks;
|
|
424
528
|
private updateWhiteInksAsync;
|
|
529
|
+
private getMaskCacheKey;
|
|
425
530
|
private getPreviewMaskSource;
|
|
531
|
+
private getElementSize;
|
|
426
532
|
private createOpaqueMaskSource;
|
|
427
533
|
private loadImageElement;
|
|
428
534
|
}
|
|
429
535
|
|
|
430
|
-
declare class RulerTool implements Extension {
|
|
431
|
-
id: string;
|
|
432
|
-
metadata: {
|
|
433
|
-
name: string;
|
|
434
|
-
};
|
|
435
|
-
private thickness;
|
|
436
|
-
private gap;
|
|
437
|
-
private backgroundColor;
|
|
438
|
-
private textColor;
|
|
439
|
-
private lineColor;
|
|
440
|
-
private fontSize;
|
|
441
|
-
private canvasService?;
|
|
442
|
-
private context?;
|
|
443
|
-
private onCanvasResized;
|
|
444
|
-
constructor(options?: Partial<{
|
|
445
|
-
thickness: number;
|
|
446
|
-
backgroundColor: string;
|
|
447
|
-
textColor: string;
|
|
448
|
-
lineColor: string;
|
|
449
|
-
fontSize: number;
|
|
450
|
-
}>);
|
|
451
|
-
activate(context: ExtensionContext): void;
|
|
452
|
-
deactivate(context: ExtensionContext): void;
|
|
453
|
-
contribute(): {
|
|
454
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
455
|
-
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
456
|
-
};
|
|
457
|
-
private getLayer;
|
|
458
|
-
private createLayer;
|
|
459
|
-
private destroyLayer;
|
|
460
|
-
private createArrowLine;
|
|
461
|
-
private updateRuler;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
declare class MirrorTool implements Extension {
|
|
465
|
-
id: string;
|
|
466
|
-
metadata: {
|
|
467
|
-
name: string;
|
|
468
|
-
};
|
|
469
|
-
private enabled;
|
|
470
|
-
private canvasService?;
|
|
471
|
-
constructor(options?: Partial<{
|
|
472
|
-
enabled: boolean;
|
|
473
|
-
}>);
|
|
474
|
-
toJSON(): {
|
|
475
|
-
enabled: boolean;
|
|
476
|
-
};
|
|
477
|
-
loadFromJSON(json: any): void;
|
|
478
|
-
activate(context: ExtensionContext): void;
|
|
479
|
-
deactivate(context: ExtensionContext): void;
|
|
480
|
-
contribute(): {
|
|
481
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
482
|
-
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
483
|
-
};
|
|
484
|
-
private applyMirror;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
declare class SizeTool implements Extension {
|
|
488
|
-
id: string;
|
|
489
|
-
metadata: {
|
|
490
|
-
name: string;
|
|
491
|
-
};
|
|
492
|
-
private context?;
|
|
493
|
-
private canvasService?;
|
|
494
|
-
activate(context: ExtensionContext): void;
|
|
495
|
-
deactivate(_context: ExtensionContext): void;
|
|
496
|
-
contribute(): {
|
|
497
|
-
[ContributionPointIds.TOOLS]: {
|
|
498
|
-
id: string;
|
|
499
|
-
name: string;
|
|
500
|
-
interaction: string;
|
|
501
|
-
}[];
|
|
502
|
-
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
503
|
-
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
504
|
-
};
|
|
505
|
-
private getConfigService;
|
|
506
|
-
private ensureDefaults;
|
|
507
|
-
private emitStateChanged;
|
|
508
|
-
private getStateForUI;
|
|
509
|
-
private updateDimensions;
|
|
510
|
-
private setConstraintMode;
|
|
511
|
-
private setUnit;
|
|
512
|
-
private setCut;
|
|
513
|
-
private getSelectedImageSize;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
declare class SceneLayoutService implements Extension {
|
|
517
|
-
id: string;
|
|
518
|
-
metadata: {
|
|
519
|
-
name: string;
|
|
520
|
-
};
|
|
521
|
-
private context?;
|
|
522
|
-
private canvasService?;
|
|
523
|
-
private configService?;
|
|
524
|
-
private lastLayout;
|
|
525
|
-
private lastGeometry;
|
|
526
|
-
private onConfigChange?;
|
|
527
|
-
activate(context: ExtensionContext): void;
|
|
528
|
-
deactivate(context: ExtensionContext): void;
|
|
529
|
-
contribute(): {
|
|
530
|
-
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
531
|
-
};
|
|
532
|
-
private onCanvasResized;
|
|
533
|
-
private refresh;
|
|
534
|
-
private getLayout;
|
|
535
|
-
private getGeometry;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
536
|
declare class ViewportSystem {
|
|
539
537
|
private _containerSize;
|
|
540
538
|
private _physicalSize;
|
|
@@ -602,21 +600,7 @@ declare class CanvasService implements Service {
|
|
|
602
600
|
private createFabricObject;
|
|
603
601
|
}
|
|
604
602
|
|
|
605
|
-
type SizeConstraintMode = "free" | "lockAspect" | "equal";
|
|
606
603
|
type CutMode = "trim" | "outset" | "inset";
|
|
607
|
-
interface SizeState {
|
|
608
|
-
unit: Unit;
|
|
609
|
-
actualWidthMm: number;
|
|
610
|
-
actualHeightMm: number;
|
|
611
|
-
constraintMode: SizeConstraintMode;
|
|
612
|
-
aspectRatio: number;
|
|
613
|
-
cutMode: CutMode;
|
|
614
|
-
cutMarginMm: number;
|
|
615
|
-
viewPadding: number | string;
|
|
616
|
-
minMm: number;
|
|
617
|
-
maxMm: number;
|
|
618
|
-
stepMm: number;
|
|
619
|
-
}
|
|
620
604
|
interface SceneRect {
|
|
621
605
|
left: number;
|
|
622
606
|
top: number;
|
|
@@ -652,36 +636,33 @@ interface SceneGeometrySnapshot {
|
|
|
652
636
|
scale: number;
|
|
653
637
|
pathData?: string;
|
|
654
638
|
}
|
|
655
|
-
declare function sanitizeMmValue(valueMm: number, limits: {
|
|
656
|
-
minMm: number;
|
|
657
|
-
maxMm: number;
|
|
658
|
-
stepMm: number;
|
|
659
|
-
}): number;
|
|
660
|
-
declare function normalizeUnit(value: unknown): Unit;
|
|
661
|
-
declare function normalizeConstraintMode(value: unknown): SizeConstraintMode;
|
|
662
|
-
declare function normalizeCutMode(value: unknown): CutMode;
|
|
663
|
-
declare function toMm(value: number, fromUnit: Unit): number;
|
|
664
|
-
declare function fromMm(valueMm: number, toUnit: Unit): number;
|
|
665
|
-
declare function resolvePaddingPx(raw: number | string, containerWidth: number, containerHeight: number): number;
|
|
666
|
-
declare function readSizeState(configService: ConfigurationService): SizeState;
|
|
667
|
-
declare function computeSceneLayout(canvasService: CanvasService, size: SizeState): SceneLayoutSnapshot | null;
|
|
668
|
-
declare function buildSceneGeometry(configService: ConfigurationService, layout: SceneLayoutSnapshot): SceneGeometrySnapshot;
|
|
669
639
|
|
|
670
|
-
declare class
|
|
671
|
-
|
|
672
|
-
metadata: {
|
|
673
|
-
name: string;
|
|
674
|
-
};
|
|
640
|
+
declare class SceneLayoutService implements Service {
|
|
641
|
+
private context?;
|
|
675
642
|
private canvasService?;
|
|
643
|
+
private configService?;
|
|
644
|
+
private lastLayout;
|
|
645
|
+
private lastGeometry;
|
|
646
|
+
private onConfigChange?;
|
|
647
|
+
private commandDisposables;
|
|
648
|
+
init(context: ServiceContext): void;
|
|
649
|
+
dispose(context: ServiceContext): void;
|
|
650
|
+
private onCanvasResized;
|
|
651
|
+
private onConfigChanged;
|
|
652
|
+
private refresh;
|
|
653
|
+
getLayout(forceRefresh?: boolean): SceneLayoutSnapshot | null;
|
|
654
|
+
getGeometry(forceRefresh?: boolean): SceneGeometrySnapshot | null;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
declare class SceneVisibilityService implements Service {
|
|
658
|
+
private context?;
|
|
676
659
|
private activeToolId;
|
|
677
|
-
|
|
678
|
-
|
|
660
|
+
private canvasService?;
|
|
661
|
+
init(context: ServiceContext): void;
|
|
662
|
+
dispose(context: ServiceContext): void;
|
|
679
663
|
private onToolActivated;
|
|
680
664
|
private onObjectAdded;
|
|
681
665
|
private apply;
|
|
682
666
|
}
|
|
683
667
|
|
|
684
|
-
|
|
685
|
-
declare function formatMm(valueMm: number, displayUnit: Unit, fractionDigits?: number): string;
|
|
686
|
-
|
|
687
|
-
export { BackgroundTool, CanvasService, type CutMode, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LineStyle, MirrorTool, RulerTool, type SceneGeometrySnapshot, SceneLayoutService, type SceneLayoutSnapshot, type SceneRect, SceneVisibilityService, type SizeConstraintMode, type SizeState, SizeTool, type WhiteInkItem, WhiteInkTool, buildSceneGeometry, computeSceneLayout, formatMm, fromMm, normalizeConstraintMode, normalizeCutMode, normalizeUnit, parseLengthToMm, readSizeState, resolvePaddingPx, sanitizeMmValue, toMm };
|
|
668
|
+
export { BackgroundTool, CanvasService, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LineStyle, MirrorTool, type RenderLayerSpec, type RenderObjectSpec, type RenderObjectType, type RenderProps, RulerTool, SceneLayoutService, SceneVisibilityService, SizeTool, ViewportSystem, type WhiteInkItem, WhiteInkTool };
|