@canva/design 1.4.0 → 1.6.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.
Files changed (2) hide show
  1. package/index.d.ts +37 -17
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -153,7 +153,7 @@ export declare type AudioTrack = {
153
153
  * @remarks
154
154
  * Units are relative to the parent container both in terms of position and size
155
155
  */
156
- declare type Box = Position & (WidthAndHeight | Width | Height);
156
+ export declare type Box = Position & (WidthAndHeight | Width | Height);
157
157
 
158
158
  declare type CommonImageDragConfig = {
159
159
  /**
@@ -494,11 +494,19 @@ export declare type Fill = {
494
494
  asset?: ImageFill | VideoFill;
495
495
  };
496
496
 
497
+ /**
498
+ * @public
499
+ * A reference to a font that can be used in other parts of the SDK.
500
+ */
501
+ export declare type FontRef = string & {
502
+ __fontRef: never;
503
+ };
504
+
497
505
  /**
498
506
  * @public
499
507
  * Font weights supported in the SDK.
500
508
  **/
501
- declare type FontWeight =
509
+ export declare type FontWeight =
502
510
  | "normal"
503
511
  | "thin"
504
512
  | "extralight"
@@ -575,7 +583,7 @@ export declare type ImageElementData = DragCallback & {
575
583
  * @public
576
584
  * An image asset that will be used to fill the given path.
577
585
  */
578
- declare type ImageFill = {
586
+ export declare type ImageFill = {
579
587
  /**
580
588
  * Type of an asset that will be used to fill the given path.
581
589
  */
@@ -700,7 +708,7 @@ export declare type NativeGroupElement = {
700
708
  * This type includes properties for controlling the position and dimensions
701
709
  * of the element
702
710
  */
703
- declare type NativeGroupElementWithBox = {
711
+ export declare type NativeGroupElementWithBox = {
704
712
  /**
705
713
  * The type of element.
706
714
  */
@@ -943,7 +951,7 @@ export declare type PageContext = {
943
951
  * @public
944
952
  * Page Dimensions
945
953
  */
946
- declare type PageDimensions = {
954
+ export declare type PageDimensions = {
947
955
  width: number;
948
956
  height: number;
949
957
  };
@@ -1164,7 +1172,7 @@ export declare type ShapeViewBox = {
1164
1172
  * @public
1165
1173
  * Attributes for changing the appearance of text.
1166
1174
  */
1167
- declare type TextAttributes = {
1175
+ export declare type TextAttributes = {
1168
1176
  /**
1169
1177
  * The size of the text.
1170
1178
  *
@@ -1174,7 +1182,8 @@ declare type TextAttributes = {
1174
1182
  */
1175
1183
  fontSize?: number;
1176
1184
  /**
1177
- * The alignment of the text. The default value is 'start'.
1185
+ * The alignment of the text.
1186
+ * @defaultValue 'start'
1178
1187
  */
1179
1188
  textAlign?: "start" | "center" | "end";
1180
1189
  /**
@@ -1185,17 +1194,24 @@ declare type TextAttributes = {
1185
1194
  * (e.g. #ff0099). The default value is #000000.
1186
1195
  */
1187
1196
  color?: string;
1188
-
1189
1197
  /**
1190
- * The weight of the font. The default value is 'normal'.
1198
+ * @public
1199
+ * A reference to the font to use for this text element.
1200
+ */
1201
+ fontRef?: FontRef;
1202
+ /**
1203
+ * The weight of the font.
1204
+ * @defaultValue 'normal'
1191
1205
  */
1192
1206
  fontWeight?: FontWeight;
1193
1207
  /**
1194
- * The style of the font. The default value is 'normal'.
1208
+ * The style of the font.
1209
+ * @defaultValue 'normal'
1195
1210
  */
1196
1211
  fontStyle?: "normal" | "italic";
1197
1212
  /**
1198
- * The decoration of the font. The default value is 'none'.
1213
+ * The decoration of the font.
1214
+ * @defaultValue 'none'
1199
1215
  */
1200
1216
  decoration?: "none" | "underline";
1201
1217
  };
@@ -1214,19 +1230,23 @@ export declare type TextDragConfig = {
1214
1230
  */
1215
1231
  children?: string[];
1216
1232
  /**
1217
- * The alignment of the text. The default value is 'start'.
1233
+ * The alignment of the text.
1234
+ * @defaultValue 'start'
1218
1235
  */
1219
1236
  textAlign?: "start" | "center" | "end";
1220
1237
  /**
1221
- * The weight of the font. The default value is 'normal'.
1238
+ * The weight of the font.
1239
+ * @defaultValue 'normal'
1222
1240
  */
1223
- fontWeight?: "normal" | "bold";
1241
+ fontWeight?: FontWeight;
1224
1242
  /**
1225
- * The style of the font. The default value is 'normal'.
1243
+ * The style of the font.
1244
+ * @defaultValue 'normal'
1226
1245
  */
1227
1246
  fontStyle?: "normal" | "italic";
1228
1247
  /**
1229
- * The decoration of the font. The default value is 'none'.
1248
+ * The decoration of the font.
1249
+ * @defaultValue 'none'
1230
1250
  */
1231
1251
  decoration?: "none" | "underline";
1232
1252
  };
@@ -1490,7 +1510,7 @@ export declare type VideoDragConfigForElement<E extends Element> =
1490
1510
  * @public
1491
1511
  * A video asset that will be used to fill the given path.
1492
1512
  */
1493
- declare type VideoFill = {
1513
+ export declare type VideoFill = {
1494
1514
  /**
1495
1515
  * Type of an asset that will be used to fill the given path.
1496
1516
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "The Canva Apps SDK design library",
5
5
  "author": "Canva Pty Ltd.",
6
6
  "license": "SEE LICENSE IN LICENSE.md FILE",