@arcblock/ux 2.9.80 → 2.9.82

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-prototype-builtins */
2
- import { createContext, useState, useEffect, useContext, useRef } from 'react';
2
+ import { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
3
3
  import get from 'lodash/get';
4
4
  import PropTypes from 'prop-types';
5
5
  import Cookie from 'js-cookie';
@@ -102,7 +102,7 @@ function LocaleProvider({
102
102
  } else {
103
103
  lastCurrentLocale.current = currentLocale;
104
104
  }
105
- const t = (key, data) => translate(translations, key, currentLocale, fallbackLocale, data);
105
+ const t = useCallback((key, data) => translate(translations, key, currentLocale, fallbackLocale, data), [translations, currentLocale, fallbackLocale]);
106
106
  return /*#__PURE__*/_jsx(Provider, {
107
107
  value: {
108
108
  locale: currentLocale,
@@ -1,5 +1,6 @@
1
1
  export const DEFAULT_TIMEOUT = 5 * 60;
2
2
  export const DEFAULT_WINDOW_TIMEOUT = 30 * 60;
3
+ export const WELLKNOWN_SERVICE_PATH_PREFIX = '/.well-known/service';
3
4
  export const AUTH_SERVICE_PREFIX = '/.well-known/service';
4
5
  export const SESSION_TOKEN_STORAGE_KEY = 'login_token';
5
6
  export const REFRESH_TOKEN_STORAGE_KEY = 'refresh_token';
@@ -127,7 +127,7 @@ function LocaleProvider(_ref) {
127
127
  } else {
128
128
  lastCurrentLocale.current = currentLocale;
129
129
  }
130
- const t = (key, data) => (0, _util.translate)(translations, key, currentLocale, fallbackLocale, data);
130
+ const t = (0, _react.useCallback)((key, data) => (0, _util.translate)(translations, key, currentLocale, fallbackLocale, data), [translations, currentLocale, fallbackLocale]);
131
131
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Provider, {
132
132
  value: _objectSpread({
133
133
  locale: currentLocale,
@@ -3,9 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SESSION_TOKEN_STORAGE_KEY = exports.RELAY_SOCKET_PREFIX = exports.REFRESH_TOKEN_STORAGE_KEY = exports.PROFILE_URL = exports.PASSPORT_STATUS = exports.OAUTH_PROVIDER = exports.NAVIGATION_URL = exports.LOGIN_PROVIDER_NAME = exports.LOGIN_PROVIDER = exports.DID_PREFIX = exports.DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DASHBOARD_URL = exports.AUTH_SERVICE_PREFIX = exports.API_DID_PREFIX = void 0;
6
+ exports.WELLKNOWN_SERVICE_PATH_PREFIX = exports.SESSION_TOKEN_STORAGE_KEY = exports.RELAY_SOCKET_PREFIX = exports.REFRESH_TOKEN_STORAGE_KEY = exports.PROFILE_URL = exports.PASSPORT_STATUS = exports.OAUTH_PROVIDER = exports.NAVIGATION_URL = exports.LOGIN_PROVIDER_NAME = exports.LOGIN_PROVIDER = exports.DID_PREFIX = exports.DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_TIMEOUT = exports.DASHBOARD_URL = exports.AUTH_SERVICE_PREFIX = exports.API_DID_PREFIX = void 0;
7
7
  const DEFAULT_TIMEOUT = exports.DEFAULT_TIMEOUT = 5 * 60;
8
8
  const DEFAULT_WINDOW_TIMEOUT = exports.DEFAULT_WINDOW_TIMEOUT = 30 * 60;
9
+ const WELLKNOWN_SERVICE_PATH_PREFIX = exports.WELLKNOWN_SERVICE_PATH_PREFIX = '/.well-known/service';
9
10
  const AUTH_SERVICE_PREFIX = exports.AUTH_SERVICE_PREFIX = '/.well-known/service';
10
11
  const SESSION_TOKEN_STORAGE_KEY = exports.SESSION_TOKEN_STORAGE_KEY = 'login_token';
11
12
  const REFRESH_TOKEN_STORAGE_KEY = exports.REFRESH_TOKEN_STORAGE_KEY = 'refresh_token';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.9.80",
3
+ "version": "2.9.82",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -361,12 +361,12 @@
361
361
  "react": ">=18.2.0",
362
362
  "react-router-dom": ">=6.22.3"
363
363
  },
364
- "gitHead": "42a44e1df8e44d948124a2f9a9b7713dfbe6219a",
364
+ "gitHead": "4984b9ac818af802b6eb9fb4d6d03e08882f5179",
365
365
  "dependencies": {
366
366
  "@arcblock/did-motif": "^1.1.13",
367
- "@arcblock/icons": "^2.9.80",
368
- "@arcblock/nft-display": "^2.9.80",
369
- "@arcblock/react-hooks": "^2.9.80",
367
+ "@arcblock/icons": "^2.9.82",
368
+ "@arcblock/nft-display": "^2.9.82",
369
+ "@arcblock/react-hooks": "^2.9.82",
370
370
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
371
371
  "@fontsource/inter": "^5.0.16",
372
372
  "@fontsource/ubuntu-mono": "^5.0.18",
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable no-prototype-builtins */
2
- import { createContext, useState, useEffect, useContext, useRef } from 'react';
2
+ import { createContext, useState, useEffect, useContext, useRef, useCallback } from 'react';
3
3
  import get from 'lodash/get';
4
4
  import PropTypes from 'prop-types';
5
5
  import Cookie from 'js-cookie';
@@ -101,7 +101,10 @@ function LocaleProvider({ children, locale, fallbackLocale, translations, onLoad
101
101
  lastCurrentLocale.current = currentLocale;
102
102
  }
103
103
 
104
- const t = (key, data) => translate(translations, key, currentLocale, fallbackLocale, data);
104
+ const t = useCallback(
105
+ (key, data) => translate(translations, key, currentLocale, fallbackLocale, data),
106
+ [translations, currentLocale, fallbackLocale]
107
+ );
105
108
 
106
109
  return <Provider value={{ locale: currentLocale, changeLocale, t, languages: langs, ...rest }}>{children}</Provider>;
107
110
  }
@@ -1,5 +1,6 @@
1
1
  export const DEFAULT_TIMEOUT = 5 * 60;
2
2
  export const DEFAULT_WINDOW_TIMEOUT = 30 * 60;
3
+ export const WELLKNOWN_SERVICE_PATH_PREFIX = '/.well-known/service';
3
4
  export const AUTH_SERVICE_PREFIX = '/.well-known/service';
4
5
  export const SESSION_TOKEN_STORAGE_KEY = 'login_token';
5
6
  export const REFRESH_TOKEN_STORAGE_KEY = 'refresh_token';