@lightningjs/solid
Advanced tools
Comparing version 0.15.0 to 0.15.1
@@ -333,3 +333,3 @@ import { createSignal, mergeProps as mergeProps$1, createRoot, createRenderEffect, createMemo, createComponent as createComponent$1, untrack, splitProps } from 'solid-js'; | ||
// text node hasnt loaded yet - skip layout | ||
if (c.name === 'text' && !(c.width || c.height)) { | ||
if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) { | ||
return false; | ||
@@ -497,65 +497,2 @@ } | ||
this.children = new Children(this); | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(this, key, { | ||
get() { | ||
return this.lng && this.lng[key] || this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
} | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(this, key, { | ||
get() { | ||
return this.lng && this.lng[key] || this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
} | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(this, { | ||
borderRadius: { | ||
set(radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ | ||
radius: { | ||
radius | ||
} | ||
} | ||
}; | ||
}, | ||
get() { | ||
return this._borderRadius; | ||
} | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom') | ||
}); | ||
Object.defineProperties(this, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ | ||
linearGradient: props | ||
} | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
} | ||
} | ||
}); | ||
} | ||
@@ -902,3 +839,66 @@ get effects() { | ||
} | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
} | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
} | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(ElementNode.prototype, { | ||
borderRadius: { | ||
set(radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ | ||
radius: { | ||
radius | ||
} | ||
} | ||
}; | ||
}, | ||
get() { | ||
return this._borderRadius; | ||
} | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom') | ||
}); | ||
Object.defineProperties(ElementNode.prototype, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ | ||
linearGradient: props | ||
} | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
} | ||
} | ||
}); | ||
/* | ||
@@ -905,0 +905,0 @@ * Copyright 2023 Comcast Cable Communications Management, LLC |
@@ -27,3 +27,3 @@ /* | ||
// text node hasnt loaded yet - skip layout | ||
if (c.name === 'text' && !(c.width || c.height)) { | ||
if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) { | ||
return false; | ||
@@ -30,0 +30,0 @@ } |
@@ -146,58 +146,2 @@ /* | ||
this.children = new Children(this); | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(this, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) || this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
}, | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(this, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) || this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
}, | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(this, { | ||
borderRadius: { | ||
set(radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ radius: { radius } }, | ||
}; | ||
}, | ||
get() { | ||
return this._borderRadius; | ||
}, | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom'), | ||
}); | ||
Object.defineProperties(this, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ linearGradient: props }, | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
}, | ||
}, | ||
}); | ||
} | ||
@@ -549,1 +493,57 @@ get effects() { | ||
} | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
}, | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
}, | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(ElementNode.prototype, { | ||
borderRadius: { | ||
set(radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ radius: { radius } }, | ||
}; | ||
}, | ||
get() { | ||
return this._borderRadius; | ||
}, | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom'), | ||
}); | ||
Object.defineProperties(ElementNode.prototype, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ linearGradient: props }, | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
}, | ||
}, | ||
}); |
import { createShader } from '../lightningInit.js'; | ||
import { type IntrinsicCommonProps, type NodeStyles, type TextStyles } from '../../index.js'; | ||
import { type BorderStyleObject, type IntrinsicCommonProps, type NodeStyles, type TextStyles } from '../../index.js'; | ||
import Children from './children.js'; | ||
@@ -50,8 +50,8 @@ import States, { type NodeStates } from './states.js'; | ||
private _color?; | ||
private _borderRadius?; | ||
private _border?; | ||
private _borderLeft?; | ||
private _borderRight?; | ||
private _borderTop?; | ||
private _borderBottom?; | ||
_borderRadius?: number; | ||
_border?: BorderStyleObject; | ||
_borderLeft?: BorderStyleObject; | ||
_borderRight?: BorderStyleObject; | ||
_borderTop?: BorderStyleObject; | ||
_borderBottom?: BorderStyleObject; | ||
_autosized?: boolean; | ||
@@ -58,0 +58,0 @@ _isDirty?: boolean; |
{ | ||
"name": "@lightningjs/solid", | ||
"version": "0.15.0", | ||
"version": "0.15.1", | ||
"description": "Lightning renderer for solid universal", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -29,3 +29,3 @@ /* | ||
// text node hasnt loaded yet - skip layout | ||
if (c.name === 'text' && !(c.width || c.height)) { | ||
if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) { | ||
return false; | ||
@@ -32,0 +32,0 @@ } |
@@ -195,8 +195,8 @@ /* | ||
private _color?: number; | ||
private _borderRadius?: number; | ||
private _border?: BorderStyleObject; | ||
private _borderLeft?: BorderStyleObject; | ||
private _borderRight?: BorderStyleObject; | ||
private _borderTop?: BorderStyleObject; | ||
private _borderBottom?: BorderStyleObject; | ||
public _borderRadius?: number; | ||
public _border?: BorderStyleObject; | ||
public _borderLeft?: BorderStyleObject; | ||
public _borderRight?: BorderStyleObject; | ||
public _borderTop?: BorderStyleObject; | ||
public _borderBottom?: BorderStyleObject; | ||
public _autosized?: boolean; // Public but uses _ prefix | ||
@@ -219,62 +219,2 @@ public _isDirty?: boolean; // Public but uses _ prefix | ||
this.children = new Children(this); | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(this, key, { | ||
get(): number { | ||
return (this.lng && this.lng[key]) || this[`_${key}`]; | ||
}, | ||
set(v: number) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
}, | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(this, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) || this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
}, | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(this, { | ||
borderRadius: { | ||
set(this: ElementNode, radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ radius: { radius } }, | ||
}; | ||
}, | ||
get(this: ElementNode) { | ||
return this._borderRadius; | ||
}, | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom'), | ||
}); | ||
Object.defineProperties(this, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ linearGradient: props }, | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
}, | ||
}, | ||
}); | ||
} | ||
@@ -692,1 +632,61 @@ | ||
} | ||
for (const key of LightningRendererNumberProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get(): number { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v: number) { | ||
this[`_${key}`] = v; | ||
this._sendToLightningAnimatable(key, v); | ||
}, | ||
}); | ||
} | ||
for (const key of LightningRendererNonAnimatingProps) { | ||
Object.defineProperty(ElementNode.prototype, key, { | ||
get() { | ||
return (this.lng && this.lng[key]) ?? this[`_${key}`]; | ||
}, | ||
set(v) { | ||
this[`_${key}`] = v; | ||
this._sendToLightning(key, v); | ||
}, | ||
}); | ||
} | ||
// Add Border Helpers | ||
Object.defineProperties(ElementNode.prototype, { | ||
borderRadius: { | ||
set(this: ElementNode, radius) { | ||
this._borderRadius = radius; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ radius: { radius } }, | ||
}; | ||
}, | ||
get(this: ElementNode) { | ||
return this._borderRadius; | ||
}, | ||
}, | ||
border: borderAccessor(), | ||
borderLeft: borderAccessor('Left'), | ||
borderRight: borderAccessor('Right'), | ||
borderTop: borderAccessor('Top'), | ||
borderBottom: borderAccessor('Bottom'), | ||
}); | ||
Object.defineProperties(ElementNode.prototype, { | ||
linearGradient: { | ||
set(props = {}) { | ||
this._linearGradient = props; | ||
this.effects = { | ||
...(this.effects || {}), | ||
...{ linearGradient: props }, | ||
}; | ||
}, | ||
get() { | ||
return this._linearGradient; | ||
}, | ||
}, | ||
}); |
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
265235