@xiee/utils 1.14.139 → 1.14.140

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.
@@ -1,7 +1,15 @@
1
+ /* the gutter is the left padding of the code block, and each number is pulled
2
+ back into it by a negative margin, so wrapped lines start to the right of the
3
+ gutter (--ln-w is the number of digits, set in code-line-numbers.js) */
4
+ code.line-numbers {
5
+ --ln-gutter: calc(var(--ln-w, 3) * 1ch + 1.5em + 1px);
6
+ display: block;
7
+ padding-left: var(--ln-gutter);
8
+ }
1
9
  span[data-line-number]::before {
2
10
  content: attr(data-line-number);
3
11
  padding-right: .5em;
4
- margin-right: 1em;
12
+ margin: 0 1em 0 calc(-1 * var(--ln-gutter));
5
13
  display: inline-block;
6
14
  border-right: solid 1px;
7
15
  color: #ccc;
@@ -1,2 +1,2 @@
1
- span[data-line-number]:before{content:attr(data-line-number);color:#ccc;border-right:1px solid;margin-right:1em;padding-right:.5em;display:inline-block}
1
+ code.line-numbers{--ln-gutter:calc(var(--ln-w,3) * 1ch + 1.5em + 1px);padding-left:var(--ln-gutter);display:block}span[data-line-number]:before{content:attr(data-line-number);margin:0 1em 0 calc(-1 * var(--ln-gutter));color:#ccc;border-right:1px solid;padding-right:.5em;display:inline-block}
2
2
  /*# sourceMappingURL=code-line-numbers.min.css.map */
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA","sources":["code-line-numbers.css"],"sourcesContent":["span[data-line-number]::before {\n content: attr(data-line-number);\n padding-right: .5em;\n margin-right: 1em;\n display: inline-block;\n border-right: solid 1px;\n color: #ccc;\n}\n"],"names":[]}
1
+ {"version":3,"mappings":"AAGA,kHAKA","sources":["code-line-numbers.css"],"sourcesContent":["/* the gutter is the left padding of the code block, and each number is pulled\n back into it by a negative margin, so wrapped lines start to the right of the\n gutter (--ln-w is the number of digits, set in code-line-numbers.js) */\ncode.line-numbers {\n --ln-gutter: calc(var(--ln-w, 3) * 1ch + 1.5em + 1px);\n display: block;\n padding-left: var(--ln-gutter);\n}\nspan[data-line-number]::before {\n content: attr(data-line-number);\n padding-right: .5em;\n margin: 0 1em 0 calc(-1 * var(--ln-gutter));\n display: inline-block;\n border-right: solid 1px;\n color: #ccc;\n}\n"],"names":[]}
@@ -11,6 +11,7 @@
11
11
  if (d > 0) n = '0'.repeat(d) + n;
12
12
  sp.dataset.lineNumber = n;
13
13
  });
14
+ el.style.setProperty('--ln-w', w); // for the gutter width in CSS
14
15
  }
15
16
  addEventListener('load', e => document.querySelectorAll('pre > code.line-numbers:first-child').forEach(addNum));
16
17
  })();
@@ -1,2 +1,2 @@
1
- (()=>{function e(e){const n='<span data-line-number=""></span>',t="span[data-line-number]";if(e.querySelector(t))return;e.innerHTML=n+e.innerHTML.replace(/\n(?=.|\s)/g,"\n"+n);let r=+e.dataset.start;isNaN(r)&&(r=1);const a=e.querySelectorAll(t),l=(""+(r-1+a.length)).length;a.forEach(e=>{let n=""+r++,t=l-n.length;t>0&&(n="0".repeat(t)+n),e.dataset.lineNumber=n})}addEventListener("load",n=>document.querySelectorAll("pre > code.line-numbers:first-child").forEach(e))})();
1
+ (()=>{function e(e){const n='<span data-line-number=""></span>',t="span[data-line-number]";if(e.querySelector(t))return;e.innerHTML=n+e.innerHTML.replace(/\n(?=.|\s)/g,"\n"+n);let r=+e.dataset.start;isNaN(r)&&(r=1);const l=e.querySelectorAll(t),a=(""+(r-1+l.length)).length;l.forEach(e=>{let n=""+r++,t=a-n.length;t>0&&(n="0".repeat(t)+n),e.dataset.lineNumber=n}),e.style.setProperty("--ln-w",a)}addEventListener("load",n=>document.querySelectorAll("pre > code.line-numbers:first-child").forEach(e))})();
2
2
  //# sourceMappingURL=code-line-numbers.min.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["addNum","el","s","sel","querySelector","innerHTML","replace","n1","dataset","start","isNaN","spans","querySelectorAll","w","length","forEach","sp","n","d","repeat","lineNumber","addEventListener","e","document"],"sources":["code-line-numbers.js"],"mappings":"AACA,MACE,SAASA,EAAOC,GACd,MAAMC,EAAI,oCAAqCC,EAAM,yBACrD,GAAIF,EAAGG,cAAcD,GAAM,OAC3BF,EAAGI,UAAYH,EAAID,EAAGI,UAAUC,QAAQ,cAAe,KAAOJ,GAC9D,IAAIK,GAAMN,EAAGO,QAAQC,MAAWC,MAAMH,KAAKA,EAAK,GAChD,MAAMI,EAAQV,EAAGW,iBAAiBT,GAAMU,GAAK,IAAMN,EAAK,EAAII,EAAMG,SAASA,OAC3EH,EAAMI,QAAQC,IACZ,IAAIC,EAAI,GAAMV,IAAOW,EAAIL,EAAII,EAAEH,OAC3BI,EAAI,IAAGD,EAAI,IAAIE,OAAOD,GAAKD,GAC/BD,EAAGR,QAAQY,WAAaH,GAE5B,CACAI,iBAAiB,OAAQC,GAAKC,SAASX,iBAAiB,uCAAuCG,QAAQf,GACxG,EAdD","ignoreList":[]}
1
+ {"version":3,"names":["addNum","el","s","sel","querySelector","innerHTML","replace","n1","dataset","start","isNaN","spans","querySelectorAll","w","length","forEach","sp","n","d","repeat","lineNumber","style","setProperty","addEventListener","e","document"],"sources":["code-line-numbers.js"],"mappings":"AACA,MACE,SAASA,EAAOC,GACd,MAAMC,EAAI,oCAAqCC,EAAM,yBACrD,GAAIF,EAAGG,cAAcD,GAAM,OAC3BF,EAAGI,UAAYH,EAAID,EAAGI,UAAUC,QAAQ,cAAe,KAAOJ,GAC9D,IAAIK,GAAMN,EAAGO,QAAQC,MAAWC,MAAMH,KAAKA,EAAK,GAChD,MAAMI,EAAQV,EAAGW,iBAAiBT,GAAMU,GAAK,IAAMN,EAAK,EAAII,EAAMG,SAASA,OAC3EH,EAAMI,QAAQC,IACZ,IAAIC,EAAI,GAAMV,IAAOW,EAAIL,EAAII,EAAEH,OAC3BI,EAAI,IAAGD,EAAI,IAAIE,OAAOD,GAAKD,GAC/BD,EAAGR,QAAQY,WAAaH,IAE1BhB,EAAGoB,MAAMC,YAAY,SAAUT,EACjC,CACAU,iBAAiB,OAAQC,GAAKC,SAASb,iBAAiB,uCAAuCG,QAAQf,GACxG,EAfD","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.14.139",
3
+ "version": "1.14.140",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "playwright test"