@canva/intents 0.0.0-beta.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/LICENSE.md +48 -0
- package/README.md +119 -0
- package/asset/beta.d.ts +1 -0
- package/beta.d.ts +975 -0
- package/data/beta.d.ts +898 -0
- package/design/beta.d.ts +45 -0
- package/lib/cjs/sdk/intents/asset/beta.js +4 -0
- package/lib/cjs/sdk/intents/beta.js +63 -0
- package/lib/cjs/sdk/intents/data/beta.js +14 -0
- package/lib/cjs/sdk/intents/design/beta.js +14 -0
- package/lib/esm/sdk/intents/asset/beta.js +1 -0
- package/lib/esm/sdk/intents/beta.js +5 -0
- package/lib/esm/sdk/intents/data/beta.js +4 -0
- package/lib/esm/sdk/intents/design/beta.js +4 -0
- package/package.json +35 -0
package/design/beta.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
*
|
|
4
|
+
* Main interface for implementing the DesignEditor intent.
|
|
5
|
+
*
|
|
6
|
+
* Implementing the DesignEditor Intent enables apps to assist users in editing designs,
|
|
7
|
+
* by presenting interactive and creative tooling alongside the Canva design surface.
|
|
8
|
+
*/
|
|
9
|
+
export declare type DesignEditorIntent = {
|
|
10
|
+
/**
|
|
11
|
+
* Renders the UI containing the app’s functionality.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* function render() {
|
|
16
|
+
* // render your UI using your preferred framework
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
render: () => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @beta
|
|
25
|
+
*
|
|
26
|
+
* Prepares a {@link DesignEditorIntent|DesignEditor Intent}.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import { prepareDesignEditor } from '@canva/intents/design';
|
|
31
|
+
*
|
|
32
|
+
* function render() {
|
|
33
|
+
* // render your UI using your preferred framework
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* prepareDesignEditor({
|
|
37
|
+
* render,
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const prepareDesignEditor: (
|
|
42
|
+
implementation: DesignEditorIntent,
|
|
43
|
+
) => void;
|
|
44
|
+
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
data: function() {
|
|
13
|
+
return _beta;
|
|
14
|
+
},
|
|
15
|
+
design: function() {
|
|
16
|
+
return _beta1;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _beta = _interop_require_wildcard(require("./data/beta"));
|
|
20
|
+
const _beta1 = _interop_require_wildcard(require("./design/beta"));
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
22
|
+
if (typeof WeakMap !== "function") return null;
|
|
23
|
+
var cacheBabelInterop = new WeakMap();
|
|
24
|
+
var cacheNodeInterop = new WeakMap();
|
|
25
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
26
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
27
|
+
})(nodeInterop);
|
|
28
|
+
}
|
|
29
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
30
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
34
|
+
return {
|
|
35
|
+
default: obj
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
39
|
+
if (cache && cache.has(obj)) {
|
|
40
|
+
return cache.get(obj);
|
|
41
|
+
}
|
|
42
|
+
var newObj = {
|
|
43
|
+
__proto__: null
|
|
44
|
+
};
|
|
45
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
46
|
+
for(var key in obj){
|
|
47
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
48
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
49
|
+
if (desc && (desc.get || desc.set)) {
|
|
50
|
+
Object.defineProperty(newObj, key, desc);
|
|
51
|
+
} else {
|
|
52
|
+
newObj[key] = obj[key];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
newObj.default = obj;
|
|
57
|
+
if (cache) {
|
|
58
|
+
cache.set(obj, newObj);
|
|
59
|
+
}
|
|
60
|
+
return newObj;
|
|
61
|
+
}
|
|
62
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
63
|
+
(_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('intents', '0.0.1', 'beta');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "prepareDataConnector", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return prepareDataConnector;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
12
|
+
const { canva_sdk } = window;
|
|
13
|
+
const prepareDataConnector = canva_sdk.intents.v1.data.prepareDataConnector;
|
|
14
|
+
(_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('intents/data', '0.0.1', 'beta');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "prepareDesignEditor", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return prepareDesignEditor;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
12
|
+
const { canva_sdk } = window;
|
|
13
|
+
const prepareDesignEditor = canva_sdk.intents.v1.design.prepareDesignEditor;
|
|
14
|
+
(_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('intents/design', '0.0.1', 'beta');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
|
+
import * as data from './data/beta';
|
|
3
|
+
import * as design from './design/beta';
|
|
4
|
+
export { design, data };
|
|
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('intents', '0.0.1', 'beta');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
|
+
const { canva_sdk } = window;
|
|
3
|
+
export const prepareDataConnector = canva_sdk.intents.v1.data.prepareDataConnector;
|
|
4
|
+
(_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('intents/data', '0.0.1', 'beta');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
|
+
const { canva_sdk } = window;
|
|
3
|
+
export const prepareDesignEditor = canva_sdk.intents.v1.design.prepareDesignEditor;
|
|
4
|
+
(_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('intents/design', '0.0.1', 'beta');
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@canva/intents",
|
|
3
|
+
"version": "0.0.0-beta.2",
|
|
4
|
+
"description": "The Canva Apps SDK Intents library",
|
|
5
|
+
"author": "Canva Pty Ltd.",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE.md FILE",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@canva/error": "^2.0.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./lib/cjs/sdk/intents/beta.js",
|
|
11
|
+
"module": "./lib/esm/sdk/intents/beta.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./beta.d.ts",
|
|
15
|
+
"require": "./lib/cjs/sdk/intents/beta.js",
|
|
16
|
+
"import": "./lib/esm/sdk/intents/beta.js"
|
|
17
|
+
},
|
|
18
|
+
"./data": {
|
|
19
|
+
"types": "./data/beta.d.ts",
|
|
20
|
+
"require": "./lib/cjs/sdk/intents/data/beta.js",
|
|
21
|
+
"import": "./lib/esm/sdk/intents/data/beta.js"
|
|
22
|
+
},
|
|
23
|
+
"./design": {
|
|
24
|
+
"types": "./design/beta.d.ts",
|
|
25
|
+
"require": "./lib/cjs/sdk/intents/design/beta.js",
|
|
26
|
+
"import": "./lib/esm/sdk/intents/design/beta.js"
|
|
27
|
+
},
|
|
28
|
+
"./asset": {
|
|
29
|
+
"types": "./asset/beta.d.ts",
|
|
30
|
+
"require": "./lib/cjs/sdk/intents/asset/beta.js",
|
|
31
|
+
"import": "./lib/esm/sdk/intents/asset/beta.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"typings": "./beta.d.ts"
|
|
35
|
+
}
|