jazz-tools 0.15.0 → 0.15.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.
Files changed (48) hide show
  1. package/.turbo/turbo-build.log +44 -44
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-FSIM7N33.js → chunk-VBDJM6Z5.js} +142 -31
  4. package/dist/chunk-VBDJM6Z5.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/inspector/index.js +30 -4
  7. package/dist/inspector/index.js.map +1 -1
  8. package/dist/inspector/viewer/new-app.d.ts.map +1 -1
  9. package/dist/inspector/viewer/use-open-inspector.d.ts +2 -0
  10. package/dist/inspector/viewer/use-open-inspector.d.ts.map +1 -0
  11. package/dist/inspector/viewer/use-page-path.d.ts.map +1 -1
  12. package/dist/react/index.js +0 -2
  13. package/dist/react/index.js.map +1 -1
  14. package/dist/react/testing.js +0 -2
  15. package/dist/react/testing.js.map +1 -1
  16. package/dist/react-native-core/index.js +2 -18
  17. package/dist/react-native-core/index.js.map +1 -1
  18. package/dist/react-native-core/media.d.ts.map +1 -1
  19. package/dist/testing.js +1 -1
  20. package/dist/tools/coValues/coFeed.d.ts +9 -0
  21. package/dist/tools/coValues/coFeed.d.ts.map +1 -1
  22. package/dist/tools/coValues/coMap.d.ts +98 -2
  23. package/dist/tools/coValues/coMap.d.ts.map +1 -1
  24. package/dist/tools/coValues/interfaces.d.ts +3 -0
  25. package/dist/tools/coValues/interfaces.d.ts.map +1 -1
  26. package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +12 -0
  27. package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
  28. package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
  29. package/dist/tools/subscribe/CoValueCoreSubscription.d.ts +2 -1
  30. package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -1
  31. package/dist/tools/subscribe/SubscriptionScope.d.ts +2 -1
  32. package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
  33. package/package.json +5 -5
  34. package/src/inspector/viewer/new-app.tsx +2 -1
  35. package/src/inspector/viewer/use-open-inspector.ts +18 -0
  36. package/src/inspector/viewer/use-page-path.ts +14 -1
  37. package/src/react-native-core/media.tsx +2 -22
  38. package/src/tools/coValues/coFeed.ts +38 -0
  39. package/src/tools/coValues/coMap.ts +118 -14
  40. package/src/tools/coValues/interfaces.ts +14 -4
  41. package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +38 -0
  42. package/src/tools/implementation/zodSchema/zodCo.ts +6 -0
  43. package/src/tools/subscribe/CoValueCoreSubscription.ts +12 -9
  44. package/src/tools/subscribe/SubscriptionScope.ts +31 -19
  45. package/src/tools/tests/coFeed.test.ts +69 -0
  46. package/src/tools/tests/coMap.test.ts +480 -4
  47. package/src/tools/tests/load.test.ts +2 -1
  48. package/dist/chunk-FSIM7N33.js.map +0 -1
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  subscribeToCoValue,
35
35
  zodReExport_exports,
36
36
  zodSchemaToCoSchema
37
- } from "./chunk-FSIM7N33.js";
37
+ } from "./chunk-VBDJM6Z5.js";
38
38
 
39
39
  // src/tools/auth/clerk/index.ts
40
40
  import {
@@ -6,7 +6,7 @@ import React7 from "react";
6
6
  // src/inspector/viewer/new-app.tsx
7
7
  import { styled as styled18 } from "goober";
8
8
  import { useJazzContext } from "jazz-tools/react-core";
9
- import { useState as useState8 } from "react";
9
+ import { useState as useState9 } from "react";
10
10
 
11
11
  // src/inspector/ui/button.tsx
12
12
  import { styled } from "goober";
@@ -1611,10 +1611,22 @@ function PageStack({
1611
1611
 
1612
1612
  // src/inspector/viewer/use-page-path.ts
1613
1613
  import { useCallback, useEffect as useEffect5, useState as useState7 } from "react";
1614
+ var STORAGE_KEY = "jazz-inspector-paths";
1614
1615
  function usePagePath(defaultPath) {
1615
- const [path, setPath] = useState7([]);
1616
+ const [path, setPath] = useState7(() => {
1617
+ const stored = localStorage.getItem(STORAGE_KEY);
1618
+ if (stored) {
1619
+ try {
1620
+ return JSON.parse(stored);
1621
+ } catch (e) {
1622
+ console.warn("Failed to parse stored path:", e);
1623
+ }
1624
+ }
1625
+ return defaultPath || [];
1626
+ });
1616
1627
  const updatePath = useCallback((newPath) => {
1617
1628
  setPath(newPath);
1629
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(newPath));
1618
1630
  }, []);
1619
1631
  useEffect5(() => {
1620
1632
  if (defaultPath && JSON.stringify(path) !== JSON.stringify(defaultPath)) {
@@ -1813,6 +1825,20 @@ function InspectorButton({
1813
1825
  ] });
1814
1826
  }
1815
1827
 
1828
+ // src/inspector/viewer/use-open-inspector.ts
1829
+ import { useEffect as useEffect6, useState as useState8 } from "react";
1830
+ var STORAGE_KEY2 = "jazz-inspector-open";
1831
+ function useOpenInspector() {
1832
+ const [open, setOpen] = useState8(() => {
1833
+ const stored = localStorage.getItem(STORAGE_KEY2);
1834
+ return stored ? JSON.parse(stored) : false;
1835
+ });
1836
+ useEffect6(() => {
1837
+ localStorage.setItem(STORAGE_KEY2, JSON.stringify(open));
1838
+ }, [open]);
1839
+ return [open, setOpen];
1840
+ }
1841
+
1816
1842
  // src/inspector/viewer/new-app.tsx
1817
1843
  import { Fragment as Fragment10, jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
1818
1844
  var InspectorContainer = styled18("div")`
@@ -1876,8 +1902,8 @@ function JazzInspectorInternal({
1876
1902
  localNode,
1877
1903
  accountId
1878
1904
  }) {
1879
- const [open, setOpen] = useState8(false);
1880
- const [coValueId, setCoValueId] = useState8("");
1905
+ const [open, setOpen] = useOpenInspector();
1906
+ const [coValueId, setCoValueId] = useState9("");
1881
1907
  const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
1882
1908
  const handleCoValueIdSubmit = (e) => {
1883
1909
  e.preventDefault();