qwerty-cli 0.0.1-alpha.16 → 0.0.1-alpha.18

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 (37) hide show
  1. package/dist/{ConfigEditor-KAL2MLQO.js → ConfigEditor-ZJ52VG3I.js} +2 -2
  2. package/dist/DictBrowser-ZQ773KQV.js +2 -0
  3. package/dist/DictBrowser-ZQ773KQV.js.map +1 -0
  4. package/dist/{HelpScreen-O5RSN3C4.js → HelpScreen-Y3TWEEWZ.js} +2 -2
  5. package/dist/{PracticeScreen-FOCGEFWL.js → PracticeScreen-PWXXG33U.js} +2 -2
  6. package/dist/{StatsViewer-XOOMUPGL.js → StatsViewer-XARAMVZW.js} +2 -2
  7. package/dist/{StatsViewer-XOOMUPGL.js.map → StatsViewer-XARAMVZW.js.map} +1 -1
  8. package/dist/{WordLookup-MWWYQBCM.js → WordLookup-LKBEPDTB.js} +2 -2
  9. package/dist/chunk-FQ2MEK7M.js +2 -0
  10. package/dist/chunk-FQ2MEK7M.js.map +1 -0
  11. package/dist/chunk-GULN5HRV.js +2 -0
  12. package/dist/chunk-GULN5HRV.js.map +1 -0
  13. package/dist/chunk-TCYEMBFW.js +3 -0
  14. package/dist/chunk-TCYEMBFW.js.map +1 -0
  15. package/dist/cli.js +1 -1
  16. package/dist/menu.impl-HBP6CFSW.js +2 -0
  17. package/dist/{menu.impl-4C7HT3VD.js.map → menu.impl-HBP6CFSW.js.map} +1 -1
  18. package/dist/practice.impl-AVTRDL7X.js +2 -0
  19. package/dist/practice.impl-AVTRDL7X.js.map +1 -0
  20. package/dist/{stats.impl-3I7BB7X3.js → stats.impl-WX3BFWI3.js} +3 -3
  21. package/dist/{stats.impl-3I7BB7X3.js.map → stats.impl-WX3BFWI3.js.map} +1 -1
  22. package/package.json +1 -1
  23. package/dist/DictBrowser-OF274IOX.js +0 -2
  24. package/dist/DictBrowser-OF274IOX.js.map +0 -1
  25. package/dist/chunk-4EJYJITR.js +0 -3
  26. package/dist/chunk-4EJYJITR.js.map +0 -1
  27. package/dist/chunk-HJIGZU3E.js +0 -2
  28. package/dist/chunk-HJIGZU3E.js.map +0 -1
  29. package/dist/chunk-UWTJMVJ6.js +0 -2
  30. package/dist/chunk-UWTJMVJ6.js.map +0 -1
  31. package/dist/menu.impl-4C7HT3VD.js +0 -2
  32. package/dist/practice.impl-OLNLJLIA.js +0 -2
  33. package/dist/practice.impl-OLNLJLIA.js.map +0 -1
  34. /package/dist/{ConfigEditor-KAL2MLQO.js.map → ConfigEditor-ZJ52VG3I.js.map} +0 -0
  35. /package/dist/{HelpScreen-O5RSN3C4.js.map → HelpScreen-Y3TWEEWZ.js.map} +0 -0
  36. /package/dist/{PracticeScreen-FOCGEFWL.js.map → PracticeScreen-PWXXG33U.js.map} +0 -0
  37. /package/dist/{WordLookup-MWWYQBCM.js.map → WordLookup-LKBEPDTB.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/practice.impl.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { render } from 'ink';\nimport { createElement } from 'react';\nimport { loadConfig } from '../infra/config-store.js';\nimport { App } from '../ui/App.js';\nimport { start as startSession, report as sessionReport } from '../infra/session-tracker.js';\nimport { printSessionReport, ensureMainScreen } from '../util/report.js';\nimport { pickStrings } from '../i18n/context.js';\nimport { enterAltScreen } from '../util/altscreen.js';\nimport { consumeSilentExit } from '../util/post-exit-action.js';\nimport type { Mode } from '../domain/chapters.js';\n\nconst MODES: Mode[] = ['order', 'dictation', 'review', 'random', 'loop'];\n\nfunction isMode(v: string): v is Mode {\n return (MODES as string[]).includes(v);\n}\n\nexport async function runPractice(\n dictIdArg: string | undefined,\n options: { chapter?: string | number; mode?: string; stealth?: boolean },\n): Promise<void> {\n if (!process.stdout.isTTY) {\n console.error(chalk.red('Practice requires an interactive TTY.'));\n process.exitCode = 1;\n return;\n }\n const cfg = await loadConfig();\n const dictId = dictIdArg ?? cfg.defaultDict;\n if (!dictId) {\n console.error(chalk.red('No dictionary specified. Pass an id or set config.defaultDict.'));\n process.exitCode = 1;\n return;\n }\n const mode = options.mode ?? cfg.defaultMode;\n if (!isMode(mode)) {\n console.error(chalk.red(`Invalid mode \"${mode}\". Valid: ${MODES.join(', ')}`));\n process.exitCode = 1;\n return;\n }\n const chapterIndex = Math.max(0, Number(options.chapter ?? 1) - 1);\n const stealth = options.stealth === true || cfg.stealth === 'default';\n\n // Enter alt-screen synchronously BEFORE render() so Ink's first frame\n // never lands on the main screen. Without this, when the user exits,\n // the main screen still has the menu/practice content from frame 0\n // showing under the exit report. Stealth uses inline mode, skip.\n if (!stealth) enterAltScreen();\n\n startSession();\n const { waitUntilExit } = render(\n createElement(App, {\n initial: { name: 'practice', params: { dictId, chapterIndex, mode, stealth } },\n initialCfg: cfg,\n inline: stealth,\n }),\n { patchConsole: false, exitOnCtrlC: false },\n );\n await waitUntilExit();\n if (!stealth) {\n ensureMainScreen();\n }\n\n if (consumeSilentExit()) {\n // User hit Ctrl+C on the stealth paused screen — erase the 3 inline rows\n // (paused / Esc back / blank) and skip the session report for a fully\n // clean exit. Cursor goes back to where the paused UI started; the shell\n // prompt then renders there, leaving no trace.\n process.stdout.write('\\x1b[3F\\x1b[0J');\n return;\n }\n if (stealth) {\n // Stealth: StealthSummary already rendered an inline summary row that\n // stays in scrollback. A second ~10-row boxen report would defeat the\n // point of the mode, so skip it.\n return;\n }\n\n const { lang, t } = pickStrings(cfg.language);\n printSessionReport(sessionReport(), t, lang);\n}\n"],"mappings":"0UAAA,OAAOA,MAAW,QAClB,OAAS,UAAAC,MAAc,MACvB,OAAS,iBAAAC,MAAqB,QAU9B,IAAMC,EAAgB,CAAC,QAAS,YAAa,SAAU,SAAU,MAAM,EAEvE,SAASC,EAAOC,EAAsB,CACpC,OAAQF,EAAmB,SAASE,CAAC,CACvC,CAEA,eAAsBC,EACpBC,EACAC,EACe,CACf,GAAI,CAAC,QAAQ,OAAO,MAAO,CACzB,QAAQ,MAAMC,EAAM,IAAI,uCAAuC,CAAC,EAChE,QAAQ,SAAW,EACnB,MACF,CACA,IAAMC,EAAM,MAAMC,EAAW,EACvBC,EAASL,GAAaG,EAAI,YAChC,GAAI,CAACE,EAAQ,CACX,QAAQ,MAAMH,EAAM,IAAI,gEAAgE,CAAC,EACzF,QAAQ,SAAW,EACnB,MACF,CACA,IAAMI,EAAOL,EAAQ,MAAQE,EAAI,YACjC,GAAI,CAACN,EAAOS,CAAI,EAAG,CACjB,QAAQ,MAAMJ,EAAM,IAAI,iBAAiBI,CAAI,aAAaV,EAAM,KAAK,IAAI,CAAC,EAAE,CAAC,EAC7E,QAAQ,SAAW,EACnB,MACF,CACA,IAAMW,EAAe,KAAK,IAAI,EAAG,OAAON,EAAQ,SAAW,CAAC,EAAI,CAAC,EAC3DO,EAAUP,EAAQ,UAAY,IAAQE,EAAI,UAAY,UAMvDK,GAASC,EAAe,EAE7BC,EAAa,EACb,GAAM,CAAE,cAAAC,CAAc,EAAIC,EACxBC,EAAcC,EAAK,CACjB,QAAS,CAAE,KAAM,WAAY,OAAQ,CAAE,OAAAT,EAAQ,aAAAE,EAAc,KAAAD,EAAM,QAAAE,CAAQ,CAAE,EAC7E,WAAYL,EACZ,OAAQK,CACV,CAAC,EACD,CAAE,aAAc,GAAO,YAAa,EAAM,CAC5C,EAMA,GALA,MAAMG,EAAc,EACfH,GACHO,EAAiB,EAGfC,EAAkB,EAAG,CAKvB,QAAQ,OAAO,MAAM,gBAAgB,EACrC,MACF,CACA,GAAIR,EAIF,OAGF,GAAM,CAAE,KAAAS,EAAM,EAAAC,CAAE,EAAIC,EAAYhB,EAAI,QAAQ,EAC5CiB,EAAmBC,EAAc,EAAGH,EAAGD,CAAI,CAC7C","names":["chalk","render","createElement","MODES","isMode","v","runPractice","dictIdArg","options","chalk","cfg","loadConfig","dictId","mode","chapterIndex","stealth","enterAltScreen","start","waitUntilExit","render","createElement","App","ensureMainScreen","consumeSilentExit","lang","t","pickStrings","printSessionReport","report"]}