@pooder/kit 4.3.1 → 5.0.1
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/.test-dist/src/CanvasService.js +249 -0
- package/.test-dist/src/ViewportSystem.js +75 -0
- package/.test-dist/src/background.js +203 -0
- package/.test-dist/src/bridgeSelection.js +20 -0
- package/.test-dist/src/constraints.js +237 -0
- package/.test-dist/src/coordinate.js +74 -0
- package/.test-dist/src/dieline.js +818 -0
- package/.test-dist/src/edgeScale.js +12 -0
- package/.test-dist/src/feature.js +754 -0
- package/.test-dist/src/featureComplete.js +32 -0
- package/.test-dist/src/film.js +167 -0
- package/.test-dist/src/geometry.js +506 -0
- package/.test-dist/src/image.js +1234 -0
- package/.test-dist/src/index.js +35 -0
- package/.test-dist/src/maskOps.js +270 -0
- package/.test-dist/src/mirror.js +104 -0
- package/.test-dist/src/renderSpec.js +2 -0
- package/.test-dist/src/ruler.js +343 -0
- package/.test-dist/src/sceneLayout.js +99 -0
- package/.test-dist/src/sceneLayoutModel.js +196 -0
- package/.test-dist/src/sceneView.js +40 -0
- package/.test-dist/src/sceneVisibility.js +42 -0
- package/.test-dist/src/size.js +332 -0
- package/.test-dist/src/tracer.js +544 -0
- package/.test-dist/src/units.js +30 -0
- package/.test-dist/src/white-ink.js +829 -0
- package/.test-dist/src/wrappedOffsets.js +33 -0
- package/.test-dist/tests/run.js +94 -0
- package/CHANGELOG.md +17 -0
- package/dist/index.d.mts +342 -37
- package/dist/index.d.ts +342 -37
- package/dist/index.js +3679 -865
- package/dist/index.mjs +3673 -868
- package/package.json +2 -2
- package/src/CanvasService.ts +300 -96
- package/src/ViewportSystem.ts +92 -92
- package/src/background.ts +230 -230
- package/src/bridgeSelection.ts +17 -0
- package/src/coordinate.ts +106 -106
- package/src/dieline.ts +1005 -973
- package/src/edgeScale.ts +19 -0
- package/src/feature.ts +83 -30
- package/src/film.ts +194 -194
- package/src/geometry.ts +242 -84
- package/src/image.ts +1582 -512
- package/src/index.ts +14 -10
- package/src/maskOps.ts +326 -0
- package/src/mirror.ts +128 -128
- package/src/renderSpec.ts +18 -0
- package/src/ruler.ts +449 -508
- package/src/sceneLayout.ts +121 -0
- package/src/sceneLayoutModel.ts +335 -0
- package/src/sceneVisibility.ts +49 -0
- package/src/size.ts +379 -0
- package/src/tracer.ts +719 -570
- package/src/units.ts +27 -27
- package/src/white-ink.ts +1018 -373
- package/src/wrappedOffsets.ts +33 -0
- package/tests/run.ts +118 -0
- package/tsconfig.test.json +15 -15
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus } from '@pooder/core';
|
|
1
|
+
import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, EventBus, ConfigurationService } from '@pooder/core';
|
|
2
2
|
import { Canvas, Group, FabricObject } from 'fabric';
|
|
3
3
|
|
|
4
4
|
declare class BackgroundTool implements Extension {
|
|
@@ -107,10 +107,20 @@ declare class DielineTool implements Extension {
|
|
|
107
107
|
private state;
|
|
108
108
|
private canvasService?;
|
|
109
109
|
private context?;
|
|
110
|
+
private onCanvasResized;
|
|
110
111
|
constructor(options?: Partial<DielineState>);
|
|
111
112
|
activate(context: ExtensionContext): void;
|
|
112
113
|
deactivate(context: ExtensionContext): void;
|
|
113
114
|
contribute(): {
|
|
115
|
+
[ContributionPointIds.TOOLS]: {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
interaction: string;
|
|
119
|
+
session: {
|
|
120
|
+
autoBegin: boolean;
|
|
121
|
+
leavePolicy: string;
|
|
122
|
+
};
|
|
123
|
+
}[];
|
|
114
124
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
115
125
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
116
126
|
};
|
|
@@ -118,10 +128,14 @@ declare class DielineTool implements Extension {
|
|
|
118
128
|
private createLayer;
|
|
119
129
|
private destroyLayer;
|
|
120
130
|
private createHatchPattern;
|
|
121
|
-
private
|
|
122
|
-
|
|
131
|
+
private getConfigService;
|
|
132
|
+
private syncSizeState;
|
|
133
|
+
private bringFeatureMarkersToFront;
|
|
134
|
+
updateDieline(_emitEvent?: boolean): void;
|
|
123
135
|
getGeometry(): DielineGeometry | null;
|
|
124
|
-
exportCutImage(
|
|
136
|
+
exportCutImage(options?: {
|
|
137
|
+
debug?: boolean;
|
|
138
|
+
}): Promise<string | null>;
|
|
125
139
|
}
|
|
126
140
|
|
|
127
141
|
declare class FilmTool implements Extension {
|
|
@@ -164,9 +178,11 @@ declare class FeatureTool implements Extension {
|
|
|
164
178
|
private context?;
|
|
165
179
|
private isUpdatingConfig;
|
|
166
180
|
private isToolActive;
|
|
181
|
+
private hasWorkingChanges;
|
|
182
|
+
private dirtyTrackerDisposable?;
|
|
167
183
|
private handleMoving;
|
|
168
184
|
private handleModified;
|
|
169
|
-
private
|
|
185
|
+
private handleSceneGeometryChange;
|
|
170
186
|
private currentGeometry;
|
|
171
187
|
constructor(options?: Partial<{
|
|
172
188
|
features: ConstraintFeature[];
|
|
@@ -176,6 +192,20 @@ declare class FeatureTool implements Extension {
|
|
|
176
192
|
private onToolActivated;
|
|
177
193
|
private updateVisibility;
|
|
178
194
|
contribute(): {
|
|
195
|
+
[ContributionPointIds.TOOLS]: {
|
|
196
|
+
id: string;
|
|
197
|
+
name: string;
|
|
198
|
+
interaction: string;
|
|
199
|
+
commands: {
|
|
200
|
+
begin: string;
|
|
201
|
+
commit: string;
|
|
202
|
+
rollback: string;
|
|
203
|
+
};
|
|
204
|
+
session: {
|
|
205
|
+
autoBegin: boolean;
|
|
206
|
+
leavePolicy: string;
|
|
207
|
+
};
|
|
208
|
+
}[];
|
|
179
209
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
180
210
|
};
|
|
181
211
|
private cloneFeatures;
|
|
@@ -203,6 +233,8 @@ interface ImageItem {
|
|
|
203
233
|
angle?: number;
|
|
204
234
|
left?: number;
|
|
205
235
|
top?: number;
|
|
236
|
+
sourceUrl?: string;
|
|
237
|
+
committedUrl?: string;
|
|
206
238
|
}
|
|
207
239
|
declare class ImageTool implements Extension {
|
|
208
240
|
id: string;
|
|
@@ -210,59 +242,182 @@ declare class ImageTool implements Extension {
|
|
|
210
242
|
name: string;
|
|
211
243
|
};
|
|
212
244
|
private items;
|
|
213
|
-
private
|
|
245
|
+
private workingItems;
|
|
246
|
+
private hasWorkingChanges;
|
|
214
247
|
private loadResolvers;
|
|
248
|
+
private sourceSizeBySrc;
|
|
215
249
|
private canvasService?;
|
|
216
250
|
private context?;
|
|
217
251
|
private isUpdatingConfig;
|
|
218
252
|
private isToolActive;
|
|
253
|
+
private isImageSelectionActive;
|
|
254
|
+
private focusedImageId;
|
|
255
|
+
private suppressSelectionClearUntil;
|
|
256
|
+
private renderSeq;
|
|
257
|
+
private dirtyTrackerDisposable?;
|
|
219
258
|
activate(context: ExtensionContext): void;
|
|
220
259
|
deactivate(context: ExtensionContext): void;
|
|
221
260
|
private onToolActivated;
|
|
222
|
-
private
|
|
261
|
+
private onSelectionChanged;
|
|
262
|
+
private onSelectionCleared;
|
|
263
|
+
private onSceneLayoutChanged;
|
|
264
|
+
private syncToolActiveFromWorkbench;
|
|
265
|
+
private isImageEditingVisible;
|
|
266
|
+
private isDebugEnabled;
|
|
267
|
+
private debug;
|
|
223
268
|
contribute(): {
|
|
269
|
+
[ContributionPointIds.TOOLS]: {
|
|
270
|
+
id: string;
|
|
271
|
+
name: string;
|
|
272
|
+
interaction: string;
|
|
273
|
+
commands: {
|
|
274
|
+
begin: string;
|
|
275
|
+
commit: string;
|
|
276
|
+
rollback: string;
|
|
277
|
+
};
|
|
278
|
+
session: {
|
|
279
|
+
autoBegin: boolean;
|
|
280
|
+
leavePolicy: string;
|
|
281
|
+
};
|
|
282
|
+
}[];
|
|
224
283
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
225
284
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
226
285
|
};
|
|
286
|
+
private normalizeItem;
|
|
287
|
+
private normalizeItems;
|
|
288
|
+
private cloneItems;
|
|
227
289
|
private generateId;
|
|
290
|
+
private getImageIdFromActiveObject;
|
|
291
|
+
private resolveReplaceTargetId;
|
|
292
|
+
private addImageEntry;
|
|
293
|
+
private upsertImageEntry;
|
|
294
|
+
private addItemToWorkingSessionIfNeeded;
|
|
295
|
+
private updateImage;
|
|
296
|
+
private getConfig;
|
|
228
297
|
private updateConfig;
|
|
229
|
-
private
|
|
230
|
-
private
|
|
298
|
+
private getFrameRect;
|
|
299
|
+
private resolveDefaultFitArea;
|
|
300
|
+
private fitImageToDefaultArea;
|
|
301
|
+
private getImageObjects;
|
|
302
|
+
private getOverlayObjects;
|
|
303
|
+
private getImageObject;
|
|
304
|
+
private clearRenderedImages;
|
|
305
|
+
private purgeSourceSizeCacheForItem;
|
|
306
|
+
private rememberSourceSize;
|
|
307
|
+
private getSourceSize;
|
|
308
|
+
private getCoverScale;
|
|
309
|
+
private getFrameVisualConfig;
|
|
310
|
+
private resolveRenderImageState;
|
|
311
|
+
private computeCanvasProps;
|
|
312
|
+
private getCurrentSrc;
|
|
313
|
+
private upsertImageObject;
|
|
314
|
+
private syncImageZOrder;
|
|
315
|
+
private buildOverlaySpecs;
|
|
231
316
|
private updateImages;
|
|
232
|
-
private
|
|
233
|
-
private
|
|
234
|
-
private
|
|
317
|
+
private updateImagesAsync;
|
|
318
|
+
private clampNormalized;
|
|
319
|
+
private onObjectModified;
|
|
320
|
+
private updateImageInWorking;
|
|
235
321
|
private updateImageInConfig;
|
|
322
|
+
private waitImageLoaded;
|
|
323
|
+
private refitImageToFrame;
|
|
324
|
+
private focusImageSelection;
|
|
325
|
+
private fitImageToArea;
|
|
326
|
+
private commitWorkingImagesAsCropped;
|
|
327
|
+
private exportCroppedImageByIds;
|
|
328
|
+
private exportImageFrameUrl;
|
|
236
329
|
}
|
|
237
330
|
|
|
331
|
+
interface WhiteInkItem {
|
|
332
|
+
id: string;
|
|
333
|
+
sourceUrl?: string;
|
|
334
|
+
url?: string;
|
|
335
|
+
opacity: number;
|
|
336
|
+
}
|
|
238
337
|
declare class WhiteInkTool implements Extension {
|
|
239
338
|
id: string;
|
|
240
339
|
metadata: {
|
|
241
340
|
name: string;
|
|
242
341
|
};
|
|
243
|
-
private
|
|
244
|
-
private
|
|
245
|
-
private
|
|
342
|
+
private items;
|
|
343
|
+
private workingItems;
|
|
344
|
+
private hasWorkingChanges;
|
|
345
|
+
private sourceSizeBySrc;
|
|
346
|
+
private previewMaskBySource;
|
|
347
|
+
private pendingPreviewMaskBySource;
|
|
246
348
|
private canvasService?;
|
|
247
|
-
private
|
|
248
|
-
private
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
349
|
+
private context?;
|
|
350
|
+
private isUpdatingConfig;
|
|
351
|
+
private isToolActive;
|
|
352
|
+
private printWithWhiteInk;
|
|
353
|
+
private previewImageVisible;
|
|
354
|
+
private renderSeq;
|
|
355
|
+
private dirtyTrackerDisposable?;
|
|
254
356
|
activate(context: ExtensionContext): void;
|
|
255
357
|
deactivate(context: ExtensionContext): void;
|
|
256
358
|
contribute(): {
|
|
359
|
+
[ContributionPointIds.TOOLS]: {
|
|
360
|
+
id: string;
|
|
361
|
+
name: string;
|
|
362
|
+
interaction: string;
|
|
363
|
+
commands: {
|
|
364
|
+
begin: string;
|
|
365
|
+
commit: string;
|
|
366
|
+
rollback: string;
|
|
367
|
+
};
|
|
368
|
+
session: {
|
|
369
|
+
autoBegin: boolean;
|
|
370
|
+
leavePolicy: string;
|
|
371
|
+
};
|
|
372
|
+
}[];
|
|
257
373
|
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
258
374
|
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
259
375
|
};
|
|
260
|
-
private
|
|
261
|
-
private
|
|
262
|
-
private
|
|
263
|
-
private
|
|
264
|
-
private
|
|
265
|
-
private
|
|
376
|
+
private onToolActivated;
|
|
377
|
+
private onSceneLayoutChanged;
|
|
378
|
+
private onObjectAdded;
|
|
379
|
+
private migrateLegacyConfigIfNeeded;
|
|
380
|
+
private syncToolActiveFromWorkbench;
|
|
381
|
+
private isPreviewActive;
|
|
382
|
+
private isDebugEnabled;
|
|
383
|
+
private debug;
|
|
384
|
+
private resolveSourceUrl;
|
|
385
|
+
private clampOpacity;
|
|
386
|
+
private normalizeItem;
|
|
387
|
+
private normalizeItems;
|
|
388
|
+
private cloneItems;
|
|
389
|
+
private generateId;
|
|
390
|
+
private getConfig;
|
|
391
|
+
private resolveReplaceTargetId;
|
|
392
|
+
private updateConfig;
|
|
393
|
+
private addWhiteInkEntry;
|
|
394
|
+
private upsertWhiteInkEntry;
|
|
395
|
+
private addItemToWorkingSessionIfNeeded;
|
|
396
|
+
private updateWhiteInkItem;
|
|
397
|
+
private updateWhiteInkInWorking;
|
|
398
|
+
private updateWhiteInkInConfig;
|
|
399
|
+
private removeWhiteInk;
|
|
400
|
+
private clearWhiteInks;
|
|
401
|
+
private completeWhiteInks;
|
|
402
|
+
private getFrameRect;
|
|
403
|
+
private getWhiteInkObjects;
|
|
404
|
+
private getWhiteInkObject;
|
|
405
|
+
private clearRenderedWhiteInks;
|
|
406
|
+
private purgeSourceCaches;
|
|
407
|
+
private rememberSourceSize;
|
|
408
|
+
private getSourceSize;
|
|
409
|
+
private getCoverScale;
|
|
410
|
+
private resolveRenderState;
|
|
411
|
+
private computeCanvasProps;
|
|
412
|
+
private getCurrentSrc;
|
|
413
|
+
private upsertWhiteInkObject;
|
|
414
|
+
private syncZOrder;
|
|
415
|
+
private applyImagePreviewVisibility;
|
|
416
|
+
private updateWhiteInks;
|
|
417
|
+
private updateWhiteInksAsync;
|
|
418
|
+
private getPreviewMaskSource;
|
|
419
|
+
private createOpaqueMaskSource;
|
|
420
|
+
private loadImageElement;
|
|
266
421
|
}
|
|
267
422
|
|
|
268
423
|
declare class RulerTool implements Extension {
|
|
@@ -276,12 +431,9 @@ declare class RulerTool implements Extension {
|
|
|
276
431
|
private textColor;
|
|
277
432
|
private lineColor;
|
|
278
433
|
private fontSize;
|
|
279
|
-
private dielineWidth;
|
|
280
|
-
private dielineHeight;
|
|
281
|
-
private dielineDisplayUnit;
|
|
282
|
-
private dielinePadding;
|
|
283
|
-
private dielineOffset;
|
|
284
434
|
private canvasService?;
|
|
435
|
+
private context?;
|
|
436
|
+
private onCanvasResized;
|
|
285
437
|
constructor(options?: Partial<{
|
|
286
438
|
thickness: number;
|
|
287
439
|
backgroundColor: string;
|
|
@@ -299,7 +451,6 @@ declare class RulerTool implements Extension {
|
|
|
299
451
|
private createLayer;
|
|
300
452
|
private destroyLayer;
|
|
301
453
|
private createArrowLine;
|
|
302
|
-
private resolvePadding;
|
|
303
454
|
private updateRuler;
|
|
304
455
|
}
|
|
305
456
|
|
|
@@ -326,8 +477,56 @@ declare class MirrorTool implements Extension {
|
|
|
326
477
|
private applyMirror;
|
|
327
478
|
}
|
|
328
479
|
|
|
329
|
-
declare
|
|
330
|
-
|
|
480
|
+
declare class SizeTool implements Extension {
|
|
481
|
+
id: string;
|
|
482
|
+
metadata: {
|
|
483
|
+
name: string;
|
|
484
|
+
};
|
|
485
|
+
private context?;
|
|
486
|
+
private canvasService?;
|
|
487
|
+
activate(context: ExtensionContext): void;
|
|
488
|
+
deactivate(_context: ExtensionContext): void;
|
|
489
|
+
contribute(): {
|
|
490
|
+
[ContributionPointIds.TOOLS]: {
|
|
491
|
+
id: string;
|
|
492
|
+
name: string;
|
|
493
|
+
interaction: string;
|
|
494
|
+
}[];
|
|
495
|
+
[ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
|
|
496
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
497
|
+
};
|
|
498
|
+
private getConfigService;
|
|
499
|
+
private ensureDefaults;
|
|
500
|
+
private emitStateChanged;
|
|
501
|
+
private getStateForUI;
|
|
502
|
+
private updateDimensions;
|
|
503
|
+
private setConstraintMode;
|
|
504
|
+
private setUnit;
|
|
505
|
+
private setCut;
|
|
506
|
+
private getSelectedImageSize;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
declare class SceneLayoutService implements Extension {
|
|
510
|
+
id: string;
|
|
511
|
+
metadata: {
|
|
512
|
+
name: string;
|
|
513
|
+
};
|
|
514
|
+
private context?;
|
|
515
|
+
private canvasService?;
|
|
516
|
+
private configService?;
|
|
517
|
+
private lastLayout;
|
|
518
|
+
private lastGeometry;
|
|
519
|
+
private onConfigChange?;
|
|
520
|
+
activate(context: ExtensionContext): void;
|
|
521
|
+
deactivate(context: ExtensionContext): void;
|
|
522
|
+
contribute(): {
|
|
523
|
+
[ContributionPointIds.COMMANDS]: CommandContribution[];
|
|
524
|
+
};
|
|
525
|
+
private onCanvasResized;
|
|
526
|
+
private refresh;
|
|
527
|
+
private getLayout;
|
|
528
|
+
private getGeometry;
|
|
529
|
+
}
|
|
331
530
|
|
|
332
531
|
declare class ViewportSystem {
|
|
333
532
|
private _containerSize;
|
|
@@ -348,6 +547,21 @@ declare class ViewportSystem {
|
|
|
348
547
|
toPhysicalPoint(point: Point): Point;
|
|
349
548
|
}
|
|
350
549
|
|
|
550
|
+
type RenderObjectType = "rect" | "image" | "path";
|
|
551
|
+
type RenderProps = Record<string, any>;
|
|
552
|
+
interface RenderObjectSpec {
|
|
553
|
+
id: string;
|
|
554
|
+
type: RenderObjectType;
|
|
555
|
+
props: RenderProps;
|
|
556
|
+
data?: Record<string, any>;
|
|
557
|
+
src?: string;
|
|
558
|
+
}
|
|
559
|
+
interface RenderLayerSpec {
|
|
560
|
+
id: string;
|
|
561
|
+
objects: RenderObjectSpec[];
|
|
562
|
+
props?: RenderProps;
|
|
563
|
+
}
|
|
564
|
+
|
|
351
565
|
declare class CanvasService implements Service {
|
|
352
566
|
canvas: Canvas;
|
|
353
567
|
viewport: ViewportSystem;
|
|
@@ -370,6 +584,97 @@ declare class CanvasService implements Service {
|
|
|
370
584
|
*/
|
|
371
585
|
getObject(id: string, layerId?: string): FabricObject | undefined;
|
|
372
586
|
requestRenderAll(): void;
|
|
587
|
+
resize(width: number, height: number): void;
|
|
588
|
+
applyLayerSpec(spec: RenderLayerSpec): Promise<void>;
|
|
589
|
+
applyObjectSpecsToLayer(layerId: string, objects: RenderObjectSpec[]): Promise<void>;
|
|
590
|
+
getRootLayerObjects(layerId: string): FabricObject[];
|
|
591
|
+
applyObjectSpecsToRootLayer(layerId: string, specs: RenderObjectSpec[]): Promise<void>;
|
|
592
|
+
private applyObjectSpecsToContainer;
|
|
593
|
+
private patchFabricObject;
|
|
594
|
+
private moveObjectInContainer;
|
|
595
|
+
private createFabricObject;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
type SizeConstraintMode = "free" | "lockAspect" | "equal";
|
|
599
|
+
type CutMode = "trim" | "outset" | "inset";
|
|
600
|
+
interface SizeState {
|
|
601
|
+
unit: Unit;
|
|
602
|
+
actualWidthMm: number;
|
|
603
|
+
actualHeightMm: number;
|
|
604
|
+
constraintMode: SizeConstraintMode;
|
|
605
|
+
aspectRatio: number;
|
|
606
|
+
cutMode: CutMode;
|
|
607
|
+
cutMarginMm: number;
|
|
608
|
+
viewPadding: number | string;
|
|
609
|
+
minMm: number;
|
|
610
|
+
maxMm: number;
|
|
611
|
+
stepMm: number;
|
|
612
|
+
}
|
|
613
|
+
interface SceneRect {
|
|
614
|
+
left: number;
|
|
615
|
+
top: number;
|
|
616
|
+
width: number;
|
|
617
|
+
height: number;
|
|
618
|
+
centerX: number;
|
|
619
|
+
centerY: number;
|
|
620
|
+
}
|
|
621
|
+
interface SceneLayoutSnapshot {
|
|
622
|
+
scale: number;
|
|
623
|
+
canvasWidth: number;
|
|
624
|
+
canvasHeight: number;
|
|
625
|
+
trimRect: SceneRect;
|
|
626
|
+
cutRect: SceneRect;
|
|
627
|
+
bleedRect: SceneRect;
|
|
628
|
+
trimWidthMm: number;
|
|
629
|
+
trimHeightMm: number;
|
|
630
|
+
cutWidthMm: number;
|
|
631
|
+
cutHeightMm: number;
|
|
632
|
+
cutMode: CutMode;
|
|
633
|
+
cutMarginMm: number;
|
|
634
|
+
}
|
|
635
|
+
interface SceneGeometrySnapshot {
|
|
636
|
+
shape: "rect" | "circle" | "ellipse" | "custom";
|
|
637
|
+
unit: "mm";
|
|
638
|
+
displayUnit: Unit;
|
|
639
|
+
x: number;
|
|
640
|
+
y: number;
|
|
641
|
+
width: number;
|
|
642
|
+
height: number;
|
|
643
|
+
radius: number;
|
|
644
|
+
offset: number;
|
|
645
|
+
scale: number;
|
|
646
|
+
pathData?: string;
|
|
647
|
+
}
|
|
648
|
+
declare function sanitizeMmValue(valueMm: number, limits: {
|
|
649
|
+
minMm: number;
|
|
650
|
+
maxMm: number;
|
|
651
|
+
stepMm: number;
|
|
652
|
+
}): number;
|
|
653
|
+
declare function normalizeUnit(value: unknown): Unit;
|
|
654
|
+
declare function normalizeConstraintMode(value: unknown): SizeConstraintMode;
|
|
655
|
+
declare function normalizeCutMode(value: unknown): CutMode;
|
|
656
|
+
declare function toMm(value: number, fromUnit: Unit): number;
|
|
657
|
+
declare function fromMm(valueMm: number, toUnit: Unit): number;
|
|
658
|
+
declare function resolvePaddingPx(raw: number | string, containerWidth: number, containerHeight: number): number;
|
|
659
|
+
declare function readSizeState(configService: ConfigurationService): SizeState;
|
|
660
|
+
declare function computeSceneLayout(canvasService: CanvasService, size: SizeState): SceneLayoutSnapshot | null;
|
|
661
|
+
declare function buildSceneGeometry(configService: ConfigurationService, layout: SceneLayoutSnapshot): SceneGeometrySnapshot;
|
|
662
|
+
|
|
663
|
+
declare class SceneVisibilityService implements Extension {
|
|
664
|
+
id: string;
|
|
665
|
+
metadata: {
|
|
666
|
+
name: string;
|
|
667
|
+
};
|
|
668
|
+
private canvasService?;
|
|
669
|
+
private activeToolId;
|
|
670
|
+
activate(context: ExtensionContext): void;
|
|
671
|
+
deactivate(context: ExtensionContext): void;
|
|
672
|
+
private onToolActivated;
|
|
673
|
+
private onObjectAdded;
|
|
674
|
+
private apply;
|
|
373
675
|
}
|
|
374
676
|
|
|
375
|
-
|
|
677
|
+
declare function parseLengthToMm(input: number | string, defaultUnit: Unit): number;
|
|
678
|
+
declare function formatMm(valueMm: number, displayUnit: Unit, fractionDigits?: number): string;
|
|
679
|
+
|
|
680
|
+
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 };
|