Skip to content

Commit 660c2de

Browse files
committed
[FIX] homePage
1 parent f00f6e7 commit 660c2de

7 files changed

Lines changed: 194 additions & 29 deletions

File tree

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ Go to [Demo](https://ndriadev.github.io/react-tools) to see and try all implemen
182182

183183
- [_alphanumericCompare_](#alphanumericCompare)
184184
- [_changeStringCase_](#changeStringCase)
185+
- [_clickElementOnKeydownEvent_](#clickElementOnKeydownEvent)
185186
- [_defaultSerializer_](#defaultSerializer)
186187
- [_detectBrowser_](#detectBrowser)
187188
- [_getBase64_](#getBase64)
@@ -393,9 +394,9 @@ useLogger(name: string, props: object)
393394
394395
### useRerender
395396
396-
Hook that force a render. [See demo](https://ndriadev.github.io/react-tools/#/hooks/lifecycle/useRerender)
397+
Hook to force a render. [See demo](https://ndriadev.github.io/react-tools/#/hooks/lifecycle/useRerender)
397398
```tsx
398-
useRerender(): React.DispatchWithoutAction
399+
useRerender<T>(withValue?: true|false|never): DispatchWithoutAction | [T, DispatchWithoutAction]
399400
```
400401
401402
## PERFORMANCE
@@ -854,7 +855,7 @@ usePopover({ mode, onBeforeToggle, onToggle }: UsePopoverProps): UsePopoverResul
854855
855856
Hook to resolve promise with Suspense support. The component that uses it, it need to be wrapped with Suspense component. This hook can be used in conditional blocks. [See demo](https://ndriadev.github.io/react-tools/#/hooks/api-dom/usePromiseSuspensible)
856857
```tsx
857-
usePromiseSuspensible<T>(promise: ()=>Promise<T>, deps: DependencyList, options: { cache?: "unmount" | number, cleanOnError?: boolean } = {}): Awaited<ReturnType<typeof promise>>
858+
usePromiseSuspensible<T>(promise: ()=>Promise<T>, deps: DependencyList, options: { cache?: "unmount" | number, cleanOnError?: boolean, identifier?: string } = {}): Awaited<ReturnType<typeof promise>>
858859
```
859860
860861
### usePublishSubscribe
@@ -1057,6 +1058,13 @@ Function that given a string, a case type, and an optional delimiter, returns th
10571058
changeStringCase({string, caseType, delimiter}:{ string?: string, caseType: "pascalCase" | "snakeCase" | "kebabCase" | "camelCase", delimiter?: "upperCase" | "lowerCase" | string}): string
10581059
```
10591060
1061+
### clickElementOnKeydownEvent
1062+
1063+
Function which, given a triggering code, executes _click_ on element when a keyDown event with triggering code is executed. [See demo](https://ndriadev.github.io/react-tools/#/utils/clickElementOnKeydownEvent)
1064+
```tsx
1065+
clickElementOnKeydownEvent(codeTriggering: KeyboardEventCode): ((e: KeyboardEvent) => void)
1066+
```
1067+
10601068
### defaultSerializer
10611069
10621070
Function to serialize any type of value. [See demo](https://ndriadev.github.io/react-tools/#/utils/defaultSerializer)
@@ -1273,6 +1281,13 @@ Utility type for __`Typed Arrays`__.
12731281
type TypedArray
12741282
```
12751283
1284+
### KeyboardEventCode
1285+
1286+
Utility type for __`Keyboard Event Code`__
1287+
```tsx
1288+
type KeyboardEventCode
1289+
```
1290+
12761291
12771292
## ESLint configuration
12781293
To validate dependencies of custom hooks like `useMemoCompare`, configure `exhaustive-deps` with the `additionalHooks` option:

apps/react-tools-demo/scripts/generateMainLayout.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ async function generateImport(router) {
3939
*/
4040
function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFiles, eventsFiles, apiDomFiles,) {
4141
router.add(" <details open className='type'>");
42-
router.add(" <summary>Hooks</summary>");
42+
router.add(" <summary translate='no'>Hooks</summary>");
4343
router.add(" <details open className='sub-type'>");
44-
router.add(" <summary>State</summary>");
44+
router.add(" <summary translate='no'>State</summary>");
4545
stateFiles.forEach(f => {
4646
const [name] = f.split(".");
4747
router.add(' <Link');
@@ -52,13 +52,14 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
5252
router.add(' containerRef.current?.scrollTo(0, 0);');
5353
router.add(' window.innerWidth < 1190 && closeNav();');
5454
router.add(' }}');
55+
router.add(' translate="no"');
5556
router.add(' >');
5657
router.add(` ${name}`);
5758
router.add(' </Link>');
5859
});
5960
router.add(" </details>");
6061
router.add(" <details open className='sub-type'>");
61-
router.add(" <summary>Lifecycle</summary>");
62+
router.add(" <summary translate='no'>Lifecycle</summary>");
6263
lifecycleFiles.forEach(f => {
6364
const [name] = f.split(".");
6465
router.add(' <Link');
@@ -69,13 +70,14 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
6970
router.add(' containerRef.current?.scrollTo(0, 0);');
7071
router.add(' window.innerWidth < 1190 && closeNav();');
7172
router.add(' }}');
73+
router.add(' translate="no"');
7274
router.add(' >');
7375
router.add(` ${name}`);
7476
router.add(' </Link>');
7577
});
7678
router.add(" </details>");
7779
router.add(" <details open className='sub-type'>");
78-
router.add(" <summary>Performance</summary>");
80+
router.add(" <summary translate='no'>Performance</summary>");
7981
performanceFiles.forEach(f => {
8082
const [name] = f.split(".");
8183
router.add(' <Link');
@@ -86,13 +88,14 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
8688
router.add(' containerRef.current?.scrollTo(0, 0);');
8789
router.add(' window.innerWidth < 1190 && closeNav();');
8890
router.add(' }}');
91+
router.add(' translate="no"');
8992
router.add(' >');
9093
router.add(` ${name}`);
9194
router.add(' </Link>');
9295
});
9396
router.add(" </details>");
9497
router.add(" <details open className='sub-type'>");
95-
router.add(" <summary>Events</summary>");
98+
router.add(" <summary translate='no'>Events</summary>");
9699
eventsFiles.forEach(f => {
97100
const [name] = f.split(".");
98101
router.add(' <Link');
@@ -103,13 +106,14 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
103106
router.add(' containerRef.current?.scrollTo(0, 0);');
104107
router.add(' window.innerWidth < 1190 && closeNav();');
105108
router.add(' }}');
109+
router.add(' translate="no"');
106110
router.add(' >');
107111
router.add(` ${name}`);
108112
router.add(' </Link>');
109113
});
110114
router.add(" </details>");
111115
router.add(" <details open className='sub-type'>");
112-
router.add(" <summary>API DOM</summary>");
116+
router.add(" <summary translate='no'>API DOM</summary>");
113117
apiDomFiles.forEach(f => {
114118
const [name] = f.split(".");
115119
router.add(' <Link');
@@ -120,6 +124,7 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
120124
router.add(' containerRef.current?.scrollTo(0, 0);');
121125
router.add(' window.innerWidth < 1190 && closeNav();');
122126
router.add(' }}');
127+
router.add(' translate="no"');
123128
router.add(' >');
124129
router.add(` ${name}`);
125130
router.add(' </Link>');
@@ -136,7 +141,7 @@ function createLinkHooksRoutes(router, stateFiles, lifecycleFiles, performanceFi
136141
*/
137142
function createLinkRoutes(router, componentsFiles, parentRoot) {
138143
router.add(" <details open className='type'>");
139-
router.add(` <summary>${parentRoot.charAt(0).toUpperCase() + parentRoot.substring(1)}</summary>`);
144+
router.add(` <summary translate="no">${parentRoot.charAt(0).toUpperCase() + parentRoot.substring(1)}</summary>`);
140145
componentsFiles.forEach(f => {
141146
const [name] = f.split(".");
142147
router.add(' <Link');
@@ -147,6 +152,7 @@ function createLinkRoutes(router, componentsFiles, parentRoot) {
147152
router.add(' containerRef.current?.scrollTo(0, 0);');
148153
router.add(' window.innerWidth < 1190 && closeNav();');
149154
router.add(' }}');
155+
router.add(' translate="no"');
150156
router.add(' >');
151157
router.add(` ${name}`);
152158
router.add(' </Link>');
@@ -248,7 +254,7 @@ async function generateMainLayout() {
248254
' <div className="title-container">',
249255
' <Link to="/" className="title">',
250256
' <img src={React} alt="react" className="img" />',
251-
' <p className="text">React Tools</p>',
257+
' <p className="text" translate="no">React Tools</p>',
252258
' </Link>',
253259
' <Link to="https://github.com/nDriaDev/react-tools">',
254260
' <img src={Logo} className="img" alt="github" />',

apps/react-tools-demo/src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ code {
235235
summary:hover {
236236
/* color: #f53340; */
237237
color: #9c2129;
238+
cursor: pointer;
238239
}
239240

240241
.docs {

apps/react-tools-demo/src/layout/DemoCodeLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ReactNode } from "react";
22

33
export default function DemoCodeLayout({ children }: {children: ReactNode}) {
44
return (
5-
<div className="demo">
5+
<div className="demo" translate="no">
66
<span className="demo-label">DEMO</span>
77
{children}
88
</div>

0 commit comments

Comments
 (0)