@adobe/ccweb-add-on-sdk-types 1.28.0 → 1.29.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.28.0",
3
+ "version": "1.29.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -88,7 +88,8 @@ declare namespace ApiConstants {
88
88
  VisualEffectType,
89
89
  TextStyleSource,
90
90
  ParagraphListType,
91
- OrderedListNumbering
91
+ OrderedListNumbering,
92
+ CreateRenditionFormat
92
93
  };
93
94
  }
94
95
 
@@ -171,6 +172,23 @@ export declare class ArtboardNode extends VisualNode implements Readonly<IRectan
171
172
  * The children of an Artboard are all subclasses of Node (not just the more minimal BaseNode or VisualNode).
172
173
  */
173
174
  get allChildren(): Readonly<Iterable<Node>>;
175
+ /**
176
+ * <InlineAlert slots="text" variant="warning"/>
177
+ *
178
+ * **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`.
179
+ *
180
+ * @experimental
181
+ * Helper to recursively traverse *all* the exposed scenegraph content within the subtree of this node.
182
+ * Every container node and every leaf node will be visited via a pre-order tree traversal.
183
+ * Although once called the list of direct descendants is static, changes to further descendants may appear while
184
+ * iterating depending on when the operation occurs relative to the parent being yielded.
185
+ * Note that the root node (i.e. what this API was called on) is not visited.
186
+ *
187
+ * The descendants of an Artboard are all subclasses of Node (not just the more minimal BaseNode or VisualNode).
188
+ *
189
+ * Warning: Processing text content via this API can be error-prone. Use {@link VisualNode.allTextContent}
190
+ */
191
+ get allDescendants(): Readonly<Iterable<Node>>;
174
192
  /**
175
193
  * The artboards's regular children (does not include any "background layer" content if present; use {@link allChildren}
176
194
  * for a read-only view that includes background content). Use the methods on this `children` ItemList object to get,
@@ -393,7 +411,7 @@ export declare class BitmapImage {
393
411
  * **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`.
394
412
  *
395
413
  * @experimental
396
- * Fetches the bitmap data as a Blob. This will wait for the bitmap to be available if necessary.
414
+ * Fetches the bitmap data as a Blob. Waits up to 1 minute for the bitmap to be available if necessary.
397
415
  */
398
416
  data(): Promise<Blob>;
399
417
  }
@@ -647,6 +665,60 @@ export declare class Context {
647
665
  get insertionParent(): ContainerNode;
648
666
  }
649
667
 
668
+ /**
669
+ * <InlineAlert slots="text" variant="warning"/>
670
+ *
671
+ * **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`.
672
+ *
673
+ * @experimental
674
+ * The format of the rendition output.
675
+ */
676
+ export declare enum CreateRenditionFormat {
677
+ png = "png",
678
+ jpeg = "jpeg"
679
+ }
680
+
681
+ /**
682
+ * <InlineAlert slots="text" variant="warning"/>
683
+ *
684
+ * **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`.
685
+ *
686
+ * @experimental
687
+ * An interface for configuring {@link VisualNode.createRendition}.
688
+ */
689
+ export declare interface CreateRenditionOptions {
690
+ /**
691
+ * Whether to output in PNG or JPEG format. Defaults to PNG.
692
+ */
693
+ format?: CreateRenditionFormat;
694
+ /**
695
+ * The scale factor to apply to the content before it is rendered.
696
+ */
697
+ scale?: number;
698
+ }
699
+
700
+ /**
701
+ * <InlineAlert slots="text" variant="warning"/>
702
+ *
703
+ * **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`.
704
+ *
705
+ * @experimental
706
+ * An interface for the result of {@link VisualNode.createRendition}.
707
+ */
708
+ export declare interface CreateRenditionResult {
709
+ /**
710
+ * The PNG or JPEG data for the rendition.
711
+ */
712
+ blob?: Blob;
713
+ /**
714
+ * The bounds of the rendition in the global coordinate space.
715
+ * This may be larger than the {@link VisualNode.boundsLocal} due to rotations, borders, filters, or other effects.
716
+ * Only provided if the {@link VisualNode} is not orphaned.
717
+ *
718
+ */
719
+ drawBoundsGlobal?: Rect;
720
+ }
721
+
650
722
  /**
651
723
  * Entry point for APIs that read or modify the document's content.
652
724
  */
@@ -788,6 +860,25 @@ export declare class Editor {
788
860
  * @returns a stroke configured with the given options.
789
861
  */
790
862
  makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
863
+ /**
864
+ * <InlineAlert slots="text" variant="warning"/>
865
+ *
866
+ * **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`.
867
+ *
868
+ * @experimental
869
+ * @param parentNode - The parent node that will contain the threaded text node. This must be a container node (e.g., ArtboardNode, GroupNode) that is attached to the document.
870
+ * @param textContent - The initial text content for the threaded text node.
871
+ * @param geometry - The geometry of the threaded text node.
872
+ * @returns A new ThreadedTextNode that is part of a threaded text flow.
873
+ *
874
+ * @throws if parentNode is not provided or is not a valid container node.
875
+ * @throws if textContent is empty or invalid.
876
+ */
877
+ createThreadedText(
878
+ parentNode: ContainerNode,
879
+ textContent: string,
880
+ geometry?: TextFrameAreaGeometry
881
+ ): ThreadedTextNode;
791
882
  /**
792
883
  * @returns a path node with a default stroke and no initial fill.
793
884
  * @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
@@ -1409,6 +1500,23 @@ declare class Node extends VisualNode implements INodeBounds {
1409
1500
  * The children of a Node are always other Node classes (never the more minimal BaseNode).
1410
1501
  */
1411
1502
  get allChildren(): Readonly<Iterable<Node>>;
1503
+ /**
1504
+ * <InlineAlert slots="text" variant="warning"/>
1505
+ *
1506
+ * **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`.
1507
+ *
1508
+ * @experimental
1509
+ * Helper to recursively traverse *all* the exposed scenegraph content within the subtree of this node.
1510
+ * Every container node and every leaf node will be visited via a pre-order tree traversal.
1511
+ * Although once called the list of direct descendants is static, changes to further descendants may appear while
1512
+ * iterating depending on when the operation occurs relative to the parent being yielded.
1513
+ * Note that the root node (i.e. what this API was called on) is not visited.
1514
+ *
1515
+ * The descendants of a Node are always other Node classes (never the more minimal BaseNode).
1516
+ *
1517
+ * Warning: Processing text content via this API can be error-prone. Use {@link VisualNode.allTextContent}
1518
+ */
1519
+ get allDescendants(): Readonly<Iterable<Node>>;
1412
1520
  get boundsInParent(): Readonly<Rect>;
1413
1521
  boundsInNode(targetNode: VisualNode): Readonly<Rect>;
1414
1522
  get translation(): Readonly<Point>;
@@ -1553,6 +1661,37 @@ export declare class PageNode extends BaseNode implements IRectangularNode {
1553
1661
  * To create new artboards, see {@link ArtboardList.addArtboard}.
1554
1662
  */
1555
1663
  get artboards(): ArtboardList;
1664
+ /**
1665
+ * <InlineAlert slots="text" variant="warning"/>
1666
+ *
1667
+ * **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`.
1668
+ *
1669
+ * @experimental
1670
+ * Helper to recursively traverse *all* the exposed scenegraph content within the subtree of this node.
1671
+ * Every container node and every leaf node will be visited via a pre-order tree traversal.
1672
+ * Although once called the list of direct descendants is static, changes to further descendants may appear while
1673
+ * iterating depending on when the operation occurs relative to the parent being yielded.
1674
+ * Note that the root node (i.e. what this API was called on) is not visited.
1675
+ *
1676
+ * Warning: Processing text content via this API can be error-prone. Use {@link VisualNode.allTextContent}
1677
+ */
1678
+ get allDescendants(): Readonly<Iterable<VisualNode>>;
1679
+ /**
1680
+ * <InlineAlert slots="text" variant="warning"/>
1681
+ *
1682
+ * **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`.
1683
+ *
1684
+ * @experimental
1685
+ * Helper to process all text content that is found as part of or within this node. This can be hard to do correctly
1686
+ * via manual tree traversal since multiple {@link ThreadedTextNode} can share a single {@link TextContentModel}.
1687
+ *
1688
+ * This iterator returns a single result per TextContentModel that is at least partially displayed within this node,
1689
+ * even if that content is split across several separate TextNode "frames". If this node is or contains some but not
1690
+ * all of the display frames of an overall TextContentModel, that model is still included as a result.
1691
+ *
1692
+ * Note that visibleRanges and visibleText may not be sorted as TextNode "frames" can appear in any order in the scenegraph.
1693
+ */
1694
+ get allTextContent(): Readonly<Iterable<TextContent>>;
1556
1695
  /**
1557
1696
  * The width of the node.
1558
1697
  *
@@ -2171,6 +2310,32 @@ declare enum TextAlignment {
2171
2310
  justifyLeft = 4
2172
2311
  }
2173
2312
 
2313
+ /**
2314
+ * <InlineAlert slots="text" variant="warning"/>
2315
+ *
2316
+ * **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`.
2317
+ *
2318
+ * @experimental
2319
+ * The values yielded by {@link VisualNode.allTextContent} and {@link PageNode.allTextContent}.
2320
+ */
2321
+ export declare interface TextContent {
2322
+ textContentModel: TextContentModel;
2323
+ /**
2324
+ * An unsorted list of the subranges of the related text content model that are visible within the node.
2325
+ *
2326
+ * Since a single text content model can be displayed across multiple TextNode "frames", any of which could be
2327
+ * outside of the node, the union of all the subranges in this value may still be a subset of the total range.
2328
+ */
2329
+ visibleRanges: TextRange[];
2330
+ /**
2331
+ * An unsorted list of the parts of the related text content model that are visible within the node.
2332
+ *
2333
+ * Since a single text content model can be displayed across multiple TextNode "frames", any of which could be
2334
+ * outside of the node, the union of all the text in this value may still be a subset of the total text.
2335
+ */
2336
+ visibleText: string[];
2337
+ }
2338
+
2174
2339
  /**
2175
2340
  * TextContentModel is an abstract base class representing a complete piece of text content.
2176
2341
  * Use this model to get or modify the text string and the style ranges applied to it.
@@ -2334,6 +2499,15 @@ export declare abstract class TextContentModel {
2334
2499
  hasUnavailableFonts(): boolean;
2335
2500
  }
2336
2501
 
2502
+ /**
2503
+ * Geometry for an area text frame in pixels.
2504
+ * @experimental
2505
+ */
2506
+ export declare interface TextFrameAreaGeometry {
2507
+ width: number;
2508
+ height: number;
2509
+ }
2510
+
2337
2511
  /**
2338
2512
  * <InlineAlert slots="text" variant="warning"/>
2339
2513
  *
@@ -2558,12 +2732,23 @@ export declare enum TextStyleSource {
2558
2732
  * ThreadedTextContentModel represents a complete piece of text content that is split across multiple
2559
2733
  * {@link ThreadedTextNode} frames for display. This subclass provides a mutable {@link allFrames} list
2560
2734
  * that supports adding, removing, and reordering text frames.
2561
- *
2562
- * The append and insert operations will automatically parent the new frame to the same parent as the
2563
- * reference frame and place it in the correct z-order.
2564
2735
  */
2565
2736
  export declare class ThreadedTextContentModel extends TextNodeContentModel {
2566
2737
  get allTextNodes(): Readonly<Iterable<ThreadedTextNode>>;
2738
+ get frames(): ThreadedTextList;
2739
+ }
2740
+
2741
+ export declare class ThreadedTextList extends ReadOnlyItemList<ThreadedTextNode> {
2742
+ /**
2743
+ * <InlineAlert slots="text" variant="warning"/>
2744
+ *
2745
+ * **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`.
2746
+ *
2747
+ * @experimental
2748
+ * @param geometry - The geometry of the threaded text node in pixels (width and height).
2749
+ * @returns A new ThreadedTextNode that is part of a threaded text flow.
2750
+ */
2751
+ addFrame(geometry?: TextFrameAreaGeometry): ThreadedTextNode;
2567
2752
  }
2568
2753
 
2569
2754
  /**
@@ -2572,8 +2757,6 @@ export declare class ThreadedTextContentModel extends TextNodeContentModel {
2572
2757
  * instead it refers to a {@link TextNodeContentModel}, which may be shared across multiple ThreadedTextNode frames.
2573
2758
  *
2574
2759
  * All linked ThreadedTextNodes that share a single TextContentModel must remain together within the same artboard.
2575
- *
2576
- * APIs are not yet available to create multi-frame text flows. To create *non*-threaded text, use {@link Editor.createText}.
2577
2760
  */
2578
2761
  export declare class ThreadedTextNode extends TextNode {
2579
2762
  /**
@@ -2669,6 +2852,15 @@ declare enum VisualEffectType {
2669
2852
  * Some VisualNodes might have a non-visual parent such as a PageNode.
2670
2853
  */
2671
2854
  export declare class VisualNode extends BaseNode implements IVisualNodeBounds {
2855
+ /**
2856
+ * Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
2857
+ * GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
2858
+ * hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their
2859
+ * overall display z-order.
2860
+ *
2861
+ * The children of a VisualNode are always other VisualNode classes (never the more minimal BaseNode).
2862
+ */
2863
+ get allChildren(): Readonly<Iterable<VisualNode>>;
2672
2864
  /**
2673
2865
  * The highest ancestor that still has visual presence in the document. Typically an Artboard, but for orphaned
2674
2866
  * content, it will be the root of the deleted content (which might be this node itself).
@@ -2678,10 +2870,54 @@ export declare class VisualNode extends BaseNode implements IVisualNodeBounds {
2678
2870
  * meaningful comparison or conversion between the bounds or coordinate spaces of such nodes.
2679
2871
  */
2680
2872
  get visualRoot(): VisualNode;
2873
+ /**
2874
+ * <InlineAlert slots="text" variant="warning"/>
2875
+ *
2876
+ * **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`.
2877
+ *
2878
+ * @experimental
2879
+ * Helper to recursively traverse *all* the exposed scenegraph content within the subtree of this node.
2880
+ * Every container node and every leaf node will be visited via a pre-order tree traversal.
2881
+ * Although once called the list of direct descendants is static, changes to further descendants may appear while
2882
+ * iterating depending on when the operation occurs relative to the parent being yielded.
2883
+ * Note that the root node (i.e. what this API was called on) is not visited.
2884
+ *
2885
+ * Warning: Processing text content via this API can be error-prone. Use {@link VisualNode.allTextContent}
2886
+ */
2887
+ get allDescendants(): Readonly<Iterable<VisualNode>>;
2888
+ /**
2889
+ * <InlineAlert slots="text" variant="warning"/>
2890
+ *
2891
+ * **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`.
2892
+ *
2893
+ * @experimental
2894
+ * Helper to process all text content that is found as part of or within this node. This can be hard to do correctly
2895
+ * via manual tree traversal since multiple {@link ThreadedTextNode} can share a single {@link TextContentModel}.
2896
+ *
2897
+ * This iterator returns a single result per TextContentModel that is at least partially displayed within this node,
2898
+ * even if that content is split across several separate TextNode "frames". If this node is or contains some but not
2899
+ * all of the display frames of an overall TextContentModel, that model is still included as a result.
2900
+ *
2901
+ * Note that visibleRanges and visibleText may not be sorted as TextNode "frames" can appear in any order in the scenegraph.
2902
+ */
2903
+ get allTextContent(): Readonly<Iterable<TextContent>>;
2681
2904
  get boundsLocal(): Readonly<Rect>;
2682
2905
  get centerPointLocal(): Readonly<Point>;
2683
2906
  get topLeftLocal(): Readonly<Point>;
2684
2907
  localPointInNode(localPoint: Point, targetNode: VisualNode): Readonly<Point>;
2908
+ /**
2909
+ * <InlineAlert slots="text" variant="warning"/>
2910
+ *
2911
+ * **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`.
2912
+ *
2913
+ * @experimental
2914
+ * Generates a rendition of this node and its descendants.
2915
+ *
2916
+ * If this node contains images, it will wait for the best quality to be available before capturing.
2917
+ * As such, there is a 20s timeout before an error is thrown to prevent indefinite waiting.
2918
+ *
2919
+ */
2920
+ createRendition(options?: CreateRenditionOptions): Promise<CreateRenditionResult>;
2685
2921
  }
2686
2922
 
2687
2923
  export {};
package/ui/ui-sdk.d.ts CHANGED
@@ -945,6 +945,11 @@ declare interface Document_2 {
945
945
  * Run print quality check
946
946
  */
947
947
  runPrintQualityCheck(options: PrintQualityCheckOptions): void;
948
+ /**
949
+ * @experimental - Experimental API
950
+ * @returns true if the document is a presentation document.
951
+ */
952
+ isPresentation(): Promise<boolean>;
948
953
  }
949
954
  export { Document_2 as Document };
950
955