@canva/design 2.3.0-beta.1 → 2.4.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/beta.d.ts CHANGED
@@ -88,7 +88,6 @@ export declare type AppElementChangeHandler<A extends AppElementData> = (
88
88
  */
89
89
  version: number;
90
90
  /**
91
- * @beta
92
91
  * Function to update the app element data.
93
92
  */
94
93
  update: (opts: AppElementOptions<A>) => Promise<void>;
@@ -102,6 +101,7 @@ export declare type AppElementChangeHandler<A extends AppElementData> = (
102
101
  */
103
102
  export declare interface AppElementClient<A extends AppElementData> {
104
103
  /**
104
+ * @deprecated This type has been superseded, use `addElement` or `registerOnElementChange` instead.
105
105
  * If an app element is selected, the element's data is overwritten and the element is re-rendered.
106
106
  * Otherwise, the provided data is used to create a new app element.
107
107
  * @param appElementData - The data to attach to the app element. Existing data will be overwritten.
@@ -109,7 +109,6 @@ export declare interface AppElementClient<A extends AppElementData> {
109
109
  */
110
110
  addOrUpdateElement(appElementData: A, placement?: Placement): Promise<void>;
111
111
  /**
112
- * @beta
113
112
  * Adds a new app element to the design.
114
113
  * @param opts - The data and placement of the app element.
115
114
  */
@@ -144,7 +143,7 @@ export declare type AppElementClientConfiguration<A extends AppElementData> = {
144
143
  export declare type AppElementData = Record<string, Value>;
145
144
 
146
145
  /**
147
- * @beta
146
+ * @public
148
147
  * Used to add or update an app element to the design.
149
148
  * The update function is provided in the AppElementChangeHandler callback (registerOnElementChange).
150
149
  */
@@ -1492,7 +1491,7 @@ export declare type Fill = {
1492
1491
  * The hex code must include all six characters and be prefixed with a `#` symbol.
1493
1492
  *
1494
1493
  * @example
1495
- * " #ff0099"
1494
+ * "#ff0099"
1496
1495
  */
1497
1496
  color?: string;
1498
1497
  /**
@@ -1698,7 +1697,7 @@ export declare type ImageRef = string & {
1698
1697
  };
1699
1698
 
1700
1699
  /**
1701
- * @beta
1700
+ * @public
1702
1701
  * @param appElementConfig - Configuration for an AppElementClient
1703
1702
  */
1704
1703
  export declare const initAppElement: <A extends AppElementData>(
@@ -2,17 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
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
- initAppElement: function() {
13
- return initAppElement;
14
- },
15
- openDesign: function() {
5
+ Object.defineProperty(exports, "openDesign", {
6
+ enumerable: true,
7
+ get: function() {
16
8
  return openDesign;
17
9
  }
18
10
  });
@@ -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 initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
36
27
  const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
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.3.0', 'beta');
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.4.0', 'beta');
@@ -9,53 +9,53 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- selection: function() {
13
- return selection;
14
- },
15
- overlay: function() {
16
- return overlay;
17
- },
18
- addPage: function() {
19
- return addPage;
20
- },
21
- setCurrentPageBackground: function() {
22
- return setCurrentPageBackground;
23
- },
24
- getDefaultPageDimensions: function() {
25
- return getDefaultPageDimensions;
12
+ addAudioTrack: function() {
13
+ return addAudioTrack;
26
14
  },
27
- requestExport: function() {
28
- return requestExport;
15
+ addElementAtCursor: function() {
16
+ return addElementAtCursor;
29
17
  },
30
- ui: function() {
31
- return ui;
18
+ addElementAtPoint: function() {
19
+ return addElementAtPoint;
32
20
  },
33
21
  addNativeElement: function() {
34
22
  return addNativeElement;
35
23
  },
36
- addElementAtPoint: function() {
37
- return addElementAtPoint;
24
+ addPage: function() {
25
+ return addPage;
38
26
  },
39
- addElementAtCursor: function() {
40
- return addElementAtCursor;
27
+ createRichtextRange: function() {
28
+ return createRichtextRange;
41
29
  },
42
- addAudioTrack: function() {
43
- return addAudioTrack;
30
+ editContent: function() {
31
+ return editContent;
44
32
  },
45
33
  getCurrentPageContext: function() {
46
34
  return getCurrentPageContext;
47
35
  },
48
- initAppElement: function() {
49
- return initAppElement;
36
+ getDefaultPageDimensions: function() {
37
+ return getDefaultPageDimensions;
50
38
  },
51
39
  getDesignToken: function() {
52
40
  return getDesignToken;
53
41
  },
54
- createRichtextRange: function() {
55
- return createRichtextRange;
42
+ initAppElement: function() {
43
+ return initAppElement;
56
44
  },
57
- editContent: function() {
58
- return editContent;
45
+ overlay: function() {
46
+ return overlay;
47
+ },
48
+ requestExport: function() {
49
+ return requestExport;
50
+ },
51
+ selection: function() {
52
+ return selection;
53
+ },
54
+ setCurrentPageBackground: function() {
55
+ return setCurrentPageBackground;
56
+ },
57
+ ui: function() {
58
+ return ui;
59
59
  }
60
60
  });
61
61
  const { canva_sdk } = window;
@@ -9,12 +9,12 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getCanvaSdk: function() {
13
- return getCanvaSdk;
14
- },
15
12
  assertIsTestCanvaSdk: function() {
16
13
  return assertIsTestCanvaSdk;
17
14
  },
15
+ getCanvaSdk: function() {
16
+ return getCanvaSdk;
17
+ },
18
18
  injectFakeAPIClients: function() {
19
19
  return injectFakeAPIClients;
20
20
  }
@@ -1,6 +1,5 @@
1
1
  var _window___canva___sdkRegistration, _window___canva__;
2
2
  const { canva_sdk } = window;
3
- export const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
4
3
  export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
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.3.0', 'beta');
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.4.0', 'beta');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "2.3.0-beta.1",
3
+ "version": "2.4.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
+ }