@krasnoff/react-accessibility-component 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,6 +29,19 @@ import { AccessibilityComponent as AccessibilityComponentBase } from "@krasnoff/
29
29
  const AccessibilityComponent = AccessibilityComponentBase as React.FC<React.PropsWithChildren>;
30
30
 
31
31
  function App() {
32
+ // need to implement this handler to listen to the events emitted by the accessibility component
33
+ useEffect(() => {
34
+ const handler = (e: Event) => {
35
+ const { message, value } = (e as CustomEvent).detail;
36
+ console.log(message, value);
37
+ // message can be: "OpenCloseComponent", "grayScale", "contrast",
38
+ // "fontSizeIndex", "brightBackground", "readableFonts",
39
+ // "markHyperlinks", "listsMark", "titlesMark"
40
+ };
41
+ window.addEventListener("shadow-click", handler);
42
+ return () => window.removeEventListener("shadow-click", handler);
43
+ }, []);
44
+
32
45
  return (
33
46
  <>
34
47
  <h1>Vite + React to NPM repository</h1>
package/dist/README.md CHANGED
@@ -29,6 +29,19 @@ import { AccessibilityComponent as AccessibilityComponentBase } from "@krasnoff/
29
29
  const AccessibilityComponent = AccessibilityComponentBase as React.FC<React.PropsWithChildren>;
30
30
 
31
31
  function App() {
32
+ // need to implement this handler to listen to the events emitted by the accessibility component
33
+ useEffect(() => {
34
+ const handler = (e: Event) => {
35
+ const { message, value } = (e as CustomEvent).detail;
36
+ console.log(message, value);
37
+ // message can be: "OpenCloseComponent", "grayScale", "contrast",
38
+ // "fontSizeIndex", "brightBackground", "readableFonts",
39
+ // "markHyperlinks", "listsMark", "titlesMark"
40
+ };
41
+ window.addEventListener("shadow-click", handler);
42
+ return () => window.removeEventListener("shadow-click", handler);
43
+ }, []);
44
+
32
45
  return (
33
46
  <>
34
47
  <h1>Vite + React to NPM repository</h1>
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@krasnoff/react-accessibility-component",
3
3
  "private": false,
4
- "version": "1.0.5",
4
+ "version": "1.0.7",
5
+ "homepage": "https://krasnoff-personal-web-app.vercel.app/",
5
6
  "description": "A React component library focused on accessibility, built with Vite and TypeScript.",
6
7
  "repository": {
7
8
  "type": "git",
8
- "url": "https://github.com/krasnoff/vite-react-ts-component.git"
9
+ "url": "https://github.com/krasnoff/react-accessibility-component-new"
9
10
  },
10
11
  "main": "dist/index.js",
11
12
  "module": "dist/index.js",