@adobe/ccweb-add-on-sdk-types 1.20.1 → 1.22.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 +2 -2
- package/sandbox/express-document-sdk.d.ts +35 -21
- package/sandbox/index.d.ts +1 -1
- package/ui/ui-sdk.d.ts +78 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/ccweb-add-on-sdk-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"author": "Adobe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"tslib": "2.7.0",
|
|
42
42
|
"gl-matrix": "3.3.0",
|
|
43
|
-
"@swc/helpers": "0.5.
|
|
43
|
+
"@swc/helpers": "0.5.17"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "18.18.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
|
|
25
|
-
import { mat2d } from "gl-matrix";
|
|
25
|
+
import type { mat2d } from "gl-matrix";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* AddOnData class provides APIs to read, write, remove private metadata to a Node.
|
|
@@ -968,7 +968,7 @@ export declare class GridLayoutNode extends Node implements IRectangularNode {
|
|
|
968
968
|
* Grid Cells are ordered by the y and then x position of their top left corner, i.e. left to right and top to bottom.
|
|
969
969
|
* The children cannot be added or removed.
|
|
970
970
|
*/
|
|
971
|
-
get allChildren(): Readonly<Iterable<
|
|
971
|
+
get allChildren(): Readonly<Iterable<GridCellNode>>;
|
|
972
972
|
/**
|
|
973
973
|
* The background fill of the GridLayout.
|
|
974
974
|
*/
|
|
@@ -1211,6 +1211,11 @@ export declare class MediaContainerNode extends Node {
|
|
|
1211
1211
|
* (as well as its maskShape sibling node).
|
|
1212
1212
|
*/
|
|
1213
1213
|
export declare abstract class MediaRectangleNode extends Node implements Readonly<IRectangularNode> {
|
|
1214
|
+
/**
|
|
1215
|
+
* Get {@link AddOnData} reference for managing private metadata attached to the media resource displayed by this node.
|
|
1216
|
+
* The same media resource may be reused in multiple places in the document, and all share the same AddOnData state.
|
|
1217
|
+
*/
|
|
1218
|
+
get mediaAddOnData(): AddOnData;
|
|
1214
1219
|
/**
|
|
1215
1220
|
* Current width of the "full frame" uncropped media, which may not be fully visible due to cropping/clipping by the
|
|
1216
1221
|
* enclosing media container's maskShape. This size may be different from the original image/video size in pixels, but
|
|
@@ -1785,6 +1790,8 @@ declare enum SceneNodeType {
|
|
|
1785
1790
|
mediaContainer = "MediaContainer",
|
|
1786
1791
|
/** Type of MediaContainerNode's "media rectangle" child when it is holding an image */
|
|
1787
1792
|
imageRectangle = "ImageRectangle",
|
|
1793
|
+
/** Type of MediaContainerNode's "media rectangle" child when it is holding an unknown media type */
|
|
1794
|
+
unknownMediaRectangle = "UnknownMediaRectangle",
|
|
1788
1795
|
/** Type of PageNode */
|
|
1789
1796
|
page = "Page",
|
|
1790
1797
|
/** Type of ComplexShapeNode, representing a complex prepackaged shape with fill and stroke, that appears as a leaf node in the UI */
|
|
@@ -1857,7 +1864,7 @@ export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "t
|
|
|
1857
1864
|
|
|
1858
1865
|
/**
|
|
1859
1866
|
* A StandaloneTextNode represents a text display frame in the scenegraph. It displays an entire piece of text.
|
|
1860
|
-
* The StandaloneTextNode does not directly hold the text content and styles – instead it refers to a {@link
|
|
1867
|
+
* The StandaloneTextNode does not directly hold the text content and styles – instead it refers to a {@link TextNodeContentModel}.
|
|
1861
1868
|
*
|
|
1862
1869
|
* To create new a single-frame piece of text, see {@link Editor.createText}.
|
|
1863
1870
|
*/
|
|
@@ -1968,11 +1975,10 @@ declare enum TextAlignment {
|
|
|
1968
1975
|
}
|
|
1969
1976
|
|
|
1970
1977
|
/**
|
|
1971
|
-
*
|
|
1972
|
-
* split across multiple {@link ThreadedTextNode} frames for display.
|
|
1978
|
+
* TextContentModel is an abstract base class representing a complete piece of text content.
|
|
1973
1979
|
* Use this model to get or modify the text string and the style ranges applied to it.
|
|
1974
1980
|
*/
|
|
1975
|
-
export declare class TextContentModel {
|
|
1981
|
+
export declare abstract class TextContentModel {
|
|
1976
1982
|
/**
|
|
1977
1983
|
* <InlineAlert slots="text" variant="warning"/>
|
|
1978
1984
|
*
|
|
@@ -1987,14 +1993,6 @@ export declare class TextContentModel {
|
|
|
1987
1993
|
* Comparing two models using `===` will always fail.
|
|
1988
1994
|
*/
|
|
1989
1995
|
get id(): string;
|
|
1990
|
-
/**
|
|
1991
|
-
* Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
|
|
1992
|
-
* starts in the first {@link ThreadedTextNode} "frame", and then flows into the second node once it has filled the first one. The ending of the
|
|
1993
|
-
* text content may not be visible at all, if the last {@link ThreadedTextNode} "frame" is not large enough to accommodate it.
|
|
1994
|
-
*
|
|
1995
|
-
* If there are multiple {@link ThreadedTextNode}s, all of them must be configured to use {@link AreaTextLayout}.
|
|
1996
|
-
*/
|
|
1997
|
-
get allTextNodes(): Readonly<Iterable<TextNode>>;
|
|
1998
1996
|
/**
|
|
1999
1997
|
* The complete text string, which may span multiple {@link ThreadedTextNode} "frames" in the scenegraph.
|
|
2000
1998
|
*/
|
|
@@ -2119,7 +2117,7 @@ declare enum TextLayout {
|
|
|
2119
2117
|
/**
|
|
2120
2118
|
* TextNode is an abstract base class representing text displayed in the scenegraph, regardless of whether it's a fully
|
|
2121
2119
|
* self-contained {@link StandaloneTextNode} or one {@link ThreadedTextNode} "frame" of multiple in a larger flow. The
|
|
2122
|
-
* APIs on TextNode and its {@link
|
|
2120
|
+
* APIs on TextNode and its {@link TextNodeContentModel} allow you to generically work with text without needing to know
|
|
2123
2121
|
* which of those subtypes you are dealing with.
|
|
2124
2122
|
*/
|
|
2125
2123
|
export declare abstract class TextNode extends Node {
|
|
@@ -2172,12 +2170,12 @@ export declare abstract class TextNode extends Node {
|
|
|
2172
2170
|
* fixed-size frame using {@link AreaTextLayout} does not fit all the (remaining) text.
|
|
2173
2171
|
*
|
|
2174
2172
|
* Note: When traversing the scenegraph in search of text content, bear in mind that multiple TextNodes may refer to the
|
|
2175
|
-
* same single {@link
|
|
2176
|
-
* not. Use {@link
|
|
2173
|
+
* same single {@link TextNodeContentModel}; this can give the impression that the same text is duplicated multiple times when it is
|
|
2174
|
+
* not. Use {@link TextNodeContentModel}.id to determine whether a given piece of text content is unique or if it's already been
|
|
2177
2175
|
* encountered before.
|
|
2178
2176
|
*
|
|
2179
2177
|
*/
|
|
2180
|
-
get fullContent():
|
|
2178
|
+
get fullContent(): TextNodeContentModel;
|
|
2181
2179
|
/**
|
|
2182
2180
|
* Helper method to determine if the text is standalone.
|
|
2183
2181
|
*/
|
|
@@ -2197,14 +2195,14 @@ export declare abstract class TextNode extends Node {
|
|
|
2197
2195
|
* The text string content which is partially *or* fully displayed in this TextNode "frame."
|
|
2198
2196
|
* WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return
|
|
2199
2197
|
* the *entire* text content string.
|
|
2200
|
-
* @deprecated - Use the text getter on {@link
|
|
2198
|
+
* @deprecated - Use the text getter on {@link TextNodeContentModel} instead. Access it via `TextNode.fullContent.text`.
|
|
2201
2199
|
*/
|
|
2202
2200
|
get text(): string;
|
|
2203
2201
|
/**
|
|
2204
2202
|
* Sets the text content of the TextNode.
|
|
2205
2203
|
* WARNING: If a piece of text content flows across several TextNodes,
|
|
2206
2204
|
* *each* TextNode's `text` setter will sets the *entire* text content string.
|
|
2207
|
-
* @deprecated - Use the text setter on {@link
|
|
2205
|
+
* @deprecated - Use the text setter on {@link TextNodeContentModel} instead. Access it via `TextNode.fullContent.text`.
|
|
2208
2206
|
*/
|
|
2209
2207
|
set text(textContent: string);
|
|
2210
2208
|
/**
|
|
@@ -2227,6 +2225,22 @@ export declare abstract class TextNode extends Node {
|
|
|
2227
2225
|
get layout(): Readonly<AutoWidthTextLayout | AutoHeightTextLayout | AreaTextLayout | UnsupportedTextLayout>;
|
|
2228
2226
|
}
|
|
2229
2227
|
|
|
2228
|
+
/**
|
|
2229
|
+
* Represents a complete piece of text content, which may be contained within a single {@link StandaloneTextNode} *or*
|
|
2230
|
+
* split across multiple {@link ThreadedTextNode} frames for display.
|
|
2231
|
+
* Use this model to get or modify the text string and the style ranges applied to it.
|
|
2232
|
+
*/
|
|
2233
|
+
export declare class TextNodeContentModel extends TextContentModel {
|
|
2234
|
+
/**
|
|
2235
|
+
* Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
|
|
2236
|
+
* starts in the first {@link ThreadedTextNode} "frame", and then flows into the second node once it has filled the first one. The ending of the
|
|
2237
|
+
* text content may not be visible at all, if the last {@link ThreadedTextNode} "frame" is not large enough to accommodate it.
|
|
2238
|
+
*
|
|
2239
|
+
* If there are multiple {@link ThreadedTextNode}s, all of them must be configured to use {@link AreaTextLayout}.
|
|
2240
|
+
*/
|
|
2241
|
+
get allTextNodes(): Readonly<Iterable<TextNode>>;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2230
2244
|
/**
|
|
2231
2245
|
* A range of text in a {@link TextContentModel}.
|
|
2232
2246
|
*/
|
|
@@ -2250,7 +2264,7 @@ export declare enum TextScriptStyle {
|
|
|
2250
2264
|
/**
|
|
2251
2265
|
* A ThreadedTextNode represents a text display frame in the scenegraph. It is a subset of longer text that flows across
|
|
2252
2266
|
* multiple TextNode "frames". Because of this, the TextNode does not directly hold the text content and styles –
|
|
2253
|
-
* instead it refers to a {@link
|
|
2267
|
+
* instead it refers to a {@link TextNodeContentModel}, which may be shared across multiple ThreadedTextNode frames.
|
|
2254
2268
|
*
|
|
2255
2269
|
* APIs are not yet available to create multi-frame text flows.
|
|
2256
2270
|
*/
|
package/sandbox/index.d.ts
CHANGED
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
|
|
25
25
|
export * from "./express-document-sdk.js";
|
|
26
|
-
export * from "./global.js";
|
|
26
|
+
export type * from "./global.js";
|
|
27
27
|
export * from "./add-on-sdk-document-sandbox.js";
|
|
28
28
|
export { default } from "./add-on-sdk-document-sandbox.js";
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ export declare enum AppEvent {
|
|
|
151
151
|
* triggered when drag is complete on the currently dragged element.
|
|
152
152
|
*/
|
|
153
153
|
dragend = "dragend",
|
|
154
|
+
/**
|
|
155
|
+
* triggered when drag is cancelled on the currently dragged element.
|
|
156
|
+
*/
|
|
157
|
+
dragcancel = "dragcancel",
|
|
154
158
|
|
|
155
159
|
/**
|
|
156
160
|
* triggered when the document id is available in the application.
|
|
@@ -186,6 +190,7 @@ declare interface AppEventsTypeMap {
|
|
|
186
190
|
[AppEvent.reset]: undefined;
|
|
187
191
|
[AppEvent.dragstart]: AppDragStartEventData;
|
|
188
192
|
[AppEvent.dragend]: AppDragEndEventData;
|
|
193
|
+
[AppEvent.dragcancel]: undefined;
|
|
189
194
|
|
|
190
195
|
[AppEvent.documentIdAvailable]: DocumentIdAvailableEventData;
|
|
191
196
|
[AppEvent.documentLinkAvailable]: DocumentLinkAvailableEventData;
|
|
@@ -215,6 +220,11 @@ export declare interface Application extends ApplicationBase {
|
|
|
215
220
|
* Represents the active document of the host application
|
|
216
221
|
*/
|
|
217
222
|
readonly document: Document_2;
|
|
223
|
+
/**
|
|
224
|
+
* @experimental - Experimental API
|
|
225
|
+
* Invoke command/actions in an add-on and handle response.
|
|
226
|
+
*/
|
|
227
|
+
readonly command: Command;
|
|
218
228
|
/**
|
|
219
229
|
* OAuth 2.0 middleware for handling user authorization.
|
|
220
230
|
*/
|
|
@@ -661,6 +671,25 @@ export declare enum ColorPickerPlacement {
|
|
|
661
671
|
right = "right"
|
|
662
672
|
}
|
|
663
673
|
|
|
674
|
+
/**
|
|
675
|
+
* @experimental - Experimental API
|
|
676
|
+
* Provides APIs to handle command execution in the add-on.
|
|
677
|
+
*/
|
|
678
|
+
export declare interface Command {
|
|
679
|
+
/**
|
|
680
|
+
* @experimental - Experimental API
|
|
681
|
+
* Register a handler for handling command execution in the add-on.
|
|
682
|
+
*
|
|
683
|
+
* _Note:_ This is similar to a JavaScript event handler.
|
|
684
|
+
* If there are multiple handlers registered for a command,
|
|
685
|
+
* each will be invoked when the host application triggers the command.
|
|
686
|
+
* In most of the cases, one handler per command is the way to go.
|
|
687
|
+
* @param command - Command triggered from the host application.
|
|
688
|
+
* @param handler - Handler for command execution.
|
|
689
|
+
*/
|
|
690
|
+
register(command: string, handler: (params: Record<string, unknown>) => unknown): void;
|
|
691
|
+
}
|
|
692
|
+
|
|
664
693
|
declare namespace Constants {
|
|
665
694
|
export {
|
|
666
695
|
Range_2 as Range,
|
|
@@ -860,15 +889,15 @@ declare interface Document_2 {
|
|
|
860
889
|
/**
|
|
861
890
|
* Add image/Ps/Ai files to the current page
|
|
862
891
|
*/
|
|
863
|
-
addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
892
|
+
addImage(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
864
893
|
/**
|
|
865
894
|
* Add GIF files to the current page
|
|
866
895
|
*/
|
|
867
|
-
addAnimatedImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
896
|
+
addAnimatedImage(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
868
897
|
/**
|
|
869
898
|
* Add video to the current page
|
|
870
899
|
*/
|
|
871
|
-
addVideo(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
900
|
+
addVideo(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
872
901
|
/**
|
|
873
902
|
* Add audio to the current page
|
|
874
903
|
*/
|
|
@@ -882,6 +911,11 @@ declare interface Document_2 {
|
|
|
882
911
|
* Get metadata of all or range of pages of the document
|
|
883
912
|
*/
|
|
884
913
|
getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
|
|
914
|
+
/**
|
|
915
|
+
* @experimental - Experimental API
|
|
916
|
+
* Get the currently selected page ids.
|
|
917
|
+
*/
|
|
918
|
+
getSelectedPageIds(): Promise<string[]>;
|
|
885
919
|
/**
|
|
886
920
|
* Get document id
|
|
887
921
|
*/
|
|
@@ -913,7 +947,7 @@ declare interface Document_2 {
|
|
|
913
947
|
*/
|
|
914
948
|
runPrintQualityCheck(options: PrintQualityCheckOptions): void;
|
|
915
949
|
}
|
|
916
|
-
export { Document_2 as Document };
|
|
950
|
+
export type { Document_2 as Document };
|
|
917
951
|
|
|
918
952
|
/**
|
|
919
953
|
* The payload data sent when the document's export permission status changes in review and approval workflow.
|
|
@@ -1068,6 +1102,10 @@ export declare enum EntrypointType {
|
|
|
1068
1102
|
* Widget entrypoint type.
|
|
1069
1103
|
*/
|
|
1070
1104
|
WIDGET = "widget",
|
|
1105
|
+
/**
|
|
1106
|
+
* Command entrypoint type.
|
|
1107
|
+
*/
|
|
1108
|
+
COMMAND = "command",
|
|
1071
1109
|
/**
|
|
1072
1110
|
* Script entrypoint type.
|
|
1073
1111
|
* add-ons with script entrypoint type can use only the document sandbox APIs.
|
|
@@ -1188,6 +1226,24 @@ export declare enum FrameRate {
|
|
|
1188
1226
|
fps60 = 60
|
|
1189
1227
|
}
|
|
1190
1228
|
|
|
1229
|
+
/**
|
|
1230
|
+
* Represents the add-on data for a node.
|
|
1231
|
+
* Note: This support is not present for PSD/AI assets.
|
|
1232
|
+
*/
|
|
1233
|
+
export declare interface ImportAddOnData {
|
|
1234
|
+
/**
|
|
1235
|
+
* The node add-on data which will persist on the image frame even if the image content is replaced with a
|
|
1236
|
+
* different one. This data can be accessed later via the MediaContainerNode.addOnData API.
|
|
1237
|
+
*/
|
|
1238
|
+
nodeAddOnData?: Record<string, string>;
|
|
1239
|
+
/**
|
|
1240
|
+
* The media add-on data which will reset if the image is replaced with a different one. All copies of the
|
|
1241
|
+
* same image in the document will share the same mediaAddOnData. This data can be accessed later via the
|
|
1242
|
+
* MediaRectangleNode.mediaAddOnData API.
|
|
1243
|
+
*/
|
|
1244
|
+
mediaAddOnData?: Record<string, string>;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1191
1247
|
/**
|
|
1192
1248
|
* Type of input dialog data passed from the add-on.
|
|
1193
1249
|
*/
|
|
@@ -1685,6 +1741,13 @@ export declare interface PngRenditionOptions extends RenditionOptions {
|
|
|
1685
1741
|
fileSizeLimitUnit?: FileSizeLimitUnit;
|
|
1686
1742
|
}
|
|
1687
1743
|
|
|
1744
|
+
export declare interface PptxRenditionOptions extends RenditionOptions {
|
|
1745
|
+
/**
|
|
1746
|
+
* PPTX rendition format
|
|
1747
|
+
*/
|
|
1748
|
+
format: RenditionFormat.pptx;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1688
1751
|
/**
|
|
1689
1752
|
* @experimental - Experimental API
|
|
1690
1753
|
* Options for running print quality check
|
|
@@ -1818,7 +1881,11 @@ export declare enum RenditionFormat {
|
|
|
1818
1881
|
/**
|
|
1819
1882
|
* PDF format
|
|
1820
1883
|
*/
|
|
1821
|
-
pdf = "application/pdf"
|
|
1884
|
+
pdf = "application/pdf",
|
|
1885
|
+
/**
|
|
1886
|
+
* PPTX format
|
|
1887
|
+
*/
|
|
1888
|
+
pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1822
1889
|
}
|
|
1823
1890
|
|
|
1824
1891
|
/**
|
|
@@ -1912,7 +1979,11 @@ export declare enum RuntimeType {
|
|
|
1912
1979
|
/**
|
|
1913
1980
|
* Add-On's document model sandbox - JS runtime that hosts add-on code that has direct access to the full model.
|
|
1914
1981
|
*/
|
|
1915
|
-
documentSandbox = "documentSandbox"
|
|
1982
|
+
documentSandbox = "documentSandbox",
|
|
1983
|
+
/**
|
|
1984
|
+
* Runtime that hosts the add-on command logic.
|
|
1985
|
+
*/
|
|
1986
|
+
command = "command"
|
|
1916
1987
|
}
|
|
1917
1988
|
|
|
1918
1989
|
/**
|
|
@@ -2072,5 +2143,4 @@ export declare enum VideoResolution {
|
|
|
2072
2143
|
custom = "custom"
|
|
2073
2144
|
}
|
|
2074
2145
|
|
|
2075
|
-
export {
|
|
2076
|
-
|
|
2146
|
+
export {};
|