Skip to content

Commit b71e437

Browse files
committed
chore: add displayName.
1 parent 6e152b8 commit b71e437

File tree

14 files changed

+61
-14
lines changed

14 files changed

+61
-14
lines changed

core/src/arrow/TriangleArrow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ export function TriangleArrow(props: TriangleArrowProps) {
1515
</svg>
1616
);
1717
}
18+
19+
TriangleArrow.displayName = 'JVR.TriangleArrow';

core/src/arrow/TriangleSolidArrow.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ export function TriangleSolidArrow(props: TriangleSolidArrowProps) {
1515
</svg>
1616
);
1717
}
18+
19+
TriangleSolidArrow.displayName = 'JVR.TriangleSolidArrow';

core/src/comps/ellipsis.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ export const Ellipsis: FC<PropsWithChildren<EllipsisProps>> = ({ style, render,
1515
</span>
1616
);
1717
};
18+
19+
Ellipsis.displayName = 'JVR.Ellipsis';

core/src/comps/meta.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ export function Meta(props: MetaProps) {
3131
</Label>
3232
);
3333
}
34+
35+
Meta.displayName = 'JVR.Meta';

core/src/copied.tsx

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,21 @@ export function Copied<T>(props: CopiedProps<T>) {
1313
const [copied, setCopied] = useState(false);
1414
const click = (event: React.MouseEvent<SVGSVGElement, MouseEvent>) => {
1515
event.stopPropagation();
16-
let copyText = JSON.stringify(text || '', (key, value) => {
17-
if (typeof value === 'bigint') {
18-
return value.toString()
19-
}
20-
return value
21-
}, 2);
16+
let copyText = JSON.stringify(
17+
text || '',
18+
(key, value) => {
19+
if (typeof value === 'bigint') {
20+
return value.toString();
21+
}
22+
return value;
23+
},
24+
2,
25+
);
2226

2327
if (text === Infinity) copyText = Infinity;
2428

25-
navigator.clipboard.writeText(copyText)
29+
navigator.clipboard
30+
.writeText(copyText)
2631
.then(() => {
2732
onCopied && onCopied(copyText, text);
2833
setCopied(true);
@@ -31,20 +36,20 @@ export function Copied<T>(props: CopiedProps<T>) {
3136
clearTimeout(timer);
3237
}, 3000);
3338
})
34-
.catch((error) => {})
39+
.catch((error) => {});
3540
};
36-
const defalutStyle = { ...style, cursor: 'pointer',verticalAlign: 'middle', marginLeft: 5 } as React.CSSProperties;
41+
const defalutStyle = { ...style, cursor: 'pointer', verticalAlign: 'middle', marginLeft: 5 } as React.CSSProperties;
3742
const svgProps: React.SVGProps<SVGSVGElement> = {
38-
height: '1em',
43+
height: '1em',
3944
width: '1em',
4045
fill: 'var(--w-rjv-copied-color, currentColor)',
4146
onClick: click,
4247
style: defalutStyle,
4348
className: 'w-rjv-copied',
4449
...reset,
45-
}
50+
};
4651
if (render) return render({ ...props, ...svgProps });
47-
if (copied) {
52+
if (copied) {
4853
return (
4954
<svg viewBox="0 0 32 36" {...svgProps} fill="var(--w-rjv-copied-success-color, #28a745)">
5055
<path d="M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"></path>
@@ -56,4 +61,6 @@ export function Copied<T>(props: CopiedProps<T>) {
5661
<path d="M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"></path>
5762
</svg>
5863
);
59-
}
64+
}
65+
66+
Copied.displayName = 'JVR.Copied';

core/src/editor/countInfoExtra.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ export function CountInfoExtra<T extends object>(props: CountInfoExtraProps<T>)
7979
</Fragment>
8080
);
8181
}
82+
83+
CountInfoExtra.displayName = 'JVR.CountInfoExtra';

core/src/editor/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ const JsonViewEditor = forwardRef<HTMLDivElement, JsonViewEditorProps<object>>((
5656
return <JsonView {...reset} displayDataTypes={false} components={comps} ref={ref} />;
5757
});
5858

59+
JsonViewEditor.displayName = 'JVR.JsonViewEditor';
60+
5961
export default JsonViewEditor;

core/src/editor/objectKey.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,5 @@ export const ObjectKey: FC<ObjectKeyProps<object>> = (props) => {
119119

120120
return <Label className={className} {...reset} autoFocus={editable} {...spanProps} ref={$edit} />;
121121
};
122+
123+
ObjectKey.displayName = 'JVR.ObjectKey';

core/src/editor/value.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,5 @@ export function ReValue<T extends object>(props: ReValueProps<T>) {
168168
</Fragment>
169169
);
170170
}
171+
172+
ReValue.displayName = 'JVR.ReValue';

core/src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ const JsonView = forwardRef<HTMLDivElement, JsonViewProps<object>>((props, ref)
8282
return <RootNode className={cls} value={value} {...reset} ref={ref} keyid={keyid} style={defaultStyle} />;
8383
});
8484

85+
JsonView.displayName = 'JVR.JsonView';
86+
8587
export default JsonView;

0 commit comments

Comments
 (0)