@pooder/kit 6.1.1 → 6.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/dist/index.d.ts CHANGED
@@ -1,9 +1,23 @@
1
1
  import * as _pooder_core from '@pooder/core';
2
- import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, Service, ServiceContext, EventBus } from '@pooder/core';
2
+ import { Extension, ExtensionContext, ContributionPointIds, ConfigurationContribution, CommandContribution, ConfigurationService, Service, ServiceContext, EventBus } from '@pooder/core';
3
3
  import { Canvas, FabricObject } from 'fabric';
4
4
 
5
5
  type BackgroundLayerKind = "color" | "image";
6
6
  type BackgroundFitMode = "cover" | "contain" | "stretch";
7
+ type BackgroundRegionUnit = "normalized" | "px";
8
+ type BackgroundRegistrationFrame = "trim" | "cut" | "bleed" | "focus" | "viewport";
9
+ interface BackgroundRegistrationRegion {
10
+ left: number;
11
+ top: number;
12
+ width: number;
13
+ height: number;
14
+ unit: BackgroundRegionUnit;
15
+ }
16
+ interface BackgroundRegistration {
17
+ sourceRegion?: BackgroundRegistrationRegion;
18
+ targetFrame?: BackgroundRegistrationFrame;
19
+ fit?: BackgroundFitMode;
20
+ }
7
21
  interface BackgroundLayer {
8
22
  id: string;
9
23
  kind: BackgroundLayerKind;
@@ -15,6 +29,7 @@ interface BackgroundLayer {
15
29
  exportable: boolean;
16
30
  color?: string;
17
31
  src?: string;
32
+ registration?: BackgroundRegistration;
18
33
  }
19
34
  interface BackgroundConfig {
20
35
  version: number;
@@ -47,8 +62,11 @@ declare class BackgroundTool implements Extension {
47
62
  private getViewportRect;
48
63
  private resolveSceneLayout;
49
64
  private resolveFocusRect;
65
+ private resolveTargetFrameRect;
50
66
  private resolveAnchorRect;
51
67
  private resolveImagePlacement;
68
+ private resolveRegistrationRegion;
69
+ private resolveRegistrationPlacement;
52
70
  private buildColorLayerSpec;
53
71
  private buildImageLayerSpec;
54
72
  private buildBackgroundSpecs;
@@ -92,6 +110,14 @@ declare class ImageTool implements Extension {
92
110
  private cropShapeHatchPatternKey?;
93
111
  private imageSpecs;
94
112
  private overlaySpecs;
113
+ private activeSnapX;
114
+ private activeSnapY;
115
+ private movingImageId;
116
+ private hasRenderedSnapGuides;
117
+ private canvasObjectMovingHandler?;
118
+ private canvasMouseUpHandler?;
119
+ private canvasBeforeRenderHandler?;
120
+ private canvasAfterRenderHandler?;
95
121
  private renderProducerDisposable?;
96
122
  private readonly subscriptions;
97
123
  private imageControlsByCapabilityKey;
@@ -102,6 +128,22 @@ declare class ImageTool implements Extension {
102
128
  private onSelectionCleared;
103
129
  private onSceneLayoutChanged;
104
130
  private onSceneGeometryChanged;
131
+ private bindCanvasInteractionHandlers;
132
+ private unbindCanvasInteractionHandlers;
133
+ private getActiveImageTarget;
134
+ private getTargetBoundsScene;
135
+ private getSnapThresholdScene;
136
+ private pickSnapMatch;
137
+ private computeMoveSnapMatches;
138
+ private areSnapMatchesEqual;
139
+ private updateSnapMatchState;
140
+ private clearSnapPreview;
141
+ private endMoveSnapInteraction;
142
+ private applyMoveSnapToTarget;
143
+ private handleCanvasBeforeRender;
144
+ private drawSnapGuideLine;
145
+ private handleCanvasAfterRender;
146
+ private handleCanvasObjectMoving;
105
147
  private syncToolActiveFromWorkbench;
106
148
  private isImageEditingVisible;
107
149
  private getEnabledImageControlCapabilities;
@@ -293,6 +335,9 @@ interface DielineState {
293
335
  customSourceWidthPx?: number;
294
336
  customSourceHeightPx?: number;
295
337
  }
338
+ declare function createDefaultDielineState(): DielineState;
339
+ declare function readDielineState(configService: ConfigurationService, fallback?: Partial<DielineState>): DielineState;
340
+
296
341
  declare class DielineTool implements Extension {
297
342
  id: string;
298
343
  metadata: {
@@ -325,7 +370,6 @@ declare class DielineTool implements Extension {
325
370
  private createHatchPattern;
326
371
  private getConfigService;
327
372
  private hasImageItems;
328
- private syncSizeState;
329
373
  private buildDielineSpecs;
330
374
  private buildImageClipEffects;
331
375
  updateDieline(_emitEvent?: boolean): void;
@@ -719,7 +763,9 @@ declare class FeatureTool implements Extension {
719
763
  private hasWorkingChanges;
720
764
  private dirtyTrackerDisposable?;
721
765
  private renderProducerDisposable?;
722
- private specs;
766
+ private markerSpecs;
767
+ private sessionDielineSpecs;
768
+ private sessionDielineEffects;
723
769
  private renderSeq;
724
770
  private readonly subscriptions;
725
771
  private handleMoving;
@@ -733,6 +779,7 @@ declare class FeatureTool implements Extension {
733
779
  deactivate(context: ExtensionContext): void;
734
780
  private onToolActivated;
735
781
  private updateVisibility;
782
+ private isSessionVisible;
736
783
  contribute(): {
737
784
  [ContributionPointIds.TOOLS]: {
738
785
  id: string;
@@ -754,8 +801,10 @@ declare class FeatureTool implements Extension {
754
801
  private getConfigService;
755
802
  private getCommittedFeatures;
756
803
  private updateCommittedFeatures;
804
+ private hasFeatureSessionDraft;
757
805
  private clearFeatureSessionState;
758
- private restoreSessionFeaturesToConfig;
806
+ private restoreCommittedFeaturesToConfig;
807
+ private suspendFeatureSession;
759
808
  private emitWorkingChange;
760
809
  private refreshGeometry;
761
810
  private resetWorkingFeaturesFromSource;
@@ -767,6 +816,7 @@ declare class FeatureTool implements Extension {
767
816
  private getGeometryForFeature;
768
817
  private setup;
769
818
  private teardown;
819
+ private createHatchPattern;
770
820
  private getDraggableMarkerTarget;
771
821
  private getFeatureForMarker;
772
822
  private constrainPosition;
@@ -775,7 +825,9 @@ declare class FeatureTool implements Extension {
775
825
  private syncGroupFromCanvas;
776
826
  private redraw;
777
827
  private redrawAsync;
778
- private buildFeatureSpecs;
828
+ private buildSessionDielineRender;
829
+ private hasImageItems;
830
+ private buildMarkerSpecs;
779
831
  private appendMarkerSpecs;
780
832
  private buildMarkerData;
781
833
  private markerId;
@@ -1008,4 +1060,4 @@ declare function createWhiteInkCommands(tool: any): CommandContribution[];
1008
1060
 
1009
1061
  declare function createWhiteInkConfigurations(): ConfigurationContribution[];
1010
1062
 
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 };
1063
+ export { type BackgroundConfig, type BackgroundFitMode, type BackgroundLayer, type BackgroundLayerKind, type BackgroundRegionUnit, type BackgroundRegistration, type BackgroundRegistrationFrame, type BackgroundRegistrationRegion, 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, createDefaultDielineState, createDielineCommands, createDielineConfigurations, createImageCommands, createImageConfigurations, createWhiteInkCommands, createWhiteInkConfigurations, evaluateVisibilityExpr, readDielineState };