@canva/intents 2.2.0 → 2.2.1-beta.1
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 +18 -18
- package/asset/beta.d.ts +190 -0
- package/asset/index.d.ts +1 -1
- package/beta.d.ts +2963 -0
- package/content/beta.d.ts +1567 -0
- package/content/index.d.ts +1 -1510
- package/data/beta.d.ts +1229 -0
- package/data/index.d.ts +1 -1229
- package/design/beta.d.ts +41 -0
- package/design/index.d.ts +1 -41
- package/index.d.ts +1 -2895
- package/lib/cjs/sdk/intents/asset/beta.js +13 -0
- package/lib/cjs/sdk/intents/asset/index.js +15 -1
- package/lib/cjs/sdk/intents/beta.js +20 -0
- package/lib/cjs/sdk/intents/content/beta.js +27 -0
- package/lib/cjs/sdk/intents/content/public.js +0 -1
- package/lib/cjs/sdk/intents/data/beta.js +20 -0
- package/lib/cjs/sdk/intents/data/public.js +0 -1
- package/lib/cjs/sdk/intents/design/beta.js +20 -0
- package/lib/cjs/sdk/intents/design/public.js +0 -1
- package/lib/cjs/sdk/intents/fake/{create.js → create_beta.js} +9 -6
- package/lib/cjs/sdk/intents/index.js +2 -4
- package/lib/cjs/sdk/intents/test/beta.js +19 -0
- package/lib/cjs/sdk/intents/test/index.js +13 -14
- package/lib/cjs/sdk/intents/version.js +1 -1
- package/lib/esm/sdk/intents/asset/beta.js +3 -0
- package/lib/esm/sdk/intents/asset/index.js +1 -1
- package/lib/esm/sdk/intents/beta.js +3 -0
- package/lib/esm/sdk/intents/content/beta.js +4 -0
- package/lib/esm/sdk/intents/content/public.js +0 -1
- package/lib/esm/sdk/intents/data/beta.js +3 -0
- package/lib/esm/sdk/intents/data/public.js +0 -1
- package/lib/esm/sdk/intents/design/beta.js +3 -0
- package/lib/esm/sdk/intents/design/public.js +0 -1
- package/lib/esm/sdk/intents/fake/{create.js → create_beta.js} +7 -4
- package/lib/esm/sdk/intents/index.js +1 -3
- package/lib/esm/sdk/intents/test/beta.js +9 -0
- package/lib/esm/sdk/intents/test/index.js +1 -9
- package/lib/esm/sdk/intents/version.js +1 -1
- package/package.json +23 -23
- package/test/beta.d.ts +11 -0
- package/test/index.d.ts +1 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
## 2.2.
|
|
4
|
-
|
|
5
|
-
### Added
|
|
6
|
-
|
|
7
|
-
- Added invocation context to provide initial state when rendering UIs
|
|
8
|
-
|
|
9
|
-
## 2.1.2 - 2026-02-03
|
|
3
|
+
## 2.2.1-beta.1 - 2026-02-27
|
|
10
4
|
|
|
11
5
|
### Fixed
|
|
12
6
|
|
|
13
|
-
-
|
|
7
|
+
- Beta PreviewMedia and Preview types now correctly use full EmailPreview variants throughout RenderPreviewUiRequest, PublishPreviewUiInvocationContext, and ContentPublisherIntent.
|
|
14
8
|
|
|
15
|
-
## 2.1.
|
|
9
|
+
## 2.2.1-beta.0 - 2026-02-24
|
|
16
10
|
|
|
17
|
-
###
|
|
11
|
+
### Added
|
|
18
12
|
|
|
19
|
-
-
|
|
13
|
+
- Added new html_standalone publish format for single html files
|
|
20
14
|
|
|
21
|
-
## 2.1.0 - 2026-
|
|
15
|
+
## 2.1.3-beta.0 - 2026-02-03
|
|
22
16
|
|
|
23
17
|
### Added
|
|
24
18
|
|
|
25
|
-
- Added a CHANGELOG.md to track changes
|
|
26
|
-
- Added
|
|
27
|
-
-
|
|
19
|
+
- Added a CHANGELOG.md to track changes
|
|
20
|
+
- **Breaking:** Added enhanced error handling between `publishContent` and the `SettingsUi`
|
|
21
|
+
- Added a new `PublishErrorClearedSettingsUiContext` for when the UI clears an error
|
|
22
|
+
- Include design title in content metadata for the content publisher intent
|
|
23
|
+
- Added `html_bundle` support in content publisher for email media slots
|
|
24
|
+
- Added `InvoctationContext` to provide initial state for content publisher intent
|
|
25
|
+
- Promoted the email requirements in content publisher from alpha to beta
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
- Fixed the `initTestEnvironment` API not mocking some intents
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## 2.0.2-beta.3 - 2025-11-11
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- Initial changelog for the Preview Intents SDK.
|
package/asset/beta.d.ts
ADDED
|
@@ -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";
|