@files-preview-app/preview-file 1.3.9 → 1.3.10

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/angular.cjs CHANGED
@@ -4854,6 +4854,36 @@ var CodePlugin = class {
4854
4854
  pre.style.transition = "transform 0.15s ease";
4855
4855
  pre.style.flexShrink = "0";
4856
4856
  } else {
4857
+ if (typeof document !== "undefined" && !document.getElementById("fp-code-syntax-styles")) {
4858
+ const style = document.createElement("style");
4859
+ style.id = "fp-code-syntax-styles";
4860
+ style.textContent = `
4861
+ .fp-code-scroll-wrapper .hljs-keyword { color: #569cd6; font-weight: normal; }
4862
+ .fp-code-scroll-wrapper .hljs-built_in { color: #4ec9b0; }
4863
+ .fp-code-scroll-wrapper .hljs-type { color: #4ec9b0; }
4864
+ .fp-code-scroll-wrapper .hljs-literal { color: #569cd6; }
4865
+ .fp-code-scroll-wrapper .hljs-number { color: #b5cea8; }
4866
+ .fp-code-scroll-wrapper .hljs-regexp { color: #d16969; }
4867
+ .fp-code-scroll-wrapper .hljs-string { color: #ce9178; }
4868
+ .fp-code-scroll-wrapper .hljs-subst { color: #d4d4d4; }
4869
+ .fp-code-scroll-wrapper .hljs-symbol { color: #569cd6; }
4870
+ .fp-code-scroll-wrapper .hljs-class { color: #4ec9b0; }
4871
+ .fp-code-scroll-wrapper .hljs-function { color: #dcdcaa; }
4872
+ .fp-code-scroll-wrapper .hljs-title { color: #dcdcaa; }
4873
+ .fp-code-scroll-wrapper .hljs-params { color: #9cdcfe; }
4874
+ .fp-code-scroll-wrapper .hljs-comment { color: #6a9955; font-style: italic; }
4875
+ .fp-code-scroll-wrapper .hljs-doctag { color: #608b4e; }
4876
+ .fp-code-scroll-wrapper .hljs-meta { color: #9cdcfe; }
4877
+ .fp-code-scroll-wrapper .hljs-section { color: #569cd6; }
4878
+ .fp-code-scroll-wrapper .hljs-tag { color: #569cd6; }
4879
+ .fp-code-scroll-wrapper .hljs-name { color: #569cd6; }
4880
+ .fp-code-scroll-wrapper .hljs-attr { color: #9cdcfe; }
4881
+ .fp-code-scroll-wrapper .hljs-attribute { color: #9cdcfe; }
4882
+ .fp-code-scroll-wrapper .hljs-variable { color: #9cdcfe; }
4883
+ .fp-code-scroll-wrapper .hljs-punctuation { color: #d4d4d4; }
4884
+ `;
4885
+ document.head.appendChild(style);
4886
+ }
4857
4887
  ctx.container.style.backgroundColor = "#1e1e1e";
4858
4888
  ctx.container.style.color = "#d4d4d4";
4859
4889
  scrollWrapper.className = "fp-code-scroll-wrapper";
@@ -4863,9 +4893,13 @@ var CodePlugin = class {
4863
4893
  scrollWrapper.style.height = "max-content";
4864
4894
  scrollWrapper.style.display = "flex";
4865
4895
  scrollWrapper.style.alignItems = "flex-start";
4866
- scrollWrapper.style.padding = "16px";
4896
+ scrollWrapper.style.padding = "16px 16px 16px 0";
4867
4897
  scrollWrapper.style.boxSizing = "border-box";
4868
- const lineCount = fullText.split(/\r?\n/).length || 1;
4898
+ const rawLines = fullText.split(/\r?\n/);
4899
+ if (rawLines.length > 1 && rawLines[rawLines.length - 1] === "") {
4900
+ rawLines.pop();
4901
+ }
4902
+ const lineCount = Math.max(1, rawLines.length);
4869
4903
  const gutterLines = [];
4870
4904
  for (let i = 1; i <= lineCount; i++) {
4871
4905
  gutterLines.push(String(i));
@@ -4873,16 +4907,23 @@ var CodePlugin = class {
4873
4907
  lineGutter.className = "fp-code-gutter";
4874
4908
  lineGutter.style.userSelect = "none";
4875
4909
  lineGutter.style.textAlign = "right";
4876
- lineGutter.style.paddingRight = "16px";
4877
- lineGutter.style.marginRight = "16px";
4910
+ lineGutter.style.padding = "0 16px";
4911
+ lineGutter.style.margin = "0 16px 0 0";
4878
4912
  lineGutter.style.borderRight = "1px solid #333333";
4879
4913
  lineGutter.style.color = "#858585";
4880
4914
  lineGutter.style.fontFamily = "Consolas, Menlo, Monaco, 'Courier New', monospace";
4881
4915
  lineGutter.style.fontSize = `${fontSize}px`;
4882
4916
  lineGutter.style.lineHeight = "1.6";
4917
+ lineGutter.style.whiteSpace = "pre";
4883
4918
  lineGutter.style.flexShrink = "0";
4919
+ lineGutter.style.position = "sticky";
4920
+ lineGutter.style.left = "0";
4921
+ lineGutter.style.backgroundColor = "#1e1e1e";
4922
+ lineGutter.style.zIndex = "2";
4923
+ lineGutter.style.boxSizing = "border-box";
4884
4924
  lineGutter.textContent = gutterLines.join("\n");
4885
4925
  pre.style.margin = "0";
4926
+ pre.style.padding = "0 16px 0 0";
4886
4927
  pre.style.fontFamily = "Consolas, Menlo, Monaco, 'Courier New', monospace";
4887
4928
  pre.style.fontSize = `${fontSize}px`;
4888
4929
  pre.style.lineHeight = "1.6";
@@ -4890,6 +4931,11 @@ var CodePlugin = class {
4890
4931
  pre.style.wordBreak = "normal";
4891
4932
  pre.style.overflowWrap = "normal";
4892
4933
  pre.style.flex = "1";
4934
+ code.style.display = "block";
4935
+ code.style.fontFamily = "inherit";
4936
+ code.style.fontSize = "inherit";
4937
+ code.style.lineHeight = "inherit";
4938
+ code.style.whiteSpace = "inherit";
4893
4939
  }
4894
4940
  const ext = (ctx.metadata.extension || "").replace(".", "");
4895
4941
  const renderCodePage = (text) => {