This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: IKEA E2490 BILRESA Scroll Wheel (ZHA) | |
| description: | | |
| Unified controller blueprint for IKEA E2490 BILRESA scroll wheel working with ZHA. | |
| - Buttons: on, off, on_double, off_double | |
| - Scroll: brightness_move_to_level with action_level from ZHA move_to_level args | |
| Supports light brightness, media_player volume, light color_temp, light hue. | |
| Version: 2026-05-02 | |
| domain: automation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { getContext, setContext } from "svelte"; | |
| /** | |
| * The context object. | |
| */ | |
| export interface Context<T> { | |
| get: () => T; | |
| set: (ctx: T) => T; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use client'; | |
| import { useEffect, useState } from 'react'; | |
| type ColorScheme = 'light' | 'dark'; | |
| const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); | |
| function getPreferredColorScheme(matches: boolean): ColorScheme { | |
| return matches ? 'dark' : 'light'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { type PropsWithChildren, useEffect, useState } from 'react'; | |
| import { createPortal } from 'react-dom'; | |
| type PortalProps = PropsWithChildren & { targetId: string }; | |
| export function Portal({ children, targetId }: PortalProps) { | |
| const [targetElement, setTargetElement] = useState<HTMLElement | null>(null); | |
| useEffect(() => { | |
| const updateTargetElement = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { isEqual } from 'lodash-es'; | |
| import { useEffect, useRef, useState } from 'react'; | |
| /** | |
| * Checks if a passed value has changed based on the provided equality function and returns the old instance of the | |
| * value if it has not changed. | |
| * | |
| * @param value The value that is compared. | |
| * @param equalFn A function that compares the old and the new value. Defaults to `lodash.isEqual`. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RefObject, useCallback, useEffect, useState } from 'react'; | |
| export interface ScrollToOptions { | |
| x?: number; | |
| y?: number; | |
| behavior?: ScrollBehavior; | |
| } | |
| export interface UseScrollOptions { | |
| disabled?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.redigital.rebased.ext.flow | |
| import arrow.core.None | |
| import arrow.core.Option | |
| import arrow.core.some | |
| import kotlinx.coroutines.flow.Flow | |
| import kotlinx.coroutines.flow.transform | |
| fun <T> Flow<T>.dedup(): Flow<T> = dedupBy { it } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import kotlinx.coroutines.coroutineScope | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.flow.Flow | |
| import kotlinx.coroutines.flow.channelFlow | |
| import kotlinx.coroutines.isActive | |
| import kotlinx.coroutines.launch | |
| import kotlinx.coroutines.sync.Mutex | |
| import kotlinx.coroutines.sync.withLock | |
| import kotlin.time.Duration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { type RefObject, useEffect, useState } from 'react'; | |
| function checkOverflow(el: HTMLElement | null): boolean { | |
| if (!el) return false; | |
| return el.offsetHeight < el.scrollHeight || el.offsetWidth < el.scrollWidth; | |
| } | |
| export function useHasOverflow(ref: RefObject<HTMLElement | null>) { | |
| const [overflow, setOverflow] = useState(false); |
NewerOlder