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
|
-
(
|
|
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
|
-
(
|
|
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-
|
|
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-
|
|
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.
|
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require__utils = require("./_utils-
|
|
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;
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { f as Fragment, p as createElement } from "./_utils-
|
|
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 };
|