@canva/design 2.7.6-beta.0 → 2.7.6-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.
@@ -9,17 +9,17 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- get bulkCreate () {
13
- return bulkCreate;
14
- },
15
12
  get editContent () {
16
13
  return editContent;
17
14
  },
15
+ get getDesignMetadata () {
16
+ return getDesignMetadata;
17
+ },
18
+ get getDesignTemplateMetadata () {
19
+ return getDesignTemplateMetadata;
20
+ },
18
21
  get openDesign () {
19
22
  return openDesign;
20
- },
21
- get publish () {
22
- return publish;
23
23
  }
24
24
  });
25
25
  const _version = require("./version");
@@ -38,10 +38,10 @@ function _export_star(from, to) {
38
38
  return from;
39
39
  }
40
40
  const { canva_sdk } = window;
41
- const publish = canva_sdk.design.v2.designInteraction.publish;
42
- const bulkCreate = canva_sdk.design.v2.designInteraction.bulkCreate;
41
+ const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
43
42
  function editContent(options, callback) {
44
43
  return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
45
44
  }
46
45
  const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
46
+ const getDesignTemplateMetadata = canva_sdk.design.v2.designInteraction.getDesignTemplateMetadata;
47
47
  window.__canva__?.sdkRegistration?.registerPackageVersion('design', _version.LATEST_VERSION_BETA, 'beta');
@@ -57,12 +57,25 @@ class FakeBetaDesignInteractionClient extends _fake_design_interaction_client.Fa
57
57
  }
58
58
  });
59
59
  }
60
- constructor(...args){
61
- super(...args), this.publish = {
62
- launch: ()=>this.delay()
63
- }, this.bulkCreate = {
64
- launch: ()=>this.delay()
65
- };
60
+ getDesignMetadata() {
61
+ return Promise.resolve({
62
+ title: 'title',
63
+ defaultPageDimensions: {
64
+ width: 800,
65
+ height: 600
66
+ },
67
+ pageMetadata: [
68
+ {
69
+ title: 'title',
70
+ type: 'absolute',
71
+ pageDimensions: {
72
+ width: 800,
73
+ height: 600
74
+ }
75
+ }
76
+ ],
77
+ durationInSeconds: 30
78
+ });
66
79
  }
67
80
  }
68
81
  const fakePageRef = {
@@ -36,24 +36,42 @@ class FakeDesignInteractionClient {
36
36
  },
37
37
  pageMetadata: [
38
38
  {
39
+ type: 'absolute',
39
40
  dimensions: {
40
41
  width: 800,
41
42
  height: 600
42
- }
43
+ },
44
+ title: 'page1'
45
+ },
46
+ {
47
+ type: 'unsupported'
43
48
  },
44
49
  {
50
+ type: 'absolute',
45
51
  dimensions: {
46
52
  width: 300,
47
53
  height: 900
48
- }
49
- },
50
- {
51
- dimensions: undefined
54
+ },
55
+ title: undefined
52
56
  }
53
57
  ],
54
58
  durationInSeconds: 30
55
59
  };
56
60
  }
61
+ async getDesignTemplateMetadata() {
62
+ await this.delay();
63
+ return {
64
+ templates: [
65
+ {
66
+ keywords: [
67
+ 'word1',
68
+ 'word2'
69
+ ],
70
+ domain: 'brand'
71
+ }
72
+ ]
73
+ };
74
+ }
57
75
  async addNativeElement(element) {
58
76
  await this.delay();
59
77
  }
@@ -140,6 +158,12 @@ class FakeDesignInteractionClient {
140
158
  return ()=>{};
141
159
  }
142
160
  };
161
+ this.publish = {
162
+ launch: ()=>this.delay()
163
+ };
164
+ this.bulkCreate = {
165
+ launch: ()=>this.delay()
166
+ };
143
167
  }
144
168
  }
145
169
  const fakeBounds = {
@@ -24,6 +24,9 @@ _export(exports, {
24
24
  get addPage () {
25
25
  return addPage;
26
26
  },
27
+ get bulkCreate () {
28
+ return bulkCreate;
29
+ },
27
30
  get createRichtextRange () {
28
31
  return createRichtextRange;
29
32
  },
@@ -51,6 +54,9 @@ _export(exports, {
51
54
  get overlay () {
52
55
  return overlay;
53
56
  },
57
+ get publish () {
58
+ return publish;
59
+ },
54
60
  get requestExport () {
55
61
  return requestExport;
56
62
  },
@@ -83,3 +89,5 @@ const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadat
83
89
  const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
84
90
  const editContent = canva_sdk.design.v2.designInteraction.editContent;
85
91
  const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
92
+ const publish = canva_sdk.design.v2.designInteraction.publish;
93
+ const bulkCreate = canva_sdk.design.v2.designInteraction.bulkCreate;
@@ -20,5 +20,5 @@ _export(exports, {
20
20
  }
21
21
  });
22
22
  const LATEST_VERSION = '2.7.5';
23
- const LATEST_VERSION_BETA = '2.7.5-beta-1';
23
+ const LATEST_VERSION_BETA = '2.7.6-beta.2';
24
24
  const LATEST_VERSION_ALPHA = 'NONE';
@@ -1,10 +1,10 @@
1
1
  import { LATEST_VERSION_BETA } from './version';
2
2
  const { canva_sdk } = window;
3
- export const publish = canva_sdk.design.v2.designInteraction.publish;
4
- export const bulkCreate = canva_sdk.design.v2.designInteraction.bulkCreate;
3
+ export const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesignMetadata;
5
4
  export function editContent(options, callback) {
6
5
  return canva_sdk.design.v2.designInteraction.editContent(options, (session)=>callback(session));
7
6
  }
8
7
  export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
8
+ export const getDesignTemplateMetadata = canva_sdk.design.v2.designInteraction.getDesignTemplateMetadata;
9
9
  export * from './public';
10
10
  window.__canva__?.sdkRegistration?.registerPackageVersion('design', LATEST_VERSION_BETA, 'beta');
@@ -47,12 +47,25 @@ class FakeBetaDesignInteractionClient extends FakeDesignInteractionClient {
47
47
  }
48
48
  });
49
49
  }
50
- constructor(...args){
51
- super(...args), this.publish = {
52
- launch: ()=>this.delay()
53
- }, this.bulkCreate = {
54
- launch: ()=>this.delay()
55
- };
50
+ getDesignMetadata() {
51
+ return Promise.resolve({
52
+ title: 'title',
53
+ defaultPageDimensions: {
54
+ width: 800,
55
+ height: 600
56
+ },
57
+ pageMetadata: [
58
+ {
59
+ title: 'title',
60
+ type: 'absolute',
61
+ pageDimensions: {
62
+ width: 800,
63
+ height: 600
64
+ }
65
+ }
66
+ ],
67
+ durationInSeconds: 30
68
+ });
56
69
  }
57
70
  }
58
71
  const fakePageRef = {
@@ -15,24 +15,42 @@ export class FakeDesignInteractionClient {
15
15
  },
16
16
  pageMetadata: [
17
17
  {
18
+ type: 'absolute',
18
19
  dimensions: {
19
20
  width: 800,
20
21
  height: 600
21
- }
22
+ },
23
+ title: 'page1'
24
+ },
25
+ {
26
+ type: 'unsupported'
22
27
  },
23
28
  {
29
+ type: 'absolute',
24
30
  dimensions: {
25
31
  width: 300,
26
32
  height: 900
27
- }
28
- },
29
- {
30
- dimensions: undefined
33
+ },
34
+ title: undefined
31
35
  }
32
36
  ],
33
37
  durationInSeconds: 30
34
38
  };
35
39
  }
40
+ async getDesignTemplateMetadata() {
41
+ await this.delay();
42
+ return {
43
+ templates: [
44
+ {
45
+ keywords: [
46
+ 'word1',
47
+ 'word2'
48
+ ],
49
+ domain: 'brand'
50
+ }
51
+ ]
52
+ };
53
+ }
36
54
  async addNativeElement(element) {
37
55
  await this.delay();
38
56
  }
@@ -119,6 +137,12 @@ export class FakeDesignInteractionClient {
119
137
  return ()=>{};
120
138
  }
121
139
  };
140
+ this.publish = {
141
+ launch: ()=>this.delay()
142
+ };
143
+ this.bulkCreate = {
144
+ launch: ()=>this.delay()
145
+ };
122
146
  }
123
147
  }
124
148
  const fakeBounds = {
@@ -17,3 +17,5 @@ export const getDesignMetadata = canva_sdk.design.v2.designInteraction.getDesign
17
17
  export const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
18
18
  export const editContent = canva_sdk.design.v2.designInteraction.editContent;
19
19
  export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
20
+ export const publish = canva_sdk.design.v2.designInteraction.publish;
21
+ export const bulkCreate = canva_sdk.design.v2.designInteraction.bulkCreate;
@@ -1,3 +1,3 @@
1
1
  export const LATEST_VERSION = '2.7.5';
2
- export const LATEST_VERSION_BETA = '2.7.5-beta-1';
2
+ export const LATEST_VERSION_BETA = '2.7.6-beta.2';
3
3
  export const LATEST_VERSION_ALPHA = 'NONE';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "2.7.6-beta.0",
3
+ "version": "2.7.6-beta.2",
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
+ }
package/test/beta.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  */
9
9
  export declare function initTestEnvironment(): void;
10
10
 
11
- export {};
11
+ export { }