@canva/design 1.6.0 → 1.7.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/index.d.ts +15 -4
- package/lib/cjs/sdk/design/public.js +9 -1
- package/lib/esm/sdk/design/public.js +7 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -97,10 +97,7 @@ export declare type AppElementRenderer<A extends AppElementData> = (
|
|
|
97
97
|
* A return value of {@link AppElementRenderer} function.
|
|
98
98
|
* It is an array of elements to render within an app element.
|
|
99
99
|
*/
|
|
100
|
-
export declare type AppElementRendererOutput =
|
|
101
|
-
NativeSimpleElementWithBox,
|
|
102
|
-
NativeVideoElementWithBox
|
|
103
|
-
>[];
|
|
100
|
+
export declare type AppElementRendererOutput = NativeSimpleElementWithBox[];
|
|
104
101
|
|
|
105
102
|
/**
|
|
106
103
|
* @public
|
|
@@ -231,6 +228,14 @@ export declare type DesignSelection = {
|
|
|
231
228
|
}): () => void;
|
|
232
229
|
};
|
|
233
230
|
|
|
231
|
+
/**
|
|
232
|
+
* @public
|
|
233
|
+
* JWT that contains the Design ID and App ID.
|
|
234
|
+
*/
|
|
235
|
+
export declare type DesignToken = {
|
|
236
|
+
token: string;
|
|
237
|
+
};
|
|
238
|
+
|
|
234
239
|
/**
|
|
235
240
|
* @public
|
|
236
241
|
* Represents a width and a height.
|
|
@@ -537,6 +542,12 @@ export declare function getDefaultPageDimensions(): Promise<
|
|
|
537
542
|
Dimensions | undefined
|
|
538
543
|
>;
|
|
539
544
|
|
|
545
|
+
/**
|
|
546
|
+
* @public
|
|
547
|
+
* Retrieves a signed JWT that contains the Design ID, App ID and User ID.
|
|
548
|
+
*/
|
|
549
|
+
export declare function getDesignToken(): Promise<DesignToken>;
|
|
550
|
+
|
|
540
551
|
declare type Height = {
|
|
541
552
|
width: "auto";
|
|
542
553
|
height: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initAppElement = exports.getCurrentPageContext = exports.addAudioTrack = exports.addNativeElement = exports.ui = exports.requestExport = exports.getDefaultPageDimensions = exports.setCurrentPageBackground = exports.addPage = exports.selection = void 0;
|
|
3
|
+
exports.getDesignToken = exports.initAppElement = exports.getCurrentPageContext = exports.addAudioTrack = exports.addNativeElement = exports.ui = exports.requestExport = exports.getDefaultPageDimensions = exports.setCurrentPageBackground = exports.addPage = exports.selection = void 0;
|
|
4
4
|
const { canva } = window;
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
@@ -87,3 +87,11 @@ function initAppElement(appElementConfig) {
|
|
|
87
87
|
return canva.designInteraction.initAppElement(appElementConfig);
|
|
88
88
|
}
|
|
89
89
|
exports.initAppElement = initAppElement;
|
|
90
|
+
/**
|
|
91
|
+
* @public
|
|
92
|
+
* Retrieves a signed JWT that contains the Design ID, App ID and User ID.
|
|
93
|
+
*/
|
|
94
|
+
function getDesignToken() {
|
|
95
|
+
return canva.designInteraction.getDesignToken();
|
|
96
|
+
}
|
|
97
|
+
exports.getDesignToken = getDesignToken;
|
|
@@ -76,3 +76,10 @@ export function getCurrentPageContext() {
|
|
|
76
76
|
export function initAppElement(appElementConfig) {
|
|
77
77
|
return canva.designInteraction.initAppElement(appElementConfig);
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* @public
|
|
81
|
+
* Retrieves a signed JWT that contains the Design ID, App ID and User ID.
|
|
82
|
+
*/
|
|
83
|
+
export function getDesignToken() {
|
|
84
|
+
return canva.designInteraction.getDesignToken();
|
|
85
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/design",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "The Canva Apps SDK design library",
|
|
5
5
|
"author": "Canva Pty Ltd.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md FILE",
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"typings": "./index.d.ts"
|
|
19
|
-
}
|
|
19
|
+
}
|