veles 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,11 +108,20 @@ function executeComponent({ element, props }) {
108
108
  }
109
109
  //#endregion
110
110
  //#region src/create-element/parse-children.ts
111
+ function flattenChildren(children) {
112
+ const flattenedChildren = [];
113
+ function append(child) {
114
+ if (Array.isArray(child)) child.forEach(append);
115
+ else flattenedChildren.push(child);
116
+ }
117
+ append(children);
118
+ return flattenedChildren;
119
+ }
111
120
  function parseChildren({ children, htmlElement, velesNode, portal }) {
112
121
  const childComponents = [];
113
122
  if (children === void 0 || children === null) return childComponents;
114
123
  let lastInsertedNode = null;
115
- (Array.isArray(children) ? children : [children]).forEach((childComponent) => {
124
+ flattenChildren(children).forEach((childComponent) => {
116
125
  if (typeof childComponent === "string") {
117
126
  const textNode = createTextElement(childComponent);
118
127
  htmlElement.append(textNode.html);
@@ -108,11 +108,20 @@ function executeComponent({ element, props }) {
108
108
  }
109
109
  //#endregion
110
110
  //#region src/create-element/parse-children.ts
111
+ function flattenChildren(children) {
112
+ const flattenedChildren = [];
113
+ function append(child) {
114
+ if (Array.isArray(child)) child.forEach(append);
115
+ else flattenedChildren.push(child);
116
+ }
117
+ append(children);
118
+ return flattenedChildren;
119
+ }
111
120
  function parseChildren({ children, htmlElement, velesNode, portal }) {
112
121
  const childComponents = [];
113
122
  if (children === void 0 || children === null) return childComponents;
114
123
  let lastInsertedNode = null;
115
- (Array.isArray(children) ? children : [children]).forEach((childComponent) => {
124
+ flattenChildren(children).forEach((childComponent) => {
116
125
  if (typeof childComponent === "string") {
117
126
  const textNode = createTextElement(childComponent);
118
127
  htmlElement.append(textNode.html);
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require__utils = require("./_utils-DnT1tr2L.cjs");
2
+ const require__utils = require("./_utils-DbrPydEE.cjs");
3
3
  //#region src/attach-component.ts
4
4
  /**
5
5
  * Attach Veles component tree to a regular HTML node.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as onMount, a as identity, c as addPublicContext, d as popPublicContext, f as Fragment, g as hasCurrentLifecycleContext, h as createTextElement, i as getMountedNodeExecutedVersion, l as createContext, m as assignDomAttribute, n as callUnmountHandlers, o as renderTree, p as createElement, r as getExecutedComponentVelesNode, s as unique, t as callMountHandlers, u as getCurrentContext, v as onUnmount } from "./_utils-DxfFNKLL.js";
1
+ import { _ as onMount, a as identity, c as addPublicContext, d as popPublicContext, f as Fragment, g as hasCurrentLifecycleContext, h as createTextElement, i as getMountedNodeExecutedVersion, l as createContext, m as assignDomAttribute, n as callUnmountHandlers, o as renderTree, p as createElement, r as getExecutedComponentVelesNode, s as unique, t as callMountHandlers, u as getCurrentContext, v as onUnmount } from "./_utils-BnAXelPu.js";
2
2
  //#region src/attach-component.ts
3
3
  /**
4
4
  * Attach Veles component tree to a regular HTML node.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require__utils = require("./_utils-DnT1tr2L.cjs");
2
+ const require__utils = require("./_utils-DbrPydEE.cjs");
3
3
  exports.Fragment = require__utils.Fragment;
4
4
  exports.jsx = require__utils.createElement;
5
5
  exports.jsxDEV = require__utils.createElement;
@@ -1,2 +1,2 @@
1
- import { f as Fragment, p as createElement } from "./_utils-DxfFNKLL.js";
1
+ import { f as Fragment, p as createElement } from "./_utils-BnAXelPu.js";
2
2
  export { Fragment, createElement as jsx, createElement as jsxDEV, createElement as jsxs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veles",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "UI library with main focus on performance",
5
5
  "keywords": [
6
6
  "JavaScript",