@lightningtv/core
Advanced tools
Comparing version 0.0.1 to 0.0.2
import { renderer, createShader } from './lightningInit.js'; | ||
import {} from './intrinsicTypes.js'; | ||
import Children from './children.js'; | ||
import States, {} from './states.js'; | ||
import States from './states.js'; | ||
import calculateFlex from './flex.js'; | ||
@@ -9,3 +8,2 @@ import { log, isArray, isNumber, isFunc, keyExists, flattenStyles, } from './utils.js'; | ||
import { assertTruthy } from '@lightningjs/renderer/utils'; | ||
import { NodeTypes } from './nodeTypes.js'; | ||
const layoutQueue = new Set(); | ||
@@ -124,3 +122,3 @@ let queueLayout = true; | ||
super(); | ||
this.type = name === 'text' ? NodeTypes.TextNode : NodeTypes.Element; | ||
this.type = name === 'text' ? 1 /* NodeTypes.TextNode */ : 0 /* NodeTypes.Element */; | ||
this.rendered = false; | ||
@@ -224,3 +222,3 @@ this.lng = {}; | ||
isTextNode() { | ||
return this.type === NodeTypes.TextNode; | ||
return this.type === 1 /* NodeTypes.TextNode */; | ||
} | ||
@@ -484,3 +482,3 @@ _layoutOnLoad() { | ||
} | ||
if (node.type === NodeTypes.Element) { | ||
if (node.type === 0 /* NodeTypes.Element */) { | ||
// only element nodes will have children that need rendering | ||
@@ -487,0 +485,0 @@ for (let i = 0; i < node.children.length; i++) { |
import { assertTruthy } from '@lightningjs/renderer/utils'; | ||
import {} from './elementNode.js'; | ||
import { NodeTypes } from './nodeTypes.js'; | ||
export default function (node) { | ||
@@ -10,3 +8,3 @@ const children = []; | ||
// Filter empty text nodes which are place holders for <Show> and elements missing dimensions | ||
if (c.type === NodeTypes.Text) { | ||
if (c.type === 2 /* NodeTypes.Text */) { | ||
continue; | ||
@@ -19,3 +17,3 @@ } | ||
// text node hasnt loaded yet - skip layout | ||
if (c.type === NodeTypes.TextNode && c.text && !(c.width || c.height)) { | ||
if (c.type === 1 /* NodeTypes.TextNode */ && c.text && !(c.width || c.height)) { | ||
return false; | ||
@@ -22,0 +20,0 @@ } |
@@ -1,7 +0,2 @@ | ||
export var NodeTypes; | ||
(function (NodeTypes) { | ||
NodeTypes[NodeTypes["Element"] = 0] = "Element"; | ||
NodeTypes[NodeTypes["TextNode"] = 1] = "TextNode"; | ||
NodeTypes[NodeTypes["Text"] = 2] = "Text"; | ||
})(NodeTypes || (NodeTypes = {})); | ||
export {}; | ||
//# sourceMappingURL=nodeTypes.js.map |
{ | ||
"name": "@lightningtv/core", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Lightning TV Core for Universal Renderers", | ||
"type": "module", | ||
"source": "src/index.ts", | ||
"main": "./dist/src/index.js", | ||
"types": "./dist/src/index.d.ts", | ||
"sideEffects": false, | ||
@@ -10,0 +8,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
149050
2193