@canva/intents 2.1.2 → 2.2.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.2.0 - 2026-02-06
4
+
5
+ ### Added
6
+
7
+ - Added invocation context to provide initial state when rendering UIs
8
+
3
9
  ## 2.1.2 - 2026-02-03
4
10
 
5
11
  ### Fixed
@@ -986,6 +986,26 @@ export declare type PublishErrorSettingsUiContext = {
986
986
  */
987
987
  export declare type PublishFileFormat = 'png' | 'jpg' | 'mp4' | 'pdf_standard' | 'html_bundle';
988
988
 
989
+ /**
990
+ * @public
991
+ * Initial payload provided from cache.
992
+ */
993
+ export declare type PublishPreviewUiInvocationContext = {
994
+ /**
995
+ * Initial preview data and context provided when the preview UI is rendered.
996
+ */
997
+ reason: 'publish';
998
+ /**
999
+ * Initial preview media to display
1000
+ * This will only be used for scheduling and not caching
1001
+ */
1002
+ previewMedia?: PreviewMedia[];
1003
+ /** Information about the current output type being previewed */
1004
+ outputType?: OutputType;
1005
+ /** Current publish reference, if available */
1006
+ publishRef?: string;
1007
+ };
1008
+
989
1009
  /**
990
1010
  * @public
991
1011
  * Validation state indicating whether publish settings are complete and valid.
@@ -1055,6 +1075,21 @@ export declare type PublishSettingsSettingsUiContext = {
1055
1075
  outputType: OutputType;
1056
1076
  };
1057
1077
 
1078
+ /**
1079
+ * @public
1080
+ * Initial payload provided from cache.
1081
+ */
1082
+ export declare type PublishSettingsUiInvocationContext = {
1083
+ /**
1084
+ * Initial settings and context provided when the settings UI is rendered.
1085
+ */
1086
+ reason: 'publish';
1087
+ /** Current publish reference to populate the UI, if any exist */
1088
+ publishRef?: string;
1089
+ /** Information about the current output type being configured */
1090
+ outputType?: OutputType;
1091
+ };
1092
+
1058
1093
  /**
1059
1094
  * @public
1060
1095
  * {@link PublishContentError} indicating failure of the remote request to the external platform.
@@ -1079,6 +1114,13 @@ export declare type RemoteRequestFailedError = {
1079
1114
  status: 'remote_request_failed';
1080
1115
  };
1081
1116
 
1117
+ /**
1118
+ * @public
1119
+ * Initial payload provided when the preview UI is rendered.
1120
+ * Contains the preview data and settings needed to initialize the preview interface.
1121
+ */
1122
+ export declare type RenderPreviewUiInvocationContext = PublishPreviewUiInvocationContext;
1123
+
1082
1124
  /**
1083
1125
  * @public
1084
1126
  * Configuration required for rendering the preview UI.
@@ -1086,7 +1128,14 @@ export declare type RemoteRequestFailedError = {
1086
1128
  * Provides callbacks for managing preview media and responding to preview updates.
1087
1129
  */
1088
1130
  export declare type RenderPreviewUiRequest = {
1089
-
1131
+ /**
1132
+ * @public
1133
+ * The initial preview data and context provided when the preview UI is rendered.
1134
+ *
1135
+ * Contains the initial preview media, output type information, and any existing
1136
+ * publish settings needed to properly display the preview interface.
1137
+ */
1138
+ invocationContext: RenderPreviewUiInvocationContext;
1090
1139
  /**
1091
1140
  * Callback to upgrade video thumbnail previews to full video media.
1092
1141
  *
@@ -1148,6 +1197,13 @@ export declare type RenderPreviewUiRequest = {
1148
1197
  }) => void) => Disposer;
1149
1198
  };
1150
1199
 
1200
+ /**
1201
+ * @public
1202
+ * Initial payload provided when the publish settings UI is rendered.
1203
+ * Contains the current settings state needed to initialize the settings interface.
1204
+ */
1205
+ export declare type RenderSettingsUiInvocationContext = PublishSettingsUiInvocationContext;
1206
+
1151
1207
  /**
1152
1208
  * @public
1153
1209
  * Configuration for the publish settings UI.
@@ -1156,7 +1212,14 @@ export declare type RenderPreviewUiRequest = {
1156
1212
  * a custom publish settings interface where users configure platform-specific options.
1157
1213
  */
1158
1214
  export declare type RenderSettingsUiRequest = {
1159
-
1215
+ /**
1216
+ * @public
1217
+ * The initial settings and context provided when the settings UI is rendered.
1218
+ *
1219
+ * Contains any previously saved publish settings and information about the current output type being configured.
1220
+ * Use this to restore the UI to its previous state or initialise it with appropriate defaults.
1221
+ */
1222
+ invocationContext: RenderSettingsUiInvocationContext;
1160
1223
  /**
1161
1224
  * Callback to save and validate the user's publish settings.
1162
1225
  *
package/index.d.ts CHANGED
@@ -266,9 +266,13 @@ declare namespace content {
266
266
  export {
267
267
  prepareContentPublisher,
268
268
  ContentPublisherIntent,
269
+ RenderPreviewUiInvocationContext,
270
+ PublishPreviewUiInvocationContext,
269
271
  RenderPreviewUiRequest,
270
272
  Disposer,
271
273
  PublishContentRequest,
274
+ RenderSettingsUiInvocationContext,
275
+ PublishSettingsUiInvocationContext,
272
276
  RenderSettingsUiRequest,
273
277
  OnContextChange,
274
278
  SettingsUiContext,
@@ -2112,6 +2116,26 @@ declare type PublishErrorSettingsUiContext = {
2112
2116
  */
2113
2117
  declare type PublishFileFormat = 'png' | 'jpg' | 'mp4' | 'pdf_standard' | 'html_bundle';
2114
2118
 
2119
+ /**
2120
+ * @public
2121
+ * Initial payload provided from cache.
2122
+ */
2123
+ declare type PublishPreviewUiInvocationContext = {
2124
+ /**
2125
+ * Initial preview data and context provided when the preview UI is rendered.
2126
+ */
2127
+ reason: 'publish';
2128
+ /**
2129
+ * Initial preview media to display
2130
+ * This will only be used for scheduling and not caching
2131
+ */
2132
+ previewMedia?: PreviewMedia[];
2133
+ /** Information about the current output type being previewed */
2134
+ outputType?: OutputType;
2135
+ /** Current publish reference, if available */
2136
+ publishRef?: string;
2137
+ };
2138
+
2115
2139
  /**
2116
2140
  * @public
2117
2141
  * Validation state indicating whether publish settings are complete and valid.
@@ -2181,6 +2205,21 @@ declare type PublishSettingsSettingsUiContext = {
2181
2205
  outputType: OutputType;
2182
2206
  };
2183
2207
 
2208
+ /**
2209
+ * @public
2210
+ * Initial payload provided from cache.
2211
+ */
2212
+ declare type PublishSettingsUiInvocationContext = {
2213
+ /**
2214
+ * Initial settings and context provided when the settings UI is rendered.
2215
+ */
2216
+ reason: 'publish';
2217
+ /** Current publish reference to populate the UI, if any exist */
2218
+ publishRef?: string;
2219
+ /** Information about the current output type being configured */
2220
+ outputType?: OutputType;
2221
+ };
2222
+
2184
2223
  /**
2185
2224
  * @public
2186
2225
  * {@link GetDataTableError} indicating failure to fetch data from the external source.
@@ -2220,6 +2259,13 @@ declare type RemoteRequestFailedError_2 = {
2220
2259
  status: 'remote_request_failed';
2221
2260
  };
2222
2261
 
2262
+ /**
2263
+ * @public
2264
+ * Initial payload provided when the preview UI is rendered.
2265
+ * Contains the preview data and settings needed to initialize the preview interface.
2266
+ */
2267
+ declare type RenderPreviewUiInvocationContext = PublishPreviewUiInvocationContext;
2268
+
2223
2269
  /**
2224
2270
  * @public
2225
2271
  * Configuration required for rendering the preview UI.
@@ -2227,7 +2273,14 @@ declare type RemoteRequestFailedError_2 = {
2227
2273
  * Provides callbacks for managing preview media and responding to preview updates.
2228
2274
  */
2229
2275
  declare type RenderPreviewUiRequest = {
2230
-
2276
+ /**
2277
+ * @public
2278
+ * The initial preview data and context provided when the preview UI is rendered.
2279
+ *
2280
+ * Contains the initial preview media, output type information, and any existing
2281
+ * publish settings needed to properly display the preview interface.
2282
+ */
2283
+ invocationContext: RenderPreviewUiInvocationContext;
2231
2284
  /**
2232
2285
  * Callback to upgrade video thumbnail previews to full video media.
2233
2286
  *
@@ -2335,6 +2388,13 @@ declare type RenderSelectionUiRequest = {
2335
2388
  updateDataRef: (dataSourceRef: DataSourceRef) => Promise<UpdateDataRefResponse>;
2336
2389
  };
2337
2390
 
2391
+ /**
2392
+ * @public
2393
+ * Initial payload provided when the publish settings UI is rendered.
2394
+ * Contains the current settings state needed to initialize the settings interface.
2395
+ */
2396
+ declare type RenderSettingsUiInvocationContext = PublishSettingsUiInvocationContext;
2397
+
2338
2398
  /**
2339
2399
  * @public
2340
2400
  * Configuration for the publish settings UI.
@@ -2343,7 +2403,14 @@ declare type RenderSelectionUiRequest = {
2343
2403
  * a custom publish settings interface where users configure platform-specific options.
2344
2404
  */
2345
2405
  declare type RenderSettingsUiRequest = {
2346
-
2406
+ /**
2407
+ * @public
2408
+ * The initial settings and context provided when the settings UI is rendered.
2409
+ *
2410
+ * Contains any previously saved publish settings and information about the current output type being configured.
2411
+ * Use this to restore the UI to its previous state or initialise it with appropriate defaults.
2412
+ */
2413
+ invocationContext: RenderSettingsUiInvocationContext;
2347
2414
  /**
2348
2415
  * Callback to save and validate the user's publish settings.
2349
2416
  *
@@ -19,6 +19,6 @@ _export(exports, {
19
19
  return LATEST_VERSION_BETA;
20
20
  }
21
21
  });
22
- const LATEST_VERSION = '2.1.2';
23
- const LATEST_VERSION_BETA = '2.0.2-beta.3';
22
+ const LATEST_VERSION = '2.2.0';
23
+ const LATEST_VERSION_BETA = '2.1.3-beta.0';
24
24
  const LATEST_VERSION_ALPHA = 'NONE';
@@ -1,3 +1,3 @@
1
- export const LATEST_VERSION = '2.1.2';
2
- export const LATEST_VERSION_BETA = '2.0.2-beta.3';
1
+ export const LATEST_VERSION = '2.2.0';
2
+ export const LATEST_VERSION_BETA = '2.1.3-beta.0';
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.2",
3
+ "version": "2.2.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",