@aquera/nile-elements 2.0.3 → 2.0.5

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.
Files changed (88) hide show
  1. package/README.md +21 -0
  2. package/demo/nxtgen-classes.css +596 -2
  3. package/demo/nxtgen-dark.css +240 -21
  4. package/demo/nxtgen-properties.css +2 -2
  5. package/demo/nxtgen-utilities.css +598 -4
  6. package/demo/nxtgen.css +57 -2
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.esm.js +1 -1
  9. package/dist/index.js +458 -317
  10. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  11. package/dist/nile-combobox/nile-combobox.cjs.js.map +1 -1
  12. package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
  13. package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
  14. package/dist/nile-combobox/nile-combobox.css.esm.js +28 -15
  15. package/dist/nile-combobox/nile-combobox.esm.js +11 -8
  16. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  17. package/dist/nile-combobox/portal-manager.cjs.js.map +1 -1
  18. package/dist/nile-combobox/portal-manager.esm.js +1 -1
  19. package/dist/nile-combobox/renderer.cjs.js +1 -1
  20. package/dist/nile-combobox/renderer.cjs.js.map +1 -1
  21. package/dist/nile-combobox/renderer.esm.js +31 -43
  22. package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
  23. package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
  24. package/dist/nile-empty-state/nile-empty-state.css.cjs.js +1 -1
  25. package/dist/nile-empty-state/nile-empty-state.css.cjs.js.map +1 -1
  26. package/dist/nile-empty-state/nile-empty-state.css.esm.js +129 -6
  27. package/dist/nile-empty-state/nile-empty-state.esm.js +45 -31
  28. package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
  29. package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
  30. package/dist/nile-pagination/nile-pagination.esm.js +25 -25
  31. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  32. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  33. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  34. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  35. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  36. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
  37. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  38. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  39. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  40. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  41. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
  42. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  43. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
  44. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  45. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +1 -1
  46. package/dist/src/nile-combobox/nile-combobox.css.js +28 -15
  47. package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
  48. package/dist/src/nile-combobox/nile-combobox.js +49 -10
  49. package/dist/src/nile-combobox/nile-combobox.js.map +1 -1
  50. package/dist/src/nile-combobox/portal-manager.js +2 -22
  51. package/dist/src/nile-combobox/portal-manager.js.map +1 -1
  52. package/dist/src/nile-combobox/renderer.d.ts +2 -3
  53. package/dist/src/nile-combobox/renderer.js +14 -45
  54. package/dist/src/nile-combobox/renderer.js.map +1 -1
  55. package/dist/src/nile-empty-state/nile-empty-state.css.js +127 -4
  56. package/dist/src/nile-empty-state/nile-empty-state.css.js.map +1 -1
  57. package/dist/src/nile-empty-state/nile-empty-state.d.ts +35 -5
  58. package/dist/src/nile-empty-state/nile-empty-state.js +159 -42
  59. package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
  60. package/dist/src/nile-empty-state/nile-empty-state.test.d.ts +1 -0
  61. package/dist/src/nile-empty-state/nile-empty-state.test.js +186 -15
  62. package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
  63. package/dist/src/nile-pagination/nile-pagination.js +5 -5
  64. package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
  65. package/dist/src/version.d.ts +1 -1
  66. package/dist/src/version.js +11 -3
  67. package/dist/src/version.js.map +1 -1
  68. package/dist/tsconfig.tsbuildinfo +1 -1
  69. package/dist/version.cjs.js +1 -1
  70. package/dist/version.cjs.js.map +1 -1
  71. package/dist/version.esm.js +1 -1
  72. package/dist/xml-09119317.cjs.js +2 -0
  73. package/dist/xml-09119317.cjs.js.map +1 -0
  74. package/dist/{xml-25c4108a.esm.js → xml-9bf771b3.esm.js} +1 -1
  75. package/package.json +2 -1
  76. package/scripts/replace-version.cjs +12 -10
  77. package/src/nile-combobox/nile-combobox.css.ts +28 -15
  78. package/src/nile-combobox/nile-combobox.ts +61 -12
  79. package/src/nile-combobox/portal-manager.ts +4 -22
  80. package/src/nile-combobox/renderer.ts +26 -69
  81. package/src/nile-empty-state/nile-empty-state.css.ts +127 -4
  82. package/src/nile-empty-state/nile-empty-state.test.ts +192 -15
  83. package/src/nile-empty-state/nile-empty-state.ts +195 -34
  84. package/src/nile-pagination/nile-pagination.ts +5 -5
  85. package/src/version.ts +11 -2
  86. package/vscode-html-custom-data.json +79 -16
  87. package/dist/xml-90fd974e.cjs.js +0 -2
  88. package/dist/xml-90fd974e.cjs.js.map +0 -1
@@ -1 +1 @@
1
- function e(e){return e&&e.t&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t],o=typeof i;"object"!==o&&"function"!==o||Object.isFrozen(i)||n(i)})),e}class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.scope;class s{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!r(e))return;const n=((e,{prefix:n})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){r(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const c=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class l{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=c({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class a extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}i(e,n){const t=e.root;n&&(t.scope=`language:${n}`),this.add(t)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function g(e){return d("(?=",e,")")}function h(e){return d("(?:",e,")*")}function f(e){return d("(?:",e,")?")}function d(...e){return e.map((e=>u(e))).join("")}function b(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>u(e))).join("|")+")"}function p(e){return new RegExp(e.toString()+"|").exec("").length-1}const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=u(e),o="";for(;i.length>0;){const e=m.exec(i);if(!e){o+=i;break}o+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+n):(o+=e[0],"("===e[0]&&t++)}return o})).map((e=>`(${e})`)).join(n)}const _="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",v="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",y="\\b(0b[01]+)",N={begin:"\\\\[\\s\\S]",relevance:0},j={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},A=function(e,n,t={}){const i=o({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=b("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:d(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},R=A("//","$"),T=A("/\\*","\\*/"),S=A("#","$"),x={scope:"number",begin:O,relevance:0},L={scope:"number",begin:v,relevance:0},D={scope:"number",begin:y,relevance:0},k={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]},H={scope:"title",begin:_,relevance:0},B={scope:"title",begin:w,relevance:0},I={begin:"\\.\\s*"+w,relevance:0};var $=Object.freeze({__proto__:null,APOS_STRING_MODE:j,BACKSLASH_ESCAPE:N,BINARY_NUMBER_MODE:D,BINARY_NUMBER_RE:y,COMMENT:A,C_BLOCK_COMMENT_MODE:T,C_LINE_COMMENT_MODE:R,C_NUMBER_MODE:L,C_NUMBER_RE:v,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:S,IDENT_RE:_,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:I,NUMBER_MODE:x,NUMBER_RE:O,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:M,REGEXP_MODE:k,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=d(n,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},TITLE_MODE:H,UNDERSCORE_IDENT_RE:w,UNDERSCORE_TITLE_MODE:B});function C(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function P(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.o=C,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function z(e,n){Array.isArray(e.illegal)&&(e.illegal=b(...e.illegal))}function X(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function G(e,n){void 0===e.relevance&&(e.relevance=1)}const W=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=d(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},Z=["of","and","for","in","not","or","if","then","parent","list","value"];function F(e,n,t="keyword"){const i=Object.create(null);return"string"==typeof e?o(t,e.split(" ")):Array.isArray(e)?o(t,e):Object.keys(e).forEach((function(t){Object.assign(i,F(e[t],n,t))})),i;function o(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,K(t[0],t[1])]}))}}function K(e,n){return n?Number(n):function(e){return Z.includes(e.toLowerCase())}(e)?0:1}const J={},Y=e=>{console.error(e)},q=(e,...n)=>{console.log(`WARN: ${e}`,...n)},Q=(e,n)=>{J[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),J[`${e}/${n}`]=!0)},V=new Error;function ee(e,n,{key:t}){let i=0;const o=e[t],r={},s={};for(let e=1;e<=n.length;e++)s[e+i]=o[e],r[e+i]=!0,i+=p(n[e-1]);e[t]=s,e[t]._emit=r,e[t]._multi=!0}function ne(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Y("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),V;if("object"!=typeof e.beginScope||null===e.beginScope)throw Y("beginScope must be object"),V;ee(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Y("skip, excludeEnd, returnEnd not compatible with endScope: {}"),V;if("object"!=typeof e.endScope||null===e.endScope)throw Y("endScope must be object"),V;ee(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}}(e)}function te(e){function n(n,t){return new RegExp(u(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(E(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function t(r,s){const c=r;if(r.isCompiled)return c;[P,X,ne,W].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),r.o=null,[U,z,G].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),l=r.keywords.$pattern,delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=F(r.keywords,e.case_insensitive)),c.keywordPatternRe=n(l,!0),s&&(r.begin||(r.begin=/\B|\b/),c.beginRe=n(c.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(c.endRe=n(c.end)),c.terminatorEnd=u(c.end)||"",r.endsWithParent&&s.terminatorEnd&&(c.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(c.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return o(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ie(e))return o(e,{starts:e.starts?o(e.starts):null});if(Object.isFrozen(e))return o(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,c)})),r.starts&&t(r.starts,s),c.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(c),c}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class oe extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const re=i,se=o,ce=Symbol("nomatch"),le=function(e){const i=Object.create(null),o=Object.create(null),r=[];let s=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,l:a};function p(e){return u.noHighlightRe.test(e)}function m(e,n,t){let i="",o="";"object"==typeof n?(i=e,t=n.ignoreIllegals,o=n.language):(Q("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=n),void 0===t&&(t=!0);const r={code:i,language:o};M("before:highlight",r);const s=r.result?r.result:E(r.language,r.code,t);return s.code=r.code,M("after:highlight",s),s}function E(e,n,o,r){const l=Object.create(null);function a(){if(!M.keywords)return void R.addText(T);let e=0;M.keywordPatternRe.lastIndex=0;let n=M.keywordPatternRe.exec(T),t="";for(;n;){t+=T.substring(e,n.index);const o=v.case_insensitive?n[0].toLowerCase():n[0],r=(i=o,M.keywords[i]);if(r){const[e,i]=r;if(R.addText(t),t="",l[o]=(l[o]||0)+1,l[o]<=7&&(S+=i),e.startsWith("_"))t+=n[0];else{const t=v.classNameAliases[e]||e;h(n[0],t)}}else t+=n[0];e=M.keywordPatternRe.lastIndex,n=M.keywordPatternRe.exec(T)}var i;t+=T.substring(e),R.addText(t)}function g(){null!=M.subLanguage?function(){if(""===T)return;let e=null;if("string"==typeof M.subLanguage){if(!i[M.subLanguage])return void R.addText(T);e=E(M.subLanguage,T,!0,A[M.subLanguage]),A[M.subLanguage]=e._top}else e=_(T,M.subLanguage.length?M.subLanguage:null);M.relevance>0&&(S+=e.relevance),R.i(e._emitter,e.language)}():a(),T=""}function h(e,n){""!==e&&(R.startScope(n),R.addText(e),R.endScope())}function f(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=v.classNameAliases[e[t]]||e[t],o=n[t];i?h(o,i):(T=o,a(),T=""),t++}}function d(e,n){return e.scope&&"string"==typeof e.scope&&R.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(T,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),T=""):e.beginScope._multi&&(f(e.beginScope,n),T="")),M=Object.create(e,{parent:{value:M}}),M}function b(e,n,i){let o=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,i);if(o){if(e["on:end"]){const i=new t(e);e["on:end"](n,i),i.isMatchIgnored&&(o=!1)}if(o){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,n,i)}function p(e){return 0===M.matcher.regexIndex?(T+=e[0],1):(D=!0,0)}function m(e){const t=e[0],i=n.substring(e.index),o=b(M,e,i);if(!o)return ce;const r=M;M.endScope&&M.endScope._wrap?(g(),h(t,M.endScope._wrap)):M.endScope&&M.endScope._multi?(g(),f(M.endScope,e)):r.skip?T+=t:(r.returnEnd||r.excludeEnd||(T+=t),g(),r.excludeEnd&&(T=t));do{M.scope&&R.closeNode(),M.skip||M.subLanguage||(S+=M.relevance),M=M.parent}while(M!==o.parent);return o.starts&&d(o.starts,e),r.returnEnd?0:t.length}let w={};function O(i,r){const c=r&&r[0];if(T+=i,null==c)return g(),0;if("begin"===w.type&&"end"===r.type&&w.index===r.index&&""===c){if(T+=n.slice(r.index,r.index+1),!s){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=w.rule,n}return 1}if(w=r,"begin"===r.type)return function(e){const n=e[0],i=e.rule,o=new t(i),r=[i.o,i["on:begin"]];for(const t of r)if(t&&(t(e,o),o.isMatchIgnored))return p(n);return i.skip?T+=n:(i.excludeBegin&&(T+=n),g(),i.returnBegin||i.excludeBegin||(T=n)),d(i,e),i.returnBegin?0:n.length}(r);if("illegal"===r.type&&!o){const e=new Error('Illegal lexeme "'+c+'" for mode "'+(M.scope||"<unnamed>")+'"');throw e.mode=M,e}if("end"===r.type){const e=m(r);if(e!==ce)return e}if("illegal"===r.type&&""===c)return T+="\n",1;if(L>1e5&&L>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return T+=c,c.length}const v=y(e);if(!v)throw Y(c.replace("{}",e)),new Error('Unknown language: "'+e+'"');const N=te(v);let j="",M=r||N;const A={},R=new u.l(u);!function(){const e=[];for(let n=M;n!==v;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>R.openNode(e)))}();let T="",S=0,x=0,L=0,D=!1;try{if(v.u)v.u(n,R);else{for(M.matcher.considerAll();;){L++,D?D=!1:M.matcher.considerAll(),M.matcher.lastIndex=x;const e=M.matcher.exec(n);if(!e)break;const t=O(n.substring(x,e.index),e);x=e.index+t}O(n.substring(x))}return R.finalize(),j=R.toHTML(),{language:e,value:j,relevance:S,illegal:!1,_emitter:R,_top:M}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:re(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:x,context:n.slice(x-100,x+100),mode:t.mode,resultSoFar:j},_emitter:R};if(s)return{language:e,value:re(n),illegal:!1,relevance:0,errorRaised:t,_emitter:R,_top:M};throw t}}function _(e,n){n=n||u.languages||Object.keys(i);const t=function(e){const n={value:re(e),illegal:!1,relevance:0,_top:l,_emitter:new u.l(u)};return n._emitter.addText(e),n}(e),o=n.filter(y).filter(j).map((n=>E(n,e,!1)));o.unshift(t);const r=o.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(y(e.language).supersetOf===n.language)return 1;if(y(n.language).supersetOf===e.language)return-1}return 0})),[s,c]=r,a=s;return a.secondBest=c,a}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=u.languageDetectRe.exec(n);if(t){const n=y(t[1]);return n||(q(c.replace("{}",t[1])),q("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>p(e)||y(e)))}(e);if(p(t))return;if(M("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),u.throwUnescapedHTML)){throw new oe("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,r=t?m(i,{language:t,ignoreIllegals:!0}):_(i);e.innerHTML=r.value,e.dataset.highlighted="yes",function(e,n,t){const i=n&&o[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),M("after:highlightElement",{el:e,result:r,text:i})}let O=!1;function v(){if("loading"===document.readyState)return O||window.addEventListener("DOMContentLoaded",(function(){v()}),!1),void(O=!0);document.querySelectorAll(u.cssSelector).forEach(w)}function y(e){return e=(e||"").toLowerCase(),i[e]||i[o[e]]}function N(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{o[e.toLowerCase()]=n}))}function j(e){const n=y(e);return n&&!n.disableAutodetect}function M(e,n){const t=e;r.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(e,{highlight:m,highlightAuto:_,highlightAll:v,highlightElement:w,highlightBlock:function(e){return Q("10.7.0","highlightBlock will be removed entirely in v12.0"),Q("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){u=se(u,e)},initHighlighting:()=>{v(),Q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){v(),Q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,t){let o=null;try{o=t(e)}catch(e){if(Y("Language definition for '{}' could not be registered.".replace("{}",n)),!s)throw e;Y(e),o=l}o.name||(o.name=n),i[n]=o,o.rawDefinition=t.bind(null,e),o.aliases&&N(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete i[e];for(const n of Object.keys(o))o[n]===e&&delete o[n]},listLanguages:function(){return Object.keys(i)},getLanguage:y,registerAliases:N,autoDetection:j,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),r.push(e)},removePlugin:function(e){const n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.11.1",e.regex={concat:d,lookahead:g,either:b,optional:f,anyNumberOfTimes:h};for(const e in $)"object"==typeof $[e]&&n($[e]);return Object.assign(e,$),e},ae=le({});ae.newInstance=()=>le({});var ue=ae;ae.HighlightJS=ae,ae.default=ae;var ge=e(ue);var he=e((function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,c,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}));export{ge as H,e as g,he as x};
1
+ function e(e){return e&&e.t&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{const i=e[t],o=typeof i;"object"!==o&&"function"!==o||Object.isFrozen(i)||n(i)})),e}class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.scope;class s{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!r(e))return;const n=((e,{prefix:n})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){r(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const c=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class l{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=c({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class a extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}i(e,n){const t=e.root;n&&(t.scope=`language:${n}`),this.add(t)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(e){return e?"string"==typeof e?e:e.source:null}function g(e){return d("(?=",e,")")}function h(e){return d("(?:",e,")*")}function f(e){return d("(?:",e,")?")}function d(...e){return e.map((e=>u(e))).join("")}function b(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>u(e))).join("|")+")"}function p(e){return new RegExp(e.toString()+"|").exec("").length-1}const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let i=u(e),o="";for(;i.length>0;){const e=m.exec(i);if(!e){o+=i;break}o+=i.substring(0,e.index),i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+n):(o+=e[0],"("===e[0]&&t++)}return o})).map((e=>`(${e})`)).join(n)}const _="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",v="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",y="\\b(0b[01]+)",N={begin:"\\\\[\\s\\S]",relevance:0},j={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[N]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[N]},A=function(e,n,t={}){const i=o({scope:"comment",begin:e,end:n,contains:[]},t);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=b("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:d(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},R=A("//","$"),T=A("/\\*","\\*/"),S=A("#","$"),x={scope:"number",begin:O,relevance:0},L={scope:"number",begin:v,relevance:0},D={scope:"number",begin:y,relevance:0},k={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[N,{begin:/\[/,end:/\]/,relevance:0,contains:[N]}]},H={scope:"title",begin:_,relevance:0},B={scope:"title",begin:w,relevance:0},I={begin:"\\.\\s*"+w,relevance:0};var $=Object.freeze({__proto__:null,APOS_STRING_MODE:j,BACKSLASH_ESCAPE:N,BINARY_NUMBER_MODE:D,BINARY_NUMBER_RE:y,COMMENT:A,C_BLOCK_COMMENT_MODE:T,C_LINE_COMMENT_MODE:R,C_NUMBER_MODE:L,C_NUMBER_RE:v,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:S,IDENT_RE:_,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:I,NUMBER_MODE:x,NUMBER_RE:O,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:M,REGEXP_MODE:k,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=d(n,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},TITLE_MODE:H,UNDERSCORE_IDENT_RE:w,UNDERSCORE_TITLE_MODE:B});function C(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function P(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function U(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.o=C,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function z(e,n){Array.isArray(e.illegal)&&(e.illegal=b(...e.illegal))}function X(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function G(e,n){void 0===e.relevance&&(e.relevance=1)}const W=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=d(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},Z=["of","and","for","in","not","or","if","then","parent","list","value"];function F(e,n,t="keyword"){const i=Object.create(null);return"string"==typeof e?o(t,e.split(" ")):Array.isArray(e)?o(t,e):Object.keys(e).forEach((function(t){Object.assign(i,F(e[t],n,t))})),i;function o(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");i[t[0]]=[e,K(t[0],t[1])]}))}}function K(e,n){return n?Number(n):function(e){return Z.includes(e.toLowerCase())}(e)?0:1}const J={},Y=e=>{console.error(e)},q=(e,...n)=>{console.log(`WARN: ${e}`,...n)},Q=(e,n)=>{J[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),J[`${e}/${n}`]=!0)},V=new Error;function ee(e,n,{key:t}){let i=0;const o=e[t],r={},s={};for(let e=1;e<=n.length;e++)s[e+i]=o[e],r[e+i]=!0,i+=p(n[e-1]);e[t]=s,e[t]._emit=r,e[t]._multi=!0}function ne(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Y("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),V;if("object"!=typeof e.beginScope||null===e.beginScope)throw Y("beginScope must be object"),V;ee(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Y("skip, excludeEnd, returnEnd not compatible with endScope: {}"),V;if("object"!=typeof e.endScope||null===e.endScope)throw Y("endScope must be object"),V;ee(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}}(e)}function te(e){function n(n,t){return new RegExp(u(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(E(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),i=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,i)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function t(r,s){const c=r;if(r.isCompiled)return c;[P,X,ne,W].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),r.o=null,[U,z,G].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),l=r.keywords.$pattern,delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=F(r.keywords,e.case_insensitive)),c.keywordPatternRe=n(l,!0),s&&(r.begin||(r.begin=/\B|\b/),c.beginRe=n(c.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(c.endRe=n(c.end)),c.terminatorEnd=u(c.end)||"",r.endsWithParent&&s.terminatorEnd&&(c.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(c.illegalRe=n(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return o(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(ie(e))return o(e,{starts:e.starts?o(e.starts):null});if(Object.isFrozen(e))return o(e);return e}("self"===e?r:e)}))),r.contains.forEach((function(e){t(e,c)})),r.starts&&t(r.starts,s),c.matcher=function(e){const n=new i;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(c),c}(e)}function ie(e){return!!e&&(e.endsWithParent||ie(e.starts))}class oe extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const re=i,se=o,ce=Symbol("nomatch"),le=function(e){const i=Object.create(null),o=Object.create(null),r=[];let s=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,l:a};function p(e){return u.noHighlightRe.test(e)}function m(e,n,t){let i="",o="";"object"==typeof n?(i=e,t=n.ignoreIllegals,o=n.language):(Q("10.7.0","highlight(lang, code, ...args) has been deprecated."),Q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,i=n),void 0===t&&(t=!0);const r={code:i,language:o};M("before:highlight",r);const s=r.result?r.result:E(r.language,r.code,t);return s.code=r.code,M("after:highlight",s),s}function E(e,n,o,r){const l=Object.create(null);function a(){if(!M.keywords)return void R.addText(T);let e=0;M.keywordPatternRe.lastIndex=0;let n=M.keywordPatternRe.exec(T),t="";for(;n;){t+=T.substring(e,n.index);const o=v.case_insensitive?n[0].toLowerCase():n[0],r=(i=o,M.keywords[i]);if(r){const[e,i]=r;if(R.addText(t),t="",l[o]=(l[o]||0)+1,l[o]<=7&&(S+=i),e.startsWith("_"))t+=n[0];else{const t=v.classNameAliases[e]||e;h(n[0],t)}}else t+=n[0];e=M.keywordPatternRe.lastIndex,n=M.keywordPatternRe.exec(T)}var i;t+=T.substring(e),R.addText(t)}function g(){null!=M.subLanguage?function(){if(""===T)return;let e=null;if("string"==typeof M.subLanguage){if(!i[M.subLanguage])return void R.addText(T);e=E(M.subLanguage,T,!0,A[M.subLanguage]),A[M.subLanguage]=e._top}else e=_(T,M.subLanguage.length?M.subLanguage:null);M.relevance>0&&(S+=e.relevance),R.i(e._emitter,e.language)}():a(),T=""}function h(e,n){""!==e&&(R.startScope(n),R.addText(e),R.endScope())}function f(e,n){let t=1;const i=n.length-1;for(;t<=i;){if(!e._emit[t]){t++;continue}const i=v.classNameAliases[e[t]]||e[t],o=n[t];i?h(o,i):(T=o,a(),T=""),t++}}function d(e,n){return e.scope&&"string"==typeof e.scope&&R.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(T,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),T=""):e.beginScope._multi&&(f(e.beginScope,n),T="")),M=Object.create(e,{parent:{value:M}}),M}function b(e,n,i){let o=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,i);if(o){if(e["on:end"]){const i=new t(e);e["on:end"](n,i),i.isMatchIgnored&&(o=!1)}if(o){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,n,i)}function p(e){return 0===M.matcher.regexIndex?(T+=e[0],1):(D=!0,0)}function m(e){const t=e[0],i=n.substring(e.index),o=b(M,e,i);if(!o)return ce;const r=M;M.endScope&&M.endScope._wrap?(g(),h(t,M.endScope._wrap)):M.endScope&&M.endScope._multi?(g(),f(M.endScope,e)):r.skip?T+=t:(r.returnEnd||r.excludeEnd||(T+=t),g(),r.excludeEnd&&(T=t));do{M.scope&&R.closeNode(),M.skip||M.subLanguage||(S+=M.relevance),M=M.parent}while(M!==o.parent);return o.starts&&d(o.starts,e),r.returnEnd?0:t.length}let w={};function O(i,r){const c=r&&r[0];if(T+=i,null==c)return g(),0;if("begin"===w.type&&"end"===r.type&&w.index===r.index&&""===c){if(T+=n.slice(r.index,r.index+1),!s){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=w.rule,n}return 1}if(w=r,"begin"===r.type)return function(e){const n=e[0],i=e.rule,o=new t(i),r=[i.o,i["on:begin"]];for(const t of r)if(t&&(t(e,o),o.isMatchIgnored))return p(n);return i.skip?T+=n:(i.excludeBegin&&(T+=n),g(),i.returnBegin||i.excludeBegin||(T=n)),d(i,e),i.returnBegin?0:n.length}(r);if("illegal"===r.type&&!o){const e=new Error('Illegal lexeme "'+c+'" for mode "'+(M.scope||"<unnamed>")+'"');throw e.mode=M,e}if("end"===r.type){const e=m(r);if(e!==ce)return e}if("illegal"===r.type&&""===c)return r.index===n.length||(T+="\n"),1;if(L>1e5&&L>3*r.index){throw new Error("potential infinite loop, way more iterations than matches")}return T+=c,c.length}const v=y(e);if(!v)throw Y(c.replace("{}",e)),new Error('Unknown language: "'+e+'"');const N=te(v);let j="",M=r||N;const A={},R=new u.l(u);!function(){const e=[];for(let n=M;n!==v;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>R.openNode(e)))}();let T="",S=0,x=0,L=0,D=!1;try{if(v.u)v.u(n,R);else{for(M.matcher.considerAll();;){L++,D?D=!1:M.matcher.considerAll(),M.matcher.lastIndex=x;const e=M.matcher.exec(n);if(!e)break;const t=O(n.substring(x,e.index),e);x=e.index+t}O(n.substring(x))}return R.finalize(),j=R.toHTML(),{language:e,value:j,relevance:S,illegal:!1,_emitter:R,_top:M}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:re(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:x,context:n.slice(x-100,x+100),mode:t.mode,resultSoFar:j},_emitter:R};if(s)return{language:e,value:re(n),illegal:!1,relevance:0,errorRaised:t,_emitter:R,_top:M};throw t}}function _(e,n){n=n||u.languages||Object.keys(i);const t=function(e){const n={value:re(e),illegal:!1,relevance:0,_top:l,_emitter:new u.l(u)};return n._emitter.addText(e),n}(e),o=n.filter(y).filter(j).map((n=>E(n,e,!1)));o.unshift(t);const r=o.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(y(e.language).supersetOf===n.language)return 1;if(y(n.language).supersetOf===e.language)return-1}return 0})),[s,c]=r,a=s;return a.secondBest=c,a}function w(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=u.languageDetectRe.exec(n);if(t){const n=y(t[1]);return n||(q(c.replace("{}",t[1])),q("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>p(e)||y(e)))}(e);if(p(t))return;if(M("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),u.throwUnescapedHTML)){throw new oe("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const i=n.textContent,r=t?m(i,{language:t,ignoreIllegals:!0}):_(i);e.innerHTML=r.value,e.dataset.highlighted="yes",function(e,n,t){const i=n&&o[n]||t;e.classList.add("hljs"),e.classList.add(`language-${i}`)}(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),M("after:highlightElement",{el:e,result:r,text:i})}let O=!1;function v(){if("loading"===document.readyState)return O||window.addEventListener("DOMContentLoaded",(function(){v()}),!1),void(O=!0);document.querySelectorAll(u.cssSelector).forEach(w)}function y(e){return e=(e||"").toLowerCase(),i[e]||i[o[e]]}function N(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{o[e.toLowerCase()]=n}))}function j(e){const n=y(e);return n&&!n.disableAutodetect}function M(e,n){const t=e;r.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(e,{highlight:m,highlightAuto:_,highlightAll:v,highlightElement:w,highlightBlock:function(e){return Q("10.7.0","highlightBlock will be removed entirely in v12.0"),Q("10.7.0","Please use highlightElement now."),w(e)},configure:function(e){u=se(u,e)},initHighlighting:()=>{v(),Q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){v(),Q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,t){let o=null;try{o=t(e)}catch(e){if(Y("Language definition for '{}' could not be registered.".replace("{}",n)),!s)throw e;Y(e),o=l}o.name||(o.name=n),i[n]=o,o.rawDefinition=t.bind(null,e),o.aliases&&N(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete i[e];for(const n of Object.keys(o))o[n]===e&&delete o[n]},listLanguages:function(){return Object.keys(i)},getLanguage:y,registerAliases:N,autoDetection:j,inherit:se,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),r.push(e)},removePlugin:function(e){const n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.11.2",e.regex={concat:d,lookahead:g,either:b,optional:f,anyNumberOfTimes:h};for(const e in $)"object"==typeof $[e]&&n($[e]);return Object.assign(e,$),e},ae=le({});ae.newInstance=()=>le({});var ue=ae;ae.HighlightJS=ae,ae.default=ae;var ge=e(ue);var he=e((function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,c,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,r,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(t,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}));export{ge as H,e as g,he as x};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "2.0.3",
6
+ "version": "2.0.5",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -153,6 +153,7 @@
153
153
  "postinstall": "node postinstall.js"
154
154
  },
155
155
  "dependencies": {
156
+ "@aquera/nile": "^1.3.1",
156
157
  "@codemirror/lang-html": "6.4.9",
157
158
  "@codemirror/lang-javascript": "6.2.1",
158
159
  "@codemirror/lang-json": "^6.0.1",
@@ -1,20 +1,22 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
  const packageJson = require('../package.json');
4
- const nilePackageJson = require('../../nile/package.json');
5
4
 
5
+ // Only this package's own version is substituted at build time.
6
+ // The @aquera/nile version is imported at runtime by src/version.ts, so it must
7
+ // NOT be baked in here - baking it is what made a nile-only publish invisible.
6
8
  const version = packageJson.version;
7
- const nileVersion = nilePackageJson.version;
8
9
  const distDir = path.join(__dirname, '../dist');
9
10
 
10
11
  function replaceVersionInFile(filePath) {
11
12
  try {
12
13
  const content = fs.readFileSync(filePath, 'utf8');
13
-
14
- if (content.includes('__NILE_ELEMENTS_VERSION__') || content.includes('__NILE_VERSION__')) {
15
- let updatedContent = content;
16
- updatedContent = updatedContent.replace(/__NILE_ELEMENTS_VERSION__/g, version);
17
- updatedContent = updatedContent.replace(/__NILE_VERSION__/g, nileVersion);
14
+
15
+ if (content.includes('__NILE_ELEMENTS_VERSION__')) {
16
+ const updatedContent = content.replace(
17
+ /__NILE_ELEMENTS_VERSION__/g,
18
+ version
19
+ );
18
20
  fs.writeFileSync(filePath, updatedContent, 'utf8');
19
21
  }
20
22
  } catch (error) {
@@ -26,13 +28,13 @@ function processDirectory(dir) {
26
28
  if (!fs.existsSync(dir)) {
27
29
  return;
28
30
  }
29
-
31
+
30
32
  const files = fs.readdirSync(dir);
31
-
33
+
32
34
  files.forEach(file => {
33
35
  const filePath = path.join(dir, file);
34
36
  const stat = fs.statSync(filePath);
35
-
37
+
36
38
  if (stat.isDirectory()) {
37
39
  processDirectory(filePath);
38
40
  } else if (file.endsWith('.js') || file.endsWith('.js.map')) {
@@ -350,20 +350,26 @@ export const styles = css`
350
350
  /* ── Listbox (dropdown) ── */
351
351
 
352
352
  .combobox__listbox {
353
- display: block;
353
+ display: flex;
354
+ flex-direction: column;
354
355
  position: relative;
355
356
  font-size: var(--nile-type-scale-3, var(--ng-font-size-text-md));
356
357
  font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
357
358
  background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
358
359
  border: solid 1px var(--nile-colors-neutral-500, var(--ng-colors-border-secondary-alt));
359
360
  border-radius: var(--nile-radius-sm, var(--ng-radius-md));
360
- padding-block: var(--nile-spacing-none, var(--ng-spacing-xs));
361
- padding-inline: var(--nile-spacing-none, var(--ng-spacing-xs));
362
- overscroll-behavior: none;
363
- overflow-y: auto;
361
+ padding: 0;
364
362
  max-width: var(--auto-size-available-width);
365
363
  max-height: var(--auto-size-available-height);
366
364
  box-shadow: 0px 2px 4px 0px rgba(119, 125, 130, 0.15);
365
+ overflow: hidden; /* Scrolling is handled by .combobox__options-scroll below */
366
+ box-sizing: border-box;
367
+ }
368
+
369
+ .combobox__options-scroll {
370
+ overflow-y: auto;
371
+ flex: 0 1 auto;
372
+ min-height: 0;
367
373
  }
368
374
 
369
375
  /* ── Options ── */
@@ -371,7 +377,11 @@ export const styles = css`
371
377
  .combobox__options {
372
378
  font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
373
379
  color: rgb(133, 129, 129);
380
+ display: block;
381
+ position: relative;
374
382
  width: 100%;
383
+ padding-bottom: 0;
384
+ box-sizing: border-box;
375
385
  }
376
386
 
377
387
  .combobox__options.loading {
@@ -425,9 +435,6 @@ export const styles = css`
425
435
  /* ── Top actions (Select All + Selected/All filter toggle) ── */
426
436
 
427
437
  .combobox__top-actions {
428
- position: sticky;
429
- top: 0;
430
- z-index: 2;
431
438
  display: flex;
432
439
  flex-direction: row;
433
440
  align-items: center;
@@ -482,16 +489,15 @@ export const styles = css`
482
489
  /* ── Footer ── */
483
490
 
484
491
  .combobox__footer {
485
- position: sticky;
486
- bottom: 0;
492
+ flex-shrink: 0;
487
493
  background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
488
494
  border-top: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
489
495
  display: flex;
490
496
  flex-direction: row;
491
- align-items: flex-start;
492
- padding: var(--nile-spacing-md, var(--ng-spacing-md)) var(--nile-spacing-lg, var(--ng-spacing-lg)) var(--nile-spacing-xl, var(--ng-spacing-xl));
493
- gap: var(--nile-spacing-lg, var(--ng-spacing-lg));
497
+ align-items: center;
494
498
  justify-content: space-between;
499
+ padding: var(--nile-spacing-md, 8px) var(--nile-spacing-lg, 12px);
500
+ margin-top: 0;
495
501
  }
496
502
 
497
503
  .combobox__footer.loading {
@@ -549,7 +555,7 @@ export const styles = css`
549
555
 
550
556
  /* ── Grid layout ── */
551
557
 
552
- :host([grid-columns]) .combobox__listbox {
558
+ :host([grid-columns]) .combobox__options-scroll {
553
559
  overflow-y: auto;
554
560
  }
555
561
 
@@ -569,8 +575,11 @@ export const styles = css`
569
575
  /* ── Bidirectional grid layout (vertical + horizontal scroll) ── */
570
576
 
571
577
  .combobox__listbox.combobox__listbox--bidirectional {
572
- overflow: auto;
573
578
  max-width: none;
579
+ }
580
+
581
+ .combobox__listbox--bidirectional .combobox__options-scroll {
582
+ overflow: auto;
574
583
  scrollbar-width: thin;
575
584
  scrollbar-color: var(--nile-colors-neutral-500, var(--ng-colors-bg-quaternary)) transparent;
576
585
  }
@@ -654,6 +663,8 @@ export const styles = css`
654
663
  * header (computed on scroll). */
655
664
  .combobox__group-header-slot {
656
665
  pointer-events: none;
666
+ z-index: 3;
667
+ background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
657
668
  }
658
669
  .combobox__group-header-slot .combobox__group-header {
659
670
  height: 100%;
@@ -665,6 +676,8 @@ export const styles = css`
665
676
  top: 0;
666
677
  z-index: 2;
667
678
  pointer-events: none;
679
+ height: 32px;
680
+ overflow: hidden;
668
681
  }
669
682
  .combobox__group-sticky-overlay .combobox__group-header {
670
683
  box-shadow: 0 1px 0 0 var(--nile-colors-neutral-300, var(--ng-colors-border-secondary));
@@ -976,10 +976,10 @@ export class NileCombobox extends NileElement implements NileFormControl {
976
976
  private onOptionClick(event: MouseEvent): void {
977
977
  // Use composedPath to find nile-option across shadow boundaries
978
978
  const path = event.composedPath();
979
- const option = path.find((el: EventTarget) =>
979
+ const option = path.find((el: EventTarget) =>
980
980
  (el as HTMLElement).tagName === 'NILE-OPTION'
981
981
  ) as any;
982
-
982
+
983
983
  if (!option || option.disabled) return;
984
984
  this.handleOptionSelection(option.value);
985
985
  }
@@ -1176,8 +1176,51 @@ export class NileCombobox extends NileElement implements NileFormControl {
1176
1176
 
1177
1177
  this.popup.active = true;
1178
1178
 
1179
- await new Promise(r => requestAnimationFrame(r));
1180
- await new Promise(r => requestAnimationFrame(r));
1179
+ // Wait for Lit to render the listbox and attach scrollElementRef.
1180
+ await this.updateComplete;
1181
+
1182
+ const scrollEl = this.isHorizontalGrid
1183
+ ? this.hScrollElementRef.value
1184
+ : this.scrollElementRef.value;
1185
+
1186
+ await new Promise<void>(resolve => {
1187
+ let attempts = 0;
1188
+ const maxAttempts = 10;
1189
+
1190
+ const check = () => {
1191
+ attempts++;
1192
+ const hasSize = this.isHorizontalGrid
1193
+ ? (scrollEl?.offsetWidth ?? 0) > 0
1194
+ : (scrollEl?.offsetHeight ?? 0) > 0;
1195
+
1196
+ if (hasSize || attempts >= maxAttempts) {
1197
+ resolve();
1198
+ } else {
1199
+ requestAnimationFrame(check);
1200
+ }
1201
+ };
1202
+
1203
+ requestAnimationFrame(check);
1204
+ });
1205
+
1206
+ if (this.isHorizontalGrid) {
1207
+ const hVirtualizer = this.hVirtualizerCtrl.getVirtualizer();
1208
+
1209
+ hVirtualizer.scrollOffset = 0;
1210
+ hVirtualizer.measure();
1211
+ } else {
1212
+ const virtualizer = this.virtualizerCtrl.getVirtualizer();
1213
+
1214
+ virtualizer.scrollOffset = 0;
1215
+ virtualizer.measure();
1216
+ }
1217
+
1218
+ this.requestUpdate();
1219
+ await this.updateComplete;
1220
+
1221
+ await new Promise<void>(resolve => {
1222
+ requestAnimationFrame(() => resolve());
1223
+ });
1181
1224
 
1182
1225
  if (this.popup?.popup) {
1183
1226
  this.popup.popup.style.visibility = '';
@@ -1185,8 +1228,8 @@ export class NileCombobox extends NileElement implements NileFormControl {
1185
1228
 
1186
1229
  const { keyframes, options } = getAnimation(this, 'combobox.show', { dir: 'ltr' });
1187
1230
  await animateTo(this.popup.popup, keyframes, options);
1188
-
1189
1231
  this.resetScrollPosition();
1232
+
1190
1233
  this.emit('nile-after-show', { value: this.value, name: this.name });
1191
1234
  }
1192
1235
 
@@ -1301,6 +1344,7 @@ export class NileCombobox extends NileElement implements NileFormControl {
1301
1344
  }
1302
1345
 
1303
1346
  private async resetScrollPosition(): Promise<void> {
1347
+ this.stickyHeaderIndex = -1;
1304
1348
  await this.portalManager.resetScrollPosition();
1305
1349
  }
1306
1350
 
@@ -1507,8 +1551,8 @@ export class NileCombobox extends NileElement implements NileFormControl {
1507
1551
  `;
1508
1552
  }
1509
1553
 
1510
- private renderStickyHeaderOverlay(grouped: boolean, useVirtual: boolean): TemplateResult {
1511
- if (!this.stickyGroupHeader || !grouped || !useVirtual) return html``;
1554
+ private renderStickyHeaderOverlay(): TemplateResult {
1555
+ if (!this.stickyGroupHeader) return html``;
1512
1556
  const idx = this.stickyHeaderIndex;
1513
1557
  if (idx < 0 || idx >= this.filteredRows.length) return html``;
1514
1558
  const row = this.filteredRows[idx];
@@ -1556,13 +1600,15 @@ export class NileCombobox extends NileElement implements NileFormControl {
1556
1600
  class="combobox__listbox ${this.isBidirectionalGrid ? 'combobox__listbox--bidirectional' : ''} ${this.portal ? 'combobox__portal-hidden' : ''}"
1557
1601
  tabindex="-1"
1558
1602
  @mouseup=${this.onOptionClick}
1559
- @scroll=${this.onScroll}
1560
1603
  style="${this.portal ? 'display: none;' : ''}${this.isBidirectionalGrid ? `max-height:${this.gridRows * 38 + 16}px;` : ''}"
1561
- ${ref(this.scrollElementRef)}
1562
1604
  >
1563
- ${this.renderLoader()}
1564
1605
  ${this.renderSelectAll()}
1565
- ${this.renderStickyHeaderOverlay(grouped, useVirtual)}
1606
+ <div
1607
+ class="combobox__options-scroll"
1608
+ @scroll=${this.onScroll}
1609
+ ${ref(this.scrollElementRef)}
1610
+ >
1611
+ ${this.renderLoader()}
1566
1612
  ${this.showNoResults && !this.optionsLoading && !this.loading
1567
1613
  ? this.renderEmptyState()
1568
1614
  : isGrid
@@ -1597,6 +1643,9 @@ export class NileCombobox extends NileElement implements NileFormControl {
1597
1643
  this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined,
1598
1644
  this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined,
1599
1645
  this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined,
1646
+ undefined,
1647
+ this.renderStickyHeaderOverlay(),
1648
+ this.stickyGroupHeader ? this.stickyHeaderIndex : -1,
1600
1649
  )
1601
1650
  : ComboboxRenderer.renderRowsPlain(
1602
1651
  this.filteredRows,
@@ -1626,7 +1675,6 @@ export class NileCombobox extends NileElement implements NileFormControl {
1626
1675
  this.getItemValue.bind(this),
1627
1676
  this.optionsLoading || this.loading,
1628
1677
  this.allowHtmlLabel,
1629
- virtualizer.measureElement,
1630
1678
  this.renderItemConfig?.getDescription ? this.getItemDescription.bind(this) : undefined,
1631
1679
  this.renderItemConfig?.getPrefix ? this.getItemPrefix.bind(this) : undefined,
1632
1680
  this.renderItemConfig?.getSuffix ? this.getItemSuffix.bind(this) : undefined,
@@ -1654,6 +1702,7 @@ export class NileCombobox extends NileElement implements NileFormControl {
1654
1702
  ${ComboboxRenderer.renderAddCustomOption(this.searchValue.trim(), this.multiple)}
1655
1703
  </div>
1656
1704
  ` : ''}
1705
+ </div>
1657
1706
  ${this.multiple && this.showFooter && !this.selectAllEnabled ? this.renderFooter() : ''}
1658
1707
  </div>
1659
1708
  `;
@@ -235,29 +235,11 @@ export class ComboboxPortalManager {
235
235
  }
236
236
 
237
237
  if (!listbox || !listbox.isConnected) return;
238
- listbox.scrollTop = 0;
239
-
240
- const virtualized = listbox.querySelector('.virtualized') as HTMLElement;
241
- if (virtualized && virtualized.isConnected) {
242
- const fewItems = this.component.filteredData?.length < 5;
243
- if (fewItems) {
244
- virtualized.style.overflowY = 'hidden';
245
- virtualized.style.maxHeight = 'none';
246
- listbox.style.overflowY = 'hidden';
247
- listbox.style.maxHeight = 'fit-content';
248
- } else {
249
- virtualized.style.overflowY = 'auto';
250
- virtualized.style.maxHeight = '';
251
- listbox.style.overflowY = 'auto';
252
- listbox.style.maxHeight = '';
253
- }
254
- virtualized.scrollTop = 0;
255
- }
256
238
 
257
- const virtualizer = listbox.querySelector('lit-virtualizer') as HTMLElement;
258
- if (virtualizer && virtualizer.isConnected) {
259
- virtualizer.scrollTop = 0;
260
- }
239
+ const scroller = listbox.querySelector(
240
+ '.combobox__options-scroll',
241
+ ) as HTMLElement | null;
242
+ (scroller ?? listbox).scrollTop = 0;
261
243
  });
262
244
  }
263
245
  }
@@ -91,6 +91,8 @@ export class ComboboxRenderer {
91
91
  getItemPrefix?: (item: any) => string,
92
92
  getItemSuffix?: (item: any) => string,
93
93
  enableDescription?: boolean,
94
+ stickyOverlay?: TemplateResult,
95
+ stickyIndex = -1,
94
96
  ): TemplateResult {
95
97
  return html`
96
98
  <div
@@ -98,6 +100,7 @@ export class ComboboxRenderer {
98
100
  class="combobox__options ${isLoading ? 'loading' : ''}"
99
101
  >
100
102
  <div style="position:relative;height:${totalSize}px;width:100%;">
103
+ ${stickyOverlay ?? ''}
101
104
  ${repeat(
102
105
  virtualItems,
103
106
  (vItem) => vItem.key,
@@ -109,8 +112,10 @@ export class ComboboxRenderer {
109
112
  `transform:translateY(${vItem.start}px);` +
110
113
  `height:${vItem.size}px;`;
111
114
  if (row.kind === 'header') {
115
+ const headerStyle =
116
+ vItem.index === stickyIndex ? `${posStyle}visibility:hidden;` : posStyle;
112
117
  return html`
113
- <div style=${posStyle} class="combobox__group-header-slot">
118
+ <div style=${headerStyle} class="combobox__group-header-slot">
114
119
  ${ComboboxRenderer.renderGroupHeader(row)}
115
120
  </div>
116
121
  `;
@@ -141,34 +146,37 @@ export class ComboboxRenderer {
141
146
  getItemValue: (item: any) => string,
142
147
  isLoading: boolean,
143
148
  allowHtmlLabel: boolean,
144
- measureElement: (el: Element | null) => void,
145
149
  getItemDescription?: (item: any) => string,
146
150
  getItemPrefix?: (item: any) => string,
147
151
  getItemSuffix?: (item: any) => string,
148
152
  enableDescription?: boolean,
149
153
  ): TemplateResult {
150
- const offsetTop = virtualItems.length > 0 ? virtualItems[0].start : 0;
151
-
152
154
  return html`
153
155
  <div
154
156
  part="select-options"
155
157
  class="combobox__options ${isLoading ? 'loading' : ''}"
156
158
  >
157
159
  <div style="position:relative;height:${totalSize}px;width:100%;">
158
- <div style="position:absolute;top:0;left:0;width:100%;transform:translateY(${offsetTop}px);">
159
- ${repeat(
160
- virtualItems,
161
- (vItem) => vItem.key,
162
- (vItem) => {
163
- const item = data[vItem.index];
164
- return ComboboxRenderer.renderMeasuredItem(
165
- item, vItem.index, value, multiple, getDisplayText, getItemValue,
166
- allowHtmlLabel, getItemDescription, getItemPrefix,
167
- getItemSuffix, enableDescription,
168
- );
169
- },
170
- )}
171
- </div>
160
+ ${repeat(
161
+ virtualItems,
162
+ (vItem) => vItem.key,
163
+ (vItem) => {
164
+ const item = data[vItem.index];
165
+ const posStyle =
166
+ `position:absolute;top:0;left:0;right:0;` +
167
+ `transform:translateY(${vItem.start}px);` +
168
+ `height:${vItem.size}px;`;
169
+ return html`
170
+ <div style=${posStyle}>
171
+ ${ComboboxRenderer.renderItem(
172
+ item, value, multiple, getDisplayText, getItemValue,
173
+ allowHtmlLabel, getItemDescription, getItemPrefix,
174
+ getItemSuffix, enableDescription,
175
+ )}
176
+ </div>
177
+ `;
178
+ },
179
+ )}
172
180
  </div>
173
181
  </div>
174
182
  `;
@@ -240,57 +248,6 @@ export class ComboboxRenderer {
240
248
  `;
241
249
  }
242
250
 
243
- private static renderMeasuredItem(
244
- item: any,
245
- index: number,
246
- value: string | string[],
247
- multiple: boolean,
248
- getDisplayText: (item: any) => string,
249
- getItemValue: (item: any) => string,
250
- allowHtmlLabel: boolean,
251
- getItemDescription?: (item: any) => string,
252
- getItemPrefix?: (item: any) => string,
253
- getItemSuffix?: (item: any) => string,
254
- enableDescription?: boolean,
255
- ): TemplateResult {
256
- if (!item) return html``;
257
-
258
- const optionValue = getItemValue(item);
259
- const displayText = getDisplayText(item);
260
- const isDisabled = item?.disabled || false;
261
- const className = item?.className;
262
- const description = getItemDescription ? getItemDescription(item) : (item?.description ?? '');
263
- const prefix = getItemPrefix ? getItemPrefix(item) : (item?.prefix ?? '');
264
- const suffix = getItemSuffix ? getItemSuffix(item) : (item?.suffix ?? '');
265
-
266
- let isSelected = false;
267
- if (multiple) {
268
- isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));
269
- } else {
270
- isSelected = String(Array.isArray(value) ? value[0] : value) === String(optionValue);
271
- }
272
-
273
- return html`
274
- <nile-option
275
- data-index=${index}
276
- value=${optionValue}
277
- .selected=${isSelected}
278
- .disabled=${isDisabled}
279
- .showCheckbox=${multiple}
280
- class=${classMap({
281
- option: enableDescription ?? false,
282
- [className ?? '']: !!className,
283
- })}
284
- .description=${description}
285
- .isDescriptionEnabled=${enableDescription}
286
- >
287
- ${unsafeHTML(prefix)}
288
- ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}
289
- ${unsafeHTML(suffix)}
290
- </nile-option>
291
- `;
292
- }
293
-
294
251
  static renderItem(
295
252
  item: any,
296
253
  value: string | string[],