@jjlmoya/utils-games-development 1.53.0 → 1.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +2 -1
  3. package/src/entries.ts +2 -0
  4. package/src/index.ts +1 -0
  5. package/src/tests/locale_completeness.test.ts +2 -2
  6. package/src/tests/tool_validation.test.ts +2 -2
  7. package/src/tool/steamBbcodeTranslator/app-client.ts +125 -0
  8. package/src/tool/steamBbcodeTranslator/bbcode-parser.ts +110 -0
  9. package/src/tool/steamBbcodeTranslator/bibliography.astro +6 -0
  10. package/src/tool/steamBbcodeTranslator/bibliography.ts +14 -0
  11. package/src/tool/steamBbcodeTranslator/component.astro +83 -0
  12. package/src/tool/steamBbcodeTranslator/entry.ts +28 -0
  13. package/src/tool/steamBbcodeTranslator/html-parser.ts +42 -0
  14. package/src/tool/steamBbcodeTranslator/html-renderer.ts +71 -0
  15. package/src/tool/steamBbcodeTranslator/i18n/de.ts +207 -0
  16. package/src/tool/steamBbcodeTranslator/i18n/en.ts +236 -0
  17. package/src/tool/steamBbcodeTranslator/i18n/es.ts +207 -0
  18. package/src/tool/steamBbcodeTranslator/i18n/fr.ts +195 -0
  19. package/src/tool/steamBbcodeTranslator/i18n/id.ts +195 -0
  20. package/src/tool/steamBbcodeTranslator/i18n/it.ts +195 -0
  21. package/src/tool/steamBbcodeTranslator/i18n/ja.ts +195 -0
  22. package/src/tool/steamBbcodeTranslator/i18n/ko.ts +195 -0
  23. package/src/tool/steamBbcodeTranslator/i18n/nl.ts +195 -0
  24. package/src/tool/steamBbcodeTranslator/i18n/pl.ts +195 -0
  25. package/src/tool/steamBbcodeTranslator/i18n/pt.ts +195 -0
  26. package/src/tool/steamBbcodeTranslator/i18n/ru.ts +195 -0
  27. package/src/tool/steamBbcodeTranslator/i18n/sv.ts +195 -0
  28. package/src/tool/steamBbcodeTranslator/i18n/tr.ts +195 -0
  29. package/src/tool/steamBbcodeTranslator/i18n/zh.ts +195 -0
  30. package/src/tool/steamBbcodeTranslator/index.ts +12 -0
  31. package/src/tool/steamBbcodeTranslator/logic.test.ts +41 -0
  32. package/src/tool/steamBbcodeTranslator/logic.ts +96 -0
  33. package/src/tool/steamBbcodeTranslator/markdown-parser.ts +115 -0
  34. package/src/tool/steamBbcodeTranslator/markdown-renderer.ts +85 -0
  35. package/src/tool/steamBbcodeTranslator/seo.astro +15 -0
  36. package/src/tool/steamBbcodeTranslator/steam-bbcode-translator.css +392 -0
  37. package/src/tool/steamBbcodeTranslator/storage.ts +30 -0
  38. package/src/tool/steamBbcodeTranslator/types.ts +36 -0
  39. package/src/tool/steamBbcodeTranslator/ui.ts +18 -0
  40. package/src/tools.ts +2 -0
@@ -0,0 +1,30 @@
1
+ import { STORAGE_KEY } from './types';
2
+
3
+ export function loadSourceFromStorage(): string | null {
4
+ if (typeof window === 'undefined') return null;
5
+ try {
6
+ const value = window.localStorage.getItem(STORAGE_KEY);
7
+ return value?.trim() ? value : null;
8
+ } catch {
9
+ return null;
10
+ }
11
+ }
12
+
13
+ export function saveSourceToStorage(source: string): void {
14
+ if (typeof window === 'undefined') return;
15
+ try {
16
+ if (source.trim()) window.localStorage.setItem(STORAGE_KEY, source);
17
+ else window.localStorage.removeItem(STORAGE_KEY);
18
+ } catch {
19
+ return;
20
+ }
21
+ }
22
+
23
+ export function clearSourceFromStorage(): void {
24
+ if (typeof window === 'undefined') return;
25
+ try {
26
+ window.localStorage.removeItem(STORAGE_KEY);
27
+ } catch {
28
+ return;
29
+ }
30
+ }
@@ -0,0 +1,36 @@
1
+ export type OutputFormat = 'markdown' | 'html';
2
+ export type TranslationDirection = 'bbcode-to-output' | 'output-to-bbcode';
3
+ export type MarkupSyntax = 'bbcode' | 'markdown' | 'html';
4
+
5
+ export interface TranslationStats {
6
+ characters: number;
7
+ tags: number;
8
+ blocks: number;
9
+ }
10
+
11
+ export interface TranslationResult {
12
+ output: string;
13
+ warnings: string[];
14
+ stats: TranslationStats;
15
+ }
16
+
17
+ export interface AutoTranslationResult {
18
+ detected: MarkupSyntax;
19
+ outputs: Partial<Record<MarkupSyntax, TranslationResult>>;
20
+ }
21
+
22
+ export interface TextNode {
23
+ kind: 'text';
24
+ value: string;
25
+ }
26
+
27
+ export interface TagNode {
28
+ kind: 'tag';
29
+ name: string;
30
+ value?: string | undefined;
31
+ children: Node[];
32
+ }
33
+
34
+ export type Node = TextNode | TagNode;
35
+
36
+ export const STORAGE_KEY = 'steam-bbcode-translator-draft-v1';
@@ -0,0 +1,18 @@
1
+ export interface SteamBbcodeTranslatorUI extends Record<string, string> {
2
+ editorLabel: string;
3
+ editorHint: string;
4
+ detectedLabel: string;
5
+ detectedEmpty: string;
6
+ bbcode: string;
7
+ markdown: string;
8
+ html: string;
9
+ copy: string;
10
+ copied: string;
11
+ clear: string;
12
+ characters: string;
13
+ blocks: string;
14
+ privacyNote: string;
15
+ persistenceNote: string;
16
+ previewLabel: string;
17
+ previewEmpty: string;
18
+ }
package/src/tools.ts CHANGED
@@ -6,6 +6,7 @@ import { SPRITE_SHEET_PACKER_TOOL } from './tool/spriteSheetPacker';
6
6
  import { AUDIO_LOOP_POINT_FINDER_TOOL } from './tool/audioLoopPointFinder';
7
7
  import { SAVE_FILE_EDITOR_TOOL } from './tool/saveFileEditor';
8
8
  import { LOCALIZATION_SANITIZER_TOOL } from './tool/localizationSanitizer';
9
+ import { STEAM_BBCODE_TRANSLATOR_TOOL } from './tool/steamBbcodeTranslator';
9
10
 
10
11
  export const ALL_TOOLS: ToolDefinition[] = [
11
12
  STEAM_CAPSULE_GENERATOR_TOOL,
@@ -14,4 +15,5 @@ export const ALL_TOOLS: ToolDefinition[] = [
14
15
  AUDIO_LOOP_POINT_FINDER_TOOL,
15
16
  SAVE_FILE_EDITOR_TOOL,
16
17
  LOCALIZATION_SANITIZER_TOOL,
18
+ STEAM_BBCODE_TRANSLATOR_TOOL,
17
19
  ];