@adobe/ccweb-add-on-sdk-types 1.24.0 → 1.26.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/ccweb-add-on-sdk-types",
3
- "version": "1.24.0",
3
+ "version": "1.26.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -46,7 +46,7 @@
46
46
  "@types/node": "18.18.2",
47
47
  "prettier": "2.8.0",
48
48
  "ts-node": "10.9.2",
49
- "typescript": "5.7.3"
49
+ "typescript": "5.9.3"
50
50
  },
51
51
  "scripts": {
52
52
  "clean": "",
@@ -92,11 +92,11 @@ declare namespace ApiConstants {
92
92
  }
93
93
 
94
94
  declare interface ApiModuleExport {
95
- editor: ExpressEditor;
95
+ editor: ExpressEditorWrapper;
96
96
  constants: unknown;
97
- colorUtils: ExpressColorUtils;
98
- fonts: ExpressFonts;
99
- viewport: ExpressViewport;
97
+ colorUtils: ExpressColorUtilsWrapper;
98
+ fonts: ExpressFontsWrapper;
99
+ viewport: ExpressViewportWrapper;
100
100
  }
101
101
 
102
102
  /**
@@ -386,6 +386,15 @@ export declare class BitmapImage {
386
386
  * Original height of the bitmap in pixels.
387
387
  */
388
388
  get height(): number;
389
+ /**
390
+ * <InlineAlert slots="text" variant="warning"/>
391
+ *
392
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
393
+ *
394
+ * @experimental
395
+ * Fetches the bitmap data as a Blob. This will wait for the bitmap to be available if necessary.
396
+ */
397
+ data(): Promise<Blob>;
389
398
  }
390
399
 
391
400
  /**
@@ -542,7 +551,7 @@ export declare class ColorUtils {
542
551
  toHex(color: Color): string;
543
552
  }
544
553
 
545
- export declare const colorUtils: ExpressColorUtils;
554
+ export declare const colorUtils: ExpressColorUtilsWrapper;
546
555
 
547
556
  /**
548
557
  * A ComplexShapeNode is a complex prepackaged shape that appears as a leaf node in the UI, even if it is composed
@@ -619,11 +628,6 @@ export declare class Context {
619
628
  * other UI state.
620
629
  */
621
630
  get insertionParent(): ContainerNode;
622
- /**
623
- * @returns The currently viewed page.
624
- * To change the current page, call {@link Viewport.bringIntoView} with an artboard or other content on that page.
625
- */
626
- get currentPage(): PageNode;
627
631
  }
628
632
 
629
633
  /**
@@ -689,7 +693,7 @@ export declare class Editor {
689
693
  /**
690
694
  * @returns the root of the document.
691
695
  */
692
- get documentRoot(): ExpressRootNode;
696
+ get documentRoot(): BaseNode;
693
697
  /**
694
698
  * @returns an ellipse node with default x/y radii, a black fill, and no initial stroke.
695
699
  * Transform values default to 0.
@@ -780,7 +784,7 @@ export declare class Editor {
780
784
  createPath(path: string): PathNode;
781
785
  }
782
786
 
783
- export declare const editor: ExpressEditor;
787
+ export declare const editor: ExpressEditorWrapper;
784
788
 
785
789
  /**
786
790
  * This enum represents the supported editor events.
@@ -828,11 +832,36 @@ export declare type EventHandlerId = string;
828
832
  declare const expressApiModule: ApiModuleExport;
829
833
  export default expressApiModule;
830
834
 
831
- declare class ExpressColorUtils extends ColorUtils {}
835
+ declare class ExpressColorUtilsWrapper extends ColorUtils {}
832
836
 
833
- declare class ExpressEditor extends Editor {}
837
+ /**
838
+ * Contains The Express specific APIs related to the current selection state.
839
+ */
840
+ export declare class ExpressContext extends Context {
841
+ /**
842
+ * @returns The currently viewed page.
843
+ * To change the current page, call {@link ExpressViewport.bringIntoView} with an artboard or other content on that page.
844
+ */
845
+ get currentPage(): PageNode;
846
+ }
834
847
 
835
- declare class ExpressFonts extends Fonts {}
848
+ /**
849
+ * Entry point for Express specific APIs that read or modify the document's content.
850
+ */
851
+ export declare class ExpressEditor extends Editor {
852
+ /**
853
+ * User's current selection context
854
+ */
855
+ get context(): ExpressContext;
856
+ /**
857
+ * @returns the root of the document.
858
+ */
859
+ get documentRoot(): ExpressRootNode;
860
+ }
861
+
862
+ declare class ExpressEditorWrapper extends ExpressEditor {}
863
+
864
+ declare class ExpressFontsWrapper extends Fonts {}
836
865
 
837
866
  /**
838
867
  * An ExpressRootNode represents the root node of the document's "scenegraph" artwork tree. The root contains a collection
@@ -848,7 +877,27 @@ export declare class ExpressRootNode extends BaseNode {
848
877
  get pages(): PageList;
849
878
  }
850
879
 
851
- declare class ExpressViewport extends Viewport {}
880
+ /**
881
+ * Represents the area of the canvas that is currently visible on-screen.
882
+ */
883
+ export declare class ExpressViewport {
884
+ /**
885
+ * Adjusts the viewport to make the node's bounds visible on-screen, assuming all bounds are within the artboard bounds.
886
+ * Makes the node's {@link ArtboardNode} or {@link PageNode} visible if they were not already visible
887
+ * (which may result in {@link Context.selection} being cleared). It is strongly recommended
888
+ * to further draw user's attention to the node, set it as the {@link Context.selection} following this call.
889
+ *
890
+ * After this call, the value of {@link Context.insertionParent} will always be the node containing {@link ArtboardNode}.
891
+ *
892
+ * Note that the node might still not appear visible if:
893
+ * - Its animation settings make it invisible at the beginning of the {@link ArtboardNode} "scene".
894
+ * - It is obscured underneath other artwork in the z-order.
895
+ * - It is hidden by a {@link GroupNode}'s mask or similar cropping.
896
+ */
897
+ bringIntoView(node: VisualNode): void;
898
+ }
899
+
900
+ declare class ExpressViewportWrapper extends ExpressViewport {}
852
901
 
853
902
  /**
854
903
  * Base interface representing any fill in the scenegraph. See {@link FillableNode}.
@@ -923,7 +972,7 @@ export declare class Fonts {
923
972
  fromPostscriptName(postscriptName: string): Promise<AvailableFont | undefined>;
924
973
  }
925
974
 
926
- export declare const fonts: ExpressFonts;
975
+ export declare const fonts: ExpressFontsWrapper;
927
976
 
928
977
  /**
929
978
  * A GridCellNode represents the media aspect of a grid cell. Unlike MediaContainerNodes, grid cells cannot be
@@ -1024,7 +1073,17 @@ declare interface IFillableNode {
1024
1073
  * ImageRectangleNodes cannot be created directly; use {@link Editor.createImageContainer} to create the entire
1025
1074
  * container structure together.
1026
1075
  */
1027
- export declare class ImageRectangleNode extends MediaRectangleNode {}
1076
+ export declare class ImageRectangleNode extends MediaRectangleNode {
1077
+ /**
1078
+ * <InlineAlert slots="text" variant="warning"/>
1079
+ *
1080
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1081
+ *
1082
+ * @experimental
1083
+ * Fetches the bitmap image resource used by this node. This will wait for the bitmap to be available if necessary.
1084
+ */
1085
+ fetchBitmapImage(): Promise<BitmapImage>;
1086
+ }
1028
1087
 
1029
1088
  /**
1030
1089
  * Interface for nodes that contain media.
@@ -1902,6 +1961,13 @@ export declare interface SolidColorStroke extends Stroke {
1902
1961
  export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "type"> &
1903
1962
  Partial<Pick<SolidColorStroke, "type">>;
1904
1963
 
1964
+ /**
1965
+ * StandaloneTextContentModel represents a complete piece of text content contained within a single {@link StandaloneTextNode}.
1966
+ */
1967
+ export declare class StandaloneTextContentModel extends TextNodeContentModel {
1968
+ get allTextNodes(): Readonly<Iterable<StandaloneTextNode>>;
1969
+ }
1970
+
1905
1971
  /**
1906
1972
  * A StandaloneTextNode represents text that is displayed *entirely* within one single frame in the scenegraph (in
1907
1973
  * contrast to {@link ThreadedTextNode}, where text may flow across several separate display "frames").
@@ -1910,6 +1976,16 @@ export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "t
1910
1976
  * To create a new StandaloneTextNode, see {@link Editor.createText}.
1911
1977
  */
1912
1978
  export declare class StandaloneTextNode extends TextNode {
1979
+ /**
1980
+ * Always returns true for this StandaloneTextNode, indicating that it is not part of a multi-frame text flow.
1981
+ */
1982
+ isStandaloneText(): this is StandaloneTextNode;
1983
+ /**
1984
+ * The model containing the complete text string and its styles, all which will be visible within the bounds of
1985
+ * this specific StandaloneTextNode.
1986
+ *
1987
+ */
1988
+ get fullContent(): StandaloneTextContentModel;
1913
1989
  get nextTextNode(): undefined;
1914
1990
  get layout(): Readonly<AutoWidthTextLayout | AutoHeightTextLayout | UnsupportedTextLayout>;
1915
1991
  /**
@@ -2279,7 +2355,7 @@ export declare abstract class TextNode extends Node {
2279
2355
  * encountered before.
2280
2356
  *
2281
2357
  */
2282
- get fullContent(): TextNodeContentModel;
2358
+ abstract get fullContent(): TextNodeContentModel;
2283
2359
  /**
2284
2360
  * Helper method to determine if the text is standalone.
2285
2361
  */
@@ -2329,7 +2405,7 @@ export declare abstract class TextNode extends Node {
2329
2405
  * split across multiple {@link ThreadedTextNode} frames for display.
2330
2406
  * Use this model to get or modify the text string and the style ranges applied to it.
2331
2407
  */
2332
- export declare class TextNodeContentModel extends TextContentModel {
2408
+ export declare abstract class TextNodeContentModel extends TextContentModel {
2333
2409
  /**
2334
2410
  * Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. This might be a single
2335
2411
  * {@link StandaloneTextNode} *or* a list of one or more {@link ThreadedTextNode}s. In the case of threaded text, the
@@ -2339,7 +2415,7 @@ export declare class TextNodeContentModel extends TextContentModel {
2339
2415
  *
2340
2416
  * All linked ThreadedTextNodes that share a single TextContentModel must remain together within the same artboard.
2341
2417
  */
2342
- get allTextNodes(): Readonly<Iterable<TextNode>>;
2418
+ abstract get allTextNodes(): Readonly<Iterable<TextNode>>;
2343
2419
  }
2344
2420
 
2345
2421
  /**
@@ -2393,6 +2469,18 @@ export declare enum TextStyleSource {
2393
2469
  firstReplacedCharacter = 2
2394
2470
  }
2395
2471
 
2472
+ /**
2473
+ * ThreadedTextContentModel represents a complete piece of text content that is split across multiple
2474
+ * {@link ThreadedTextNode} frames for display. This subclass provides a mutable {@link allFrames} list
2475
+ * that supports adding, removing, and reordering text frames.
2476
+ *
2477
+ * The append and insert operations will automatically parent the new frame to the same parent as the
2478
+ * reference frame and place it in the correct z-order.
2479
+ */
2480
+ export declare class ThreadedTextContentModel extends TextNodeContentModel {
2481
+ get allTextNodes(): Readonly<Iterable<ThreadedTextNode>>;
2482
+ }
2483
+
2396
2484
  /**
2397
2485
  * A ThreadedTextNode represents a text display frame in the scenegraph which is a subset of longer text that flows across
2398
2486
  * multiple such "frames". Because of this, the TextNode does not directly hold the text content and styles –
@@ -2403,6 +2491,22 @@ export declare enum TextStyleSource {
2403
2491
  * APIs are not yet available to create multi-frame text flows. To create *non*-threaded text, use {@link Editor.createText}.
2404
2492
  */
2405
2493
  export declare class ThreadedTextNode extends TextNode {
2494
+ /**
2495
+ * Always returns true for this ThreadedTextNode, indicating that it is part of a multi-frame text flow.
2496
+ */
2497
+ isThreadedText(): this is ThreadedTextNode;
2498
+ /**
2499
+ * The model containing the complete text string and its styles, only part of which may be visible within the bounds of
2500
+ * this specific ThreadedTextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a
2501
+ * fixed-size frame using {@link AreaTextLayout} does not fit all the (remaining) text.
2502
+ *
2503
+ * Note: When traversing the scenegraph in search of text content, bear in mind that multiple ThreadedTextNodes may refer to the
2504
+ * same single {@link ThreadedTextContentModel}; this can give the impression that the same text is duplicated multiple times when it is
2505
+ * not. Use {@link ThreadedTextContentModel}.id to determine whether a given piece of text content is unique or if it's already been
2506
+ * encountered before.
2507
+ *
2508
+ */
2509
+ get fullContent(): ThreadedTextContentModel;
2406
2510
  get nextTextNode(): ThreadedTextNode | undefined;
2407
2511
  get layout(): Readonly<AreaTextLayout>;
2408
2512
  /**
@@ -2459,27 +2563,7 @@ export declare interface UnsupportedTextLayout {
2459
2563
  type: TextLayout.magicFit | TextLayout.circular;
2460
2564
  }
2461
2565
 
2462
- /**
2463
- * Represents the area of the canvas that is currently visible on-screen.
2464
- */
2465
- export declare class Viewport {
2466
- /**
2467
- * Adjusts the viewport to make the node's bounds visible on-screen, assuming all bounds are within the artboard bounds.
2468
- * Makes the node's {@link ArtboardNode} or {@link PageNode} visible if they were not already visible
2469
- * (which may result in {@link Context.selection} being cleared). It is strongly recommended
2470
- * to further draw user's attention to the node, set it as the {@link Context.selection} following this call.
2471
- *
2472
- * After this call, the value of {@link Context.insertionParent} will always be the node containing {@link ArtboardNode}.
2473
- *
2474
- * Note that the node might still not appear visible if:
2475
- * - Its animation settings make it invisible at the beginning of the {@link ArtboardNode} "scene".
2476
- * - It is obscured underneath other artwork in the z-order.
2477
- * - It is hidden by a {@link GroupNode}'s mask or similar cropping.
2478
- */
2479
- bringIntoView(node: VisualNode): void;
2480
- }
2481
-
2482
- export declare const viewport: ExpressViewport;
2566
+ export declare const viewport: ExpressViewportWrapper;
2483
2567
 
2484
2568
  /**
2485
2569
  * Visual effects that can be applied to a text node.
package/ui/ui-sdk.d.ts CHANGED
@@ -887,7 +887,7 @@ export declare type DisableDragToDocument = () => void;
887
887
  */
888
888
  declare interface Document_2 {
889
889
  /**
890
- * Add image/PSD/AI assets to the current page
890
+ * Add image/PSD/AI/SVG assets to the current page
891
891
  */
892
892
  addImage(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
893
893
  /**
@@ -1139,6 +1139,10 @@ export declare enum EntrypointType {
1139
1139
  * Mobile more entrypoint type.
1140
1140
  */
1141
1141
  MOBILE_MORE = "mobile.more",
1142
+ /**
1143
+ * Mobile share entrypoint type.
1144
+ */
1145
+ MOBILE_SHARE = "mobile.share",
1142
1146
  /**
1143
1147
  * Schedule entrypoint type.
1144
1148
  */
@@ -1162,7 +1166,11 @@ export declare enum EntrypointType {
1162
1166
  /**
1163
1167
  * Quick action entrypoint type.
1164
1168
  */
1165
- QUICK_ACTION = "quick-action"
1169
+ QUICK_ACTION = "quick-action",
1170
+ /**
1171
+ * Content hub home (L1) entrypoint type.
1172
+ */
1173
+ CONTENT_HUB_HOME = "content-hub-home"
1166
1174
  }
1167
1175
 
1168
1176
  export declare interface Field {