@xyo-network/react-xns 7.5.4 → 7.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-xns",
3
- "version": "7.5.4",
3
+ "version": "7.5.6",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -43,28 +43,28 @@
43
43
  "src"
44
44
  ],
45
45
  "dependencies": {
46
- "@xylabs/react-button": "~7.1.15",
47
- "@xylabs/react-flexbox": "~7.1.15",
48
- "@xylabs/react-link": "~7.1.15",
49
- "@xylabs/react-pixel": "~7.1.15",
50
- "@xylabs/react-theme": "~7.1.15",
46
+ "@xylabs/react-button": "~7.1.17",
47
+ "@xylabs/react-flexbox": "~7.1.17",
48
+ "@xylabs/react-link": "~7.1.17",
49
+ "@xylabs/react-pixel": "~7.1.17",
50
+ "@xylabs/react-theme": "~7.1.17",
51
51
  "@xyo-network/xns-record-payloadset-plugins": "~5.3.1"
52
52
  },
53
53
  "devDependencies": {
54
- "@mui/icons-material": "~7.3.8",
55
- "@mui/material": "~7.3.8",
56
- "@storybook/react-vite": "~10.2.9",
54
+ "@mui/icons-material": "~7.3.9",
55
+ "@mui/material": "~7.3.9",
56
+ "@storybook/react-vite": "~10.3.3",
57
57
  "@types/react": "^19.2.14",
58
- "@xylabs/ts-scripts-yarn3": "~7.3.2",
59
- "@xylabs/tsconfig": "~7.3.2",
60
- "@xylabs/tsconfig-dom": "~7.3.2",
61
- "@xylabs/tsconfig-react": "~7.3.2",
58
+ "@xylabs/ts-scripts-yarn3": "~7.5.6",
59
+ "@xylabs/tsconfig": "~7.5.6",
60
+ "@xylabs/tsconfig-dom": "~7.5.6",
61
+ "@xylabs/tsconfig-react": "~7.5.6",
62
62
  "react": "^19.2.4",
63
63
  "react-dom": "^19.2.4",
64
- "react-router-dom": "^7.13.0",
65
- "storybook": "~10.2.9",
64
+ "react-router-dom": "^7.13.2",
65
+ "storybook": "~10.3.3",
66
66
  "typescript": "^5.9.3",
67
- "vite": "~7.3.1",
67
+ "vite": "~8.0.3",
68
68
  "zod": "^4.3.6"
69
69
  },
70
70
  "peerDependencies": {
@@ -3,7 +3,8 @@ import { TextField, useTheme } from '@mui/material'
3
3
  import { alphaCss } from '@xylabs/react-theme'
4
4
  import { MIN_DOMAIN_LENGTH, XnsNameHelper } from '@xyo-network/xns-record-payloadset-plugins'
5
5
  import React, {
6
- useLayoutEffect, useMemo, useRef, useState,
6
+ useLayoutEffect,
7
+ useRef, useState,
7
8
  } from 'react'
8
9
 
9
10
  export interface XnsEstimateNameTextFieldProps {
@@ -19,13 +20,15 @@ export const XnsEstimateNameTextField: React.FC<XnsEstimateNameTextFieldProps &
19
20
  const inputRef = useRef<HTMLInputElement>(null)
20
21
 
21
22
  // watch for external changes to the value and update the validLength state
22
- useMemo(() => {
23
+ const [previousValue, setPreviousValue] = useState<unknown>(value)
24
+ if (value !== previousValue) {
25
+ setPreviousValue(value)
23
26
  const validValueLength = !!(value && typeof value === 'string' && value.length >= MIN_DOMAIN_LENGTH)
24
27
  setValidLength(validValueLength)
25
- }, [value])
28
+ }
26
29
 
27
30
  // Update the input value when the value prop changes
28
- // NOTE: the intent of this component is to remain uncontrolled to avoid the need to manage the value state
31
+ // The intent of this component is to remain uncontrolled to avoid the need to manage the value state
29
32
  // Therefore, we use useLayoutEffect to update the input value directly.
30
33
  useLayoutEffect(() => {
31
34
  if (inputRef.current && typeof value === 'string') {
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-x/jsx-no-iife */
2
1
  import {
3
2
  Alert, Snackbar, useMediaQuery, useTheme,
4
3
  } from '@mui/material'
@@ -38,6 +37,7 @@ export const XnsNameCaptureErrors: React.FC<XnsNameCaptureErrorsProps> = ({
38
37
  </Alert>
39
38
  </Snackbar>
40
39
  )
40
+ // eslint-disable-next-line react-x/unsupported-syntax
41
41
  : (() => {
42
42
  // setTimeout(() => setError(undefined), 1500)
43
43
  return (
@@ -60,7 +60,7 @@ export const XnsNameCapture: React.FC<XnsNameCaptureProps> = ({
60
60
  } else {
61
61
  setError(new Error(errors.join(', ')))
62
62
  }
63
- }, [paramsString, to, xnsName, onCaptureNameProp, navigate])
63
+ }, [captureDisabled, xnsName, onCaptureNameProp, paramsString, navigate, to])
64
64
 
65
65
  const onKeyDown: KeyboardEventHandler<HTMLDivElement> = useCallback(async (event) => {
66
66
  if (event.key === 'Enter' && !captureDisabled) {
@@ -17,5 +17,5 @@ export const useXnsNameCaptureRouting = (props: XnsNameCaptureProps) => {
17
17
  routingError: error,
18
18
  navigate: props.navigate ?? ((to: string) => navigate(to)),
19
19
  paramsString: props.paramsString ? `${props.paramsString}${params.toString()}` : params.toString(),
20
- }), [props, params, name, error])
20
+ }), [props, name, error, params, navigate])
21
21
  }