@canva/design 2.7.5-beta.1 → 2.7.6-beta.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/beta.d.ts +248 -225
- package/lib/cjs/sdk/design/beta.js +1 -13
- package/lib/cjs/sdk/design/fake/create_beta.js +7 -0
- package/lib/cjs/sdk/design/fake/fake_design_interaction_client.js +0 -6
- package/lib/cjs/sdk/design/version.js +17 -4
- package/lib/esm/sdk/design/beta.js +2 -5
- package/lib/esm/sdk/design/fake/create_beta.js +7 -0
- package/lib/esm/sdk/design/fake/fake_design_interaction_client.js +0 -6
- package/lib/esm/sdk/design/version.js +3 -1
- package/package.json +1 -1
package/beta.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ export declare const addElementAtCursor: (
|
|
|
133
133
|
) => Promise<void>;
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
* @
|
|
136
|
+
* @public
|
|
137
137
|
* Add element to fixed designs, which use a coordinate-based positioning system.
|
|
138
138
|
*
|
|
139
139
|
* @example Insert an image at specific coordinates
|
|
@@ -245,7 +245,7 @@ export declare const addNativeElement: (
|
|
|
245
245
|
) => Promise<void>;
|
|
246
246
|
|
|
247
247
|
/**
|
|
248
|
-
* @
|
|
248
|
+
* @public
|
|
249
249
|
* Adds a new page immediately after the currently selected page.
|
|
250
250
|
* @param opts - Configuration for the new page to be added.
|
|
251
251
|
*
|
|
@@ -336,23 +336,43 @@ export declare const addNativeElement: (
|
|
|
336
336
|
* ]
|
|
337
337
|
* });
|
|
338
338
|
* ```
|
|
339
|
+
*
|
|
340
|
+
* @example Create page with custom dimensions
|
|
341
|
+
* ```typescript
|
|
342
|
+
* import { addPage } from "@canva/design";
|
|
343
|
+
*
|
|
344
|
+
* await addPage({
|
|
345
|
+
* dimensions: {
|
|
346
|
+
* width: 300,
|
|
347
|
+
* height: 300,
|
|
348
|
+
* },
|
|
349
|
+
* });
|
|
350
|
+
* ```
|
|
339
351
|
*/
|
|
340
352
|
export declare const addPage: (opts?: {
|
|
341
|
-
/** Elements to be added to the page */
|
|
353
|
+
/** Elements to be added to the page. */
|
|
342
354
|
elements?: ElementAtPoint[];
|
|
343
|
-
/**
|
|
344
|
-
* The page background. This can be a solid color, an image or a video.
|
|
345
|
-
**/
|
|
355
|
+
/** The page background. This can be a solid color, an image or a video. */
|
|
346
356
|
background?: PageBackgroundFill;
|
|
347
357
|
/** A page title which must be no longer than 255 characters */
|
|
348
358
|
title?: string;
|
|
359
|
+
/**
|
|
360
|
+
* The optional custom dimensions in pixels for the new page. The following constraints apply:
|
|
361
|
+
* - `width` and `height` cannot be lower than 40 or higher than 8000
|
|
362
|
+
* - The total area of the new page cannot exceed 25_000_000
|
|
363
|
+
* In case this is not specified, the default dimensions for the design type will be used.
|
|
364
|
+
*/
|
|
365
|
+
dimensions?: {
|
|
366
|
+
width: number;
|
|
367
|
+
height: number;
|
|
368
|
+
};
|
|
349
369
|
}) => Promise<void>;
|
|
350
370
|
|
|
351
371
|
/**
|
|
352
372
|
* @public
|
|
353
373
|
* Alternative text for a11y compliance.
|
|
354
374
|
*/
|
|
355
|
-
declare type AltText = {
|
|
375
|
+
export declare type AltText = {
|
|
356
376
|
/**
|
|
357
377
|
* The text content.
|
|
358
378
|
*/
|
|
@@ -438,7 +458,7 @@ declare type AltText = {
|
|
|
438
458
|
* });
|
|
439
459
|
* ```
|
|
440
460
|
*/
|
|
441
|
-
declare type AppElementChangeHandler<A extends AppElementData> = (
|
|
461
|
+
export declare type AppElementChangeHandler<A extends AppElementData> = (
|
|
442
462
|
appElement:
|
|
443
463
|
| {
|
|
444
464
|
/**
|
|
@@ -510,7 +530,7 @@ declare type AppElementChangeHandler<A extends AppElementData> = (
|
|
|
510
530
|
* @public
|
|
511
531
|
* A client that provides methods for creating and managing the lifecycle of an app element.
|
|
512
532
|
*/
|
|
513
|
-
declare interface AppElementClient<A extends AppElementData> {
|
|
533
|
+
export declare interface AppElementClient<A extends AppElementData> {
|
|
514
534
|
/**
|
|
515
535
|
* @deprecated This type has been superseded, use `addElement` or `registerOnElementChange` instead.
|
|
516
536
|
* If an app element is selected, the element's data is overwritten and the element is re-rendered.
|
|
@@ -744,7 +764,7 @@ declare interface AppElementClient<A extends AppElementData> {
|
|
|
744
764
|
}
|
|
745
765
|
|
|
746
766
|
/**
|
|
747
|
-
* @
|
|
767
|
+
* @public
|
|
748
768
|
* Options for creating an app element client.
|
|
749
769
|
*/
|
|
750
770
|
export declare type AppElementClientConfiguration<A extends AppElementData> = {
|
|
@@ -758,14 +778,14 @@ export declare type AppElementClientConfiguration<A extends AppElementData> = {
|
|
|
758
778
|
* @public
|
|
759
779
|
* The data associated with an app element.
|
|
760
780
|
*/
|
|
761
|
-
declare type AppElementData = Record<string, Value>;
|
|
781
|
+
export declare type AppElementData = Record<string, Value>;
|
|
762
782
|
|
|
763
783
|
/**
|
|
764
784
|
* @public
|
|
765
785
|
* Used to add or update an app element to the design.
|
|
766
786
|
* The update function is provided in the AppElementChangeHandler callback (registerOnElementChange).
|
|
767
787
|
*/
|
|
768
|
-
declare type AppElementOptions<A extends AppElementData> = {
|
|
788
|
+
export declare type AppElementOptions<A extends AppElementData> = {
|
|
769
789
|
/**
|
|
770
790
|
* The data to attach to the app element.
|
|
771
791
|
*/
|
|
@@ -777,7 +797,7 @@ declare type AppElementOptions<A extends AppElementData> = {
|
|
|
777
797
|
};
|
|
778
798
|
|
|
779
799
|
/**
|
|
780
|
-
* @
|
|
800
|
+
* @public
|
|
781
801
|
* A callback function that renders an app element based on the data it receives.
|
|
782
802
|
* @param appElementData - The data the callback must use to render the app element.
|
|
783
803
|
*/
|
|
@@ -786,7 +806,7 @@ export declare type AppElementRenderer<A extends AppElementData> = (
|
|
|
786
806
|
) => AppElementRendererOutput;
|
|
787
807
|
|
|
788
808
|
/**
|
|
789
|
-
* @
|
|
809
|
+
* @public
|
|
790
810
|
* An array of one or more elements to render as output of an app element.
|
|
791
811
|
*/
|
|
792
812
|
export declare type AppElementRendererOutput = GroupContentAtPoint[];
|
|
@@ -795,7 +815,7 @@ export declare type AppElementRendererOutput = GroupContentAtPoint[];
|
|
|
795
815
|
* @public
|
|
796
816
|
* A unique identifier that references an app runtime process
|
|
797
817
|
*/
|
|
798
|
-
declare type AppProcessId = string & {
|
|
818
|
+
export declare type AppProcessId = string & {
|
|
799
819
|
__appProcessId: never;
|
|
800
820
|
};
|
|
801
821
|
|
|
@@ -803,7 +823,7 @@ declare type AppProcessId = string & {
|
|
|
803
823
|
* @public
|
|
804
824
|
* Audio track to be added to the design at the end of a drag event.
|
|
805
825
|
*/
|
|
806
|
-
declare type AudioDragConfig = {
|
|
826
|
+
export declare type AudioDragConfig = {
|
|
807
827
|
/**
|
|
808
828
|
* The type of element.
|
|
809
829
|
*/
|
|
@@ -828,7 +848,7 @@ declare type AudioDragConfig = {
|
|
|
828
848
|
* @public
|
|
829
849
|
* A unique identifier that references an audio asset in Canva's backend.
|
|
830
850
|
*/
|
|
831
|
-
declare type AudioRef = string & {
|
|
851
|
+
export declare type AudioRef = string & {
|
|
832
852
|
__audioRef: never;
|
|
833
853
|
};
|
|
834
854
|
|
|
@@ -836,7 +856,7 @@ declare type AudioRef = string & {
|
|
|
836
856
|
* @public
|
|
837
857
|
* An audio track that can be added to a design.
|
|
838
858
|
*/
|
|
839
|
-
declare type AudioTrack = {
|
|
859
|
+
export declare type AudioTrack = {
|
|
840
860
|
/**
|
|
841
861
|
* A unique identifier that points to an audio asset in Canva's backend.
|
|
842
862
|
*/
|
|
@@ -847,7 +867,7 @@ declare type AudioTrack = {
|
|
|
847
867
|
* @public
|
|
848
868
|
* A segment of a richtext range.
|
|
849
869
|
*/
|
|
850
|
-
declare type Bounds = {
|
|
870
|
+
export declare type Bounds = {
|
|
851
871
|
/**
|
|
852
872
|
* The starting position of the segment.
|
|
853
873
|
*
|
|
@@ -861,6 +881,16 @@ declare type Bounds = {
|
|
|
861
881
|
length: number;
|
|
862
882
|
};
|
|
863
883
|
|
|
884
|
+
/**
|
|
885
|
+
* @deprecated
|
|
886
|
+
* @public
|
|
887
|
+
* A position, rotation, and set of dimensions.
|
|
888
|
+
*
|
|
889
|
+
* @remarks
|
|
890
|
+
* The position and dimensions are relative to the container.
|
|
891
|
+
*/
|
|
892
|
+
export declare type Box = Point & (WidthAndHeight | Width | Height);
|
|
893
|
+
|
|
864
894
|
/**
|
|
865
895
|
* @beta
|
|
866
896
|
* An alias for the BulkCreateLauncher interface, providing access to bulk create related functionality
|
|
@@ -895,7 +925,7 @@ export declare type BulkCreateLauncher = {
|
|
|
895
925
|
* @public
|
|
896
926
|
* An individual cell in a table element.
|
|
897
927
|
*/
|
|
898
|
-
declare type Cell = {
|
|
928
|
+
export declare type Cell = {
|
|
899
929
|
/**
|
|
900
930
|
* The attributes of the cell.
|
|
901
931
|
*/
|
|
@@ -965,7 +995,7 @@ declare type CommonImageDragConfig = {
|
|
|
965
995
|
* @public
|
|
966
996
|
* A snapshot of content from a user's design.
|
|
967
997
|
*/
|
|
968
|
-
declare interface ContentDraft<T> {
|
|
998
|
+
export declare interface ContentDraft<T> {
|
|
969
999
|
/**
|
|
970
1000
|
* The individual content items that exist within the snapshot.
|
|
971
1001
|
*
|
|
@@ -1040,10 +1070,16 @@ declare interface ContentDraft<T> {
|
|
|
1040
1070
|
*/
|
|
1041
1071
|
export declare type ContentType = "richtext" | "fill";
|
|
1042
1072
|
|
|
1073
|
+
/**
|
|
1074
|
+
* @public
|
|
1075
|
+
* A type of content that can be read from a user's design.
|
|
1076
|
+
*/
|
|
1077
|
+
declare type ContentType_2 = "richtext";
|
|
1078
|
+
|
|
1043
1079
|
/**
|
|
1044
1080
|
* @beta
|
|
1045
1081
|
*/
|
|
1046
|
-
declare type ContentTypeMap = {
|
|
1082
|
+
export declare type ContentTypeMap = {
|
|
1047
1083
|
richtext: RichtextContentSession;
|
|
1048
1084
|
fill: FillContentSession;
|
|
1049
1085
|
};
|
|
@@ -1052,10 +1088,25 @@ declare type ContentTypeMap = {
|
|
|
1052
1088
|
* @public
|
|
1053
1089
|
* Options for configuring where content in a design should be queried from.
|
|
1054
1090
|
*/
|
|
1055
|
-
declare type ContextOptions = {
|
|
1091
|
+
export declare type ContextOptions = {
|
|
1056
1092
|
target: "current_page";
|
|
1057
1093
|
};
|
|
1058
1094
|
|
|
1095
|
+
/**
|
|
1096
|
+
* @public
|
|
1097
|
+
* A set of X and Y coordinates.
|
|
1098
|
+
*/
|
|
1099
|
+
export declare type Coordinates = {
|
|
1100
|
+
/**
|
|
1101
|
+
* X coordinate, in pixels.
|
|
1102
|
+
*/
|
|
1103
|
+
x: number;
|
|
1104
|
+
/**
|
|
1105
|
+
* Y coordinate, in pixels.
|
|
1106
|
+
*/
|
|
1107
|
+
y: number;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1059
1110
|
/**
|
|
1060
1111
|
* @public
|
|
1061
1112
|
* Creates a new RichtextRange object, which contains methods to manipulate text.
|
|
@@ -2774,7 +2825,7 @@ export declare namespace DesignEditing {
|
|
|
2774
2825
|
}
|
|
2775
2826
|
|
|
2776
2827
|
/**
|
|
2777
|
-
* @
|
|
2828
|
+
* @public
|
|
2778
2829
|
* An element that's natively supported by the Canva editor.
|
|
2779
2830
|
*/
|
|
2780
2831
|
export declare type DesignElement =
|
|
@@ -2791,7 +2842,7 @@ export declare type DesignElement =
|
|
|
2791
2842
|
* @public
|
|
2792
2843
|
* Information about the design.
|
|
2793
2844
|
*/
|
|
2794
|
-
declare type DesignMetadata = {
|
|
2845
|
+
export declare type DesignMetadata = {
|
|
2795
2846
|
/**
|
|
2796
2847
|
* The title of the user's design.
|
|
2797
2848
|
* @remarks
|
|
@@ -2905,7 +2956,7 @@ export declare type DesignOpenPageCallback<
|
|
|
2905
2956
|
* @public
|
|
2906
2957
|
* Provides methods for managing the lifecycle of overlays, such as selected image overlays.
|
|
2907
2958
|
*/
|
|
2908
|
-
declare type DesignOverlay = {
|
|
2959
|
+
export declare type DesignOverlay = {
|
|
2909
2960
|
/**
|
|
2910
2961
|
* Registers a callback that runs when the `canOpen` state of an overlay target changes.
|
|
2911
2962
|
* @param opts - Options for configuring the callback.
|
|
@@ -3005,7 +3056,7 @@ declare type DesignOverlay = {
|
|
|
3005
3056
|
* @public
|
|
3006
3057
|
* Provides methods for interacting with selected content.
|
|
3007
3058
|
*/
|
|
3008
|
-
declare type DesignSelection = {
|
|
3059
|
+
export declare type DesignSelection = {
|
|
3009
3060
|
/**
|
|
3010
3061
|
* Registers a callback that runs when the specified type of content is selected.
|
|
3011
3062
|
*
|
|
@@ -3092,7 +3143,7 @@ declare type DesignSelection = {
|
|
|
3092
3143
|
* @public
|
|
3093
3144
|
* JWT that contains the Design ID and App ID.
|
|
3094
3145
|
*/
|
|
3095
|
-
declare type DesignToken = {
|
|
3146
|
+
export declare type DesignToken = {
|
|
3096
3147
|
token: string;
|
|
3097
3148
|
};
|
|
3098
3149
|
|
|
@@ -3100,7 +3151,7 @@ declare type DesignToken = {
|
|
|
3100
3151
|
* @public
|
|
3101
3152
|
* A set of dimensions.
|
|
3102
3153
|
*/
|
|
3103
|
-
declare type Dimensions = {
|
|
3154
|
+
export declare type Dimensions = {
|
|
3104
3155
|
/**
|
|
3105
3156
|
* A width, in pixels.
|
|
3106
3157
|
*/
|
|
@@ -3115,7 +3166,7 @@ declare type Dimensions = {
|
|
|
3115
3166
|
* @public
|
|
3116
3167
|
* An event that occurs when a user starts dragging an HTML element.
|
|
3117
3168
|
*/
|
|
3118
|
-
declare type DragStartEvent<E extends Element> = Pick<
|
|
3169
|
+
export declare type DragStartEvent<E extends Element> = Pick<
|
|
3119
3170
|
DragEvent,
|
|
3120
3171
|
"dataTransfer" | "currentTarget" | "preventDefault" | "clientX" | "clientY"
|
|
3121
3172
|
> & {
|
|
@@ -3173,6 +3224,15 @@ export declare type EditContentCallback = (
|
|
|
3173
3224
|
session: RichtextContentSession | FillContentSession,
|
|
3174
3225
|
) => Promise<void> | void;
|
|
3175
3226
|
|
|
3227
|
+
/**
|
|
3228
|
+
* @public
|
|
3229
|
+
* A callback for reading and updating the requested design content.
|
|
3230
|
+
* @param session - The result of reading the content in the design.
|
|
3231
|
+
*/
|
|
3232
|
+
declare type EditContentCallback_2 = (
|
|
3233
|
+
session: RichtextContentSession,
|
|
3234
|
+
) => Promise<void> | void;
|
|
3235
|
+
|
|
3176
3236
|
/**
|
|
3177
3237
|
* @beta
|
|
3178
3238
|
* Options for configuring how the design content is read.
|
|
@@ -3184,20 +3244,31 @@ export declare type EditContentOptions = {
|
|
|
3184
3244
|
contentType: ContentType;
|
|
3185
3245
|
} & ContextOptions;
|
|
3186
3246
|
|
|
3247
|
+
/**
|
|
3248
|
+
* @public
|
|
3249
|
+
* Options for configuring how the design content is read.
|
|
3250
|
+
*/
|
|
3251
|
+
declare type EditContentOptions_2 = {
|
|
3252
|
+
/**
|
|
3253
|
+
* The type of content to edit from the user's design
|
|
3254
|
+
*/
|
|
3255
|
+
contentType: ContentType_2;
|
|
3256
|
+
} & ContextOptions;
|
|
3257
|
+
|
|
3187
3258
|
/**
|
|
3188
3259
|
* @public
|
|
3189
3260
|
* Elements targeting a cursor are a subset of the base Element
|
|
3190
3261
|
**/
|
|
3191
|
-
declare type ElementAtCursor =
|
|
3262
|
+
export declare type ElementAtCursor =
|
|
3192
3263
|
| ImageElement
|
|
3193
|
-
|
|
|
3264
|
+
| VideoElement
|
|
3194
3265
|
| EmbedElement
|
|
3195
3266
|
| TextElement
|
|
3196
3267
|
| RichtextElement
|
|
3197
3268
|
| TableElement;
|
|
3198
3269
|
|
|
3199
3270
|
/**
|
|
3200
|
-
* @
|
|
3271
|
+
* @public
|
|
3201
3272
|
* An element that's natively supported by the Canva editor and has positional properties.
|
|
3202
3273
|
*/
|
|
3203
3274
|
export declare type ElementAtPoint =
|
|
@@ -3209,24 +3280,11 @@ export declare type ElementAtPoint =
|
|
|
3209
3280
|
| GroupElementAtPoint
|
|
3210
3281
|
| RichtextElementAtPoint;
|
|
3211
3282
|
|
|
3212
|
-
/**
|
|
3213
|
-
* @public
|
|
3214
|
-
* An element that's natively supported by the Canva editor and has positional properties.
|
|
3215
|
-
*/
|
|
3216
|
-
declare type ElementAtPoint_2 =
|
|
3217
|
-
| ImageElementAtPoint
|
|
3218
|
-
| VideoElementAtPoint_2
|
|
3219
|
-
| EmbedElementAtPoint
|
|
3220
|
-
| TextElementAtPoint
|
|
3221
|
-
| ShapeElementAtPoint
|
|
3222
|
-
| GroupElementAtPoint
|
|
3223
|
-
| RichtextElementAtPoint;
|
|
3224
|
-
|
|
3225
3283
|
/**
|
|
3226
3284
|
* @public
|
|
3227
3285
|
* Embed element to be added to the design at the end of a drag event.
|
|
3228
3286
|
*/
|
|
3229
|
-
declare type EmbedDragConfig = {
|
|
3287
|
+
export declare type EmbedDragConfig = {
|
|
3230
3288
|
/**
|
|
3231
3289
|
* The type of element.
|
|
3232
3290
|
*/
|
|
@@ -3252,7 +3310,7 @@ declare type EmbedDragConfig = {
|
|
|
3252
3310
|
* @public
|
|
3253
3311
|
* An element that renders rich media, such as a YouTube video.
|
|
3254
3312
|
*/
|
|
3255
|
-
declare type EmbedElement = {
|
|
3313
|
+
export declare type EmbedElement = {
|
|
3256
3314
|
/**
|
|
3257
3315
|
* The type of element.
|
|
3258
3316
|
*/
|
|
@@ -3270,7 +3328,7 @@ declare type EmbedElement = {
|
|
|
3270
3328
|
* @public
|
|
3271
3329
|
* An element that renders rich media, such as a YouTube video, and has positional properties.
|
|
3272
3330
|
*/
|
|
3273
|
-
declare type EmbedElementAtPoint = EmbedElement &
|
|
3331
|
+
export declare type EmbedElementAtPoint = EmbedElement &
|
|
3274
3332
|
Point &
|
|
3275
3333
|
(WidthAndHeight | Width | Height);
|
|
3276
3334
|
|
|
@@ -3278,7 +3336,7 @@ declare type EmbedElementAtPoint = EmbedElement &
|
|
|
3278
3336
|
* @public
|
|
3279
3337
|
* The result when a user abandons the export flow, such as by closing the export menu.
|
|
3280
3338
|
*/
|
|
3281
|
-
declare type ExportAborted = {
|
|
3339
|
+
export declare type ExportAborted = {
|
|
3282
3340
|
/**
|
|
3283
3341
|
* The status of the export flow.
|
|
3284
3342
|
*/
|
|
@@ -3289,7 +3347,7 @@ declare type ExportAborted = {
|
|
|
3289
3347
|
* @public
|
|
3290
3348
|
* The exported file.
|
|
3291
3349
|
*/
|
|
3292
|
-
declare type ExportBlob = {
|
|
3350
|
+
export declare type ExportBlob = {
|
|
3293
3351
|
/**
|
|
3294
3352
|
* The URL of the exported design.
|
|
3295
3353
|
*
|
|
@@ -3327,7 +3385,7 @@ declare type ExportBlob = {
|
|
|
3327
3385
|
* @public
|
|
3328
3386
|
* The result when a user successfully completes an export flow.
|
|
3329
3387
|
*/
|
|
3330
|
-
declare type ExportCompleted = {
|
|
3388
|
+
export declare type ExportCompleted = {
|
|
3331
3389
|
/**
|
|
3332
3390
|
* The status of the export flow.
|
|
3333
3391
|
*/
|
|
@@ -3349,7 +3407,7 @@ declare type ExportCompleted = {
|
|
|
3349
3407
|
* @public
|
|
3350
3408
|
* The types of files that Canva supports for exported designs.
|
|
3351
3409
|
*/
|
|
3352
|
-
declare type ExportFileType =
|
|
3410
|
+
export declare type ExportFileType =
|
|
3353
3411
|
| "png"
|
|
3354
3412
|
| "jpg"
|
|
3355
3413
|
| "pdf_standard"
|
|
@@ -3362,20 +3420,39 @@ declare type ExportFileType =
|
|
|
3362
3420
|
* @public
|
|
3363
3421
|
* Object representation of the supported file types with properties where applicable.
|
|
3364
3422
|
*/
|
|
3365
|
-
declare type ExportFileTypeWithProperties =
|
|
3366
|
-
|
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3423
|
+
export declare type ExportFileTypeWithProperties =
|
|
3424
|
+
| ExportImageFileType
|
|
3425
|
+
| ExportVideoFileType
|
|
3426
|
+
| ExportPrintFileType;
|
|
3427
|
+
|
|
3428
|
+
/**
|
|
3429
|
+
* @public
|
|
3430
|
+
* Supported image file types with properties.
|
|
3431
|
+
*
|
|
3432
|
+
* @remarks
|
|
3433
|
+
* Zip behavior for image file types:
|
|
3434
|
+
* - `auto` (default): Files are zipped together if the design has multiple pages, unzipped if it has one page.
|
|
3435
|
+
* - `always`: Files are always zipped into a single zip file, regardless of page count.
|
|
3436
|
+
* - `never`: Files are never zipped, providing an array of files.
|
|
3437
|
+
*/
|
|
3438
|
+
export declare type ExportImageFileType = {
|
|
3439
|
+
type: "png" | "jpg" | "svg";
|
|
3440
|
+
zipped?: ZipBehavior;
|
|
3441
|
+
};
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* @public
|
|
3445
|
+
* Supported print file types.
|
|
3446
|
+
*/
|
|
3447
|
+
export declare type ExportPrintFileType = {
|
|
3448
|
+
type: "pdf_standard" | "pptx";
|
|
3449
|
+
};
|
|
3373
3450
|
|
|
3374
3451
|
/**
|
|
3375
3452
|
* @public
|
|
3376
3453
|
* Options for configuring the export of a design.
|
|
3377
3454
|
*/
|
|
3378
|
-
declare type ExportRequest = {
|
|
3455
|
+
export declare type ExportRequest = {
|
|
3379
3456
|
/**
|
|
3380
3457
|
* The types of files the user can export their design as.
|
|
3381
3458
|
*
|
|
@@ -3389,7 +3466,21 @@ declare type ExportRequest = {
|
|
|
3389
3466
|
* @public
|
|
3390
3467
|
* The result of exporting a design.
|
|
3391
3468
|
*/
|
|
3392
|
-
declare type ExportResponse = ExportCompleted | ExportAborted;
|
|
3469
|
+
export declare type ExportResponse = ExportCompleted | ExportAborted;
|
|
3470
|
+
|
|
3471
|
+
/**
|
|
3472
|
+
* @public
|
|
3473
|
+
* Supported video file types with properties.
|
|
3474
|
+
*
|
|
3475
|
+
* @remarks
|
|
3476
|
+
* Zip behavior for video file types:
|
|
3477
|
+
* - `auto` or `never` (default): Files are never zipped together, regardless of count.
|
|
3478
|
+
* - `always`: Files are always zipped into a single file.
|
|
3479
|
+
*/
|
|
3480
|
+
export declare type ExportVideoFileType = {
|
|
3481
|
+
type: "gif" | "video";
|
|
3482
|
+
zipped?: ZipBehavior;
|
|
3483
|
+
};
|
|
3393
3484
|
|
|
3394
3485
|
/**
|
|
3395
3486
|
* @public
|
|
@@ -3398,7 +3489,7 @@ declare type ExportResponse = ExportCompleted | ExportAborted;
|
|
|
3398
3489
|
* @remarks
|
|
3399
3490
|
* This type is only used when the image data is from an external URL.
|
|
3400
3491
|
*/
|
|
3401
|
-
declare type ExternalImageDragConfig = CommonImageDragConfig & {
|
|
3492
|
+
export declare type ExternalImageDragConfig = CommonImageDragConfig & {
|
|
3402
3493
|
/**
|
|
3403
3494
|
* A function that returns a reference (ref) to an audio asset in Canva's backend.
|
|
3404
3495
|
*/
|
|
@@ -3422,7 +3513,7 @@ declare type ExternalImageDragConfig = CommonImageDragConfig & {
|
|
|
3422
3513
|
* @remarks
|
|
3423
3514
|
* The `color` and `asset` properties are mutually exclusive.
|
|
3424
3515
|
*/
|
|
3425
|
-
declare type Fill = {
|
|
3516
|
+
export declare type Fill = {
|
|
3426
3517
|
/**
|
|
3427
3518
|
* If `true`, users can replace a fill by dropping an image or video onto it.
|
|
3428
3519
|
*/
|
|
@@ -3447,7 +3538,7 @@ declare type Fill = {
|
|
|
3447
3538
|
* @beta
|
|
3448
3539
|
* Object for interacting with fill content (images/videos).
|
|
3449
3540
|
*/
|
|
3450
|
-
declare type FillContent =
|
|
3541
|
+
export declare type FillContent =
|
|
3451
3542
|
| {
|
|
3452
3543
|
type: "image";
|
|
3453
3544
|
/**
|
|
@@ -3489,7 +3580,7 @@ declare type FillContent =
|
|
|
3489
3580
|
* @beta
|
|
3490
3581
|
* Session for reading and updating fill content in a user's design.
|
|
3491
3582
|
*/
|
|
3492
|
-
declare interface FillContentSession {
|
|
3583
|
+
export declare interface FillContentSession {
|
|
3493
3584
|
/**
|
|
3494
3585
|
* Fill content in the design.
|
|
3495
3586
|
*/
|
|
@@ -3508,7 +3599,7 @@ declare interface FillContentSession {
|
|
|
3508
3599
|
* @public
|
|
3509
3600
|
* A reference to a font that can be used in other parts of the SDK.
|
|
3510
3601
|
*/
|
|
3511
|
-
declare type FontRef = string & {
|
|
3602
|
+
export declare type FontRef = string & {
|
|
3512
3603
|
__fontRef: never;
|
|
3513
3604
|
};
|
|
3514
3605
|
|
|
@@ -3516,7 +3607,7 @@ declare type FontRef = string & {
|
|
|
3516
3607
|
* @public
|
|
3517
3608
|
* Font weights supported in the SDK.
|
|
3518
3609
|
**/
|
|
3519
|
-
declare type FontWeight =
|
|
3610
|
+
export declare type FontWeight =
|
|
3520
3611
|
| "normal"
|
|
3521
3612
|
| "thin"
|
|
3522
3613
|
| "extralight"
|
|
@@ -3645,7 +3736,7 @@ export declare const getDesignMetadata: () => Promise<DesignMetadata>;
|
|
|
3645
3736
|
export declare const getDesignToken: () => Promise<DesignToken>;
|
|
3646
3737
|
|
|
3647
3738
|
/**
|
|
3648
|
-
* @
|
|
3739
|
+
* @public
|
|
3649
3740
|
* An element that's natively supported by the Canva editor, can exist within a group, and has positional properties.
|
|
3650
3741
|
*/
|
|
3651
3742
|
export declare type GroupContentAtPoint = Exclude<
|
|
@@ -3653,20 +3744,11 @@ export declare type GroupContentAtPoint = Exclude<
|
|
|
3653
3744
|
GroupElementAtPoint
|
|
3654
3745
|
>;
|
|
3655
3746
|
|
|
3656
|
-
/**
|
|
3657
|
-
* @public
|
|
3658
|
-
* An element that's natively supported by the Canva editor, can exist within a group, and has positional properties.
|
|
3659
|
-
*/
|
|
3660
|
-
declare type GroupContentAtPoint_2 = Exclude<
|
|
3661
|
-
ElementAtPoint_2,
|
|
3662
|
-
GroupElementAtPoint
|
|
3663
|
-
>;
|
|
3664
|
-
|
|
3665
3747
|
/**
|
|
3666
3748
|
* @public
|
|
3667
3749
|
* An element that contains two or more elements.
|
|
3668
3750
|
*/
|
|
3669
|
-
declare type GroupElement = {
|
|
3751
|
+
export declare type GroupElement = {
|
|
3670
3752
|
/**
|
|
3671
3753
|
* The type of element.
|
|
3672
3754
|
*/
|
|
@@ -3678,14 +3760,14 @@ declare type GroupElement = {
|
|
|
3678
3760
|
* - Each element within a group must have dimensions and a position.
|
|
3679
3761
|
* - The dimensions and positions are relative to the dimensions and positions of the group.
|
|
3680
3762
|
*/
|
|
3681
|
-
children:
|
|
3763
|
+
children: GroupContentAtPoint[];
|
|
3682
3764
|
};
|
|
3683
3765
|
|
|
3684
3766
|
/**
|
|
3685
3767
|
* @public
|
|
3686
3768
|
* An element that contains two or more elements and has positional properties.
|
|
3687
3769
|
*/
|
|
3688
|
-
declare type GroupElementAtPoint = GroupElement &
|
|
3770
|
+
export declare type GroupElementAtPoint = GroupElement &
|
|
3689
3771
|
Point &
|
|
3690
3772
|
(WidthAndHeight | Width | Height);
|
|
3691
3773
|
|
|
@@ -3712,13 +3794,13 @@ declare type Height = {
|
|
|
3712
3794
|
* @public
|
|
3713
3795
|
* Image element or content to be added to the design at the end of a drag event.
|
|
3714
3796
|
*/
|
|
3715
|
-
declare type ImageDragConfig = ExternalImageDragConfig;
|
|
3797
|
+
export declare type ImageDragConfig = ExternalImageDragConfig;
|
|
3716
3798
|
|
|
3717
3799
|
/**
|
|
3718
3800
|
* @public
|
|
3719
3801
|
* Image element or content to be added to the design at the end of a drag event.
|
|
3720
3802
|
*/
|
|
3721
|
-
declare type ImageDragConfigForElement<E extends Element> =
|
|
3803
|
+
export declare type ImageDragConfigForElement<E extends Element> =
|
|
3722
3804
|
E extends HTMLImageElement
|
|
3723
3805
|
? Partial<ImageDragConfig> & Pick<ImageDragConfig, "type">
|
|
3724
3806
|
: ImageDragConfig;
|
|
@@ -3727,7 +3809,7 @@ declare type ImageDragConfigForElement<E extends Element> =
|
|
|
3727
3809
|
* @public
|
|
3728
3810
|
* An element that renders image content.
|
|
3729
3811
|
*/
|
|
3730
|
-
declare type ImageElement = {
|
|
3812
|
+
export declare type ImageElement = {
|
|
3731
3813
|
/**
|
|
3732
3814
|
* The type of element.
|
|
3733
3815
|
*/
|
|
@@ -3766,7 +3848,7 @@ declare type ImageElement = {
|
|
|
3766
3848
|
* @public
|
|
3767
3849
|
* An element that renders image content and has positional properties.
|
|
3768
3850
|
*/
|
|
3769
|
-
declare type ImageElementAtPoint = ImageElement &
|
|
3851
|
+
export declare type ImageElementAtPoint = ImageElement &
|
|
3770
3852
|
Point &
|
|
3771
3853
|
(WidthAndHeight | Width | Height);
|
|
3772
3854
|
|
|
@@ -3774,7 +3856,7 @@ declare type ImageElementAtPoint = ImageElement &
|
|
|
3774
3856
|
* @public
|
|
3775
3857
|
* An image asset that fills a path's interior.
|
|
3776
3858
|
*/
|
|
3777
|
-
declare type ImageFill = {
|
|
3859
|
+
export declare type ImageFill = {
|
|
3778
3860
|
/**
|
|
3779
3861
|
* The type of fill.
|
|
3780
3862
|
*/
|
|
@@ -3796,12 +3878,12 @@ declare type ImageFill = {
|
|
|
3796
3878
|
* @public
|
|
3797
3879
|
* A unique identifier that references an image asset in Canva's backend.
|
|
3798
3880
|
*/
|
|
3799
|
-
declare type ImageRef = string & {
|
|
3881
|
+
export declare type ImageRef = string & {
|
|
3800
3882
|
__imageRef: never;
|
|
3801
3883
|
};
|
|
3802
3884
|
|
|
3803
3885
|
/**
|
|
3804
|
-
* @
|
|
3886
|
+
* @public
|
|
3805
3887
|
* @param appElementConfig - Configuration for an AppElementClient
|
|
3806
3888
|
*
|
|
3807
3889
|
* @example Initialize app element client
|
|
@@ -3846,7 +3928,7 @@ export declare const initAppElement: <A extends AppElementData>(
|
|
|
3846
3928
|
* @public
|
|
3847
3929
|
* Options for formatting inline richtext.
|
|
3848
3930
|
*/
|
|
3849
|
-
declare type InlineFormatting = {
|
|
3931
|
+
export declare type InlineFormatting = {
|
|
3850
3932
|
/**
|
|
3851
3933
|
* The color of the text as a hex code.
|
|
3852
3934
|
*
|
|
@@ -3914,22 +3996,34 @@ export declare type LaunchPublishOpts = {
|
|
|
3914
3996
|
* @public
|
|
3915
3997
|
* An element that's natively supported by the Canva editor.
|
|
3916
3998
|
*/
|
|
3917
|
-
declare type NativeElement =
|
|
3999
|
+
export declare type NativeElement =
|
|
3918
4000
|
| NativeImageElement
|
|
3919
|
-
|
|
|
4001
|
+
| NativeVideoElement
|
|
3920
4002
|
| NativeEmbedElement
|
|
3921
4003
|
| NativeTextElement
|
|
3922
4004
|
| NativeShapeElement
|
|
3923
4005
|
| NativeGroupElement;
|
|
3924
4006
|
|
|
4007
|
+
/**
|
|
4008
|
+
* @deprecated
|
|
4009
|
+
* @public
|
|
4010
|
+
* The types of elements an app can add to a user's design.
|
|
4011
|
+
*/
|
|
4012
|
+
export declare type NativeElementType =
|
|
4013
|
+
| "image"
|
|
4014
|
+
| "embed"
|
|
4015
|
+
| "text"
|
|
4016
|
+
| "shape"
|
|
4017
|
+
| "video";
|
|
4018
|
+
|
|
3925
4019
|
/**
|
|
3926
4020
|
* @deprecated The type has been superseded by `ElementAtPoint`.
|
|
3927
4021
|
* @public
|
|
3928
4022
|
* An element that's natively supported by the Canva editor and has positional properties.
|
|
3929
4023
|
*/
|
|
3930
|
-
declare type NativeElementWithBox =
|
|
4024
|
+
export declare type NativeElementWithBox =
|
|
3931
4025
|
| NativeImageElementWithBox
|
|
3932
|
-
|
|
|
4026
|
+
| NativeVideoElementWithBox
|
|
3933
4027
|
| NativeEmbedElementWithBox
|
|
3934
4028
|
| NativeTextElementWithBox
|
|
3935
4029
|
| NativeShapeElementWithBox
|
|
@@ -3940,98 +4034,91 @@ declare type NativeElementWithBox =
|
|
|
3940
4034
|
* @public
|
|
3941
4035
|
* An element that renders rich media, such as a YouTube video.
|
|
3942
4036
|
*/
|
|
3943
|
-
declare type NativeEmbedElement = EmbedElement;
|
|
4037
|
+
export declare type NativeEmbedElement = EmbedElement;
|
|
3944
4038
|
|
|
3945
4039
|
/**
|
|
3946
4040
|
* @deprecated The type has been superseded by `EmbedElementAtPoint`.
|
|
3947
4041
|
* @public
|
|
3948
4042
|
* An element that renders rich media, such as a YouTube video, and has positional properties.
|
|
3949
4043
|
*/
|
|
3950
|
-
declare type NativeEmbedElementWithBox = EmbedElementAtPoint;
|
|
4044
|
+
export declare type NativeEmbedElementWithBox = EmbedElementAtPoint;
|
|
3951
4045
|
|
|
3952
4046
|
/**
|
|
3953
4047
|
* @deprecated The type has been superseded by `GroupElement`.
|
|
3954
4048
|
* @public
|
|
3955
4049
|
* An element that contains two or more elements.
|
|
3956
4050
|
*/
|
|
3957
|
-
declare type NativeGroupElement = GroupElement;
|
|
4051
|
+
export declare type NativeGroupElement = GroupElement;
|
|
3958
4052
|
|
|
3959
4053
|
/**
|
|
3960
4054
|
* @deprecated The type has been superseded by `GroupElementAtPoint`.
|
|
3961
4055
|
* @public
|
|
3962
4056
|
* An element that contains two or more elements and has positional properties.
|
|
3963
4057
|
*/
|
|
3964
|
-
declare type NativeGroupElementWithBox = GroupElementAtPoint;
|
|
4058
|
+
export declare type NativeGroupElementWithBox = GroupElementAtPoint;
|
|
3965
4059
|
|
|
3966
4060
|
/**
|
|
3967
4061
|
* @deprecated The type has been superseded by `ImageElement`.
|
|
3968
4062
|
* @public
|
|
3969
4063
|
* An element that renders image content.
|
|
3970
4064
|
*/
|
|
3971
|
-
declare type NativeImageElement = ImageElement;
|
|
4065
|
+
export declare type NativeImageElement = ImageElement;
|
|
3972
4066
|
|
|
3973
4067
|
/**
|
|
3974
4068
|
* @deprecated The type has been superseded by `ImageElementAtPoint`.
|
|
3975
4069
|
* @public
|
|
3976
4070
|
* An element that renders image content and has positional properties.
|
|
3977
4071
|
*/
|
|
3978
|
-
declare type NativeImageElementWithBox = ImageElementAtPoint;
|
|
4072
|
+
export declare type NativeImageElementWithBox = ImageElementAtPoint;
|
|
3979
4073
|
|
|
3980
4074
|
/**
|
|
3981
4075
|
* @deprecated The type has been superseded by `ShapeElement`.
|
|
3982
4076
|
* @public
|
|
3983
4077
|
* An element that renders a vector shape.
|
|
3984
4078
|
*/
|
|
3985
|
-
declare type NativeShapeElement = ShapeElement;
|
|
4079
|
+
export declare type NativeShapeElement = ShapeElement;
|
|
3986
4080
|
|
|
3987
4081
|
/**
|
|
3988
4082
|
* @deprecated The type has been superseded by `ShapeElementAtPoint`.
|
|
3989
4083
|
* @public
|
|
3990
4084
|
* An element that renders a vector shape and has positional properties.
|
|
3991
4085
|
*/
|
|
3992
|
-
declare type NativeShapeElementWithBox = ShapeElementAtPoint;
|
|
4086
|
+
export declare type NativeShapeElementWithBox = ShapeElementAtPoint;
|
|
4087
|
+
|
|
4088
|
+
/**
|
|
4089
|
+
* @deprecated The type has been superseded by `GroupContentAtPoint`.
|
|
4090
|
+
* @public
|
|
4091
|
+
* An element that's natively supported by the Canva editor, can exist within a group, and has positional properties.
|
|
4092
|
+
*/
|
|
4093
|
+
export declare type NativeSimpleElementWithBox = GroupContentAtPoint;
|
|
3993
4094
|
|
|
3994
4095
|
/**
|
|
3995
4096
|
* @deprecated The type has been superseded by `TextElement`.
|
|
3996
4097
|
* @public
|
|
3997
4098
|
* An element that renders text content.
|
|
3998
4099
|
*/
|
|
3999
|
-
declare type NativeTextElement = TextElement;
|
|
4100
|
+
export declare type NativeTextElement = TextElement;
|
|
4000
4101
|
|
|
4001
4102
|
/**
|
|
4002
4103
|
* @deprecated The type has been superseded by `TextElementAtPoint`.
|
|
4003
4104
|
* @public
|
|
4004
4105
|
* An element that renders text content and has positional properties.
|
|
4005
4106
|
*/
|
|
4006
|
-
declare type NativeTextElementWithBox = TextElementAtPoint;
|
|
4007
|
-
|
|
4008
|
-
/**
|
|
4009
|
-
* @deprecated The type has been superseded by `VideoElement`.
|
|
4010
|
-
* @beta
|
|
4011
|
-
* An element that renders video content.
|
|
4012
|
-
*/
|
|
4013
|
-
export declare type NativeVideoElement = VideoElement;
|
|
4107
|
+
export declare type NativeTextElementWithBox = TextElementAtPoint;
|
|
4014
4108
|
|
|
4015
4109
|
/**
|
|
4016
4110
|
* @deprecated The type has been superseded by `VideoElement`.
|
|
4017
4111
|
* @public
|
|
4018
4112
|
* An element that renders video content.
|
|
4019
4113
|
*/
|
|
4020
|
-
declare type
|
|
4021
|
-
|
|
4022
|
-
/**
|
|
4023
|
-
* @deprecated The type has been superseded by `VideoElementAtPoint`.
|
|
4024
|
-
* @beta
|
|
4025
|
-
* An element that renders video content and has positional properties.
|
|
4026
|
-
*/
|
|
4027
|
-
export declare type NativeVideoElementWithBox = VideoElementAtPoint;
|
|
4114
|
+
export declare type NativeVideoElement = VideoElement;
|
|
4028
4115
|
|
|
4029
4116
|
/**
|
|
4030
4117
|
* @deprecated The type has been superseded by `VideoElementAtPoint`.
|
|
4031
4118
|
* @public
|
|
4032
4119
|
* An element that renders video content and has positional properties.
|
|
4033
4120
|
*/
|
|
4034
|
-
declare type
|
|
4121
|
+
export declare type NativeVideoElementWithBox = VideoElementAtPoint;
|
|
4035
4122
|
|
|
4036
4123
|
/**
|
|
4037
4124
|
* An object primitive data type that can be used in app element data.
|
|
@@ -4066,7 +4153,7 @@ export declare const overlay: DesignOverlay;
|
|
|
4066
4153
|
* @public
|
|
4067
4154
|
* Information about whether or not an overlay can be opened for the specified target.
|
|
4068
4155
|
*/
|
|
4069
|
-
declare type OverlayOpenableEvent<Target extends OverlayTarget> = {
|
|
4156
|
+
export declare type OverlayOpenableEvent<Target extends OverlayTarget> = {
|
|
4070
4157
|
/**
|
|
4071
4158
|
* Information about whether or not an overlay can be opened or not for a selected image.
|
|
4072
4159
|
*/
|
|
@@ -4097,7 +4184,7 @@ declare type OverlayOpenableEvent<Target extends OverlayTarget> = {
|
|
|
4097
4184
|
* @public
|
|
4098
4185
|
* An entity that an overlay can be opened for.
|
|
4099
4186
|
*/
|
|
4100
|
-
declare type OverlayTarget = "image_selection";
|
|
4187
|
+
export declare type OverlayTarget = "image_selection";
|
|
4101
4188
|
|
|
4102
4189
|
/**
|
|
4103
4190
|
* @public
|
|
@@ -4118,13 +4205,13 @@ declare type OverlayUnopenableEvent = {
|
|
|
4118
4205
|
* @public
|
|
4119
4206
|
* The appearance of a page's background.
|
|
4120
4207
|
*/
|
|
4121
|
-
declare type PageBackgroundFill = Pick<Fill, "asset" | "color">;
|
|
4208
|
+
export declare type PageBackgroundFill = Pick<Fill, "asset" | "color">;
|
|
4122
4209
|
|
|
4123
4210
|
/**
|
|
4124
4211
|
* @public
|
|
4125
4212
|
* Information about a page.
|
|
4126
4213
|
*/
|
|
4127
|
-
declare type PageContext = {
|
|
4214
|
+
export declare type PageContext = {
|
|
4128
4215
|
/**
|
|
4129
4216
|
* The dimensions of the page, in pixels.
|
|
4130
4217
|
*
|
|
@@ -4138,7 +4225,7 @@ declare type PageContext = {
|
|
|
4138
4225
|
* @public
|
|
4139
4226
|
* A set of page dimensions, in pixels.
|
|
4140
4227
|
*/
|
|
4141
|
-
declare type PageDimensions = {
|
|
4228
|
+
export declare type PageDimensions = {
|
|
4142
4229
|
/**
|
|
4143
4230
|
* The width of the page, in pixels.
|
|
4144
4231
|
*/
|
|
@@ -4153,7 +4240,7 @@ declare type PageDimensions = {
|
|
|
4153
4240
|
* @public
|
|
4154
4241
|
* Information about a page.
|
|
4155
4242
|
*/
|
|
4156
|
-
declare type PageMetadata = {
|
|
4243
|
+
export declare type PageMetadata = {
|
|
4157
4244
|
/**
|
|
4158
4245
|
* The dimensions of the page, in pixels.
|
|
4159
4246
|
*
|
|
@@ -4167,7 +4254,7 @@ declare type PageMetadata = {
|
|
|
4167
4254
|
* @public
|
|
4168
4255
|
* The outline of a path.
|
|
4169
4256
|
*/
|
|
4170
|
-
declare type PathStroke = {
|
|
4257
|
+
export declare type PathStroke = {
|
|
4171
4258
|
/**
|
|
4172
4259
|
* The weight (thickness) of the stroke.
|
|
4173
4260
|
*
|
|
@@ -4196,7 +4283,7 @@ declare type PathStroke = {
|
|
|
4196
4283
|
* @public
|
|
4197
4284
|
* A position, set of dimensions, and rotation.
|
|
4198
4285
|
*/
|
|
4199
|
-
declare type Placement = Point & (WidthAndHeight | Width | Height);
|
|
4286
|
+
export declare type Placement = Point & (WidthAndHeight | Width | Height);
|
|
4200
4287
|
|
|
4201
4288
|
/**
|
|
4202
4289
|
* A position and rotation.
|
|
@@ -4281,7 +4368,7 @@ export declare const requestExport: (
|
|
|
4281
4368
|
* @public
|
|
4282
4369
|
* Provides methods for interacting with a range of formatted text.
|
|
4283
4370
|
*/
|
|
4284
|
-
declare interface RichtextContentRange extends RichtextRange {
|
|
4371
|
+
export declare interface RichtextContentRange extends RichtextRange {
|
|
4285
4372
|
/**
|
|
4286
4373
|
* Indicates whether the object containing this richtext range has been deleted.
|
|
4287
4374
|
*/
|
|
@@ -4369,7 +4456,7 @@ declare interface RichtextContentRange extends RichtextRange {
|
|
|
4369
4456
|
* );
|
|
4370
4457
|
* ```
|
|
4371
4458
|
*/
|
|
4372
|
-
declare interface RichtextContentSession {
|
|
4459
|
+
export declare interface RichtextContentSession {
|
|
4373
4460
|
/**
|
|
4374
4461
|
* Richtext content in the design.
|
|
4375
4462
|
*/
|
|
@@ -4412,7 +4499,7 @@ declare interface RichtextContentSession {
|
|
|
4412
4499
|
* @public
|
|
4413
4500
|
* An element that renders richtext content.
|
|
4414
4501
|
*/
|
|
4415
|
-
declare type RichtextElement = {
|
|
4502
|
+
export declare type RichtextElement = {
|
|
4416
4503
|
/**
|
|
4417
4504
|
* The type of element.
|
|
4418
4505
|
*/
|
|
@@ -4433,13 +4520,13 @@ declare type RichtextElement = {
|
|
|
4433
4520
|
* It will be positioned and sized relative to its parent container.
|
|
4434
4521
|
* The parent container may be an app element, or the current page.
|
|
4435
4522
|
*/
|
|
4436
|
-
declare type RichtextElementAtPoint = RichtextElement & TextBox;
|
|
4523
|
+
export declare type RichtextElementAtPoint = RichtextElement & TextBox;
|
|
4437
4524
|
|
|
4438
4525
|
/**
|
|
4439
4526
|
* @public
|
|
4440
4527
|
* Options for formatting richtext.
|
|
4441
4528
|
*/
|
|
4442
|
-
declare type RichtextFormatting = InlineFormatting & {
|
|
4529
|
+
export declare type RichtextFormatting = InlineFormatting & {
|
|
4443
4530
|
/**
|
|
4444
4531
|
* @public
|
|
4445
4532
|
* A unique identifier that points to a font asset in Canva's backend.
|
|
@@ -4487,7 +4574,7 @@ declare type RichtextFormatting = InlineFormatting & {
|
|
|
4487
4574
|
* @public
|
|
4488
4575
|
* Provides methods for interacting with a range of formatted text.
|
|
4489
4576
|
*/
|
|
4490
|
-
declare type RichtextRange = {
|
|
4577
|
+
export declare type RichtextRange = {
|
|
4491
4578
|
/**
|
|
4492
4579
|
* Formats all of the paragraphs that overlap the given bounds.
|
|
4493
4580
|
*
|
|
@@ -4771,7 +4858,7 @@ export declare const selection: DesignSelection;
|
|
|
4771
4858
|
* @public
|
|
4772
4859
|
* Information about the user's selection. To access the selected content, call the `read` method.
|
|
4773
4860
|
*/
|
|
4774
|
-
declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
4861
|
+
export declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
4775
4862
|
/**
|
|
4776
4863
|
* The type of content that's selected.
|
|
4777
4864
|
*/
|
|
@@ -4857,7 +4944,7 @@ declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
|
4857
4944
|
* @public
|
|
4858
4945
|
* Information about a user's selection.
|
|
4859
4946
|
*/
|
|
4860
|
-
declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
4947
|
+
export declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
4861
4948
|
/**
|
|
4862
4949
|
* The type of content.
|
|
4863
4950
|
*/
|
|
@@ -4879,7 +4966,11 @@ declare interface SelectionEvent<Scope extends SelectionScope> {
|
|
|
4879
4966
|
* @public
|
|
4880
4967
|
* A type of content that supports selection events.
|
|
4881
4968
|
*/
|
|
4882
|
-
declare type SelectionScope =
|
|
4969
|
+
export declare type SelectionScope =
|
|
4970
|
+
| "plaintext"
|
|
4971
|
+
| "image"
|
|
4972
|
+
| "video"
|
|
4973
|
+
| "richtext";
|
|
4883
4974
|
|
|
4884
4975
|
/**
|
|
4885
4976
|
* @public
|
|
@@ -4888,7 +4979,7 @@ declare type SelectionScope = "plaintext" | "image" | "video" | "richtext";
|
|
|
4888
4979
|
* @remarks
|
|
4889
4980
|
* The available properties depend on the type (scope) of content.
|
|
4890
4981
|
*/
|
|
4891
|
-
declare type SelectionValue<Scope extends SelectionScope> = {
|
|
4982
|
+
export declare type SelectionValue<Scope extends SelectionScope> = {
|
|
4892
4983
|
/**
|
|
4893
4984
|
* A selected range of plaintext.
|
|
4894
4985
|
*/
|
|
@@ -4985,7 +5076,7 @@ export declare const setCurrentPageBackground: (
|
|
|
4985
5076
|
* @public
|
|
4986
5077
|
* An element that renders a vector shape.
|
|
4987
5078
|
*/
|
|
4988
|
-
declare type ShapeElement = {
|
|
5079
|
+
export declare type ShapeElement = {
|
|
4989
5080
|
/**
|
|
4990
5081
|
* The type of element.
|
|
4991
5082
|
*/
|
|
@@ -5009,7 +5100,7 @@ declare type ShapeElement = {
|
|
|
5009
5100
|
* @public
|
|
5010
5101
|
* An element that renders a vector shape and has positional properties.
|
|
5011
5102
|
*/
|
|
5012
|
-
declare type ShapeElementAtPoint = ShapeElement &
|
|
5103
|
+
export declare type ShapeElementAtPoint = ShapeElement &
|
|
5013
5104
|
Point &
|
|
5014
5105
|
(WidthAndHeight | Width | Height);
|
|
5015
5106
|
|
|
@@ -5017,7 +5108,7 @@ declare type ShapeElementAtPoint = ShapeElement &
|
|
|
5017
5108
|
* @public
|
|
5018
5109
|
* A path that defines the structure of a shape element.
|
|
5019
5110
|
*/
|
|
5020
|
-
declare type ShapePath = {
|
|
5111
|
+
export declare type ShapePath = {
|
|
5021
5112
|
/**
|
|
5022
5113
|
* The shape of the path.
|
|
5023
5114
|
*
|
|
@@ -5049,7 +5140,7 @@ declare type ShapePath = {
|
|
|
5049
5140
|
* @remarks
|
|
5050
5141
|
* This is similar to the `viewBox` attribute of an `SVGElement`.
|
|
5051
5142
|
*/
|
|
5052
|
-
declare type ShapeViewBox = {
|
|
5143
|
+
export declare type ShapeViewBox = {
|
|
5053
5144
|
/**
|
|
5054
5145
|
* The distance of the shape from the top edge of the element, in pixels.
|
|
5055
5146
|
*/
|
|
@@ -5072,7 +5163,7 @@ declare type ShapeViewBox = {
|
|
|
5072
5163
|
* @public
|
|
5073
5164
|
* An element that renders a table.
|
|
5074
5165
|
*/
|
|
5075
|
-
declare type TableElement = {
|
|
5166
|
+
export declare type TableElement = {
|
|
5076
5167
|
/**
|
|
5077
5168
|
* The type of element.
|
|
5078
5169
|
*/
|
|
@@ -5095,7 +5186,7 @@ declare type TableElement = {
|
|
|
5095
5186
|
* @public
|
|
5096
5187
|
* Options for configuring the appearance of text.
|
|
5097
5188
|
*/
|
|
5098
|
-
declare type TextAttributes = {
|
|
5189
|
+
export declare type TextAttributes = {
|
|
5099
5190
|
/**
|
|
5100
5191
|
* The size of the text.
|
|
5101
5192
|
*
|
|
@@ -5162,7 +5253,7 @@ declare type TextBox = Point & {
|
|
|
5162
5253
|
* @public
|
|
5163
5254
|
* Text element or content to be added to the design at the end of a drag event.
|
|
5164
5255
|
*/
|
|
5165
|
-
declare type TextDragConfig = {
|
|
5256
|
+
export declare type TextDragConfig = {
|
|
5166
5257
|
/**
|
|
5167
5258
|
* The type of element.
|
|
5168
5259
|
*/
|
|
@@ -5202,7 +5293,7 @@ declare type TextDragConfig = {
|
|
|
5202
5293
|
* @public
|
|
5203
5294
|
* An element that renders text content.
|
|
5204
5295
|
*/
|
|
5205
|
-
declare type TextElement = {
|
|
5296
|
+
export declare type TextElement = {
|
|
5206
5297
|
/**
|
|
5207
5298
|
* The type of element.
|
|
5208
5299
|
*/
|
|
@@ -5220,13 +5311,13 @@ declare type TextElement = {
|
|
|
5220
5311
|
* @public
|
|
5221
5312
|
* An element that renders text content and has positional properties.
|
|
5222
5313
|
*/
|
|
5223
|
-
declare type TextElementAtPoint = TextElement & TextBox;
|
|
5314
|
+
export declare type TextElementAtPoint = TextElement & TextBox;
|
|
5224
5315
|
|
|
5225
5316
|
/**
|
|
5226
5317
|
* @public
|
|
5227
5318
|
* A region of richtext.
|
|
5228
5319
|
*/
|
|
5229
|
-
declare type TextRegion = {
|
|
5320
|
+
export declare type TextRegion = {
|
|
5230
5321
|
/**
|
|
5231
5322
|
* The plaintext content of the region.
|
|
5232
5323
|
*/
|
|
@@ -5241,7 +5332,7 @@ declare type TextRegion = {
|
|
|
5241
5332
|
* @public
|
|
5242
5333
|
* Provides methods for adding drag and drop behavior to an app.
|
|
5243
5334
|
*/
|
|
5244
|
-
declare interface UI {
|
|
5335
|
+
export declare interface UI {
|
|
5245
5336
|
/**
|
|
5246
5337
|
* @deprecated The method has been superseded by `startDragToPoint`.
|
|
5247
5338
|
* @public
|
|
@@ -5301,7 +5392,7 @@ export declare const ui: UI;
|
|
|
5301
5392
|
* @public
|
|
5302
5393
|
* A data type that can be used in app element data.
|
|
5303
5394
|
*/
|
|
5304
|
-
declare type Value =
|
|
5395
|
+
export declare type Value =
|
|
5305
5396
|
| Primitive
|
|
5306
5397
|
| ObjectPrimitive
|
|
5307
5398
|
| Exclude<Value, undefined>[]
|
|
@@ -5313,7 +5404,7 @@ declare type Value =
|
|
|
5313
5404
|
* @public
|
|
5314
5405
|
* Video element or content to be added to the design at the end of a drag event.
|
|
5315
5406
|
*/
|
|
5316
|
-
declare type VideoDragConfig = {
|
|
5407
|
+
export declare type VideoDragConfig = {
|
|
5317
5408
|
/**
|
|
5318
5409
|
* The type of element.
|
|
5319
5410
|
*/
|
|
@@ -5346,32 +5437,17 @@ declare type VideoDragConfig = {
|
|
|
5346
5437
|
* @public
|
|
5347
5438
|
* Video element or content to be added to the design at the end of a drag event.
|
|
5348
5439
|
*/
|
|
5349
|
-
declare type VideoDragConfigForElement<E extends Element> =
|
|
5440
|
+
export declare type VideoDragConfigForElement<E extends Element> =
|
|
5350
5441
|
E extends HTMLImageElement
|
|
5351
5442
|
? Partial<VideoDragConfig> &
|
|
5352
5443
|
Pick<VideoDragConfig, "type" | "resolveVideoRef">
|
|
5353
5444
|
: VideoDragConfig;
|
|
5354
5445
|
|
|
5355
|
-
/**
|
|
5356
|
-
* @beta
|
|
5357
|
-
* An element that renders video content.
|
|
5358
|
-
*/
|
|
5359
|
-
export declare type VideoElement = VideoElement_2 & {
|
|
5360
|
-
/**
|
|
5361
|
-
* Options for configuring the cropping of the video.
|
|
5362
|
-
*/
|
|
5363
|
-
imageBox?: VideoImageBox;
|
|
5364
|
-
/**
|
|
5365
|
-
* Options for configuring the start, and end of the video.
|
|
5366
|
-
*/
|
|
5367
|
-
trim?: VideoTrim;
|
|
5368
|
-
};
|
|
5369
|
-
|
|
5370
5446
|
/**
|
|
5371
5447
|
* @public
|
|
5372
5448
|
* An element that renders video content.
|
|
5373
5449
|
*/
|
|
5374
|
-
declare type
|
|
5450
|
+
export declare type VideoElement = {
|
|
5375
5451
|
/**
|
|
5376
5452
|
* The type of element.
|
|
5377
5453
|
*/
|
|
@@ -5389,26 +5465,11 @@ declare type VideoElement_2 = {
|
|
|
5389
5465
|
altText: AltText | undefined;
|
|
5390
5466
|
};
|
|
5391
5467
|
|
|
5392
|
-
/**
|
|
5393
|
-
* @beta
|
|
5394
|
-
* An element that renders video content and has positional properties.
|
|
5395
|
-
*/
|
|
5396
|
-
export declare type VideoElementAtPoint = VideoElementAtPoint_2 & {
|
|
5397
|
-
/**
|
|
5398
|
-
* Options for configuring the cropping of the video.
|
|
5399
|
-
*/
|
|
5400
|
-
imageBox?: VideoImageBox;
|
|
5401
|
-
/**
|
|
5402
|
-
* Options for configuring the start, and end of the video.
|
|
5403
|
-
*/
|
|
5404
|
-
trim?: VideoTrim;
|
|
5405
|
-
};
|
|
5406
|
-
|
|
5407
5468
|
/**
|
|
5408
5469
|
* @public
|
|
5409
5470
|
* An element that renders video content and has positional properties.
|
|
5410
5471
|
*/
|
|
5411
|
-
declare type
|
|
5472
|
+
export declare type VideoElementAtPoint = VideoElement &
|
|
5412
5473
|
Point &
|
|
5413
5474
|
(WidthAndHeight | Width | Height);
|
|
5414
5475
|
|
|
@@ -5416,7 +5477,7 @@ declare type VideoElementAtPoint_2 = VideoElement_2 &
|
|
|
5416
5477
|
* @public
|
|
5417
5478
|
* A video asset that fills a path's interior.
|
|
5418
5479
|
*/
|
|
5419
|
-
declare type VideoFill = {
|
|
5480
|
+
export declare type VideoFill = {
|
|
5420
5481
|
/**
|
|
5421
5482
|
* The type of fill.
|
|
5422
5483
|
*/
|
|
@@ -5434,52 +5495,14 @@ declare type VideoFill = {
|
|
|
5434
5495
|
altText?: AltText;
|
|
5435
5496
|
};
|
|
5436
5497
|
|
|
5437
|
-
/**
|
|
5438
|
-
* @beta
|
|
5439
|
-
* Options for configuring the visible portion of a video.
|
|
5440
|
-
*/
|
|
5441
|
-
export declare type VideoImageBox = {
|
|
5442
|
-
/**
|
|
5443
|
-
* The distance of the image box from the top edge of the video, in pixels.
|
|
5444
|
-
*/
|
|
5445
|
-
top: number;
|
|
5446
|
-
/**
|
|
5447
|
-
* The distance of the image box from the left edge of the video, in pixels.
|
|
5448
|
-
*/
|
|
5449
|
-
left: number;
|
|
5450
|
-
/**
|
|
5451
|
-
* The width of the image box, in pixels.
|
|
5452
|
-
*/
|
|
5453
|
-
width: number;
|
|
5454
|
-
/**
|
|
5455
|
-
* The height of the image box, in pixels.
|
|
5456
|
-
*/
|
|
5457
|
-
height: number;
|
|
5458
|
-
};
|
|
5459
|
-
|
|
5460
5498
|
/**
|
|
5461
5499
|
* @public
|
|
5462
5500
|
* A unique identifier that references a video asset in Canva's backend.
|
|
5463
5501
|
*/
|
|
5464
|
-
declare type VideoRef = string & {
|
|
5502
|
+
export declare type VideoRef = string & {
|
|
5465
5503
|
__videoRef: never;
|
|
5466
5504
|
};
|
|
5467
5505
|
|
|
5468
|
-
/**
|
|
5469
|
-
* @beta
|
|
5470
|
-
* Options for configuring the start and end points for video playback.
|
|
5471
|
-
*/
|
|
5472
|
-
export declare type VideoTrim = {
|
|
5473
|
-
/**
|
|
5474
|
-
* The start point of the video, in milliseconds relative to the start of the source video.
|
|
5475
|
-
*/
|
|
5476
|
-
startMs: number;
|
|
5477
|
-
/**
|
|
5478
|
-
* The end point of the video, in milliseconds relative to the start of the source video.
|
|
5479
|
-
*/
|
|
5480
|
-
endMs: number;
|
|
5481
|
-
};
|
|
5482
|
-
|
|
5483
5506
|
/**
|
|
5484
5507
|
* A set of dimensions with an auto-calculated height.
|
|
5485
5508
|
*/
|
|
@@ -5537,6 +5560,6 @@ declare type WidthAndHeight = {
|
|
|
5537
5560
|
* - `auto` or `never` (default): Files are never zipped together, regardless of count.
|
|
5538
5561
|
* - `always`: Files are always zipped into a single file.
|
|
5539
5562
|
*/
|
|
5540
|
-
declare type ZipBehavior = "auto" | "always" | "never";
|
|
5563
|
+
export declare type ZipBehavior = "auto" | "always" | "never";
|
|
5541
5564
|
|
|
5542
5565
|
export {};
|
|
@@ -9,21 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
get addElementAtPoint () {
|
|
13
|
-
return addElementAtPoint;
|
|
14
|
-
},
|
|
15
|
-
get addPage () {
|
|
16
|
-
return addPage;
|
|
17
|
-
},
|
|
18
12
|
get bulkCreate () {
|
|
19
13
|
return bulkCreate;
|
|
20
14
|
},
|
|
21
15
|
get editContent () {
|
|
22
16
|
return editContent;
|
|
23
17
|
},
|
|
24
|
-
get initAppElement () {
|
|
25
|
-
return initAppElement;
|
|
26
|
-
},
|
|
27
18
|
get openDesign () {
|
|
28
19
|
return openDesign;
|
|
29
20
|
},
|
|
@@ -53,7 +44,4 @@ function editContent(options, callback) {
|
|
|
53
44
|
return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
|
|
54
45
|
}
|
|
55
46
|
const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
56
|
-
|
|
57
|
-
const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
|
|
58
|
-
const addPage = canva_sdk.design.v2.designInteraction.addPage;
|
|
59
|
-
window.__canva__?.sdkRegistration?.registerPackageVersion('design', _version.LATEST_VERSION, 'beta');
|
|
47
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('design', _version.LATEST_VERSION_BETA, 'beta');
|
|
@@ -57,6 +57,13 @@ class FakeBetaDesignInteractionClient extends _fake_design_interaction_client.Fa
|
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
+
constructor(...args){
|
|
61
|
+
super(...args), this.publish = {
|
|
62
|
+
launch: ()=>this.delay()
|
|
63
|
+
}, this.bulkCreate = {
|
|
64
|
+
launch: ()=>this.delay()
|
|
65
|
+
};
|
|
66
|
+
}
|
|
60
67
|
}
|
|
61
68
|
const fakePageRef = {
|
|
62
69
|
type: 'absolute',
|
|
@@ -2,10 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get LATEST_VERSION () {
|
|
8
13
|
return LATEST_VERSION;
|
|
14
|
+
},
|
|
15
|
+
get LATEST_VERSION_ALPHA () {
|
|
16
|
+
return LATEST_VERSION_ALPHA;
|
|
17
|
+
},
|
|
18
|
+
get LATEST_VERSION_BETA () {
|
|
19
|
+
return LATEST_VERSION_BETA;
|
|
9
20
|
}
|
|
10
21
|
});
|
|
11
|
-
const LATEST_VERSION = '2.7.
|
|
22
|
+
const LATEST_VERSION = '2.7.5';
|
|
23
|
+
const LATEST_VERSION_BETA = '2.7.5-beta-1';
|
|
24
|
+
const LATEST_VERSION_ALPHA = 'NONE';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LATEST_VERSION_BETA } from './version';
|
|
2
2
|
const { canva_sdk } = window;
|
|
3
3
|
export const publish = canva_sdk.design.v2.designInteraction.publish;
|
|
4
4
|
export const bulkCreate = canva_sdk.design.v2.designInteraction.bulkCreate;
|
|
@@ -6,8 +6,5 @@ export function editContent(options, callback) {
|
|
|
6
6
|
return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
|
|
7
7
|
}
|
|
8
8
|
export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
9
|
-
export const addElementAtPoint = canva_sdk.design.v2.designInteraction.addElementAtPoint;
|
|
10
|
-
export const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
|
|
11
|
-
export const addPage = canva_sdk.design.v2.designInteraction.addPage;
|
|
12
9
|
export * from './public';
|
|
13
|
-
window.__canva__?.sdkRegistration?.registerPackageVersion('design',
|
|
10
|
+
window.__canva__?.sdkRegistration?.registerPackageVersion('design', LATEST_VERSION_BETA, 'beta');
|
|
@@ -47,6 +47,13 @@ class FakeBetaDesignInteractionClient extends FakeDesignInteractionClient {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
+
constructor(...args){
|
|
51
|
+
super(...args), this.publish = {
|
|
52
|
+
launch: ()=>this.delay()
|
|
53
|
+
}, this.bulkCreate = {
|
|
54
|
+
launch: ()=>this.delay()
|
|
55
|
+
};
|
|
56
|
+
}
|
|
50
57
|
}
|
|
51
58
|
const fakePageRef = {
|
|
52
59
|
type: 'absolute',
|