From 23b97f7968ae7bdeba140c36024d6192a9f4fdb3 Mon Sep 17 00:00:00 2001 From: nemo shen Date: Sun, 14 Jan 2024 12:05:52 +0800 Subject: [PATCH] test: coverage --- coverage/base.css | 362 ++++ coverage/block-navigation.js | 85 + coverage/coverage-final.json | 1586 +++++++++++++++++ coverage/favicon.png | Bin 0 -> 445 bytes coverage/index.html | 240 +++ coverage/packages/core/useEllipsis/index.html | 178 ++ .../packages/core/useEllipsis/index.ts.html | 741 ++++++++ coverage/packages/core/useToast/index.html | 178 ++ .../packages/core/useToast/useToast.tsx.html | 306 ++++ coverage/prettify.css | 101 ++ coverage/prettify.js | 1004 +++++++++++ coverage/sort-arrow-sprite.png | Bin 0 -> 138 bytes coverage/sorter.js | 191 ++ coverage/src/App.vue.html | 108 ++ coverage/src/demo/UseEllipsis.vue.html | 216 +++ coverage/src/demo/UseToast.vue.html | 153 ++ coverage/src/demo/index.html | 196 ++ coverage/src/index.html | 196 ++ coverage/src/main.js.html | 99 + package.json | 2 + packages/core/useLoading/index.test.ts | 7 + pnpm-lock.yaml | 142 ++ vite.config.ts | 4 + 23 files changed, 6095 insertions(+) create mode 100644 coverage/base.css create mode 100644 coverage/block-navigation.js create mode 100644 coverage/coverage-final.json create mode 100644 coverage/favicon.png create mode 100644 coverage/index.html create mode 100644 coverage/packages/core/useEllipsis/index.html create mode 100644 coverage/packages/core/useEllipsis/index.ts.html create mode 100644 coverage/packages/core/useToast/index.html create mode 100644 coverage/packages/core/useToast/useToast.tsx.html create mode 100644 coverage/prettify.css create mode 100644 coverage/prettify.js create mode 100644 coverage/sort-arrow-sprite.png create mode 100644 coverage/sorter.js create mode 100644 coverage/src/App.vue.html create mode 100644 coverage/src/demo/UseEllipsis.vue.html create mode 100644 coverage/src/demo/UseToast.vue.html create mode 100644 coverage/src/demo/index.html create mode 100644 coverage/src/index.html create mode 100644 coverage/src/main.js.html diff --git a/coverage/base.css b/coverage/base.css new file mode 100644 index 0000000..8cd9700 --- /dev/null +++ b/coverage/base.css @@ -0,0 +1,362 @@ +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: 0.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/block-navigation.js b/coverage/block-navigation.js new file mode 100644 index 0000000..70480f0 --- /dev/null +++ b/coverage/block-navigation.js @@ -0,0 +1,85 @@ +/* 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/coverage-final.json b/coverage/coverage-final.json new file mode 100644 index 0000000..1e866d2 --- /dev/null +++ b/coverage/coverage-final.json @@ -0,0 +1,1586 @@ +{ + "/Users/nemo/github/nemo-shen/noi/packages/core/useEllipsis/index.ts": { + "path": "/Users/nemo/github/nemo-shen/noi/packages/core/useEllipsis/index.ts", + "statementMap": { + "0": { + "start": { "line": 13, "column": 7 }, + "end": { "line": 13, "column": null } + }, + "1": { + "start": { "line": 14, "column": 2 }, + "end": { "line": 14, "column": null } + }, + "2": { + "start": { "line": 15, "column": 2 }, + "end": { "line": 15, "column": null } + }, + "3": { + "start": { "line": 13, "column": 12 }, + "end": { "line": 13, "column": null } + }, + "4": { + "start": { "line": 18, "column": 7 }, + "end": { "line": 18, "column": null } + }, + "5": { + "start": { "line": 19, "column": 2 }, + "end": { "line": 19, "column": null } + }, + "6": { + "start": { "line": 20, "column": 2 }, + "end": { "line": 20, "column": null } + }, + "7": { + "start": { "line": 18, "column": 12 }, + "end": { "line": 18, "column": null } + }, + "8": { + "start": { "line": 48, "column": 24 }, + "end": { "line": 68, "column": null } + }, + "9": { + "start": { "line": 49, "column": 18 }, + "end": { "line": 49, "column": null } + }, + "10": { + "start": { "line": 51, "column": 24 }, + "end": { "line": 51, "column": null } + }, + "11": { + "start": { "line": 53, "column": 15 }, + "end": { "line": 53, "column": null } + }, + "12": { + "start": { "line": 54, "column": 2 }, + "end": { "line": 56, "column": null } + }, + "13": { + "start": { "line": 55, "column": 4 }, + "end": { "line": 55, "column": null } + }, + "14": { + "start": { "line": 58, "column": 2 }, + "end": { "line": 58, "column": null } + }, + "15": { + "start": { "line": 60, "column": 18 }, + "end": { "line": 62, "column": null } + }, + "16": { + "start": { "line": 61, "column": 4 }, + "end": { "line": 61, "column": null } + }, + "17": { + "start": { "line": 64, "column": 2 }, + "end": { "line": 67, "column": null } + }, + "18": { + "start": { "line": 70, "column": 25 }, + "end": { "line": 164, "column": null } + }, + "19": { + "start": { "line": 78, "column": 15 }, + "end": { "line": 78, "column": null } + }, + "20": { + "start": { "line": 80, "column": 16 }, + "end": { "line": 80, "column": null } + }, + "21": { + "start": { "line": 81, "column": 21 }, + "end": { "line": 81, "column": null } + }, + "22": { + "start": { "line": 85, "column": 4 }, + "end": { "line": 85, "column": null } + }, + "23": { + "start": { "line": 85, "column": 30 }, + "end": { "line": 85, "column": null } + }, + "24": { + "start": { "line": 87, "column": 4 }, + "end": { "line": 94, "column": null } + }, + "25": { + "start": { "line": 88, "column": 6 }, + "end": { "line": 88, "column": null } + }, + "26": { + "start": { "line": 89, "column": 6 }, + "end": { "line": 92, "column": null } + }, + "27": { + "start": { "line": 90, "column": 8 }, + "end": { "line": 90, "column": null } + }, + "28": { + "start": { "line": 91, "column": 8 }, + "end": { "line": 91, "column": null } + }, + "29": { + "start": { "line": 93, "column": 6 }, + "end": { "line": 93, "column": null } + }, + "30": { + "start": { "line": 96, "column": 17 }, + "end": { "line": 96, "column": null } + }, + "31": { + "start": { "line": 97, "column": 19 }, + "end": { "line": 97, "column": null } + }, + "32": { + "start": { "line": 99, "column": 4 }, + "end": { "line": 99, "column": null } + }, + "33": { + "start": { "line": 100, "column": 4 }, + "end": { "line": 103, "column": null } + }, + "34": { + "start": { "line": 101, "column": 6 }, + "end": { "line": 101, "column": null } + }, + "35": { + "start": { "line": 102, "column": 6 }, + "end": { "line": 102, "column": null } + }, + "36": { + "start": { "line": 104, "column": 4 }, + "end": { "line": 104, "column": null } + }, + "37": { + "start": { "line": 108, "column": 4 }, + "end": { "line": 108, "column": null } + }, + "38": { + "start": { "line": 109, "column": 23 }, + "end": { "line": 109, "column": null } + }, + "39": { + "start": { "line": 110, "column": 4 }, + "end": { "line": 120, "column": null } + }, + "40": { + "start": { "line": 112, "column": 8 }, + "end": { "line": 112, "column": null } + }, + "41": { + "start": { "line": 113, "column": 8 }, + "end": { "line": 113, "column": null } + }, + "42": { + "start": { "line": 115, "column": 8 }, + "end": { "line": 115, "column": null } + }, + "43": { + "start": { "line": 116, "column": 8 }, + "end": { "line": 116, "column": null } + }, + "44": { + "start": { "line": 118, "column": 8 }, + "end": { "line": 118, "column": null } + }, + "45": { + "start": { "line": 119, "column": 8 }, + "end": { "line": 119, "column": null } + }, + "46": { + "start": { "line": 121, "column": 4 }, + "end": { "line": 123, "column": null } + }, + "47": { + "start": { "line": 122, "column": 6 }, + "end": { "line": 122, "column": null } + }, + "48": { + "start": { "line": 124, "column": 4 }, + "end": { "line": 124, "column": null } + }, + "49": { + "start": { "line": 128, "column": 4 }, + "end": { "line": 128, "column": null } + }, + "50": { + "start": { "line": 129, "column": 22 }, + "end": { "line": 129, "column": null } + }, + "51": { + "start": { "line": 130, "column": 4 }, + "end": { "line": 130, "column": null } + }, + "52": { + "start": { "line": 131, "column": 4 }, + "end": { "line": 131, "column": null } + }, + "53": { + "start": { "line": 132, "column": 4 }, + "end": { "line": 150, "column": null } + }, + "54": { + "start": { "line": 134, "column": 6 }, + "end": { "line": 148, "column": null } + }, + "55": { + "start": { "line": 136, "column": 10 }, + "end": { "line": 136, "column": null } + }, + "56": { + "start": { "line": 137, "column": 10 }, + "end": { "line": 137, "column": null } + }, + "57": { + "start": { "line": 139, "column": 10 }, + "end": { "line": 141, "column": null } + }, + "58": { + "start": { "line": 142, "column": 10 }, + "end": { "line": 142, "column": null } + }, + "59": { + "start": { "line": 144, "column": 10 }, + "end": { "line": 146, "column": null } + }, + "60": { + "start": { "line": 147, "column": 10 }, + "end": { "line": 147, "column": null } + }, + "61": { + "start": { "line": 149, "column": 6 }, + "end": { "line": 149, "column": null } + }, + "62": { + "start": { "line": 151, "column": 4 }, + "end": { "line": 151, "column": null } + }, + "63": { + "start": { "line": 154, "column": 12 }, + "end": { "line": 154, "column": null } + }, + "64": { + "start": { "line": 155, "column": 2 }, + "end": { "line": 157, "column": null } + }, + "65": { + "start": { "line": 156, "column": 4 }, + "end": { "line": 156, "column": null } + }, + "66": { + "start": { "line": 158, "column": 2 }, + "end": { "line": 160, "column": null } + }, + "67": { + "start": { "line": 159, "column": 4 }, + "end": { "line": 159, "column": null } + }, + "68": { + "start": { "line": 162, "column": 2 }, + "end": { "line": 162, "column": null } + }, + "69": { + "start": { "line": 163, "column": 2 }, + "end": { "line": 163, "column": null } + }, + "70": { + "start": { "line": 166, "column": 34 }, + "end": { "line": 170, "column": null } + }, + "71": { + "start": { "line": 172, "column": 27 }, + "end": { "line": 218, "column": null } + }, + "72": { + "start": { "line": 177, "column": 2 }, + "end": { "line": 177, "column": null } + }, + "73": { + "start": { "line": 178, "column": 26 }, + "end": { "line": 178, "column": null } + }, + "74": { + "start": { "line": 179, "column": 16 }, + "end": { "line": 179, "column": null } + }, + "75": { + "start": { "line": 180, "column": 16 }, + "end": { "line": 180, "column": null } + }, + "76": { + "start": { "line": 182, "column": 17 }, + "end": { "line": 187, "column": null } + }, + "77": { + "start": { "line": 183, "column": 4 }, + "end": { "line": 186, "column": null } + }, + "78": { + "start": { "line": 189, "column": 22 }, + "end": { "line": 200, "column": null } + }, + "79": { + "start": { "line": 190, "column": 4 }, + "end": { "line": 190, "column": null } + }, + "80": { + "start": { "line": 190, "column": 23 }, + "end": { "line": 190, "column": null } + }, + "81": { + "start": { "line": 191, "column": 4 }, + "end": { "line": 191, "column": null } + }, + "82": { + "start": { "line": 192, "column": 4 }, + "end": { "line": 199, "column": null } + }, + "83": { + "start": { "line": 202, "column": 2 }, + "end": { "line": 202, "column": null } + }, + "84": { + "start": { "line": 204, "column": 20 }, + "end": { "line": 204, "column": null } + }, + "85": { + "start": { "line": 205, "column": 2 }, + "end": { "line": 205, "column": null } + }, + "86": { + "start": { "line": 207, "column": 18 }, + "end": { "line": 211, "column": null } + }, + "87": { + "start": { "line": 208, "column": 4 }, + "end": { "line": 210, "column": null } + }, + "88": { + "start": { "line": 213, "column": 2 }, + "end": { "line": 217, "column": null } + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { "line": 13, "column": 7 }, + "end": { "line": 13, "column": 12 } + }, + "loc": { + "start": { "line": 13, "column": 7 }, + "end": { "line": 13, "column": null } + } + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { "line": 18, "column": 7 }, + "end": { "line": 18, "column": 12 } + }, + "loc": { + "start": { "line": 18, "column": 7 }, + "end": { "line": 18, "column": null } + } + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { "line": 48, "column": 24 }, + "end": { "line": 48, "column": 25 } + }, + "loc": { + "start": { "line": 48, "column": 72 }, + "end": { "line": 68, "column": null } + } + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { "line": 54, "column": 15 }, + "end": { "line": 54, "column": 16 } + }, + "loc": { + "start": { "line": 54, "column": 24 }, + "end": { "line": 56, "column": 3 } + } + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { "line": 60, "column": 18 }, + "end": { "line": 60, "column": 24 } + }, + "loc": { + "start": { "line": 60, "column": 24 }, + "end": { "line": 62, "column": null } + } + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { "line": 70, "column": 25 }, + "end": { "line": 70, "column": null } + }, + "loc": { + "start": { "line": 77, "column": 5 }, + "end": { "line": 164, "column": null } + } + }, + "6": { + "name": "calc", + "decl": { + "start": { "line": 84, "column": 11 }, + "end": { "line": 84, "column": 16 } + }, + "loc": { + "start": { "line": 84, "column": 54 }, + "end": { "line": 105, "column": null } + } + }, + "7": { + "name": "withEllipsisText", + "decl": { + "start": { "line": 107, "column": 11 }, + "end": { "line": 107, "column": 28 } + }, + "loc": { + "start": { "line": 107, "column": 45 }, + "end": { "line": 125, "column": null } + } + }, + "8": { + "name": "withAction", + "decl": { + "start": { "line": 127, "column": 11 }, + "end": { "line": 127, "column": 22 } + }, + "loc": { + "start": { "line": 127, "column": 39 }, + "end": { "line": 152, "column": null } + } + }, + "9": { + "name": "(anonymous_9)", + "decl": { + "start": { "line": 172, "column": 27 }, + "end": { "line": 172, "column": null } + }, + "loc": { + "start": { "line": 175, "column": 24 }, + "end": { "line": 218, "column": null } + } + }, + "10": { + "name": "(anonymous_10)", + "decl": { + "start": { "line": 182, "column": 17 }, + "end": { "line": 182, "column": 23 } + }, + "loc": { + "start": { "line": 182, "column": 23 }, + "end": { "line": 187, "column": null } + } + }, + "11": { + "name": "(anonymous_11)", + "decl": { + "start": { "line": 189, "column": 22 }, + "end": { "line": 189, "column": 28 } + }, + "loc": { + "start": { "line": 189, "column": 28 }, + "end": { "line": 200, "column": null } + } + }, + "12": { + "name": "(anonymous_12)", + "decl": { + "start": { "line": 207, "column": 27 }, + "end": { "line": 207, "column": null } + }, + "loc": { + "start": { "line": 208, "column": 4 }, + "end": { "line": 210, "column": null } + } + } + }, + "branchMap": { + "0": { + "loc": { + "start": { "line": 13, "column": 12 }, + "end": { "line": 13, "column": null } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 13, "column": 12 }, + "end": { "line": 13, "column": null } + }, + { + "start": { "line": 13, "column": 12 }, + "end": { "line": 13, "column": null } + } + ] + }, + "1": { + "loc": { + "start": { "line": 18, "column": 12 }, + "end": { "line": 18, "column": null } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 18, "column": 12 }, + "end": { "line": 18, "column": null } + }, + { + "start": { "line": 18, "column": 12 }, + "end": { "line": 18, "column": null } + } + ] + }, + "2": { + "loc": { + "start": { "line": 84, "column": 33 }, + "end": { "line": 84, "column": 43 } + }, + "type": "default-arg", + "locations": [ + { + "start": { "line": 84, "column": 39 }, + "end": { "line": 84, "column": 43 } + } + ] + }, + "3": { + "loc": { + "start": { "line": 84, "column": 43 }, + "end": { "line": 84, "column": 54 } + }, + "type": "default-arg", + "locations": [ + { + "start": { "line": 84, "column": 50 }, + "end": { "line": 84, "column": 54 } + } + ] + }, + "4": { + "loc": { + "start": { "line": 85, "column": 4 }, + "end": { "line": 85, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 85, "column": 4 }, + "end": { "line": 85, "column": null } + }, + { + "start": { "line": 85, "column": 4 }, + "end": { "line": 85, "column": null } + } + ] + }, + "5": { + "loc": { + "start": { "line": 87, "column": 4 }, + "end": { "line": 94, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 87, "column": 4 }, + "end": { "line": 94, "column": null } + }, + { + "start": { "line": 87, "column": 4 }, + "end": { "line": 94, "column": null } + } + ] + }, + "6": { + "loc": { + "start": { "line": 89, "column": 6 }, + "end": { "line": 92, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 89, "column": 6 }, + "end": { "line": 92, "column": null } + }, + { + "start": { "line": 89, "column": 6 }, + "end": { "line": 92, "column": null } + } + ] + }, + "7": { + "loc": { + "start": { "line": 100, "column": 4 }, + "end": { "line": 103, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 100, "column": 4 }, + "end": { "line": 103, "column": null } + }, + { + "start": { "line": 100, "column": 4 }, + "end": { "line": 103, "column": null } + } + ] + }, + "8": { + "loc": { + "start": { "line": 102, "column": 29 }, + "end": { "line": 102, "column": 43 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 102, "column": 29 }, + "end": { "line": 102, "column": 37 } + }, + { + "start": { "line": 102, "column": 37 }, + "end": { "line": 102, "column": 43 } + } + ] + }, + "9": { + "loc": { + "start": { "line": 110, "column": 4 }, + "end": { "line": 120, "column": null } + }, + "type": "switch", + "locations": [ + { + "start": { "line": 111, "column": 6 }, + "end": { "line": 113, "column": null } + }, + { + "start": { "line": 114, "column": 6 }, + "end": { "line": 116, "column": null } + }, + { + "start": { "line": 117, "column": 6 }, + "end": { "line": 119, "column": null } + } + ] + }, + "10": { + "loc": { + "start": { "line": 121, "column": 4 }, + "end": { "line": 123, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 121, "column": 4 }, + "end": { "line": 123, "column": null } + }, + { + "start": { "line": 121, "column": 4 }, + "end": { "line": 123, "column": null } + } + ] + }, + "11": { + "loc": { + "start": { "line": 132, "column": 4 }, + "end": { "line": 150, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 132, "column": 4 }, + "end": { "line": 150, "column": null } + }, + { + "start": { "line": 132, "column": 4 }, + "end": { "line": 150, "column": null } + } + ] + }, + "12": { + "loc": { + "start": { "line": 134, "column": 6 }, + "end": { "line": 148, "column": null } + }, + "type": "switch", + "locations": [ + { + "start": { "line": 135, "column": 8 }, + "end": { "line": 137, "column": null } + }, + { + "start": { "line": 138, "column": 8 }, + "end": { "line": 142, "column": null } + }, + { + "start": { "line": 143, "column": 8 }, + "end": { "line": 147, "column": null } + } + ] + }, + "13": { + "loc": { + "start": { "line": 155, "column": 2 }, + "end": { "line": 157, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 155, "column": 2 }, + "end": { "line": 157, "column": null } + }, + { + "start": { "line": 155, "column": 2 }, + "end": { "line": 157, "column": null } + } + ] + }, + "14": { + "loc": { + "start": { "line": 158, "column": 2 }, + "end": { "line": 160, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 158, "column": 2 }, + "end": { "line": 160, "column": null } + }, + { + "start": { "line": 158, "column": 2 }, + "end": { "line": 160, "column": null } + } + ] + }, + "15": { + "loc": { + "start": { "line": 184, "column": 6 }, + "end": { "line": 186, "column": null } + }, + "type": "cond-expr", + "locations": [ + { + "start": { "line": 185, "column": 10 }, + "end": { "line": 185, "column": null } + }, + { + "start": { "line": 186, "column": 10 }, + "end": { "line": 186, "column": null } + } + ] + }, + "16": { + "loc": { + "start": { "line": 190, "column": 4 }, + "end": { "line": 190, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 190, "column": 4 }, + "end": { "line": 190, "column": null } + }, + { + "start": { "line": 190, "column": 4 }, + "end": { "line": 190, "column": null } + } + ] + }, + "17": { + "loc": { + "start": { "line": 197, "column": 6 }, + "end": { "line": 197, "column": null } + }, + "type": "cond-expr", + "locations": [ + { + "start": { "line": 197, "column": 23 }, + "end": { "line": 197, "column": 59 } + }, + { + "start": { "line": 197, "column": 59 }, + "end": { "line": 197, "column": null } + } + ] + }, + "18": { + "loc": { + "start": { "line": 208, "column": 4 }, + "end": { "line": 210, "column": null } + }, + "type": "cond-expr", + "locations": [ + { + "start": { "line": 209, "column": 8 }, + "end": { "line": 209, "column": null } + }, + { + "start": { "line": 210, "column": 8 }, + "end": { "line": 210, "column": null } + } + ] + } + }, + "s": { + "0": 2, + "1": 2, + "2": 2, + "3": 2, + "4": 2, + "5": 2, + "6": 2, + "7": 2, + "8": 2, + "9": 8, + "10": 8, + "11": 8, + "12": 8, + "13": 0, + "14": 8, + "15": 8, + "16": 8, + "17": 8, + "18": 2, + "19": 8, + "20": 8, + "21": 8, + "22": 56, + "23": 0, + "24": 56, + "25": 8, + "26": 8, + "27": 0, + "28": 0, + "29": 8, + "30": 48, + "31": 48, + "32": 48, + "33": 48, + "34": 24, + "35": 24, + "36": 24, + "37": 44, + "38": 44, + "39": 44, + "40": 10, + "41": 10, + "42": 34, + "43": 34, + "44": 0, + "45": 0, + "46": 44, + "47": 36, + "48": 8, + "49": 0, + "50": 0, + "51": 0, + "52": 0, + "53": 0, + "54": 0, + "55": 0, + "56": 0, + "57": 0, + "58": 0, + "59": 0, + "60": 0, + "61": 0, + "62": 0, + "63": 8, + "64": 8, + "65": 8, + "66": 8, + "67": 0, + "68": 8, + "69": 8, + "70": 2, + "71": 2, + "72": 4, + "73": 4, + "74": 4, + "75": 4, + "76": 4, + "77": 0, + "78": 4, + "79": 8, + "80": 0, + "81": 8, + "82": 8, + "83": 4, + "84": 4, + "85": 4, + "86": 4, + "87": 8, + "88": 4 + }, + "f": { + "0": 2, + "1": 2, + "2": 8, + "3": 0, + "4": 8, + "5": 8, + "6": 56, + "7": 44, + "8": 0, + "9": 4, + "10": 0, + "11": 8, + "12": 8 + }, + "b": { + "0": [2, 2], + "1": [2, 2], + "2": [8], + "3": [8], + "4": [0, 56], + "5": [8, 48], + "6": [0, 8], + "7": [24, 24], + "8": [24, 0], + "9": [10, 34, 0], + "10": [36, 8], + "11": [0, 0], + "12": [0, 0, 0], + "13": [8, 0], + "14": [0, 8], + "15": [0, 0], + "16": [0, 8], + "17": [0, 8], + "18": [8, 0] + } + }, + "/Users/nemo/github/nemo-shen/noi/packages/core/useToast/useToast.tsx": { + "path": "/Users/nemo/github/nemo-shen/noi/packages/core/useToast/useToast.tsx", + "statementMap": { + "0": { + "start": { "line": 12, "column": 14 }, + "end": { "line": 12, "column": 23 } + }, + "1": { + "start": { "line": 14, "column": 23 }, + "end": { "line": 40, "column": 1 } + }, + "2": { + "start": { "line": 15, "column": 14 }, + "end": { "line": 35, "column": 4 } + }, + "3": { + "start": { "line": 17, "column": 19 }, + "end": { "line": 17, "column": 29 } + }, + "4": { + "start": { "line": 18, "column": 47 }, + "end": { "line": 18, "column": 54 } + }, + "5": { + "start": { "line": 19, "column": 20 }, + "end": { "line": 26, "column": 7 } + }, + "6": { + "start": { "line": 20, "column": 8 }, + "end": { "line": 20, "column": null } + }, + "7": { + "start": { "line": 21, "column": 8 }, + "end": { "line": 25, "column": null } + }, + "8": { + "start": { "line": 22, "column": 10 }, + "end": { "line": 22, "column": null } + }, + "9": { + "start": { "line": 23, "column": 15 }, + "end": { "line": 25, "column": null } + }, + "10": { + "start": { "line": 24, "column": 10 }, + "end": { "line": 24, "column": null } + }, + "11": { + "start": { "line": 27, "column": 20 }, + "end": { "line": 29, "column": 7 } + }, + "12": { + "start": { "line": 28, "column": 8 }, + "end": { "line": 28, "column": null } + }, + "13": { + "start": { "line": 31, "column": 6 }, + "end": { "line": 31, "column": null } + }, + "14": { + "start": { "line": 33, "column": 6 }, + "end": { "line": 33, "column": null } + }, + "15": { + "start": { "line": 33, "column": 13 }, + "end": { "line": 33, "column": 45 } + }, + "16": { + "start": { "line": 36, "column": 15 }, + "end": { "line": 36, "column": 44 } + }, + "17": { + "start": { "line": 37, "column": 2 }, + "end": { "line": 37, "column": null } + }, + "18": { + "start": { "line": 38, "column": 19 }, + "end": { "line": 38, "column": 34 } + }, + "19": { + "start": { "line": 39, "column": 2 }, + "end": { "line": 39, "column": null } + }, + "20": { + "start": { "line": 42, "column": 20 }, + "end": { "line": 48, "column": 1 } + }, + "21": { + "start": { "line": 43, "column": 2 }, + "end": { "line": 46, "column": null } + }, + "22": { + "start": { "line": 44, "column": 21 }, + "end": { "line": 44, "column": 37 } + }, + "23": { + "start": { "line": 45, "column": 4 }, + "end": { "line": 45, "column": null } + }, + "24": { + "start": { "line": 47, "column": 2 }, + "end": { "line": 47, "column": null } + }, + "25": { + "start": { "line": 67, "column": 24 }, + "end": { "line": 73, "column": 1 } + }, + "26": { + "start": { "line": 68, "column": 26 }, + "end": { "line": 68, "column": 39 } + }, + "27": { + "start": { "line": 69, "column": 2 }, + "end": { "line": 72, "column": null } + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { "line": 14, "column": 23 }, + "end": { "line": 14, "column": 29 } + }, + "loc": { + "start": { "line": 14, "column": 29 }, + "end": { "line": 40, "column": 1 } + } + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { "line": 16, "column": 4 }, + "end": { "line": 16, "column": 9 } + }, + "loc": { + "start": { "line": 16, "column": 25 }, + "end": { "line": 34, "column": null } + } + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { "line": 19, "column": 20 }, + "end": { "line": 19, "column": 49 } + }, + "loc": { + "start": { "line": 19, "column": 54 }, + "end": { "line": 26, "column": 7 } + } + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { "line": 27, "column": 20 }, + "end": { "line": 27, "column": 26 } + }, + "loc": { + "start": { "line": 27, "column": 26 }, + "end": { "line": 29, "column": 7 } + } + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { "line": 33, "column": 13 }, + "end": { "line": 33, "column": 32 } + }, + "loc": { + "start": { "line": 33, "column": 13 }, + "end": { "line": 33, "column": 45 } + } + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { "line": 42, "column": 20 }, + "end": { "line": 42, "column": 26 } + }, + "loc": { + "start": { "line": 42, "column": 26 }, + "end": { "line": 48, "column": 1 } + } + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { "line": 67, "column": 24 }, + "end": { "line": 67, "column": 25 } + }, + "loc": { + "start": { "line": 67, "column": 60 }, + "end": { "line": 73, "column": 1 } + } + } + }, + "branchMap": { + "0": { + "loc": { + "start": { "line": 21, "column": 8 }, + "end": { "line": 25, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 21, "column": 8 }, + "end": { "line": 25, "column": null } + }, + { + "start": { "line": 23, "column": 15 }, + "end": { "line": 25, "column": null } + } + ] + }, + "1": { + "loc": { + "start": { "line": 21, "column": 12 }, + "end": { "line": 21, "column": 59 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 21, "column": 12 }, + "end": { "line": 21, "column": 39 } + }, + { + "start": { "line": 21, "column": 43 }, + "end": { "line": 21, "column": 59 } + } + ] + }, + "2": { + "loc": { + "start": { "line": 23, "column": 15 }, + "end": { "line": 25, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 23, "column": 15 }, + "end": { "line": 25, "column": null } + }, + { + "start": { "line": 23, "column": 15 }, + "end": { "line": 25, "column": null } + } + ] + }, + "3": { + "loc": { + "start": { "line": 43, "column": 2 }, + "end": { "line": 46, "column": null } + }, + "type": "if", + "locations": [ + { + "start": { "line": 43, "column": 2 }, + "end": { "line": 46, "column": null } + }, + { + "start": { "line": 43, "column": 2 }, + "end": { "line": 46, "column": null } + } + ] + }, + "4": { + "loc": { + "start": { "line": 67, "column": 25 }, + "end": { "line": 67, "column": 55 } + }, + "type": "default-arg", + "locations": [ + { + "start": { "line": 67, "column": 53 }, + "end": { "line": 67, "column": 55 } + } + ] + } + }, + "s": { + "0": 1, + "1": 1, + "2": 1, + "3": 1, + "4": 1, + "5": 1, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 1, + "12": 0, + "13": 1, + "14": 1, + "15": 1, + "16": 1, + "17": 1, + "18": 1, + "19": 1, + "20": 1, + "21": 1, + "22": 1, + "23": 1, + "24": 0, + "25": 1, + "26": 1, + "27": 1 + }, + "f": { "0": 1, "1": 1, "2": 0, "3": 0, "4": 1, "5": 1, "6": 1 }, + "b": { "0": [0, 0], "1": [0, 0], "2": [0, 0], "3": [1, 0], "4": [1] } + }, + "/Users/nemo/github/nemo-shen/noi/src/App.vue": { + "path": "/Users/nemo/github/nemo-shen/noi/src/App.vue", + "statementMap": { + "0": { + "start": { "line": 6, "column": 2 }, + "end": { "line": 6, "column": null } + } + }, + "fnMap": {}, + "branchMap": {}, + "s": { "0": 0 }, + "f": {}, + "b": {} + }, + "/Users/nemo/github/nemo-shen/noi/src/main.js": { + "path": "/Users/nemo/github/nemo-shen/noi/src/main.js", + "statementMap": { + "0": { + "start": { "line": 4, "column": 0 }, + "end": { "line": 4, "column": 28 } + } + }, + "fnMap": {}, + "branchMap": {}, + "s": { "0": 0 }, + "f": {}, + "b": {} + }, + "/Users/nemo/github/nemo-shen/noi/src/demo/UseEllipsis.vue": { + "path": "/Users/nemo/github/nemo-shen/noi/src/demo/UseEllipsis.vue", + "statementMap": { + "0": { + "start": { "line": 4, "column": 20 }, + "end": { "line": 4, "column": null } + }, + "1": { + "start": { "line": 5, "column": 22 }, + "end": { "line": 7, "column": null } + }, + "2": { + "start": { "line": 9, "column": 21 }, + "end": { "line": 20, "column": null } + }, + "3": { + "start": { "line": 10, "column": 2 }, + "end": { "line": 20, "column": null } + }, + "4": { + "start": { "line": 15, "column": 10 }, + "end": { "line": 15, "column": null } + }, + "5": { + "start": { "line": 21, "column": 35 }, + "end": { "line": 23, "column": null } + }, + "6": { + "start": { "line": 27, "column": 18 }, + "end": { "line": 27, "column": 33 } + }, + "7": { + "start": { "line": 31, "column": 18 }, + "end": { "line": 31, "column": null } + } + }, + "fnMap": { + "0": { + "name": "(anonymous_1)", + "decl": { + "start": { "line": 9, "column": 21 }, + "end": { "line": 9, "column": 22 } + }, + "loc": { + "start": { "line": 10, "column": 2 }, + "end": { "line": 20, "column": null } + } + }, + "1": { + "name": "(anonymous_2)", + "decl": { + "start": { "line": 14, "column": 15 }, + "end": { "line": 14, "column": 21 } + }, + "loc": { + "start": { "line": 14, "column": 21 }, + "end": { "line": 16, "column": null } + } + }, + "2": { + "name": "(anonymous_4)", + "decl": { + "start": { "line": 1, "column": 0 }, + "end": { "line": 1, "column": null } + }, + "loc": { + "start": { "line": 27, "column": 18 }, + "end": { "line": 27, "column": 33 } + } + }, + "3": { + "name": "(anonymous_5)", + "decl": { + "start": { "line": 31, "column": 16 }, + "end": { "line": 31, "column": 18 } + }, + "loc": { + "start": { "line": 31, "column": 18 }, + "end": { "line": 31, "column": null } + } + } + }, + "branchMap": { + "0": { + "loc": { + "start": { "line": 1, "column": 0 }, + "end": { "line": 27, "column": 33 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 1, "column": 0 }, + "end": { "line": 1, "column": null } + }, + { + "start": { "line": 1, "column": 0 }, + "end": { "line": 27, "column": 33 } + } + ] + }, + "1": { + "loc": { + "start": { "line": 31, "column": 16 }, + "end": { "line": 31, "column": null } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 31, "column": 16 }, + "end": { "line": 31, "column": 18 } + }, + { + "start": { "line": 31, "column": 16 }, + "end": { "line": 31, "column": null } + } + ] + }, + "2": { + "loc": { + "start": { "line": 31, "column": 18 }, + "end": { "line": 31, "column": null } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 31, "column": 18 }, + "end": { "line": 31, "column": null } + }, + { + "start": { "line": 31, "column": 18 }, + "end": { "line": 31, "column": null } + } + ] + }, + "3": { + "loc": { + "start": { "line": 32, "column": 7 }, + "end": { "line": 32, "column": null } + }, + "type": "cond-expr", + "locations": [ + { + "start": { "line": 32, "column": 12 }, + "end": { "line": 32, "column": null } + }, + { + "start": { "line": 32, "column": 12 }, + "end": { "line": 32, "column": null } + } + ] + } + }, + "s": { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0 }, + "f": { "0": 0, "1": 0, "2": 0, "3": 0 }, + "b": { "0": [0, 0], "1": [0, 0], "2": [0, 0], "3": [0, 0] } + }, + "/Users/nemo/github/nemo-shen/noi/src/demo/UseToast.vue": { + "path": "/Users/nemo/github/nemo-shen/noi/src/demo/UseToast.vue", + "statementMap": { + "0": { + "start": { "line": 5, "column": 24 }, + "end": { "line": 5, "column": null } + }, + "1": { + "start": { "line": 6, "column": 24 }, + "end": { "line": 8, "column": null } + }, + "2": { + "start": { "line": 7, "column": 2 }, + "end": { "line": 7, "column": null } + }, + "3": { + "start": { "line": 12, "column": 18 }, + "end": { "line": 12, "column": 31 } + }, + "4": { + "start": { "line": 13, "column": 18 }, + "end": { "line": 13, "column": 32 } + }, + "5": { + "start": { "line": 15, "column": 18 }, + "end": { "line": 15, "column": 27 } + } + }, + "fnMap": { + "0": { + "name": "(anonymous_1)", + "decl": { + "start": { "line": 6, "column": 24 }, + "end": { "line": 6, "column": 30 } + }, + "loc": { + "start": { "line": 6, "column": 30 }, + "end": { "line": 8, "column": null } + } + }, + "1": { + "name": "(anonymous_3)", + "decl": { + "start": { "line": 12, "column": 16 }, + "end": { "line": 12, "column": 18 } + }, + "loc": { + "start": { "line": 12, "column": 18 }, + "end": { "line": 12, "column": 31 } + } + }, + "2": { + "name": "(anonymous_4)", + "decl": { + "start": { "line": 13, "column": 16 }, + "end": { "line": 13, "column": 18 } + }, + "loc": { + "start": { "line": 13, "column": 18 }, + "end": { "line": 13, "column": 32 } + } + }, + "3": { + "name": "(anonymous_5)", + "decl": { + "start": { "line": 15, "column": 16 }, + "end": { "line": 15, "column": 18 } + }, + "loc": { + "start": { "line": 15, "column": 18 }, + "end": { "line": 15, "column": 27 } + } + } + }, + "branchMap": { + "0": { + "loc": { + "start": { "line": 12, "column": 16 }, + "end": { "line": 12, "column": 31 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 12, "column": 16 }, + "end": { "line": 12, "column": 18 } + }, + { + "start": { "line": 12, "column": 16 }, + "end": { "line": 12, "column": 31 } + } + ] + }, + "1": { + "loc": { + "start": { "line": 13, "column": 16 }, + "end": { "line": 13, "column": 32 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 13, "column": 16 }, + "end": { "line": 13, "column": 18 } + }, + { + "start": { "line": 13, "column": 16 }, + "end": { "line": 13, "column": 32 } + } + ] + }, + "2": { + "loc": { + "start": { "line": 15, "column": 16 }, + "end": { "line": 15, "column": 27 } + }, + "type": "binary-expr", + "locations": [ + { + "start": { "line": 15, "column": 16 }, + "end": { "line": 15, "column": 18 } + }, + { + "start": { "line": 15, "column": 16 }, + "end": { "line": 15, "column": 27 } + } + ] + } + }, + "s": { "0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "5": 0 }, + "f": { "0": 0, "1": 0, "2": 0, "3": 0 }, + "b": { "0": [0, 0], "1": [0, 0], "2": [0, 0] } + } +} diff --git a/coverage/favicon.png b/coverage/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c1525b811a167671e9de1fa78aab9f5c0b61cef7 GIT binary patch literal 445 zcmV;u0Yd(XP))rP{nL}Ln%S7`m{0DjX9TLF* zFCb$4Oi7vyLOydb!7n&^ItCzb-%BoB`=x@N2jll2Nj`kauio%aw_@fe&*}LqlFT43 z8doAAe))z_%=P%v^@JHp3Hjhj^6*Kr_h|g_Gr?ZAa&y>wxHE99Gk>A)2MplWz2xdG zy8VD2J|Uf#EAw*bo5O*PO_}X2Tob{%bUoO2G~T`@%S6qPyc}VkhV}UifBuRk>%5v( z)x7B{I~z*k<7dv#5tC+m{km(D087J4O%+<<;K|qwefb6@GSX45wCK}Sn*> + + + Code coverage report for All files + + + + + + + + + +
+
+

All files

+
+
+ 65.41% + Statements + 87/133 +
+ +
+ 39.34% + Branches + 24/61 +
+ +
+ 53.57% + Functions + 15/28 +
+ +
+ 65.62% + Lines + 84/128 +
+
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ File + + Statements + + Branches + + Functions + + Lines +
+ packages/core/useEllipsis + +
+
+
+
+
74.15%66/8957.89%22/3876.92%10/1375.29%64/85
+ packages/core/useToast + +
+
+
+
+
75%21/2822.22%2/971.42%5/774.07%20/27
+ src + +
+
+
+
+
0%0/2100%0/0100%0/00%0/2
+ src/demo + +
+
+
+
+
0%0/140%0/140%0/80%0/14
+
+
+ +
+ + + + + + + + diff --git a/coverage/packages/core/useEllipsis/index.html b/coverage/packages/core/useEllipsis/index.html new file mode 100644 index 0000000..b45527e --- /dev/null +++ b/coverage/packages/core/useEllipsis/index.html @@ -0,0 +1,178 @@ + + + + Code coverage report for packages/core/useEllipsis + + + + + + + + + +
+
+

+ All files packages/core/useEllipsis +

+
+
+ 74.15% + Statements + 66/89 +
+ +
+ 57.89% + Branches + 22/38 +
+ +
+ 76.92% + Functions + 10/13 +
+ +
+ 75.29% + Lines + 64/85 +
+
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ File + + Statements + + Branches + + Functions + + Lines +
+ index.ts + +
+
+
+
+
74.15%66/8957.89%22/3876.92%10/1375.29%64/85
+
+
+ +
+ + + + + + + + diff --git a/coverage/packages/core/useEllipsis/index.ts.html b/coverage/packages/core/useEllipsis/index.ts.html new file mode 100644 index 0000000..d966062 --- /dev/null +++ b/coverage/packages/core/useEllipsis/index.ts.html @@ -0,0 +1,741 @@ + + + + Code coverage report for packages/core/useEllipsis/index.ts + + + + + + + + + +
+
+

+ All files / + packages/core/useEllipsis index.ts +

+
+
+ 74.15% + Statements + 66/89 +
+ +
+ 57.89% + Branches + 22/38 +
+ +
+ 76.92% + Functions + 10/13 +
+ +
+ 75.29% + Lines + 64/85 +
+
+

+ 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 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219  +  +  +  +  +  +  +  +  +  +  +  +2x +2x +2x +  +  +2x +2x +2x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2x +8x +  +8x +  +8x +8x +  +  +  +8x +  +8x +8x +  +  +8x +  +  +  +  +  +2x +  +  +  +  +  +  +  +8x +  +8x +8x +  +  +  +56x +  +56x +8x +8x +  +  +  +8x +  +  +48x +48x +  +48x +48x +24x +24x +  +24x +  +  +  +44x +44x +44x +  +10x +10x +  +34x +34x +  +  +  +  +44x +36x +  +8x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8x +8x +8x +  +8x +  +  +  +8x +8x +  +  +2x +  +  +  +  +  +2x +  +  +  +  +4x +4x +4x +4x +  +4x +  +  +  +  +  +  +4x +8x +8x +8x +  +  +  +  +  +  +  +  +  +4x +  +4x +4x +  +4x +8x +  +  +  +  +4x +  +  +  +  +  + 
import {
+  ref,
+  type Ref,
+  render,
+  type VNode,
+  watch,
+  computed,
+  ComputedRef,
+  onMounted,
+} from 'vue'
+import { useWindowSize } from '@vueuse/core'
+ 
+export enum EllipsisPosition {
+  Start = 'start',
+  End = 'end',
+}
+ 
+export enum EllipsisState {
+  Expanded = 'expanded',
+  Collapsed = 'collapsed',
+}
+ 
+interface UseEllipsisOptions {
+  content: Ref<string> // 同组件 prop
+  rows?: number // 同组件 prop default: 1
+  ellipsisText?: string // 同组件 prop default: '...'
+  position?: EllipsisPosition // 同组件 prop default 'end'
+  action?: (payload: { state: Ref<EllipsisState>; toggle: Function }) => VNode // 操作 VNode则表示自定义slot 传入之后会被计算到字符中
+}
+ 
+interface UseEllipsisReturn {
+  content: ComputedRef<string> // 省略后的内容
+  state: EllipsisState // 当前状态
+  toggle: (e: MouseEvent) => void // 切换状态
+}
+ 
+interface UseCloneElementReturn {
+  dupNode: HTMLElement
+  unmount: Function
+}
+ 
+/**
+ * 存放省略内容的容器需要是一个没有其他元素的干净容器,如果需要在内部增加action,可以通过action option 增加
+ * 如果需要控制省略位置可以通过 position option 控制 'left' | 'center' | 'right'(default)
+ * 如果需要控制省略符号可以通过 ellipsisText: '...' default
+ * @param source
+ */
+const useCloneElement = (source: HTMLElement): UseCloneElementReturn => {
+  const dupNode = source.cloneNode(false) as HTMLElement
+ 
+  const computedStyle = window.getComputedStyle(source)
+ 
+  const keys = Array.from(computedStyle)
+  keys.forEach((key) => {
+    dupNode.style.setProperty(key, computedStyle.getPropertyPriority(key))
+  })
+ 
+  document.body.appendChild(dupNode)
+ 
+  const unmount = () => {
+    document.body.removeChild(dupNode)
+  }
+ 
+  return {
+    dupNode,
+    unmount,
+  }
+}
+ 
+const calcEllipsisText = (
+  clone: UseCloneElementReturn,
+  sourceContent: string,
+  ellipsisText: string,
+  position: EllipsisPosition,
+  actionNode: VNode,
+  rows: number
+) => {
+  const node = clone.dupNode
+ 
+  const style = window.getComputedStyle(node)
+  const lineHeight = parseFloat(style.lineHeight) * rows
+  // 先把 ellipsisText 放到node中进行试算,那么我们就能知道我们至少要留多少空间给ellipsisText,也就是说
+ 
+  function calc(content: string, res = '', tail = '') {
+    Iif (content.length === 0) return res
+ 
+    if (content.length === 1) {
+      node.innerText = `${res}${content}`
+      Iif (node.clientHeight > lineHeight) {
+        node.innerText = res
+        return res
+      }
+      return `${res}${content}`
+    }
+ 
+    const half = content.slice(0, content.length / 2)
+    const remain = content.slice(half.length)
+ 
+    node.innerText = `${res}${half}`
+    if (node.offsetHeight > lineHeight) {
+      node.innerText = res
+      return calc(half, res, tail ?? remain)
+    }
+    return calc(remain + tail, res + half, '')
+  }
+ 
+  function withEllipsisText(content: string) {
+    node.innerText = ''
+    const newContent = content.slice(0, content.length - 1)
+    switch (position) {
+      case EllipsisPosition.Start:
+        node.innerText = ellipsisText + content
+        break
+      case EllipsisPosition.End:
+        node.innerText = content + ellipsisText
+        break
+      default:
+        node.innerText = content + ellipsisText
+        break
+    }
+    if (node.offsetHeight > lineHeight) {
+      return withEllipsisText(newContent)
+    }
+    return node.innerText
+  }
+ 
+  function withAction(content: string) {
+    node.innerText = content
+    const dummyNode = document.createElement('div')
+    render(actionNode, dummyNode)
+    node.appendChild(dummyNode.firstChild)
+    if (node.offsetHeight > lineHeight) {
+      let newContent
+      switch (position) {
+        case EllipsisPosition.Start:
+          newContent = ellipsisText + content.slice(1 + ellipsisText.length)
+          break
+        case EllipsisPosition.End:
+          newContent =
+            content.slice(0, content.length - 1 - ellipsisText.length) +
+            ellipsisText
+          break
+        default:
+          newContent =
+            content.slice(0, content.length - 1 - ellipsisText.length) +
+            ellipsisText
+          break
+      }
+      return withAction(newContent)
+    }
+    return content
+  }
+ 
+  let res = calc(sourceContent)
+  Eif (ellipsisText.length !== 0) {
+    res = withEllipsisText(res)
+  }
+  Iif (actionNode) {
+    res = withAction(res)
+  }
+ 
+  clone.unmount()
+  return res
+}
+ 
+const defaultUseEllipsisOptions = {
+  rows: 1,
+  ellipsisText: '...',
+  position: EllipsisPosition.End,
+}
+ 
+export const useEllipsis = (
+  source: Ref<HTMLElement>,
+  options: UseEllipsisOptions
+): UseEllipsisReturn => {
+  // eslint-disable-next-line no-param-reassign
+  options = { ...defaultUseEllipsisOptions, ...options }
+  const ellipsisContent = ref('')
+  const state = ref(EllipsisState.Collapsed)
+  const clone = ref<UseCloneElementReturn>()
+ 
+  const toggle = () => {
+    state.value =
+      state.value === EllipsisState.Collapsed
+        ? EllipsisState.Expanded
+        : EllipsisState.Collapsed
+  }
+ 
+  const reCalculate = () => {
+    Iif (!source.value) return
+    clone.value = useCloneElement(source.value)
+    ellipsisContent.value = calcEllipsisText(
+      clone.value,
+      options.content.value,
+      options.ellipsisText,
+      options.position,
+      options.action ? options.action({ state, toggle }) : undefined,
+      options.rows
+    )
+  }
+ 
+  onMounted(reCalculate)
+ 
+  const { width } = useWindowSize()
+  watch([width, options.content, source], reCalculate)
+ 
+  const content = computed(() =>
+    state.value === EllipsisState.Collapsed
+      ? ellipsisContent.value
+      : options.content.value
+  )
+ 
+  return {
+    content,
+    state: EllipsisState.Collapsed,
+    toggle,
+  }
+}
+ 
+ +
+ +
+ + + + + + + + diff --git a/coverage/packages/core/useToast/index.html b/coverage/packages/core/useToast/index.html new file mode 100644 index 0000000..f24c694 --- /dev/null +++ b/coverage/packages/core/useToast/index.html @@ -0,0 +1,178 @@ + + + + Code coverage report for packages/core/useToast + + + + + + + + + +
+
+

+ All files packages/core/useToast +

+
+
+ 75% + Statements + 21/28 +
+ +
+ 22.22% + Branches + 2/9 +
+ +
+ 71.42% + Functions + 5/7 +
+ +
+ 74.07% + Lines + 20/27 +
+
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ File + + Statements + + Branches + + Functions + + Lines +
+ useToast.tsx + +
+
+
+
+
75%21/2822.22%2/971.42%5/774.07%20/27
+
+
+ +
+ + + + + + + + diff --git a/coverage/packages/core/useToast/useToast.tsx.html b/coverage/packages/core/useToast/useToast.tsx.html new file mode 100644 index 0000000..7cf9820 --- /dev/null +++ b/coverage/packages/core/useToast/useToast.tsx.html @@ -0,0 +1,306 @@ + + + + Code coverage report for packages/core/useToast/useToast.tsx + + + + + + + + + +
+
+

+ All files / + packages/core/useToast useToast.tsx +

+
+
+ 75% + Statements + 21/28 +
+ +
+ 22.22% + Branches + 2/9 +
+ +
+ 71.42% + Functions + 5/7 +
+ +
+ 74.07% + Lines + 20/27 +
+
+

+ 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 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74  +  +  +  +  +  +  +  +  +  +  +1x +  +1x +1x +  +1x +1x +1x +  +  +  +  +  +  +  +1x +  +  +  +1x +  +1x +  +  +1x +1x +1x +1x +  +  +1x +1x +1x +1x +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1x +1x +1x +  +  +  +  + 
import { ref, type Ref, createApp, Component, isVNode } from 'vue'
+ 
+interface UseToastOptions {
+  duration?: number
+  root?: Component
+}
+ 
+interface OpenOptions {
+  content?: string | Component
+}
+ 
+const stack = new Set()
+ 
+const createInstance = () => {
+  const app = createApp({
+    setup(_, { expose }) {
+      const show = ref(false)
+      const message: Ref<string | Component> = ref('')
+      const open = (options: string | OpenOptions) => {
+        show.value = true
+        if (typeof options === 'string' || isVNode(options)) {
+          message.value = options
+        } else if (options.content) {
+          message.value = options.content
+        }
+      }
+      const close = () => {
+        show.value = false
+      }
+ 
+      expose({ open, close })
+ 
+      return () => <div v-show={show.value}>{message.value}</div>
+    },
+  })
+  const root = document.createElement('div')
+  document.body.appendChild(root)
+  const instance = app.mount(root)
+  return instance
+}
+ 
+const getInstance = () => {
+  Eif (stack.size === 0) {
+    const instance = createInstance()
+    return instance
+  }
+  return stack.values().next().value
+}
+ 
+/**
+ * ```js
+ * mountRootComponent({ setup() {} })
+ * mountRootComponent(App.vue)
+ * mountRootComponent(App.tsx)
+ * ```
+ * const { open } = useToast()
+ * 0. 所有的实例都挂在 app 实例中?
+ * 1. 先判断是否有 toast 实例
+ * 2. 如果没有则创建实例
+ * 3. 返回必要的方法,并响应式 content 并不是 important message
+ * 4. call open 则会展示,如果没传duration默认3秒
+ * 5. call close 手动关闭 toast
+ * open('text')
+ * open(options)
+ * open(Component)
+ */
+export const useToast = (_options: UseToastOptions = {}) => {
+  const { open, close } = getInstance()
+  return {
+    open,
+    close,
+  }
+}
+ 
+ +
+ +
+ + + + + + + + diff --git a/coverage/prettify.css b/coverage/prettify.css new file mode 100644 index 0000000..006492c --- /dev/null +++ b/coverage/prettify.css @@ -0,0 +1,101 @@ +.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/prettify.js b/coverage/prettify.js new file mode 100644 index 0000000..51a892a --- /dev/null +++ b/coverage/prettify.js @@ -0,0 +1,1004 @@ +/* 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; V < U; ++V) { + var ae = Z[V] + if (ae.ignoreCase) { + ac = true + } else { + if ( + /[a-z]/i.test( + ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, '') + ) + ) { + S = true + ac = false + break + } + } + } + var Y = { b: 8, t: 9, n: 10, v: 11, f: 12, r: 13 } + function ab(ah) { + var ag = ah.charCodeAt(0) + if (ag !== 92) { + return ag + } + var af = ah.charAt(1) + ag = Y[af] + if (ag) { + return ag + } else { + if ('0' <= af && af <= '7') { + return parseInt(ah.substring(1), 8) + } else { + if (af === 'u' || af === 'x') { + return parseInt(ah.substring(2), 16) + } else { + return ah.charCodeAt(1) + } + } + } + } + function T(af) { + if (af < 32) { + return (af < 16 ? '\\x0' : '\\x') + af.toString(16) + } + var ag = String.fromCharCode(af) + if (ag === '\\' || ag === '-' || ag === '[' || ag === ']') { + ag = '\\' + ag + } + return ag + } + function X(am) { + var aq = am + .substring(1, am.length - 1) + .match( + new RegExp( + '\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]', + 'g' + ) + ) + var ak = [] + var af = [] + var ao = aq[0] === '^' + for (var ar = ao ? 1 : 0, aj = aq.length; ar < aj; ++ar) { + var ah = aq[ar] + if (/\\[bdsw]/i.test(ah)) { + ak.push(ah) + } else { + var ag = ab(ah) + var al + if (ar + 2 < aj && '-' === aq[ar + 1]) { + al = ab(aq[ar + 2]) + ar += 2 + } else { + al = ag + } + af.push([ag, al]) + if (!(al < 65 || ag > 122)) { + 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; ar < af.length; ++ar) { + var at = af[ar] + if (at[0] <= ap[1] + 1) { + ap[1] = Math.max(ap[1], at[1]) + } else { + ai.push((ap = at)) + } + } + var an = ['['] + if (ao) { + an.push('^') + } + an.push.apply(an, ak) + for (var ar = 0; ar < ai.length; ++ar) { + var at = ai[ar] + an.push(T(at[0])) + if (at[1] > at[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 < ah; ++ak) { + var ag = aj[ak] + if (ag === '(') { + ++am + } else { + if ('\\' === ag.charAt(0)) { + var af = +ag.substring(1) + if (af && af <= am) { + an[af] = -1 + } + } + } + } + for (var ak = 1; ak < an.length; ++ak) { + if (-1 === an[ak]) { + an[ak] = ++ad + } + } + for (var ak = 0, am = 0; ak < ah; ++ak) { + var ag = aj[ak] + if (ag === '(') { + ++am + if (an[am] === undefined) { + aj[ak] = '(?:' + } + } else { + if ('\\' === ag.charAt(0)) { + var af = +ag.substring(1) + if (af && af <= am) { + aj[ak] = '\\' + an[am] + } + } + } + } + for (var ak = 0, am = 0; ak < ah; ++ak) { + if ('^' === aj[ak] && '^' !== aj[ak + 1]) { + aj[ak] = '' + } + } + if (al.ignoreCase && S) { + for (var ak = 0; ak < ah; ++ak) { + var ag = aj[ak] + var ai = ag.charAt(0) + if (ag.length >= 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 < U; ++V) { + var ae = Z[V] + if (ae.global || ae.multiline) { + throw new Error('' + ae) + } + aa.push('(?:' + W(ae) + ')') + } + return new RegExp(aa.join('|'), ac ? 'gi' : 'g') + } + function a(V) { + var U = /(?:^|\s)nocode(?:\s|$)/ + var X = [] + var T = 0 + var Z = [] + var W = 0 + var S + if (V.currentStyle) { + S = V.currentStyle.whiteSpace + } else { + if (window.getComputedStyle) { + S = document.defaultView + .getComputedStyle(V, null) + .getPropertyValue('white-space') + } + } + var Y = S && 'pre' === S.substring(0, 3) + function aa(ab) { + switch (ab.nodeType) { + case 1: + if (U.test(ab.className)) { + return + } + for (var ae = ab.firstChild; ae; ae = ae.nextSibling) { + aa(ae) + } + var ad = ab.nodeName + if ('BR' === ad || 'LI' === ad) { + X[W] = '\n' + Z[W << 1] = T++ + Z[(W++ << 1) | 1] = ab + } + break + case 3: + case 4: + var ac = ab.nodeValue + if (ac.length) { + if (!Y) { + ac = ac.replace(/[ \t\r\n]+/g, ' ') + } else { + ac = ac.replace(/\r\n?/g, '\n') + } + X[W] = ac + Z[W << 1] = T + T += ac.length + Z[(W++ << 1) | 1] = ab + } + break + } + } + aa(V) + return { sourceCode: X.join('').replace(/\n$/, ''), spans: Z } + } + function B(S, U, W, T) { + if (!U) { + return + } + var V = { sourceCode: U, basePos: S } + W(V) + T.push.apply(T, V.decorations) + } + var v = /\S/ + function o(S) { + var V = undefined + for (var U = S.firstChild; U; U = U.nextSibling) { + var T = U.nodeType + V = T === 1 ? (V ? S : U) : T === 3 ? (v.test(U.nodeValue) ? S : V) : V + } + return V === S ? undefined : V + } + function g(U, T) { + var S = {} + var V + ;(function () { + var ad = U.concat(T) + var ah = [] + var ag = {} + for (var ab = 0, Z = ad.length; ab < Z; ++ab) { + var Y = ad[ab] + var ac = Y[3] + if (ac) { + for (var ae = ac.length; --ae >= 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 < aq; ++ae) { + var ag = an[ae] + var ap = aj[ag] + var ai = void 0 + var am + if (typeof ap === 'string') { + am = false + } else { + var aa = S[ag.charAt(0)] + if (aa) { + ai = ag.match(aa[1]) + ap = aa[0] + } else { + for (var ao = 0; ao < X; ++ao) { + aa = T[ao] + ai = ag.match(aa[1]) + if (ai) { + ap = aa[0] + break + } + } + if (!ai) { + ap = F + } + } + am = ap.length >= 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 < W.length; ++Y) { + ae(W[Y]) + } + if (ag === (ag | 0)) { + W[0].setAttribute('value', ag) + } + var aa = ac.createElement('OL') + aa.className = 'linenums' + var X = Math.max(0, (ag - 1) | 0) || 0 + for (var Y = 0, T = W.length; Y < T; ++Y) { + af = W[Y] + af.className = 'L' + ((Y + X) % 10) + if (!af.firstChild) { + af.appendChild(ac.createTextNode('\xA0')) + } + aa.appendChild(af) + } + V.appendChild(aa) + } + function D(ac) { + var aj = /\bMSIE\b/.test(navigator.userAgent) + var am = /\n/g + var al = ac.sourceCode + var an = al.length + var V = 0 + var aa = ac.spans + var T = aa.length + var ah = 0 + var X = ac.decorations + var Y = X.length + var Z = 0 + X[Y] = an + var ar, aq + for (aq = ar = 0; aq < Y; ) { + if (X[aq] !== X[aq + 2]) { + X[ar++] = X[aq++] + X[ar++] = X[aq++] + } else { + aq += 2 + } + } + Y = ar + for (aq = ar = 0; aq < Y; ) { + var at = X[aq] + var ab = X[aq + 1] + var W = aq + 2 + while (W + 2 <= Y && X[W + 1] === ab) { + W += 2 + } + X[ar++] = at + X[ar++] = ab + aq = W + } + Y = X.length = ar + var ae = null + while (ah < T) { + var af = aa[ah] + var S = aa[ah + 2] || an + var ag = X[Z] + var ap = X[Z + 2] || an + var W = Math.min(S, ap) + var ak = aa[ah + 1] + var U + if (ak.nodeType !== 1 && (U = al.substring(V, W))) { + if (aj) { + U = U.replace(am, '\r') + } + ak.nodeValue = U + var ai = ak.ownerDocument + var ao = ai.createElement('SPAN') + ao.className = X[Z + 1] + var ad = ak.parentNode + ad.replaceChild(ao, ak) + ao.appendChild(ak) + if (V < S) { + aa[ah + 1] = ak = ai.createTextNode(al.substring(W, S)) + ad.insertBefore(ak, ao.nextSibling) + } + } + V = W + if (V >= 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 < ac.length; ++aa) { + for (var Z = 0, V = ac[aa].length; Z < V; ++Z) { + T.push(ac[aa][Z]) + } + } + ac = null + var W = Date + if (!W.now) { + W = { + now: function () { + return +new Date() + }, + } + } + var X = 0 + var S + var ab = /\blang(?:uage)?-([\w.]+)(?!\S)/ + var ae = /\bprettyprint\b/ + function U() { + var ag = window.PR_SHOULD_USE_CONTINUATION ? W.now() + 250 : Infinity + for (; X < T.length && W.now() < ag; X++) { + var aj = T[X] + var ai = aj.className + if (ai.indexOf('prettyprint') >= 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 < T.length) { + setTimeout(U, 250) + } else { + if (ad) { + ad() + } + } + } + U() + } + window.prettyPrintOne = y + window.prettyPrint = b + window.PR = { + createSimpleLexer: g, + registerLangHandler: c, + sourceDecorator: i, + PR_ATTRIB_NAME: P, + PR_ATTRIB_VALUE: n, + PR_COMMENT: j, + PR_DECLARATION: E, + PR_KEYWORD: z, + PR_LITERAL: G, + PR_NOCODE: N, + PR_PLAIN: F, + PR_PUNCTUATION: L, + PR_SOURCE: J, + PR_STRING: C, + PR_TAG: m, + PR_TYPE: O, + } +})() +PR.registerLangHandler( + PR.createSimpleLexer( + [], + [ + [PR.PR_DECLARATION, /^]*(?:>|$)/], + [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/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed68316eb3f65dec9063332d2f69bf3093bbfab GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qh}Z>jv*C{$p!i!8j}?a+@3A= zIAGwzjijN=FBi!|L1t?LM;Q;gkwn>2cAy-KV{dn nf0J1DIvEHQu*n~6U}x}qyky7vi4|9XhBJ7&`njxgN@xNA8m%nc literal 0 HcmV?d00001 diff --git a/coverage/sorter.js b/coverage/sorter.js new file mode 100644 index 0000000..5841327 --- /dev/null +++ b/coverage/sorter.js @@ -0,0 +1,191 @@ +/* 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/src/App.vue.html b/coverage/src/App.vue.html new file mode 100644 index 0000000..ad4f7a8 --- /dev/null +++ b/coverage/src/App.vue.html @@ -0,0 +1,108 @@ + + + + Code coverage report for src/App.vue + + + + + + + + + +
+
+

+ All files / + src App.vue +

+
+
+ 0% + Statements + 0/1 +
+ +
+ 100% + Branches + 0/0 +
+ +
+ 100% + Functions + 0/0 +
+ +
+ 0% + Lines + 0/1 +
+
+

+ 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  +  +  +  +  +  +  + 
<script setup lang="ts">
+import UseEllipsis from './demo/UseEllipsis.vue'
+</script>
+ 
+<template>
+  <UseEllipsis />
+</template>
+ 
+ +
+ +
+ + + + + + + + diff --git a/coverage/src/demo/UseEllipsis.vue.html b/coverage/src/demo/UseEllipsis.vue.html new file mode 100644 index 0000000..481eb84 --- /dev/null +++ b/coverage/src/demo/UseEllipsis.vue.html @@ -0,0 +1,216 @@ + + + + Code coverage report for src/demo/UseEllipsis.vue + + + + + + + + + +
+
+

+ All files / + src/demo UseEllipsis.vue +

+
+
+ 0% + Statements + 0/8 +
+ +
+ 0% + Branches + 0/8 +
+ +
+ 0% + Functions + 0/4 +
+ +
+ 0% + Lines + 0/8 +
+
+

+ 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 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
<script setup lang="ts">
+import { ref, h, VNode } from 'vue'
+import { useEllipsis, EllipsisPosition } from '@noi/core'
+const ellipsisRef = ref<HTMLElement>()
+const sourceContent = ref(
+  '擁有正確的座右銘,可以幫助你改變心態,自信迎接新的一天,比前一天更好。座右銘能改變你的生活。將勵志名言納入內容,作為文案,用這些金句激勵讀者。讓名言成為你的引領,展翅高飛!'
+)
+ 
+const renderButton = (_this) =>
+  h(
+    'button',
+    {
+      on: {
+        click: () => {
+          _this.toggle()
+        },
+      },
+    },
+    'Expanded'
+  )
+const { content, state, toggle } = useEllipsis(ellipsisRef, {
+  content: sourceContent,
+})
+</script>
+ 
+<template>
+  <input v-model="sourceContent" type="text" />
+  <div class="ellipsis" ref="ellipsisRef">
+    {{ content }}
+  </div>
+  <button @click="toggle">
+    {{ state === 'expanded' ? 'Collapsed' : 'Expanded' }}
+  </button>
+</template>
+ 
+<style>
+.ellipsis {
+  /* display: inline-block; */
+  /* width: 200px; */
+  font-size: 22px;
+  line-height: 32px;
+}
+</style>
+ 
+ +
+ +
+ + + + + + + + diff --git a/coverage/src/demo/UseToast.vue.html b/coverage/src/demo/UseToast.vue.html new file mode 100644 index 0000000..437ae1c --- /dev/null +++ b/coverage/src/demo/UseToast.vue.html @@ -0,0 +1,153 @@ + + + + Code coverage report for src/demo/UseToast.vue + + + + + + + + + +
+
+

+ All files / + src/demo UseToast.vue +

+
+
+ 0% + Statements + 0/6 +
+ +
+ 0% + Branches + 0/6 +
+ +
+ 0% + Functions + 0/4 +
+ +
+ 0% + Lines + 0/6 +
+
+

+ 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 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
<script setup lang="ts">
+import { h } from 'vue'
+import { useToast } from '@noi/core'
+ 
+const { open, close } = useToast()
+const openNodeContent = () => {
+  open(h('div', { class: 'nemo' }, 'hello world'))
+}
+</script>
+ 
+<template>
+  <button @click="open('abc')">open abc</button>
+  <button @click="open('nemo')">open nemo</button>
+  <button @click="openNodeContent">open node content</button>
+  <button @click="close()">close</button>
+</template>
+ 
+<style>
+.nemo {
+  color: red;
+}
+</style>
+ 
+ +
+ +
+ + + + + + + + diff --git a/coverage/src/demo/index.html b/coverage/src/demo/index.html new file mode 100644 index 0000000..d081f1a --- /dev/null +++ b/coverage/src/demo/index.html @@ -0,0 +1,196 @@ + + + + Code coverage report for src/demo + + + + + + + + + +
+
+

All files src/demo

+
+
+ 0% + Statements + 0/14 +
+ +
+ 0% + Branches + 0/14 +
+ +
+ 0% + Functions + 0/8 +
+ +
+ 0% + Lines + 0/14 +
+
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ File + + Statements + + Branches + + Functions + + Lines +
+ UseEllipsis.vue + +
+
+
+
+
0%0/80%0/80%0/40%0/8
+ UseToast.vue + +
+
+
+
+
0%0/60%0/60%0/40%0/6
+
+
+ +
+ + + + + + + + diff --git a/coverage/src/index.html b/coverage/src/index.html new file mode 100644 index 0000000..90ef0b9 --- /dev/null +++ b/coverage/src/index.html @@ -0,0 +1,196 @@ + + + + Code coverage report for src + + + + + + + + + +
+
+

All files src

+
+
+ 0% + Statements + 0/2 +
+ +
+ 100% + Branches + 0/0 +
+ +
+ 100% + Functions + 0/0 +
+ +
+ 0% + Lines + 0/2 +
+
+

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

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ File + + Statements + + Branches + + Functions + + Lines +
+ App.vue + +
+
+
+
+
0%0/1100%0/0100%0/00%0/1
+ main.js + +
+
+
+
+
0%0/1100%0/0100%0/00%0/1
+
+
+ +
+ + + + + + + + diff --git a/coverage/src/main.js.html b/coverage/src/main.js.html new file mode 100644 index 0000000..3231e86 --- /dev/null +++ b/coverage/src/main.js.html @@ -0,0 +1,99 @@ + + + + Code coverage report for src/main.js + + + + + + + + + +
+
+

+ All files / + src main.js +

+
+
+ 0% + Statements + 0/1 +
+ +
+ 100% + Branches + 0/0 +
+ +
+ 100% + Functions + 0/0 +
+ +
+ 0% + Lines + 0/1 +
+
+

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

+ +
+
+

+
1 +2 +3 +4 +5  +  +  +  + 
import { createApp } from 'vue'
+import App from './App.vue'
+ 
+createApp(App).mount('#app')
+ +
+ +
+ + + + + + + + diff --git a/package.json b/package.json index a91c7f0..74540a8 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "vite build", "preview": "vite preview", "test": "vitest", + "test:cov": "vitest run --coverage", "lint": "eslint .", "lint:fix": "eslint . --fix", "format": "prettier -w ." @@ -37,6 +38,7 @@ "@typescript-eslint/eslint-plugin": "^6.18.1", "@vitejs/plugin-vue": "^4.5.2", "@vitejs/plugin-vue-jsx": "^3.1.0", + "@vitest/coverage-istanbul": "^1.2.0", "@vue/test-utils": "^2.4.3", "eslint": "^7.32.0", "eslint-config-airbnb-base": "^15.0.0", diff --git a/packages/core/useLoading/index.test.ts b/packages/core/useLoading/index.test.ts index e69de29..d389c37 100644 --- a/packages/core/useLoading/index.test.ts +++ b/packages/core/useLoading/index.test.ts @@ -0,0 +1,7 @@ +import { test, describe, expect } from 'vitest' + +describe('useLoading', () => { + test('should be right', () => { + expect(true).toBeTruthy() + }) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aae6bd4..dbb167d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ importers: '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 version: 3.1.0(vite@5.0.11)(vue@3.4.13) + '@vitest/coverage-istanbul': + specifier: ^1.2.0 + version: 1.2.0(vitest@1.2.0) '@vue/test-utils': specifier: ^2.4.3 version: 2.4.3(vue@3.4.13) @@ -824,6 +827,14 @@ packages: wrap-ansi-cjs: /wrap-ansi@7.0.0 dev: true + /@istanbuljs/schema@0.1.3: + resolution: + { + integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==, + } + engines: { node: '>=8' } + dev: true + /@jest/schemas@29.6.3: resolution: { @@ -1470,6 +1481,28 @@ packages: vue: 3.4.13(typescript@5.3.3) dev: true + /@vitest/coverage-istanbul@1.2.0(vitest@1.2.0): + resolution: + { + integrity: sha512-hNN/pUR5la6P/L78+YcRl05Lpf6APXlH9ujkmCxxjVWtVG6WuKuqUMhHgYQBYfiOORBwDZ1MBgSUGCMPh4kpmQ==, + } + peerDependencies: + vitest: ^1.0.0 + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.2 + istanbul-lib-instrument: 6.0.1 + istanbul-lib-report: 3.0.1 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.6 + magicast: 0.3.2 + picocolors: 1.0.0 + test-exclude: 6.0.0 + vitest: 1.2.0(@types/node@20.11.0)(happy-dom@12.10.3) + transitivePeerDependencies: + - supports-color + dev: true + /@vitest/expect@1.2.0: resolution: { @@ -3602,6 +3635,13 @@ packages: dev: false optional: true + /html-escaper@2.0.2: + resolution: + { + integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==, + } + dev: true + /html-tags@3.3.1: resolution: { @@ -3944,6 +3984,67 @@ packages: integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==, } + /istanbul-lib-coverage@3.2.2: + resolution: + { + integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==, + } + engines: { node: '>=8' } + dev: true + + /istanbul-lib-instrument@6.0.1: + resolution: + { + integrity: sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==, + } + engines: { node: '>=10' } + dependencies: + '@babel/core': 7.23.7 + '@babel/parser': 7.23.6 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.2 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-lib-report@3.0.1: + resolution: + { + integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==, + } + engines: { node: '>=10' } + dependencies: + istanbul-lib-coverage: 3.2.2 + make-dir: 4.0.0 + supports-color: 7.2.0 + dev: true + + /istanbul-lib-source-maps@4.0.1: + resolution: + { + integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==, + } + engines: { node: '>=10' } + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.2 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-reports@3.1.6: + resolution: + { + integrity: sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==, + } + engines: { node: '>=8' } + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.1 + dev: true + /jackspeak@2.3.6: resolution: { @@ -4220,6 +4321,27 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 + /magicast@0.3.2: + resolution: + { + integrity: sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg==, + } + dependencies: + '@babel/parser': 7.23.6 + '@babel/types': 7.23.6 + source-map-js: 1.0.2 + dev: true + + /make-dir@4.0.0: + resolution: + { + integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==, + } + engines: { node: '>=10' } + dependencies: + semver: 7.5.4 + dev: true + /mdast-util-from-markdown@0.8.5: resolution: { @@ -5198,6 +5320,14 @@ packages: } engines: { node: '>=0.10.0' } + /source-map@0.6.1: + resolution: + { + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, + } + engines: { node: '>=0.10.0' } + dev: true + /sprintf-js@1.0.3: resolution: { @@ -5422,6 +5552,18 @@ packages: dev: false optional: true + /test-exclude@6.0.0: + resolution: + { + integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==, + } + engines: { node: '>=8' } + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + /text-table@0.2.0: resolution: { diff --git a/vite.config.ts b/vite.config.ts index 2e0d6ff..227b4b5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,10 @@ export default defineConfig({ plugins: [vue(), vueJsx()], test: { environment: 'happy-dom', + coverage: { + provider: 'istanbul', + reporter: ['text', 'json', 'html'], + }, }, resolve: { alias: {