@adobe/ccweb-add-on-sdk-types 1.15.0 → 1.17.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 +1 -1
- package/sandbox/express-document-sdk.d.ts +226 -74
- package/ui/ui-sdk.d.ts +46 -19
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ declare namespace ApiConstants {
|
|
|
81
81
|
StrokePosition,
|
|
82
82
|
StrokeType,
|
|
83
83
|
TextAlignment,
|
|
84
|
-
|
|
84
|
+
TextLayout,
|
|
85
85
|
EditorEvent,
|
|
86
86
|
VisualEffectType,
|
|
87
87
|
ParagraphListType,
|
|
@@ -105,7 +105,7 @@ declare interface ApiModuleExport {
|
|
|
105
105
|
* @experimental
|
|
106
106
|
*/
|
|
107
107
|
export declare interface AreaTextLayout {
|
|
108
|
-
type:
|
|
108
|
+
type: TextLayout.area;
|
|
109
109
|
/**
|
|
110
110
|
* The width of the text node in pixels.
|
|
111
111
|
*/
|
|
@@ -120,6 +120,11 @@ export declare interface AreaTextLayout {
|
|
|
120
120
|
* <InlineAlert slots="text" variant="warning"/>
|
|
121
121
|
*
|
|
122
122
|
* *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
123
|
+
*
|
|
124
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
125
|
+
*
|
|
126
|
+
* *Additional arrowhead types may be added in the future.* If your code has different branches or cases depending on arrow type,
|
|
127
|
+
* always have a default/fallback case to handle any unknown values you may encounter.
|
|
123
128
|
*/
|
|
124
129
|
declare enum ArrowHeadType {
|
|
125
130
|
none = 0,
|
|
@@ -159,7 +164,7 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
|
|
|
159
164
|
*
|
|
160
165
|
* Please note that creating and deleting an artboard in a single frame will crash the editor.
|
|
161
166
|
*/
|
|
162
|
-
export declare class ArtboardNode extends VisualNode implements IRectangularNode
|
|
167
|
+
export declare class ArtboardNode extends VisualNode implements Readonly<IRectangularNode>, ContainerNode {
|
|
163
168
|
/**
|
|
164
169
|
* Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
|
|
165
170
|
* GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
|
|
@@ -185,10 +190,12 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
|
|
|
185
190
|
get parent(): PageNode | undefined;
|
|
186
191
|
/**
|
|
187
192
|
* The width of the artboard.
|
|
193
|
+
* Shares the same dimensions as the parent page and other artboards within the parent page.
|
|
188
194
|
*/
|
|
189
195
|
get width(): number;
|
|
190
196
|
/**
|
|
191
197
|
* The height of the artboard.
|
|
198
|
+
* Shares the same dimensions as the parent page and other artboards within the parent page.
|
|
192
199
|
*/
|
|
193
200
|
get height(): number;
|
|
194
201
|
}
|
|
@@ -201,13 +208,24 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
|
|
|
201
208
|
* @experimental
|
|
202
209
|
*/
|
|
203
210
|
export declare interface AutoHeightTextLayout {
|
|
204
|
-
type:
|
|
211
|
+
type: TextLayout.autoHeight;
|
|
205
212
|
/**
|
|
206
213
|
* The width of the text node in pixels.
|
|
207
214
|
*/
|
|
208
215
|
width: number;
|
|
209
216
|
}
|
|
210
217
|
|
|
218
|
+
/**
|
|
219
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
220
|
+
*
|
|
221
|
+
* **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`.
|
|
222
|
+
*
|
|
223
|
+
* @experimental
|
|
224
|
+
*/
|
|
225
|
+
export declare interface AutoWidthTextLayout {
|
|
226
|
+
type: TextLayout.autoWidth;
|
|
227
|
+
}
|
|
228
|
+
|
|
211
229
|
/**
|
|
212
230
|
* Font the current user has access or licensing permissions to create / edit content with.
|
|
213
231
|
*/
|
|
@@ -650,6 +668,22 @@ export declare class Editor {
|
|
|
650
668
|
* @returns a Promise that resolves when the lambda has finished running, or rejects if the lambda throws an error.
|
|
651
669
|
*/
|
|
652
670
|
queueAsyncEdit(lambda: () => void): Promise<void>;
|
|
671
|
+
/**
|
|
672
|
+
* @returns a text node with default styles. The text content is initially empty, so the text node will be
|
|
673
|
+
* invisible until its `fullContent` property's `text` is set. Creates auto-width text, so the node's width will
|
|
674
|
+
* automatically adjust to accommodate whatever text is set.
|
|
675
|
+
* @deprecated - Initial text content is always expected so please use `createText(textContent: string): StandaloneTextNode`.
|
|
676
|
+
*/
|
|
677
|
+
createText(): StandaloneTextNode;
|
|
678
|
+
/**
|
|
679
|
+
* @param textContent - the initial string to show.
|
|
680
|
+
* @returns a text node with default styles. Creates auto-width text, so the node's width will automatically adjust
|
|
681
|
+
* to accommodate the given text content.
|
|
682
|
+
*
|
|
683
|
+
* Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
|
|
684
|
+
* insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.
|
|
685
|
+
*/
|
|
686
|
+
createText(textContent: string): StandaloneTextNode;
|
|
653
687
|
/**
|
|
654
688
|
* User's current selection context
|
|
655
689
|
*/
|
|
@@ -735,15 +769,6 @@ export declare class Editor {
|
|
|
735
769
|
* @returns a stroke configured with the given options.
|
|
736
770
|
*/
|
|
737
771
|
makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
|
|
738
|
-
/**
|
|
739
|
-
* @returns a text node with default styles. The text content is initially empty, so the text node will be
|
|
740
|
-
* invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically
|
|
741
|
-
* adjust to accommodate whatever text is set.
|
|
742
|
-
*
|
|
743
|
-
* Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
|
|
744
|
-
* insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.
|
|
745
|
-
*/
|
|
746
|
-
createText(): TextNode;
|
|
747
772
|
/**
|
|
748
773
|
* @returns a path node with a default stroke and no initial fill.
|
|
749
774
|
* @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
|
|
@@ -913,7 +938,7 @@ export declare class GridCellNode extends MediaContainerNode {}
|
|
|
913
938
|
*
|
|
914
939
|
* APIs to create a new grid layout are not yet available.
|
|
915
940
|
*/
|
|
916
|
-
export declare class GridLayoutNode extends Node implements
|
|
941
|
+
export declare class GridLayoutNode extends Node implements IRectangularNode {
|
|
917
942
|
/**
|
|
918
943
|
* The Grid's regular children. Does not include rectangles and skips over media constainer nodes to return fill grandchildren.
|
|
919
944
|
* 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.
|
|
@@ -927,12 +952,16 @@ export declare class GridLayoutNode extends Node implements Readonly<IRectangula
|
|
|
927
952
|
get fill(): Readonly<Fill>;
|
|
928
953
|
/**
|
|
929
954
|
* The width of the node.
|
|
955
|
+
* Must be at least {@link MIN_DIMENSION}.
|
|
930
956
|
*/
|
|
931
957
|
get width(): number;
|
|
958
|
+
set width(value: number);
|
|
932
959
|
/**
|
|
933
960
|
* The height of the node.
|
|
961
|
+
* Must be at least {@link MIN_DIMENSION}.
|
|
934
962
|
*/
|
|
935
963
|
get height(): number;
|
|
964
|
+
set height(value: number);
|
|
936
965
|
}
|
|
937
966
|
|
|
938
967
|
/**
|
|
@@ -1030,7 +1059,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1030
1059
|
* Add one or more items to the end of the list. The last argument will become the last item in this list. Items are
|
|
1031
1060
|
* removed from their previous parent, if any – or if an item is already in *this* list, its index is simply changed.
|
|
1032
1061
|
*
|
|
1033
|
-
* @throws - if item has a different parent and item is a {@link
|
|
1062
|
+
* @throws - if item has a different parent and item is a {@link ThreadedTextNode}, or if item's children subtree contains a {@link ThreadedTextNode}.
|
|
1034
1063
|
*/
|
|
1035
1064
|
append(...items: T[]): void;
|
|
1036
1065
|
/**
|
|
@@ -1042,7 +1071,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1042
1071
|
* `newItem` is removed from its previous parent, if any – or if it's already in *this* list, its index is simply
|
|
1043
1072
|
* changed. No-op if both arguments are the same item.
|
|
1044
1073
|
*
|
|
1045
|
-
* @throws - if newItem has a different parent and newItem is a {@link
|
|
1074
|
+
* @throws - if newItem has a different parent and newItem is a {@link ThreadedTextNode}, or if newItem's children subtree contains a {@link ThreadedTextNode}.
|
|
1046
1075
|
*/
|
|
1047
1076
|
replace(oldItem: T, newItem: T): void;
|
|
1048
1077
|
/**
|
|
@@ -1050,7 +1079,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1050
1079
|
* to occupy, shifting `before` and all later items to higher indices. `newItem` is removed from its previous parent,
|
|
1051
1080
|
* if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
|
|
1052
1081
|
*
|
|
1053
|
-
* @throws - if newItem has a different parent and it is a {@link
|
|
1082
|
+
* @throws - if newItem has a different parent and it is a {@link ThreadedTextNode}, or if newItem's children subtree contains a {@link ThreadedTextNode}.
|
|
1054
1083
|
*/
|
|
1055
1084
|
insertBefore(newItem: T, before: T): void;
|
|
1056
1085
|
/**
|
|
@@ -1058,7 +1087,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1058
1087
|
* shifting all later items to higher indices (the index of `after` remains unchanged). `newItem` is removed from its previous parent,
|
|
1059
1088
|
* if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
|
|
1060
1089
|
*
|
|
1061
|
-
* @throws - if newItem has a different parent and it is a {@link
|
|
1090
|
+
* @throws - if newItem has a different parent and it is a {@link ThreadedTextNode}, or if newItem's children subtree contains a {@link ThreadedTextNode}.
|
|
1062
1091
|
*/
|
|
1063
1092
|
insertAfter(newItem: T, after: T): void;
|
|
1064
1093
|
}
|
|
@@ -1265,6 +1294,46 @@ declare class Node extends VisualNode {
|
|
|
1265
1294
|
*/
|
|
1266
1295
|
get blendMode(): BlendMode;
|
|
1267
1296
|
set blendMode(value: BlendMode);
|
|
1297
|
+
/**
|
|
1298
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1299
|
+
*
|
|
1300
|
+
* **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`.
|
|
1301
|
+
*
|
|
1302
|
+
* @experimental
|
|
1303
|
+
* Changes the width to the given value and the height to the given width multiplied by the aspect ratio.
|
|
1304
|
+
*/
|
|
1305
|
+
rescaleProportionalToWidth(width: number): void;
|
|
1306
|
+
/**
|
|
1307
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1308
|
+
*
|
|
1309
|
+
* **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`.
|
|
1310
|
+
*
|
|
1311
|
+
* @experimental
|
|
1312
|
+
* Changes the height to the given value and the width to the given height multiplied by the aspect ratio.
|
|
1313
|
+
*/
|
|
1314
|
+
rescaleProportionalToHeight(height: number): void;
|
|
1315
|
+
/**
|
|
1316
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1317
|
+
*
|
|
1318
|
+
* **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`.
|
|
1319
|
+
*
|
|
1320
|
+
* @experimental
|
|
1321
|
+
* Resizes the node to fit within a box with the given dimensions.
|
|
1322
|
+
*
|
|
1323
|
+
* If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
|
|
1324
|
+
*/
|
|
1325
|
+
resizeToFitWithin(width: number, height: number): void;
|
|
1326
|
+
/**
|
|
1327
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1328
|
+
*
|
|
1329
|
+
* **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`.
|
|
1330
|
+
*
|
|
1331
|
+
* @experimental
|
|
1332
|
+
* Resizes the node to cover a box with the given dimensions.
|
|
1333
|
+
*
|
|
1334
|
+
* If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
|
|
1335
|
+
*/
|
|
1336
|
+
resizeToCover(width: number, height: number): void;
|
|
1268
1337
|
}
|
|
1269
1338
|
export { Node as Node };
|
|
1270
1339
|
|
|
@@ -1345,7 +1414,7 @@ export declare class PageList extends RestrictedItemList<PageNode> {
|
|
|
1345
1414
|
*
|
|
1346
1415
|
* To create new pages, see {@link PageList.addPage}.
|
|
1347
1416
|
*/
|
|
1348
|
-
export declare class PageNode extends BaseNode implements
|
|
1417
|
+
export declare class PageNode extends BaseNode implements IRectangularNode {
|
|
1349
1418
|
/**
|
|
1350
1419
|
* The artboards or "scenes" of a page, ordered by timeline sequence.
|
|
1351
1420
|
* To create new artboards, see {@link ArtboardList.addArtboard}.
|
|
@@ -1354,13 +1423,17 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
|
|
|
1354
1423
|
/**
|
|
1355
1424
|
* The width of the node.
|
|
1356
1425
|
* All Artboards within a page share the same dimensions.
|
|
1426
|
+
* Must be at least {@link MIN_PAGE_DIMENSION} and no larger than {@link MAX_PAGE_DIMENSION}.
|
|
1357
1427
|
*/
|
|
1358
1428
|
get width(): number;
|
|
1429
|
+
set width(value: number);
|
|
1359
1430
|
/**
|
|
1360
1431
|
* The height of the node.
|
|
1361
1432
|
* All Artboards within a page share the same dimensions.
|
|
1433
|
+
* Must be at least {@link MIN_PAGE_DIMENSION} and no larger than {@link MAX_PAGE_DIMENSION}.
|
|
1362
1434
|
*/
|
|
1363
1435
|
get height(): number;
|
|
1436
|
+
set height(value: number);
|
|
1364
1437
|
/**
|
|
1365
1438
|
* The page's name. Displayed as a user-editable label above the current artboard in the UI.
|
|
1366
1439
|
*/
|
|
@@ -1469,17 +1542,6 @@ export declare interface Point {
|
|
|
1469
1542
|
y: number;
|
|
1470
1543
|
}
|
|
1471
1544
|
|
|
1472
|
-
/**
|
|
1473
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
1474
|
-
*
|
|
1475
|
-
* **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`.
|
|
1476
|
-
*
|
|
1477
|
-
* @experimental
|
|
1478
|
-
*/
|
|
1479
|
-
export declare interface PointTextLayout {
|
|
1480
|
-
type: TextType.autoWidth;
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
1545
|
/**
|
|
1484
1546
|
* ReadOnlyItemList represents an ordered list of API objects, representing items that are all children of the
|
|
1485
1547
|
* same parent node. (The reverse is not necessarily true, however: this list might not include all
|
|
@@ -1520,7 +1582,7 @@ export declare class ReadOnlyItemList<T extends ListItem> {
|
|
|
1520
1582
|
toArray(): readonly T[];
|
|
1521
1583
|
}
|
|
1522
1584
|
|
|
1523
|
-
declare interface Rect {
|
|
1585
|
+
export declare interface Rect {
|
|
1524
1586
|
x: number;
|
|
1525
1587
|
y: number;
|
|
1526
1588
|
width: number;
|
|
@@ -1725,6 +1787,31 @@ export declare interface SolidColorStroke extends Stroke {
|
|
|
1725
1787
|
export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "type"> &
|
|
1726
1788
|
Partial<Pick<SolidColorStroke, "type">>;
|
|
1727
1789
|
|
|
1790
|
+
/**
|
|
1791
|
+
* A StandaloneTextNode represents a text display frame in the scenegraph. It displays an entire piece of text.
|
|
1792
|
+
* The StandaloneTextNode does not directly hold the text content and styles – instead it refers to a {@link TextContentModel}.
|
|
1793
|
+
*
|
|
1794
|
+
* To create new a single-frame piece of text, see {@link Editor.createText}.
|
|
1795
|
+
*/
|
|
1796
|
+
export declare class StandaloneTextNode extends TextNode {
|
|
1797
|
+
get nextTextNode(): undefined;
|
|
1798
|
+
get layout(): Readonly<AutoWidthTextLayout | AutoHeightTextLayout | UnsupportedTextLayout>;
|
|
1799
|
+
/**
|
|
1800
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1801
|
+
*
|
|
1802
|
+
* **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`.
|
|
1803
|
+
*
|
|
1804
|
+
* @experimental
|
|
1805
|
+
* Sets the layout mode of the TextNode "frame."
|
|
1806
|
+
*
|
|
1807
|
+
* {@link AreaTextLayout} is not supported by single-frame text.
|
|
1808
|
+
*
|
|
1809
|
+
* @throws if changing text layout to/from {@link TextLayout.magicFit} or {@link TextLayout.circular} layout when the text contains font(s) unavailable to the current user.
|
|
1810
|
+
* @throws if {@link StandaloneTextNode} is not a part of a multi-frame text content flow and the layout is {@link AreaTextLayout}.
|
|
1811
|
+
*/
|
|
1812
|
+
set layout(layout: AutoWidthTextLayout | AutoHeightTextLayout);
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1728
1815
|
/**
|
|
1729
1816
|
* Base class for a Node that can have its own stroke.
|
|
1730
1817
|
*/
|
|
@@ -1799,15 +1886,22 @@ declare interface StyleRange {
|
|
|
1799
1886
|
* <InlineAlert slots="text" variant="warning"/>
|
|
1800
1887
|
*
|
|
1801
1888
|
* *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
1889
|
+
*
|
|
1890
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1891
|
+
*
|
|
1892
|
+
* *Additional alignment types may be added in the future.* If your code has different branches or cases depending on text alignment,
|
|
1893
|
+
* always have a default/fallback case to handle any unknown values you may encounter.
|
|
1802
1894
|
*/
|
|
1803
1895
|
declare enum TextAlignment {
|
|
1804
1896
|
left = 1,
|
|
1805
1897
|
right = 2,
|
|
1806
|
-
center = 3
|
|
1898
|
+
center = 3,
|
|
1899
|
+
justifyLeft = 4
|
|
1807
1900
|
}
|
|
1808
1901
|
|
|
1809
1902
|
/**
|
|
1810
|
-
* Represents a complete piece of text content
|
|
1903
|
+
* Represents a complete piece of text content, which may be contained within a single {@link StandaloneTextNode} *or*
|
|
1904
|
+
* split across multiple {@link ThreadedTextNode} frames for display.
|
|
1811
1905
|
* Use this model to get or modify the text string and the style ranges applied to it.
|
|
1812
1906
|
*/
|
|
1813
1907
|
export declare class TextContentModel {
|
|
@@ -1827,14 +1921,14 @@ export declare class TextContentModel {
|
|
|
1827
1921
|
get id(): string;
|
|
1828
1922
|
/**
|
|
1829
1923
|
* Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
|
|
1830
|
-
* starts in the first {@link
|
|
1831
|
-
* text content may not be visible at all, if the last {@link
|
|
1924
|
+
* 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
|
|
1925
|
+
* text content may not be visible at all, if the last {@link ThreadedTextNode} "frame" is not large enough to accommodate it.
|
|
1832
1926
|
*
|
|
1833
|
-
* If there are multiple {@link
|
|
1927
|
+
* If there are multiple {@link ThreadedTextNode}s, all of them must be configured to use {@link AreaTextLayout}.
|
|
1834
1928
|
*/
|
|
1835
1929
|
get allTextNodes(): Readonly<Iterable<TextNode>>;
|
|
1836
1930
|
/**
|
|
1837
|
-
* The complete text string, which may span multiple {@link
|
|
1931
|
+
* The complete text string, which may span multiple {@link ThreadedTextNode} "frames" in the scenegraph.
|
|
1838
1932
|
*/
|
|
1839
1933
|
get text(): string;
|
|
1840
1934
|
set text(textContent: string);
|
|
@@ -1918,14 +2012,58 @@ export declare class TextContentModel {
|
|
|
1918
2012
|
}
|
|
1919
2013
|
|
|
1920
2014
|
/**
|
|
1921
|
-
*
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
2015
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
2016
|
+
*
|
|
2017
|
+
* *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
1924
2018
|
*
|
|
1925
|
-
*
|
|
1926
|
-
*
|
|
2019
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
2020
|
+
*
|
|
2021
|
+
* *Additional text layout types may be added in the future.* If your code has different branches or cases depending on layout type,
|
|
2022
|
+
* always have a default/fallback case to handle any unknown values you may encounter.
|
|
2023
|
+
*/
|
|
2024
|
+
declare enum TextLayout {
|
|
2025
|
+
/**
|
|
2026
|
+
* Area text: both width and height are explicitly set. If text content is too long to fit, the end of the text will be
|
|
2027
|
+
* clipped. If text content is short, the frame's bounds will occupy extra height that is just blank space.
|
|
2028
|
+
*/
|
|
2029
|
+
area = 1,
|
|
2030
|
+
/**
|
|
2031
|
+
* Auto-height text: Width is explicitly set, and text wraps to use as much vertical space as necessary to display the
|
|
2032
|
+
* full content.
|
|
2033
|
+
*/
|
|
2034
|
+
autoHeight = 2,
|
|
2035
|
+
/**
|
|
2036
|
+
* Auto-width, aka point text: both width and height are automatically determined based on the content. There is no
|
|
2037
|
+
* automatic line wrapping, so the text will all be on one line unless the text contains explicit newlines.
|
|
2038
|
+
*/
|
|
2039
|
+
autoWidth = 3,
|
|
2040
|
+
/**
|
|
2041
|
+
* Text is arranged in a circle or arc. The API does not yet support setting or reading the details of this layout style.
|
|
2042
|
+
*/
|
|
2043
|
+
circular = 4,
|
|
2044
|
+
/**
|
|
2045
|
+
* Aka "Dynamic" layout in the UI: text size and styles are automatically varied to create an attractive multi-line layout.
|
|
2046
|
+
* The API does not yet support setting or reading the details of this layout style.
|
|
2047
|
+
*/
|
|
2048
|
+
magicFit = 5
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
/**
|
|
2052
|
+
* TextNode is an abstract base class representing text displayed in the scenegraph, regardless of whether it's a fully
|
|
2053
|
+
* self-contained {@link StandaloneTextNode} or one {@link ThreadedTextNode} "frame" of multiple in a larger flow. The
|
|
2054
|
+
* APIs on TextNode and its {@link TextContentModel} allow you to generically work with text without needing to know
|
|
2055
|
+
* which of those subtypes you are dealing with.
|
|
1927
2056
|
*/
|
|
1928
|
-
export declare class TextNode extends Node {
|
|
2057
|
+
export declare abstract class TextNode extends Node {
|
|
2058
|
+
/**
|
|
2059
|
+
* {@inheritDoc VisualNode.boundsLocal}
|
|
2060
|
+
*
|
|
2061
|
+
* @returns
|
|
2062
|
+
* Note: The bounding box of the orphaned TextNode may be different from the bounding box of the node placed on a
|
|
2063
|
+
* page. It is recommended to use this property only when the node is placed on a page.
|
|
2064
|
+
*
|
|
2065
|
+
*/
|
|
2066
|
+
get boundsLocal(): Readonly<Rect>;
|
|
1929
2067
|
/**
|
|
1930
2068
|
* {@inheritDoc VisualNode.centerPointLocal}
|
|
1931
2069
|
*
|
|
@@ -1944,6 +2082,22 @@ export declare class TextNode extends Node {
|
|
|
1944
2082
|
*
|
|
1945
2083
|
*/
|
|
1946
2084
|
get topLeftLocal(): Readonly<Point>;
|
|
2085
|
+
/**
|
|
2086
|
+
* {@inheritDoc Node.boundsInParent}
|
|
2087
|
+
*
|
|
2088
|
+
* @returns
|
|
2089
|
+
* Note: The bounding box of an orphaned TextNode may become different after it is placed on a
|
|
2090
|
+
* page. It is recommended to use this property only when the node is placed on a page.
|
|
2091
|
+
*/
|
|
2092
|
+
get boundsInParent(): Readonly<Rect>;
|
|
2093
|
+
/**
|
|
2094
|
+
* {@inheritDoc Node.boundsInNode}
|
|
2095
|
+
*
|
|
2096
|
+
* @returns
|
|
2097
|
+
* Note: The bounding box of an orphaned TextNode may become different after it is placed on a
|
|
2098
|
+
* page. It is recommended to use this method only when the node is placed on a page.
|
|
2099
|
+
*/
|
|
2100
|
+
boundsInNode(targetNode: VisualNode): Readonly<Rect>;
|
|
1947
2101
|
/**
|
|
1948
2102
|
* The model containing the complete text string and its styles, only part of which may be visible within the bounds of
|
|
1949
2103
|
* this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a
|
|
@@ -1956,13 +2110,21 @@ export declare class TextNode extends Node {
|
|
|
1956
2110
|
*
|
|
1957
2111
|
*/
|
|
1958
2112
|
get fullContent(): TextContentModel;
|
|
2113
|
+
/**
|
|
2114
|
+
* Helper method to determine if the text is standalone.
|
|
2115
|
+
*/
|
|
2116
|
+
isStandaloneText(): this is StandaloneTextNode;
|
|
2117
|
+
/**
|
|
2118
|
+
* Helper method to determine if the text is in a flow.
|
|
2119
|
+
*/
|
|
2120
|
+
isThreadedText(): this is ThreadedTextNode;
|
|
1959
2121
|
/**
|
|
1960
2122
|
* The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size
|
|
1961
2123
|
* ({@link AreaTextLayout}), any text content that does not fit within this node's area will be clipped.
|
|
1962
2124
|
*
|
|
1963
2125
|
* To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`.
|
|
1964
2126
|
*/
|
|
1965
|
-
get nextTextNode():
|
|
2127
|
+
abstract get nextTextNode(): ThreadedTextNode | undefined;
|
|
1966
2128
|
/**
|
|
1967
2129
|
* The text string content which is partially *or* fully displayed in this TextNode "frame."
|
|
1968
2130
|
* WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return
|
|
@@ -1994,23 +2156,7 @@ export declare class TextNode extends Node {
|
|
|
1994
2156
|
* @experimental
|
|
1995
2157
|
* @returns The layout mode of the TextNode "frame."
|
|
1996
2158
|
*/
|
|
1997
|
-
get layout(): Readonly<
|
|
1998
|
-
/**
|
|
1999
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
2000
|
-
*
|
|
2001
|
-
* **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`.
|
|
2002
|
-
*
|
|
2003
|
-
* @experimental
|
|
2004
|
-
* Sets the layout mode of the TextNode "frame."
|
|
2005
|
-
*
|
|
2006
|
-
* If this TextNode is part of a multi-frame text content flow, it must be configured to use {@link AreaTextLayout}. Other
|
|
2007
|
-
* layout modes, except for {@link AreaTextLayout}, are only available for single-frame text.
|
|
2008
|
-
*
|
|
2009
|
-
* @throws if changing text layout to/from {@link TextType.magicFit} or {@link TextType.circular} layout when the text contains font(s) unavailable to the current user.
|
|
2010
|
-
* @throws if {@link TextNode} is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
|
|
2011
|
-
* @throws if {@link TextNode} is not a part of a multi-frame text content flow and the layout is {@link AreaTextLayout}.
|
|
2012
|
-
*/
|
|
2013
|
-
set layout(layout: PointTextLayout | AutoHeightTextLayout | AreaTextLayout);
|
|
2159
|
+
get layout(): Readonly<AutoWidthTextLayout | AutoHeightTextLayout | AreaTextLayout | UnsupportedTextLayout>;
|
|
2014
2160
|
}
|
|
2015
2161
|
|
|
2016
2162
|
/**
|
|
@@ -2022,22 +2168,28 @@ declare interface TextRange {
|
|
|
2022
2168
|
}
|
|
2023
2169
|
|
|
2024
2170
|
/**
|
|
2025
|
-
*
|
|
2171
|
+
* A ThreadedTextNode represents a text display frame in the scenegraph. It is a subset of longer text that flows across
|
|
2172
|
+
* multiple TextNode "frames". Because of this, the TextNode does not directly hold the text content and styles –
|
|
2173
|
+
* instead it refers to a {@link TextContentModel}, which may be shared across multiple ThreadedTextNode frames.
|
|
2026
2174
|
*
|
|
2027
|
-
*
|
|
2175
|
+
* APIs are not yet available to create multi-frame text flows.
|
|
2028
2176
|
*/
|
|
2029
|
-
declare
|
|
2030
|
-
|
|
2177
|
+
export declare class ThreadedTextNode extends TextNode {
|
|
2178
|
+
get nextTextNode(): ThreadedTextNode | undefined;
|
|
2179
|
+
get layout(): Readonly<AreaTextLayout>;
|
|
2031
2180
|
/**
|
|
2032
|
-
*
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
*
|
|
2181
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
2182
|
+
*
|
|
2183
|
+
* **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`.
|
|
2184
|
+
*
|
|
2185
|
+
* @experimental
|
|
2186
|
+
* Sets the layout mode of the TextNode "frame."
|
|
2187
|
+
*
|
|
2188
|
+
* Only {@link AreaTextLayout}, with fully fixed bounds, is currently supported by threaded text.
|
|
2189
|
+
*
|
|
2190
|
+
* @throws if {@link ThreadedTextNode} is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
|
|
2037
2191
|
*/
|
|
2038
|
-
|
|
2039
|
-
circular = 4,
|
|
2040
|
-
magicFit = 5
|
|
2192
|
+
set layout(layout: AreaTextLayout);
|
|
2041
2193
|
}
|
|
2042
2194
|
|
|
2043
2195
|
/**
|
|
@@ -2091,7 +2243,7 @@ export declare interface UnorderedListStyleInput extends BaseParagraphListStyle
|
|
|
2091
2243
|
* @experimental
|
|
2092
2244
|
*/
|
|
2093
2245
|
export declare interface UnsupportedTextLayout {
|
|
2094
|
-
type:
|
|
2246
|
+
type: TextLayout.magicFit | TextLayout.circular;
|
|
2095
2247
|
}
|
|
2096
2248
|
|
|
2097
2249
|
/**
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -155,6 +155,10 @@ export declare enum AppEvent {
|
|
|
155
155
|
* triggered when the document link is available in the application.
|
|
156
156
|
*/
|
|
157
157
|
documentLinkAvailable = "documentLinkAvailable",
|
|
158
|
+
/**
|
|
159
|
+
* triggered when the published document link is available in the application.
|
|
160
|
+
*/
|
|
161
|
+
documentPublishedLinkAvailable = "documentPublishedLinkAvailable",
|
|
158
162
|
/**
|
|
159
163
|
* triggered when the document title is changed in the application.
|
|
160
164
|
*/
|
|
@@ -176,6 +180,7 @@ declare interface AppEventsTypeMap {
|
|
|
176
180
|
|
|
177
181
|
[AppEvent.documentIdAvailable]: DocumentIdAvailableEventData;
|
|
178
182
|
[AppEvent.documentLinkAvailable]: DocumentLinkAvailableEventData;
|
|
183
|
+
[AppEvent.documentPublishedLinkAvailable]: DocumentPublishedLinkAvailableEventData;
|
|
179
184
|
[AppEvent.documentTitleChange]: DocumentTitleChangeEventData;
|
|
180
185
|
}
|
|
181
186
|
|
|
@@ -258,17 +263,15 @@ declare interface ApplicationBase {
|
|
|
258
263
|
showModalDialog(dialogOptions: CustomDialogOptions): Promise<CustomDialogResult>;
|
|
259
264
|
|
|
260
265
|
/**
|
|
261
|
-
* @experimental - Experimental API
|
|
262
266
|
* Shows a color picker popover anchored to the specified element.
|
|
263
267
|
* The anchor element must be an instance of HTMLElement.
|
|
264
268
|
* Custom DOM events are dispatched on the anchor element when the color changes or the color picker closes.
|
|
265
|
-
* See {@link
|
|
269
|
+
* See {@link ColorPickerEvent} for more details.
|
|
266
270
|
* @param anchorElement - The HTML element to anchor the color picker to.
|
|
267
271
|
* @param options - Optional configuration options for customizing the color picker behavior and appearance.
|
|
268
272
|
*/
|
|
269
273
|
showColorPicker(anchorElement: HTMLElement, options?: ColorPickerOptions): Promise<void>;
|
|
270
274
|
/**
|
|
271
|
-
* @experimental - Experimental API
|
|
272
275
|
* Hides the color picker popover if it is currently visible.
|
|
273
276
|
*/
|
|
274
277
|
hideColorPicker(): Promise<void>;
|
|
@@ -538,10 +541,9 @@ export declare interface ClientStorage {
|
|
|
538
541
|
}
|
|
539
542
|
|
|
540
543
|
/**
|
|
541
|
-
* @experimental - Experimental API
|
|
542
544
|
* Custom DOM events dispatched on the anchor element passed to `showColorPicker()` API.
|
|
543
545
|
*/
|
|
544
|
-
export declare enum
|
|
546
|
+
export declare enum ColorPickerEvent {
|
|
545
547
|
/**
|
|
546
548
|
* Color change event dispatched when a color is selected.
|
|
547
549
|
* The event detail will contain a 'color' property of type string.
|
|
@@ -554,7 +556,6 @@ export declare enum ColorPickerEvents {
|
|
|
554
556
|
}
|
|
555
557
|
|
|
556
558
|
/**
|
|
557
|
-
* @experimental - Experimental API
|
|
558
559
|
* Options that can be passed to the `showColorPicker` API to customize the color picker's behavior and appearance.
|
|
559
560
|
*/
|
|
560
561
|
export declare interface ColorPickerOptions {
|
|
@@ -564,10 +565,12 @@ export declare interface ColorPickerOptions {
|
|
|
564
565
|
*/
|
|
565
566
|
title?: string;
|
|
566
567
|
/**
|
|
567
|
-
* Initial color for the color picker, in
|
|
568
|
+
* Initial color for the color picker, in hex format.
|
|
569
|
+
* Can provide either as a number in 0xRRGGBB or 0xRRGGBBAA format,
|
|
570
|
+
* or as a string in "#RRGGBB" or "#RRGGBBAA" format.
|
|
568
571
|
* Default color is 0xFFFFFF (white).
|
|
569
572
|
*/
|
|
570
|
-
initialColor?: number;
|
|
573
|
+
initialColor?: number | string;
|
|
571
574
|
/**
|
|
572
575
|
* Placement of the color picker popover relative to the anchor element.
|
|
573
576
|
* Default placement is ColorPickerPlacement.left.
|
|
@@ -586,7 +589,6 @@ export declare interface ColorPickerOptions {
|
|
|
586
589
|
}
|
|
587
590
|
|
|
588
591
|
/**
|
|
589
|
-
* @experimental - Experimental API
|
|
590
592
|
* Denotes the placement of the color picker popover relative to its anchor element.
|
|
591
593
|
* Used in the placement option of `showColorPicker()` API.
|
|
592
594
|
*/
|
|
@@ -631,7 +633,6 @@ declare namespace Constants {
|
|
|
631
633
|
DeviceClass,
|
|
632
634
|
PlatformType,
|
|
633
635
|
ColorPickerPlacement,
|
|
634
|
-
ColorPickerEvents,
|
|
635
636
|
AuthorizationStatus
|
|
636
637
|
};
|
|
637
638
|
}
|
|
@@ -810,7 +811,7 @@ declare interface Document_2 {
|
|
|
810
811
|
/**
|
|
811
812
|
* Add video to the current page
|
|
812
813
|
*/
|
|
813
|
-
addVideo(blob: Blob): Promise<void>;
|
|
814
|
+
addVideo(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
814
815
|
/**
|
|
815
816
|
* Add audio to the current page
|
|
816
817
|
*/
|
|
@@ -830,7 +831,7 @@ declare interface Document_2 {
|
|
|
830
831
|
id(): Promise<string | undefined>;
|
|
831
832
|
/**
|
|
832
833
|
* @experimental - Experimental API
|
|
833
|
-
* Get document Link
|
|
834
|
+
* Get document Link and Published document Link
|
|
834
835
|
*/
|
|
835
836
|
link(options: LinkOptions): Promise<string | undefined>;
|
|
836
837
|
/**
|
|
@@ -840,7 +841,7 @@ declare interface Document_2 {
|
|
|
840
841
|
/**
|
|
841
842
|
* Import a Pdf to the document.
|
|
842
843
|
*/
|
|
843
|
-
importPdf(blob: Blob, attributes: MediaAttributes): void;
|
|
844
|
+
importPdf(blob: Blob, attributes: MediaAttributes & SourceMimeTypeInfo): void;
|
|
844
845
|
/**
|
|
845
846
|
* Import a presentation to the document.
|
|
846
847
|
*/
|
|
@@ -856,21 +857,28 @@ export { Document_2 as Document };
|
|
|
856
857
|
/**
|
|
857
858
|
* The payload data sent to the document id available event handler.
|
|
858
859
|
*/
|
|
859
|
-
declare interface DocumentIdAvailableEventData {
|
|
860
|
+
export declare interface DocumentIdAvailableEventData {
|
|
860
861
|
documentId: string | undefined;
|
|
861
862
|
}
|
|
862
863
|
|
|
863
864
|
/**
|
|
864
865
|
* The payload data sent to the document link available event handler.
|
|
865
866
|
*/
|
|
866
|
-
declare interface DocumentLinkAvailableEventData {
|
|
867
|
+
export declare interface DocumentLinkAvailableEventData {
|
|
867
868
|
documentLink: string | undefined;
|
|
868
869
|
}
|
|
869
870
|
|
|
871
|
+
/**
|
|
872
|
+
* The payload data sent to the published document link available event handler.
|
|
873
|
+
*/
|
|
874
|
+
declare interface DocumentPublishedLinkAvailableEventData {
|
|
875
|
+
documentPublishedLink: string | undefined;
|
|
876
|
+
}
|
|
877
|
+
|
|
870
878
|
/**
|
|
871
879
|
* The payload data sent to the document title change event handler.
|
|
872
880
|
*/
|
|
873
|
-
declare interface DocumentTitleChangeEventData {
|
|
881
|
+
export declare interface DocumentTitleChangeEventData {
|
|
874
882
|
documentTitle: string;
|
|
875
883
|
}
|
|
876
884
|
|
|
@@ -907,7 +915,7 @@ export declare interface DragCompletionData {
|
|
|
907
915
|
/**
|
|
908
916
|
* Interface to provide drag options which can be passed to enableDragToDocument to change the drag behavior.
|
|
909
917
|
*/
|
|
910
|
-
declare interface DragOptions {
|
|
918
|
+
export declare interface DragOptions {
|
|
911
919
|
/**
|
|
912
920
|
* Use preview size for the drag image instead of the element size
|
|
913
921
|
*/
|
|
@@ -1078,7 +1086,11 @@ export declare enum LinkOptions {
|
|
|
1078
1086
|
/**
|
|
1079
1087
|
* Link to the current document
|
|
1080
1088
|
*/
|
|
1081
|
-
document = "document"
|
|
1089
|
+
document = "document",
|
|
1090
|
+
/**
|
|
1091
|
+
* Link to Published document link
|
|
1092
|
+
*/
|
|
1093
|
+
published = "published"
|
|
1082
1094
|
}
|
|
1083
1095
|
|
|
1084
1096
|
/**
|
|
@@ -1718,6 +1730,21 @@ export declare interface SearchAction extends PanelAction {
|
|
|
1718
1730
|
|
|
1719
1731
|
export declare type SimpleDialogOptions = AlertDialogOptions | InputDialogOptions;
|
|
1720
1732
|
|
|
1733
|
+
/**
|
|
1734
|
+
* Mime type details for importing media
|
|
1735
|
+
*/
|
|
1736
|
+
export declare interface SourceMimeTypeInfo {
|
|
1737
|
+
/**
|
|
1738
|
+
* Mime type of the source asset
|
|
1739
|
+
*/
|
|
1740
|
+
sourceMimeType?: SupportedMimeTypes;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
export declare enum SupportedMimeTypes {
|
|
1744
|
+
docx = "docx",
|
|
1745
|
+
gdoc = "gdoc"
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1721
1748
|
/**
|
|
1722
1749
|
* Represents template data for a page
|
|
1723
1750
|
*/
|
|
@@ -1778,7 +1805,7 @@ declare type UnproxyOrClone<T> = T extends RemoteObject<ProxyMarked> ? Local<T>
|
|
|
1778
1805
|
/**
|
|
1779
1806
|
* Callback to unregister iframe from the add-on SDK.
|
|
1780
1807
|
*/
|
|
1781
|
-
declare type UnregisterIframe = () => void;
|
|
1808
|
+
export declare type UnregisterIframe = () => void;
|
|
1782
1809
|
|
|
1783
1810
|
/**
|
|
1784
1811
|
* Types of dialog variants supported.
|