jazz-tools 0.18.6 → 0.18.8
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/.turbo/turbo-build.log +55 -55
- package/CHANGELOG.md +28 -0
- package/dist/better-auth/auth/server.d.ts.map +1 -1
- package/dist/better-auth/auth/server.js +8 -4
- package/dist/better-auth/auth/server.js.map +1 -1
- package/dist/{chunk-45VKEOXG.js → chunk-QF3R3C4N.js} +75 -22
- package/dist/chunk-QF3R3C4N.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/inspector/{custom-element-IBHKHN27.js → custom-element-G6SPZEBR.js} +292 -31
- package/dist/inspector/custom-element-G6SPZEBR.js.map +1 -0
- package/dist/inspector/index.d.ts +1 -1
- package/dist/inspector/index.js +302 -41
- package/dist/inspector/index.js.map +1 -1
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/inspector/ui/button.d.ts +1 -1
- package/dist/inspector/ui/button.d.ts.map +1 -1
- package/dist/inspector/ui/heading.d.ts +2 -1
- package/dist/inspector/ui/heading.d.ts.map +1 -1
- package/dist/inspector/ui/input.d.ts.map +1 -1
- package/dist/inspector/ui/modal.d.ts +16 -0
- package/dist/inspector/ui/modal.d.ts.map +1 -0
- package/dist/inspector/viewer/delete-local-data.d.ts +2 -0
- package/dist/inspector/viewer/delete-local-data.d.ts.map +1 -0
- package/dist/inspector/viewer/{inpsector-button.d.ts → inspector-button.d.ts} +1 -1
- package/dist/inspector/viewer/{inpsector-button.d.ts.map → inspector-button.d.ts.map} +1 -1
- package/dist/inspector/viewer/new-app.d.ts +1 -1
- package/dist/inspector/viewer/new-app.d.ts.map +1 -1
- package/dist/react/hooks.d.ts +1 -1
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-core/hooks.d.ts +133 -0
- package/dist/react-core/hooks.d.ts.map +1 -1
- package/dist/react-core/index.js +85 -17
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-core/tests/useCoStateWithSelector.test.d.ts +2 -0
- package/dist/react-core/tests/useCoStateWithSelector.test.d.ts.map +1 -0
- package/dist/react-native-core/hooks.d.ts +1 -1
- package/dist/react-native-core/hooks.d.ts.map +1 -1
- package/dist/react-native-core/index.js +3 -1
- package/dist/react-native-core/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/coValues/CoFieldInit.d.ts +5 -5
- package/dist/tools/coValues/CoFieldInit.d.ts.map +1 -1
- package/dist/tools/coValues/CoValueBase.d.ts +14 -0
- package/dist/tools/coValues/CoValueBase.d.ts.map +1 -1
- package/dist/tools/coValues/coMap.d.ts +0 -12
- package/dist/tools/coValues/coMap.d.ts.map +1 -1
- package/dist/tools/implementation/createContext.d.ts +2 -1
- package/dist/tools/implementation/createContext.d.ts.map +1 -1
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +5 -3
- package/dist/tools/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
- package/dist/tools/tests/utils.d.ts.map +1 -1
- package/dist/worker/index.d.ts +4 -0
- package/dist/worker/index.d.ts.map +1 -1
- package/dist/worker/index.js +4 -2
- package/dist/worker/index.js.map +1 -1
- package/package.json +6 -4
- package/src/better-auth/auth/server.ts +8 -4
- package/src/better-auth/auth/tests/server.test.ts +2 -2
- package/src/inspector/index.tsx +1 -1
- package/src/inspector/ui/button.tsx +15 -1
- package/src/inspector/ui/heading.tsx +7 -2
- package/src/inspector/ui/input.tsx +6 -2
- package/src/inspector/ui/modal.tsx +158 -0
- package/src/inspector/viewer/delete-local-data.tsx +101 -0
- package/src/inspector/viewer/new-app.tsx +3 -1
- package/src/react/hooks.tsx +1 -0
- package/src/react/index.ts +1 -0
- package/src/react-core/hooks.ts +162 -0
- package/src/react-core/tests/useCoStateWithSelector.test.ts +149 -0
- package/src/react-native-core/hooks.tsx +1 -0
- package/src/tools/coValues/CoFieldInit.ts +5 -5
- package/src/tools/coValues/CoValueBase.ts +32 -0
- package/src/tools/coValues/coList.ts +35 -0
- package/src/tools/coValues/coMap.ts +0 -18
- package/src/tools/implementation/createContext.ts +9 -2
- package/src/tools/implementation/zodSchema/schemaTypes/CoMapSchema.ts +22 -8
- package/src/tools/tests/coList.test.ts +41 -0
- package/src/tools/tests/coMap.test.ts +37 -0
- package/src/tools/tests/coPlainText.test.ts +24 -0
- package/src/tools/tests/createContext.test.ts +24 -0
- package/src/tools/tests/deepLoading.test.ts +2 -0
- package/src/tools/tests/patterns/requestToJoin.test.ts +14 -6
- package/src/tools/tests/utils.ts +1 -0
- package/src/worker/index.ts +6 -0
- package/dist/chunk-45VKEOXG.js.map +0 -1
- package/dist/inspector/custom-element-IBHKHN27.js.map +0 -1
- /package/src/inspector/viewer/{inpsector-button.tsx → inspector-button.tsx} +0 -0
package/dist/index.js
CHANGED
@@ -31786,8 +31786,8 @@ var import_client = __toESM(require_client(), 1);
|
|
31786
31786
|
import { Account } from "jazz-tools";
|
31787
31787
|
|
31788
31788
|
// src/inspector/viewer/new-app.tsx
|
31789
|
-
var
|
31790
|
-
import { styled as
|
31789
|
+
var import_react17 = __toESM(require_react(), 1);
|
31790
|
+
import { styled as styled19 } from "goober";
|
31791
31791
|
|
31792
31792
|
// src/inspector/ui/button.tsx
|
31793
31793
|
var import_react = __toESM(require_react(), 1);
|
@@ -31814,6 +31814,9 @@ var StyledButton = styled("button")`
|
|
31814
31814
|
border-color: var(--j-primary-color);
|
31815
31815
|
color: white;
|
31816
31816
|
font-weight: 500;
|
31817
|
+
&:hover {
|
31818
|
+
opacity: 0.8;
|
31819
|
+
}
|
31817
31820
|
`;
|
31818
31821
|
case "secondary":
|
31819
31822
|
return `
|
@@ -31832,6 +31835,17 @@ var StyledButton = styled("button")`
|
|
31832
31835
|
text-decoration: underline;
|
31833
31836
|
}
|
31834
31837
|
`;
|
31838
|
+
case "destructive":
|
31839
|
+
return `
|
31840
|
+
padding: 0.375rem 0.75rem;
|
31841
|
+
background-color: var(--j-destructive-color);
|
31842
|
+
border-color: var(--j-destructive-color);
|
31843
|
+
color: white;
|
31844
|
+
font-weight: 500;
|
31845
|
+
&:hover {
|
31846
|
+
opacity: 0.8;
|
31847
|
+
}
|
31848
|
+
`;
|
31835
31849
|
default:
|
31836
31850
|
return "";
|
31837
31851
|
}
|
@@ -31877,7 +31891,7 @@ var StyledInput = styled2("input")`
|
|
31877
31891
|
box-shadow: var(--j-shadow-sm);
|
31878
31892
|
font-weight: 500;
|
31879
31893
|
background-color: white;
|
31880
|
-
color: var(--text-color-strong);
|
31894
|
+
color: var(--j-text-color-strong);
|
31881
31895
|
|
31882
31896
|
@media (prefers-color-scheme: dark) {
|
31883
31897
|
background-color: var(--j-foreground);
|
@@ -31888,7 +31902,15 @@ var Input = (0, import_react2.forwardRef)(
|
|
31888
31902
|
const generatedId = (0, import_react2.useId)();
|
31889
31903
|
const id = customId || generatedId;
|
31890
31904
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Container, { className, children: [
|
31891
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
31905
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
31906
|
+
"label",
|
31907
|
+
{
|
31908
|
+
htmlFor: id,
|
31909
|
+
className: hideLabel ? "j-sr-only" : "",
|
31910
|
+
style: { color: "var(--j-text-color)" },
|
31911
|
+
children: label
|
31912
|
+
}
|
31913
|
+
),
|
31892
31914
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StyledInput, { ref, ...inputProps, id })
|
31893
31915
|
] });
|
31894
31916
|
}
|
@@ -31978,9 +32000,10 @@ var StyledHeading = styled5("h1")`
|
|
31978
32000
|
`;
|
31979
32001
|
function Heading({
|
31980
32002
|
children,
|
31981
|
-
className
|
32003
|
+
className,
|
32004
|
+
id
|
31982
32005
|
}) {
|
31983
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledHeading, { className, children });
|
32006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StyledHeading, { className, id, children });
|
31984
32007
|
}
|
31985
32008
|
|
31986
32009
|
// src/inspector/ui/text.tsx
|
@@ -33579,7 +33602,7 @@ var GlobalStyles = styled16("div")`
|
|
33579
33602
|
}
|
33580
33603
|
`;
|
33581
33604
|
|
33582
|
-
// src/inspector/viewer/
|
33605
|
+
// src/inspector/viewer/inspector-button.tsx
|
33583
33606
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
33584
33607
|
import { styled as styled17 } from "goober";
|
33585
33608
|
var StyledInspectorButton = styled17("button")`
|
@@ -33678,9 +33701,246 @@ function useOpenInspector() {
|
|
33678
33701
|
return [open, setOpen];
|
33679
33702
|
}
|
33680
33703
|
|
33681
|
-
// src/inspector/
|
33704
|
+
// src/inspector/ui/modal.tsx
|
33705
|
+
var import_react15 = __toESM(require_react(), 1);
|
33706
|
+
import { styled as styled18 } from "goober";
|
33682
33707
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
33683
|
-
var
|
33708
|
+
var ModalContent = styled18("dialog")`
|
33709
|
+
background-color: var(--j-background);
|
33710
|
+
border-radius: var(--j-radius-lg);
|
33711
|
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
|
33712
|
+
border: 1px solid var(--j-border-color);
|
33713
|
+
max-width: 32rem;
|
33714
|
+
margin-block: auto;
|
33715
|
+
margin-inline: auto;
|
33716
|
+
&::backdrop {
|
33717
|
+
background-color: rgba(0, 0, 0, 0.7);
|
33718
|
+
}
|
33719
|
+
|
33720
|
+
`;
|
33721
|
+
var ModalHeader = styled18("div")`
|
33722
|
+
display: flex;
|
33723
|
+
justify-content: space-between;
|
33724
|
+
align-items: flex-start;
|
33725
|
+
padding: 1.5rem 1.5rem 0 1.5rem;
|
33726
|
+
gap: 1rem;
|
33727
|
+
`;
|
33728
|
+
var ModalBody = styled18("div")`
|
33729
|
+
padding: 1rem 1.5rem;
|
33730
|
+
flex: 1;
|
33731
|
+
`;
|
33732
|
+
var ModalFooter = styled18("div")`
|
33733
|
+
display: flex;
|
33734
|
+
justify-content: flex-end;
|
33735
|
+
gap: 0.75rem;
|
33736
|
+
padding: 0 1.5rem 1.5rem 1.5rem;
|
33737
|
+
`;
|
33738
|
+
var CloseButton = styled18("button")`
|
33739
|
+
background: none;
|
33740
|
+
border: none;
|
33741
|
+
cursor: pointer;
|
33742
|
+
padding: 0.25rem;
|
33743
|
+
border-radius: var(--j-radius-sm);
|
33744
|
+
color: var(--j-text-color);
|
33745
|
+
font-size: 1.25rem;
|
33746
|
+
line-height: 1;
|
33747
|
+
display: flex;
|
33748
|
+
align-items: center;
|
33749
|
+
justify-content: center;
|
33750
|
+
min-width: 2rem;
|
33751
|
+
min-height: 2rem;
|
33752
|
+
|
33753
|
+
&:hover {
|
33754
|
+
background-color: var(--j-foreground);
|
33755
|
+
}
|
33756
|
+
|
33757
|
+
&:focus-visible {
|
33758
|
+
outline: 2px solid var(--j-border-focus);
|
33759
|
+
outline-offset: 2px;
|
33760
|
+
}
|
33761
|
+
`;
|
33762
|
+
var Modal = (0, import_react15.forwardRef)(
|
33763
|
+
({
|
33764
|
+
isOpen,
|
33765
|
+
onClose,
|
33766
|
+
heading,
|
33767
|
+
text,
|
33768
|
+
children,
|
33769
|
+
confirmText = "Confirm",
|
33770
|
+
cancelText = "Cancel",
|
33771
|
+
onConfirm,
|
33772
|
+
onCancel,
|
33773
|
+
showButtons = true,
|
33774
|
+
className
|
33775
|
+
}, ref) => {
|
33776
|
+
const modalRef = (0, import_react15.useRef)(null);
|
33777
|
+
(0, import_react15.useEffect)(() => {
|
33778
|
+
if (isOpen) {
|
33779
|
+
modalRef.current?.showModal();
|
33780
|
+
} else {
|
33781
|
+
onClose();
|
33782
|
+
modalRef.current?.close();
|
33783
|
+
}
|
33784
|
+
}, [isOpen, onClose]);
|
33785
|
+
const handleConfirm = () => {
|
33786
|
+
onConfirm?.();
|
33787
|
+
onClose();
|
33788
|
+
};
|
33789
|
+
const handleCancel = () => {
|
33790
|
+
onCancel?.();
|
33791
|
+
onClose();
|
33792
|
+
};
|
33793
|
+
if (!isOpen) return null;
|
33794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
33795
|
+
ModalContent,
|
33796
|
+
{
|
33797
|
+
ref: ref || modalRef,
|
33798
|
+
className,
|
33799
|
+
role: "dialog",
|
33800
|
+
"aria-labelledby": "modal-heading",
|
33801
|
+
onClose,
|
33802
|
+
children: [
|
33803
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ModalHeader, { children: [
|
33804
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, { id: "modal-heading", children: heading }),
|
33805
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CloseButton, { onClick: onClose, "aria-label": "Close modal", type: "button", children: "\xD7" })
|
33806
|
+
] }),
|
33807
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ModalBody, { children: [
|
33808
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { style: { margin: "0 0 1rem 0", color: "var(--j-text-color)" }, children: text }),
|
33809
|
+
children
|
33810
|
+
] }),
|
33811
|
+
showButtons && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ModalFooter, { children: [
|
33812
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "secondary", onClick: handleCancel, children: cancelText }),
|
33813
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Button, { variant: "primary", onClick: handleConfirm, children: confirmText })
|
33814
|
+
] })
|
33815
|
+
]
|
33816
|
+
}
|
33817
|
+
);
|
33818
|
+
}
|
33819
|
+
);
|
33820
|
+
Modal.displayName = "Modal";
|
33821
|
+
|
33822
|
+
// src/inspector/viewer/delete-local-data.tsx
|
33823
|
+
var import_react16 = __toESM(require_react(), 1);
|
33824
|
+
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
33825
|
+
var DELETE_LOCAL_DATA_STRING = "delete my local data";
|
33826
|
+
function DeleteLocalData() {
|
33827
|
+
const [showDeleteModal, setShowDeleteModal] = (0, import_react16.useState)(false);
|
33828
|
+
const [confirmDeleteString, setConfirmDeleteString] = (0, import_react16.useState)("");
|
33829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
33830
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "destructive", onClick: () => setShowDeleteModal(true), children: "Delete my local data" }),
|
33831
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
33832
|
+
Modal,
|
33833
|
+
{
|
33834
|
+
isOpen: showDeleteModal,
|
33835
|
+
onClose: () => setShowDeleteModal(false),
|
33836
|
+
heading: "Delete Local Data",
|
33837
|
+
showButtons: false,
|
33838
|
+
children: [
|
33839
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
33840
|
+
"div",
|
33841
|
+
{
|
33842
|
+
style: {
|
33843
|
+
margin: "0 0 1rem 0",
|
33844
|
+
color: "var(--j-text-color)",
|
33845
|
+
display: "flex",
|
33846
|
+
flexDirection: "column",
|
33847
|
+
gap: "0.5rem"
|
33848
|
+
},
|
33849
|
+
children: [
|
33850
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { children: [
|
33851
|
+
"This action ",
|
33852
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "cannot" }),
|
33853
|
+
" be undone."
|
33854
|
+
] }),
|
33855
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { children: [
|
33856
|
+
"Be aware that the following data will be",
|
33857
|
+
" ",
|
33858
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "permanently" }),
|
33859
|
+
" deleted:"
|
33860
|
+
] }),
|
33861
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("ul", { style: { listStyleType: "disc", paddingLeft: "1rem" }, children: [
|
33862
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("li", { children: [
|
33863
|
+
"Unsynced data for ",
|
33864
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "all apps" }),
|
33865
|
+
" on",
|
33866
|
+
" ",
|
33867
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("code", { children: window.location.origin })
|
33868
|
+
] }),
|
33869
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("li", { children: "Accounts" }),
|
33870
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("li", { children: "Logged in sessions" })
|
33871
|
+
] }),
|
33872
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", {})
|
33873
|
+
]
|
33874
|
+
}
|
33875
|
+
),
|
33876
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
33877
|
+
Input,
|
33878
|
+
{
|
33879
|
+
label: `Type "${DELETE_LOCAL_DATA_STRING}" to confirm`,
|
33880
|
+
placeholder: DELETE_LOCAL_DATA_STRING,
|
33881
|
+
value: confirmDeleteString,
|
33882
|
+
onChange: (e) => {
|
33883
|
+
setConfirmDeleteString(e.target.value);
|
33884
|
+
}
|
33885
|
+
}
|
33886
|
+
),
|
33887
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
33888
|
+
"p",
|
33889
|
+
{
|
33890
|
+
style: {
|
33891
|
+
margin: "0 0 1rem 0",
|
33892
|
+
color: "var(--j-text-color)",
|
33893
|
+
display: "flex",
|
33894
|
+
flexDirection: "column",
|
33895
|
+
gap: "0.5rem"
|
33896
|
+
},
|
33897
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("small", { children: [
|
33898
|
+
"Data synced to a sync server will ",
|
33899
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "not" }),
|
33900
|
+
" be deleted, and will be synced when you log in again."
|
33901
|
+
] })
|
33902
|
+
}
|
33903
|
+
),
|
33904
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
33905
|
+
"div",
|
33906
|
+
{
|
33907
|
+
style: {
|
33908
|
+
display: "flex",
|
33909
|
+
marginTop: "0.5rem",
|
33910
|
+
justifyContent: "flex-end",
|
33911
|
+
gap: "0.5rem"
|
33912
|
+
},
|
33913
|
+
children: [
|
33914
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "secondary", onClick: () => setShowDeleteModal(false), children: "Cancel" }),
|
33915
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
33916
|
+
Button,
|
33917
|
+
{
|
33918
|
+
variant: "destructive",
|
33919
|
+
disabled: confirmDeleteString !== DELETE_LOCAL_DATA_STRING,
|
33920
|
+
onClick: () => {
|
33921
|
+
const jazzKeys = Object.keys(localStorage).filter(
|
33922
|
+
(key) => key.startsWith("jazz-") || key.startsWith("co_z")
|
33923
|
+
);
|
33924
|
+
jazzKeys.forEach((key) => localStorage.removeItem(key));
|
33925
|
+
indexedDB.deleteDatabase("jazz-storage");
|
33926
|
+
window.location.reload();
|
33927
|
+
setShowDeleteModal(false);
|
33928
|
+
},
|
33929
|
+
children: "I'm sure, delete my local data"
|
33930
|
+
}
|
33931
|
+
)
|
33932
|
+
]
|
33933
|
+
}
|
33934
|
+
)
|
33935
|
+
]
|
33936
|
+
}
|
33937
|
+
)
|
33938
|
+
] });
|
33939
|
+
}
|
33940
|
+
|
33941
|
+
// src/inspector/viewer/new-app.tsx
|
33942
|
+
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
33943
|
+
var InspectorContainer = styled19("div")`
|
33684
33944
|
position: fixed;
|
33685
33945
|
height: 50vh;
|
33686
33946
|
max-height: 800px;
|
@@ -33697,17 +33957,17 @@ var InspectorContainer = styled18("div")`
|
|
33697
33957
|
background-color: var(--j-background);
|
33698
33958
|
}
|
33699
33959
|
`;
|
33700
|
-
var HeaderContainer2 =
|
33960
|
+
var HeaderContainer2 = styled19("div")`
|
33701
33961
|
display: flex;
|
33702
33962
|
align-items: center;
|
33703
33963
|
gap: 1rem;
|
33704
33964
|
padding: 0 0.75rem;
|
33705
33965
|
margin: 0.75rem 0;
|
33706
33966
|
`;
|
33707
|
-
var Form =
|
33967
|
+
var Form = styled19("form")`
|
33708
33968
|
width: 24rem;
|
33709
33969
|
`;
|
33710
|
-
var InitialForm =
|
33970
|
+
var InitialForm = styled19("form")`
|
33711
33971
|
display: flex;
|
33712
33972
|
flex-direction: column;
|
33713
33973
|
position: relative;
|
@@ -33719,7 +33979,7 @@ var InitialForm = styled18("form")`
|
|
33719
33979
|
max-width: 24rem;
|
33720
33980
|
margin: 0 auto;
|
33721
33981
|
`;
|
33722
|
-
var OrText =
|
33982
|
+
var OrText = styled19("p")`
|
33723
33983
|
text-align: center;
|
33724
33984
|
`;
|
33725
33985
|
function JazzInspectorInternal({
|
@@ -33728,7 +33988,7 @@ function JazzInspectorInternal({
|
|
33728
33988
|
accountId
|
33729
33989
|
}) {
|
33730
33990
|
const [open, setOpen] = useOpenInspector();
|
33731
|
-
const [coValueId, setCoValueId] = (0,
|
33991
|
+
const [coValueId, setCoValueId] = (0, import_react17.useState)("");
|
33732
33992
|
const { path, addPages, goToIndex, goBack, setPage } = usePagePath();
|
33733
33993
|
const handleCoValueIdSubmit = (e) => {
|
33734
33994
|
e.preventDefault();
|
@@ -33738,12 +33998,12 @@ function JazzInspectorInternal({
|
|
33738
33998
|
setCoValueId("");
|
33739
33999
|
};
|
33740
34000
|
if (!open) {
|
33741
|
-
return /* @__PURE__ */ (0,
|
34001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(InspectorButton, { position, onClick: () => setOpen(true) });
|
33742
34002
|
}
|
33743
|
-
return /* @__PURE__ */ (0,
|
33744
|
-
/* @__PURE__ */ (0,
|
33745
|
-
/* @__PURE__ */ (0,
|
33746
|
-
/* @__PURE__ */ (0,
|
34003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(InspectorContainer, { as: GlobalStyles, style: { zIndex: 999 }, children: [
|
34004
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(HeaderContainer2, { children: [
|
34005
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Breadcrumbs, { path, onBreadcrumbClick: goToIndex }),
|
34006
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Form, { onSubmit: handleCoValueIdSubmit, children: path.length !== 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33747
34007
|
Input,
|
33748
34008
|
{
|
33749
34009
|
label: "CoValue ID",
|
@@ -33754,23 +34014,24 @@ function JazzInspectorInternal({
|
|
33754
34014
|
onChange: (e) => setCoValueId(e.target.value)
|
33755
34015
|
}
|
33756
34016
|
) }),
|
33757
|
-
/* @__PURE__ */ (0,
|
34017
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DeleteLocalData, {}),
|
34018
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "plain", type: "button", onClick: () => setOpen(false), children: "Close" })
|
33758
34019
|
] }),
|
33759
|
-
/* @__PURE__ */ (0,
|
34020
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33760
34021
|
PageStack,
|
33761
34022
|
{
|
33762
34023
|
path,
|
33763
34024
|
node: localNode,
|
33764
34025
|
goBack,
|
33765
34026
|
addPages,
|
33766
|
-
children: path.length <= 0 && /* @__PURE__ */ (0,
|
34027
|
+
children: path.length <= 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
33767
34028
|
InitialForm,
|
33768
34029
|
{
|
33769
34030
|
onSubmit: handleCoValueIdSubmit,
|
33770
34031
|
"aria-hidden": path.length !== 0,
|
33771
34032
|
children: [
|
33772
|
-
/* @__PURE__ */ (0,
|
33773
|
-
/* @__PURE__ */ (0,
|
34033
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Heading, { children: "Jazz CoValue Inspector" }),
|
34034
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33774
34035
|
Input,
|
33775
34036
|
{
|
33776
34037
|
label: "CoValue ID",
|
@@ -33781,10 +34042,10 @@ function JazzInspectorInternal({
|
|
33781
34042
|
onChange: (e) => setCoValueId(e.target.value)
|
33782
34043
|
}
|
33783
34044
|
),
|
33784
|
-
/* @__PURE__ */ (0,
|
33785
|
-
accountId && /* @__PURE__ */ (0,
|
33786
|
-
/* @__PURE__ */ (0,
|
33787
|
-
/* @__PURE__ */ (0,
|
34045
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { type: "submit", variant: "primary", children: "Inspect CoValue" }),
|
34046
|
+
accountId && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
34047
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(OrText, { children: "or" }),
|
34048
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
33788
34049
|
Button,
|
33789
34050
|
{
|
33790
34051
|
variant: "secondary",
|
@@ -33805,7 +34066,7 @@ function JazzInspectorInternal({
|
|
33805
34066
|
}
|
33806
34067
|
|
33807
34068
|
// src/inspector/custom-element.tsx
|
33808
|
-
var
|
34069
|
+
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
33809
34070
|
var JazzInspectorElement = class extends HTMLElement {
|
33810
34071
|
constructor() {
|
33811
34072
|
super(...arguments);
|
@@ -33847,7 +34108,7 @@ var JazzInspectorElement = class extends HTMLElement {
|
|
33847
34108
|
return;
|
33848
34109
|
}
|
33849
34110
|
this.root?.render(
|
33850
|
-
/* @__PURE__ */ (0,
|
34111
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
33851
34112
|
JazzInspectorInternal,
|
33852
34113
|
{
|
33853
34114
|
localNode: this.account.$jazz.localNode,
|
@@ -33973,4 +34234,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
33973
34234
|
* LICENSE file in the root directory of this source tree.
|
33974
34235
|
*)
|
33975
34236
|
*/
|
33976
|
-
//# sourceMappingURL=custom-element-
|
34237
|
+
//# sourceMappingURL=custom-element-G6SPZEBR.js.map
|