docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
<StyledSectionCard> <StyledCardIcon>
<mask> and easily load your JSON data and start exploring and analyzing it right away! <mask> </Styles.StyledCardDescription> <mask> </Styles.StyledSectionCard> <mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiOutlineSearchCircle size={50} col...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardIcon> <StyledCardTitle>SEARCH</StyledCardTitle> <StyledCardDescription>
<mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiOutlineSearchCircle size={50} color="#5865F2" /> <mask> </Styles.StyledCardIcon> <mask> <Styles.StyledCardTitle>SEARCH</Styles.StyledCardTitle> <mask> <Styles.StyledCardDescription> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardDescription> </StyledSectionCard>
<mask> <Styles.StyledCardDescription> <mask> Have a huge file of values, keys or arrays? Worry no more, type in the keyword you are <mask> looking for into search input and it will take you to each node with matching result <mask> highlighting the line to understand better! <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledSectionCard> <StyledCardIcon>
<mask> highlighting the line to understand better! <mask> </Styles.StyledCardDescription> <mask> </Styles.StyledSectionCard> <mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiOutlineDownload size={50} color="#DA2877" /> <mask> </Styles.S...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardIcon> <StyledCardTitle>DOWNLOAD</StyledCardTitle> <StyledCardDescription>
<mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiOutlineDownload size={50} color="#DA2877" /> <mask> </Styles.StyledCardIcon> <mask> <Styles.StyledCardTitle>DOWNLOAD</Styles.StyledCardTitle> <mask> <Styles.StyledCardDescription> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardDescription> </StyledSectionCard>
<mask> <Styles.StyledCardDescription> <mask> Download the graph to your local machine and use it wherever you want, to your blogs, <mask> website or make it a poster and paste to the wall. Who wouldn&apos;t want to see a JSON <mask> Crack graph onto their wall, eh? <mask> </Styl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledSectionCard> <StyledCardIcon>
<mask> Crack graph onto their wall, eh? <mask> </Styles.StyledCardDescription> <mask> </Styles.StyledSectionCard> <mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiLightningBolt size={50} color="#F5E027" /> <mask> </Styles.StyledCardIcon...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardIcon> <StyledCardTitle>LIVE</StyledCardTitle> <StyledCardDescription>
<mask> <mask> <Styles.StyledSectionCard> <mask> <Styles.StyledCardIcon> <mask> <HiLightningBolt size={50} color="#F5E027" /> <mask> </Styles.StyledCardIcon> <mask> <Styles.StyledCardTitle>LIVE</Styles.StyledCardTitle> <mask> <Styles.StyledCardDescription> <mask> With...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledCardDescription> </StyledSectionCard> </StyledFeaturesSection>
<mask> <Styles.StyledCardDescription> <mask> With Microsoft&apos;s Monaco Editor which is also used by VS Code, easily edit your JSON and <mask> directly view through the graphs. Also there&apos;s a JSON validator above of it to make <mask> sure there is no type error. <mask> </...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledTwitterQuote> <StyledSectionArea> <StyledSubTitle>Open Source Community</StyledSubTitle> <StyledMinorTitle>
<mask> April 27, 2022 <mask> </a> <mask> </blockquote>{" "} <mask> <Script strategy="lazyOnload" src="https://platform.twitter.com/widgets.js"></Script> <mask> </Styles.StyledTwitterQuote> <mask> <Styles.StyledSectionArea> <mask> <Styles.StyledSubTitle>Open Source Comm...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledMinorTitle>
<mask> you join our community and help us make JSON Crack the best it can be. <mask> <br /> <mask> <br /> So why not join us and become part of the JSON Crack open source community today? We <mask> can&apos;t wait to see what we can accomplish together! <mask> </Styles.StyledM...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledSectionArea> </StyledSection>
<mask> leftIcon={<AiTwotoneStar />} <mask> > <mask> STAR ON GITHUB <mask> </Button> <mask> </Styles.StyledSectionArea> <mask> </Styles.StyledSection> <mask> ); <mask> <mask> const EmbedSection = () => ( <mask> <Styles.StyledSection id="embed"> <mask> <Styles.StyledSec...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledSection id="embed"> <StyledSectionArea> <StyledSubTitle>Embed Into Your Website</StyledSubTitle> <StyledMinorTitle>
<mask> </Styles.StyledSection> <mask> ); <mask> <mask> const EmbedSection = () => ( <mask> <Styles.StyledSection id="embed"> <mask> <Styles.StyledSectionArea> <mask> <Styles.StyledSubTitle>Embed Into Your Website</Styles.StyledSubTitle> <mask> <Styles.StyledMinorTitle> <mask> JSON ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledMinorTitle>
<mask> the website. This can be useful for a variety of purposes, such as quickly checking the <mask> structure of a JSON file or verifying the data contained within it. JSON Crack&apos;s <mask> intuitive interface makes it easy to navigate and understand even complex JSON data, making <mask...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledSectionArea>
<mask> </Styles.StyledMinorTitle> <mask> <Button w="fit-content" size="md" component="a" href="/docs"> <mask> LEARN TO EMBED <mask> </Button> <mask> </Styles.StyledSectionArea> <mask> <div> <mask> <Styles.StyledFrame <mask> title="Example Embed" <mask> sr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledFrame
<mask> LEARN TO EMBED <mask> </Button> <mask> </Styles.StyledSectionArea> <mask> <div> <mask> <Styles.StyledFrame <mask> title="Example Embed" <mask> src={`${baseURL}/widget?json=63c313d32ffa98f29b462315`} <mask> loading="lazy" <mask> ></Styles.StyledFr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
></StyledFrame>
<mask> <Styles.StyledFrame <mask> title="Example Embed" <mask> src={`${baseURL}/widget?json=63c313d32ffa98f29b462315`} <mask> loading="lazy" <mask> ></Styles.StyledFrame> <mask> </div> <mask> </Styles.StyledSection> <mask> ); <mask> <mask> const SupportSection = () =...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledSection>
<mask> src={`${baseURL}/widget?json=63c313d32ffa98f29b462315`} <mask> loading="lazy" <mask> ></Styles.StyledFrame> <mask> </div> <mask> </Styles.StyledSection> <mask> ); <mask> <mask> const SupportSection = () => ( <mask> <Styles.StyledPaidSection> <mask> <Styles.StyledProdu...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledPaidSection> <StyledProducthunt> <StyledSubTitle>
<mask> </Styles.StyledSection> <mask> ); <mask> <mask> const SupportSection = () => ( <mask> <Styles.StyledPaidSection> <mask> <Styles.StyledProducthunt> <mask> <Styles.StyledSubTitle> <mask> Support JSON Crack at <mask> <br /> <mask> <Styles.StyledHighlightedText>Produc...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledHighlightedText>Product Hunt</StyledHighlightedText> </StyledSubTitle>
<mask> <Styles.StyledProducthunt> <mask> <Styles.StyledSubTitle> <mask> Support JSON Crack at <mask> <br /> <mask> <Styles.StyledHighlightedText>Product Hunt</Styles.StyledHighlightedText> <mask> </Styles.StyledSubTitle> <mask> <Producthunt /> <mask> </Styles.St...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledProducthunt> <StyledAffiliate> <StyledSubTitle>Affiliate</StyledSubTitle>
<mask> <br /> <mask> <Styles.StyledHighlightedText>Product Hunt</Styles.StyledHighlightedText> <mask> </Styles.StyledSubTitle> <mask> <Producthunt /> <mask> </Styles.StyledProducthunt> <mask> <Styles.StyledAffiliate> <mask> <Styles.StyledSubTitle>Affiliate</Styles.Styled...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledAffiliate> </StyledPaidSection>
<mask> </Styles.StyledProducthunt> <mask> <Styles.StyledAffiliate> <mask> <Styles.StyledSubTitle>Affiliate</Styles.StyledSubTitle> <mask> <CarbonAds /> <mask> </Styles.StyledAffiliate> <mask> </Styles.StyledPaidSection> <mask> ); <mask> <mask> const SponsorSection = () => ( <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledSponsorSection id="sponsor"> <StyledSubTitle>Sponsors</StyledSubTitle> <StyledMinorTitle>
<mask> </Styles.StyledPaidSection> <mask> ); <mask> <mask> const SponsorSection = () => ( <mask> <Styles.StyledSponsorSection id="sponsor"> <mask> <Styles.StyledSubTitle>Sponsors</Styles.StyledSubTitle> <mask> <Styles.StyledMinorTitle> <mask> Your supports make JSON Crack possible to continue...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledMinorTitle>
<mask> <Styles.StyledSponsorSection id="sponsor"> <mask> <Styles.StyledSubTitle>Sponsors</Styles.StyledSubTitle> <mask> <Styles.StyledMinorTitle> <mask> Your supports make JSON Crack possible to continue and accessible for everyone! <mask> </Styles.StyledMinorTitle> <mask> <Button <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledSponsorSection>
<mask> > <mask> Become A Sponsor! <mask> </Button> <mask> <Sponsors /> <mask> </Styles.StyledSponsorSection> <mask> ); <mask> <mask> const HomePage = () => { <mask> return ( <mask> <ThemeProvider theme={darkTheme}> </s> feat: support edit on graph </s> remove <Styles.StyledHo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
<StyledHome>
<mask> <mask> const HomePage = () => { <mask> return ( <mask> <ThemeProvider theme={darkTheme}> <mask> <Styles.StyledHome> <mask> <Head> <mask> <title>JSON Crack - Crack your data into pieces</title> <mask> </Head> <mask> <Navbar /> <mask> <HeroSection />...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
</StyledHome>{" "}
<mask> <GitHubSection /> <mask> <EmbedSection /> <mask> <SponsorSection /> <mask> <Footer /> <mask> </Styles.StyledHome>{" "} <mask> </ThemeProvider> <mask> ); <mask> }; <mask> <mask> export default HomePage; </s> feat: support edit on graph </s> remove </Styl...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/pages/index.tsx
import _get from "lodash.get"; import _set from "lodash.set";
<mask> import debounce from "lodash.debounce"; <mask> import { toast } from "react-hot-toast"; <mask> import { create } from "zustand"; <mask> import { defaultJson } from "src/constants/data"; <mask> import { getFromCloud } from "src/services/json"; </s> feat: support edit on graph </s> remove import * as Styles ...
[ "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useFile.ts
editContents: (path: string, value: string, callback?: () => void) => void;
<mask> setFile: (fileData: File) => void; <mask> setJsonSchema: (jsonSchema: object | null) => void; <mask> } <mask> <mask> export type File = { <mask> _id: string; </s> feat: support edit on graph </s> remove const initialUser = () => { if (isDevelopment) { return { _id: "0", provider: ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useFile.ts
const debouncedUpdateJson = debounce( (value: unknown) => useJson.getState().setJson(JSON.stringify(value, null, 2)), 800 );
<mask> <mask> const isURL = <mask> /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi; <mask> <mask> const debouncedUpdateJson = debounce((value: un...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useFile.ts
debouncedUpdateJson(JSON.parse(contents as string));
<mask> getContents: () => get().contents, <mask> getHasChanges: () => get().hasChanges, <mask> setContents: ({ contents, hasChanges = true }) => { <mask> set({ ...(contents && { contents }), hasChanges }); <mask> debouncedUpdateJson(contents); <mask> }, <mask> setError: error => set({ error }),...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useFile.ts
useGraph.getState().setGraph(json);
<mask> ...initialStates, <mask> getJson: () => get().json, <mask> setJson: json => { <mask> set({ json, loading: false }); <mask> useGraph.getState().setGraph(JSON.parse(json)); <mask> }, <mask> clear: () => { <mask> set({ json: "", loading: false }); <mask> useGraph.getState().clearG...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useJson.ts
const devUser = { _id: "0", provider: "google", providerUserId: "115637229829349229857", email: "test@jsoncrack.com", name: "JSON Crack", profilePicture: "", signUpAt: "2022-12-04T11:07:32.000Z", lastLoginAt: "2023-05-13T09:56:02.915Z", updatedAt: "2023-05-06T16:19:47.486Z", type: 0, } as CustomUser...
<mask> checkSession: () => void; <mask> isPremium: () => boolean; <mask> } <mask> <mask> const initialUser = () => { <mask> if (isDevelopment) { <mask> return { <mask> _id: "0", <mask> provider: "google", <mask> providerUserId: "115637229829349229857", <mask> email: "test@j...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useUser.ts
isAuthenticated: false, user: null,
<mask> isAuthenticated: boolean; <mask> } <mask> <mask> const initialStates: UserStates = { <mask> isAuthenticated: isDevelopment, <mask> user: initialUser(), <mask> }; <mask> <mask> const useUser = create<UserStates & UserActions>()((set, get) => ({ <mask> ...initialStates, <mask> setUser: (key,...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useUser.ts
<mask> setUser: (key, value) => set({ [key]: value }), <mask> isPremium: () => { <mask> const user = get().user; <mask> <mask> if (isDevelopment) return true; <mask> if (user) return user.type > 0; <mask> return false; <mask> }, <mask> logout: async () => { <mask> const session = ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useUser.ts
if (isDevelopment) { return set({ user: devUser as CustomUser, isAuthenticated: true }); }
<mask> const currentSession = altogic.auth.getSession(); <mask> <mask> if (currentSession) { <mask> const { user, errors } = await altogic.auth.getUserFromDB(); <mask> if (errors?.items || !user) { <mask> altogic.auth.clearLocalData(); <mask> return; <mask> } <mask> ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/45d4fa3d663eefcb34d2a972b1db0477b0d8d993
src/store/useUser.ts
<mask> y, <mask> }) => { <mask> const performanceMode = useConfig((state) => state.performanceMode); <mask> const hideCollapse = useStored((state) => state.hideCollapse); <mask> const expand = useConfig((state) => state.expand); <mask> const expandNodes = useGraph((state) => state.expandNodes); <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/CustomNode/TextNode.tsx
const [isExpanded, setIsExpanded] = React.useState(true);
<mask> const hideCollapse = useStored((state) => state.hideCollapse); <mask> const expand = useConfig((state) => state.expand); <mask> const expandNodes = useGraph((state) => state.expandNodes); <mask> const collapseNodes = useGraph((state) => state.collapseNodes); <mask> const [isExpanded, setIsExpanded...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/CustomNode/TextNode.tsx
<mask> <mask> const handleExpand = (e: React.MouseEvent<HTMLButtonElement>) => { <mask> e.stopPropagation(); <mask> setIsExpanded(!isExpanded); <mask> }; <mask> <mask> React.useEffect(() => { <mask> setIsExpanded(!expand); <mask> }, [expand]); <mask> <mask> React.useEffect(() => { <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/CustomNode/TextNode.tsx
<mask> React.useEffect(() => { <mask> setIsExpanded(!expand); <mask> }, [expand]); <mask> <mask> React.useEffect(() => { <mask> if (isExpanded) collapseNodes(node.id); <mask> else expandNodes(node.id); <mask> }, [collapseNodes, expand, expandNodes, isExpanded, node.id]); <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/CustomNode/TextNode.tsx
};
<mask> <mask> React.useEffect(() => { <mask> if (isExpanded) collapseNodes(node.id); <mask> else expandNodes(node.id); <mask> }, [collapseNodes, expand, expandNodes, isExpanded, node.id]); <mask> <mask> return ( <mask> <Styled.StyledForeignObject <mask> width={width} <mask> hei...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/CustomNode/TextNode.tsx
const hiddenItems = document.querySelectorAll("hide"); hiddenItems.forEach((item) => item.classList.remove("hide"));
<mask> React.useEffect(() => { <mask> const nodeList = collapsedNodes.map((id) => `[id*="node-${id}"]`); <mask> const edgeList = collapsedEdges.map((id) => `[class*="edge-${id}"]`); <mask> <mask> const nodes = document.querySelectorAll('[id*="node-"]'); <mask> const edges = document.querySelect...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/Graph/index.tsx
import { CgArrowsMergeAltH, CgArrowsShrinkH } from "react-icons/cg";
<mask> import Link from "next/link"; <mask> import styled from "styled-components"; <mask> import { CanvasDirection } from "reaflow"; <mask> import { TiFlowMerge } from "react-icons/ti"; <mask> import { <mask> CgArrowsMergeAltH, <mask> CgArrowsShrinkH, <mask> CgPerformance, <mask> } from "react-icons/cg"...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/Sidebar/index.tsx
<mask> width: 100%; <mask> color: ${({ theme }) => theme.INTERACTIVE_NORMAL}; <mask> cursor: pointer; <mask> <mask> ${({ theme, beta }) => <mask> beta && <mask> ` <mask> &::after { <mask> position: absolute; <mask> display: flex; <mask> justify-content: center; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/Sidebar/index.tsx
<mask> if (layout === "RIGHT") return 270; <mask> return 360; <mask> } <mask> <mask> const StyledAlertIcon = styled(IoAlertCircleSharp)` <mask> color: ${({ theme }) => theme.ORANGE}; <mask> `; <mask> <mask> export const Sidebar: React.FC = () => { <mask> const getJson = useConfig((state) => state.ge...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/48c827a25a6db366990208ca536532e252ea073f
src/components/Sidebar/index.tsx
import styled from "styled-components";
<mask> import React from "react"; <mask> import styled, { css } from "styled-components"; <mask> import ReactFlow, { <mask> ControlButton, <mask> Controls, <mask> Elements, <mask> isNode, </s> seperate function to helper file </s> remove isNode, </s> add </s> remove Position, ReactFlowProvider, ...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<mask> import ReactFlow, { <mask> ControlButton, <mask> Controls, <mask> Elements, <mask> isNode, <mask> NodeExtent, <mask> Position, <mask> ReactFlowProvider, <mask> } from "react-flow-renderer"; <mask> import { defaultValue } from "../JsonEditor"; </s> seperate function to helper file </s> re...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<mask> Controls, <mask> Elements, <mask> isNode, <mask> NodeExtent, <mask> Position, <mask> ReactFlowProvider, <mask> } from "react-flow-renderer"; <mask> import { defaultValue } from "../JsonEditor"; <mask> import { parser } from "src/utils/json-editor-parser"; <mask> import { useLocalStorage } f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<mask> } from "react-flow-renderer"; <mask> import { defaultValue } from "../JsonEditor"; <mask> import { parser } from "src/utils/json-editor-parser"; <mask> import { useLocalStorage } from "usehooks-ts"; <mask> import dagre from "dagre"; <mask> import { CustomNodeComponent } from "./Node"; <mask> <mask> cons...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
import { onLayout } from "./helpers";
<mask> import { parser } from "src/utils/json-editor-parser"; <mask> import { useLocalStorage } from "usehooks-ts"; <mask> import dagre from "dagre"; <mask> import { CustomNodeComponent } from "./Node"; <mask> <mask> const dagreGraph = new dagre.graphlib.Graph(); <mask> dagreGraph.setDefaultEdgeLabel(() => ({})...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<mask> } <mask> } <mask> `; <mask> <mask> const onLayout = ( <mask> direction: string, <mask> elements: Elements, <mask> setElements: React.Dispatch<Elements> <mask> ) => { <mask> const isHorizontal = direction === "LR"; <mask> dagreGraph.setGraph({ rankdir: direction }); <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
export const LiveEditor: React.FC = () => {
<mask> const nodeTypes = { <mask> special: CustomNodeComponent, <mask> }; <mask> <mask> const LiveEditor: React.FC = () => { <mask> const [json] = useLocalStorage("json", JSON.stringify(defaultValue)); <mask> const [rfInstance, setRfInstance] = React.useState<any>(null); <mask> const [valid, setValid] ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
parser(json)
<mask> const [json] = useLocalStorage("json", JSON.stringify(defaultValue)); <mask> const [rfInstance, setRfInstance] = React.useState<any>(null); <mask> const [valid, setValid] = React.useState(true); <mask> const [elements, setElements] = React.useState<Elements>( <mask> parser(JSON.parse(json)) <ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
onLayout("RL", parser(json), setElements);
<mask> <mask> React.useEffect(() => { <mask> try { <mask> JSON.parse(json); <mask> setElements(parser(JSON.parse(json))); <mask> setValid(true); <mask> } catch (error) { <mask> setValid(false); <mask> } <mask> }, [json]); </s> seperate function to helper file </s> rem...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<ReactFlow nodeExtent={nodeExtent} elements={elements} nodeTypes={nodeTypes} onLoad={(rf: any) => { setRfInstance(rf); onLayout("RL", elements, setElements); }} > <Controls> <ControlButton onClick={() => onLayout("RL", e...
<mask> if (!valid) return null; <mask> <mask> return ( <mask> <StyledLiveEditor> <mask> <ReactFlowProvider> <mask> <ReactFlow <mask> nodeExtent={nodeExtent} <mask> elements={elements} <mask> nodeTypes={nodeTypes} <mask> onLoad={(rf: any) => { <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", ...
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
<mask> </ReactFlowProvider> <mask> </StyledLiveEditor> <mask> ); <mask> }; <mask> <mask> export default LiveEditor; </s> seperate function to helper file </s> remove <ReactFlowProvider> <ReactFlow nodeExtent={nodeExtent} elements={elements} nodeTypes={node...
[ "keep", "keep", "keep", "keep", "replace", "replace" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4942d68d3d1988802b60b456e8c1123ae0b51809
src/pages/editor/LiveEditor/index.tsx
"save-html-as-image": "^1.7.1",
<mask> "react-zoom-pan-pinch": "^2.1.3", <mask> "reaflow": "^5.0.4", <mask> "styled-components": "^5.3.5" <mask> }, <mask> "devDependencies": { <mask> "@testing-library/jest-dom": "^5.16.4", <mask> "@testing-library/react": "^13.1.1", </s> add export as image support </s> remove import t...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/49d14e79a25b14e5563bc42cdcde5d7a98376334
package.json
import { saveAsPng } from "save-html-as-image";
<mask> import React from "react"; <mask> import toast from "react-hot-toast"; <mask> import { <mask> AiOutlineFullscreen, <mask> AiOutlineMinus, <mask> AiOutlinePlus, <mask> } from "react-icons/ai"; </s> add export as image support </s> remove <StyledToolElement aria-label="save" onC...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/49d14e79a25b14e5563bc42cdcde5d7a98376334
src/containers/Editor/Tools.tsx
const exportAsImage = () => { saveAsPng(document.querySelector("svg[id*='ref']"), { filename: "jsonvisio.com", printDate: true, }); };
<mask> const toggleTheme = () => dispatch({ type: ConfigActionType.TOGGLE_THEME }); <mask> <mask> return ( <mask> <StyledTools> <mask> <StyledToolElement aria-label="fullscreen" onClick={toggleEditor}> <mask> <AiOutlineFullscreen /> <mask> </StyledToolElement> </s> add export as ima...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/49d14e79a25b14e5563bc42cdcde5d7a98376334
src/containers/Editor/Tools.tsx
<StyledToolElement aria-label="save" onClick={exportAsImage}>
<mask> <StyledToolElement aria-label="switch theme" onClick={toggleTheme}> <mask> {settings.lightmode ? <HiOutlineMoon /> : <HiOutlineSun />} <mask> </StyledToolElement> <mask> <Input /> <mask> <StyledToolElement <mask> aria-label="save" <mask> onClick={() => { <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/49d14e79a25b14e5563bc42cdcde5d7a98376334
src/containers/Editor/Tools.tsx
AiOutlineLink,
<mask> AiFillGithub, <mask> AiOutlineTwitter, <mask> AiOutlineSave, <mask> AiOutlineFileAdd, <mask> } from "react-icons/ai"; <mask> <mask> import { Tooltip } from "src/components/Tooltip"; <mask> import { Modal } from "src/components/Modal/index"; </s> Add Fetch JSON from URL Added a button in sideba...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
import { Modal } from "src/components/Modal/index";
<mask> <mask> import { Tooltip } from "src/components/Tooltip"; <mask> import { ConfigActionType } from "src/reducer/reducer"; <mask> import { useConfig } from "src/hocs/config"; <mask> import { useRouter } from "next/router"; <mask> <mask> const StyledSidebar = styled.div` </s> Add Fetch JSON from URL Added...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
const [visible, setVisible] = React.useState(false);
<mask> const router = useRouter(); <mask> const [jsonFile, setJsonFile] = React.useState<File | null>(null); <mask> <mask> const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => { <mask> if (e.target.files) setJsonFile(e.target.files?.item(0)); <mask> }; <mask> </s> Add Fetch JSON fr...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
const handleImportJSONFromURL = () => { setVisible(true); };
<mask> const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => { <mask> if (e.target.files) setJsonFile(e.target.files?.item(0)); <mask> }; <mask> <mask> const handleClear = () => { <mask> dispatch({ type: ConfigActionType.SET_JSON, payload: "{}" }); <mask> localStorage.removeItem...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
<Modal visible={visible} setVisible={setVisible} />
<mask> <mask> return ( <mask> <StyledSidebar> <mask> <StyledTopWrapper> <mask> <Link passHref href="/"> <mask> <StyledElement onClick={() => router.push("/")}> <mask> <StyledLogo> <mask> <StyledText>J</StyledText> </s> Add Fetch JSON from URL Added a bu...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
<Tooltip title="Fetch JSON from URL"> <StyledElement onClick={handleImportJSONFromURL}> <AiOutlineLink /> </StyledElement> </Tooltip>
<mask> </StyledElement> <mask> </Tooltip> <mask> <Tooltip title="Rotate Layout"> <mask> <StyledElement <mask> onClick={() => dispatch({ type: ConfigActionType.TOGGLE_LAYOUT })} <mask> > </s> Add Fetch JSON from URL Added a button in sidebar to show a mod...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4bf74a4476f99aa9b4b5458a522245094959befb
src/components/Sidebar/index.tsx
const [minScale, setMinScale] = React.useState(0.3);
<mask> } <mask> `; <mask> <mask> const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) => { <mask> const setGraphValue = useGraph(state => state.setGraphValue); <mask> const setConfig = useConfig(state => state.setConfig); <mask> const loading = useGraph(state => state.loading);...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
<mask> <mask> const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) => { <mask> const setGraphValue = useGraph(state => state.setGraphValue); <mask> const setConfig = useConfig(state => state.setConfig); <mask> const canvasRef = React.useRef(null); <mask> const setCanvasRef = use...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
const areaSize = layout.width * layout.height; setMinScale((1_000_000 * 0.5) / areaSize);
<mask> const onLayoutChange = React.useCallback( <mask> (layout: ElkRoot) => { <mask> if (layout.width && layout.height) { <mask> setSize({ width: layout.width + 400, height: layout.height + 400 }); <mask> <mask> requestAnimationFrame(() => { <mask> setTimeout(() => { <mas...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
<mask> const input = document.querySelector("input:focus") as HTMLInputElement; <mask> if (input) input.blur(); <mask> }, []); <mask> <mask> React.useEffect(()=>{ <mask> setCanvasRef(canvasRef) <mask> }) <mask> <mask> if (nodes.length > 8_000) return <ErrorView />; <mask> <mask> retu...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
minScale={minScale} initialScale={0.4} wheel={{ step: 0.08 }}
<mask> <StyledEditorWrapper isWidget={isWidget}> <mask> {loading && <Loading message="Painting graph..." />} <mask> <TransformWrapper <mask> maxScale={2} <mask> minScale={0.25} <mask> initialScale={0.7} <mask> wheel={{ step: 0.05 }} <mask> zoomAnimation={{...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
className="jsoncrack-canvas"
<mask> }} <mask> > <mask> <Canvas <mask> nodes={nodes} <mask> edges={edges} <mask> maxWidth={size.width} <mask> maxHeight={size.height} <mask> direction={layout} <mask> onLayoutChange={onLayoutChange} </s> set ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
<mask> animated={false} <mask> readonly={true} <mask> dragEdge={null} <mask> dragNode={null} <mask> ref={canvasRef} <mask> fit={true} <mask> node={props => <CustomNode {...props} onClick={handleNodeClick} />} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/components/Graph/index.tsx
<mask> import { ReactZoomPanPinchRef } from "react-zoom-pan-pinch"; <mask> import { CanvasDirection } from "reaflow"; <mask> import { defaultJson } from "src/constants/data"; <mask> import create from "zustand"; <mask> import {MutableRefObject} from "react"; <mask> interface ConfigActions { <mask> setJson: (js...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/hooks/store/useConfig.tsx
<mask> import create from "zustand"; <mask> import {MutableRefObject} from "react"; <mask> interface ConfigActions { <mask> setJson: (json: string) => void; <mask> setCanvasRef: (canvas: MutableRefObject<HTMLCanvasElement | null> ) => void; <mask> setConfig: (key: keyof Config, value: unknown) => void; <ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/hooks/store/useConfig.tsx
<mask> <mask> const initialStates = { <mask> json: defaultJson, <mask> cursorMode: "move" as "move" | "navigation", <mask> canvas: undefined as MutableRefObject<HTMLCanvasElement | null> | undefined, <mask> layout: "RIGHT" as CanvasDirection, <mask> expand: true, <mask> hideEditor: false, <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/hooks/store/useConfig.tsx
<mask> const useConfig = create<Config & ConfigActions>()((set, get) => ({ <mask> ...initialStates, <mask> getJson: () => get().json, <mask> setJson: (json: string) => set({ json }), <mask> setCanvasRef: (canvas: MutableRefObject<HTMLCanvasElement | null> ) => set({ canvas }), <mask> zoomIn: () => { <m...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/hooks/store/useConfig.tsx
const canvas = document.querySelector(".jsoncrack-canvas") as HTMLElement; if (zoomPanPinch && canvas) zoomPanPinch.zoomToElement(canvas);
<mask> } <mask> }, <mask> centerView: () => { <mask> const zoomPanPinch = get().zoomPanPinch; <mask> const canvas = get().canvas <mask> if(zoomPanPinch && canvas && canvas.current) <mask> zoomPanPinch.zoomToElement(canvas.current["containerRef"].current) <mask> }, <mask> setConfig...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4c39318beb34ecbe318b6fb2766ad1eec9f1a552
src/hooks/store/useConfig.tsx
<mask> Html, <mask> Head, <mask> Main, <mask> NextScript, <mask> DocumentContext, <mask> } from "next/document"; <mask> import { SeoTags } from "src/components/SeoTags"; <mask> import { ServerStyleSheet } from "styled-components"; <mask> <mask> const isDevelopment = process.env.NODE_ENV === "develo...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4f0ee7b951a218c3bf260a5bbf7dc0d42305fb6a
src/pages/_document.tsx
<mask> NextScript, <mask> DocumentContext, <mask> } from "next/document"; <mask> import { SeoTags } from "src/components/SeoTags"; <mask> import { ServerStyleSheet } from "styled-components"; <mask> <mask> const isDevelopment = process.env.NODE_ENV === "development"; <mask> <mask> class MyDocument extend...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/4f0ee7b951a218c3bf260a5bbf7dc0d42305fb6a
src/pages/_document.tsx
<mask> <mask> const isDevelopment = process.env.NODE_ENV === "development"; <mask> <mask> class MyDocument extends Document { <mask> static async getInitialProps(ctx: DocumentContext) { <mask> const sheet = new ServerStyleSheet(); <mask> const originalRenderPage = ctx.renderPage; <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AykutSarac/jsoncrack.com/commit/4f0ee7b951a218c3bf260a5bbf7dc0d42305fb6a
src/pages/_document.tsx
try { let json = parseTree(jsonStr); let nodes: NodeData[] = []; let edges: EdgeData[] = [];
<mask> }; <mask> }; <mask> <mask> export const parser = (jsonStr: string, isFolded = false) => { <mask> try{ <mask> let json = parseTree(jsonStr); <mask> console.log(json); <mask> let nodes: NodeData[] = []; <mask> let edges: EdgeData[] = []; <mask> <mask> const addNodes = ( <mask> text:...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
const addNodes = ( text: any, width: number, height: number, parent: boolean, isEmpty?: boolean ) => { let actualId = String(nodes.length + 1); nodes = [ ...nodes, { id: actualId, text: text, width: width, height: ...
<mask> console.log(json); <mask> let nodes: NodeData[] = []; <mask> let edges: EdgeData[] = []; <mask> <mask> const addNodes = ( <mask> text: any, <mask> width: number, <mask> height: number, <mask> parent: boolean, <mask> isEmpty?: boolean <mask> ) => { <mask> let actualI...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", ...
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
]; return actualId; };
<mask> isParent: parent, <mask> childrenCount: parent ? 1 : 0, <mask> isEmpty: isEmpty, <mask> }, <mask> }, <mask> ]; <mask> return actualId; <mask> }; <mask> <mask> const addEdges = (from: string, to: string) => { <mask> edges = [ <mask> .....
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
const addEdges = (from: string, to: string) => { edges = [ ...edges, { id: `e${from}-${to}`, from: from, to: to, }, ]; };
<mask> ]; <mask> return actualId; <mask> }; <mask> <mask> const addEdges = (from: string, to: string) => { <mask> edges = [ <mask> ...edges, <mask> { <mask> id: `e${from}-${to}`, <mask> from: from, <mask> to: to, <mask> }, <mask> ]; <mask> }...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
let parentName: string = ""; let bracketOpen: { id: string; type: string }[] = []; let objectsFromArray: number[] = []; let notHaveParent: string[] = []; let brothersNode: [string, string][] = []; let brothersParentId: string | undefined = ""; let brotherKey: string = ""; let brothersNod...
<mask> }, <mask> ]; <mask> }; <mask> <mask> let parentName: string = ""; <mask> let bracketOpen: string[] = []; <mask> let objectsFromArray: number[] = []; <mask> let notHaveParent: string[] = []; <mask> let brothersNode: [string, string][] = []; <mask> let brothersParentId: string | ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
const traverse = ( objectToTraverse: Node, parentType?: string, myParentId?: string, nextType?: string ) => { let { type, children, value } = objectToTraverse;
<mask> parentId: string | undefined; <mask> objectsFromArrayId: number | undefined; <mask> }[] = []; <mask> <mask> const traverse = ( <mask> objectToTraverse: Node, <mask> parentType?: string, <mask> myParentId?: string, <mask> nextType?: string <mask> ) => { <mask> let { t...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
if (!children) { if (value !== undefined) { if ( parentType === "property" && nextType !== "object" && nextType !== "array" ) { brothersParentId = myParentId; if (nextType === undefined) { // add key and value to...
<mask> nextType?: string <mask> ) => { <mask> let { type, children, value } = objectToTraverse; <mask> <mask> if (!children) { <mask> if (value !== undefined) { <mask> if ( <mask> parentType === "property" && <mask> nextType !== "object" && <mask> nex...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
if (nextType && parentType !== "array") { if (nextType === "object" || nextType === "array") { parentName = value; }
<mask> brothersNode = [...brothersNode, [brotherKey, value]]; <mask> } else { <mask> brotherKey = value; <mask> } <mask> } else if (parentType === "array") { <mask> const { width, height } = calculateSize(String(value), false, isFolded); <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
} else if (children) { let parentId: string | undefined;
<mask> if (myParentId) { <mask> addEdges(myParentId, nodeFromArrayId); <mask> } <mask> } <mask> if (nextType && parentType !== "array") { <mask> if (nextType === "object" || nextType === "array") { <mask> parentName = value; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
if (type !== "property" && parentName !== "") { // add last brothers node and add parent node if (brothersNode.length > 0) { // end brothers node const { width, height } = calculateSize(brothersNode, false, isFolded); const brothersNodeId = addNodes(brothe...
<mask> } <mask> } else if (children) { <mask> let parentId: string | undefined; <mask> <mask> if (type !== "property" && parentName !== "") { <mask> // add last brothers node and add parent node <mask> if (brothersNode.length > 0) { <mask> // end brothers node <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
brothersNodeProps = [ ...brothersNodeProps, { id: brothersNodeId, parentId: brothersParentId, objectsFromArrayId: objectsFromArray[objectsFromArray.length - 1], }, ]; } // add parent nod...
<mask> } else { <mask> notHaveParent = [...notHaveParent, brothersNodeId]; <mask> } <mask> <mask> brothersNodeProps = [ <mask> ...brothersNodeProps, <mask> { <mask> id: brothersNodeId, <mask> parentId: brothersParent...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
// add edges from parent node let brothersProps = brothersNodeProps.filter( e => e.parentId === myParentId && e.objectsFromArrayId === objectsFromArray[objectsFromArray.length - 1]
<mask> } else if (parentType === "array") { <mask> objectsFromArray = [...objectsFromArray, objectsFromArray.length + 1]; <mask> } <mask> <mask> children.forEach((branch, index, array) => { <mask> if (array[index + 1]) { <mask> traverse( <mask> branch, <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
if ( (brothersProps.length > 0 && bracketOpen[bracketOpen.length - 2] && bracketOpen[bracketOpen.length - 2].type !== "object") || (brothersProps.length > 0 && bracketOpen.length === 1) ) { addEdges(brothersProps[brothersProps.length - ...
<mask> type, <mask> bracketOpen[bracketOpen.length - 1], <mask> array[index + 1].type <mask> ); <mask> } else { <mask> traverse(branch, type, bracketOpen[bracketOpen.length - 1]); <mask> } <mask> }); <mask> <mask> if (type !=...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
objectsFromArray = [...objectsFromArray, objectsFromArray.length + 1];
<mask> newBracketOpen.splice(newBracketOpen.length - 1); <mask> bracketOpen = [...newBracketOpen]; <mask> } <mask> } else if (parentType === "array") { <mask> if (objectsFromArray.length > 0) { <mask> let newobjectsFromArray = [...objectsFromArray]; ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
children.forEach((branch, index, array) => { if (array[index + 1]) { traverse( branch, type, bracketOpen[bracketOpen.length - 1] ? bracketOpen[bracketOpen.length - 1].id : undefined, array[index + 1].ty...
<mask> objectsFromArray = [...newobjectsFromArray]; <mask> } <mask> } <mask> <mask> // add brothers node when is the last node <mask> if (brothersNode.length > 0) { <mask> const { width, height } = calculateSize(brothersNode, false, isFolded); <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
traverse( branch, type, bracketOpen[bracketOpen.length - 1] ? bracketOpen[bracketOpen.length - 1].id : undefined );
<mask> brothersNode = []; <mask> if (brothersParentId) { <mask> addEdges(brothersParentId, brothersNodeId); <mask> } else { <mask> notHaveParent = [...notHaveParent, brothersNodeId]; <mask> } <mask> brothersNodeProps = [ <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
});
<mask> addEdges(brothersParentId, brothersNodeId); <mask> } else { <mask> notHaveParent = [...notHaveParent, brothersNodeId]; <mask> } <mask> brothersNodeProps = [ <mask> ...brothersNodeProps, <mask> { <mask> id: brother...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
if (type !== "property") { // when children end if (parentType !== "array") { if (bracketOpen.length > 0) { let newBracketOpen = [...bracketOpen]; newBracketOpen.splice(newBracketOpen.length - 1); bracketOpen = [...newBracketOpen]; ...
<mask> }, <mask> ]; <mask> } <mask> <mask> if (parentId) { <mask> let myChildrens = edges.filter(e => e.from === parentId); <mask> let myIndex = nodes.findIndex(e => e.id === parentId); <mask> <mask> let ModifyNodes = [...nodes]; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts
// add brothers node when is the last node if (brothersNode.length > 0) { const { width, height } = calculateSize(brothersNode, false, isFolded); const brothersNodeId = addNodes(brothersNode, width, height, false); brothersNode = []; if (brothersParent...
<mask> if (parentId) { <mask> let myChildrens = edges.filter(e => e.from === parentId); <mask> let myIndex = nodes.findIndex(e => e.id === parentId); <mask> <mask> let ModifyNodes = [...nodes]; <mask> if (ModifyNodes[myIndex]) { <mask> ModifyNodes[myIn...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AykutSarac/jsoncrack.com/commit/50cb490dbec31b58562a2bac051b3de4b4725049
src/utils/jsonParser.ts