@canva/design 2.6.0-beta.1 → 2.6.0

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.
@@ -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 ContentType_2 = "richtext";
355
+ export declare type ContentType = "richtext";
384
356
 
385
357
  /**
386
358
  * @public
@@ -1922,40 +1894,6 @@ export declare type DesignElement =
1922
1894
  | RichtextElement
1923
1895
  | TableElement;
1924
1896
 
1925
- /**
1926
- * @beta
1927
- * Information about the design.
1928
- */
1929
- export declare type DesignMetadata = {
1930
- /**
1931
- * The title of the user's design.
1932
- * @remarks
1933
- * This is optional and will be `undefined` if the user hasn't set a title.
1934
- */
1935
- title?: string;
1936
- /**
1937
- * The default dimensions that a new page will have when it is added to a design.
1938
- * It is possible for a user to resize a page without resizing the entire design, e.g. by clicking
1939
- * "Expand to Whiteboard". However, there will always be a single set of default dimensions for a
1940
- * design that is applied whenever a new page is created.
1941
- * @remarks
1942
- * This is optional and will be `undefined` if the design is unbounded (e.g. Whiteboard or Doc).
1943
- */
1944
- defaultPageDimensions?: PageDimensions;
1945
- /**
1946
- * The information associated with each page of the design.
1947
- * @remarks
1948
- * The order of pages is not guaranteed.
1949
- */
1950
- pageMetadata: Iterable<PageContext>;
1951
- /**
1952
- * The duration of the whole design in seconds.
1953
- * @remarks
1954
- * This is the precise value, which differs from what is displayed in the UI as duration in Canva UI is formatted differently.
1955
- */
1956
- durationInSeconds: number;
1957
- };
1958
-
1959
1897
  /**
1960
1898
  * @public
1961
1899
  * A callback for reading and updating part of a design.
@@ -2064,30 +2002,21 @@ export declare type DragStartEvent<E extends Element> = Pick<
2064
2002
  * @param callback - A callback for operating on the read content.
2065
2003
  */
2066
2004
  export declare const editContent: (
2067
- options: EditContentOptions_2,
2068
- callback: EditContentCallback_2,
2005
+ options: EditContentOptions,
2006
+ callback: EditContentCallback,
2069
2007
  ) => Promise<void>;
2070
2008
 
2071
- /**
2072
- * @beta
2073
- * A callback for reading and updating the requested design content.
2074
- * @param session - The result of reading the content in the design.
2075
- */
2076
- export declare type EditContentCallback = (
2077
- session: RichtextContentSession | ContentFillSession,
2078
- ) => Promise<void> | void;
2079
-
2080
2009
  /**
2081
2010
  * @public
2082
2011
  * A callback for reading and updating the requested design content.
2083
2012
  * @param session - The result of reading the content in the design.
2084
2013
  */
2085
- declare type EditContentCallback_2 = (
2014
+ export declare type EditContentCallback = (
2086
2015
  session: RichtextContentSession,
2087
2016
  ) => Promise<void> | void;
2088
2017
 
2089
2018
  /**
2090
- * @beta
2019
+ * @public
2091
2020
  * Options for configuring how the design content is read.
2092
2021
  */
2093
2022
  export declare type EditContentOptions = {
@@ -2097,17 +2026,6 @@ export declare type EditContentOptions = {
2097
2026
  contentType: ContentType;
2098
2027
  } & ContextOptions;
2099
2028
 
2100
- /**
2101
- * @public
2102
- * Options for configuring how the design content is read.
2103
- */
2104
- declare type EditContentOptions_2 = {
2105
- /**
2106
- * The type of content to edit from the user's design
2107
- */
2108
- contentType: ContentType_2;
2109
- } & ContextOptions;
2110
-
2111
2029
  /**
2112
2030
  * @public
2113
2031
  * Elements targeting a cursor are a subset of the base Element
@@ -2381,12 +2299,6 @@ export declare const getDefaultPageDimensions: () => Promise<
2381
2299
  Dimensions | undefined
2382
2300
  >;
2383
2301
 
2384
- /**
2385
- * @beta
2386
- * Retrieves information about the design.
2387
- */
2388
- export declare const getDesignMetadata: () => Promise<DesignMetadata>;
2389
-
2390
2302
  /**
2391
2303
  * @public
2392
2304
  * Retrieves a signed JWT that contains the Design ID, App ID and User ID.
@@ -3409,11 +3321,6 @@ export declare type TextDragConfig = {
3409
3321
  * @defaultValue "none"
3410
3322
  */
3411
3323
  decoration?: "none" | "underline";
3412
- /**
3413
- * @beta
3414
- * A unique identifier that points to a font asset in Canva's backend.
3415
- */
3416
- fontRef?: FontRef;
3417
3324
  };
3418
3325
 
3419
3326
  /**
@@ -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
- const { canva_sdk } = window;
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.0', '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.0', '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.0', 'beta');
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.0', 'ga');
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@canva/design",
3
- "version": "2.6.0-beta.1",
3
+ "version": "2.6.0",
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/beta.js",
11
- "module": "./lib/esm/sdk/design/beta.js",
10
+ "main": "./lib/cjs/sdk/design/index.js",
11
+ "module": "./lib/esm/sdk/design/index.js",
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./beta.d.ts",
15
- "require": "./lib/cjs/sdk/design/beta.js",
16
- "import": "./lib/esm/sdk/design/beta.js"
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/beta.d.ts",
20
- "require": "./lib/cjs/sdk/design/test/beta.js",
21
- "import": "./lib/esm/sdk/design/test/beta.js"
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": "./beta.d.ts"
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