@forsakringskassan/docs-generator 3.21.0 → 3.22.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-GtJZoX7J.mjs';
5
+ import { r as runAsWorker, f as format2, a as resolveConfig } from './vendor-DBujHFR5.mjs';
6
6
  import 'node:url';
7
7
  import 'node:path';
8
8
  import 'fs';
@@ -54,4 +54,4 @@ async function formatCode(source, filepath) {
54
54
  runAsWorker(formatCode);
55
55
 
56
56
  export { formatCode };
57
- //# sourceMappingURL=format-code.worker-NI_KIDrb.mjs.map
57
+ //# sourceMappingURL=format-code.worker-BsMUHGd2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-code.worker-NI_KIDrb.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 (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\n/* eslint-disable-next-line unicorn/no-top-level-side-effects -- required for worker to function */\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,WAAW,MAAA,EAAW;AACtB,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;AAGA,WAAA,CAAY,UAAU,CAAA;;"}
1
+ {"version":3,"file":"format-code.worker-BsMUHGd2.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 (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\n/* eslint-disable-next-line unicorn/no-top-level-side-effects -- required for worker to function */\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,WAAW,MAAA,EAAW;AACtB,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;AAGA,WAAA,CAAY,UAAU,CAAA;;"}
package/dist/index.mjs CHANGED
@@ -3,13 +3,13 @@ import { createRequire as $createRequire } from "node:module";
3
3
  const require = $createRequire(import.meta.url);
4
4
 
5
5
  import { ApiItemKind, ApiModel } from '@microsoft/api-extractor-model';
6
- import { Z as Ze, M as MarkdownItCallable, g as fm, s as strToU8, z as zlibSync, h as strFromU8, d as dedent, i as closest, j as distance, k as isCI, m as moduleImporter, l as cliProgress, t as tinylr, w as watch, n as createInstance, o as fse, p as inter } from './vendor-GtJZoX7J.mjs';
6
+ import { Z as Ze, M as MarkdownItCallable, g as fm, s as strToU8, z as zlibSync, h as strFromU8, d as dedent, i as closest, j as distance, k as isCI, m as moduleImporter, l as cliProgress, t as tinylr, w as watch, n as createInstance, o as fse, p as inter } from './vendor-DBujHFR5.mjs';
7
7
  import path__default from 'node:path';
8
8
  import fs from 'node:fs/promises';
9
9
  import crypto from 'node:crypto';
10
10
  import path from 'node:path/posix';
11
11
  import { exec, execSync } from 'node:child_process';
12
- import { g as generateId, f as formatCode, p as parseInfostring, a as getFingerprint, h as hasTag, b as parseImport, d as findTag, e as getOutputFilePath, i as isDocumentPage, j as findDocument, k as getDocumentBody, n as normalizePath, l as htmlencode, c as createMarkdownRenderer } from './create-markdown-renderer-Bm-yRJ38.mjs';
12
+ import { g as generateId, f as formatCode, p as parseInfostring, a as getFingerprint, h as hasTag, b as parseImport, d as findTag, e as getOutputFilePath, i as isDocumentPage, j as findDocument, k as getDocumentBody, n as normalizePath, l as htmlencode, c as createMarkdownRenderer } from './create-markdown-renderer-CX0kOizk.mjs';
13
13
  import { DocExcerpt } from '@microsoft/tsdoc';
14
14
  import pkg from '../package.json' with { type: "json" };
15
15
  import fs__default, { existsSync, readFileSync, copyFileSync } from 'node:fs';
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-Bm-yRJ38.mjs';
6
- import './vendor-GtJZoX7J.mjs';
5
+ export { S as SoftError, c as createMarkdownRenderer } from './create-markdown-renderer-CX0kOizk.mjs';
6
+ import './vendor-DBujHFR5.mjs';
7
7
  import 'node:url';
8
8
  import 'node:path';
9
9
  import 'fs';
@@ -797,6 +797,18 @@ function e2(e3, r2) {
797
797
  }
798
798
 
799
799
  // src/runtime/search.ts
800
+ function removeIsTouch() {
801
+ const searchForm = document.querySelector("#search-form");
802
+ if (searchForm) {
803
+ searchForm.classList.remove("is-touch");
804
+ }
805
+ }
806
+ function setIsTouch() {
807
+ const searchForm = document.querySelector("#search-form");
808
+ if (searchForm) {
809
+ searchForm.classList.add("is-touch");
810
+ }
811
+ }
800
812
  function isMoreSpecific(a, b) {
801
813
  if (b === null) {
802
814
  return true;
@@ -920,9 +932,11 @@ function setup() {
920
932
  function clickOutside(event) {
921
933
  const rect = dialog.getBoundingClientRect();
922
934
  const point = { x: event.clientX, y: event.clientY };
923
- if (isOutside(rect, point)) {
924
- dialog.close();
935
+ if (!isOutside(rect, point)) {
936
+ return;
925
937
  }
938
+ dialog.close();
939
+ removeIsTouch();
926
940
  }
927
941
  queueMicrotask(async () => {
928
942
  try {
@@ -938,9 +952,11 @@ function setup() {
938
952
  dialog.addEventListener("close", () => {
939
953
  document.body.removeEventListener("click", clickOutside);
940
954
  document.body.classList.remove("docs-modal-active");
955
+ removeIsTouch();
941
956
  });
942
957
  dialogCloseButton.addEventListener("click", () => {
943
958
  dialog.close();
959
+ removeIsTouch();
944
960
  });
945
961
  input.addEventListener("input", () => {
946
962
  searchTerm = input.value.toLowerCase();
@@ -980,6 +996,7 @@ function setup() {
980
996
  if (!(event.ctrlKey && event.key === "k")) {
981
997
  return;
982
998
  }
999
+ removeIsTouch();
983
1000
  event.preventDefault();
984
1001
  input.value = searchTerm = "";
985
1002
  updateResults();
@@ -994,15 +1011,29 @@ function setup() {
994
1011
  return;
995
1012
  function initButton() {
996
1013
  const button = document.querySelector("#docs-search");
997
- if (button) {
998
- button.addEventListener("submit", (event) => {
999
- event.preventDefault();
1000
- input.value = searchTerm = "";
1001
- dialog.showModal();
1002
- document.body.addEventListener("click", clickOutside);
1003
- document.body.classList.add("docs-modal-active");
1004
- });
1014
+ if (!button) {
1015
+ return;
1016
+ }
1017
+ const searchForm = document.querySelector("#search-form");
1018
+ if (searchForm) {
1019
+ removeIsTouch();
1005
1020
  }
1021
+ button.addEventListener("submit", (event) => {
1022
+ event.preventDefault();
1023
+ input.value = searchTerm = "";
1024
+ dialog.showModal();
1025
+ document.body.addEventListener("click", clickOutside);
1026
+ document.body.classList.add("docs-modal-active");
1027
+ });
1028
+ button.addEventListener(
1029
+ "touchstart",
1030
+ () => {
1031
+ if (searchForm) {
1032
+ setIsTouch();
1033
+ }
1034
+ },
1035
+ { passive: true }
1036
+ );
1006
1037
  }
1007
1038
  }
1008
1039
  setup();
@@ -1161,7 +1161,8 @@ pre.mermaid:not([data-processed])::after {
1161
1161
  :root {
1162
1162
  --docs-background-color: #ffffff;
1163
1163
  --docs-font-family: "Inter Variable", sans-serif;
1164
- --docs-font-line-height: 1.5;
1164
+ --docs-line-height: 1.5;
1165
+ --docs-font-line-height: var(--docs-line-height);
1165
1166
  --docs-font-size: 16px;
1166
1167
  --docs-font-weight: normal;
1167
1168
  --docs-text-color-default: #1b1e23;
@@ -1319,6 +1320,24 @@ textarea {
1319
1320
  margin: 0;
1320
1321
  }
1321
1322
 
1323
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(ul, ol, dl, blockquote, .docs-messagebox) {
1324
+ box-sizing: border-box;
1325
+ max-width: min(100%, var(--docs-content-max-width, 100%), var(--docs-text-max-width, 100%));
1326
+ }
1327
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(#docs-title, .docs-heading, .code-preview, pre, .table, .docs-messagebox--details) {
1328
+ box-sizing: border-box;
1329
+ max-width: min(100%, var(--docs-content-max-width, 100%));
1330
+ }
1331
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(.code-preview[data-tags~=live-example]) {
1332
+ box-sizing: border-box;
1333
+ max-width: min(100%, var(--docs-live-example-max-width, 100%));
1334
+ }
1335
+
1336
+ :where(#docs-content) p:not(.code-preview p) {
1337
+ box-sizing: border-box;
1338
+ max-width: min(100%, var(--docs-content-max-width, 100%), var(--docs-text-max-width, 680px));
1339
+ }
1340
+
1322
1341
  /* inter-cyrillic-ext-wght-normal */
1323
1342
  @font-face {
1324
1343
  font-family: "Inter Variable";
@@ -1554,6 +1573,9 @@ textarea {
1554
1573
  .docs-modal__close .icon {
1555
1574
  min-width: 1rem;
1556
1575
  }
1576
+ .docs-modal__body.is-touch p {
1577
+ display: none;
1578
+ }
1557
1579
  .docs-modal::backdrop {
1558
1580
  background: rgba(0, 0, 0, 0.75);
1559
1581
  backdrop-filter: blur(5px);
@@ -1618,10 +1640,17 @@ kbd {
1618
1640
  #search-dialog {
1619
1641
  --docs-text-color-default: var(--docs-search-text-color);
1620
1642
  margin-top: 80px;
1643
+ width: 580px;
1621
1644
  background: var(--docs-search-background-color);
1622
1645
  border: 1px solid var(--docs-search-border-color);
1623
1646
  color: var(--docs-text-color-default);
1624
- width: 580px;
1647
+ }
1648
+ @media (width < 640px) {
1649
+ #search-dialog {
1650
+ width: auto;
1651
+ margin-left: 1rem;
1652
+ margin-right: 1rem;
1653
+ }
1625
1654
  }
1626
1655
 
1627
1656
  .docs-search-dialog__input {
@@ -1634,6 +1663,9 @@ kbd {
1634
1663
  width: 100%;
1635
1664
  margin: 0 0 1.5rem;
1636
1665
  }
1666
+ .docs-modal__body.is-touch .docs-search-dialog__input {
1667
+ margin: 0;
1668
+ }
1637
1669
  .docs-search-dialog__input:focus {
1638
1670
  border-radius: 0;
1639
1671
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1b1e23, 0 0 0 6px #ffffff;
@@ -1652,6 +1684,10 @@ kbd {
1652
1684
  margin: 0.5rem 0 1.5rem;
1653
1685
  padding: 0.2rem;
1654
1686
  }
1687
+ .docs-modal__body.is-touch .docs-search-result__list:empty {
1688
+ margin: 0.5rem 0;
1689
+ padding: 0;
1690
+ }
1655
1691
  .docs-search-result__item {
1656
1692
  display: flex;
1657
1693
  border: 2px solid #8d8e91;
@@ -2,7 +2,8 @@
2
2
  :root {
3
3
  --docs-background-color: #ffffff;
4
4
  --docs-font-family: "Inter Variable", sans-serif;
5
- --docs-font-line-height: 1.5;
5
+ --docs-line-height: 1.5;
6
+ --docs-font-line-height: var(--docs-line-height);
6
7
  --docs-font-size: 16px;
7
8
  --docs-font-weight: normal;
8
9
  --docs-text-color-default: #1b1e23;
@@ -160,6 +161,24 @@ textarea {
160
161
  margin: 0;
161
162
  }
162
163
 
164
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(ul, ol, dl, blockquote, .docs-messagebox) {
165
+ box-sizing: border-box;
166
+ max-width: min(100%, var(--docs-content-max-width, 100%), var(--docs-text-max-width, 100%));
167
+ }
168
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(#docs-title, .docs-heading, .code-preview, pre, .table, .docs-messagebox--details) {
169
+ box-sizing: border-box;
170
+ max-width: min(100%, var(--docs-content-max-width, 100%));
171
+ }
172
+ :where(#docs-title:not(.code-preview *), #docs-content :not(.code-preview *)):where(.code-preview[data-tags~=live-example]) {
173
+ box-sizing: border-box;
174
+ max-width: min(100%, var(--docs-live-example-max-width, 100%));
175
+ }
176
+
177
+ :where(#docs-content) p:not(.code-preview p) {
178
+ box-sizing: border-box;
179
+ max-width: min(100%, var(--docs-content-max-width, 100%), var(--docs-text-max-width, 680px));
180
+ }
181
+
163
182
  /* inter-cyrillic-ext-wght-normal */
164
183
  @font-face {
165
184
  font-family: "Inter Variable";
@@ -401,6 +420,9 @@ textarea {
401
420
  .docs-modal__close .icon {
402
421
  min-width: 1rem;
403
422
  }
423
+ .docs-modal__body.is-touch p {
424
+ display: none;
425
+ }
404
426
  .docs-modal::backdrop {
405
427
  background: rgba(0, 0, 0, 0.75);
406
428
  backdrop-filter: blur(5px);
@@ -465,10 +487,17 @@ kbd {
465
487
  #search-dialog {
466
488
  --docs-text-color-default: var(--docs-search-text-color);
467
489
  margin-top: 80px;
490
+ width: 580px;
468
491
  background: var(--docs-search-background-color);
469
492
  border: 1px solid var(--docs-search-border-color);
470
493
  color: var(--docs-text-color-default);
471
- width: 580px;
494
+ }
495
+ @media (width < 640px) {
496
+ #search-dialog {
497
+ width: auto;
498
+ margin-left: 1rem;
499
+ margin-right: 1rem;
500
+ }
472
501
  }
473
502
 
474
503
  .docs-search-dialog__input {
@@ -481,6 +510,9 @@ kbd {
481
510
  width: 100%;
482
511
  margin: 0 0 1.5rem;
483
512
  }
513
+ .docs-modal__body.is-touch .docs-search-dialog__input {
514
+ margin: 0;
515
+ }
484
516
  .docs-search-dialog__input:focus {
485
517
  border-radius: 0;
486
518
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1b1e23, 0 0 0 6px #ffffff;
@@ -499,6 +531,10 @@ kbd {
499
531
  margin: 0.5rem 0 1.5rem;
500
532
  padding: 0.2rem;
501
533
  }
534
+ .docs-modal__body.is-touch .docs-search-result__list:empty {
535
+ margin: 0.5rem 0;
536
+ padding: 0;
537
+ }
502
538
  .docs-search-result__item {
503
539
  display: flex;
504
540
  border: 2px solid #8d8e91;
@@ -14,7 +14,7 @@
14
14
  --docs-warning-background: var(--fkds-color-feedback-background-warning);
15
15
  --docs-error-color: var(--fkds-color-feedback-border-negative);
16
16
  --docs-error-background: var(--fkds-color-feedback-background-negative);
17
- --docs-font-line-height: var(--f-line-height-large);
17
+ --docs-line-height: var(--f-line-height-large);
18
18
  --docs-font-size: var(--f-font-size-default-rem);
19
19
  --docs-font-family: var(--f-font-family);
20
20
  --docs-focus-box-shadow:
@@ -16540,7 +16540,7 @@ class Interpolator {
16540
16540
  };
16541
16541
  this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
16542
16542
  this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
16543
- this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
16543
+ this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
16544
16544
  }
16545
16545
  interpolate(str, data, lng, options) {
16546
16546
  let match;
@@ -16644,7 +16644,10 @@ class Interpolator {
16644
16644
  if (clonedOptions.defaultValue && clonedOptions.defaultValue.includes(this.prefix)) delete clonedOptions.defaultValue;
16645
16645
  return key;
16646
16646
  };
16647
- while (match = this.nestingRegexp.exec(str)) {
16647
+ const nestingRegexp = new RegExp(this.nestingRegexp);
16648
+ let out = '';
16649
+ let lastEnd = 0;
16650
+ while (match = nestingRegexp.exec(str)) {
16648
16651
  let formatters = [];
16649
16652
  clonedOptions = {
16650
16653
  ...options
@@ -16670,10 +16673,11 @@ class Interpolator {
16670
16673
  interpolationkey: match[1].trim()
16671
16674
  }), value.trim());
16672
16675
  }
16673
- str = str.replace(match[0], regexSafe(makeString$1(value)));
16676
+ out += str.slice(lastEnd, match.index) + makeString$1(value);
16677
+ lastEnd = nestingRegexp.lastIndex;
16674
16678
  this.regexp.lastIndex = 0;
16675
16679
  }
16676
- return str;
16680
+ return lastEnd ? out + str.slice(lastEnd) : str;
16677
16681
  }
16678
16682
  }
16679
16683
 
@@ -69234,4 +69238,4 @@ var yaml = /*#__PURE__*/Object.freeze({
69234
69238
  });
69235
69239
 
69236
69240
  export { HighlightJS as H, MarkdownItCallable as M, Ze$b as Z, resolveConfig as a, createTwoFilesPatch$1 as b, createSyncFn as c, dedent$1 as d, deflist_plugin as e, format2 as f, fm$3 as g, strFromU8 as h, closest as i, distance as j, isCI as k, cliProgress as l, moduleImporter as m, createInstance as n, fse as o, inter as p, runAsWorker as r, strToU8 as s, tinylr as t, watch$1 as w, zlibSync as z };
69237
- //# sourceMappingURL=vendor-GtJZoX7J.mjs.map
69241
+ //# sourceMappingURL=vendor-DBujHFR5.mjs.map