@adobe/ccweb-add-on-sdk-types 1.10.0 → 1.11.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.10.0",
3
+ "version": "1.11.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -22,8 +22,6 @@
22
22
  * SOFTWARE.
23
23
  ********************************************************************************/
24
24
 
25
- /// <reference types="gl-matrix/index.js" />
26
-
27
25
  import { mat2d } from "gl-matrix";
28
26
 
29
27
  /**
@@ -124,6 +122,7 @@ declare interface ApiModuleExport {
124
122
  constants: unknown;
125
123
  colorUtils: ExpressColorUtils;
126
124
  fonts: ExpressFonts;
125
+ viewport: ExpressViewport;
127
126
  }
128
127
 
129
128
  /**
@@ -157,7 +156,7 @@ declare enum ArrowHeadType {
157
156
 
158
157
  /**
159
158
  * ArtboardList represents an ordered list of ArtboardNodes arranged in a timeline sequence, where they are called "scenes."
160
- * All items in the list are children of a single PageNode.
159
+ * All items in the list are children of a single {@link PageNode}.
161
160
  *
162
161
  * ArtboardList also provides APIs for adding/removing artboards from the page. ArtboardList is never empty: it is illegal to
163
162
  * remove the last remaining artboard from the list.
@@ -175,8 +174,11 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
175
174
 
176
175
  /**
177
176
  * An ArtboardNode represents an artboard object in the scenegraph. All user visual content must be contained on an artboard.
177
+ * Artboards are always contained on a {@link PageNode}; when a page contains multiple artboards, the artboards represent
178
+ * "scenes" in a linear timeline sequence.
179
+ *
180
+ * To create new artboards, see {@link ArtboardList.addArtboard}.
178
181
  *
179
- * When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.
180
182
  * Please note that creating and deleting an artboard in a single frame will crash the editor.
181
183
  */
182
184
  export declare class ArtboardNode extends VisualNode implements IRectangularNode, ContainerNode {
@@ -246,12 +248,28 @@ export declare class AvailableFont extends BaseFont {
246
248
  * **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`.
247
249
  *
248
250
  * @experimental
249
- * Base character styles that can be applied to a range of characters.
251
+ * Base character styles that can be applied to any range of characters.
252
+ * Excludes font style, which differs between the getter-oriented {@link CharacterStyles} interface and the
253
+ * setter-oriented {@link CharacterStylesInput}.
250
254
  */
251
255
  declare interface BaseCharacterStyles {
256
+ /**
257
+ * Size of the text in points.
258
+ */
252
259
  fontSize: number;
260
+ /**
261
+ * Text color.
262
+ */
253
263
  color: Color;
254
- tracking: number;
264
+ /**
265
+ * Uniformly adjusts the letter spacing, aka character spacing. Specified as a delta relative to the font's default
266
+ * spacing, in units of 1/1000 em: positive values increase the spacing, negative values tighten the spacing, and 0
267
+ * leaves spacing at its default.
268
+ */
269
+ letterSpacing: number;
270
+ /**
271
+ * Adds an underline to text.
272
+ */
255
273
  underline: boolean;
256
274
  }
257
275
 
@@ -415,7 +433,8 @@ declare enum BlendMode {
415
433
  * **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`.
416
434
  *
417
435
  * @experimental
418
- * Text styles of a range of characters, even a short span like a single word.
436
+ * Text styles that can be applied to any range of characters, even a short span like a single word. (Contrast with
437
+ * ParagraphStyles, which must be applied to an entire paragraph atomically).
419
438
  */
420
439
  export declare interface CharacterStyles extends BaseCharacterStyles {
421
440
  font: Font;
@@ -427,7 +446,11 @@ export declare interface CharacterStyles extends BaseCharacterStyles {
427
446
  * **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`.
428
447
  *
429
448
  * @experimental
430
- * Input shape of the applyCharacterStyle API.
449
+ * Variant of {@link CharacterStyles} with all style fields optional, used for applyCharacterStyles(). When using that API,
450
+ * any fields not specified are left unchanged, preserving the text's existing styles.
451
+ *
452
+ * If specified, the font must be of the {@link AvailableFont} type – one that is guaranteed to be available for the current
453
+ * user to edit with.
431
454
  */
432
455
  export declare interface CharacterStylesInput extends Partial<BaseCharacterStyles> {
433
456
  font?: AvailableFont;
@@ -439,7 +462,11 @@ export declare interface CharacterStylesInput extends Partial<BaseCharacterStyle
439
462
  * **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`.
440
463
  *
441
464
  * @experimental
442
- * Output shape of the characterStyleRange getter.
465
+ * A set of {@link CharacterStyles} along with the range of characters they apply to. Seen in the characterStyleRanges
466
+ * getter.
467
+ *
468
+ * Note that fonts returned by the getter are *not* guaranteed to be ones the user has rights to edit with, even though they
469
+ * are visible in the document.
443
470
  */
444
471
  export declare interface CharacterStylesRange extends CharacterStyles, StyleRange {}
445
472
 
@@ -449,7 +476,11 @@ export declare interface CharacterStylesRange extends CharacterStyles, StyleRang
449
476
  * **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`.
450
477
  *
451
478
  * @experimental
452
- * Input shape of the characterStyleRange setter.
479
+ * Variant of {@link CharacterStylesRange} with all style fields optional, along with the range of characters they apply to.
480
+ * Used for the characterStyleRanges setter. When invoking the setter, any fields not specified are reset to their defaults.
481
+ *
482
+ * If specified, the font must be of the {@link AvailableFont} type – one that is guaranteed to be available for the current
483
+ * user to edit with.
453
484
  */
454
485
  export declare interface CharacterStylesRangeInput extends CharacterStylesInput, StyleRange {}
455
486
 
@@ -559,9 +590,13 @@ export declare class Context {
559
590
  */
560
591
  get selection(): readonly Node[];
561
592
  /**
562
- * Sets the current selection, automatically ensuring these rules are met:
563
- * - Nodes must be within the current artboard (others are filtered out).
564
- * - A node cannot be selected at the same time as its ancestor (descendants are filtered out).
593
+ * Sets the current selection to an array of {@link Node}.
594
+ * Accepts a single node as a shortcut for a length-1 array `[node]` or
595
+ * `undefined` as a shortcut for `[]`, which clears the selection.
596
+ *
597
+ * Only node(s) that meet the following criteria can be selected:
598
+ * - Nodes must be within the current artboard (nodes outside the active artboard are filtered out).
599
+ * - A node cannot be selected if its ancestor is also selected (descendants are filtered out).
565
600
  * - Locked nodes are filtered out (but will still be included in selectionIncludingNonEditable).
566
601
  */
567
602
  set selection(nodes: Node | readonly Node[] | undefined);
@@ -694,7 +729,7 @@ export declare class Editor {
694
729
  * render as a gray placeholder on other clients until it has been uploaded to DCX and then downloaded by those clients.
695
730
  * This local client will act as having unsaved changes until the upload has finished.
696
731
  *
697
- * @param bitmapData - BitmapImage resource (e.g. returned from loadBitmapImage()).
732
+ * @param bitmapData - BitmapImage resource (e.g. returned from {@link loadBitmapImage}).
698
733
  * @param options - Additional configuration:
699
734
  * - initialSize - Size the image is displayed at. Must have the same aspect ratio as bitmapData. Defaults to the
700
735
  * size the image would be created at by a UI drag-drop gesture (typically the image's full size, but scaled down
@@ -782,7 +817,9 @@ export declare enum EditorEvent {
782
817
  export declare type EditorEventHandler = () => void;
783
818
 
784
819
  /**
785
- * An EllipseNode represents an ellipse object in the scenegraph.
820
+ * An EllipseNode represents an ellipse or circle shape in the scenegraph.
821
+ *
822
+ * To create new ellipse, see {@link Editor.createEllipse}.
786
823
  */
787
824
  export declare class EllipseNode extends FillableNode {
788
825
  /**
@@ -834,10 +871,13 @@ declare class ExpressFonts extends Fonts {}
834
871
  export declare class ExpressRootNode extends BaseNode {
835
872
  /**
836
873
  * The pages of the document. All visual content is contained on artboards within the pages.
874
+ * To create new pages, see {@link PageList.addPage}.
837
875
  */
838
876
  get pages(): PageList;
839
877
  }
840
878
 
879
+ declare class ExpressViewport extends Viewport {}
880
+
841
881
  /**
842
882
  * Base interface representing any fill in the scenegraph. See {@link FillableNode}.
843
883
  * Currently, you can only create {@link ColorFill}s, but you might encounter
@@ -933,6 +973,8 @@ export declare class GridCellNode extends MediaContainerNode {}
933
973
  /**
934
974
  * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to create
935
975
  * a layout grid that other content can be placed into.
976
+ *
977
+ * APIs to create a new grid layout are not yet available.
936
978
  */
937
979
  export declare class GridLayoutNode extends Node implements Readonly<IRectangularNode> {
938
980
  /**
@@ -959,6 +1001,8 @@ export declare class GridLayoutNode extends Node implements Readonly<IRectangula
959
1001
  /**
960
1002
  * A GroupNode represents a Group object in the scenegraph, which has a collection of generic children as well as a separate,
961
1003
  * optional vector mask child.
1004
+ *
1005
+ * To create new group, see {@link Editor.createGroup}.
962
1006
  */
963
1007
  export declare class GroupNode extends Node implements ContainerNode {
964
1008
  /**
@@ -997,6 +1041,9 @@ declare interface IFillableNode {
997
1041
  * ImageRectangleNode is a rectangular node that displays the image media part of a MediaContainerNode. It can only exist
998
1042
  * within that container parent. Cropping can be adjusted by changing this media's position/rotation (as well as its mask
999
1043
  * shape sibling node).
1044
+ *
1045
+ * ImageRectangleNodes cannot be created directly; use {@link Editor.createImageContainer} to create the entire
1046
+ * container structure together.
1000
1047
  */
1001
1048
  export declare class ImageRectangleNode extends Node implements Readonly<IRectangularNode> {
1002
1049
  /**
@@ -1077,7 +1124,9 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
1077
1124
  }
1078
1125
 
1079
1126
  /**
1080
- * A LineNode represents a simple line object in the scenegraph – a single straight-line segment.
1127
+ * A LineNode represents a simple vector line in the scenegraph – a single straight-line segment.
1128
+ *
1129
+ * To create new lines, see {@link Editor.createLine}.
1081
1130
  */
1082
1131
  export declare class LineNode extends StrokableNode {
1083
1132
  static readonly DEFAULT_START_X = 0;
@@ -1148,6 +1197,9 @@ export declare interface ListItem {}
1148
1197
  * A MediaContainerNode is a multi-node construct that displays media (such as images or video) with optional cropping and
1149
1198
  * clipping to a shape mask. The underlying media asset is always rectangular, but the final appearance of this node is
1150
1199
  * determined by the maskShape which is not necessarily a rectangle.
1200
+ *
1201
+ * To create new media container for a bitmap image, see {@link Editor.createImageContainer}. APIs for creating a
1202
+ * container with other content, such as videos, are not yet available.
1151
1203
  */
1152
1204
  export declare class MediaContainerNode extends Node {
1153
1205
  /**
@@ -1276,8 +1328,8 @@ export { Node as Node };
1276
1328
 
1277
1329
  /**
1278
1330
  * PageList represents an ordered list of PageNodes, all of which are children of the root node of the document's "scenegraph"
1279
- * artwork tree. A page contains one or more artboards, representing "scenes" in a linear timeline sequence. Those artboards
1280
- * in turn contain all the visual content of the document.
1331
+ * artwork tree (see {@link ExpressRootNode}). A page contains one or more artboards, representing "scenes" in a linear timeline
1332
+ * sequence. Those artboards in turn contain all the visual content of the document.
1281
1333
  *
1282
1334
  * PageList also provides APIs for adding/removing pages from the document. PageList is never empty: it is illegal to
1283
1335
  * remove the last remaining page from the list.
@@ -1294,12 +1346,16 @@ export declare class PageList extends RestrictedItemList<PageNode> {
1294
1346
  }
1295
1347
 
1296
1348
  /**
1297
- * A PageNode represents a page in the document. A page contains one or more artboards, representing "scenes" in a linear
1298
- * timeline sequence. Those artboards in turn contain all the visual content of the document.
1349
+ * A PageNode represents a page in the document, a child of the root node of the document's "scenegraph" artwork tree
1350
+ * (see {@link ExpressRootNode}). A page contains one or more artboards, representing "scenes" in a linear timeline
1351
+ * sequence. Those artboards in turn contain all the visual content of the document.
1352
+ *
1353
+ * To create new pages, see {@link PageList.addPage}.
1299
1354
  */
1300
1355
  export declare class PageNode extends BaseNode implements Readonly<IRectangularNode> {
1301
1356
  /**
1302
1357
  * The artboards or "scenes" of a page, ordered by timeline sequence.
1358
+ * To create new artboards, see {@link ArtboardList.addArtboard}.
1303
1359
  */
1304
1360
  get artboards(): ArtboardList;
1305
1361
  /**
@@ -1329,8 +1385,10 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
1329
1385
  }
1330
1386
 
1331
1387
  /**
1332
- * A PathNode represents a generic vector path shape in the scenegraph. Paths cannot be created or edited through this API
1388
+ * A PathNode represents a generic vector path shape in the scenegraph. Paths cannot be edited through this API
1333
1389
  * yet, only read.
1390
+ *
1391
+ * To create new paths, see {@link Editor.createPath}.
1334
1392
  */
1335
1393
  export declare class PathNode extends FillableNode {
1336
1394
  /**
@@ -1419,7 +1477,9 @@ export declare interface RectangleGeometry {
1419
1477
  }
1420
1478
 
1421
1479
  /**
1422
- * A RectangleNode represents a rectangle object in the scenegraph.
1480
+ * A RectangleNode represents a rectangle shape in the scenegraph.
1481
+ *
1482
+ * To create new rectangles, see {@link Editor.createRectangle}.
1423
1483
  */
1424
1484
  export declare class RectangleNode extends FillableNode implements IRectangularNode {
1425
1485
  /**
@@ -1733,7 +1793,13 @@ export declare class TextContentModel {
1733
1793
  * **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`.
1734
1794
  *
1735
1795
  * @experimental
1736
- * The character style ranges of this text content.
1796
+ * The character styles applied to different ranges of this text content. When setting character styles, any style
1797
+ * properties that are not provided are reset to their defaults (contrast to {@link applyCharacterStyles} which
1798
+ * preserves the text's existing styles for any fields not specified). When *getting* styles, all fields are always
1799
+ * provided.
1800
+ *
1801
+ * Note: existing fonts used in the document, returned by this getter, are not guaranteed to be ones the current user
1802
+ * has rights to edit with. The *setter* only accepts the AvailableFont type which has been verified to be usable.
1737
1803
  */
1738
1804
  get characterStyleRanges(): readonly CharacterStylesRange[];
1739
1805
  set characterStyleRanges(styles: readonly CharacterStylesRangeInput[]);
@@ -1743,8 +1809,11 @@ export declare class TextContentModel {
1743
1809
  * **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`.
1744
1810
  *
1745
1811
  * @experimental
1746
- * Apply one or more styles to the characters in the given range, leaving other styles in this range unchanged. Does
1747
- * not modify any styles in the text outside this range.
1812
+ * Apply one or more styles to the characters in the given range, leaving any style properties that were not specified
1813
+ * unchanged. Does not modify any styles in the text outside this range. Contrast to the {@link characterStyleRanges}
1814
+ * setter, which specifies new style range(s) for the entire text at once, and resets any unspecified properties back to
1815
+ * default styles.
1816
+
1748
1817
  * @param styles - The styles to apply.
1749
1818
  * @param range - The start and length of character sequence to which the styles should be applied.
1750
1819
  * If not specified the styles will be applied to the entire piece of text content flow.
@@ -1761,7 +1830,10 @@ export declare class TextContentModel {
1761
1830
  /**
1762
1831
  * A TextNode represents a text display frame in the scenegraph. It may display an entire piece of text, or sometimes just
1763
1832
  * a subset of longer text that flows across multiple TextNode "frames". Because of this, the TextNode does not directly hold
1764
- * the text content and styles – instead it refers to a {@link TextContentModel}, which may be shared across multiple TextNodes.
1833
+ * the text content and styles – instead it refers to a {@link TextContentModel}, which may be shared across multiple TextNode frames.
1834
+ *
1835
+ * To create new a single-frame piece of text, see {@link Editor.createText}. APIs are not yet available to create
1836
+ * multi-frame text flows.
1765
1837
  */
1766
1838
  export declare class TextNode extends Node {
1767
1839
  /**
@@ -1773,6 +1845,7 @@ export declare class TextNode extends Node {
1773
1845
  * same single {@link TextContentModel}; this can give the impression that the same text is duplicated multiple times when it is
1774
1846
  * not. Use {@link TextContentModel}.id to determine whether a given piece of text content is unique or if it's already been
1775
1847
  * encountered before.
1848
+ *
1776
1849
  */
1777
1850
  get fullContent(): TextContentModel;
1778
1851
  /**
@@ -1883,6 +1956,28 @@ export declare interface UnsupportedTextLayout {
1883
1956
  type: TextType.magicFit | TextType.circular;
1884
1957
  }
1885
1958
 
1959
+ /**
1960
+ * Represents the area of the canvas that is currently visible on-screen.
1961
+ */
1962
+ export declare class Viewport {
1963
+ /**
1964
+ * Adjusts the viewport to make the node's bounds visible on-screen, assuming all bounds are within the artboard bounds.
1965
+ * Makes the node's {@link ArtboardNode} or {@link PageNode} visible if they were not already
1966
+ * (which may result in {@link Context.selection} being cleared). It is strongly recomended
1967
+ * to further draw user's attention to the node by setting it as the {@link Context.selection} following this call.
1968
+ *
1969
+ * After this call, the value of {@link Context.insertionParent} will always be the node's containing {@link ArtboardNode}.
1970
+ *
1971
+ * Note that the node might still not appear visible if:
1972
+ * - Its animation settings make it invisible at the beginning of the {@link ArtboardNode} "scene".
1973
+ * - It is obscured underneath other artwork in the z-order.
1974
+ * - It is hidden by a {@link GroupNode}'s mask or similar cropping.
1975
+ */
1976
+ bringIntoView(node: VisualNode): void;
1977
+ }
1978
+
1979
+ export declare const viewport: ExpressViewport;
1980
+
1886
1981
  /**
1887
1982
  * <InlineAlert slots="text" variant="warning"/>
1888
1983
  *
package/ui/ui-sdk.d.ts CHANGED
@@ -371,9 +371,34 @@ export declare enum AuthorizationStatus {
371
371
  POPUP_BLOCKED = "POPUP_BLOCKED",
372
372
  POPUP_CLOSED = "POPUP_CLOSED",
373
373
  POPUP_TIMEOUT = "POPUP_TIMEOUT",
374
- FAILED = "FAILED"
374
+ FAILED = "FAILED",
375
+ IFRAME_LOAD_FAILED = "IFRAME_LOAD_FAILED"
375
376
  }
376
377
 
378
+ /**
379
+ * Request parameters to authorize a user using OAuth 2.0 PKCE based authorization in an iframe.
380
+ */
381
+ export declare type AuthorizeInsideIframeRequest = AuthorizationRequest & {
382
+ /**
383
+ * Relative position of the oauth iframe panel
384
+ */
385
+ position?: {
386
+ top: number;
387
+ left: number;
388
+ };
389
+ /**
390
+ * Offset from the right and bottom of the Iframe container when the size (windowSize) is not specified.
391
+ */
392
+ offset?: {
393
+ right: number;
394
+ bottom: number;
395
+ };
396
+ /**
397
+ * Flag to determine if the iframe panel needs to show a header.
398
+ */
399
+ showHeader?: boolean;
400
+ };
401
+
377
402
  /**
378
403
  * Request parameters to initiate an OAuth 2.0 PKCE based authorization workflow,
379
404
  * where the Add-on developer is responsible for handling redirect to his/her owned Redirect URL.
@@ -712,6 +737,14 @@ declare interface Document_2 {
712
737
  * Get document name/title
713
738
  */
714
739
  title(): Promise<string>;
740
+ /**
741
+ * Import a Pdf to the document.
742
+ */
743
+ importPdf(blob: Blob, attributes: MediaAttributes): void;
744
+ /**
745
+ * Import a presentation to the document.
746
+ */
747
+ importPresentation(blob: Blob, attributes: MediaAttributes): void;
715
748
  }
716
749
  export { Document_2 as Document };
717
750
 
@@ -1065,6 +1098,12 @@ export declare interface OAuth {
1065
1098
  * @returns - {@link AuthorizationResult} Authorization result.
1066
1099
  */
1067
1100
  authorizeWithOwnRedirect(request: AuthorizeWithOwnRedirectRequest): Promise<AuthorizationResult>;
1101
+ /**
1102
+ * Authorize a user using OAuth 2.0 PKCE workflow in an iframe.
1103
+ * @param request - {@link AuthorizeInsideIframeRequest} Payload with parameters to be used in the authorization workflow.
1104
+ * @returns - {@link AuthorizationResponse} Response containing a ONE-TIME Authorization Code which can be used to obtain an access token.
1105
+ */
1106
+ authorizeInsideIframe(request: AuthorizeInsideIframeRequest): Promise<AuthorizationResponse>;
1068
1107
  }
1069
1108
 
1070
1109
  /**