docs-i18n 0.1.0 → 0.2.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 (49) hide show
  1. package/dist/{assemble-IOHQYYHI.js → assemble-ZHDLGVTL.js} +3 -4
  2. package/dist/chunk-I74LIORX.js +11211 -0
  3. package/dist/{chunk-QSVWLTGQ.js → chunk-OSMPWXSQ.js} +1 -1
  4. package/dist/{chunk-AKLW2MUS.js → chunk-PHDMD6EM.js} +29 -7
  5. package/dist/cli.js +6 -7
  6. package/dist/{rescan-VB2PILB2.js → rescan-OJTVWDAP.js} +2 -3
  7. package/dist/server-HNVJP43X.js +2742 -0
  8. package/dist/{status-EWQEACVF.js → status-ZG7F3FRT.js} +1 -2
  9. package/dist/translate-2PCYIWIG.js +14531 -0
  10. package/package.json +3 -2
  11. package/src/admin/index.html +13 -0
  12. package/src/admin/server/index.ts +88 -0
  13. package/src/admin/server/routes/jobs.ts +113 -0
  14. package/src/admin/server/routes/models.ts +87 -0
  15. package/src/admin/server/routes/status.ts +57 -0
  16. package/src/admin/server/services/job-manager.ts +184 -0
  17. package/src/admin/server/services/status.ts +183 -0
  18. package/src/admin/ui/App.tsx +326 -0
  19. package/src/admin/ui/components/FileList.tsx +438 -0
  20. package/src/admin/ui/components/JobDialog.tsx +360 -0
  21. package/src/admin/ui/components/JobPanel.tsx +134 -0
  22. package/src/admin/ui/components/LangGrid.tsx +54 -0
  23. package/src/admin/ui/components/Preview.tsx +369 -0
  24. package/src/admin/ui/components/ProgressBar.tsx +21 -0
  25. package/src/admin/ui/lib/api.ts +154 -0
  26. package/src/admin/ui/lib/flags.ts +30 -0
  27. package/src/admin/ui/main.tsx +19 -0
  28. package/src/admin/ui/styles.css +1096 -0
  29. package/src/admin/vite.config.ts +7 -0
  30. package/dist/build-4EQEL4NI.js +0 -12
  31. package/dist/build2-3W5WMFHZ.js +0 -4901
  32. package/dist/chunk-3YNFMSJH.js +0 -30
  33. package/dist/chunk-55MBYBVK.js +0 -368
  34. package/dist/chunk-FYDB7MZX.js +0 -38944
  35. package/dist/chunk-O35QHRY6.js +0 -6
  36. package/dist/chunk-PTIH4GGE.js +0 -44
  37. package/dist/chunk-SUIDX6IZ.js +0 -122
  38. package/dist/chunk-VKKNQBDN.js +0 -6487
  39. package/dist/dist-6C32URTL.js +0 -19
  40. package/dist/dist-HOWMMQFV.js +0 -6677
  41. package/dist/false-JGP4AGWN.js +0 -7
  42. package/dist/main-QVE5TVA3.js +0 -2505
  43. package/dist/node-4GLCLDJ6.js +0 -875
  44. package/dist/node-NUDVMOF2.js +0 -129
  45. package/dist/postcss-3SK7VUC2.js +0 -5886
  46. package/dist/postcss-import-JD46KA2Z.js +0 -458
  47. package/dist/prompt-BYQIwEjg-TG7DLENB.js +0 -915
  48. package/dist/server-ER56DGPR.js +0 -548
  49. package/dist/translate-F3AQFN6X.js +0 -707
@@ -1,30 +0,0 @@
1
- // src/config.ts
2
- async function loadConfig(path) {
3
- const configPath = path ?? "docs-i18n.config.ts";
4
- try {
5
- const mod = await import(
6
- /* @vite-ignore */
7
- `${process.cwd()}/${configPath}`
8
- );
9
- return mod.default ?? mod;
10
- } catch {
11
- throw new Error(`Cannot load config from ${configPath}. Create a docs-i18n.config.ts file.`);
12
- }
13
- }
14
- function flattenSources(config) {
15
- const projects = Object.entries(config.projects);
16
- const singleProject = projects.length === 1;
17
- return projects.flatMap(
18
- ([projectId, project]) => Object.entries(project.sources).map(([version, sourcePath]) => ({
19
- project: projectId,
20
- version,
21
- sourcePath,
22
- versionKey: singleProject ? version : `${projectId}/${version}`
23
- }))
24
- );
25
- }
26
-
27
- export {
28
- loadConfig,
29
- flattenSources
30
- };
@@ -1,368 +0,0 @@
1
- import {
2
- __commonJSMin
3
- } from "./chunk-PTIH4GGE.js";
4
-
5
- // node_modules/vite/dist/node/chunks/lib.js
6
- var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
- var openParentheses = "(".charCodeAt(0);
8
- var closeParentheses = ")".charCodeAt(0);
9
- var singleQuote = "'".charCodeAt(0);
10
- var doubleQuote = '"'.charCodeAt(0);
11
- var backslash = "\\".charCodeAt(0);
12
- var slash = "/".charCodeAt(0);
13
- var comma = ",".charCodeAt(0);
14
- var colon = ":".charCodeAt(0);
15
- var star = "*".charCodeAt(0);
16
- var uLower = "u".charCodeAt(0);
17
- var uUpper = "U".charCodeAt(0);
18
- var plus = "+".charCodeAt(0);
19
- var isUnicodeRange = /^[a-f0-9?-]+$/i;
20
- module.exports = function(input) {
21
- var tokens = [];
22
- var value = input;
23
- var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
24
- var pos = 0;
25
- var code = value.charCodeAt(pos);
26
- var max = value.length;
27
- var stack = [{ nodes: tokens }];
28
- var balanced = 0;
29
- var parent;
30
- var name = "";
31
- var before = "";
32
- var after = "";
33
- while (pos < max) if (code <= 32) {
34
- next = pos;
35
- do {
36
- next += 1;
37
- code = value.charCodeAt(next);
38
- } while (code <= 32);
39
- token = value.slice(pos, next);
40
- prev = tokens[tokens.length - 1];
41
- if (code === closeParentheses && balanced) after = token;
42
- else if (prev && prev.type === "div") {
43
- prev.after = token;
44
- prev.sourceEndIndex += token.length;
45
- } else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) before = token;
46
- else tokens.push({
47
- type: "space",
48
- sourceIndex: pos,
49
- sourceEndIndex: next,
50
- value: token
51
- });
52
- pos = next;
53
- } else if (code === singleQuote || code === doubleQuote) {
54
- next = pos;
55
- quote = code === singleQuote ? "'" : '"';
56
- token = {
57
- type: "string",
58
- sourceIndex: pos,
59
- quote
60
- };
61
- do {
62
- escape = false;
63
- next = value.indexOf(quote, next + 1);
64
- if (~next) {
65
- escapePos = next;
66
- while (value.charCodeAt(escapePos - 1) === backslash) {
67
- escapePos -= 1;
68
- escape = !escape;
69
- }
70
- } else {
71
- value += quote;
72
- next = value.length - 1;
73
- token.unclosed = true;
74
- }
75
- } while (escape);
76
- token.value = value.slice(pos + 1, next);
77
- token.sourceEndIndex = token.unclosed ? next : next + 1;
78
- tokens.push(token);
79
- pos = next + 1;
80
- code = value.charCodeAt(pos);
81
- } else if (code === slash && value.charCodeAt(pos + 1) === star) {
82
- next = value.indexOf("*/", pos);
83
- token = {
84
- type: "comment",
85
- sourceIndex: pos,
86
- sourceEndIndex: next + 2
87
- };
88
- if (next === -1) {
89
- token.unclosed = true;
90
- next = value.length;
91
- token.sourceEndIndex = next;
92
- }
93
- token.value = value.slice(pos + 2, next);
94
- tokens.push(token);
95
- pos = next + 2;
96
- code = value.charCodeAt(pos);
97
- } else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
98
- token = value[pos];
99
- tokens.push({
100
- type: "word",
101
- sourceIndex: pos - before.length,
102
- sourceEndIndex: pos + token.length,
103
- value: token
104
- });
105
- pos += 1;
106
- code = value.charCodeAt(pos);
107
- } else if (code === slash || code === comma || code === colon) {
108
- token = value[pos];
109
- tokens.push({
110
- type: "div",
111
- sourceIndex: pos - before.length,
112
- sourceEndIndex: pos + token.length,
113
- value: token,
114
- before,
115
- after: ""
116
- });
117
- before = "";
118
- pos += 1;
119
- code = value.charCodeAt(pos);
120
- } else if (openParentheses === code) {
121
- next = pos;
122
- do {
123
- next += 1;
124
- code = value.charCodeAt(next);
125
- } while (code <= 32);
126
- parenthesesOpenPos = pos;
127
- token = {
128
- type: "function",
129
- sourceIndex: pos - name.length,
130
- value: name,
131
- before: value.slice(parenthesesOpenPos + 1, next)
132
- };
133
- pos = next;
134
- if (name === "url" && code !== singleQuote && code !== doubleQuote) {
135
- next -= 1;
136
- do {
137
- escape = false;
138
- next = value.indexOf(")", next + 1);
139
- if (~next) {
140
- escapePos = next;
141
- while (value.charCodeAt(escapePos - 1) === backslash) {
142
- escapePos -= 1;
143
- escape = !escape;
144
- }
145
- } else {
146
- value += ")";
147
- next = value.length - 1;
148
- token.unclosed = true;
149
- }
150
- } while (escape);
151
- whitespacePos = next;
152
- do {
153
- whitespacePos -= 1;
154
- code = value.charCodeAt(whitespacePos);
155
- } while (code <= 32);
156
- if (parenthesesOpenPos < whitespacePos) {
157
- if (pos !== whitespacePos + 1) token.nodes = [{
158
- type: "word",
159
- sourceIndex: pos,
160
- sourceEndIndex: whitespacePos + 1,
161
- value: value.slice(pos, whitespacePos + 1)
162
- }];
163
- else token.nodes = [];
164
- if (token.unclosed && whitespacePos + 1 !== next) {
165
- token.after = "";
166
- token.nodes.push({
167
- type: "space",
168
- sourceIndex: whitespacePos + 1,
169
- sourceEndIndex: next,
170
- value: value.slice(whitespacePos + 1, next)
171
- });
172
- } else {
173
- token.after = value.slice(whitespacePos + 1, next);
174
- token.sourceEndIndex = next;
175
- }
176
- } else {
177
- token.after = "";
178
- token.nodes = [];
179
- }
180
- pos = next + 1;
181
- token.sourceEndIndex = token.unclosed ? next : pos;
182
- code = value.charCodeAt(pos);
183
- tokens.push(token);
184
- } else {
185
- balanced += 1;
186
- token.after = "";
187
- token.sourceEndIndex = pos + 1;
188
- tokens.push(token);
189
- stack.push(token);
190
- tokens = token.nodes = [];
191
- parent = token;
192
- }
193
- name = "";
194
- } else if (closeParentheses === code && balanced) {
195
- pos += 1;
196
- code = value.charCodeAt(pos);
197
- parent.after = after;
198
- parent.sourceEndIndex += after.length;
199
- after = "";
200
- balanced -= 1;
201
- stack[stack.length - 1].sourceEndIndex = pos;
202
- stack.pop();
203
- parent = stack[balanced];
204
- tokens = parent.nodes;
205
- } else {
206
- next = pos;
207
- do {
208
- if (code === backslash) next += 1;
209
- next += 1;
210
- code = value.charCodeAt(next);
211
- } while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
212
- token = value.slice(pos, next);
213
- if (openParentheses === code) name = token;
214
- else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) tokens.push({
215
- type: "unicode-range",
216
- sourceIndex: pos,
217
- sourceEndIndex: next,
218
- value: token
219
- });
220
- else tokens.push({
221
- type: "word",
222
- sourceIndex: pos,
223
- sourceEndIndex: next,
224
- value: token
225
- });
226
- pos = next;
227
- }
228
- for (pos = stack.length - 1; pos; pos -= 1) {
229
- stack[pos].unclosed = true;
230
- stack[pos].sourceEndIndex = value.length;
231
- }
232
- return stack[0].nodes;
233
- };
234
- }));
235
- var require_walk = /* @__PURE__ */ __commonJSMin(((exports, module) => {
236
- module.exports = function walk(nodes, cb, bubble) {
237
- var i, max, node, result;
238
- for (i = 0, max = nodes.length; i < max; i += 1) {
239
- node = nodes[i];
240
- if (!bubble) result = cb(node, i, nodes);
241
- if (result !== false && node.type === "function" && Array.isArray(node.nodes)) walk(node.nodes, cb, bubble);
242
- if (bubble) cb(node, i, nodes);
243
- }
244
- };
245
- }));
246
- var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
247
- function stringifyNode(node, custom) {
248
- var type = node.type;
249
- var value = node.value;
250
- var buf;
251
- var customResult;
252
- if (custom && (customResult = custom(node)) !== void 0) return customResult;
253
- else if (type === "word" || type === "space") return value;
254
- else if (type === "string") {
255
- buf = node.quote || "";
256
- return buf + value + (node.unclosed ? "" : buf);
257
- } else if (type === "comment") return "/*" + value + (node.unclosed ? "" : "*/");
258
- else if (type === "div") return (node.before || "") + value + (node.after || "");
259
- else if (Array.isArray(node.nodes)) {
260
- buf = stringify(node.nodes, custom);
261
- if (type !== "function") return buf;
262
- return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
263
- }
264
- return value;
265
- }
266
- function stringify(nodes, custom) {
267
- var result, i;
268
- if (Array.isArray(nodes)) {
269
- result = "";
270
- for (i = nodes.length - 1; ~i; i -= 1) result = stringifyNode(nodes[i], custom) + result;
271
- return result;
272
- }
273
- return stringifyNode(nodes, custom);
274
- }
275
- module.exports = stringify;
276
- }));
277
- var require_unit = /* @__PURE__ */ __commonJSMin(((exports, module) => {
278
- var minus = "-".charCodeAt(0);
279
- var plus = "+".charCodeAt(0);
280
- var dot = ".".charCodeAt(0);
281
- var exp = "e".charCodeAt(0);
282
- var EXP = "E".charCodeAt(0);
283
- function likeNumber(value) {
284
- var code = value.charCodeAt(0);
285
- var nextCode;
286
- if (code === plus || code === minus) {
287
- nextCode = value.charCodeAt(1);
288
- if (nextCode >= 48 && nextCode <= 57) return true;
289
- var nextNextCode = value.charCodeAt(2);
290
- if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) return true;
291
- return false;
292
- }
293
- if (code === dot) {
294
- nextCode = value.charCodeAt(1);
295
- if (nextCode >= 48 && nextCode <= 57) return true;
296
- return false;
297
- }
298
- if (code >= 48 && code <= 57) return true;
299
- return false;
300
- }
301
- module.exports = function(value) {
302
- var pos = 0;
303
- var length = value.length;
304
- var code;
305
- var nextCode;
306
- var nextNextCode;
307
- if (length === 0 || !likeNumber(value)) return false;
308
- code = value.charCodeAt(pos);
309
- if (code === plus || code === minus) pos++;
310
- while (pos < length) {
311
- code = value.charCodeAt(pos);
312
- if (code < 48 || code > 57) break;
313
- pos += 1;
314
- }
315
- code = value.charCodeAt(pos);
316
- nextCode = value.charCodeAt(pos + 1);
317
- if (code === dot && nextCode >= 48 && nextCode <= 57) {
318
- pos += 2;
319
- while (pos < length) {
320
- code = value.charCodeAt(pos);
321
- if (code < 48 || code > 57) break;
322
- pos += 1;
323
- }
324
- }
325
- code = value.charCodeAt(pos);
326
- nextCode = value.charCodeAt(pos + 1);
327
- nextNextCode = value.charCodeAt(pos + 2);
328
- if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
329
- pos += nextCode === plus || nextCode === minus ? 3 : 2;
330
- while (pos < length) {
331
- code = value.charCodeAt(pos);
332
- if (code < 48 || code > 57) break;
333
- pos += 1;
334
- }
335
- }
336
- return {
337
- number: value.slice(0, pos),
338
- unit: value.slice(pos)
339
- };
340
- };
341
- }));
342
- var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
343
- var parse = require_parse();
344
- var walk = require_walk();
345
- var stringify = require_stringify();
346
- function ValueParser(value) {
347
- if (this instanceof ValueParser) {
348
- this.nodes = parse(value);
349
- return this;
350
- }
351
- return new ValueParser(value);
352
- }
353
- ValueParser.prototype.toString = function() {
354
- return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
355
- };
356
- ValueParser.prototype.walk = function(cb, bubble) {
357
- walk(this.nodes, cb, bubble);
358
- return this;
359
- };
360
- ValueParser.unit = require_unit();
361
- ValueParser.walk = walk;
362
- ValueParser.stringify = stringify;
363
- module.exports = ValueParser;
364
- }));
365
-
366
- export {
367
- require_lib
368
- };