@dskripchenko/ui 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
21
21
|
`),r=[],i=[],a=e=>gc(e,t),o=()=>{i.length>0&&(r.push(`<p>${a(i.join(`
|
|
22
22
|
`))}</p>`),i=[])};for(let e=0;e<n.length;e++){let s=n[e]??``,c=/^\s*(`{3,}|~{3,})\s*([\w+#.-]*)[^`]*$/.exec(s);if(c){o();let t=[],i=c[1]??"```",a=s.length-s.trimStart().length,l=e=>{let t=e.trim();return e.length-e.trimStart().length<=a+3&&t.length>=i.length&&t[0]===i[0]&&/^(`+|~+)$/.test(t)};for(e++;e<n.length&&!l(n[e]??``);)t.push(n[e]??``),e++;let u=c[2]?` class="language-${c[2]}"`:``;r.push(`<pre><code${u}>${t.join(`
|
|
23
23
|
`)}</code></pre>`);continue}if(s.trim()===``){o();continue}let l=/^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(s);if(l){o();let e=l[1]?.length??1,n=a(l[2]??``);if(t.slugger){let i=_c(n),a=t.slugger(i);t.onHeading?.({level:e,text:i,id:a}),r.push(`<h${e} id="${lc(a)}">${n}</h${e}>`)}else r.push(`<h${e}>${n}</h${e}>`);continue}if(/^\s*([-*_])(\s*\1){2,}\s*$/.test(s)){o(),r.push(`<hr>`);continue}if(s.includes(`|`)&&yc.test(n[e+1]??``)&&(n[e+1]??``).includes(`|`)){o();let t=bc(s),i=bc(n[e+1]??``).map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`);return t&&n?`center`:n?`right`:t?`left`:``}),c=(e,t,n)=>`<${e}${i[n]?` style="text-align:${i[n]}"`:``}>${a(t)}</${e}>`,l=[];for(e+=2;e<n.length&&(n[e]??``).includes(`|`)&&(n[e]??``).trim()!==``;){let r=bc(n[e]??``);l.push(`<tr>${t.map((e,t)=>c(`td`,r[t]??``,t)).join(``)}</tr>`),e++}e--,r.push(`<div class="uid-markdown__table"><table><thead><tr>${t.map((e,t)=>c(`th`,e,t)).join(``)}</tr></thead><tbody>${l.join(``)}</tbody></table></div>`);continue}if(/^\s*>/.test(s)){o();let i=[];for(;e<n.length&&/^\s*>/.test(n[e]??``);)i.push((n[e]??``).replace(/^\s*>\s?/,``)),e++;e--,r.push(Dc(i,t));continue}if(vc.test(s)){o();let i=Ec(n,e,t);r.push(i.html),e=i.next-1;continue}i.push(s)}return o(),r.join(`
|
|
24
|
-
`)}function wc(e){return(/^[ \t]*/.exec(e)?.[0]??``).replace(/\t/g,` `).length}function Tc(e){return/^\s*(#{1,6}\s|>|```|~~~|\|)/.test(e)||/^\s*([-*_])(\s*\1){2,}\s*$/.test(e)}function Ec(e,t,n){let r=vc.exec(e[t]??``),i=wc(r?.[1]??``),a=/\d/.test(r?.[2]??``),o=[],s=0,c=t;for(;c<e.length;){let t=vc.exec(e[c]??``);if(!t||wc(t[1]??``)>i+1||wc(t[1]??``)<i||/\d/.test(t[2]??``)!==a)break;let r=[t[3]??``],l=[];for(c++;c<e.length;){let t=e[c]??``;if(t.trim()===``){let t=c+1;for(;t<e.length&&(e[t]??``).trim()===``;)t++;if(t<e.length&&wc(e[t]??``)>i+1){for(;c<t;c++)l.push(``);continue}break}if(
|
|
24
|
+
`)}function wc(e){return(/^[ \t]*/.exec(e)?.[0]??``).replace(/\t/g,` `).length}function Tc(e){return/^\s*(#{1,6}\s|>|```|~~~|\|)/.test(e)||/^\s*([-*_])(\s*\1){2,}\s*$/.test(e)}function Ec(e,t,n){let r=vc.exec(e[t]??``),i=wc(r?.[1]??``),a=/\d/.test(r?.[2]??``),o=[],s=0,c=t;for(;c<e.length;){let t=vc.exec(e[c]??``);if(!t||wc(t[1]??``)>i+1||wc(t[1]??``)<i||/\d/.test(t[2]??``)!==a)break;let r=[t[3]??``],l=[];for(c++;c<e.length;){let t=e[c]??``;if(t.trim()===``){let t=c+1;for(;t<e.length&&(e[t]??``).trim()===``;)t++;if(t<e.length&&wc(e[t]??``)>i+1){for(;c<t;c++)l.push(``);continue}break}if(l.length===0&&!vc.test(t)&&!Tc(t)){r.push(t.trim()),c++;continue}if(wc(t)>i+1){l.push(t),c++;continue}break}let u=/^\[([ xX])\]\s+/.exec(r[0]??``);u&&(r[0]=(r[0]??``).slice(u[0].length));let d=gc(r.join(`
|
|
25
25
|
`),n);if(l.some(e=>e.trim()!==``)){let e=Math.min(...l.filter(e=>e.trim()!==``).map(wc)),t=l.map(t=>t.replace(/\t/g,` `).slice(e));d+=Oc(t,n)}o.push(u?`<li class="uid-markdown__task"><input type="checkbox" disabled${u[1]===` `?``:` checked`} aria-label="${lc(u[1]===` `?n.taskLabels?.open??`Not done`:n.taskLabels?.done??`Done`)}"> ${d}</li>`:`<li>${d}</li>`),u&&s++;let f=c;for(;f<e.length&&(e[f]??``).trim()===``;)f++;let p=vc.exec(e[f]??``);f>c&&p&&wc(p[1]??``)<=i+1&&wc(p[1]??``)>=i&&/\d/.test(p[2]??``)===a&&(c=f)}let l=a?`ol`:`ul`,u=a?Number.parseInt(r?.[2]??`1`,10):1;return{html:`<${l}${a&&u!==1&&Number.isFinite(u)?` start="${u}"`:``}${s>0&&s===o.length?` class="uid-markdown__tasks"`:``}>${o.join(``)}</${l}>`,next:c}}function Dc(e,t){let n=(e[0]??``).trim(),r=/^\[!(\w+)\]\s*$/.exec(n);if(r){let n=xc[(r[1]??``).toLowerCase()];if(n)return`<blockquote class="uid-markdown__callout uid-markdown__callout--${n}">${`<p class="uid-markdown__callout-title">${lc(Sc(n,t))}</p>`}${Oc(e.slice(1),t)}</blockquote>`}let i=/^\*\*([^*]+?):?\*\*:?/.exec(n);if(i){let n=xc[(i[1]??``).trim().toLowerCase()];if(n)return`<blockquote class="uid-markdown__callout uid-markdown__callout--${n}">${Oc(e,t)}</blockquote>`}return`<blockquote>${Oc(e,t)}</blockquote>`}function Oc(e,t){return Cc(uc(e.join(`
|
|
26
26
|
`)),t)}function kc(e){if(!e)return[];let t=e.replace(/\r\n?/g,`
|
|
27
27
|
`).split(`
|
package/dist/index.mjs
CHANGED
|
@@ -7094,14 +7094,14 @@ function Sl(e, t, n) {
|
|
|
7094
7094
|
}
|
|
7095
7095
|
break;
|
|
7096
7096
|
}
|
|
7097
|
-
if (bl(t) > i + 1) {
|
|
7098
|
-
l.push(t), c++;
|
|
7099
|
-
continue;
|
|
7100
|
-
}
|
|
7101
7097
|
if (l.length === 0 && !ml.test(t) && !xl(t)) {
|
|
7102
7098
|
r.push(t.trim()), c++;
|
|
7103
7099
|
continue;
|
|
7104
7100
|
}
|
|
7101
|
+
if (bl(t) > i + 1) {
|
|
7102
|
+
l.push(t), c++;
|
|
7103
|
+
continue;
|
|
7104
|
+
}
|
|
7105
7105
|
break;
|
|
7106
7106
|
}
|
|
7107
7107
|
let u = /^\[([ xX])\]\s+/.exec(r[0] ?? "");
|