diff --git a/e2e/meta-tx-gateway/package.json b/e2e/meta-tx-gateway/package.json index 0908f65e8..428e90a19 100644 --- a/e2e/meta-tx-gateway/package.json +++ b/e2e/meta-tx-gateway/package.json @@ -1,6 +1,6 @@ { "name": "meta-tx-gateway", - "version": "1.7.10-alpha.17", + "version": "1.7.10-alpha.18", "description": "", "main": "index.js", "private": true, @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/bosonprotocol/core-components#readme", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "cors": "^2.8.5", "dotenv": "^16.0.2", "ethers": "^5.7.0", diff --git a/e2e/opensea-api-mock/package.json b/e2e/opensea-api-mock/package.json index 7148a1732..c6e2922bd 100644 --- a/e2e/opensea-api-mock/package.json +++ b/e2e/opensea-api-mock/package.json @@ -1,6 +1,6 @@ { "name": "opensea-api-mock", - "version": "1.0.5-alpha.17", + "version": "1.0.5-alpha.18", "description": "", "main": "index.js", "private": true, @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/bosonprotocol/core-components#readme", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "@opensea/seaport-js": "^4.0.0", "cors": "^2.8.5", "dotenv": "^16.0.2", diff --git a/package-lock.json b/package-lock.json index acd50e39a..355190557 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,10 +47,10 @@ } }, "e2e/meta-tx-gateway": { - "version": "1.7.10-alpha.17", + "version": "1.7.10-alpha.18", "license": "ISC", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "cors": "^2.8.5", "dotenv": "^16.0.2", "ethers": "^5.7.0", @@ -143,10 +143,10 @@ } }, "e2e/opensea-api-mock": { - "version": "1.0.5-alpha.17", + "version": "1.0.5-alpha.18", "license": "ISC", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "@opensea/seaport-js": "^4.0.0", "cors": "^2.8.5", "dotenv": "^16.0.2", @@ -42884,7 +42884,7 @@ }, "packages/common": { "name": "@bosonprotocol/common", - "version": "1.29.0-alpha.12", + "version": "1.29.0-alpha.13", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/metadata": "^1.16.2", @@ -42905,10 +42905,10 @@ }, "packages/core-sdk": { "name": "@bosonprotocol/core-sdk", - "version": "1.41.0-alpha.26", + "version": "1.41.0-alpha.27", "license": "Apache-2.0", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "@ethersproject/abi": "^5.5.0", "@ethersproject/address": "^5.5.0", "@ethersproject/bignumber": "^5.5.0", @@ -42969,10 +42969,10 @@ }, "packages/eth-connect-sdk": { "name": "@bosonprotocol/eth-connect-sdk", - "version": "1.7.0-alpha.12", + "version": "1.7.0-alpha.13", "license": "Apache-2.0", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12" + "@bosonprotocol/common": "^1.29.0-alpha.13" }, "devDependencies": { "eslint": "^8.10.0", @@ -42988,10 +42988,10 @@ }, "packages/ethers-sdk": { "name": "@bosonprotocol/ethers-sdk", - "version": "1.15.0-alpha.12", + "version": "1.15.0-alpha.13", "license": "Apache-2.0", "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12" + "@bosonprotocol/common": "^1.29.0-alpha.13" }, "devDependencies": { "@typechain/ethers-v5": "^9.0.0", @@ -43008,7 +43008,7 @@ }, "packages/ipfs-storage": { "name": "@bosonprotocol/ipfs-storage", - "version": "1.12.0-alpha.24", + "version": "1.12.0-alpha.25", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/metadata-storage": "^1.0.1", @@ -43049,13 +43049,13 @@ }, "packages/react-kit": { "name": "@bosonprotocol/react-kit", - "version": "0.34.0-alpha.24", + "version": "0.34.0-alpha.25", "license": "Apache-2.0", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.41.0-alpha.26", - "@bosonprotocol/ethers-sdk": "^1.15.0-alpha.12", - "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.24", + "@bosonprotocol/core-sdk": "^1.41.0-alpha.27", + "@bosonprotocol/ethers-sdk": "^1.15.0-alpha.13", + "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.25", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", "@glidejs/glide": "3.6.0", @@ -43847,7 +43847,7 @@ }, "packages/subgraph": { "name": "@bosonprotocol/subgraph", - "version": "1.34.0-alpha.26", + "version": "1.34.0-alpha.27", "license": "Apache-2.0", "dependencies": { "@graphprotocol/graph-cli": "0.68.5", diff --git a/packages/common/package.json b/packages/common/package.json index 991ab7147..385706294 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/common", - "version": "1.29.0-alpha.12", + "version": "1.29.0-alpha.13", "description": "Common configs, types, interfaces and utilities shared by the core components of the Boson Protocol.", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/packages/core-sdk/package.json b/packages/core-sdk/package.json index 2092db10d..361a1dce3 100644 --- a/packages/core-sdk/package.json +++ b/packages/core-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/core-sdk", - "version": "1.41.0-alpha.26", + "version": "1.41.0-alpha.27", "description": "Facilitates interaction with the contracts and subgraphs of the Boson Protocol", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", @@ -35,7 +35,7 @@ "access": "public" }, "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12", + "@bosonprotocol/common": "^1.29.0-alpha.13", "@ethersproject/abi": "^5.5.0", "@ethersproject/address": "^5.5.0", "@ethersproject/bignumber": "^5.5.0", diff --git a/packages/eth-connect-sdk/package.json b/packages/eth-connect-sdk/package.json index e4fc31f8e..5ccedc80b 100644 --- a/packages/eth-connect-sdk/package.json +++ b/packages/eth-connect-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/eth-connect-sdk", - "version": "1.7.0-alpha.12", + "version": "1.7.0-alpha.13", "description": "Implementation of the Web3LibAdapter interface and contract abstractions targeting eth-connect for the Boson Protocol.", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", @@ -31,7 +31,7 @@ "access": "public" }, "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12" + "@bosonprotocol/common": "^1.29.0-alpha.13" }, "devDependencies": { "eslint": "^8.10.0", diff --git a/packages/ethers-sdk/package.json b/packages/ethers-sdk/package.json index 0da944d2f..abefe1ce2 100644 --- a/packages/ethers-sdk/package.json +++ b/packages/ethers-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/ethers-sdk", - "version": "1.15.0-alpha.12", + "version": "1.15.0-alpha.13", "description": "Implementation of the Web3LibAdapter interface and contract abstractions targeting ethers for the Boson Protocol.", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", @@ -32,7 +32,7 @@ "access": "public" }, "dependencies": { - "@bosonprotocol/common": "^1.29.0-alpha.12" + "@bosonprotocol/common": "^1.29.0-alpha.13" }, "devDependencies": { "@typechain/ethers-v5": "^9.0.0", diff --git a/packages/ipfs-storage/package.json b/packages/ipfs-storage/package.json index 25a4c5a70..ba7a6eba7 100644 --- a/packages/ipfs-storage/package.json +++ b/packages/ipfs-storage/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/ipfs-storage", - "version": "1.12.0-alpha.24", + "version": "1.12.0-alpha.25", "description": "IPFS metadata storage implementation for building on top of the Boson Protocol.", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", diff --git a/packages/react-kit/package.json b/packages/react-kit/package.json index b087be329..9445ae3d1 100644 --- a/packages/react-kit/package.json +++ b/packages/react-kit/package.json @@ -1,7 +1,7 @@ { "name": "@bosonprotocol/react-kit", "description": "React toolkit with smart components and hooks for building on top of the Boson Protocol.", - "version": "0.34.0-alpha.24", + "version": "0.34.0-alpha.25", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", "types": "./dist/cjs/index.d.ts", @@ -15,9 +15,9 @@ "license": "Apache-2.0", "dependencies": { "@bosonprotocol/chat-sdk": "^1.3.1-alpha.9", - "@bosonprotocol/core-sdk": "^1.41.0-alpha.26", - "@bosonprotocol/ethers-sdk": "^1.15.0-alpha.12", - "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.24", + "@bosonprotocol/core-sdk": "^1.41.0-alpha.27", + "@bosonprotocol/ethers-sdk": "^1.15.0-alpha.13", + "@bosonprotocol/ipfs-storage": "^1.12.0-alpha.25", "@davatar/react": "1.11.1", "@ethersproject/units": "5.6.0", "@glidejs/glide": "3.6.0", diff --git a/packages/react-kit/src/components/buttons/BaseButton.tsx b/packages/react-kit/src/components/buttons/BaseButton.tsx index 754f2679b..3dad68d46 100644 --- a/packages/react-kit/src/components/buttons/BaseButton.tsx +++ b/packages/react-kit/src/components/buttons/BaseButton.tsx @@ -13,16 +13,17 @@ import { Typography } from "../ui/Typography"; import { theme } from "../../theme"; import { Loading } from "../ui/loading/Loading"; import { ButtonSize } from "../ui/buttonSize"; - +import { AddDollarPrefixToKeys } from "../../types/helpers"; const colors = theme.colors.light; -const ButtonWithThemeProps = styled.button<{ - size: ButtonSizeProp; - fill: boolean | undefined; - theme: BaseButtonTheme; -}>` +const ButtonWithThemeProps = styled.button< + AddDollarPrefixToKeys<{ + size: ButtonSizeProp; + fill: boolean | undefined; + }> & { theme: BaseButtonTheme } +>` ${() => Styles.button}; - ${(props) => Styles[props.size as keyof typeof Styles]} + ${(props) => Styles[props.$size as keyof typeof Styles]} border-style: solid; border-color: ${(props) => props.theme?.borderColor || "transparent"}; border-width: ${(props) => props.theme?.borderWidth || 0}px; @@ -35,7 +36,7 @@ const ButtonWithThemeProps = styled.button<{ stroke: ${(props) => props.theme?.color || "#000000"}; } ${(props) => - props.fill + props.$fill ? css` width: 100%; ` @@ -175,8 +176,8 @@ export const BaseButton = forwardRef( {withEditor && showEditor && ( @@ -327,17 +327,21 @@ function BaseUpload({ ) : ( <> - {field.value && field.value?.length !== 0 && preview ? ( + {showPreview ? ( <> {isVideoOnly ? ( )} - {placeholder && ( + {placeholder && !showPreview && ( {placeholder} diff --git a/packages/react-kit/src/components/ui/Video.tsx b/packages/react-kit/src/components/ui/Video.tsx index 00acb89b0..f238d11b2 100644 --- a/packages/react-kit/src/components/ui/Video.tsx +++ b/packages/react-kit/src/components/ui/Video.tsx @@ -198,7 +198,7 @@ export const Video: React.FC = ({ return ; } return ( - + diff --git a/packages/react-kit/src/components/wallet2/accountDrawer/IconButton.tsx b/packages/react-kit/src/components/wallet2/accountDrawer/IconButton.tsx index 0cb525928..1e5537a0b 100644 --- a/packages/react-kit/src/components/wallet2/accountDrawer/IconButton.tsx +++ b/packages/react-kit/src/components/wallet2/accountDrawer/IconButton.tsx @@ -112,19 +112,19 @@ const IconBlock = forwardRef< borderRadius: CSSProperties["borderRadius"]; } >(function IconBlock(props, ref) { - const { color, backgroundColor, borderRadius } = props; if ("href" in props) { + const { color, backgroundColor, borderRadius, ...restProps } = props; return ( } $color={color} $backgroundColor={backgroundColor} $borderRadius={borderRadius} - {...props} + {...restProps} /> ); } - + const { color, backgroundColor, borderRadius, ...restProps } = props; return ( ); }); diff --git a/packages/react-kit/src/stories/buttons/Upload.stories.tsx b/packages/react-kit/src/stories/buttons/Upload.stories.tsx index 4230e0c3a..73fc9b105 100644 --- a/packages/react-kit/src/stories/buttons/Upload.stories.tsx +++ b/packages/react-kit/src/stories/buttons/Upload.stories.tsx @@ -1,6 +1,6 @@ import React from "react"; import { Meta } from "@storybook/react"; -import { QueryClientProviderCustom, Upload } from "../.."; +import { BaseUploadProps, QueryClientProviderCustom, Upload } from "../.."; import { EnvironmentProvider } from "../../components/environment/EnvironmentProvider"; import { IpfsProvider } from "../../components/ipfs/IpfsProvider"; import { Formik } from "formik"; @@ -20,7 +20,6 @@ export default { }, // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs tags: ["autodocs"], - // args: { onClick: fn() }, argTypes: { name: { table: { @@ -69,20 +68,23 @@ export default { } satisfies Meta; const BASE_ARGS = { - name -} as const; + name, + placeholder: "", + withEditor: false, + saveButtonTheme: undefined +} as const satisfies BaseUploadProps; // More on args: https://storybook.js.org/docs/react/writing-stories/args export const Base = { args: { ...BASE_ARGS - } + } satisfies BaseUploadProps }; export const VideoOnly = { args: { ...BASE_ARGS, accept: "video/mp4", - withUpload: true - } + withUpload: false + } satisfies BaseUploadProps }; diff --git a/packages/react-kit/src/types/helpers.ts b/packages/react-kit/src/types/helpers.ts index 369d4e11e..bc66134a7 100644 --- a/packages/react-kit/src/types/helpers.ts +++ b/packages/react-kit/src/types/helpers.ts @@ -13,30 +13,6 @@ type Falsy = false | 0 | "" | null | undefined; export const isTruthy = (x: T | Falsy): x is T => !!x; -//#region Omit doesnt work well when using it with a type that has [x:string]: any, in that case there is no autocomplete: https://github.com/microsoft/TypeScript/issues/31153 -type KnownKeys = { - [K in keyof T]: string extends K ? never : number extends K ? never : K; -} extends { [_ in keyof T]: infer U } - ? {} extends U - ? never - : U - : never; // I don't know why not just U work here, but ({} extends U ? never : U) work - -type OmitFromKnownKeys = - KnownKeys extends infer U - ? [U] extends [keyof T] - ? Pick> - : never - : never; -export type ExtendedOmit = OmitFromKnownKeys & - (string extends K - ? {} - : string extends keyof T - ? { [n: string]: T[Exclude] } - : {}) & // support number property - (number extends K - ? {} - : number extends keyof T - ? { [n: number]: T[Exclude] } - : {}); // support number property -//#endregion +export type AddDollarPrefixToKeys = { + [K in keyof T as `$${string & K}`]: T[K]; +}; diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index 666eee763..1f03b1699 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -1,6 +1,6 @@ { "name": "@bosonprotocol/subgraph", - "version": "1.34.0-alpha.26", + "version": "1.34.0-alpha.27", "dependencies": { "@graphprotocol/graph-cli": "0.68.5", "@graphprotocol/graph-ts": "0.33.0"