Skip to content

Commit 910a45d

Browse files
committed
chore: improve config files, ran linting
1 parent cca7060 commit 910a45d

File tree

6 files changed

+49
-35
lines changed

6 files changed

+49
-35
lines changed

packages/pluggableWidgets/skiplink-web/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@mendix/pluggable-widget-skiplink-web",
2+
"name": "@mendix/skiplink-web",
33
"widgetName": "SkipLink",
44
"version": "1.0.0",
55
"description": "Adds a skip link to the top of the page for accessibility.",
@@ -30,14 +30,19 @@
3030
"e2e": "run-e2e ci",
3131
"e2edev": "run-e2e dev --with-preps",
3232
"format": "prettier --ignore-path ./node_modules/@mendix/prettier-config-web-widgets/global-prettierignore --write .",
33-
"lint": "eslint src package.json",
33+
"lint": "eslint src/ package.json",
3434
"publish-marketplace": "rui-publish-marketplace",
3535
"release": "pluggable-widgets-tools release:web",
3636
"start": "pluggable-widgets-tools start:server",
3737
"test": "jest --projects jest.config.js",
3838
"update-changelog": "rui-update-changelog-widget",
3939
"verify": "rui-verify-package-format"
4040
},
41+
"dependencies": {
42+
"@floating-ui/react": "^0.26.27",
43+
"@mendix/widget-plugin-component-kit": "workspace:*",
44+
"classnames": "^2.5.1"
45+
},
4146
"devDependencies": {
4247
"@mendix/automation-utils": "workspace:*",
4348
"@mendix/eslint-config-web-widgets": "workspace:*",

packages/pluggableWidgets/skiplink-web/src/SkipLink.editorConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hidePropertiesIn, Problem, Properties } from "@mendix/pluggable-widgets-tools";
1+
import { Problem, Properties } from "@mendix/pluggable-widgets-tools";
22
import {
33
StructurePreviewProps,
44
RowLayoutProps,
@@ -7,7 +7,7 @@ import {
77
structurePreviewPalette
88
} from "@mendix/widget-plugin-platform/preview/structure-preview-api";
99

10-
export function getProperties(values: any, defaultValues: Properties): Properties {
10+
export function getProperties(defaultValues: Properties): Properties {
1111
// No conditional properties for skiplink, but function provided for consistency
1212
return defaultValues;
1313
}
Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
import { createElement, ReactElement } from "react";
2-
3-
export interface SkipLinkPreviewProps {
4-
linkText: string;
5-
mainContentId: string;
6-
}
2+
import { SkipLinkPreviewProps } from "../typings/SkipLinkProps";
73

84
export const preview = (props: SkipLinkPreviewProps): ReactElement => {
9-
return (
10-
<div style={{ position: "relative", height: 40 }}>
11-
<a
12-
href={`#${props.mainContentId}`}
13-
style={{
14-
position: "absolute",
15-
top: 0,
16-
left: 0,
17-
background: "#fff",
18-
color: "#0078d4",
19-
padding: "8px 16px",
20-
zIndex: 1000,
21-
textDecoration: "none",
22-
border: "2px solid #0078d4",
23-
borderRadius: 4,
24-
fontWeight: "bold"
25-
}}
26-
>
27-
{props.linkText}
28-
</a>
29-
</div>
30-
);
5+
if (props.renderMode === "xray") {
6+
return (
7+
<div style={{ position: "relative", height: 40 }}>
8+
<a
9+
href={`#${props.mainContentId}`}
10+
style={{
11+
position: "absolute",
12+
top: 0,
13+
left: 0,
14+
background: "#fff",
15+
color: "#0078d4",
16+
padding: "8px 16px",
17+
zIndex: 1000,
18+
textDecoration: "none",
19+
border: "2px solid #0078d4",
20+
borderRadius: 4,
21+
fontWeight: "bold"
22+
}}
23+
>
24+
{props.linkText}
25+
</a>
26+
</div>
27+
);
28+
}
29+
return <div />;
3130
};
3231

3332
export function getPreviewCss(): string {
34-
return require("./SkipLink.css");
33+
return require("./ui/SkipLink.scss");
3534
}

packages/pluggableWidgets/skiplink-web/src/SkipLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "./ui/SkipLink.css";
1+
import "./ui/SkipLink.scss";
22
import { useEffect } from "react";
33

44
export interface SkipLinkProps {

pnpm-lock.yaml

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)