-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into refactor/optimize-session-invalidation
- Loading branch information
Showing
19 changed files
with
5,064 additions
and
5,294 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@kleros/kleros-sdk", | ||
"version": "2.1.7", | ||
"version": "2.1.8", | ||
"description": "SDK for Kleros version 2", | ||
"repository": "[email protected]:kleros/kleros-v2.git", | ||
"author": "Kleros", | ||
|
@@ -44,10 +44,10 @@ | |
"vitest": "^1.1.3" | ||
}, | ||
"dependencies": { | ||
"@reality.eth/reality-eth-lib": "^3.2.30", | ||
"@reality.eth/reality-eth-lib": "^3.2.43", | ||
"@urql/core": "^5.0.8", | ||
"mustache": "^4.2.0", | ||
"viem": "^2.21.26", | ||
"viem": "^2.21.35", | ||
"zod": "^3.22.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../web/.env.devnet-neo.public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../web/.env.devnet-university.public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../web/.env.devnet.public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186", | ||
"volta": { | ||
"node": "20.11.0", | ||
"yarn": "4.3.1" | ||
"yarn": "4.5.1" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf .next src/graphql-generated src/hooks/contracts/generated.ts", | ||
|
@@ -28,13 +28,13 @@ | |
"@graphql-codegen/cli": "^5.0.2", | ||
"@graphql-codegen/client-preset": "^4.3.2", | ||
"@svgr/webpack": "^8.1.0", | ||
"@types/node": "^20", | ||
"@types/node": "^20.17.1", | ||
"@types/react": "18.2.0", | ||
"@types/react-dom": "^18.2.18", | ||
"@typescript-eslint/eslint-plugin": "^8.8.1", | ||
"@typescript-eslint/parser": "^8.8.1", | ||
"@typescript-eslint/utils": "^8.8.1", | ||
"@wagmi/cli": "^2.0.3", | ||
"@wagmi/cli": "^2.1.16", | ||
"eslint": "^8.57.1", | ||
"eslint-config-next": "^14.2.15", | ||
"eslint-config-prettier": "^9.1.0", | ||
|
@@ -49,7 +49,7 @@ | |
"@kleros/kleros-sdk": "workspace:^", | ||
"@kleros/ui-components-library": "^2.15.0", | ||
"@web3modal/wagmi": "^5.1.11", | ||
"graphql": "^16.8.1", | ||
"graphql": "^16.9.0", | ||
"graphql-request": "^7.1.0", | ||
"next": "14.2.14", | ||
"react": "^18.2.0", | ||
|
@@ -58,7 +58,7 @@ | |
"react-toastify": "^10.0.5", | ||
"typewriter-effect": "^2.21.0", | ||
"vanilla-jsoneditor": "^0.21.4", | ||
"viem": "^2.1.0", | ||
"wagmi": "^2.2.1" | ||
"viem": "^2.21.35", | ||
"wagmi": "^2.12.25" | ||
} | ||
} |
89 changes: 89 additions & 0 deletions
89
web-devtools/src/app/(main)/dispute-template/CustomContextInputs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import retrieveVariables from "@kleros/kleros-sdk/src/dataMappings/utils/retrieveVariables"; | ||
import { Field } from "@kleros/ui-components-library"; | ||
import { useMemo, useState } from "react"; | ||
import styled from "styled-components"; | ||
import { useDebounce } from "react-use"; | ||
import WithHelpTooltip from "components/WithHelpTooltip"; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
margin-top: 32px; | ||
`; | ||
|
||
const Header = styled.h2` | ||
margin: 0; | ||
`; | ||
|
||
const InputContainer = styled.div` | ||
display: flex; | ||
gap: 16px; | ||
flex-wrap: wrap; | ||
`; | ||
const VariableName = styled.p` | ||
font-family: "Roboto Mono", monospace; | ||
`; | ||
|
||
// prevent duplicating input fields | ||
const DisputeRequestParams = [ | ||
"arbitrator", | ||
"arbitrable", | ||
"arbitratorDisputeID", | ||
"externalDisputeID", | ||
"templateID", | ||
"templateUri", | ||
]; | ||
|
||
interface ICustomContextInputs { | ||
dataMapping: string; | ||
setCustomContext: (context: Record<string, string>) => void; | ||
} | ||
const CustomContextInputs: React.FC<ICustomContextInputs> = ({ dataMapping, setCustomContext }) => { | ||
const [customContextInputs, setCustomContextInputs] = useState<Record<string, string>>(); | ||
|
||
const requiredVariables = useMemo(() => { | ||
try { | ||
return retrieveVariables(dataMapping); | ||
} catch (error) { | ||
console.error("Failed to parse dataMapping:", error); | ||
return []; | ||
} | ||
}, [dataMapping]); | ||
|
||
useDebounce( | ||
() => { | ||
if (!customContextInputs) return; | ||
setCustomContext(customContextInputs); | ||
}, | ||
300, | ||
[customContextInputs] | ||
); | ||
|
||
return requiredVariables.length ? ( | ||
<Container> | ||
<WithHelpTooltip tooltipMsg="These are additional variables required by the data mapping to be passed as initial context. Please ignore the variables that will come from the result of the preceeding data mappings"> | ||
<Header>Additional Context</Header> | ||
</WithHelpTooltip> | ||
{requiredVariables.map((variable, index) => | ||
DisputeRequestParams.includes(variable) ? null : ( | ||
<InputContainer key={`${variable}-${index}`}> | ||
<VariableName>{variable}:</VariableName> | ||
<Field | ||
type="text" | ||
name={variable} | ||
value={customContextInputs?.[variable]} | ||
onChange={(e) => { | ||
setCustomContextInputs((prev) => ({ ...prev, [variable]: e.target.value })); | ||
}} | ||
placeholder="0x..." | ||
/> | ||
</InputContainer> | ||
) | ||
)} | ||
</Container> | ||
) : null; | ||
}; | ||
|
||
export default CustomContextInputs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ | |
"./*" | ||
], | ||
"src*": [ | ||
"../../kleros-sdk/src/*", | ||
"./*" | ||
], | ||
"svgs*": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.