@adobe/ccweb-add-on-sdk-types 1.4.0 → 1.5.1

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,57 +1,57 @@
1
1
  {
2
- "name": "@adobe/ccweb-add-on-sdk-types",
3
- "version": "1.4.0",
4
- "author": "Adobe",
5
- "license": "MIT",
6
- "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
7
- "keywords": [
8
- "adobe",
9
- "creative cloud web",
10
- "express",
11
- "add-on",
12
- "typescript",
13
- "sdk",
14
- "typings"
15
- ],
16
- "main": "",
17
- "exports": {
18
- ".": "./index.d.ts",
19
- "./iframe-ui": "./ui/ui-sdk.d.ts",
20
- "./express-document-sdk": "./sandbox/express-document-sdk.d.ts",
21
- "./add-on-sdk-document-sandbox": "./sandbox/add-on-sdk-document-sandbox.d.ts"
22
- },
23
- "typesVersions": {
24
- "*": {
25
- "iframe-ui": [
26
- "./ui/ui-sdk.d.ts"
27
- ],
28
- "express-document-sdk": [
29
- "./sandbox/express-document-sdk.d.ts"
30
- ],
31
- "add-on-sdk-document-sandbox": [
32
- "./sandbox/add-on-sdk-document-sandbox.d.ts"
33
- ]
34
- }
35
- },
36
- "types": "index.d.ts",
37
- "repository": {
38
- "url": "https://github.com/adobe/create-ccweb-add-on"
39
- },
40
- "scripts": {
41
- "clean": "",
42
- "ibuild": "",
43
- "build": "",
44
- "build:release": "",
45
- "test": ""
46
- },
47
- "dependencies": {
48
- "tslib": "2.4.0",
49
- "gl-matrix": "3.3.0"
50
- },
51
- "devDependencies": {
52
- "@types/node": "16.11.62",
53
- "prettier": "2.8.0",
54
- "ts-node": "10.9.1",
55
- "typescript": "4.8.4"
2
+ "name": "@adobe/ccweb-add-on-sdk-types",
3
+ "version": "1.5.1",
4
+ "author": "Adobe",
5
+ "license": "MIT",
6
+ "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
7
+ "keywords": [
8
+ "adobe",
9
+ "creative cloud web",
10
+ "express",
11
+ "add-on",
12
+ "typescript",
13
+ "sdk",
14
+ "typings"
15
+ ],
16
+ "main": "",
17
+ "exports": {
18
+ ".": "./index.d.ts",
19
+ "./iframe-ui": "./ui/ui-sdk.d.ts",
20
+ "./express-document-sdk": "./sandbox/express-document-sdk.d.ts",
21
+ "./add-on-sdk-document-sandbox": "./sandbox/add-on-sdk-document-sandbox.d.ts"
22
+ },
23
+ "typesVersions": {
24
+ "*": {
25
+ "iframe-ui": [
26
+ "./ui/ui-sdk.d.ts"
27
+ ],
28
+ "express-document-sdk": [
29
+ "./sandbox/express-document-sdk.d.ts"
30
+ ],
31
+ "add-on-sdk-document-sandbox": [
32
+ "./sandbox/add-on-sdk-document-sandbox.d.ts"
33
+ ]
56
34
  }
57
- }
35
+ },
36
+ "types": "index.d.ts",
37
+ "repository": {
38
+ "url": "https://github.com/adobe/create-ccweb-add-on"
39
+ },
40
+ "dependencies": {
41
+ "tslib": "2.4.0",
42
+ "gl-matrix": "3.3.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "16.11.62",
46
+ "prettier": "2.8.0",
47
+ "ts-node": "10.9.1",
48
+ "typescript": "4.8.4"
49
+ },
50
+ "scripts": {
51
+ "clean": "",
52
+ "ibuild": "",
53
+ "build": "",
54
+ "build:release": "",
55
+ "test": ""
56
+ }
57
+ }
@@ -59,7 +59,9 @@ declare enum ArrowHeadType {
59
59
  export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
60
60
  /**
61
61
  * Create a new artboard and add it to the end of the list. The artboard size is the same as others on this page. The
62
- * artboard background is set to default fill color {@link DEFAULT_ARTBOARD_FILL_COLOR}.
62
+ * artboard background is set to default fill color {@link DEFAULT_ARTBOARD_FILL_COLOR}. The new artboard becomes the
63
+ * default target for newly inserted content (see insertionParent) and the timeline advances to show this artboard
64
+ * in the current viewport.
63
65
  * @returns the newly added artboard.
64
66
  */
65
67
  addArtboard(): ArtboardNode;
@@ -70,7 +72,7 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
70
72
  *
71
73
  * When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.
72
74
  */
73
- export declare class ArtboardNode extends BaseNode implements IRectangularNode, ContainerNode {
75
+ export declare class ArtboardNode extends VisualNode implements IRectangularNode, ContainerNode {
74
76
  /**
75
77
  * Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
76
78
  * GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
@@ -84,6 +86,11 @@ export declare class ArtboardNode extends BaseNode implements IRectangularNode,
84
86
  * The node's children. Use the methods on this ItemList object to get, add, and remove children.
85
87
  */
86
88
  get children(): ItemList<Node>;
89
+ /**
90
+ * The background fill of the artboard. Artboards must always have a fill.
91
+ */
92
+ set fill(fill: Fill);
93
+ get fill(): Readonly<Fill>;
87
94
  /**
88
95
  * The node's parent. Undefined if the node is an orphan.
89
96
  */
@@ -96,11 +103,6 @@ export declare class ArtboardNode extends BaseNode implements IRectangularNode,
96
103
  * The height of the artboard.
97
104
  */
98
105
  get height(): number;
99
- /**
100
- * The background fill of the artboard. Artboards must always have a fill.
101
- */
102
- get fill(): Readonly<Fill>;
103
- set fill(fill: Fill);
104
106
  }
105
107
 
106
108
  /**
@@ -110,6 +112,11 @@ export declare class ArtboardNode extends BaseNode implements IRectangularNode,
110
112
  * properties.
111
113
  */
112
114
  export declare class BaseNode {
115
+ /**
116
+ * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
117
+ * moved to a different part of the document.
118
+ */
119
+ get id(): string;
113
120
  /**
114
121
  * Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
115
122
  * GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
@@ -120,12 +127,6 @@ export declare class BaseNode {
120
127
  * to guarantee all their children are full-fledged Node instances.
121
128
  */
122
129
  get allChildren(): Readonly<Iterable<BaseNode>>;
123
-
124
- /**
125
- * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
126
- * moved to a different part of the document.
127
- */
128
- get id(): string;
129
130
  /**
130
131
  * The node's type.
131
132
  */
@@ -169,7 +170,7 @@ export declare interface BitmapImage {
169
170
  * <InlineAlert slots="text" variant="warning"/>
170
171
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
171
172
  *
172
- * Determines how a scenende is composited on top of the content rendered below it.
173
+ * Determines how a scenenode is composited on top of the content rendered below it.
173
174
  *
174
175
  * If a node is inside a container whose blend mode anything other than {@link passThrough}, then the node's blend mode only
175
176
  * interacts with other siblings within the same container. See documentation below for details.
@@ -234,7 +235,7 @@ export declare interface Color {
234
235
  /**
235
236
  * Represents a solid-color fill.
236
237
  *
237
- * The most convenient way to create a stroke is via `Editor.makeColorFill()`.
238
+ * The most convenient way to create a fill is via `Editor.makeColorFill()`.
238
239
  */
239
240
  export declare interface ColorFill extends Fill {
240
241
  /**
@@ -297,9 +298,9 @@ export declare const constants: typeof ApiConstants;
297
298
  * also hold children in specified "slots." Use {@link Node.allChildren} for read access to children regardless of node type.
298
299
  *
299
300
  * Some ContainerNode classes may be full-fledged Node subclasses (such as Group), while others may be a subclass of the
300
- * more minimal BaseNode (such as Artboard).
301
+ * more minimal VisualNode (such as Artboard).
301
302
  */
302
- export declare interface ContainerNode extends BaseNode {
303
+ export declare interface ContainerNode extends VisualNode {
303
304
  /**
304
305
  * The node's children. Use the methods on this ItemList object to get, add, and remove children.
305
306
  */
@@ -337,12 +338,52 @@ export declare class Context {
337
338
  * other UI state.
338
339
  */
339
340
  get insertionParent(): ContainerNode;
341
+ /**
342
+ * @returns The currently viewed page.
343
+ */
344
+ get currentPage(): PageNode;
340
345
  }
341
346
 
342
347
  /**
343
348
  * Entry point for APIs that read or modify the document's content.
344
349
  */
345
350
  export declare class Editor {
351
+ /**
352
+ * Enqueues a function to be run at a later time when edits to the user's document may be performed. You can always edit
353
+ * the document immediately when invoked in response to your add-on's UI code. However, if you delay to await an
354
+ * asynchronous operation such as {@link loadBitmapImage}, any edits following this pause must be scheduled using
355
+ * queueAsyncEdit(). This ensures the edit is properly tracked for saving and undo.
356
+ *
357
+ * The delay before your edit function is executed is typically just a few milliseconds, so it will appear instantaneous
358
+ * to users. However, note that queueAsyncEdit() will return *before* your function has been run.
359
+ * If you need to trigger any code after the edit has been performed, either include this in the lambda you are enqueuing
360
+ * or await the Promise returned by queueAsyncEdit().
361
+ *
362
+ * Generally, calling any setter or method is treated as an edit; but simple getters may be safely called at any time.
363
+ *
364
+ * Example of typical usage:
365
+ * ```javascript
366
+ * // Assume insertImage() is called from your UI code, and given a Blob containing image data
367
+ * async function insertImage(blob) {
368
+ * // This function was invoked from the UI iframe, so we can make any edits we want synchronously here.
369
+ * // Initially load the bitmap - an async operation
370
+ * const bitmapImage = await editor.loadBitmapImage(blob);
371
+ *
372
+ * // Execution doesn't arrive at this line until an async delay, due to the Promise 'await' above
373
+ *
374
+ * // Further edits need to be queued to run at a safe time
375
+ * editor.queueAsyncEdit(() => {
376
+ * // Create scenenode to display the image, and add it to the current artboard
377
+ * const mediaContainer = editor.createImageContainer(bitmapImage);
378
+ * editor.context.insertionParent.children.append(mediaContainer);
379
+ * });
380
+ * }
381
+ * ```
382
+ *
383
+ * @param lambda - a function which edits the document model.
384
+ * @returns a Promise that resolves when the lambda has finished running, or rejects if the lambda throws an error.
385
+ */
386
+ queueAsyncEdit(lambda: () => void): Promise<void>;
346
387
  /**
347
388
  * User's current selection context
348
389
  */
@@ -381,7 +422,7 @@ export declare class Editor {
381
422
  * container's mediaRectangle and maskShape children.
382
423
  *
383
424
  * Image creation involves some asynchronous steps. The image will be visible in this client almost instantly, but will
384
- * render as a gray placeholder on other clients until it has been uploaded to storage and then downloaded by those clients.
425
+ * render as a gray placeholder on other clients until it has been uploaded to DCX and then downloaded by those clients.
385
426
  * This local client will act as having unsaved changes until the upload has finished.
386
427
  *
387
428
  * @param bitmapData - BitmapImage resource (e.g. returned from loadBitmapImage()).
@@ -410,7 +451,7 @@ export declare class Editor {
410
451
  *
411
452
  * @param bitmapData - Encoded image data in PNG or JPEG format.
412
453
  */
413
- loadBitmapImage(bitmapData: Blob): Promise<BitmapImage>;
454
+ loadBitmapImage(rendition: Blob): Promise<BitmapImage>;
414
455
  /**
415
456
  * Convenience helper to create a complete Stroke value given just a subset of its fields. All other fields are
416
457
  * populated with default values.
@@ -426,14 +467,6 @@ export declare class Editor {
426
467
  * @returns a stroke configured with the given options.
427
468
  */
428
469
  makeStroke(options?: Partial<Stroke>): Stroke;
429
- /**
430
- * @returns a path node with a default stroke and no initial fill.
431
- * @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
432
- * Note that the path data will be normalized, and therefore the `path` getter may return a different SVG string from the path creation input.
433
- * For example, "M 10 80 Q 52.5 10, 95 80 T 180 80" becomes "M 10 80 C 38.33 33.33 66.67 33.33 95 80...".
434
- * Throws if the input is empty or is not legal SVG path syntax.
435
- */
436
- createPath(path: string): PathNode;
437
470
  /**
438
471
  * @returns a text node with default styles. The text content is initially empty, so the text node will be
439
472
  * invisible until its `text` property is set. Creates point text, so the node's width will automatically
@@ -441,41 +474,13 @@ export declare class Editor {
441
474
  */
442
475
  createText(): TextNode;
443
476
  /**
444
- * Enqueues a function to be run at a later time when edits to the user's document may be performed. You can always edit
445
- * the document immediately when invoked in response to your add-on's UI code. However, if you delay to await an
446
- * asynchronous operation such as {@link loadBitmapImage}, any edits following this pause must be scheduled using
447
- * queueAsyncEdit(). This ensures the edit is properly tracked for saving and undo.
448
- *
449
- * The delay before your edit function is executed is typically just a few milliseconds, so it will appear instantaneous
450
- * to users. However, note that queueAsyncEdit() will return *before* your function has been run.
451
- * If you need to trigger any code after the edit has been performed, either include this in the lambda you are enqueuing
452
- * or await the Promise returned by queueAsyncEdit().
453
- *
454
- * Generally, calling any setter or method is treated as an edit; but simple getters may be safely called at any time.
455
- *
456
- * Example of typical usage:
457
- * ```javascript
458
- * // Assume insertImage() is called from your UI code, and given a Blob containing image data
459
- * async function insertImage(blob) {
460
- * // This function was invoked from the UI iframe, so we can make any edits we want synchronously here.
461
- * // Initially load the bitmap - an async operation
462
- * const bitmapImage = await editor.loadBitmapImage(blob);
463
- *
464
- * // Execution doesn't arrive at this line until an async delay, due to the Promise 'await' above
465
- *
466
- * // Further edits need to be queued to run at a safe time
467
- * editor.queueAsyncEdit(() => {
468
- * // Create scenenode to display the image, and add it to the current artboard
469
- * const mediaContainer = editor.createImageContainer(bitmapImage);
470
- * editor.context.insertionParent.children.append(mediaContainer);
471
- * });
472
- * }
473
- * ```
474
- *
475
- * @param lambda - a function which edits the document model.
476
- * @returns a Promise that resolves when the lambda has finished running, or rejects if the lambda throws an error.
477
+ * @returns a path node with a default stroke and no initial fill.
478
+ * @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
479
+ * Note that the path data will be normalized, and therefore the `path` getter may return a different SVG string from the path creation input.
480
+ * For example, "M 10 80 Q 52.5 10, 95 80 T 180 80" becomes "M 10 80 C 38.33 33.33 66.67 33.33 95 80...".
481
+ * Throws if the input is empty or is not legal SVG path syntax.
477
482
  */
478
- queueAsyncEdit(lambda: () => void): Promise<void>;
483
+ createPath(path: string): PathNode;
479
484
  }
480
485
 
481
486
  export declare const editor: ExpressEditor;
@@ -543,8 +548,8 @@ export declare class FillableNode extends StrokableNode implements IFillableNode
543
548
  /**
544
549
  * The fill applied to the shape, if any.
545
550
  */
546
- get fill(): Readonly<Fill> | undefined;
547
551
  set fill(fill: Fill | undefined);
552
+ get fill(): Readonly<Fill> | undefined;
548
553
  }
549
554
 
550
555
  /**
@@ -573,10 +578,15 @@ declare enum FillType {
573
578
  }
574
579
 
575
580
  /**
576
- * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to
577
- * create a layout grid that other content can be placed into.
581
+ * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to create
582
+ * a layout grid that other content can be placed into.
578
583
  */
579
- export declare class GridLayoutNode extends Node implements IRectangularNode {
584
+ export declare class GridLayoutNode extends Node implements Readonly<IRectangularNode> {
585
+ /**
586
+ * The background fill of the GridLayout.
587
+ */
588
+ set fill(fill: Fill);
589
+ get fill(): Readonly<Fill>;
580
590
  /**
581
591
  * The width of the node.
582
592
  */
@@ -585,11 +595,6 @@ export declare class GridLayoutNode extends Node implements IRectangularNode {
585
595
  * The height of the node.
586
596
  */
587
597
  get height(): number;
588
- /**
589
- * The background fill of the GridLayout.
590
- */
591
- get fill(): Readonly<Fill>;
592
- set fill(fill: Fill);
593
598
  }
594
599
 
595
600
  /**
@@ -614,6 +619,12 @@ export declare class GroupNode extends Node implements ContainerNode {
614
619
  * @throws if the given node type cannot be used as a vector mask.
615
620
  */
616
621
  set maskShape(mask: FillableNode | undefined);
622
+ /**
623
+ * @override
624
+ * Note: If this group has a maskShape, group's bounds are always identical to the maskShape's, regardless of the
625
+ * group's other content.
626
+ */
627
+ get boundsLocal(): Readonly<Rect>;
617
628
  }
618
629
 
619
630
  /**
@@ -783,11 +794,13 @@ export declare class MediaContainerNode extends Node {
783
794
 
784
795
  /**
785
796
  * A Node represents an object in the scenegraph, the document's visual content tree. Most tangible visual content is a
786
- * subclass of Node, but note that some abstract top-level structural nodes (such as PageNode) only extend the more minimal
787
- * BaseNode. As a general rule, if you can click or drag an object with the select/move tool in the UI, then it extends
788
- * from Node.
797
+ * subclass of Node, but note that some abstract top-level structural nodes (such as PageNode) only extend the more
798
+ * minimal VisualNode or BaseNode. As a general rule, if you can click or drag an object with the select/move
799
+ * tool in the UI, then it extends from Node.
800
+ *
801
+ * A Node’s parent is always a VisualContentNode but may not be another Node (e.g. if the parent is an ArtboardNode)
789
802
  */
790
- declare class Node extends BaseNode {
803
+ declare class Node extends VisualNode {
791
804
  /**
792
805
  * Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
793
806
  * GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
@@ -797,16 +810,27 @@ declare class Node extends BaseNode {
797
810
  * The children of a Node are always other Node classes (never the more minimal BaseNode).
798
811
  */
799
812
  get allChildren(): Readonly<Iterable<Node>>;
813
+ /**
814
+ * An axis-aligned box in the parent’s coordinate space encompassing the node’s layout bounds (its
815
+ * {@link boundsLocal}, as transformed by its position and rotation relative to the parent). If the node has
816
+ * rotation, the top-left of its boundsLocal box (aligned to its own axes) is not necessarily located at the
817
+ * top-left of the boundsInParent box (since it's aligned to the parent's axes). This value is well-defined
818
+ * even for an orphan node with no parent.
819
+ */
820
+ get boundsInParent(): Readonly<Rect>;
821
+ /**
822
+ * Convert the node's {@link boundsLocal} to an axis-aligned bounding box in the coordinate space of the target
823
+ * node. Both nodes must share the same {@link visualRoot}, but can lie anywhere within that subtree
824
+ * relative to one another (the target node need not be an ancestor of this node, nor vice versa).
825
+ */
826
+ boundsInNode(targetNode: VisualNode): Readonly<Rect>;
800
827
  /**
801
828
  * The translation of the node along its parent's axes. This is identical to the translation component of
802
829
  * `transformMatrix`. It is often simpler to set a node's position using `setPositionInParent` than by
803
830
  * setting translation directly.
804
831
  */
805
- get translation(): Readonly<{
806
- x: number;
807
- y: number;
808
- }>;
809
- set translation(value: { x: number; y: number });
832
+ get translation(): Readonly<Point>;
833
+ set translation(value: Point);
810
834
  /**
811
835
  * Move the node so the given `localRegistrationPoint` in its local coordinates is placed at the given
812
836
  * `parentPoint` in its parent's coordinates (taking into account any rotation on this node, etc.).
@@ -831,7 +855,7 @@ declare class Node extends BaseNode {
831
855
  * Set the node’s rotation angle relative to its parent to exactly the given value, keeping the given point in the
832
856
  * node’s local coordinate space at a fixed location within the parent. Disregards any rotation the node may already
833
857
  * have had. The angle set here may not be the absolute rotation angle seen on screen, if the parent or other
834
- * ancestors have any rotation of their own.
858
+ * ancestors also have rotation of their own.
835
859
  * @param angleInDegrees - Angle in degrees.
836
860
  * @param localRotationPoint - Point to rotate around, in node's local coordinates.
837
861
  * @example
@@ -884,6 +908,7 @@ export declare class PageList extends RestrictedItemList<PageNode> {
884
908
  * with the same defaults as in {@link ArtboardList.addArtboard}. The page's artboard becomes the default target for
885
909
  * newly inserted content ({@link Context.insertionParent}) and the viewport switches to display this artboard.
886
910
  * @param geometry - The size of the new page.
911
+ *
887
912
  */
888
913
  addPage(geometry: RectangleGeometry): PageNode;
889
914
  }
@@ -912,6 +937,15 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
912
937
  */
913
938
  get name(): string | undefined;
914
939
  set name(name: string | undefined);
940
+ /**
941
+ * Clones this page, all artboards within it, and all content within those artboards. The cloned page is the same size
942
+ * as the original. Adds the new page immediately after this one in the pages list. The first artboard in the cloned
943
+ * page becomes the default target for newly inserted content ({@link Context.insertionParent}) and the viewport
944
+ * switches to display this artboard.
945
+ * @returns the cloned page.
946
+ *
947
+ */
948
+ cloneInPlace(): PageNode;
915
949
  }
916
950
 
917
951
  /**
@@ -930,12 +964,11 @@ export declare class PathNode extends FillableNode {
930
964
  * has multiple disjoint parts. The default value is nonZero.
931
965
  */
932
966
  get fillRule(): FillRule;
933
- set fillRule(fillRule: FillRule);
967
+ set fillRule(rule: FillRule);
934
968
  }
935
969
 
936
970
  /**
937
971
  * Represents a 2D position.
938
- * @public
939
972
  */
940
973
  export declare interface Point {
941
974
  x: number;
@@ -982,6 +1015,13 @@ export declare class ReadOnlyItemList<T extends ListItem> {
982
1015
  toArray(): Readonly<T[]>;
983
1016
  }
984
1017
 
1018
+ declare interface Rect {
1019
+ x: number;
1020
+ y: number;
1021
+ width: number;
1022
+ height: number;
1023
+ }
1024
+
985
1025
  export declare interface RectangleGeometry {
986
1026
  width: number;
987
1027
  height: number;
@@ -1062,6 +1102,7 @@ export declare class RectangleNode extends FillableNode implements IRectangularN
1062
1102
  declare class RestrictedItemList<T extends ListItem> extends ReadOnlyItemList<T> {
1063
1103
  /**
1064
1104
  * Remove the items from the list. The items need not be contiguous.
1105
+ *
1065
1106
  * @throws If any of the items are not in the list, or if it is illegal to remove any of the items from this parent.
1066
1107
  */
1067
1108
  remove(...items: T[]): void;
@@ -1137,8 +1178,8 @@ export declare class StrokableNode extends Node implements IStrokableNode {
1137
1178
  /**
1138
1179
  * The stroke applied to the shape, if any.
1139
1180
  */
1140
- get stroke(): Readonly<Stroke> | undefined;
1141
1181
  set stroke(stroke: Stroke | undefined);
1182
+ get stroke(): Readonly<Stroke> | undefined;
1142
1183
  }
1143
1184
 
1144
1185
  /**
@@ -1222,4 +1263,50 @@ export declare class TextNode extends Node {
1222
1263
  */
1223
1264
  export declare class UnknownNode extends Node {}
1224
1265
 
1266
+ /**
1267
+ * A "node" represents an object in the scenegraph, the document's visual content tree. This class represents any node
1268
+ * that can be visually perceived in the content. Most visual content is a subclass of the richer Node class which extends
1269
+ * VisualNode with more properties, but the overall ArtboardNode container only supports the VisualNode APIs
1270
+ * (and higher-level more abstract containers like PageNode extend only the minimal BaseNode class).
1271
+ *
1272
+ * Some VisualNodes might have a non-visual parent such as a PageNode.
1273
+ */
1274
+ export declare class VisualNode extends BaseNode {
1275
+ /**
1276
+ * The highest ancestor that still has visual presence in the document. Typically an Artboard, but for orphaned
1277
+ * content, it will be the root of the deleted content (which might be this node itself).
1278
+ *
1279
+ * Nodes that are both in the same visualRoot subtree lie within the same "visual space" of the document's
1280
+ * structure. Nodes that are in different visual roots have no spatial relation to one another; there is no
1281
+ * meaningful comparison or conversion between the bounds or coordinate spaces of such nodes.
1282
+ */
1283
+ get visualRoot(): VisualNode;
1284
+ /**
1285
+ * The bounding box of the node, expressed in the node's local coordinate space (which may be shifted or rotated
1286
+ * relative to its parent). Generally matches the selection outline seen in the UI, encompassing the vector path
1287
+ * "spine" of the shape as well as its stroke, but excluding effects such as shadows.
1288
+ *
1289
+ * The top-left corner of the bounding box corresponds to the visual top-left corner of the node, but this value is
1290
+ * *not* necessarily (0,0) – this is especially true for Text and Path nodes.
1291
+ */
1292
+ get boundsLocal(): Readonly<Rect>;
1293
+ /**
1294
+ * Position of the node's centerpoint in its own local coordinate space, i.e. the center of the boundsLocal
1295
+ * box.
1296
+ */
1297
+ get centerPointLocal(): Readonly<Point>;
1298
+ /**
1299
+ * Position of the node's top-left corner in its own local coordinate space, equal to (boundsLocal.x,
1300
+ * boundsLocal.y). If the node is rotated, this is not the same as the top-left corner of
1301
+ * boundsInParent.
1302
+ */
1303
+ get topLeftLocal(): Readonly<Point>;
1304
+ /**
1305
+ * Convert a point given in the node’s local coordinate space to a point in the coordinate space of the target node.
1306
+ * Both nodes must share the same {@link visualRoot}, but can lie anywhere within that subtree relative to one
1307
+ * another (the target node need not be an ancestor of this node, nor vice versa).
1308
+ */
1309
+ localPointInNode(localPoint: Point, targetNode: VisualNode): Readonly<Point>;
1310
+ }
1311
+
1225
1312
  export {};
package/ui/ui-sdk.d.ts CHANGED
@@ -215,7 +215,13 @@ declare interface ApplicationBase {
215
215
  * @returns DisableDragToDocument - Callback to undo the changes made by enableDragToDocument
216
216
  */
217
217
  enableDragToDocument(element: HTMLElement, dragCallbacks: DragCallbacks): DisableDragToDocument;
218
-
218
+ /**
219
+ * @experimental - Experimental API
220
+ * Register iframe with the add-on SDK.
221
+ * @param element - HTMLIframeElement to be registered.
222
+ * @returns UnregisterIframe - Callback to unregister iframe from the add-on SDK.
223
+ */
224
+ registerIframe(element: HTMLIFrameElement): UnregisterIframe;
219
225
  /**
220
226
  * Show a modal dialog
221
227
  * @param dialogOptions - dialog options such as title, description, etc.
@@ -467,6 +473,8 @@ declare namespace Constants {
467
473
  RuntimeType,
468
474
  BleedUnit,
469
475
  VideoResolution,
476
+ EditorPanel,
477
+ PanelActionType,
470
478
  AuthorizationStatus
471
479
  };
472
480
  }
@@ -671,6 +679,45 @@ export declare interface DragCompletionData {
671
679
 
672
680
  export declare type DragPreviewCallback = (element: HTMLElement) => URL;
673
681
 
682
+ export declare enum EditorPanel {
683
+ /**
684
+ * Editor search panel
685
+ */
686
+ search = "search",
687
+ /**
688
+ * Editor your stuff panel
689
+ */
690
+ yourStuff = "yourStuff",
691
+ /**
692
+ * Editor templates panel
693
+ */
694
+ templates = "templates",
695
+ /**
696
+ * Editor media panel
697
+ */
698
+ media = "media",
699
+ /**
700
+ * Editor text panel
701
+ */
702
+ text = "text",
703
+ /**
704
+ * Editor elements panel
705
+ */
706
+ elements = "elements",
707
+ /**
708
+ * Editor grids panel
709
+ */
710
+ grids = "grids",
711
+ /**
712
+ * Editor brands panel
713
+ */
714
+ brands = "brands",
715
+ /**
716
+ * Editor addOns panel
717
+ */
718
+ addOns = "addOns"
719
+ }
720
+
674
721
  export declare interface Field {
675
722
  /**
676
723
  * Label
@@ -925,6 +972,23 @@ export declare interface PageRendition extends Rendition {
925
972
  metadata: PageMetadata;
926
973
  }
927
974
 
975
+ /**
976
+ * Represents the action to be performed on opening an Editor panel.
977
+ */
978
+ export declare interface PanelAction {
979
+ /**
980
+ * Type of action to be performed on the Editor panel {@link PanelActionType}.
981
+ */
982
+ type: PanelActionType;
983
+ }
984
+
985
+ export declare enum PanelActionType {
986
+ /**
987
+ * Action type to perform search action on Editor panel.
988
+ */
989
+ search = "search"
990
+ }
991
+
928
992
  /**
929
993
  * Represents a PDF Page box
930
994
  */
@@ -1237,6 +1301,20 @@ export declare enum RuntimeType {
1237
1301
  documentSandbox = "documentSandbox"
1238
1302
  }
1239
1303
 
1304
+ /**
1305
+ * Search Action that can be performed on Editor Panel.
1306
+ */
1307
+ export declare interface SearchAction extends PanelAction {
1308
+ /**
1309
+ * Search action type.
1310
+ */
1311
+ type: PanelActionType.search;
1312
+ /**
1313
+ * Query used to perform search action.
1314
+ */
1315
+ searchString: string;
1316
+ }
1317
+
1240
1318
  export declare type SimpleDialogOptions = AlertDialogOptions | InputDialogOptions;
1241
1319
 
1242
1320
  /**
@@ -1255,6 +1333,13 @@ export declare interface UI {
1255
1333
  * Supported locales of the application
1256
1334
  */
1257
1335
  readonly locales: string[];
1336
+ /**
1337
+ * @experimental - Experimental API
1338
+ * Opens an Editor Panel
1339
+ * @param panel - one of {@link EditorPanel}
1340
+ * @param action - optional action to be performed on the panel {@link PanelAction}
1341
+ */
1342
+ openEditorPanel(panel: EditorPanel, action?: PanelAction): void;
1258
1343
  }
1259
1344
 
1260
1345
  declare type UiTheme = "light" | "dark" | "lightest" | "darkest";
@@ -1272,6 +1357,12 @@ declare type Unpromisify<P> = P extends Promise<infer T> ? T : P;
1272
1357
  */
1273
1358
  declare type UnproxyOrClone<T> = T extends RemoteObject<ProxyMarked> ? Local<T> : T;
1274
1359
 
1360
+ /**
1361
+ * @experimental - Experimental API
1362
+ * Callback to unregister iframe from the add-on SDK.
1363
+ */
1364
+ declare type UnregisterIframe = () => void;
1365
+
1275
1366
  /**
1276
1367
  * Types of dialog variants supported.
1277
1368
  */