Skip to content

Commit c0b6361

Browse files
committed
style fix format on files, and interface error
Signed-off-by: Ricardo Silva <rephyrus0877@protonmail.com>
1 parent 7712f92 commit c0b6361

File tree

7 files changed

+120
-123
lines changed

7 files changed

+120
-123
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ logo
1313
build
1414
src/external
1515

16+
LICENSE.md
Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
/********************************************************************************
2-
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3-
*
4-
* See the NOTICE file(s) distributed with this work for additional
5-
* information regarding copyright ownership.
6-
*
7-
* This program and the accompanying materials are made available under the
8-
* terms of the Eclipse Public License v. 2.0 which is available at
9-
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
10-
*
11-
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
12-
********************************************************************************/
13-
14-
import React from "react";
15-
import ReactDOM from "react-dom";
16-
17-
interface SpinnerTemplateProps {
18-
fullScreen?: boolean; // overlay ->true, inline component -> false
19-
className?: string;
20-
show?: boolean;
21-
}
22-
23-
const SpinnerTemplate: React.FC<SpinnerTemplateProps> = ({
24-
fullScreen = true,
25-
className = "",
26-
show = true,
27-
}) => {
28-
if (!show) {
29-
return null;
30-
}
31-
32-
const spinnerElement = <Spinner className={className} />;
33-
34-
if (fullScreen) {
35-
return ReactDOM.createPortal(
36-
<div className="bg-transparent-400 absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center text-white">
37-
<div className="bg-transparent-400 flex max-h-screen w-1/3 flex-col items-center justify-center p-4">
38-
<div className="justify-center overflow-hidden p-2">
39-
{spinnerElement}
40-
</div>
41-
</div>
42-
</div>,
43-
document.getElementById("modal-root") as HTMLElement
44-
);
45-
}
46-
47-
return (
48-
<div className={`flex items-center justify-center py-4 ${className}`}>
49-
{spinnerElement}
50-
</div>
51-
);
52-
};
53-
54-
const Spinner: React.FC<{ className?: string }> = ({ className = "" }) => {
55-
return (
56-
<div className={`spinner-container ${className}`}>
57-
<div className="loading-spinner"></div>
58-
</div>
59-
);
60-
};
61-
62-
export { Spinner };
63-
export default SpinnerTemplate;
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License v. 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0, or the W3C Software Notice and
10+
*
11+
* SPDX-License-Identifier: EPL-2.0 OR W3C-20150513
12+
********************************************************************************/
13+
14+
import React from "react";
15+
import ReactDOM from "react-dom";
16+
17+
interface SpinnerTemplateProps {
18+
fullScreen?: boolean; // overlay ->true, inline component -> false
19+
className?: string;
20+
show?: boolean;
21+
}
22+
23+
const SpinnerTemplate: React.FC<SpinnerTemplateProps> = ({
24+
fullScreen = true,
25+
className = "",
26+
show = true,
27+
}) => {
28+
if (!show) {
29+
return null;
30+
}
31+
32+
const spinnerElement = <Spinner className={className} />;
33+
34+
if (fullScreen) {
35+
return ReactDOM.createPortal(
36+
<div className="bg-transparent-400 absolute left-0 top-0 z-10 flex h-full w-full items-center justify-center text-white">
37+
<div className="bg-transparent-400 flex max-h-screen w-1/3 flex-col items-center justify-center p-4">
38+
<div className="justify-center overflow-hidden p-2">
39+
{spinnerElement}
40+
</div>
41+
</div>
42+
</div>,
43+
document.getElementById("modal-root") as HTMLElement
44+
);
45+
}
46+
47+
return (
48+
<div className={`flex items-center justify-center py-4 ${className}`}>
49+
{spinnerElement}
50+
</div>
51+
);
52+
};
53+
54+
const Spinner: React.FC<{ className?: string }> = ({ className = "" }) => {
55+
return (
56+
<div className={`spinner-container ${className}`}>
57+
<div className="loading-spinner"></div>
58+
</div>
59+
);
60+
};
61+
62+
export { Spinner };
63+
export default SpinnerTemplate;

src/components/TDViewer/base/BaseButton.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
import React from "react";
1515

16-
interface BaseButtonProps
17-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
16+
interface BaseButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
1817
children: React.ReactNode;
1918
variant?: "primary" | "secondary" | "empty";
2019
className?: string;

src/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@tailwind components;
33
@tailwind utilities;
44

5-
65
html,
76
body,
87
#root {

src/types/context.d.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,62 @@ declare global {
1515
northboundConnection: INorthboundConnection;
1616
contributeCatalog: IContributeCatalog;
1717

18-
// Callback functions
19-
updateOfflineTD: (td: string) => void;
20-
updateIsModified: (isModified: boolean) => void;
21-
setFileHandle: (handle: string | null) => void;
22-
removeForm: (
23-
level: string,
24-
interactionName: string,
25-
toBeDeletedForm: { href: string; op: string },
26-
index: number
27-
) => void;
28-
addForm: (level: string, interactionName: string, form: any) => void;
29-
removeLink: (link: any) => void;
30-
removeOneOfAKindReducer: (kind: string, oneOfAKind: string) => void;
31-
addLinkedTd: (linkedTd: Record<string, any>) => void;
32-
updateLinkedTd: (linkedTd: Record<string, any>) => void;
33-
updateValidationMessage: (validationMessage?: any) => void;
34-
updateNorthboundConnection: (
35-
northboundConnection: INorthboundConnection
36-
) => void;
37-
updateContributeCatalog: (contributeCatalog: IContributeCatalog) => void;
38-
}
18+
// Callback functions
19+
updateOfflineTD: (td: string) => void;
20+
updateIsModified: (isModified: boolean) => void;
21+
setFileHandle: (handle: string | null) => void;
22+
removeForm: (
23+
level: string,
24+
interactionName: string,
25+
toBeDeletedForm: { href: string; op: string },
26+
index: number
27+
) => void;
28+
addForm: (level: string, interactionName: string, form: any) => void;
29+
removeLink: (link: any) => void;
30+
removeOneOfAKindReducer: (kind: string, oneOfAKind: string) => void;
31+
addLinkedTd: (linkedTd: Record<string, any>) => void;
32+
updateLinkedTd: (linkedTd: Record<string, any>) => void;
33+
updateValidationMessage: (validationMessage?: any) => void;
34+
updateNorthboundConnection: (
35+
northboundConnection: INorthboundConnection
36+
) => void;
37+
updateContributeCatalog: (contributeCatalog: IContributeCatalog) => void;
38+
}
3939

40-
interface IValidationMessage {
41-
report: {
42-
json: null | "passed" | "failed" | "warning";
43-
schema: null | "passed" | "failed" | "warning";
44-
defaults: null | "passed" | "failed" | "warning";
45-
jsonld: null | "passed" | "failed" | "warning";
46-
additional: null | "passed" | "failed" | "warning";
47-
};
48-
details: {
49-
enumConst: null | string;
50-
propItems: null | string;
51-
security: null | string;
52-
propUniqueness: null | string;
53-
multiLangConsistency: null | string;
54-
linksRelTypeCount: null | string;s
55-
readWriteOnly: null | string;
56-
uriVariableSecurity: null | string;
57-
};
58-
detailComments: {
59-
enumConst: null | string;
60-
propItems: null | string;
61-
security: null | string;
62-
propUniqueness: null | string;
63-
multiLangConsistency: null | string;
64-
linksRelTypeCount: null | string;
65-
readWriteOnly: null | string;
66-
uriVariableSecurity: null | string;
67-
};
68-
validationErrors?: {
69-
json: string;
70-
schema: string;
71-
};
72-
customMessage: string; // custom to editor
73-
}
40+
interface IValidationMessage {
41+
report: {
42+
json: null | "passed" | "failed" | "warning";
43+
schema: null | "passed" | "failed" | "warning";
44+
defaults: null | "passed" | "failed" | "warning";
45+
jsonld: null | "passed" | "failed" | "warning";
46+
additional: null | "passed" | "failed" | "warning";
47+
};
48+
details: {
49+
enumConst: null | string;
50+
propItems: null | string;
51+
security: null | string;
52+
propUniqueness: null | string;
53+
multiLangConsistency: null | string;
54+
linksRelTypeCount: null | string;
55+
readWriteOnly: null | string;
56+
uriVariableSecurity: null | string;
57+
};
58+
detailComments: {
59+
enumConst: null | string;
60+
propItems: null | string;
61+
security: null | string;
62+
propUniqueness: null | string;
63+
multiLangConsistency: null | string;
64+
linksRelTypeCount: null | string;
65+
readWriteOnly: null | string;
66+
uriVariableSecurity: null | string;
67+
};
68+
validationErrors?: {
69+
json: string;
70+
schema: string;
71+
};
72+
customMessage: string; // custom to editor
73+
}
7474

7575
interface INorthboundConnection {
7676
message: string;

src/workers/schemaWorker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const tdSchema =
2727
const tmSchema =
2828
"https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/tm-json-schema-validation.json";
2929

30-
3130
self.onmessage = async (message) => {
3231
// Check that prevents messages sent from webpack and react scripts to be executed.
3332
// Not sure why this is happening at the moment. This is only a "quick" fix.

src/workers/validationWorker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import { tdValidator, tmValidator } from "../external/TdPlayground";
1414
import { isThingModel } from "../util";
1515

16-
1716
self.onmessage = async (message) => {
1817
console.debug("validation worker received message...");
1918
let tdStr = message.data;

0 commit comments

Comments
 (0)