@canva/intents 2.1.0 → 2.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.1.2 - 2026-02-03
4
+
5
+ ### Fixed
6
+
7
+ - Fix missing id and status fields in Content Publisher email preview type
8
+
9
+ ## 2.1.1 - 2026-01-30
10
+
11
+ ### Changed
12
+
13
+ - Update NPM readme
14
+
3
15
  ## 2.1.0 - 2026-01-30
4
16
 
5
17
  ### Added
package/README.md CHANGED
@@ -22,6 +22,7 @@ An "intent" represents a specific user workflow an app can support. For example:
22
22
 
23
23
  - Users can select and import data from an app which implements the **Data Connector** intent.
24
24
  - An app is able to present interactive and creative tooling alongside the Canva design surface by implementing the **Design Editor** intent.
25
+ - Users can publish their Canva designs directly to external platforms.
25
26
 
26
27
  The `@canva/intents` package encompasses **all available intents**, exporting each intent's type information and prepare function, grouped by domain.
27
28
  This allows your app to prepare one or more intents while keeping each intent's implementation modular and type-safe.
@@ -30,6 +31,7 @@ Currently supported intents:
30
31
 
31
32
  - [`Data Connector`](#data-connector-example)
32
33
  - [`Design Editor`](#design-editor-example)
34
+ - [`Content Publisher`](#content-publisher-example)
33
35
 
34
36
  New intents will be added to this package in the future.
35
37
 
@@ -97,6 +99,69 @@ prepareDesignEditor({
97
99
  });
98
100
  ```
99
101
 
102
+ ### Content Publisher example
103
+
104
+ ```ts
105
+ import { prepareContentPublisher } from "@canva/intents/content";
106
+
107
+ prepareContentPublisher({
108
+ renderSettingsUi: ({
109
+ updatePublishSettings,
110
+ registerOnContextChange,
111
+ }) => {
112
+ root.render(
113
+ <AppUiProvider>
114
+ <SettingUi
115
+ updatePublishSettings={updatePublishSettings}
116
+ registerOnContextChange={registerOnContextChange}
117
+ />
118
+ </AppUiProvider>,
119
+ );
120
+ },
121
+
122
+ renderPreviewUi: ({ registerOnPreviewChange }) => {
123
+ root.render(
124
+ <AppUiProvider>
125
+ <PreviewUi registerOnPreviewChange={registerOnPreviewChange} />
126
+ </AppUiProvider>,
127
+ );
128
+ },
129
+
130
+ getPublishConfiguration: async () => {
131
+ return {
132
+ status: "completed",
133
+ outputTypes: [
134
+ {
135
+ id: "post",
136
+ displayName: "Post",
137
+ mediaSlots: [
138
+ {
139
+ id: "media",
140
+ displayName: "Media",
141
+ fileCount: { exact: 1 },
142
+ accepts: {
143
+ image: {
144
+ format: "png",
145
+ },
146
+ },
147
+ },
148
+ ],
149
+ },
150
+ ],
151
+ };
152
+ },
153
+
154
+ publishContent: async (request: PublishContentRequest) => {
155
+ // logic to upload media to your platform here
156
+ return {
157
+ status: "completed",
158
+ externalId: "1234567890",
159
+ externalUrl: "https://example.com/posts/1234567890",
160
+ };
161
+ },
162
+ });
163
+ ```
164
+
100
165
  ## Related packages
101
166
 
102
167
  The Apps SDK is made up of the following packages:
@@ -413,6 +413,13 @@ export declare interface DocumentRequirement extends BaseFileRequirement {
413
413
  */
414
414
  export declare type DocumentSize = 'a4' | 'a3' | 'letter' | 'legal';
415
415
 
416
+ /**
417
+ * Email preview stub used before beta preview type is fully supported.
418
+ */
419
+ declare interface EmailPreviewStub extends BasePreview {
420
+ kind: 'email';
421
+ }
422
+
416
423
  /**
417
424
  * @public
418
425
  *
@@ -812,9 +819,7 @@ export declare const prepareContentPublisher: (implementation: ContentPublisherI
812
819
  *
813
820
  * Check the `kind` and `status` properties to determine the type and state.
814
821
  */
815
- export declare type Preview = ImagePreview | VideoPreview | DocumentPreview | {
816
- kind: 'email';
817
- };
822
+ export declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreviewStub;
818
823
 
819
824
  /**
820
825
  * @public
@@ -1081,6 +1086,7 @@ export declare type RemoteRequestFailedError = {
1081
1086
  * Provides callbacks for managing preview media and responding to preview updates.
1082
1087
  */
1083
1088
  export declare type RenderPreviewUiRequest = {
1089
+
1084
1090
  /**
1085
1091
  * Callback to upgrade video thumbnail previews to full video media.
1086
1092
  *
@@ -1150,6 +1156,7 @@ export declare type RenderPreviewUiRequest = {
1150
1156
  * a custom publish settings interface where users configure platform-specific options.
1151
1157
  */
1152
1158
  export declare type RenderSettingsUiRequest = {
1159
+
1153
1160
  /**
1154
1161
  * Callback to save and validate the user's publish settings.
1155
1162
  *
package/index.d.ts CHANGED
@@ -1053,6 +1053,13 @@ declare interface DocumentRequirement extends BaseFileRequirement {
1053
1053
  */
1054
1054
  declare type DocumentSize = 'a4' | 'a3' | 'letter' | 'legal';
1055
1055
 
1056
+ /**
1057
+ * Email preview stub used before beta preview type is fully supported.
1058
+ */
1059
+ declare interface EmailPreviewStub extends BasePreview {
1060
+ kind: 'email';
1061
+ }
1062
+
1056
1063
  /**
1057
1064
  * @public
1058
1065
  *
@@ -1938,9 +1945,7 @@ declare const prepareDesignEditor: (implementation: DesignEditorIntent) => void;
1938
1945
  *
1939
1946
  * Check the `kind` and `status` properties to determine the type and state.
1940
1947
  */
1941
- declare type Preview = ImagePreview | VideoPreview | DocumentPreview | {
1942
- kind: 'email';
1943
- };
1948
+ declare type Preview = ImagePreview | VideoPreview | DocumentPreview | EmailPreviewStub;
1944
1949
 
1945
1950
  /**
1946
1951
  * @public
@@ -2222,6 +2227,7 @@ declare type RemoteRequestFailedError_2 = {
2222
2227
  * Provides callbacks for managing preview media and responding to preview updates.
2223
2228
  */
2224
2229
  declare type RenderPreviewUiRequest = {
2230
+
2225
2231
  /**
2226
2232
  * Callback to upgrade video thumbnail previews to full video media.
2227
2233
  *
@@ -2337,6 +2343,7 @@ declare type RenderSelectionUiRequest = {
2337
2343
  * a custom publish settings interface where users configure platform-specific options.
2338
2344
  */
2339
2345
  declare type RenderSettingsUiRequest = {
2346
+
2340
2347
  /**
2341
2348
  * Callback to save and validate the user's publish settings.
2342
2349
  *
@@ -19,6 +19,6 @@ _export(exports, {
19
19
  return LATEST_VERSION_BETA;
20
20
  }
21
21
  });
22
- const LATEST_VERSION = '2.1.0';
22
+ const LATEST_VERSION = '2.1.2';
23
23
  const LATEST_VERSION_BETA = '2.0.2-beta.3';
24
24
  const LATEST_VERSION_ALPHA = 'NONE';
@@ -1,3 +1,3 @@
1
- export const LATEST_VERSION = '2.1.0';
1
+ export const LATEST_VERSION = '2.1.2';
2
2
  export const LATEST_VERSION_BETA = '2.0.2-beta.3';
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.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "The Canva Apps SDK Intents library",
5
5
  "author": "Canva Pty Ltd.",
6
6
  "license": "SEE LICENSE IN LICENSE.md FILE",