@forsakringskassan/docs-generator 2.37.1 → 2.38.0

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.
@@ -2,7 +2,7 @@ import { createRequire as $createRequire } from "node:module";
2
2
 
3
3
  const require = $createRequire(import.meta.url);
4
4
 
5
- import { r as runAsWorker, f as format2, a as resolveConfig } from './vendor-Bk5vSW_n.mjs';
5
+ import { r as runAsWorker, f as format2, a as resolveConfig } from './vendor-DV7BHNMM.mjs';
6
6
  import 'node:url';
7
7
  import 'node:path';
8
8
  import 'fs';
@@ -55,4 +55,4 @@ async function formatCode(source, filepath) {
55
55
  runAsWorker(formatCode);
56
56
 
57
57
  export { formatCode };
58
- //# sourceMappingURL=format-code.worker-CRcs4_Zl.mjs.map
58
+ //# sourceMappingURL=format-code.worker-DpigILeN.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-code.worker-CRcs4_Zl.mjs","sources":["../src/utils/format-code.worker.ts"],"sourcesContent":["import { type Options, format as prettier, resolveConfig } from \"prettier\";\nimport { runAsWorker } from \"synckit\";\n\nconst configCache = new Map<string, Options | null>();\n\nasync function getConfig(filepath: string): Promise<Options | null> {\n const cached = configCache.get(filepath);\n if (typeof cached !== \"undefined\") {\n return cached;\n }\n const options = await resolveConfig(filepath);\n configCache.set(filepath, options);\n return options;\n}\n\n/**\n * @internal\n */\nexport async function formatCode(\n source: string,\n filepath: string,\n): Promise<string> {\n const options = await getConfig(filepath);\n const formatted = await prettier(source, { ...options, filepath });\n return formatted.trim();\n}\n\nrunAsWorker(formatCode);\n"],"names":["prettier"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,WAAA,uBAAkB,GAAA,EAA4B;AAEpD,eAAe,UAAU,QAAA,EAA2C;AAChE,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,GAAA,CAAI,QAAQ,CAAA;AACvC,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAC/B,IAAA,OAAO,MAAA;AAAA,EACX;AACA,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,CAAc,QAAQ,CAAA;AAC5C,EAAA,WAAA,CAAY,GAAA,CAAI,UAAU,OAAO,CAAA;AACjC,EAAA,OAAO,OAAA;AACX;AAKA,eAAsB,UAAA,CAClB,QACA,QAAA,EACe;AACf,EAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,QAAQ,CAAA;AACxC,EAAA,MAAM,SAAA,GAAY,MAAMA,OAAA,CAAS,MAAA,EAAQ,EAAE,GAAG,OAAA,EAAS,UAAU,CAAA;AACjE,EAAA,OAAO,UAAU,IAAA,EAAK;AAC1B;AAEA,WAAA,CAAY,UAAU,CAAA;;;;"}
1
+ {"version":3,"file":"format-code.worker-DpigILeN.mjs","sources":["../src/utils/format-code.worker.ts"],"sourcesContent":["import { type Options, format as prettier, resolveConfig } from \"prettier\";\nimport { runAsWorker } from \"synckit\";\n\nconst configCache = new Map<string, Options | null>();\n\nasync function getConfig(filepath: string): Promise<Options | null> {\n const cached = configCache.get(filepath);\n if (typeof cached !== \"undefined\") {\n return cached;\n }\n const options = await resolveConfig(filepath);\n configCache.set(filepath, options);\n return options;\n}\n\n/**\n * @internal\n */\nexport async function formatCode(\n source: string,\n filepath: string,\n): Promise<string> {\n const options = await getConfig(filepath);\n const formatted = await prettier(source, { ...options, filepath });\n return formatted.trim();\n}\n\nrunAsWorker(formatCode);\n"],"names":["prettier"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,WAAA,uBAAkB,GAAA,EAA4B;AAEpD,eAAe,UAAU,QAAA,EAA2C;AAChE,EAAA,MAAM,MAAA,GAAS,WAAA,CAAY,GAAA,CAAI,QAAQ,CAAA;AACvC,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAC/B,IAAA,OAAO,MAAA;AAAA,EACX;AACA,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,CAAc,QAAQ,CAAA;AAC5C,EAAA,WAAA,CAAY,GAAA,CAAI,UAAU,OAAO,CAAA;AACjC,EAAA,OAAO,OAAA;AACX;AAKA,eAAsB,UAAA,CAClB,QACA,QAAA,EACe;AACf,EAAA,MAAM,OAAA,GAAU,MAAM,SAAA,CAAU,QAAQ,CAAA;AACxC,EAAA,MAAM,SAAA,GAAY,MAAMA,OAAA,CAAS,MAAA,EAAQ,EAAE,GAAG,OAAA,EAAS,UAAU,CAAA;AACjE,EAAA,OAAO,UAAU,IAAA,EAAK;AAC1B;AAEA,WAAA,CAAY,UAAU,CAAA;;;;"}
package/dist/index.mjs CHANGED
@@ -4,8 +4,8 @@ const require = $createRequire(import.meta.url);
4
4
 
5
5
  import fs from 'node:fs/promises';
6
6
  import path from 'node:path/posix';
7
- import { t as ts, m as minimatch, M as MarkdownIt, d as dedent, g as closest, h as distance, i as fm, j as isCI, Z as Ze, k as moduleImporter, l as cliProgress, n as tinylr, w as watch, o as createInstance, p as fse, q as inter } from './vendor-Bk5vSW_n.mjs';
8
- import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as filePath, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-BO8ZE3IZ.mjs';
7
+ import { t as ts, m as minimatch, M as MarkdownIt, d as dedent, g as closest, h as distance, i as fm, j as isCI, Z as Ze, k as moduleImporter, l as cliProgress, n as tinylr, w as watch, o as createInstance, p as fse, q as inter } from './vendor-DV7BHNMM.mjs';
8
+ import { g as generateId, p as parseInfostring, i as isDocumentPage, n as normalizePath, a as getFingerprint, h as hasTag, f as findTag, b as getOutputFilePath, d as htmlencode, e as filePath, c as createMarkdownRenderer, j as generateExample } from './create-markdown-renderer-DFoBsWJN.mjs';
9
9
  import path__default from 'node:path';
10
10
  import require$$1 from 'crypto';
11
11
  import 'node:crypto';
package/dist/markdown.mjs CHANGED
@@ -2,8 +2,8 @@ import { createRequire as $createRequire } from "node:module";
2
2
 
3
3
  const require = $createRequire(import.meta.url);
4
4
 
5
- export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-BO8ZE3IZ.mjs';
6
- import './vendor-Bk5vSW_n.mjs';
5
+ export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-DFoBsWJN.mjs';
6
+ import './vendor-DV7BHNMM.mjs';
7
7
  import 'node:url';
8
8
  import 'node:path';
9
9
  import 'fs';
@@ -86,11 +86,34 @@ h6:not(.code-preview h6) {
86
86
  font-family: var(--docs-heading-font-family);
87
87
  line-height: var(--docs-heading-line-height);
88
88
  margin-top: 0;
89
- margin-bottom: 0.25rem;
90
89
  text-wrap: balance;
91
90
  text-wrap: pretty;
92
91
  }
93
92
 
93
+ h1:not(.code-preview h1) {
94
+ margin-bottom: var(--docs-heading-margin-bottom-h1);
95
+ }
96
+
97
+ h2:not(.code-preview h2) {
98
+ margin-bottom: var(--docs-heading-margin-bottom-h2);
99
+ }
100
+
101
+ h3:not(.code-preview h3) {
102
+ margin-bottom: var(--docs-heading-margin-bottom-h3);
103
+ }
104
+
105
+ h4:not(.code-preview h4) {
106
+ margin-bottom: var(--docs-heading-margin-bottom-h4);
107
+ }
108
+
109
+ h5:not(.code-preview h5) {
110
+ margin-bottom: var(--docs-heading-margin-bottom-h5);
111
+ }
112
+
113
+ h6:not(.code-preview h6) {
114
+ margin-bottom: var(--docs-heading-margin-bottom-h6);
115
+ }
116
+
94
117
  h1 {
95
118
  font-size: var(--f-font-size-h1);
96
119
  font-weight: var(--docs-heading-font-weight-h1);
@@ -86,11 +86,34 @@ h6:not(.code-preview h6) {
86
86
  font-family: var(--docs-heading-font-family);
87
87
  line-height: var(--docs-heading-line-height);
88
88
  margin-top: 0;
89
- margin-bottom: 0.25rem;
90
89
  text-wrap: balance;
91
90
  text-wrap: pretty;
92
91
  }
93
92
 
93
+ h1:not(.code-preview h1) {
94
+ margin-bottom: var(--docs-heading-margin-bottom-h1);
95
+ }
96
+
97
+ h2:not(.code-preview h2) {
98
+ margin-bottom: var(--docs-heading-margin-bottom-h2);
99
+ }
100
+
101
+ h3:not(.code-preview h3) {
102
+ margin-bottom: var(--docs-heading-margin-bottom-h3);
103
+ }
104
+
105
+ h4:not(.code-preview h4) {
106
+ margin-bottom: var(--docs-heading-margin-bottom-h4);
107
+ }
108
+
109
+ h5:not(.code-preview h5) {
110
+ margin-bottom: var(--docs-heading-margin-bottom-h5);
111
+ }
112
+
113
+ h6:not(.code-preview h6) {
114
+ margin-bottom: var(--docs-heading-margin-bottom-h6);
115
+ }
116
+
94
117
  h1 {
95
118
  font-size: var(--f-font-size-h1);
96
119
  font-weight: var(--docs-heading-font-weight-h1);
@@ -1388,6 +1411,12 @@ kbd {
1388
1411
  --docs-heading-letter-spacing-h3: -0.3px;
1389
1412
  --docs-heading-letter-spacing-h4: -0.3px;
1390
1413
  --docs-heading-line-height: 1.4;
1414
+ --docs-heading-margin-bottom-h1: 1.5rem;
1415
+ --docs-heading-margin-bottom-h2: 1rem;
1416
+ --docs-heading-margin-bottom-h3: 1rem;
1417
+ --docs-heading-margin-bottom-h4: 0.5rem;
1418
+ --docs-heading-margin-bottom-h5: 0.5rem;
1419
+ --docs-heading-margin-bottom-h6: 0.5rem;
1391
1420
  --docs-header-text-color-default: #1b1e23;
1392
1421
  --docs-header-text-color-discrete: #5f6165;
1393
1422
  --docs-header-background-color: transparent;
@@ -36,6 +36,12 @@
36
36
  --docs-heading-letter-spacing-h3: -0.3px;
37
37
  --docs-heading-letter-spacing-h4: -0.3px;
38
38
  --docs-heading-line-height: 1.4;
39
+ --docs-heading-margin-bottom-h1: 1.5rem;
40
+ --docs-heading-margin-bottom-h2: 1rem;
41
+ --docs-heading-margin-bottom-h3: 1rem;
42
+ --docs-heading-margin-bottom-h4: 0.5rem;
43
+ --docs-heading-margin-bottom-h5: 0.5rem;
44
+ --docs-heading-margin-bottom-h6: 0.5rem;
39
45
  --docs-header-text-color-default: #1b1e23;
40
46
  --docs-header-text-color-discrete: #5f6165;
41
47
  --docs-header-background-color: transparent;
@@ -11456,9 +11456,10 @@ function createDedent(options) {
11456
11456
  result = result.trim();
11457
11457
  }
11458
11458
 
11459
- // handle escaped newlines at the end to ensure they don't get stripped too
11459
+ // Unescape escapes after trimming so sequences like `\n`, `\t`,
11460
+ // `\xHH` and `\u{...}` are preserved (fixes #24)
11460
11461
  if (escapeSpecialCharacters) {
11461
- result = result.replace(/\\n/g, "\n");
11462
+ result = result.replace(/\\n/g, "\n").replace(/\\t/g, "\t").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (_, h) => String.fromCharCode(parseInt(h, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (_, h) => String.fromCodePoint(parseInt(h, 16))).replace(/\\u([\da-fA-F]{4})/g, (_, h) => String.fromCharCode(parseInt(h, 16)));
11462
11463
  }
11463
11464
 
11464
11465
  // Workaround for Bun issue with Unicode characters
@@ -72182,4 +72183,4 @@ var typescript = /*#__PURE__*/Object.freeze({
72182
72183
  });
72183
72184
 
72184
72185
  export { HighlightJS as H, MarkdownIt as M, Ze$a as Z, resolveConfig as a, createTwoFilesPatch$1 as b, createSyncFn as c, dedent$1 as d, deflist_plugin as e, format2 as f, closest as g, distance as h, fm$2 as i, isCI as j, moduleImporter as k, cliProgress as l, minimatch as m, tinylr as n, createInstance as o, fse as p, inter as q, runAsWorker as r, ts$7 as t, watch$1 as w };
72185
- //# sourceMappingURL=vendor-Bk5vSW_n.mjs.map
72186
+ //# sourceMappingURL=vendor-DV7BHNMM.mjs.map