@canva/design 2.7.4-beta.1 → 2.7.4-beta.2

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 CHANGED
@@ -3327,6 +3327,44 @@ export declare type ExportBlob = {
3327
3327
  url: string;
3328
3328
  };
3329
3329
 
3330
+ /**
3331
+ * @beta
3332
+ * The exported file.
3333
+ */
3334
+ export declare type ExportBlobWithZippedOptionOutput = {
3335
+ /**
3336
+ * The URL of the exported design.
3337
+ *
3338
+ * @remarks
3339
+ * If a user's design contains multiple pages but is exported in a format that doesn't support multiple pages,
3340
+ * by defaultthis URL will point to a ZIP file that contains each page as a separate file.
3341
+ *
3342
+ * If the user has configured the export to not zip the exported files (using the `zipped` property), this URL will point to a single file.
3343
+ *
3344
+ * For example:
3345
+ *
3346
+ * - If a single-page design is exported as a JPG, the URL will point to a JPG file.
3347
+ * - If a multi-page design is exported as a JPG, the URL will point to a ZIP file that contains a JPG file for each page.
3348
+ * - If a multi-page design is exported as a JPG and the user has set `zipped` to `never` for JPGs, the URL will point to a JPG file and will be one of multiple urls in the exportBlobs array.
3349
+ * - If a multi-page design is exported as a PDF file, the URL will point to a PDF file.
3350
+ * - If a multi-page design is exported as a VIDEO file and the user has set `zipped` to `always` for VIDEOs, the URL will point to a ZIP that contains a VIDEO file.
3351
+ *
3352
+ * The following file types support multiple pages:
3353
+ *
3354
+ * - `"GIF"`
3355
+ * - `"PDF_STANDARD"`
3356
+ * - `"PPTX"`
3357
+ * - `"VIDEO"`
3358
+ *
3359
+ * The following file types do not support multiple pages:
3360
+ *
3361
+ * - `"JPG"`
3362
+ * - `"PNG"`
3363
+ * - `"SVG"`
3364
+ */
3365
+ url: string;
3366
+ };
3367
+
3330
3368
  /**
3331
3369
  * @public
3332
3370
  * The result when a user successfully completes an export flow.
@@ -3350,6 +3388,28 @@ export declare type ExportCompleted = {
3350
3388
  exportBlobs: ExportBlob[];
3351
3389
  };
3352
3390
 
3391
+ /**
3392
+ * @beta
3393
+ * The result when a user successfully completes an export flow.
3394
+ */
3395
+ export declare type ExportCompletedWithZippedOptionOutput = {
3396
+ /**
3397
+ * The status of the export flow.
3398
+ */
3399
+ status: "completed";
3400
+ /**
3401
+ * The title of the design, if set by the user.
3402
+ */
3403
+ title?: string;
3404
+ /**
3405
+ * The exported files.
3406
+ *
3407
+ * @remarks
3408
+ * This array can contain a single link either to a file or a ZIP, or multiple links to individual files.
3409
+ */
3410
+ exportBlobs: ExportBlobWithZippedOptionOutput[];
3411
+ };
3412
+
3353
3413
  /**
3354
3414
  * @public
3355
3415
  * The types of files that Canva supports for exported designs.
@@ -3363,6 +3423,19 @@ export declare type ExportFileType =
3363
3423
  | "pptx"
3364
3424
  | "svg";
3365
3425
 
3426
+ /**
3427
+ * @beta
3428
+ * Object representation of the supported file types with properties where applicable.
3429
+ */
3430
+ export declare type ExportFileTypeWithProperties =
3431
+ | {
3432
+ type: "pdf_standard" | "pptx";
3433
+ }
3434
+ | {
3435
+ type: "png" | "jpg" | "video" | "gif" | "svg";
3436
+ zipped?: ZipBehavior;
3437
+ };
3438
+
3366
3439
  /**
3367
3440
  * @public
3368
3441
  * Options for configuring the export of a design.
@@ -3377,12 +3450,34 @@ export declare type ExportRequest = {
3377
3450
  acceptedFileTypes: ExportFileType[];
3378
3451
  };
3379
3452
 
3453
+ /**
3454
+ * @beta
3455
+ * Options for configuring the export of a design.
3456
+ */
3457
+ export declare type ExportRequestWithFileTypeProperties = {
3458
+ /**
3459
+ * The types of files the user can export their design as.
3460
+ *
3461
+ * @remarks
3462
+ * You must provide at least one file type.
3463
+ */
3464
+ acceptedFileTypes: (ExportFileType | ExportFileTypeWithProperties)[];
3465
+ };
3466
+
3380
3467
  /**
3381
3468
  * @public
3382
3469
  * The result of exporting a design.
3383
3470
  */
3384
3471
  export declare type ExportResponse = ExportCompleted | ExportAborted;
3385
3472
 
3473
+ /**
3474
+ * @beta
3475
+ * The result of exporting a design.
3476
+ */
3477
+ export declare type ExportResponseWithZippedOptionOutput =
3478
+ | ExportCompletedWithZippedOptionOutput
3479
+ | ExportAborted;
3480
+
3386
3481
  /**
3387
3482
  * @public
3388
3483
  * Image element or content to be added to the design at the end of a drag event.
@@ -4205,13 +4300,13 @@ declare type Point = {
4205
4300
  declare type Primitive = undefined | null | number | boolean | string;
4206
4301
 
4207
4302
  /**
4208
- * @public
4303
+ * @beta
4209
4304
  * Exports the user's design as one or more static files.
4210
4305
  * @param request - The request object containing configurations of the design export.
4211
4306
  */
4212
4307
  export declare const requestExport: (
4213
- request: ExportRequest,
4214
- ) => Promise<ExportResponse>;
4308
+ request: ExportRequestWithFileTypeProperties,
4309
+ ) => Promise<ExportResponseWithZippedOptionOutput>;
4215
4310
 
4216
4311
  /**
4217
4312
  * @public
@@ -5395,4 +5490,20 @@ declare type WidthAndHeight = {
5395
5490
  height: number;
5396
5491
  };
5397
5492
 
5493
+ /**
5494
+ * @beta
5495
+ * The behavior of zipping the exported files.
5496
+ *
5497
+ * @remarks
5498
+ * For `png`, `jpg`, and `svg`:
5499
+ * - `auto` (default): Files are zipped together if the design has multiple pages, unzipped if it has one page.
5500
+ * - `always`: Files are always zipped into a single zip file, regardless of page count.
5501
+ * - `never`: Files are never zipped, providing an array of files.
5502
+ *
5503
+ * For `video` and `gif`:
5504
+ * - `auto` or `never` (default): Files are never zipped together, regardless of count.
5505
+ * - `always`: Files are always zipped into a single file.
5506
+ */
5507
+ export declare type ZipBehavior = "auto" | "always" | "never";
5508
+
5398
5509
  export {};
@@ -14,6 +14,9 @@ _export(exports, {
14
14
  },
15
15
  get openDesign () {
16
16
  return openDesign;
17
+ },
18
+ get requestExport () {
19
+ return requestExport;
17
20
  }
18
21
  });
19
22
  const _version = require("./version");
@@ -36,4 +39,6 @@ function editContent(options, callback) {
36
39
  return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
37
40
  }
38
41
  const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
42
+ const requestExport = canva_sdk.design.v2.export.requestExport;
39
43
  window.__canva__?.sdkRegistration?.registerPackageVersion('design', _version.LATEST_VERSION, 'beta');
44
+ 'comment';
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "LATEST_VERSION", {
8
8
  return LATEST_VERSION;
9
9
  }
10
10
  });
11
- const LATEST_VERSION = '2.7.3';
11
+ const LATEST_VERSION = '2.7.4';
@@ -4,5 +4,7 @@ export function editContent(options, callback) {
4
4
  return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
5
5
  }
6
6
  export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
7
+ export const requestExport = canva_sdk.design.v2.export.requestExport;
7
8
  export * from './public';
8
9
  window.__canva__?.sdkRegistration?.registerPackageVersion('design', LATEST_VERSION, 'beta');
10
+ 'comment';
@@ -1 +1 @@
1
- export const LATEST_VERSION = '2.7.3';
1
+ export const LATEST_VERSION = '2.7.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "2.7.4-beta.1",
3
+ "version": "2.7.4-beta.2",
4
4
  "description": "The Canva Apps SDK design library",
5
5
  "author": "Canva Pty Ltd.",
6
6
  "license": "SEE LICENSE IN LICENSE.md FILE",