taffy-js 0.2.10 → 0.2.11
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 +108 -12
- package/package.json +2 -2
- package/pkg/README.md +108 -12
- package/pkg/package.json +1 -1
- package/pkg/taffy_wasm.d.ts +302 -0
- package/pkg/taffy_wasm.js +541 -1
- package/pkg/taffy_wasm_bg.wasm +0 -0
- package/pkg/taffy_wasm_bg.wasm.d.ts +32 -0
package/pkg/taffy_wasm.js
CHANGED
|
@@ -512,6 +512,41 @@ export const FlexWrap = Object.freeze({
|
|
|
512
512
|
WrapReverse: 2, "2": "WrapReverse",
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
+
/**
|
|
516
|
+
* Grid auto flow enumeration
|
|
517
|
+
*
|
|
518
|
+
* Controls whether grid items are placed row-wise or column-wise, and whether
|
|
519
|
+
* the sparse or dense packing algorithm is used.
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* ```typescript
|
|
523
|
+
* import { GridAutoFlow } from 'taffy-js';
|
|
524
|
+
*
|
|
525
|
+
* style.gridAutoFlow = GridAutoFlow.Row; // Fill rows first
|
|
526
|
+
* style.gridAutoFlow = GridAutoFlow.Column; // Fill columns first
|
|
527
|
+
* style.gridAutoFlow = GridAutoFlow.RowDense; // Fill rows, pack densely
|
|
528
|
+
* ```
|
|
529
|
+
* @enum {0 | 1 | 2 | 3}
|
|
530
|
+
*/
|
|
531
|
+
export const GridAutoFlow = Object.freeze({
|
|
532
|
+
/**
|
|
533
|
+
* Items are placed by filling each row in turn, adding new rows as necessary
|
|
534
|
+
*/
|
|
535
|
+
Row: 0, "0": "Row",
|
|
536
|
+
/**
|
|
537
|
+
* Items are placed by filling each column in turn, adding new columns as necessary
|
|
538
|
+
*/
|
|
539
|
+
Column: 1, "1": "Column",
|
|
540
|
+
/**
|
|
541
|
+
* Combines `Row` with the dense packing algorithm
|
|
542
|
+
*/
|
|
543
|
+
RowDense: 2, "2": "RowDense",
|
|
544
|
+
/**
|
|
545
|
+
* Combines `Column` with the dense packing algorithm
|
|
546
|
+
*/
|
|
547
|
+
ColumnDense: 3, "3": "ColumnDense",
|
|
548
|
+
});
|
|
549
|
+
|
|
515
550
|
/**
|
|
516
551
|
* Main axis alignment enumeration
|
|
517
552
|
*
|
|
@@ -1005,6 +1040,20 @@ export class Style {
|
|
|
1005
1040
|
set margin(val) {
|
|
1006
1041
|
wasm.style_set_margin(this.__wbg_ptr, val);
|
|
1007
1042
|
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Gets the text-align property
|
|
1045
|
+
*
|
|
1046
|
+
* Used by block layout to implement legacy text alignment behavior.
|
|
1047
|
+
*
|
|
1048
|
+
* @returns - The current [`TextAlign`](JsTextAlign) value
|
|
1049
|
+
*
|
|
1050
|
+
* @defaultValue - `TextAlign.Auto`
|
|
1051
|
+
* @returns {TextAlign}
|
|
1052
|
+
*/
|
|
1053
|
+
get textAlign() {
|
|
1054
|
+
const ret = wasm.style_textAlign(this.__wbg_ptr);
|
|
1055
|
+
return ret;
|
|
1056
|
+
}
|
|
1008
1057
|
/**
|
|
1009
1058
|
* Gets the align-items property
|
|
1010
1059
|
*
|
|
@@ -1030,6 +1079,19 @@ export class Style {
|
|
|
1030
1079
|
const ret = wasm.style_flexShrink(this.__wbg_ptr);
|
|
1031
1080
|
return ret;
|
|
1032
1081
|
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Gets the grid-column property
|
|
1084
|
+
*
|
|
1085
|
+
* Defines which column in the grid the item should start and end at.
|
|
1086
|
+
* Corresponds to CSS `grid-column` shorthand.
|
|
1087
|
+
*
|
|
1088
|
+
* @returns - A `Line<GridPlacement>` with start and end placements
|
|
1089
|
+
* @returns {Line<GridPlacement>}
|
|
1090
|
+
*/
|
|
1091
|
+
get gridColumn() {
|
|
1092
|
+
const ret = wasm.style_gridColumn(this.__wbg_ptr);
|
|
1093
|
+
return ret;
|
|
1094
|
+
}
|
|
1033
1095
|
/**
|
|
1034
1096
|
* Sets the display mode
|
|
1035
1097
|
*
|
|
@@ -1071,6 +1133,36 @@ export class Style {
|
|
|
1071
1133
|
const ret = wasm.style_aspectRatio(this.__wbg_ptr);
|
|
1072
1134
|
return ret === 0x100000001 ? undefined : ret;
|
|
1073
1135
|
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Gets the justify-self property
|
|
1138
|
+
*
|
|
1139
|
+
* Overrides the parent's justify-items for this specific element in the inline axis.
|
|
1140
|
+
*
|
|
1141
|
+
* @returns - The current [`AlignSelf`](JsAlignSelf) value (returns `Auto` if not set)
|
|
1142
|
+
* @returns {AlignSelf | undefined}
|
|
1143
|
+
*/
|
|
1144
|
+
get justifySelf() {
|
|
1145
|
+
const ret = wasm.style_justifySelf(this.__wbg_ptr);
|
|
1146
|
+
return ret === 8 ? undefined : ret;
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* Sets the grid-row property
|
|
1150
|
+
*
|
|
1151
|
+
* @param val - A Line object with start and end GridPlacement values
|
|
1152
|
+
*
|
|
1153
|
+
* @example
|
|
1154
|
+
* ```typescript
|
|
1155
|
+
* style.display = Display.Grid;
|
|
1156
|
+
* // CSS: grid-row: 1 / 3
|
|
1157
|
+
* style.gridRow = { start: 1, end: 3 };
|
|
1158
|
+
* // CSS: grid-row: 2 / span 2
|
|
1159
|
+
* style.gridRow = { start: 2, end: { span: 2 } };
|
|
1160
|
+
* ```
|
|
1161
|
+
* @param {Line<GridPlacement>} val
|
|
1162
|
+
*/
|
|
1163
|
+
set gridRow(val) {
|
|
1164
|
+
wasm.style_set_gridRow(this.__wbg_ptr, val);
|
|
1165
|
+
}
|
|
1074
1166
|
/**
|
|
1075
1167
|
* Sets the maximum size constraints
|
|
1076
1168
|
*
|
|
@@ -1141,6 +1233,33 @@ export class Style {
|
|
|
1141
1233
|
const ret = wasm.style_alignContent(this.__wbg_ptr);
|
|
1142
1234
|
return ret === 9 ? undefined : ret;
|
|
1143
1235
|
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Gets whether this item is a table
|
|
1238
|
+
*
|
|
1239
|
+
* Table children are handled specially in block layout.
|
|
1240
|
+
*
|
|
1241
|
+
* @returns - Whether the item is treated as a table
|
|
1242
|
+
*
|
|
1243
|
+
* @defaultValue - `false`
|
|
1244
|
+
* @returns {boolean}
|
|
1245
|
+
*/
|
|
1246
|
+
get itemIsTable() {
|
|
1247
|
+
const ret = wasm.style_itemIsTable(this.__wbg_ptr);
|
|
1248
|
+
return ret !== 0;
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Gets the justify-items property
|
|
1252
|
+
*
|
|
1253
|
+
* Defines the default justify-self for all children in the inline axis.
|
|
1254
|
+
* This is primarily used for CSS Grid layout.
|
|
1255
|
+
*
|
|
1256
|
+
* @returns - The current [`AlignItems`](JsAlignItems) value, or `undefined` if not set
|
|
1257
|
+
* @returns {AlignItems | undefined}
|
|
1258
|
+
*/
|
|
1259
|
+
get justifyItems() {
|
|
1260
|
+
const ret = wasm.style_justifyItems(this.__wbg_ptr);
|
|
1261
|
+
return ret === 7 ? undefined : ret;
|
|
1262
|
+
}
|
|
1144
1263
|
/**
|
|
1145
1264
|
* Sets the flex grow factor
|
|
1146
1265
|
*
|
|
@@ -1184,6 +1303,32 @@ export class Style {
|
|
|
1184
1303
|
const ret = wasm.style_flexDirection(this.__wbg_ptr);
|
|
1185
1304
|
return ret;
|
|
1186
1305
|
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Gets the grid-auto-flow property
|
|
1308
|
+
*
|
|
1309
|
+
* Controls how auto-placed items are inserted into the grid.
|
|
1310
|
+
*
|
|
1311
|
+
* @returns - The current [`GridAutoFlow`](JsGridAutoFlow) value
|
|
1312
|
+
*
|
|
1313
|
+
* @defaultValue - `GridAutoFlow.Row`
|
|
1314
|
+
* @returns {GridAutoFlow}
|
|
1315
|
+
*/
|
|
1316
|
+
get gridAutoFlow() {
|
|
1317
|
+
const ret = wasm.style_gridAutoFlow(this.__wbg_ptr);
|
|
1318
|
+
return ret;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Gets the grid-auto-rows property
|
|
1322
|
+
*
|
|
1323
|
+
* Defines the size of implicitly created rows.
|
|
1324
|
+
*
|
|
1325
|
+
* @returns - An array of track sizing functions
|
|
1326
|
+
* @returns {any}
|
|
1327
|
+
*/
|
|
1328
|
+
get gridAutoRows() {
|
|
1329
|
+
const ret = wasm.style_gridAutoRows(this.__wbg_ptr);
|
|
1330
|
+
return ret;
|
|
1331
|
+
}
|
|
1187
1332
|
/**
|
|
1188
1333
|
* Sets the align-self property
|
|
1189
1334
|
*
|
|
@@ -1226,6 +1371,20 @@ export class Style {
|
|
|
1226
1371
|
set flexBasis(val) {
|
|
1227
1372
|
wasm.style_set_flexBasis(this.__wbg_ptr, val);
|
|
1228
1373
|
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Sets the text-align property
|
|
1376
|
+
*
|
|
1377
|
+
* @param val - The new text-align value
|
|
1378
|
+
*
|
|
1379
|
+
* @example
|
|
1380
|
+
* ```typescript
|
|
1381
|
+
* style.textAlign = TextAlign.LegacyCenter;
|
|
1382
|
+
* ```
|
|
1383
|
+
* @param {TextAlign} val
|
|
1384
|
+
*/
|
|
1385
|
+
set textAlign(val) {
|
|
1386
|
+
wasm.style_set_textAlign(this.__wbg_ptr, val);
|
|
1387
|
+
}
|
|
1229
1388
|
/**
|
|
1230
1389
|
* Gets the justify-content property
|
|
1231
1390
|
*
|
|
@@ -1238,6 +1397,20 @@ export class Style {
|
|
|
1238
1397
|
const ret = wasm.style_justifyContent(this.__wbg_ptr);
|
|
1239
1398
|
return ret === 9 ? undefined : ret;
|
|
1240
1399
|
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Gets the scrollbar width
|
|
1402
|
+
*
|
|
1403
|
+
* The width of the scrollbar gutter when `overflow` is set to `Scroll`.
|
|
1404
|
+
*
|
|
1405
|
+
* @returns - The scrollbar width in pixels
|
|
1406
|
+
*
|
|
1407
|
+
* @defaultValue - `0`
|
|
1408
|
+
* @returns {number}
|
|
1409
|
+
*/
|
|
1410
|
+
get scrollbarWidth() {
|
|
1411
|
+
const ret = wasm.style_scrollbarWidth(this.__wbg_ptr);
|
|
1412
|
+
return ret;
|
|
1413
|
+
}
|
|
1241
1414
|
/**
|
|
1242
1415
|
* Sets the align-items property
|
|
1243
1416
|
*
|
|
@@ -1266,6 +1439,38 @@ export class Style {
|
|
|
1266
1439
|
set flexShrink(val) {
|
|
1267
1440
|
wasm.style_set_flexShrink(this.__wbg_ptr, val);
|
|
1268
1441
|
}
|
|
1442
|
+
/**
|
|
1443
|
+
* Sets the grid-column property
|
|
1444
|
+
*
|
|
1445
|
+
* @param val - A Line object with start and end GridPlacement values
|
|
1446
|
+
*
|
|
1447
|
+
* @example
|
|
1448
|
+
* ```typescript
|
|
1449
|
+
* style.display = Display.Grid;
|
|
1450
|
+
* // CSS: grid-column: 1 / 4
|
|
1451
|
+
* style.gridColumn = { start: 1, end: 4 };
|
|
1452
|
+
* // CSS: grid-column: auto / span 3
|
|
1453
|
+
* style.gridColumn = { start: "auto", end: { span: 3 } };
|
|
1454
|
+
* ```
|
|
1455
|
+
* @param {Line<GridPlacement>} val
|
|
1456
|
+
*/
|
|
1457
|
+
set gridColumn(val) {
|
|
1458
|
+
wasm.style_set_gridColumn(this.__wbg_ptr, val);
|
|
1459
|
+
}
|
|
1460
|
+
/**
|
|
1461
|
+
* Gets whether this item is a replaced element
|
|
1462
|
+
*
|
|
1463
|
+
* Replaced elements have special sizing behavior (e.g., `<img>`, `<video>`).
|
|
1464
|
+
*
|
|
1465
|
+
* @returns - Whether the item is a replaced element
|
|
1466
|
+
*
|
|
1467
|
+
* @defaultValue - `false`
|
|
1468
|
+
* @returns {boolean}
|
|
1469
|
+
*/
|
|
1470
|
+
get itemIsReplaced() {
|
|
1471
|
+
const ret = wasm.style_itemIsReplaced(this.__wbg_ptr);
|
|
1472
|
+
return ret !== 0;
|
|
1473
|
+
}
|
|
1269
1474
|
/**
|
|
1270
1475
|
* Sets the aspect ratio
|
|
1271
1476
|
*
|
|
@@ -1280,6 +1485,32 @@ export class Style {
|
|
|
1280
1485
|
set aspectRatio(val) {
|
|
1281
1486
|
wasm.style_set_aspectRatio(this.__wbg_ptr, val);
|
|
1282
1487
|
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Sets the justify-self property
|
|
1490
|
+
*
|
|
1491
|
+
* @param val - The new justify-self value, or `undefined`/`Auto` to inherit from parent
|
|
1492
|
+
*
|
|
1493
|
+
* @example
|
|
1494
|
+
* ```typescript
|
|
1495
|
+
* style.justifySelf = AlignSelf.End;
|
|
1496
|
+
* ```
|
|
1497
|
+
* @param {AlignSelf | undefined} val
|
|
1498
|
+
*/
|
|
1499
|
+
set justifySelf(val) {
|
|
1500
|
+
wasm.style_set_justifySelf(this.__wbg_ptr, val);
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1503
|
+
* Gets the grid-auto-columns property
|
|
1504
|
+
*
|
|
1505
|
+
* Defines the size of implicitly created columns.
|
|
1506
|
+
*
|
|
1507
|
+
* @returns - An array of track sizing functions
|
|
1508
|
+
* @returns {any}
|
|
1509
|
+
*/
|
|
1510
|
+
get gridAutoColumns() {
|
|
1511
|
+
const ret = wasm.style_gridAutoColumns(this.__wbg_ptr);
|
|
1512
|
+
return ret;
|
|
1513
|
+
}
|
|
1283
1514
|
/**
|
|
1284
1515
|
* Sets the align-content property
|
|
1285
1516
|
*
|
|
@@ -1294,6 +1525,43 @@ export class Style {
|
|
|
1294
1525
|
set alignContent(val) {
|
|
1295
1526
|
wasm.style_set_alignContent(this.__wbg_ptr, val);
|
|
1296
1527
|
}
|
|
1528
|
+
/**
|
|
1529
|
+
* Sets whether this item is a table
|
|
1530
|
+
*
|
|
1531
|
+
* @param val - Whether the item should be treated as a table
|
|
1532
|
+
* @param {boolean} val
|
|
1533
|
+
*/
|
|
1534
|
+
set itemIsTable(val) {
|
|
1535
|
+
wasm.style_set_itemIsTable(this.__wbg_ptr, val);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Sets the justify-items property
|
|
1539
|
+
*
|
|
1540
|
+
* @param val - The new justify-items value, or `undefined` to use default
|
|
1541
|
+
*
|
|
1542
|
+
* @example
|
|
1543
|
+
* ```typescript
|
|
1544
|
+
* style.display = Display.Grid;
|
|
1545
|
+
* style.justifyItems = AlignItems.Center;
|
|
1546
|
+
* ```
|
|
1547
|
+
* @param {AlignItems | undefined} val
|
|
1548
|
+
*/
|
|
1549
|
+
set justifyItems(val) {
|
|
1550
|
+
wasm.style_set_justifyItems(this.__wbg_ptr, val);
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Gets the grid-template-rows property
|
|
1554
|
+
*
|
|
1555
|
+
* Defines the track sizing functions (heights) of the grid rows.
|
|
1556
|
+
* Returns Taffy's native serialization format.
|
|
1557
|
+
*
|
|
1558
|
+
* @returns - An array of `GridTrack` values
|
|
1559
|
+
* @returns {GridTrack[]}
|
|
1560
|
+
*/
|
|
1561
|
+
get gridTemplateRows() {
|
|
1562
|
+
const ret = wasm.style_gridTemplateRows(this.__wbg_ptr);
|
|
1563
|
+
return ret;
|
|
1564
|
+
}
|
|
1297
1565
|
/**
|
|
1298
1566
|
* Sets the flex direction
|
|
1299
1567
|
*
|
|
@@ -1309,6 +1577,48 @@ export class Style {
|
|
|
1309
1577
|
set flexDirection(val) {
|
|
1310
1578
|
wasm.style_set_flexDirection(this.__wbg_ptr, val);
|
|
1311
1579
|
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Sets the grid-auto-flow property
|
|
1582
|
+
*
|
|
1583
|
+
* @param val - The new grid-auto-flow value
|
|
1584
|
+
*
|
|
1585
|
+
* @example
|
|
1586
|
+
* ```typescript
|
|
1587
|
+
* style.display = Display.Grid;
|
|
1588
|
+
* style.gridAutoFlow = GridAutoFlow.Column;
|
|
1589
|
+
* ```
|
|
1590
|
+
* @param {GridAutoFlow} val
|
|
1591
|
+
*/
|
|
1592
|
+
set gridAutoFlow(val) {
|
|
1593
|
+
wasm.style_set_gridAutoFlow(this.__wbg_ptr, val);
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Sets the grid-auto-rows property
|
|
1597
|
+
*
|
|
1598
|
+
* @param val - An array of track sizing functions for implicit rows
|
|
1599
|
+
*
|
|
1600
|
+
* @example
|
|
1601
|
+
* ```typescript
|
|
1602
|
+
* style.display = Display.Grid;
|
|
1603
|
+
* style.gridAutoRows = [{ min: "Auto", max: "Auto" }];
|
|
1604
|
+
* ```
|
|
1605
|
+
* @param {any} val
|
|
1606
|
+
*/
|
|
1607
|
+
set gridAutoRows(val) {
|
|
1608
|
+
wasm.style_set_gridAutoRows(this.__wbg_ptr, val);
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* Gets the grid-template-areas property
|
|
1612
|
+
*
|
|
1613
|
+
* Defines named grid areas that can be referenced by grid items.
|
|
1614
|
+
*
|
|
1615
|
+
* @returns - An array of `GridArea` values
|
|
1616
|
+
* @returns {GridArea[]}
|
|
1617
|
+
*/
|
|
1618
|
+
get gridTemplateAreas() {
|
|
1619
|
+
const ret = wasm.style_gridTemplateAreas(this.__wbg_ptr);
|
|
1620
|
+
return ret;
|
|
1621
|
+
}
|
|
1312
1622
|
/**
|
|
1313
1623
|
* Sets the justify-content property
|
|
1314
1624
|
*
|
|
@@ -1323,6 +1633,159 @@ export class Style {
|
|
|
1323
1633
|
set justifyContent(val) {
|
|
1324
1634
|
wasm.style_set_justifyContent(this.__wbg_ptr, val);
|
|
1325
1635
|
}
|
|
1636
|
+
/**
|
|
1637
|
+
* Sets the scrollbar width
|
|
1638
|
+
*
|
|
1639
|
+
* @param val - The scrollbar width in pixels
|
|
1640
|
+
*
|
|
1641
|
+
* @example
|
|
1642
|
+
* ```typescript
|
|
1643
|
+
* style.overflow = { x: Overflow.Scroll, y: Overflow.Scroll };
|
|
1644
|
+
* style.scrollbarWidth = 15;
|
|
1645
|
+
* ```
|
|
1646
|
+
* @param {number} val
|
|
1647
|
+
*/
|
|
1648
|
+
set scrollbarWidth(val) {
|
|
1649
|
+
wasm.style_set_scrollbarWidth(this.__wbg_ptr, val);
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Sets whether this item is a replaced element
|
|
1653
|
+
*
|
|
1654
|
+
* @param val - Whether the item should be treated as a replaced element
|
|
1655
|
+
* @param {boolean} val
|
|
1656
|
+
*/
|
|
1657
|
+
set itemIsReplaced(val) {
|
|
1658
|
+
wasm.style_set_itemIsReplaced(this.__wbg_ptr, val);
|
|
1659
|
+
}
|
|
1660
|
+
/**
|
|
1661
|
+
* Gets the grid-template-columns property
|
|
1662
|
+
*
|
|
1663
|
+
* Defines the track sizing functions (widths) of the grid columns.
|
|
1664
|
+
*
|
|
1665
|
+
* @returns - An array of `GridTrack` values
|
|
1666
|
+
* @returns {GridTrack[]}
|
|
1667
|
+
*/
|
|
1668
|
+
get gridTemplateColumns() {
|
|
1669
|
+
const ret = wasm.style_gridTemplateColumns(this.__wbg_ptr);
|
|
1670
|
+
return ret;
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Sets the grid-auto-columns property
|
|
1674
|
+
*
|
|
1675
|
+
* @param val - An array of track sizing functions for implicit columns
|
|
1676
|
+
* @param {any} val
|
|
1677
|
+
*/
|
|
1678
|
+
set gridAutoColumns(val) {
|
|
1679
|
+
wasm.style_set_gridAutoColumns(this.__wbg_ptr, val);
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Sets the grid-template-rows property
|
|
1683
|
+
*
|
|
1684
|
+
* @param val - An array of GridTrack objects (Taffy's serde format)
|
|
1685
|
+
*
|
|
1686
|
+
* @example
|
|
1687
|
+
* ```typescript
|
|
1688
|
+
* style.display = Display.Grid;
|
|
1689
|
+
* // Simple: use Taffy's serde format
|
|
1690
|
+
* style.gridTemplateRows = [
|
|
1691
|
+
* { type: "Single", value: { min: { Length: 100 }, max: { Length: 100 } } },
|
|
1692
|
+
* { type: "Single", value: { min: "Auto", max: { Fr: 1.0 } } }
|
|
1693
|
+
* ];
|
|
1694
|
+
* ```
|
|
1695
|
+
* @param {GridTrack[]} val
|
|
1696
|
+
*/
|
|
1697
|
+
set gridTemplateRows(val) {
|
|
1698
|
+
wasm.style_set_gridTemplateRows(this.__wbg_ptr, val);
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Gets the grid-template-row-names property
|
|
1702
|
+
*
|
|
1703
|
+
* Defines the named lines between the rows.
|
|
1704
|
+
*
|
|
1705
|
+
* @returns - An array of arrays of line names
|
|
1706
|
+
* @returns {string[][]}
|
|
1707
|
+
*/
|
|
1708
|
+
get gridTemplateRowNames() {
|
|
1709
|
+
const ret = wasm.style_gridTemplateRowNames(this.__wbg_ptr);
|
|
1710
|
+
return ret;
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Sets the grid-template-areas property
|
|
1714
|
+
*
|
|
1715
|
+
* @param val - An array of named grid area definitions
|
|
1716
|
+
*
|
|
1717
|
+
* @example
|
|
1718
|
+
* ```typescript
|
|
1719
|
+
* style.display = Display.Grid;
|
|
1720
|
+
* style.gridTemplateAreas = [
|
|
1721
|
+
* { name: "header", row_start: 1, row_end: 2, column_start: 1, column_end: 4 },
|
|
1722
|
+
* { name: "main", row_start: 2, row_end: 4, column_start: 2, column_end: 4 }
|
|
1723
|
+
* ];
|
|
1724
|
+
* ```
|
|
1725
|
+
* @param {GridArea[]} val
|
|
1726
|
+
*/
|
|
1727
|
+
set gridTemplateAreas(val) {
|
|
1728
|
+
wasm.style_set_gridTemplateAreas(this.__wbg_ptr, val);
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Sets the grid-template-columns property
|
|
1732
|
+
*
|
|
1733
|
+
* @param val - An array of GridTrack objects
|
|
1734
|
+
*
|
|
1735
|
+
* @example
|
|
1736
|
+
* ```typescript
|
|
1737
|
+
* style.display = Display.Grid;
|
|
1738
|
+
* style.gridTemplateColumns = [
|
|
1739
|
+
* { type: "Single", value: { min: { Length: 200 }, max: { Length: 200 } } },
|
|
1740
|
+
* { type: "Single", value: { min: "Auto", max: { Fr: 1.0 } } },
|
|
1741
|
+
* { type: "Single", value: { min: "Auto", max: { Fr: 1.0 } } }
|
|
1742
|
+
* ];
|
|
1743
|
+
* ```
|
|
1744
|
+
* @param {GridTrack[]} val
|
|
1745
|
+
*/
|
|
1746
|
+
set gridTemplateColumns(val) {
|
|
1747
|
+
wasm.style_set_gridTemplateColumns(this.__wbg_ptr, val);
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Gets the grid-template-column-names property
|
|
1751
|
+
*
|
|
1752
|
+
* Defines the named lines between the columns.
|
|
1753
|
+
*
|
|
1754
|
+
* @returns - An array of arrays of line names
|
|
1755
|
+
* @returns {string[][]}
|
|
1756
|
+
*/
|
|
1757
|
+
get gridTemplateColumnNames() {
|
|
1758
|
+
const ret = wasm.style_gridTemplateColumnNames(this.__wbg_ptr);
|
|
1759
|
+
return ret;
|
|
1760
|
+
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Sets the grid-template-row-names property
|
|
1763
|
+
*
|
|
1764
|
+
* @param val - An array of arrays of line names
|
|
1765
|
+
*
|
|
1766
|
+
* @example
|
|
1767
|
+
* ```typescript
|
|
1768
|
+
* style.gridTemplateRowNames = [["header-start"], ["header-end", "main-start"], ["main-end"]];
|
|
1769
|
+
* ```
|
|
1770
|
+
* @param {string[][]} val
|
|
1771
|
+
*/
|
|
1772
|
+
set gridTemplateRowNames(val) {
|
|
1773
|
+
wasm.style_set_gridTemplateRowNames(this.__wbg_ptr, val);
|
|
1774
|
+
}
|
|
1775
|
+
/**
|
|
1776
|
+
* Sets the grid-template-column-names property
|
|
1777
|
+
*
|
|
1778
|
+
* @param val - An array of arrays of line names
|
|
1779
|
+
*
|
|
1780
|
+
* @example
|
|
1781
|
+
* ```typescript
|
|
1782
|
+
* style.gridTemplateColumnNames = [["sidebar-start"], ["sidebar-end", "main-start"], ["main-end"]];
|
|
1783
|
+
* ```
|
|
1784
|
+
* @param {string[][]} val
|
|
1785
|
+
*/
|
|
1786
|
+
set gridTemplateColumnNames(val) {
|
|
1787
|
+
wasm.style_set_gridTemplateColumnNames(this.__wbg_ptr, val);
|
|
1788
|
+
}
|
|
1326
1789
|
/**
|
|
1327
1790
|
* Gets the gap
|
|
1328
1791
|
*
|
|
@@ -1438,6 +1901,19 @@ export class Style {
|
|
|
1438
1901
|
set gap(val) {
|
|
1439
1902
|
wasm.style_set_gap(this.__wbg_ptr, val);
|
|
1440
1903
|
}
|
|
1904
|
+
/**
|
|
1905
|
+
* Gets the grid-row property
|
|
1906
|
+
*
|
|
1907
|
+
* Defines which row in the grid the item should start and end at.
|
|
1908
|
+
* Corresponds to CSS `grid-row` shorthand.
|
|
1909
|
+
*
|
|
1910
|
+
* @returns - A `Line<GridPlacement>` with start and end placements
|
|
1911
|
+
* @returns {Line<GridPlacement>}
|
|
1912
|
+
*/
|
|
1913
|
+
get gridRow() {
|
|
1914
|
+
const ret = wasm.style_gridRow(this.__wbg_ptr);
|
|
1915
|
+
return ret;
|
|
1916
|
+
}
|
|
1441
1917
|
/**
|
|
1442
1918
|
* Gets the maximum size constraints
|
|
1443
1919
|
*
|
|
@@ -2469,6 +2945,39 @@ export class TaffyTree {
|
|
|
2469
2945
|
}
|
|
2470
2946
|
if (Symbol.dispose) TaffyTree.prototype[Symbol.dispose] = TaffyTree.prototype.free;
|
|
2471
2947
|
|
|
2948
|
+
/**
|
|
2949
|
+
* Text alignment enumeration (for block layout)
|
|
2950
|
+
*
|
|
2951
|
+
* Used by block layout to implement the legacy behaviour of `<center>` and
|
|
2952
|
+
* `<div align="left | right | center">`.
|
|
2953
|
+
*
|
|
2954
|
+
* @example
|
|
2955
|
+
* ```typescript
|
|
2956
|
+
* import { TextAlign } from 'taffy-js';
|
|
2957
|
+
*
|
|
2958
|
+
* style.textAlign = TextAlign.LegacyCenter; // Center block children
|
|
2959
|
+
* ```
|
|
2960
|
+
* @enum {0 | 1 | 2 | 3}
|
|
2961
|
+
*/
|
|
2962
|
+
export const TextAlign = Object.freeze({
|
|
2963
|
+
/**
|
|
2964
|
+
* No special legacy text align behaviour
|
|
2965
|
+
*/
|
|
2966
|
+
Auto: 0, "0": "Auto",
|
|
2967
|
+
/**
|
|
2968
|
+
* Corresponds to `-webkit-left` or `-moz-left` in browsers
|
|
2969
|
+
*/
|
|
2970
|
+
LegacyLeft: 1, "1": "LegacyLeft",
|
|
2971
|
+
/**
|
|
2972
|
+
* Corresponds to `-webkit-right` or `-moz-right` in browsers
|
|
2973
|
+
*/
|
|
2974
|
+
LegacyRight: 2, "2": "LegacyRight",
|
|
2975
|
+
/**
|
|
2976
|
+
* Corresponds to `-webkit-center` or `-moz-center` in browsers
|
|
2977
|
+
*/
|
|
2978
|
+
LegacyCenter: 3, "3": "LegacyCenter",
|
|
2979
|
+
});
|
|
2980
|
+
|
|
2472
2981
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
2473
2982
|
|
|
2474
2983
|
async function __wbg_load(module, imports) {
|
|
@@ -2558,6 +3067,10 @@ function __wbg_get_imports() {
|
|
|
2558
3067
|
const ret = typeof(val) === 'object' && val !== null;
|
|
2559
3068
|
return ret;
|
|
2560
3069
|
};
|
|
3070
|
+
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
3071
|
+
const ret = typeof(arg0) === 'string';
|
|
3072
|
+
return ret;
|
|
3073
|
+
};
|
|
2561
3074
|
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
2562
3075
|
const ret = arg0 === undefined;
|
|
2563
3076
|
return ret;
|
|
@@ -2595,6 +3108,10 @@ function __wbg_get_imports() {
|
|
|
2595
3108
|
const ret = arg0.call(arg1);
|
|
2596
3109
|
return ret;
|
|
2597
3110
|
}, arguments) };
|
|
3111
|
+
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
3112
|
+
const ret = arg0.done;
|
|
3113
|
+
return ret;
|
|
3114
|
+
};
|
|
2598
3115
|
imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
2599
3116
|
const ret = Object.entries(arg0);
|
|
2600
3117
|
return ret;
|
|
@@ -2610,6 +3127,10 @@ function __wbg_get_imports() {
|
|
|
2610
3127
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2611
3128
|
}
|
|
2612
3129
|
};
|
|
3130
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
3131
|
+
const ret = arg0[arg1 >>> 0];
|
|
3132
|
+
return ret;
|
|
3133
|
+
};
|
|
2613
3134
|
imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
2614
3135
|
const ret = Reflect.get(arg0, arg1);
|
|
2615
3136
|
return ret;
|
|
@@ -2668,7 +3189,7 @@ function __wbg_get_imports() {
|
|
|
2668
3189
|
const ret = arg0.length;
|
|
2669
3190
|
return ret;
|
|
2670
3191
|
};
|
|
2671
|
-
imports.wbg.
|
|
3192
|
+
imports.wbg.__wbg_log_23225a7078e26a12 = function(arg0, arg1) {
|
|
2672
3193
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
2673
3194
|
};
|
|
2674
3195
|
imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
|
|
@@ -2687,10 +3208,18 @@ function __wbg_get_imports() {
|
|
|
2687
3208
|
const ret = new Error();
|
|
2688
3209
|
return ret;
|
|
2689
3210
|
};
|
|
3211
|
+
imports.wbg.__wbg_new_b546ae120718850e = function() {
|
|
3212
|
+
const ret = new Map();
|
|
3213
|
+
return ret;
|
|
3214
|
+
};
|
|
2690
3215
|
imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
2691
3216
|
const ret = arg0.next;
|
|
2692
3217
|
return ret;
|
|
2693
3218
|
};
|
|
3219
|
+
imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
3220
|
+
const ret = arg0.next();
|
|
3221
|
+
return ret;
|
|
3222
|
+
}, arguments) };
|
|
2694
3223
|
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
2695
3224
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
2696
3225
|
};
|
|
@@ -2701,6 +3230,13 @@ function __wbg_get_imports() {
|
|
|
2701
3230
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
2702
3231
|
arg0[arg1] = arg2;
|
|
2703
3232
|
};
|
|
3233
|
+
imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
3234
|
+
arg0[arg1 >>> 0] = arg2;
|
|
3235
|
+
};
|
|
3236
|
+
imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
|
|
3237
|
+
const ret = arg0.set(arg1, arg2);
|
|
3238
|
+
return ret;
|
|
3239
|
+
};
|
|
2704
3240
|
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
2705
3241
|
const ret = arg1.stack;
|
|
2706
3242
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -2720,6 +3256,10 @@ function __wbg_get_imports() {
|
|
|
2720
3256
|
const ret = TaffyError.__wrap(arg0);
|
|
2721
3257
|
return ret;
|
|
2722
3258
|
};
|
|
3259
|
+
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
3260
|
+
const ret = arg0.value;
|
|
3261
|
+
return ret;
|
|
3262
|
+
};
|
|
2723
3263
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
2724
3264
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2725
3265
|
const ret = getStringFromWasm0(arg0, arg1);
|
package/pkg/taffy_wasm_bg.wasm
CHANGED
|
Binary file
|