Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8789192
:chore: Remove old eml file while creating blueprint
wryonik May 14, 2025
fbc7412
:chore: Remove old registry banner
wryonik May 26, 2025
c9f8c73
:chore: Remove email body as regex location if ignoreBodyHashCheck is…
wryonik May 24, 2025
caa3003
:chore: Update data sharing toggle state
wryonik May 23, 2025
048b06e
:chore: Render public output in proofs page
wryonik May 23, 2025
0859d68
:chore: Optimise dev server and update fields logic in create blueprints
wryonik May 19, 2025
cfc9daf
:chore: Fix update of max body length
wryonik May 21, 2025
dcc74d3
:chore: Add caching of emails while generating proof
wryonik May 26, 2025
177888e
:chore: Add satoshi font
wryonik May 28, 2025
46c8638
:chore: Remove optional details submenu and layout fixes
wryonik May 28, 2025
f1a4072
fix: bump sdk version
DimiDumo Jun 2, 2025
a9ae0ea
fix: bump sdk-version
DimiDumo Jun 2, 2025
fe7af4b
:chore: Fix npm installation
wryonik May 23, 2025
3535d98
:chore: Fix files structure
wryonik May 23, 2025
964fafc
:chore: Update tests for flow changes
wryonik May 23, 2025
bcc7a9b
:chore: Update env variables
wryonik May 24, 2025
3fb61d6
:chore: update create blueprint test
wryonik May 26, 2025
8b091ac
:chore: Update tests for flow changes
wryonik Jun 3, 2025
66ea6d4
:chore: Update tests for flow changes
wryonik Jun 3, 2025
d25ef4f
:chore: Update flow for validating emails while proof generation
wryonik May 28, 2025
079b552
:chore: Fix fetch more emails logic
wryonik Jun 3, 2025
39ca5d5
chore: bump sdk version
DimiDumo Jun 4, 2025
982e02f
chore: remove on chain from verify
DimiDumo Jun 4, 2025
3896455
feat: enable local verification on proof detail page
DimiDumo Jun 5, 2025
272a485
chore: bump sdk version
DimiDumo Jun 6, 2025
241764a
feat: pre init noir
DimiDumo Jun 9, 2025
c69a7c3
chore: remove maxLength from externalInput proof generation
DimiDumo Jun 10, 2025
180537a
:chore: Fix rendering of delete button for failed blueprint versions
wryonik Jun 6, 2025
53efc76
:chore: Remove filters for unauthorized users
wryonik Jun 6, 2025
7efe851
:chore: Fix multiple success toast on successful verification of proof
wryonik Jun 6, 2025
6eedb87
chore: Update styling in case of long blueprint fields
wryonik Jun 12, 2025
4aab72d
:chore: Update regex extraction location to header as default
wryonik Jun 12, 2025
e924bad
:chore: Fix loading state of buttons while creating blueprint
wryonik Jun 12, 2025
5b64686
:chore: Move saved emls from localstorage to indexdb
wryonik Jun 12, 2025
e8adae8
:chore: Update logic to save cached emails while generating proof to …
wryonik Jun 12, 2025
12f2c86
:chore: Update test cases
wryonik Jun 13, 2025
0636391
:chore: Show zk framework in blueprints parameters page
wryonik Jun 20, 2025
0676d90
:fix: Fix disable state of fields while editing basic fields
wryonik Jun 4, 2025
345dab3
:chore: Fix auth state in localstorage when logging out from one tab
wryonik Jun 23, 2025
f393224
:chore: Handle error in case of missing fields in email
wryonik Jun 23, 2025
f53992f
New fab button added
PrakharSingh0908 Jun 4, 2025
4e405ef
FAB not visible in mobile and button overlap problem solved
PrakharSingh0908 Jun 4, 2025
c96007d
Mobile bp card improved'
PrakharSingh0908 Jun 4, 2025
3a6f2f1
Spacing issue fixed
PrakharSingh0908 Jun 4, 2025
d5a0b7e
Add create blueprint button to the header
PrakharSingh0908 Jun 4, 2025
60b9d59
chore: linting errors fixed for fab button
PrakharSingh0908 Jun 10, 2025
653c914
fix: increasing truncating title for larger screen widths
PrakharSingh0908 Jun 10, 2025
eca0695
chore: add truncating values for slug characters
PrakharSingh0908 Jun 10, 2025
7ce0cd4
fix: remove package json
PrakharSingh0908 Jun 10, 2025
f9b4ef7
:chore: Fix build errors
wryonik Jun 24, 2025
4645b81
Merge pull request #163 from zkemail/rutefig/feat-sort-blueprints-by-…
DimiDumo May 22, 2025
0e8ece0
hotfix: prompt user consent for gmail login
rutefig Jun 30, 2025
4567a99
chore: bump sdk version
DimiDumo Jul 3, 2025
f9e35ed
hotfix: missing func args
DimiDumo Jul 7, 2025
b7a64a7
:fix: Fix auto updation of email headers length while creating blueprint
wryonik Jul 7, 2025
51a6690
chore: bump sdk version
DimiDumo Jul 9, 2025
40d59be
:chore: Add option to disable eml upload
wryonik Jul 28, 2025
ea20e2b
:chore: Remove validation checks while creating blueprint without eml…
wryonik Jul 28, 2025
4b1e95d
:chore: Unmask input fields in posthog session replay
wryonik Aug 4, 2025
4d7d9e1
chore: add capture groups to default patterns
rutefig Aug 11, 2025
9e33fe5
fix: bypass blueprint validation for now
rutefig Aug 11, 2025
3aa15e6
fix: lock file with published sdk
rutefig Aug 11, 2025
8508e5b
:chore: Show error message on initial regex page visit
wryonik Jul 21, 2025
ce151c5
:fix: Fix blueprint meta data on blueprint info page
wryonik Jul 14, 2025
11c9905
fix: regex pattern
BornPsych Sep 8, 2025
3217e04
chore: added dummy regex values and updated sdk
BornPsych Sep 8, 2025
c9c8e13
chore: sdk version upgrade
BornPsych Sep 8, 2025
a60a097
:chore: Update the regex extraction design to include a maximum lengt…
wryonik Sep 10, 2025
f20c101
:chore: Update sdk version
wryonik Sep 11, 2025
1215536
:chore: Update max length of regex according to public parts max length
wryonik Sep 11, 2025
4fa7084
:chore: Remove max length input field from regex definition
wryonik Sep 11, 2025
c879da6
Merge remote-tracking branch 'origin/staging' into dev
rutefig Sep 11, 2025
1cb98b8
Merge pull request #233 from zkemail/shubham/reg-550-frontend-max-len…
rutefig Sep 11, 2025
1a77048
fix: max match length value
BornPsych Sep 11, 2025
4129c9e
Merge pull request #234 from zkemail/fix/max-match-length
BornPsych Sep 11, 2025
25cc496
chore: sdk version upgrade
BornPsych Sep 11, 2025
3abd261
chore: updated bun lock
BornPsych Sep 11, 2025
2cd9c7b
chore: updated package json and bun lock
BornPsych Sep 11, 2025
e4bfb80
chore: updated the sdk version
BornPsych Sep 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.6",
"@react-oauth/google": "^0.12.1",
"@zk-email/sdk": "1.4.1-2",
"@zk-email/sdk": "2.0.1-6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^11.11.11",
Expand Down Expand Up @@ -398,9 +398,9 @@

"@zk-email/helpers": ["@zk-email/[email protected]", "", { "dependencies": { "addressparser": "^1.0.1", "atob": "^2.1.2", "circomlibjs": "^0.1.7", "libmime": "^5.2.1", "localforage": "^1.10.0", "node-forge": "^1.3.1", "pako": "^2.1.0", "psl": "^1.9.0", "snarkjs": "https://github.com/sampritipanda/snarkjs.git#fef81fc51d17a734637555c6edbd585ecda02d9e" } }, "sha512-0S49A5cezcnCR98qAw/zJfjr8l/uFy20BcPxS8ADXNA9RVp4cUB2EQ4imRqnAg8ZoM+C/D+si1h/9KkW9qrJyw=="],

"@zk-email/relayer-utils": ["@zk-email/[email protected]2", "", {}, "sha512-4bf3g9kkauQqr3IncB/oidwP9seYR1BZ4pdHTiND89zL287QWEJkQAvKfF3neNA34ZsY1f3omCsylCMGJJrwQA=="],
"@zk-email/relayer-utils": ["@zk-email/[email protected]4", "", {}, "sha512-Fyx93d909uxbaCZHm/C44dge1s3s5h+4pFMylCqPwb2b1Gj+wmfJwYNM1zsZcQeJowFVkqlUJeJ3rYIBlJyhkg=="],

"@zk-email/sdk": ["@zk-email/sdk@1.4.1-2", "", { "dependencies": { "@azure/msal-browser": "^4.5.1", "@mach-34/noir-bignum-paramgen": "^1.1.2", "@peculiar/webcrypto": "^1.5.0", "@zk-email/relayer-utils": "0.4.66-2", "@zk-email/snarkjs": "^0.0.1", "@zk-email/zkemail-nr": "1.3.3-3", "ethers": "^6.13.4", "jszip": "^3.10.1", "poseidon-lite": "^0.3.0", "rsa-key": "^0.0.6", "snarkjs": "^0.7.5", "viem": "^2.21.53", "zod": "^3.23.8" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-W3xCOzVeU/miasnyzpmS/Wa9qdMRE5xN1kSiq/qd5cWXikFPHfN0XX8YMD/6XpPcUW6FkO3LclX6Lgi0cclHyA=="],
"@zk-email/sdk": ["@zk-email/sdk@2.0.1-6", "", { "dependencies": { "@azure/msal-browser": "^4.5.1", "@mach-34/noir-bignum-paramgen": "^1.1.2", "@peculiar/webcrypto": "^1.5.0", "@zk-email/relayer-utils": "0.4.66-4", "@zk-email/snarkjs": "^0.0.1", "@zk-email/zkemail-nr": "1.3.3-3", "ethers": "^6.13.4", "jszip": "^3.10.1", "poseidon-lite": "^0.3.0", "rsa-key": "^0.0.6", "snarkjs": "^0.7.5", "viem": "^2.21.53", "zod": "^3.23.8" }, "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-HxsIGd1MdrRT5NxCaFP6WW9aiKUMOHyjHy9sMxmHjmJ6EewK2PwrjDNg+gEcguXd7MLDJsh9s8yk2kRzUrYFbw=="],

"@zk-email/snarkjs": ["@zk-email/[email protected]", "", { "dependencies": { "@iden3/binfileutils": "0.0.12", "bfj": "^7.0.2", "blake2b-wasm": "^2.4.0", "circom_runtime": "0.1.28", "ejs": "^3.1.6", "fastfile": "0.0.20", "ffjavascript": "0.3.1", "js-sha3": "^0.8.0", "logplease": "^1.2.15", "r1csfile": "0.0.48" }, "bin": { "snarkjs": "build/cli.cjs" } }, ""],

Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.6",
"@react-oauth/google": "^0.12.1",
"@zk-email/sdk": "1.4.1-2",
"@zk-email/sdk": "2.0.1-6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^11.11.11",
Expand Down
10 changes: 5 additions & 5 deletions src/app/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ const Navbar = () => {
const searchParams = useSearchParams();
const { search, filters, sort } = useBlueprintFiltersStore();

const handleCreateBlueprint = () => {
localStorage.removeItem('create-blueprint');
router.push('/create');
};

// Handle logo click to preserve filters and sort when on home page
const handleLogoClick = () => {
if (pathname === '/') {
Expand All @@ -44,6 +39,11 @@ const Navbar = () => {
}
};

const handleCreateBlueprint = () => {
localStorage.removeItem('create-blueprint');
router.push('/create');
};

return (
<nav className="flex items-center justify-between border-b bg-white px-6 py-3 dark:border-grey-800 dark:bg-black">
<button
Expand Down
153 changes: 93 additions & 60 deletions src/app/create/[id]/createBlueprintSteps/ExtractFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ import { Select } from '@/components/ui/select';
import { Label } from '@/components/ui/label';
import { Button } from '@/components/ui/button';
import Image from 'next/image';
import { DecomposedRegex, ExternalInput, parseEmail, testDecomposedRegex } from '@zk-email/sdk';
import {
DecomposedRegex,
DecomposedRegexPart,
ExternalInput,
parseEmail,
testDecomposedRegex,
} from '@zk-email/sdk';
import { toast } from 'react-toastify';
import { posthog } from 'posthog-js';
import { Separator } from '@/components/ui/separator';
import Link from 'next/link';
import { REGEX_COLORS } from '@/app/constants';
import { Checkbox } from '@/components/ui/checkbox';
import { Switch } from '@/components/ui/switch';

const AIPromptInput = ({
aiPrompt,
Expand Down Expand Up @@ -471,7 +478,7 @@ const ExtractFields = ({
{
isPublic: true,
regexDef:
"[A-Za-z0-9!#$%&'\\*\\+-/=\\?\\^_`{\\|}~\\.]+@[A-Za-z0-9\\.-]+",
"[A-Za-z0-9!#$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~\\.]+@[A-Za-z0-9\\.-]+",
},
{
isPublic: false,
Expand Down Expand Up @@ -503,7 +510,7 @@ const ExtractFields = ({
parts: [
{
isPublic: false,
regexDef: '(\r\n|^)from:[^\r\n]*@',
regexDef: '(?:\r\n|^)from:[^\r\n]*@',
},
{
isPublic: true,
Expand Down Expand Up @@ -663,17 +670,6 @@ const ExtractFields = ({
{ label: 'Email Header', value: 'header' },
]}
/>
<Input
title="Max Length"
placeholder="64"
type="number"
value={regex.maxLength}
onChange={(e) => {
const updatedRegexes = [...store.decomposedRegexes];
updatedRegexes[index] = { ...regex, maxLength: parseInt(e.target.value) };
setField('decomposedRegexes', updatedRegexes);
}}
/>
<Checkbox
title="Hash Public Output"
checked={regex.isHashed}
Expand Down Expand Up @@ -726,54 +722,54 @@ const ExtractFields = ({
</span>
<Label>Field</Label>
</div>
<Button
variant="destructive"
size="smIcon"
onClick={() => {
const parts = parseRegexParts(regex.parts);
parts.splice(partIndex, 1);
const updatedRegexes = [...store.decomposedRegexes];
updatedRegexes[index] = {
...regex,
parts: parts,
};
setField('decomposedRegexes', updatedRegexes);
}}
>
<Image
src="/assets/Trash.svg"
alt="trash"
width={16}
height={16}
style={{
maxWidth: '100%',
height: 'auto',
<div className="flex flex-row items-center gap-2">
<div className="flex flex-row items-center gap-2">
<Switch
id={`${regex.name}-${partIndex}-isPublic`}
className="mr-2"
checked={!part.isPublic}
onCheckedChange={(checked) => {
const parts = parseRegexParts(regex.parts);
parts[partIndex].isPublic = !checked;
const updatedRegexes = [...store.decomposedRegexes];
updatedRegexes[index] = {
...regex,
parts: parts,
};
setField('decomposedRegexes', updatedRegexes);
}}
/>
<Label htmlFor={`${regex.name}-${partIndex}-isPublic`}>Private</Label>
</div>

<Button
variant="destructive"
size="smIcon"
onClick={() => {
const parts = parseRegexParts(regex.parts);
parts.splice(partIndex, 1);
const updatedRegexes = [...store.decomposedRegexes];
updatedRegexes[index] = {
...regex,
parts: parts,
};
setField('decomposedRegexes', updatedRegexes);
}}
/>
</Button>
</div>
<div className="ml-3 flex flex-col gap-3">
<Label>Public / Private</Label>
<Select
value={part.isPublic ? 'public' : 'private'}
onChange={(value) => {
const parts = parseRegexParts(regex.parts);
parts[partIndex].isPublic = value === 'public';
const updatedRegexes = [...store.decomposedRegexes];
updatedRegexes[index] = {
...regex,
parts: parts,
};
setField('decomposedRegexes', updatedRegexes);
}}
options={[
{ label: 'Public', value: 'public' },
{ label: 'Private', value: 'private' },
]}
/>
>
<Image
src="/assets/Trash.svg"
alt="trash"
width={16}
height={16}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</Button>
</div>
</div>
<div className="ml-3 flex flex-col gap-3">
<Label>Define Regex</Label>
<div className="flex flex-col gap-3">
<div className="relative">
<Input
value={part.regexDef?.replace(/\r/g, '\\r').replace(/\n/g, '\\n')}
Expand All @@ -800,6 +796,43 @@ const ExtractFields = ({
placeholder="Enter regex definition"
/>
</div>
{part.isPublic ? (
<div className="relative mx-3">
<Label>Max Length</Label>
<Input
value={part.maxLength}
onChange={(e) => {
const parts: DecomposedRegexPart[] = [
...parseRegexParts(regex.parts),
];
const rawValue = e.target.value;
console.log(rawValue, 'rawValue');
parts[partIndex] = {
...parts[partIndex],
maxLength: parseInt(rawValue),
};
const updatedRegexes = [...store.decomposedRegexes];
const updatedMaxLength = parts.reduce((acc: number, p: any) => {
const partMax =
p && p.isPublic && typeof p.maxLength === 'number'
? p.maxLength
: 0;
return acc + partMax;
}, 0);
updatedRegexes[index] = {
...regex,
parts: parts,
maxMatchLength:
updatedMaxLength > (updatedRegexes[index].maxLength ?? 0)
? updatedMaxLength
: updatedRegexes[index].maxLength,
};
setField('decomposedRegexes', updatedRegexes);
}}
placeholder="Enter max length for this regex"
/>
</div>
) : null}
</div>
</div>
);
Expand Down
21 changes: 16 additions & 5 deletions src/app/create/[id]/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,27 @@ export const useCreateBlueprintStore = create<CreateBlueprintState>()(
)
) as BlueprintProps;

console.log('Creating blueprint with: ', data);


// Parse decomposedRegexes since we are saving them as string to make handling TextArea easier
// TODO: need to add the maxmatch length and max length per public part in the client side for user
data.decomposedRegexes?.forEach((dcr) => {
dcr.parts =
typeof dcr.parts === 'string'
? (JSON.parse((dcr.parts as unknown as string).trim()) as DecomposedRegexPart[])
: dcr.parts;
typeof dcr.parts === 'string'
? (JSON.parse((dcr.parts as unknown as string).trim()) as DecomposedRegexPart[])
: dcr.parts;
dcr.maxLength = dcr.maxLength || 64;
dcr.maxMatchLength = dcr.maxMatchLength || 64;
dcr.isHashed = dcr.isHashed || false;


dcr.parts?.forEach((part) => {
if (part.isPublic) {
part.maxLength = part.maxLength || 64;
}
});
});

console.log('Creating blueprint with: ', data);

const githubUserName = useAuthStore.getState().username;
data.githubUsername = githubUserName ?? '';
Expand Down
Loading