@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 6.82 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index.cjs765.js"),S=require("./index.cjs681.js");var A;function q(){if(A)return n.__exports;A=1;var s=n.__exports&&n.__exports.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(i[u]=o[u])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),c=n.__exports&&n.__exports.__assign||function(){return c=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},c.apply(this,arguments)};Object.defineProperty(n.__exports,"__esModule",{value:!0}),n.__exports.cloneNode=n.__exports.hasChildren=n.__exports.isDocument=n.__exports.isDirective=n.__exports.isComment=n.__exports.isText=n.__exports.isCDATA=n.__exports.isTag=n.__exports.Element=n.__exports.Document=n.__exports.CDATA=n.__exports.NodeWithChildren=n.__exports.ProcessingInstruction=n.__exports.Comment=n.__exports.Text=n.__exports.DataNode=n.__exports.Node=void 0;var a=S.__require(),h=(function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),m(this,t)},e})();n.__exports.Node=h;var p=(function(e){s(t,e);function t(r){var i=e.call(this)||this;return i.data=r,i}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(r){this.data=r},enumerable:!1,configurable:!0}),t})(h);n.__exports.DataNode=p;var d=(function(e){s(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=a.ElementType.Text,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t})(p);n.__exports.Text=d;var b=(function(e){s(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=a.ElementType.Comment,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t})(p);n.__exports.Comment=b;var g=(function(e){s(t,e);function t(r,i){var o=e.call(this,i)||this;return o.name=r,o.type=a.ElementType.Directive,o}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t})(p);n.__exports.ProcessingInstruction=g;var f=(function(e){s(t,e);function t(r){var i=e.call(this)||this;return i.children=r,i}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var r;return(r=this.children[0])!==null&&r!==void 0?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(r){this.children=r},enumerable:!1,configurable:!0}),t})(h);n.__exports.NodeWithChildren=f;var v=(function(e){s(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=a.ElementType.CDATA,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t})(f);n.__exports.CDATA=v;var T=(function(e){s(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=a.ElementType.Root,r}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t})(f);n.__exports.Document=T;var C=(function(e){s(t,e);function t(r,i,o,u){o===void 0&&(o=[]),u===void 0&&(u=r==="script"?a.ElementType.Script:r==="style"?a.ElementType.Style:a.ElementType.Tag);var l=e.call(this,o)||this;return l.name=r,l.attribs=i,l.type=u,l}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(r){this.name=r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var r=this;return Object.keys(this.attribs).map(function(i){var o,u;return{name:i,value:r.attribs[i],namespace:(o=r["x-attribsNamespace"])===null||o===void 0?void 0:o[i],prefix:(u=r["x-attribsPrefix"])===null||u===void 0?void 0:u[i]}})},enumerable:!1,configurable:!0}),t})(f);n.__exports.Element=C;function P(e){return(0,a.isTag)(e)}n.__exports.isTag=P;function O(e){return e.type===a.ElementType.CDATA}n.__exports.isCDATA=O;function N(e){return e.type===a.ElementType.Text}n.__exports.isText=N;function D(e){return e.type===a.ElementType.Comment}n.__exports.isComment=D;function j(e){return e.type===a.ElementType.Directive}n.__exports.isDirective=j;function E(e){return e.type===a.ElementType.Root}n.__exports.isDocument=E;function w(e){return Object.prototype.hasOwnProperty.call(e,"children")}n.__exports.hasChildren=w;function m(e,t){t===void 0&&(t=!1);var r;if(N(e))r=new d(e.data);else if(D(e))r=new b(e.data);else if(P(e)){var i=t?x(e.children):[],o=new C(e.name,c({},e.attribs),i);i.forEach(function(I){return I.parent=o}),e.namespace!=null&&(o.namespace=e.namespace),e["x-attribsNamespace"]&&(o["x-attribsNamespace"]=c({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(o["x-attribsPrefix"]=c({},e["x-attribsPrefix"])),r=o}else if(O(e)){var i=t?x(e.children):[],u=new v(i);i.forEach(function(y){return y.parent=u}),r=u}else if(E(e)){var i=t?x(e.children):[],l=new T(i);i.forEach(function(y){return y.parent=l}),e["x-mode"]&&(l["x-mode"]=e["x-mode"]),r=l}else if(j(e)){var _=new g(e.name,e.data);e["x-name"]!=null&&(_["x-name"]=e["x-name"],_["x-publicId"]=e["x-publicId"],_["x-systemId"]=e["x-systemId"]),r=_}else throw new Error("Not implemented yet: ".concat(e.type));return r.startIndex=e.startIndex,r.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(r.sourceCodeLocation=e.sourceCodeLocation),r}n.__exports.cloneNode=m;function x(e){for(var t=e.map(function(i){return m(i,!0)}),r=1;r<t.length;r++)t[r].prev=t[r-1],t[r-1].next=t[r];return t}return n.__exports}exports.__require=q;
//# sourceMappingURL=index.cjs716.js.map