@canva/design 2.2.0-beta.1 → 2.2.1-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 +169 -257
- package/lib/cjs/sdk/design/beta.js +1 -2
- package/lib/cjs/sdk/design/public.js +3 -9
- package/lib/esm/sdk/design/beta.js +1 -2
- package/lib/esm/sdk/design/public.js +3 -9
- package/package.json +1 -1
package/beta.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const addAudioTrack: (audioTrack: AudioTrack) => Promise<void>;
|
|
|
10
10
|
* Add element to responsive documents, which slot things into a text stream
|
|
11
11
|
*/
|
|
12
12
|
export declare const addElementAtCursor: (
|
|
13
|
-
element: ElementAtCursor
|
|
13
|
+
element: ElementAtCursor
|
|
14
14
|
) => Promise<void>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -18,7 +18,7 @@ export declare const addElementAtCursor: (
|
|
|
18
18
|
* Add element to fixed designs, which use a coordinate-based positioning system.
|
|
19
19
|
*/
|
|
20
20
|
export declare const addElementAtPoint: (
|
|
21
|
-
element: DesignElement | ElementAtPoint
|
|
21
|
+
element: DesignElement | ElementAtPoint
|
|
22
22
|
) => Promise<void>;
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -145,7 +145,7 @@ export declare type AppElementRenderer<A extends AppElementData> = (
|
|
|
145
145
|
* @public
|
|
146
146
|
* An array of one or more elements to render as output of an app element.
|
|
147
147
|
*/
|
|
148
|
-
export declare type AppElementRendererOutput =
|
|
148
|
+
export declare type AppElementRendererOutput = GroupContentAtPoint[];
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
* @public
|
|
@@ -225,7 +225,7 @@ export declare type Bounds = {
|
|
|
225
225
|
* @remarks
|
|
226
226
|
* The position and dimensions are relative to the container.
|
|
227
227
|
*/
|
|
228
|
-
export declare type Box =
|
|
228
|
+
export declare type Box = Point & (WidthAndHeight | Width | Height);
|
|
229
229
|
|
|
230
230
|
/**
|
|
231
231
|
* @public
|
|
@@ -355,7 +355,7 @@ export declare type Coordinates = {
|
|
|
355
355
|
* @public
|
|
356
356
|
* Creates a new RichtextRange object, which contains methods to manipulate text.
|
|
357
357
|
*/
|
|
358
|
-
export declare
|
|
358
|
+
export declare const createRichtextRange: () => RichtextRange;
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* @beta
|
|
@@ -695,7 +695,7 @@ export declare namespace DesignEditing {
|
|
|
695
695
|
/**
|
|
696
696
|
* A unique identifier that points to an image asset in Canva's backend.
|
|
697
697
|
*/
|
|
698
|
-
imageRef:
|
|
698
|
+
imageRef: ImageRef;
|
|
699
699
|
/**
|
|
700
700
|
* If `true`, the image is flipped horizontally.
|
|
701
701
|
*/
|
|
@@ -717,7 +717,7 @@ export declare namespace DesignEditing {
|
|
|
717
717
|
/**
|
|
718
718
|
* A unique identifier that points to a video asset in Canva's backend.
|
|
719
719
|
*/
|
|
720
|
-
videoRef:
|
|
720
|
+
videoRef: VideoRef;
|
|
721
721
|
/**
|
|
722
722
|
* If `true`, the video is flipped horizontally.
|
|
723
723
|
*/
|
|
@@ -1073,7 +1073,15 @@ export declare namespace DesignEditing {
|
|
|
1073
1073
|
* @public
|
|
1074
1074
|
* An element that's natively supported by the Canva editor.
|
|
1075
1075
|
*/
|
|
1076
|
-
export declare type DesignElement =
|
|
1076
|
+
export declare type DesignElement =
|
|
1077
|
+
| ImageElement
|
|
1078
|
+
| VideoElement
|
|
1079
|
+
| EmbedElement
|
|
1080
|
+
| TextElement
|
|
1081
|
+
| ShapeElement
|
|
1082
|
+
| GroupElement
|
|
1083
|
+
| RichtextElement
|
|
1084
|
+
| TableElement;
|
|
1077
1085
|
|
|
1078
1086
|
/**
|
|
1079
1087
|
* @beta
|
|
@@ -1223,14 +1231,20 @@ export declare type ElementAtCursor =
|
|
|
1223
1231
|
| VideoElement
|
|
1224
1232
|
| EmbedElement
|
|
1225
1233
|
| TextElement
|
|
1226
|
-
| RichtextElement
|
|
1234
|
+
| RichtextElement
|
|
1235
|
+
| TableElement;
|
|
1227
1236
|
|
|
1228
1237
|
/**
|
|
1229
1238
|
* @public
|
|
1230
1239
|
* An element that's natively supported by the Canva editor and has positional properties.
|
|
1231
1240
|
*/
|
|
1232
1241
|
export declare type ElementAtPoint =
|
|
1233
|
-
|
|
|
1242
|
+
| ImageElementAtPoint
|
|
1243
|
+
| VideoElementAtPoint
|
|
1244
|
+
| EmbedElementAtPoint
|
|
1245
|
+
| TextElementAtPoint
|
|
1246
|
+
| ShapeElementAtPoint
|
|
1247
|
+
| GroupElementAtPoint
|
|
1234
1248
|
| RichtextElementAtPoint;
|
|
1235
1249
|
|
|
1236
1250
|
/**
|
|
@@ -1274,13 +1288,27 @@ export declare type EmbedDragConfig = {
|
|
|
1274
1288
|
* @public
|
|
1275
1289
|
* An element that renders rich media, such as a YouTube video.
|
|
1276
1290
|
*/
|
|
1277
|
-
export declare type EmbedElement =
|
|
1291
|
+
export declare type EmbedElement = {
|
|
1292
|
+
/**
|
|
1293
|
+
* The type of element.
|
|
1294
|
+
*/
|
|
1295
|
+
type: "embed";
|
|
1296
|
+
/**
|
|
1297
|
+
* The URL of the rich media.
|
|
1298
|
+
*
|
|
1299
|
+
* @remarks
|
|
1300
|
+
* This URL must be supported by the Iframely API.
|
|
1301
|
+
*/
|
|
1302
|
+
url: string;
|
|
1303
|
+
};
|
|
1278
1304
|
|
|
1279
1305
|
/**
|
|
1280
1306
|
* @public
|
|
1281
1307
|
* An element that renders rich media, such as a YouTube video, and has positional properties.
|
|
1282
1308
|
*/
|
|
1283
|
-
export declare type EmbedElementAtPoint =
|
|
1309
|
+
export declare type EmbedElementAtPoint = EmbedElement &
|
|
1310
|
+
Point &
|
|
1311
|
+
(WidthAndHeight | Width | Height);
|
|
1284
1312
|
|
|
1285
1313
|
/**
|
|
1286
1314
|
* @public
|
|
@@ -1482,25 +1510,43 @@ export declare const getDefaultPageDimensions: () => Promise<
|
|
|
1482
1510
|
* @public
|
|
1483
1511
|
* Retrieves a signed JWT that contains the Design ID, App ID and User ID.
|
|
1484
1512
|
*/
|
|
1485
|
-
export declare
|
|
1513
|
+
export declare const getDesignToken: () => Promise<DesignToken>;
|
|
1486
1514
|
|
|
1487
1515
|
/**
|
|
1488
1516
|
* @public
|
|
1489
1517
|
* An element that's natively supported by the Canva editor, can exist within a group, and has positional properties.
|
|
1490
1518
|
*/
|
|
1491
|
-
export declare type GroupContentAtPoint =
|
|
1519
|
+
export declare type GroupContentAtPoint = Exclude<
|
|
1520
|
+
ElementAtPoint,
|
|
1521
|
+
GroupElementAtPoint
|
|
1522
|
+
>;
|
|
1492
1523
|
|
|
1493
1524
|
/**
|
|
1494
1525
|
* @public
|
|
1495
1526
|
* An element that contains two or more elements.
|
|
1496
1527
|
*/
|
|
1497
|
-
export declare type GroupElement =
|
|
1528
|
+
export declare type GroupElement = {
|
|
1529
|
+
/**
|
|
1530
|
+
* The type of element.
|
|
1531
|
+
*/
|
|
1532
|
+
type: "group";
|
|
1533
|
+
/**
|
|
1534
|
+
* The elements to render within the group.
|
|
1535
|
+
*
|
|
1536
|
+
* @remarks
|
|
1537
|
+
* - Each element within a group must have dimensions and a position.
|
|
1538
|
+
* - The dimensions and positions are relative to the dimensions and positions of the group.
|
|
1539
|
+
*/
|
|
1540
|
+
children: GroupContentAtPoint[];
|
|
1541
|
+
};
|
|
1498
1542
|
|
|
1499
1543
|
/**
|
|
1500
1544
|
* @public
|
|
1501
1545
|
* An element that contains two or more elements and has positional properties.
|
|
1502
1546
|
*/
|
|
1503
|
-
export declare type GroupElementAtPoint =
|
|
1547
|
+
export declare type GroupElementAtPoint = GroupElement &
|
|
1548
|
+
Point &
|
|
1549
|
+
(WidthAndHeight | Width | Height);
|
|
1504
1550
|
|
|
1505
1551
|
/**
|
|
1506
1552
|
* A set of dimensions with an auto-calculated width.
|
|
@@ -1540,13 +1586,45 @@ export declare type ImageDragConfigForElement<E extends Element> =
|
|
|
1540
1586
|
* @public
|
|
1541
1587
|
* An element that renders image content.
|
|
1542
1588
|
*/
|
|
1543
|
-
export declare type ImageElement =
|
|
1589
|
+
export declare type ImageElement = {
|
|
1590
|
+
/**
|
|
1591
|
+
* The type of element.
|
|
1592
|
+
*/
|
|
1593
|
+
type: "image";
|
|
1594
|
+
/**
|
|
1595
|
+
* A description of the image content.
|
|
1596
|
+
*/
|
|
1597
|
+
altText: AltText | undefined;
|
|
1598
|
+
} & (
|
|
1599
|
+
| {
|
|
1600
|
+
/**
|
|
1601
|
+
* A data URL that contains the image data.
|
|
1602
|
+
*/
|
|
1603
|
+
dataUrl: string;
|
|
1604
|
+
/**
|
|
1605
|
+
* A unique identifier that points to an image asset in Canva's backend.
|
|
1606
|
+
*/
|
|
1607
|
+
ref?: never;
|
|
1608
|
+
}
|
|
1609
|
+
| {
|
|
1610
|
+
/**
|
|
1611
|
+
* A data URL that contains the image data.
|
|
1612
|
+
*/
|
|
1613
|
+
dataUrl?: never;
|
|
1614
|
+
/**
|
|
1615
|
+
* A unique identifier that points to an image asset in Canva's backend.
|
|
1616
|
+
*/
|
|
1617
|
+
ref: ImageRef;
|
|
1618
|
+
}
|
|
1619
|
+
);
|
|
1544
1620
|
|
|
1545
1621
|
/**
|
|
1546
1622
|
* @public
|
|
1547
1623
|
* An element that renders image content and has positional properties.
|
|
1548
1624
|
*/
|
|
1549
|
-
export declare type ImageElementAtPoint =
|
|
1625
|
+
export declare type ImageElementAtPoint = ImageElement &
|
|
1626
|
+
Point &
|
|
1627
|
+
(WidthAndHeight | Width | Height);
|
|
1550
1628
|
|
|
1551
1629
|
/**
|
|
1552
1630
|
* @public
|
|
@@ -1586,9 +1664,9 @@ export declare type ImageRef = string & {
|
|
|
1586
1664
|
* @public
|
|
1587
1665
|
* @param appElementConfig - Configuration for an AppElementClient
|
|
1588
1666
|
*/
|
|
1589
|
-
export declare
|
|
1667
|
+
export declare const initAppElement: <A extends AppElementData>(
|
|
1590
1668
|
appElementConfig: AppElementClientConfiguration<A>
|
|
1591
|
-
)
|
|
1669
|
+
) => AppElementClient<A>;
|
|
1592
1670
|
|
|
1593
1671
|
/**
|
|
1594
1672
|
* @public
|
|
@@ -1636,7 +1714,7 @@ export declare type InlineFormatting = {
|
|
|
1636
1714
|
};
|
|
1637
1715
|
|
|
1638
1716
|
/**
|
|
1639
|
-
* @deprecated
|
|
1717
|
+
* @deprecated The type has been superseded by `DesignElement`.
|
|
1640
1718
|
* @public
|
|
1641
1719
|
* An element that's natively supported by the Canva editor.
|
|
1642
1720
|
*/
|
|
@@ -1678,279 +1756,91 @@ export declare type NativeElementWithBox =
|
|
|
1678
1756
|
* @public
|
|
1679
1757
|
* An element that renders rich media, such as a YouTube video.
|
|
1680
1758
|
*/
|
|
1681
|
-
export declare type NativeEmbedElement =
|
|
1682
|
-
/**
|
|
1683
|
-
* The type of element.
|
|
1684
|
-
*/
|
|
1685
|
-
type: "embed";
|
|
1686
|
-
/**
|
|
1687
|
-
* The URL of the rich media.
|
|
1688
|
-
*
|
|
1689
|
-
* @remarks
|
|
1690
|
-
* This URL must be supported by the Iframely API.
|
|
1691
|
-
*/
|
|
1692
|
-
url: string;
|
|
1693
|
-
};
|
|
1759
|
+
export declare type NativeEmbedElement = EmbedElement;
|
|
1694
1760
|
|
|
1695
1761
|
/**
|
|
1696
1762
|
* @deprecated The type has been superseded by `EmbedElementAtPoint`.
|
|
1697
1763
|
* @public
|
|
1698
1764
|
* An element that renders rich media, such as a YouTube video, and has positional properties.
|
|
1699
1765
|
*/
|
|
1700
|
-
export declare type NativeEmbedElementWithBox =
|
|
1701
|
-
/**
|
|
1702
|
-
* The type of element.
|
|
1703
|
-
*/
|
|
1704
|
-
type: "embed";
|
|
1705
|
-
/**
|
|
1706
|
-
* The URL of the rich media.
|
|
1707
|
-
*
|
|
1708
|
-
* @remarks
|
|
1709
|
-
* This URL must be supported by the Iframely API.
|
|
1710
|
-
*/
|
|
1711
|
-
url: string;
|
|
1712
|
-
} & Box;
|
|
1766
|
+
export declare type NativeEmbedElementWithBox = EmbedElementAtPoint;
|
|
1713
1767
|
|
|
1714
1768
|
/**
|
|
1715
1769
|
* @deprecated The type has been superseded by `GroupElement`.
|
|
1716
1770
|
* @public
|
|
1717
1771
|
* An element that contains two or more elements.
|
|
1718
1772
|
*/
|
|
1719
|
-
export declare type NativeGroupElement =
|
|
1720
|
-
/**
|
|
1721
|
-
* The type of element.
|
|
1722
|
-
*/
|
|
1723
|
-
type: "group";
|
|
1724
|
-
/**
|
|
1725
|
-
* The elements to render within the group.
|
|
1726
|
-
*
|
|
1727
|
-
* @remarks
|
|
1728
|
-
* - Each element within a group must have dimensions and a position.
|
|
1729
|
-
* - The dimensions and positions are relative to the dimensions and positions of the group.
|
|
1730
|
-
*/
|
|
1731
|
-
children: NativeSimpleElementWithBox[];
|
|
1732
|
-
};
|
|
1773
|
+
export declare type NativeGroupElement = GroupElement;
|
|
1733
1774
|
|
|
1734
1775
|
/**
|
|
1735
1776
|
* @deprecated The type has been superseded by `GroupElementAtPoint`.
|
|
1736
1777
|
* @public
|
|
1737
1778
|
* An element that contains two or more elements and has positional properties.
|
|
1738
1779
|
*/
|
|
1739
|
-
export declare type NativeGroupElementWithBox =
|
|
1740
|
-
/**
|
|
1741
|
-
* The type of element.
|
|
1742
|
-
*/
|
|
1743
|
-
type: "group";
|
|
1744
|
-
/**
|
|
1745
|
-
* The elements to render within the group.
|
|
1746
|
-
*
|
|
1747
|
-
* @remarks
|
|
1748
|
-
* - Each element within a group must have dimensions and a position.
|
|
1749
|
-
* - The dimensions and positions are relative to the dimensions and positions of the group.
|
|
1750
|
-
*/
|
|
1751
|
-
children: NativeSimpleElementWithBox[];
|
|
1752
|
-
} & Box;
|
|
1780
|
+
export declare type NativeGroupElementWithBox = GroupElementAtPoint;
|
|
1753
1781
|
|
|
1754
1782
|
/**
|
|
1755
1783
|
* @deprecated The type has been superseded by `ImageElement`.
|
|
1756
1784
|
* @public
|
|
1757
1785
|
* An element that renders image content.
|
|
1758
1786
|
*/
|
|
1759
|
-
export declare type NativeImageElement =
|
|
1760
|
-
/**
|
|
1761
|
-
* The type of element.
|
|
1762
|
-
*/
|
|
1763
|
-
type: "image";
|
|
1764
|
-
/**
|
|
1765
|
-
* A description of the image content.
|
|
1766
|
-
*/
|
|
1767
|
-
altText: AltText | undefined;
|
|
1768
|
-
} & (
|
|
1769
|
-
| {
|
|
1770
|
-
/**
|
|
1771
|
-
* A data URL that contains the image data.
|
|
1772
|
-
*/
|
|
1773
|
-
dataUrl: string;
|
|
1774
|
-
/**
|
|
1775
|
-
* A unique identifier that points to an image asset in Canva's backend.
|
|
1776
|
-
*/
|
|
1777
|
-
ref?: never;
|
|
1778
|
-
}
|
|
1779
|
-
| {
|
|
1780
|
-
/**
|
|
1781
|
-
* A data URL that contains the image data.
|
|
1782
|
-
*/
|
|
1783
|
-
dataUrl?: never;
|
|
1784
|
-
/**
|
|
1785
|
-
* A unique identifier that points to an image asset in Canva's backend.
|
|
1786
|
-
*/
|
|
1787
|
-
ref: ImageRef;
|
|
1788
|
-
}
|
|
1789
|
-
);
|
|
1787
|
+
export declare type NativeImageElement = ImageElement;
|
|
1790
1788
|
|
|
1791
1789
|
/**
|
|
1792
1790
|
* @deprecated The type has been superseded by `ImageElementAtPoint`.
|
|
1793
1791
|
* @public
|
|
1794
1792
|
* An element that renders image content and has positional properties.
|
|
1795
1793
|
*/
|
|
1796
|
-
export declare type NativeImageElementWithBox =
|
|
1794
|
+
export declare type NativeImageElementWithBox = ImageElementAtPoint;
|
|
1797
1795
|
|
|
1798
1796
|
/**
|
|
1799
1797
|
* @deprecated The type has been superseded by `ShapeElement`.
|
|
1800
1798
|
* @public
|
|
1801
1799
|
* An element that renders a vector shape.
|
|
1802
1800
|
*/
|
|
1803
|
-
export declare type NativeShapeElement =
|
|
1804
|
-
/**
|
|
1805
|
-
* The type of element.
|
|
1806
|
-
*/
|
|
1807
|
-
type: "shape";
|
|
1808
|
-
/**
|
|
1809
|
-
* Options for configuring the scale and cropping of the shape.
|
|
1810
|
-
*/
|
|
1811
|
-
viewBox: ShapeViewBox;
|
|
1812
|
-
/**
|
|
1813
|
-
* The paths that define the structure of the shape.
|
|
1814
|
-
*
|
|
1815
|
-
* @remarks
|
|
1816
|
-
* - There must be between 1 and 30 paths (inclusive).
|
|
1817
|
-
* - The maximum combined size of all paths must not exceed 2kb.
|
|
1818
|
-
* - The maximum number of unique fill colors across all paths is 6.
|
|
1819
|
-
*/
|
|
1820
|
-
paths: ShapePath[];
|
|
1821
|
-
};
|
|
1801
|
+
export declare type NativeShapeElement = ShapeElement;
|
|
1822
1802
|
|
|
1823
1803
|
/**
|
|
1824
1804
|
* @deprecated The type has been superseded by `ShapeElementAtPoint`.
|
|
1825
1805
|
* @public
|
|
1826
1806
|
* An element that renders a vector shape and has positional properties.
|
|
1827
1807
|
*/
|
|
1828
|
-
export declare type NativeShapeElementWithBox =
|
|
1829
|
-
/**
|
|
1830
|
-
* The type of element.
|
|
1831
|
-
*/
|
|
1832
|
-
type: "shape";
|
|
1833
|
-
/**
|
|
1834
|
-
* Options for configuring the scale and cropping of a shape.
|
|
1835
|
-
*/
|
|
1836
|
-
viewBox: ShapeViewBox;
|
|
1837
|
-
/**
|
|
1838
|
-
* The paths that define the structure of the shape.
|
|
1839
|
-
*
|
|
1840
|
-
* @remarks
|
|
1841
|
-
* - There must be between 1 and 30 paths (inclusive).
|
|
1842
|
-
* - The maximum combined size of all paths must not exceed 2kb.
|
|
1843
|
-
* - The maximum number of unique fill colors across all paths is 6.
|
|
1844
|
-
*/
|
|
1845
|
-
paths: ShapePath[];
|
|
1846
|
-
} & Box;
|
|
1808
|
+
export declare type NativeShapeElementWithBox = ShapeElementAtPoint;
|
|
1847
1809
|
|
|
1848
1810
|
/**
|
|
1849
1811
|
* @deprecated The type has been superseded by `GroupContentAtPoint`.
|
|
1850
1812
|
* @public
|
|
1851
1813
|
* An element that's natively supported by the Canva editor, can exist within a group, and has positional properties.
|
|
1852
1814
|
*/
|
|
1853
|
-
export declare type NativeSimpleElementWithBox =
|
|
1854
|
-
NativeElementWithBox,
|
|
1855
|
-
NativeGroupElementWithBox
|
|
1856
|
-
>;
|
|
1815
|
+
export declare type NativeSimpleElementWithBox = GroupContentAtPoint;
|
|
1857
1816
|
|
|
1858
1817
|
/**
|
|
1859
1818
|
* @deprecated The type has been superseded by `TextElement`.
|
|
1860
1819
|
* @public
|
|
1861
1820
|
* An element that renders text content.
|
|
1862
1821
|
*/
|
|
1863
|
-
export declare type NativeTextElement =
|
|
1864
|
-
/**
|
|
1865
|
-
* The type of element.
|
|
1866
|
-
*/
|
|
1867
|
-
type: "text";
|
|
1868
|
-
/**
|
|
1869
|
-
* The text content.
|
|
1870
|
-
*
|
|
1871
|
-
* @remarks
|
|
1872
|
-
* Only the first element in this array is used.
|
|
1873
|
-
*/
|
|
1874
|
-
children: string[];
|
|
1875
|
-
} & TextAttributes;
|
|
1822
|
+
export declare type NativeTextElement = TextElement;
|
|
1876
1823
|
|
|
1877
1824
|
/**
|
|
1878
1825
|
* @deprecated The type has been superseded by `TextElementAtPoint`.
|
|
1879
1826
|
* @public
|
|
1880
1827
|
* An element that renders text content and has positional properties.
|
|
1881
1828
|
*/
|
|
1882
|
-
export declare type NativeTextElementWithBox =
|
|
1883
|
-
/**
|
|
1884
|
-
* The type of element.
|
|
1885
|
-
*/
|
|
1886
|
-
type: "text";
|
|
1887
|
-
/**
|
|
1888
|
-
* The text content.
|
|
1889
|
-
*
|
|
1890
|
-
* @remarks
|
|
1891
|
-
* Only the first element in this array is used.
|
|
1892
|
-
*/
|
|
1893
|
-
children: [string];
|
|
1894
|
-
/**
|
|
1895
|
-
* The width of the element, in pixels.
|
|
1896
|
-
*
|
|
1897
|
-
* @remarks
|
|
1898
|
-
* - Minimum: 0
|
|
1899
|
-
* - Maximum: 32767
|
|
1900
|
-
*/
|
|
1901
|
-
width?: number;
|
|
1902
|
-
/**
|
|
1903
|
-
* The distance from the top edge of the container, in pixels.
|
|
1904
|
-
*
|
|
1905
|
-
* @remarks
|
|
1906
|
-
* - Minimum: -32768
|
|
1907
|
-
* - Maximum: 32767
|
|
1908
|
-
*/
|
|
1909
|
-
top: number;
|
|
1910
|
-
/**
|
|
1911
|
-
* The distance from the left edge of the container, in pixels.
|
|
1912
|
-
*
|
|
1913
|
-
* @remarks
|
|
1914
|
-
* - Minimum: -32768
|
|
1915
|
-
* - Maximum: 32767
|
|
1916
|
-
*/
|
|
1917
|
-
left: number;
|
|
1918
|
-
/**
|
|
1919
|
-
* The rotation of the element, in degrees.
|
|
1920
|
-
*
|
|
1921
|
-
* @remarks
|
|
1922
|
-
* - Minimum: -180
|
|
1923
|
-
* - Maximum: 180
|
|
1924
|
-
*/
|
|
1925
|
-
rotation?: number;
|
|
1926
|
-
} & TextAttributes;
|
|
1829
|
+
export declare type NativeTextElementWithBox = TextElementAtPoint;
|
|
1927
1830
|
|
|
1928
1831
|
/**
|
|
1929
1832
|
* @deprecated The type has been superseded by `VideoElement`.
|
|
1930
1833
|
* @public
|
|
1931
1834
|
* An element that renders video content.
|
|
1932
1835
|
*/
|
|
1933
|
-
export declare type NativeVideoElement =
|
|
1934
|
-
/**
|
|
1935
|
-
* The type of element.
|
|
1936
|
-
*/
|
|
1937
|
-
type: "video";
|
|
1938
|
-
/**
|
|
1939
|
-
* A unique identifier that points to a video asset in Canva's backend.
|
|
1940
|
-
*/
|
|
1941
|
-
ref: VideoRef;
|
|
1942
|
-
/**
|
|
1943
|
-
* A description of the video content.
|
|
1944
|
-
*/
|
|
1945
|
-
altText: AltText | undefined;
|
|
1946
|
-
};
|
|
1836
|
+
export declare type NativeVideoElement = VideoElement;
|
|
1947
1837
|
|
|
1948
1838
|
/**
|
|
1949
1839
|
* @deprecated The type has been superseded by `VideoElementAtPoint`.
|
|
1950
1840
|
* @public
|
|
1951
1841
|
* An element that renders video content and has positional properties.
|
|
1952
1842
|
*/
|
|
1953
|
-
export declare type NativeVideoElementWithBox =
|
|
1843
|
+
export declare type NativeVideoElementWithBox = VideoElementAtPoint;
|
|
1954
1844
|
|
|
1955
1845
|
/**
|
|
1956
1846
|
* An object primitive data type that can be used in app element data.
|
|
@@ -2100,13 +1990,12 @@ export declare type PathStroke = {
|
|
|
2100
1990
|
* @public
|
|
2101
1991
|
* A position, set of dimensions, and rotation.
|
|
2102
1992
|
*/
|
|
2103
|
-
export declare type Placement =
|
|
1993
|
+
export declare type Placement = Point & (WidthAndHeight | Width | Height);
|
|
2104
1994
|
|
|
2105
1995
|
/**
|
|
2106
|
-
* @deprecated
|
|
2107
1996
|
* A position and rotation.
|
|
2108
1997
|
*/
|
|
2109
|
-
declare type
|
|
1998
|
+
declare type Point = {
|
|
2110
1999
|
/**
|
|
2111
2000
|
* The distance from the top edge of the container, in pixels.
|
|
2112
2001
|
*
|
|
@@ -2471,13 +2360,33 @@ export declare const setCurrentPageBackground: (
|
|
|
2471
2360
|
* @public
|
|
2472
2361
|
* An element that renders a vector shape.
|
|
2473
2362
|
*/
|
|
2474
|
-
export declare type ShapeElement =
|
|
2363
|
+
export declare type ShapeElement = {
|
|
2364
|
+
/**
|
|
2365
|
+
* The type of element.
|
|
2366
|
+
*/
|
|
2367
|
+
type: "shape";
|
|
2368
|
+
/**
|
|
2369
|
+
* Options for configuring the scale and cropping of the shape.
|
|
2370
|
+
*/
|
|
2371
|
+
viewBox: ShapeViewBox;
|
|
2372
|
+
/**
|
|
2373
|
+
* The paths that define the structure of the shape.
|
|
2374
|
+
*
|
|
2375
|
+
* @remarks
|
|
2376
|
+
* - There must be between 1 and 30 paths (inclusive).
|
|
2377
|
+
* - The maximum combined size of all paths must not exceed 2kb.
|
|
2378
|
+
* - The maximum number of unique fill colors across all paths is 6.
|
|
2379
|
+
*/
|
|
2380
|
+
paths: ShapePath[];
|
|
2381
|
+
};
|
|
2475
2382
|
|
|
2476
2383
|
/**
|
|
2477
2384
|
* @public
|
|
2478
2385
|
* An element that renders a vector shape and has positional properties.
|
|
2479
2386
|
*/
|
|
2480
|
-
export declare type ShapeElementAtPoint =
|
|
2387
|
+
export declare type ShapeElementAtPoint = ShapeElement &
|
|
2388
|
+
Point &
|
|
2389
|
+
(WidthAndHeight | Width | Height);
|
|
2481
2390
|
|
|
2482
2391
|
/**
|
|
2483
2392
|
* @public
|
|
@@ -2613,39 +2522,15 @@ export declare type TextAttributes = {
|
|
|
2613
2522
|
* @public
|
|
2614
2523
|
* The dimensions, position, and rotation of a text element.
|
|
2615
2524
|
*/
|
|
2616
|
-
declare type TextBox = {
|
|
2525
|
+
declare type TextBox = Point & {
|
|
2617
2526
|
/**
|
|
2618
|
-
* The width, in pixels.
|
|
2527
|
+
* The width of the element, in pixels.
|
|
2619
2528
|
*
|
|
2620
2529
|
* @remarks
|
|
2621
2530
|
* - Minimum: 0
|
|
2622
2531
|
* - Maximum: 32767
|
|
2623
2532
|
*/
|
|
2624
2533
|
width?: number;
|
|
2625
|
-
/**
|
|
2626
|
-
* The distance from the top edge of the container, in pixels.
|
|
2627
|
-
*
|
|
2628
|
-
* @remarks
|
|
2629
|
-
* - Minimum: -32767
|
|
2630
|
-
* - Maximum: 32767
|
|
2631
|
-
*/
|
|
2632
|
-
top: number;
|
|
2633
|
-
/**
|
|
2634
|
-
* The distance from the left edge of the container, in pixels.
|
|
2635
|
-
*
|
|
2636
|
-
* @remarks
|
|
2637
|
-
* - Minimum: -32767
|
|
2638
|
-
* - Maximum: 32767
|
|
2639
|
-
*/
|
|
2640
|
-
left: number;
|
|
2641
|
-
/**
|
|
2642
|
-
* The rotation, in degrees.
|
|
2643
|
-
*
|
|
2644
|
-
* @remarks
|
|
2645
|
-
* - Minimum: -180
|
|
2646
|
-
* - Maximum: 180
|
|
2647
|
-
*/
|
|
2648
|
-
rotation?: number;
|
|
2649
2534
|
};
|
|
2650
2535
|
|
|
2651
2536
|
/**
|
|
@@ -2692,13 +2577,25 @@ export declare type TextDragConfig = {
|
|
|
2692
2577
|
* @public
|
|
2693
2578
|
* An element that renders text content.
|
|
2694
2579
|
*/
|
|
2695
|
-
export declare type TextElement =
|
|
2580
|
+
export declare type TextElement = {
|
|
2581
|
+
/**
|
|
2582
|
+
* The type of element.
|
|
2583
|
+
*/
|
|
2584
|
+
type: "text";
|
|
2585
|
+
/**
|
|
2586
|
+
* The text content.
|
|
2587
|
+
*
|
|
2588
|
+
* @remarks
|
|
2589
|
+
* Only the first element in this array is used.
|
|
2590
|
+
*/
|
|
2591
|
+
children: string[];
|
|
2592
|
+
} & TextAttributes;
|
|
2696
2593
|
|
|
2697
2594
|
/**
|
|
2698
2595
|
* @public
|
|
2699
2596
|
* An element that renders text content and has positional properties.
|
|
2700
2597
|
*/
|
|
2701
|
-
export declare type TextElementAtPoint =
|
|
2598
|
+
export declare type TextElementAtPoint = TextElement & TextAttributes & TextBox;
|
|
2702
2599
|
|
|
2703
2600
|
/**
|
|
2704
2601
|
* @public
|
|
@@ -2834,13 +2731,28 @@ export declare type VideoDragConfigForElement<E extends Element> =
|
|
|
2834
2731
|
* @public
|
|
2835
2732
|
* An element that renders video content.
|
|
2836
2733
|
*/
|
|
2837
|
-
export declare type VideoElement =
|
|
2734
|
+
export declare type VideoElement = {
|
|
2735
|
+
/**
|
|
2736
|
+
* The type of element.
|
|
2737
|
+
*/
|
|
2738
|
+
type: "video";
|
|
2739
|
+
/**
|
|
2740
|
+
* A unique identifier that points to a video asset in Canva's backend.
|
|
2741
|
+
*/
|
|
2742
|
+
ref: VideoRef;
|
|
2743
|
+
/**
|
|
2744
|
+
* A description of the video content.
|
|
2745
|
+
*/
|
|
2746
|
+
altText: AltText | undefined;
|
|
2747
|
+
};
|
|
2838
2748
|
|
|
2839
2749
|
/**
|
|
2840
2750
|
* @public
|
|
2841
2751
|
* An element that renders video content and has positional properties.
|
|
2842
2752
|
*/
|
|
2843
|
-
export declare type VideoElementAtPoint =
|
|
2753
|
+
export declare type VideoElementAtPoint = VideoElement &
|
|
2754
|
+
Point &
|
|
2755
|
+
(WidthAndHeight | Width | Height);
|
|
2844
2756
|
|
|
2845
2757
|
/**
|
|
2846
2758
|
* @public
|
|
@@ -34,5 +34,4 @@ var _window___canva___sdkRegistration, _window___canva__;
|
|
|
34
34
|
const { canva_sdk } = window;
|
|
35
35
|
const readContent = canva_sdk.design.v2.designInteraction.readContent;
|
|
36
36
|
const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
37
|
-
(_window___canva__ =
|
|
38
|
-
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.1.0', 'beta');
|
|
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.2.1', 'beta');
|
|
@@ -68,12 +68,6 @@ const addElementAtPoint = canva_sdk.design.v2.designInteraction.addElementAtPoin
|
|
|
68
68
|
const addElementAtCursor = canva_sdk.design.v2.designInteraction.addElementAtCursor;
|
|
69
69
|
const addAudioTrack = canva_sdk.design.v2.designInteraction.addAudioTrack;
|
|
70
70
|
const getCurrentPageContext = canva_sdk.design.v2.designInteraction.getCurrentPageContext;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function getDesignToken() {
|
|
75
|
-
return canva_sdk.design.v2.designInteraction.getDesignToken();
|
|
76
|
-
}
|
|
77
|
-
function createRichtextRange() {
|
|
78
|
-
return canva_sdk.design.v2.designInteraction.createRichtextRange();
|
|
79
|
-
}
|
|
71
|
+
const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
|
|
72
|
+
const getDesignToken = canva_sdk.design.v2.designInteraction.getDesignToken;
|
|
73
|
+
const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
|
|
@@ -3,5 +3,4 @@ const { canva_sdk } = window;
|
|
|
3
3
|
export const readContent = canva_sdk.design.v2.designInteraction.readContent;
|
|
4
4
|
export const openDesign = canva_sdk.design.v2.designInteraction.openDesign;
|
|
5
5
|
export * from './public';
|
|
6
|
-
(_window___canva__ =
|
|
7
|
-
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.1.0', 'beta');
|
|
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.2.1', 'beta');
|
|
@@ -11,12 +11,6 @@ export const addElementAtPoint = canva_sdk.design.v2.designInteraction.addElemen
|
|
|
11
11
|
export const addElementAtCursor = canva_sdk.design.v2.designInteraction.addElementAtCursor;
|
|
12
12
|
export const addAudioTrack = canva_sdk.design.v2.designInteraction.addAudioTrack;
|
|
13
13
|
export const getCurrentPageContext = canva_sdk.design.v2.designInteraction.getCurrentPageContext;
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export function getDesignToken() {
|
|
18
|
-
return canva_sdk.design.v2.designInteraction.getDesignToken();
|
|
19
|
-
}
|
|
20
|
-
export function createRichtextRange() {
|
|
21
|
-
return canva_sdk.design.v2.designInteraction.createRichtextRange();
|
|
22
|
-
}
|
|
14
|
+
export const initAppElement = canva_sdk.design.v2.designInteraction.initAppElement;
|
|
15
|
+
export const getDesignToken = canva_sdk.design.v2.designInteraction.getDesignToken;
|
|
16
|
+
export const createRichtextRange = canva_sdk.design.v2.designInteraction.createRichtextRange;
|