@canva/intents 2.6.0 → 2.6.1-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.
Files changed (36) hide show
  1. package/CHANGELOG.md +32 -36
  2. package/asset/beta.d.ts +190 -0
  3. package/asset/index.d.ts +1 -1
  4. package/beta.d.ts +3499 -0
  5. package/content/beta.d.ts +2077 -0
  6. package/content/index.d.ts +1 -1801
  7. package/data/beta.d.ts +1229 -0
  8. package/data/index.d.ts +1 -1229
  9. package/design/beta.d.ts +41 -0
  10. package/design/index.d.ts +1 -41
  11. package/index.d.ts +1 -3204
  12. package/lib/cjs/sdk/intents/asset/beta.js +13 -0
  13. package/lib/cjs/sdk/intents/asset/index.js +15 -1
  14. package/lib/cjs/sdk/intents/beta.js +20 -0
  15. package/lib/cjs/sdk/intents/content/beta.js +20 -0
  16. package/lib/cjs/sdk/intents/data/beta.js +20 -0
  17. package/lib/cjs/sdk/intents/design/beta.js +20 -0
  18. package/lib/cjs/sdk/intents/fake/{create.js → create_beta.js} +9 -6
  19. package/lib/cjs/sdk/intents/index.js +2 -4
  20. package/lib/cjs/sdk/intents/test/beta.js +19 -0
  21. package/lib/cjs/sdk/intents/test/index.js +13 -14
  22. package/lib/cjs/sdk/intents/version.js +1 -1
  23. package/lib/esm/sdk/intents/asset/beta.js +3 -0
  24. package/lib/esm/sdk/intents/asset/index.js +1 -1
  25. package/lib/esm/sdk/intents/beta.js +3 -0
  26. package/lib/esm/sdk/intents/content/beta.js +3 -0
  27. package/lib/esm/sdk/intents/data/beta.js +3 -0
  28. package/lib/esm/sdk/intents/design/beta.js +3 -0
  29. package/lib/esm/sdk/intents/fake/{create.js → create_beta.js} +7 -4
  30. package/lib/esm/sdk/intents/index.js +1 -3
  31. package/lib/esm/sdk/intents/test/beta.js +9 -0
  32. package/lib/esm/sdk/intents/test/index.js +1 -9
  33. package/lib/esm/sdk/intents/version.js +1 -1
  34. package/package.json +23 -23
  35. package/test/beta.d.ts +11 -0
  36. package/test/index.d.ts +1 -11
package/CHANGELOG.md CHANGED
@@ -1,70 +1,66 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 2.6.0 - 2026-06-09
3
+ ## 2.6.1-beta.0 - 2026-06-18
4
4
 
5
5
  ### Added
6
6
 
7
- - Promote `DocumentPreviewUpgrading`, `DocumentPreviewReady`, and `DocumentPreviewPage` from beta to public
8
- - The `DocumentPreview` union now includes `upgrading` and `ready` states in the GA package
7
+ - Added `content_export` to the `ContentNoun` type in the content publisher intent
9
8
 
10
- ## 2.5.0 - 2026-04-09
11
-
12
- ### Changed
13
-
14
- - Increased the `publishRef` size limit from 5KB to 32KB, allowing apps to store more complex publishing settings.
9
+ ## 2.5.1-beta.2 - 2026-05-28
15
10
 
16
11
  ### Added
17
12
 
18
- - Add design metadata in MediaSelections
19
- - Enable apps to support transparent PNG exports in publish flow by adding optional allowTransparentBackground capability to ImageRequirement
13
+ - Add multi-page document preview support to Content Publisher
14
+ - Add optional `contentNoun` on Content Publisher `OutputType` so apps can describe what kind of content is published (for example post, email, or publication) and Canva can tailor publish-flow UX accordingly. When omitted, behavior defaults to generic `content`.
15
+ - Add `getContentSummary` action to the Content Publisher
20
16
 
21
- ## 2.4.0 - 2026-03-23
17
+ ## 2.5.1-beta.1 - 2026-05-12
22
18
 
23
19
  ### Added
24
20
 
25
- - Launch the new Email media type to public, enabling publishing and selection of email pages.
26
-
27
- ## 2.3.1 - 2026-03-12
28
-
29
- ### Fixed
30
-
31
- - Re-export data types from the intents/data public API that were accidentally removed during a refactor
32
- - Rename `Selection` type to `MediaSelection` for clarity
21
+ - Promote requestAiContent from alpha to beta
33
22
 
34
- ## 2.3.0 - 2026-03-06
23
+ ## 2.5.1-beta.0 - 2026-04-10
35
24
 
36
- ### Added
25
+ ### Changed
37
26
 
38
- - Promoted `Selection`, `ImageSelection`, `VideoSelection`, `DocumentSelection`, `EmailSelection` types and `MediaSlot.selection` field from beta to public
27
+ - Promotion intents from preview to ga
39
28
 
40
- ## 2.2.0 - 2026-02-06
29
+ ## 2.4.1-beta.0 - 2026-03-30
41
30
 
42
31
  ### Added
43
32
 
44
- - Added invocation context to provide initial state when rendering UIs
33
+ - Added `Selection`, `ImageSelection`, `VideoSelection`, `DocumentSelection`, and `EmailSelection` types representing metadata about user-selected media in a media slot
34
+ - Added optional `selection` field to `MediaSlot`, populated by Canva when returning output types in Settings UI contexts
45
35
 
46
- ## 2.1.2 - 2026-02-03
36
+ ## 2.2.1-beta.1 - 2026-02-27
47
37
 
48
38
  ### Fixed
49
39
 
50
- - Fix missing id and status fields in Content Publisher email preview type
40
+ - Beta PreviewMedia and Preview types now correctly use full EmailPreview variants throughout RenderPreviewUiRequest, PublishPreviewUiInvocationContext, and ContentPublisherIntent.
51
41
 
52
- ## 2.1.1 - 2026-01-30
42
+ ## 2.2.1-beta.0 - 2026-02-24
53
43
 
54
- ### Changed
44
+ ### Added
55
45
 
56
- - Update NPM readme
46
+ - Added new html_standalone publish format for single html files
57
47
 
58
- ## 2.1.0 - 2026-01-30
48
+ ## 2.1.3-beta.0 - 2026-02-03
59
49
 
60
50
  ### Added
61
51
 
62
- - Added a CHANGELOG.md to track changes.
63
- - Added a test harness method `initTestEnvionment` which can be imported from `@canva/intents/test`
64
- - Promoted the Content Publisher Intent API from beta to general availability
52
+ - Added a CHANGELOG.md to track changes
53
+ - **Breaking:** Added enhanced error handling between `publishContent` and the `SettingsUi`
54
+ - Added a new `PublishErrorClearedSettingsUiContext` for when the UI clears an error
55
+ - Include design title in content metadata for the content publisher intent
56
+ - Added `html_bundle` support in content publisher for email media slots
57
+ - Added `InvoctationContext` to provide initial state for content publisher intent
58
+ - Promoted the email requirements in content publisher from alpha to beta
65
59
 
66
- ## 2.0.0 - 2025-06-12
60
+ ### Fixed
67
61
 
68
- ### Added
62
+ - Fixed the `initTestEnvironment` API not mocking some intents
63
+
64
+ ## 2.0.2-beta.3 - 2025-11-11
69
65
 
70
- - Added the new `@canva/intents` package at version `2.0.0` with the brand new [Data Connector](https://www.canva.dev/docs/apps/data-connector/) intent.
66
+ - Initial changelog for the Preview Intents SDK.
@@ -0,0 +1,190 @@
1
+ /**
2
+ * @beta
3
+ * Union of all supported asset types.
4
+ */
5
+ export declare type Asset = ImageAsset | VideoAsset | AudioAsset | DocumentAsset | SheetAsset | GenericAsset;
6
+
7
+ /**
8
+ * @beta
9
+ * Reference to an asset. Used as a unique identifier.
10
+ */
11
+ export declare type AssetRef = string & {
12
+ __assetRef: never;
13
+ };
14
+
15
+ /**
16
+ * @beta
17
+ * Audio asset result structure.
18
+ */
19
+ export declare type AudioAsset = BaseAsset & {
20
+ type: 'audio';
21
+ mimeType: 'audio/mpeg' | 'audio/mp4' | 'audio/x-m4a' | 'audio/mp3' | 'audio/ogg' | 'audio/wav' | 'audio/x-wav' | 'audio/x-pn-wav' | 'audio/wave' | 'audio/vnd.wave' | 'audio/webm';
22
+ };
23
+
24
+ /**
25
+ * @beta
26
+ * Base structure for an asset result.
27
+ */
28
+ export declare type BaseAsset = {
29
+ name: string;
30
+ url: string;
31
+ };
32
+
33
+ /**
34
+ * @beta
35
+ * Document asset result structure.
36
+ */
37
+ export declare type DocumentAsset = BaseAsset & {
38
+ type: 'document';
39
+ parentRef?: AssetRef;
40
+ mimeType: DocumentMimeType;
41
+ };
42
+
43
+ /**
44
+ * @beta
45
+ * Supported mimetype for document assets.
46
+ */
47
+ export declare type DocumentMimeType = 'application/pdf' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'text/plain' | 'text/markdown';
48
+
49
+ /**
50
+ * @beta
51
+ * Request parameters for URL expansion.
52
+ */
53
+ export declare type ExpandUrlRequest = {
54
+ url: string;
55
+ requestConnection: () => Promise<void>;
56
+ };
57
+
58
+ /**
59
+ * @beta
60
+ * Response from URL expansion operation.
61
+ */
62
+ export declare type ExpandUrlResponse = {
63
+ status: 'completed';
64
+ result: ExpandUrlResult;
65
+ } | {
66
+ status: 'not_found';
67
+ };
68
+
69
+ /**
70
+ * @beta
71
+ * Result of completed URL expansion.
72
+ */
73
+ export declare type ExpandUrlResult = {
74
+ ref: UrlExpanderAssetRef;
75
+ };
76
+
77
+ /**
78
+ * @beta
79
+ * Generic asset result structure.
80
+ * A generic asset is any file that is not already covered by other asset types such as ImageAsset etc.
81
+ * It is an error to pass a mime type that is covered by another asset type.
82
+ */
83
+ export declare type GenericAsset = BaseAsset & {
84
+ type: 'generic';
85
+ mimeType: string;
86
+ };
87
+
88
+ /**
89
+ * @beta
90
+ * Completed response from content retrieval operation.
91
+ */
92
+ export declare type GetContentCompletedResponse = {
93
+ status: 'completed';
94
+ result: {
95
+ type: 'asset';
96
+ asset: Asset;
97
+ };
98
+ };
99
+
100
+ /**
101
+ * @beta
102
+ * Error response from content retrieval operation.
103
+ */
104
+ export declare type GetContentErrorResponse = {
105
+ status: 'app_error';
106
+ message: string;
107
+ };
108
+
109
+ /**
110
+ * @beta
111
+ * Request parameters for content retrieval.
112
+ */
113
+ export declare type GetContentRequest = {
114
+ ref: UrlExpanderAssetRef;
115
+ requestConnection: () => Promise<void>;
116
+ };
117
+
118
+ /**
119
+ * @beta
120
+ * Response from content retrieval operation.
121
+ */
122
+ export declare type GetContentResponse = GetContentCompletedResponse | GetContentErrorResponse;
123
+
124
+ /**
125
+ * @beta
126
+ * Image asset result structure.
127
+ */
128
+ export declare type ImageAsset = BaseAsset & {
129
+ type: 'image';
130
+ thumbnailUrl: string;
131
+ parentRef?: AssetRef;
132
+ mimeType: 'image/heic' | 'image/jpeg' | 'image/png' | 'image/svg+xml' | 'image/tiff' | 'image/webp';
133
+ };
134
+
135
+ /**
136
+ * @beta
137
+ *
138
+ * Prepares the `UrlExpanderIntent`.
139
+ */
140
+ export declare const prepareUrlExpander: (implementation: UrlExpanderIntent) => void;
141
+
142
+ /**
143
+ * @beta
144
+ * Sheet asset result structure.
145
+ */
146
+ export declare type SheetAsset = BaseAsset & {
147
+ type: 'sheet';
148
+ parentRef?: AssetRef;
149
+ mimeType: SheetMimeType;
150
+ };
151
+
152
+ /**
153
+ * @beta
154
+ * Supported mimetype for sheet assets.
155
+ */
156
+ export declare type SheetMimeType = 'text/csv' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
157
+
158
+ /**
159
+ * @beta
160
+ * Reference to an asset with metadata.
161
+ */
162
+ export declare type UrlExpanderAssetRef = {
163
+ type: 'asset';
164
+ id: string;
165
+ name: string;
166
+ iconUrl?: string;
167
+ description?: string;
168
+ };
169
+
170
+ /**
171
+ * @beta
172
+ * Intent interface for URL expansion and content retrieval operations.
173
+ */
174
+ export declare type UrlExpanderIntent = {
175
+ expandUrl(request: ExpandUrlRequest): Promise<ExpandUrlResponse>;
176
+ getContent(request: GetContentRequest): Promise<GetContentResponse>;
177
+ };
178
+
179
+ /**
180
+ * @beta
181
+ * Video asset result structure.
182
+ */
183
+ export declare type VideoAsset = BaseAsset & {
184
+ type: 'video';
185
+ thumbnailImageUrl: string;
186
+ parentRef?: AssetRef;
187
+ mimeType: 'video/avi' | 'video/x-msvideo' | 'image/gif' | 'video/x-m4v' | 'video/x-matroska' | 'video/quicktime' | 'video/mp4' | 'video/mpeg' | 'video/webm';
188
+ };
189
+
190
+ export { }
package/asset/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { }
1
+ export * from "./beta";