@forsakringskassan/docs-generator 3.21.0 → 3.21.1

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();
@@ -1554,6 +1554,9 @@ textarea {
1554
1554
  .docs-modal__close .icon {
1555
1555
  min-width: 1rem;
1556
1556
  }
1557
+ .docs-modal__body.is-touch p {
1558
+ display: none;
1559
+ }
1557
1560
  .docs-modal::backdrop {
1558
1561
  background: rgba(0, 0, 0, 0.75);
1559
1562
  backdrop-filter: blur(5px);
@@ -1618,10 +1621,17 @@ kbd {
1618
1621
  #search-dialog {
1619
1622
  --docs-text-color-default: var(--docs-search-text-color);
1620
1623
  margin-top: 80px;
1624
+ width: 580px;
1621
1625
  background: var(--docs-search-background-color);
1622
1626
  border: 1px solid var(--docs-search-border-color);
1623
1627
  color: var(--docs-text-color-default);
1624
- width: 580px;
1628
+ }
1629
+ @media (width < 640px) {
1630
+ #search-dialog {
1631
+ width: auto;
1632
+ margin-left: 1rem;
1633
+ margin-right: 1rem;
1634
+ }
1625
1635
  }
1626
1636
 
1627
1637
  .docs-search-dialog__input {
@@ -1634,6 +1644,9 @@ kbd {
1634
1644
  width: 100%;
1635
1645
  margin: 0 0 1.5rem;
1636
1646
  }
1647
+ .docs-modal__body.is-touch .docs-search-dialog__input {
1648
+ margin: 0;
1649
+ }
1637
1650
  .docs-search-dialog__input:focus {
1638
1651
  border-radius: 0;
1639
1652
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1b1e23, 0 0 0 6px #ffffff;
@@ -1652,6 +1665,10 @@ kbd {
1652
1665
  margin: 0.5rem 0 1.5rem;
1653
1666
  padding: 0.2rem;
1654
1667
  }
1668
+ .docs-modal__body.is-touch .docs-search-result__list:empty {
1669
+ margin: 0.5rem 0;
1670
+ padding: 0;
1671
+ }
1655
1672
  .docs-search-result__item {
1656
1673
  display: flex;
1657
1674
  border: 2px solid #8d8e91;
@@ -401,6 +401,9 @@ textarea {
401
401
  .docs-modal__close .icon {
402
402
  min-width: 1rem;
403
403
  }
404
+ .docs-modal__body.is-touch p {
405
+ display: none;
406
+ }
404
407
  .docs-modal::backdrop {
405
408
  background: rgba(0, 0, 0, 0.75);
406
409
  backdrop-filter: blur(5px);
@@ -465,10 +468,17 @@ kbd {
465
468
  #search-dialog {
466
469
  --docs-text-color-default: var(--docs-search-text-color);
467
470
  margin-top: 80px;
471
+ width: 580px;
468
472
  background: var(--docs-search-background-color);
469
473
  border: 1px solid var(--docs-search-border-color);
470
474
  color: var(--docs-text-color-default);
471
- width: 580px;
475
+ }
476
+ @media (width < 640px) {
477
+ #search-dialog {
478
+ width: auto;
479
+ margin-left: 1rem;
480
+ margin-right: 1rem;
481
+ }
472
482
  }
473
483
 
474
484
  .docs-search-dialog__input {
@@ -481,6 +491,9 @@ kbd {
481
491
  width: 100%;
482
492
  margin: 0 0 1.5rem;
483
493
  }
494
+ .docs-modal__body.is-touch .docs-search-dialog__input {
495
+ margin: 0;
496
+ }
484
497
  .docs-search-dialog__input:focus {
485
498
  border-radius: 0;
486
499
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #1b1e23, 0 0 0 6px #ffffff;
@@ -499,6 +512,10 @@ kbd {
499
512
  margin: 0.5rem 0 1.5rem;
500
513
  padding: 0.2rem;
501
514
  }
515
+ .docs-modal__body.is-touch .docs-search-result__list:empty {
516
+ margin: 0.5rem 0;
517
+ padding: 0;
518
+ }
502
519
  .docs-search-result__item {
503
520
  display: flex;
504
521
  border: 2px solid #8d8e91;
@@ -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