@adobe/ccweb-add-on-sdk-types 1.14.0 → 1.16.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.14.0",
3
+ "version": "1.16.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -81,7 +81,7 @@ declare namespace ApiConstants {
81
81
  StrokePosition,
82
82
  StrokeType,
83
83
  TextAlignment,
84
- TextType,
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: TextType.area;
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,
@@ -175,6 +180,7 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
175
180
  get children(): ItemList<Node>;
176
181
  /**
177
182
  * The background fill of the artboard. Artboards must always have a fill.
183
+ *
178
184
  */
179
185
  set fill(fill: Fill);
180
186
  get fill(): Readonly<Fill>;
@@ -200,7 +206,7 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
200
206
  * @experimental
201
207
  */
202
208
  export declare interface AutoHeightTextLayout {
203
- type: TextType.autoHeight;
209
+ type: TextLayout.autoHeight;
204
210
  /**
205
211
  * The width of the text node in pixels.
206
212
  */
@@ -1476,7 +1482,7 @@ export declare interface Point {
1476
1482
  * @experimental
1477
1483
  */
1478
1484
  export declare interface PointTextLayout {
1479
- type: TextType.autoWidth;
1485
+ type: TextLayout.autoWidth;
1480
1486
  }
1481
1487
 
1482
1488
  /**
@@ -1798,11 +1804,17 @@ declare interface StyleRange {
1798
1804
  * <InlineAlert slots="text" variant="warning"/>
1799
1805
  *
1800
1806
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1807
+ *
1808
+ * <InlineAlert slots="text" variant="warning"/>
1809
+ *
1810
+ * *Additional alignment types may be added in the future.* If your code has different branches or cases depending on text alignment,
1811
+ * always have a default/fallback case to handle any unknown values you may encounter.
1801
1812
  */
1802
1813
  declare enum TextAlignment {
1803
1814
  left = 1,
1804
1815
  right = 2,
1805
- center = 3
1816
+ center = 3,
1817
+ justifyLeft = 4
1806
1818
  }
1807
1819
 
1808
1820
  /**
@@ -1885,13 +1897,7 @@ export declare class TextContentModel {
1885
1897
  * If the specified range doesn't align well with the paragraph boundaries, the range will be expanded to cover the
1886
1898
  * entire paragraphs, it overlaps.
1887
1899
  */
1888
- applyCharacterStyles(
1889
- styles: CharacterStylesInput,
1890
- range?: {
1891
- start: number;
1892
- length: number;
1893
- }
1894
- ): void;
1900
+ applyCharacterStyles(styles: CharacterStylesInput, range?: TextRange): void;
1895
1901
  /**
1896
1902
  * <InlineAlert slots="text" variant="warning"/>
1897
1903
  *
@@ -1907,13 +1913,56 @@ export declare class TextContentModel {
1907
1913
  * @param range - The start and length of character sequence to which the styles should be applied.
1908
1914
  * If not specified the styles will be applied to the entire piece of text content flow.
1909
1915
  */
1910
- applyParagraphStyles(
1911
- styles: ParagraphStylesInput,
1912
- range?: {
1913
- start: number;
1914
- length: number;
1915
- }
1916
- ): void;
1916
+ applyParagraphStyles(styles: ParagraphStylesInput, range?: TextRange): void;
1917
+ /**
1918
+ * <InlineAlert slots="text" variant="warning"/>
1919
+ *
1920
+ * **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`.
1921
+ *
1922
+ * @experimental
1923
+ * Returns true if this text contains any fonts unavailable to the current user.
1924
+ * Currently, if any unavailable fonts are present, the text content cannot be modified and
1925
+ * certain styling changes are limited as well. To remove these restrictions, you must modify
1926
+ * the character styles to use only AvailableFonts.
1927
+ */
1928
+ hasUnavailableFonts(): boolean;
1929
+ }
1930
+
1931
+ /**
1932
+ * <InlineAlert slots="text" variant="warning"/>
1933
+ *
1934
+ * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1935
+ *
1936
+ * <InlineAlert slots="text" variant="warning"/>
1937
+ *
1938
+ * *Additional text layout types may be added in the future.* If your code has different branches or cases depending on layout type,
1939
+ * always have a default/fallback case to handle any unknown values you may encounter.
1940
+ */
1941
+ declare enum TextLayout {
1942
+ /**
1943
+ * Area text: both width and height are explicitly set. If text content is too long to fit, the end of the text will be
1944
+ * clipped. If text content is short, the frame's bounds will occupy extra height that is just blank space.
1945
+ */
1946
+ area = 1,
1947
+ /**
1948
+ * Auto-height text: Width is explicitly set, and text wraps to use as much vertical space as necessary to display the
1949
+ * full content.
1950
+ */
1951
+ autoHeight = 2,
1952
+ /**
1953
+ * Auto-width, aka point text: both width and height are automatically determined based on the content. There is no
1954
+ * automatic line wrapping, so the text will all be on one line unless the text contains explicit newlines.
1955
+ */
1956
+ autoWidth = 3,
1957
+ /**
1958
+ * Text is arranged in a circle or arc. The API does not yet support setting or reading the details of this layout style.
1959
+ */
1960
+ circular = 4,
1961
+ /**
1962
+ * Aka "Dynamic" layout in the UI: text size and styles are automatically varied to create an attractive multi-line layout.
1963
+ * The API does not yet support setting or reading the details of this layout style.
1964
+ */
1965
+ magicFit = 5
1917
1966
  }
1918
1967
 
1919
1968
  /**
@@ -2005,7 +2054,7 @@ export declare class TextNode extends Node {
2005
2054
  * If this TextNode is part of a multi-frame text content flow, it must be configured to use {@link AreaTextLayout}. Other
2006
2055
  * layout modes, except for {@link AreaTextLayout}, are only available for single-frame text.
2007
2056
  *
2008
- * @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.
2057
+ * @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.
2009
2058
  * @throws if {@link TextNode} is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
2010
2059
  * @throws if {@link TextNode} is not a part of a multi-frame text content flow and the layout is {@link AreaTextLayout}.
2011
2060
  */
@@ -2013,22 +2062,11 @@ export declare class TextNode extends Node {
2013
2062
  }
2014
2063
 
2015
2064
  /**
2016
- * <InlineAlert slots="text" variant="warning"/>
2017
- *
2018
- * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
2065
+ * A range of text in a {@link TextContentModel}.
2019
2066
  */
2020
- declare enum TextType {
2021
- /**
2022
- * Point text
2023
- */
2024
- autoWidth = 0,
2025
- /**
2026
- * Soft bottom
2027
- */
2028
- autoHeight = 1,
2029
- area = 2,
2030
- magicFit = 3,
2031
- circular = 4
2067
+ declare interface TextRange {
2068
+ start: number;
2069
+ length: number;
2032
2070
  }
2033
2071
 
2034
2072
  /**
@@ -2082,7 +2120,7 @@ export declare interface UnorderedListStyleInput extends BaseParagraphListStyle
2082
2120
  * @experimental
2083
2121
  */
2084
2122
  export declare interface UnsupportedTextLayout {
2085
- type: TextType.magicFit | TextType.circular;
2123
+ type: TextLayout.magicFit | TextLayout.circular;
2086
2124
  }
2087
2125
 
2088
2126
  /**
package/ui/ui-sdk.d.ts CHANGED
@@ -151,6 +151,10 @@ export declare enum AppEvent {
151
151
  * triggered when the document id is available in the application.
152
152
  */
153
153
  documentIdAvailable = "documentIdAvailable",
154
+ /**
155
+ * triggered when the document link is available in the application.
156
+ */
157
+ documentLinkAvailable = "documentLinkAvailable",
154
158
  /**
155
159
  * triggered when the document title is changed in the application.
156
160
  */
@@ -171,6 +175,7 @@ declare interface AppEventsTypeMap {
171
175
  [AppEvent.dragend]: AppDragEndEventData;
172
176
 
173
177
  [AppEvent.documentIdAvailable]: DocumentIdAvailableEventData;
178
+ [AppEvent.documentLinkAvailable]: DocumentLinkAvailableEventData;
174
179
  [AppEvent.documentTitleChange]: DocumentTitleChangeEventData;
175
180
  }
176
181
 
@@ -253,17 +258,15 @@ declare interface ApplicationBase {
253
258
  showModalDialog(dialogOptions: CustomDialogOptions): Promise<CustomDialogResult>;
254
259
 
255
260
  /**
256
- * @experimental - Experimental API
257
261
  * Shows a color picker popover anchored to the specified element.
258
262
  * The anchor element must be an instance of HTMLElement.
259
263
  * Custom DOM events are dispatched on the anchor element when the color changes or the color picker closes.
260
- * See {@link ColorPickerEvents} for more details.
264
+ * See {@link ColorPickerEvent} for more details.
261
265
  * @param anchorElement - The HTML element to anchor the color picker to.
262
266
  * @param options - Optional configuration options for customizing the color picker behavior and appearance.
263
267
  */
264
268
  showColorPicker(anchorElement: HTMLElement, options?: ColorPickerOptions): Promise<void>;
265
269
  /**
266
- * @experimental - Experimental API
267
270
  * Hides the color picker popover if it is currently visible.
268
271
  */
269
272
  hideColorPicker(): Promise<void>;
@@ -533,10 +536,9 @@ export declare interface ClientStorage {
533
536
  }
534
537
 
535
538
  /**
536
- * @experimental - Experimental API
537
539
  * Custom DOM events dispatched on the anchor element passed to `showColorPicker()` API.
538
540
  */
539
- export declare enum ColorPickerEvents {
541
+ export declare enum ColorPickerEvent {
540
542
  /**
541
543
  * Color change event dispatched when a color is selected.
542
544
  * The event detail will contain a 'color' property of type string.
@@ -549,7 +551,6 @@ export declare enum ColorPickerEvents {
549
551
  }
550
552
 
551
553
  /**
552
- * @experimental - Experimental API
553
554
  * Options that can be passed to the `showColorPicker` API to customize the color picker's behavior and appearance.
554
555
  */
555
556
  export declare interface ColorPickerOptions {
@@ -559,10 +560,12 @@ export declare interface ColorPickerOptions {
559
560
  */
560
561
  title?: string;
561
562
  /**
562
- * Initial color for the color picker, in 0xRRGGBB format.
563
+ * Initial color for the color picker, in hex format.
564
+ * Can provide either as a number in 0xRRGGBB or 0xRRGGBBAA format,
565
+ * or as a string in "#RRGGBB" or "#RRGGBBAA" format.
563
566
  * Default color is 0xFFFFFF (white).
564
567
  */
565
- initialColor?: number;
568
+ initialColor?: number | string;
566
569
  /**
567
570
  * Placement of the color picker popover relative to the anchor element.
568
571
  * Default placement is ColorPickerPlacement.left.
@@ -581,7 +584,6 @@ export declare interface ColorPickerOptions {
581
584
  }
582
585
 
583
586
  /**
584
- * @experimental - Experimental API
585
587
  * Denotes the placement of the color picker popover relative to its anchor element.
586
588
  * Used in the placement option of `showColorPicker()` API.
587
589
  */
@@ -607,6 +609,7 @@ export declare enum ColorPickerPlacement {
607
609
  declare namespace Constants {
608
610
  export {
609
611
  Range_2 as Range,
612
+ LinkOptions,
610
613
  RenditionFormat,
611
614
  RenditionType,
612
615
  RenditionIntent,
@@ -625,7 +628,6 @@ declare namespace Constants {
625
628
  DeviceClass,
626
629
  PlatformType,
627
630
  ColorPickerPlacement,
628
- ColorPickerEvents,
629
631
  AuthorizationStatus
630
632
  };
631
633
  }
@@ -822,6 +824,11 @@ declare interface Document_2 {
822
824
  * Get document id
823
825
  */
824
826
  id(): Promise<string | undefined>;
827
+ /**
828
+ * @experimental - Experimental API
829
+ * Get document Link
830
+ */
831
+ link(options: LinkOptions): Promise<string | undefined>;
825
832
  /**
826
833
  * Get document name/title
827
834
  */
@@ -845,14 +852,21 @@ export { Document_2 as Document };
845
852
  /**
846
853
  * The payload data sent to the document id available event handler.
847
854
  */
848
- declare interface DocumentIdAvailableEventData {
855
+ export declare interface DocumentIdAvailableEventData {
849
856
  documentId: string | undefined;
850
857
  }
851
858
 
859
+ /**
860
+ * The payload data sent to the document link available event handler.
861
+ */
862
+ export declare interface DocumentLinkAvailableEventData {
863
+ documentLink: string | undefined;
864
+ }
865
+
852
866
  /**
853
867
  * The payload data sent to the document title change event handler.
854
868
  */
855
- declare interface DocumentTitleChangeEventData {
869
+ export declare interface DocumentTitleChangeEventData {
856
870
  documentTitle: string;
857
871
  }
858
872
 
@@ -889,7 +903,7 @@ export declare interface DragCompletionData {
889
903
  /**
890
904
  * Interface to provide drag options which can be passed to enableDragToDocument to change the drag behavior.
891
905
  */
892
- declare interface DragOptions {
906
+ export declare interface DragOptions {
893
907
  /**
894
908
  * Use preview size for the drag image instead of the element size
895
909
  */
@@ -1052,6 +1066,17 @@ export declare interface JpgRenditionOptions extends RenditionOptions {
1052
1066
  };
1053
1067
  }
1054
1068
 
1069
+ /**
1070
+ * @experimental - Experimental API
1071
+ * Link options for document link
1072
+ */
1073
+ export declare enum LinkOptions {
1074
+ /**
1075
+ * Link to the current document
1076
+ */
1077
+ document = "document"
1078
+ }
1079
+
1055
1080
  /**
1056
1081
  * Takes the raw type of a remote object or function as a remote thread would see it through a proxy (e.g. when
1057
1082
  * passed in as a function argument) and returns the type the local thread has to supply.
@@ -1749,7 +1774,7 @@ declare type UnproxyOrClone<T> = T extends RemoteObject<ProxyMarked> ? Local<T>
1749
1774
  /**
1750
1775
  * Callback to unregister iframe from the add-on SDK.
1751
1776
  */
1752
- declare type UnregisterIframe = () => void;
1777
+ export declare type UnregisterIframe = () => void;
1753
1778
 
1754
1779
  /**
1755
1780
  * Types of dialog variants supported.