@canva/design 1.3.0 → 1.5.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 +28 -17
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -97,7 +97,10 @@ export declare type AppElementRenderer<A extends AppElementData> = (
97
97
  * A return value of {@link AppElementRenderer} function.
98
98
  * It is an array of elements to render within an app element.
99
99
  */
100
- export declare type AppElementRendererOutput = NativeSimpleElementWithBox[];
100
+ export declare type AppElementRendererOutput = Exclude<
101
+ NativeSimpleElementWithBox,
102
+ NativeVideoElementWithBox
103
+ >[];
101
104
 
102
105
  /**
103
106
  * @public
@@ -150,7 +153,7 @@ export declare type AudioTrack = {
150
153
  * @remarks
151
154
  * Units are relative to the parent container both in terms of position and size
152
155
  */
153
- declare type Box = Position & (WidthAndHeight | Width | Height);
156
+ export declare type Box = Position & (WidthAndHeight | Width | Height);
154
157
 
155
158
  declare type CommonImageDragConfig = {
156
159
  /**
@@ -495,7 +498,7 @@ export declare type Fill = {
495
498
  * @public
496
499
  * Font weights supported in the SDK.
497
500
  **/
498
- declare type FontWeight =
501
+ export declare type FontWeight =
499
502
  | "normal"
500
503
  | "thin"
501
504
  | "extralight"
@@ -572,7 +575,7 @@ export declare type ImageElementData = DragCallback & {
572
575
  * @public
573
576
  * An image asset that will be used to fill the given path.
574
577
  */
575
- declare type ImageFill = {
578
+ export declare type ImageFill = {
576
579
  /**
577
580
  * Type of an asset that will be used to fill the given path.
578
581
  */
@@ -697,7 +700,7 @@ export declare type NativeGroupElement = {
697
700
  * This type includes properties for controlling the position and dimensions
698
701
  * of the element
699
702
  */
700
- declare type NativeGroupElementWithBox = {
703
+ export declare type NativeGroupElementWithBox = {
701
704
  /**
702
705
  * The type of element.
703
706
  */
@@ -940,7 +943,7 @@ export declare type PageContext = {
940
943
  * @public
941
944
  * Page Dimensions
942
945
  */
943
- declare type PageDimensions = {
946
+ export declare type PageDimensions = {
944
947
  width: number;
945
948
  height: number;
946
949
  };
@@ -1161,7 +1164,7 @@ export declare type ShapeViewBox = {
1161
1164
  * @public
1162
1165
  * Attributes for changing the appearance of text.
1163
1166
  */
1164
- declare type TextAttributes = {
1167
+ export declare type TextAttributes = {
1165
1168
  /**
1166
1169
  * The size of the text.
1167
1170
  *
@@ -1171,7 +1174,8 @@ declare type TextAttributes = {
1171
1174
  */
1172
1175
  fontSize?: number;
1173
1176
  /**
1174
- * The alignment of the text. The default value is 'start'.
1177
+ * The alignment of the text.
1178
+ * @defaultValue 'start'
1175
1179
  */
1176
1180
  textAlign?: "start" | "center" | "end";
1177
1181
  /**
@@ -1184,15 +1188,18 @@ declare type TextAttributes = {
1184
1188
  color?: string;
1185
1189
 
1186
1190
  /**
1187
- * The weight of the font. The default value is 'normal'.
1191
+ * The weight of the font.
1192
+ * @defaultValue 'normal'
1188
1193
  */
1189
1194
  fontWeight?: FontWeight;
1190
1195
  /**
1191
- * The style of the font. The default value is 'normal'.
1196
+ * The style of the font.
1197
+ * @defaultValue 'normal'
1192
1198
  */
1193
1199
  fontStyle?: "normal" | "italic";
1194
1200
  /**
1195
- * The decoration of the font. The default value is 'none'.
1201
+ * The decoration of the font.
1202
+ * @defaultValue 'none'
1196
1203
  */
1197
1204
  decoration?: "none" | "underline";
1198
1205
  };
@@ -1211,19 +1218,23 @@ export declare type TextDragConfig = {
1211
1218
  */
1212
1219
  children?: string[];
1213
1220
  /**
1214
- * The alignment of the text. The default value is 'start'.
1221
+ * The alignment of the text.
1222
+ * @defaultValue 'start'
1215
1223
  */
1216
1224
  textAlign?: "start" | "center" | "end";
1217
1225
  /**
1218
- * The weight of the font. The default value is 'normal'.
1226
+ * The weight of the font.
1227
+ * @defaultValue 'normal'
1219
1228
  */
1220
- fontWeight?: "normal" | "bold";
1229
+ fontWeight?: FontWeight;
1221
1230
  /**
1222
- * The style of the font. The default value is 'normal'.
1231
+ * The style of the font.
1232
+ * @defaultValue 'normal'
1223
1233
  */
1224
1234
  fontStyle?: "normal" | "italic";
1225
1235
  /**
1226
- * The decoration of the font. The default value is 'none'.
1236
+ * The decoration of the font.
1237
+ * @defaultValue 'none'
1227
1238
  */
1228
1239
  decoration?: "none" | "underline";
1229
1240
  };
@@ -1487,7 +1498,7 @@ export declare type VideoDragConfigForElement<E extends Element> =
1487
1498
  * @public
1488
1499
  * A video asset that will be used to fill the given path.
1489
1500
  */
1490
- declare type VideoFill = {
1501
+ export declare type VideoFill = {
1491
1502
  /**
1492
1503
  * Type of an asset that will be used to fill the given path.
1493
1504
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "1.3.0",
3
+ "version": "1.5.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",