taffy-js 0.1.2 → 0.1.3
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 +306 -46
- package/package.json +1 -1
- package/taffy_js.d.ts +142 -47
- package/taffy_js.js +387 -69
- package/taffy_js_bg.wasm +0 -0
package/taffy_js.js
CHANGED
|
@@ -77,9 +77,9 @@ function debugString(val) {
|
|
|
77
77
|
return className;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function
|
|
80
|
+
function getArrayU64FromWasm0(ptr, len) {
|
|
81
81
|
ptr = ptr >>> 0;
|
|
82
|
-
return
|
|
82
|
+
return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -87,6 +87,14 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
87
87
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
let cachedBigUint64ArrayMemory0 = null;
|
|
91
|
+
function getBigUint64ArrayMemory0() {
|
|
92
|
+
if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
|
|
93
|
+
cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
|
|
94
|
+
}
|
|
95
|
+
return cachedBigUint64ArrayMemory0;
|
|
96
|
+
}
|
|
97
|
+
|
|
90
98
|
let cachedDataViewMemory0 = null;
|
|
91
99
|
function getDataViewMemory0() {
|
|
92
100
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
@@ -100,14 +108,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
100
108
|
return decodeText(ptr, len);
|
|
101
109
|
}
|
|
102
110
|
|
|
103
|
-
let cachedUint32ArrayMemory0 = null;
|
|
104
|
-
function getUint32ArrayMemory0() {
|
|
105
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
106
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
107
|
-
}
|
|
108
|
-
return cachedUint32ArrayMemory0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
111
|
let cachedUint8ArrayMemory0 = null;
|
|
112
112
|
function getUint8ArrayMemory0() {
|
|
113
113
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -129,9 +129,9 @@ function isLikeNone(x) {
|
|
|
129
129
|
return x === undefined || x === null;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
function
|
|
133
|
-
const ptr = malloc(arg.length *
|
|
134
|
-
|
|
132
|
+
function passArray64ToWasm0(arg, malloc) {
|
|
133
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
134
|
+
getBigUint64ArrayMemory0().set(arg, ptr / 8);
|
|
135
135
|
WASM_VECTOR_LEN = arg.length;
|
|
136
136
|
return ptr;
|
|
137
137
|
}
|
|
@@ -328,37 +328,41 @@ export const AlignItems = Object.freeze({
|
|
|
328
328
|
|
|
329
329
|
/**
|
|
330
330
|
* How a single item is aligned along the cross axis, overriding `AlignItems`.
|
|
331
|
-
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
|
|
331
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
|
|
332
332
|
*/
|
|
333
333
|
export const AlignSelf = Object.freeze({
|
|
334
|
+
/**
|
|
335
|
+
* Auto
|
|
336
|
+
*/
|
|
337
|
+
Auto: 0, "0": "Auto",
|
|
334
338
|
/**
|
|
335
339
|
* items are aligned at the start of the cross axis.
|
|
336
340
|
*/
|
|
337
|
-
Start:
|
|
341
|
+
Start: 1, "1": "Start",
|
|
338
342
|
/**
|
|
339
343
|
* Items are aligned at the end of the cross axis.
|
|
340
344
|
*/
|
|
341
|
-
End:
|
|
345
|
+
End: 2, "2": "End",
|
|
342
346
|
/**
|
|
343
347
|
* Items are aligned at the start of the flex-direction cross axis.
|
|
344
348
|
*/
|
|
345
|
-
FlexStart:
|
|
349
|
+
FlexStart: 3, "3": "FlexStart",
|
|
346
350
|
/**
|
|
347
351
|
* Items are aligned at the end of the flex-direction cross axis.
|
|
348
352
|
*/
|
|
349
|
-
FlexEnd:
|
|
353
|
+
FlexEnd: 4, "4": "FlexEnd",
|
|
350
354
|
/**
|
|
351
355
|
* Items are aligned at the center of the cross axis.
|
|
352
356
|
*/
|
|
353
|
-
Center:
|
|
357
|
+
Center: 5, "5": "Center",
|
|
354
358
|
/**
|
|
355
359
|
* Items are aligned based on their baselines.
|
|
356
360
|
*/
|
|
357
|
-
Baseline:
|
|
361
|
+
Baseline: 6, "6": "Baseline",
|
|
358
362
|
/**
|
|
359
363
|
* Items are stretched to fill the container along the cross axis.
|
|
360
364
|
*/
|
|
361
|
-
Stretch:
|
|
365
|
+
Stretch: 7, "7": "Stretch",
|
|
362
366
|
});
|
|
363
367
|
|
|
364
368
|
/**
|
|
@@ -409,6 +413,7 @@ export class AvailableSpace {
|
|
|
409
413
|
if (Symbol.dispose) AvailableSpace.prototype[Symbol.dispose] = AvailableSpace.prototype.free;
|
|
410
414
|
|
|
411
415
|
/**
|
|
416
|
+
* Represents a length value in CSS.
|
|
412
417
|
* Represents a length value in CSS.
|
|
413
418
|
*
|
|
414
419
|
* This struct corresponds to a dimension value that can be specified in pixels, percentage, or auto.
|
|
@@ -512,6 +517,22 @@ export const Display = Object.freeze({
|
|
|
512
517
|
Block: 3, "3": "Block",
|
|
513
518
|
});
|
|
514
519
|
|
|
520
|
+
/**
|
|
521
|
+
* Start and End are used for logical positioning (e.g. paddingStart).
|
|
522
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
|
|
523
|
+
*/
|
|
524
|
+
export const Edge = Object.freeze({
|
|
525
|
+
Left: 0, "0": "Left",
|
|
526
|
+
Right: 1, "1": "Right",
|
|
527
|
+
Top: 2, "2": "Top",
|
|
528
|
+
Bottom: 3, "3": "Bottom",
|
|
529
|
+
Start: 4, "4": "Start",
|
|
530
|
+
End: 5, "5": "End",
|
|
531
|
+
Horizontal: 6, "6": "Horizontal",
|
|
532
|
+
Vertical: 7, "7": "Vertical",
|
|
533
|
+
All: 8, "8": "All",
|
|
534
|
+
});
|
|
535
|
+
|
|
515
536
|
/**
|
|
516
537
|
* The direction of the main axis for a flex container.
|
|
517
538
|
* @enum {0 | 1 | 2 | 3}
|
|
@@ -577,6 +598,15 @@ export const GridAutoFlow = Object.freeze({
|
|
|
577
598
|
ColumnDense: 3, "3": "ColumnDense",
|
|
578
599
|
});
|
|
579
600
|
|
|
601
|
+
/**
|
|
602
|
+
* @enum {0 | 1 | 2}
|
|
603
|
+
*/
|
|
604
|
+
export const Gutter = Object.freeze({
|
|
605
|
+
Column: 0, "0": "Column",
|
|
606
|
+
Row: 1, "1": "Row",
|
|
607
|
+
All: 2, "2": "All",
|
|
608
|
+
});
|
|
609
|
+
|
|
580
610
|
/**
|
|
581
611
|
* How items are distributed along the main axis.
|
|
582
612
|
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
|
|
@@ -1468,14 +1498,14 @@ export class Style {
|
|
|
1468
1498
|
*/
|
|
1469
1499
|
get align_self() {
|
|
1470
1500
|
const ret = wasm.__wbg_get_style_align_self(this.__wbg_ptr);
|
|
1471
|
-
return ret ===
|
|
1501
|
+
return ret === 8 ? undefined : ret;
|
|
1472
1502
|
}
|
|
1473
1503
|
/**
|
|
1474
1504
|
* How a single item is aligned along the cross axis.
|
|
1475
1505
|
* @param {AlignSelf | null} [arg0]
|
|
1476
1506
|
*/
|
|
1477
1507
|
set align_self(arg0) {
|
|
1478
|
-
wasm.__wbg_set_style_align_self(this.__wbg_ptr, isLikeNone(arg0) ?
|
|
1508
|
+
wasm.__wbg_set_style_align_self(this.__wbg_ptr, isLikeNone(arg0) ? 8 : arg0);
|
|
1479
1509
|
}
|
|
1480
1510
|
/**
|
|
1481
1511
|
* How lines of content are aligned along the cross axis.
|
|
@@ -1577,14 +1607,14 @@ export class TaffyNode {
|
|
|
1577
1607
|
wasm.__wbg_taffynode_free(ptr, 0);
|
|
1578
1608
|
}
|
|
1579
1609
|
/**
|
|
1580
|
-
* @returns {
|
|
1610
|
+
* @returns {bigint}
|
|
1581
1611
|
*/
|
|
1582
1612
|
get id() {
|
|
1583
1613
|
const ret = wasm.__wbg_get_taffynode_id(this.__wbg_ptr);
|
|
1584
|
-
return ret
|
|
1614
|
+
return BigInt.asUintN(64, ret);
|
|
1585
1615
|
}
|
|
1586
1616
|
/**
|
|
1587
|
-
* @param {
|
|
1617
|
+
* @param {bigint} arg0
|
|
1588
1618
|
*/
|
|
1589
1619
|
set id(arg0) {
|
|
1590
1620
|
wasm.__wbg_set_taffynode_id(this.__wbg_ptr, arg0);
|
|
@@ -1592,30 +1622,122 @@ export class TaffyNode {
|
|
|
1592
1622
|
/**
|
|
1593
1623
|
* @returns {Layout}
|
|
1594
1624
|
*/
|
|
1595
|
-
|
|
1596
|
-
const ret = wasm.
|
|
1625
|
+
getLayout() {
|
|
1626
|
+
const ret = wasm.taffynode_getLayout(this.__wbg_ptr);
|
|
1597
1627
|
if (ret[2]) {
|
|
1598
1628
|
throw takeFromExternrefTable0(ret[1]);
|
|
1599
1629
|
}
|
|
1600
1630
|
return Layout.__wrap(ret[0]);
|
|
1601
1631
|
}
|
|
1632
|
+
markDirty() {
|
|
1633
|
+
const ret = wasm.taffynode_markDirty(this.__wbg_ptr);
|
|
1634
|
+
if (ret[1]) {
|
|
1635
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* @param {Edge} edge
|
|
1640
|
+
* @param {number} value
|
|
1641
|
+
*/
|
|
1642
|
+
setBorder(edge, value) {
|
|
1643
|
+
const ret = wasm.taffynode_setBorder(this.__wbg_ptr, edge, value);
|
|
1644
|
+
if (ret[1]) {
|
|
1645
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* @param {number} value
|
|
1650
|
+
*/
|
|
1651
|
+
setHeight(value) {
|
|
1652
|
+
const ret = wasm.taffynode_setHeight(this.__wbg_ptr, value);
|
|
1653
|
+
if (ret[1]) {
|
|
1654
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* @param {Edge} edge
|
|
1659
|
+
* @param {number} value
|
|
1660
|
+
*/
|
|
1661
|
+
setMargin(edge, value) {
|
|
1662
|
+
const ret = wasm.taffynode_setMargin(this.__wbg_ptr, edge, value);
|
|
1663
|
+
if (ret[1]) {
|
|
1664
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* @param {Display} display
|
|
1669
|
+
*/
|
|
1670
|
+
setDisplay(display) {
|
|
1671
|
+
const ret = wasm.taffynode_setDisplay(this.__wbg_ptr, display);
|
|
1672
|
+
if (ret[1]) {
|
|
1673
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* @param {Edge} edge
|
|
1678
|
+
* @param {number} value
|
|
1679
|
+
*/
|
|
1680
|
+
setPadding(edge, value) {
|
|
1681
|
+
const ret = wasm.taffynode_setPadding(this.__wbg_ptr, edge, value);
|
|
1682
|
+
if (ret[1]) {
|
|
1683
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* @param {TaffyNode} child
|
|
1688
|
+
* @param {number} index
|
|
1689
|
+
*/
|
|
1690
|
+
insertChild(child, index) {
|
|
1691
|
+
_assertClass(child, TaffyNode);
|
|
1692
|
+
const ret = wasm.taffynode_insertChild(this.__wbg_ptr, child.__wbg_ptr, index);
|
|
1693
|
+
if (ret[1]) {
|
|
1694
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1602
1697
|
/**
|
|
1603
1698
|
* @param {TaffyNode} child
|
|
1604
1699
|
*/
|
|
1605
|
-
|
|
1700
|
+
removeChild(child) {
|
|
1606
1701
|
_assertClass(child, TaffyNode);
|
|
1607
|
-
const ret = wasm.
|
|
1702
|
+
const ret = wasm.taffynode_removeChild(this.__wbg_ptr, child.__wbg_ptr);
|
|
1608
1703
|
if (ret[1]) {
|
|
1609
1704
|
throw takeFromExternrefTable0(ret[0]);
|
|
1610
1705
|
}
|
|
1611
1706
|
}
|
|
1612
1707
|
/**
|
|
1613
|
-
* @param {
|
|
1708
|
+
* @param {BigUint64Array} children
|
|
1614
1709
|
*/
|
|
1615
|
-
|
|
1616
|
-
const ptr0 =
|
|
1710
|
+
setChildren(children) {
|
|
1711
|
+
const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
|
|
1617
1712
|
const len0 = WASM_VECTOR_LEN;
|
|
1618
|
-
const ret = wasm.
|
|
1713
|
+
const ret = wasm.taffynode_setChildren(this.__wbg_ptr, ptr0, len0);
|
|
1714
|
+
if (ret[1]) {
|
|
1715
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* @param {number} value
|
|
1720
|
+
*/
|
|
1721
|
+
setFlexGrow(value) {
|
|
1722
|
+
const ret = wasm.taffynode_setFlexGrow(this.__wbg_ptr, value);
|
|
1723
|
+
if (ret[1]) {
|
|
1724
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* @param {FlexWrap} wrap
|
|
1729
|
+
*/
|
|
1730
|
+
setFlexWrap(wrap) {
|
|
1731
|
+
const ret = wasm.taffynode_setFlexWrap(this.__wbg_ptr, wrap);
|
|
1732
|
+
if (ret[1]) {
|
|
1733
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* @param {number} value
|
|
1738
|
+
*/
|
|
1739
|
+
setMinWidth(value) {
|
|
1740
|
+
const ret = wasm.taffynode_setMinWidth(this.__wbg_ptr, value);
|
|
1619
1741
|
if (ret[1]) {
|
|
1620
1742
|
throw takeFromExternrefTable0(ret[0]);
|
|
1621
1743
|
}
|
|
@@ -1623,8 +1745,161 @@ export class TaffyNode {
|
|
|
1623
1745
|
/**
|
|
1624
1746
|
* @param {any} available_space
|
|
1625
1747
|
*/
|
|
1626
|
-
|
|
1627
|
-
const ret = wasm.
|
|
1748
|
+
computeLayout(available_space) {
|
|
1749
|
+
const ret = wasm.taffynode_computeLayout(this.__wbg_ptr, available_space);
|
|
1750
|
+
if (ret[1]) {
|
|
1751
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
/**
|
|
1755
|
+
* @param {AlignSelf} align
|
|
1756
|
+
*/
|
|
1757
|
+
setAlignSelf(align) {
|
|
1758
|
+
const ret = wasm.taffynode_setAlignSelf(this.__wbg_ptr, align);
|
|
1759
|
+
if (ret[1]) {
|
|
1760
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
/**
|
|
1764
|
+
* @param {number} value
|
|
1765
|
+
*/
|
|
1766
|
+
setFlexBasis(value) {
|
|
1767
|
+
const ret = wasm.taffynode_setFlexBasis(this.__wbg_ptr, value);
|
|
1768
|
+
if (ret[1]) {
|
|
1769
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* @param {number} value
|
|
1774
|
+
*/
|
|
1775
|
+
setMinHeight(value) {
|
|
1776
|
+
const ret = wasm.taffynode_setMinHeight(this.__wbg_ptr, value);
|
|
1777
|
+
if (ret[1]) {
|
|
1778
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
setWidthAuto() {
|
|
1782
|
+
const ret = wasm.taffynode_setWidthAuto(this.__wbg_ptr);
|
|
1783
|
+
if (ret[1]) {
|
|
1784
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* @param {AlignItems} align
|
|
1789
|
+
*/
|
|
1790
|
+
setAlignItems(align) {
|
|
1791
|
+
const ret = wasm.taffynode_setAlignItems(this.__wbg_ptr, align);
|
|
1792
|
+
if (ret[1]) {
|
|
1793
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* @param {number} value
|
|
1798
|
+
*/
|
|
1799
|
+
setFlexShrink(value) {
|
|
1800
|
+
const ret = wasm.taffynode_setFlexShrink(this.__wbg_ptr, value);
|
|
1801
|
+
if (ret[1]) {
|
|
1802
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
setHeightAuto() {
|
|
1806
|
+
const ret = wasm.taffynode_setHeightAuto(this.__wbg_ptr);
|
|
1807
|
+
if (ret[1]) {
|
|
1808
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* @param {Edge} edge
|
|
1813
|
+
*/
|
|
1814
|
+
setMarginAuto(edge) {
|
|
1815
|
+
const ret = wasm.taffynode_setMarginAuto(this.__wbg_ptr, edge);
|
|
1816
|
+
if (ret[1]) {
|
|
1817
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* @param {Function} js_func
|
|
1822
|
+
*/
|
|
1823
|
+
setMeasureFunc(js_func) {
|
|
1824
|
+
const ret = wasm.taffynode_setMeasureFunc(this.__wbg_ptr, js_func);
|
|
1825
|
+
if (ret[1]) {
|
|
1826
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* @param {Position} position
|
|
1831
|
+
*/
|
|
1832
|
+
setPositionType(position) {
|
|
1833
|
+
const ret = wasm.taffynode_setPositionType(this.__wbg_ptr, position);
|
|
1834
|
+
if (ret[1]) {
|
|
1835
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* @param {number} value
|
|
1840
|
+
*/
|
|
1841
|
+
setWidthPercent(value) {
|
|
1842
|
+
const ret = wasm.taffynode_setWidthPercent(this.__wbg_ptr, value);
|
|
1843
|
+
if (ret[1]) {
|
|
1844
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* @param {FlexDirection} direction
|
|
1849
|
+
*/
|
|
1850
|
+
setFlexDirection(direction) {
|
|
1851
|
+
const ret = wasm.taffynode_setFlexDirection(this.__wbg_ptr, direction);
|
|
1852
|
+
if (ret[1]) {
|
|
1853
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* @param {number} value
|
|
1858
|
+
*/
|
|
1859
|
+
setHeightPercent(value) {
|
|
1860
|
+
const ret = wasm.taffynode_setHeightPercent(this.__wbg_ptr, value);
|
|
1861
|
+
if (ret[1]) {
|
|
1862
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
setFlexBasisAuto() {
|
|
1866
|
+
const ret = wasm.taffynode_setFlexBasisAuto(this.__wbg_ptr);
|
|
1867
|
+
if (ret[1]) {
|
|
1868
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* @param {JustifyContent} justify
|
|
1873
|
+
*/
|
|
1874
|
+
setJustifyContent(justify) {
|
|
1875
|
+
const ret = wasm.taffynode_setJustifyContent(this.__wbg_ptr, justify);
|
|
1876
|
+
if (ret[1]) {
|
|
1877
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* @param {number} value
|
|
1882
|
+
*/
|
|
1883
|
+
setMinWidthPercent(value) {
|
|
1884
|
+
const ret = wasm.taffynode_setMinWidthPercent(this.__wbg_ptr, value);
|
|
1885
|
+
if (ret[1]) {
|
|
1886
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* @param {number} value
|
|
1891
|
+
*/
|
|
1892
|
+
setFlexBasisPercent(value) {
|
|
1893
|
+
const ret = wasm.taffynode_setFlexBasisPercent(this.__wbg_ptr, value);
|
|
1894
|
+
if (ret[1]) {
|
|
1895
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* @param {number} value
|
|
1900
|
+
*/
|
|
1901
|
+
setMinHeightPercent(value) {
|
|
1902
|
+
const ret = wasm.taffynode_setMinHeightPercent(this.__wbg_ptr, value);
|
|
1628
1903
|
if (ret[1]) {
|
|
1629
1904
|
throw takeFromExternrefTable0(ret[0]);
|
|
1630
1905
|
}
|
|
@@ -1658,12 +1933,22 @@ export class TaffyNode {
|
|
|
1658
1933
|
}
|
|
1659
1934
|
return takeFromExternrefTable0(ret[0]);
|
|
1660
1935
|
}
|
|
1936
|
+
/**
|
|
1937
|
+
* @param {Gutter} gutter
|
|
1938
|
+
* @param {number} value
|
|
1939
|
+
*/
|
|
1940
|
+
setGap(gutter, value) {
|
|
1941
|
+
const ret = wasm.taffynode_setGap(this.__wbg_ptr, gutter, value);
|
|
1942
|
+
if (ret[1]) {
|
|
1943
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1661
1946
|
/**
|
|
1662
1947
|
* @param {TaffyNode} child
|
|
1663
1948
|
*/
|
|
1664
|
-
|
|
1949
|
+
addChild(child) {
|
|
1665
1950
|
_assertClass(child, TaffyNode);
|
|
1666
|
-
const ret = wasm.
|
|
1951
|
+
const ret = wasm.taffynode_addChild(this.__wbg_ptr, child.__wbg_ptr);
|
|
1667
1952
|
if (ret[1]) {
|
|
1668
1953
|
throw takeFromExternrefTable0(ret[0]);
|
|
1669
1954
|
}
|
|
@@ -1677,6 +1962,15 @@ export class TaffyNode {
|
|
|
1677
1962
|
throw takeFromExternrefTable0(ret[0]);
|
|
1678
1963
|
}
|
|
1679
1964
|
}
|
|
1965
|
+
/**
|
|
1966
|
+
* @param {number} value
|
|
1967
|
+
*/
|
|
1968
|
+
setWidth(value) {
|
|
1969
|
+
const ret = wasm.taffynode_setWidth(this.__wbg_ptr, value);
|
|
1970
|
+
if (ret[1]) {
|
|
1971
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1680
1974
|
}
|
|
1681
1975
|
if (Symbol.dispose) TaffyNode.prototype[Symbol.dispose] = TaffyNode.prototype.free;
|
|
1682
1976
|
|
|
@@ -1781,8 +2075,8 @@ export const TrackUnit = Object.freeze({
|
|
|
1781
2075
|
* # Errors
|
|
1782
2076
|
*
|
|
1783
2077
|
* Returns a `JsValue` error if the operation fails (e.g., recursive hierarchy).
|
|
1784
|
-
* @param {
|
|
1785
|
-
* @param {
|
|
2078
|
+
* @param {bigint} parent
|
|
2079
|
+
* @param {bigint} child
|
|
1786
2080
|
*/
|
|
1787
2081
|
export function add_child(parent, child) {
|
|
1788
2082
|
const ret = wasm.add_child(parent, child);
|
|
@@ -1801,7 +2095,10 @@ export function auto() {
|
|
|
1801
2095
|
}
|
|
1802
2096
|
|
|
1803
2097
|
/**
|
|
1804
|
-
* Clear all nodes
|
|
2098
|
+
* Clear all nodes from the layout tree.
|
|
2099
|
+
*
|
|
2100
|
+
* This removes all nodes and resets the tree to an empty state.
|
|
2101
|
+
* Any existing node IDs become invalid after this call.
|
|
1805
2102
|
*/
|
|
1806
2103
|
export function clear() {
|
|
1807
2104
|
const ret = wasm.clear();
|
|
@@ -1821,7 +2118,7 @@ export function clear() {
|
|
|
1821
2118
|
* # Errors
|
|
1822
2119
|
*
|
|
1823
2120
|
* Returns a `JsValue` error if the layout computation fails.
|
|
1824
|
-
* @param {
|
|
2121
|
+
* @param {bigint} root
|
|
1825
2122
|
* @param {any} available_space
|
|
1826
2123
|
*/
|
|
1827
2124
|
export function compute_layout(root, available_space) {
|
|
@@ -1856,16 +2153,16 @@ export function dimension(value, unit) {
|
|
|
1856
2153
|
* # Errors
|
|
1857
2154
|
*
|
|
1858
2155
|
* Returns a `JsValue` error if the node does not exist.
|
|
1859
|
-
* @param {
|
|
1860
|
-
* @returns {
|
|
2156
|
+
* @param {bigint} parent
|
|
2157
|
+
* @returns {BigUint64Array}
|
|
1861
2158
|
*/
|
|
1862
2159
|
export function get_children(parent) {
|
|
1863
2160
|
const ret = wasm.get_children(parent);
|
|
1864
2161
|
if (ret[3]) {
|
|
1865
2162
|
throw takeFromExternrefTable0(ret[2]);
|
|
1866
2163
|
}
|
|
1867
|
-
var v1 =
|
|
1868
|
-
wasm.__wbindgen_free(ret[0], ret[1] *
|
|
2164
|
+
var v1 = getArrayU64FromWasm0(ret[0], ret[1]).slice();
|
|
2165
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
1869
2166
|
return v1;
|
|
1870
2167
|
}
|
|
1871
2168
|
|
|
@@ -1883,7 +2180,7 @@ export function get_children(parent) {
|
|
|
1883
2180
|
* # Errors
|
|
1884
2181
|
*
|
|
1885
2182
|
* Returns a `JsValue` error if the node does not exist or layout information is unavailable.
|
|
1886
|
-
* @param {
|
|
2183
|
+
* @param {bigint} node
|
|
1887
2184
|
* @returns {any}
|
|
1888
2185
|
*/
|
|
1889
2186
|
export function get_layout(node) {
|
|
@@ -1908,19 +2205,22 @@ export function get_layout(node) {
|
|
|
1908
2205
|
* # Errors
|
|
1909
2206
|
*
|
|
1910
2207
|
* Returns a `JsValue` error if internal tree access fails.
|
|
1911
|
-
* @param {
|
|
1912
|
-
* @returns {
|
|
2208
|
+
* @param {bigint} node
|
|
2209
|
+
* @returns {bigint | undefined}
|
|
1913
2210
|
*/
|
|
1914
2211
|
export function get_parent(node) {
|
|
1915
2212
|
const ret = wasm.get_parent(node);
|
|
1916
|
-
if (ret[
|
|
1917
|
-
throw takeFromExternrefTable0(ret[
|
|
2213
|
+
if (ret[3]) {
|
|
2214
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1918
2215
|
}
|
|
1919
|
-
return ret[0] ===
|
|
2216
|
+
return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
|
|
1920
2217
|
}
|
|
1921
2218
|
|
|
1922
2219
|
/**
|
|
1923
|
-
* Initialize
|
|
2220
|
+
* Initialize the WASM module.
|
|
2221
|
+
*
|
|
2222
|
+
* This function is automatically called when the WASM module is loaded.
|
|
2223
|
+
* It sets up the console error panic hook for better error messages in development.
|
|
1924
2224
|
*/
|
|
1925
2225
|
export function init() {
|
|
1926
2226
|
wasm.init();
|
|
@@ -1936,7 +2236,7 @@ export function init() {
|
|
|
1936
2236
|
* # Errors
|
|
1937
2237
|
*
|
|
1938
2238
|
* Returns a `JsValue` error if the node does not exist.
|
|
1939
|
-
* @param {
|
|
2239
|
+
* @param {bigint} node
|
|
1940
2240
|
*/
|
|
1941
2241
|
export function mark_dirty(node) {
|
|
1942
2242
|
const ret = wasm.mark_dirty(node);
|
|
@@ -1960,14 +2260,14 @@ export function mark_dirty(node) {
|
|
|
1960
2260
|
*
|
|
1961
2261
|
* Returns a `JsValue` error if the style cannot be deserialized or if node creation fails.
|
|
1962
2262
|
* @param {any} style
|
|
1963
|
-
* @returns {
|
|
2263
|
+
* @returns {bigint}
|
|
1964
2264
|
*/
|
|
1965
2265
|
export function new_leaf(style) {
|
|
1966
2266
|
const ret = wasm.new_leaf(style);
|
|
1967
2267
|
if (ret[2]) {
|
|
1968
2268
|
throw takeFromExternrefTable0(ret[1]);
|
|
1969
2269
|
}
|
|
1970
|
-
return ret[0]
|
|
2270
|
+
return BigInt.asUintN(64, ret[0]);
|
|
1971
2271
|
}
|
|
1972
2272
|
|
|
1973
2273
|
/**
|
|
@@ -1986,21 +2286,25 @@ export function new_leaf(style) {
|
|
|
1986
2286
|
*
|
|
1987
2287
|
* Returns a `JsValue` error if the style cannot be deserialized or if node creation fails.
|
|
1988
2288
|
* @param {any} style
|
|
1989
|
-
* @param {
|
|
1990
|
-
* @returns {
|
|
2289
|
+
* @param {BigUint64Array} children
|
|
2290
|
+
* @returns {bigint}
|
|
1991
2291
|
*/
|
|
1992
2292
|
export function new_with_children(style, children) {
|
|
1993
|
-
const ptr0 =
|
|
2293
|
+
const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
|
|
1994
2294
|
const len0 = WASM_VECTOR_LEN;
|
|
1995
2295
|
const ret = wasm.new_with_children(style, ptr0, len0);
|
|
1996
2296
|
if (ret[2]) {
|
|
1997
2297
|
throw takeFromExternrefTable0(ret[1]);
|
|
1998
2298
|
}
|
|
1999
|
-
return ret[0]
|
|
2299
|
+
return BigInt.asUintN(64, ret[0]);
|
|
2000
2300
|
}
|
|
2001
2301
|
|
|
2002
2302
|
/**
|
|
2003
|
-
* Get the total number of nodes
|
|
2303
|
+
* Get the total number of nodes currently in the layout tree.
|
|
2304
|
+
*
|
|
2305
|
+
* # Returns
|
|
2306
|
+
*
|
|
2307
|
+
* The total count of all nodes in the tree.
|
|
2004
2308
|
* @returns {number}
|
|
2005
2309
|
*/
|
|
2006
2310
|
export function node_count() {
|
|
@@ -2039,8 +2343,8 @@ export function px(value) {
|
|
|
2039
2343
|
* # Errors
|
|
2040
2344
|
*
|
|
2041
2345
|
* Returns a `JsValue` error if the child is not found in the parent.
|
|
2042
|
-
* @param {
|
|
2043
|
-
* @param {
|
|
2346
|
+
* @param {bigint} parent
|
|
2347
|
+
* @param {bigint} child
|
|
2044
2348
|
*/
|
|
2045
2349
|
export function remove_child(parent, child) {
|
|
2046
2350
|
const ret = wasm.remove_child(parent, child);
|
|
@@ -2059,7 +2363,7 @@ export function remove_child(parent, child) {
|
|
|
2059
2363
|
* # Errors
|
|
2060
2364
|
*
|
|
2061
2365
|
* Returns a `JsValue` error if the node does not exist or cannot be removed.
|
|
2062
|
-
* @param {
|
|
2366
|
+
* @param {bigint} node
|
|
2063
2367
|
*/
|
|
2064
2368
|
export function remove_node(node) {
|
|
2065
2369
|
const ret = wasm.remove_node(node);
|
|
@@ -2079,11 +2383,11 @@ export function remove_node(node) {
|
|
|
2079
2383
|
* # Errors
|
|
2080
2384
|
*
|
|
2081
2385
|
* Returns a `JsValue` error if the operation fails.
|
|
2082
|
-
* @param {
|
|
2083
|
-
* @param {
|
|
2386
|
+
* @param {bigint} parent
|
|
2387
|
+
* @param {BigUint64Array} children
|
|
2084
2388
|
*/
|
|
2085
2389
|
export function set_children(parent, children) {
|
|
2086
|
-
const ptr0 =
|
|
2390
|
+
const ptr0 = passArray64ToWasm0(children, wasm.__wbindgen_malloc);
|
|
2087
2391
|
const len0 = WASM_VECTOR_LEN;
|
|
2088
2392
|
const ret = wasm.set_children(parent, ptr0, len0);
|
|
2089
2393
|
if (ret[1]) {
|
|
@@ -2102,7 +2406,7 @@ export function set_children(parent, children) {
|
|
|
2102
2406
|
* # Errors
|
|
2103
2407
|
*
|
|
2104
2408
|
* Returns a `JsValue` error if the style cannot be deserialized or if the node does not exist.
|
|
2105
|
-
* @param {
|
|
2409
|
+
* @param {bigint} node
|
|
2106
2410
|
* @param {any} style
|
|
2107
2411
|
*/
|
|
2108
2412
|
export function set_style(node, style) {
|
|
@@ -2182,6 +2486,10 @@ function __wbg_get_imports() {
|
|
|
2182
2486
|
const ret = typeof(arg0) === 'function';
|
|
2183
2487
|
return ret;
|
|
2184
2488
|
};
|
|
2489
|
+
imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
|
|
2490
|
+
const ret = arg0 === null;
|
|
2491
|
+
return ret;
|
|
2492
|
+
};
|
|
2185
2493
|
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
2186
2494
|
const val = arg0;
|
|
2187
2495
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -2216,6 +2524,10 @@ function __wbg_get_imports() {
|
|
|
2216
2524
|
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
2217
2525
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2218
2526
|
};
|
|
2527
|
+
imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
2528
|
+
const ret = arg0.call(arg1, arg2);
|
|
2529
|
+
return ret;
|
|
2530
|
+
}, arguments) };
|
|
2219
2531
|
imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
2220
2532
|
const ret = arg0.call(arg1);
|
|
2221
2533
|
return ret;
|
|
@@ -2239,6 +2551,9 @@ function __wbg_get_imports() {
|
|
|
2239
2551
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
2240
2552
|
}
|
|
2241
2553
|
};
|
|
2554
|
+
imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
|
|
2555
|
+
console.error(arg0);
|
|
2556
|
+
};
|
|
2242
2557
|
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
2243
2558
|
const ret = arg0[arg1 >>> 0];
|
|
2244
2559
|
return ret;
|
|
@@ -2328,6 +2643,9 @@ function __wbg_get_imports() {
|
|
|
2328
2643
|
const ret = arg0.value;
|
|
2329
2644
|
return ret;
|
|
2330
2645
|
};
|
|
2646
|
+
imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
|
|
2647
|
+
console.warn(arg0);
|
|
2648
|
+
};
|
|
2331
2649
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
2332
2650
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2333
2651
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
@@ -2354,8 +2672,8 @@ function __wbg_get_imports() {
|
|
|
2354
2672
|
function __wbg_finalize_init(instance, module) {
|
|
2355
2673
|
wasm = instance.exports;
|
|
2356
2674
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
2675
|
+
cachedBigUint64ArrayMemory0 = null;
|
|
2357
2676
|
cachedDataViewMemory0 = null;
|
|
2358
|
-
cachedUint32ArrayMemory0 = null;
|
|
2359
2677
|
cachedUint8ArrayMemory0 = null;
|
|
2360
2678
|
|
|
2361
2679
|
|