Skip to content

Commit

Permalink
Merge branch 'main' of github.com:reown-com/appkit into enes/apkt-178…
Browse files Browse the repository at this point in the history
…7-enable-sentry-and-appkit-analytics
  • Loading branch information
tomiir committed Dec 17, 2024
2 parents c3c8515 + fdc9132 commit fbd03a0
Show file tree
Hide file tree
Showing 60 changed files with 959 additions and 288 deletions.
22 changes: 22 additions & 0 deletions .changeset/clever-rings-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-ui': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

refactor: adds background transition
22 changes: 22 additions & 0 deletions .changeset/new-avocados-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-utils': patch
'@reown/appkit': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-siwe': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Fix an issue where approving with Smart Account didn't work
22 changes: 22 additions & 0 deletions .changeset/orange-dots-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit': patch
'@reown/appkit-core': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-siwe': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Add jsdocs comments explaining params and functions from SIWX and Bitcoin packages.
22 changes: 22 additions & 0 deletions .changeset/rude-peaches-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit': patch
'@reown/appkit-core': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Clear SIWX sessions when calling ConnectionController.disconnect
22 changes: 22 additions & 0 deletions .changeset/slimy-berries-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-core': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

refactor: make the wallet image listen state updates for embedded use case
22 changes: 22 additions & 0 deletions .changeset/swift-melons-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@reown/appkit': patch
'@reown/appkit-core': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Adds parsing of Universal Provider session_event to get accountsChanged event
134 changes: 76 additions & 58 deletions apps/builder/components/configuration-sections/section-design.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { ThemeMode } from '@reown/appkit/react'
import { cn } from '@/lib/utils'
import { useSnapshot } from 'valtio'
import { ThemeStore } from '@/lib/theme-store'
import { HexColorPicker } from 'react-colorful'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import Image from 'next/image'
import { ACCENT_COLORS, BG_COLORS, RADIUS_NAME_VALUE_MAP, FONT_OPTIONS } from '@/lib/constants'

Expand All @@ -18,6 +16,26 @@ export function SectionDesign() {
const { fontFamily, mixColor, accentColor, borderRadius } = useSnapshot(ThemeStore.state)
const [radius, setRadius] = React.useState('M')

function handleColorPickerClick(inputId: string) {
const input = document.getElementById(inputId)
input?.click()
}

function handleAccentColorChange(e: React.ChangeEvent<HTMLInputElement>) {
const newColor = e.target.value
if (/^#[0-9A-F]{6}$/i.test(newColor)) {
ThemeStore.setAccentColor(newColor)
}
}

function handleMixColorChange(e: React.ChangeEvent<HTMLInputElement>) {
const newColor = e.target.value
if (/^#[0-9A-F]{6}$/i.test(newColor)) {
ThemeStore.setMixColor(newColor)
ThemeStore.setMixColorStrength(8)
}
}

return (
<div className="space-y-4">
<div className="space-y-2">
Expand Down Expand Up @@ -109,7 +127,7 @@ export function SectionDesign() {
</div>

<div className="space-y-2">
<Label className="text-sm text-text-secondary">Main</Label>
<Label className="text-sm text-text-secondary">Accent</Label>
<div className="grid grid-cols-5 gap-2">
{ACCENT_COLORS.map((color, index) => (
<button
Expand All @@ -131,31 +149,34 @@ export function SectionDesign() {
></div>
</button>
))}
<Popover>
<PopoverTrigger asChild>
<button
className={cn(
'flex items-center justify-center p-4 rounded-2xl transition-colors bg-fg-secondary hover:bg-fg-tertiary border border-transparent h-[38px]',
!ACCENT_COLORS.includes(accentColor) && accentColor !== ''
? 'border-fg-accent bg-fg-accent/10 hover:bg-fg-accent/10'
: null
)}
aria-label="Custom color picker"
>
<Image
src="/color-picker-icon.png"
alt="Color picker icon"
objectFit="cover"
width={16}
height={16}
className="rounded-2xl aspect-square"
/>
</button>
</PopoverTrigger>
<PopoverContent className="w-auto p-3">
<HexColorPicker color={accentColor} onChange={ThemeStore.setAccentColor} />
</PopoverContent>
</Popover>
<div className="relative">
<button
onClick={() => handleColorPickerClick('accent-color-input')}
className={cn(
'w-full flex items-center justify-center p-4 rounded-2xl transition-colors bg-fg-secondary hover:bg-fg-tertiary border border-transparent h-[38px]',
!ACCENT_COLORS.includes(accentColor) && accentColor !== ''
? 'border-fg-accent bg-fg-accent/10 hover:bg-fg-accent/10'
: null
)}
aria-label="Custom color picker"
>
<Image
src="/color-picker-icon.png"
alt="Color picker icon"
objectFit="cover"
width={16}
height={16}
className="rounded-2xl aspect-square"
/>
</button>
<input
id="accent-color-input"
type="color"
value={accentColor}
onChange={handleAccentColorChange}
className="absolute invisible"
/>
</div>
</div>
</div>

Expand All @@ -181,37 +202,34 @@ export function SectionDesign() {
></div>
</button>
))}
<Popover>
<PopoverTrigger asChild>
<button
className={cn(
'flex items-center justify-center p-4 rounded-2xl transition-colors bg-fg-secondary hover:bg-fg-tertiary border border-transparent h-[38px]',
!BG_COLORS.includes(mixColor) && mixColor !== ''
? 'border-fg-accent bg-fg-accent/10 hover:bg-fg-accent/10'
: null
)}
aria-label="Custom background color picker"
>
<Image
src="/color-picker-icon.png"
alt="Color picker icon"
objectFit="cover"
width={16}
height={16}
className="rounded-2xl aspect-square"
/>
</button>
</PopoverTrigger>
<PopoverContent className="w-auto p-3">
<HexColorPicker
color={mixColor}
onChange={color => {
ThemeStore.setMixColor(color)
ThemeStore.setMixColorStrength(8)
}}
<div className="relative">
<button
onClick={() => handleColorPickerClick('mix-color-input')}
className={cn(
'w-full flex items-center justify-center p-4 rounded-2xl transition-colors bg-fg-secondary hover:bg-fg-tertiary border border-transparent h-[38px]',
!BG_COLORS.includes(mixColor) && mixColor !== ''
? 'border-fg-accent bg-fg-accent/10 hover:bg-fg-accent/10'
: null
)}
aria-label="Custom background color picker"
>
<Image
src="/color-picker-icon.png"
alt="Color picker icon"
objectFit="cover"
width={16}
height={16}
className="rounded-2xl aspect-square"
/>
</PopoverContent>
</Popover>
</button>
<input
id="mix-color-input"
type="color"
value={mixColor}
onChange={handleMixColorChange}
className="absolute invisible"
/>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ export function SectionWalletFeatures() {
updateFeatures({ swaps: !config.features.swaps })
return
case 'Receive':
updateFeatures({ receive: !config.features.receive })
return
case 'Send':
updateFeatures({ send: !config.features.send })
return
default:
return
Expand Down
33 changes: 0 additions & 33 deletions apps/builder/components/ui/popover.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ export const WalletFeatureItem = React.memo(
Send: sendEnabled
}

const featureCanBeToggledMap = {
Buy: true,
Swap: true,
Receive: false,
Send: false
}

useEffect(() => {
if (!dragOverlay) {
return
Expand Down Expand Up @@ -124,7 +131,9 @@ export const WalletFeatureItem = React.memo(
>
{handle ? <Handle {...handleProps} {...listeners} /> : null}
<span className="text-sm flex-1">{value}</span>
<Checkbox checked={featureEnabledMap[value as WalletFeatureName]} />
{featureCanBeToggledMap[value as WalletFeatureName] ? (
<Checkbox checked={featureEnabledMap[value as WalletFeatureName]} />
) : null}
</div>
</li>
</div>
Expand Down
2 changes: 0 additions & 2 deletions apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-icons": "1.3.0",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-popover": "1.1.2",
"@radix-ui/react-radio-group": "1.2.1",
"@radix-ui/react-select": "2.1.2",
"@radix-ui/react-separator": "1.1.0",
Expand All @@ -38,7 +37,6 @@
"next": "14.2.3",
"next-themes": "0.4.3",
"react": "18.3.1",
"react-colorful": "5.6.1",
"react-dom": "18.3.1",
"sonner": "1.4.3",
"tailwind-merge": "2.2.1",
Expand Down
Loading

0 comments on commit fbd03a0

Please sign in to comment.