@intlayer/cli 6.1.6 → 7.0.0-canary.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.
Files changed (287) hide show
  1. package/dist/cjs/IntlayerEventListener.cjs +187 -239
  2. package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_utils_asset.cjs +104 -0
  4. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  5. package/dist/cjs/build.cjs +23 -42
  6. package/dist/cjs/build.cjs.map +1 -1
  7. package/dist/cjs/cli.cjs +370 -431
  8. package/dist/cjs/cli.cjs.map +1 -1
  9. package/dist/cjs/config.cjs +10 -35
  10. package/dist/cjs/config.cjs.map +1 -1
  11. package/dist/cjs/editor.cjs +51 -66
  12. package/dist/cjs/editor.cjs.map +1 -1
  13. package/dist/cjs/fill/fill.cjs +73 -301
  14. package/dist/cjs/fill/fill.cjs.map +1 -1
  15. package/dist/cjs/fill/formatAutoFillData.cjs +48 -106
  16. package/dist/cjs/fill/formatAutoFillData.cjs.map +1 -1
  17. package/dist/cjs/fill/formatAutoFilledFilePath.cjs +27 -43
  18. package/dist/cjs/fill/formatAutoFilledFilePath.cjs.map +1 -1
  19. package/dist/cjs/fill/formatFillData.cjs +50 -0
  20. package/dist/cjs/fill/formatFillData.cjs.map +1 -0
  21. package/dist/cjs/fill/groupLimiter.cjs +42 -0
  22. package/dist/cjs/fill/groupLimiter.cjs.map +1 -0
  23. package/dist/cjs/fill/index.cjs +5 -25
  24. package/dist/cjs/fill/listTranslationsTasks.cjs +77 -0
  25. package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -0
  26. package/dist/cjs/fill/test-original-case.cjs +10 -0
  27. package/dist/cjs/fill/test-original-case.cjs.map +1 -0
  28. package/dist/cjs/fill/translateDictionary.cjs +148 -0
  29. package/dist/cjs/fill/translateDictionary.cjs.map +1 -0
  30. package/dist/cjs/fill/writeAutoFill.cjs +48 -0
  31. package/dist/cjs/fill/writeAutoFill.cjs.map +1 -0
  32. package/dist/cjs/fill/writeFill.cjs +50 -0
  33. package/dist/cjs/fill/writeFill.cjs.map +1 -0
  34. package/dist/cjs/getTargetDictionary.cjs +36 -76
  35. package/dist/cjs/getTargetDictionary.cjs.map +1 -1
  36. package/dist/cjs/index.cjs +31 -45
  37. package/dist/cjs/listContentDeclaration.cjs +36 -64
  38. package/dist/cjs/listContentDeclaration.cjs.map +1 -1
  39. package/dist/cjs/liveSync.cjs +146 -221
  40. package/dist/cjs/liveSync.cjs.map +1 -1
  41. package/dist/cjs/pull.cjs +132 -195
  42. package/dist/cjs/pull.cjs.map +1 -1
  43. package/dist/cjs/push/pullLog.cjs +101 -144
  44. package/dist/cjs/push/pullLog.cjs.map +1 -1
  45. package/dist/cjs/push/push.cjs +159 -249
  46. package/dist/cjs/push/push.cjs.map +1 -1
  47. package/dist/cjs/pushConfig.cjs +18 -45
  48. package/dist/cjs/pushConfig.cjs.map +1 -1
  49. package/dist/cjs/pushLog.cjs +87 -128
  50. package/dist/cjs/pushLog.cjs.map +1 -1
  51. package/dist/cjs/reviewDoc.cjs +183 -291
  52. package/dist/cjs/reviewDoc.cjs.map +1 -1
  53. package/dist/cjs/test/index.cjs +52 -91
  54. package/dist/cjs/test/index.cjs.map +1 -1
  55. package/dist/cjs/test/listMissingTranslations.cjs +35 -62
  56. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  57. package/dist/cjs/translateDoc.cjs +127 -221
  58. package/dist/cjs/translateDoc.cjs.map +1 -1
  59. package/dist/cjs/utils/calculateChunks.cjs +85 -115
  60. package/dist/cjs/utils/calculateChunks.cjs.map +1 -1
  61. package/dist/cjs/utils/checkAccess.cjs +33 -72
  62. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  63. package/dist/cjs/utils/checkFileModifiedRange.cjs +75 -91
  64. package/dist/cjs/utils/checkFileModifiedRange.cjs.map +1 -1
  65. package/dist/cjs/utils/checkLastUpdateTime.cjs +17 -30
  66. package/dist/cjs/utils/checkLastUpdateTime.cjs.map +1 -1
  67. package/dist/cjs/utils/chunkInference.cjs +28 -47
  68. package/dist/cjs/utils/chunkInference.cjs.map +1 -1
  69. package/dist/cjs/utils/fixChunkStartEndChars.cjs +23 -42
  70. package/dist/cjs/utils/fixChunkStartEndChars.cjs.map +1 -1
  71. package/dist/cjs/utils/formatTimeDiff.cjs +17 -43
  72. package/dist/cjs/utils/formatTimeDiff.cjs.map +1 -1
  73. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +13 -32
  74. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs.map +1 -1
  75. package/dist/cjs/utils/getOutputFilePath.cjs +71 -86
  76. package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
  77. package/dist/cjs/utils/getParentPackageJSON.cjs +19 -44
  78. package/dist/cjs/utils/getParentPackageJSON.cjs.map +1 -1
  79. package/dist/cjs/utils/listSpecialChars.cjs +49 -73
  80. package/dist/cjs/utils/listSpecialChars.cjs.map +1 -1
  81. package/dist/cjs/utils/mapChunksBetweenFiles.cjs +90 -132
  82. package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -1
  83. package/dist/cjs/utils/reorderParagraphs.cjs +86 -118
  84. package/dist/cjs/utils/reorderParagraphs.cjs.map +1 -1
  85. package/dist/cjs/watch.cjs +21 -39
  86. package/dist/cjs/watch.cjs.map +1 -1
  87. package/dist/esm/IntlayerEventListener.mjs +178 -201
  88. package/dist/esm/IntlayerEventListener.mjs.map +1 -1
  89. package/dist/esm/_virtual/_utils_asset.mjs +100 -0
  90. package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
  91. package/dist/esm/build.mjs +20 -23
  92. package/dist/esm/build.mjs.map +1 -1
  93. package/dist/esm/cli.mjs +349 -380
  94. package/dist/esm/cli.mjs.map +1 -1
  95. package/dist/esm/config.mjs +8 -14
  96. package/dist/esm/config.mjs.map +1 -1
  97. package/dist/esm/editor.mjs +47 -41
  98. package/dist/esm/editor.mjs.map +1 -1
  99. package/dist/esm/fill/fill.mjs +68 -300
  100. package/dist/esm/fill/fill.mjs.map +1 -1
  101. package/dist/esm/fill/formatAutoFillData.mjs +47 -81
  102. package/dist/esm/fill/formatAutoFillData.mjs.map +1 -1
  103. package/dist/esm/fill/formatAutoFilledFilePath.mjs +25 -19
  104. package/dist/esm/fill/formatAutoFilledFilePath.mjs.map +1 -1
  105. package/dist/esm/fill/formatFillData.mjs +50 -0
  106. package/dist/esm/fill/formatFillData.mjs.map +1 -0
  107. package/dist/esm/fill/groupLimiter.mjs +40 -0
  108. package/dist/esm/fill/groupLimiter.mjs.map +1 -0
  109. package/dist/esm/fill/index.mjs +4 -3
  110. package/dist/esm/fill/listTranslationsTasks.mjs +70 -0
  111. package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -0
  112. package/dist/esm/fill/test-original-case.mjs +10 -0
  113. package/dist/esm/fill/test-original-case.mjs.map +1 -0
  114. package/dist/esm/fill/translateDictionary.mjs +141 -0
  115. package/dist/esm/fill/translateDictionary.mjs.map +1 -0
  116. package/dist/esm/fill/writeAutoFill.mjs +44 -0
  117. package/dist/esm/fill/writeAutoFill.mjs.map +1 -0
  118. package/dist/esm/fill/writeFill.mjs +45 -0
  119. package/dist/esm/fill/writeFill.mjs.map +1 -0
  120. package/dist/esm/getTargetDictionary.mjs +27 -48
  121. package/dist/esm/getTargetDictionary.mjs.map +1 -1
  122. package/dist/esm/index.mjs +15 -13
  123. package/dist/esm/listContentDeclaration.mjs +28 -43
  124. package/dist/esm/listContentDeclaration.mjs.map +1 -1
  125. package/dist/esm/liveSync.mjs +135 -187
  126. package/dist/esm/liveSync.mjs.map +1 -1
  127. package/dist/esm/pull.mjs +125 -178
  128. package/dist/esm/pull.mjs.map +1 -1
  129. package/dist/esm/push/pullLog.mjs +99 -125
  130. package/dist/esm/push/pullLog.mjs.map +1 -1
  131. package/dist/esm/push/push.mjs +149 -221
  132. package/dist/esm/push/push.mjs.map +1 -1
  133. package/dist/esm/pushConfig.mjs +14 -23
  134. package/dist/esm/pushConfig.mjs.map +1 -1
  135. package/dist/esm/pushLog.mjs +85 -109
  136. package/dist/esm/pushLog.mjs.map +1 -1
  137. package/dist/esm/reviewDoc.mjs +167 -264
  138. package/dist/esm/reviewDoc.mjs.map +1 -1
  139. package/dist/esm/test/index.mjs +47 -73
  140. package/dist/esm/test/index.mjs.map +1 -1
  141. package/dist/esm/test/listMissingTranslations.mjs +30 -41
  142. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  143. package/dist/esm/translateDoc.mjs +114 -193
  144. package/dist/esm/translateDoc.mjs.map +1 -1
  145. package/dist/esm/utils/calculateChunks.mjs +83 -91
  146. package/dist/esm/utils/calculateChunks.mjs.map +1 -1
  147. package/dist/esm/utils/checkAccess.mjs +28 -46
  148. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  149. package/dist/esm/utils/checkFileModifiedRange.mjs +73 -65
  150. package/dist/esm/utils/checkFileModifiedRange.mjs.map +1 -1
  151. package/dist/esm/utils/checkLastUpdateTime.mjs +15 -6
  152. package/dist/esm/utils/checkLastUpdateTime.mjs.map +1 -1
  153. package/dist/esm/utils/chunkInference.mjs +24 -24
  154. package/dist/esm/utils/chunkInference.mjs.map +1 -1
  155. package/dist/esm/utils/fixChunkStartEndChars.mjs +22 -18
  156. package/dist/esm/utils/fixChunkStartEndChars.mjs.map +1 -1
  157. package/dist/esm/utils/formatTimeDiff.mjs +16 -19
  158. package/dist/esm/utils/formatTimeDiff.mjs.map +1 -1
  159. package/dist/esm/utils/getIsFileUpdatedRecently.mjs +11 -8
  160. package/dist/esm/utils/getIsFileUpdatedRecently.mjs.map +1 -1
  161. package/dist/esm/utils/getOutputFilePath.mjs +70 -62
  162. package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
  163. package/dist/esm/utils/getParentPackageJSON.mjs +16 -20
  164. package/dist/esm/utils/getParentPackageJSON.mjs.map +1 -1
  165. package/dist/esm/utils/listSpecialChars.mjs +48 -49
  166. package/dist/esm/utils/listSpecialChars.mjs.map +1 -1
  167. package/dist/esm/utils/mapChunksBetweenFiles.mjs +87 -107
  168. package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -1
  169. package/dist/esm/utils/reorderParagraphs.mjs +85 -93
  170. package/dist/esm/utils/reorderParagraphs.mjs.map +1 -1
  171. package/dist/esm/watch.mjs +17 -17
  172. package/dist/esm/watch.mjs.map +1 -1
  173. package/dist/types/IntlayerEventListener.d.ts +63 -59
  174. package/dist/types/IntlayerEventListener.d.ts.map +1 -1
  175. package/dist/types/build.d.ts +10 -7
  176. package/dist/types/build.d.ts.map +1 -1
  177. package/dist/types/cli.d.ts +13 -10
  178. package/dist/types/cli.d.ts.map +1 -1
  179. package/dist/types/config.d.ts +7 -4
  180. package/dist/types/config.d.ts.map +1 -1
  181. package/dist/types/editor.d.ts +6 -4
  182. package/dist/types/editor.d.ts.map +1 -1
  183. package/dist/types/fill/fill.d.ts +20 -14
  184. package/dist/types/fill/fill.d.ts.map +1 -1
  185. package/dist/types/fill/formatAutoFillData.d.ts +10 -7
  186. package/dist/types/fill/formatAutoFillData.d.ts.map +1 -1
  187. package/dist/types/fill/formatAutoFilledFilePath.d.ts +6 -2
  188. package/dist/types/fill/formatAutoFilledFilePath.d.ts.map +1 -1
  189. package/dist/types/fill/formatFillData.d.ts +12 -0
  190. package/dist/types/fill/formatFillData.d.ts.map +1 -0
  191. package/dist/types/fill/groupLimiter.d.ts +15 -0
  192. package/dist/types/fill/groupLimiter.d.ts.map +1 -0
  193. package/dist/types/fill/index.d.ts +3 -3
  194. package/dist/types/fill/listTranslationsTasks.d.ts +15 -0
  195. package/dist/types/fill/listTranslationsTasks.d.ts.map +1 -0
  196. package/dist/types/fill/test-original-case.d.ts +1 -0
  197. package/dist/types/fill/translateDictionary.d.ts +19 -0
  198. package/dist/types/fill/translateDictionary.d.ts.map +1 -0
  199. package/dist/types/fill/writeAutoFill.d.ts +7 -0
  200. package/dist/types/fill/writeAutoFill.d.ts.map +1 -0
  201. package/dist/types/fill/writeFill.d.ts +7 -0
  202. package/dist/types/fill/writeFill.d.ts.map +1 -0
  203. package/dist/types/getTargetDictionary.d.ts +17 -13
  204. package/dist/types/getTargetDictionary.d.ts.map +1 -1
  205. package/dist/types/index.d.ts +15 -14
  206. package/dist/types/listContentDeclaration.d.ts +10 -7
  207. package/dist/types/listContentDeclaration.d.ts.map +1 -1
  208. package/dist/types/liveSync.d.ts +8 -3
  209. package/dist/types/liveSync.d.ts.map +1 -1
  210. package/dist/types/pull.d.ts +9 -6
  211. package/dist/types/pull.d.ts.map +1 -1
  212. package/dist/types/push/pullLog.d.ts +25 -21
  213. package/dist/types/push/pullLog.d.ts.map +1 -1
  214. package/dist/types/push/push.d.ts +13 -9
  215. package/dist/types/push/push.d.ts.map +1 -1
  216. package/dist/types/pushConfig.d.ts +7 -4
  217. package/dist/types/pushConfig.d.ts.map +1 -1
  218. package/dist/types/pushLog.d.ts +23 -20
  219. package/dist/types/pushLog.d.ts.map +1 -1
  220. package/dist/types/reviewDoc.d.ts +34 -17
  221. package/dist/types/reviewDoc.d.ts.map +1 -1
  222. package/dist/types/test/index.d.ts +9 -5
  223. package/dist/types/test/index.d.ts.map +1 -1
  224. package/dist/types/test/listMissingTranslations.d.ts +14 -10
  225. package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
  226. package/dist/types/translateDoc.d.ts +34 -17
  227. package/dist/types/translateDoc.d.ts.map +1 -1
  228. package/dist/types/utils/calculateChunks.d.ts +10 -7
  229. package/dist/types/utils/calculateChunks.d.ts.map +1 -1
  230. package/dist/types/utils/checkAccess.d.ts +8 -4
  231. package/dist/types/utils/checkAccess.d.ts.map +1 -1
  232. package/dist/types/utils/checkFileModifiedRange.d.ts +8 -6
  233. package/dist/types/utils/checkFileModifiedRange.d.ts.map +1 -1
  234. package/dist/types/utils/checkLastUpdateTime.d.ts +4 -1
  235. package/dist/types/utils/checkLastUpdateTime.d.ts.map +1 -1
  236. package/dist/types/utils/chunkInference.d.ts +9 -6
  237. package/dist/types/utils/chunkInference.d.ts.map +1 -1
  238. package/dist/types/utils/fixChunkStartEndChars.d.ts +4 -1
  239. package/dist/types/utils/fixChunkStartEndChars.d.ts.map +1 -1
  240. package/dist/types/utils/formatTimeDiff.d.ts +4 -1
  241. package/dist/types/utils/formatTimeDiff.d.ts.map +1 -1
  242. package/dist/types/utils/getIsFileUpdatedRecently.d.ts +4 -1
  243. package/dist/types/utils/getIsFileUpdatedRecently.d.ts.map +1 -1
  244. package/dist/types/utils/getOutputFilePath.d.ts +7 -2
  245. package/dist/types/utils/getOutputFilePath.d.ts.map +1 -1
  246. package/dist/types/utils/getParentPackageJSON.d.ts +30 -28
  247. package/dist/types/utils/getParentPackageJSON.d.ts.map +1 -1
  248. package/dist/types/utils/listSpecialChars.d.ts +9 -7
  249. package/dist/types/utils/listSpecialChars.d.ts.map +1 -1
  250. package/dist/types/utils/mapChunksBetweenFiles.d.ts +10 -6
  251. package/dist/types/utils/mapChunksBetweenFiles.d.ts.map +1 -1
  252. package/dist/types/utils/reorderParagraphs.d.ts +4 -1
  253. package/dist/types/utils/reorderParagraphs.d.ts.map +1 -1
  254. package/dist/types/watch.d.ts +9 -6
  255. package/dist/types/watch.d.ts.map +1 -1
  256. package/package.json +42 -47
  257. package/LICENSE +0 -202
  258. package/dist/cjs/fill/autoFill.cjs +0 -105
  259. package/dist/cjs/fill/autoFill.cjs.map +0 -1
  260. package/dist/cjs/fill/index.cjs.map +0 -1
  261. package/dist/cjs/index.cjs.map +0 -1
  262. package/dist/cjs/utils/getChunk.cjs +0 -77
  263. package/dist/cjs/utils/getChunk.cjs.map +0 -1
  264. package/dist/cjs/utils/splitTextByLine.cjs +0 -35
  265. package/dist/cjs/utils/splitTextByLine.cjs.map +0 -1
  266. package/dist/esm/fill/autoFill.mjs +0 -92
  267. package/dist/esm/fill/autoFill.mjs.map +0 -1
  268. package/dist/esm/fill/index.mjs.map +0 -1
  269. package/dist/esm/index.mjs.map +0 -1
  270. package/dist/esm/prompts/REVIEW_PROMPT.md +0 -37
  271. package/dist/esm/prompts/TRANSLATE_PROMPT.md +0 -38
  272. package/dist/esm/utils/calculrateChunkTest.md +0 -9
  273. package/dist/esm/utils/getChunk.mjs +0 -53
  274. package/dist/esm/utils/getChunk.mjs.map +0 -1
  275. package/dist/esm/utils/splitTextByLine.mjs +0 -11
  276. package/dist/esm/utils/splitTextByLine.mjs.map +0 -1
  277. package/dist/types/fill/autoFill.d.ts +0 -4
  278. package/dist/types/fill/autoFill.d.ts.map +0 -1
  279. package/dist/types/fill/index.d.ts.map +0 -1
  280. package/dist/types/index.d.ts.map +0 -1
  281. package/dist/types/utils/getChunk.d.ts +0 -9
  282. package/dist/types/utils/getChunk.d.ts.map +0 -1
  283. package/dist/types/utils/splitTextByLine.d.ts +0 -2
  284. package/dist/types/utils/splitTextByLine.d.ts.map +0 -1
  285. /package/dist/{cjs → assets}/prompts/REVIEW_PROMPT.md +0 -0
  286. /package/dist/{cjs → assets}/prompts/TRANSLATE_PROMPT.md +0 -0
  287. /package/dist/{cjs/utils/calculrateChunkTest.md → assets/utils/_calculateChunkTest.md} +0 -0
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var getChunk_exports = {};
20
- __export(getChunk_exports, {
21
- getChunk: () => getChunk
22
- });
23
- module.exports = __toCommonJS(getChunk_exports);
24
- var import_splitTextByLine = require('./splitTextByLine.cjs');
25
- const getChunk = (text, options = {}) => {
26
- const { lineStart, lineLength, charStart, charLength } = options;
27
- if (lineStart === void 0 && lineLength === void 0 && charStart === void 0 && charLength === void 0) {
28
- return text;
29
- }
30
- const lines = (0, import_splitTextByLine.splitTextByLines)(text);
31
- const getCharIndexOfLineStart = (lineNumber) => {
32
- if (lineNumber <= 0) return 0;
33
- let idx = 0;
34
- for (let i = 0; i < Math.min(lineNumber, lines.length); i++) {
35
- idx += lines[i].length;
36
- }
37
- return idx;
38
- };
39
- const getCharIndexOfLineEnd = (lineNumber) => {
40
- if (lineNumber >= lines.length) {
41
- return text.length;
42
- }
43
- const line = lines[lineNumber];
44
- const lineEnd = getCharIndexOfLineStart(lineNumber) + line.length;
45
- return lineEnd;
46
- };
47
- let effectiveStart = 0;
48
- let effectiveEnd = text.length;
49
- if (lineStart !== void 0) {
50
- effectiveStart = Math.max(
51
- effectiveStart,
52
- getCharIndexOfLineStart(lineStart)
53
- );
54
- }
55
- if (charStart !== void 0) {
56
- effectiveStart = Math.max(effectiveStart, charStart);
57
- }
58
- if (lineLength !== void 0) {
59
- const endLine = (lineStart ?? 0) + lineLength - 1;
60
- effectiveEnd = Math.min(effectiveEnd, getCharIndexOfLineEnd(endLine));
61
- }
62
- if (charLength !== void 0) {
63
- effectiveEnd = Math.min(
64
- effectiveEnd,
65
- (charStart ?? effectiveStart) + charLength
66
- );
67
- }
68
- if (effectiveStart >= effectiveEnd) {
69
- return "";
70
- }
71
- return text.slice(effectiveStart, effectiveEnd);
72
- };
73
- // Annotate the CommonJS export names for ESM import in node:
74
- 0 && (module.exports = {
75
- getChunk
76
- });
77
- //# sourceMappingURL=getChunk.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/getChunk.ts"],"sourcesContent":["import { splitTextByLines } from './splitTextByLine';\n\ntype TrunkOptions = {\n lineStart?: number;\n lineLength?: number;\n charStart?: number;\n charLength?: number;\n};\n\nexport const getChunk = (text: string, options: TrunkOptions = {}): string => {\n const { lineStart, lineLength, charStart, charLength } = options;\n\n // Fast-path: if no filters were provided, return the whole text\n if (\n lineStart === undefined &&\n lineLength === undefined &&\n charStart === undefined &&\n charLength === undefined\n ) {\n return text;\n }\n\n // ---------------------------------------------------------------------------\n // Utility helpers to convert between line numbers and absolute char indices\n // ---------------------------------------------------------------------------\n const lines = splitTextByLines(text);\n\n const getCharIndexOfLineStart = (lineNumber: number): number => {\n if (lineNumber <= 0) return 0;\n // Sum the length of every previous line\n let idx = 0;\n for (let i = 0; i < Math.min(lineNumber, lines.length); i++) {\n idx += lines[i].length;\n }\n return idx;\n };\n\n const getCharIndexOfLineEnd = (lineNumber: number): number => {\n // If the requested line number exceeds the number of lines, clamp to the last character\n if (lineNumber >= lines.length) {\n return text.length;\n }\n const line = lines[lineNumber];\n const lineEnd = getCharIndexOfLineStart(lineNumber) + line.length;\n\n return lineEnd;\n };\n\n // ---------------------------------------------------------------------------\n // Compute the effective (inclusive) charStart/charEnd for the requested slice\n // ---------------------------------------------------------------------------\n let effectiveStart = 0; // inclusive\n let effectiveEnd = text.length; // exclusive\n\n // Apply line boundaries if provided\n if (lineStart !== undefined) {\n effectiveStart = Math.max(\n effectiveStart,\n getCharIndexOfLineStart(lineStart)\n );\n }\n\n // Apply character boundaries if provided\n if (charStart !== undefined) {\n effectiveStart = Math.max(effectiveStart, charStart);\n }\n\n // Apply line length boundary from lineStart (or 0)\n if (lineLength !== undefined) {\n const endLine = (lineStart ?? 0) + lineLength - 1;\n effectiveEnd = Math.min(effectiveEnd, getCharIndexOfLineEnd(endLine));\n }\n\n // Apply character length boundary from effectiveStart\n if (charLength !== undefined) {\n effectiveEnd = Math.min(\n effectiveEnd,\n (charStart ?? effectiveStart) + charLength\n );\n }\n\n // If bounds do not overlap, return empty string\n if (effectiveStart >= effectiveEnd) {\n return '';\n }\n\n return text.slice(effectiveStart, effectiveEnd);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAiC;AAS1B,MAAM,WAAW,CAAC,MAAc,UAAwB,CAAC,MAAc;AAC5E,QAAM,EAAE,WAAW,YAAY,WAAW,WAAW,IAAI;AAGzD,MACE,cAAc,UACd,eAAe,UACf,cAAc,UACd,eAAe,QACf;AACA,WAAO;AAAA,EACT;AAKA,QAAM,YAAQ,yCAAiB,IAAI;AAEnC,QAAM,0BAA0B,CAAC,eAA+B;AAC9D,QAAI,cAAc,EAAG,QAAO;AAE5B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,KAAK,IAAI,YAAY,MAAM,MAAM,GAAG,KAAK;AAC3D,aAAO,MAAM,CAAC,EAAE;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,QAAM,wBAAwB,CAAC,eAA+B;AAE5D,QAAI,cAAc,MAAM,QAAQ;AAC9B,aAAO,KAAK;AAAA,IACd;AACA,UAAM,OAAO,MAAM,UAAU;AAC7B,UAAM,UAAU,wBAAwB,UAAU,IAAI,KAAK;AAE3D,WAAO;AAAA,EACT;AAKA,MAAI,iBAAiB;AACrB,MAAI,eAAe,KAAK;AAGxB,MAAI,cAAc,QAAW;AAC3B,qBAAiB,KAAK;AAAA,MACpB;AAAA,MACA,wBAAwB,SAAS;AAAA,IACnC;AAAA,EACF;AAGA,MAAI,cAAc,QAAW;AAC3B,qBAAiB,KAAK,IAAI,gBAAgB,SAAS;AAAA,EACrD;AAGA,MAAI,eAAe,QAAW;AAC5B,UAAM,WAAW,aAAa,KAAK,aAAa;AAChD,mBAAe,KAAK,IAAI,cAAc,sBAAsB,OAAO,CAAC;AAAA,EACtE;AAGA,MAAI,eAAe,QAAW;AAC5B,mBAAe,KAAK;AAAA,MAClB;AAAA,OACC,aAAa,kBAAkB;AAAA,IAClC;AAAA,EACF;AAGA,MAAI,kBAAkB,cAAc;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,MAAM,gBAAgB,YAAY;AAChD;","names":[]}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var splitTextByLine_exports = {};
20
- __export(splitTextByLine_exports, {
21
- splitTextByLines: () => splitTextByLines
22
- });
23
- module.exports = __toCommonJS(splitTextByLine_exports);
24
- const splitTextByLines = (text) => {
25
- const splittedText = text.match(/[^\n]*\n|[^\n]*$/g) ?? [];
26
- if (splittedText.length > 0 && splittedText.at(-1) === "") {
27
- splittedText.pop();
28
- }
29
- return splittedText;
30
- };
31
- // Annotate the CommonJS export names for ESM import in node:
32
- 0 && (module.exports = {
33
- splitTextByLines
34
- });
35
- //# sourceMappingURL=splitTextByLine.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/splitTextByLine.ts"],"sourcesContent":["export const splitTextByLines = (text: string): string[] => {\n const splittedText = text.match(/[^\\n]*\\n|[^\\n]*$/g) ?? [];\n\n if (splittedText.length > 0 && splittedText.at(-1) === '') {\n splittedText.pop();\n }\n\n return splittedText;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,mBAAmB,CAAC,SAA2B;AAC1D,QAAM,eAAe,KAAK,MAAM,mBAAmB,KAAK,CAAC;AAEzD,MAAI,aAAa,SAAS,KAAK,aAAa,GAAG,EAAE,MAAM,IAAI;AACzD,iBAAa,IAAI;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
@@ -1,92 +0,0 @@
1
- import {
2
- formatLocale,
3
- formatPath,
4
- reduceDictionaryContent,
5
- writeContentDeclaration
6
- } from "@intlayer/chokidar";
7
- import {
8
- colorizeKey,
9
- getAppLogger
10
- } from "@intlayer/config";
11
- import {
12
- getFilteredLocalesContent,
13
- getLocalisedContent
14
- } from "@intlayer/core";
15
- import { formatAutoFillData } from "./formatAutoFillData.mjs";
16
- const autoFill = async (fullDictionary, contentDeclarationFile, autoFillOptions, outputLocales, parentLocales, configuration) => {
17
- const appLogger = getAppLogger(configuration, {
18
- config: {
19
- prefix: ""
20
- }
21
- });
22
- let localeList = (outputLocales ?? configuration.internationalization.locales).filter((locale) => !parentLocales?.includes(locale));
23
- const filePath = contentDeclarationFile.filePath;
24
- if (!filePath) {
25
- appLogger("No file path found for dictionary", {
26
- level: "error"
27
- });
28
- return;
29
- }
30
- const autoFillData = formatAutoFillData(
31
- autoFillOptions,
32
- localeList,
33
- filePath,
34
- fullDictionary.key,
35
- configuration
36
- );
37
- for await (const output of autoFillData) {
38
- const reducedDictionary = reduceDictionaryContent(
39
- fullDictionary,
40
- contentDeclarationFile
41
- );
42
- if (output.isPerLocale) {
43
- const sourceLocale = output.localeList[0];
44
- const sourceLocaleContent = getLocalisedContent(
45
- reducedDictionary,
46
- sourceLocale,
47
- { dictionaryKey: reducedDictionary.key, keyPath: [] }
48
- );
49
- await writeContentDeclaration({
50
- ...fullDictionary,
51
- locale: sourceLocale,
52
- autoFilled: true,
53
- autoFill: void 0,
54
- content: sourceLocaleContent.content,
55
- filePath: output.filePath
56
- });
57
- if (output.filePath) {
58
- appLogger(
59
- `Auto filled per-locale content declaration for '${colorizeKey(fullDictionary.key)}' written to ${formatPath(output.filePath)} for locale ${formatLocale(sourceLocale)}`,
60
- {
61
- level: "info"
62
- }
63
- );
64
- }
65
- } else {
66
- const content = getFilteredLocalesContent(
67
- reducedDictionary.content,
68
- output.localeList,
69
- { dictionaryKey: reducedDictionary.key, keyPath: [] }
70
- );
71
- await writeContentDeclaration({
72
- ...fullDictionary,
73
- autoFilled: true,
74
- autoFill: void 0,
75
- content,
76
- filePath: output.filePath
77
- });
78
- if (output.filePath) {
79
- appLogger(
80
- `Auto filled content declaration for '${colorizeKey(fullDictionary.key)}' written to ${formatPath(output.filePath)}`,
81
- {
82
- level: "info"
83
- }
84
- );
85
- }
86
- }
87
- }
88
- };
89
- export {
90
- autoFill
91
- };
92
- //# sourceMappingURL=autoFill.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/fill/autoFill.ts"],"sourcesContent":["import {\n formatLocale,\n formatPath,\n reduceDictionaryContent,\n writeContentDeclaration,\n} from '@intlayer/chokidar';\nimport {\n colorizeKey,\n getAppLogger,\n type IntlayerConfig,\n Locales,\n} from '@intlayer/config';\nimport {\n type AutoFill,\n type ContentNode,\n type Dictionary,\n getFilteredLocalesContent,\n getLocalisedContent,\n} from '@intlayer/core';\nimport { AutoFillData, formatAutoFillData } from './formatAutoFillData';\n\nexport const autoFill = async (\n fullDictionary: Dictionary,\n contentDeclarationFile: Dictionary,\n autoFillOptions: AutoFill,\n outputLocales: Locales[],\n parentLocales: Locales[],\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration, {\n config: {\n prefix: '',\n },\n });\n let localeList: Locales[] = (\n outputLocales ?? configuration.internationalization.locales\n ).filter((locale) => !parentLocales?.includes(locale));\n\n const filePath = contentDeclarationFile.filePath;\n\n if (!filePath) {\n appLogger('No file path found for dictionary', {\n level: 'error',\n });\n return;\n }\n\n const autoFillData: AutoFillData[] = formatAutoFillData(\n autoFillOptions,\n localeList,\n filePath,\n fullDictionary.key,\n configuration\n );\n\n for await (const output of autoFillData) {\n const reducedDictionary = reduceDictionaryContent(\n fullDictionary,\n contentDeclarationFile\n );\n\n if (output.isPerLocale) {\n const sourceLocale = output.localeList[0];\n\n const sourceLocaleContent = getLocalisedContent(\n reducedDictionary as unknown as ContentNode,\n sourceLocale,\n { dictionaryKey: reducedDictionary.key, keyPath: [] }\n );\n\n await writeContentDeclaration({\n ...fullDictionary,\n locale: sourceLocale,\n autoFilled: true,\n autoFill: undefined,\n content: sourceLocaleContent.content,\n filePath: output.filePath,\n });\n\n if (output.filePath) {\n appLogger(\n `Auto filled per-locale content declaration for '${colorizeKey(fullDictionary.key)}' written to ${formatPath(output.filePath)} for locale ${formatLocale(sourceLocale)}`,\n {\n level: 'info',\n }\n );\n }\n } else {\n const content = getFilteredLocalesContent(\n reducedDictionary.content as unknown as ContentNode,\n output.localeList,\n { dictionaryKey: reducedDictionary.key, keyPath: [] }\n );\n\n // write file\n await writeContentDeclaration({\n ...fullDictionary,\n autoFilled: true,\n autoFill: undefined,\n content,\n filePath: output.filePath,\n });\n\n if (output.filePath) {\n appLogger(\n `Auto filled content declaration for '${colorizeKey(fullDictionary.key)}' written to ${formatPath(output.filePath)}`,\n {\n level: 'info',\n }\n );\n }\n }\n }\n};\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP;AAAA,EAIE;AAAA,EACA;AAAA,OACK;AACP,SAAuB,0BAA0B;AAE1C,MAAM,WAAW,OACtB,gBACA,wBACA,iBACA,eACA,eACA,kBACG;AACH,QAAM,YAAY,aAAa,eAAe;AAAA,IAC5C,QAAQ;AAAA,MACN,QAAQ;AAAA,IACV;AAAA,EACF,CAAC;AACD,MAAI,cACF,iBAAiB,cAAc,qBAAqB,SACpD,OAAO,CAAC,WAAW,CAAC,eAAe,SAAS,MAAM,CAAC;AAErD,QAAM,WAAW,uBAAuB;AAExC,MAAI,CAAC,UAAU;AACb,cAAU,qCAAqC;AAAA,MAC7C,OAAO;AAAA,IACT,CAAC;AACD;AAAA,EACF;AAEA,QAAM,eAA+B;AAAA,IACnC;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf;AAAA,EACF;AAEA,mBAAiB,UAAU,cAAc;AACvC,UAAM,oBAAoB;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AAEA,QAAI,OAAO,aAAa;AACtB,YAAM,eAAe,OAAO,WAAW,CAAC;AAExC,YAAM,sBAAsB;AAAA,QAC1B;AAAA,QACA;AAAA,QACA,EAAE,eAAe,kBAAkB,KAAK,SAAS,CAAC,EAAE;AAAA,MACtD;AAEA,YAAM,wBAAwB;AAAA,QAC5B,GAAG;AAAA,QACH,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,SAAS,oBAAoB;AAAA,QAC7B,UAAU,OAAO;AAAA,MACnB,CAAC;AAED,UAAI,OAAO,UAAU;AACnB;AAAA,UACE,mDAAmD,YAAY,eAAe,GAAG,CAAC,gBAAgB,WAAW,OAAO,QAAQ,CAAC,eAAe,aAAa,YAAY,CAAC;AAAA,UACtK;AAAA,YACE,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,IACF,OAAO;AACL,YAAM,UAAU;AAAA,QACd,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,EAAE,eAAe,kBAAkB,KAAK,SAAS,CAAC,EAAE;AAAA,MACtD;AAGA,YAAM,wBAAwB;AAAA,QAC5B,GAAG;AAAA,QACH,YAAY;AAAA,QACZ,UAAU;AAAA,QACV;AAAA,QACA,UAAU,OAAO;AAAA,MACnB,CAAC;AAED,UAAI,OAAO,UAAU;AACnB;AAAA,UACE,wCAAwC,YAAY,eAAe,GAAG,CAAC,gBAAgB,WAAW,OAAO,QAAQ,CAAC;AAAA,UAClH;AAAA,YACE,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/fill/index.ts"],"sourcesContent":["export * from './autoFill';\nexport * from './fill';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type * from '@intlayer/chokidar';\nexport * from './build';\nexport * from './cli';\nexport * from './editor';\nexport * from './fill/fill';\nexport * from './listContentDeclaration';\nexport * from './liveSync';\nexport * from './pull';\nexport * from './push/push';\nexport * from './pushConfig';\nexport * from './reviewDoc';\nexport * from './test';\nexport * from './translateDoc';\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1,37 +0,0 @@
1
- You are an expert in internationalisation, technical documentation and multilingual content auditing. Your task is to **audit an existing translation** against its {{baseLocaleName}} source and make it fully up-to-date.
2
-
3
- # Base instructions
4
-
5
- 1. **Goal of the audit**
6
-
7
- - Insert any **missing paragraphs, lists, tables, code blocks or images** that have been introduced in the base file since the last translation.
8
- - **Correct spelling, grammar, punctuation or Markdown syntax errors** that may exist in the current translation.
9
- - Keep all **code blocks** and **variable names** in the same language as the base file, but translate the **comments** inside the code blocks to {{localeName}}. Example: `internationalization: {` should stay `internationalization: {`. You should not replace the `z` by a `s`.
10
- - Do **not** change sentences that are already correct. Do not reflow or re-word translated sentences unless it is strictly necessary for correctness.
11
- - To ensure all characters are included in the reviewed content, you should use "///chunkStart///" and "///chunkEnd///" to delimit the chunk of the reviewed content. You should not use "---" or "```" to delimit the chunk of the reviewed content.
12
-
13
- 2. **Output requirements**
14
-
15
- - Return **only the full, updated file content in {{localeName}}** ‑ no explanations or surrounding code fences.
16
- - All existing correct content must remain **byte-for-byte identical** unless a fix is required (see above).
17
- - New or updated content must be placed in the correct position so that the overall structure mirrors the English file.
18
- - If overlapping chunks are found, you should include the exact same content than provided in the user message.
19
-
20
- 3. **Locales**
21
-
22
- - Source locale: {{baseLocaleName}}
23
- - Target locale: {{localeName}}
24
-
25
- 4. **Output Example:**
26
-
27
- Entry (en - English (US)): "///chunkStart/// - Here the translated content///chunkEnd///"
28
- Entry (fr - French): "///chunkStart/// - Ici le contenu trraduit ce mardi 25 juin 2025///chunkEnd///"
29
- Expected Output (fr - French): "///chunkStart/// - Ici le contenu traduit///chunkEnd///"
30
-
31
- # Custom instructions
32
-
33
- {{customInstructions}}
34
-
35
- # Application context
36
-
37
- {{applicationContext}}
@@ -1,38 +0,0 @@
1
- You are an expert in internationalization and content management. Your task is to translate the following documentation into {{localeName}}.
2
-
3
- # Base instructions
4
-
5
- 1. **Requirement:**
6
-
7
- - You should only translate the text, and titles of the file.
8
- - You should not alter the structure of the file.
9
- - You should not alter the code logic of code elements.
10
- - You should consider the context of the solution (Intlayer), and write for the user of the solution (developer).
11
- - In the code elements, the naming of the variables should be made in the same language as the base file. But the comments should be in {{localeName}}.
12
- - You should return the translated file in {{localeName}} without any additional comments or explanations.
13
- - To ensure all characters are included in the translated content, you should use "///chunkStart///" and "///chunkEnd///" to delimit the translated content. You should not use "---" or "```" to delimit the translated content.
14
- - Anyway the length of the chunk to translate, you should translate the whole chunk and do not skip any part. You should ensure that each part of the chunk is translated.
15
- - Each title should be translated and present in the output file.
16
- - Each listing point should be translated and present in the output file.
17
- - Each code element should be translated and present in the output file.
18
- - Each image should be translated and present in the output file.
19
- - Each link should be translated and present in the output file.
20
- - If overlapping chunks are found, you should include the exact same content than provided in the user message.
21
-
22
- 2. **Locales:**
23
-
24
- - Base file locale: {{baseLocaleName}}
25
- - Desired Final file language: {{localeName}}
26
-
27
- 3. **Output Example:**
28
-
29
- Entry (en - English (US)): "///chunkStart/// - Here the translated content///chunkEnd///"
30
- Expected Output (fr - French): "///chunkStart/// - Ici le contenu traduit///chunkEnd///"
31
-
32
- # Custom instructions
33
-
34
- {{customInstructions}}
35
-
36
- # Application context
37
-
38
- {{applicationContext}}
@@ -1,9 +0,0 @@
1
- Lorem ipsum dolor sit amet consectetur adipiscing elit. Blandit quis suspendisse aliquet nisi sodales consequat magna. Sem placerat in id cursus mi pretium tellus. Finibus facilisis dapibus etiam interdum tortor ligula congue. Sed diam urna tempor pulvinar vivamus fringilla lacus. Porta elementum a enim euismod quam justo lectus. Nisl malesuada lacinia integer nunc posuere ut hendrerit. Imperdiet mollis nullam volutpat porttitor ullamcorper rutrum gravida. Ad litora torquent per conubia nostra inceptos himenaeos. Ornare sagittis vehicula praesent dui felis venenatis ultrices. Dis parturient montes nascetur ridiculus mus donec rhoncus. Potenti ultricies habitant morbi senectus netus suscipit auctor. Maximus eget fermentum odio phasellus non purus est. Platea dictumst lorem ipsum dolor sit amet consectetur. Dictum risus blandit quis suspendisse aliquet nisi sodales. Vitae pellentesque sem placerat in id cursus mi. Luctus nibh finibus facilisis dapibus etiam interdum tortor. Eu aenean sed diam urna tempor pulvinar vivamus. Tincidunt nam porta elementum a enim euismod quam. Iaculis massa nisl malesuada lacinia integer nunc posuere. Velit aliquam imperdiet mollis nullam volutpat porttitor ullamcorper. Taciti sociosqu ad litora torquent per conubia nostra.
2
-
3
- Primis vulputate ornare sagittis vehicula praesent dui felis. Et magnis dis parturient montes nascetur ridiculus mus. Accumsan maecenas potenti ultricies habitant morbi senectus netus. Mattis scelerisque maximus eget fermentum odio phasellus non. Hac habitasse platea dictumst lorem ipsum dolor sit. Vestibulum fusce dictum risus blandit quis suspendisse aliquet. Ex sapien vitae pellentesque sem placerat in id. Neque at luctus nibh finibus facilisis dapibus etiam. Tempus leo eu aenean sed diam urna tempor. Viverra ac tincidunt nam porta elementum a enim. Bibendum egestas iaculis massa nisl malesuada lacinia integer. Arcu dignissim velit aliquam imperdiet mollis nullam volutpat. Class aptent taciti sociosqu ad litora torquent per. Turpis fames primis vulputate ornare sagittis vehicula praesent. Natoque penatibus et magnis dis parturient montes nascetur. Feugiat tristique accumsan maecenas potenti ultricies habitant morbi. Nulla molestie mattis scelerisque maximus eget fermentum odio. Cubilia curae hac habitasse platea dictumst lorem ipsum. Mauris pharetra vestibulum fusce dictum risus blandit quis. Quisque faucibus ex sapien vitae pellentesque sem placerat. Ante condimentum neque at luctus nibh finibus facilisis. Duis convallis tempus leo eu aenean sed diam. Sollicitudin erat viverra ac tincidunt nam porta elementum. Nec metus bibendum egestas iaculis massa nisl malesuada.
4
-
5
- Commodo augue arcu dignissim velit aliquam imperdiet mollis. Semper vel class aptent taciti sociosqu ad litora. Cras eleifend turpis fames primis vulputate ornare sagittis. Orci varius natoque penatibus et magnis dis parturient. Proin libero feugiat tristique accumsan maecenas potenti ultricies. Eros lobortis nulla molestie mattis scelerisque maximus eget. Curabitur facilisi cubilia curae hac habitasse platea dictumst. Efficitur laoreet mauris pharetra vestibulum fusce dictum risus. Adipiscing elit quisque faucibus ex sapien vitae pellentesque. Consequat magna ante condimentum neque at luctus nibh. Pretium tellus duis convallis tempus leo eu aenean. Ligula congue sollicitudin erat viverra ac tincidunt nam. Fringilla lacus nec metus bibendum egestas iaculis massa. Justo lectus commodo augue arcu dignissim velit aliquam. Ut hendrerit semper vel class aptent taciti sociosqu. Rutrum gravida cras eleifend turpis fames primis vulputate. Inceptos himenaeos orci varius natoque penatibus et magnis. Venenatis ultrices proin libero feugiat tristique accumsan maecenas. Donec rhoncus eros lobortis nulla molestie mattis scelerisque. Suscipit auctor curabitur facilisi cubilia curae hac habitasse. Purus est efficitur laoreet mauris pharetra vestibulum fusce. Amet consectetur adipiscing elit quisque faucibus ex sapien. Nisi sodales consequat magna ante condimentum neque at. Cursus mi pretium tellus duis convallis tempus leo. Interdum tortor ligula congue sollicitudin erat viverra ac.
6
-
7
- Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Euismod quam justo lectus commodo augue arcu dignissim. Nunc posuere ut hendrerit semper vel class aptent. Porttitor ullamcorper rutrum gravida cras eleifend turpis fames. Conubia nostra inceptos himenaeos orci varius natoque penatibus. Dui felis venenatis ultrices proin libero feugiat tristique. Ridiculus mus donec rhoncus eros lobortis nulla molestie. Senectus netus suscipit auctor curabitur facilisi cubilia curae. Phasellus non purus est efficitur laoreet mauris pharetra. Dolor sit amet consectetur adipiscing elit quisque faucibus. Suspendisse aliquet nisi sodales consequat magna ante condimentum. In id cursus mi pretium tellus duis convallis.
8
-
9
- Dapibus etiam interdum tortor ligula congue sollicitudin erat. Urna tempor pulvinar vivamus fringilla lacus nec metus. Aenim euismod quam justo lectus commodo augue. Lacinia integer nunc posuere ut hendrerit semper vel. Nullam volutpat porttitor ullamcorper rutrum gravida cras eleifend. Torquent per conubia nostra inceptos himenaeos orci varius. Vehicula praesent dui felis venenatis ultrices proin libero. Montes nascetur ridiculus mus donec rhoncus eros lobortis. Habitant morbi senectus netus suscipit auctor curabitur facilisi. Fermentum odio phasellus non purus est efficitur laoreet. Lorem ipsum dolor sit amet consectetur adipiscing elit. Blandit quis suspendisse aliquet nisi sodales consequat magna. Sem placerat in id cursus mi pretium tellus. Finibus facilisis dapibus etiam interdum tortor ligula congue. Sed diam urna tempor pulvinar vivamus fringilla lacus. Porta elementum a enim euismod quam justo lectus. Nisl malesuada lacinia integer nunc posuere ut hendrerit.
@@ -1,53 +0,0 @@
1
- import { splitTextByLines } from "./splitTextByLine.mjs";
2
- const getChunk = (text, options = {}) => {
3
- const { lineStart, lineLength, charStart, charLength } = options;
4
- if (lineStart === void 0 && lineLength === void 0 && charStart === void 0 && charLength === void 0) {
5
- return text;
6
- }
7
- const lines = splitTextByLines(text);
8
- const getCharIndexOfLineStart = (lineNumber) => {
9
- if (lineNumber <= 0) return 0;
10
- let idx = 0;
11
- for (let i = 0; i < Math.min(lineNumber, lines.length); i++) {
12
- idx += lines[i].length;
13
- }
14
- return idx;
15
- };
16
- const getCharIndexOfLineEnd = (lineNumber) => {
17
- if (lineNumber >= lines.length) {
18
- return text.length;
19
- }
20
- const line = lines[lineNumber];
21
- const lineEnd = getCharIndexOfLineStart(lineNumber) + line.length;
22
- return lineEnd;
23
- };
24
- let effectiveStart = 0;
25
- let effectiveEnd = text.length;
26
- if (lineStart !== void 0) {
27
- effectiveStart = Math.max(
28
- effectiveStart,
29
- getCharIndexOfLineStart(lineStart)
30
- );
31
- }
32
- if (charStart !== void 0) {
33
- effectiveStart = Math.max(effectiveStart, charStart);
34
- }
35
- if (lineLength !== void 0) {
36
- const endLine = (lineStart ?? 0) + lineLength - 1;
37
- effectiveEnd = Math.min(effectiveEnd, getCharIndexOfLineEnd(endLine));
38
- }
39
- if (charLength !== void 0) {
40
- effectiveEnd = Math.min(
41
- effectiveEnd,
42
- (charStart ?? effectiveStart) + charLength
43
- );
44
- }
45
- if (effectiveStart >= effectiveEnd) {
46
- return "";
47
- }
48
- return text.slice(effectiveStart, effectiveEnd);
49
- };
50
- export {
51
- getChunk
52
- };
53
- //# sourceMappingURL=getChunk.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/getChunk.ts"],"sourcesContent":["import { splitTextByLines } from './splitTextByLine';\n\ntype TrunkOptions = {\n lineStart?: number;\n lineLength?: number;\n charStart?: number;\n charLength?: number;\n};\n\nexport const getChunk = (text: string, options: TrunkOptions = {}): string => {\n const { lineStart, lineLength, charStart, charLength } = options;\n\n // Fast-path: if no filters were provided, return the whole text\n if (\n lineStart === undefined &&\n lineLength === undefined &&\n charStart === undefined &&\n charLength === undefined\n ) {\n return text;\n }\n\n // ---------------------------------------------------------------------------\n // Utility helpers to convert between line numbers and absolute char indices\n // ---------------------------------------------------------------------------\n const lines = splitTextByLines(text);\n\n const getCharIndexOfLineStart = (lineNumber: number): number => {\n if (lineNumber <= 0) return 0;\n // Sum the length of every previous line\n let idx = 0;\n for (let i = 0; i < Math.min(lineNumber, lines.length); i++) {\n idx += lines[i].length;\n }\n return idx;\n };\n\n const getCharIndexOfLineEnd = (lineNumber: number): number => {\n // If the requested line number exceeds the number of lines, clamp to the last character\n if (lineNumber >= lines.length) {\n return text.length;\n }\n const line = lines[lineNumber];\n const lineEnd = getCharIndexOfLineStart(lineNumber) + line.length;\n\n return lineEnd;\n };\n\n // ---------------------------------------------------------------------------\n // Compute the effective (inclusive) charStart/charEnd for the requested slice\n // ---------------------------------------------------------------------------\n let effectiveStart = 0; // inclusive\n let effectiveEnd = text.length; // exclusive\n\n // Apply line boundaries if provided\n if (lineStart !== undefined) {\n effectiveStart = Math.max(\n effectiveStart,\n getCharIndexOfLineStart(lineStart)\n );\n }\n\n // Apply character boundaries if provided\n if (charStart !== undefined) {\n effectiveStart = Math.max(effectiveStart, charStart);\n }\n\n // Apply line length boundary from lineStart (or 0)\n if (lineLength !== undefined) {\n const endLine = (lineStart ?? 0) + lineLength - 1;\n effectiveEnd = Math.min(effectiveEnd, getCharIndexOfLineEnd(endLine));\n }\n\n // Apply character length boundary from effectiveStart\n if (charLength !== undefined) {\n effectiveEnd = Math.min(\n effectiveEnd,\n (charStart ?? effectiveStart) + charLength\n );\n }\n\n // If bounds do not overlap, return empty string\n if (effectiveStart >= effectiveEnd) {\n return '';\n }\n\n return text.slice(effectiveStart, effectiveEnd);\n};\n"],"mappings":"AAAA,SAAS,wBAAwB;AAS1B,MAAM,WAAW,CAAC,MAAc,UAAwB,CAAC,MAAc;AAC5E,QAAM,EAAE,WAAW,YAAY,WAAW,WAAW,IAAI;AAGzD,MACE,cAAc,UACd,eAAe,UACf,cAAc,UACd,eAAe,QACf;AACA,WAAO;AAAA,EACT;AAKA,QAAM,QAAQ,iBAAiB,IAAI;AAEnC,QAAM,0BAA0B,CAAC,eAA+B;AAC9D,QAAI,cAAc,EAAG,QAAO;AAE5B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,KAAK,IAAI,YAAY,MAAM,MAAM,GAAG,KAAK;AAC3D,aAAO,MAAM,CAAC,EAAE;AAAA,IAClB;AACA,WAAO;AAAA,EACT;AAEA,QAAM,wBAAwB,CAAC,eAA+B;AAE5D,QAAI,cAAc,MAAM,QAAQ;AAC9B,aAAO,KAAK;AAAA,IACd;AACA,UAAM,OAAO,MAAM,UAAU;AAC7B,UAAM,UAAU,wBAAwB,UAAU,IAAI,KAAK;AAE3D,WAAO;AAAA,EACT;AAKA,MAAI,iBAAiB;AACrB,MAAI,eAAe,KAAK;AAGxB,MAAI,cAAc,QAAW;AAC3B,qBAAiB,KAAK;AAAA,MACpB;AAAA,MACA,wBAAwB,SAAS;AAAA,IACnC;AAAA,EACF;AAGA,MAAI,cAAc,QAAW;AAC3B,qBAAiB,KAAK,IAAI,gBAAgB,SAAS;AAAA,EACrD;AAGA,MAAI,eAAe,QAAW;AAC5B,UAAM,WAAW,aAAa,KAAK,aAAa;AAChD,mBAAe,KAAK,IAAI,cAAc,sBAAsB,OAAO,CAAC;AAAA,EACtE;AAGA,MAAI,eAAe,QAAW;AAC5B,mBAAe,KAAK;AAAA,MAClB;AAAA,OACC,aAAa,kBAAkB;AAAA,IAClC;AAAA,EACF;AAGA,MAAI,kBAAkB,cAAc;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,MAAM,gBAAgB,YAAY;AAChD;","names":[]}
@@ -1,11 +0,0 @@
1
- const splitTextByLines = (text) => {
2
- const splittedText = text.match(/[^\n]*\n|[^\n]*$/g) ?? [];
3
- if (splittedText.length > 0 && splittedText.at(-1) === "") {
4
- splittedText.pop();
5
- }
6
- return splittedText;
7
- };
8
- export {
9
- splitTextByLines
10
- };
11
- //# sourceMappingURL=splitTextByLine.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/splitTextByLine.ts"],"sourcesContent":["export const splitTextByLines = (text: string): string[] => {\n const splittedText = text.match(/[^\\n]*\\n|[^\\n]*$/g) ?? [];\n\n if (splittedText.length > 0 && splittedText.at(-1) === '') {\n splittedText.pop();\n }\n\n return splittedText;\n};\n"],"mappings":"AAAO,MAAM,mBAAmB,CAAC,SAA2B;AAC1D,QAAM,eAAe,KAAK,MAAM,mBAAmB,KAAK,CAAC;AAEzD,MAAI,aAAa,SAAS,KAAK,aAAa,GAAG,EAAE,MAAM,IAAI;AACzD,iBAAa,IAAI;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
@@ -1,4 +0,0 @@
1
- import { type IntlayerConfig, Locales } from '@intlayer/config';
2
- import { type AutoFill, type Dictionary } from '@intlayer/core';
3
- export declare const autoFill: (fullDictionary: Dictionary, contentDeclarationFile: Dictionary, autoFillOptions: AutoFill, outputLocales: Locales[], parentLocales: Locales[], configuration: IntlayerConfig) => Promise<void>;
4
- //# sourceMappingURL=autoFill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autoFill.d.ts","sourceRoot":"","sources":["../../../src/fill/autoFill.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,cAAc,EACnB,OAAO,EACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,QAAQ,EAEb,KAAK,UAAU,EAGhB,MAAM,gBAAgB,CAAC;AAGxB,eAAO,MAAM,QAAQ,GACnB,gBAAgB,UAAU,EAC1B,wBAAwB,UAAU,EAClC,iBAAiB,QAAQ,EACzB,eAAe,OAAO,EAAE,EACxB,eAAe,OAAO,EAAE,EACxB,eAAe,cAAc,kBAsF9B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fill/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,oBAAoB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC"}
@@ -1,9 +0,0 @@
1
- type TrunkOptions = {
2
- lineStart?: number;
3
- lineLength?: number;
4
- charStart?: number;
5
- charLength?: number;
6
- };
7
- export declare const getChunk: (text: string, options?: TrunkOptions) => string;
8
- export {};
9
- //# sourceMappingURL=getChunk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getChunk.d.ts","sourceRoot":"","sources":["../../../src/utils/getChunk.ts"],"names":[],"mappings":"AAEA,KAAK,YAAY,GAAG;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,EAAE,UAAS,YAAiB,KAAG,MA8EnE,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const splitTextByLines: (text: string) => string[];
2
- //# sourceMappingURL=splitTextByLine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitTextByLine.d.ts","sourceRoot":"","sources":["../../../src/utils/splitTextByLine.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,MAAM,EAQrD,CAAC"}
File without changes