@canva/design 2.6.1-beta.1 → 2.6.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/{beta.d.ts → index.d.ts} +5 -98
- package/lib/cjs/sdk/design/{beta.js → index.js} +2 -10
- package/lib/esm/sdk/design/{beta.js → index.js} +1 -3
- package/package.json +10 -10
- package/lib/cjs/sdk/design/test/beta.js +0 -18
- package/lib/esm/sdk/design/test/beta.js +0 -1
- /package/test/{beta.d.ts → index.d.ts} +0 -0
package/{beta.d.ts → index.d.ts}
RENAMED
|
@@ -348,39 +348,11 @@ export declare interface ContentDraft<T> {
|
|
|
348
348
|
save(): Promise<void>;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
/**
|
|
352
|
-
* @beta
|
|
353
|
-
* Object for interacting with fill content (images/videos).
|
|
354
|
-
*/
|
|
355
|
-
export declare type ContentFill = (
|
|
356
|
-
| Omit<ImageFill, "altText">
|
|
357
|
-
| Omit<VideoFill, "altText">
|
|
358
|
-
) & {
|
|
359
|
-
/**
|
|
360
|
-
* Indicates whether the fill object has been deleted.
|
|
361
|
-
*/
|
|
362
|
-
deleted: boolean;
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* @beta
|
|
367
|
-
* Session for reading and updating fill content in a user's design.
|
|
368
|
-
*/
|
|
369
|
-
export declare interface ContentFillSession {
|
|
370
|
-
readonly contents: readonly ContentFill[];
|
|
371
|
-
sync(): Promise<void>;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* @beta
|
|
376
|
-
*/
|
|
377
|
-
export declare type ContentType = "richtext" | "fill";
|
|
378
|
-
|
|
379
351
|
/**
|
|
380
352
|
* @public
|
|
381
353
|
* A type of content that can be read from a user's design.
|
|
382
354
|
*/
|
|
383
|
-
declare type
|
|
355
|
+
export declare type ContentType = "richtext";
|
|
384
356
|
|
|
385
357
|
/**
|
|
386
358
|
* @public
|
|
@@ -1939,40 +1911,6 @@ export declare type DesignElement =
|
|
|
1939
1911
|
| RichtextElement
|
|
1940
1912
|
| TableElement;
|
|
1941
1913
|
|
|
1942
|
-
/**
|
|
1943
|
-
* @beta
|
|
1944
|
-
* Information about the design.
|
|
1945
|
-
*/
|
|
1946
|
-
export declare type DesignMetadata = {
|
|
1947
|
-
/**
|
|
1948
|
-
* The title of the user's design.
|
|
1949
|
-
* @remarks
|
|
1950
|
-
* This is optional and will be `undefined` if the user hasn't set a title.
|
|
1951
|
-
*/
|
|
1952
|
-
title?: string;
|
|
1953
|
-
/**
|
|
1954
|
-
* The default dimensions that a new page will have when it is added to a design.
|
|
1955
|
-
* It is possible for a user to resize a page without resizing the entire design, e.g. by clicking
|
|
1956
|
-
* "Expand to Whiteboard". However, there will always be a single set of default dimensions for a
|
|
1957
|
-
* design that is applied whenever a new page is created.
|
|
1958
|
-
* @remarks
|
|
1959
|
-
* This is optional and will be `undefined` if the design is unbounded (e.g. Whiteboard or Doc).
|
|
1960
|
-
*/
|
|
1961
|
-
defaultPageDimensions?: PageDimensions;
|
|
1962
|
-
/**
|
|
1963
|
-
* The information associated with each page of the design.
|
|
1964
|
-
* @remarks
|
|
1965
|
-
* The order of pages is not guaranteed.
|
|
1966
|
-
*/
|
|
1967
|
-
pageMetadata: Iterable<PageContext>;
|
|
1968
|
-
/**
|
|
1969
|
-
* The duration of the whole design in seconds.
|
|
1970
|
-
* @remarks
|
|
1971
|
-
* This is the precise value, which differs from what is displayed in the UI as duration in Canva UI is formatted differently.
|
|
1972
|
-
*/
|
|
1973
|
-
durationInSeconds: number;
|
|
1974
|
-
};
|
|
1975
|
-
|
|
1976
1914
|
/**
|
|
1977
1915
|
* @public
|
|
1978
1916
|
* A callback for reading and updating part of a design.
|
|
@@ -2081,30 +2019,21 @@ export declare type DragStartEvent<E extends Element> = Pick<
|
|
|
2081
2019
|
* @param callback - A callback for operating on the read content.
|
|
2082
2020
|
*/
|
|
2083
2021
|
export declare const editContent: (
|
|
2084
|
-
options:
|
|
2085
|
-
callback:
|
|
2022
|
+
options: EditContentOptions,
|
|
2023
|
+
callback: EditContentCallback,
|
|
2086
2024
|
) => Promise<void>;
|
|
2087
2025
|
|
|
2088
|
-
/**
|
|
2089
|
-
* @beta
|
|
2090
|
-
* A callback for reading and updating the requested design content.
|
|
2091
|
-
* @param session - The result of reading the content in the design.
|
|
2092
|
-
*/
|
|
2093
|
-
export declare type EditContentCallback = (
|
|
2094
|
-
session: RichtextContentSession | ContentFillSession,
|
|
2095
|
-
) => Promise<void> | void;
|
|
2096
|
-
|
|
2097
2026
|
/**
|
|
2098
2027
|
* @public
|
|
2099
2028
|
* A callback for reading and updating the requested design content.
|
|
2100
2029
|
* @param session - The result of reading the content in the design.
|
|
2101
2030
|
*/
|
|
2102
|
-
declare type
|
|
2031
|
+
export declare type EditContentCallback = (
|
|
2103
2032
|
session: RichtextContentSession,
|
|
2104
2033
|
) => Promise<void> | void;
|
|
2105
2034
|
|
|
2106
2035
|
/**
|
|
2107
|
-
* @
|
|
2036
|
+
* @public
|
|
2108
2037
|
* Options for configuring how the design content is read.
|
|
2109
2038
|
*/
|
|
2110
2039
|
export declare type EditContentOptions = {
|
|
@@ -2114,17 +2043,6 @@ export declare type EditContentOptions = {
|
|
|
2114
2043
|
contentType: ContentType;
|
|
2115
2044
|
} & ContextOptions;
|
|
2116
2045
|
|
|
2117
|
-
/**
|
|
2118
|
-
* @public
|
|
2119
|
-
* Options for configuring how the design content is read.
|
|
2120
|
-
*/
|
|
2121
|
-
declare type EditContentOptions_2 = {
|
|
2122
|
-
/**
|
|
2123
|
-
* The type of content to edit from the user's design
|
|
2124
|
-
*/
|
|
2125
|
-
contentType: ContentType_2;
|
|
2126
|
-
} & ContextOptions;
|
|
2127
|
-
|
|
2128
2046
|
/**
|
|
2129
2047
|
* @public
|
|
2130
2048
|
* Elements targeting a cursor are a subset of the base Element
|
|
@@ -2398,12 +2316,6 @@ export declare const getDefaultPageDimensions: () => Promise<
|
|
|
2398
2316
|
Dimensions | undefined
|
|
2399
2317
|
>;
|
|
2400
2318
|
|
|
2401
|
-
/**
|
|
2402
|
-
* @beta
|
|
2403
|
-
* Retrieves information about the design.
|
|
2404
|
-
*/
|
|
2405
|
-
export declare const getDesignMetadata: () => Promise<DesignMetadata>;
|
|
2406
|
-
|
|
2407
2319
|
/**
|
|
2408
2320
|
* @public
|
|
2409
2321
|
* Retrieves a signed JWT that contains the Design ID, App ID and User ID.
|
|
@@ -3426,11 +3338,6 @@ export declare type TextDragConfig = {
|
|
|
3426
3338
|
* @defaultValue "none"
|
|
3427
3339
|
*/
|
|
3428
3340
|
decoration?: "none" | "underline";
|
|
3429
|
-
/**
|
|
3430
|
-
* @beta
|
|
3431
|
-
* A unique identifier that points to a font asset in Canva's backend.
|
|
3432
|
-
*/
|
|
3433
|
-
fontRef?: FontRef;
|
|
3434
3341
|
};
|
|
3435
3342
|
|
|
3436
3343
|
/**
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict"
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "getDesignMetadata", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getDesignMetadata;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
5
|
_export_star(require("./public"), exports);
|
|
12
6
|
function _export_star(from, to) {
|
|
13
7
|
Object.keys(from).forEach(function(k) {
|
|
@@ -23,6 +17,4 @@ function _export_star(from, to) {
|
|
|
23
17
|
return from;
|
|
24
18
|
}
|
|
25
19
|
var _window___canva___sdkRegistration, _window___canva__;
|
|
26
|
-
|
|
27
|
-
const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
|
|
28
|
-
(_window___canva__ = window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('design', '2.6.1', 'beta');
|
|
20
|
+
(_window___canva__ = window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('design', '2.6.1', 'ga');
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
|
-
const { canva_sdk } = window;
|
|
3
|
-
export const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
|
|
4
2
|
export * from './public';
|
|
5
|
-
(_window___canva__ = window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('design', '2.6.1', '
|
|
3
|
+
(_window___canva__ = window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('design', '2.6.1', 'ga');
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/design",
|
|
3
|
-
"version": "2.6.1
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "The Canva Apps SDK design library",
|
|
5
5
|
"author": "Canva Pty Ltd.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md FILE",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@canva/error": "^2.0.0"
|
|
9
9
|
},
|
|
10
|
-
"main": "./lib/cjs/sdk/design/
|
|
11
|
-
"module": "./lib/esm/sdk/design/
|
|
10
|
+
"main": "./lib/cjs/sdk/design/index.js",
|
|
11
|
+
"module": "./lib/esm/sdk/design/index.js",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./
|
|
15
|
-
"require": "./lib/cjs/sdk/design/
|
|
16
|
-
"import": "./lib/esm/sdk/design/
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"require": "./lib/cjs/sdk/design/index.js",
|
|
16
|
+
"import": "./lib/esm/sdk/design/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./test": {
|
|
19
|
-
"types": "./test/
|
|
20
|
-
"require": "./lib/cjs/sdk/design/test/
|
|
21
|
-
"import": "./lib/esm/sdk/design/test/
|
|
19
|
+
"types": "./test/index.d.ts",
|
|
20
|
+
"require": "./lib/cjs/sdk/design/test/index.js",
|
|
21
|
+
"import": "./lib/esm/sdk/design/test/index.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
-
"typings": "./
|
|
24
|
+
"typings": "./index.d.ts"
|
|
25
25
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
_export_star(require("./index"), exports);
|
|
6
|
-
function _export_star(from, to) {
|
|
7
|
-
Object.keys(from).forEach(function(k) {
|
|
8
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
-
Object.defineProperty(to, k, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function() {
|
|
12
|
-
return from[k];
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return from;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './index';
|
|
File without changes
|