diff --git a/.gitignore b/.gitignore index 3fd8b75..020ce87 100644 --- a/.gitignore +++ b/.gitignore @@ -9,15 +9,12 @@ /node_modules/ /npm-debug.log -## testing -/coverage/ ## temp folders /.tmp/ # build /_site/ -/dist/ /out-tsc/ storybook-static @@ -42,9 +39,6 @@ pids # Directory for instrumented libs generated by jscoverage/JSCover lib-cov -# Coverage directory used by tools like istanbul -coverage -*.lcov # nyc test coverage .nyc_output @@ -104,7 +98,6 @@ typings/ # Nuxt.js build / generate output .nuxt -dist # Gatsby files .cache/ diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..63298ca --- /dev/null +++ b/BUILD.md @@ -0,0 +1,17 @@ +# slotted-element development +The sources are used directly from [node_modules/slotted-element](node_modules/slotted-element) + +`npm link slotted-element` would make it linked to locally installed repo which has to be registered by +`npm link` + +The TDD via `npm run test:watch` would allow tests and sources modification and debug in browser. + +[dist/](dist) is holding generated binaries and demo referenced via CDN within main [README.md](README.md) + +# npm run build +Would invoke [build.sh](build.sh) which +* execute `test.sh` to generate [coverage/](coverage) folder with results and [coverage.svg](coverage/coverage.svg) +* cleanup [dist/](dist) folder +* execute compilation by [esbuild](https://esbuild.github.io/) + +Upon release in github and npmjs.org the code with working demo would be populated into CDN. diff --git a/README.md b/README.md index 8f5fa67..b45c1ac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,10 @@ test suite for `slotted-element` and `fetch-element` [![git][github-image] slotted-element](https://github.com/sashafirsov/slotted-element) -| [demo](https://unpkg.com/slotted-element@1.1.0/demo/index.html) +| [demo](https://unpkg.com/slotted-element-test@1.1.1/dist/bundle/demo/index.html) + +[![NPM version][npm-image]][npm-url] +[![coverage][coverage-image]][coverage-url] # Test @@ -13,3 +16,7 @@ test suite for `slotted-element` and `fetch-element` After test run is located in [coverage/lcov-report/index.html](coverage/lcov-report/index.html) [github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg +[npm-image]: https://img.shields.io/npm/v/slotted-element-test.svg +[npm-url]: https://npmjs.org/package/slotted-element-test +[coverage-image]: https://unpkg.com/slotted-element-test@1.1.1/coverage/coverage.svg +[coverage-url]: https://unpkg.com/slotted-element-test@1.1.1/coverage/lcov-report/index.html diff --git a/ToDo.md b/ToDo.md index cbe0c67..9b01e76 100644 --- a/ToDo.md +++ b/ToDo.md @@ -1,2 +1,8 @@ +* demo in `dist` * update `html-demo-element` version * integrate code coverage as in css-chain +* .d.ts +npx -p typescript tsc **/*.js --declaration --allowJs --emitDeclarationOnly +--outDir types + +* xml diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..d35d247 --- /dev/null +++ b/build.sh @@ -0,0 +1,31 @@ +#node types/generate-mixin.js +bash ./test.sh + +PACKAGE_VERSION=$(node -pe "require('slotted-element/package.json').version") +echo $PACKAGE_VERSION + +BUILD_DIR=dist/esm +SRC_DIR=node_modules/slotted-element +rm -rf dist/* +mkdir dist +#mkdir $BUILD_DIR +#mkdir $BUILD_DIR/demo +#cp $SRC_DIR/demo/* $BUILD_DIR/demo +#cp $SRC_DIR/*.d.ts $BUILD_DIR +#sed "s/..\/src\/css-chain-element.js/css-chain-element.js/" src/demo.html >$BUILD_DIR/demo.html + +TARGET_PARAM=--target=chrome97,firefox95,safari15,edge96 +# https://kangax.github.io/compat-table/es2016plus/ +#esbuild $SRC_DIR/*.js --minify --sourcemap $TARGET_PARAM --outdir=$BUILD_DIR +#esbuild $SRC_DIR/../css-chain/*.js --minify --sourcemap $TARGET_PARAM --outdir=$BUILD_DIR + +# bundle +BUILD_DIR=dist/bundle +mkdir $BUILD_DIR +mkdir $BUILD_DIR/demo +mkdir $BUILD_DIR/render + +cp $SRC_DIR/demo/* $BUILD_DIR/demo +cp $SRC_DIR/*.d.ts $BUILD_DIR +esbuild $SRC_DIR/slotted-element.js --minify --bundle --sourcemap --format=esm $TARGET_PARAM --outdir=$BUILD_DIR +esbuild $SRC_DIR/render/*.js --minify --bundle --sourcemap --format=esm $TARGET_PARAM --outdir=$BUILD_DIR/render diff --git a/ci/compile.mjs b/ci/compile.mjs new file mode 100644 index 0000000..8b27f6b --- /dev/null +++ b/ci/compile.mjs @@ -0,0 +1,15 @@ +import esbuild from 'esbuild'; +import htmlPlugin from '@chialab/esbuild-plugin-html'; + +await esbuild.build({ + entryPoints: ['dist/esm/demo/index.html'], + outdir: 'dist/esm/bundle', + assetNames: 'assets/[name]-[hash]', + chunkNames: '[ext]/[name]-[hash]', + plugins: [ + htmlPlugin({ + // scriptsTarget: 'es6', + // modulesTarget: 'es2020', + }), + ], +}); diff --git a/coverage/coverage.svg b/coverage/coverage.svg new file mode 100644 index 0000000..9d500f8 --- /dev/null +++ b/coverage/coverage.svg @@ -0,0 +1,10 @@ + + + + + coverage + 92.97% + diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 0000000..f418035 --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,224 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* yellow */ +.cbranch-no { background: yellow !important; color: #111; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +.highlighted, +.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ + background: #C21F39 !important; +} +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +.medium .chart { border:1px solid #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + +span.cline-neutral { background: #eaeaea; } + +.coverage-summary td.empty { + opacity: .5; + padding-top: 4px; + padding-bottom: 4px; + line-height: 1; + color: #888; +} + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/block-navigation.js b/coverage/lcov-report/block-navigation.js new file mode 100644 index 0000000..cc12130 --- /dev/null +++ b/coverage/lcov-report/block-navigation.js @@ -0,0 +1,87 @@ +/* eslint-disable */ +var jumpToCode = (function init() { + // Classes of code we would like to highlight in the file view + var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; + + // Elements to highlight in the file listing view + var fileListingElements = ['td.pct.low']; + + // We don't want to select elements that are direct descendants of another match + var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` + + // Selecter that finds elements on the page to which we can jump + var selector = + fileListingElements.join(', ') + + ', ' + + notSelector + + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` + + // The NodeList of matching elements + var missingCoverageElements = document.querySelectorAll(selector); + + var currentIndex; + + function toggleClass(index) { + missingCoverageElements + .item(currentIndex) + .classList.remove('highlighted'); + missingCoverageElements.item(index).classList.add('highlighted'); + } + + function makeCurrent(index) { + toggleClass(index); + currentIndex = index; + missingCoverageElements.item(index).scrollIntoView({ + behavior: 'smooth', + block: 'center', + inline: 'center' + }); + } + + function goToPrevious() { + var nextIndex = 0; + if (typeof currentIndex !== 'number' || currentIndex === 0) { + nextIndex = missingCoverageElements.length - 1; + } else if (missingCoverageElements.length > 1) { + nextIndex = currentIndex - 1; + } + + makeCurrent(nextIndex); + } + + function goToNext() { + var nextIndex = 0; + + if ( + typeof currentIndex === 'number' && + currentIndex < missingCoverageElements.length - 1 + ) { + nextIndex = currentIndex + 1; + } + + makeCurrent(nextIndex); + } + + return function jump(event) { + if ( + document.getElementById('fileSearch') === document.activeElement && + document.activeElement != null + ) { + // if we're currently focused on the search input, we don't want to navigate + return; + } + + switch (event.which) { + case 78: // n + case 74: // j + goToNext(); + break; + case 66: // b + case 75: // k + case 80: // p + goToPrevious(); + break; + } + }; +})(); +window.addEventListener('keydown', jumpToCode); diff --git a/coverage/lcov-report/favicon.png b/coverage/lcov-report/favicon.png new file mode 100644 index 0000000..6691817 Binary files /dev/null and b/coverage/lcov-report/favicon.png differ diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 0000000..d63979f --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+ +
+ 92.97% + Statements + 278/299 +
+ + +
+ 89.23% + Branches + 58/65 +
+ + +
+ 83.33% + Functions + 35/42 +
+ + +
+ 92.97% + Lines + 278/299 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
slotted-element +
+
91.76%234/25589.47%51/5782.5%33/4091.76%234/255
slotted-element/render +
+
100%44/4487.5%7/8100%2/2100%44/44
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 0000000..b317a7c --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 0000000..b322523 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/slotted-element/fetch-element.js.html b/coverage/lcov-report/slotted-element/fetch-element.js.html new file mode 100644 index 0000000..6a7519a --- /dev/null +++ b/coverage/lcov-report/slotted-element/fetch-element.js.html @@ -0,0 +1,118 @@ + + + + + + Code coverage report for slotted-element/fetch-element.js + + + + + + + + + +
+
+

All files / slotted-element fetch-element.js

+
+ +
+ 98.65% + Statements + 147/149 +
+ + +
+ 100% + Branches + 40/40 +
+ + +
+ 85.71% + Functions + 24/28 +
+ + +
+ 98.65% + Lines + 147/149 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +120 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0
Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\fetch-element.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\fetch-element.js')
+Error: Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\fetch-element.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\fetch-element.js')
+    at Context.defaultSourceLookup [as sourceFinder] (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:17:15)
+    at Context.getSource (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:71:21)
+    at annotateSourceCode (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\annotator.js:232:40)
+    at HtmlReport.onDetail (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\index.js:414:33)
+    at LcovReport. [as onDetail] (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\lcov\index.js:28:23)
+    at Visitor.value (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:38:38)
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:88:21)
+    at C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:92:19
+    at Array.forEach ()
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:91:28)
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/slotted-element/index.html b/coverage/lcov-report/slotted-element/index.html new file mode 100644 index 0000000..d90dd73 --- /dev/null +++ b/coverage/lcov-report/slotted-element/index.html @@ -0,0 +1,131 @@ + + + + + + Code coverage report for slotted-element + + + + + + + + + +
+
+

All files slotted-element

+
+ +
+ 91.76% + Statements + 234/255 +
+ + +
+ 89.47% + Branches + 51/57 +
+ + +
+ 82.5% + Functions + 33/40 +
+ + +
+ 91.76% + Lines + 234/255 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
fetch-element.js +
+
98.65%147/149100%40/4085.71%24/2898.65%147/149
slotted-element.js +
+
82.07%87/10664.7%11/1775%9/1282.07%87/106
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/slotted-element/render/index.html b/coverage/lcov-report/slotted-element/render/index.html new file mode 100644 index 0000000..80c0bdd --- /dev/null +++ b/coverage/lcov-report/slotted-element/render/index.html @@ -0,0 +1,116 @@ + + + + + + Code coverage report for slotted-element/render + + + + + + + + + +
+
+

All files slotted-element/render

+
+ +
+ 100% + Statements + 44/44 +
+ + +
+ 87.5% + Branches + 7/8 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 44/44 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
json.js +
+
100%44/4487.5%7/8100%2/2100%44/44
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/slotted-element/render/json.js.html b/coverage/lcov-report/slotted-element/render/json.js.html new file mode 100644 index 0000000..e63396f --- /dev/null +++ b/coverage/lcov-report/slotted-element/render/json.js.html @@ -0,0 +1,118 @@ + + + + + + Code coverage report for slotted-element/render/json.js + + + + + + + + + +
+
+

All files / slotted-element/render json.js

+
+ +
+ 100% + Statements + 44/44 +
+ + +
+ 87.5% + Branches + 7/8 +
+ + +
+ 100% + Functions + 2/2 +
+ + +
+ 100% + Lines + 44/44 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +120 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0
Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\render\json.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\render\json.js')
+Error: Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\render\json.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\render\json.js')
+    at Context.defaultSourceLookup [as sourceFinder] (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:17:15)
+    at Context.getSource (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:71:21)
+    at annotateSourceCode (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\annotator.js:232:40)
+    at HtmlReport.onDetail (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\index.js:414:33)
+    at LcovReport. [as onDetail] (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\lcov\index.js:28:23)
+    at Visitor.value (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:38:38)
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:88:21)
+    at C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:92:19
+    at Array.forEach ()
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:91:28)
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/slotted-element/slotted-element.js.html b/coverage/lcov-report/slotted-element/slotted-element.js.html new file mode 100644 index 0000000..d9dbc01 --- /dev/null +++ b/coverage/lcov-report/slotted-element/slotted-element.js.html @@ -0,0 +1,118 @@ + + + + + + Code coverage report for slotted-element/slotted-element.js + + + + + + + + + +
+
+

All files / slotted-element slotted-element.js

+
+ +
+ 82.07% + Statements + 87/106 +
+ + +
+ 64.7% + Branches + 11/17 +
+ + +
+ 75% + Functions + 9/12 +
+ + +
+ 82.07% + Lines + 87/106 +
+ + +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+

+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +120 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0
Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\slotted-element.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\slotted-element.js')
+Error: Unable to lookup source: C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\slotted-element.js (ENOENT: no such file or directory, open 'C:\aWork\slotted-element-test\__wds-outside-root__\1\slotted-element\slotted-element.js')
+    at Context.defaultSourceLookup [as sourceFinder] (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:17:15)
+    at Context.getSource (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\context.js:71:21)
+    at annotateSourceCode (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\annotator.js:232:40)
+    at HtmlReport.onDetail (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\html\index.js:414:33)
+    at LcovReport. [as onDetail] (C:\aWork\slotted-element-test\node_modules\istanbul-reports\lib\lcov\index.js:28:23)
+    at Visitor.value (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:38:38)
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:88:21)
+    at C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:92:19
+    at Array.forEach ()
+    at ReportNode.visit (C:\aWork\slotted-element-test\node_modules\istanbul-lib-report\lib\tree.js:91:28)
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 0000000..03f704a Binary files /dev/null and b/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/coverage/lcov-report/sorter.js b/coverage/lcov-report/sorter.js new file mode 100644 index 0000000..2bb296a --- /dev/null +++ b/coverage/lcov-report/sorter.js @@ -0,0 +1,196 @@ +/* eslint-disable */ +var addSorting = (function() { + 'use strict'; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { + return document.querySelector('.coverage-summary'); + } + // returns the thead element of the summary table + function getTableHeader() { + return getTable().querySelector('thead tr'); + } + // returns the tbody element of the summary table + function getTableBody() { + return getTable().querySelector('tbody'); + } + // returns the th element for nth column + function getNthColumn(n) { + return getTableHeader().querySelectorAll('th')[n]; + } + + function onFilterInput() { + const searchValue = document.getElementById('fileSearch').value; + const rows = document.getElementsByTagName('tbody')[0].children; + for (let i = 0; i < rows.length; i++) { + const row = rows[i]; + if ( + row.textContent + .toLowerCase() + .includes(searchValue.toLowerCase()) + ) { + row.style.display = ''; + } else { + row.style.display = 'none'; + } + } + } + + // loads the search box + function addSearchBox() { + var template = document.getElementById('filterTemplate'); + var templateClone = template.content.cloneNode(true); + templateClone.getElementById('fileSearch').oninput = onFilterInput; + template.parentElement.appendChild(templateClone); + } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = + colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function(a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function(a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc + ? ' sorted-desc' + : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function() { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i = 0; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function() { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(); + addSearchBox(); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 0000000..c12760a --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,475 @@ +TN: +SF:__wds-outside-root__\1\slotted-element\fetch-element.js +FN:1,wait4DomUpdated +FN:7,done +FN:12,toKebbabCase +FN:19,get observedAttributes +FN:21,get mime2mod +FN:21,application/json +FN:22,text/html +FN:23,text/xml +FN:24,application/xml +FN:25,image/svg+xml +FN:28,get headers +FN:30,abort +FN:32,fetch +FN:34,FetchElement +FN:41,FetchElement.abort +FN:42,FetchElement._fetch +FN:65,get +FN:70,get +FN:71,set +FN:75,connectedCallback +FN:81,attributeChangedCallback +FN:96,onResponse +FN:108,setContent +FN:110,onResult +FN:129,render +FN:130,renderHtml +FN:138,onError +FN:144,getKeys +FNF:28 +FNH:24 +FNDA:1,wait4DomUpdated +FNDA:1,done +FNDA:1,toKebbabCase +FNDA:2,get observedAttributes +FNDA:1,get mime2mod +FNDA:1,application/json +FNDA:1,text/html +FNDA:0,text/xml +FNDA:0,application/xml +FNDA:1,image/svg+xml +FNDA:1,get headers +FNDA:0,abort +FNDA:1,fetch +FNDA:2,FetchElement +FNDA:0,FetchElement.abort +FNDA:1,FetchElement._fetch +FNDA:1,get +FNDA:2,get +FNDA:1,set +FNDA:2,connectedCallback +FNDA:1,attributeChangedCallback +FNDA:1,onResponse +FNDA:1,setContent +FNDA:1,onResult +FNDA:1,render +FNDA:1,renderHtml +FNDA:1,onError +FNDA:1,getKeys +DA:1,2 +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:11,2 +DA:12,2 +DA:13,1 +DA:14,1 +DA:15,2 +DA:16,2 +DA:17,2 +DA:18,2 +DA:19,2 +DA:20,2 +DA:21,2 +DA:22,1 +DA:23,1 +DA:24,1 +DA:25,1 +DA:26,1 +DA:27,2 +DA:28,2 +DA:29,2 +DA:30,2 +DA:31,2 +DA:32,2 +DA:33,2 +DA:34,2 +DA:35,2 +DA:36,2 +DA:37,2 +DA:38,2 +DA:39,2 +DA:40,2 +DA:41,2 +DA:42,2 +DA:43,1 +DA:44,1 +DA:45,1 +DA:46,1 +DA:47,1 +DA:48,1 +DA:49,1 +DA:50,1 +DA:51,1 +DA:52,1 +DA:53,1 +DA:54,1 +DA:55,1 +DA:56,1 +DA:57,1 +DA:58,1 +DA:59,1 +DA:60,1 +DA:61,1 +DA:62,1 +DA:63,1 +DA:64,2 +DA:65,2 +DA:66,2 +DA:67,2 +DA:68,2 +DA:69,2 +DA:70,2 +DA:71,2 +DA:72,2 +DA:73,2 +DA:74,2 +DA:75,2 +DA:76,2 +DA:77,2 +DA:78,2 +DA:79,2 +DA:80,2 +DA:81,2 +DA:82,1 +DA:83,1 +DA:84,1 +DA:85,0 +DA:86,0 +DA:87,1 +DA:88,1 +DA:89,1 +DA:90,1 +DA:91,1 +DA:92,1 +DA:93,1 +DA:94,1 +DA:95,2 +DA:96,2 +DA:97,1 +DA:98,1 +DA:99,1 +DA:100,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:104,1 +DA:105,1 +DA:106,1 +DA:107,2 +DA:108,2 +DA:109,2 +DA:110,2 +DA:111,1 +DA:112,1 +DA:113,1 +DA:114,1 +DA:115,1 +DA:116,1 +DA:117,1 +DA:118,1 +DA:119,1 +DA:120,1 +DA:121,1 +DA:122,1 +DA:123,1 +DA:124,1 +DA:125,1 +DA:126,1 +DA:127,1 +DA:128,2 +DA:129,2 +DA:130,2 +DA:131,1 +DA:132,1 +DA:133,1 +DA:134,1 +DA:135,1 +DA:136,1 +DA:137,2 +DA:138,2 +DA:139,1 +DA:140,1 +DA:141,1 +DA:142,1 +DA:143,2 +DA:144,2 +DA:145,2 +DA:146,2 +DA:147,2 +DA:148,2 +DA:149,2 +LF:149 +LH:147 +BRDA:1,0,0,2 +BRDA:1,1,0,2 +BRDA:4,2,0,2 +BRDA:6,3,0,1 +BRDA:8,4,0,1 +BRDA:7,5,0,3 +BRDA:7,6,0,3 +BRDA:12,7,0,2 +BRDA:14,8,0,1 +BRDA:19,9,0,2 +BRDA:21,10,0,2 +BRDA:21,11,0,2 +BRDA:22,12,0,2 +BRDA:25,13,0,2 +BRDA:28,14,0,2 +BRDA:32,15,0,2 +BRDA:34,16,0,2 +BRDA:42,17,0,2 +BRDA:54,18,0,2 +BRDA:60,19,0,1 +BRDA:65,20,0,2 +BRDA:67,21,0,2 +BRDA:68,22,0,2 +BRDA:70,23,0,2 +BRDA:71,24,0,2 +BRDA:75,25,0,2 +BRDA:81,26,0,2 +BRDA:84,27,0,1 +BRDA:88,28,0,1 +BRDA:92,29,0,1 +BRDA:96,30,0,2 +BRDA:108,31,0,2 +BRDA:110,32,0,2 +BRDA:118,33,0,1 +BRDA:122,34,0,1 +BRDA:129,35,0,2 +BRDA:130,36,0,2 +BRDA:138,37,0,2 +BRDA:144,38,0,2 +BRDA:77,39,0,2 +BRF:40 +BRH:40 +end_of_record +TN: +SF:__wds-outside-root__\1\slotted-element\slotted-element.js +FN:7,createNode +FN:13,get observedAttributes +FN:15,connectedCallback +FN:20,attributeChangedCallback +FN:27,$ +FN:29,fetch +FN:35,setContent +FN:48,slotsInit +FN:64,slotOnly +FN:75,slotsClear +FN:80,slotClone +FN:91,slotAdd +FNF:12 +FNH:9 +FNDA:1,createNode +FNDA:1,get observedAttributes +FNDA:1,connectedCallback +FNDA:1,attributeChangedCallback +FNDA:1,$ +FNDA:0,fetch +FNDA:0,setContent +FNDA:1,slotsInit +FNDA:1,slotOnly +FNDA:0,slotsClear +FNDA:1,slotClone +FNDA:1,slotAdd +DA:1,1 +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:11,1 +DA:12,1 +DA:13,1 +DA:14,1 +DA:15,1 +DA:16,1 +DA:17,1 +DA:18,1 +DA:19,1 +DA:20,1 +DA:21,1 +DA:22,1 +DA:23,1 +DA:24,1 +DA:25,1 +DA:26,1 +DA:27,1 +DA:28,1 +DA:29,1 +DA:30,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:34,1 +DA:35,1 +DA:36,0 +DA:37,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:43,0 +DA:44,1 +DA:45,1 +DA:46,1 +DA:47,1 +DA:48,1 +DA:49,1 +DA:50,1 +DA:51,1 +DA:52,1 +DA:53,1 +DA:54,1 +DA:55,1 +DA:56,1 +DA:57,1 +DA:58,1 +DA:59,1 +DA:60,1 +DA:61,1 +DA:62,1 +DA:63,1 +DA:64,1 +DA:65,1 +DA:66,1 +DA:67,1 +DA:68,1 +DA:69,1 +DA:70,1 +DA:71,1 +DA:72,1 +DA:73,1 +DA:74,1 +DA:75,1 +DA:76,0 +DA:77,0 +DA:78,0 +DA:79,1 +DA:80,1 +DA:81,1 +DA:82,1 +DA:83,1 +DA:84,1 +DA:85,0 +DA:86,0 +DA:87,0 +DA:88,0 +DA:89,1 +DA:90,1 +DA:91,1 +DA:92,1 +DA:93,1 +DA:94,1 +DA:95,1 +DA:96,1 +DA:97,1 +DA:98,1 +DA:99,1 +DA:100,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:104,1 +DA:105,1 +DA:106,1 +LF:106 +LH:87 +BRDA:1,0,0,1 +BRDA:7,1,0,1 +BRDA:13,2,0,1 +BRDA:15,3,0,1 +BRDA:20,4,0,1 +BRDA:23,5,0,0 +BRDA:25,6,0,0 +BRDA:27,7,0,1 +BRDA:48,8,0,1 +BRDA:52,9,0,1 +BRDA:64,10,0,1 +BRDA:69,11,0,0 +BRDA:80,12,0,1 +BRDA:85,13,0,0 +BRDA:91,14,0,1 +BRDA:93,15,0,0 +BRDA:97,16,0,0 +BRF:17 +BRH:11 +end_of_record +TN: +SF:__wds-outside-root__\1\slotted-element\render\json.js +FN:3,render +FN:12,json2table +FNF:2 +FNH:2 +FNDA:1,render +FNDA:1,json2table +DA:1,1 +DA:2,1 +DA:3,1 +DA:4,1 +DA:5,1 +DA:6,1 +DA:7,1 +DA:8,1 +DA:9,1 +DA:10,1 +DA:11,1 +DA:12,1 +DA:13,1 +DA:14,1 +DA:15,1 +DA:16,1 +DA:17,1 +DA:18,1 +DA:19,1 +DA:20,1 +DA:21,1 +DA:22,1 +DA:23,1 +DA:24,1 +DA:25,1 +DA:26,1 +DA:27,1 +DA:28,1 +DA:29,1 +DA:30,1 +DA:31,1 +DA:32,1 +DA:33,1 +DA:34,1 +DA:35,1 +DA:36,1 +DA:37,1 +DA:38,1 +DA:39,1 +DA:40,1 +DA:41,1 +DA:42,1 +DA:43,1 +DA:44,1 +LF:44 +LH:44 +BRDA:1,0,0,1 +BRDA:3,1,0,1 +BRDA:12,2,0,1 +BRDA:17,3,0,0 +BRDA:22,4,0,1 +BRDA:23,5,0,1 +BRDA:24,6,0,1 +BRDA:38,7,0,1 +BRF:8 +BRH:7 +end_of_record diff --git a/dist/bundle/demo/Screenshot-fetch-element.png b/dist/bundle/demo/Screenshot-fetch-element.png new file mode 100644 index 0000000..dded43e Binary files /dev/null and b/dist/bundle/demo/Screenshot-fetch-element.png differ diff --git a/dist/bundle/demo/confused.svg b/dist/bundle/demo/confused.svg new file mode 100644 index 0000000..b803847 --- /dev/null +++ b/dist/bundle/demo/confused.svg @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dist/bundle/demo/demo.css b/dist/bundle/demo/demo.css new file mode 100644 index 0000000..904792f --- /dev/null +++ b/dist/bundle/demo/demo.css @@ -0,0 +1,2 @@ +main{ display: flex; flex-wrap: wrap; justify-content:space-between; gap: 1rem; } +main>*{ flex: auto; } diff --git a/dist/bundle/demo/demo3-element-a.html b/dist/bundle/demo/demo3-element-a.html new file mode 100644 index 0000000..da7b676 --- /dev/null +++ b/dist/bundle/demo/demo3-element-a.html @@ -0,0 +1,21 @@ + + + + + + + +

slot0 is overridden in body!

+
+ + + diff --git a/dist/bundle/demo/demo3-element.html b/dist/bundle/demo/demo3-element.html new file mode 100644 index 0000000..4495b34 --- /dev/null +++ b/dist/bundle/demo/demo3-element.html @@ -0,0 +1,24 @@ + + + + + + +

slot0 is overridden in body!

+
+ + + diff --git a/dist/bundle/demo/doc.json b/dist/bundle/demo/doc.json new file mode 100644 index 0000000..e15aeae --- /dev/null +++ b/dist/bundle/demo/doc.json @@ -0,0 +1,6 @@ +{ + "name": "Doc", + "title": "Dwarf", + "age": 50, + "portrait": "doc.png" +} diff --git a/dist/bundle/demo/doc.png b/dist/bundle/demo/doc.png new file mode 100644 index 0000000..aa08cd7 Binary files /dev/null and b/dist/bundle/demo/doc.png differ diff --git a/dist/bundle/demo/dwarfs.json b/dist/bundle/demo/dwarfs.json new file mode 100644 index 0000000..b473966 --- /dev/null +++ b/dist/bundle/demo/dwarfs.json @@ -0,0 +1,8 @@ +[ { "name": "Doc" , "Age guess":50, "title": "The leader of the dwarfs, required to be pompous, self-important and bumbling" } +, { "name": "Grumpy" , "Age guess":17, "title": " Doc and Grumpy arguing about whether Snow White should stay with them" } +, { "name": "Happy" , "Age guess":17, "title": " :) " } +, { "name": "Sleepy" , "Age guess":17, "title": " :-O " } +, { "name": "Bashful" , "Age guess":17, "title": "reluctant to draw attention to oneself; shy." } +, { "name": "Sneezy" , "Age guess":17, "title": "inclined to sneeze. ill, sick - affected by an impairment of normal physical or mental function" } +, { "name": "Dopey" , "Age guess":17, "title": "stupefied by sleep or a drug." } +] diff --git a/dist/bundle/demo/embedded.html b/dist/bundle/demo/embedded.html new file mode 100644 index 0000000..8efded0 --- /dev/null +++ b/dist/bundle/demo/embedded.html @@ -0,0 +1 @@ +From embedded.html 😏 diff --git a/dist/bundle/demo/import-map.importmap b/dist/bundle/demo/import-map.importmap new file mode 100644 index 0000000..d9189d2 --- /dev/null +++ b/dist/bundle/demo/import-map.importmap @@ -0,0 +1,5 @@ +{ + "imports": { + "css-chain": "../node_modules/css-chain/css-chain.js" + } +} \ No newline at end of file diff --git a/dist/bundle/demo/index.html b/dist/bundle/demo/index.html new file mode 100644 index 0000000..1a2f8a5 --- /dev/null +++ b/dist/bundle/demo/index.html @@ -0,0 +1,63 @@ + + + + + + + + + + + +

slotted-element demo

+ +

+ slotted-element is web component implementing slots without shadow DOM. + It is based on fetch-element component to fetch data and render from retrieved JSON or HTML. +

+
+ + + + + + + + + + + + + +
+ Slots located in wrapper + + + +
+
+
+ + + +
+ doc.json as table + +
+
+
+ + + + + + + + +
+ + + diff --git a/dist/bundle/demo/nav.html b/dist/bundle/demo/nav.html new file mode 100644 index 0000000..38a0e4d --- /dev/null +++ b/dist/bundle/demo/nav.html @@ -0,0 +1,4 @@ +git | + slotted-element demo | + fetch-element demo | + template demo diff --git a/dist/bundle/demo/render-from-json.html b/dist/bundle/demo/render-from-json.html new file mode 100644 index 0000000..3e769a9 --- /dev/null +++ b/dist/bundle/demo/render-from-json.html @@ -0,0 +1,47 @@ + + + + + render table from json - FetchElement + + + + + +

fetch-element render from JSON demo

+ +

+ slotted-element by default renders JSON as table. The rendering could be redefined: +

+
+ + + + + + + + + + + + +
+
+ + +
+ + diff --git a/dist/bundle/demo/render-from-xml.html b/dist/bundle/demo/render-from-xml.html new file mode 100644 index 0000000..011ccf7 --- /dev/null +++ b/dist/bundle/demo/render-from-xml.html @@ -0,0 +1,42 @@ + + + + + render table from json - FetchElement + + + + +

fetch-element render from JSON demo

+git | + slotted-element demo +
+ + + + + + + + + + + + +
+ + diff --git a/dist/bundle/demo/template-demo.html b/dist/bundle/demo/template-demo.html new file mode 100644 index 0000000..2be0ba7 --- /dev/null +++ b/dist/bundle/demo/template-demo.html @@ -0,0 +1,57 @@ + + + + + template - SlottedElement demo + + + + + + + + +

slotted-element with template demo

+ +

+ slotted-element is web component implementing slots without shadow DOM. There are 3 ways of template use: +

+
+ + +
inline HTML with slots 🎉
+

Not triggered as "src" attribute is not set.

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + diff --git a/dist/bundle/demo/template-with-slots2.html b/dist/bundle/demo/template-with-slots2.html new file mode 100644 index 0000000..f812fb7 --- /dev/null +++ b/dist/bundle/demo/template-with-slots2.html @@ -0,0 +1,16 @@ + + + + + + + + +

slot0 is overridden in body!

+
+ + diff --git a/dist/bundle/fetch-element.d.ts b/dist/bundle/fetch-element.d.ts new file mode 100644 index 0000000..462f2f1 --- /dev/null +++ b/dist/bundle/fetch-element.d.ts @@ -0,0 +1,148 @@ +/// +/** + * @returns Promise resolved when updated DOM is rendered by calling [requestIdleCallback](https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback) + * @param cb callback invoked on dom rendered, its return value passed back to wait4DomUpdated promise + */ +export function wait4DomUpdated(cb: ()=>T): Promise; + +/** + * @returns string lovercased with spaces replaces with dash '-' + * @param s string to convert + */ +export function toKebbabCase(s: string): string; + +/** + * webcomponent renders JSON and other content types retrieved by interruptible + * [ fetch() ](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) api + * [more...](https://github.com/sashafirsov/slotted-element#fetch-element) + */ +export class FetchElement extends HTMLElement { + /** + * @see [using custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) + */ + static get observedAttributes(): string[]; + + /** + * override this map the content type to module loader function + * @see [json remdering module](https://github.com/sashafirsov/slotted-element/blob/main/render/json.js) sample + */ + static get mime2mod(): { + 'application/json': () => Promise; + 'text/html': () => (data: any, contentType: any, httpCode: any, responseHeaders: any, ...args: any[]) => Promise; + 'text/xml': () => (data: any, contentType: any, httpCode: any, responseHeaders: any, ...args: any[]) => Promise; + 'application/xml': () => (data: any, contentType: any, httpCode: any, responseHeaders: any, ...args: any[]) => Promise; + 'image/svg+xml': () => (data: any, contentType: any, httpCode: any, responseHeaders: any, ...args: any[]) => Promise; + }; + + /** + * override to override the request headers + */ + get headers(): {[key:string]:string}; + + /** + * interrupt current request + * @see [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + */ + abort(): void; + + /** + * @see [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) + * @param args + */ + fetch( url:Request | string, options ): Promise; + + /** + * private + */ + _fetch: (url: any, options: any) => Promise; + /** + * string representing the loading to rendering life cycle + */ + state: 'loading'|'rendering'|'loaded'|'error'; + /** + * response.status, set by onResponse() handler, matching http error code + */ + status: string; + + /** + * @see [web component lifecycle](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks) + */ + connectedCallback(): void; + + /** + * set to true when fetch is initialized + */ + initialized: boolean; + /** + * @see [web component lifecycle](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks) + */ + attributeChangedCallback(name: any, oldValue: any, newValue: any): void; + + /** + * callback when `fetch()` is resolved. + * Sets `status`, `contentType`, `responseHeaders` and resolves the method for data + * conversion according to content type. + * @param response + * @returns data promise from `response.json()` or `response.text()` + */ + onResponse(response: any): Promise; + + /** + * set by `onResponse()` to 'network error' in case of http code not in 200 range + */ + error: string; + /** + * response.headers.get( 'content-type' ) + */ + contentType: string; + /** + * response.headers + */ + responseHeaders: any; + + /** + * pre-render callback to massage response data before `render()` + * @param data + */ + setContent(data: any): void; + + /** + * callback which check the contentType and invokes renderer from `mime2mod` map + * @param result + */ + onResult(result: any): Promise; + + /** + * callback to override the output HTML according to response outcome. + * @param data + * @param contentType + * @param httpCode + * @param responseHeaders + */ + render(data: any, contentType: any, httpCode: any, responseHeaders: any): void; + + /** + * default rendering implementation which triggers data and html transformation + * @param data + * @param contentType + * @param httpCode + * @param responseHeaders + * @param args + */ + renderHtml(data: any, contentType: any, httpCode: any, responseHeaders: any, ...args: any[]): Promise; + + /** + * callback on `fetch()` failure + * @param error + * @returns value for rejected promise + */ + onError(error: any): any; + + /** + * override to limit or define the order of keys on json object to be rendered in table. + * @param obj + * @returns array of keys to be shown in HTML + */ + getKeys(obj: any): string[]; +} +export default FetchElement; diff --git a/dist/bundle/render/json.js b/dist/bundle/render/json.js new file mode 100644 index 0000000..ce1fcfc --- /dev/null +++ b/dist/bundle/render/json.js @@ -0,0 +1,21 @@ +var g=Object.defineProperty,j=Object.defineProperties;var x=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var m=(t,e,r)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,u=(t,e)=>{for(var r in e||(e={}))E.call(e,r)&&m(t,r,e[r]);if(d)for(var r of d(e))C.call(e,r)&&m(t,r,e[r]);return t},p=(t,e)=>j(t,x(e));var b=(t,e)=>()=>(t&&(e=t(t=0)),e);function o(t){return new Promise(e=>{let r=window.requestIdleCallback||window.requestAnimationFrame,s=()=>e(t&&t());r?r(s):setTimeout(s,100)})}function l(t){return(t||"").toLowerCase().replaceAll(/\s/g,"-")}var _FetchElement,k,y=b(()=>{_FetchElement=class extends HTMLElement{static get observedAttributes(){return["src","method","headers","state","status","error","skiprender"]}static get mime2mod(){return{"application/json":async()=>(await Promise.resolve().then(()=>(T(),v))).default,"text/html":()=>_FetchElement.prototype.renderHtml,"text/xml":()=>_FetchElement.prototype.renderHtml,"application/xml":()=>_FetchElement.prototype.renderHtml,"image/svg+xml":()=>_FetchElement.prototype.renderHtml}}get headers(){return{}}abort(){}fetch(...t){return this._fetch(...t)}constructor(){super();let t=Promise.resolve(),e=new AbortController,{signal:r}=e;this.abort=()=>e.abort(),this._fetch=async(s,n)=>{this.state="loading",this.status="";let a=p(u({method:this.getAttribute("method")||"GET",headers:this.headers},n),{signal:r});return t=new Promise(async(i,c)=>{try{let h=await fetch(s,a),f=await this.onResponse(h),w=await this.onResult(f);this.error?c(this.error):i(w)}catch(h){c(this.onError(h))}})},Object.defineProperty(this,"promise",{get(){return t}}),_FetchElement.observedAttributes.filter(s=>s!=="headers").forEach(s=>Object.defineProperty(this,s,{get:()=>this.getAttribute(s),set:n=>this.setAttribute(s,n)}))}connectedCallback(){this.src&&this.fetch(this.src),this.initialized=!0}attributeChangedCallback(name,oldValue,newValue){switch(name){case"headers":this[name]=eval(newValue);break;case"src":this.initialized&&this.fetch(newValue);break;default:this[name]!==newValue&&(this[name]=newValue)}}async onResponse(t){let e=1*(this.status=t.status);return(e<200||e>=300)&&(this.error="network error"),this.contentType=t.headers.get("content-type"),this.responseHeaders=t.headers,this.contentType.includes("json")?t.json():t.text()}setContent(t){this.innerHTML=t}async onResult(t){try{if(this.hasAttribute("skiprender"))return;let e=await this.constructor.mime2mod[this.contentType.split(";")[0]]();return typeof e=="string"&&(e=(await import(e)).default),this.state="rendering",(e||this.render).call(this,t,this.contentType,this.status,this.responseHeaders)}finally{this.state="loaded"}}render(t,e,r,s){}async renderHtml(t,e,r,s){this.setContent(t),await o(),this.render(...arguments),await o()}onError(t){return this.state="error",t}getKeys(t){return Object.keys(t)}},k=_FetchElement;window.customElements.define("fetch-element",_FetchElement)});async function A(t,e,r,s){await o();let n=this.render(t,e,r,s);this.json2table||(this.json2table=H),this.setContent(n||this.json2table(t,[])),await o()}function H(t,e){if(Array.isArray(t)){if(!t.length)return"";let s=this.getKeys(t[0]);return` + + ${s.map(n=>``).join(` +`)} + ${t.map((n,a)=>` + ${s.map(i=>` + `).join("")} + `).join(` +`)} +
${n}
+ ${this.json2table(n[i],[...e,a,i])} +
+`}return typeof t!="object"||t===null?t:` + + ${this.getKeys(t).map(s=>` + + +`).join("")} +
${s}${this.json2table(t[s],[...e,s])}
+`}var T=b(()=>{y()});T();export{A as default,H as json2table}; +//# sourceMappingURL=json.js.map diff --git a/dist/bundle/render/json.js.map b/dist/bundle/render/json.js.map new file mode 100644 index 0000000..5f71ab8 --- /dev/null +++ b/dist/bundle/render/json.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../slotted-element/fetch-element.js", "../../../../slotted-element/render/json.js"], + "sourcesContent": [" export function\nwait4DomUpdated( cb )\n{\n return new Promise( resolve =>\n {\n const assureDom = window.requestIdleCallback || window.requestAnimationFrame\n , done = () => resolve( cb && cb() );\n assureDom ? assureDom( done ) : setTimeout( done, 100 );\n } )\n}\n\n export function\ntoKebbabCase( s )\n{ return ( s || '' ).toLowerCase().replaceAll( /\\s/g, '-' )}\n\n export class\nFetchElement extends HTMLElement\n{\n static get observedAttributes(){ return [ 'src', 'method', 'headers', 'state', 'status', 'error', 'skiprender' ]; }\n\n static get mime2mod(){ return { 'application/json':async ()=>(await import('./render/json.js')).default\n , 'text/html': ()=>FetchElement.prototype.renderHtml\n , 'text/xml': ()=>FetchElement.prototype.renderHtml\n , 'application/xml': ()=>FetchElement.prototype.renderHtml\n , 'image/svg+xml': ()=>FetchElement.prototype.renderHtml\n }}\n\n get headers(){ return {} }\n\n abort(){}\n\n fetch(...args){ return this._fetch(...args); }\n\n constructor()\n {\n super();\n let promise = Promise.resolve();\n const controller = new AbortController();\n const { signal } = controller;\n\n this.abort = () => controller.abort();\n this._fetch = async( url, options ) =>\n {\n this.state = 'loading';\n this.status = '';\n\n const opt = {\n method: this.getAttribute( 'method' ) || 'GET'\n , headers: this.headers\n , ...options\n , signal\n };\n\n return promise = new Promise( async( resolve, reject ) =>\n {\n try\n { const response = await fetch( url, opt );\n const ret = await this.onResponse( response )\n const res = await this.onResult( ret );\n this.error ? reject( this.error ) : resolve( res );\n }catch( ex )\n { reject( this.onError( ex ) ); }\n } )\n };\n Object.defineProperty( this, 'promise', { get(){ return promise; } } );\n FetchElement.observedAttributes\n .filter( prop => prop !== 'headers' )\n .forEach( prop => Object.defineProperty( this, prop,\n {\n get: () => this.getAttribute( prop )\n , set: val => this.setAttribute( prop, val )\n } ) );\n }\n\n connectedCallback()\n {\n this.src && this.fetch( this.src );\n this.initialized = !0;\n }\n\n attributeChangedCallback( name, oldValue, newValue )\n {\n switch( name )\n { case 'headers':\n this[ name ] = eval( newValue );\n break;\n case 'src':\n this.initialized && this.fetch( newValue );\n break;\n default:\n if( this[ name ] !== newValue )\n this[ name ] = newValue;\n }\n }\n\n async onResponse( response )\n {\n const s = 1 * ( this.status = response.status );\n if( s < 200 || s >= 300 )\n this.error = 'network error';\n this.contentType = response.headers.get( 'content-type' );\n this.responseHeaders = response.headers;\n if( this.contentType.includes( 'json' ) )\n return response.json();\n return response.text();\n }\n\n setContent( html ){ this.innerHTML = html; }\n \n async onResult( result )\n {\n try\n { if( this.hasAttribute('skiprender') )\n return;\n\n let mod = await this.constructor.mime2mod[ this.contentType.split(';')[0] ]();\n if( typeof mod === 'string' )\n mod = (await import(mod)).default;\n\n this.state = 'rendering';\n\n return ( mod || this.render ).call( this, result, this.contentType, this.status, this.responseHeaders );\n }finally\n {\n this.state = 'loaded';\n }\n }\n\n render( data, contentType, httpCode, responseHeaders ){}\n async renderHtml( data, contentType, httpCode, responseHeaders )\n {\n this.setContent( data );\n await wait4DomUpdated();\n this.render( ...arguments );\n await wait4DomUpdated();\n }\n\n onError( error )\n {\n this.state = 'error';\n return error;\n }\n\n getKeys( obj ){ return Object.keys( obj ); }\n}\n\nexport default FetchElement;\n\nwindow.customElements.define( 'fetch-element', FetchElement );\n", "import { toKebbabCase, wait4DomUpdated } from '../fetch-element.js';\n\nexport default async function render( data, contentType, status, responseHeaders )\n{\n await wait4DomUpdated();\n const html = this.render( data, contentType, status, responseHeaders );\n if( !this.json2table )\n this.json2table = json2table;\n this.setContent( html || this.json2table( data, [] ) );\n await wait4DomUpdated();\n}\nexport function json2table( data, path )\n{\n if( Array.isArray( data ) )\n {\n if( !data.length )\n return '';\n const keys = this.getKeys( data[ 0 ] );\n\n return `\n\n ${ keys.map( k => `` ).join( '\\n' ) }\n ${ data.map( ( r, i ) => `\n ${ keys.map( k => `\n ` ).join( '' )\n }\n ` ).join( '\\n' ) }\n
${ k }
\n ${ this.json2table( r[ k ], [ ...path, i, k ] ) }\n
\n`\n }\n if( typeof data !== 'object' || data === null )\n return data;\n const keys = this.getKeys( data );\n return `\n\n ${ keys.map( k => `\n\n \n` ).join( '' ) }\n
${ k }${ this.json2table( data[ k ], [ ...path, k ] ) }
\n`\n}\n"], + "mappings": "gdAAW,WACM,EACjB,CACI,MAAO,IAAI,SAAS,GACpB,CACI,GAAM,GAAY,OAAO,qBAAuB,OAAO,sBACjD,EAAY,IAAM,EAAS,GAAM,EAAG,CAAE,EAC5C,EAAY,EAAW,CAAK,EAAI,WAAY,EAAM,GAAI,CAC1D,CAAE,CACN,CAEW,WACG,EACd,CAAE,MAAS,IAAK,IAAK,YAAY,EAAE,WAAY,MAAO,GAAI,CAAC,CAb3D,GAeW,eAmIJ,EAlJP,SAeW,2BACU,YACrB,WACe,qBAAoB,CAAE,MAAQ,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,gBAAiB,aAAa,IClJ5D,iBAAsC,EAAM,EAAa,EAAQ,EACjE,CACI,KAAM,GAAgB,EACtB,GAAM,GAAO,KAAK,OAAQ,EAAM,EAAa,EAAQ,CAAgB,EACrE,AAAK,KAAK,YACN,MAAK,WAAa,GACtB,KAAK,WAAY,GAAQ,KAAK,WAAY,EAAM,CAAC,CAAE,CAAE,EACrD,KAAM,GAAgB,CAC1B,CACO,WAAqB,EAAM,EAClC,CACI,GAAI,MAAM,QAAS,CAAK,EACxB,CACI,GAAI,CAAC,EAAK,OACN,MAAO,GACX,GAAM,GAAO,KAAK,QAAS,EAAM,EAAI,EAErC,MAAO;AAAA;AAAA,UAEJ,EAAK,IAAK,GAAK,OAAQ,QAAU,EAAE,KAAM;AAAA,CAAK;AAAA,MAClD,EAAK,IAAK,CAAE,EAAG,IAAO;AAAA,UAClB,EAAK,IAAK,GAAK;AAAA,mBACN,EAAc,CAAE;AAAA,cACrB,KAAK,WAAY,EAAG,GAAK,CAAE,GAAG,EAAM,EAAG,CAAE,CAAE;AAAA,cAC3C,EAAE,KAAM,EAAG;AAAA,UAEf,EAAE,KAAM;AAAA,CAAK;AAAA;AAAA,CAGpB,CACA,MAAI,OAAO,IAAS,UAAY,IAAS,KAC9B,EAEJ;AAAA;AAAA,MAEJ,AAHU,KAAK,QAAS,CAAK,EAGxB,IAAK,GAAK;AAAA,UACX;AAAA,eACK,EAAc,CAAE,MAAQ,KAAK,WAAY,EAAM,GAAK,CAAE,GAAG,EAAM,CAAE,CAAE;AAAA,MAC5E,EAAE,KAAM,EAAG;AAAA;AAAA,CAGlB,CA3CA", + "names": [] +} diff --git a/dist/bundle/render/xml.js b/dist/bundle/render/xml.js new file mode 100644 index 0000000..a0b3858 --- /dev/null +++ b/dist/bundle/render/xml.js @@ -0,0 +1,3 @@ +async function p(o,r,e,n){let i=new window.DOMParser().parseFromString(o,"text/xml");this.render(i,r,e,n)}function f(o,r){var e=new XMLHttpRequest;e.open("GET",o,!1),e.onreadystatechange=function(){if(e.readyState==4)try{if(e.responseXML)return r(e.responseXML);var n=e.responseText.trim();n.charAt(0)!="<"&&(n=t(JSON.parse(n))),r(new DOMParser().parseFromString(n,"application/xml"))}catch(i){console.error("XML reading error",i)}},e.send()}function t(o,r){var e=typeof r!="string";if(o instanceof Array)return e&&(r="array"),"<"+r+">"+o.map(function(a){return t(a,r)}).join()+"";e&&(r="r"),r=r.replace(/[^a-z0-9]/gi,"_");var n={},i=["<"+r+" "];for(var s in o)typeof o[s]=="object"?n[s]=o[s]:i.push(s.replace(/[^a-z0-9]/gi,"_")+'="'+o[s].toString().replace(/&/gi,"&")+'"');if(n){i.push(">");for(var s in n)i.push(t(n[s],s));i.push("")}else i.push("/>");return i.join(` +`)}export{t as Json2Xml,p as default,f as getXml}; +//# sourceMappingURL=xml.js.map diff --git a/dist/bundle/render/xml.js.map b/dist/bundle/render/xml.js.map new file mode 100644 index 0000000..cba460f --- /dev/null +++ b/dist/bundle/render/xml.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../../slotted-element/render/xml.js"], + "sourcesContent": ["export default async function render( data, contentType, status, responseHeaders )\n{\n const xml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n this.render( xml, contentType, status, responseHeaders );\n // todo xslt from xml\n}\n export function\ngetXml(url, callback)\n{\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, false);\n xhr.onreadystatechange = function ()\n {\n if( 4 != xhr.readyState )\n return;\n try\n { if( xhr.responseXML )\n return callback(xhr.responseXML);\n var txt = xhr.responseText.trim();\n if( txt.charAt(0)!='<' )\n txt = Json2Xml( JSON.parse(txt) );\n callback(new DOMParser().parseFromString( txt, \"application/xml\" ));\n }catch( ex )\n { console.error(\"XML reading error\", ex ); }\n }\n xhr.send();\n}\n export function\nJson2Xml( o, tag )\n{ var noTag = \"string\" != typeof tag;\n\n if( o instanceof Array )\n { noTag && (tag = 'array');\n return \"<\"+tag+\">\"+o.map(function(el){ return Json2Xml(el,tag); }).join()+\"\";\n }\n noTag && (tag = 'r');\n tag=tag.replace( /[^a-z0-9]/gi,'_' );\n var oo = {}\n , ret = [ \"<\"+tag+\" \"];\n for( var k in o )\n if( typeof o[k] == \"object\" )\n oo[k] = o[k];\n else\n ret.push( k.replace( /[^a-z0-9]/gi,'_' ) + '=\"'+o[k].toString().replace(/&/gi,'&')+'\"');\n if( oo )\n { ret.push(\">\");\n for( var k in oo )\n ret.push( Json2Xml( oo[k], k ) );\n ret.push(\"\");\n }else\n ret.push(\"/>\");\n return ret.join('\\n');\n}"], + "mappings": "AAAA,iBAAsC,EAAM,EAAa,EAAQ,EACjE,CACI,GAAM,GAAQ,GAAI,QAAO,UAAU,EAAI,gBAAiB,EAAM,UAAW,EACzE,KAAK,OAAQ,EAAK,EAAa,EAAQ,CAAgB,CAE3D,CACW,WACJ,EAAK,EACZ,CACI,GAAI,GAAM,GAAI,gBACd,EAAI,KAAK,MAAO,EAAK,EAAK,EAC1B,EAAI,mBAAqB,UACzB,CACI,GAAI,AAAK,EAAI,YAAT,EAEJ,GACA,CAAI,GAAI,EAAI,YACJ,MAAO,GAAS,EAAI,WAAW,EACnC,GAAI,GAAM,EAAI,aAAa,KAAK,EAChC,AAAI,EAAI,OAAO,CAAC,GAAG,KACf,GAAM,EAAU,KAAK,MAAM,CAAG,CAAE,GACpC,EAAS,GAAI,WAAU,EAAE,gBAAiB,EAAK,iBAAkB,CAAC,CACtE,OAAQ,EAAP,CACO,QAAQ,MAAM,oBAAqB,CAAG,CAAG,CACrD,EACA,EAAI,KAAK,CACb,CACW,WACD,EAAG,EACb,CAAI,GAAI,GAAQ,AAAY,MAAO,IAAnB,SAEZ,GAAI,YAAa,OACb,UAAW,GAAM,SACV,IAAI,EAAI,IAAI,EAAE,IAAI,SAAS,EAAG,CAAE,MAAO,GAAS,EAAG,CAAG,CAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAI,IAEvF,GAAW,GAAM,KACjB,EAAI,EAAI,QAAS,cAAc,GAAI,EACnC,GAAI,GAAM,CAAC,EACH,EAAM,CAAE,IAAI,EAAI,GAAG,EAC3B,OAAS,KAAK,GACV,AAAI,MAAO,GAAE,IAAM,SACf,EAAG,GAAK,EAAE,GAEV,EAAI,KAAM,EAAE,QAAS,cAAc,GAAI,EAAI,KAAK,EAAE,GAAG,SAAS,EAAE,QAAQ,MAAM,OAAO,EAAE,GAAG,EAClG,GAAI,EACJ,CAAI,EAAI,KAAK,GAAG,EACZ,OAAS,KAAK,GACV,EAAI,KAAM,EAAU,EAAG,GAAI,CAAE,CAAE,EACnC,EAAI,KAAK,KAAK,EAAI,GAAG,CACzB,KACI,GAAI,KAAK,IAAI,EACjB,MAAO,GAAI,KAAK;AAAA,CAAI,CACxB", + "names": [] +} diff --git a/dist/bundle/slotted-element.d.ts b/dist/bundle/slotted-element.d.ts new file mode 100644 index 0000000..9369c0a --- /dev/null +++ b/dist/bundle/slotted-element.d.ts @@ -0,0 +1,72 @@ +export * from "./fetch-element.js"; +export class SlottedElement extends FetchElement { + /** + * @see [web component lifecycle](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks) + */ + attributeChangedCallback(name: any, oldValue: any, newValue: any): void; + + /** + * attribute with id of html element used as template [see light DOM](https://github.com/sashafirsov/css-chain#light-dom-api) + */ + template: string; + + /** + * [CssChain](https://github.com/sashafirsov/css-chain) of slotted-elemt children defined by `css` + * @param css + */ + $(css: undefined|string): CssChainCollection&T; + + /** + * @see [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) + * @param args + */ + fetch( url:Request | string, options ): Promise; + /** + * pre-render callback to massage response data before `render()` + * @param data + */ + setContent(data: any): void; + + /** + * read slots from internal DOM. Has to be called before any slots operations. + */ + slotsInit(): void; + + /** + * hashmap of slot name to slot used internally + */ + slots: {}; + + /** + * hide all slots except of named one by setting/removing `hidden` attribute + * @param name + */ + slotOnly(name: string): void; + + /** + * remove all slots clones + */ + slotsClear(): void; + + /** + * returns node (clone of slot subtree) to be modified before insertion by `slotAdd()` + * @param name + */ + slotClone(name: string): Node; + + /** + * adds slot clone node to internal content immediately after original slot + * @param node name or node created by slotClone(name) + */ + slotAdd(node: Node): Node; + + /** + * clones slot node and inserts immediately after original slot + * @param nodeName name or node created by slotClone(name) + */ + slotAdd(nodeName: string): Node; +} +export default SlottedElement; +export { $ as CssChain }; +import FetchElement from "./fetch-element.js"; +import {CssChain as $, CssChainCollection, CssChainT} from "css-chain"; diff --git a/dist/bundle/slotted-element.js b/dist/bundle/slotted-element.js new file mode 100644 index 0000000..3ea8a8a --- /dev/null +++ b/dist/bundle/slotted-element.js @@ -0,0 +1,21 @@ +var M=Object.defineProperty,_=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var z=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var P=(e,t,s)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,S=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&P(e,s,t[s]);if(L)for(var s of L(t))G.call(t,s)&&P(e,s,t[s]);return e},R=(e,t)=>_(e,W(t));var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>{for(var s in t)M(e,s,{get:t[s],enumerable:!0})};var v={};J(v,{default:()=>I,json2table:()=>q});async function I(e,t,s,r){await u();let n=this.render(e,t,s,r);this.json2table||(this.json2table=q),this.setContent(n||this.json2table(e,[])),await u()}function q(e,t){if(Array.isArray(e)){if(!e.length)return"";let r=this.getKeys(e[0]);return` + + ${r.map(n=>``).join(` +`)} + ${e.map((n,o)=>` + ${r.map(i=>` + `).join("")} + `).join(` +`)} +
${n}
+ ${this.json2table(n[i],[...t,o,i])} +
+`}return typeof e!="object"||e===null?e:` + + ${this.getKeys(e).map(r=>` + + +`).join("")} +
${r}${this.json2table(e[r],[...t,r])}
+`}var D=F(()=>{E()});function u(e){return new Promise(t=>{let s=window.requestIdleCallback||window.requestAnimationFrame,r=()=>t(e&&e());s?s(r):setTimeout(r,100)})}function T(e){return(e||"").toLowerCase().replaceAll(/\s/g,"-")}var _FetchElement,g,E=F(()=>{_FetchElement=class extends HTMLElement{static get observedAttributes(){return["src","method","headers","state","status","error","skiprender"]}static get mime2mod(){return{"application/json":async()=>(await Promise.resolve().then(()=>(D(),v))).default,"text/html":()=>_FetchElement.prototype.renderHtml,"text/xml":()=>_FetchElement.prototype.renderHtml,"application/xml":()=>_FetchElement.prototype.renderHtml,"image/svg+xml":()=>_FetchElement.prototype.renderHtml}}get headers(){return{}}abort(){}fetch(...e){return this._fetch(...e)}constructor(){super();let e=Promise.resolve(),t=new AbortController,{signal:s}=t;this.abort=()=>t.abort(),this._fetch=async(r,n)=>{this.state="loading",this.status="";let o=R(S({method:this.getAttribute("method")||"GET",headers:this.headers},n),{signal:s});return e=new Promise(async(i,m)=>{try{let p=await fetch(r,o),y=await this.onResponse(p),l=await this.onResult(y);this.error?m(this.error):i(l)}catch(p){m(this.onError(p))}})},Object.defineProperty(this,"promise",{get(){return e}}),_FetchElement.observedAttributes.filter(r=>r!=="headers").forEach(r=>Object.defineProperty(this,r,{get:()=>this.getAttribute(r),set:n=>this.setAttribute(r,n)}))}connectedCallback(){this.src&&this.fetch(this.src),this.initialized=!0}attributeChangedCallback(name,oldValue,newValue){switch(name){case"headers":this[name]=eval(newValue);break;case"src":this.initialized&&this.fetch(newValue);break;default:this[name]!==newValue&&(this[name]=newValue)}}async onResponse(e){let t=1*(this.status=e.status);return(t<200||t>=300)&&(this.error="network error"),this.contentType=e.headers.get("content-type"),this.responseHeaders=e.headers,this.contentType.includes("json")?e.json():e.text()}setContent(e){this.innerHTML=e}async onResult(e){try{if(this.hasAttribute("skiprender"))return;let t=await this.constructor.mime2mod[this.contentType.split(";")[0]]();return typeof t=="string"&&(t=(await import(t)).default),this.state="rendering",(t||this.render).call(this,e,this.contentType,this.status,this.responseHeaders)}finally{this.state="loaded"}}render(e,t,s,r){}async renderHtml(e,t,s,r){this.setContent(e),await u(),this.render(...arguments),await u()}onError(e){return this.state="error",e}getKeys(e){return Object.keys(e)}},g=_FetchElement;window.customElements.define("fetch-element",_FetchElement)});E();var dt=Object.getPrototypeOf({}),$=(e,t,s)=>{typeof e[t]=="function"?s.prototype[t]=function(...r){return t.startsWith("get")?this.length?this[0][t](...r):void 0:(this.forEach(n=>n[t](...r)),this)}:Object.defineProperty(s.prototype,t,{get:function(){if(this.length)return this[0][t]},set:function(r){return this.forEach(n=>n[t]=r),r}})};var c=(e,...t)=>Array.prototype.map.apply(e,t),V=(e,...t)=>c(e,...t).join(","),w=e=>c(e,t=>rt(t)).join(""),d=e=>document.createElement(e);function Y(e,t,s){let r=d(e);return r[t]=s,r}function Q(e){return!!e?.nodeType}var X=()=>"",f=e=>Array.isArray(e)||e&&typeof e.forEach=="function",j=(e,t)=>typeof e===t,A=e=>j(e,"string"),Z=e=>j(e,"number"),b=e=>j(e,"function"),tt=e=>e.getRootNode().host,O=e=>tt(e)&&e.assignedNodes,et=(e,t)=>(e.forEach(t),e),B=e=>O(e)?e.assignedNodes().forEach(t=>t.remove()):e.innerHTML="",st={1:e=>e.assignedNodes?w(e.assignedNodes())||w(e.childNodes):["SCRIPT","AUDIO","STYLE","CANVAS","DATALIST","EMBED","OBJECT","PICTURE","IFRAME","METER","NOSCRIPT","SELECT","OPTGROUP","PROGRESS","TEMPLATE","VIDEO"].includes(e.nodeName)?"":e.innerText,3:e=>e.nodeValue,11:e=>w(e.childNodes)},rt=e=>(st[e.nodeType]||X)(e),k=(e,t)=>O(e)?e.assignedElements().forEach(s=>s.innerText=t):e.innerText=t,ot=(e,t)=>e.map(s=>t.appendChild(s)),nt=e=>c(e,t=>t.assignedElements?c(t.assignedElements(),s=>s.outerHTML).join(""):t.innerHTML).join(""),N=e=>{let t=d("div");t.innerHTML=e;let s=r=>{if(r.nodeType!==3)return r;let n=d("span");return n.append(r),n};return[...t.childNodes].map(r=>(r.remove(),r)).map(s)},K=(e,t)=>{let s=(n,o)=>o instanceof Node?o.remove()||n.append(o):N(o).forEach(i=>n.append(i)),r=n=>O(e)?e.assign(...e.assignedNodes(),...ot(et(N(n),o=>o.slot=e.name),e.getRootNode().host)):s(e,n);t instanceof NodeList||f(t)?[...t].forEach(r):r(t)},C=(e,t)=>{B(e),K(e,t)},a=class extends Array{attr(...t){return t.length>1?((t[2]?this.$(t[2]):this).setAttribute(...t),this):this.getAttribute(...t)}prop(...t){return t.length>1?((t[2]?this.$(t[2]):this).forEach(s=>s[t[0]]=t[1]),this):this[0][t[0]]}forEach(...t){return Array.prototype.forEach.apply(this,t),this}map(...t){return c(this,...t)}push(...t){return Array.prototype.push.apply(this,t),this}querySelector(t){return new a().push(this.querySelectorAll(t)[0])}querySelectorAll(t){return this.reduce((s,r)=>s.push(...(r.shadowRoot||r).querySelectorAll(t)),new a)}$(...t){return t.length?this.querySelectorAll(...t):this}parent(t){let s=new Set,r=o=>s.has(o)?0:(s.add(o),o),n=o=>{for(;o=o.parentElement;)if(o.matches(t))return r(o)};return h(this.map(t?n:o=>r(o.parentElement)).filter(o=>o))}on(...t){return this.addEventListener(...t)}append(t){return this.forEach(s=>K(s,t))}remove(...t){return t.length?b(t[1])?this.removeEventListener(...t):this.map(s=>s.matches(t[0])).filter(s=>s):(this.forEach(s=>s.remove()),new a)}erase(){return this.forEach(t=>B(t))}slots(...t){let s=t.length?V(t[0].split(","),o=>['""',"''"].includes(o)||!o?"slot:not([name])":`slot[name="${o}"]`):"slot",r=this.filter(o=>o.matches&&o.matches(s)),n=this.filter(o=>!r.includes(o)&&o.querySelector).map(o=>o.shadowRoot||o).$(t.length?V(t[0].split(","),o=>['""',"''"].includes(o)||!o?"slot:not([name])":`slot[name="${o}"]`):"slot");return t.length===2?(n.html(t[1]),this):h([...r,...n])}template(t){if(t===void 0){let r=this.$("[slot]").forEach(n=>this.$(n.slot?`slot[name="${n.slot}"]`:"slot:not([name])").length||n.parentNode.insertBefore(Y("slot","name",n.slot),n));r.remove(),t=d("template"),this.childNodes.forEach(n=>t.content.append(n)),this.append(r)}else A(t)&&(t=this.$(t),t.remove());let s=h(t.content?t.content.childNodes:t).clone(this);return s.slots().forEach(r=>{let n=this.children.filter(o=>o.slot===r.name);n.length&&C(r,n)}),this.children.remove(),this.append(s),this}get innerText(){return this.txt()}set innerText(t){return this.txt(t)}txt(t,s=void 0){let r=s?this.$(s):this;return t===void 0?w(r):(r.forEach(b(t)?(n,o)=>k(n,t(n,o,r)):n=>k(n,t)),this)}get outerHTML(){return this.map(t=>t.outerHTML).join("")}set outerHTML(t){return this.forEach((s,r,n)=>{let o=s.parentNode;N(b(t)?t(s,r,n):t).forEach(i=>o.insertBefore(n[r]=i,s)),s.remove()})}get innerHTML(){return this.html()}set innerHTML(t){return this.html(t)}html(t,s=void 0){let r=s?this.$(s):this;return t===void 0?nt(r):(r.forEach(b(t)?(n,o)=>C(n,t(n,o,r)):n=>C(n,t)),this)}assignedElements(t){return h([].concat(...this.map(s=>s.assignedElements?s.assignedElements(t):[])))}assignedNodes(t){return h([].concat(...this.map(s=>s.assignedNodes?s.assignedNodes(t):[])))}cloneNode(...t){return this.map(s=>s.cloneNode&&s.cloneNode(...t))}clone(t=1,s=void 0){let r=t;if(Z(t)&&(r=Array.from({length:t},(o,i)=>i)),f(r)){let o=[];return this.forEach(i=>r.forEach((m,p)=>{let y=i.ownerDocument.importNode(i,!0),l=s&&s(y,m,p,r);A(l)?o.push(...N(l)):f(l)?o.push(...l):o.push(Q(l)?l:y)})),h(o)}let n=t;return this.map(o=>n?n.importNode(o,!0):o.cloneNode?o.cloneNode(!0):Object.assign({},o))}get firstElementChild(){return h(this.map(t=>t.firstElementChild).filter(t=>t))}get firstChild(){return h(this.map(t=>t.firstChild).filter(t=>t))}get childNodes(){return h([].concat(...c(this,t=>[...t.childNodes||[]])))}get children(){return h([].concat(...c(this,t=>[...t.children||[]])))}},x=new Set,it=Object.getPrototypeOf({});function U(e,t){let s=A(e)?d(e):e;if(!x.has(s.tagName)){x.add(s.tagName);for(let r in s)r in t.prototype||$(s,r,t);for(let r;(r=Object.getPrototypeOf(s))!==it&&r!=null&&!x.has(r);){x.add(r);for(let n of Object.getOwnPropertyNames(r))n in t.prototype||$(s,n,t)}}}Object.getOwnPropertyNames(window).filter(e=>e.startsWith("HTML")&&e.endsWith("Element")&&e.length>11).map(e=>e.substring(4,e.length-7).toLowerCase()).forEach(e=>U(d(e),a));function h(e,t=document,s=[]){let r=typeof e=="string"?t.querySelectorAll(e):f(e)?e:[e?e.shadowRoot||e:document];f(s)?s.length||(s=[...r].slice(0,256)):s=[s],s.forEach(o=>U(o,a));let n=new a;return n.push(...r),n}E();var Et=g;function ht(e,t,s){let r=document.createElement(e);return r[t]=s,r}var H=class extends g{static get observedAttributes(){return["template",...g.observedAttributes]}connectedCallback(){this._$=h(this),this.slotsInit(),super.connectedCallback()}attributeChangedCallback(t,s,r){if(t!=="template")return super.attributeChangedCallback(t,s,r);this.template=r,this.initialized&&this.slotsInit()}$(t){return t?this._$.$(t):this._$}fetch(t,s){return this.slotOnly("loading"),super.fetch(t,s).finally(()=>this.slotOnly(this.state))}setContent(t){if(this.slots.loaded){let s=this.slotClone("loaded");s.innerHTML=t,this.slotAdd(s)}else this.innerHTML=t}slotsInit(){this.slots||(this.slots={},this.$("[slot]").map(r=>this.slots[r.slot]=r));let t=this._$,s=t.attr("template");s?t.template(h("#"+s)):this.template?t.template(ht("template","innerHTML",this.template)):t.template(),this.src||this.slotOnly("loaded")}slotOnly(t){this.$("[slot-cloned]").filter(r=>r.slot!==t).remove(),this.$().slots(t).length&&this.$().slots().attr("hidden","hidden"),this.$(`[slot="${t}"][slot-cloned]`).length||this.slotAdd(t),this.$().slots(t).removeAttribute("hidden")}slotsClear(){this.$("[slot-cloned]").remove()}slotClone(t){let s=this.slots[t];if(!s)return;let r=s.cloneNode(!0);return r.setAttribute("slot-cloned",!0),r.hidden=!1,r}slotAdd(t){let s=t.slot?t:this.slotClone(t),r=this.$(`slot[name="${t.slot||t}"]`),n;for(let o of r)n=o.parentElement.insertBefore(s,o);return n}},gt=H;window.customElements.define("slotted-element",H);export{h as CssChain,Et as FetchElement,H as SlottedElement,_FetchElement,gt as default,T as toKebbabCase,u as wait4DomUpdated}; +//# sourceMappingURL=slotted-element.js.map diff --git a/dist/bundle/slotted-element.js.map b/dist/bundle/slotted-element.js.map new file mode 100644 index 0000000..7d1b8f7 --- /dev/null +++ b/dist/bundle/slotted-element.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../slotted-element/render/json.js", "../../../slotted-element/fetch-element.js", "../../../slotted-element/slotted-element.js", "../../../slotted-element/node_modules/css-chain/ApiChain.js", "../../../slotted-element/node_modules/css-chain/CssChain.js"], + "sourcesContent": ["import { toKebbabCase, wait4DomUpdated } from '../fetch-element.js';\n\nexport default async function render( data, contentType, status, responseHeaders )\n{\n await wait4DomUpdated();\n const html = this.render( data, contentType, status, responseHeaders );\n if( !this.json2table )\n this.json2table = json2table;\n this.setContent( html || this.json2table( data, [] ) );\n await wait4DomUpdated();\n}\nexport function json2table( data, path )\n{\n if( Array.isArray( data ) )\n {\n if( !data.length )\n return '';\n const keys = this.getKeys( data[ 0 ] );\n\n return `\n\n ${ keys.map( k => `` ).join( '\\n' ) }\n ${ data.map( ( r, i ) => `\n ${ keys.map( k => `\n ` ).join( '' )\n }\n ` ).join( '\\n' ) }\n
${ k }
\n ${ this.json2table( r[ k ], [ ...path, i, k ] ) }\n
\n`\n }\n if( typeof data !== 'object' || data === null )\n return data;\n const keys = this.getKeys( data );\n return `\n\n ${ keys.map( k => `\n\n \n` ).join( '' ) }\n
${ k }${ this.json2table( data[ k ], [ ...path, k ] ) }
\n`\n}\n", " export function\nwait4DomUpdated( cb )\n{\n return new Promise( resolve =>\n {\n const assureDom = window.requestIdleCallback || window.requestAnimationFrame\n , done = () => resolve( cb && cb() );\n assureDom ? assureDom( done ) : setTimeout( done, 100 );\n } )\n}\n\n export function\ntoKebbabCase( s )\n{ return ( s || '' ).toLowerCase().replaceAll( /\\s/g, '-' )}\n\n export class\nFetchElement extends HTMLElement\n{\n static get observedAttributes(){ return [ 'src', 'method', 'headers', 'state', 'status', 'error', 'skiprender' ]; }\n\n static get mime2mod(){ return { 'application/json':async ()=>(await import('./render/json.js')).default\n , 'text/html': ()=>FetchElement.prototype.renderHtml\n , 'text/xml': ()=>FetchElement.prototype.renderHtml\n , 'application/xml': ()=>FetchElement.prototype.renderHtml\n , 'image/svg+xml': ()=>FetchElement.prototype.renderHtml\n }}\n\n get headers(){ return {} }\n\n abort(){}\n\n fetch(...args){ return this._fetch(...args); }\n\n constructor()\n {\n super();\n let promise = Promise.resolve();\n const controller = new AbortController();\n const { signal } = controller;\n\n this.abort = () => controller.abort();\n this._fetch = async( url, options ) =>\n {\n this.state = 'loading';\n this.status = '';\n\n const opt = {\n method: this.getAttribute( 'method' ) || 'GET'\n , headers: this.headers\n , ...options\n , signal\n };\n\n return promise = new Promise( async( resolve, reject ) =>\n {\n try\n { const response = await fetch( url, opt );\n const ret = await this.onResponse( response )\n const res = await this.onResult( ret );\n this.error ? reject( this.error ) : resolve( res );\n }catch( ex )\n { reject( this.onError( ex ) ); }\n } )\n };\n Object.defineProperty( this, 'promise', { get(){ return promise; } } );\n FetchElement.observedAttributes\n .filter( prop => prop !== 'headers' )\n .forEach( prop => Object.defineProperty( this, prop,\n {\n get: () => this.getAttribute( prop )\n , set: val => this.setAttribute( prop, val )\n } ) );\n }\n\n connectedCallback()\n {\n this.src && this.fetch( this.src );\n this.initialized = !0;\n }\n\n attributeChangedCallback( name, oldValue, newValue )\n {\n switch( name )\n { case 'headers':\n this[ name ] = eval( newValue );\n break;\n case 'src':\n this.initialized && this.fetch( newValue );\n break;\n default:\n if( this[ name ] !== newValue )\n this[ name ] = newValue;\n }\n }\n\n async onResponse( response )\n {\n const s = 1 * ( this.status = response.status );\n if( s < 200 || s >= 300 )\n this.error = 'network error';\n this.contentType = response.headers.get( 'content-type' );\n this.responseHeaders = response.headers;\n if( this.contentType.includes( 'json' ) )\n return response.json();\n return response.text();\n }\n\n setContent( html ){ this.innerHTML = html; }\n \n async onResult( result )\n {\n try\n { if( this.hasAttribute('skiprender') )\n return;\n\n let mod = await this.constructor.mime2mod[ this.contentType.split(';')[0] ]();\n if( typeof mod === 'string' )\n mod = (await import(mod)).default;\n\n this.state = 'rendering';\n\n return ( mod || this.render ).call( this, result, this.contentType, this.status, this.responseHeaders );\n }finally\n {\n this.state = 'loaded';\n }\n }\n\n render( data, contentType, httpCode, responseHeaders ){}\n async renderHtml( data, contentType, httpCode, responseHeaders )\n {\n this.setContent( data );\n await wait4DomUpdated();\n this.render( ...arguments );\n await wait4DomUpdated();\n }\n\n onError( error )\n {\n this.state = 'error';\n return error;\n }\n\n getKeys( obj ){ return Object.keys( obj ); }\n}\n\nexport default FetchElement;\n\nwindow.customElements.define( 'fetch-element', FetchElement );\n", "import FE from './fetch-element.js';\nimport { CssChain as $ } from 'css-chain';\n\nexport * from './fetch-element.js';\nexport const FetchElement = FE;\n\nfunction createNode( tag, prop, val ){ const el = document.createElement(tag); el[prop]=val; return el; }\n\n\n export class\nSlottedElement extends FE\n{\n static get observedAttributes(){ return [ 'template', ...FE.observedAttributes ]; }\n\n connectedCallback()\n { this._$ = $(this);\n this.slotsInit();\n super.connectedCallback();\n }\n attributeChangedCallback( name, oldValue, newValue )\n {\n if( name !== 'template')\n return super.attributeChangedCallback( name, oldValue, newValue );\n this.template = newValue;\n this.initialized && this.slotsInit();\n }\n $( css ){ return css? this._$.$(css): this._$; }\n\n fetch( url, options )\n {\n this.slotOnly('loading')\n return super.fetch( url, options ).finally( ()=>this.slotOnly(this.state) );\n }\n\n setContent( html )\n {\n if( this.slots.loaded )\n { const slot = this.slotClone('loaded')\n slot.innerHTML = html;\n this.slotAdd(slot);\n }else\n this.innerHTML = html;\n }\n\n\n // slot API\n\n slotsInit()\n {\n if( !this.slots )\n { this.slots = {};\n this.$( '[slot]' ).map( node =>this.slots[ node.slot ] = node )\n }\n const $i = this._$\n , a = $i.attr('template');\n if( a ) $i.template( $('#'+a ) )\n else if( this.template )\n $i.template( createNode( 'template', 'innerHTML', this.template ) )\n else\n $i.template();\n this.src || this.slotOnly('loaded');\n }\n\n slotOnly( name )\n { this.$( '[slot-cloned]' )\n .filter( el => el.slot !== name )\n .remove();\n const $s = this.$().slots(name);\n $s.length && this.$().slots().attr('hidden','hidden');\n if( !this.$( `[slot=\"${name}\"][slot-cloned]` ).length )\n this.slotAdd(name);\n this.$().slots(name).removeAttribute('hidden');\n }\n\n slotsClear()\n { this.$( '[slot-cloned]' )\n .remove();\n }\n\n slotClone( name )\n {\n const slot = this.slots[ name ]\n if( !slot )\n return;\n const ret = slot.cloneNode( true );\n ret.setAttribute( 'slot-cloned', true );\n ret.hidden = false;\n return ret;\n }\n\n slotAdd( node )\n {\n const slot = node.slot ? node: this.slotClone( node )\n , ref = this.$(`slot[name=\"${node.slot || node}\"]`);\n let added;\n for( let r of ref)\n added = r.parentElement.insertBefore( slot, r );\n return added;\n }\n\n}\nexport default SlottedElement;\n\nwindow.customElements.define('slotted-element', SlottedElement);\n\nexport { $ as CssChain };\n", "const Prototype2ApiChain = new Map();\nconst OBJ_prototype = Object.getPrototypeOf( {} );\n\n export const\nsetProp = ( refObj, k, ApiChainLocal )=>\n{\n if( typeof refObj[ k ] == 'function' )\n { ApiChainLocal.prototype[ k ] = function( ...args )\n { if( k.startsWith('get') )\n {\n if( this.length )\n return this[ 0 ][ k ]( ...args )\n else\n return;\n }\n this.forEach( el => el[ k ]( ...args ) );\n return this;\n }\n }else\n { Object.defineProperty( ApiChainLocal.prototype, k,\n { get : function(){ if( this.length ) return this[ 0 ][ k ] }\n , set: function( v )\n { this.forEach( el => el[ k ] = v );\n return v\n }\n } );\n }\n}\n function\napplyPrototype( elementProto, refObj )\n{ let ChainClass = Prototype2ApiChain.get(elementProto);\n if( ChainClass )\n return ChainClass;\n\n class ApiChainLocal extends Array{}\n\n const applied = {\"constructor\":1};\n for ( let obj=refObj; obj !== OBJ_prototype && obj != null ; obj = Object.getPrototypeOf(obj))\n {\n for( let k of Object.getOwnPropertyNames(obj) )\n if( !applied[k])\n { setProp( refObj, k, ApiChainLocal );\n applied[k]=1;\n }\n }\n Prototype2ApiChain.set(elementProto, ApiChainLocal);\n return ApiChainLocal;\n}\n export function\nApiChain( elOrArr, elementProto = undefined )\n{\n const isArr = Array.isArray( elOrArr );\n const arr = isArr ? elOrArr : [ elOrArr ];\n if( ! elementProto )\n elementProto = Object.getPrototypeOf( isArr ? elOrArr[0] : elOrArr );\n const refObj = arr[0];\n if( elementProto === OBJ_prototype )\n {\n class ApiChainLocal extends Array{}\n\n for( let k in refObj )\n setProp( refObj, k, ApiChainLocal );\n const ret = new ApiChainLocal();\n ret.push(...arr);\n return ret;\n }\n\n // class object\n const ApiChain = applyPrototype( elementProto, refObj );\n\n const ret = new ApiChain();\n ret.push(...arr);\n return ret;\n}\nexport default ApiChain;\n", "import { setProp } from './ApiChain.js';\nexport const map = (arr, ...args ) => Array.prototype.map.apply( arr, args );\nexport const csv = (arr, ...args ) => map( arr, ...args ).join(',');\n\nexport const collectionText = arr=> map(arr, e=>getNodeText(e)).join('');\nconst createEl = tag=> document.createElement(tag);\nfunction nodeProp( tag, prop, val ){ const el = createEl(tag); el[prop]=val; return el; }\nexport function isNode(n){ return !!n?.nodeType; }\n\nconst nop = ()=>''\n, isArr = a => Array.isArray(a) || (a && 'function' === typeof a.forEach)\n, isT = (a,t) => typeof a === t\n, isStr = a => isT(a, 'string')\n, isNum = a => isT(a, 'number')\n, isFn = a => isT(a, 'function')\n, inWC = n => n.getRootNode().host\n, hasAssigned = n=> inWC(n) && n.assignedNodes\n, each = (arr, cb )=> (arr.forEach(cb),arr)\n, clear = n => hasAssigned(n)\n ? n.assignedNodes().forEach( a => a.remove() )\n : n.innerHTML=''\n;\n\nconst node2text = { 1: n=>n.assignedNodes\n ? collectionText(n.assignedNodes()) || collectionText(n.childNodes)\n : [ 'SCRIPT','AUDIO','STYLE','CANVAS','DATALIST','EMBED','OBJECT'\n , 'PICTURE','IFRAME','METER','NOSCRIPT'\n , 'SELECT','OPTGROUP','PROGRESS','TEMPLATE','VIDEO'\n ].includes(n.nodeName)? '' : n.innerText //collectionText(n.children)\n , 3: n=>n.nodeValue\n , 11:n=>collectionText(n.childNodes)\n };\nexport const getNodeText = n => (node2text[n.nodeType] || nop)(n);\nexport const setNodeText = ( n, val ) =>\n hasAssigned(n)\n ? n.assignedElements().forEach( e => e.innerText = val )\n : n.innerText = val;\nexport const assignParent = (arr,n)=>arr.map( e=>n.appendChild(e))\nexport const collectionHtml = arr => map( arr, n=>n.assignedElements\n ? map( n.assignedElements(), e=>e.outerHTML ).join('')\n : n.innerHTML\n ).join('');\n\nexport const html2NodeArr = html =>\n{ const n = createEl('div');\n n.innerHTML = html;\n const wrapIfText = e=>{\n if( e.nodeType !== 3 )\n return e;\n const n = createEl('span');\n n.append(e);\n return n;\n };\n return [...n.childNodes].map(e=>(e.remove(),e)).map(wrapIfText);\n};\n\nexport const addNodeHtml = ( n, val ) =>\n{\n const set = ( to, v )=> ( v instanceof Node\n ? v.remove() || to.append(v)\n : html2NodeArr(v).forEach( e=>to.append(e) )\n )\n , append = v => hasAssigned(n)\n ? n.assign( ...n.assignedNodes()\n , ...assignParent( each( html2NodeArr(v), e=>e.slot=n.name )\n , n.getRootNode().host ) )\n : set(n,v);\n\n val instanceof NodeList || isArr(val)\n ? [ ...val ].forEach( append )\n : append(val);\n}\nexport const setNodeHtml = ( n, val ) => { clear(n); addNodeHtml(n,val) };\n\n class\nCssChainT extends Array\n{\n attr(...args){ return args.length>1 ? (( args[2] ? this.$(args[2]) : this ).setAttribute(...args),this) : this.getAttribute(...args) }\n prop(...args){ return args.length>1 ? (( args[2] ? this.$(args[2]) : this ).forEach( el=>el[args[0]]=args[1]),this ): this[0][args[0]] }\n forEach( ...args){ Array.prototype.forEach.apply(this,args); return this }\n map( ...args){ return map(this,...args) }\n push(...args){ Array.prototype.push.apply(this,args); return this; }\n querySelector(css){ return new CssChainT().push( this.querySelectorAll(css)[0] ) }\n querySelectorAll(css){ return this.reduce( ($,el)=> $.push(...(el.shadowRoot||el).querySelectorAll(css) ), new CssChainT()) }\n $(...args){ return args.length ? this.querySelectorAll(...args) : this; }\n parent(css)\n { const s = new Set()\n , add = n=> s.has(n) ? 0 : (s.add(n), n)\n , parentLoop = n=> { while( n=n.parentElement )\n if( n.matches(css) )\n return add(n);\n };\n return CssChain(this.map( css ? parentLoop : n=>add(n.parentElement) ).filter(n=>n));\n }\n on(...args){ return this.addEventListener(...args) }\n append(val){ return this.forEach( n=> addNodeHtml(n,val)) }\n remove(...args)\n { if( !args.length )\n { this.forEach(el=>el.remove()); return new CssChainT() }\n return isFn(args[1]) ? this.removeEventListener(...args) : this.map(el=>el.matches(args[0])).filter(el=>el) ;\n }\n erase(){ return this.forEach(n=>clear(n)) }\n slots(...arr)\n {\n const selector = arr.length\n ? csv( arr[0].split(',')\n , n=> ['\"\"',\"''\"].includes(n) || !n\n ? `slot:not([name])`\n : `slot[name=\"${n}\"]`\n )\n : 'slot';\n const ss = this.filter( el=>el.matches && el.matches(selector) );\n const ret = this.filter( n => !ss.includes(n) && n.querySelector )\n .map( n=>n.shadowRoot || n ).$( arr.length\n ? csv( arr[0].split(',')\n , n=> ['\"\"',\"''\"].includes(n) || !n\n ? `slot:not([name])`\n : `slot[name=\"${n}\"]`\n )\n : 'slot');\n if( arr.length === 2 )\n { ret.html( arr[ 1 ] );\n return this\n }\n return CssChain([...ss,...ret]);\n }\n template(n)\n {\n if( n === undefined )\n {\n const $s = this.$('[slot]')\n .forEach( n => this.$(n.slot ? `slot[name=\"${n.slot}\"]`:'slot:not([name])').length\n || n.parentNode.insertBefore( nodeProp('slot','name',n.slot), n ));\n $s.remove();\n n = createEl('template');\n this.childNodes.forEach( c=>n.content.append(c) );\n this.append($s);\n }else if( isStr(n) )\n { n = this.$( n );\n n.remove();\n }\n const c = CssChain( n.content ? n.content.childNodes : n ).clone(this);\n c.slots().forEach( s =>\n { const v = this.children.filter( n=>n.slot===s.name );\n v.length && setNodeHtml(s,v)\n });\n this.children.remove();\n this.append(c);\n return this;\n }\n get innerText(){ return this.txt() }\n set innerText( val ){ return this.txt( val ) }\n txt( val, css=undefined )\n { const arr = css? this.$(css): this;\n if( val === undefined )\n return collectionText( arr );\n arr.forEach( isFn(val)\n ? (n,i)=>setNodeText(n,val(n,i,arr))\n : n=>setNodeText(n,val) );\n return this\n }\n get outerHTML(){ return this.map( e=>e.outerHTML ).join('') }\n set outerHTML( val )\n { return this.forEach( (n,i,arr)=>\n { const p = n.parentNode;\n html2NodeArr(isFn(val) ? val(n,i,arr): val )\n .forEach( e=> p.insertBefore( (arr[i]=e), n));\n n.remove();\n })\n }\n get innerHTML(){ return this.html() }\n set innerHTML( val ){ return this.html(val) }\n html( val, css=undefined )\n { const arr = css? this.$(css): this;\n if( val === undefined )\n return collectionHtml( arr );\n arr.forEach( isFn(val)\n ? (n,i)=>setNodeHtml(n,val(n,i,arr))\n : n=>setNodeHtml(n,val) );\n return this\n }\n assignedElements(opts){ return CssChain([].concat( ...this.map( el=>el.assignedElements ? el.assignedElements(opts):[] ) ) ) }\n assignedNodes(f){ return CssChain([].concat( ...this.map( el=>el.assignedNodes ? el.assignedNodes(f):[] ) ) ) }\n cloneNode(...args){ return this.map( el=>el.cloneNode && el.cloneNode(...args) ) }\n clone( /* number|array */count=1, cb=undefined )\n {\n let arr = count;\n if( isNum(count) )\n arr = Array.from({length: count}, (v, i) => i);\n\n if( isArr(arr) )\n { const ret = [];\n this.forEach( n => arr.forEach( (d,i) =>\n { const m = n.ownerDocument.importNode(n,true)\n , x = cb && cb( m, d, i, arr );\n isStr(x)\n ? ret.push( ...html2NodeArr(x) )\n : isArr(x)\n ? ret.push(...x)\n : ret.push( isNode(x) ? x : m )\n }));\n return CssChain( ret );\n }\n const doc = count;\n return this.map( el=> doc? doc.importNode( el,true ): el.cloneNode ? el.cloneNode(true):Object.assign({},el) )\n }\n get firstElementChild(){ return CssChain(this.map( n=>n.firstElementChild).filter(n=>n)) }\n get firstChild(){ return CssChain(this.map( n=>n.firstChild).filter(n=>n)) }\n get childNodes(){ return CssChain([].concat( ...map( this, el=>[...(el.childNodes || [] )] ) ) ) }\n get children(){ return CssChain([].concat( ...map( this, el=>[...(el.children || [] )] ) ) ) }\n}\n\nconst appliedTypes = new Set()\n, OBJ_prototype = Object.getPrototypeOf( {} );\n\n export function\napplyPrototype( nodeOrTag, ApiChain )\n{ const node = isStr(nodeOrTag) ? createEl(nodeOrTag) : nodeOrTag;\n if( appliedTypes.has(node.tagName) )\n return;\n appliedTypes.add( node.tagName );\n\n for( let k in node )\n if( !( k in ApiChain.prototype ) )\n setProp( node, k, ApiChain );\n\n for ( let proto; (proto= Object.getPrototypeOf(node)) !== OBJ_prototype && proto != null && !appliedTypes.has(proto) ; )\n { appliedTypes.add(proto);\n for( let k of Object.getOwnPropertyNames(proto) )\n if( !( k in ApiChain.prototype ) )\n setProp( node, k, ApiChain );\n }\n}\nObject.getOwnPropertyNames(window)\n .filter(key => key.startsWith('HTML') && key.endsWith('Element')&& key.length > 11 )\n .map( key=>key.substring(4,key.length-7).toLowerCase() )\n .forEach( tag=>applyPrototype( createEl(tag), CssChainT ) );\n\n export function\nCssChain( css, el=document, protoArr=[] )\n{\n const arr = 'string'===typeof css\n ? el.querySelectorAll( css )\n : isArr(css) ? css : [css? css.shadowRoot || css : document];\n\n if( isArr( protoArr ) )\n { if( !protoArr.length )\n protoArr = [...arr].slice(0,256);\n }else\n protoArr = [ protoArr ];\n\n protoArr.forEach( el => applyPrototype(el,CssChainT) );\n const ret = new CssChainT();\n ret.push(...arr);\n return ret;\n}\nexport default CssChain;\n"], + "mappings": "8gBAAA,+CAEA,iBAAsC,EAAM,EAAa,EAAQ,EACjE,CACI,KAAM,GAAgB,EACtB,GAAM,GAAO,KAAK,OAAQ,EAAM,EAAa,EAAQ,CAAgB,EACrE,AAAK,KAAK,YACN,MAAK,WA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EAAE,MAAM,CAAI,EAAE,gBAAgB,QAAQ,CACjD,CAEA,YACA,CAAI,KAAK,EAAG,eAAgB,EACnB,OAAO,CAChB,CAEA,UAAW,EACX,CACI,GAAM,GAAO,KAAK,MAAO,GACzB,GAAI,CAAC,EACD,OACJ,GAAM,GAAM,EAAK,UAAW,EAAK,EACjC,SAAI,aAAc,cAAe,EAAK,EACtC,EAAI,OAAS,GACN,CACX,CAEA,QAAS,EACT,CACI,GAAM,GAAO,EAAK,KAAO,EAAM,KAAK,UAAW,CAAK,EAC7C,EAAM,KAAK,EAAE,cAAc,EAAK,MAAQ,KAAQ,EACnD,EACJ,OAAS,KAAK,GACV,EAAQ,EAAE,cAAc,aAAc,EAAM,CAAE,EAClD,MAAO,EACX,CAEJ,EACO,GAAQ,EAEf,OAAO,eAAe,OAAO,kBAAmB,CAAc", + "names": [] +} diff --git a/package-lock.json b/package-lock.json index 69516dd..ba9a04f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,21 @@ { "name": "slotted-element-test", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.1.0", + "version": "1.1.1", "license": "Apache-2.0", "dependencies": { - "css-chain": "^1.1.0", - "slotted-element": "^1.1.0" + "slotted-element": "^1.1.1" }, "devDependencies": { - "@open-wc/testing": "^3.1.1", + "@chialab/esbuild-plugin-html": "^0.15.9", + "@open-wc/testing": "^3.1.2", "@web/dev-server": "^0.1.30", "@web/test-runner": "^0.13.27", + "esbuild": "^0.14.27", "prismjs": "^1.27.0" }, "funding": { @@ -23,10 +24,10 @@ } }, "../slotted-element": { - "version": "1.1.0", + "version": "1.1.1", "license": "Apache-2.0", "dependencies": { - "css-chain": "^1.1.0" + "css-chain": "^1.1.2" }, "funding": { "type": "patreon", @@ -116,6 +117,53 @@ "node": ">=4" } }, + "node_modules/@chialab/esbuild-plugin-html": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/esbuild-plugin-html/-/esbuild-plugin-html-0.15.9.tgz", + "integrity": "sha512-N4gm+NoY/bcw/pJTTr0u7SRpXZV/Xw3VdRXuSAbQgQivHt2lfIl2/V9bdU6m1YR+X/lnKCJPlTMW8FMb4VhVmg==", + "dev": true, + "dependencies": { + "@chialab/esbuild-rna": "^0.15.9", + "@chialab/node-resolve": "^0.15.9" + }, + "engines": { + "node": ">=13" + } + }, + "node_modules/@chialab/esbuild-rna": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/esbuild-rna/-/esbuild-rna-0.15.9.tgz", + "integrity": "sha512-VkluZCFE3UZSTqsYmjTbdtHCwQTLk+YYd9vuVeIAXTwnwr1dP5Utjphx+CXNx4eSn/QpBd7kjcvykdVJ136vlQ==", + "dev": true, + "dependencies": { + "@chialab/estransform": "^0.15.3", + "@chialab/node-resolve": "^0.15.9" + }, + "engines": { + "node": ">=13" + } + }, + "node_modules/@chialab/estransform": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/@chialab/estransform/-/estransform-0.15.3.tgz", + "integrity": "sha512-5CxuC4+mgHGNedbxmJ0avDsyHngDRCt5ytlASJNtCGvaeEkcEFhXSKT8SvVBkOJcMOepBBP3Pq0BdBnw50WwLg==", + "dev": true, + "dependencies": { + "@parcel/source-map": "^2.0.0" + }, + "engines": { + "node": ">=13" + } + }, + "node_modules/@chialab/node-resolve": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/node-resolve/-/node-resolve-0.15.9.tgz", + "integrity": "sha512-4/2GWaGnMV2CLK4QsG4OyJVb6gcz28XPb/bswYWrH9DmYEx6YXVlNEGDswNJxFeYXvXBCIQ5UGzAzjdEMa075A==", + "dev": true, + "engines": { + "node": ">=13" + } + }, "node_modules/@esm-bundle/chai": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", @@ -126,9 +174,9 @@ } }, "node_modules/@lit/reactive-element": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.3.0.tgz", - "integrity": "sha512-0TKSIuJHXNLM0k98fi0AdMIdUoHIYlDHTP+0Vruc2SOs4T6vU1FinXgSvYd8mSrkt+8R+qdRAXvjpqrMXMyBgw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.3.1.tgz", + "integrity": "sha512-nOJARIr3pReqK3hfFCSW2Zg/kFcFsSAlIE7z4a0C9D2dPrgD/YSn3ZP2ET/rxKB65SXyG7jJbkynBRm+tGlacw==", "dev": true }, "node_modules/@nodelib/fs.scandir": { @@ -208,15 +256,15 @@ } }, "node_modules/@open-wc/testing": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@open-wc/testing/-/testing-3.1.1.tgz", - "integrity": "sha512-jhetklmEe599T3Ran2VjWq2gpTi0xl0MHei0SOpTLSOCddj8E7xtZLm4KbRi4wPBiE6EQgg2raP3oDVyWuTFzg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@open-wc/testing/-/testing-3.1.2.tgz", + "integrity": "sha512-2KjEszLItrIEZwCLFjWOSy4rnLzLOpgckrKfZjNA39PpFR3xD9bqYU30TTnLRHBk2B/0ZUbHglyca3iwcF964w==", "dev": true, "dependencies": { "@esm-bundle/chai": "^4.3.4", "@open-wc/chai-dom-equals": "^0.12.36", "@open-wc/semantic-dom-diff": "^0.19.5", - "@open-wc/testing-helpers": "^2.1.1", + "@open-wc/testing-helpers": "^2.1.2", "@types/chai": "^4.2.11", "@types/chai-dom": "^0.0.9", "@types/sinon-chai": "^3.2.3", @@ -224,9 +272,9 @@ } }, "node_modules/@open-wc/testing-helpers": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@open-wc/testing-helpers/-/testing-helpers-2.1.1.tgz", - "integrity": "sha512-PFE+nd5IYSUgjIvmjV5PwjrBcTjLPOzvPrBk29krCVgwbgU4SS5WIxaHuxxGzpRn0SYDNlop5e/BMNjL2i4bsg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@open-wc/testing-helpers/-/testing-helpers-2.1.2.tgz", + "integrity": "sha512-NEdsV47DnOWaw3Wpp85p4qZ6bdubtGPdlTiblk8vSf2HJ2sR4b3ckyRWzsj/k+pcxrDGt8z0Awz71p+048Rrfg==", "dev": true, "dependencies": { "@open-wc/scoped-elements": "^2.0.1", @@ -234,6 +282,18 @@ "lit-html": "^2.0.0" } }, + "node_modules/@parcel/source-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@parcel/source-map/-/source-map-2.0.2.tgz", + "integrity": "sha512-NnUrPYLpYB6qyx2v6bcRPn/gVigmGG6M6xL8wIg/i0dP1GLkuY1nf+Hqdf63FzPTqqT7K3k6eE5yHPQVMO5jcA==", + "dev": true, + "dependencies": { + "detect-libc": "^1.0.3" + }, + "engines": { + "node": "^12.18.3 || >=14" + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", @@ -1429,15 +1489,6 @@ "node-fetch": "2.6.7" } }, - "node_modules/css-chain": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/css-chain/-/css-chain-1.1.0.tgz", - "integrity": "sha512-sgyXTSvOIboFT0pl4qn6obwQpqZKFsrJ6w1oT+ui6O0Ir9BrAHoS1XHCUkIsNsWB2UnVORLi9Y5xKV7nKbb/Eg==", - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/sashafirsov" - } - }, "node_modules/debounce": { "version": "1.2.0", "dev": true, @@ -1526,6 +1577,18 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/devtools-protocol": { "version": "0.0.960912", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.960912.tgz", @@ -1594,6 +1657,361 @@ "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, + "node_modules/esbuild": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", + "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "esbuild-android-64": "0.14.27", + "esbuild-android-arm64": "0.14.27", + "esbuild-darwin-64": "0.14.27", + "esbuild-darwin-arm64": "0.14.27", + "esbuild-freebsd-64": "0.14.27", + "esbuild-freebsd-arm64": "0.14.27", + "esbuild-linux-32": "0.14.27", + "esbuild-linux-64": "0.14.27", + "esbuild-linux-arm": "0.14.27", + "esbuild-linux-arm64": "0.14.27", + "esbuild-linux-mips64le": "0.14.27", + "esbuild-linux-ppc64le": "0.14.27", + "esbuild-linux-riscv64": "0.14.27", + "esbuild-linux-s390x": "0.14.27", + "esbuild-netbsd-64": "0.14.27", + "esbuild-openbsd-64": "0.14.27", + "esbuild-sunos-64": "0.14.27", + "esbuild-windows-32": "0.14.27", + "esbuild-windows-64": "0.14.27", + "esbuild-windows-arm64": "0.14.27" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", + "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", + "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", + "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", + "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", + "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", + "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", + "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", + "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", + "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", + "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", + "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", + "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", + "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", + "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", + "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", + "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", + "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", + "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", + "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", + "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2335,9 +2753,9 @@ "dev": true }, "node_modules/lit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-2.2.0.tgz", - "integrity": "sha512-FDyxUuczo6cJJY/2Bkgfh1872U4ikUvmK1Cb6+lYC1CW+QOo8CaWXCpvPKFzYsz0ojUxoruBLVrECc7VI2f1dQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/lit/-/lit-2.2.1.tgz", + "integrity": "sha512-dSe++R50JqrvNGXmI9OE13de1z5U/Y3J2dTm/9GC86vedI8ILoR8ZGnxfThFpvQ9m0lR0qRnIR4IiKj/jDCfYw==", "dev": true, "dependencies": { "@lit/reactive-element": "^1.3.0", @@ -2356,9 +2774,9 @@ } }, "node_modules/lit-html": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.2.0.tgz", - "integrity": "sha512-dJnevgV8VkCuOXLWrjQopDE8nSy8CzipZ/ATfYQv7z7Dct4abblcKecf50gkIScuwCTzKvRLgvTgV0zzagW4gA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.2.1.tgz", + "integrity": "sha512-AiJ/Rs0awjICs2FioTnHSh+Np5dhYSkyRczKy3wKjp8qjLhr1Ov+GiHrUQNdX8ou1LMuznpIME990AZsa/tR8g==", "dev": true, "dependencies": { "@types/trusted-types": "^2.0.2" @@ -3702,6 +4120,41 @@ } } }, + "@chialab/esbuild-plugin-html": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/esbuild-plugin-html/-/esbuild-plugin-html-0.15.9.tgz", + "integrity": "sha512-N4gm+NoY/bcw/pJTTr0u7SRpXZV/Xw3VdRXuSAbQgQivHt2lfIl2/V9bdU6m1YR+X/lnKCJPlTMW8FMb4VhVmg==", + "dev": true, + "requires": { + "@chialab/esbuild-rna": "^0.15.9", + "@chialab/node-resolve": "^0.15.9" + } + }, + "@chialab/esbuild-rna": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/esbuild-rna/-/esbuild-rna-0.15.9.tgz", + "integrity": "sha512-VkluZCFE3UZSTqsYmjTbdtHCwQTLk+YYd9vuVeIAXTwnwr1dP5Utjphx+CXNx4eSn/QpBd7kjcvykdVJ136vlQ==", + "dev": true, + "requires": { + "@chialab/estransform": "^0.15.3", + "@chialab/node-resolve": "^0.15.9" + } + }, + "@chialab/estransform": { + "version": "0.15.3", + "resolved": "https://registry.npmjs.org/@chialab/estransform/-/estransform-0.15.3.tgz", + "integrity": "sha512-5CxuC4+mgHGNedbxmJ0avDsyHngDRCt5ytlASJNtCGvaeEkcEFhXSKT8SvVBkOJcMOepBBP3Pq0BdBnw50WwLg==", + "dev": true, + "requires": { + "@parcel/source-map": "^2.0.0" + } + }, + "@chialab/node-resolve": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@chialab/node-resolve/-/node-resolve-0.15.9.tgz", + "integrity": "sha512-4/2GWaGnMV2CLK4QsG4OyJVb6gcz28XPb/bswYWrH9DmYEx6YXVlNEGDswNJxFeYXvXBCIQ5UGzAzjdEMa075A==", + "dev": true + }, "@esm-bundle/chai": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/@esm-bundle/chai/-/chai-4.3.4.tgz", @@ -3712,9 +4165,9 @@ } }, "@lit/reactive-element": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.3.0.tgz", - "integrity": "sha512-0TKSIuJHXNLM0k98fi0AdMIdUoHIYlDHTP+0Vruc2SOs4T6vU1FinXgSvYd8mSrkt+8R+qdRAXvjpqrMXMyBgw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-1.3.1.tgz", + "integrity": "sha512-nOJARIr3pReqK3hfFCSW2Zg/kFcFsSAlIE7z4a0C9D2dPrgD/YSn3ZP2ET/rxKB65SXyG7jJbkynBRm+tGlacw==", "dev": true }, "@nodelib/fs.scandir": { @@ -3785,15 +4238,15 @@ } }, "@open-wc/testing": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@open-wc/testing/-/testing-3.1.1.tgz", - "integrity": "sha512-jhetklmEe599T3Ran2VjWq2gpTi0xl0MHei0SOpTLSOCddj8E7xtZLm4KbRi4wPBiE6EQgg2raP3oDVyWuTFzg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@open-wc/testing/-/testing-3.1.2.tgz", + "integrity": "sha512-2KjEszLItrIEZwCLFjWOSy4rnLzLOpgckrKfZjNA39PpFR3xD9bqYU30TTnLRHBk2B/0ZUbHglyca3iwcF964w==", "dev": true, "requires": { "@esm-bundle/chai": "^4.3.4", "@open-wc/chai-dom-equals": "^0.12.36", "@open-wc/semantic-dom-diff": "^0.19.5", - "@open-wc/testing-helpers": "^2.1.1", + "@open-wc/testing-helpers": "^2.1.2", "@types/chai": "^4.2.11", "@types/chai-dom": "^0.0.9", "@types/sinon-chai": "^3.2.3", @@ -3801,9 +4254,9 @@ } }, "@open-wc/testing-helpers": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@open-wc/testing-helpers/-/testing-helpers-2.1.1.tgz", - "integrity": "sha512-PFE+nd5IYSUgjIvmjV5PwjrBcTjLPOzvPrBk29krCVgwbgU4SS5WIxaHuxxGzpRn0SYDNlop5e/BMNjL2i4bsg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@open-wc/testing-helpers/-/testing-helpers-2.1.2.tgz", + "integrity": "sha512-NEdsV47DnOWaw3Wpp85p4qZ6bdubtGPdlTiblk8vSf2HJ2sR4b3ckyRWzsj/k+pcxrDGt8z0Awz71p+048Rrfg==", "dev": true, "requires": { "@open-wc/scoped-elements": "^2.0.1", @@ -3811,6 +4264,15 @@ "lit-html": "^2.0.0" } }, + "@parcel/source-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@parcel/source-map/-/source-map-2.0.2.tgz", + "integrity": "sha512-NnUrPYLpYB6qyx2v6bcRPn/gVigmGG6M6xL8wIg/i0dP1GLkuY1nf+Hqdf63FzPTqqT7K3k6eE5yHPQVMO5jcA==", + "dev": true, + "requires": { + "detect-libc": "^1.0.3" + } + }, "@rollup/plugin-node-resolve": { "version": "11.2.1", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", @@ -4748,11 +5210,6 @@ "node-fetch": "2.6.7" } }, - "css-chain": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/css-chain/-/css-chain-1.1.0.tgz", - "integrity": "sha512-sgyXTSvOIboFT0pl4qn6obwQpqZKFsrJ6w1oT+ui6O0Ir9BrAHoS1XHCUkIsNsWB2UnVORLi9Y5xKV7nKbb/Eg==" - }, "debounce": { "version": "1.2.0", "dev": true @@ -4812,6 +5269,12 @@ "integrity": "sha512-R5QZrOXxSs0JDUIU/VANvRJlQVMts9C0L76HToQdPdlftfZCE7W6dyH0G4GZ5UW9fRqUOhAoCE2aGekuu+3HjQ==", "dev": true }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true + }, "devtools-protocol": { "version": "0.0.960912", "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.960912.tgz", @@ -4870,6 +5333,174 @@ "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, + "esbuild": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.27.tgz", + "integrity": "sha512-MZQt5SywZS3hA9fXnMhR22dv0oPGh6QtjJRIYbgL1AeqAoQZE+Qn5ppGYQAoHv/vq827flj4tIJ79Mrdiwk46Q==", + "dev": true, + "requires": { + "esbuild-android-64": "0.14.27", + "esbuild-android-arm64": "0.14.27", + "esbuild-darwin-64": "0.14.27", + "esbuild-darwin-arm64": "0.14.27", + "esbuild-freebsd-64": "0.14.27", + "esbuild-freebsd-arm64": "0.14.27", + "esbuild-linux-32": "0.14.27", + "esbuild-linux-64": "0.14.27", + "esbuild-linux-arm": "0.14.27", + "esbuild-linux-arm64": "0.14.27", + "esbuild-linux-mips64le": "0.14.27", + "esbuild-linux-ppc64le": "0.14.27", + "esbuild-linux-riscv64": "0.14.27", + "esbuild-linux-s390x": "0.14.27", + "esbuild-netbsd-64": "0.14.27", + "esbuild-openbsd-64": "0.14.27", + "esbuild-sunos-64": "0.14.27", + "esbuild-windows-32": "0.14.27", + "esbuild-windows-64": "0.14.27", + "esbuild-windows-arm64": "0.14.27" + } + }, + "esbuild-android-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.27.tgz", + "integrity": "sha512-LuEd4uPuj/16Y8j6kqy3Z2E9vNY9logfq8Tq+oTE2PZVuNs3M1kj5Qd4O95ee66yDGb3isaOCV7sOLDwtMfGaQ==", + "dev": true, + "optional": true + }, + "esbuild-android-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.27.tgz", + "integrity": "sha512-E8Ktwwa6vX8q7QeJmg8yepBYXaee50OdQS3BFtEHKrzbV45H4foMOeEE7uqdjGQZFBap5VAqo7pvjlyA92wznQ==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.27.tgz", + "integrity": "sha512-czw/kXl/1ZdenPWfw9jDc5iuIYxqUxgQ/Q+hRd4/3udyGGVI31r29LCViN2bAJgGvQkqyLGVcG03PJPEXQ5i2g==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.27.tgz", + "integrity": "sha512-BEsv2U2U4o672oV8+xpXNxN9bgqRCtddQC6WBh4YhXKDcSZcdNh7+6nS+DM2vu7qWIWNA4JbRG24LUUYXysimQ==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.27.tgz", + "integrity": "sha512-7FeiFPGBo+ga+kOkDxtPmdPZdayrSzsV9pmfHxcyLKxu+3oTcajeZlOO1y9HW+t5aFZPiv7czOHM4KNd0tNwCA==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.27.tgz", + "integrity": "sha512-8CK3++foRZJluOWXpllG5zwAVlxtv36NpHfsbWS7TYlD8S+QruXltKlXToc/5ZNzBK++l6rvRKELu/puCLc7jA==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.27.tgz", + "integrity": "sha512-qhNYIcT+EsYSBClZ5QhLzFzV5iVsP1YsITqblSaztr3+ZJUI+GoK8aXHyzKd7/CKKuK93cxEMJPpfi1dfsOfdw==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.27.tgz", + "integrity": "sha512-ESjck9+EsHoTaKWlFKJpPZRN26uiav5gkI16RuI8WBxUdLrrAlYuYSndxxKgEn1csd968BX/8yQZATYf/9+/qg==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.27.tgz", + "integrity": "sha512-JnnmgUBdqLQO9hoNZQqNHFWlNpSX82vzB3rYuCJMhtkuaWQEmQz6Lec1UIxJdC38ifEghNTBsF9bbe8dFilnCw==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.27.tgz", + "integrity": "sha512-no6Mi17eV2tHlJnqBHRLekpZ2/VYx+NfGxKcBE/2xOMYwctsanCaXxw4zapvNrGE9X38vefVXLz6YCF8b1EHiQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.27.tgz", + "integrity": "sha512-NolWP2uOvIJpbwpsDbwfeExZOY1bZNlWE/kVfkzLMsSgqeVcl5YMen/cedRe9mKnpfLli+i0uSp7N+fkKNU27A==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.27.tgz", + "integrity": "sha512-/7dTjDvXMdRKmsSxKXeWyonuGgblnYDn0MI1xDC7J1VQXny8k1qgNp6VmrlsawwnsymSUUiThhkJsI+rx0taNA==", + "dev": true, + "optional": true + }, + "esbuild-linux-riscv64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.27.tgz", + "integrity": "sha512-D+aFiUzOJG13RhrSmZgrcFaF4UUHpqj7XSKrIiCXIj1dkIkFqdrmqMSOtSs78dOtObWiOrFCDDzB24UyeEiNGg==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.27.tgz", + "integrity": "sha512-CD/D4tj0U4UQjELkdNlZhQ8nDHU5rBn6NGp47Hiz0Y7/akAY5i0oGadhEIg0WCY/HYVXFb3CsSPPwaKcTOW3bg==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.27.tgz", + "integrity": "sha512-h3mAld69SrO1VoaMpYl3a5FNdGRE/Nqc+E8VtHOag4tyBwhCQXxtvDDOAKOUQexBGca0IuR6UayQ4ntSX5ij1Q==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.27.tgz", + "integrity": "sha512-xwSje6qIZaDHXWoPpIgvL+7fC6WeubHHv18tusLYMwL+Z6bEa4Pbfs5IWDtQdHkArtfxEkIZz77944z8MgDxGw==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.27.tgz", + "integrity": "sha512-/nBVpWIDjYiyMhuqIqbXXsxBc58cBVH9uztAOIfWShStxq9BNBik92oPQPJ57nzWXRNKQUEFWr4Q98utDWz7jg==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.27.tgz", + "integrity": "sha512-Q9/zEjhZJ4trtWhFWIZvS/7RUzzi8rvkoaS9oiizkHTTKd8UxFwn/Mm2OywsAfYymgUYm8+y2b+BKTNEFxUekw==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.27.tgz", + "integrity": "sha512-b3y3vTSl5aEhWHK66ngtiS/c6byLf6y/ZBvODH1YkBM+MGtVL6jN38FdHUsZasCz9gFwYs/lJMVY9u7GL6wfYg==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.14.27", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.27.tgz", + "integrity": "sha512-I/reTxr6TFMcR5qbIkwRGvldMIaiBu2+MP0LlD7sOlNXrfqIl9uNjsuxFPGEG4IRomjfQ5q8WT+xlF/ySVkqKg==", + "dev": true, + "optional": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -5424,9 +6055,9 @@ } }, "lit": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-2.2.0.tgz", - "integrity": "sha512-FDyxUuczo6cJJY/2Bkgfh1872U4ikUvmK1Cb6+lYC1CW+QOo8CaWXCpvPKFzYsz0ojUxoruBLVrECc7VI2f1dQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/lit/-/lit-2.2.1.tgz", + "integrity": "sha512-dSe++R50JqrvNGXmI9OE13de1z5U/Y3J2dTm/9GC86vedI8ILoR8ZGnxfThFpvQ9m0lR0qRnIR4IiKj/jDCfYw==", "dev": true, "requires": { "@lit/reactive-element": "^1.3.0", @@ -5445,9 +6076,9 @@ } }, "lit-html": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.2.0.tgz", - "integrity": "sha512-dJnevgV8VkCuOXLWrjQopDE8nSy8CzipZ/ATfYQv7z7Dct4abblcKecf50gkIScuwCTzKvRLgvTgV0zzagW4gA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-2.2.1.tgz", + "integrity": "sha512-AiJ/Rs0awjICs2FioTnHSh+Np5dhYSkyRczKy3wKjp8qjLhr1Ov+GiHrUQNdX8ou1LMuznpIME990AZsa/tR8g==", "dev": true, "requires": { "@types/trusted-types": "^2.0.2" @@ -6086,7 +6717,7 @@ "slotted-element": { "version": "file:../slotted-element", "requires": { - "css-chain": "^1.1.0" + "css-chain": "^1.1.2" } }, "source-map": { diff --git a/package.json b/package.json index 8bb1245..6348bad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slotted-element-test", - "version": "1.1.0", + "version": "1.1.1", "description": "test for fetch-element and slotted-element", "author": { "name": "Sasha Firsov", @@ -25,18 +25,20 @@ "module": "index.js", "type": "module", "scripts": { + "build": "bash build.sh", "start": "web-dev-server", - "test": "web-test-runner --coverage", + "test": "bash test.sh", "test:watch": "web-test-runner --watch" }, "dependencies": { - "css-chain": "^1.1.0", - "slotted-element": "^1.1.0" + "slotted-element": "^1.1.1" }, "devDependencies": { - "@open-wc/testing": "^3.1.1", + "@chialab/esbuild-plugin-html": "^0.15.9", + "@open-wc/testing": "^3.1.2", "@web/dev-server": "^0.1.30", "@web/test-runner": "^0.13.27", + "esbuild": "^0.14.27", "prismjs": "^1.27.0" }, "funding": {