@canva/design 2.4.1-beta.2 → 2.6.0-beta.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/README.md +3 -1
- package/beta.d.ts +1057 -248
- package/lib/cjs/sdk/design/beta.js +4 -13
- package/lib/cjs/sdk/design/fake/fake_design_interaction_client.js +0 -90
- package/lib/cjs/sdk/design/public.js +21 -17
- package/lib/cjs/sdk/utils/canva_sdk.js +5 -5
- package/lib/esm/sdk/design/beta.js +1 -2
- package/lib/esm/sdk/design/fake/fake_design_interaction_client.js +0 -90
- package/lib/esm/sdk/design/public.js +1 -0
- package/package.json +2 -2
|
@@ -2,18 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
getDesignMetadata: function() {
|
|
5
|
+
Object.defineProperty(exports, "getDesignMetadata", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
13
8
|
return getDesignMetadata;
|
|
14
|
-
},
|
|
15
|
-
openDesign: function() {
|
|
16
|
-
return openDesign;
|
|
17
9
|
}
|
|
18
10
|
});
|
|
19
11
|
_export_star(require("./public"), exports);
|
|
@@ -32,6 +24,5 @@ function _export_star(from, to) {
|
|
|
32
24
|
}
|
|
33
25
|
var _window___canva___sdkRegistration, _window___canva__;
|
|
34
26
|
const { canva_sdk } = window;
|
|
35
|
-
const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
36
27
|
const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
|
|
37
|
-
(_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.
|
|
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.0', 'beta');
|
|
@@ -112,17 +112,6 @@ class FakeDesignInteractionClient {
|
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
async openDesign(options, callback) {
|
|
115
|
-
await this.delay();
|
|
116
|
-
await callback({
|
|
117
|
-
page: fakePage,
|
|
118
|
-
save: async ()=>{
|
|
119
|
-
await this.delay();
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
elementBuilder: fakeElementBuilder
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
async openDesign2(options, callback) {
|
|
126
115
|
throw new Error('Not yet implemented');
|
|
127
116
|
}
|
|
128
117
|
constructor(delay){
|
|
@@ -171,82 +160,3 @@ const fakePageDimensions = {
|
|
|
171
160
|
width: 800,
|
|
172
161
|
height: 600
|
|
173
162
|
};
|
|
174
|
-
const fakeFill = {
|
|
175
|
-
media: undefined,
|
|
176
|
-
color: {
|
|
177
|
-
type: 'solid',
|
|
178
|
-
color: '#FFFFFF'
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const fakePage = {
|
|
182
|
-
type: 'fixed',
|
|
183
|
-
locked: false,
|
|
184
|
-
dimensions: fakePageDimensions,
|
|
185
|
-
background: fakeFill,
|
|
186
|
-
elements: {
|
|
187
|
-
count: ()=>0,
|
|
188
|
-
toArray: ()=>[],
|
|
189
|
-
insertBefore: (ref)=>ref,
|
|
190
|
-
insertAfter: (ref)=>ref,
|
|
191
|
-
forEach: (callback)=>{},
|
|
192
|
-
filter: (filter)=>[],
|
|
193
|
-
moveBefore: (item)=>{},
|
|
194
|
-
moveAfter: (item)=>{},
|
|
195
|
-
delete: (item)=>{}
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
const fakeElement = {
|
|
199
|
-
top: 0,
|
|
200
|
-
left: 0,
|
|
201
|
-
rotation: 0,
|
|
202
|
-
transparency: 0,
|
|
203
|
-
locked: true,
|
|
204
|
-
width: 100,
|
|
205
|
-
height: 100
|
|
206
|
-
};
|
|
207
|
-
const fakeRectElement = {
|
|
208
|
-
...fakeElement,
|
|
209
|
-
type: 'rect',
|
|
210
|
-
fill: fakeFill,
|
|
211
|
-
stroke: {
|
|
212
|
-
weight: 10,
|
|
213
|
-
color: fakeFill.color
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
const fakeShapeElement = {
|
|
217
|
-
...fakeElement,
|
|
218
|
-
type: 'shape',
|
|
219
|
-
viewBox: {
|
|
220
|
-
top: 0,
|
|
221
|
-
left: 0,
|
|
222
|
-
width: 100,
|
|
223
|
-
height: 100
|
|
224
|
-
},
|
|
225
|
-
paths: {
|
|
226
|
-
count: ()=>0,
|
|
227
|
-
toArray: ()=>[],
|
|
228
|
-
forEach: (callback)=>{},
|
|
229
|
-
filter: (filter)=>[]
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
const fakeEmbedElement = {
|
|
233
|
-
...fakeElement,
|
|
234
|
-
type: 'embed',
|
|
235
|
-
url: 'https://canva.dev/docs/apps/testing/'
|
|
236
|
-
};
|
|
237
|
-
const fakeTextElement = {
|
|
238
|
-
...fakeElement,
|
|
239
|
-
type: 'text',
|
|
240
|
-
text: fakeRichtextRange
|
|
241
|
-
};
|
|
242
|
-
function cloneElement(element) {
|
|
243
|
-
return fakeRectElement;
|
|
244
|
-
}
|
|
245
|
-
const fakeElementBuilder = {
|
|
246
|
-
createRectElement: (opts)=>fakeRectElement,
|
|
247
|
-
createShapeElement: (opts)=>fakeShapeElement,
|
|
248
|
-
createEmbedElement: (opts)=>fakeEmbedElement,
|
|
249
|
-
createTextElement: (opts)=>fakeTextElement,
|
|
250
|
-
createRichtextRange: ()=>fakeRichtextRange,
|
|
251
|
-
cloneElement
|
|
252
|
-
};
|
|
@@ -5,56 +5,59 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
addAudioTrack
|
|
12
|
+
get addAudioTrack () {
|
|
13
13
|
return addAudioTrack;
|
|
14
14
|
},
|
|
15
|
-
addElementAtCursor
|
|
15
|
+
get addElementAtCursor () {
|
|
16
16
|
return addElementAtCursor;
|
|
17
17
|
},
|
|
18
|
-
addElementAtPoint
|
|
18
|
+
get addElementAtPoint () {
|
|
19
19
|
return addElementAtPoint;
|
|
20
20
|
},
|
|
21
|
-
addNativeElement
|
|
21
|
+
get addNativeElement () {
|
|
22
22
|
return addNativeElement;
|
|
23
23
|
},
|
|
24
|
-
addPage
|
|
24
|
+
get addPage () {
|
|
25
25
|
return addPage;
|
|
26
26
|
},
|
|
27
|
-
createRichtextRange
|
|
27
|
+
get createRichtextRange () {
|
|
28
28
|
return createRichtextRange;
|
|
29
29
|
},
|
|
30
|
-
editContent
|
|
30
|
+
get editContent () {
|
|
31
31
|
return editContent;
|
|
32
32
|
},
|
|
33
|
-
getCurrentPageContext
|
|
33
|
+
get getCurrentPageContext () {
|
|
34
34
|
return getCurrentPageContext;
|
|
35
35
|
},
|
|
36
|
-
getDefaultPageDimensions
|
|
36
|
+
get getDefaultPageDimensions () {
|
|
37
37
|
return getDefaultPageDimensions;
|
|
38
38
|
},
|
|
39
|
-
getDesignToken
|
|
39
|
+
get getDesignToken () {
|
|
40
40
|
return getDesignToken;
|
|
41
41
|
},
|
|
42
|
-
initAppElement
|
|
42
|
+
get initAppElement () {
|
|
43
43
|
return initAppElement;
|
|
44
44
|
},
|
|
45
|
-
|
|
45
|
+
get openDesign () {
|
|
46
|
+
return openDesign;
|
|
47
|
+
},
|
|
48
|
+
get overlay () {
|
|
46
49
|
return overlay;
|
|
47
50
|
},
|
|
48
|
-
requestExport
|
|
51
|
+
get requestExport () {
|
|
49
52
|
return requestExport;
|
|
50
53
|
},
|
|
51
|
-
selection
|
|
54
|
+
get selection () {
|
|
52
55
|
return selection;
|
|
53
56
|
},
|
|
54
|
-
setCurrentPageBackground
|
|
57
|
+
get setCurrentPageBackground () {
|
|
55
58
|
return setCurrentPageBackground;
|
|
56
59
|
},
|
|
57
|
-
ui
|
|
60
|
+
get ui () {
|
|
58
61
|
return ui;
|
|
59
62
|
}
|
|
60
63
|
});
|
|
@@ -75,3 +78,4 @@ const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
|
|
|
75
78
|
const getDesignToken = canva_sdk.design.v2.designInteraction.getDesignToken;
|
|
76
79
|
const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
|
|
77
80
|
const editContent = canva_sdk.design.v2.designInteraction.editContent;
|
|
81
|
+
const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
assertIsTestCanvaSdk
|
|
12
|
+
get assertIsTestCanvaSdk () {
|
|
13
13
|
return assertIsTestCanvaSdk;
|
|
14
14
|
},
|
|
15
|
-
bindMethodsToClients
|
|
15
|
+
get bindMethodsToClients () {
|
|
16
16
|
return bindMethodsToClients;
|
|
17
17
|
},
|
|
18
|
-
getCanvaSdk
|
|
18
|
+
get getCanvaSdk () {
|
|
19
19
|
return getCanvaSdk;
|
|
20
20
|
},
|
|
21
|
-
injectFakeAPIClients
|
|
21
|
+
get injectFakeAPIClients () {
|
|
22
22
|
return injectFakeAPIClients;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
2
|
const { canva_sdk } = window;
|
|
3
|
-
export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
4
3
|
export const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
|
|
5
4
|
export * from './public';
|
|
6
|
-
(_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.
|
|
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.0', 'beta');
|
|
@@ -102,17 +102,6 @@ export class FakeDesignInteractionClient {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
async openDesign(options, callback) {
|
|
105
|
-
await this.delay();
|
|
106
|
-
await callback({
|
|
107
|
-
page: fakePage,
|
|
108
|
-
save: async ()=>{
|
|
109
|
-
await this.delay();
|
|
110
|
-
}
|
|
111
|
-
}, {
|
|
112
|
-
elementBuilder: fakeElementBuilder
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async openDesign2(options, callback) {
|
|
116
105
|
throw new Error('Not yet implemented');
|
|
117
106
|
}
|
|
118
107
|
constructor(delay){
|
|
@@ -161,82 +150,3 @@ const fakePageDimensions = {
|
|
|
161
150
|
width: 800,
|
|
162
151
|
height: 600
|
|
163
152
|
};
|
|
164
|
-
const fakeFill = {
|
|
165
|
-
media: undefined,
|
|
166
|
-
color: {
|
|
167
|
-
type: 'solid',
|
|
168
|
-
color: '#FFFFFF'
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
const fakePage = {
|
|
172
|
-
type: 'fixed',
|
|
173
|
-
locked: false,
|
|
174
|
-
dimensions: fakePageDimensions,
|
|
175
|
-
background: fakeFill,
|
|
176
|
-
elements: {
|
|
177
|
-
count: ()=>0,
|
|
178
|
-
toArray: ()=>[],
|
|
179
|
-
insertBefore: (ref)=>ref,
|
|
180
|
-
insertAfter: (ref)=>ref,
|
|
181
|
-
forEach: (callback)=>{},
|
|
182
|
-
filter: (filter)=>[],
|
|
183
|
-
moveBefore: (item)=>{},
|
|
184
|
-
moveAfter: (item)=>{},
|
|
185
|
-
delete: (item)=>{}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const fakeElement = {
|
|
189
|
-
top: 0,
|
|
190
|
-
left: 0,
|
|
191
|
-
rotation: 0,
|
|
192
|
-
transparency: 0,
|
|
193
|
-
locked: true,
|
|
194
|
-
width: 100,
|
|
195
|
-
height: 100
|
|
196
|
-
};
|
|
197
|
-
const fakeRectElement = {
|
|
198
|
-
...fakeElement,
|
|
199
|
-
type: 'rect',
|
|
200
|
-
fill: fakeFill,
|
|
201
|
-
stroke: {
|
|
202
|
-
weight: 10,
|
|
203
|
-
color: fakeFill.color
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
const fakeShapeElement = {
|
|
207
|
-
...fakeElement,
|
|
208
|
-
type: 'shape',
|
|
209
|
-
viewBox: {
|
|
210
|
-
top: 0,
|
|
211
|
-
left: 0,
|
|
212
|
-
width: 100,
|
|
213
|
-
height: 100
|
|
214
|
-
},
|
|
215
|
-
paths: {
|
|
216
|
-
count: ()=>0,
|
|
217
|
-
toArray: ()=>[],
|
|
218
|
-
forEach: (callback)=>{},
|
|
219
|
-
filter: (filter)=>[]
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
const fakeEmbedElement = {
|
|
223
|
-
...fakeElement,
|
|
224
|
-
type: 'embed',
|
|
225
|
-
url: 'https://canva.dev/docs/apps/testing/'
|
|
226
|
-
};
|
|
227
|
-
const fakeTextElement = {
|
|
228
|
-
...fakeElement,
|
|
229
|
-
type: 'text',
|
|
230
|
-
text: fakeRichtextRange
|
|
231
|
-
};
|
|
232
|
-
function cloneElement(element) {
|
|
233
|
-
return fakeRectElement;
|
|
234
|
-
}
|
|
235
|
-
const fakeElementBuilder = {
|
|
236
|
-
createRectElement: (opts)=>fakeRectElement,
|
|
237
|
-
createShapeElement: (opts)=>fakeShapeElement,
|
|
238
|
-
createEmbedElement: (opts)=>fakeEmbedElement,
|
|
239
|
-
createTextElement: (opts)=>fakeTextElement,
|
|
240
|
-
createRichtextRange: ()=>fakeRichtextRange,
|
|
241
|
-
cloneElement
|
|
242
|
-
};
|
|
@@ -15,3 +15,4 @@ export const initAppElement = canva_sdk.design.v2.designInteraction.initAppEleme
|
|
|
15
15
|
export const getDesignToken = canva_sdk.design.v2.designInteraction.getDesignToken;
|
|
16
16
|
export const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
|
|
17
17
|
export const editContent = canva_sdk.design.v2.designInteraction.editContent;
|
|
18
|
+
export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canva/design",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0-beta.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",
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"typings": "./beta.d.ts"
|
|
25
|
-
}
|
|
25
|
+
}
|