@canva/intents 2.3.1 → 2.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.4.0 - 2026-03-23
4
+
5
+ ### Added
6
+
7
+ - Launch the new Email media type to public, enabling publishing and selection of email pages.
8
+
3
9
  ## 2.3.1 - 2026-03-12
4
10
 
5
11
  ### Fixed
@@ -305,6 +305,7 @@ export declare interface DesignContentMetadata {
305
305
  * The pages that make up the exported metadata
306
306
  */
307
307
  pages: OutputPageMetadata[];
308
+
308
309
  }
309
310
 
310
311
  /**
@@ -422,10 +423,75 @@ export declare type DocumentSelection = {
422
423
  export declare type DocumentSize = 'a4' | 'a3' | 'letter' | 'legal';
423
424
 
424
425
  /**
425
- * Email preview stub used before beta preview type is fully supported.
426
+ * @public
427
+ * Exported email file ready for publishing.
428
+ *
429
+ * Contains the final HTML bundle that should be uploaded to your platform.
430
+ */
431
+ export declare type EmailOutputFile = BaseOutputFile;
432
+
433
+ /**
434
+ * @public
435
+ * Email preview in various states.
436
+ *
437
+ * Display a loading state until the preview transitions to `"ready"` or `"error"`.
438
+ */
439
+ export declare type EmailPreview = EmailPreviewLoading | EmailPreviewReady | EmailPreviewError;
440
+
441
+ /**
442
+ * @public
443
+ * Email preview in an error state.
444
+ *
445
+ * Display an error state to the user.
446
+ */
447
+ export declare interface EmailPreviewError extends BasePreview {
448
+ kind: 'email';
449
+ status: 'error';
450
+ message: string;
451
+ }
452
+
453
+ /**
454
+ * @public
455
+ * Email preview in a loading state.
456
+ *
457
+ * Display a loading spinner until the preview transitions to `"ready"` or `"error"`.
458
+ */
459
+ export declare interface EmailPreviewLoading extends BasePreview {
460
+ kind: 'email';
461
+ status: 'loading';
462
+ }
463
+
464
+ /**
465
+ * @public
466
+ * Email preview in a ready state.
467
+ *
468
+ * Display the email preview.
426
469
  */
427
- declare interface EmailPreviewStub extends BasePreview {
470
+ export declare interface EmailPreviewReady extends BasePreview {
428
471
  kind: 'email';
472
+ status: 'ready';
473
+ /**
474
+ * URL to the single html file that represents the email.
475
+ */
476
+ url: string;
477
+ }
478
+
479
+ /**
480
+ * @public
481
+ * Email file requirements for a media slot, currently only supports HTML bundle format.
482
+ *
483
+ * Note: Email output types use html_standalone previews in the preview UI.
484
+ * The actual email file is only generated for the final output in OutputMedia.
485
+ *
486
+ * @example Email bundle requirements
487
+ * ```ts
488
+ * const emailReq: EmailRequirement = {
489
+ * format: 'html_bundle',
490
+ * };
491
+ * ```
492
+ */
493
+ export declare interface EmailRequirement extends BaseFileRequirement {
494
+ format: 'html_bundle' | 'html_standalone';
429
495
  }
430
496
 
431
497
  /**
@@ -667,7 +733,10 @@ export declare type MediaSlot = {
667
733
  image?: ImageRequirement;
668
734
  video?: VideoRequirement;
669
735
  document?: DocumentRequirement;
670
-
736
+ /**
737
+ * Email output types will show a single html file (canva hosted assets) preview in preview UI
738
+ */
739
+ email?: EmailRequirement;
671
740
  };
672
741
  /**
673
742
  * @public
@@ -914,7 +983,7 @@ export declare const prepareContentPublisher: (implementation: ContentPublisherI
914
983
  *
915
984
  * Check the `kind` and `status` properties to determine the type and state.
916
985
  */
917
- export declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreviewStub;
986
+ export declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreview;
918
987
 
919
988
  /**
920
989
  * @public
@@ -1378,6 +1447,7 @@ export declare type RenderSettingsUiRequest = {
1378
1447
  registerOnContextChange: (opts: {
1379
1448
  onContextChange: OnContextChange;
1380
1449
  }) => Disposer;
1450
+
1381
1451
  };
1382
1452
 
1383
1453
  /**
package/index.d.ts CHANGED
@@ -267,6 +267,12 @@ declare namespace content {
267
267
  prepareContentPublisher,
268
268
  Disposer,
269
269
  PublishContentRequest,
270
+ Preview,
271
+ PreviewMedia,
272
+ RenderPreviewUiInvocationContext,
273
+ PublishPreviewUiInvocationContext,
274
+ RenderPreviewUiRequest,
275
+ ContentPublisherIntent,
270
276
  RenderSettingsUiInvocationContext,
271
277
  PublishSettingsUiInvocationContext,
272
278
  RenderSettingsUiRequest,
@@ -297,6 +303,7 @@ declare namespace content {
297
303
  ImageRequirement,
298
304
  VideoRequirement,
299
305
  DocumentRequirement,
306
+ EmailRequirement,
300
307
  MediaSelection,
301
308
  ImageSelection,
302
309
  VideoSelection,
@@ -323,6 +330,10 @@ declare namespace content {
323
330
  VideoPreviewUpgrading,
324
331
  VideoPreviewReady,
325
332
  VideoPreviewError,
333
+ EmailPreview,
334
+ EmailPreviewLoading,
335
+ EmailPreviewReady,
336
+ EmailPreviewError,
326
337
  BasePreview,
327
338
  SizedPreview,
328
339
  PreviewKind,
@@ -333,15 +344,10 @@ declare namespace content {
333
344
  VideoOutputFile,
334
345
  BaseOutputFile,
335
346
  DocumentOutputFile,
347
+ EmailOutputFile,
336
348
  ContentMetadata,
337
349
  DesignContentMetadata,
338
- OutputPageMetadata,
339
- Preview,
340
- PreviewMedia,
341
- RenderPreviewUiInvocationContext,
342
- PublishPreviewUiInvocationContext,
343
- RenderPreviewUiRequest,
344
- ContentPublisherIntent
350
+ OutputPageMetadata
345
351
  }
346
352
  }
347
353
  export { content }
@@ -918,6 +924,7 @@ declare interface DesignContentMetadata {
918
924
  * The pages that make up the exported metadata
919
925
  */
920
926
  pages: OutputPageMetadata[];
927
+
921
928
  }
922
929
 
923
930
  /**
@@ -1072,10 +1079,75 @@ declare type DocumentSelection = {
1072
1079
  declare type DocumentSize = 'a4' | 'a3' | 'letter' | 'legal';
1073
1080
 
1074
1081
  /**
1075
- * Email preview stub used before beta preview type is fully supported.
1082
+ * @public
1083
+ * Exported email file ready for publishing.
1084
+ *
1085
+ * Contains the final HTML bundle that should be uploaded to your platform.
1086
+ */
1087
+ declare type EmailOutputFile = BaseOutputFile;
1088
+
1089
+ /**
1090
+ * @public
1091
+ * Email preview in various states.
1092
+ *
1093
+ * Display a loading state until the preview transitions to `"ready"` or `"error"`.
1094
+ */
1095
+ declare type EmailPreview = EmailPreviewLoading | EmailPreviewReady | EmailPreviewError;
1096
+
1097
+ /**
1098
+ * @public
1099
+ * Email preview in an error state.
1100
+ *
1101
+ * Display an error state to the user.
1102
+ */
1103
+ declare interface EmailPreviewError extends BasePreview {
1104
+ kind: 'email';
1105
+ status: 'error';
1106
+ message: string;
1107
+ }
1108
+
1109
+ /**
1110
+ * @public
1111
+ * Email preview in a loading state.
1112
+ *
1113
+ * Display a loading spinner until the preview transitions to `"ready"` or `"error"`.
1076
1114
  */
1077
- declare interface EmailPreviewStub extends BasePreview {
1115
+ declare interface EmailPreviewLoading extends BasePreview {
1078
1116
  kind: 'email';
1117
+ status: 'loading';
1118
+ }
1119
+
1120
+ /**
1121
+ * @public
1122
+ * Email preview in a ready state.
1123
+ *
1124
+ * Display the email preview.
1125
+ */
1126
+ declare interface EmailPreviewReady extends BasePreview {
1127
+ kind: 'email';
1128
+ status: 'ready';
1129
+ /**
1130
+ * URL to the single html file that represents the email.
1131
+ */
1132
+ url: string;
1133
+ }
1134
+
1135
+ /**
1136
+ * @public
1137
+ * Email file requirements for a media slot, currently only supports HTML bundle format.
1138
+ *
1139
+ * Note: Email output types use html_standalone previews in the preview UI.
1140
+ * The actual email file is only generated for the final output in OutputMedia.
1141
+ *
1142
+ * @example Email bundle requirements
1143
+ * ```ts
1144
+ * const emailReq: EmailRequirement = {
1145
+ * format: 'html_bundle',
1146
+ * };
1147
+ * ```
1148
+ */
1149
+ declare interface EmailRequirement extends BaseFileRequirement {
1150
+ format: 'html_bundle' | 'html_standalone';
1079
1151
  }
1080
1152
 
1081
1153
  /**
@@ -1609,7 +1681,10 @@ declare type MediaSlot = {
1609
1681
  image?: ImageRequirement;
1610
1682
  video?: VideoRequirement;
1611
1683
  document?: DocumentRequirement;
1612
-
1684
+ /**
1685
+ * Email output types will show a single html file (canva hosted assets) preview in preview UI
1686
+ */
1687
+ email?: EmailRequirement;
1613
1688
  };
1614
1689
  /**
1615
1690
  * @public
@@ -2050,7 +2125,7 @@ declare const prepareDesignEditor: (implementation: DesignEditorIntent) => void;
2050
2125
  *
2051
2126
  * Check the `kind` and `status` properties to determine the type and state.
2052
2127
  */
2053
- declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreviewStub;
2128
+ declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreview;
2054
2129
 
2055
2130
  /**
2056
2131
  * @public
@@ -2575,6 +2650,7 @@ declare type RenderSettingsUiRequest = {
2575
2650
  registerOnContextChange: (opts: {
2576
2651
  onContextChange: OnContextChange;
2577
2652
  }) => Disposer;
2653
+
2578
2654
  };
2579
2655
 
2580
2656
  /**
@@ -19,6 +19,6 @@ _export(exports, {
19
19
  return LATEST_VERSION_BETA;
20
20
  }
21
21
  });
22
- const LATEST_VERSION = '2.3.1';
22
+ const LATEST_VERSION = '2.4.0';
23
23
  const LATEST_VERSION_BETA = '2.2.1-beta.1';
24
24
  const LATEST_VERSION_ALPHA = 'NONE';
@@ -1,3 +1,3 @@
1
- export const LATEST_VERSION = '2.3.1';
1
+ export const LATEST_VERSION = '2.4.0';
2
2
  export const LATEST_VERSION_BETA = '2.2.1-beta.1';
3
3
  export const LATEST_VERSION_ALPHA = 'NONE';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/intents",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "The Canva Apps SDK Intents library",
5
5
  "author": "Canva Pty Ltd.",
6
6
  "license": "SEE LICENSE IN LICENSE.md FILE",