diff --git a/package.json b/package.json index 14bd3be9..63a8cfaa 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,7 @@ "core-js", "sharp" ] - } + }, + "workspaces": ["packages/*"], + "packageManager": "pnpm@10.5.2+sha512.da9dc28cd3ff40d0592188235ab25d3202add8a207afbedc682220e4a0029ffbff4562102b9e6e46b4e3f9e8bd53e6d05de48544b0c57d4b0179e22c76d1199b" } diff --git a/packages/react/src/container.tsx b/packages/react/src/container.tsx index 73c8c667..c9dd2d89 100644 --- a/packages/react/src/container.tsx +++ b/packages/react/src/container.tsx @@ -34,6 +34,10 @@ export const Container: (props: ContainerProperties & RefAttributes) => propertySignals.default, outerRef, innerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), [parent, propertySignals], ) diff --git a/packages/react/src/custom.tsx b/packages/react/src/custom.tsx index e3032519..aa13510f 100644 --- a/packages/react/src/custom.tsx +++ b/packages/react/src/custom.tsx @@ -36,6 +36,10 @@ export const CustomContainer: (props: CustomContainerProperties & RefAttributes< propertySignals.default, outerRef, innerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), [parent, propertySignals], ) diff --git a/packages/react/src/default.tsx b/packages/react/src/default.tsx index cddf59d9..a3d0b7b3 100644 --- a/packages/react/src/default.tsx +++ b/packages/react/src/default.tsx @@ -1,5 +1,6 @@ import { AllOptionalProperties } from '@pmndrs/uikit' -import { ReactNode, createContext, useContext } from 'react' +import { Signal } from '@preact/signals-core' +import { ReactNode, createContext, useContext, useMemo } from 'react' const DefaultPropertiesContext = createContext(undefined) @@ -9,19 +10,64 @@ export function useDefaultProperties(): AllOptionalProperties | undefined { export type DefaultPropertiesProperties = { children?: ReactNode } & AllOptionalProperties -export function DefaultProperties(properties: DefaultPropertiesProperties) { +const createDefaultPropertiesHash = (properties: AllOptionalProperties | undefined) => { + if (properties === undefined) { + return '' + } + return Array.from(Object.entries(properties)) + .sort(([ka], [kb]) => (ka > kb ? 1 : ka < kb ? -1 : 0)) + .map(([k, v]) => { + switch (typeof v) { + case 'function': + console.warn('no function in default props please', k) + return '' + case 'object': + if (Array.isArray(v)) { + return v.join(',') + } + if (v instanceof Signal) { + return `${k}=${v.peek()}` + } + for (let nk of Object.keys(v)) { + if (typeof v[nk] === 'object') { + console.warn('no deeply nested objects in default props please', k, v) + return '' + } + if (typeof v[nk] === 'function') { + console.warn('no functions nested in objects in default props please', k, v) + return '' + } + } + return `${k}=${JSON.stringify(v)}` + default: + if (v === undefined) return '' + return `${k}=${v}` + } + }) + .join('&') +} + +export function DefaultProperties({ children, ...properties }: DefaultPropertiesProperties) { const existingDefaultProperties = useContext(DefaultPropertiesContext) - const result: any = { ...existingDefaultProperties } - for (const key in properties) { - if (key === 'children') { - continue - } - //TODO: this is not correctly merged but rather overwritten - const value = properties[key as keyof AllOptionalProperties] - if (value == null) { - continue + const existingDefaultPropertiesHash = createDefaultPropertiesHash(existingDefaultProperties) + const propertiesHash = createDefaultPropertiesHash(properties) + + const result: any = useMemo(() => { + const result: any = { ...existingDefaultProperties } + for (const key in properties) { + if (key === 'children') { + continue + } + //TODO: this is not correctly merged but rather overwritten + const value = properties[key as keyof AllOptionalProperties] + if (value == null) { + continue + } + result[key] = value as any } - result[key] = value as any - } - return {properties.children} + return result + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [existingDefaultPropertiesHash, propertiesHash]) + + return {children} } diff --git a/packages/react/src/icon.tsx b/packages/react/src/icon.tsx index 924d5b65..9b32643b 100644 --- a/packages/react/src/icon.tsx +++ b/packages/react/src/icon.tsx @@ -36,6 +36,10 @@ export const Icon: (props: IconProperties & RefAttributes) => ReactNode propertySignals.properties, propertySignals.default, outerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), [parent, properties.svgHeight, properties.svgWidth, properties.text, propertySignals], ) diff --git a/packages/react/src/image.tsx b/packages/react/src/image.tsx index 7ddcef74..c5b5b842 100644 --- a/packages/react/src/image.tsx +++ b/packages/react/src/image.tsx @@ -33,6 +33,10 @@ export const Image: (props: ImageProperties & RefAttributes) => ReactN propertySignals.default, outerRef, innerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), // eslint-disable-next-line react-hooks/exhaustive-deps [], diff --git a/packages/react/src/input.tsx b/packages/react/src/input.tsx index 98cbefe6..e3d2092d 100644 --- a/packages/react/src/input.tsx +++ b/packages/react/src/input.tsx @@ -43,6 +43,10 @@ export const Input: (props: InputProperties & RefAttributes) => ReactN propertySignals.properties, propertySignals.default, outerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), // eslint-disable-next-line react-hooks/exhaustive-deps [], diff --git a/packages/react/src/root.tsx b/packages/react/src/root.tsx index 3cedb1e3..b3dba3ec 100644 --- a/packages/react/src/root.tsx +++ b/packages/react/src/root.tsx @@ -60,6 +60,10 @@ export const Root: (props: RootProperties & RefAttributes) => ReactNode }, //requestFrame = invalidate, because invalidate always causes another frame invalidate, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), // eslint-disable-next-line react-hooks/exhaustive-deps [invalidate], diff --git a/packages/react/src/svg.tsx b/packages/react/src/svg.tsx index 4ff01c5c..df328df0 100644 --- a/packages/react/src/svg.tsx +++ b/packages/react/src/svg.tsx @@ -33,6 +33,10 @@ export const Svg: (props: SvgProperties & RefAttributes) => ReactNode = propertySignals.default, outerRef, innerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), [parent, propertySignals], ) diff --git a/packages/react/src/text.tsx b/packages/react/src/text.tsx index e2c10cf7..41877e3b 100644 --- a/packages/react/src/text.tsx +++ b/packages/react/src/text.tsx @@ -42,6 +42,10 @@ export const Text: (props: TextProperties & RefAttributes) => ReactNode propertySignals.properties, propertySignals.default, outerRef, + // @ts-expect-error + propertySignals.handlers, + propertySignals.hoverProps, + propertySignals.activeProps, ), [fontFamilies, parent, propertySignals, textSignal], ) diff --git a/packages/react/src/utils.tsx b/packages/react/src/utils.tsx index c26254c8..a70a139d 100644 --- a/packages/react/src/utils.tsx +++ b/packages/react/src/utils.tsx @@ -1,9 +1,10 @@ -import { Signal, effect, signal } from '@preact/signals-core' +import { Signal, batch, effect, signal } from '@preact/signals-core' import { EventHandlers, ThreeEvent } from '@react-three/fiber/dist/declarations/src/core/events' import { ReactNode, forwardRef, useEffect, useMemo, useState } from 'react' import { Object3D } from 'three' import { useDefaultProperties } from './default.js' import { AllOptionalProperties } from '@pmndrs/uikit/internals' +import { Sign } from 'crypto' export type R3FEventMap = { mouse: ThreeEvent @@ -35,16 +36,68 @@ export const AddHandlers = forwardRef< ) }) +const eventHandlerKeys: Array = [ + 'onClick', + 'onContextMenu', + 'onDoubleClick', + 'onPointerCancel', + 'onPointerDown', + 'onPointerEnter', + 'onPointerLeave', + 'onPointerMove', + 'onPointerOut', + 'onPointerOver', + 'onPointerUp', + 'onWheel', +] + export function usePropertySignals(properties: T) { const propertySignals = useMemo( () => ({ style: signal(undefined), properties: signal(undefined as any), default: signal(undefined), + handlers: (() => { + const hashmap = {} as Record> + for (const key of eventHandlerKeys) { + hashmap[key] = signal(undefined) + } + return hashmap + })(), + hoverProps: signal(undefined), + activeProps: signal(undefined), }), [], ) - propertySignals.properties.value = properties - propertySignals.default.value = useDefaultProperties() + const defaultProperties = useDefaultProperties() + batch(() => { + propertySignals.properties.value = properties + propertySignals.default.value = defaultProperties + for (const key of eventHandlerKeys) { + // @ts-expect-error + const handler = properties[key] + propertySignals.handlers[key].value = handler + } + // @ts-expect-error + propertySignals.hoverProps.value = { + // @ts-expect-error + hover: properties.hover, + // @ts-expect-error + cursor: properties.cursor, + // @ts-expect-error + onHoverChange: properties.onHoverChange, + // @ts-expect-error + classes: properties.classes, + } + // @ts-expect-error + propertySignals.activeProps.value = { + // @ts-expect-error + active: properties.active, + // @ts-expect-error + onActiveChange: properties.onActiveChange, + // @ts-expect-error + classes: properties.classes, + } + }) return propertySignals } diff --git a/packages/uikit/src/components/container.ts b/packages/uikit/src/components/container.ts index c937a32a..1209f56a 100644 --- a/packages/uikit/src/components/container.ts +++ b/packages/uikit/src/components/container.ts @@ -74,6 +74,9 @@ export function createContainer( defaultProperties: Signal, object: Object3DRef, childrenContainer: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const node = signal(undefined) const flexState = createFlexNodeState() @@ -152,7 +155,16 @@ export function createContainer( initializers, ) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal, scrollHandlers) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + scrollHandlers, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(parentCtx, handlers) const interactionPanel = createInteractionPanel( diff --git a/packages/uikit/src/components/content.ts b/packages/uikit/src/components/content.ts index 61a89ba1..c7645230 100644 --- a/packages/uikit/src/components/content.ts +++ b/packages/uikit/src/components/content.ts @@ -74,6 +74,9 @@ export function createContent( defaultProperties: Signal, object: Object3DRef, contentContainerRef: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const hoveredSignal = signal>([]) const activeSignal = signal>([]) @@ -145,7 +148,15 @@ export function createContent( setupMatrixWorldUpdate(true, true, object, parentCtx.root, globalMatrix, initializers, false) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(parentCtx, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, object, initializers, true) diff --git a/packages/uikit/src/components/custom.ts b/packages/uikit/src/components/custom.ts index ccf5a0a8..2d345007 100644 --- a/packages/uikit/src/components/custom.ts +++ b/packages/uikit/src/components/custom.ts @@ -59,6 +59,9 @@ export function createCustomContainer( defaultProperties: Signal, object: Object3DRef, meshRef: { current?: Mesh | null }, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const hoveredSignal = signal>([]) const activeSignal = signal>([]) @@ -150,7 +153,15 @@ export function createCustomContainer( setupMatrixWorldUpdate(true, true, object, parentCtx.root, globalMatrix, initializers, false) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(parentCtx, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, object, initializers, true) diff --git a/packages/uikit/src/components/icon.ts b/packages/uikit/src/components/icon.ts index 72c76874..7b1a98fd 100644 --- a/packages/uikit/src/components/icon.ts +++ b/packages/uikit/src/components/icon.ts @@ -69,6 +69,9 @@ export function createIcon( properties: Signal | undefined>, defaultProperties: Signal, object: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const initializers: Initializers = [] const hoveredSignal = signal>([]) @@ -141,7 +144,15 @@ export function createIcon( setupMatrixWorldUpdate(true, true, object, parentCtx.root, globalMatrix, initializers, false) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(parentCtx, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, object, initializers, false) diff --git a/packages/uikit/src/components/image.ts b/packages/uikit/src/components/image.ts index 494b3b59..738cb649 100644 --- a/packages/uikit/src/components/image.ts +++ b/packages/uikit/src/components/image.ts @@ -117,6 +117,9 @@ export function createImage( defaultProperties: Signal, object: Object3DRef, childrenContainer: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const initializers: Initializers = [] const texture = signal(undefined) @@ -205,7 +208,16 @@ export function createImage( initializers, ) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal, scrollHandlers) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + scrollHandlers, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(parentCtx, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, imageMesh, initializers, false) diff --git a/packages/uikit/src/components/input.ts b/packages/uikit/src/components/input.ts index b1e26555..6c32691f 100644 --- a/packages/uikit/src/components/input.ts +++ b/packages/uikit/src/components/input.ts @@ -120,6 +120,9 @@ export function createInput( properties: Signal | undefined>, defaultProperties: Signal, object: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const hoveredSignal = signal>([]) const activeSignal = signal>([]) @@ -304,10 +307,12 @@ export function createInput( const handlers = computedHandlers( style, - properties, defaultProperties, hoveredSignal, activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, selectionHandlers, 'text', ) diff --git a/packages/uikit/src/components/root.ts b/packages/uikit/src/components/root.ts index 45942e3b..6b10895a 100644 --- a/packages/uikit/src/components/root.ts +++ b/packages/uikit/src/components/root.ts @@ -91,6 +91,9 @@ export function createRoot( onFrameSet: Set<(delta: number) => void>, requestRender: () => void = () => {}, requestFrame: () => void = () => {}, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const rootSize = signal([0, 0]) const hoveredSignal = signal>([]) @@ -262,7 +265,16 @@ export function createRoot( initializers, ) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal, scrollHandlers) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + scrollHandlers, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(undefined, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, rootCtx, interactionPanel, initializers, false) diff --git a/packages/uikit/src/components/svg.ts b/packages/uikit/src/components/svg.ts index 7a755fad..e62c441d 100644 --- a/packages/uikit/src/components/svg.ts +++ b/packages/uikit/src/components/svg.ts @@ -99,6 +99,9 @@ export function createSvg( defaultProperties: Signal, object: Object3DRef, childrenContainer: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const initializers: Initializers = [] const hoveredSignal = signal>([]) @@ -212,7 +215,16 @@ export function createSvg( initializers, ) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal, scrollHandlers) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + scrollHandlers, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(undefined, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, centerGroup, initializers, false) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, interactionPanel, initializers, false) diff --git a/packages/uikit/src/components/text.ts b/packages/uikit/src/components/text.ts index 5c7a7805..a2c11ea0 100644 --- a/packages/uikit/src/components/text.ts +++ b/packages/uikit/src/components/text.ts @@ -73,6 +73,9 @@ export function createText( properties: Signal | undefined>, defaultProperties: Signal, object: Object3DRef, + handlersSignal: Record>, + hoverPropsSingnal: Signal, + activePropsSingnal: Signal, ) { const hoveredSignal = signal>([]) const activeSignal = signal>([]) @@ -154,7 +157,15 @@ export function createText( initializers, ) - const handlers = computedHandlers(style, properties, defaultProperties, hoveredSignal, activeSignal) + const handlers = computedHandlers( + style, + defaultProperties, + hoveredSignal, + activeSignal, + handlersSignal, + hoverPropsSingnal, + activePropsSingnal, + ) const ancestorsHaveListeners = computeAncestorsHaveListeners(undefined, handlers) setupPointerEvents(mergedProperties, ancestorsHaveListeners, parentCtx.root, interactionPanel, initializers, false) diff --git a/packages/uikit/src/components/utils.ts b/packages/uikit/src/components/utils.ts index 06ff2178..43d0d866 100644 --- a/packages/uikit/src/components/utils.ts +++ b/packages/uikit/src/components/utils.ts @@ -7,7 +7,7 @@ import { WithResponsive } from '../responsive.js' import { ColorRepresentation, Initializers, readReactive } from '../utils.js' import { FlexNode, FlexNodeState } from '../flex/index.js' import { ParentContext, Object3DRef, RootContext } from '../context.js' -import { EventHandlers } from '../events.js' +import { EventHandlers, ThreeMouseEvent, ThreePointerEvent } from '../events.js' import { AllOptionalProperties, MergedProperties, @@ -167,34 +167,41 @@ const eventHandlerKeys: Array = [ export function computedHandlers( style: Signal, - propertiesSignal: Signal, defaultProperties: Signal, hoveredSignal: Signal>, activeSignal: Signal>, + handlersSingal: Record>, + hoverPropsSignal: Signal, + activePropsSignal: Signal, dynamicHandlers?: Signal, defaultCursor?: string, ) { return computed(() => { const handlers: EventHandlers = {} - const properties = propertiesSignal.value - if (properties != null) { - for (const key of eventHandlerKeys) { - const handler = properties[key] - if (handler != null) { - handlers[key] = handler as any - } + for (const key of eventHandlerKeys) { + const handler = handlersSingal[key].value + if (handler != null) { + handlers[key] = handler as any } } addHandlers(handlers, dynamicHandlers?.value) addHoverHandlers( handlers, style.value, - propertiesSignal.value, + // @ts-expect-error + hoverPropsSignal.value, defaultProperties.value, hoveredSignal, defaultCursor, ) - addActiveHandlers(handlers, style.value, propertiesSignal.value, defaultProperties.value, activeSignal) + addActiveHandlers( + handlers, + style.value, + // @ts-expect-error + activePropsSignal.value, + defaultProperties.value, + activeSignal, + ) return handlers }) } diff --git a/packages/uikit/src/scroll.ts b/packages/uikit/src/scroll.ts index b22d1a8f..32c6601a 100644 --- a/packages/uikit/src/scroll.ts +++ b/packages/uikit/src/scroll.ts @@ -256,6 +256,13 @@ export function computedScrollHandlers( object.current!.worldToLocal(localPointHelper.copy(event.point)) distanceHelper.copy(localPointHelper).sub(prevInteraction.localPoint) distanceHelper.divideScalar(root.pixelSize.peek()) + + const timestamp = performance.now(); + const deltaTime = timestamp - (prevInteraction as any).timestamp; + + if (distanceHelper.length() < 15 && deltaTime < 200 && (event as any).pointerState?.type === 'xrController') { + return; + } prevInteraction.localPoint.copy(localPointHelper) if (prevInteraction.type === 'scroll-bar') { @@ -275,8 +282,6 @@ export function computedScrollHandlers( scroll(event, distanceHelper.x, -distanceHelper.y, undefined, false) return } - const timestamp = performance.now() - const deltaTime = timestamp - prevInteraction.timestamp scroll(event, -distanceHelper.x, distanceHelper.y, deltaTime, true) prevInteraction.timestamp = timestamp }, diff --git a/packages/uikit/src/text/font.ts b/packages/uikit/src/text/font.ts index fdd9734c..7ae91f58 100644 --- a/packages/uikit/src/text/font.ts +++ b/packages/uikit/src/text/font.ts @@ -4,7 +4,6 @@ import { MergedProperties } from '../properties/merged.js' import { Initializers } from '../utils.js' import { loadCachedFont } from './cache.js' import { computedInheritableProperty } from '../properties/index.js' -import { inter } from '@pmndrs/msdfonts' export type FontFamilyWeightMap = Partial> @@ -28,7 +27,7 @@ export type FontWeight = keyof typeof fontWeightNames | number export type FontFamilyProperties = { fontFamily?: string; fontWeight?: FontWeight } const defaultFontFamilyUrls: FontFamilies = { - inter, + inter: {}, } export function computedFont( diff --git a/packages/uikit/src/vanilla/container.ts b/packages/uikit/src/vanilla/container.ts index 199a1a27..48e60d82 100644 --- a/packages/uikit/src/vanilla/container.ts +++ b/packages/uikit/src/vanilla/container.ts @@ -28,6 +28,7 @@ export class Container extends this.contextSignal.value = undefined return } + // @ts-expect-error const internals = (this.internals = createContainer( parentContext, this.styleSignal, diff --git a/packages/uikit/src/vanilla/content.ts b/packages/uikit/src/vanilla/content.ts index f7ffb793..a991198b 100644 --- a/packages/uikit/src/vanilla/content.ts +++ b/packages/uikit/src/vanilla/content.ts @@ -35,6 +35,7 @@ export class Content extends C if (parentContext == null) { return } + // @ts-expect-error const internals = (this.internals = createContent( parentContext, this.styleSignal, diff --git a/packages/uikit/src/vanilla/custom.ts b/packages/uikit/src/vanilla/custom.ts index 3ef77430..0ba4f68a 100644 --- a/packages/uikit/src/vanilla/custom.ts +++ b/packages/uikit/src/vanilla/custom.ts @@ -32,6 +32,7 @@ export class CustomContainer e if (parentContext == null) { return } + // @ts-expect-error const internals = createCustomContainer( parentContext, this.styleSignal, diff --git a/packages/uikit/src/vanilla/icon.ts b/packages/uikit/src/vanilla/icon.ts index d58d2d35..1de5b2eb 100644 --- a/packages/uikit/src/vanilla/icon.ts +++ b/packages/uikit/src/vanilla/icon.ts @@ -33,6 +33,7 @@ export class Icon extends Comp if (parentContext == null) { return } + // @ts-expect-error const internals = (this.internals = createIcon( parentContext, text, diff --git a/packages/uikit/src/vanilla/image.ts b/packages/uikit/src/vanilla/image.ts index f1a49f68..68ba6594 100644 --- a/packages/uikit/src/vanilla/image.ts +++ b/packages/uikit/src/vanilla/image.ts @@ -28,6 +28,7 @@ export class Image extends Par if (parentContext == null) { return } + // @ts-expect-error const internals = (this.internals = createImage( parentContext, this.styleSignal, diff --git a/packages/uikit/src/vanilla/input.ts b/packages/uikit/src/vanilla/input.ts index 1344c693..98d96bd3 100644 --- a/packages/uikit/src/vanilla/input.ts +++ b/packages/uikit/src/vanilla/input.ts @@ -28,6 +28,7 @@ export class Input extends Com if (parentContext == null) { return } + // @ts-expect-error const internals = (this.internals = createInput( parentContext, parentContext.fontFamiliesSignal, diff --git a/packages/uikit/src/vanilla/root.ts b/packages/uikit/src/vanilla/root.ts index 28a4fddb..9328a24a 100644 --- a/packages/uikit/src/vanilla/root.ts +++ b/packages/uikit/src/vanilla/root.ts @@ -45,6 +45,7 @@ export class Root extends Pare } getCamera = () => cam } + // @ts-expect-error const internals = (this.internals = createRoot( computed(() => readReactive(this.pixelSizeSignal.value) ?? DEFAULT_PIXEL_SIZE), this.styleSignal, diff --git a/packages/uikit/src/vanilla/svg.ts b/packages/uikit/src/vanilla/svg.ts index 52e50346..73a11bae 100644 --- a/packages/uikit/src/vanilla/svg.ts +++ b/packages/uikit/src/vanilla/svg.ts @@ -29,6 +29,7 @@ export class Svg extends Paren this.contextSignal.value = undefined return } + // @ts-expect-error const internals = (this.internals = createSvg( parentContext, this.styleSignal, diff --git a/packages/uikit/src/vanilla/text.ts b/packages/uikit/src/vanilla/text.ts index 78d87c8e..40b4491d 100644 --- a/packages/uikit/src/vanilla/text.ts +++ b/packages/uikit/src/vanilla/text.ts @@ -34,6 +34,7 @@ export class Text extends Comp if (parentContext == null) { return } + // @ts-expect-error const internals = (this.internals = createText( parentContext, this.textSignal,