@shadow-shard-tools/docs-core 1.0.17 → 1.0.19

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.
Files changed (254) hide show
  1. package/README.md +85 -5
  2. package/dist/cjs/configs/clientConfig.js +78 -0
  3. package/dist/cjs/configs/codeLanguagesConfig.js +36 -0
  4. package/dist/cjs/configs/index.browser.js +16 -0
  5. package/dist/cjs/configs/index.js +20 -0
  6. package/dist/cjs/configs/sstDocsConfig.browser.js +27 -0
  7. package/dist/cjs/configs/sstDocsConfig.js +88 -0
  8. package/dist/cjs/configs/sstDocsConfigShared.js +232 -0
  9. package/dist/cjs/constants/alignmentClasses.js +17 -0
  10. package/dist/cjs/constants/index.js +7 -0
  11. package/dist/cjs/constants/spacingClasses.js +9 -0
  12. package/dist/cjs/data/buildTree.js +131 -0
  13. package/dist/cjs/data/fsDataProvider.browser.js +10 -0
  14. package/dist/cjs/data/fsDataProvider.js +23 -0
  15. package/dist/cjs/data/httpDataProvider.js +25 -0
  16. package/dist/cjs/data/index.browser.js +17 -0
  17. package/dist/cjs/data/index.js +22 -0
  18. package/dist/cjs/data/loadAllCategories.js +30 -0
  19. package/dist/cjs/data/loadAllItems.js +26 -0
  20. package/dist/cjs/data/loadVersionData.fs.js +29 -0
  21. package/dist/cjs/data/loadVersionData.js +78 -0
  22. package/dist/cjs/data/loadVersions.js +6 -0
  23. package/dist/cjs/index.browser.js +22 -0
  24. package/dist/cjs/index.js +22 -0
  25. package/dist/cjs/themes/index.js +15 -0
  26. package/dist/cjs/themes/presets/default.js +121 -0
  27. package/dist/cjs/themes/styleThemeSchema.js +36 -0
  28. package/dist/cjs/themes/themeRegistry.js +22 -0
  29. package/dist/cjs/types/AudioData.js +2 -0
  30. package/dist/cjs/types/BaseImage.js +2 -0
  31. package/dist/cjs/types/Category.js +2 -0
  32. package/dist/cjs/types/CategoryTitleData.js +2 -0
  33. package/dist/cjs/types/ChartData.js +2 -0
  34. package/dist/cjs/types/ClientVisibleSstDocsConfig.js +2 -0
  35. package/dist/cjs/types/CodeData.js +2 -0
  36. package/dist/cjs/types/Content.js +2 -0
  37. package/dist/cjs/types/DataDiagnostic.js +2 -0
  38. package/dist/cjs/types/DataProvider.js +2 -0
  39. package/dist/cjs/types/DividerData.js +2 -0
  40. package/dist/cjs/types/DocItem.js +2 -0
  41. package/dist/cjs/types/HeaderBranding.js +2 -0
  42. package/dist/cjs/types/HtmlGeneratorSettings.js +2 -0
  43. package/dist/cjs/types/ImageCarouselData.js +2 -0
  44. package/dist/cjs/types/ImageCompareData.js +2 -0
  45. package/dist/cjs/types/ImageData.js +2 -0
  46. package/dist/cjs/types/ImageGridData.js +2 -0
  47. package/dist/cjs/types/IndexJson.js +2 -0
  48. package/dist/cjs/types/ListData.js +2 -0
  49. package/dist/cjs/types/Logger.js +2 -0
  50. package/dist/cjs/types/MathData.js +2 -0
  51. package/dist/cjs/types/MessageBoxData.js +2 -0
  52. package/dist/cjs/types/RawCategory.js +2 -0
  53. package/dist/cjs/types/SstDocsConfig.js +2 -0
  54. package/dist/cjs/types/StyleTheme.js +2 -0
  55. package/dist/cjs/types/TableData.js +2 -0
  56. package/dist/cjs/types/TextData.js +2 -0
  57. package/dist/cjs/types/TitleData.js +2 -0
  58. package/dist/cjs/types/Version.js +2 -0
  59. package/dist/cjs/types/YoutubeData.js +2 -0
  60. package/dist/cjs/types/index.js +2 -0
  61. package/dist/cjs/utilities/dom/copyToClipboard.js +40 -0
  62. package/dist/cjs/utilities/dom/downloadTextFile.js +23 -0
  63. package/dist/cjs/utilities/dom/getResponsiveWidth.js +11 -0
  64. package/dist/cjs/utilities/file/getFileExtension.js +9 -0
  65. package/dist/cjs/utilities/index.browser.js +53 -0
  66. package/dist/cjs/utilities/index.js +53 -0
  67. package/dist/cjs/utilities/path/pathExists.browser.js +6 -0
  68. package/dist/cjs/utilities/path/pathExists.js +16 -0
  69. package/dist/cjs/utilities/path/resolveAgainstProjectRoot.browser.js +6 -0
  70. package/dist/cjs/utilities/path/resolveAgainstProjectRoot.js +13 -0
  71. package/dist/cjs/utilities/path/resolveDataPath.browser.js +6 -0
  72. package/dist/cjs/utilities/path/resolveDataPath.js +18 -0
  73. package/dist/cjs/utilities/string/extractYouTubeId.js +18 -0
  74. package/dist/cjs/utilities/string/normalizeBaseUrlPath.js +11 -0
  75. package/dist/cjs/utilities/string/normalizeSystemPath.js +14 -0
  76. package/dist/cjs/utilities/string/processListItems.js +10 -0
  77. package/dist/cjs/utilities/string/sanitizeFilename.js +13 -0
  78. package/dist/cjs/utilities/string/slugify.js +12 -0
  79. package/dist/cjs/utilities/string/withBasePath.js +73 -0
  80. package/dist/cjs/utilities/system/createTimeout.js +11 -0
  81. package/dist/cjs/utilities/system/formatTime.js +12 -0
  82. package/dist/cjs/utilities/system/logger.browser.js +39 -0
  83. package/dist/cjs/utilities/system/logger.js +60 -0
  84. package/dist/cjs/utilities/validation/isMobileDevice.js +8 -0
  85. package/dist/cjs/utilities/validation/isValidColor.js +182 -0
  86. package/dist/cjs/utilities/validation/isValidImageUrl.js +42 -0
  87. package/dist/cjs/utilities/validation/isValidYouTubeId.js +9 -0
  88. package/dist/cjs/utilities/validation/validateScale.js +8 -0
  89. package/dist/configs/clientConfig.d.ts.map +1 -1
  90. package/dist/configs/clientConfig.js +38 -24
  91. package/dist/configs/clientConfig.js.map +1 -1
  92. package/dist/configs/index.browser.d.ts +4 -0
  93. package/dist/configs/index.browser.d.ts.map +1 -0
  94. package/dist/configs/index.browser.js +4 -0
  95. package/dist/configs/index.browser.js.map +1 -0
  96. package/dist/configs/index.d.ts +1 -3
  97. package/dist/configs/index.d.ts.map +1 -1
  98. package/dist/configs/index.js +1 -3
  99. package/dist/configs/index.js.map +1 -1
  100. package/dist/configs/sstDocsConfig.browser.d.ts +8 -0
  101. package/dist/configs/sstDocsConfig.browser.d.ts.map +1 -0
  102. package/dist/configs/sstDocsConfig.browser.js +18 -0
  103. package/dist/configs/sstDocsConfig.browser.js.map +1 -0
  104. package/dist/configs/sstDocsConfig.d.ts +2 -2
  105. package/dist/configs/sstDocsConfig.d.ts.map +1 -1
  106. package/dist/configs/sstDocsConfig.js +18 -183
  107. package/dist/configs/sstDocsConfig.js.map +1 -1
  108. package/dist/configs/sstDocsConfigShared.d.ts +17 -0
  109. package/dist/configs/sstDocsConfigShared.d.ts.map +1 -0
  110. package/dist/configs/sstDocsConfigShared.js +226 -0
  111. package/dist/configs/sstDocsConfigShared.js.map +1 -0
  112. package/dist/data/buildTree.d.ts +6 -10
  113. package/dist/data/buildTree.d.ts.map +1 -1
  114. package/dist/data/buildTree.js +117 -162
  115. package/dist/data/buildTree.js.map +1 -1
  116. package/dist/data/fsDataProvider.browser.d.ts +6 -0
  117. package/dist/data/fsDataProvider.browser.d.ts.map +1 -0
  118. package/dist/data/fsDataProvider.browser.js +7 -0
  119. package/dist/data/fsDataProvider.browser.js.map +1 -0
  120. package/dist/data/fsDataProvider.d.ts +2 -1
  121. package/dist/data/fsDataProvider.d.ts.map +1 -1
  122. package/dist/data/fsDataProvider.js +15 -3
  123. package/dist/data/fsDataProvider.js.map +1 -1
  124. package/dist/data/httpDataProvider.d.ts +2 -1
  125. package/dist/data/httpDataProvider.d.ts.map +1 -1
  126. package/dist/data/httpDataProvider.js +17 -4
  127. package/dist/data/httpDataProvider.js.map +1 -1
  128. package/dist/data/index.browser.d.ts +7 -0
  129. package/dist/data/index.browser.d.ts.map +1 -0
  130. package/dist/data/index.browser.js +7 -0
  131. package/dist/data/index.browser.js.map +1 -0
  132. package/dist/data/index.d.ts +4 -3
  133. package/dist/data/index.d.ts.map +1 -1
  134. package/dist/data/index.js +4 -3
  135. package/dist/data/index.js.map +1 -1
  136. package/dist/data/loadAllCategories.d.ts +10 -1
  137. package/dist/data/loadAllCategories.d.ts.map +1 -1
  138. package/dist/data/loadAllCategories.js +15 -5
  139. package/dist/data/loadAllCategories.js.map +1 -1
  140. package/dist/data/loadAllItems.d.ts +10 -1
  141. package/dist/data/loadAllItems.d.ts.map +1 -1
  142. package/dist/data/loadAllItems.js +19 -7
  143. package/dist/data/loadAllItems.js.map +1 -1
  144. package/dist/data/loadVersionData.d.ts +22 -1
  145. package/dist/data/loadVersionData.d.ts.map +1 -1
  146. package/dist/data/loadVersionData.fs.d.ts +3 -0
  147. package/dist/data/loadVersionData.fs.d.ts.map +1 -0
  148. package/dist/data/loadVersionData.fs.js +24 -0
  149. package/dist/data/loadVersionData.fs.js.map +1 -0
  150. package/dist/data/loadVersionData.js +67 -7
  151. package/dist/data/loadVersionData.js.map +1 -1
  152. package/dist/index.browser.d.ts +7 -0
  153. package/dist/index.browser.d.ts.map +1 -0
  154. package/dist/index.browser.js +7 -0
  155. package/dist/index.browser.js.map +1 -0
  156. package/dist/themes/index.d.ts +2 -2
  157. package/dist/themes/index.d.ts.map +1 -1
  158. package/dist/themes/index.js +2 -2
  159. package/dist/themes/index.js.map +1 -1
  160. package/dist/themes/presets/default.d.ts +3 -0
  161. package/dist/themes/presets/default.d.ts.map +1 -0
  162. package/dist/themes/presets/default.js +119 -0
  163. package/dist/themes/presets/default.js.map +1 -0
  164. package/dist/themes/styleThemeSchema.d.ts +6 -0
  165. package/dist/themes/styleThemeSchema.d.ts.map +1 -0
  166. package/dist/themes/styleThemeSchema.js +32 -0
  167. package/dist/themes/styleThemeSchema.js.map +1 -0
  168. package/dist/themes/themeRegistry.d.ts +3 -4
  169. package/dist/themes/themeRegistry.d.ts.map +1 -1
  170. package/dist/themes/themeRegistry.js +11 -11
  171. package/dist/themes/themeRegistry.js.map +1 -1
  172. package/dist/types/Content.d.ts +35 -18
  173. package/dist/types/Content.d.ts.map +1 -1
  174. package/dist/types/DataDiagnostic.d.ts +8 -0
  175. package/dist/types/DataDiagnostic.d.ts.map +1 -0
  176. package/dist/types/DataDiagnostic.js +2 -0
  177. package/dist/types/DataDiagnostic.js.map +1 -0
  178. package/dist/types/HtmlGeneratorSettings.d.ts +3 -11
  179. package/dist/types/HtmlGeneratorSettings.d.ts.map +1 -1
  180. package/dist/types/StyleTheme.d.ts +115 -131
  181. package/dist/types/StyleTheme.d.ts.map +1 -1
  182. package/dist/types/index.d.ts +2 -2
  183. package/dist/types/index.d.ts.map +1 -1
  184. package/dist/utilities/index.browser.d.ts +23 -0
  185. package/dist/utilities/index.browser.d.ts.map +1 -0
  186. package/dist/utilities/index.browser.js +29 -0
  187. package/dist/utilities/index.browser.js.map +1 -0
  188. package/dist/utilities/path/pathExists.browser.d.ts +2 -0
  189. package/dist/utilities/path/pathExists.browser.d.ts.map +1 -0
  190. package/dist/utilities/path/pathExists.browser.js +4 -0
  191. package/dist/utilities/path/pathExists.browser.js.map +1 -0
  192. package/dist/utilities/path/pathExists.js +1 -1
  193. package/dist/utilities/path/pathExists.js.map +1 -1
  194. package/dist/utilities/path/resolveAgainstProjectRoot.browser.d.ts +2 -0
  195. package/dist/utilities/path/resolveAgainstProjectRoot.browser.d.ts.map +1 -0
  196. package/dist/utilities/path/resolveAgainstProjectRoot.browser.js +4 -0
  197. package/dist/utilities/path/resolveAgainstProjectRoot.browser.js.map +1 -0
  198. package/dist/utilities/path/resolveAgainstProjectRoot.d.ts.map +1 -1
  199. package/dist/utilities/path/resolveAgainstProjectRoot.js.map +1 -1
  200. package/dist/utilities/path/resolveDataPath.browser.d.ts +2 -0
  201. package/dist/utilities/path/resolveDataPath.browser.d.ts.map +1 -0
  202. package/dist/utilities/path/resolveDataPath.browser.js +4 -0
  203. package/dist/utilities/path/resolveDataPath.browser.js.map +1 -0
  204. package/dist/utilities/path/resolveDataPath.d.ts.map +1 -1
  205. package/dist/utilities/path/resolveDataPath.js +1 -1
  206. package/dist/utilities/path/resolveDataPath.js.map +1 -1
  207. package/dist/utilities/string/normalizeSystemPath.d.ts.map +1 -1
  208. package/dist/utilities/string/normalizeSystemPath.js +9 -1
  209. package/dist/utilities/string/normalizeSystemPath.js.map +1 -1
  210. package/dist/utilities/string/withBasePath.d.ts.map +1 -1
  211. package/dist/utilities/string/withBasePath.js +66 -6
  212. package/dist/utilities/string/withBasePath.js.map +1 -1
  213. package/dist/utilities/system/logger.browser.d.ts +3 -0
  214. package/dist/utilities/system/logger.browser.d.ts.map +1 -0
  215. package/dist/utilities/system/logger.browser.js +36 -0
  216. package/dist/utilities/system/logger.browser.js.map +1 -0
  217. package/dist/utilities/system/logger.d.ts.map +1 -1
  218. package/dist/utilities/system/logger.js +26 -6
  219. package/dist/utilities/system/logger.js.map +1 -1
  220. package/package.json +313 -160
  221. package/dist/browser/serverOnly.d.ts +0 -15
  222. package/dist/browser/serverOnly.d.ts.map +0 -1
  223. package/dist/browser/serverOnly.js +0 -33
  224. package/dist/browser/serverOnly.js.map +0 -1
  225. package/dist/browser.d.ts +0 -38
  226. package/dist/browser.d.ts.map +0 -1
  227. package/dist/browser.js +0 -45
  228. package/dist/browser.js.map +0 -1
  229. package/dist/configs/sstDocsConfig.shared.d.ts +0 -8
  230. package/dist/configs/sstDocsConfig.shared.d.ts.map +0 -1
  231. package/dist/configs/sstDocsConfig.shared.js +0 -86
  232. package/dist/configs/sstDocsConfig.shared.js.map +0 -1
  233. package/dist/configs/stylesConfig.d.ts +0 -3
  234. package/dist/configs/stylesConfig.d.ts.map +0 -1
  235. package/dist/configs/stylesConfig.js +0 -8
  236. package/dist/configs/stylesConfig.js.map +0 -1
  237. package/dist/styles/themes.css +0 -1
  238. package/dist/styles/themes.css.map +0 -1
  239. package/dist/themes/baseThemeClasses.d.ts +0 -106
  240. package/dist/themes/baseThemeClasses.d.ts.map +0 -1
  241. package/dist/themes/baseThemeClasses.js +0 -106
  242. package/dist/themes/baseThemeClasses.js.map +0 -1
  243. package/dist/themes/darkTheme.d.ts +0 -3
  244. package/dist/themes/darkTheme.d.ts.map +0 -1
  245. package/dist/themes/darkTheme.js +0 -42
  246. package/dist/themes/darkTheme.js.map +0 -1
  247. package/dist/themes/lightTheme.d.ts +0 -3
  248. package/dist/themes/lightTheme.d.ts.map +0 -1
  249. package/dist/themes/lightTheme.js +0 -42
  250. package/dist/themes/lightTheme.js.map +0 -1
  251. package/dist/types/StylesConfig.d.ts +0 -8
  252. package/dist/types/StylesConfig.d.ts.map +0 -1
  253. package/dist/types/StylesConfig.js +0 -2
  254. package/dist/types/StylesConfig.js.map +0 -1
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AVAILABLE_THEME_PRESET_NAMES = exports.DEFAULT_THEME_PRESET = exports.DOCS_CORE_THEME_PRESETS = void 0;
4
+ exports.getThemePreset = getThemePreset;
5
+ exports.isThemePresetName = isThemePresetName;
6
+ const default_js_1 = require("./presets/default.js");
7
+ exports.DOCS_CORE_THEME_PRESETS = {
8
+ default: default_js_1.defaultTheme,
9
+ };
10
+ exports.DEFAULT_THEME_PRESET = "default";
11
+ exports.AVAILABLE_THEME_PRESET_NAMES = Object.freeze(Object.keys(exports.DOCS_CORE_THEME_PRESETS));
12
+ function getThemePreset(name = exports.DEFAULT_THEME_PRESET) {
13
+ const preset = exports.DOCS_CORE_THEME_PRESETS[name];
14
+ if (!preset) {
15
+ const options = exports.AVAILABLE_THEME_PRESET_NAMES.join(", ");
16
+ throw new Error(`Unknown theme preset "${String(name)}". Supported presets: ${options}`);
17
+ }
18
+ return preset;
19
+ }
20
+ function isThemePresetName(value) {
21
+ return typeof value === "string" && exports.AVAILABLE_THEME_PRESET_NAMES.includes(value);
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copyToClipboard = void 0;
4
+ const copyToClipboard = async (text) => {
5
+ const hasNavigatorClipboard = typeof navigator !== "undefined" &&
6
+ !!navigator.clipboard &&
7
+ typeof navigator.clipboard.writeText === "function";
8
+ if (hasNavigatorClipboard) {
9
+ try {
10
+ await navigator.clipboard.writeText(text);
11
+ return true;
12
+ }
13
+ catch {
14
+ // Intentionally fall through to the DOM-based fallback.
15
+ }
16
+ }
17
+ if (typeof document === "undefined" ||
18
+ typeof document.createElement !== "function" ||
19
+ typeof document.body === "undefined") {
20
+ return false;
21
+ }
22
+ const textarea = document.createElement("textarea");
23
+ textarea.value = text;
24
+ textarea.setAttribute("readonly", "true");
25
+ textarea.style.position = "absolute";
26
+ textarea.style.left = "-9999px";
27
+ document.body.appendChild(textarea);
28
+ textarea.select();
29
+ try {
30
+ const success = typeof document.execCommand === "function"
31
+ ? document.execCommand("copy")
32
+ : false;
33
+ return success;
34
+ }
35
+ finally {
36
+ document.body.removeChild(textarea);
37
+ }
38
+ };
39
+ exports.copyToClipboard = copyToClipboard;
40
+ exports.default = exports.copyToClipboard;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadTextFile = void 0;
4
+ const sanitizeFilename_js_1 = require("../string/sanitizeFilename.js");
5
+ const downloadTextFile = (content, filename, mimeType = "text/plain") => {
6
+ try {
7
+ const blob = new Blob([content], { type: mimeType });
8
+ const url = URL.createObjectURL(blob);
9
+ const link = document.createElement("a");
10
+ link.href = url;
11
+ link.download = (0, sanitizeFilename_js_1.sanitizeFilename)(filename);
12
+ link.style.display = "none";
13
+ document.body.appendChild(link);
14
+ link.click();
15
+ document.body.removeChild(link);
16
+ setTimeout(() => URL.revokeObjectURL(url), 100);
17
+ }
18
+ catch (error) {
19
+ console.error("Failed to download file:", error);
20
+ }
21
+ };
22
+ exports.downloadTextFile = downloadTextFile;
23
+ exports.default = exports.downloadTextFile;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getResponsiveWidth = void 0;
4
+ const getResponsiveWidth = (scale, isMobile) => {
5
+ if (isMobile || scale === 1) {
6
+ return "100%";
7
+ }
8
+ return `${scale * 100}%`;
9
+ };
10
+ exports.getResponsiveWidth = getResponsiveWidth;
11
+ exports.default = exports.getResponsiveWidth;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileExtension = void 0;
4
+ const getFileExtension = (filename) => {
5
+ const lastDot = filename.lastIndexOf(".");
6
+ return lastDot !== -1 ? filename.slice(lastDot + 1).toLowerCase() : "";
7
+ };
8
+ exports.getFileExtension = getFileExtension;
9
+ exports.default = exports.getFileExtension;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadTextFile = exports.copyToClipboard = exports.getResponsiveWidth = exports.validateScale = exports.isValidYouTubeId = exports.isValidImageUrl = exports.isValidColor = exports.isMobileDevice = exports.createLogger = exports.formatTime = exports.createTimeout = exports.pathExists = exports.resolveAgainstProjectRoot = exports.resolveDataPath = exports.getFileExtension = exports.normalizeSystemPath = exports.normalizeBaseUrlPath = exports.processListItems = exports.withBasePath = exports.extractYouTubeId = exports.sanitizeFilename = exports.slugify = void 0;
4
+ // string
5
+ var slugify_js_1 = require("./string/slugify.js");
6
+ Object.defineProperty(exports, "slugify", { enumerable: true, get: function () { return slugify_js_1.slugify; } });
7
+ var sanitizeFilename_js_1 = require("./string/sanitizeFilename.js");
8
+ Object.defineProperty(exports, "sanitizeFilename", { enumerable: true, get: function () { return sanitizeFilename_js_1.sanitizeFilename; } });
9
+ var extractYouTubeId_js_1 = require("./string/extractYouTubeId.js");
10
+ Object.defineProperty(exports, "extractYouTubeId", { enumerable: true, get: function () { return extractYouTubeId_js_1.extractYouTubeId; } });
11
+ var withBasePath_js_1 = require("./string/withBasePath.js");
12
+ Object.defineProperty(exports, "withBasePath", { enumerable: true, get: function () { return withBasePath_js_1.withBasePath; } });
13
+ var processListItems_js_1 = require("./string/processListItems.js");
14
+ Object.defineProperty(exports, "processListItems", { enumerable: true, get: function () { return processListItems_js_1.processListItems; } });
15
+ var normalizeBaseUrlPath_js_1 = require("./string/normalizeBaseUrlPath.js");
16
+ Object.defineProperty(exports, "normalizeBaseUrlPath", { enumerable: true, get: function () { return normalizeBaseUrlPath_js_1.normalizeBaseUrlPath; } });
17
+ var normalizeSystemPath_js_1 = require("./string/normalizeSystemPath.js");
18
+ Object.defineProperty(exports, "normalizeSystemPath", { enumerable: true, get: function () { return normalizeSystemPath_js_1.normalizeSystemPath; } });
19
+ // file
20
+ var getFileExtension_js_1 = require("./file/getFileExtension.js");
21
+ Object.defineProperty(exports, "getFileExtension", { enumerable: true, get: function () { return getFileExtension_js_1.getFileExtension; } });
22
+ //path
23
+ var resolveDataPath_browser_js_1 = require("./path/resolveDataPath.browser.js");
24
+ Object.defineProperty(exports, "resolveDataPath", { enumerable: true, get: function () { return resolveDataPath_browser_js_1.resolveDataPath; } });
25
+ var resolveAgainstProjectRoot_browser_js_1 = require("./path/resolveAgainstProjectRoot.browser.js");
26
+ Object.defineProperty(exports, "resolveAgainstProjectRoot", { enumerable: true, get: function () { return resolveAgainstProjectRoot_browser_js_1.resolveAgainstProjectRoot; } });
27
+ var pathExists_browser_js_1 = require("./path/pathExists.browser.js");
28
+ Object.defineProperty(exports, "pathExists", { enumerable: true, get: function () { return pathExists_browser_js_1.pathExists; } });
29
+ // system
30
+ var createTimeout_js_1 = require("./system/createTimeout.js");
31
+ Object.defineProperty(exports, "createTimeout", { enumerable: true, get: function () { return createTimeout_js_1.createTimeout; } });
32
+ var formatTime_js_1 = require("./system/formatTime.js");
33
+ Object.defineProperty(exports, "formatTime", { enumerable: true, get: function () { return formatTime_js_1.formatTime; } });
34
+ var logger_browser_js_1 = require("./system/logger.browser.js");
35
+ Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return logger_browser_js_1.createLogger; } });
36
+ // validation
37
+ var isMobileDevice_js_1 = require("./validation/isMobileDevice.js");
38
+ Object.defineProperty(exports, "isMobileDevice", { enumerable: true, get: function () { return isMobileDevice_js_1.isMobileDevice; } });
39
+ var isValidColor_js_1 = require("./validation/isValidColor.js");
40
+ Object.defineProperty(exports, "isValidColor", { enumerable: true, get: function () { return isValidColor_js_1.isValidColor; } });
41
+ var isValidImageUrl_js_1 = require("./validation/isValidImageUrl.js");
42
+ Object.defineProperty(exports, "isValidImageUrl", { enumerable: true, get: function () { return isValidImageUrl_js_1.isValidImageUrl; } });
43
+ var isValidYouTubeId_js_1 = require("./validation/isValidYouTubeId.js");
44
+ Object.defineProperty(exports, "isValidYouTubeId", { enumerable: true, get: function () { return isValidYouTubeId_js_1.isValidYouTubeId; } });
45
+ var validateScale_js_1 = require("./validation/validateScale.js");
46
+ Object.defineProperty(exports, "validateScale", { enumerable: true, get: function () { return validateScale_js_1.validateScale; } });
47
+ // dom
48
+ var getResponsiveWidth_js_1 = require("./dom/getResponsiveWidth.js");
49
+ Object.defineProperty(exports, "getResponsiveWidth", { enumerable: true, get: function () { return getResponsiveWidth_js_1.getResponsiveWidth; } });
50
+ var copyToClipboard_js_1 = require("./dom/copyToClipboard.js");
51
+ Object.defineProperty(exports, "copyToClipboard", { enumerable: true, get: function () { return copyToClipboard_js_1.copyToClipboard; } });
52
+ var downloadTextFile_js_1 = require("./dom/downloadTextFile.js");
53
+ Object.defineProperty(exports, "downloadTextFile", { enumerable: true, get: function () { return downloadTextFile_js_1.downloadTextFile; } });
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadTextFile = exports.copyToClipboard = exports.getResponsiveWidth = exports.validateScale = exports.isValidYouTubeId = exports.isValidImageUrl = exports.isValidColor = exports.isMobileDevice = exports.createLogger = exports.formatTime = exports.createTimeout = exports.pathExists = exports.resolveAgainstProjectRoot = exports.resolveDataPath = exports.getFileExtension = exports.normalizeSystemPath = exports.normalizeBaseUrlPath = exports.processListItems = exports.withBasePath = exports.extractYouTubeId = exports.sanitizeFilename = exports.slugify = void 0;
4
+ // string
5
+ var slugify_js_1 = require("./string/slugify.js");
6
+ Object.defineProperty(exports, "slugify", { enumerable: true, get: function () { return slugify_js_1.slugify; } });
7
+ var sanitizeFilename_js_1 = require("./string/sanitizeFilename.js");
8
+ Object.defineProperty(exports, "sanitizeFilename", { enumerable: true, get: function () { return sanitizeFilename_js_1.sanitizeFilename; } });
9
+ var extractYouTubeId_js_1 = require("./string/extractYouTubeId.js");
10
+ Object.defineProperty(exports, "extractYouTubeId", { enumerable: true, get: function () { return extractYouTubeId_js_1.extractYouTubeId; } });
11
+ var withBasePath_js_1 = require("./string/withBasePath.js");
12
+ Object.defineProperty(exports, "withBasePath", { enumerable: true, get: function () { return withBasePath_js_1.withBasePath; } });
13
+ var processListItems_js_1 = require("./string/processListItems.js");
14
+ Object.defineProperty(exports, "processListItems", { enumerable: true, get: function () { return processListItems_js_1.processListItems; } });
15
+ var normalizeBaseUrlPath_js_1 = require("./string/normalizeBaseUrlPath.js");
16
+ Object.defineProperty(exports, "normalizeBaseUrlPath", { enumerable: true, get: function () { return normalizeBaseUrlPath_js_1.normalizeBaseUrlPath; } });
17
+ var normalizeSystemPath_js_1 = require("./string/normalizeSystemPath.js");
18
+ Object.defineProperty(exports, "normalizeSystemPath", { enumerable: true, get: function () { return normalizeSystemPath_js_1.normalizeSystemPath; } });
19
+ // file
20
+ var getFileExtension_js_1 = require("./file/getFileExtension.js");
21
+ Object.defineProperty(exports, "getFileExtension", { enumerable: true, get: function () { return getFileExtension_js_1.getFileExtension; } });
22
+ //path
23
+ var resolveDataPath_js_1 = require("./path/resolveDataPath.js");
24
+ Object.defineProperty(exports, "resolveDataPath", { enumerable: true, get: function () { return resolveDataPath_js_1.resolveDataPath; } });
25
+ var resolveAgainstProjectRoot_js_1 = require("./path/resolveAgainstProjectRoot.js");
26
+ Object.defineProperty(exports, "resolveAgainstProjectRoot", { enumerable: true, get: function () { return resolveAgainstProjectRoot_js_1.resolveAgainstProjectRoot; } });
27
+ var pathExists_js_1 = require("./path/pathExists.js");
28
+ Object.defineProperty(exports, "pathExists", { enumerable: true, get: function () { return pathExists_js_1.pathExists; } });
29
+ // system
30
+ var createTimeout_js_1 = require("./system/createTimeout.js");
31
+ Object.defineProperty(exports, "createTimeout", { enumerable: true, get: function () { return createTimeout_js_1.createTimeout; } });
32
+ var formatTime_js_1 = require("./system/formatTime.js");
33
+ Object.defineProperty(exports, "formatTime", { enumerable: true, get: function () { return formatTime_js_1.formatTime; } });
34
+ var logger_js_1 = require("./system/logger.js");
35
+ Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return logger_js_1.createLogger; } });
36
+ // validation
37
+ var isMobileDevice_js_1 = require("./validation/isMobileDevice.js");
38
+ Object.defineProperty(exports, "isMobileDevice", { enumerable: true, get: function () { return isMobileDevice_js_1.isMobileDevice; } });
39
+ var isValidColor_js_1 = require("./validation/isValidColor.js");
40
+ Object.defineProperty(exports, "isValidColor", { enumerable: true, get: function () { return isValidColor_js_1.isValidColor; } });
41
+ var isValidImageUrl_js_1 = require("./validation/isValidImageUrl.js");
42
+ Object.defineProperty(exports, "isValidImageUrl", { enumerable: true, get: function () { return isValidImageUrl_js_1.isValidImageUrl; } });
43
+ var isValidYouTubeId_js_1 = require("./validation/isValidYouTubeId.js");
44
+ Object.defineProperty(exports, "isValidYouTubeId", { enumerable: true, get: function () { return isValidYouTubeId_js_1.isValidYouTubeId; } });
45
+ var validateScale_js_1 = require("./validation/validateScale.js");
46
+ Object.defineProperty(exports, "validateScale", { enumerable: true, get: function () { return validateScale_js_1.validateScale; } });
47
+ // dom
48
+ var getResponsiveWidth_js_1 = require("./dom/getResponsiveWidth.js");
49
+ Object.defineProperty(exports, "getResponsiveWidth", { enumerable: true, get: function () { return getResponsiveWidth_js_1.getResponsiveWidth; } });
50
+ var copyToClipboard_js_1 = require("./dom/copyToClipboard.js");
51
+ Object.defineProperty(exports, "copyToClipboard", { enumerable: true, get: function () { return copyToClipboard_js_1.copyToClipboard; } });
52
+ var downloadTextFile_js_1 = require("./dom/downloadTextFile.js");
53
+ Object.defineProperty(exports, "downloadTextFile", { enumerable: true, get: function () { return downloadTextFile_js_1.downloadTextFile; } });
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pathExists = pathExists;
4
+ async function pathExists(_pathLike) {
5
+ throw new Error("pathExists is only available in a Node.js environment.");
6
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pathExists = pathExists;
4
+ const node_fs_1 = require("node:fs");
5
+ const promises_1 = require("node:fs/promises");
6
+ async function pathExists(pathLike) {
7
+ try {
8
+ await (0, promises_1.access)(pathLike, node_fs_1.constants.F_OK);
9
+ return true;
10
+ }
11
+ catch (error) {
12
+ if (error.code === "ENOENT")
13
+ return false;
14
+ throw error;
15
+ }
16
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveAgainstProjectRoot = resolveAgainstProjectRoot;
4
+ function resolveAgainstProjectRoot(candidate) {
5
+ throw new Error(`resolveAgainstProjectRoot("${candidate}") is only available in Node.js where project roots can be resolved.`);
6
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.resolveAgainstProjectRoot = resolveAgainstProjectRoot;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const app_root_path_1 = __importDefault(require("app-root-path"));
9
+ function resolveAgainstProjectRoot(candidate) {
10
+ return node_path_1.default.isAbsolute(candidate)
11
+ ? candidate
12
+ : node_path_1.default.join(app_root_path_1.default.path, candidate);
13
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveDataPath = resolveDataPath;
4
+ function resolveDataPath(_input) {
5
+ throw new Error("resolveDataPath is only available in a Node.js environment.");
6
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.resolveDataPath = resolveDataPath;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const normalizeSystemPath_js_1 = require("../string/normalizeSystemPath.js");
9
+ const resolveAgainstProjectRoot_js_1 = require("./resolveAgainstProjectRoot.js");
10
+ function resolveDataPath(input) {
11
+ const argv = process.argv.slice(2);
12
+ const i = argv.indexOf("--fsDataPath");
13
+ const fromCli = i !== -1 && argv[i + 1] ? argv[i + 1] : undefined;
14
+ const fromEnv = process.env.FS_DATA_PATH;
15
+ const candidate = input ?? fromCli ?? fromEnv ?? "./public/SST-Docs/data";
16
+ const abs = (0, resolveAgainstProjectRoot_js_1.resolveAgainstProjectRoot)(String(candidate));
17
+ return (0, normalizeSystemPath_js_1.normalizeSystemPath)(node_path_1.default.resolve(abs));
18
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractYouTubeId = void 0;
4
+ const extractYouTubeId = (url) => {
5
+ const patterns = [
6
+ /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\n?#]+)/,
7
+ /^([a-zA-Z0-9_-]{11})$/,
8
+ ];
9
+ for (const pattern of patterns) {
10
+ const match = url.match(pattern);
11
+ if (match && match[1]) {
12
+ return match[1];
13
+ }
14
+ }
15
+ return null;
16
+ };
17
+ exports.extractYouTubeId = extractYouTubeId;
18
+ exports.default = exports.extractYouTubeId;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeBaseUrlPath = normalizeBaseUrlPath;
4
+ function normalizeBaseUrlPath(basePath) {
5
+ if (!basePath)
6
+ return "/";
7
+ if (basePath === "/")
8
+ return "/";
9
+ const trimmed = basePath.replace(/\/+$/, "");
10
+ return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
11
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeSystemPath = normalizeSystemPath;
4
+ const DRIVE_ROOT_REGEX = /^[A-Za-z]:[\\/]*$/;
5
+ function normalizeSystemPath(p) {
6
+ const normalized = p.replace(/\\/g, "/");
7
+ if (normalized === "/") {
8
+ return "/";
9
+ }
10
+ if (DRIVE_ROOT_REGEX.test(normalized)) {
11
+ return `${normalized.slice(0, 2)}/`;
12
+ }
13
+ return normalized.replace(/\/+$/, "");
14
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processListItems = void 0;
4
+ const processListItems = (items) => {
5
+ return (items ?? [])
6
+ .map((item) => item.trim())
7
+ .filter((item) => item.length > 0);
8
+ };
9
+ exports.processListItems = processListItems;
10
+ exports.default = exports.processListItems;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitizeFilename = void 0;
4
+ const sanitizeFilename = (filename) => {
5
+ return filename
6
+ .replace(/[<>:"/\\|?*]/g, "_")
7
+ .replace(/\s+/g, "_")
8
+ .replace(/_+/g, "_")
9
+ .replace(/^_+|_+$/g, "")
10
+ .slice(0, 255);
11
+ };
12
+ exports.sanitizeFilename = sanitizeFilename;
13
+ exports.default = exports.sanitizeFilename;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.slugify = void 0;
4
+ const slugify = (text) => {
5
+ return text
6
+ .toLowerCase()
7
+ .trim()
8
+ .replace(/\s+/g, "-")
9
+ .replace(/[^\w-]/g, "");
10
+ };
11
+ exports.slugify = slugify;
12
+ exports.default = exports.slugify;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withBasePath = withBasePath;
4
+ function normalizePosixPath(value) {
5
+ if (!value)
6
+ return ".";
7
+ const isAbsolute = value.startsWith("/");
8
+ const segments = value.split("/");
9
+ const stack = [];
10
+ for (const segment of segments) {
11
+ if (!segment || segment === ".")
12
+ continue;
13
+ if (segment === "..") {
14
+ if (stack.length && stack[stack.length - 1] !== "..") {
15
+ stack.pop();
16
+ }
17
+ else if (!isAbsolute) {
18
+ stack.push("..");
19
+ }
20
+ }
21
+ else {
22
+ stack.push(segment);
23
+ }
24
+ }
25
+ let normalized = stack.join("/");
26
+ if (isAbsolute) {
27
+ normalized = `/${normalized}`;
28
+ }
29
+ else if (!normalized) {
30
+ normalized = ".";
31
+ }
32
+ const hasTrailingSlash = value.endsWith("/") && normalized !== "/" && !normalized.endsWith("/");
33
+ if (hasTrailingSlash) {
34
+ normalized += "/";
35
+ }
36
+ return normalized || (isAbsolute ? "/" : ".");
37
+ }
38
+ function joinUrlPath(basePath, rawChild) {
39
+ const normalizedBase = normalizePosixPath(basePath || "/");
40
+ const normalizedChild = normalizePosixPath(rawChild || "").replace(/^\/+/, "");
41
+ const baseWithLeadingSlash = normalizedBase.startsWith("/")
42
+ ? normalizedBase
43
+ : `/${normalizedBase}`;
44
+ return normalizePosixPath(`${baseWithLeadingSlash}/${normalizedChild}`);
45
+ }
46
+ function isAbsoluteUrl(value) {
47
+ try {
48
+ new URL(value);
49
+ return true;
50
+ }
51
+ catch {
52
+ return false;
53
+ }
54
+ }
55
+ function withBasePath(raw, baseUrl) {
56
+ if (!raw)
57
+ return "";
58
+ const trimmedRaw = raw.trim();
59
+ if (/^data:/i.test(trimmedRaw) ||
60
+ /^\/\//.test(trimmedRaw) ||
61
+ isAbsoluteUrl(trimmedRaw)) {
62
+ return trimmedRaw;
63
+ }
64
+ const trimmedBase = (baseUrl ?? "/").trim();
65
+ if (trimmedBase && isAbsoluteUrl(trimmedBase)) {
66
+ const url = new URL(trimmedBase);
67
+ url.pathname = joinUrlPath(url.pathname, trimmedRaw);
68
+ return url.toString();
69
+ }
70
+ const parsedBase = new URL(trimmedBase || "/", "http://local.placeholder");
71
+ const joinedPath = joinUrlPath(parsedBase.pathname, trimmedRaw);
72
+ return `${joinedPath}${parsedBase.search}${parsedBase.hash}`;
73
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTimeout = void 0;
4
+ const createTimeout = (callback, delay) => {
5
+ const timeoutId = setTimeout(callback, delay);
6
+ return {
7
+ clear: () => clearTimeout(timeoutId),
8
+ };
9
+ };
10
+ exports.createTimeout = createTimeout;
11
+ exports.default = exports.createTimeout;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatTime = void 0;
4
+ const formatTime = (seconds) => {
5
+ if (isNaN(seconds) || seconds < 0)
6
+ return "0:00";
7
+ const mins = Math.floor(seconds / 60);
8
+ const secs = Math.floor(seconds % 60);
9
+ return `${mins}:${secs.toString().padStart(2, "0")}`;
10
+ };
11
+ exports.formatTime = formatTime;
12
+ exports.default = exports.formatTime;