@cesdk/cesdk-js 1.7.0-alpha.2 → 1.7.0-alpha.3

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/index.d.ts CHANGED
@@ -992,6 +992,99 @@ export declare class BlockAPI {
992
992
  * @deprecated Use `getStrokeWidth`.
993
993
  */
994
994
  getOutlineWidth(id: DesignBlockId): number;
995
+ /**
996
+ * Query if the given block has a drop shadow property.
997
+ * @param id - The block to query.
998
+ * @returns True if the block has a drop shadow property.
999
+ */
1000
+ hasDropShadow(id: DesignBlockId): boolean;
1001
+ /**
1002
+ * Enable or disable the drop shadow of the given design block.
1003
+ * @param id - The block whose drop shadow should be enabled or disabled.
1004
+ * @param enabled - If true, the drop shadow will be enabled.
1005
+ */
1006
+ setDropShadowEnabled(id: DesignBlockId, enabled: boolean): void;
1007
+ /**
1008
+ * Query if the drop shadow of the given design block is enabled.
1009
+ * @param id - The block whose drop shadow state should be queried.
1010
+ * @returns True if the block's drop shadow is enabled.
1011
+ */
1012
+ isDropShadowEnabled(id: DesignBlockId): boolean;
1013
+ /**
1014
+ * Set the drop shadow color of the given design block.
1015
+ * @param id - The block whose drop shadow color should be set.
1016
+ * @param r - The red color component in the range of 0 to 1.
1017
+ * @param g - The green color component in the range of 0 to 1.
1018
+ * @param b - The blue color component in the range of 0 to 1.
1019
+ * @param a - The alpha color component in the range of 0 to 1.
1020
+ */
1021
+ setDropShadowColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;
1022
+ /**
1023
+ * Get the drop shadow color of the given design block.
1024
+ * @param id - The block whose background color should be queried.
1025
+ * @returns The background color.
1026
+ */
1027
+ getDropShadowColorRGBA(id: DesignBlockId): RGBA;
1028
+ /**
1029
+ * Set the drop shadow's X offset of the given design block.
1030
+ * @param id - The block whose drop shadow's X offset should be set.
1031
+ * @param xOffset - The X offset to be set.
1032
+ */
1033
+ setDropShadowXOffset(id: DesignBlockId, xOffset: number): void;
1034
+ /**
1035
+ * Get the drop shadow's X offset of the given design block.
1036
+ * @param id - The block whose drop shadow's X offset should be queried.
1037
+ * @returns The offset.
1038
+ */
1039
+ getDropShadowXOffset(id: DesignBlockId): number;
1040
+ /**
1041
+ * Set the drop shadow's Y offset of the given design block.
1042
+ * @param id - The block whose drop shadow's Y offset should be set.
1043
+ * @param yOffset - The X offset to be set.
1044
+ */
1045
+ setDropShadowYOffset(id: DesignBlockId, yOffset: number): void;
1046
+ /**
1047
+ * Get the drop shadow's Y offset of the given design block.
1048
+ * @param id - The block whose drop shadow's Y offset should be queried.
1049
+ * @returns The offset.
1050
+ */
1051
+ getDropShadowYOffset(id: DesignBlockId): number;
1052
+ /**
1053
+ * Set the drop shadow's blur radius on the X axis of the given design block.
1054
+ * @param id - The block whose drop shadow's blur radius should be set.
1055
+ * @param xBlurRadius - The blur radius to be set.
1056
+ */
1057
+ setDropShadowXBlurRadius(id: DesignBlockId, xBlurRadius: number): void;
1058
+ /**
1059
+ * Get the drop shadow's blur radius on the X axis of the given design block.
1060
+ * @param id - The block whose drop shadow's blur radius should be queried.
1061
+ * @returns The blur radius.
1062
+ */
1063
+ getDropShadowXBlurRadius(id: DesignBlockId): number;
1064
+ /**
1065
+ * Set the drop shadow's blur radius on the Y axis of the given design block.
1066
+ * @param id - The block whose drop shadow's blur radius should be set.
1067
+ * @param yBlurRadius - The blur radius to be set.
1068
+ */
1069
+ setDropShadowYBlurRadius(id: DesignBlockId, yBlurRadius: number): void;
1070
+ /**
1071
+ * Get the drop shadow's blur radius on the Y axis of the given design block.
1072
+ * @param id - The block whose drop shadow's blur radius should be queried.
1073
+ * @returns The blur radius.
1074
+ */
1075
+ getDropShadowYBlurRadius(id: DesignBlockId): number;
1076
+ /**
1077
+ * Set the drop shadow's clipping of the given design block. (Only applies to shapes.)
1078
+ * @param id - The block whose drop shadow's clip should be set.
1079
+ * @param clip - The drop shadow's clip to be set.
1080
+ */
1081
+ setDropShadowClip(id: DesignBlockId, clip: boolean): void;
1082
+ /**
1083
+ * Get the drop shadow's clipping of the given design block.
1084
+ * @param id - The block whose drop shadow's clipping should be queried.
1085
+ * @returns The drop shadow's clipping.
1086
+ */
1087
+ getDropShadowClip(id: DesignBlockId): boolean;
995
1088
  /**
996
1089
  * Query if the given block has fill color properties.
997
1090
  * @param id - The block to query.
@@ -1011,6 +1104,12 @@ export declare class BlockAPI {
1011
1104
  * @returns An empty result on success, an error otherwise.
1012
1105
  */
1013
1106
  setFillEnabled(id: DesignBlockId, enabled: boolean): void;
1107
+ /**
1108
+ * Returns the block containing the fill properties of the given block.
1109
+ * @param id - The block whose fill block should be returned.
1110
+ * @returns The block that currently defines the given block's fill.
1111
+ */
1112
+ getFill(id: DesignBlockId): DesignBlockId;
1014
1113
  /**
1015
1114
  * Set the fill type of the given design block.
1016
1115
  * @param id - The block whose fill type should be set.
@@ -1123,6 +1222,36 @@ export declare class BlockAPI {
1123
1222
  * @returns the gradient's radius, an error otherwise.
1124
1223
  */
1125
1224
  getFillGradientRadius(id: DesignBlockId): number;
1225
+ /**
1226
+ * Set a metadata value of a block identified by a key.
1227
+ * If the key does not exist, yet, it will be added.
1228
+ * @param block - The block whose metadata will be accessed.
1229
+ * @param key - The key used to identify the desired piece of metadata.
1230
+ * @param value - The value to set.
1231
+ */
1232
+ setMetadata(id: DesignBlockId, key: string, value: string): void;
1233
+ /**
1234
+ * Get a metadata value of a block identified by a key.
1235
+ * If the key does not exist, yet, this method will fail.
1236
+ * @param block - The block whose metadata will be accessed.
1237
+ * @param key - The key used to identify the desired piece of metadata.
1238
+ * @returns the value associated with the key.
1239
+ */
1240
+ getMetadata(id: DesignBlockId, key: string): string;
1241
+ /**
1242
+ * Check if the block has metadata associated with the key.
1243
+ * @param block - The block whose metadata will be accessed.
1244
+ * @param key - The key used to identify the desired piece of metadata.
1245
+ * @returns whether the key exists.
1246
+ */
1247
+ hasMetadata(id: DesignBlockId, key: string): boolean;
1248
+ /**
1249
+ * Remove metadata associated with the key from the given block.
1250
+ * If the key does not exist, this method will fail.
1251
+ * @param block - The block whose metadata will be accessed.
1252
+ * @param key - The key used to identify the desired piece of metadata.
1253
+ */
1254
+ removeMetadata(id: DesignBlockId, key: string): void;
1126
1255
  }
1127
1256
 
1128
1257
  /**
@@ -1423,16 +1552,6 @@ export declare class EditorAPI {
1423
1552
  * @returns The text cursor's y position in screen space.
1424
1553
  */
1425
1554
  getTextCursorPositionInScreenSpaceY(): number;
1426
- /**
1427
- * Sets the zoom level of the scene.
1428
- * @param zoomLevel - The new zoom level.
1429
- */
1430
- setZoomLevel(zoomLevel?: number): void;
1431
- /**
1432
- * Query a camera zoom level.
1433
- * @returns The zoom level of the block's (main) camera.
1434
- */
1435
- getZoomLevel(): number;
1436
1555
  /**
1437
1556
  * Adds a new history state to the stack, if undoable changes were made.
1438
1557
  */
@@ -2098,6 +2217,31 @@ export declare class SceneAPI {
2098
2217
  * @returns A Promise that resolves once the template was applied or rejects if there was an error.
2099
2218
  */
2100
2219
  applyTemplateFromURL(url: string): Promise<void>;
2220
+ /**
2221
+ * Sets the zoom level of the active scene.
2222
+ * Only has an effect if the zoom level is not handled by the UI.
2223
+ *
2224
+ * @param zoomLevel - The new zoom level.
2225
+ */
2226
+ setZoomLevel(zoomLevel?: number): void;
2227
+ /**
2228
+ * Query a camera zoom level of the active scene.
2229
+ * @returns The zoom level of the block's camera.
2230
+ */
2231
+ getZoomLevel(): number;
2232
+ /**
2233
+ * Sets the zoom and focus to show a block.
2234
+ * Only has an effect if the zoom level is not handled by the UI.
2235
+ * Without padding, this results in a tight view on the block.
2236
+ *
2237
+ * @param id - The block that should be focussed on.
2238
+ * @param paddingLeft - Optional padding in screen pixels to the left of the block.
2239
+ * @param paddingTop - Optional padding in screen pixels to the top of the block.
2240
+ * @param paddingRight - Optional padding in screen pixels to the right of the block.
2241
+ * @param paddingBottom - Optional padding in screen pixels to the bottom of the block.
2242
+ * @returns A promise that resolves once the zoom was set or rejects with an error otherwise.
2243
+ */
2244
+ zoomToBlock(id: DesignBlockId, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): Promise<void>;
2101
2245
  /**
2102
2246
  * Converts all values of the current scene into the given design unit.
2103
2247
  * @param designUnit - The new design unit of the scene
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cesdk/cesdk-js",
3
- "version": "1.7.0-alpha.2",
3
+ "version": "1.7.0-alpha.3",
4
4
  "main": "./cesdk.umd.js",
5
5
  "types": "./index.d.ts",
6
6
  "homepage": "https://www.img.ly",