@canva/intents 2.0.2-beta.3 → 2.1.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 +21 -0
- package/README.md +65 -0
- package/asset/index.d.ts +1 -1
- package/content/index.d.ts +1440 -1
- package/data/index.d.ts +1229 -1
- package/design/index.d.ts +41 -1
- package/index.d.ts +2821 -1
- package/lib/cjs/sdk/intents/asset/index.js +1 -15
- package/lib/cjs/sdk/intents/content/index.js +4 -2
- package/lib/cjs/sdk/intents/content/{beta.js → public.js} +0 -2
- package/lib/cjs/sdk/intents/fake/create.js +3 -0
- package/lib/cjs/sdk/intents/index.js +4 -2
- package/lib/cjs/sdk/intents/public.js +8 -4
- package/lib/cjs/sdk/intents/version.js +17 -4
- package/lib/esm/sdk/intents/asset/index.js +1 -1
- package/lib/esm/sdk/intents/content/index.js +3 -1
- package/lib/esm/sdk/intents/content/public.js +2 -0
- package/lib/esm/sdk/intents/fake/create.js +3 -0
- package/lib/esm/sdk/intents/index.js +3 -1
- package/lib/esm/sdk/intents/public.js +2 -1
- package/lib/esm/sdk/intents/version.js +3 -1
- package/package.json +23 -23
- package/test/index.d.ts +11 -1
- package/asset/beta.d.ts +0 -236
- package/beta.d.ts +0 -1309
- package/content/beta.d.ts +0 -1410
- package/data/beta.d.ts +0 -1242
- package/design/beta.d.ts +0 -43
- package/lib/cjs/sdk/intents/asset/beta.js +0 -14
- package/lib/cjs/sdk/intents/beta.js +0 -20
- package/lib/cjs/sdk/intents/data/beta.js +0 -20
- package/lib/cjs/sdk/intents/design/beta.js +0 -20
- package/lib/cjs/sdk/intents/test/beta.js +0 -18
- package/lib/esm/sdk/intents/asset/beta.js +0 -4
- package/lib/esm/sdk/intents/beta.js +0 -3
- package/lib/esm/sdk/intents/content/beta.js +0 -4
- package/lib/esm/sdk/intents/data/beta.js +0 -3
- package/lib/esm/sdk/intents/design/beta.js +0 -3
- package/lib/esm/sdk/intents/test/beta.js +0 -1
- package/test/beta.d.ts +0 -11
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 2.1.1 - 2026-01-30
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update NPM readme
|
|
8
|
+
|
|
9
|
+
## 2.1.0 - 2026-01-30
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added a CHANGELOG.md to track changes.
|
|
14
|
+
- Added a test harness method `initTestEnvionment` which can be imported from `@canva/intents/test`
|
|
15
|
+
- Promoted the Content Publisher Intent API from beta to general availability
|
|
16
|
+
|
|
17
|
+
## 2.0.0 - 2025-06-12
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- 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.
|
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:
|
package/asset/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { }
|