@pooder/kit 6.0.1 → 6.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.
Files changed (91) hide show
  1. package/.test-dist/src/extensions/background/BackgroundTool.js +524 -0
  2. package/.test-dist/src/extensions/background/index.js +17 -0
  3. package/.test-dist/src/extensions/dieline/DielineTool.js +748 -0
  4. package/.test-dist/src/extensions/dieline/commands.js +127 -0
  5. package/.test-dist/src/extensions/dieline/config.js +107 -0
  6. package/.test-dist/src/extensions/dieline/index.js +21 -0
  7. package/.test-dist/src/extensions/dieline/model.js +2 -0
  8. package/.test-dist/src/extensions/dieline/renderer.js +2 -0
  9. package/.test-dist/src/extensions/feature/FeatureTool.js +914 -0
  10. package/.test-dist/src/extensions/feature/index.js +17 -0
  11. package/.test-dist/src/extensions/film/FilmTool.js +207 -0
  12. package/.test-dist/src/extensions/film/index.js +17 -0
  13. package/.test-dist/src/extensions/image/ImageTool.js +1499 -0
  14. package/.test-dist/src/extensions/image/commands.js +162 -0
  15. package/.test-dist/src/extensions/image/config.js +129 -0
  16. package/.test-dist/src/extensions/image/index.js +21 -0
  17. package/.test-dist/src/extensions/image/model.js +2 -0
  18. package/.test-dist/src/extensions/image/renderer.js +5 -0
  19. package/.test-dist/src/extensions/mirror/MirrorTool.js +104 -0
  20. package/.test-dist/src/extensions/mirror/index.js +17 -0
  21. package/.test-dist/src/extensions/ruler/RulerTool.js +442 -0
  22. package/.test-dist/src/extensions/ruler/index.js +17 -0
  23. package/.test-dist/src/extensions/sceneLayout.js +2 -93
  24. package/.test-dist/src/extensions/sceneLayoutModel.js +15 -200
  25. package/.test-dist/src/extensions/size/SizeTool.js +332 -0
  26. package/.test-dist/src/extensions/size/index.js +17 -0
  27. package/.test-dist/src/extensions/white-ink/WhiteInkTool.js +1003 -0
  28. package/.test-dist/src/extensions/white-ink/commands.js +148 -0
  29. package/.test-dist/src/extensions/white-ink/config.js +31 -0
  30. package/.test-dist/src/extensions/white-ink/index.js +21 -0
  31. package/.test-dist/src/extensions/white-ink/model.js +2 -0
  32. package/.test-dist/src/extensions/white-ink/renderer.js +5 -0
  33. package/.test-dist/src/services/SceneLayoutService.js +96 -0
  34. package/.test-dist/src/services/index.js +1 -0
  35. package/.test-dist/src/shared/constants/layers.js +25 -0
  36. package/.test-dist/src/shared/imaging/sourceSizeCache.js +82 -0
  37. package/.test-dist/src/shared/index.js +22 -0
  38. package/.test-dist/src/shared/runtime/sessionState.js +74 -0
  39. package/.test-dist/src/shared/runtime/subscriptions.js +30 -0
  40. package/.test-dist/src/shared/scene/frame.js +34 -0
  41. package/.test-dist/src/shared/scene/sceneLayoutModel.js +202 -0
  42. package/.test-dist/tests/run.js +116 -0
  43. package/CHANGELOG.md +6 -0
  44. package/dist/index.d.mts +390 -367
  45. package/dist/index.d.ts +390 -367
  46. package/dist/index.js +5138 -4927
  47. package/dist/index.mjs +1149 -1977
  48. package/dist/tracer-PO7CRBYY.mjs +1016 -0
  49. package/package.json +1 -1
  50. package/src/extensions/{background.ts → background/BackgroundTool.ts} +33 -50
  51. package/src/extensions/background/index.ts +1 -0
  52. package/src/extensions/{dieline.ts → dieline/DielineTool.ts} +14 -218
  53. package/src/extensions/dieline/commands.ts +109 -0
  54. package/src/extensions/dieline/config.ts +106 -0
  55. package/src/extensions/dieline/index.ts +5 -0
  56. package/src/extensions/dieline/model.ts +1 -0
  57. package/src/extensions/dieline/renderer.ts +1 -0
  58. package/src/extensions/{feature.ts → feature/FeatureTool.ts} +27 -21
  59. package/src/extensions/feature/index.ts +1 -0
  60. package/src/extensions/{film.ts → film/FilmTool.ts} +36 -48
  61. package/src/extensions/film/index.ts +1 -0
  62. package/src/extensions/{image.ts → image/ImageTool.ts} +123 -402
  63. package/src/extensions/image/commands.ts +176 -0
  64. package/src/extensions/image/config.ts +128 -0
  65. package/src/extensions/image/index.ts +5 -0
  66. package/src/extensions/image/model.ts +1 -0
  67. package/src/extensions/image/renderer.ts +1 -0
  68. package/src/extensions/{mirror.ts → mirror/MirrorTool.ts} +1 -1
  69. package/src/extensions/mirror/index.ts +1 -0
  70. package/src/extensions/{ruler.ts → ruler/RulerTool.ts} +4 -5
  71. package/src/extensions/ruler/index.ts +1 -0
  72. package/src/extensions/sceneLayout.ts +1 -140
  73. package/src/extensions/sceneLayoutModel.ts +1 -364
  74. package/src/extensions/{size.ts → size/SizeTool.ts} +7 -6
  75. package/src/extensions/size/index.ts +1 -0
  76. package/src/extensions/{white-ink.ts → white-ink/WhiteInkTool.ts} +130 -317
  77. package/src/extensions/white-ink/commands.ts +157 -0
  78. package/src/extensions/white-ink/config.ts +30 -0
  79. package/src/extensions/white-ink/index.ts +5 -0
  80. package/src/extensions/white-ink/model.ts +1 -0
  81. package/src/extensions/white-ink/renderer.ts +1 -0
  82. package/src/services/SceneLayoutService.ts +139 -0
  83. package/src/services/index.ts +1 -0
  84. package/src/shared/constants/layers.ts +23 -0
  85. package/src/shared/imaging/sourceSizeCache.ts +103 -0
  86. package/src/shared/index.ts +6 -0
  87. package/src/shared/runtime/sessionState.ts +105 -0
  88. package/src/shared/runtime/subscriptions.ts +45 -0
  89. package/src/shared/scene/frame.ts +46 -0
  90. package/src/shared/scene/sceneLayoutModel.ts +367 -0
  91. package/tests/run.ts +146 -0
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as _pooder_core from '@pooder/core';
1
2
  import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, ServiceContext, EventBus } from '@pooder/core';
2
3
  import { Canvas, FabricObject } from 'fabric';
3
4
 
@@ -29,11 +30,10 @@ declare class BackgroundTool implements Extension {
29
30
  private configService?;
30
31
  private specs;
31
32
  private renderProducerDisposable?;
32
- private configChangeDisposable?;
33
+ private readonly subscriptions;
33
34
  private renderSeq;
34
35
  private latestSceneLayout;
35
- private sourceSizeBySrc;
36
- private pendingSizeBySrc;
36
+ private sourceSizeCache;
37
37
  private onCanvasResized;
38
38
  private onSceneLayoutChanged;
39
39
  constructor(options?: Partial<BackgroundConfig>);
@@ -53,7 +53,6 @@ declare class BackgroundTool implements Extension {
53
53
  private buildImageLayerSpec;
54
54
  private buildBackgroundSpecs;
55
55
  private collectActiveImageUrls;
56
- private ensureImageSize;
57
56
  private loadImageSize;
58
57
  private updateBackground;
59
58
  private updateBackgroundAsync;
@@ -79,7 +78,7 @@ declare class ImageTool implements Extension {
79
78
  private workingItems;
80
79
  private hasWorkingChanges;
81
80
  private loadResolvers;
82
- private sourceSizeBySrc;
81
+ private sourceSizeCache;
83
82
  private canvasService?;
84
83
  private context?;
85
84
  private isUpdatingConfig;
@@ -94,6 +93,7 @@ declare class ImageTool implements Extension {
94
93
  private imageSpecs;
95
94
  private overlaySpecs;
96
95
  private renderProducerDisposable?;
96
+ private readonly subscriptions;
97
97
  private imageControlsByCapabilityKey;
98
98
  activate(context: ExtensionContext): void;
99
99
  deactivate(context: ExtensionContext): void;
@@ -126,8 +126,8 @@ declare class ImageTool implements Extension {
126
126
  leavePolicy: string;
127
127
  };
128
128
  }[];
129
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
130
- [ContributionPointIds.COMMANDS]: CommandContribution[];
129
+ [ContributionPointIds.CONFIGURATIONS]: _pooder_core.ConfigurationContribution[];
130
+ [ContributionPointIds.COMMANDS]: _pooder_core.CommandContribution[];
131
131
  };
132
132
  private normalizeItem;
133
133
  private normalizeItems;
@@ -141,6 +141,7 @@ declare class ImageTool implements Extension {
141
141
  private addItemToWorkingSessionIfNeeded;
142
142
  private updateImage;
143
143
  private getConfig;
144
+ private applyCommittedItems;
144
145
  private updateConfig;
145
146
  private getFrameRect;
146
147
  private getFrameRectScreen;
@@ -155,6 +156,7 @@ declare class ImageTool implements Extension {
155
156
  private rememberSourceSize;
156
157
  private getSourceSize;
157
158
  private ensureSourceSize;
159
+ private loadImageSize;
158
160
  private getCoverScale;
159
161
  private getFrameVisualConfig;
160
162
  private toSceneGeometryLike;
@@ -182,6 +184,16 @@ declare class ImageTool implements Extension {
182
184
  private exportUserCroppedImage;
183
185
  }
184
186
 
187
+ declare function createImageCommands(tool: any): CommandContribution[];
188
+
189
+ declare function createImageConfigurations(): ConfigurationContribution[];
190
+
191
+ interface RectLike$1 {
192
+ width: number;
193
+ height: number;
194
+ }
195
+ declare function getCoverScale(frame: RectLike$1, source: RectLike$1): number;
196
+
185
197
  declare class SizeTool implements Extension {
186
198
  id: string;
187
199
  metadata: {
@@ -307,8 +319,8 @@ declare class DielineTool implements Extension {
307
319
  leavePolicy: string;
308
320
  };
309
321
  }[];
310
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
311
- [ContributionPointIds.COMMANDS]: CommandContribution[];
322
+ [ContributionPointIds.CONFIGURATIONS]: _pooder_core.ConfigurationContribution[];
323
+ [ContributionPointIds.COMMANDS]: _pooder_core.CommandContribution[];
312
324
  };
313
325
  private createHatchPattern;
314
326
  private getConfigService;
@@ -324,357 +336,56 @@ declare class DielineTool implements Extension {
324
336
  }): Promise<string | null>;
325
337
  }
326
338
 
327
- interface ConstraintFeature extends DielineFeature {
328
- constraints?: Array<{
329
- type: string;
330
- params?: any;
331
- validateOnly?: boolean;
332
- }>;
333
- }
339
+ declare function createDielineCommands(tool: any, state: any): CommandContribution[];
334
340
 
335
- declare class FeatureTool implements Extension {
336
- id: string;
337
- metadata: {
338
- name: string;
339
- };
340
- private workingFeatures;
341
- private canvasService?;
342
- private context?;
343
- private isUpdatingConfig;
344
- private isToolActive;
345
- private isFeatureSessionActive;
346
- private sessionOriginalFeatures;
347
- private hasWorkingChanges;
348
- private dirtyTrackerDisposable?;
349
- private renderProducerDisposable?;
350
- private specs;
351
- private renderSeq;
352
- private handleMoving;
353
- private handleModified;
354
- private handleSceneGeometryChange;
355
- private currentGeometry;
356
- constructor(options?: Partial<{
357
- features: ConstraintFeature[];
358
- }>);
359
- activate(context: ExtensionContext): void;
360
- deactivate(context: ExtensionContext): void;
361
- private onToolActivated;
362
- private updateVisibility;
363
- contribute(): {
364
- [ContributionPointIds.TOOLS]: {
365
- id: string;
366
- name: string;
367
- interaction: string;
368
- commands: {
369
- begin: string;
370
- commit: string;
371
- rollback: string;
372
- };
373
- session: {
374
- autoBegin: boolean;
375
- leavePolicy: string;
376
- };
377
- }[];
378
- [ContributionPointIds.COMMANDS]: CommandContribution[];
379
- };
380
- private cloneFeatures;
381
- private getConfigService;
382
- private getCommittedFeatures;
383
- private updateCommittedFeatures;
384
- private clearFeatureSessionState;
385
- private restoreSessionFeaturesToConfig;
386
- private emitWorkingChange;
387
- private refreshGeometry;
388
- private resetWorkingFeaturesFromSource;
389
- private setWorkingFeatures;
390
- private updateWorkingGroupPosition;
391
- private completeFeatures;
392
- private addFeature;
393
- private addDoubleLayerHole;
394
- private getGeometryForFeature;
395
- private setup;
396
- private teardown;
397
- private getDraggableMarkerTarget;
398
- private getFeatureForMarker;
399
- private constrainPosition;
400
- private toNormalizedPoint;
401
- private syncFeatureFromCanvas;
402
- private syncGroupFromCanvas;
403
- private redraw;
404
- private redrawAsync;
405
- private buildFeatureSpecs;
406
- private appendMarkerSpecs;
407
- private buildMarkerData;
408
- private markerId;
409
- private bridgeIndicatorId;
410
- private toFeatureIndex;
411
- private readGroupIndices;
412
- private readGroupMemberOffsets;
413
- private syncMarkerVisualsByTarget;
414
- private syncMarkerVisualObjectsToCenter;
415
- private enforceConstraints;
416
- }
341
+ declare function createDielineConfigurations(state: any): ConfigurationContribution[];
417
342
 
418
- declare class FilmTool implements Extension {
419
- id: string;
420
- metadata: {
421
- name: string;
422
- };
423
- private url;
424
- private opacity;
425
- private canvasService?;
426
- private specs;
427
- private renderProducerDisposable?;
428
- private renderSeq;
429
- private renderImageUrl;
430
- private sourceSizeBySrc;
431
- private pendingSizeBySrc;
432
- private onCanvasResized;
433
- constructor(options?: Partial<{
434
- url: string;
435
- opacity: number;
436
- }>);
437
- activate(context: ExtensionContext): void;
438
- deactivate(context: ExtensionContext): void;
439
- contribute(): {
440
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
441
- [ContributionPointIds.COMMANDS]: CommandContribution[];
442
- };
443
- private getViewportSize;
444
- private clampOpacity;
445
- private buildFilmSpecs;
446
- private ensureImageSize;
447
- private loadImageSize;
448
- private updateFilm;
449
- private updateFilmAsync;
343
+ interface Point {
344
+ x: number;
345
+ y: number;
450
346
  }
451
-
452
- declare class MirrorTool implements Extension {
453
- id: string;
454
- metadata: {
455
- name: string;
456
- };
457
- private enabled;
458
- private canvasService?;
459
- constructor(options?: Partial<{
460
- enabled: boolean;
461
- }>);
462
- toJSON(): {
463
- enabled: boolean;
464
- };
465
- loadFromJSON(json: any): void;
466
- activate(context: ExtensionContext): void;
467
- deactivate(context: ExtensionContext): void;
468
- contribute(): {
469
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
470
- [ContributionPointIds.COMMANDS]: CommandContribution[];
471
- };
472
- private applyMirror;
347
+ interface Size {
348
+ width: number;
349
+ height: number;
350
+ }
351
+ interface Layout {
352
+ scale: number;
353
+ offsetX: number;
354
+ offsetY: number;
355
+ width: number;
356
+ height: number;
473
357
  }
474
358
 
475
- declare class RulerTool implements Extension {
476
- id: string;
477
- metadata: {
478
- name: string;
479
- };
480
- private thickness;
481
- private gap;
482
- private backgroundColor;
483
- private textColor;
484
- private lineColor;
485
- private fontSize;
486
- private renderSeq;
487
- private readonly numericProps;
488
- private specs;
489
- private renderProducerDisposable?;
490
- private canvasService?;
491
- private context?;
492
- private onCanvasResized;
493
- constructor(options?: Partial<{
494
- thickness: number;
495
- backgroundColor: string;
496
- textColor: string;
497
- lineColor: string;
498
- fontSize: number;
499
- gap: number;
500
- }>);
501
- activate(context: ExtensionContext): void;
502
- deactivate(context: ExtensionContext): void;
503
- contribute(): {
504
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
505
- [ContributionPointIds.COMMANDS]: CommandContribution[];
506
- };
507
- private log;
508
- private syncConfig;
509
- private toFiniteNumber;
510
- private toSceneDisplayLength;
511
- private formatLengthMm;
512
- private buildLinePath;
513
- private buildStartArrowPath;
514
- private buildEndArrowPath;
515
- private createPathSpec;
516
- private createTextSpec;
517
- private buildRulerSpecs;
518
- private updateRuler;
519
- private updateRulerAsync;
359
+ declare class ViewportSystem {
360
+ private _containerSize;
361
+ private _physicalSize;
362
+ private _padding;
363
+ private _layout;
364
+ constructor(containerSize?: Size, physicalSize?: Size, padding?: number);
365
+ get layout(): Layout;
366
+ get scale(): number;
367
+ get offset(): Point;
368
+ updateContainer(width: number, height: number): void;
369
+ updatePhysical(width: number, height: number): void;
370
+ setPadding(padding: number): void;
371
+ private updateLayout;
372
+ toPixel(value: number): number;
373
+ toPhysical(value: number): number;
374
+ toPixelPoint(point: Point): Point;
375
+ toPhysicalPoint(point: Point): Point;
520
376
  }
521
377
 
522
- interface WhiteInkItem {
523
- id: string;
524
- sourceUrl?: string;
525
- url?: string;
526
- opacity: number;
527
- }
528
- declare class WhiteInkTool implements Extension {
529
- id: string;
530
- metadata: {
531
- name: string;
532
- };
533
- private items;
534
- private workingItems;
535
- private hasWorkingChanges;
536
- private sourceSizeBySrc;
537
- private previewMaskBySource;
538
- private pendingPreviewMaskBySource;
539
- private canvasService?;
540
- private context?;
541
- private isUpdatingConfig;
542
- private isToolActive;
543
- private printWithWhiteInk;
544
- private previewImageVisible;
545
- private renderSeq;
546
- private dirtyTrackerDisposable?;
547
- private whiteSpecs;
548
- private coverSpecs;
549
- private overlaySpecs;
550
- private renderProducerDisposable?;
551
- activate(context: ExtensionContext): void;
552
- deactivate(context: ExtensionContext): void;
553
- contribute(): {
554
- [ContributionPointIds.TOOLS]: {
555
- id: string;
556
- name: string;
557
- interaction: string;
558
- commands: {
559
- begin: string;
560
- commit: string;
561
- rollback: string;
562
- };
563
- session: {
564
- autoBegin: boolean;
565
- leavePolicy: string;
566
- };
567
- }[];
568
- [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
569
- [ContributionPointIds.COMMANDS]: CommandContribution[];
570
- };
571
- private onToolActivated;
572
- private onSceneLayoutChanged;
573
- private onObjectAdded;
574
- private onObjectModified;
575
- private onObjectRemoved;
576
- private onImageWorkingChanged;
577
- private migrateLegacyConfigIfNeeded;
578
- private syncToolActiveFromWorkbench;
579
- private isPreviewActive;
580
- private isDebugEnabled;
581
- private debug;
582
- private resolveSourceUrl;
583
- private normalizeItem;
584
- private normalizeItems;
585
- private cloneItems;
586
- private getEffectiveWhiteInkItem;
587
- private generateId;
588
- private getConfig;
589
- private resolveReplaceTargetId;
590
- private updateConfig;
591
- private addWhiteInkEntry;
592
- private upsertWhiteInkEntry;
593
- private addItemToWorkingSessionIfNeeded;
594
- private updateWhiteInkItem;
595
- private updateWhiteInkInWorking;
596
- private updateWhiteInkInConfig;
597
- private removeWhiteInk;
598
- private clearWhiteInks;
599
- private completeWhiteInks;
600
- private getFrameRect;
601
- private toLayoutSceneRect;
602
- private getImageObjects;
603
- private getPrimaryImageObject;
604
- private getPrimaryImageSource;
605
- private getCurrentSrc;
606
- private getImageSnapshot;
607
- private getImagePlacementState;
608
- private shouldRestoreSnapshotToSource;
609
- private getCoverScale;
610
- private ensureSourceSize;
611
- private resolveAlignedImageSnapshot;
612
- private getImageElementFromObject;
613
- private rememberSourceSize;
614
- private getSourceSize;
615
- private computeWhiteScaleAdjust;
616
- private computeCoverOpacity;
617
- private buildCloneImageSpec;
618
- private buildFrameSpecs;
619
- private resolveRenderItems;
620
- private resolveRenderSources;
621
- private clearRenderedWhiteInks;
622
- private purgeSourceCaches;
623
- private updateWhiteInks;
624
- private updateWhiteInksAsync;
625
- private getMaskCacheKey;
626
- private getPreviewMaskSource;
627
- private getElementSize;
628
- private createOpaqueMaskSource;
629
- private loadImageElement;
630
- }
631
-
632
- interface Point {
633
- x: number;
634
- y: number;
635
- }
636
- interface Size {
637
- width: number;
638
- height: number;
639
- }
640
- interface Layout {
641
- scale: number;
642
- offsetX: number;
643
- offsetY: number;
644
- width: number;
645
- height: number;
646
- }
647
-
648
- declare class ViewportSystem {
649
- private _containerSize;
650
- private _physicalSize;
651
- private _padding;
652
- private _layout;
653
- constructor(containerSize?: Size, physicalSize?: Size, padding?: number);
654
- get layout(): Layout;
655
- get scale(): number;
656
- get offset(): Point;
657
- updateContainer(width: number, height: number): void;
658
- updatePhysical(width: number, height: number): void;
659
- setPadding(padding: number): void;
660
- private updateLayout;
661
- toPixel(value: number): number;
662
- toPhysical(value: number): number;
663
- toPixelPoint(point: Point): Point;
664
- toPhysicalPoint(point: Point): Point;
665
- }
666
-
667
- type RenderObjectType = "rect" | "image" | "path" | "text";
668
- type RenderProps = Record<string, any>;
669
- type RenderCoordinateSpace = "scene" | "screen";
670
- type RenderLayoutLength = number | string;
671
- type RenderLayoutAlign = "start" | "center" | "end";
672
- type RenderLayoutReference = "sceneViewport" | "screenViewport" | "custom";
673
- interface RenderLayoutInsets {
674
- top?: RenderLayoutLength;
675
- right?: RenderLayoutLength;
676
- bottom?: RenderLayoutLength;
677
- left?: RenderLayoutLength;
378
+ type RenderObjectType = "rect" | "image" | "path" | "text";
379
+ type RenderProps = Record<string, any>;
380
+ type RenderCoordinateSpace = "scene" | "screen";
381
+ type RenderLayoutLength = number | string;
382
+ type RenderLayoutAlign = "start" | "center" | "end";
383
+ type RenderLayoutReference = "sceneViewport" | "screenViewport" | "custom";
384
+ interface RenderLayoutInsets {
385
+ top?: RenderLayoutLength;
386
+ right?: RenderLayoutLength;
387
+ bottom?: RenderLayoutLength;
388
+ left?: RenderLayoutLength;
678
389
  }
679
390
  interface RenderLayoutRect {
680
391
  left: number;
@@ -917,18 +628,6 @@ declare class CanvasService implements Service {
917
628
  private createFabricObject;
918
629
  }
919
630
 
920
- interface VisibilityLayerState {
921
- exists: boolean;
922
- objectCount: number;
923
- }
924
- interface VisibilityEvalContext {
925
- activeToolId?: string | null;
926
- isSessionActive?: (toolId: string) => boolean;
927
- hasAnyActiveSession?: () => boolean;
928
- layers: Map<string, VisibilityLayerState>;
929
- }
930
- declare function evaluateVisibilityExpr(expr: VisibilityExpr | undefined, context: VisibilityEvalContext): boolean;
931
-
932
631
  type CutMode = "trim" | "outset" | "inset";
933
632
  interface SceneRect {
934
633
  left: number;
@@ -974,7 +673,7 @@ declare class SceneLayoutService implements Service {
974
673
  private configService?;
975
674
  private lastLayout;
976
675
  private lastGeometry;
977
- private onConfigChange?;
676
+ private readonly subscriptions;
978
677
  private commandDisposables;
979
678
  init(context: ServiceContext): void;
980
679
  dispose(context: ServiceContext): void;
@@ -985,4 +684,328 @@ declare class SceneLayoutService implements Service {
985
684
  getGeometry(forceRefresh?: boolean): SceneGeometrySnapshot | null;
986
685
  }
987
686
 
988
- export { type BackgroundConfig, type BackgroundFitMode, type BackgroundLayer, type BackgroundLayerKind, BackgroundTool, CanvasService, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LayerObjectCountComparator, type LineStyle, MirrorTool, type RenderClipPathEffectSpec, type RenderCoordinateSpace, type RenderEffectSpec, type RenderLayoutAlign, type RenderLayoutInsets, type RenderLayoutLength, type RenderLayoutRect, type RenderLayoutReference, type RenderObjectLayoutSpec, type RenderObjectSpec, type RenderObjectType, type RenderPassSpec, type RenderProps, RulerTool, SceneLayoutService, SizeTool, ViewportSystem, type VisibilityEvalContext, type VisibilityExpr, type VisibilityLayerState, type WhiteInkItem, WhiteInkTool, evaluateVisibilityExpr };
687
+ interface VisibilityLayerState {
688
+ exists: boolean;
689
+ objectCount: number;
690
+ }
691
+ interface VisibilityEvalContext {
692
+ activeToolId?: string | null;
693
+ isSessionActive?: (toolId: string) => boolean;
694
+ hasAnyActiveSession?: () => boolean;
695
+ layers: Map<string, VisibilityLayerState>;
696
+ }
697
+ declare function evaluateVisibilityExpr(expr: VisibilityExpr | undefined, context: VisibilityEvalContext): boolean;
698
+
699
+ interface ConstraintFeature extends DielineFeature {
700
+ constraints?: Array<{
701
+ type: string;
702
+ params?: any;
703
+ validateOnly?: boolean;
704
+ }>;
705
+ }
706
+
707
+ declare class FeatureTool implements Extension {
708
+ id: string;
709
+ metadata: {
710
+ name: string;
711
+ };
712
+ private workingFeatures;
713
+ private canvasService?;
714
+ private context?;
715
+ private isUpdatingConfig;
716
+ private isToolActive;
717
+ private isFeatureSessionActive;
718
+ private sessionOriginalFeatures;
719
+ private hasWorkingChanges;
720
+ private dirtyTrackerDisposable?;
721
+ private renderProducerDisposable?;
722
+ private specs;
723
+ private renderSeq;
724
+ private readonly subscriptions;
725
+ private handleMoving;
726
+ private handleModified;
727
+ private handleSceneGeometryChange;
728
+ private currentGeometry;
729
+ constructor(options?: Partial<{
730
+ features: ConstraintFeature[];
731
+ }>);
732
+ activate(context: ExtensionContext): void;
733
+ deactivate(context: ExtensionContext): void;
734
+ private onToolActivated;
735
+ private updateVisibility;
736
+ contribute(): {
737
+ [ContributionPointIds.TOOLS]: {
738
+ id: string;
739
+ name: string;
740
+ interaction: string;
741
+ commands: {
742
+ begin: string;
743
+ commit: string;
744
+ rollback: string;
745
+ };
746
+ session: {
747
+ autoBegin: boolean;
748
+ leavePolicy: string;
749
+ };
750
+ }[];
751
+ [ContributionPointIds.COMMANDS]: CommandContribution[];
752
+ };
753
+ private cloneFeatures;
754
+ private getConfigService;
755
+ private getCommittedFeatures;
756
+ private updateCommittedFeatures;
757
+ private clearFeatureSessionState;
758
+ private restoreSessionFeaturesToConfig;
759
+ private emitWorkingChange;
760
+ private refreshGeometry;
761
+ private resetWorkingFeaturesFromSource;
762
+ private setWorkingFeatures;
763
+ private updateWorkingGroupPosition;
764
+ private completeFeatures;
765
+ private addFeature;
766
+ private addDoubleLayerHole;
767
+ private getGeometryForFeature;
768
+ private setup;
769
+ private teardown;
770
+ private getDraggableMarkerTarget;
771
+ private getFeatureForMarker;
772
+ private constrainPosition;
773
+ private toNormalizedPoint;
774
+ private syncFeatureFromCanvas;
775
+ private syncGroupFromCanvas;
776
+ private redraw;
777
+ private redrawAsync;
778
+ private buildFeatureSpecs;
779
+ private appendMarkerSpecs;
780
+ private buildMarkerData;
781
+ private markerId;
782
+ private bridgeIndicatorId;
783
+ private toFeatureIndex;
784
+ private readGroupIndices;
785
+ private readGroupMemberOffsets;
786
+ private syncMarkerVisualsByTarget;
787
+ private syncMarkerVisualObjectsToCenter;
788
+ private enforceConstraints;
789
+ }
790
+
791
+ declare class FilmTool implements Extension {
792
+ id: string;
793
+ metadata: {
794
+ name: string;
795
+ };
796
+ private url;
797
+ private opacity;
798
+ private canvasService?;
799
+ private specs;
800
+ private renderProducerDisposable?;
801
+ private renderSeq;
802
+ private renderImageUrl;
803
+ private sourceSizeCache;
804
+ private readonly subscriptions;
805
+ private onCanvasResized;
806
+ constructor(options?: Partial<{
807
+ url: string;
808
+ opacity: number;
809
+ }>);
810
+ activate(context: ExtensionContext): void;
811
+ deactivate(context: ExtensionContext): void;
812
+ contribute(): {
813
+ [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
814
+ [ContributionPointIds.COMMANDS]: CommandContribution[];
815
+ };
816
+ private getViewportSize;
817
+ private clampOpacity;
818
+ private buildFilmSpecs;
819
+ private loadImageSize;
820
+ private updateFilm;
821
+ private updateFilmAsync;
822
+ }
823
+
824
+ declare class MirrorTool implements Extension {
825
+ id: string;
826
+ metadata: {
827
+ name: string;
828
+ };
829
+ private enabled;
830
+ private canvasService?;
831
+ constructor(options?: Partial<{
832
+ enabled: boolean;
833
+ }>);
834
+ toJSON(): {
835
+ enabled: boolean;
836
+ };
837
+ loadFromJSON(json: any): void;
838
+ activate(context: ExtensionContext): void;
839
+ deactivate(context: ExtensionContext): void;
840
+ contribute(): {
841
+ [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
842
+ [ContributionPointIds.COMMANDS]: CommandContribution[];
843
+ };
844
+ private applyMirror;
845
+ }
846
+
847
+ declare class RulerTool implements Extension {
848
+ id: string;
849
+ metadata: {
850
+ name: string;
851
+ };
852
+ private thickness;
853
+ private gap;
854
+ private backgroundColor;
855
+ private textColor;
856
+ private lineColor;
857
+ private fontSize;
858
+ private renderSeq;
859
+ private readonly numericProps;
860
+ private specs;
861
+ private renderProducerDisposable?;
862
+ private canvasService?;
863
+ private context?;
864
+ private onCanvasResized;
865
+ constructor(options?: Partial<{
866
+ thickness: number;
867
+ backgroundColor: string;
868
+ textColor: string;
869
+ lineColor: string;
870
+ fontSize: number;
871
+ gap: number;
872
+ }>);
873
+ activate(context: ExtensionContext): void;
874
+ deactivate(context: ExtensionContext): void;
875
+ contribute(): {
876
+ [ContributionPointIds.CONFIGURATIONS]: ConfigurationContribution[];
877
+ [ContributionPointIds.COMMANDS]: CommandContribution[];
878
+ };
879
+ private log;
880
+ private syncConfig;
881
+ private toFiniteNumber;
882
+ private toSceneDisplayLength;
883
+ private formatLengthMm;
884
+ private buildLinePath;
885
+ private buildStartArrowPath;
886
+ private buildEndArrowPath;
887
+ private createPathSpec;
888
+ private createTextSpec;
889
+ private buildRulerSpecs;
890
+ private updateRuler;
891
+ private updateRulerAsync;
892
+ }
893
+
894
+ interface WhiteInkItem {
895
+ id: string;
896
+ sourceUrl?: string;
897
+ url?: string;
898
+ opacity: number;
899
+ }
900
+ declare class WhiteInkTool implements Extension {
901
+ id: string;
902
+ metadata: {
903
+ name: string;
904
+ };
905
+ private items;
906
+ private workingItems;
907
+ private hasWorkingChanges;
908
+ private sourceSizeCache;
909
+ private previewMaskBySource;
910
+ private pendingPreviewMaskBySource;
911
+ private canvasService?;
912
+ private context?;
913
+ private isUpdatingConfig;
914
+ private isToolActive;
915
+ private printWithWhiteInk;
916
+ private previewImageVisible;
917
+ private renderSeq;
918
+ private dirtyTrackerDisposable?;
919
+ private whiteSpecs;
920
+ private coverSpecs;
921
+ private overlaySpecs;
922
+ private renderProducerDisposable?;
923
+ private readonly subscriptions;
924
+ activate(context: ExtensionContext): void;
925
+ deactivate(context: ExtensionContext): void;
926
+ contribute(): {
927
+ [ContributionPointIds.TOOLS]: {
928
+ id: string;
929
+ name: string;
930
+ interaction: string;
931
+ commands: {
932
+ begin: string;
933
+ commit: string;
934
+ rollback: string;
935
+ };
936
+ session: {
937
+ autoBegin: boolean;
938
+ leavePolicy: string;
939
+ };
940
+ }[];
941
+ [ContributionPointIds.CONFIGURATIONS]: _pooder_core.ConfigurationContribution[];
942
+ [ContributionPointIds.COMMANDS]: _pooder_core.CommandContribution[];
943
+ };
944
+ private onToolActivated;
945
+ private onSceneLayoutChanged;
946
+ private onObjectAdded;
947
+ private onObjectModified;
948
+ private onObjectRemoved;
949
+ private onImageWorkingChanged;
950
+ private migrateLegacyConfigIfNeeded;
951
+ private syncToolActiveFromWorkbench;
952
+ private isPreviewActive;
953
+ private isDebugEnabled;
954
+ private debug;
955
+ private resolveSourceUrl;
956
+ private normalizeItem;
957
+ private normalizeItems;
958
+ private cloneItems;
959
+ private getEffectiveWhiteInkItem;
960
+ private generateId;
961
+ private getConfig;
962
+ private resolveReplaceTargetId;
963
+ private applyCommittedItems;
964
+ private updateConfig;
965
+ private addWhiteInkEntry;
966
+ private upsertWhiteInkEntry;
967
+ private addItemToWorkingSessionIfNeeded;
968
+ private updateWhiteInkItem;
969
+ private updateWhiteInkInWorking;
970
+ private updateWhiteInkInConfig;
971
+ private removeWhiteInk;
972
+ private clearWhiteInks;
973
+ private completeWhiteInks;
974
+ private getFrameRect;
975
+ private toLayoutSceneRect;
976
+ private getImageObjects;
977
+ private getPrimaryImageObject;
978
+ private getPrimaryImageSource;
979
+ private getCurrentSrc;
980
+ private getImageSnapshot;
981
+ private getImagePlacementState;
982
+ private shouldRestoreSnapshotToSource;
983
+ private getCoverScale;
984
+ private ensureSourceSize;
985
+ private loadImageSize;
986
+ private resolveAlignedImageSnapshot;
987
+ private getImageElementFromObject;
988
+ private rememberSourceSize;
989
+ private getSourceSize;
990
+ private computeWhiteScaleAdjust;
991
+ private computeCoverOpacity;
992
+ private buildCloneImageSpec;
993
+ private buildFrameSpecs;
994
+ private resolveRenderItems;
995
+ private resolveRenderSources;
996
+ private clearRenderedWhiteInks;
997
+ private purgeSourceCaches;
998
+ private updateWhiteInks;
999
+ private updateWhiteInksAsync;
1000
+ private getMaskCacheKey;
1001
+ private getPreviewMaskSource;
1002
+ private getElementSize;
1003
+ private createOpaqueMaskSource;
1004
+ private loadImageElement;
1005
+ }
1006
+
1007
+ declare function createWhiteInkCommands(tool: any): CommandContribution[];
1008
+
1009
+ declare function createWhiteInkConfigurations(): ConfigurationContribution[];
1010
+
1011
+ export { type BackgroundConfig, type BackgroundFitMode, type BackgroundLayer, type BackgroundLayerKind, BackgroundTool, CanvasService, type DielineGeometry, type DielineState, DielineTool, FeatureTool, FilmTool, type ImageItem, ImageTool, type LayerObjectCountComparator, type LineStyle, MirrorTool, type RenderClipPathEffectSpec, type RenderCoordinateSpace, type RenderEffectSpec, type RenderLayoutAlign, type RenderLayoutInsets, type RenderLayoutLength, type RenderLayoutRect, type RenderLayoutReference, type RenderObjectLayoutSpec, type RenderObjectSpec, type RenderObjectType, type RenderPassSpec, type RenderProps, RulerTool, SceneLayoutService, SizeTool, ViewportSystem, type VisibilityEvalContext, type VisibilityExpr, type VisibilityLayerState, type WhiteInkItem, WhiteInkTool, getCoverScale as computeImageCoverScale, getCoverScale as computeWhiteInkCoverScale, createDielineCommands, createDielineConfigurations, createImageCommands, createImageConfigurations, createWhiteInkCommands, createWhiteInkConfigurations, evaluateVisibilityExpr };