502 lines
47 KiB
JavaScript
502 lines
47 KiB
JavaScript
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||
|
if(typeof exports === 'object' && typeof module === 'object')
|
||
|
module.exports = factory();
|
||
|
else if(typeof define === 'function' && define.amd)
|
||
|
define([], factory);
|
||
|
else if(typeof exports === 'object')
|
||
|
exports["demo"] = factory();
|
||
|
else
|
||
|
root["demo"] = factory();
|
||
|
})(this, function() {
|
||
|
return /******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
/******/
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
/******/
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId]) {
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
/******/ }
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ i: moduleId,
|
||
|
/******/ l: false,
|
||
|
/******/ exports: {}
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
/******/
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.l = true;
|
||
|
/******/
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
/******/
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
/******/
|
||
|
/******/ // define getter function for harmony exports
|
||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||
|
/******/ }
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // define __esModule on exports
|
||
|
/******/ __webpack_require__.r = function(exports) {
|
||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
|
/******/ }
|
||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // create a fake namespace object
|
||
|
/******/ // mode & 1: value is a module id, require it
|
||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||
|
/******/ // mode & 4: return value when already ns object
|
||
|
/******/ // mode & 8|1: behave like require
|
||
|
/******/ __webpack_require__.t = function(value, mode) {
|
||
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
||
|
/******/ if(mode & 8) return value;
|
||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||
|
/******/ var ns = Object.create(null);
|
||
|
/******/ __webpack_require__.r(ns);
|
||
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||
|
/******/ return ns;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
|
/******/ __webpack_require__.n = function(module) {
|
||
|
/******/ var getter = module && module.__esModule ?
|
||
|
/******/ function getDefault() { return module['default']; } :
|
||
|
/******/ function getModuleExports() { return module; };
|
||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||
|
/******/ return getter;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||
|
/******/
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "";
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.tsx");
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ({
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/constants.js":
|
||
|
/*!*********************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/constants.js ***!
|
||
|
\*********************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.NODE_TYPE = void 0;
|
||
|
var NODE_TYPE;
|
||
|
(function (NODE_TYPE) {
|
||
|
NODE_TYPE["ELEMENT"] = "element";
|
||
|
NODE_TYPE["TEXT"] = "text";
|
||
|
NODE_TYPE["COMPONENT"] = "component";
|
||
|
NODE_TYPE["FRAGMENT"] = "fragment";
|
||
|
})(NODE_TYPE = exports.NODE_TYPE || (exports.NODE_TYPE = {}));
|
||
|
;
|
||
|
//# sourceMappingURL=constants.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/jsx.js":
|
||
|
/*!***************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/jsx.js ***!
|
||
|
\***************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.Fragment = exports.jsx = void 0;
|
||
|
const ElementNode_1 = __webpack_require__(/*! ./node/ElementNode */ "./node_modules/async-jsx-html/nodejs/node/ElementNode.js");
|
||
|
const ComponentNode_1 = __webpack_require__(/*! ./node/ComponentNode */ "./node_modules/async-jsx-html/nodejs/node/ComponentNode.js");
|
||
|
exports.jsx = (element, props, ...children) => {
|
||
|
const nodeProps = props || {};
|
||
|
if (typeof element === 'string') {
|
||
|
return new ElementNode_1.ElementNode(element, nodeProps, children);
|
||
|
}
|
||
|
if (typeof element === 'function') {
|
||
|
return new ComponentNode_1.ComponentNode(element, nodeProps, children);
|
||
|
}
|
||
|
throw new TypeError(`Expected jsx element to be a string or a function`);
|
||
|
};
|
||
|
exports.Fragment = (props, children) => {
|
||
|
return children;
|
||
|
};
|
||
|
//# sourceMappingURL=jsx.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/mod.js":
|
||
|
/*!***************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/mod.js ***!
|
||
|
\***************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.React = exports.Fragment = exports.jsx = void 0;
|
||
|
const jsx_1 = __webpack_require__(/*! ./jsx */ "./node_modules/async-jsx-html/nodejs/jsx.js");
|
||
|
Object.defineProperty(exports, "jsx", { enumerable: true, get: function () { return jsx_1.jsx; } });
|
||
|
Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return jsx_1.Fragment; } });
|
||
|
var ElementNode_1 = __webpack_require__(/*! ./node/ElementNode */ "./node_modules/async-jsx-html/nodejs/node/ElementNode.js");
|
||
|
Object.defineProperty(exports, "ElementNode", { enumerable: true, get: function () { return ElementNode_1.ElementNode; } });
|
||
|
var ComponentNode_1 = __webpack_require__(/*! ./node/ComponentNode */ "./node_modules/async-jsx-html/nodejs/node/ComponentNode.js");
|
||
|
Object.defineProperty(exports, "ComponentNode", { enumerable: true, get: function () { return ComponentNode_1.ComponentNode; } });
|
||
|
exports.React = {
|
||
|
Fragment: jsx_1.Fragment,
|
||
|
createElement(element, props, ...children) {
|
||
|
return jsx_1.jsx(element, props, ...children);
|
||
|
}
|
||
|
};
|
||
|
//# sourceMappingURL=mod.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/ComponentNode.js":
|
||
|
/*!******************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/ComponentNode.js ***!
|
||
|
\******************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
|
});
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.ComponentNode = void 0;
|
||
|
const constants_1 = __webpack_require__(/*! ../constants */ "./node_modules/async-jsx-html/nodejs/constants.js");
|
||
|
const FragmentNode_1 = __webpack_require__(/*! ./FragmentNode */ "./node_modules/async-jsx-html/nodejs/node/FragmentNode.js");
|
||
|
const Node_1 = __webpack_require__(/*! ./Node */ "./node_modules/async-jsx-html/nodejs/node/Node.js");
|
||
|
const normalizeChildren_1 = __webpack_require__(/*! ./utils/normalizeChildren */ "./node_modules/async-jsx-html/nodejs/node/utils/normalizeChildren.js");
|
||
|
class ComponentNode extends Node_1.Node {
|
||
|
constructor(component, props, children) {
|
||
|
super(children);
|
||
|
this.component = component;
|
||
|
this.props = props;
|
||
|
this.type = constants_1.NODE_TYPE.COMPONENT;
|
||
|
}
|
||
|
render() {
|
||
|
return __awaiter(this, void 0, void 0, function* () {
|
||
|
return [].concat(yield this.renderComponent()).join('');
|
||
|
});
|
||
|
}
|
||
|
renderComponent() {
|
||
|
return __awaiter(this, void 0, void 0, function* () {
|
||
|
const child = yield this.component(this.props, this.children);
|
||
|
const children = normalizeChildren_1.normalizeChildren(Array.isArray(child) ? child : [child]);
|
||
|
if (children.length === 1) {
|
||
|
return children[0].render();
|
||
|
}
|
||
|
else if (children.length > 1) {
|
||
|
return new FragmentNode_1.FragmentNode(children).render();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
exports.ComponentNode = ComponentNode;
|
||
|
//# sourceMappingURL=ComponentNode.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/ElementNode.js":
|
||
|
/*!****************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/ElementNode.js ***!
|
||
|
\****************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
|
});
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.ElementNode = void 0;
|
||
|
const constants_1 = __webpack_require__(/*! ../constants */ "./node_modules/async-jsx-html/nodejs/constants.js");
|
||
|
const Node_1 = __webpack_require__(/*! ./Node */ "./node_modules/async-jsx-html/nodejs/node/Node.js");
|
||
|
const htmlEncode_1 = __webpack_require__(/*! ./utils/htmlEncode */ "./node_modules/async-jsx-html/nodejs/node/utils/htmlEncode.js");
|
||
|
const ELEMENT_PROP = {
|
||
|
INNER_HTML: 'innerHTML'
|
||
|
};
|
||
|
class ElementNode extends Node_1.Node {
|
||
|
constructor(name, props, children) {
|
||
|
super(children);
|
||
|
this.name = name;
|
||
|
this.props = props;
|
||
|
this.type = constants_1.NODE_TYPE.ELEMENT;
|
||
|
}
|
||
|
render() {
|
||
|
return __awaiter(this, void 0, void 0, function* () {
|
||
|
const renderedProps = this.propsToHTML();
|
||
|
const renderedChildren = typeof this.props[ELEMENT_PROP.INNER_HTML] === 'string' ? this.props[ELEMENT_PROP.INNER_HTML] : (yield this.renderChildren()).join('');
|
||
|
return renderedChildren ? `<${this.name}${renderedProps}>${renderedChildren}</${this.name}>` : `<${this.name}${renderedProps} />`;
|
||
|
});
|
||
|
}
|
||
|
getValidProps() {
|
||
|
const props = this.props;
|
||
|
return Object.keys(this.props).filter(key => {
|
||
|
if (key === ELEMENT_PROP.INNER_HTML) {
|
||
|
return false;
|
||
|
}
|
||
|
const val = props[key];
|
||
|
return typeof val === 'string' || typeof val === 'number' || val === true;
|
||
|
});
|
||
|
}
|
||
|
propsToHTML() {
|
||
|
const keys = this.getValidProps();
|
||
|
if (!keys.length) {
|
||
|
return '';
|
||
|
}
|
||
|
const props = this.props;
|
||
|
const pairs = keys.map(key => {
|
||
|
if (!/^[a-zA-Z0-9-:\._]+$/.test(key)) {
|
||
|
throw new Error(`Invalid attribute name format ${key}`);
|
||
|
}
|
||
|
const val = props[key];
|
||
|
return val === true || val === '' ? key : `${key}="${htmlEncode_1.doubleQuoteEncode(val.toString())}"`;
|
||
|
});
|
||
|
return ` ${pairs.join(' ')}`;
|
||
|
}
|
||
|
}
|
||
|
exports.ElementNode = ElementNode;
|
||
|
//# sourceMappingURL=ElementNode.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/FragmentNode.js":
|
||
|
/*!*****************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/FragmentNode.js ***!
|
||
|
\*****************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.FragmentNode = void 0;
|
||
|
const constants_1 = __webpack_require__(/*! ../constants */ "./node_modules/async-jsx-html/nodejs/constants.js");
|
||
|
const Node_1 = __webpack_require__(/*! ./Node */ "./node_modules/async-jsx-html/nodejs/node/Node.js");
|
||
|
class FragmentNode extends Node_1.Node {
|
||
|
constructor(children) {
|
||
|
super(children);
|
||
|
this.type = constants_1.NODE_TYPE.FRAGMENT;
|
||
|
}
|
||
|
render() {
|
||
|
return this.renderChildren();
|
||
|
}
|
||
|
}
|
||
|
exports.FragmentNode = FragmentNode;
|
||
|
//# sourceMappingURL=FragmentNode.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/Node.js":
|
||
|
/*!*********************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/Node.js ***!
|
||
|
\*********************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
|
});
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.Node = void 0;
|
||
|
const normalizeChildren_1 = __webpack_require__(/*! ./utils/normalizeChildren */ "./node_modules/async-jsx-html/nodejs/node/utils/normalizeChildren.js");
|
||
|
class Node {
|
||
|
constructor(children) {
|
||
|
this.children = children;
|
||
|
}
|
||
|
renderChildren() {
|
||
|
return __awaiter(this, void 0, void 0, function* () {
|
||
|
const result = [];
|
||
|
const children = normalizeChildren_1.normalizeChildren(this.children);
|
||
|
for (const child of children) {
|
||
|
const renderedChild = yield child.render();
|
||
|
if (renderedChild) {
|
||
|
if (Array.isArray(renderedChild)) {
|
||
|
renderedChild.forEach(subchild => subchild && result.push(subchild));
|
||
|
}
|
||
|
else {
|
||
|
result.push(renderedChild);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return result;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
exports.Node = Node;
|
||
|
//# sourceMappingURL=Node.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/TextNode.js":
|
||
|
/*!*************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/TextNode.js ***!
|
||
|
\*************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||
|
});
|
||
|
};
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.TextNode = void 0;
|
||
|
const constants_1 = __webpack_require__(/*! ../constants */ "./node_modules/async-jsx-html/nodejs/constants.js");
|
||
|
const htmlEncode_1 = __webpack_require__(/*! ./utils/htmlEncode */ "./node_modules/async-jsx-html/nodejs/node/utils/htmlEncode.js");
|
||
|
class TextNode {
|
||
|
constructor(text) {
|
||
|
this.text = text;
|
||
|
this.type = constants_1.NODE_TYPE.TEXT;
|
||
|
}
|
||
|
render() {
|
||
|
return __awaiter(this, void 0, void 0, function* () {
|
||
|
return htmlEncode_1.htmlEncode(this.text);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
exports.TextNode = TextNode;
|
||
|
//# sourceMappingURL=TextNode.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/utils/htmlEncode.js":
|
||
|
/*!*********************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/utils/htmlEncode.js ***!
|
||
|
\*********************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.htmlEncode = exports.doubleQuoteEncode = void 0;
|
||
|
function doubleQuoteEncode(text) {
|
||
|
return text.replace(/"/g, '"');
|
||
|
}
|
||
|
exports.doubleQuoteEncode = doubleQuoteEncode;
|
||
|
function htmlEncode(text) {
|
||
|
return doubleQuoteEncode(text.replace(/&/g, '&').replace(/\//g, '/').replace(/</g, '<').replace(/>/g, '>').replace(/'/g, '''));
|
||
|
}
|
||
|
exports.htmlEncode = htmlEncode;
|
||
|
//# sourceMappingURL=htmlEncode.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/async-jsx-html/nodejs/node/utils/normalizeChildren.js":
|
||
|
/*!****************************************************************************!*\
|
||
|
!*** ./node_modules/async-jsx-html/nodejs/node/utils/normalizeChildren.js ***!
|
||
|
\****************************************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.normalizeChildren = void 0;
|
||
|
const TextNode_1 = __webpack_require__(/*! ../TextNode */ "./node_modules/async-jsx-html/nodejs/node/TextNode.js");
|
||
|
const constants_1 = __webpack_require__(/*! ../../constants */ "./node_modules/async-jsx-html/nodejs/constants.js");
|
||
|
function normalizeChildren(children) {
|
||
|
const result = [];
|
||
|
for (const child of children) {
|
||
|
if (child && typeof child !== 'boolean') {
|
||
|
if (typeof child === 'string' || typeof child === 'number') {
|
||
|
result.push(new TextNode_1.TextNode(`${child}`));
|
||
|
}
|
||
|
else if (Array.isArray(child)) {
|
||
|
normalizeChildren(child).forEach(result.push);
|
||
|
}
|
||
|
else if (child.type === constants_1.NODE_TYPE.ELEMENT || child.type === constants_1.NODE_TYPE.TEXT || child.type === constants_1.NODE_TYPE.COMPONENT) {
|
||
|
result.push(child);
|
||
|
}
|
||
|
else {
|
||
|
throw new TypeError(`Unrecognized node type: ${typeof child}`);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return result;
|
||
|
}
|
||
|
exports.normalizeChildren = normalizeChildren;
|
||
|
//# sourceMappingURL=normalizeChildren.js.map
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/index.tsx":
|
||
|
/*!***********************!*\
|
||
|
!*** ./src/index.tsx ***!
|
||
|
\***********************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
"use strict";
|
||
|
|
||
|
exports.__esModule = true;
|
||
|
exports.Test = void 0;
|
||
|
var async_jsx_html_1 = __webpack_require__(/*! async-jsx-html */ "./node_modules/async-jsx-html/nodejs/mod.js");
|
||
|
function Test() {
|
||
|
return async_jsx_html_1.jsx("div", null, "Hello World");
|
||
|
}
|
||
|
exports.Test = Test;
|
||
|
|
||
|
|
||
|
/***/ })
|
||
|
|
||
|
/******/ });
|
||
|
});
|
||
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2Vz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