@lightningjs/solid
Advanced tools
Comparing version 0.11.2 to 0.11.3
@@ -848,6 +848,12 @@ import { createSignal, mergeProps as mergeProps$1, createRoot, createRenderEffect, createMemo, createComponent as createComponent$1, untrack, createEffect } from 'solid-js'; | ||
} | ||
const Canvas = props => { | ||
const Canvas = (props = {}) => { | ||
const renderer = startLightningRenderer(props.options); | ||
const init = renderer.init(); | ||
function rootRef(root) { | ||
root.renderer = renderer; | ||
if (isFunc(props.ref)) { | ||
props.ref(root); | ||
} else { | ||
props.ref = root; | ||
} | ||
init.then(() => { | ||
@@ -854,0 +860,0 @@ root.lng = renderer.root; |
@@ -28,6 +28,13 @@ /* | ||
} | ||
export const Canvas = (props) => { | ||
export const Canvas = (props = {}) => { | ||
const renderer = startLightningRenderer(props.options); | ||
const init = renderer.init(); | ||
function rootRef(root) { | ||
root.renderer = renderer; | ||
if (isFunc(props.ref)) { | ||
props.ref(root); | ||
} | ||
else { | ||
props.ref = root; | ||
} | ||
init.then(() => { | ||
@@ -34,0 +41,0 @@ root.lng = renderer.root; |
@@ -100,2 +100,3 @@ /* | ||
lng = null; | ||
renderer; | ||
selected; | ||
@@ -102,0 +103,0 @@ rendered; |
import { type JSX } from "solid-js"; | ||
import { type SolidRendererOptions } from '../core/renderer/index.js'; | ||
import { ElementNode } from "../core/node/index.js"; | ||
export interface CanvasOptions { | ||
@@ -8,6 +9,7 @@ coreExtensionModule?: string; | ||
export interface CanvasProps { | ||
ref?: ElementNode | ((node: ElementNode) => void) | null; | ||
options?: Partial<SolidRendererOptions>; | ||
onFirstRender?: (callback: () => void) => void; | ||
onFirstRender?: (callback: (root: ElementNode) => void) => void; | ||
children?: JSX.Element; | ||
} | ||
export declare const Canvas: (props: CanvasProps) => JSX.Element; | ||
export declare const Canvas: (props?: CanvasProps) => JSX.Element; |
@@ -5,3 +5,3 @@ import { createShader } from '../renderer/index.js'; | ||
import States, { type NodeStates } from './states.js'; | ||
import type { INode, INodeAnimatableProps, INodeWritableProps, ShaderRef, Dimensions, AnimationSettings } from '@lightningjs/renderer'; | ||
import type { RendererMain, INode, INodeAnimatableProps, INodeWritableProps, ShaderRef, Dimensions, AnimationSettings } from '@lightningjs/renderer'; | ||
export interface TextNode { | ||
@@ -34,2 +34,3 @@ name: string; | ||
lng: INode | null; | ||
renderer?: RendererMain; | ||
selected?: number; | ||
@@ -36,0 +37,0 @@ rendered: boolean; |
{ | ||
"name": "@lightningjs/solid", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "Lightning renderer for solid universal", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -32,2 +32,3 @@ /* | ||
import type { | ||
RendererMain, | ||
INode, | ||
@@ -158,2 +159,3 @@ INodeAnimatableProps, | ||
lng: INode | null = null; | ||
renderer?: RendererMain; | ||
selected?: number; | ||
@@ -160,0 +162,0 @@ rendered: boolean; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
286614
4454