@adobe/ccweb-add-on-sdk-types 1.26.0 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/ccweb-add-on-sdk-types",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -84,6 +84,7 @@ declare namespace ApiConstants {
84
84
  TextLayout,
85
85
  TextScriptStyle,
86
86
  EditorEvent,
87
+ ResizeBehavior,
87
88
  VisualEffectType,
88
89
  TextStyleSource,
89
90
  ParagraphListType,
@@ -553,6 +554,22 @@ export declare class ColorUtils {
553
554
 
554
555
  export declare const colorUtils: ExpressColorUtilsWrapper;
555
556
 
557
+ /**
558
+ * <InlineAlert slots="text" variant="warning"/>
559
+ *
560
+ * **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`.
561
+ *
562
+ * @experimental
563
+ * An interface for arbitrary resize operations regardless of whether given a width or height when using {@link Node.resize}.
564
+ */
565
+ declare interface CommonResizeOptions {
566
+ /**
567
+ * Whether to try to avoid scaling the content's visual styling (e.g. stroke width, corner detailing, etc.).
568
+ * Note that some kinds of content may not be able to avoid rescaling in some scenarios.
569
+ */
570
+ avoidScalingVisualDetailsIfPossible: boolean;
571
+ }
572
+
556
573
  /**
557
574
  * A ComplexShapeNode is a complex prepackaged shape that appears as a leaf node in the UI, even if it is composed
558
575
  * of multiple separate paths.
@@ -849,13 +866,7 @@ export declare class ExpressContext extends Context {
849
866
  * Entry point for Express specific APIs that read or modify the document's content.
850
867
  */
851
868
  export declare class ExpressEditor extends Editor {
852
- /**
853
- * User's current selection context
854
- */
855
869
  get context(): ExpressContext;
856
- /**
857
- * @returns the root of the document.
858
- */
859
870
  get documentRoot(): ExpressRootNode;
860
871
  }
861
872
 
@@ -980,6 +991,17 @@ export declare const fonts: ExpressFontsWrapper;
980
991
  * media rectangle child when those actions are applied.
981
992
  */
982
993
  export declare class GridCellNode extends Node implements IMediaContainerNode {
994
+ /**
995
+ * <InlineAlert slots="text" variant="warning"/>
996
+ *
997
+ * **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`.
998
+ *
999
+ * @experimental
1000
+ * Proxy resizing of the MediaRectangleNode *inside* this grid cell. The enclosing grid layout keeps
1001
+ * the crop window (and thus the overall GridCellNode/MediaContainerNode bounds) fixed in position.
1002
+ * *Warning:* This will not change the bounds reported by this GridCellNode itself.
1003
+ */
1004
+ resize(options: ResizeOptions): void;
983
1005
  /**
984
1006
  * Always throws as it's not possible to clone a single grid slot.
985
1007
  * Use the parent grid container instead.
@@ -1080,9 +1102,18 @@ export declare class ImageRectangleNode extends MediaRectangleNode {
1080
1102
  * **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`.
1081
1103
  *
1082
1104
  * @experimental
1083
- * Fetches the bitmap image resource used by this node. This will wait for the bitmap to be available if necessary.
1105
+ * Fetches the bitmap image resource used by this node. Waits up to a minute for the bitmap to be available if necessary.
1084
1106
  */
1085
1107
  fetchBitmapImage(): Promise<BitmapImage>;
1108
+ /**
1109
+ * <InlineAlert slots="text" variant="warning"/>
1110
+ *
1111
+ * **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`.
1112
+ *
1113
+ * @experimental
1114
+ * Returns true if the media can be exported based on the user's entitlements.
1115
+ */
1116
+ canExportMedia(): boolean;
1086
1117
  }
1087
1118
 
1088
1119
  /**
@@ -1440,60 +1471,9 @@ declare class Node extends VisualNode implements INodeBounds {
1440
1471
  * **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`.
1441
1472
  *
1442
1473
  * @experimental
1443
- * Changes the width to the given value by visually *scaling* the entire content larger or smaller on both axes to
1444
- * preserve its existing aspect ratio, keeping its top-left corner ({@link topLeftLocal}) at a fixed location.
1445
- *
1446
- * Scaling changes the size of visual styling elements such as stroke width, corner detailing, and font size.
1447
- * Contrast this to *resizing* operations (such as {@link resizeToFitWithin}), which adjust the bounding box of an
1448
- * element while trying to preserve the existing size of visual detailing such as strokes, corners, and fonts.
1449
- *
1450
- * Rescaling becomes baked into the updated values of fields such as stroke weight, rectangle width, etc. (it is not
1451
- * a separate, persistent scale factor multiplier).
1452
- */
1453
- rescaleProportionalToWidth(width: number): void;
1454
- /**
1455
- * <InlineAlert slots="text" variant="warning"/>
1456
- *
1457
- * **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`.
1458
- *
1459
- * @experimental
1460
- * Changes the height to the given value by visually *scaling* the entire content larger or smaller on both axes to
1461
- * preserve its existing aspect ratio. See {@link rescaleProportionalToWidth} documentation for additional explanation.
1462
- */
1463
- rescaleProportionalToHeight(height: number): void;
1464
- /**
1465
- * <InlineAlert slots="text" variant="warning"/>
1466
- *
1467
- * **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`.
1468
- *
1469
- * @experimental
1470
- * Resizes the node to fit entirely *within* a box of the given dimensions, keeping its top-left corner ({@link topLeftLocal})
1471
- * at a fixed location. Nodes with a fixed aspect ratio may leave unused space on one axis as a result, but nodes
1472
- * with flexible aspect ratio will be resized to the exact box size specified.
1473
- *
1474
- * Resizing attempts to preserve the existing size of visual styling elements such as stroke width, corner detailing,
1475
- * and font size as much as possible. Contrast with *rescaling* (such as {@link rescaleProportionalToWidth}), which
1476
- * always changes the size of visual detailing in exact proportion to the change in overall bounding box size. This
1477
- * API may still produce *some* degree of rescaling if necessary for certain shapes with fixed corner/edge detailing
1478
- * to fit the box better.
1479
- *
1480
- * @see resizeToCover
1474
+ * Resizes this node based on the given {@link ResizeOptions}.
1481
1475
  */
1482
- resizeToFitWithin(width: number, height: number): void;
1483
- /**
1484
- * <InlineAlert slots="text" variant="warning"/>
1485
- *
1486
- * **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`.
1487
- *
1488
- * @experimental
1489
- * Resizes the node to completely *cover* a box of the given dimensions, keeping its top-left corner ({@link topLeftLocal})
1490
- * at a fixed location. Nodes with a fixed aspect ratio may extend outside the box on one axis as a result, but
1491
- * nodes with flexible aspect ratio will be resized to the exact box size specified. See {@link resizeToFitWithin}
1492
- * documentation for additional explanation.
1493
- *
1494
- * @see resizeToFitWithin
1495
- */
1496
- resizeToCover(width: number, height: number): void;
1476
+ resize(options: ResizeOptions): void;
1497
1477
  /**
1498
1478
  * Creates a copy of this node and its entire subtree of descendants.
1499
1479
  *
@@ -1836,6 +1816,111 @@ declare interface RemoveListStyleInput extends BaseParagraphListStyle {
1836
1816
  type: ParagraphListType.none;
1837
1817
  }
1838
1818
 
1819
+ /**
1820
+ * <InlineAlert slots="text" variant="warning"/>
1821
+ *
1822
+ * **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`.
1823
+ *
1824
+ * @experimental
1825
+ * An interface for rescaling the node based on a given height when using {@link Node.resize}.
1826
+ */
1827
+ declare interface RescaleProportionalToHeightOptions extends CommonResizeOptions {
1828
+ behavior: ResizeBehavior.proportional;
1829
+ height: number;
1830
+ /** Instead of providing a width, it will be calculated by multiplying the given height by the current aspect ratio. */
1831
+ width?: never;
1832
+ }
1833
+
1834
+ /**
1835
+ * <InlineAlert slots="text" variant="warning"/>
1836
+ *
1837
+ * **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`.
1838
+ *
1839
+ * @experimental
1840
+ * An interface for rescaling the node based on a given width when using {@link Node.resize}.
1841
+ */
1842
+ declare interface RescaleProportionalToWidthOptions extends CommonResizeOptions {
1843
+ behavior: ResizeBehavior.proportional;
1844
+ width: number;
1845
+ /** Instead of providing a height, it will be calculated by multiplying the given width by the current aspect ratio. */
1846
+ height?: never;
1847
+ }
1848
+
1849
+ /**
1850
+ * <InlineAlert slots="text" variant="warning"/>
1851
+ *
1852
+ * **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`.
1853
+ *
1854
+ * @experimental
1855
+ * An enum for controlling the behavior of {@link Node.resize}.
1856
+ */
1857
+ export declare enum ResizeBehavior {
1858
+ /**
1859
+ * Resizes the node to fit entirely *within* a box of the given dimensions, keeping its {@link topLeftLocal}
1860
+ * at a fixed location. Nodes with a fixed aspect ratio may leave unused space on one axis as a result,
1861
+ * but nodes with flexible aspect ratio will be resized to the exact box size specified.
1862
+ */
1863
+ contain = "contain",
1864
+ /**
1865
+ * Resizes the node to completely *cover* a box of the given dimensions, keeping its {@link topLeftLocal}
1866
+ * at a fixed location. Nodes with a fixed aspect ratio may extend outside the box on one axis as a result,
1867
+ * but nodes with flexible aspect ratio will be resized to the exact box size specified.
1868
+ */
1869
+ cover = "cover",
1870
+ /**
1871
+ * Resizes the node to the given width or height while preserving its current aspect ratio, keeping its
1872
+ * {@link topLeftLocal} at a fixed location.
1873
+ */
1874
+ proportional = "proportional"
1875
+ }
1876
+
1877
+ /**
1878
+ * <InlineAlert slots="text" variant="warning"/>
1879
+ *
1880
+ * **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`.
1881
+ *
1882
+ * @experimental
1883
+ * A type union for providing the necessary arguments to {@link Node.resize}.
1884
+ *
1885
+ * Note that some nodes only support proportional resizing. In some cases this is always true (e.g. images) while in
1886
+ * other cases it is due to the current visual details (e.g. the stroke being too thick to shrink the size of a shape).
1887
+ */
1888
+ export declare type ResizeOptions =
1889
+ | RescaleProportionalToWidthOptions
1890
+ | RescaleProportionalToHeightOptions
1891
+ | ResizeUsingWidthOptions
1892
+ | ResizeUsingHeightOptions;
1893
+
1894
+ /**
1895
+ * <InlineAlert slots="text" variant="warning"/>
1896
+ *
1897
+ * **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`.
1898
+ *
1899
+ * @experimental
1900
+ * An interface for resizing the node based on a given height when using {@link Node.resize}.
1901
+ */
1902
+ declare interface ResizeUsingHeightOptions extends CommonResizeOptions {
1903
+ behavior: ResizeBehavior.contain | ResizeBehavior.cover;
1904
+ height: number;
1905
+ /** If a width is not provided, it will be calculated by multiplying the given height by the current aspect ratio. */
1906
+ width?: number;
1907
+ }
1908
+
1909
+ /**
1910
+ * <InlineAlert slots="text" variant="warning"/>
1911
+ *
1912
+ * **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`.
1913
+ *
1914
+ * @experimental
1915
+ * An interface for resizing the node based on a given width when using {@link Node.resize}.
1916
+ */
1917
+ declare interface ResizeUsingWidthOptions extends CommonResizeOptions {
1918
+ behavior: ResizeBehavior.contain | ResizeBehavior.cover;
1919
+ width: number;
1920
+ /** If a height is not provided, it will be calculated by multiplying the given width by the current aspect ratio. */
1921
+ height?: number;
1922
+ }
1923
+
1839
1924
  /**
1840
1925
  * Base for ItemLists that restrict how items are added to the list, but freely allow items to be removed and
1841
1926
  * reordered. The {@link ItemList} subclass adds more capabilities, however.
package/ui/ui-sdk.d.ts CHANGED
@@ -912,7 +912,6 @@ declare interface Document_2 {
912
912
  */
913
913
  getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
914
914
  /**
915
- * @experimental - Experimental API
916
915
  * Get the currently selected page ids.
917
916
  */
918
917
  getSelectedPageIds(): Promise<string[]>;
@@ -1316,7 +1315,8 @@ export declare interface JpgRenditionOptions extends RenditionOptions {
1316
1315
  */
1317
1316
  quality?: number;
1318
1317
  /**
1319
- * Requested size
1318
+ * The desired dimensions for the image rendition.
1319
+ * NOTE: Only downscaling is supported on mobile and chrome OS devices.
1320
1320
  */
1321
1321
  requestedSize?: {
1322
1322
  width?: number;
@@ -1751,7 +1751,8 @@ export declare interface PngRenditionOptions extends RenditionOptions {
1751
1751
  */
1752
1752
  backgroundColor?: number;
1753
1753
  /**
1754
- * Requested size
1754
+ * The desired dimensions for the image rendition.
1755
+ * NOTE: Only downscaling is supported on mobile and chrome OS devices.
1755
1756
  */
1756
1757
  requestedSize?: {
1757
1758
  width?: number;