@adobe/ccweb-add-on-sdk-types 1.16.0 → 1.18.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 +179 -56
- package/ui/ui-sdk.d.ts +69 -6
package/package.json
CHANGED
|
@@ -164,7 +164,7 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
|
|
|
164
164
|
*
|
|
165
165
|
* Please note that creating and deleting an artboard in a single frame will crash the editor.
|
|
166
166
|
*/
|
|
167
|
-
export declare class ArtboardNode extends VisualNode implements IRectangularNode
|
|
167
|
+
export declare class ArtboardNode extends VisualNode implements Readonly<IRectangularNode>, ContainerNode {
|
|
168
168
|
/**
|
|
169
169
|
* Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
|
|
170
170
|
* GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
|
|
@@ -190,10 +190,12 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
|
|
|
190
190
|
get parent(): PageNode | undefined;
|
|
191
191
|
/**
|
|
192
192
|
* The width of the artboard.
|
|
193
|
+
* Shares the same dimensions as the parent page and other artboards within the parent page.
|
|
193
194
|
*/
|
|
194
195
|
get width(): number;
|
|
195
196
|
/**
|
|
196
197
|
* The height of the artboard.
|
|
198
|
+
* Shares the same dimensions as the parent page and other artboards within the parent page.
|
|
197
199
|
*/
|
|
198
200
|
get height(): number;
|
|
199
201
|
}
|
|
@@ -213,6 +215,17 @@ export declare interface AutoHeightTextLayout {
|
|
|
213
215
|
width: number;
|
|
214
216
|
}
|
|
215
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
|
+
|
|
216
229
|
/**
|
|
217
230
|
* Font the current user has access or licensing permissions to create / edit content with.
|
|
218
231
|
*/
|
|
@@ -655,6 +668,22 @@ export declare class Editor {
|
|
|
655
668
|
* @returns a Promise that resolves when the lambda has finished running, or rejects if the lambda throws an error.
|
|
656
669
|
*/
|
|
657
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;
|
|
658
687
|
/**
|
|
659
688
|
* User's current selection context
|
|
660
689
|
*/
|
|
@@ -740,15 +769,6 @@ export declare class Editor {
|
|
|
740
769
|
* @returns a stroke configured with the given options.
|
|
741
770
|
*/
|
|
742
771
|
makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
|
|
743
|
-
/**
|
|
744
|
-
* @returns a text node with default styles. The text content is initially empty, so the text node will be
|
|
745
|
-
* invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically
|
|
746
|
-
* adjust to accommodate whatever text is set.
|
|
747
|
-
*
|
|
748
|
-
* Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
|
|
749
|
-
* insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.
|
|
750
|
-
*/
|
|
751
|
-
createText(): TextNode;
|
|
752
772
|
/**
|
|
753
773
|
* @returns a path node with a default stroke and no initial fill.
|
|
754
774
|
* @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
|
|
@@ -918,7 +938,7 @@ export declare class GridCellNode extends MediaContainerNode {}
|
|
|
918
938
|
*
|
|
919
939
|
* APIs to create a new grid layout are not yet available.
|
|
920
940
|
*/
|
|
921
|
-
export declare class GridLayoutNode extends Node implements
|
|
941
|
+
export declare class GridLayoutNode extends Node implements IRectangularNode {
|
|
922
942
|
/**
|
|
923
943
|
* The Grid's regular children. Does not include rectangles and skips over media constainer nodes to return fill grandchildren.
|
|
924
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.
|
|
@@ -932,12 +952,16 @@ export declare class GridLayoutNode extends Node implements Readonly<IRectangula
|
|
|
932
952
|
get fill(): Readonly<Fill>;
|
|
933
953
|
/**
|
|
934
954
|
* The width of the node.
|
|
955
|
+
* Must be at least {@link MIN_DIMENSION}.
|
|
935
956
|
*/
|
|
936
957
|
get width(): number;
|
|
958
|
+
set width(value: number);
|
|
937
959
|
/**
|
|
938
960
|
* The height of the node.
|
|
961
|
+
* Must be at least {@link MIN_DIMENSION}.
|
|
939
962
|
*/
|
|
940
963
|
get height(): number;
|
|
964
|
+
set height(value: number);
|
|
941
965
|
}
|
|
942
966
|
|
|
943
967
|
/**
|
|
@@ -1035,7 +1059,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1035
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
|
|
1036
1060
|
* removed from their previous parent, if any – or if an item is already in *this* list, its index is simply changed.
|
|
1037
1061
|
*
|
|
1038
|
-
* @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}.
|
|
1039
1063
|
*/
|
|
1040
1064
|
append(...items: T[]): void;
|
|
1041
1065
|
/**
|
|
@@ -1047,7 +1071,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1047
1071
|
* `newItem` is removed from its previous parent, if any – or if it's already in *this* list, its index is simply
|
|
1048
1072
|
* changed. No-op if both arguments are the same item.
|
|
1049
1073
|
*
|
|
1050
|
-
* @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}.
|
|
1051
1075
|
*/
|
|
1052
1076
|
replace(oldItem: T, newItem: T): void;
|
|
1053
1077
|
/**
|
|
@@ -1055,7 +1079,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1055
1079
|
* to occupy, shifting `before` and all later items to higher indices. `newItem` is removed from its previous parent,
|
|
1056
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.
|
|
1057
1081
|
*
|
|
1058
|
-
* @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}.
|
|
1059
1083
|
*/
|
|
1060
1084
|
insertBefore(newItem: T, before: T): void;
|
|
1061
1085
|
/**
|
|
@@ -1063,7 +1087,7 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
|
|
|
1063
1087
|
* shifting all later items to higher indices (the index of `after` remains unchanged). `newItem` is removed from its previous parent,
|
|
1064
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.
|
|
1065
1089
|
*
|
|
1066
|
-
* @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}.
|
|
1067
1091
|
*/
|
|
1068
1092
|
insertAfter(newItem: T, after: T): void;
|
|
1069
1093
|
}
|
|
@@ -1270,6 +1294,46 @@ declare class Node extends VisualNode {
|
|
|
1270
1294
|
*/
|
|
1271
1295
|
get blendMode(): BlendMode;
|
|
1272
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;
|
|
1273
1337
|
}
|
|
1274
1338
|
export { Node as Node };
|
|
1275
1339
|
|
|
@@ -1350,7 +1414,7 @@ export declare class PageList extends RestrictedItemList<PageNode> {
|
|
|
1350
1414
|
*
|
|
1351
1415
|
* To create new pages, see {@link PageList.addPage}.
|
|
1352
1416
|
*/
|
|
1353
|
-
export declare class PageNode extends BaseNode implements
|
|
1417
|
+
export declare class PageNode extends BaseNode implements IRectangularNode {
|
|
1354
1418
|
/**
|
|
1355
1419
|
* The artboards or "scenes" of a page, ordered by timeline sequence.
|
|
1356
1420
|
* To create new artboards, see {@link ArtboardList.addArtboard}.
|
|
@@ -1359,13 +1423,17 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
|
|
|
1359
1423
|
/**
|
|
1360
1424
|
* The width of the node.
|
|
1361
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}.
|
|
1362
1427
|
*/
|
|
1363
1428
|
get width(): number;
|
|
1429
|
+
set width(value: number);
|
|
1364
1430
|
/**
|
|
1365
1431
|
* The height of the node.
|
|
1366
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}.
|
|
1367
1434
|
*/
|
|
1368
1435
|
get height(): number;
|
|
1436
|
+
set height(value: number);
|
|
1369
1437
|
/**
|
|
1370
1438
|
* The page's name. Displayed as a user-editable label above the current artboard in the UI.
|
|
1371
1439
|
*/
|
|
@@ -1474,17 +1542,6 @@ export declare interface Point {
|
|
|
1474
1542
|
y: number;
|
|
1475
1543
|
}
|
|
1476
1544
|
|
|
1477
|
-
/**
|
|
1478
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
1479
|
-
*
|
|
1480
|
-
* **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`.
|
|
1481
|
-
*
|
|
1482
|
-
* @experimental
|
|
1483
|
-
*/
|
|
1484
|
-
export declare interface PointTextLayout {
|
|
1485
|
-
type: TextLayout.autoWidth;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
1545
|
/**
|
|
1489
1546
|
* ReadOnlyItemList represents an ordered list of API objects, representing items that are all children of the
|
|
1490
1547
|
* same parent node. (The reverse is not necessarily true, however: this list might not include all
|
|
@@ -1525,7 +1582,7 @@ export declare class ReadOnlyItemList<T extends ListItem> {
|
|
|
1525
1582
|
toArray(): readonly T[];
|
|
1526
1583
|
}
|
|
1527
1584
|
|
|
1528
|
-
declare interface Rect {
|
|
1585
|
+
export declare interface Rect {
|
|
1529
1586
|
x: number;
|
|
1530
1587
|
y: number;
|
|
1531
1588
|
width: number;
|
|
@@ -1730,6 +1787,31 @@ export declare interface SolidColorStroke extends Stroke {
|
|
|
1730
1787
|
export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "type"> &
|
|
1731
1788
|
Partial<Pick<SolidColorStroke, "type">>;
|
|
1732
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
|
+
|
|
1733
1815
|
/**
|
|
1734
1816
|
* Base class for a Node that can have its own stroke.
|
|
1735
1817
|
*/
|
|
@@ -1818,7 +1900,8 @@ declare enum TextAlignment {
|
|
|
1818
1900
|
}
|
|
1819
1901
|
|
|
1820
1902
|
/**
|
|
1821
|
-
* 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.
|
|
1822
1905
|
* Use this model to get or modify the text string and the style ranges applied to it.
|
|
1823
1906
|
*/
|
|
1824
1907
|
export declare class TextContentModel {
|
|
@@ -1838,14 +1921,14 @@ export declare class TextContentModel {
|
|
|
1838
1921
|
get id(): string;
|
|
1839
1922
|
/**
|
|
1840
1923
|
* Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
|
|
1841
|
-
* starts in the first {@link
|
|
1842
|
-
* 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.
|
|
1843
1926
|
*
|
|
1844
|
-
* If there are multiple {@link
|
|
1927
|
+
* If there are multiple {@link ThreadedTextNode}s, all of them must be configured to use {@link AreaTextLayout}.
|
|
1845
1928
|
*/
|
|
1846
1929
|
get allTextNodes(): Readonly<Iterable<TextNode>>;
|
|
1847
1930
|
/**
|
|
1848
|
-
* The complete text string, which may span multiple {@link
|
|
1931
|
+
* The complete text string, which may span multiple {@link ThreadedTextNode} "frames" in the scenegraph.
|
|
1849
1932
|
*/
|
|
1850
1933
|
get text(): string;
|
|
1851
1934
|
set text(textContent: string);
|
|
@@ -1966,14 +2049,21 @@ declare enum TextLayout {
|
|
|
1966
2049
|
}
|
|
1967
2050
|
|
|
1968
2051
|
/**
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1971
|
-
*
|
|
1972
|
-
*
|
|
1973
|
-
* To create new a single-frame piece of text, see {@link Editor.createText}. APIs are not yet available to create
|
|
1974
|
-
* multi-frame text flows.
|
|
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.
|
|
1975
2056
|
*/
|
|
1976
|
-
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>;
|
|
1977
2067
|
/**
|
|
1978
2068
|
* {@inheritDoc VisualNode.centerPointLocal}
|
|
1979
2069
|
*
|
|
@@ -1992,6 +2082,22 @@ export declare class TextNode extends Node {
|
|
|
1992
2082
|
*
|
|
1993
2083
|
*/
|
|
1994
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>;
|
|
1995
2101
|
/**
|
|
1996
2102
|
* The model containing the complete text string and its styles, only part of which may be visible within the bounds of
|
|
1997
2103
|
* this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a
|
|
@@ -2004,13 +2110,21 @@ export declare class TextNode extends Node {
|
|
|
2004
2110
|
*
|
|
2005
2111
|
*/
|
|
2006
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;
|
|
2007
2121
|
/**
|
|
2008
2122
|
* The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size
|
|
2009
2123
|
* ({@link AreaTextLayout}), any text content that does not fit within this node's area will be clipped.
|
|
2010
2124
|
*
|
|
2011
2125
|
* To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`.
|
|
2012
2126
|
*/
|
|
2013
|
-
get nextTextNode():
|
|
2127
|
+
abstract get nextTextNode(): ThreadedTextNode | undefined;
|
|
2014
2128
|
/**
|
|
2015
2129
|
* The text string content which is partially *or* fully displayed in this TextNode "frame."
|
|
2016
2130
|
* WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return
|
|
@@ -2042,7 +2156,27 @@ export declare class TextNode extends Node {
|
|
|
2042
2156
|
* @experimental
|
|
2043
2157
|
* @returns The layout mode of the TextNode "frame."
|
|
2044
2158
|
*/
|
|
2045
|
-
get layout(): Readonly<
|
|
2159
|
+
get layout(): Readonly<AutoWidthTextLayout | AutoHeightTextLayout | AreaTextLayout | UnsupportedTextLayout>;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
/**
|
|
2163
|
+
* A range of text in a {@link TextContentModel}.
|
|
2164
|
+
*/
|
|
2165
|
+
declare interface TextRange {
|
|
2166
|
+
start: number;
|
|
2167
|
+
length: number;
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
/**
|
|
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.
|
|
2174
|
+
*
|
|
2175
|
+
* APIs are not yet available to create multi-frame text flows.
|
|
2176
|
+
*/
|
|
2177
|
+
export declare class ThreadedTextNode extends TextNode {
|
|
2178
|
+
get nextTextNode(): ThreadedTextNode | undefined;
|
|
2179
|
+
get layout(): Readonly<AreaTextLayout>;
|
|
2046
2180
|
/**
|
|
2047
2181
|
* <InlineAlert slots="text" variant="warning"/>
|
|
2048
2182
|
*
|
|
@@ -2051,22 +2185,11 @@ export declare class TextNode extends Node {
|
|
|
2051
2185
|
* @experimental
|
|
2052
2186
|
* Sets the layout mode of the TextNode "frame."
|
|
2053
2187
|
*
|
|
2054
|
-
*
|
|
2055
|
-
* layout modes, except for {@link AreaTextLayout}, are only available for single-frame text.
|
|
2188
|
+
* Only {@link AreaTextLayout}, with fully fixed bounds, is currently supported by threaded text.
|
|
2056
2189
|
*
|
|
2057
|
-
* @throws if
|
|
2058
|
-
* @throws if {@link TextNode} is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
|
|
2059
|
-
* @throws if {@link TextNode} is not a part of a multi-frame text content flow and the layout is {@link AreaTextLayout}.
|
|
2190
|
+
* @throws if {@link ThreadedTextNode} is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
|
|
2060
2191
|
*/
|
|
2061
|
-
set layout(layout:
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
/**
|
|
2065
|
-
* A range of text in a {@link TextContentModel}.
|
|
2066
|
-
*/
|
|
2067
|
-
declare interface TextRange {
|
|
2068
|
-
start: number;
|
|
2069
|
-
length: number;
|
|
2192
|
+
set layout(layout: AreaTextLayout);
|
|
2070
2193
|
}
|
|
2071
2194
|
|
|
2072
2195
|
/**
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -155,10 +155,18 @@ 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
|
*/
|
|
161
|
-
documentTitleChange = "documentTitleChange"
|
|
165
|
+
documentTitleChange = "documentTitleChange",
|
|
166
|
+
/**
|
|
167
|
+
* triggered when the document's export permission status changes in review and approval workflow.
|
|
168
|
+
*/
|
|
169
|
+
documentExportAllowedChange = "documentExportAllowedChange"
|
|
162
170
|
}
|
|
163
171
|
|
|
164
172
|
export declare type AppEventHandlerType<Event extends AppEventType> = (data: AppEventsTypeMap[Event]) => void;
|
|
@@ -176,7 +184,9 @@ declare interface AppEventsTypeMap {
|
|
|
176
184
|
|
|
177
185
|
[AppEvent.documentIdAvailable]: DocumentIdAvailableEventData;
|
|
178
186
|
[AppEvent.documentLinkAvailable]: DocumentLinkAvailableEventData;
|
|
187
|
+
[AppEvent.documentPublishedLinkAvailable]: DocumentPublishedLinkAvailableEventData;
|
|
179
188
|
[AppEvent.documentTitleChange]: DocumentTitleChangeEventData;
|
|
189
|
+
[AppEvent.documentExportAllowedChange]: DocumentExportAllowedChangeEventData;
|
|
180
190
|
}
|
|
181
191
|
|
|
182
192
|
export declare type AppEventType = keyof AppEventsTypeMap & string;
|
|
@@ -806,7 +816,7 @@ declare interface Document_2 {
|
|
|
806
816
|
/**
|
|
807
817
|
* Add video to the current page
|
|
808
818
|
*/
|
|
809
|
-
addVideo(blob: Blob): Promise<void>;
|
|
819
|
+
addVideo(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
810
820
|
/**
|
|
811
821
|
* Add audio to the current page
|
|
812
822
|
*/
|
|
@@ -826,17 +836,21 @@ declare interface Document_2 {
|
|
|
826
836
|
id(): Promise<string | undefined>;
|
|
827
837
|
/**
|
|
828
838
|
* @experimental - Experimental API
|
|
829
|
-
* Get document Link
|
|
839
|
+
* Get document Link and Published document Link
|
|
830
840
|
*/
|
|
831
841
|
link(options: LinkOptions): Promise<string | undefined>;
|
|
832
842
|
/**
|
|
833
843
|
* Get document name/title
|
|
834
844
|
*/
|
|
835
845
|
title(): Promise<string>;
|
|
846
|
+
/**
|
|
847
|
+
* Returns whether the document can be exported based on its review status in the review and approval workflow.
|
|
848
|
+
*/
|
|
849
|
+
exportAllowed(): Promise<boolean>;
|
|
836
850
|
/**
|
|
837
851
|
* Import a Pdf to the document.
|
|
838
852
|
*/
|
|
839
|
-
importPdf(blob: Blob, attributes: MediaAttributes): void;
|
|
853
|
+
importPdf(blob: Blob, attributes: MediaAttributes & SourceMimeTypeInfo): void;
|
|
840
854
|
/**
|
|
841
855
|
* Import a presentation to the document.
|
|
842
856
|
*/
|
|
@@ -849,6 +863,13 @@ declare interface Document_2 {
|
|
|
849
863
|
}
|
|
850
864
|
export { Document_2 as Document };
|
|
851
865
|
|
|
866
|
+
/**
|
|
867
|
+
* The payload data sent when the document's export permission status changes in review and approval workflow.
|
|
868
|
+
*/
|
|
869
|
+
export declare interface DocumentExportAllowedChangeEventData {
|
|
870
|
+
documentExportAllowed: boolean;
|
|
871
|
+
}
|
|
872
|
+
|
|
852
873
|
/**
|
|
853
874
|
* The payload data sent to the document id available event handler.
|
|
854
875
|
*/
|
|
@@ -863,6 +884,13 @@ export declare interface DocumentLinkAvailableEventData {
|
|
|
863
884
|
documentLink: string | undefined;
|
|
864
885
|
}
|
|
865
886
|
|
|
887
|
+
/**
|
|
888
|
+
* The payload data sent to the published document link available event handler.
|
|
889
|
+
*/
|
|
890
|
+
declare interface DocumentPublishedLinkAvailableEventData {
|
|
891
|
+
documentPublishedLink: string | undefined;
|
|
892
|
+
}
|
|
893
|
+
|
|
866
894
|
/**
|
|
867
895
|
* The payload data sent to the document title change event handler.
|
|
868
896
|
*/
|
|
@@ -897,7 +925,7 @@ export declare interface DragCompletionData {
|
|
|
897
925
|
/**
|
|
898
926
|
* Media info
|
|
899
927
|
*/
|
|
900
|
-
attributes?: MediaAttributes;
|
|
928
|
+
attributes?: MediaAttributes & SourceMimeTypeInfo;
|
|
901
929
|
}
|
|
902
930
|
|
|
903
931
|
/**
|
|
@@ -1074,7 +1102,11 @@ export declare enum LinkOptions {
|
|
|
1074
1102
|
/**
|
|
1075
1103
|
* Link to the current document
|
|
1076
1104
|
*/
|
|
1077
|
-
document = "document"
|
|
1105
|
+
document = "document",
|
|
1106
|
+
/**
|
|
1107
|
+
* Link to Published document link
|
|
1108
|
+
*/
|
|
1109
|
+
published = "published"
|
|
1078
1110
|
}
|
|
1079
1111
|
|
|
1080
1112
|
/**
|
|
@@ -1252,6 +1284,22 @@ export declare interface PageMetadata {
|
|
|
1252
1284
|
* Whether page contains timelines
|
|
1253
1285
|
*/
|
|
1254
1286
|
hasTemporalContent: boolean;
|
|
1287
|
+
/**
|
|
1288
|
+
* Duration of the temporal content in seconds. Applicable only if hasTemporalContent is true.
|
|
1289
|
+
*/
|
|
1290
|
+
temporalContentDuration?: number;
|
|
1291
|
+
/**
|
|
1292
|
+
* Whether the page contains audio content
|
|
1293
|
+
*/
|
|
1294
|
+
hasAudioContent: boolean;
|
|
1295
|
+
/**
|
|
1296
|
+
* Whether the page contains video content
|
|
1297
|
+
*/
|
|
1298
|
+
hasVideoContent: boolean;
|
|
1299
|
+
/**
|
|
1300
|
+
* Whether the page contains animated content
|
|
1301
|
+
*/
|
|
1302
|
+
hasAnimatedContent: boolean;
|
|
1255
1303
|
/**
|
|
1256
1304
|
* Whether the page is blank
|
|
1257
1305
|
*/
|
|
@@ -1714,6 +1762,21 @@ export declare interface SearchAction extends PanelAction {
|
|
|
1714
1762
|
|
|
1715
1763
|
export declare type SimpleDialogOptions = AlertDialogOptions | InputDialogOptions;
|
|
1716
1764
|
|
|
1765
|
+
/**
|
|
1766
|
+
* Mime type details for importing media
|
|
1767
|
+
*/
|
|
1768
|
+
export declare interface SourceMimeTypeInfo {
|
|
1769
|
+
/**
|
|
1770
|
+
* Mime type of the source asset
|
|
1771
|
+
*/
|
|
1772
|
+
sourceMimeType?: SupportedMimeTypes;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
export declare enum SupportedMimeTypes {
|
|
1776
|
+
docx = "docx",
|
|
1777
|
+
gdoc = "gdoc"
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1717
1780
|
/**
|
|
1718
1781
|
* Represents template data for a page
|
|
1719
1782
|
*/
|