tinybase 8.4.0-beta.0 → 8.4.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.
Files changed (40) hide show
  1. package/@types/ui-react-dom/index.d.ts +10 -10
  2. package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
  3. package/@types/ui-react-inspector/index.d.ts +1 -1
  4. package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
  5. package/@types/ui-solid-dom/index.d.ts +2013 -0
  6. package/@types/ui-solid-dom/with-schemas/index.d.ts +2064 -0
  7. package/@types/ui-solid-inspector/index.d.ts +73 -0
  8. package/@types/ui-solid-inspector/with-schemas/index.d.ts +73 -0
  9. package/@types/ui-svelte-dom/index.d.ts +10 -10
  10. package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
  11. package/@types/ui-svelte-inspector/index.d.ts +1 -1
  12. package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
  13. package/agents.md +10 -0
  14. package/min/ui-solid/index.js +1 -1
  15. package/min/ui-solid/index.js.gz +0 -0
  16. package/min/ui-solid/with-schemas/index.js +1 -1
  17. package/min/ui-solid/with-schemas/index.js.gz +0 -0
  18. package/min/ui-solid-dom/index.js +1 -0
  19. package/min/ui-solid-dom/index.js.gz +0 -0
  20. package/min/ui-solid-dom/with-schemas/index.js +1 -0
  21. package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
  22. package/min/ui-solid-inspector/index.js +1 -0
  23. package/min/ui-solid-inspector/index.js.gz +0 -0
  24. package/min/ui-solid-inspector/with-schemas/index.js +1 -0
  25. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  26. package/min/ui-svelte-inspector/index.js +1 -1
  27. package/min/ui-svelte-inspector/index.js.gz +0 -0
  28. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  29. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  30. package/package.json +76 -2
  31. package/readme.md +14 -14
  32. package/releases.md +98 -62
  33. package/ui-solid/index.js +208 -104
  34. package/ui-solid/with-schemas/index.js +208 -104
  35. package/ui-solid-dom/index.js +1575 -0
  36. package/ui-solid-dom/with-schemas/index.js +1575 -0
  37. package/ui-solid-inspector/index.js +5621 -0
  38. package/ui-solid-inspector/with-schemas/index.js +5621 -0
  39. package/ui-svelte-inspector/index.js +6 -2
  40. package/ui-svelte-inspector/with-schemas/index.js +6 -2
package/ui-solid/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  untrack,
9
9
  useContext,
10
10
  } from 'solid-js';
11
- import h from 'solid-js/h';
11
+ import {createComponent, memo, mergeProps} from 'solid-js/web';
12
12
 
13
13
  const getTypeOf = (thing) => typeof thing;
14
14
  const TINYBASE = 'tinybase';
@@ -296,11 +296,14 @@ const Provider = (props) => {
296
296
  addExtraThingById,
297
297
  delExtraThingById,
298
298
  ]);
299
- return /* @__PURE__ */ h(
300
- Context.Provider,
301
- {value: {value: contextValue}},
302
- () => props.children,
303
- );
299
+ return createComponent(Context.Provider, {
300
+ value: {
301
+ value: contextValue,
302
+ },
303
+ get children() {
304
+ return props.children;
305
+ },
306
+ });
304
307
  };
305
308
 
306
309
  const EMPTY_ARRAY = [];
@@ -1555,13 +1558,14 @@ const CheckpointView = (props) => {
1555
1558
  () => props.checkpointId,
1556
1559
  () => props.checkpoints,
1557
1560
  );
1558
- return () =>
1561
+ return memo(() =>
1559
1562
  wrap(
1560
1563
  getValue(checkpoint) ?? EMPTY_STRING,
1561
1564
  void 0,
1562
1565
  props.debugIds,
1563
1566
  props.checkpointId,
1564
- );
1567
+ ),
1568
+ );
1565
1569
  };
1566
1570
 
1567
1571
  const ResultCellView = (props) => {
@@ -1571,13 +1575,14 @@ const ResultCellView = (props) => {
1571
1575
  () => props.cellId,
1572
1576
  () => props.queries,
1573
1577
  );
1574
- return () =>
1578
+ return memo(() =>
1575
1579
  wrap(
1576
1580
  EMPTY_STRING + (getValue(resultCell) ?? EMPTY_STRING),
1577
1581
  void 0,
1578
1582
  props.debugIds,
1579
1583
  props.cellId,
1580
- );
1584
+ ),
1585
+ );
1581
1586
  };
1582
1587
 
1583
1588
  const ResultRowView = (props) => {
@@ -1586,24 +1591,38 @@ const ResultRowView = (props) => {
1586
1591
  () => props.rowId,
1587
1592
  () => props.queries,
1588
1593
  );
1589
- return () => {
1594
+ const content = () => {
1590
1595
  const ResultCell = props.resultCellComponent ?? ResultCellView;
1591
1596
  return wrap(
1592
1597
  arrayMap(getValue(resultCellIds), (cellId) =>
1593
- /* @__PURE__ */ h(ResultCell, {
1594
- ...getProps(props.getResultCellComponentProps, cellId),
1595
- queryId: props.queryId,
1596
- rowId: props.rowId,
1597
- cellId,
1598
- queries: props.queries,
1599
- debugIds: props.debugIds,
1600
- }),
1598
+ createComponent(
1599
+ ResultCell,
1600
+ mergeProps(
1601
+ () => getProps(props.getResultCellComponentProps, cellId),
1602
+ {
1603
+ get queryId() {
1604
+ return props.queryId;
1605
+ },
1606
+ get rowId() {
1607
+ return props.rowId;
1608
+ },
1609
+ cellId: cellId,
1610
+ get queries() {
1611
+ return props.queries;
1612
+ },
1613
+ get debugIds() {
1614
+ return props.debugIds;
1615
+ },
1616
+ },
1617
+ ),
1618
+ ),
1601
1619
  ),
1602
1620
  props.separator,
1603
1621
  props.debugIds,
1604
1622
  props.rowId,
1605
1623
  );
1606
1624
  };
1625
+ return memo(content);
1607
1626
  };
1608
1627
 
1609
1628
  const CellView = (props) => {
@@ -1613,13 +1632,14 @@ const CellView = (props) => {
1613
1632
  () => props.cellId,
1614
1633
  () => props.store,
1615
1634
  );
1616
- return () =>
1635
+ return memo(() =>
1617
1636
  wrap(
1618
1637
  EMPTY_STRING + (getValue(cell) ?? EMPTY_STRING),
1619
1638
  void 0,
1620
1639
  props.debugIds,
1621
1640
  props.cellId,
1622
- );
1641
+ ),
1642
+ );
1623
1643
  };
1624
1644
 
1625
1645
  const useCustomOrDefaultCellIds = (customCellIds, tableId, rowId, store) => {
@@ -1634,64 +1654,95 @@ const RowView = (props) => {
1634
1654
  () => props.rowId,
1635
1655
  () => props.store,
1636
1656
  );
1637
- return () => {
1657
+ const content = () => {
1638
1658
  const Cell = props.cellComponent ?? CellView;
1639
1659
  return wrap(
1640
1660
  arrayMap(getValue(cellIds), (cellId) =>
1641
- /* @__PURE__ */ h(Cell, {
1642
- ...getProps(props.getCellComponentProps, cellId),
1643
- tableId: props.tableId,
1644
- rowId: props.rowId,
1645
- cellId,
1646
- store: props.store,
1647
- debugIds: props.debugIds,
1648
- }),
1661
+ createComponent(
1662
+ Cell,
1663
+ mergeProps(() => getProps(props.getCellComponentProps, cellId), {
1664
+ get tableId() {
1665
+ return props.tableId;
1666
+ },
1667
+ get rowId() {
1668
+ return props.rowId;
1669
+ },
1670
+ cellId: cellId,
1671
+ get store() {
1672
+ return props.store;
1673
+ },
1674
+ get debugIds() {
1675
+ return props.debugIds;
1676
+ },
1677
+ }),
1678
+ ),
1649
1679
  ),
1650
1680
  props.separator,
1651
1681
  props.debugIds,
1652
1682
  props.rowId,
1653
1683
  );
1654
1684
  };
1685
+ return memo(content);
1655
1686
  };
1656
1687
 
1657
1688
  const tableView = (props, rowIds) => {
1658
- return () => {
1689
+ const content = () => {
1659
1690
  const Row = props.rowComponent ?? RowView;
1660
1691
  return wrap(
1661
1692
  arrayMap(getValue(rowIds), (rowId) =>
1662
- /* @__PURE__ */ h(Row, {
1663
- ...getProps(props.getRowComponentProps, rowId),
1664
- tableId: props.tableId,
1665
- rowId,
1666
- customCellIds: props.customCellIds,
1667
- store: props.store,
1668
- debugIds: props.debugIds,
1669
- }),
1693
+ createComponent(
1694
+ Row,
1695
+ mergeProps(() => getProps(props.getRowComponentProps, rowId), {
1696
+ get tableId() {
1697
+ return props.tableId;
1698
+ },
1699
+ rowId: rowId,
1700
+ get customCellIds() {
1701
+ return props.customCellIds;
1702
+ },
1703
+ get store() {
1704
+ return props.store;
1705
+ },
1706
+ get debugIds() {
1707
+ return props.debugIds;
1708
+ },
1709
+ }),
1710
+ ),
1670
1711
  ),
1671
1712
  props.separator,
1672
1713
  props.debugIds,
1673
1714
  props.tableId,
1674
1715
  );
1675
1716
  };
1717
+ return memo(content);
1676
1718
  };
1677
1719
  const resultTableView = (props, rowIds) => {
1678
- return () => {
1720
+ const content = () => {
1679
1721
  const ResultRow = props.resultRowComponent ?? ResultRowView;
1680
1722
  return wrap(
1681
1723
  arrayMap(getValue(rowIds), (rowId) =>
1682
- /* @__PURE__ */ h(ResultRow, {
1683
- ...getProps(props.getResultRowComponentProps, rowId),
1684
- queryId: props.queryId,
1685
- rowId,
1686
- queries: props.queries,
1687
- debugIds: props.debugIds,
1688
- }),
1724
+ createComponent(
1725
+ ResultRow,
1726
+ mergeProps(() => getProps(props.getResultRowComponentProps, rowId), {
1727
+ get queryId() {
1728
+ return props.queryId;
1729
+ },
1730
+ rowId: rowId,
1731
+ get queries() {
1732
+ return props.queries;
1733
+ },
1734
+ get debugIds() {
1735
+ return props.debugIds;
1736
+ },
1737
+ }),
1738
+ ),
1689
1739
  ),
1690
1740
  props.separator,
1691
1741
  props.debugIds,
1692
1742
  props.queryId,
1693
1743
  );
1694
1744
  };
1745
+ return memo(content);
1695
1746
  };
1696
1747
  const useComponentPerRow = (props, getRowIdsHook, rowId) => {
1697
1748
  const resolvedRelationships = useRelationshipsOrRelationshipsById(
@@ -1702,7 +1753,7 @@ const useComponentPerRow = (props, getRowIdsHook, rowId) => {
1702
1753
  rowId,
1703
1754
  resolvedRelationships,
1704
1755
  );
1705
- return () => {
1756
+ const content = () => {
1706
1757
  const Row = props.rowComponent ?? RowView;
1707
1758
  const [_relationship, store, localTableId] = getRelationshipsStoreTableIds(
1708
1759
  getValue(resolvedRelationships),
@@ -1710,39 +1761,54 @@ const useComponentPerRow = (props, getRowIdsHook, rowId) => {
1710
1761
  );
1711
1762
  return wrap(
1712
1763
  arrayMap(getValue(rowIds), (localRowId) =>
1713
- /* @__PURE__ */ h(Row, {
1714
- ...getProps(props.getRowComponentProps, localRowId),
1715
- tableId: localTableId,
1716
- rowId: localRowId,
1717
- store,
1718
- debugIds: props.debugIds,
1719
- }),
1764
+ createComponent(
1765
+ Row,
1766
+ mergeProps(() => getProps(props.getRowComponentProps, localRowId), {
1767
+ tableId: localTableId,
1768
+ rowId: localRowId,
1769
+ store: store,
1770
+ get debugIds() {
1771
+ return props.debugIds;
1772
+ },
1773
+ }),
1774
+ ),
1720
1775
  ),
1721
1776
  props.separator,
1722
1777
  props.debugIds,
1723
1778
  getValue(rowId),
1724
1779
  );
1725
1780
  };
1781
+ return memo(content);
1726
1782
  };
1727
1783
  const getUseCheckpointView = (getCheckpoints) => (props) => {
1728
1784
  const resolvedCheckpoints = useCheckpointsOrCheckpointsById(
1729
1785
  () => props.checkpoints,
1730
1786
  );
1731
1787
  const checkpointIds = useCheckpointIds(resolvedCheckpoints);
1732
- return () => {
1788
+ const content = () => {
1733
1789
  const Checkpoint = props.checkpointComponent ?? CheckpointView;
1734
1790
  return wrap(
1735
1791
  arrayMap(getCheckpoints(getValue(checkpointIds)), (checkpointId) =>
1736
- /* @__PURE__ */ h(Checkpoint, {
1737
- ...getProps(props.getCheckpointComponentProps, checkpointId),
1738
- checkpoints: getValue(resolvedCheckpoints),
1739
- checkpointId,
1740
- debugIds: props.debugIds,
1741
- }),
1792
+ createComponent(
1793
+ Checkpoint,
1794
+ mergeProps(
1795
+ () => getProps(props.getCheckpointComponentProps, checkpointId),
1796
+ {
1797
+ get checkpoints() {
1798
+ return getValue(resolvedCheckpoints);
1799
+ },
1800
+ checkpointId: checkpointId,
1801
+ get debugIds() {
1802
+ return props.debugIds;
1803
+ },
1804
+ },
1805
+ ),
1806
+ ),
1742
1807
  ),
1743
1808
  props.separator,
1744
1809
  );
1745
1810
  };
1811
+ return memo(content);
1746
1812
  };
1747
1813
 
1748
1814
  const BackwardCheckpointsView = getUseCheckpointView(
@@ -1764,7 +1830,7 @@ const SliceView = (props) => {
1764
1830
  () => props.sliceId,
1765
1831
  resolvedIndexes,
1766
1832
  );
1767
- return () => {
1833
+ const content = () => {
1768
1834
  const Row = props.rowComponent ?? RowView;
1769
1835
  const [_indexesValue, store, tableId] = getIndexStoreTableId(
1770
1836
  getValue(resolvedIndexes),
@@ -1772,19 +1838,24 @@ const SliceView = (props) => {
1772
1838
  );
1773
1839
  return wrap(
1774
1840
  arrayMap(getValue(rowIds), (rowId) =>
1775
- /* @__PURE__ */ h(Row, {
1776
- ...getProps(props.getRowComponentProps, rowId),
1777
- tableId,
1778
- rowId,
1779
- store,
1780
- debugIds: props.debugIds,
1781
- }),
1841
+ createComponent(
1842
+ Row,
1843
+ mergeProps(() => getProps(props.getRowComponentProps, rowId), {
1844
+ tableId: tableId,
1845
+ rowId: rowId,
1846
+ store: store,
1847
+ get debugIds() {
1848
+ return props.debugIds;
1849
+ },
1850
+ }),
1851
+ ),
1782
1852
  ),
1783
1853
  props.separator,
1784
1854
  props.debugIds,
1785
1855
  props.sliceId,
1786
1856
  );
1787
1857
  };
1858
+ return memo(content);
1788
1859
  };
1789
1860
 
1790
1861
  const IndexView = (props) => {
@@ -1792,23 +1863,32 @@ const IndexView = (props) => {
1792
1863
  () => props.indexId,
1793
1864
  () => props.indexes,
1794
1865
  );
1795
- return () => {
1866
+ const content = () => {
1796
1867
  const Slice = props.sliceComponent ?? SliceView;
1797
1868
  return wrap(
1798
1869
  arrayMap(getValue(sliceIds), (sliceId) =>
1799
- /* @__PURE__ */ h(Slice, {
1800
- ...getProps(props.getSliceComponentProps, sliceId),
1801
- indexId: props.indexId,
1802
- sliceId,
1803
- indexes: props.indexes,
1804
- debugIds: props.debugIds,
1805
- }),
1870
+ createComponent(
1871
+ Slice,
1872
+ mergeProps(() => getProps(props.getSliceComponentProps, sliceId), {
1873
+ get indexId() {
1874
+ return props.indexId;
1875
+ },
1876
+ sliceId: sliceId,
1877
+ get indexes() {
1878
+ return props.indexes;
1879
+ },
1880
+ get debugIds() {
1881
+ return props.debugIds;
1882
+ },
1883
+ }),
1884
+ ),
1806
1885
  ),
1807
1886
  props.separator,
1808
1887
  props.debugIds,
1809
1888
  props.indexId,
1810
1889
  );
1811
1890
  };
1891
+ return memo(content);
1812
1892
  };
1813
1893
 
1814
1894
  const LinkedRowsView = (props) =>
@@ -1822,13 +1902,14 @@ const MetricView = (props) => {
1822
1902
  () => props.metricId,
1823
1903
  () => props.metrics,
1824
1904
  );
1825
- return () =>
1905
+ return memo(() =>
1826
1906
  wrap(
1827
1907
  getValue(metric) ?? EMPTY_STRING,
1828
1908
  void 0,
1829
1909
  props.debugIds,
1830
1910
  props.metricId,
1831
- );
1911
+ ),
1912
+ );
1832
1913
  };
1833
1914
 
1834
1915
  const RemoteRowView = (props) => {
@@ -1840,7 +1921,7 @@ const RemoteRowView = (props) => {
1840
1921
  () => props.localRowId,
1841
1922
  resolvedRelationships,
1842
1923
  );
1843
- return () => {
1924
+ const content = () => {
1844
1925
  const Row = props.rowComponent ?? RowView;
1845
1926
  const [_relationshipsValue, store, , remoteTableId] =
1846
1927
  getRelationshipsStoreTableIds(
@@ -1851,18 +1932,26 @@ const RemoteRowView = (props) => {
1851
1932
  return wrap(
1852
1933
  isUndefined(remoteTableId) || isUndefined(remoteRowId)
1853
1934
  ? null
1854
- : /* @__PURE__ */ h(Row, {
1855
- ...getProps(props.getRowComponentProps, remoteRowId),
1856
- tableId: remoteTableId,
1857
- rowId: remoteRowId,
1858
- store,
1859
- debugIds: props.debugIds,
1860
- }),
1935
+ : createComponent(
1936
+ Row,
1937
+ mergeProps(
1938
+ () => getProps(props.getRowComponentProps, remoteRowId),
1939
+ {
1940
+ tableId: remoteTableId,
1941
+ rowId: remoteRowId,
1942
+ store: store,
1943
+ get debugIds() {
1944
+ return props.debugIds;
1945
+ },
1946
+ },
1947
+ ),
1948
+ ),
1861
1949
  void 0,
1862
1950
  props.debugIds,
1863
1951
  props.localRowId,
1864
1952
  );
1865
1953
  };
1954
+ return memo(content);
1866
1955
  };
1867
1956
 
1868
1957
  const ResultSortedTableView = (props) =>
@@ -1911,20 +2000,27 @@ const TableView = (props) =>
1911
2000
 
1912
2001
  const TablesView = (props) => {
1913
2002
  const tableIds = useTableIds(() => props.store);
1914
- return () => {
2003
+ const content = () => {
1915
2004
  const Table = props.tableComponent ?? TableView;
1916
2005
  return wrap(
1917
2006
  arrayMap(getValue(tableIds), (tableId) =>
1918
- /* @__PURE__ */ h(Table, {
1919
- ...getProps(props.getTableComponentProps, tableId),
1920
- tableId,
1921
- store: props.store,
1922
- debugIds: props.debugIds,
1923
- }),
2007
+ createComponent(
2008
+ Table,
2009
+ mergeProps(() => getProps(props.getTableComponentProps, tableId), {
2010
+ tableId: tableId,
2011
+ get store() {
2012
+ return props.store;
2013
+ },
2014
+ get debugIds() {
2015
+ return props.debugIds;
2016
+ },
2017
+ }),
2018
+ ),
1924
2019
  ),
1925
2020
  props.separator,
1926
2021
  );
1927
2022
  };
2023
+ return memo(content);
1928
2024
  };
1929
2025
 
1930
2026
  const ValueView = (props) => {
@@ -1932,31 +2028,39 @@ const ValueView = (props) => {
1932
2028
  () => props.valueId,
1933
2029
  () => props.store,
1934
2030
  );
1935
- return () =>
2031
+ return memo(() =>
1936
2032
  wrap(
1937
2033
  EMPTY_STRING + (getValue(value) ?? EMPTY_STRING),
1938
2034
  void 0,
1939
2035
  props.debugIds,
1940
2036
  props.valueId,
1941
- );
2037
+ ),
2038
+ );
1942
2039
  };
1943
2040
 
1944
2041
  const ValuesView = (props) => {
1945
2042
  const valueIds = useValueIds(() => props.store);
1946
- return () => {
2043
+ const content = () => {
1947
2044
  const Value = props.valueComponent ?? ValueView;
1948
2045
  return wrap(
1949
2046
  arrayMap(getValue(valueIds), (valueId) =>
1950
- /* @__PURE__ */ h(Value, {
1951
- ...getProps(props.getValueComponentProps, valueId),
1952
- valueId,
1953
- store: props.store,
1954
- debugIds: props.debugIds,
1955
- }),
2047
+ createComponent(
2048
+ Value,
2049
+ mergeProps(() => getProps(props.getValueComponentProps, valueId), {
2050
+ valueId: valueId,
2051
+ get store() {
2052
+ return props.store;
2053
+ },
2054
+ get debugIds() {
2055
+ return props.debugIds;
2056
+ },
2057
+ }),
2058
+ ),
1956
2059
  ),
1957
2060
  props.separator,
1958
2061
  );
1959
2062
  };
2063
+ return memo(content);
1960
2064
  };
1961
2065
 
1962
2066
  export {