This commit is contained in:
Jaco
2023-02-20 10:45:38 +02:00
committed by GitHub
parent 6ff0fd7e9b
commit c25fefa16f
17 changed files with 89 additions and 42 deletions
+7
View File
@@ -1,5 +1,12 @@
# CHANGELOG # CHANGELOG
## 2.12.1 Feb 20, 2023
Changes:
- Adjust `styled-components` usage to cater for server-based environments
## 2.11.3 Feb 19, 2023 ## 2.11.3 Feb 19, 2023
Changes: Changes:
+2 -2
View File
@@ -11,7 +11,7 @@
}, },
"sideEffects": false, "sideEffects": false,
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"versions": { "versions": {
"git": "2.11.3", "git": "2.11.3",
"npm": "2.11.3" "npm": "2.11.3"
@@ -34,7 +34,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.20.12", "@babel/core": "^7.20.12",
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/dev": "^0.68.38", "@polkadot/dev": "^0.68.40",
"@polkadot/x-bundle": "^10.4.2", "@polkadot/x-bundle": "^10.4.2",
"@types/jest": "^29.4.0", "@types/jest": "^29.4.0",
"babel-loader": "^8.3.0", "babel-loader": "^8.3.0",
+1 -1
View File
@@ -14,7 +14,7 @@
"url": "https://github.com/polkadot-js/ui.git" "url": "https://github.com/polkadot-js/ui.git"
}, },
"sideEffects": false, "sideEffects": false,
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13" "@babel/runtime": "^7.20.13"
+1 -1
View File
@@ -14,7 +14,7 @@
"url": "https://github.com/polkadot-js/ui.git" "url": "https://github.com/polkadot-js/ui.git"
}, },
"sideEffects": false, "sideEffects": false,
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13" "@babel/runtime": "^7.20.13"
+3 -3
View File
@@ -17,13 +17,13 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/keyring": "^10.4.2", "@polkadot/keyring": "^10.4.2",
"@polkadot/ui-settings": "2.11.3", "@polkadot/ui-settings": "2.12.0",
"@polkadot/ui-shared": "2.11.3", "@polkadot/ui-shared": "2.12.0",
"@polkadot/util": "^10.4.2", "@polkadot/util": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2", "@polkadot/util-crypto": "^10.4.2",
"color": "^3.2.1", "color": "^3.2.1",
+11 -1
View File
@@ -6,7 +6,7 @@ import type { IdentityProps as Props, Props as ComponentProps } from './types';
import React from 'react'; import React from 'react';
import CopyToClipboard from 'react-copy-to-clipboard'; import CopyToClipboard from 'react-copy-to-clipboard';
import styled from 'styled-components'; import styledComponents from 'styled-components';
import { ICON_DEFAULT_HOST, settings } from '@polkadot/ui-settings'; import { ICON_DEFAULT_HOST, settings } from '@polkadot/ui-settings';
import { isHex, isU8a, u8aToHex } from '@polkadot/util'; import { isHex, isU8a, u8aToHex } from '@polkadot/util';
@@ -14,6 +14,16 @@ import { decodeAddress, encodeAddress, ethereumEncode } from '@polkadot/util-cry
import { Beachball, Empty, Ethereum, Jdenticon, Polkadot } from './icons'; import { Beachball, Empty, Ethereum, Jdenticon, Polkadot } from './icons';
// In styled-components v6, there is a named export which can be used
// directly, i.e. "import { styled } from ..." with no more magic. Until
// such time the cjs vs esm import here is problematic, so we hack around
// the various shapes below
const styled = (
(styledComponents as unknown as { styled: typeof styledComponents }).styled ||
(styledComponents as unknown as { default: typeof styledComponents }).default ||
styledComponents
);
const Fallback = Beachball; const Fallback = Beachball;
interface State { interface State {
@@ -5,7 +5,17 @@ import type { Props } from '../types';
import makeBlockie from 'ethereum-blockies-base64'; import makeBlockie from 'ethereum-blockies-base64';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import styled from 'styled-components'; import styledComponents from 'styled-components';
// In styled-components v6, there is a named export which can be used
// directly, i.e. "import { styled } from ..." with no more magic. Until
// such time the cjs vs esm import here is problematic, so we hack around
// the various shapes below
const styled = (
(styledComponents as unknown as { styled: typeof styledComponents }).styled ||
(styledComponents as unknown as { default: typeof styledComponents }).default ||
styledComponents
);
interface ImgProps { interface ImgProps {
size: number; size: number;
+2 -2
View File
@@ -17,11 +17,11 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/ui-settings": "2.11.3", "@polkadot/ui-settings": "2.12.0",
"@polkadot/util": "^10.4.2", "@polkadot/util": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2", "@polkadot/util-crypto": "^10.4.2",
"qrcode-generator": "^1.4.4", "qrcode-generator": "^1.4.4",
+13 -3
View File
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import React, { useEffect, useMemo, useRef, useState } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react';
import styled from 'styled-components'; import styledComponents from 'styled-components';
import { objectSpread } from '@polkadot/util'; import { objectSpread } from '@polkadot/util';
import { xxhashAsHex } from '@polkadot/util-crypto'; import { xxhashAsHex } from '@polkadot/util-crypto';
@@ -10,6 +10,16 @@ import { xxhashAsHex } from '@polkadot/util-crypto';
import { qrcode } from './qrcode'; import { qrcode } from './qrcode';
import { createFrames, createImgSize } from './util'; import { createFrames, createImgSize } from './util';
// In styled-components v6, there is a named export which can be used
// directly, i.e. "import { styled } from ..." with no more magic. Until
// such time the cjs vs esm import here is problematic, so we hack around
// the various shapes below
const styled = (
(styledComponents as unknown as { styled: typeof styledComponents }).styled ||
(styledComponents as unknown as { default: typeof styledComponents }).default ||
styledComponents
);
interface Props { interface Props {
className?: string; className?: string;
size?: string | number; size?: string | number;
@@ -28,7 +38,7 @@ interface FrameState {
interface TimerState { interface TimerState {
timerDelay: number; timerDelay: number;
timerId: number | null; timerId: ReturnType<typeof setTimeout> | null;
} }
const DEFAULT_FRAME_DELAY = 2750; const DEFAULT_FRAME_DELAY = 2750;
@@ -84,7 +94,7 @@ function Display ({ className, size, skipEncoding, style, timerDelay = DEFAULT_F
return newState; return newState;
}); });
timerRef.current.timerId = window.setTimeout(nextFrame, timerRef.current.timerDelay); timerRef.current.timerId = setTimeout(nextFrame, timerRef.current.timerDelay);
return (): void => { return (): void => {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
+11 -1
View File
@@ -3,10 +3,20 @@
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import Reader from 'react-qr-reader'; import Reader from 'react-qr-reader';
import styled from 'styled-components'; import styledComponents from 'styled-components';
import { createImgSize } from './util'; import { createImgSize } from './util';
// In styled-components v6, there is a named export which can be used
// directly, i.e. "import { styled } from ..." with no more magic. Until
// such time the cjs vs esm import here is problematic, so we hack around
// the various shapes below
const styled = (
(styledComponents as unknown as { styled: typeof styledComponents }).styled ||
(styledComponents as unknown as { default: typeof styledComponents }).default ||
styledComponents
);
interface Props { interface Props {
className?: string; className?: string;
delay?: number; delay?: number;
+2 -2
View File
@@ -17,11 +17,11 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/ui-shared": "2.11.3", "@polkadot/ui-shared": "2.12.0",
"@polkadot/util": "^10.4.2", "@polkadot/util": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2", "@polkadot/util-crypto": "^10.4.2",
"react-native-svg": "^12.5.1" "react-native-svg": "^12.5.1"
+1 -1
View File
@@ -13,7 +13,7 @@
"url": "https://github.com/polkadot-js/ui.git" "url": "https://github.com/polkadot-js/ui.git"
}, },
"sideEffects": false, "sideEffects": false,
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
+2 -2
View File
@@ -16,12 +16,12 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/keyring": "^10.4.2", "@polkadot/keyring": "^10.4.2",
"@polkadot/ui-settings": "2.11.3", "@polkadot/ui-settings": "2.12.0",
"@polkadot/util": "^10.4.2", "@polkadot/util": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2", "@polkadot/util-crypto": "^10.4.2",
"mkdirp": "^2.1.3", "mkdirp": "^2.1.3",
+1 -1
View File
@@ -17,7 +17,7 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
+1 -1
View File
@@ -17,7 +17,7 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
+2 -2
View File
@@ -17,11 +17,11 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "2.11.3", "version": "2.12.0",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.13", "@babel/runtime": "^7.20.13",
"@polkadot/ui-shared": "2.11.3", "@polkadot/ui-shared": "2.12.0",
"@polkadot/util": "^10.4.2", "@polkadot/util": "^10.4.2",
"@polkadot/util-crypto": "^10.4.2", "@polkadot/util-crypto": "^10.4.2",
"jdenticon": "3.2.0" "jdenticon": "3.2.0"
+18 -18
View File
@@ -2182,9 +2182,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@polkadot/dev@npm:^0.68.38": "@polkadot/dev@npm:^0.68.40":
version: 0.68.38 version: 0.68.40
resolution: "@polkadot/dev@npm:0.68.38" resolution: "@polkadot/dev@npm:0.68.40"
dependencies: dependencies:
"@babel/cli": ^7.20.7 "@babel/cli": ^7.20.7
"@babel/core": ^7.20.12 "@babel/core": ^7.20.12
@@ -2248,7 +2248,7 @@ __metadata:
jsdom: ^21.1.0 jsdom: ^21.1.0
madge: ^6.0.0 madge: ^6.0.0
prettier: ^2.8.4 prettier: ^2.8.4
rollup: ^3.17.1 rollup: ^3.17.2
rollup-plugin-cleanup: ^3.2.1 rollup-plugin-cleanup: ^3.2.1
typescript: ^4.9.5 typescript: ^4.9.5
webpack: ^5.75.0 webpack: ^5.75.0
@@ -2286,7 +2286,7 @@ __metadata:
polkadot-exec-swc: scripts/polkadot-exec-swc.mjs polkadot-exec-swc: scripts/polkadot-exec-swc.mjs
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
checksum: 7fa2e683784b02b97fb08c34f1f84d6504e28d2a3d1ae0513b392390a800f4801f281bf789b0c7f0a19e221bfc6de5a2c89a237eb3674ce9ad131188392d7e08 checksum: efa0673933e2fec834b2d0a29c454c3d95e54c4608ea6eea8b4dc3730344234219afb61840d475771b873d6d34a67ae537e8451f73b0dd43eb82e440a1733966
languageName: node languageName: node
linkType: hard linkType: hard
@@ -2337,8 +2337,8 @@ __metadata:
dependencies: dependencies:
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/keyring": ^10.4.2 "@polkadot/keyring": ^10.4.2
"@polkadot/ui-settings": 2.11.3 "@polkadot/ui-settings": 2.12.0
"@polkadot/ui-shared": 2.11.3 "@polkadot/ui-shared": 2.12.0
"@polkadot/util": ^10.4.2 "@polkadot/util": ^10.4.2
"@polkadot/util-crypto": ^10.4.2 "@polkadot/util-crypto": ^10.4.2
"@types/react-copy-to-clipboard": ^5.0.4 "@types/react-copy-to-clipboard": ^5.0.4
@@ -2366,7 +2366,7 @@ __metadata:
resolution: "@polkadot/react-qr@workspace:packages/react-qr" resolution: "@polkadot/react-qr@workspace:packages/react-qr"
dependencies: dependencies:
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/ui-settings": 2.11.3 "@polkadot/ui-settings": 2.12.0
"@polkadot/util": ^10.4.2 "@polkadot/util": ^10.4.2
"@polkadot/util-crypto": ^10.4.2 "@polkadot/util-crypto": ^10.4.2
"@types/react-qr-reader": ^2.1.4 "@types/react-qr-reader": ^2.1.4
@@ -2388,7 +2388,7 @@ __metadata:
resolution: "@polkadot/reactnative-identicon@workspace:packages/reactnative-identicon" resolution: "@polkadot/reactnative-identicon@workspace:packages/reactnative-identicon"
dependencies: dependencies:
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/ui-shared": 2.11.3 "@polkadot/ui-shared": 2.12.0
"@polkadot/util": ^10.4.2 "@polkadot/util": ^10.4.2
"@polkadot/util-crypto": ^10.4.2 "@polkadot/util-crypto": ^10.4.2
"@types/react-native": ^0.71.3 "@types/react-native": ^0.71.3
@@ -2416,7 +2416,7 @@ __metadata:
dependencies: dependencies:
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/keyring": ^10.4.2 "@polkadot/keyring": ^10.4.2
"@polkadot/ui-settings": 2.11.3 "@polkadot/ui-settings": 2.12.0
"@polkadot/util": ^10.4.2 "@polkadot/util": ^10.4.2
"@polkadot/util-crypto": ^10.4.2 "@polkadot/util-crypto": ^10.4.2
"@types/mkdirp": ^1.0.2 "@types/mkdirp": ^1.0.2
@@ -2431,7 +2431,7 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@polkadot/ui-settings@2.11.3, @polkadot/ui-settings@workspace:packages/ui-settings": "@polkadot/ui-settings@2.12.0, @polkadot/ui-settings@workspace:packages/ui-settings":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@polkadot/ui-settings@workspace:packages/ui-settings" resolution: "@polkadot/ui-settings@workspace:packages/ui-settings"
dependencies: dependencies:
@@ -2447,7 +2447,7 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@polkadot/ui-shared@2.11.3, @polkadot/ui-shared@workspace:packages/ui-shared": "@polkadot/ui-shared@2.12.0, @polkadot/ui-shared@workspace:packages/ui-shared":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@polkadot/ui-shared@workspace:packages/ui-shared" resolution: "@polkadot/ui-shared@workspace:packages/ui-shared"
dependencies: dependencies:
@@ -2505,7 +2505,7 @@ __metadata:
resolution: "@polkadot/vue-identicon@workspace:packages/vue-identicon" resolution: "@polkadot/vue-identicon@workspace:packages/vue-identicon"
dependencies: dependencies:
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/ui-shared": 2.11.3 "@polkadot/ui-shared": 2.12.0
"@polkadot/util": ^10.4.2 "@polkadot/util": ^10.4.2
"@polkadot/util-crypto": ^10.4.2 "@polkadot/util-crypto": ^10.4.2
jdenticon: 3.2.0 jdenticon: 3.2.0
@@ -13908,9 +13908,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"rollup@npm:^3.17.1": "rollup@npm:^3.17.2":
version: 3.17.1 version: 3.17.2
resolution: "rollup@npm:3.17.1" resolution: "rollup@npm:3.17.2"
dependencies: dependencies:
fsevents: ~2.3.2 fsevents: ~2.3.2
dependenciesMeta: dependenciesMeta:
@@ -13918,7 +13918,7 @@ __metadata:
optional: true optional: true
bin: bin:
rollup: dist/bin/rollup rollup: dist/bin/rollup
checksum: 3c6076eba228a6623b886929154ebbb9ddfb6a044e567456eeb6257b5235f4fd740655836b539155b1b25697f38f5d189bf81b9ce0624ce5aafc6c8620bd80c0 checksum: 9473eb7e7ffdb74c8e01e813eccb2e81e86cd429aea4705c424a5369845bedd871e715347a53be04a157f8febb99a8e502c124b896141e06d94fb86d6e121721
languageName: node languageName: node
linkType: hard linkType: hard
@@ -13928,7 +13928,7 @@ __metadata:
dependencies: dependencies:
"@babel/core": ^7.20.12 "@babel/core": ^7.20.12
"@babel/runtime": ^7.20.13 "@babel/runtime": ^7.20.13
"@polkadot/dev": ^0.68.38 "@polkadot/dev": ^0.68.40
"@polkadot/x-bundle": ^10.4.2 "@polkadot/x-bundle": ^10.4.2
"@types/jest": ^29.4.0 "@types/jest": ^29.4.0
babel-loader: ^8.3.0 babel-loader: ^8.3.0