@adobe/ccweb-add-on-sdk-types 1.18.0 → 1.19.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.18.0",
3
+ "version": "1.19.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -82,6 +82,7 @@ declare namespace ApiConstants {
82
82
  StrokeType,
83
83
  TextAlignment,
84
84
  TextLayout,
85
+ TextScriptStyle,
85
86
  EditorEvent,
86
87
  VisualEffectType,
87
88
  ParagraphListType,
@@ -190,12 +191,14 @@ export declare class ArtboardNode extends VisualNode implements Readonly<IRectan
190
191
  get parent(): PageNode | undefined;
191
192
  /**
192
193
  * The width of the artboard.
193
- * Shares the same dimensions as the parent page and other artboards within the parent page.
194
+ * Shares the same dimensions as the parent {@link PageNode} and other artboards within the parent {@link PageNode}.
195
+ * To resize an artboard, resize the parent {@link PageNode}.
194
196
  */
195
197
  get width(): number;
196
198
  /**
197
199
  * The height of the artboard.
198
- * Shares the same dimensions as the parent page and other artboards within the parent page.
200
+ * Shares the same dimensions as the parent {@link PageNode} and other artboards within the parent {@link PageNode}.
201
+ * To resize an artboard, resize the parent {@link PageNode}.
199
202
  */
200
203
  get height(): number;
201
204
  }
@@ -261,6 +264,15 @@ declare interface BaseCharacterStyles {
261
264
  * Adds an underline to text.
262
265
  */
263
266
  underline: boolean;
267
+ /**
268
+ * URL for the hyperlink.
269
+ * A link can be removed by setting it to undefined
270
+ */
271
+ link: string | undefined;
272
+ /**
273
+ * Sets a superscript or subscript style.
274
+ */
275
+ baselineShift: TextScriptStyle;
264
276
  }
265
277
 
266
278
  /**
@@ -930,7 +942,19 @@ export declare const fonts: ExpressFonts;
930
942
  * GridCellNodes cannot be translated or rotated directly. This implementation translates and rotates the
931
943
  * MediaRectangle child of the GridCellNode when those actions are applied.
932
944
  */
933
- export declare class GridCellNode extends MediaContainerNode {}
945
+ export declare class GridCellNode extends MediaContainerNode {
946
+ /**
947
+ * <InlineAlert slots="text" variant="warning"/>
948
+ *
949
+ * **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`.
950
+ *
951
+ * @experimental
952
+ * Always throws as it's not possible to clone a single grid slot.
953
+ * Use the parent grid container instead.
954
+ *
955
+ */
956
+ clone(): never;
957
+ }
934
958
 
935
959
  /**
936
960
  * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to create
@@ -1007,27 +1031,14 @@ declare interface IFillableNode {
1007
1031
  }
1008
1032
 
1009
1033
  /**
1010
- * ImageRectangleNode is a rectangular node that displays the image media part of a MediaContainerNode. It can only exist
1011
- * within that container parent. Cropping can be adjusted by changing this media's position/rotation (as well as its mask
1012
- * shape sibling node).
1034
+ * ImageRectangleNode is a rectangular node that displays the image media part of a {@link MediaContainerNode}. It can only
1035
+ * exist within that container parent. Cropping can be adjusted by changing this rectangle's position/rotation (as well as
1036
+ * its maskShape sibling node).
1013
1037
  *
1014
1038
  * ImageRectangleNodes cannot be created directly; use {@link Editor.createImageContainer} to create the entire
1015
1039
  * container structure together.
1016
1040
  */
1017
- export declare class ImageRectangleNode extends Node implements Readonly<IRectangularNode> {
1018
- /**
1019
- * Current width of the "full frame" image rectangle, which may not be fully visible due to cropping/clipping by the
1020
- * enclosing media container's maskShape. This size may be different from the original bitmap's size in pixels, but
1021
- * will always match its aspect ratio.
1022
- */
1023
- get width(): number;
1024
- /**
1025
- * Current height of the "full frame" image rectangle, which may not be fully visible due to cropping/clipping by the
1026
- * enclosing media container's maskShape. This size may be different from the original bitmap's size in pixels, but
1027
- * will always match its aspect ratio.
1028
- */
1029
- get height(): number;
1030
- }
1041
+ export declare class ImageRectangleNode extends MediaRectangleNode {}
1031
1042
 
1032
1043
  /**
1033
1044
  * Interface for nodes with width and height properties.
@@ -1173,10 +1184,10 @@ export declare interface ListItem {}
1173
1184
  export declare class MediaContainerNode extends Node {
1174
1185
  /**
1175
1186
  * The rectangular node representing the entire, uncropped bounds of the media (e.g. image, GIFs, or video). The media's position and
1176
- * rotation can be changed, but it cannot be resized yet via this API. Media types other than images will yield a plain Node object
1177
- * for now.
1187
+ * rotation can be changed, but it cannot be resized yet via this API. Media types other than images will yield an UnknownMediaRectangleNode
1188
+ * object for now.
1178
1189
  */
1179
- get mediaRectangle(): ImageRectangleNode | Node;
1190
+ get mediaRectangle(): ImageRectangleNode | UnknownMediaRectangleNode;
1180
1191
  /**
1181
1192
  * The mask used for cropping/clipping the media. The bounds of this shape are entire visible bounds of the container.
1182
1193
  * The shape's geometric properties (position, rotation, size, etc.) can be changed, but it cannot be replaced by a
@@ -1193,6 +1204,38 @@ export declare class MediaContainerNode extends Node {
1193
1204
  replaceMedia(media: BitmapImage): void;
1194
1205
  }
1195
1206
 
1207
+ /**
1208
+ * MediaRectangleNode is the base class for a rectangular node that represents the *uncropped* media within a
1209
+ * {@link MediaContainerNode}. Specific subclasses such as {@link ImageRectangleNode} exist for each media type and
1210
+ * may provide additional media-specific APIs. Cropping can be adjusted by changing this rectangle's position/rotation
1211
+ * (as well as its maskShape sibling node).
1212
+ */
1213
+ export declare abstract class MediaRectangleNode extends Node implements Readonly<IRectangularNode> {
1214
+ /**
1215
+ * Current width of the "full frame" uncropped media, which may not be fully visible due to cropping/clipping by the
1216
+ * enclosing media container's maskShape. This size may be different from the original image/video size in pixels, but
1217
+ * will always match its aspect ratio.
1218
+ */
1219
+ get width(): number;
1220
+ /**
1221
+ * Current height of the "full frame" uncropped media, which may not be fully visible due to cropping/clipping by the
1222
+ * enclosing media container's maskShape. This size may be different from the original image/video size in pixels, but
1223
+ * will always match its aspect ratio.
1224
+ */
1225
+ get height(): number;
1226
+ /**
1227
+ * <InlineAlert slots="text" variant="warning"/>
1228
+ *
1229
+ * **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`.
1230
+ *
1231
+ * @experimental
1232
+ * Always throws as it's not possible to clone just the media rectangle alone.
1233
+ * Clone the entire parent MediaContainerNode instead.
1234
+ *
1235
+ */
1236
+ clone(): never;
1237
+ }
1238
+
1196
1239
  /**
1197
1240
  * A Node represents an object in the scenegraph, the document's visual content tree. Most tangible visual content is a
1198
1241
  * subclass of Node, but note that some abstract top-level structural nodes (such as PageNode) only extend the more
@@ -1334,6 +1377,15 @@ declare class Node extends VisualNode {
1334
1377
  * If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
1335
1378
  */
1336
1379
  resizeToCover(width: number, height: number): void;
1380
+ /**
1381
+ * <InlineAlert slots="text" variant="warning"/>
1382
+ *
1383
+ * **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`.
1384
+ *
1385
+ * @experimental
1386
+ * Creates an orphaned copy of this node, including all persistent attributes and descendants.
1387
+ */
1388
+ clone(): typeof this;
1337
1389
  }
1338
1390
  export { Node as Node };
1339
1391
 
@@ -1422,14 +1474,30 @@ export declare class PageNode extends BaseNode implements IRectangularNode {
1422
1474
  get artboards(): ArtboardList;
1423
1475
  /**
1424
1476
  * The width of the node.
1425
- * All Artboards within a page share the same dimensions.
1477
+ *
1478
+ * All Artboards within a page share the same dimensions, so changing this value will also automatically adjust the
1479
+ * size of every child {@link ArtboardNode}.
1480
+ *
1481
+ * Note: changing the page's size does not adjust the size or position of any of visual content inside any child
1482
+ * {@link ArtboardNode}. Callers should use their own layout logic to update the content for the new bounds as
1483
+ * desired. For example, making the size smaller could result in content being clipped and hard to access if it is
1484
+ * not adjusted to be visible again.
1485
+ *
1426
1486
  * Must be at least {@link MIN_PAGE_DIMENSION} and no larger than {@link MAX_PAGE_DIMENSION}.
1427
1487
  */
1428
1488
  get width(): number;
1429
1489
  set width(value: number);
1430
1490
  /**
1431
1491
  * The height of the node.
1432
- * All Artboards within a page share the same dimensions.
1492
+ *
1493
+ * All Artboards within a page share the same dimensions, so changing this value will also automatically adjust the
1494
+ * size of every child {@link ArtboardNode}.
1495
+ *
1496
+ * Note: changing the page's size does not adjust the size or position of any of visual content inside any child
1497
+ * {@link ArtboardNode}. Callers should use their own layout logic to update the content for the new bounds as
1498
+ * desired. For example, making the size smaller could result in content being clipped and hard to access if it is
1499
+ * not adjusted to be visible again.
1500
+ *
1433
1501
  * Must be at least {@link MIN_PAGE_DIMENSION} and no larger than {@link MAX_PAGE_DIMENSION}.
1434
1502
  */
1435
1503
  get height(): number;
@@ -2167,6 +2235,18 @@ declare interface TextRange {
2167
2235
  length: number;
2168
2236
  }
2169
2237
 
2238
+ /**
2239
+ * Represents a text script style.
2240
+ */
2241
+ export declare enum TextScriptStyle {
2242
+ /** text appears at the standard baseline */
2243
+ none = 0,
2244
+ /** text appears above the baseline */
2245
+ superscript = 1,
2246
+ /** text appears below the baseline */
2247
+ subscript = 2
2248
+ }
2249
+
2170
2250
  /**
2171
2251
  * A ThreadedTextNode represents a text display frame in the scenegraph. It is a subset of longer text that flows across
2172
2252
  * multiple TextNode "frames". Because of this, the TextNode does not directly hold the text content and styles –
@@ -2175,6 +2255,15 @@ declare interface TextRange {
2175
2255
  * APIs are not yet available to create multi-frame text flows.
2176
2256
  */
2177
2257
  export declare class ThreadedTextNode extends TextNode {
2258
+ /**
2259
+ * <InlineAlert slots="text" variant="warning"/>
2260
+ *
2261
+ * **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`.
2262
+ *
2263
+ * @experimental
2264
+ * Always throws as it's not possible to clone only a single "frame" of threaded text.
2265
+ */
2266
+ clone(): never;
2178
2267
  get nextTextNode(): ThreadedTextNode | undefined;
2179
2268
  get layout(): Readonly<AreaTextLayout>;
2180
2269
  /**
@@ -2199,6 +2288,13 @@ export declare class UnavailableFont extends BaseFont {
2199
2288
  get availableForEditing(): false;
2200
2289
  }
2201
2290
 
2291
+ /**
2292
+ * UnknownMediaRectangleNode is a rectangular node that represents the *uncropped* media within a {@link MediaContainerNode}
2293
+ * for cases where the media type is not yet supported by this API. Cropping can still be adjusted by changing this
2294
+ * rectangle's position/rotation (as well as its maskShape sibling node).
2295
+ */
2296
+ export declare class UnknownMediaRectangleNode extends MediaRectangleNode {}
2297
+
2202
2298
  /**
2203
2299
  * An UnknownNode is a node with limited support and therefore treated as a leaf node.
2204
2300
  */
package/ui/ui-sdk.d.ts CHANGED
@@ -38,6 +38,11 @@ export declare interface AddOn extends AddOnBase {
38
38
  * Local-persisted storage per user per addon.
39
39
  */
40
40
  readonly clientStorage: ClientStorage;
41
+
42
+ /**
43
+ * Current active entrypoint that the add-on is loaded in.
44
+ */
45
+ readonly entrypointType: EntrypointType;
41
46
  }
42
47
 
43
48
  /**
@@ -678,6 +683,10 @@ export declare interface CurrentUser {
678
683
  * @returns if the current user is a premium user
679
684
  */
680
685
  isPremiumUser(): Promise<boolean>;
686
+ /**
687
+ * @returns if the current user is an anonymous (guest) user
688
+ */
689
+ isAnonymousUser(): Promise<boolean>;
681
690
  }
682
691
 
683
692
  /**
@@ -1008,6 +1017,61 @@ export declare enum ElementsTabs {
1008
1017
  charts = "charts"
1009
1018
  }
1010
1019
 
1020
+ /**
1021
+ * Types of entrypoints that add-ons support.
1022
+ */
1023
+ export declare enum EntrypointType {
1024
+ /**
1025
+ * Widget entrypoint type.
1026
+ */
1027
+ WIDGET = "widget",
1028
+ /**
1029
+ * Script entrypoint type.
1030
+ * add-ons with script entrypoint type can use only the document sandbox APIs.
1031
+ */
1032
+ SCRIPT = "script",
1033
+ /**
1034
+ * Panel entrypoint type.
1035
+ */
1036
+ PANEL = "panel",
1037
+ /**
1038
+ * Share entrypoint type.
1039
+ */
1040
+ SHARE = "share",
1041
+ /**
1042
+ * Content hub entrypoint type.
1043
+ */
1044
+ CONTENT_HUB = "content-hub",
1045
+ /**
1046
+ * Mobile media audio entrypoint type.
1047
+ */
1048
+ MOBILE_MEDIA_AUDIO = "mobile.media.audio",
1049
+ /**
1050
+ * Mobile your stuff files entrypoint type.
1051
+ */
1052
+ MOBILE_YOUR_STUFF_FILES = "mobile.your-stuff.files",
1053
+ /**
1054
+ * Mobile more entrypoint type.
1055
+ */
1056
+ MOBILE_MORE = "mobile.more",
1057
+ /**
1058
+ * Schedule entrypoint type.
1059
+ */
1060
+ SCHEDULE = "schedule",
1061
+ /**
1062
+ * Contextual replace entrypoint type.
1063
+ */
1064
+ CONTEXTUAL_REPLACE = "contextual.replace",
1065
+ /**
1066
+ * Contextual upload entrypoint type.
1067
+ */
1068
+ CONTEXTUAL_UPLOAD = "contextual.upload",
1069
+ /**
1070
+ * Contextual bulk create entrypoint type.
1071
+ */
1072
+ CONTEXTUAL_BULK_CREATE = "contextual.bulk-create"
1073
+ }
1074
+
1011
1075
  export declare interface Field {
1012
1076
  /**
1013
1077
  * Label