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 |
|---|---|---|---|---|
import { HovercardAds } from "src/components/HovercardAds"; | <mask> } from "@mantine/core";
<mask> import { FaChevronRight } from "react-icons/fa";
<mask> import { SiVisualstudiocode } from "react-icons/si";
<mask> import { Typewriter } from "react-simple-typewriter";
<mask> import { HoverCard } from "src/components/FlexBar";
<mask> import { lightTheme } from "src/constant... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c3fed760cd25eba817515d4670df156f60f82511 | src/pages/index.tsx |
<HovercardAds /> | <mask> <HeroSection />
<mask> <StatsBanner />
<mask> <Features />
<mask> <HeroBottom />
<mask> <HoverCard />
<mask> <Footer />
<mask> </ThemeProvider>
<mask> );
<mask> };
<mask>
</s> feat: improve google analytics setup </s> remove id="google-analytics"
</s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c3fed760cd25eba817515d4670df156f60f82511 | src/pages/index.tsx |
Sentry.setUser({ id: user._id, email: user.email, username: user.name }); | <mask> const { data: premiumData } = await altogic.endpoint.get("/isPremium");
<mask>
<mask> set({ user: user as User, isAuthenticated: true, premium: premiumData.premium });
<mask> } else if (new URLSearchParams(window.location.search).get("access_token")) {
<mask> const { errors, user } = ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c3fed760cd25eba817515d4670df156f60f82511 | src/store/useUser.ts |
if (user) {
const { data: premiumData } = await altogic.endpoint.get("/isPremium");
Sentry.setUser({ id: user._id, email: user.email, username: user.name });
set({ user: user as User, isAuthenticated: true, premium: premiumData.premium });
} | <mask> toast.error(errors.items[0].message);
<mask> return;
<mask> }
<mask>
<mask> const { data: premiumData } = await altogic.endpoint.get("/isPremium");
<mask> set({ user: user as User, isAuthenticated: true, premium: premiumData.premium });
<mask> }
<mask> },
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c3fed760cd25eba817515d4670df156f60f82511 | src/store/useUser.ts |
"include": ["src", "next-env.d.ts",], | <mask> "jsx": "preserve",
<mask> "incremental": true,
<mask> "noImplicitAny": false
<mask> },
<mask> "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
<mask> "exclude": ["node_modules"]
<mask> }
</s> feat: improve google analytics setup </s> remove const { data: premiumData } = await ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c3fed760cd25eba817515d4670df156f60f82511 | tsconfig.json |
hasCollapse={data.parent && hasCollapse} | <mask> height={height}
<mask> x={0}
<mask> y={0}
<mask> hideCollapse={hideCollapse}
<mask> hasCollapse={data.isParent && hasCollapse}
<mask> ref={ref}
<mask> >
<mask> <StyledTextNodeWrapper hasCollapse={data.isParent && !hideCollapse}>
<mask> {(!performance... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/TextNode.tsx |
<StyledTextNodeWrapper hasCollapse={data.parent && !hideCollapse}> | <mask> hideCollapse={hideCollapse}
<mask> hasCollapse={data.isParent && hasCollapse}
<mask> ref={ref}
<mask> >
<mask> <StyledTextNodeWrapper hasCollapse={data.isParent && !hideCollapse}>
<mask> {(!performanceMode || inViewport) && (
<mask> <Styled.StyledKey
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/TextNode.tsx |
parent={data.parent} | <mask> <Styled.StyledKey
<mask> data-x={x}
<mask> data-y={y}
<mask> data-key={JSON.stringify(text)}
<mask> parent={data.isParent}
<mask> >
<mask> <Styled.StyledLinkItUrl>
<mask> {JSON.stringify(text).replaceAll('"', ""... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/TextNode.tsx |
{data.parent && data.childrenCount > 0 && !hideChildrenCount && ( | <mask> </Styled.StyledLinkItUrl>
<mask> </Styled.StyledKey>
<mask> )}
<mask>
<mask> {data.isParent && data.childrenCount > 0 && !hideChildrenCount && (
<mask> <Styled.StyledChildrenCount>
<mask> ({data.childrenCount})
<mask> </Styled.StyledC... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/TextNode.tsx |
{inViewport && data.parent && hasCollapse && !hideCollapse && ( | <mask> ({data.childrenCount})
<mask> </Styled.StyledChildrenCount>
<mask> )}
<mask>
<mask> {inViewport && data.isParent && hasCollapse && !hideCollapse && (
<mask> <StyledExpand onClick={handleExpand}>
<mask> {isExpanded ? <MdLinkOff size={18} /> : <Md... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/TextNode.tsx |
if (!Number.isNaN(+value)) return theme.NODE_COLORS.INTEGER;
if (value === "true") return theme.NODE_COLORS.BOOL.TRUE;
if (value === "false") return theme.NODE_COLORS.BOOL.FALSE;
if (value === "null") return theme.NODE_COLORS.NULL;
return theme.NODE_COLORS.NODE_VALUE; | <mask> import { LinkItUrl } from "react-linkify-it";
<mask> import styled, { DefaultTheme } from "styled-components";
<mask>
<mask> function getTypeColor(value: string, theme: DefaultTheme) {
<mask> if (!Number.isNaN(+value)) return "#FD0079";
<mask> if (value === "true") return theme.TEXT_POSITIVE;
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/styles.tsx |
color: ${({ theme }) => theme.NODE_COLORS.TEXT}; | <mask> }>`
<mask> text-align: ${({ isObject }) => !isObject && "center"};
<mask> font-size: 12px;
<mask> overflow: hidden;
<mask> color: ${({ theme }) => theme.TEXT_NORMAL};
<mask> pointer-events: none;
<mask> padding: ${({ isObject }) => isObject && "10px"};
<mask>
<mask> * {
<mask> font-f... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/styles.tsx |
function getKeyColor(
theme: DefaultTheme,
parent: "array" | "object" | false,
objectKey: boolean
) {
if (parent) {
if (parent === "array") return theme.NODE_COLORS.PARENT_ARR;
return theme.NODE_COLORS.PARENT_OBJ;
}
if (objectKey) return theme.NODE_COLORS.NODE_KEY;
return theme.NODE_COLORS.TEXT; | <mask> cursor: pointer;
<mask> }
<mask> `;
<mask>
<mask> function getKeyColor(theme: DefaultTheme, parent: boolean, objectKey: boolean) {
<mask> if (parent) return theme.NODE_KEY;
<mask> if (objectKey) return theme.OBJECT_KEY;
<mask> return theme.TEXT_POSITIVE;
<mask> }
<mask>
<mask> export con... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/styles.tsx |
parent?: "array" | "object" | false; | <mask> }
<mask>
<mask> export const StyledKey = styled.span<{
<mask> objectKey?: boolean;
<mask> parent?: boolean;
<mask> value?: string;
<mask> }>`
<mask> display: inline;
<mask> flex: 1;
<mask> font-weight: 500;
</s> seperate colors from array and object </s> remove function getKeyColor(theme:... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/styles.tsx |
color: ${({ theme }) => theme.NODE_COLORS.CHILD_COUNT}; | <mask> padding: 0 auto;
<mask> `;
<mask>
<mask> export const StyledChildrenCount = styled.span`
<mask> color: ${({ theme }) => theme.TEXT_POSITIVE};
<mask> padding: 10px;
<mask> margin-left: -15px;
<mask> `;
</s> seperate colors from array and object </s> remove color: ${({ theme }) => theme.TEXT_NO... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/components/CustomNode/styles.tsx |
<mask> import { DefaultTheme } from "styled-components";
<mask>
<mask> const fixedColors = {
<mask> CRIMSON: "#DC143C",
<mask> BLURPLE: "#5865F2",
<mask> FULL_WHITE: "#FFFFFF",
<mask> BLACK: "#202225",
</s> seperate colors from array and object </s> remove declare module "styled-components" {
export ... | [
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/constants/theme.ts | |
const nodeColors = {
dark: {
NODE_COLORS: {
TEXT: "#35D073",
NODE_KEY: "#59b8ff",
NODE_VALUE: "#DCE5E7",
INTEGER: "#e8c479",
NULL: "#939598",
BOOL: {
FALSE: "#F85C50",
TRUE: "#00DC7D",
},
PARENT_ARR: "#FC9A40",
PARENT_OBJ: "#59b8ff",
CHIL... | <mask> PRIMARY: "#4D4D4D",
<mask> TEXT_DANGER: "#db662e",
<mask> };
<mask>
<mask> export const darkTheme: DefaultTheme = {
<mask> ...fixedColors,
<mask> BLACK_SECONDARY: "#23272A",
<mask> SILVER_DARK: "#4D4D4D",
<mask> NODE_KEY: "#FAA81A",
<mask> OBJECT_KEY: "#59b8ff",
</s> seperate colors fro... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/constants/theme.ts |
...nodeColors.dark, | <mask> };
<mask>
<mask> export const darkTheme = {
<mask> ...fixedColors,
<mask> BLACK_SECONDARY: "#23272A",
<mask> SILVER_DARK: "#4D4D4D",
<mask> NODE_KEY: "#FAA81A",
<mask> OBJECT_KEY: "#59b8ff",
<mask> SIDEBAR_ICONS: "#8B8E90",
</s> seperate colors from array and object </s> remove export cons... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/constants/theme.ts |
export const lightTheme = { | <mask> TEXT_NORMAL: "#dcddde",
<mask> TEXT_POSITIVE: "hsl(139,calc(var(--saturation-factor, 1)*51.6%),52.2%)",
<mask> } as const;
<mask>
<mask> export const lightTheme: DefaultTheme = {
<mask> ...fixedColors,
<mask> BLACK_SECONDARY: "#F2F2F2",
<mask> SILVER_DARK: "#CCCCCC",
<mask> NODE_KEY: "#DC37... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/constants/theme.ts |
...nodeColors.light, | <mask> export const lightTheme = {
<mask> ...fixedColors,
<mask> BLACK_SECONDARY: "#F2F2F2",
<mask> SILVER_DARK: "#CCCCCC",
<mask> NODE_KEY: "#DC3790",
<mask> OBJECT_KEY: "#0260E8",
<mask> SIDEBAR_ICONS: "#6D6E70",
<mask>
</s> seperate colors from array and object </s> remove export const lightThe... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/constants/theme.ts |
type CustomTheme = typeof theme; | <mask> import "styled-components";
<mask>
<mask> declare module "styled-components" {
<mask> export interface DefaultTheme {
<mask> BLURPLE: string;
<mask> FULL_WHITE: string;
<mask> BLACK: string;
<mask> BLACK_LIGHT: string;
<mask> BLACK_DARK: string;
<mask> BLACK_PRIMARY: string;
... | [
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"ke... | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/typings/styled.d.ts |
declare module "styled-components" {
export interface DefaultTheme extends CustomTheme {} | <mask> NODE_KEY: string;
<mask> OBJECT_KEY: string;
<mask> SIDEBAR_ICONS: string;
<mask>
<mask> INTERACTIVE_NORMAL: string;
<mask> INTERACTIVE_HOVER: string;
<mask> INTERACTIVE_ACTIVE: string;
<mask> BACKGROUND_NODE: string;
<mask> BACKGROUND_TERTIARY: string;
<mask> BACKG... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/typings/styled.d.ts |
parent: "string" | "number" | "boolean" | "object" | "array" | "null" | false, | <mask> const addNodes = (
<mask> text: any,
<mask> width: number,
<mask> height: number,
<mask> parent: boolean,
<mask> isEmpty?: boolean
<mask> ) => {
<mask> let actualId = String(nodes.length + 1);
<mask> nodes = [
<mask> ...nodes,
</s> seperate col... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/utils/jsonParser.ts |
parent: parent === "array" || parent === "object" ? parent : false, | <mask> text: text,
<mask> width: width,
<mask> height: height,
<mask> data: {
<mask> isParent: parent,
<mask> childrenCount: parent ? 1 : 0,
<mask> isEmpty: isEmpty,
<mask> },
<mask> },
<mask> ];
</s> seperate... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/utils/jsonParser.ts |
parentId = addNodes(parentName, width, height, type); | <mask> }
<mask>
<mask> // add parent node
<mask> const { width, height } = calculateSize(parentName, true, isFolded);
<mask> parentId = addNodes(parentName, width, height, true);
<mask> bracketOpen = [...bracketOpen, { id: parentId, type: type }];
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/utils/jsonParser.ts |
objectsFromArray = [...objectsFromArray, objectsFromArrayId++];
} | <mask> } else {
<mask> notHaveParent = [...notHaveParent, parentId];
<mask> }
<mask> } else if (parentType === "array") {
<mask> objectsFromArray = [...objectsFromArray, objectsFromArrayId++];
<mask> }
<mask> children.forEach((branch, index, a... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/c8134fcda5d6935b1d04c37b0afaa848f6143029 | src/utils/jsonParser.ts |
const StyledWrapper = styled.span` | <mask> import React from "react";
<mask> import styled from "styled-components";
<mask>
<mask> const StyledWrapper = styled.div`
<mask> height: 100px;
<mask>
<mask> #carbonads {
<mask> width: 100%;
<mask> display: flex;
<mask> }
<mask>
</s> fix ads not appearing at next page </s> remove con... | [
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/cb90d73d7fa35468ddfa13fe4b4b35aeda5f5506 | src/components/CarbonAds/index.tsx |
height="100%" | <mask> <StyledEditorWrapper>
<mask> <ErrorContainer error={error} setError={setError} />
<mask> <StyledWrapper>
<mask> <Editor
<mask> height="auto"
<mask> defaultLanguage="json"
<mask> value={value}
<mask> theme={editorTheme}
<mask> opti... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/cb90d73d7fa35468ddfa13fe4b4b35aeda5f5506 | src/containers/JsonEditor/index.tsx |
<mask> align-items: center;
<mask> gap: 3rem;
<mask> `;
<mask>
<mask> const StyledCarbonWrapper = styled.div`
<mask> display: flex;
<mask> background: #111827;
<mask> border-radius: 5px;
<mask> overflow: hidden;
<mask> `;
<mask>
<mask> const StyledCarbon = styled.span`
<mask> display: flex;... | [
"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/cb90d73d7fa35468ddfa13fe4b4b35aeda5f5506 | src/pages/index.tsx | |
<StyledNavLink href="/editor">Editor</StyledNavLink> | <mask> <Head>
<mask> <title>JSON Visio - Directly onto graphs</title>
<mask> </Head>
<mask> <StyledNavbar>
<mask> <Link href="/editor" passHref>
<mask> <StyledNavLink>Editor</StyledNavLink>
<mask> </Link>
<mask> <Link href="#features" passHref>
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/cb90d73d7fa35468ddfa13fe4b4b35aeda5f5506 | src/pages/index.tsx |
<StyledButton
onClick={() => window.location.replace("/editor")}
disabled={isMobile}
> | <mask> Seamlessly visualize your JSON data{" "}
<mask> <StyledHighlightedText>instantly</StyledHighlightedText> into graphs.
<mask> </StyledSubTitle>
<mask> <StyledMinorTitle>Paste - Import - Fetch!</StyledMinorTitle>
<mask> <StyledButton onClick={() => push("/editor")} ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/cb90d73d7fa35468ddfa13fe4b4b35aeda5f5506 | src/pages/index.tsx |
const maxZoom = useConfig(state => state.maxZoom); | <mask> const GraphComponent = ({ isWidget, openModal, setSelectedNode }: LayoutProps) => {
<mask> const setConfig = useConfig(state => state.setConfig);
<mask> const setGraphValue = useGraph(state => state.setGraphValue);
<mask> const loading = useGraph(state => state.loading);
<mask> const layout = useCon... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/components/Graph/index.tsx |
let newHeight = 0;
let newWidth = 0;
layout?.children?.forEach(node => {
if (node.y + node.height > newHeight) newHeight = node.y + node.height;
if (node.x + node.width > newWidth) newWidth = node.x + node.width;
});
if (layout === "LEFT" || layout === "RIGH... | <mask>
<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> requestAnimationFrame(() => {
<mask> setTimeout(() => {
<mas... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/components/Graph/index.tsx |
[setConfig, setGraphValue] | <mask> }, 0);
<mask> });
<mask> }
<mask> },
<mask> [setGraphValue]
<mask> );
<mask>
<mask> const onCanvasClick = React.useCallback(() => {
<mask> const input = document.querySelector("input:focus") as HTMLInputElement;
<mask> if (input) input.blur();
</s> custom m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/components/Graph/index.tsx |
minScale={maxZoom} | <mask> <StyledEditorWrapper isWidget={isWidget}>
<mask> {loading && <Loading message="Painting graph..." />}
<mask> <TransformWrapper
<mask> maxScale={2}
<mask> minScale={0.5}
<mask> initialScale={0.7}
<mask> wheel={{ step: 0.05 }}
<mask> zoomAnimation={{ ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/components/Graph/index.tsx |
maxZoom: 0.07, | <mask>
<mask> const initialStates = {
<mask> json: defaultJson,
<mask> cursorMode: "move" as "move" | "navigation",
<mask> layout: "RIGHT" as CanvasDirection,
<mask> expand: true,
<mask> hideEditor: false,
</s> custom maxZoom per canvas size </s> remove [setGraphValue]
</s> add [setConfig, s... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/hooks/store/useConfig.tsx |
if (zoomPanPinch) zoomPanPinch.centerView(get().maxZoom); | <mask> }
<mask> },
<mask> centerView: () => {
<mask> const zoomPanPinch = get().zoomPanPinch;
<mask> if (zoomPanPinch) zoomPanPinch.centerView(0.6);
<mask> },
<mask> setConfig: (setting: keyof Config, value: unknown) => set({ [setting]: value }),
<mask> }));
<mask>
<mask> export default u... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/dc3185d5cdf376294f7da8fcceec39a6cd504916 | src/hooks/store/useConfig.tsx |
<mask> });
<mask>
<mask> const handleNodeClick = React.useCallback(
<mask> (e: React.MouseEvent<SVGElement>, data: NodeData) => {
<mask> console.log(data);
<mask> if (setSelectedNode) setSelectedNode(data.text);
<mask> if (openNodeModal) openNodeModal();
<mask> },
<mask> [ope... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/components/Graph/index.tsx | |
const handleEdgeClick = React.useCallback(
(e: React.MouseEvent<SVGElement>, data: EdgeData) => {
let curFromId = data.from;
let curToId = data.to;
const path = [curFromId, curToId];
while (curFromId !== "1") {
curToId = curFromId;
curFromId = edges.find(({ to }) => to === ... | <mask> },
<mask> [openNodeModal, setSelectedNode]
<mask> );
<mask>
<mask> const handleEdgeClick = React.useCallback((e: React.MouseEvent<SVGElement>, data: EdgeData) => {
<mask> const fromIndex = Number(data.from) - 1;
<mask> const toIndex = Number(data.to) - 1;
<mask> console.log(`${fr... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/components/Graph/index.tsx |
import dynamic from "next/dynamic"; | <mask> import React from "react";
<mask> import toast from "react-hot-toast";
<mask> import { FiCopy } from "react-icons/fi";
<mask> import { vscDarkPlus } from "react-syntax-highlighter/dist/cjs/styles/prism";
<mask> import { vs } from "react-syntax-highlighter/dist/cjs/styles/prism";
<mask> import { Button } fr... | [
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx |
import { vscDarkPlus } from "react-syntax-highlighter/dist/cjs/styles/prism";
import { vs } from "react-syntax-highlighter/dist/cjs/styles/prism"; | <mask> import toast from "react-hot-toast";
<mask> import { FiCopy } from "react-icons/fi";
<mask> import { Button } from "src/components/Button";
<mask> import { Modal } from "src/components/Modal";
<mask> import useStored from "src/store/useStored";
<mask>
<mask> const SyntaxHighlighter = dynamic(
</s> feat:... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx |
import useStored from "src/store/useStored";
const SyntaxHighlighter = dynamic(
() => import("react-syntax-highlighter/dist/esm/prism-async").then(c => c),
{
ssr: false,
}
); | <mask> import toast from "react-hot-toast";
<mask> import { FiCopy } from "react-icons/fi";
<mask> import { Button } from "src/components/Button";
<mask> import { Modal } from "src/components/Modal";
<mask> import styled from "styled-components";
<mask>
<mask> interface EdgeModalProps {
<mask> selectedEdge: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx |
<mask> visible: boolean;
<mask> closeModal: () => void;
<mask> }
<mask>
<mask> const StyledTextarea = styled.textarea`
<mask> resize: none;
<mask> width: 100%;
<mask> min-height: 200px;
<mask>
<mask> padding: 10px;
<mask> background: ${({ theme }) => theme.BACKGROUND_TERTIARY};
<mask> colo... | [
"keep",
"keep",
"keep",
"keep",
"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/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx | |
const lightmode = useStored(state => state.lightmode); | <mask> closeModal: () => void;
<mask> }
<mask>
<mask> export const EdgeModal = ({ selectedEdge, visible, closeModal }: EdgeModalProps) => {
<mask> const handleClipboard = () => {
<mask> toast.success("Content copied to clipboard!");
<mask> navigator.clipboard.writeText(selectedEdge);
<mask> clo... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx |
<SyntaxHighlighter
style={lightmode ? vs : vscDarkPlus}
customStyle={{
borderRadius: "4px",
fontSize: "14px",
margin: "0",
}}
language="javascript"
>
{selectedEdge}
</SyntaxHighlighter> | <mask> return (
<mask> <Modal visible={visible} setVisible={closeModal}>
<mask> <Modal.Header>Edge Content</Modal.Header>
<mask> <Modal.Content>
<mask> <StyledTextarea defaultValue={selectedEdge} readOnly />
<mask> </Modal.Content>
<mask> <Modal.Controls setVisible={closeMod... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/de667d05fcf9fa4122f28d7e5e392c90b75834b6 | src/containers/Modals/EdgeModal/index.tsx |
<mask> import React from "react";
<mask> import styled from "styled-components";
<mask> import { Anchor, Paper, Text } from "@mantine/core";
<mask> import Editor, { loader, Monaco } from "@monaco-editor/react";
<mask> import debounce from "lodash.debounce";
<mask> import { Loading } from "src/components/Loading";... | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/components/MonacoEditor/index.tsx | |
height="100%" | <mask> onChange={handleChange}
<mask> loading={<Loading message="Loading Editor..." />}
<mask> beforeMount={handleEditorWillMount}
<mask> defaultLanguage="json"
<mask> height="82vh"
<mask> />
<mask> <Anchor href="https://editor.herowand.com">
<mask> <P... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/components/MonacoEditor/index.tsx |
<mask> beforeMount={handleEditorWillMount}
<mask> defaultLanguage="json"
<mask> height="82vh"
<mask> />
<mask> <Anchor href="https://editor.herowand.com">
<mask> <Paper p="sm" h="80px" shadow="md" withBorder>
<mask> <Text align="center">Visualize other data f... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/components/MonacoEditor/index.tsx | |
import { Button } from "@mantine/core"; | <mask> import dynamic from "next/dynamic";
<mask> import Head from "next/head";
<mask> import Link from "next/link";
<mask> import Script from "next/script";
<mask> import { Anchor, Button, Image, Paper } from "@mantine/core";
<mask> import { AiOutlineRight, AiTwotoneStar } from "react-icons/ai";
<mask> import {... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/containers/Home/index.tsx |
<mask> GET IT ON VS CODE
<mask> </Button>
<mask> </Link>
<mask> </Styles.StyledButtonWrapper>
<mask> <Anchor href="https://editor.herowand.com/?ref=jsoncrack" target="_blank">
<mask> <Paper shadow="xs" withBorder>
<mask> <Image src="assets/herowand_banner.webp" width... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/containers/Home/index.tsx | |
import { HerowandModal } from "src/containers/Modals/HerowandModal"; | <mask> import { GoogleAnalytics } from "src/components/GoogleAnalytics";
<mask> import GlobalStyle from "src/constants/globalStyle";
<mask> import { darkTheme, lightTheme } from "src/constants/theme";
<mask> import { ModalController } from "src/containers/ModalController";
<mask> import useStored from "src/store/u... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/pages/_app.tsx |
<HerowandModal /> | <mask> <GoogleAnalytics />
<mask> <ThemeProvider theme={lightmode ? lightTheme : darkTheme}>
<mask> <GlobalStyle />
<mask> <MantineProvider
<mask> withGlobalStyles
<mask> withNormalizeCSS
<mask> withCSSVariables
<mask> theme={{
... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/pages/_app.tsx |
herowand: false, | <mask> settings: false,
<mask> share: false,
<mask> login: false,
<mask> premium: false,
<mask> };
<mask>
<mask> type ModalType = keyof typeof initialStates;
<mask>
</s> replace herowand ads to news modal </s> remove <Anchor href="https://editor.herowand.com/?ref=jsoncrack" target="_blank">
... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e10cfa6e14f40874088447b415f78fed12850ba2 | src/store/useModal.tsx |
import {
searchQuery,
cleanupHighlight,
highlightMatchedNodes,
} from "src/utils/search";
| <mask> import { useConfig } from "src/hocs/config";
<mask>
<mask> type Content = { value: string; debounced: string };
<mask>
<mask> export const useFocusNode = () => {
<mask> const [content, setContent] = React.useState({
<mask> value: "",
</s> Highlight all the matched nodes after performing search </... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
const matchedNodes: NodeListOf<Element> = searchQuery( | <mask> React.useEffect(() => {
<mask> if (!settings.zoomPanPinch) return;
<mask> const zoomPanPinch = settings.zoomPanPinch.instance.wrapperComponent;
<mask>
<mask> const node = document.querySelector(
<mask> `span[data-key*='${content.debounced}' i]`
<mask> );
<mask>
<mask> docum... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
const firstMatchedNode: Element | null = matchedNodes[0] || null; | <mask>
<mask> const matchedNodes: NodeListOf<Element> = searchQuery(
<mask> `span[data-key*='${content.debounced}' i]`
<mask> );
<mask>
<mask> cleanupHighlight();
<mask>
<mask> if (zoomPanPinch && firstMatchedNode && firstMatchedNode.parentElement) {
<mask> const newScale = 1;
<... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
cleanupHighlight(); | <mask> const node = document.querySelector(
<mask> `span[data-key*='${content.debounced}' i]`
<mask> );
<mask>
<mask> document
<mask> .querySelector("foreignObject.searched")
<mask> ?.classList.remove("searched");
<mask>
<mask> if (zoomPanPinch && node && node.parentElement)... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
if (zoomPanPinch && firstMatchedNode && firstMatchedNode.parentElement) { | <mask> document
<mask> .querySelector("foreignObject.searched")
<mask> ?.classList.remove("searched");
<mask>
<mask> if (zoomPanPinch && node && node.parentElement) {
<mask> const newScale = 1;
<mask> const x = Number(node.getAttribute("data-x"));
<mask> const y = Number(n... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
const x = Number(firstMatchedNode.getAttribute("data-x"));
const y = Number(firstMatchedNode.getAttribute("data-y")); | <mask> ?.classList.remove("searched");
<mask>
<mask> if (zoomPanPinch && node && node.parentElement) {
<mask> const newScale = 1;
<mask> const x = Number(node.getAttribute("data-x"));
<mask> const y = Number(node.getAttribute("data-y"));
<mask>
<mask> const newPositionX =
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
firstMatchedNode.getBoundingClientRect().width; | <mask> const y = Number(node.getAttribute("data-y"));
<mask>
<mask> const newPositionX =
<mask> (zoomPanPinch.offsetLeft - x) * newScale +
<mask> node.getBoundingClientRect().width;
<mask> const newPositionY =
<mask> (zoomPanPinch.offsetTop - y) * newScale +
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
firstMatchedNode.getBoundingClientRect().height; | <mask> (zoomPanPinch.offsetLeft - x) * newScale +
<mask> node.getBoundingClientRect().width;
<mask> const newPositionY =
<mask> (zoomPanPinch.offsetTop - y) * newScale +
<mask> node.getBoundingClientRect().height;
<mask>
<mask> node.parentElement.parentElement
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
highlightMatchedNodes(matchedNodes); | <mask> const newPositionY =
<mask> (zoomPanPinch.offsetTop - y) * newScale +
<mask> node.getBoundingClientRect().height;
<mask>
<mask> node.parentElement.parentElement
<mask> ?.closest("foreignObject")
<mask> ?.classList.toggle("searched");
<mask>
<mask> sett... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e671358c012189ed64594155e00b320ef9bd3652 | src/hooks/useFocusNode.tsx |
let objectsFromArrayId = 0; | <mask>
<mask> let parentName: string = "";
<mask> let bracketOpen: { id: string; type: string }[] = [];
<mask> let objectsFromArray: number[] = [];
<mask> let notHaveParent: string[] = [];
<mask> let brothersNode: [string, string][] = [];
<mask> let brothersParentId: string | undefined =... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
objectsFromArray[objectsFromArray.length - 1] | <mask> let findBrothersNode = brothersNodeProps.find(
<mask> e =>
<mask> e.parentId === brothersParentId &&
<mask> e.objectsFromArrayId ===
<mask> objectsFromArray[objectsFromArray.length - 2]
<mask> );
<mask> if ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
if (findBrothersNode) { | <mask> e.parentId === brothersParentId &&
<mask> e.objectsFromArrayId ===
<mask> objectsFromArray[objectsFromArray.length - 2]
<mask> );
<mask> if (findBrothersNode && parentType !== "array") {
<mask> let ModifyNodes = [...nod... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
objectsFromArray = [...objectsFromArray, objectsFromArrayId++];
} | <mask> } else {
<mask> notHaveParent = [...notHaveParent, parentId];
<mask> }
<mask> } else if (parentType === "array") {
<mask> objectsFromArray = [...objectsFromArray, objectsFromArray.length + 1];
<mask> }
<mask>
<mask> children.forEach((bran... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
<mask> });
<mask>
<mask> if (type !== "property") {
<mask> // when children end
<mask> if (parentType !== "array") {
<mask> if (bracketOpen.length > 0) {
<mask> let newBracketOpen = [...bracketOpen];
<mask> newBracketOpen.splice(newBra... | [
"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/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts | |
objectsFromArray[objectsFromArray.length - 1] | <mask> let findBrothersNode = brothersNodeProps.find(
<mask> e =>
<mask> e.parentId === brothersParentId &&
<mask> e.objectsFromArrayId ===
<mask> objectsFromArray[objectsFromArray.length - 2]
<mask> );
<mask> if ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
if (findBrothersNode) { | <mask> e.parentId === brothersParentId &&
<mask> e.objectsFromArrayId ===
<mask> objectsFromArray[objectsFromArray.length - 2]
<mask> );
<mask> if (findBrothersNode && parentType !== "array") {
<mask> let ModifyNodes = [...nod... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
// close brackets
if (parentType !== "array") {
if (bracketOpen.length > 0) {
let newBracketOpen = [...bracketOpen];
newBracketOpen.splice(newBracketOpen.length - 1);
bracketOpen = [...newBracketOpen];
}
} else if (parentTyp... | <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> if (ModifyNodes[myIndex])... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
console.log(nodes); | <mask> addNodes(text, width, height, false);
<mask> }
<mask> }
<mask>
<mask> return { nodes, edges };
<mask> } catch (error) {
<mask> console.error(error);
<mask> return {
</s> fix: different brothers node in array is not work correctly </s> remove objectsFromArray = ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e772153cd3b250bb734baef786fd07dfc1d69f43 | src/utils/jsonParser.ts |
<Styles.StyledIframge src="https://jsoncrack.com/widget"></Styles.StyledIframge> | <mask> visitors, blog readers or anybody else!
<mask> </Styles.StyledMinorTitle>
<mask> </Styles.StyledSectionArea>
<mask> <div>
<mask> <Styles.StyledIframge src="https://jsoncrack.com/widget?json=%5B%5B%22squadName%22%2C%22homeTown%22%2C%22formed%22%2C%22secretBase%22%2C%22active%22%2C... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e7fe70e6280b877a2897976bf5c03005379bd778 | src/containers/Home/index.tsx |
const { query, push } = useRouter(); | <mask> };
<mask> }
<mask>
<mask> const WidgetPage = () => {
<mask> const [json, setJson] = React.useState(defaultJson);
<mask>
<mask> React.useEffect(() => {
<mask> if (query.json)
<mask> setJson(
<mask> JSON.stringify({
</s> display warning for embed query json </s> remove const ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e7fe70e6280b877a2897976bf5c03005379bd778 | src/pages/Widget/index.tsx |
<mask> const collapsedEdges = useGraph(state => state.collapsedEdges);
<mask> const loading = useGraph(state => state.loading);
<mask> const setGraphValue = useGraph(state => state.setGraphValue);
<mask> const centerView = useConfig(state => state.centerView);
<mask> const { push } = useRouter();
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e7fe70e6280b877a2897976bf5c03005379bd778 | src/pages/Widget/index.tsx | |
import { TextRenderer } from "./TextRenderer"; | <mask> import React from "react";
<mask> import { CustomNodeProps } from "src/components/CustomNode";
<mask> import * as Styled from "./styles";
<mask>
<mask> const Node: React.FC<CustomNodeProps> = ({ node, x, y }) => {
<mask> const { text, width, height, data } = node;
<mask> if (data.isEmpty) return null... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/components/CustomNode/ObjectNode.tsx |
<TextRenderer>{JSON.stringify(val[1])}</TextRenderer> | <mask> >
<mask> <Styled.StyledKey objectKey>
<mask> {JSON.stringify(val[0]).replaceAll('"', "")}:{" "}
<mask> </Styled.StyledKey>
<mask> <Styled.StyledLinkItUrl>{JSON.stringify(val[1])}</Styled.StyledLinkItUrl>
<mask> </Styled.StyledRow>
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/components/CustomNode/ObjectNode.tsx |
import { TextRenderer } from "./TextRenderer"; | <mask> import useGraph from "src/store/useGraph";
<mask> import useStored from "src/store/useStored";
<mask> import { isContentImage } from "src/utils/core/calculateNodeSize";
<mask> import * as Styled from "./styles";
<mask>
<mask> const StyledExpand = styled.button`
<mask> pointer-events: all;
<mask> dis... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/components/CustomNode/TextNode.tsx |
<TextRenderer>{JSON.stringify(text).replaceAll('"', "")}</TextRenderer> | <mask> data-y={y}
<mask> data-key={JSON.stringify(text)}
<mask> >
<mask> <Styled.StyledKey parent={isParent} type={type}>
<mask> <Styled.StyledLinkItUrl>
<mask> {JSON.stringify(text).replaceAll('"', "")}
<mask> </Styled.StyledLinkItUrl>
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/components/CustomNode/TextNode.tsx |
const isURL =
/(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>
<mask> export type FileStates = typeof initialStates;
<mask>
<mask> const isURL = new RegExp(
<mask> /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/
<mask> );
<mask>
<mask> const debouncedUpdateJson = debounce(
<mask> (value... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/store/useFile.ts |
const isImageURL = /(https?:\/\/.*\.(?:png|jpg|gif))/i.test(value); | <mask>
<mask> export const isContentImage = (value: string | [string, string][]) => {
<mask> if (typeof value !== "string") return false;
<mask>
<mask> const isURL = /(https?:\/\/.*\.(?:png|jpg|gif))/i.test(value);
<mask> const isBase64 = value.startsWith("data:image/") && value.includes("base64");
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/utils/core/calculateNodeSize.ts |
return isImageURL || isBase64; | <mask> if (typeof value !== "string") return false;
<mask>
<mask> const isURL = /(https?:\/\/.*\.(?:png|jpg|gif))/i.test(value);
<mask> const isBase64 = value.startsWith("data:image/") && value.includes("base64");
<mask> return isURL || isBase64;
<mask> };
<mask>
<mask> const sizeCache = new Map<strin... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/e9769a5192a28d5219eea141e3f8a51a809c31d5 | src/utils/core/calculateNodeSize.ts |
import React, { useEffect } from "react"; | <mask> import React from "react";
<mask> import {
<mask> AiOutlineFullscreen,
<mask> AiOutlineMinus,
<mask> AiOutlinePlus,
<mask> } from "react-icons/ai";
</s> Add node tools in tools </s> remove import { MdCenterFocusWeak } from "react-icons/md";
</s> add import {
MdCenterFocusWeak,
MdOutlineCopyAll,... | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
AiOutlineNodeCollapse,
AiOutlineNodeExpand, | <mask> AiOutlineMinus,
<mask> AiOutlinePlus,
<mask> } from "react-icons/ai";
<mask> import { FiDownload } from "react-icons/fi";
<mask> import { HiOutlineSun, HiOutlineMoon } from "react-icons/hi";
<mask> import {
<mask> MdCenterFocusWeak,
<mask> MdOutlineCopyAll,
</s> Add node tools in tools </s> remo... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
import {
MdCenterFocusWeak,
MdOutlineCopyAll,
MdOutlineRestartAlt,
} from "react-icons/md"; | <mask> AiOutlinePlus,
<mask> } from "react-icons/ai";
<mask> import { FiDownload } from "react-icons/fi";
<mask> import { HiOutlineSun, HiOutlineMoon } from "react-icons/hi";
<mask> import { MdCenterFocusWeak } from "react-icons/md";
<mask> import { SearchInput } from "src/components/SearchInput";
<mask> impor... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
import useNodeTools from "src/hooks/store/useNodeTools";
import { collapseNodes, expandNodes, restartNodes } from "./NodeTools"; | <mask> import { DownloadModal } from "../Modals/DownloadModal";
<mask> import useStored from "src/hooks/store/useStored";
<mask>
<mask> export const StyledTools = styled.div`
<mask> display: flex;
<mask> align-items: center;
<mask> gap: 4px;
<mask> flex-direction: row-reverse;
</s> Add node tools in t... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
const [expand, setExpand] = React.useState(true);
const [isLastNode, setIsLastNode] = React.useState(false); | <mask> `;
<mask>
<mask> export const Tools: React.FC = () => {
<mask> const [isDownloadVisible, setDownloadVisible] = React.useState(false);
<mask> const lightmode = useStored((state) => state.lightmode);
<mask> const setLightTheme = useStored((state) => state.setLightTheme);
<mask>
<mask> const [perf... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
const selectedNodeColor = "#00D69D"; | <mask> const centerView = useConfig((state) => state.centerView);
<mask> const toggleEditor = () => setConfig("hideEditor", !hideEditor);
<mask> const toggleTheme = () => setLightTheme(!lightmode);
<mask>
<mask> return (
<mask> <StyledTools>
<mask> <StyledToolElement aria-label="fullscreen" on... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
{selectedNode && (
<>
<StyledToolElement
aria-label="copy"
onClick={() => setNodeTools("copySelectedNode", true)}
>
<MdOutlineCopyAll color={selectedNodeColor} />
</StyledToolElement>
<StyledToolElement
aria-label="res... | <mask> <StyledToolElement aria-label="switch theme" onClick={toggleTheme}>
<mask> {lightmode ? <HiOutlineMoon /> : <HiOutlineSun />}
<mask> </StyledToolElement>
<mask> {!performanceMode && <SearchInput />}
<mask> {!performanceMode && (
<mask> <StyledToolElement
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f0be095c41721bf5c237f8f1721e305c0fbe0381 | src/containers/Editor/Tools.tsx |
if (!(object instanceof Object)) object = [object];
| <mask>
<mask> function generateChildren(object: Object, nextId: () => string) {
<mask> return Object.entries(object)
<mask> .filter(filterChild)
<mask> .flatMap(([k, v]) => {
<mask> // const isObject = v instanceof Object && !Array.isArray(v);
<mask>
<mask> // if (isObject) {
</s> impro... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f6eb5db83da3b593e8cd1cb68f48f507b36cfcca | src/utils/json-editor-parser.ts |
.flatMap(([k, v]) => {
// const isObject = v instanceof Object && !Array.isArray(v);
// if (isObject) {
// return [
// {
// id: nextId(),
// text: k,
// parent: true,
// children: generateChildren(v, nextId),
// },
... | <mask>
<mask> function generateChildren(object: Object, nextId: () => string) {
<mask> return Object.entries(object)
<mask> .filter(filterChild)
<mask> .flatMap(([k, v]) => [
<mask> {
<mask> id: nextId(),
<mask> text: k,
<mask> parent: true,
<mask> children: ex... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f6eb5db83da3b593e8cd1cb68f48f507b36cfcca | src/utils/json-editor-parser.ts |
return String(object);
| <mask> const entries = Object.entries(object).filter(filterValues);
<mask> return Object.fromEntries(entries);
<mask> }
<mask>
<mask> return object.toString();
<mask> }
<mask>
<mask> const extract = (
<mask> os: string[] | object[] | null,
<mask> nextId = (
</s> improve algorithm for null a... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f6eb5db83da3b593e8cd1cb68f48f507b36cfcca | src/utils/json-editor-parser.ts |
<mask> };
<mask>
<mask> export const parser = (input: string | string[]) => {
<mask> try {
<mask> // if (typeof input !== "object") input = JSON.parse(input);
<mask> if (!Array.isArray(input)) input = [input];
<mask>
<mask> const mappedElements = extract(input);
<mask> const res = [...flatt... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f6eb5db83da3b593e8cd1cb68f48f507b36cfcca | src/utils/json-editor-parser.ts | |
setIsPrivate(data?.private ?? true); | <mask> const [isPrivate, setIsPrivate] = React.useState(false);
<mask> const [isUpdating, setIsUpdating] = React.useState(false);
<mask>
<mask> React.useEffect(() => {
<mask> setIsPrivate(data?.private ?? false);
<mask> }, [data]);
<mask>
<mask> const handleSaveJson = React.useCallback(async () ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f7ffa43cf1a3200146cae5d5da620c65a66aff16 | src/containers/Editor/BottomBar.tsx |
<mask>
<mask> const setPrivate = async () => {
<mask> try {
<mask> if (!query.json) return handleSaveJson();
<mask> if (!isPrivate && user?.type === 0) {
<mask> return window.open("https://jsoncrack.com/pricing", "_blank");
<mask> }
<mask>
<mask> setIsUpdating(true);
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f7ffa43cf1a3200146cae5d5da620c65a66aff16 | src/containers/Editor/BottomBar.tsx | |
import { Tools } from "src/containers/Editor/LiveEditor/Tools"; | <mask> import React from "react";
<mask> import { GraphCanvas } from "src/containers/Editor/LiveEditor/GraphCanvas";
<mask> import { Tools } from "src/containers/Editor/Tools";
<mask> import styled from "styled-components";
<mask>
<mask> const StyledLiveEditor = styled.div`
<mask> position: relative;
<mask> ... | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f7ffa43cf1a3200146cae5d5da620c65a66aff16 | src/containers/Editor/LiveEditor/index.tsx |
<mask> <StyledPricingCardDetails>
<mask> <StyledPricingCardDetailsItem>
<mask> Create and share up to 200 files
<mask> </StyledPricingCardDetailsItem>
<mask> <StyledPricingCardDetailsItem>Store private JSON</StyledPricingCardDetailsItem>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/f7ffa43cf1a3200146cae5d5da620c65a66aff16 | src/containers/PricingCards/index.tsx | |
<mask> "react-hot-toast": "^2.4.0",
<mask> "react-icons": "^4.6.0",
<mask> "react-in-viewport": "^1.0.0-alpha.28",
<mask> "react-linkify-it": "^1.0.7",
<mask> "react-twitter-embed": "^4.0.4",
<mask> "react-zoom-pan-pinch": "^2.1.3",
<mask> "reaflow": "^5.0.7",
<mask> "styled-comp... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/fb6d8a55f5872543e9483794a1c94f07a3ffe3f1 | package.json | |
<mask> HiOutlineDownload,
<mask> HiOutlineSearchCircle,
<mask> } from "react-icons/hi";
<mask> import { SiVisualstudiocode } from "react-icons/si";
<mask> import { TwitterTweetEmbed } from "react-twitter-embed";
<mask> import { CarbonAds } from "src/components/CarbonAds";
<mask> import { Producthunt } from "... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/fb6d8a55f5872543e9483794a1c94f07a3ffe3f1 | src/containers/Home/index.tsx | |
import Script from "next/script"; | <mask> import { defaultJson } from "src/constants/data";
<mask> import { GoalsModal } from "src/containers/Modals/GoalsModal";
<mask> import pkg from "../../../package.json";
<mask> import * as Styles from "./styles";
<mask>
<mask> const Navbar = () => (
<mask> <Styles.StyledNavbar>
<mask> <Styles.Styled... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AykutSarac/jsoncrack.com/commit/fb6d8a55f5872543e9483794a1c94f07a3ffe3f1 | src/containers/Home/index.tsx |
private _doubleClick: Nullable<Control> = null;
private _lockMainSelection: boolean = false;
| <mask> private _liveRenderObserver: Nullable<Observer<AdvancedDynamicTexture>>;
<mask> private _guiRenderObserver: Nullable<Observer<AdvancedDynamicTexture>>;
<mask> private _mainSelection: Nullable<Control> = null;
<mask> private _selectionDepth = 0;
<mask> private _doubleClick : Nullable<Cont... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/00e673ddab5b3be0eb45c36574359a6f809b25a5 | guiEditor/src/diagram/workbench.tsx |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.