@kittl/sdk 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -56,7 +56,11 @@ declare const ANIMATION_CHANNELS: readonly [
56
56
  "scaleY",
57
57
  "skewX",
58
58
  "skewY",
59
- "opacity"
59
+ "opacity",
60
+ "offsetDistance",
61
+ "translateZ",
62
+ "rotateX",
63
+ "rotateY"
60
64
  ];
61
65
  declare const ANIMATION_EASING_NAMES: readonly [
62
66
  "linear",
@@ -65,6 +69,7 @@ declare const ANIMATION_EASING_NAMES: readonly [
65
69
  "ease-out",
66
70
  "ease-in-out"
67
71
  ];
72
+ declare const ANIMATION_SHAPE_CHANNEL = "d";
68
73
  declare const APP_STATE_SUBSCRIPTION_KEYS: readonly [
69
74
  "selectedObjectsIds",
70
75
  "selectedLayersIds",
@@ -171,9 +176,7 @@ declare const DEFAULT_VALUES$1: {
171
176
  generation?: {
172
177
  meta?: GenerationMeta;
173
178
  generationId?: string;
174
- aiArtId? /**
175
- * Cache key to support local history changes without relying on persistence
176
- */: string;
179
+ aiArtId?: string;
177
180
  generatorKey?: string;
178
181
  };
179
182
  };
@@ -264,6 +267,37 @@ declare const GUIDE_DEFAULT_VALUES: {
264
267
  version: string;
265
268
  type: ObjectType.Guide;
266
269
  };
270
+ declare const GenerateContentActionOrigin: {
271
+ readonly COPILOT: "COPILOT";
272
+ readonly RIGHT_PANEL: "RIGHT_PANEL";
273
+ readonly LEFT_PANEL: "LEFT_PANEL";
274
+ readonly MICRO_APP: "MICRO_APP";
275
+ readonly IMAGE_SETS: "IMAGE_SETS";
276
+ readonly AI_CHAT: "AI_CHAT";
277
+ readonly SMARTBOARD: "SMARTBOARD";
278
+ readonly AI_INPUT_GENERATE_IMAGE: "AI_INPUT_GENERATE_IMAGE";
279
+ readonly AI_INPUT_REMIX_IMAGE: "AI_INPUT_REMIX_IMAGE";
280
+ readonly AI_INPUT_GENERATE_VIDEO: "AI_INPUT_GENERATE_VIDEO";
281
+ readonly AI_INPUT_MICRO_EDITOR_REMIX: "AI_INPUT_MICRO_EDITOR_REMIX";
282
+ readonly AI_INPUT_MICRO_EDITOR_INPAINT: "AI_INPUT_MICRO_EDITOR_INPAINT";
283
+ readonly AI_HUB_GENERATE_IMAGE: "AI_HUB_GENERATE_IMAGE";
284
+ readonly AI_HUB_REMIX_IMAGE: "AI_HUB_REMIX_IMAGE";
285
+ readonly AI_HUB_GENERATE_VIDEO: "AI_HUB_GENERATE_VIDEO";
286
+ readonly VIDEOBOARD: "VIDEOBOARD";
287
+ readonly AGENT: "AGENT";
288
+ readonly WORKFLOW: "WORKFLOW";
289
+ readonly AI_HUB_AGENT: "AI_HUB_AGENT";
290
+ readonly MCP: "MCP";
291
+ readonly MCP_WORKFLOW: "MCP_WORKFLOW";
292
+ readonly AI_AGENT: "AI_AGENT";
293
+ readonly AI_AGENT_CHAT: "AI_AGENT_CHAT";
294
+ readonly AI_AGENT_CHAT_WEBSITE: "AI_AGENT_CHAT_WEBSITE";
295
+ readonly MOBILE_APP_GENERATE_IMAGE: "MOBILE_APP_GENERATE_IMAGE";
296
+ readonly MOBILE_APP_REMIX_IMAGE: "MOBILE_APP_REMIX_IMAGE";
297
+ readonly MOBILE_APP_GENERATE_VIDEO: "MOBILE_APP_GENERATE_VIDEO";
298
+ readonly MOBILE_APP_AGENT: "MOBILE_APP_AGENT";
299
+ readonly AI_AGENT_WORKFLOW: "AI_AGENT_WORKFLOW";
300
+ };
267
301
  declare const GenerationStatus: {
268
302
  readonly CREATED: "CREATED";
269
303
  readonly QUEUED: "QUEUED";
@@ -412,6 +446,7 @@ declare const PendingOperation: {
412
446
  readonly UPSCALE: "upscale";
413
447
  readonly REMOVE_BACKGROUND: "removeBackground";
414
448
  readonly REFRAME: "reframe";
449
+ readonly RASTERIZE: "rasterize";
415
450
  };
416
451
  declare const RICH_TEXT_DEFAULT_VALUES: {
417
452
  opacity?: number | undefined;
@@ -706,6 +741,17 @@ export interface AddFontStyleOptions {
706
741
  /**
707
742
  * API for managing application state including selection, viewport, active tool, and canvas mode.
708
743
  *
744
+ * ## Selection
745
+ *
746
+ * {@link AppState.selectionIds} is the only stored selection list; every
747
+ * selection getter is derived from it and the current design state. Derived results are identity-stable — the very same array instance is
748
+ * returned until the selection or the design state changes — so React
749
+ * subscribers and the extension bridge can diff them by reference.
750
+ *
751
+ * Every selection setter replaces the whole selection: whatever ids it is
752
+ * given are expanded into their closure and committed to
753
+ * {@link AppState.selectionIds}.
754
+ *
709
755
  * @public
710
756
  */
711
757
  export interface AppStateAPI {
@@ -714,7 +760,7 @@ export interface AppStateAPI {
714
760
  */
715
761
  getSelectedObjectsIds(): string[];
716
762
  /**
717
- * Sets the selected object IDs.
763
+ * Replaces the selection with the given objects.
718
764
  *
719
765
  * @param ids - Array of object IDs to select
720
766
  * @param origin - Optional origin tag for loop prevention in bidirectional syncs.
@@ -727,41 +773,51 @@ export interface AppStateAPI {
727
773
  */
728
774
  getSelectedLayersIds(): string[];
729
775
  /**
730
- * Sets the selected layer IDs.
776
+ * Replaces the selection with the given layers.
777
+ *
778
+ * Board sub-layer ids (artboard, background, texture) select the board they
779
+ * belong to.
731
780
  *
732
781
  * @param ids - Array of layer IDs to select
782
+ * @param origin - Optional origin tag for loop prevention in bidirectional syncs
733
783
  */
734
- setSelectedLayersIds(ids: string[]): void;
784
+ setSelectedLayersIds(ids: string[], origin?: Origin): void;
735
785
  /**
736
786
  * Gets the IDs of selected artboards.
737
787
  */
738
788
  getSelectedArtboardIds(): string[];
739
789
  /**
740
- * Sets the selected artboard IDs.
790
+ * Replaces the selection with the given artboards.
741
791
  *
742
792
  * @param ids - Array of artboard IDs to select
793
+ * @param origin - Optional origin tag for loop prevention in bidirectional syncs
743
794
  */
744
- setSelectedArtboardIds(ids: string[]): void;
795
+ setSelectedArtboardIds(ids: string[], origin?: Origin): void;
745
796
  /**
746
797
  * Gets the object IDs within selected artboards.
747
798
  */
748
799
  getSelectedArtboardsObjectIds(): string[];
749
800
  /**
750
- * Sets the object IDs within selected artboards.
801
+ * Replaces the selection with the given objects.
751
802
  *
752
803
  * @param ids - Array of object IDs
804
+ * @param origin - Optional origin tag for loop prevention in bidirectional syncs
753
805
  */
754
- setSelectedArtboardsObjectIds(ids: string[]): void;
806
+ setSelectedArtboardsObjectIds(ids: string[], origin?: Origin): void;
755
807
  /**
756
808
  * Gets all selected object IDs including objects, artboards, and artboard objects.
809
+ *
810
+ * A flat, deduplicated list of ids that exist as boards or objects; it never
811
+ * contains group ids or synthetic (`link__`, `path__`) ids.
757
812
  */
758
813
  getAllSelectedObjectsIds(): string[];
759
814
  /**
760
- * Sets all selected object IDs.
815
+ * Replaces the selection with the given ids.
761
816
  *
762
817
  * @param ids - Array of all object IDs to select
818
+ * @param origin - Optional origin tag for loop prevention in bidirectional syncs
763
819
  */
764
- setAllSelectedObjectsIds(ids: string[]): void;
820
+ setAllSelectedObjectsIds(ids: string[], origin?: Origin): void;
765
821
  /**
766
822
  * Gets the current canvas mode.
767
823
  *
@@ -955,11 +1011,13 @@ export interface AsyncAIAPI {
955
1011
  * Sandboxed-side API proxies where all calls resolve asynchronously.
956
1012
  */
957
1013
  export interface AsyncApiMapping {
1014
+ agent: WithAsync<PublicAgentAPI>;
958
1015
  ai: AsyncAIAPI;
959
1016
  aiGenerator: AsyncAIGeneratorAPI;
960
1017
  brandKit: WithAsync<PublicBrandKitAPI>;
961
1018
  mockup: WithAsync<MockupDataAPI>;
962
- context: AsyncContextAPI;
1019
+ /** One proxy serves every entrypoint, so it is typed with every mount's fields. */
1020
+ context: AsyncContextAPI<KittlWidestContext>;
963
1021
  data: AsyncDataAPI;
964
1022
  /** @deprecated Use `project.design.api`. */
965
1023
  design: AsyncDesignAPI;
@@ -1026,7 +1084,7 @@ export interface AsyncProjectAPI {
1026
1084
  createBatch(): Promise<AsyncBatchDesignAPI>;
1027
1085
  };
1028
1086
  app: {
1029
- state: AsyncPublicStateAPI<AppState, PublicAppSelectorState>;
1087
+ state: AsyncPublicStateAPI<PublicAppState, PublicAppSelectorState>;
1030
1088
  api: AsyncAppStateAPI;
1031
1089
  };
1032
1090
  }
@@ -1270,14 +1328,6 @@ export interface CancellableSubmission {
1270
1328
  * first point the backend reports a schedule.
1271
1329
  */
1272
1330
  until?: number;
1273
- /**
1274
- * Drops the work still being done to prepare this submission's generations,
1275
- * for a caller that handed the tracker an abort handle.
1276
- *
1277
- * Cancelling is `cancelGenerations`; this only saves finishing an upload for
1278
- * a generation the user has already stopped.
1279
- */
1280
- abort?: () => void;
1281
1331
  }
1282
1332
  /**
1283
1333
  * Methods for generating preview images and exports from the canvas.
@@ -2371,6 +2421,27 @@ export interface ImageAPI {
2371
2421
  * @throws When the specified image ID doesn't exist in the design
2372
2422
  */
2373
2423
  resetImageBackgroundRemoval(params: ResetImageBackgroundRemovalParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
2424
+ /**
2425
+ * Crops an image to its non-transparent pixels, for example after its
2426
+ * background was removed.
2427
+ *
2428
+ * Loads the image source, finds the transparent rows and columns along its
2429
+ * edges, and crops them away. The image is moved so its visible content
2430
+ * stays in place on the canvas, respecting rotation, scale, and flip.
2431
+ *
2432
+ * Leaves the image unchanged when it:
2433
+ * - is already cropped,
2434
+ * - has no transparent edges,
2435
+ * - is fully transparent, or
2436
+ * - had its source replaced while the image was loading.
2437
+ *
2438
+ * @param params - Configuration parameters identifying the image to trim
2439
+ * @param opts - Additional options for the design API operation
2440
+ * @returns Promise that resolves to the trimmed image object
2441
+ * @throws When the specified image ID doesn't exist in the design, or the
2442
+ * image source cannot be loaded or read
2443
+ */
2444
+ trimTransparentEdges(params: TrimTransparentEdgesParams, opts?: UpdateObjectApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
2374
2445
  }
2375
2446
  /** @public */
2376
2447
  export interface ImageGenerationResult {
@@ -2840,8 +2911,15 @@ export interface MockupDataAPI {
2840
2911
  getOverview(options?: Pick<PaginationOptions, "sort">): SdkResultAsync<MockupOverviewDto>;
2841
2912
  /** Fetches a paginated list of mockups within a specific group. */
2842
2913
  getGroup(groupId: string, options?: PaginationOptions): SdkResultAsync<MockupGroupDto>;
2843
- /** Searches mockups by a text query. */
2844
- search(query: string, options?: PaginationOptions): SdkResultAsync<PaginatedResult<CatalogItem>>;
2914
+ /**
2915
+ * Searches mockups by text. OpenSearch uses relevance ordering and ignores sort.
2916
+ *
2917
+ * @param query - Search text.
2918
+ * @param options - Pagination, database sort, and optional OpenSearch mode.
2919
+ *
2920
+ * @returns Lightweight catalog summaries or an SDK error.
2921
+ */
2922
+ search(query: string, options?: MockupSearchOptions): SdkResultAsync<PaginatedResult<CatalogItem>>;
2845
2923
  /** Fetches suggested tags and groups for mockup discovery. */
2846
2924
  getSuggestions(): SdkResultAsync<MockupSuggestions>;
2847
2925
  }
@@ -2879,6 +2957,14 @@ export interface MockupOverviewGroupDto {
2879
2957
  /** Total number of mockups in this group */
2880
2958
  total: number;
2881
2959
  }
2960
+ /** Pagination and search source options for the mockup catalog. */
2961
+ export interface MockupSearchOptions extends PaginationOptions {
2962
+ /**
2963
+ * Uses OpenSearch relevance ordering instead of database sorting when true.
2964
+ * OpenSearch currently ignores `sort`. Defaults to false.
2965
+ */
2966
+ useOpenSearch?: boolean;
2967
+ }
2882
2968
  /**
2883
2969
  * Suggested tags and groups for mockup discovery.
2884
2970
  */
@@ -3005,7 +3091,7 @@ export interface ObjectAPI {
3005
3091
  *
3006
3092
  * @example
3007
3093
  * ```typescript
3008
- * const objectApi = new ObjectAPI(projectManager, store);
3094
+ * const objectApi = new ObjectAPI(projectCapability, store);
3009
3095
  *
3010
3096
  * // Lock a background image to prevent accidental modification
3011
3097
  * const result = await objectApi.setLockedState({
@@ -3045,7 +3131,7 @@ export interface ObjectAPI {
3045
3131
  *
3046
3132
  * @example
3047
3133
  * ```typescript
3048
- * const objectApi = new ObjectAPI(projectManager, store);
3134
+ * const objectApi = new ObjectAPI(projectCapability, store);
3049
3135
  *
3050
3136
  * // Hide an object
3051
3137
  * const result = await objectApi.setHiddenState({
@@ -3096,7 +3182,7 @@ export interface ObjectAPI {
3096
3182
 
3097
3183
  * @example
3098
3184
  * ```typescript
3099
- * const objectApi = new ObjectAPI(projectManager, store);
3185
+ * const objectApi = new ObjectAPI(projectCapability, store);
3100
3186
  *
3101
3187
  * // Rotate a text element 90 degrees clockwise around its center (default)
3102
3188
  * await objectApi.rotateObject({
@@ -3269,6 +3355,43 @@ export interface PlacementAPI {
3269
3355
  batchClient?: BatchClient<NormalizedDesignState>;
3270
3356
  }): SmartPlacementOutput;
3271
3357
  }
3358
+ /**
3359
+ * Agent methods sandboxed extensions can call through the public SDK.
3360
+ *
3361
+ * Deliberately narrower than {@link AgentAPI}: a single-object, JSON-serializable
3362
+ * argument per method, and only what an apps panel item needs to hand work to
3363
+ * the agent. Both act on the chat open beside the panel, which the host
3364
+ * decides (see {@link AgentAPI.getOpenChatId}); an app never names a chat.
3365
+ * Listing, archiving and feedback stay host-internal.
3366
+ */
3367
+ export interface PublicAgentAPI {
3368
+ /**
3369
+ * Posts a text user message into the open chat and runs the agent on it.
3370
+ * Resolves once the run leaves its interruptible phase, like
3371
+ * {@link AgentAPI.sendMessage}. Text only: an image an app wants the agent
3372
+ * to see goes through {@link PublicAgentAPI.attachImage}, so the user stays
3373
+ * in charge of what is sent. Rejects when no chat is open, and while that
3374
+ * chat's run is still active (see {@link AgentAPI.getIsRunActive}): unlike
3375
+ * the host API, an app never replaces an answer the user is waiting for.
3376
+ */
3377
+ sendMessage: (args: PublicAgentSendMessageArgs) => Promise<void>;
3378
+ /**
3379
+ * Adds an image to the open chat composer's reference row. The user sees it
3380
+ * beside the prompt, can remove it, and sends it with their next message.
3381
+ * Nothing is sent by this call. See {@link AgentAPI.attachImage}.
3382
+ */
3383
+ attachImage: (args: PublicAgentAttachImageArgs) => Promise<void>;
3384
+ }
3385
+ /** Arguments of {@link PublicAgentAPI.attachImage}. */
3386
+ export interface PublicAgentAttachImageArgs {
3387
+ /** The image to attach: the record `upload.image.upload` returned. */
3388
+ image: SandboxedAgentComposerImage;
3389
+ }
3390
+ /** Arguments of {@link PublicAgentAPI.sendMessage}. */
3391
+ export interface PublicAgentSendMessageArgs {
3392
+ /** The user-role prompt to send, as the user had typed it. */
3393
+ text: string;
3394
+ }
3272
3395
  /**
3273
3396
  * Public drag-and-drop API for extension-provided images.
3274
3397
  *
@@ -3444,6 +3567,18 @@ export interface RotateObjectParams {
3444
3567
  y: OriginY;
3445
3568
  };
3446
3569
  }
3570
+ /**
3571
+ * An image an apps panel item attaches to the chat composer: the record
3572
+ * `upload.image.upload` returned to it. `id` is the upload object id the agent
3573
+ * loop stores (see {@link AgentMessageFilePart}); `objectName` is what the
3574
+ * host builds the thumbnail from.
3575
+ */
3576
+ export interface SandboxedAgentComposerImage {
3577
+ /** Upload object id of the image. */
3578
+ id: string;
3579
+ /** Storage object name of the upload, for the composer thumbnail. */
3580
+ objectName: string;
3581
+ }
3447
3582
  export interface SerializeBoardBase {
3448
3583
  objects: SerializedObject[];
3449
3584
  groupStructure: StructureObject;
@@ -3925,26 +4060,6 @@ export interface StructureObjectMeta {
3925
4060
  */
3926
4061
  maskBackgroundColor?: string | null;
3927
4062
  }
3928
- /**
3929
- * What a generation's caller knows about the submission it belongs to.
3930
- *
3931
- * One submission is one Stop, so every generation of a group shares these.
3932
- *
3933
- * @public
3934
- */
3935
- export interface SubmissionOptions {
3936
- /**
3937
- * Abandons the work of preparing this generation - rasterizing and uploading
3938
- * its reference images - when the caller stops the submission it belongs to.
3939
- *
3940
- * An optimization, not the way to cancel: stopping a generation is
3941
- * {@link AIGeneratorAPI.cancelGenerations}, which works the same with or
3942
- * without this, and aborting once the create request has been sent does
3943
- * nothing. Pass it to avoid finishing an upload whose generation the user
3944
- * has already taken back.
3945
- */
3946
- signal?: AbortSignal;
3947
- }
3948
4063
  /**
3949
4064
  * API for creating and managing text elements in the design.
3950
4065
  *
@@ -4376,7 +4491,8 @@ export interface WithObjectLayout {
4376
4491
  flipX: boolean;
4377
4492
  flipY: boolean;
4378
4493
  }
4379
- export type AIGenerationActionOrigin = "COPILOT" | "RIGHT_PANEL" | "LEFT_PANEL" | "MICRO_APP" | "IMAGE_SETS" | "AI_CHAT" | "SMARTBOARD" | "AI_INPUT_GENERATE_IMAGE" | "AI_INPUT_REMIX_IMAGE" | "AI_INPUT_GENERATE_VIDEO" | "AI_INPUT_MICRO_EDITOR_REMIX" | "AI_INPUT_MICRO_EDITOR_INPAINT" | "AI_HUB_GENERATE_IMAGE" | "AI_HUB_REMIX_IMAGE" | "AI_HUB_GENERATE_VIDEO" | "VIDEOBOARD" | "AGENT" | "AI_HUB_AGENT" | "WORKFLOW" | "MCP" | "MCP_WORKFLOW" | "AI_AGENT" | "AI_AGENT_CHAT" | "AI_AGENT_CHAT_WEBSITE" | "MOBILE_APP_GENERATE_IMAGE" | "MOBILE_APP_REMIX_IMAGE" | "MOBILE_APP_GENERATE_VIDEO" | "MOBILE_APP_AGENT";
4494
+ /** Where generation started, using the API's action-origin contract. */
4495
+ export type AIGenerationActionOrigin = GenerateContentActionOrigin;
4380
4496
  export type AIGenerationContentType = "image" | "video";
4381
4497
  export type AIGenerationModelTaskType = "IMAGE_TO_IMAGE" | "IMAGE_INPAINT" | "IMAGE_OUTPAINT" | "TEXT_TO_IMAGE" | "IMAGE_TO_VIDEO";
4382
4498
  /**
@@ -4451,11 +4567,9 @@ export type AIGeneratorAPI = {
4451
4567
  * @param generatorId - Unique identifier for the generator type
4452
4568
  * @param inputSettings - Generator-specific input parameters matching the API schema
4453
4569
  * @param output - Requested output settings for the generation
4454
- * @param options - What the caller knows about the submission this
4455
- * generation belongs to, see {@link SubmissionOptions}
4456
4570
  * @returns Object containing the generation ID
4457
4571
  */
4458
- generate: (generatorId: string, inputSettings: GenerationInputSettings, output: GenerationOutputSettings, options?: SubmissionOptions) => {
4572
+ generate: (generatorId: string, inputSettings: GenerationInputSettings, output: GenerationOutputSettings) => {
4459
4573
  generationId: string;
4460
4574
  };
4461
4575
  /**
@@ -4499,10 +4613,6 @@ export type AIGeneratorAPI = {
4499
4613
  * generation whose create request has not been sent is taken back without the
4500
4614
  * backend ever hearing about it.
4501
4615
  *
4502
- * Takes the submission rather than bare ids so this is also where the
4503
- * preparation still running for it is dropped - callers never do that
4504
- * themselves, and so cannot forget to.
4505
- *
4506
4616
  * @param submission - The submission to stop, from `createSubmissionTracker`.
4507
4617
  * A caller without a tracker can pass `{ generationIds }`.
4508
4618
  * @returns Promise resolving once every cancellation settled, listing the
@@ -4809,7 +4919,7 @@ export type AddSmartboardParams = {
4809
4919
  } & {
4810
4920
  position: AbsolutePosition | RelativePosition;
4811
4921
  size: Dimensions;
4812
- };
4922
+ } & Pick<SmartboardOptions, "generationSettings">;
4813
4923
  /**
4814
4924
  * Comprehensive font and styling properties for text customization and typography control.
4815
4925
  *
@@ -4887,6 +4997,11 @@ export type AddTextParams = {
4887
4997
  * **Default dimensions**: 200x50 pixels if not specified
4888
4998
  */
4889
4999
  size: Dimensions;
5000
+ /**
5001
+ * When set, assigns the new text to this board instead of resolving the board
5002
+ * id via `getObjectBoardId`.
5003
+ */
5004
+ boardId?: string;
4890
5005
  };
4891
5006
  /**
4892
5007
  * Parameters for adding a new video to the design.
@@ -4974,6 +5089,11 @@ export type AnimateViewportToBoundsParams = ViewportAnimationSettings & ObjectPo
4974
5089
  */
4975
5090
  export type AnimateViewportToCenterParams = ViewportAnimationSettings & ObjectPositionRect;
4976
5091
  export type AnimationChannel = (typeof ANIMATION_CHANNELS)[number];
5092
+ /**
5093
+ * How a track combines with the object's own property: `add` is
5094
+ * `property + value`, `replace` sets it.
5095
+ */
5096
+ export type AnimationComposite = "add" | "replace";
4977
5097
  /**
4978
5098
  * `cubic-bezier(x1, y1, x2, y2)`; x values within `[0, 1]`, y values may
4979
5099
  * overshoot. A mutable tuple on purpose: `Normalized<>` cannot map `readonly`
@@ -4988,13 +5108,39 @@ export type AnimationCubicBezierEasing = {
4988
5108
  y2: number
4989
5109
  ];
4990
5110
  };
4991
- export type AnimationEasing = AnimationEasingName | AnimationCubicBezierEasing;
5111
+ export type AnimationEasing = AnimationEasingName | AnimationCubicBezierEasing | AnimationStepsEasing | AnimationHoldEasing;
4992
5112
  export type AnimationEasingName = (typeof ANIMATION_EASING_NAMES)[number];
5113
+ /** Keeps the keyframe value until the next keyframe. */
5114
+ export type AnimationHoldEasing = {
5115
+ type: "hold";
5116
+ };
4993
5117
  /**
4994
5118
  * Key of an animation in the design state, built from its
4995
5119
  * {@link AnimationTarget}: `objectId` or `objectId/pathItemId`.
4996
5120
  */
4997
5121
  export type AnimationKey = string;
5122
+ /**
5123
+ * Curve the target travels along, driven by the `offsetDistance` channel.
5124
+ * Offsets are added to the position, so the curve is relative to where the
5125
+ * target rests (usually ending at `0,0`), in its parent's units.
5126
+ */
5127
+ export type AnimationMotionPath = {
5128
+ /**
5129
+ * SVG path data made of one absolute `M` followed by absolute `L` / `C`
5130
+ * commands, e.g. `'M -200 300 C -150 100 -50 0 0 0'`. A string rather than
5131
+ * points keeps it one atomic value in the design state.
5132
+ */
5133
+ path: string;
5134
+ /** Rotates the target along the curve's tangent, on top of `rotate`. */
5135
+ autoRotate?: boolean;
5136
+ };
5137
+ export type AnimationShapeChannel = typeof ANIMATION_SHAPE_CHANNEL;
5138
+ /** `steps(count, position)`: jumps in `count` equal steps. */
5139
+ export type AnimationStepsEasing = {
5140
+ type: "steps";
5141
+ count: number;
5142
+ position: "start" | "end";
5143
+ };
4998
5144
  export type Animations = Record<AnimationKey, NormalizedAnimation>;
4999
5145
  /**
5000
5146
  * Application state interface containing selection, viewport, active tool, and other UI state.
@@ -5006,25 +5152,27 @@ export type Animations = Record<AnimationKey, NormalizedAnimation>;
5006
5152
  */
5007
5153
  export type AppState = {
5008
5154
  /**
5009
- * Array of selected objects' ids.
5010
- * Note: unlike `selectedLayersIds`, this includes all selected objects regardless group structure; there won't be ids of groups.
5011
- */
5012
- selectedObjectsIds: string[];
5013
- /**
5014
- * Array of selected layers' ids.
5015
- * Note: all items in the list are on the same level in the group structure; there might be ids of groups.
5016
- */
5017
- selectedLayersIds: string[];
5018
- /**
5019
- * Array of selected artboards' ids.
5020
- */
5021
- selectedArtboardIds: string[];
5022
- /**
5023
- * Array of selected artboards' object ids.
5155
+ * Every selected id, in selection order — the single stored selection list
5156
+ * every selection getter of {@link AppStateAPI} (including
5157
+ * `getAllSelectedObjectsIds`) is derived from.
5158
+ *
5159
+ * The list holds the full closure of the selection: selecting a board or a
5160
+ * group also lists everything nested inside it, in canvas render order. It
5161
+ * mixes all the kinds of things that can be selected:
5162
+ *
5163
+ * - board ids
5164
+ * - object ids
5165
+ * - group ids (structure nodes that are not objects themselves)
5166
+ * - `link__<inputBoardId>_<targetBoardId>` ids for the connection between a
5167
+ * smartboard input and its target
5168
+ * - `path__<childObjectId>` ids for a single sub-path of an illustration
5169
+ * - ids the design state does not know yet, passed through untouched
5170
+ *
5171
+ * A board's texture and background are not selectable on their own: they
5172
+ * exist only as layer ids, which {@link AppStateAPI.getSelectedLayersIds}
5173
+ * derives from the selected board.
5024
5174
  */
5025
- selectedArtboardsObjectIds: string[];
5026
- /** All selected objects including: objects, artboards and artboards' objects */
5027
- allSelectedObjectsIds: string[];
5175
+ selectionIds: string[];
5028
5176
  /**
5029
5177
  * Active canvas mode after its mode-specific entry succeeds.
5030
5178
  *
@@ -5046,6 +5194,12 @@ export type AppState = {
5046
5194
  isViewOnlyMode: boolean;
5047
5195
  /** Whether the loaded design contains objects outside the supported viewport bounds. */
5048
5196
  hasLegacyOutOfBoundsObjects: boolean;
5197
+ /**
5198
+ * Canvas-owned: true when recoverable content exists but none is in view.
5199
+ * Excludes helpers and hidden/transparent objects; false in runtimes without
5200
+ * the renderer's content visibility stage and outside the default working mode.
5201
+ */
5202
+ isContentOutOfView: boolean;
5049
5203
  canvasSettings: SettingsType;
5050
5204
  /** Last-used pen tool stroke/fill settings, applied to newly drawn paths. */
5051
5205
  penToolSetting: {
@@ -5170,7 +5324,7 @@ export type BoundingRect = {
5170
5324
  bottom: number;
5171
5325
  right: number;
5172
5326
  };
5173
- /** Brand kit data exposed through the project manager. */
5327
+ /** Brand kit data exposed through the `brandKit` capability. */
5174
5328
  export type BrandKit = {
5175
5329
  id: string;
5176
5330
  name: string;
@@ -5272,6 +5426,16 @@ export type CanvasMode = {
5272
5426
  } | {
5273
5427
  mode: "inpaint";
5274
5428
  targetId: string;
5429
+ }
5430
+ /**
5431
+ * A rich text object is being edited. Set by the canvas while the text is in
5432
+ * editing mode; it is not a `CanvasModeManager` mode. `range` holds the
5433
+ * selected characters and is absent until the canvas reports it.
5434
+ */
5435
+ | {
5436
+ mode: "text-editing";
5437
+ targetId: string;
5438
+ range?: TextRange;
5275
5439
  } | {
5276
5440
  mode: "custom";
5277
5441
  id: string;
@@ -5284,7 +5448,7 @@ export type CanvasMode = {
5284
5448
  *
5285
5449
  * @public
5286
5450
  */
5287
- export type CanvasModeKind = "erase" | "erase-and-fill" | "crop" | "reframe" | "inpaint" | null;
5451
+ export type CanvasModeKind = "erase" | "erase-and-fill" | "crop" | "reframe" | "inpaint" | "text-editing" | null;
5288
5452
  /**
5289
5453
  * The index of a character in the rich text object.
5290
5454
  */
@@ -5368,6 +5532,10 @@ export type CreateBasicShapeInput = CreateElementWithPositionAndSize & {
5368
5532
  */
5369
5533
  export type CreateBoardParams = Omit<CreateElementWithPositionAndSize, "size" | "boardId"> & {
5370
5534
  title?: string;
5535
+ /**
5536
+ * Layout of the new artboard. Defaults to the standard layout.
5537
+ */
5538
+ activeLayout?: ArtboardOptions["activeLayout"];
5371
5539
  /**
5372
5540
  * size required on artboard
5373
5541
  */
@@ -5673,6 +5841,7 @@ export type FileBrowserCapability = {
5673
5841
  * Union of nodes a dynamic tab can return.
5674
5842
  */
5675
5843
  export type FileBrowserContent = FileBrowserItem | FileBrowserFolder;
5844
+ export type FileBrowserContentSource = "generated" | "uploaded";
5676
5845
  /**
5677
5846
  * Input arguments for a file browser content request.
5678
5847
  */
@@ -5748,6 +5917,8 @@ export type FileBrowserItem = {
5748
5917
  animatedPreview?: string;
5749
5918
  content: {
5750
5919
  data: string;
5920
+ /** Identifies whether the content came from uploads or generated content. */
5921
+ source?: FileBrowserContentSource;
5751
5922
  /** Optional MIME type used when materializing the selected asset. */
5752
5923
  mimeType?: string;
5753
5924
  /** Persisted upload classification. */
@@ -5909,6 +6080,7 @@ export type FullColor = {
5909
6080
  visible: boolean;
5910
6081
  };
5911
6082
  export type FunctionType = (...args: never) => unknown;
6083
+ export type GenerateContentActionOrigin = (typeof GenerateContentActionOrigin)[keyof typeof GenerateContentActionOrigin];
5912
6084
  /** Alias: capability name for AIGenerationInputSettings. @public */
5913
6085
  export type GenerationInputSettings = AIGenerationInputSettings;
5914
6086
  /** Alias: capability name for AIGenerationOutputSettings. @public */
@@ -6158,6 +6330,22 @@ export type JSONObject = {
6158
6330
  [key: string]: JSONValue;
6159
6331
  };
6160
6332
  export type JSONValue = null | boolean | number | string | Array<JSONValue> | JSONObject;
6333
+ export type KeyframeBase = {
6334
+ id: string;
6335
+ /**
6336
+ * Easing of the segment that starts at this keyframe. Defaults to
6337
+ * {@link DEFAULT_KEYFRAME_EASING}, ignored on the last keyframe.
6338
+ */
6339
+ easing?: AnimationEasing;
6340
+ };
6341
+ /**
6342
+ * Every field any mounting point's host context can carry. The extension-side
6343
+ * bridge is typed with it because it is one proxy shared by all entrypoints;
6344
+ * each entrypoint narrows it to the context its mounting point receives.
6345
+ *
6346
+ * @public
6347
+ */
6348
+ export type KittlWidestContext = KittlEditorContext;
6161
6349
  /**
6162
6350
  * The predefined OpenType variation axes. However, a font can define custom
6163
6351
  * axes using a four-character string.
@@ -6178,6 +6366,15 @@ export type LeftTopPosition = {
6178
6366
  left: number;
6179
6367
  top: number;
6180
6368
  };
6369
+ /**
6370
+ * The derived selection lists readable through the `appState` subscribe
6371
+ * channel. None of them is stored in {@link AppState} (only the selection
6372
+ * closure `selectionIds` is); they are derived by the app state API, and the host bridge merges
6373
+ * them in before delivering updates (see `createExtensionAppStateStore` in
6374
+ * `@repo/sandbox-wrapper`), so published extensions can keep subscribing to
6375
+ * them by their legacy names.
6376
+ */
6377
+ export type LegacySelectionKey = "selectedObjectsIds" | "selectedLayersIds" | "selectedArtboardIds" | "selectedArtboardsObjectIds" | "allSelectedObjectsIds";
6181
6378
  /**
6182
6379
  * The line height of the text.
6183
6380
  */
@@ -6273,8 +6470,6 @@ export type MicroEditorWorkflowSource = {
6273
6470
  presetId: string;
6274
6471
  /** Whether outputs from the workflow preset support layerization. */
6275
6472
  isLayerizable: boolean;
6276
- /** Whether this particular workflow result is ready for layerization. */
6277
- readyToLayerize?: boolean;
6278
6473
  /** Generated-content record associated with this workflow result. */
6279
6474
  generatedContentId?: string;
6280
6475
  /** Original upload id accepted by the image-spec API. */
@@ -6409,10 +6604,20 @@ export type NormalizeValue<T> = T extends null | undefined ? T : NonNullable<T>
6409
6604
  * instead of trying to normalize the union as a whole.
6410
6605
  */
6411
6606
  export type Normalized<T> = T extends null | undefined ? T : T extends Builtin ? T : T extends unknown[] | readonly unknown[] ? NormalizeArray<T> : T extends object ? NormalizeObject<T> : T;
6412
- /** `keyframes` becomes a record plus `keyframesIndices` for ordering. */
6413
- export type NormalizedAnimation = Normalized<SerializedAnimation>;
6607
+ /** `tracks` becomes a record plus `tracksIndices` for ordering. */
6608
+ export type NormalizedAnimation = Normalized<Omit<SerializedAnimation, "tracks">> & {
6609
+ tracks: Record<string, NormalizedTrack>;
6610
+ tracksIndices: Record<string, string>;
6611
+ };
6414
6612
  export type NormalizedBasicShapeObject = Normalized<BasicShapeSerializedObject>;
6415
6613
  export type NormalizedBoard = NormalizedStandardBoard | NormalizedFloatingBoard;
6614
+ /**
6615
+ * `keyframes` becomes a record plus `keyframesIndices` for ordering. A record
6616
+ * has no first entry, so it holds any {@link SerializedKeyframe}.
6617
+ */
6618
+ export type NormalizedChannelTrack = Normalized<Omit<SerializedChannelTrack, "keyframes"> & {
6619
+ keyframes: SerializedKeyframe[];
6620
+ }>;
6416
6621
  export type NormalizedCombinedShapeObject = Normalized<CombinedShapeSerializedObject>;
6417
6622
  export type NormalizedDesignState = {
6418
6623
  boards: Record<ID, NormalizedBoard>;
@@ -6446,11 +6651,14 @@ export type NormalizedPathTextObject = Normalized<PathTextSerializedObject>;
6446
6651
  * In the normalized form all object references are replaced by their ids.
6447
6652
  */
6448
6653
  export type NormalizedRichTextObject = Normalized<RichTextSerializedObject>;
6654
+ /** `keyframes` becomes a record plus `keyframesIndices` for ordering. */
6655
+ export type NormalizedShapeTrack = Normalized<SerializedShapeTrack>;
6449
6656
  /**
6450
6657
  * The normalized version of a StandardBoard
6451
6658
  */
6452
6659
  export type NormalizedStandardBoard<T extends ArtboardOptions = ArtboardOptions> = Normalized<BaseStandardBoard<T>>;
6453
6660
  export type NormalizedStandardObject = NormalizedBasicShapeObject | NormalizedCombinedShapeObject | NormalizedIllustrationImageObject | NormalizedIllustrationObject | NormalizedLoadingCardObject | NormalizedMaskObject | NormalizedMockupDesignObject | NormalizedPathTextObject | NormalizedRichTextObject | NormalizedVideoObject;
6661
+ export type NormalizedTrack = NormalizedChannelTrack | NormalizedShapeTrack;
6454
6662
  export type NormalizedVideoObject = Normalized<VideoSerializedObject>;
6455
6663
  export type NullablePathTextShadowOptions = PathTextShadowOptions | {
6456
6664
  type: null;
@@ -6678,6 +6886,8 @@ export type PlainInputSetting = {
6678
6886
  isPremium?: boolean;
6679
6887
  name: "combineBoards" | (string & {});
6680
6888
  label?: string;
6889
+ /** Help text shown when hovering a boolean setting. */
6890
+ tooltip?: string;
6681
6891
  disabled?: true;
6682
6892
  } & ({
6683
6893
  type: "selection";
@@ -6720,18 +6930,16 @@ export type PrintMargins = {
6720
6930
  bottom: number;
6721
6931
  left: number;
6722
6932
  };
6933
+ /** Generator API exposed to iframe clients. Same as {@link AIGeneratorAPI}. */
6934
+ export type PublicAIGeneratorAPI = AIGeneratorAPI;
6935
+ /** App selectors cover the approved subscription fields within the full snapshot. */
6936
+ export type PublicAppSelectorState = Pick<PublicAppState, (typeof APP_STATE_SUBSCRIPTION_KEYS)[number]>;
6723
6937
  /**
6724
- * Generator API exposed to iframe clients. Local AbortSignals and abort callbacks
6725
- * cannot cross postMessage; cancellation uses the host's generation IDs instead.
6938
+ * The shape of the state extensions can subscribe to over the `appState`
6939
+ * channel: the current {@link AppState} plus the five derived, read-only
6940
+ * {@link LegacySelectionKey} lists.
6726
6941
  */
6727
- export type PublicAIGeneratorAPI = Omit<AIGeneratorAPI, "generate" | "cancelGenerations"> & {
6728
- /** Starts a generation without accepting a caller-local AbortSignal. */
6729
- generate: (generatorId: string, inputSettings: GenerationInputSettings, output: GenerationOutputSettings) => ReturnType<AIGeneratorAPI["generate"]>;
6730
- /** Cancels a submission using only its serializable fields. */
6731
- cancelGenerations: (submission: Pick<CancellableSubmission, "generationIds" | "until">) => ReturnType<AIGeneratorAPI["cancelGenerations"]>;
6732
- };
6733
- /** App selectors cover the approved subscription fields within the full snapshot. */
6734
- export type PublicAppSelectorState = Pick<AppState, (typeof APP_STATE_SUBSCRIPTION_KEYS)[number]>;
6942
+ export type PublicAppState = AppState & Record<LegacySelectionKey, string[]>;
6735
6943
  /**
6736
6944
  * Brand kit methods sandboxed extensions can call through the public SDK.
6737
6945
  * Read-only for now: image uploads into a brand kit need a write scope first.
@@ -7426,8 +7634,9 @@ export type SerialisedPhotoFilter = ({
7426
7634
  export type SerializableCornerRadii = Record<string, Record<string, number>>;
7427
7635
  export type SerializableObjectType = ObjectType.IllustrationImage | ObjectType.Illustration | ObjectType.Artboard | ObjectType.Smartboard | ObjectType.Videoboard | ObjectType.MockupBoard | ObjectType.PathText | ObjectType.RichText | ObjectType.MockupDesign | ObjectType.OverlayTexture | ObjectType.Mask | ObjectType.BasicShape | ObjectType.VectorPath | ObjectType.Guide | ObjectType.CombinedShape | ObjectType.LoadingCard | ObjectType.Video;
7428
7636
  /**
7429
- * Keyframes of one target. The animation lasts until its last keyframe (see
7430
- * `getAnimationDuration`), so there is no separate duration to keep in sync.
7637
+ * Tracks of one target, at most one per channel. The animation lasts until
7638
+ * its last keyframe (see `getAnimationDuration`), so there is no separate
7639
+ * duration to keep in sync.
7431
7640
  */
7432
7641
  export type SerializedAnimation = {
7433
7642
  /**
@@ -7438,22 +7647,77 @@ export type SerializedAnimation = {
7438
7647
  x: number;
7439
7648
  y: number;
7440
7649
  };
7441
- keyframes: SerializedKeyframe[];
7650
+ motionPath?: AnimationMotionPath;
7651
+ /**
7652
+ * Distance from the viewer to the canvas plane for the 3D channels, in
7653
+ * canvas px, like CSS `perspective()`; positive. Defaults to `1000`. When
7654
+ * several animations apply to one object, the most specific one that sets
7655
+ * it wins.
7656
+ */
7657
+ perspective?: number;
7658
+ tracks: SerializedTrack[];
7442
7659
  };
7443
7660
  export type SerializedAnimations = Record<AnimationKey, SerializedAnimation>;
7444
7661
  export type SerializedBoard = SerializedStandardBoard | SerializedFloatingBoard;
7445
- export type SerializedKeyframe = {
7662
+ /** Keyframes of one channel. */
7663
+ export type SerializedChannelTrack = {
7446
7664
  id: string;
7665
+ channel: AnimationChannel;
7666
+ composite: AnimationComposite;
7667
+ /** Unique times; the fractional-index order only breaks ties. */
7668
+ keyframes: SerializedKeyframes;
7669
+ };
7670
+ /** Any keyframe of a track, see {@link SerializedKeyframes} for their order. */
7671
+ export type SerializedKeyframe<TValue = number> = SerializedStartKeyframe<TValue> | SerializedTimedKeyframe<TValue>;
7672
+ /**
7673
+ * Keyframes of a track. Only the first one may be a start keyframe without
7674
+ * `value`; every later keyframe has one. A track whose first keyframe comes
7675
+ * after `0` starts from the target's own value with
7676
+ * {@link DEFAULT_KEYFRAME_EASING}, as if it had a start keyframe without
7677
+ * value and easing.
7678
+ */
7679
+ export type SerializedKeyframes<TValue = number> = [
7680
+ ] | [
7681
+ SerializedKeyframe<TValue>,
7682
+ ...SerializedTimedKeyframe<TValue>[]
7683
+ ];
7684
+ export type SerializedObject = StandardSerializedObject | GuideSerializedObject;
7685
+ /**
7686
+ * Keyframe of the shape track: `value` is absolute SVG path data (`M L C Q
7687
+ * Z`). Lines, quadratics and cubics may morph into each other as long as the
7688
+ * structure (subpaths, segment count per subpath, closed flags) matches the
7689
+ * path's own; only positions interpolate. Every shape keyframe has a value,
7690
+ * since playback cannot read the path's own shape, and the track holds its
7691
+ * first shape before its first keyframe.
7692
+ */
7693
+ export type SerializedShapeKeyframe = SerializedTimedKeyframe<string>;
7694
+ /** Keyframes of the path shape; it replaces the shape, so has no composite. */
7695
+ export type SerializedShapeTrack = {
7696
+ id: string;
7697
+ channel: AnimationShapeChannel;
7698
+ /** Unique times; the fractional-index order only breaks ties. */
7699
+ keyframes: SerializedShapeKeyframe[];
7700
+ };
7701
+ /**
7702
+ * Keyframe at the animation start. Without `value` it starts from the
7703
+ * target's own value, like a CSS animation without a `0%` keyframe, so it
7704
+ * can set only the easing of the first segment.
7705
+ */
7706
+ export type SerializedStartKeyframe<TValue = number> = KeyframeBase & {
7707
+ time: 0;
7708
+ value?: TValue;
7709
+ };
7710
+ export type SerializedTimedKeyframe<TValue = number> = KeyframeBase & {
7447
7711
  /** Offset from the animation start, integer milliseconds. */
7448
7712
  time: number;
7449
- /** Easing of the segment that ends at this keyframe. Defaults to `linear`. */
7450
- easing?: AnimationEasing;
7451
- /** A channel that is omitted keeps its previous value. */
7452
- values: Partial<Record<AnimationChannel, number>>;
7453
- /** Channels not listed here use `add`. */
7454
- composites?: Partial<Record<AnimationChannel, "replace">>;
7713
+ /**
7714
+ * Relative to the object, not to the previous keyframe: with `add` an
7715
+ * offset from the object's own property (e.g. `translateX: 10` is 10px right
7716
+ * of the object), with `replace` the absolute property value.
7717
+ */
7718
+ value: TValue;
7455
7719
  };
7456
- export type SerializedObject = StandardSerializedObject | GuideSerializedObject;
7720
+ export type SerializedTrack = SerializedChannelTrack | SerializedShapeTrack;
7457
7721
  export type SetCanvasModeWithTargetOptions = {
7458
7722
  /**
7459
7723
  * Optional origin metadata for state propagation.
@@ -7463,6 +7727,11 @@ export type SetCanvasModeWithTargetOptions = {
7463
7727
  * Optional id of the object that should enter the mode.
7464
7728
  */
7465
7729
  targetId?: string | null;
7730
+ /**
7731
+ * Optional selected character range of the edited text. Only used by
7732
+ * `'text-editing'`.
7733
+ */
7734
+ range?: TextRange;
7466
7735
  };
7467
7736
  /** Color updates to apply to one object. */
7468
7737
  export type SetColorsParams = {
@@ -7542,6 +7811,7 @@ export type ShapeProperties = {
7542
7811
  skewY?: BasicShapeSerializedObject["skewY"];
7543
7812
  cornerRadii?: BasicShapeSerializedObject["cornerRadii"];
7544
7813
  name?: BasicShapeSerializedObject["name"];
7814
+ defaultName?: BasicShapeSerializedObject["defaultName"];
7545
7815
  shadowOptions?: BasicShapeSerializedObject["shadowOptions"];
7546
7816
  fill?: NonNullable<BasicShapeSerializedObject["fill"]>;
7547
7817
  fillColor?: NonNullable<BasicShapeSerializedObject["fill"]>[number]["value"];
@@ -7858,6 +8128,15 @@ export type TextProperties = {
7858
8128
  */
7859
8129
  strokeWidth?: number;
7860
8130
  };
8131
+ /**
8132
+ * Character range of the text being edited, in Fabric character indices.
8133
+ * A line break (`'\n'`) counts as one character, and `start === end` is a
8134
+ * caret without a selection.
8135
+ */
8136
+ export type TextRange = {
8137
+ start: number;
8138
+ end: number;
8139
+ };
7861
8140
  /**
7862
8141
  * Parameters for changing the hidden state of an illustration path.
7863
8142
  *
@@ -7878,6 +8157,9 @@ export type ToggleLockIllustrationPathParams = {
7878
8157
  pathId: string;
7879
8158
  locked: boolean;
7880
8159
  };
8160
+ export type TrimTransparentEdgesParams = {
8161
+ id: IllustrationImageSerializedObject["id"];
8162
+ };
7881
8163
  /** Preserves variant-specific object fields in design selectors. */
7882
8164
  export type UnionToIntersection<U> = (U extends unknown ? (value: U) => void : never) extends (value: infer I) => void ? I : never;
7883
8165
  /**
@@ -7945,6 +8227,9 @@ export type UpdateIllustrationParams = {
7945
8227
  stroke?: IllustrationSerializedObject["stroke"];
7946
8228
  strokeWidth?: IllustrationSerializedObject["strokeWidth"];
7947
8229
  fill?: IllustrationSerializedObject["fill"];
8230
+ opacity?: IllustrationSerializedObject["opacity"];
8231
+ flipX?: IllustrationSerializedObject["flipX"];
8232
+ flipY?: IllustrationSerializedObject["flipY"];
7948
8233
  };
7949
8234
  /**
7950
8235
  * Parameters for updating an existing image.
@@ -7966,6 +8251,23 @@ export type UpdateImageParams = {
7966
8251
  strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
7967
8252
  inpaintingStrokeWidth?: IllustrationImageSerializedObject["inpaintingStrokeWidth"];
7968
8253
  inpaintingSelectionMode?: IllustrationImageSerializedObject["inpaintingSelectionMode"];
8254
+ opacity?: IllustrationImageSerializedObject["opacity"];
8255
+ flipX?: IllustrationImageSerializedObject["flipX"];
8256
+ flipY?: IllustrationImageSerializedObject["flipY"];
8257
+ /**
8258
+ * Photo filters to add or replace, keyed by filter id; `null` removes one.
8259
+ * Merged into the current filters. Every filter must end up with an index
8260
+ * in `filtersIndices`, and an image has at most one filter of each type.
8261
+ */
8262
+ filters?: Record<string, NonNullable<NormalizedIllustrationImageObject["filters"]>[string] | null>;
8263
+ /**
8264
+ * Fractional index of each filter id, which sets the order the filters
8265
+ * apply in; `null` removes one. Merged into the current indices, so the
8266
+ * filters can be reordered without sending them.
8267
+ */
8268
+ filtersIndices?: Record<string, string | null>;
8269
+ globalCompositeOperation?: IllustrationImageSerializedObject["globalCompositeOperation"];
8270
+ backgroundRestorePathBoundary?: IllustrationImageSerializedObject["backgroundRestorePathBoundary"];
7969
8271
  } & GeneratableObject;
7970
8272
  export type UpdateImageSourceParams = {
7971
8273
  id: IllustrationImageSerializedObject["id"];
@@ -8105,6 +8407,36 @@ export type UpdateTextParams = {
8105
8407
  left?: number;
8106
8408
  top?: number;
8107
8409
  angle?: number;
8410
+ /**
8411
+ * Opacity of the whole text element, from 0 (transparent) to 1 (opaque)
8412
+ */
8413
+ opacity?: number;
8414
+ /**
8415
+ * Mirror the text horizontally
8416
+ */
8417
+ flipX?: boolean;
8418
+ /**
8419
+ * Mirror the text vertically
8420
+ */
8421
+ flipY?: boolean;
8422
+ /**
8423
+ * Width of the text box in pixels
8424
+ */
8425
+ width?: number;
8426
+ /**
8427
+ * Height of the text box in pixels
8428
+ */
8429
+ height?: number;
8430
+ /**
8431
+ * Per-character style overrides, in the compressed format the text
8432
+ * object stores. Replaces the stored overrides as a whole.
8433
+ */
8434
+ styles?: RichTextCompressedStyles;
8435
+ /**
8436
+ * Transform (warp, circle, free form or free line) shaping the text, with
8437
+ * its points. Replaces the stored transform as a whole.
8438
+ */
8439
+ activeTransformPlugin?: RichTextSerializedTransformPluginObject;
8108
8440
  } & Partial<TextProperties>;
8109
8441
  /**
8110
8442
  * Parameters for updating texture properties.
@@ -8269,6 +8601,13 @@ export type VideoboardOptions = ConnectedArtboardOptions<ObjectType.Videoboard>
8269
8601
  * @public
8270
8602
  */
8271
8603
  export type Viewport = {
8604
+ /**
8605
+ * Viewport size in screen pixels, measured from the canvas container.
8606
+ */
8607
+ pixelSize: {
8608
+ width: number;
8609
+ height: number;
8610
+ };
8272
8611
  /**
8273
8612
  * Viewport corners in canvas coordinates (derived from transform + canvas size).
8274
8613
  * - tl: top-left
@@ -8361,12 +8700,15 @@ export type ViewportAPI = {
8361
8700
  */
8362
8701
  setTransform(transform: Viewport["transform"], origin?: Origin): void;
8363
8702
  /**
8364
- * Returns the current viewport size in screen pixels.
8703
+ * Returns the current viewport size in screen pixels, measured from the
8704
+ * canvas container.
8365
8705
  */
8366
8706
  getPixelSize(): {
8367
8707
  width: number;
8368
8708
  height: number;
8369
8709
  };
8710
+ /** Reads the canvas-owned {@link AppState.isContentOutOfView} flag. */
8711
+ isContentOutOfView(): boolean;
8370
8712
  /**
8371
8713
  * Returns the current viewport zoom level.
8372
8714
  */
@@ -8396,7 +8738,8 @@ export type ViewportAPI = {
8396
8738
  */
8397
8739
  getCoords(): Viewport["coords"];
8398
8740
  /**
8399
- * Sets the viewport corner coordinates.
8741
+ * Sets the viewport corner coordinates and, when supplied, its measured
8742
+ * screen-space size.
8400
8743
  *
8401
8744
  * This is primarily for internal synchronization. In normal usage, prefer
8402
8745
  * updating the viewport via {@link set}, {@link setZoom}, or
@@ -8404,8 +8747,19 @@ export type ViewportAPI = {
8404
8747
  *
8405
8748
  * @param coords - The viewport corner coordinates to set
8406
8749
  * @param origin - Optional origin metadata for state propagation
8750
+ * @param pixelSize - Canvas-container size measured with these coordinates
8751
+ * (legacy callers that omit it derive a size from coordinates and zoom)
8752
+ */
8753
+ setCoords(coords: Viewport["coords"], origin?: Origin, pixelSize?: Viewport["pixelSize"]): void;
8754
+ /**
8755
+ * Publishes a viewport snapshot from the canvas renderer.
8756
+ *
8757
+ * Internal only — callers must obtain all fields from the same Fabric state.
8758
+ *
8759
+ * @param viewport - Transform, coordinates, and measured canvas size
8760
+ * @param origin - Optional origin metadata for state propagation
8407
8761
  */
8408
- setCoords(coords: Viewport["coords"], origin?: Origin): void;
8762
+ setSnapshot(viewport: Viewport, origin?: Origin): void;
8409
8763
  /**
8410
8764
  * Returns the current viewport center in world space.
8411
8765
  */