hyperscript-rxjs 1.0.12 → 1.1.0
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.
- package/dist/hyperscript-rxjs.js +1 -1
- package/package.json +26 -26
- package/readme.md +28 -17
package/dist/hyperscript-rxjs.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["rxjs","rxjs/operators"],t):"object"==typeof exports?exports.hyperscript=t(require("rxjs"),require("rxjs/operators")):r.hyperscript=t(r.rxjs,r.rxjs.operators)}(this,(function(r,t){return(()=>{"use strict";var e={443:r=>{r.exports=t},318:t=>{t.exports=r}},n={};function o(r){var t=n[r];if(void 0!==t)return t.exports;var u=n[r]={exports:{}};return e[r](u,u.exports,o),u.exports}o.d=(r,t)=>{for(var e in t)o.o(t,e)&&!o.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:t[e]})},o.o=(r,t)=>Object.prototype.hasOwnProperty.call(r,t),o.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var u={};return(()=>{o.r(u),o.d(u,{a:()=>c,abbr:()=>m,address:()=>s,area:()=>l,article:()=>p,aside:()=>y,audio:()=>A,b:()=>d,bdi:()=>b,bdo:()=>h,bindTabIndex:()=>it,blockquote:()=>E,br:()=>g,button:()=>v,caption:()=>T,checkbox:()=>Xr,choice:()=>et,cite:()=>O,code:()=>N,col:()=>x,colgroup:()=>I,collapse:()=>tt,data:()=>S,datalist:()=>D,dd:()=>L,del:()=>R,details:()=>C,dfn:()=>P,dialog:()=>j,div:()=>B,dl:()=>k,dt:()=>M,em:()=>U,fieldset:()=>H,figcaption:()=>G,figure:()=>w,flip:()=>nt,footer:()=>F,form:()=>q,fragment:()=>f,getDisplay:()=>st,h1:()=>V,h2:()=>_,h3:()=>K,h4:()=>Y,h5:()=>Q,h6:()=>W,header:()=>X,hgroup:()=>J,hr:()=>z,hyperscript:()=>i,i:()=>Z,img:()=>$,input:()=>rr,ins:()=>tr,kbd:()=>er,label:()=>nr,legend:()=>or,li:()=>ur,main:()=>ar,mark:()=>ir,menu:()=>fr,menuitem:()=>cr,meter:()=>mr,nav:()=>sr,numberbox:()=>Jr,ol:()=>lr,optgroup:()=>pr,option:()=>yr,output:()=>Ar,p:()=>dr,pre:()=>br,progress:()=>hr,q:()=>Er,radio:()=>zr,rb:()=>gr,rp:()=>vr,rt:()=>Tr,rtc:()=>Or,ruby:()=>Nr,s:()=>xr,samp:()=>Ir,section:()=>Sr,select:()=>Zr,small:()=>Dr,span:()=>Lr,strong:()=>Rr,sub:()=>Cr,summary:()=>Pr,sup:()=>jr,tabControl:()=>ft,tabNavItem:()=>ot,tabPanel:()=>ut,tabRoot:()=>at,table:()=>Br,tbody:()=>kr,td:()=>Mr,textNode:()=>Wr,textarea:()=>rt,textbox:()=>$r,tfoot:()=>Ur,th:()=>Hr,thead:()=>Gr,time:()=>wr,tr:()=>Fr,track:()=>qr,tt:()=>Vr,u:()=>_r,ul:()=>Kr,video:()=>Yr,wbr:()=>Qr});var r=o(318);const t=(r,t)=>{r.subscription?r.subscription.add(t):r.subscription=t};var e=o(443);function n(r,t,e){if("."===t.charAt(0)){let n=t.substring(1);e?r.classList.add(n):r.classList.remove(n)}else{let[n,o]=function(r,t){if(r.includes(".")){let e=r.split("."),n=e.pop();return[e.reduce(((r,t)=>r[t]),t),n]}return[t,r]}(t,r);n[o]=e}return r}function a(r,o,u){var a;let i=(a=u,(0,e.startWith)(0)(a).subscribe({next:t=>{n(r,o,t)},error(t){n(r,o,t.message)}}));return t(r,i),r}function i(e,...o){let u=document.createElement(e),{props:i,children:f}=function(r){let t={},e=[];if(r.length>0){let[n,...o]=r;null==n||Object.getPrototypeOf(n)===Object.prototype?(n&&(t=n),o.length>0&&(e=o)):e=r}return{props:t,children:e}}(o);return function(t,e){let[o,u]=function(t){let e={},n={};for(const o in t){let u=t[o];(0,r.isObservable)(u)?e[o]=u:n[o]=u}return[e,n]}(e);Object.entries(u).forEach((([r,e])=>{n(t,r,e)})),Object.entries(o).forEach((([r,e])=>{a(t,r,e)}))}(u,i),f=1===f.length&&Array.isArray(f[0])?f[0]:f,f.map((r=>{return(t=r)&&t.nodeType&&(t.nodeType===document.ELEMENT_NODE||t.nodeType===document.TEXT_NODE)?r:document.createTextNode(r);var t})).forEach((r=>{u.appendChild(r)})),u.pipeEvent=function(e){return(n,o)=>{let u=o((0,r.fromEvent)(e,n));return t(e,u),e}}(u),u.subscribeEvent=function(e){return(n,o)=>{let u=(0,r.fromEvent)(e,n).subscribe(o);return t(e,u),e}}(u),u}function f(...r){r=1===r.length&&Array.isArray(r[0])?r[0]:r;let t=new DocumentFragment;return r.forEach((r=>{t.appendChild(r)})),t}function c(r,...t){return i("a",...Array.from(arguments))}function m(r,...t){return i("abbr",...Array.from(arguments))}function s(r,...t){return i("address",...Array.from(arguments))}function l(r,...t){return i("area",...Array.from(arguments))}function p(r,...t){return i("article",...Array.from(arguments))}function y(r,...t){return i("aside",...Array.from(arguments))}function A(r,...t){return i("audio",...Array.from(arguments))}function d(r,...t){return i("b",...Array.from(arguments))}function b(r,...t){return i("bdi",...Array.from(arguments))}function h(r,...t){return i("bdo",...Array.from(arguments))}function E(r,...t){return i("blockquote",...Array.from(arguments))}function g(r,...t){return i("br",...Array.from(arguments))}function v(r,...t){return i("button",...Array.from(arguments))}function T(r,...t){return i("caption",...Array.from(arguments))}function O(r,...t){return i("cite",...Array.from(arguments))}function N(r,...t){return i("code",...Array.from(arguments))}function x(r,...t){return i("col",...Array.from(arguments))}function I(r,...t){return i("colgroup",...Array.from(arguments))}function S(r,...t){return i("data",...Array.from(arguments))}function D(r,...t){return i("datalist",...Array.from(arguments))}function L(r,...t){return i("dd",...Array.from(arguments))}function R(r,...t){return i("del",...Array.from(arguments))}function C(r,...t){return i("details",...Array.from(arguments))}function P(r,...t){return i("dfn",...Array.from(arguments))}function j(r,...t){return i("dialog",...Array.from(arguments))}function B(r,...t){return i("div",...Array.from(arguments))}function k(r,...t){return i("dl",...Array.from(arguments))}function M(r,...t){return i("dt",...Array.from(arguments))}function U(r,...t){return i("em",...Array.from(arguments))}function H(r,...t){return i("fieldset",...Array.from(arguments))}function G(r,...t){return i("figcaption",...Array.from(arguments))}function w(r,...t){return i("figure",...Array.from(arguments))}function F(r,...t){return i("footer",...Array.from(arguments))}function q(r,...t){return i("form",...Array.from(arguments))}function V(r,...t){return i("h1",...Array.from(arguments))}function _(r,...t){return i("h2",...Array.from(arguments))}function K(r,...t){return i("h3",...Array.from(arguments))}function Y(r,...t){return i("h4",...Array.from(arguments))}function Q(r,...t){return i("h5",...Array.from(arguments))}function W(r,...t){return i("h6",...Array.from(arguments))}function X(r,...t){return i("header",...Array.from(arguments))}function J(r,...t){return i("hgroup",...Array.from(arguments))}function z(r,...t){return i("hr",...Array.from(arguments))}function Z(r,...t){return i("i",...Array.from(arguments))}function $(r,...t){return i("img",...Array.from(arguments))}function rr(r,...t){return i("input",...Array.from(arguments))}function tr(r,...t){return i("ins",...Array.from(arguments))}function er(r,...t){return i("kbd",...Array.from(arguments))}function nr(r,...t){return i("label",...Array.from(arguments))}function or(r,...t){return i("legend",...Array.from(arguments))}function ur(r,...t){return i("li",...Array.from(arguments))}function ar(r,...t){return i("main",...Array.from(arguments))}function ir(r,...t){return i("mark",...Array.from(arguments))}function fr(r,...t){return i("menu",...Array.from(arguments))}function cr(r,...t){return i("menuitem",...Array.from(arguments))}function mr(r,...t){return i("meter",...Array.from(arguments))}function sr(r,...t){return i("nav",...Array.from(arguments))}function lr(r,...t){return i("ol",...Array.from(arguments))}function pr(r,...t){return i("optgroup",...Array.from(arguments))}function yr(r,...t){return i("option",...Array.from(arguments))}function Ar(r,...t){return i("output",...Array.from(arguments))}function dr(r,...t){return i("p",...Array.from(arguments))}function br(r,...t){return i("pre",...Array.from(arguments))}function hr(r,...t){return i("progress",...Array.from(arguments))}function Er(r,...t){return i("q",...Array.from(arguments))}function gr(r,...t){return i("rb",...Array.from(arguments))}function vr(r,...t){return i("rp",...Array.from(arguments))}function Tr(r,...t){return i("rt",...Array.from(arguments))}function Or(r,...t){return i("rtc",...Array.from(arguments))}function Nr(r,...t){return i("ruby",...Array.from(arguments))}function xr(r,...t){return i("s",...Array.from(arguments))}function Ir(r,...t){return i("samp",...Array.from(arguments))}function Sr(r,...t){return i("section",...Array.from(arguments))}function Dr(r,...t){return i("small",...Array.from(arguments))}function Lr(r,...t){return i("span",...Array.from(arguments))}function Rr(r,...t){return i("strong",...Array.from(arguments))}function Cr(r,...t){return i("sub",...Array.from(arguments))}function Pr(r,...t){return i("summary",...Array.from(arguments))}function jr(r,...t){return i("sup",...Array.from(arguments))}function Br(r,...t){return i("table",...Array.from(arguments))}function kr(r,...t){return i("tbody",...Array.from(arguments))}function Mr(r,...t){return i("td",...Array.from(arguments))}function Ur(r,...t){return i("tfoot",...Array.from(arguments))}function Hr(r,...t){return i("th",...Array.from(arguments))}function Gr(r,...t){return i("thead",...Array.from(arguments))}function wr(r,...t){return i("time",...Array.from(arguments))}function Fr(r,...t){return i("tr",...Array.from(arguments))}function qr(r,...t){return i("track",...Array.from(arguments))}function Vr(r,...t){return i("tt",...Array.from(arguments))}function _r(r,...t){return i("u",...Array.from(arguments))}function Kr(r,...t){return i("ul",...Array.from(arguments))}function Yr(r,...t){return i("video",...Array.from(arguments))}function Qr(r,...t){return i("wbr",...Array.from(arguments))}function Wr(t){if((0,r.isObservable)(t)){let r=document.createTextNode("");return t.subscribe({next:t=>{r.nodeValue=t},error:t=>{r.nodeValue=t.message}}),r}return document.createTextNode(t)}function Xr(r){let t=rr({...r,type:"checkbox"});return r.checked&&t.pipeEvent("input",(t=>t.pipe((0,e.map)((r=>r.target.checked))).subscribe(r.checked))),t}function Jr(t={}){let{number:n,...o}=t,u=rr({...o,type:"text"});if(n&&n instanceof r.BehaviorSubject){let r=n.pipe((0,e.map)((r=>String(r))));a(u,"value",r),u.pipeEvent("blur",(r=>r.pipe((0,e.map)((r=>Number(r.target.value)))).subscribe((r=>{Number.isNaN(r)?u.select():n.value!==r&&n.next(r)}))))}return u.style.textAlign="right",u}function zr(r){let t=rr({...r,type:"radio"});return r.checked&&t.pipeEvent("input",(t=>t.pipe((0,e.map)((r=>r.target.checked))).subscribe(r.checked))),t}function Zr(t,...n){let o=i("select",t,...n),{selectedIndex:u,value:a,...f}=t;return(0,r.isObservable)(u)&&(u.subscribe((r=>{o[r].selected=!0})),o.pipeEvent("input",(r=>r.pipe((0,e.map)((r=>r.target.selectedIndex))).subscribe(u)))),(0,r.isObservable)(a)&&(a.subscribe((r=>{Array.from(o.getElementsByTagName("option")).filter((t=>t.value===r)).forEach((r=>{r.selected=!0}))})),o.pipeEvent("input",(r=>r.pipe((0,e.map)((r=>r.target.value))).subscribe(a)))),o}function $r(r){let t=rr({...r,type:"text"});return t.pipeEvent("input",(t=>{var n;return n=t,(0,e.map)((r=>r.target.value))(n).subscribe(r.value)})),t}function rt(r){let t=i("textarea",r);return t.pipeEvent("input",(t=>{var n;return n=t,(0,e.map)((r=>r.target.value))(n).subscribe(r.value)})),t}const tt=(r,...t)=>((t=1===t.length&&Array.isArray(t[0])?t[0]:t).forEach((t=>{var n;a(t,".hidden",(n=r,(0,e.map)((r=>!r))(n)))})),t),et=(r,t)=>Object.entries(t).map((([t,n])=>{var o;return tt((o=r,(0,e.map)((r=>r===t))(o)),n)})).reduce(((r,t)=>[...r,...t]),[]);function nt(r,t,n){var o;return[...tt(r,t),...tt((o=r,(0,e.map)((r=>!r))(o)),n)]}function ot(...r){return ur({className:"nav-item"},v({type:"button",className:"btn btn-link nav-link"},...r))}function ut(...r){return B({className:"tab-pane"},...r)}function at(r={}){return B(r,Kr({className:"nav nav-tabs"}),B({className:"tab-content"}))}function it(r,t=new BehaviorSubject(0)){let n=r.firstChild,o=r.lastChild;t.subscribe((r=>{Array.from(n.children).forEach(((t,e)=>{let n=t.firstChild;r===e?n.classList.add("active"):n.classList.remove("active")})),Array.from(o.children).forEach(((t,e)=>{r===e?t.classList.add("active"):t.classList.remove("active")}))})),n.pipeEvent("click",(r=>{var o,u;return u=r,o=(0,e.map)((r=>[...n.children].map((r=>r.firstChild)).indexOf(r.target)))(u),(0,e.filter)((r=>r>-1))(o).subscribe(t)}))}function ft(r,t,e){let{tabIndex:n,...o}=r,u=at(o),a=u.firstChild,i=u.lastChild;return t.map((r=>ot(r))).forEach((r=>a.appendChild(r))),e.map((r=>ut(r))).forEach((r=>i.appendChild(r))),it(u,n),u}const ct=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DD","DETAILS","DIALOG","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","UL"]),mt=new Set(["A","ABBR","ACRONYM","AUDIO","B","BDI","BDO","BIG","BR","BUTTON","CANVAS","CITE","CODE","DATA","DATALIST","DEL","DFN","EM","EMBED","I","IFRAME","IMG","INPUT","INS","KBD","LABEL","MAP","MARK","METER","NOSCRIPT","OBJECT","OUTPUT","PICTURE","PROGRESS","Q","RUBY","S","SAMP","SCRIPT","SELECT","SLOT","SMALL","SPAN","STRONG","SUB","SUP","SVG","TEMPLATE","TEXTAREA","TIME","TT","U","VAR","VIDEO","WBR"]);function st(r){return"TBODY"===r.tagName?"table-row-group":"THEAD"===r.tagName?"table-header-group":"TFOOT"===r.tagName?"table-footer-group":"TR"===r.tagName?"table-row":"TD"===r.tagName||"TH"===r.tagName?"table-cell":"COLGROUP"===r.tagName?"table-column-group":"COL"===r.tagName?"table-column":"CAPTION"===r.tagName?"table-caption":ct.has(r.tagName)?"block":mt.has(r.tagName)?"inline":"unset"}})(),u})()}));
|
1
|
+
!function(r,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["rxjs","rxjs/operators"],t):"object"==typeof exports?exports.hyperscript=t(require("rxjs"),require("rxjs/operators")):r.hyperscript=t(r.rxjs,r.rxjs.operators)}(this,(function(r,t){return(()=>{"use strict";var e={705:r=>{r.exports=t},130:t=>{t.exports=r}},n={};function o(r){var t=n[r];if(void 0!==t)return t.exports;var u=n[r]={exports:{}};return e[r](u,u.exports,o),u.exports}o.d=(r,t)=>{for(var e in t)o.o(t,e)&&!o.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:t[e]})},o.o=(r,t)=>Object.prototype.hasOwnProperty.call(r,t),o.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var u={};return(()=>{o.r(u),o.d(u,{a:()=>c,abbr:()=>m,address:()=>s,area:()=>l,article:()=>p,aside:()=>d,audio:()=>y,b:()=>A,bdi:()=>b,bdo:()=>h,bindTabIndex:()=>it,blockquote:()=>E,br:()=>g,button:()=>v,caption:()=>T,checkbox:()=>Xr,choice:()=>et,cite:()=>N,code:()=>O,col:()=>x,colgroup:()=>I,collapse:()=>tt,data:()=>S,datalist:()=>D,dd:()=>L,del:()=>R,details:()=>C,dfn:()=>P,dialog:()=>j,div:()=>B,dl:()=>k,dt:()=>M,em:()=>U,fieldset:()=>H,figcaption:()=>G,figure:()=>w,flip:()=>nt,footer:()=>F,form:()=>q,fragment:()=>f,getDisplay:()=>st,h1:()=>V,h2:()=>_,h3:()=>K,h4:()=>Y,h5:()=>Q,h6:()=>W,header:()=>X,hgroup:()=>J,hr:()=>z,hyperscript:()=>i,i:()=>Z,img:()=>$,input:()=>rr,ins:()=>tr,kbd:()=>er,label:()=>nr,legend:()=>or,li:()=>ur,main:()=>ar,mark:()=>ir,menu:()=>fr,menuitem:()=>cr,meter:()=>mr,nav:()=>sr,numberbox:()=>Jr,ol:()=>lr,optgroup:()=>pr,option:()=>dr,output:()=>yr,p:()=>Ar,pre:()=>br,progress:()=>hr,q:()=>Er,radio:()=>zr,rb:()=>gr,rp:()=>vr,rt:()=>Tr,rtc:()=>Nr,ruby:()=>Or,s:()=>xr,samp:()=>Ir,section:()=>Sr,select:()=>Zr,small:()=>Dr,span:()=>Lr,strong:()=>Rr,sub:()=>Cr,summary:()=>Pr,sup:()=>jr,tabControl:()=>ft,tabNavItem:()=>ot,tabPanel:()=>ut,tabRoot:()=>at,table:()=>Br,tbody:()=>kr,td:()=>Mr,textNode:()=>Wr,textarea:()=>rt,textbox:()=>$r,tfoot:()=>Ur,th:()=>Hr,thead:()=>Gr,time:()=>wr,tr:()=>Fr,track:()=>qr,tt:()=>Vr,u:()=>_r,ul:()=>Kr,video:()=>Yr,wbr:()=>Qr});var r=o(130);const t=(r,t)=>{r.subscription?r.subscription.add(t):r.subscription=t};var e=o(705);function n(r,t,e){if("."===t.charAt(0)){let n=t.substring(1);e?r.classList.add(n):r.classList.remove(n)}else{let[n,o]=function(r,t){if(r.includes(".")){let e=r.split("."),n=e.pop();return[e.reduce(((r,t)=>r[t]),t),n]}return[t,r]}(t,r);n[o]=e}return r}function a(r,o,u){var a;let i=(a=u,(0,e.startWith)(0)(a).subscribe({next:t=>{n(r,o,t)},error(t){n(r,o,t.message)}}));return t(r,i),r}function i(e,...o){let u=document.createElement(e),{props:i,childNodes:f}=function(r){let t={},e=[];if(r.length>0){let[n,...o]=r;null==n||Object.getPrototypeOf(n)===Object.prototype?(n&&(t=n),o.length>0&&(e=o)):e=r}return{props:t,childNodes:e}}(o);return function(t,e){let[o,u]=function(t){let e={},n={};for(const o in t){let u=t[o];(0,r.isObservable)(u)?e[o]=u:n[o]=u}return[e,n]}(e);Object.entries(u).forEach((([r,e])=>{n(t,r,e)})),Object.entries(o).forEach((([r,e])=>{a(t,r,e)}))}(u,i),f=1===f.length&&Array.isArray(f[0])?f[0]:f,f.map((r=>{return(t=r)&&t.nodeType&&(t.nodeType===document.ELEMENT_NODE||t.nodeType===document.TEXT_NODE)?r:document.createTextNode(r);var t})).forEach((r=>{u.appendChild(r)})),u.pipeEvent=function(e){return(n,o)=>{let u=o((0,r.fromEvent)(e,n));return t(e,u),e}}(u),u.subscribeEvent=function(e){return(n,o)=>{let u=(0,r.fromEvent)(e,n).subscribe(o);return t(e,u),e}}(u),u}function f(...r){r=1===r.length&&Array.isArray(r[0])?r[0]:r;let t=new DocumentFragment;return r.forEach((r=>{t.appendChild(r)})),t}function c(r,...t){return i("a",...Array.from(arguments))}function m(r,...t){return i("abbr",...Array.from(arguments))}function s(r,...t){return i("address",...Array.from(arguments))}function l(r,...t){return i("area",...Array.from(arguments))}function p(r,...t){return i("article",...Array.from(arguments))}function d(r,...t){return i("aside",...Array.from(arguments))}function y(r,...t){return i("audio",...Array.from(arguments))}function A(r,...t){return i("b",...Array.from(arguments))}function b(r,...t){return i("bdi",...Array.from(arguments))}function h(r,...t){return i("bdo",...Array.from(arguments))}function E(r,...t){return i("blockquote",...Array.from(arguments))}function g(r,...t){return i("br",...Array.from(arguments))}function v(r,...t){return i("button",...Array.from(arguments))}function T(r,...t){return i("caption",...Array.from(arguments))}function N(r,...t){return i("cite",...Array.from(arguments))}function O(r,...t){return i("code",...Array.from(arguments))}function x(r,...t){return i("col",...Array.from(arguments))}function I(r,...t){return i("colgroup",...Array.from(arguments))}function S(r,...t){return i("data",...Array.from(arguments))}function D(r,...t){return i("datalist",...Array.from(arguments))}function L(r,...t){return i("dd",...Array.from(arguments))}function R(r,...t){return i("del",...Array.from(arguments))}function C(r,...t){return i("details",...Array.from(arguments))}function P(r,...t){return i("dfn",...Array.from(arguments))}function j(r,...t){return i("dialog",...Array.from(arguments))}function B(r,...t){return i("div",...Array.from(arguments))}function k(r,...t){return i("dl",...Array.from(arguments))}function M(r,...t){return i("dt",...Array.from(arguments))}function U(r,...t){return i("em",...Array.from(arguments))}function H(r,...t){return i("fieldset",...Array.from(arguments))}function G(r,...t){return i("figcaption",...Array.from(arguments))}function w(r,...t){return i("figure",...Array.from(arguments))}function F(r,...t){return i("footer",...Array.from(arguments))}function q(r,...t){return i("form",...Array.from(arguments))}function V(r,...t){return i("h1",...Array.from(arguments))}function _(r,...t){return i("h2",...Array.from(arguments))}function K(r,...t){return i("h3",...Array.from(arguments))}function Y(r,...t){return i("h4",...Array.from(arguments))}function Q(r,...t){return i("h5",...Array.from(arguments))}function W(r,...t){return i("h6",...Array.from(arguments))}function X(r,...t){return i("header",...Array.from(arguments))}function J(r,...t){return i("hgroup",...Array.from(arguments))}function z(r,...t){return i("hr",...Array.from(arguments))}function Z(r,...t){return i("i",...Array.from(arguments))}function $(r,...t){return i("img",...Array.from(arguments))}function rr(r,...t){return i("input",...Array.from(arguments))}function tr(r,...t){return i("ins",...Array.from(arguments))}function er(r,...t){return i("kbd",...Array.from(arguments))}function nr(r,...t){return i("label",...Array.from(arguments))}function or(r,...t){return i("legend",...Array.from(arguments))}function ur(r,...t){return i("li",...Array.from(arguments))}function ar(r,...t){return i("main",...Array.from(arguments))}function ir(r,...t){return i("mark",...Array.from(arguments))}function fr(r,...t){return i("menu",...Array.from(arguments))}function cr(r,...t){return i("menuitem",...Array.from(arguments))}function mr(r,...t){return i("meter",...Array.from(arguments))}function sr(r,...t){return i("nav",...Array.from(arguments))}function lr(r,...t){return i("ol",...Array.from(arguments))}function pr(r,...t){return i("optgroup",...Array.from(arguments))}function dr(r,...t){return i("option",...Array.from(arguments))}function yr(r,...t){return i("output",...Array.from(arguments))}function Ar(r,...t){return i("p",...Array.from(arguments))}function br(r,...t){return i("pre",...Array.from(arguments))}function hr(r,...t){return i("progress",...Array.from(arguments))}function Er(r,...t){return i("q",...Array.from(arguments))}function gr(r,...t){return i("rb",...Array.from(arguments))}function vr(r,...t){return i("rp",...Array.from(arguments))}function Tr(r,...t){return i("rt",...Array.from(arguments))}function Nr(r,...t){return i("rtc",...Array.from(arguments))}function Or(r,...t){return i("ruby",...Array.from(arguments))}function xr(r,...t){return i("s",...Array.from(arguments))}function Ir(r,...t){return i("samp",...Array.from(arguments))}function Sr(r,...t){return i("section",...Array.from(arguments))}function Dr(r,...t){return i("small",...Array.from(arguments))}function Lr(r,...t){return i("span",...Array.from(arguments))}function Rr(r,...t){return i("strong",...Array.from(arguments))}function Cr(r,...t){return i("sub",...Array.from(arguments))}function Pr(r,...t){return i("summary",...Array.from(arguments))}function jr(r,...t){return i("sup",...Array.from(arguments))}function Br(r,...t){return i("table",...Array.from(arguments))}function kr(r,...t){return i("tbody",...Array.from(arguments))}function Mr(r,...t){return i("td",...Array.from(arguments))}function Ur(r,...t){return i("tfoot",...Array.from(arguments))}function Hr(r,...t){return i("th",...Array.from(arguments))}function Gr(r,...t){return i("thead",...Array.from(arguments))}function wr(r,...t){return i("time",...Array.from(arguments))}function Fr(r,...t){return i("tr",...Array.from(arguments))}function qr(r,...t){return i("track",...Array.from(arguments))}function Vr(r,...t){return i("tt",...Array.from(arguments))}function _r(r,...t){return i("u",...Array.from(arguments))}function Kr(r,...t){return i("ul",...Array.from(arguments))}function Yr(r,...t){return i("video",...Array.from(arguments))}function Qr(r,...t){return i("wbr",...Array.from(arguments))}function Wr(t){if((0,r.isObservable)(t)){let r=document.createTextNode("");return t.subscribe({next:t=>{r.nodeValue=t},error:t=>{r.nodeValue=t.message}}),r}return document.createTextNode(t)}function Xr(r){let t=rr({...r,type:"checkbox"});return r.checked&&t.pipeEvent("input",(t=>t.pipe((0,e.map)((r=>r.target.checked))).subscribe(r.checked))),t}function Jr(t={}){let{number:n,...o}=t,u=rr({...o,type:"text"});if(n&&n instanceof r.BehaviorSubject){let r=n.pipe((0,e.map)((r=>String(r))));a(u,"value",r),u.pipeEvent("blur",(r=>r.pipe((0,e.map)((r=>Number(r.target.value)))).subscribe((r=>{Number.isNaN(r)?u.select():n.value!==r&&n.next(r)}))))}return u.style.textAlign="right",u}function zr(r){let t=rr({...r,type:"radio"});return r.checked&&t.pipeEvent("input",(t=>t.pipe((0,e.map)((r=>r.target.checked))).subscribe(r.checked))),t}function Zr(t,...n){let o=i("select",t,...n),{selectedIndex:u,value:a,...f}=t;return(0,r.isObservable)(u)&&(u.subscribe((r=>{o[r].selected=!0})),o.pipeEvent("input",(r=>r.pipe((0,e.map)((r=>r.target.selectedIndex))).subscribe(u)))),(0,r.isObservable)(a)&&(a.subscribe((r=>{Array.from(o.getElementsByTagName("option")).filter((t=>t.value===r)).forEach((r=>{r.selected=!0}))})),o.pipeEvent("input",(r=>r.pipe((0,e.map)((r=>r.target.value))).subscribe(a)))),o}function $r(r){let t=rr({...r,type:"text"});return t.pipeEvent("input",(t=>{var n;return n=t,(0,e.map)((r=>r.target.value))(n).subscribe(r.value)})),t}function rt(r){let t=i("textarea",r);return t.pipeEvent("input",(t=>{var n;return n=t,(0,e.map)((r=>r.target.value))(n).subscribe(r.value)})),t}function tt(r,...t){return(t=1===t.length&&Array.isArray(t[0])?t[0]:t).forEach((t=>{a(t,"hidden",r)})),t}function et(r,t){return Object.entries(t).map((([t,n])=>{var o;return tt((o=r,(0,e.map)((r=>r!==t))(o)),n)})).reduce(((r,t)=>[...r,...t]),[])}function nt(r,t,n){var o;return[...tt((o=r,(0,e.map)((r=>!r))(o)),t),...tt(r,n)]}function ot(...r){return ur({className:"nav-item"},v({type:"button",className:"btn btn-link nav-link"},...r))}function ut(...r){return B({className:"tab-pane"},...r)}function at(r={}){return B(r,Kr({className:"nav nav-tabs"}),B({className:"tab-content"}))}function it(r,t=new BehaviorSubject(0)){let n=r.firstChild,o=r.lastChild;t.subscribe((r=>{Array.from(n.childNodes).forEach(((t,e)=>{let n=t.firstChild;r===e?n.classList.add("active"):n.classList.remove("active")})),Array.from(o.childNodes).forEach(((t,e)=>{r===e?t.classList.add("active"):t.classList.remove("active")}))})),n.pipeEvent("click",(r=>{var o,u;return u=r,o=(0,e.map)((r=>[...n.childNodes].map((r=>r.firstChild)).indexOf(r.target)))(u),(0,e.filter)((r=>r>-1))(o).subscribe(t)}))}function ft(r,t,e){let{tabIndex:n,...o}=r,u=at(o),a=u.firstChild,i=u.lastChild;return t.map((r=>ot(r))).forEach((r=>a.appendChild(r))),e.map((r=>ut(r))).forEach((r=>i.appendChild(r))),it(u,n),u}const ct=new Set(["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DD","DETAILS","DIALOG","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","TABLE","UL"]),mt=new Set(["A","ABBR","ACRONYM","AUDIO","B","BDI","BDO","BIG","BR","BUTTON","CANVAS","CITE","CODE","DATA","DATALIST","DEL","DFN","EM","EMBED","I","IFRAME","IMG","INPUT","INS","KBD","LABEL","MAP","MARK","METER","NOSCRIPT","OBJECT","OUTPUT","PICTURE","PROGRESS","Q","RUBY","S","SAMP","SCRIPT","SELECT","SLOT","SMALL","SPAN","STRONG","SUB","SUP","SVG","TEMPLATE","TEXTAREA","TIME","TT","U","VAR","VIDEO","WBR"]);function st(r){return"TBODY"===r.tagName?"table-row-group":"THEAD"===r.tagName?"table-header-group":"TFOOT"===r.tagName?"table-footer-group":"TR"===r.tagName?"table-row":"TD"===r.tagName||"TH"===r.tagName?"table-cell":"COLGROUP"===r.tagName?"table-column-group":"COL"===r.tagName?"table-column":"CAPTION"===r.tagName?"table-caption":ct.has(r.tagName)?"block":mt.has(r.tagName)?"inline":"unset"}})(),u})()}));
|
package/package.json
CHANGED
@@ -1,30 +1,25 @@
|
|
1
1
|
{
|
2
2
|
"dependencies": {
|
3
|
-
"rxjs": "7.
|
3
|
+
"rxjs": "7.5.5"
|
4
4
|
},
|
5
5
|
"devDependencies": {
|
6
|
-
"@babel/core": "7.
|
7
|
-
"@babel/plugin-proposal-class-properties": "7.
|
8
|
-
"@babel/plugin-proposal-export-default-from": "7.
|
9
|
-
"@babel/plugin-proposal-export-namespace-from": "7.
|
10
|
-
"@babel/plugin-proposal-pipeline-operator": "7.
|
11
|
-
"@babel/preset-env": "7.
|
12
|
-
"@webpack-cli/serve": "1.
|
13
|
-
"babel-jest": "
|
14
|
-
"babel-loader": "8.2.
|
15
|
-
"clean-webpack-plugin": "
|
16
|
-
"core-js": "3.
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"webpack": "5.37.0",
|
24
|
-
"webpack-bundle-analyzer": "4.4.1",
|
25
|
-
"webpack-cli": "4.7.0",
|
26
|
-
"webpack-dev-server": "3.11.2",
|
27
|
-
"webpack-merge": "5.7.3"
|
6
|
+
"@babel/core": "7.17.7",
|
7
|
+
"@babel/plugin-proposal-class-properties": "7.16.7",
|
8
|
+
"@babel/plugin-proposal-export-default-from": "7.16.7",
|
9
|
+
"@babel/plugin-proposal-export-namespace-from": "7.16.7",
|
10
|
+
"@babel/plugin-proposal-pipeline-operator": "7.17.6",
|
11
|
+
"@babel/preset-env": "7.16.11",
|
12
|
+
"@webpack-cli/serve": "1.6.1",
|
13
|
+
"babel-jest": "27.5.1",
|
14
|
+
"babel-loader": "8.2.3",
|
15
|
+
"clean-webpack-plugin": "4.0.0",
|
16
|
+
"core-js": "3.21.1",
|
17
|
+
"jest": "27.5.1",
|
18
|
+
"node-fetch": "3.2.3",
|
19
|
+
"webpack": "5.70.0",
|
20
|
+
"webpack-cli": "4.9.2",
|
21
|
+
"webpack-dev-server": "4.7.4",
|
22
|
+
"webpack-merge": "5.8.0"
|
28
23
|
},
|
29
24
|
"scripts": {
|
30
25
|
"build": "webpack --config webpack.prod.js",
|
@@ -32,11 +27,16 @@
|
|
32
27
|
"test": "jest"
|
33
28
|
},
|
34
29
|
"name": "hyperscript-rxjs",
|
35
|
-
"description": "
|
30
|
+
"description": "A js UI library that uses rxjs to react dom directly.",
|
36
31
|
"main": "dist/hyperscript-rxjs.js",
|
37
|
-
"version": "1.0
|
32
|
+
"version": "1.1.0",
|
38
33
|
"author": "cuishengli<34696643@qq.com>",
|
39
|
-
"keywords": [
|
34
|
+
"keywords": [
|
35
|
+
"ui",
|
36
|
+
"rxjs",
|
37
|
+
"reactive",
|
38
|
+
"dom"
|
39
|
+
],
|
40
40
|
"repository": {
|
41
41
|
"type": "git",
|
42
42
|
"url": "https://github.com/xp44mm/hyperscript-rxjs"
|
package/readme.md
CHANGED
@@ -1,34 +1,45 @@
|
|
1
|
-
hyperscript-rxjs
|
1
|
+
`hyperscript-rxjs`是一个直接操作DOM的js前端框架库。`hyperscript-rxjs`具有如下特点:
|
2
2
|
|
3
|
-
|
3
|
+
* 相比操作DOM模型的命令式代码,`hyperscript-rxjs`更具声明性。
|
4
|
+
|
5
|
+
* `hyperscript-rxjs`修复或绕开了很多DOM的历史缺陷。
|
6
|
+
|
7
|
+
* 像knockout一样,`hyperscript-rxjs`使用MVVM分离视图与视图模型,不同的是`hyperscript-rxjs`采取通用的rxjs库来观察变化。
|
4
8
|
|
5
|
-
hyperscript-rxjs
|
9
|
+
* 像react一样,`hyperscript-rxjs`操作DOM,与html无关。不同的是`hyperscript-rxjs`直接操作DOM本身,无虚拟DOM。
|
6
10
|
|
7
|
-
|
11
|
+
* `hyperscript-rxjs`采用更新的事件标准`addEventListener`,不采用属性事件`onevent`。采用rxjs观察DOM模型的变化,事件通知。
|
8
12
|
|
9
|
-
|
13
|
+
* 尽管rxjs是技术发展趋势,用户仍然可以基于`hyperscript-rxjs`实现代码,渐进实现不依赖任何框架的代码。
|
14
|
+
|
15
|
+
`hyperscript-rxjs`学习难度小于react,并且其知识兼容底层的DOM,实用性更强。教程见单独的文件。
|
16
|
+
|
17
|
+
## 依赖库
|
10
18
|
|
11
|
-
|
19
|
+
`hyperscript-rxjs` is based on `rxjs`。
|
12
20
|
|
13
|
-
|
21
|
+
## 入门
|
14
22
|
|
15
|
-
|
23
|
+
一个Hello World程序,就像写html一样简单。
|
16
24
|
|
17
|
-
|
25
|
+
```js
|
26
|
+
import { p } from 'hyperscript-rxjs'
|
27
|
+
export function hello() { return p('hello world!'); }
|
28
|
+
```
|
18
29
|
|
19
|
-
|
30
|
+
本框架API的设计和DOM底层完全一致,即使你将来不使用本框架,也会有益于你的职业生涯。本教程的其余部分将更加详细地涵盖前端库的各种功能以及其它高级用法。
|
20
31
|
|
21
|
-
|
32
|
+
## 教程
|
22
33
|
|
23
|
-
|
34
|
+
教程及其源代码位于github库`xp44mm/hyperscript-rxjs-test`中。
|
24
35
|
|
25
|
-
|
36
|
+
## 相关库
|
26
37
|
|
27
|
-
|
38
|
+
推荐使用如下库,编写更优美的代码:
|
28
39
|
|
29
|
-
|
40
|
+
xp44mm/structural-comparison
|
30
41
|
|
31
|
-
|
42
|
+
xp44mm/deep-rxjs
|
32
43
|
|
33
|
-
|
44
|
+
xp44mm/parse-html
|
34
45
|
|