@lightningjs/solid
Advanced tools
Comparing version 0.15.7 to 0.15.8
@@ -615,10 +615,8 @@ import { createSignal, mergeProps as mergeProps$1, createRoot, createRenderEffect, createMemo, createComponent as createComponent$1, untrack, splitProps } from 'solid-js'; | ||
} | ||
_layoutOnTextLoad() { | ||
_layoutOnLoad() { | ||
this.lng.on('loaded', (_node, loadedPayload) => { | ||
if (loadedPayload.type === 'text') { | ||
const { | ||
dimensions | ||
} = loadedPayload; | ||
this.parent.updateLayout(this, dimensions); | ||
} | ||
const { | ||
dimensions | ||
} = loadedPayload; | ||
this.parent.updateLayout(this, dimensions); | ||
}); | ||
@@ -695,2 +693,5 @@ } | ||
} | ||
requiresLayout() { | ||
return this.display === 'flex' || this.onBeforeLayout; | ||
} | ||
updateLayout(child, dimensions) { | ||
@@ -766,3 +767,3 @@ if (this.hasChildren) { | ||
} | ||
if (parent.display === 'flex' && layoutQueue.indexOf(parent) === -1) { | ||
if (parent.requiresLayout() && layoutQueue.indexOf(parent) === -1) { | ||
layoutQueue.push(parent); | ||
@@ -809,4 +810,4 @@ if (queueLayout) { | ||
node.lng = renderer.createTextNode(props); | ||
if ((parent.display === 'flex' || parent.onBeforeLayout) && (!props.width || !props.height)) { | ||
node._layoutOnTextLoad(); | ||
if (parent.requiresLayout() && (!props.width || !props.height)) { | ||
node._layoutOnLoad(); | ||
} | ||
@@ -832,2 +833,5 @@ } else { | ||
} | ||
if (props.autosize && parent.requiresLayout()) { | ||
node._layoutOnLoad(); | ||
} | ||
if (node.onFail) { | ||
@@ -834,0 +838,0 @@ node.lng.on('failed', node.onFail); |
@@ -260,8 +260,6 @@ /* | ||
} | ||
_layoutOnTextLoad() { | ||
_layoutOnLoad() { | ||
this.lng.on('loaded', (_node, loadedPayload) => { | ||
if (loadedPayload.type === 'text') { | ||
const { dimensions } = loadedPayload; | ||
this.parent.updateLayout(this, dimensions); | ||
} | ||
const { dimensions } = loadedPayload; | ||
this.parent.updateLayout(this, dimensions); | ||
}); | ||
@@ -339,2 +337,5 @@ } | ||
} | ||
requiresLayout() { | ||
return this.display === 'flex' || this.onBeforeLayout; | ||
} | ||
updateLayout(child, dimensions) { | ||
@@ -408,3 +409,3 @@ if (this.hasChildren) { | ||
} | ||
if (parent.display === 'flex' && layoutQueue.indexOf(parent) === -1) { | ||
if (parent.requiresLayout() && layoutQueue.indexOf(parent) === -1) { | ||
layoutQueue.push(parent); | ||
@@ -453,5 +454,4 @@ if (queueLayout) { | ||
node.lng = renderer.createTextNode(props); | ||
if ((parent.display === 'flex' || parent.onBeforeLayout) && | ||
(!props.width || !props.height)) { | ||
node._layoutOnTextLoad(); | ||
if (parent.requiresLayout() && (!props.width || !props.height)) { | ||
node._layoutOnLoad(); | ||
} | ||
@@ -478,2 +478,5 @@ } | ||
} | ||
if (props.autosize && parent.requiresLayout()) { | ||
node._layoutOnLoad(); | ||
} | ||
if (node.onFail) { | ||
@@ -480,0 +483,0 @@ node.lng.on('failed', node.onFail); |
@@ -76,3 +76,3 @@ import { createShader } from '../lightningInit.js'; | ||
isTextNode(): boolean; | ||
_layoutOnTextLoad(): void; | ||
_layoutOnLoad(): void; | ||
getText(): string; | ||
@@ -91,2 +91,3 @@ destroy(): void; | ||
set animationSettings(animationSettings: Partial<AnimationSettings>); | ||
requiresLayout(): true | ((child: ElementNode, dimensions: Dimensions) => void); | ||
updateLayout(child?: ElementNode, dimensions?: Dimensions): void; | ||
@@ -93,0 +94,0 @@ _stateChanged(): void; |
{ | ||
"name": "@lightningjs/solid", | ||
"version": "0.15.7", | ||
"version": "0.15.8", | ||
"description": "Lightning renderer for solid universal", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -360,8 +360,6 @@ /* | ||
_layoutOnTextLoad() { | ||
_layoutOnLoad() { | ||
this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => { | ||
if (loadedPayload.type === 'text') { | ||
const { dimensions } = loadedPayload; | ||
this.parent!.updateLayout(this, dimensions); | ||
} | ||
const { dimensions } = loadedPayload; | ||
this.parent!.updateLayout(this, dimensions); | ||
}); | ||
@@ -454,2 +452,6 @@ } | ||
requiresLayout() { | ||
return this.display === 'flex' || this.onBeforeLayout; | ||
} | ||
updateLayout(child?: ElementNode, dimensions?: Dimensions) { | ||
@@ -543,3 +545,3 @@ if (this.hasChildren) { | ||
if (parent.display === 'flex' && layoutQueue.indexOf(parent) === -1) { | ||
if (parent.requiresLayout() && layoutQueue.indexOf(parent) === -1) { | ||
layoutQueue.push(parent); | ||
@@ -597,7 +599,4 @@ if (queueLayout) { | ||
if ( | ||
(parent.display === 'flex' || parent.onBeforeLayout) && | ||
(!props.width || !props.height) | ||
) { | ||
node._layoutOnTextLoad(); | ||
if (parent.requiresLayout() && (!props.width || !props.height)) { | ||
node._layoutOnLoad(); | ||
} | ||
@@ -627,2 +626,6 @@ } else { | ||
if (props.autosize && parent.requiresLayout()) { | ||
node._layoutOnLoad(); | ||
} | ||
if (node.onFail) { | ||
@@ -629,0 +632,0 @@ node.lng.on('failed', node.onFail); |
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
270502
4454