@sudobility/sudojo_lib 0.0.94 → 0.0.96

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.
package/dist/index.d.ts CHANGED
@@ -8,42 +8,495 @@
8
8
  * - Level, technique, and learning data hooks
9
9
  * - Teaching/hint integration with solver
10
10
  * - Legacy useGame hook for backward compatibility
11
+ *
12
+ * ## Hook Architecture
13
+ *
14
+ * The hooks form a layered composition pattern:
15
+ *
16
+ * **Data hooks** (fetch and cache server data):
17
+ * - `useLevels` / `useLevel` - Difficulty level data
18
+ * - `useTechniques` / `useTechnique` - Solving technique data
19
+ * - `useLearning` / `useLearningItem` - Learning material data
20
+ *
21
+ * **Game fetching hooks** (handle auth, subscription, and puzzle loading):
22
+ * - `useLevelGame` - Fetch a random board for a specific level
23
+ * - `useDailyGame` - Fetch today's daily puzzle
24
+ *
25
+ * **Game state hooks** (manage board state and user interaction):
26
+ * - `useSudoku` - Primary game state (flat 81-cell array, modern API)
27
+ * - `useGame` - Legacy game state (2D array, deprecated)
28
+ * - `useBoardEntry` - Manual puzzle entry mode
29
+ *
30
+ * **Feature hooks** (provide specific game features):
31
+ * - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)
32
+ * - `useGameTeaching` - Step-by-step teaching with solver
33
+ * - `useGameTimer` - Elapsed time tracking via ref (no re-renders)
34
+ * - `useGamePersistence` / `useAutoSave` - localStorage game save/restore
35
+ * - `useLocalStorage` - Generic typed localStorage hook
36
+ *
37
+ * **Orchestration hooks** (combine multiple hooks for app-level features):
38
+ * - `useGamePlay` - Current game management with Zustand store (daily/play slots)
39
+ * - `useGameSession` - Server-side gamification (start/finish, points, badges)
40
+ *
41
+ * ## Migration Guide
42
+ *
43
+ * Legacy exports (prefixed with "Legacy" comments) use the 2D `GameBoard` type
44
+ * from `useGame`. New code should use `useSudoku` with its flat 81-cell
45
+ * `SudokuBoard` type. See `@deprecated` tags on legacy exports.
46
+ */
47
+ /**
48
+ * @deprecated Use `SudokuCell` instead. Part of the legacy `useGame` 2D board API.
11
49
  */
12
50
  export type { CellPosition, CellState, GameBoard, GameHint, GameMove, GameSettings, GameState, GameStatus, TeachingState, } from './types';
51
+ /** @deprecated Use `DEFAULT_APP_SETTINGS` / `DEFAULT_PLAY_SETTINGS` instead. */
13
52
  export { DEFAULT_GAME_SETTINGS } from './types';
14
- export type { SudokuCell, SudokuBoard, SudokuPlay, SudokuPlaySettings, SudokuAppSettings, SudokuGameState, SudokuDisplay, PlayingSource, } from './types';
15
- export { DEFAULT_PLAY_SETTINGS, DEFAULT_APP_SETTINGS, createEmptyCell, createEmptyBoard, cellHasError, rowOf, columnOf, blockOf, cellIndex, getRowIndices, getColumnIndices, getBlockIndices, getRelatedIndices, } from './types';
16
- export type { HintArea, HintCell, HintCellActions, DisplayHintStep, CellDisplayState, PencilmarkDisplayState, UIColorPalette, LinkType, DisplayLink, DisplayCellGroup, } from './types';
53
+ /** Core Sudoku cell and board types using flat 81-cell array representation. */
54
+ export type {
55
+ /** A single cell in the Sudoku board (indexed 0-80). */
56
+ SudokuCell,
57
+ /** The Sudoku board containing all 81 cells. */
58
+ SudokuBoard,
59
+ /** Current play state including board, settings, and selection. */
60
+ SudokuPlay,
61
+ /** Session settings that can change during play (pencilmarking, auto-pencilmarks). */
62
+ SudokuPlaySettings,
63
+ /** App-level settings persisted across sessions (showErrors, display format). */
64
+ SudokuAppSettings,
65
+ /** Full game state including source, history, and digit mapping. */
66
+ SudokuGameState,
67
+ /** Display modes for Sudoku digits ('NUMERIC' | 'KANJI' | 'COLORS' | 'EMOJIS'). */
68
+ SudokuDisplay,
69
+ /** Source of the puzzle ('DAILY' | 'CHALLENGE' | 'LEVEL' | 'ENTERED'). */
70
+ PlayingSource, } from './types';
71
+ /** Default settings and cell/board helper functions for the modern Sudoku API. */
72
+ export {
73
+ /** Default session play settings (pencilmarking off, auto-pencilmarks off). */
74
+ DEFAULT_PLAY_SETTINGS,
75
+ /** Default app settings (showErrors on, animations on, numeric display). */
76
+ DEFAULT_APP_SETTINGS,
77
+ /** Create an empty SudokuCell at the given index. */
78
+ createEmptyCell,
79
+ /** Create an empty 81-cell SudokuBoard. */
80
+ createEmptyBoard,
81
+ /** Check if a cell has an error (input does not match solution). */
82
+ cellHasError,
83
+ /** Get row index (0-8) from cell index (0-80). */
84
+ rowOf,
85
+ /** Get column index (0-8) from cell index (0-80). */
86
+ columnOf,
87
+ /** Get block index (0-8) from cell index (0-80). */
88
+ blockOf,
89
+ /** Get cell index (0-80) from row and column. */
90
+ cellIndex,
91
+ /** Get all cell indices in the same row as the given index. */
92
+ getRowIndices,
93
+ /** Get all cell indices in the same column as the given index. */
94
+ getColumnIndices,
95
+ /** Get all cell indices in the same block as the given index. */
96
+ getBlockIndices,
97
+ /** Get all related cell indices (same row, column, or block) excluding the cell itself. */
98
+ getRelatedIndices, } from './types';
99
+ /** Display and hint visualization types matching the Kotlin renderable layer. */
100
+ export type {
101
+ /** Highlighted area in a hint (row, column, or block). */
102
+ HintArea,
103
+ /** Cell display information in a hint step. */
104
+ HintCell,
105
+ /** Actions to perform on a cell during hint visualization. */
106
+ HintCellActions,
107
+ /** A single hint step with title, text, areas, cells, links, and groups. */
108
+ DisplayHintStep,
109
+ /** Complete display state for a single cell (colors, digit, pencilmarks). */
110
+ CellDisplayState,
111
+ /** Display state for a single pencilmark (digit and color). */
112
+ PencilmarkDisplayState,
113
+ /** UI color palette with system colors for light or dark mode. */
114
+ UIColorPalette,
115
+ /** Link type for chain visualization ('strong' | 'weak'). */
116
+ LinkType,
117
+ /** A link between two cells in a chain (display format). */
118
+ DisplayLink,
119
+ /** A group of cells for pattern visualization (display format). */
120
+ DisplayCellGroup, } from './types';
121
+ /** Theme and color enums plus predefined light/dark palettes. */
17
122
  export { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';
18
- export type { CompletedPuzzle, GameStats, UserProgress } from './types';
19
- export { DEFAULT_PROGRESS, PROGRESS_STORAGE_KEY } from './types';
20
- export type { DigitDisplay, AppSettings } from './types';
21
- export { DEFAULT_SETTINGS, SETTINGS_STORAGE_KEY } from './types';
22
- export type { Product, Subscription } from './types';
123
+ /** Types for tracking user puzzle completion and statistics. */
124
+ export type {
125
+ /** Record of a completed puzzle (id, type, time). */
126
+ CompletedPuzzle,
127
+ /** Computed game statistics (best times, averages). */
128
+ GameStats,
129
+ /** Full user progress data (completed puzzles, streak, stats). */
130
+ UserProgress, } from './types';
131
+ export {
132
+ /** Default empty user progress state. */
133
+ DEFAULT_PROGRESS,
134
+ /** localStorage key for progress data ('sudojo-progress'). */
135
+ PROGRESS_STORAGE_KEY, } from './types';
136
+ /** Types for application settings. */
137
+ export type {
138
+ /** Digit display format ('numeric' | 'kanji' | 'emojis'). */
139
+ DigitDisplay,
140
+ /** Application settings (showErrors, symmetrical, display). */
141
+ AppSettings, } from './types';
142
+ export {
143
+ /** Default application settings. */
144
+ DEFAULT_SETTINGS,
145
+ /** localStorage key for settings ('sudojo-settings'). */
146
+ SETTINGS_STORAGE_KEY, } from './types';
147
+ /** Types for RevenueCat subscription management. */
148
+ export type {
149
+ /** Subscription product information (price, period, trial). */
150
+ Product,
151
+ /** User subscription status (active, expiration, renewal). */
152
+ Subscription, } from './types';
153
+ /** Default inactive subscription state. */
23
154
  export { DEFAULT_SUBSCRIPTION } from './types';
24
- export type { SavedGameState, GamePersistenceKey } from './types';
25
- export { GAME_STORAGE_PREFIX, getGameStorageKey } from './types';
26
- export type { GameSource, CurrentGameMeta, CurrentGame, GameSlot, } from './types';
27
- export { cloneBoard, countFilledCells, createGameBoard, getBlockCells, getBlockIndex, getBoardStateString, getColumnCells, getEmptyCells, getPencilmarksString, getRelatedCells, getRowCells, isValidPlacement, autoRemovePencilmarks, clearHighlights, countMistakes, getIncorrectCells, getProgressPercentage, isBoardFilled, isCellCorrect, isGameComplete, isValueCorrect, updateCellErrors, updateCellHighlights, validateGameState, } from './utils';
28
- export type { ScramblerProtocol, SudokuScrambleResult } from './utils';
29
- export { Scrambler, NonScrambler, scrambleSudokuBoard, parsePuzzleString, cellsToPuzzleString, cellsToStateString, cellsToInputString, cellsToPencilmarksString, } from './utils';
30
- export type { PresentBoardOptions } from './utils';
31
- export { presentBoard, calculateCellHints, themeColorToCSS, getColorPalette, getCellsWithDigit, getSelectedDigit, computeSelectedDigitCells, convertSolverLink, convertSolverCellGroup, sudokuColorToTheme, } from './utils';
32
- export { formatTime, parseTime } from './utils';
33
- export { calculateStats, calculateStreak, isPuzzleCompleted, getCompletedLevelIds, getCompletedDailyDates, } from './utils';
34
- export type { ThemePreference, ResolvedTheme } from './utils';
35
- export { THEME_STORAGE_KEY, getSystemTheme, resolveTheme, isValidThemePreference, } from './utils';
36
- export { convertPackageToProduct, parseCustomerInfo, getPeriodDisplayName, isBestValuePlan, getRevenueCatErrorMessage, } from './utils';
37
- export { getTechniqueIconUrl } from './utils';
38
- export { generateDetailedExplanation, getHintActionSummary } from './utils';
39
- export type { TranslateFunction } from './utils';
40
- export { getLocalizedHintText } from './utils';
41
- export { getBeltKey, getLocalizedBeltName, getBeltLabelKey, getLocalizedBeltLabel, getLevelKey, getLocalizedLevelTitle, getTechniqueKey, getLocalizedTechniqueName, } from './utils';
42
- export { displayDigit } from './utils';
43
- export { useLevel, useLevels, useTechnique, useTechniques, useLearning, useLearningItem, useGame, useSudoku, useGameTeaching, useLevelGame, useDailyGame, useGameTimer, useGamePersistence, useAutoSave, useLocalStorage, useHint, useGamePlay, useBoardEntry, useGameSession, } from './hooks';
44
- export type { UseLevelOptions, UseLevelResult, UseLevelsOptions, UseLevelsResult, UseTechniqueOptions, UseTechniqueResult, UseTechniquesOptions, UseTechniquesResult, UseLearningItemOptions, UseLearningItemResult, UseLearningOptions, UseLearningResult, UseGameOptions, UseGameResult, UseSudokuOptions, UseSudokuResult, UseGameTeachingOptions, UseGameTeachingResult, UseLevelGameOptions, UseLevelGameResult, UseDailyGameOptions, UseDailyGameResult, GameFetchStatus, UseGameTimerOptions, UseGameTimerResult, UseGamePersistenceOptions, UseGamePersistenceResult, UseHintOptions, UseHintResult, HintBoardData, HintReceivedData, HintAccessError, UseGamePlayOptions, UseGamePlayResult, UseBoardEntryOptions, UseBoardEntryReturn, ValidatedPuzzle, UseGameSessionOptions, GameSessionResult, GameFinishResult, } from './hooks';
155
+ /** Types for saving and restoring game progress to localStorage. */
156
+ export type {
157
+ /** Saved game state (input, pencilmarks, mode, timestamp). */
158
+ SavedGameState,
159
+ /** Key identifying a game to persist (type + id). */
160
+ GamePersistenceKey, } from './types';
161
+ export {
162
+ /** localStorage key prefix for game saves ('sudojo_game_'). */
163
+ GAME_STORAGE_PREFIX,
164
+ /** Generate a localStorage key from a GamePersistenceKey. */
165
+ getGameStorageKey, } from './types';
166
+ /** Types for the Zustand-backed current game store. */
167
+ export type {
168
+ /** Source of the current game ('daily' | 'level' | 'entered'). */
169
+ GameSource,
170
+ /** Navigation metadata for resuming a game (date, level, board info). */
171
+ CurrentGameMeta,
172
+ /** Full current game state stored in Zustand (puzzle, progress, timing). */
173
+ CurrentGame,
174
+ /** Which store slot a game lives in ('daily' | 'play'). */
175
+ GameSlot, } from './types';
176
+ /**
177
+ * @deprecated These utilities work with the legacy 2D `GameBoard` type.
178
+ * For new code, use `useSudoku` with its flat 81-cell board and the
179
+ * scrambler/presenter utilities below.
180
+ */
181
+ export {
182
+ /** @deprecated Clone a 2D GameBoard. Use useSudoku's immutable state instead. */
183
+ cloneBoard,
184
+ /** @deprecated Count filled cells in a 2D GameBoard. */
185
+ countFilledCells,
186
+ /** @deprecated Create a 2D GameBoard from puzzle/solution strings. */
187
+ createGameBoard,
188
+ /** @deprecated Get cells in a block by block index (2D API). */
189
+ getBlockCells,
190
+ /** @deprecated Get block index from row/col (2D API). Use blockOf() instead. */
191
+ getBlockIndex,
192
+ /** @deprecated Get 2D board state as string. Use cellsToStateString() instead. */
193
+ getBoardStateString,
194
+ /** @deprecated Get cells in a column (2D API). Use getColumnIndices() instead. */
195
+ getColumnCells,
196
+ /** @deprecated Get empty cells from a 2D GameBoard. */
197
+ getEmptyCells,
198
+ /** @deprecated Get pencilmarks string from 2D GameBoard. Use cellsToPencilmarksString() instead. */
199
+ getPencilmarksString,
200
+ /** @deprecated Get related cells (2D API). Use getRelatedIndices() instead. */
201
+ getRelatedCells,
202
+ /** @deprecated Get cells in a row (2D API). Use getRowIndices() instead. */
203
+ getRowCells,
204
+ /** @deprecated Check if placement is valid (2D API). */
205
+ isValidPlacement,
206
+ /** @deprecated Auto-remove pencilmarks (2D API). useSudoku handles this internally. */
207
+ autoRemovePencilmarks,
208
+ /** @deprecated Clear highlights (2D API). useSudoku handles this via presentBoard(). */
209
+ clearHighlights,
210
+ /** @deprecated Count mistakes (2D API). Use useSudoku's errorCount instead. */
211
+ countMistakes,
212
+ /** @deprecated Get incorrect cells (2D API). Use useSudoku's errorCells instead. */
213
+ getIncorrectCells,
214
+ /** @deprecated Get progress percentage (2D API). Use useSudoku's progress instead. */
215
+ getProgressPercentage,
216
+ /** @deprecated Check if board is filled (2D API). */
217
+ isBoardFilled,
218
+ /** @deprecated Check if cell is correct (2D API). Use cellHasError() instead. */
219
+ isCellCorrect,
220
+ /** @deprecated Check if game is complete (2D API). Use useSudoku's isCompleted instead. */
221
+ isGameComplete,
222
+ /** @deprecated Check if value is correct (2D API). */
223
+ isValueCorrect,
224
+ /** @deprecated Update cell errors (2D API). useSudoku handles this automatically. */
225
+ updateCellErrors,
226
+ /** @deprecated Update cell highlights (2D API). Use presentBoard() instead. */
227
+ updateCellHighlights,
228
+ /** @deprecated Validate entire game state (2D API). */
229
+ validateGameState, } from './utils';
230
+ /** Types for board scrambling. */
231
+ export type {
232
+ /** Protocol for board scramblers (Scrambler and NonScrambler implement this). */
233
+ ScramblerProtocol,
234
+ /** Result of scrambling a board (cells + digit mappings). */
235
+ SudokuScrambleResult, } from './utils';
236
+ /** Board scrambling and puzzle string conversion utilities. */
237
+ export {
238
+ /** Scrambler that permutes rows, columns, and digits to create unique puzzles. */
239
+ Scrambler,
240
+ /** Identity scrambler that returns the board unchanged. */
241
+ NonScrambler,
242
+ /** Scramble a board using a ScramblerProtocol implementation. */
243
+ scrambleSudokuBoard,
244
+ /** Parse an 81-character puzzle string into SudokuCell array. */
245
+ parsePuzzleString,
246
+ /** Convert SudokuCell array to puzzle string (given values only). */
247
+ cellsToPuzzleString,
248
+ /** Convert SudokuCell array to state string (given + input values). */
249
+ cellsToStateString,
250
+ /** Convert SudokuCell array to input-only string. */
251
+ cellsToInputString,
252
+ /** Convert SudokuCell array to comma-separated pencilmarks string. */
253
+ cellsToPencilmarksString, } from './utils';
254
+ /** Options type for the presentBoard function. */
255
+ export type {
256
+ /** Options for generating cell display states (cells, selection, errors, hints). */
257
+ PresentBoardOptions, } from './utils';
258
+ /** Board presentation and color utilities matching the Kotlin renderable layer. */
259
+ export {
260
+ /** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */
261
+ presentBoard,
262
+ /** Process hint step areas and cells into a map of cell hints by index. */
263
+ calculateCellHints,
264
+ /** Convert a ThemeColor to an actual CSS color string using a palette. */
265
+ themeColorToCSS,
266
+ /** Get the UIColorPalette for light or dark mode. */
267
+ getColorPalette,
268
+ /** Get indices of cells containing a specific digit (given or input). */
269
+ getCellsWithDigit,
270
+ /** Get the digit to highlight based on the selected cell (given or correct input). */
271
+ getSelectedDigit,
272
+ /** Compute the set of cell indices with the same digit as the selected cell. */
273
+ computeSelectedDigitCells,
274
+ /** Convert a solver link (row/col pairs) to display format (flat indices). */
275
+ convertSolverLink,
276
+ /** Convert a solver cell group to display format with ThemeColor. */
277
+ convertSolverCellGroup,
278
+ /** Convert SudokuColor enum to ThemeColor enum. */
279
+ sudokuColorToTheme, } from './utils';
280
+ /** Time formatting and parsing utilities. */
281
+ export {
282
+ /** Format seconds into MM:SS or HH:MM:SS string. */
283
+ formatTime,
284
+ /** Parse a MM:SS or HH:MM:SS string back to total seconds. */
285
+ parseTime, } from './utils';
286
+ /** User progress calculation utilities. */
287
+ export {
288
+ /** Calculate game statistics (best times, averages) from completed puzzles. */
289
+ calculateStats,
290
+ /** Calculate current daily streak from completion history. */
291
+ calculateStreak,
292
+ /** Check if a specific puzzle (by type and id) has been completed. */
293
+ isPuzzleCompleted,
294
+ /** Get all completed level IDs from completion history. */
295
+ getCompletedLevelIds,
296
+ /** Get all completed daily dates (YYYY-MM-DD) from completion history. */
297
+ getCompletedDailyDates, } from './utils';
298
+ /** Types for theme preference management. */
299
+ export type {
300
+ /** Theme preference: 'light' | 'dark' | 'system'. */
301
+ ThemePreference,
302
+ /** Resolved theme without system option: 'light' | 'dark'. */
303
+ ResolvedTheme, } from './utils';
304
+ /** Theme detection and resolution utilities. */
305
+ export {
306
+ /** localStorage key for theme preference ('sudojo-theme'). */
307
+ THEME_STORAGE_KEY,
308
+ /** Detect the system color scheme preference (light/dark). */
309
+ getSystemTheme,
310
+ /** Resolve a ThemePreference to an actual theme using the system theme. */
311
+ resolveTheme,
312
+ /** Type guard: check if a value is a valid ThemePreference. */
313
+ isValidThemePreference, } from './utils';
314
+ /** RevenueCat subscription conversion and display utilities. */
315
+ export {
316
+ /** Convert a RevenueCat package to a Product domain model. */
317
+ convertPackageToProduct,
318
+ /** Parse RevenueCat CustomerInfo into a Subscription domain model. */
319
+ parseCustomerInfo,
320
+ /** Get human-readable name for an ISO 8601 subscription period (e.g., 'P1M' -> 'Monthly'). */
321
+ getPeriodDisplayName,
322
+ /** Check if a subscription period is the "best value" option (annual plans). */
323
+ isBestValuePlan,
324
+ /** Get a user-friendly error message for a RevenueCat error code. */
325
+ getRevenueCatErrorMessage, } from './utils';
326
+ /** Technique display utilities. */
327
+ export {
328
+ /** Get the icon URL for a solving technique by its path slug. */
329
+ getTechniqueIconUrl, } from './utils';
330
+ /** Hint explanation generation utilities for teaching users solving techniques. */
331
+ export {
332
+ /** Generate a detailed explanation for a hint step based on the technique. */
333
+ generateDetailedExplanation,
334
+ /** Get a short action summary for a hint step (e.g., 'Place 5 in R1C3'). */
335
+ getHintActionSummary, } from './utils';
336
+ /** Types for hint text localization. */
337
+ export type {
338
+ /** Translation function compatible with i18next's `t` function. */
339
+ TranslateFunction, } from './utils';
340
+ /** Hint localization utilities. */
341
+ export {
342
+ /** Get localized text for a hint step using a translation function. */
343
+ getLocalizedHintText, } from './utils';
344
+ /** Internationalization key generation and localization utilities. */
345
+ export {
346
+ /** Get i18n key for a belt name (e.g., 'belts.1.name'). */
347
+ getBeltKey,
348
+ /** Get localized belt name using a translation function. */
349
+ getLocalizedBeltName,
350
+ /** Get i18n key for a belt label (e.g., 'belts.1.label'). */
351
+ getBeltLabelKey,
352
+ /** Get localized belt label (e.g., 'White Belt'). */
353
+ getLocalizedBeltLabel,
354
+ /** Get i18n key for a level title (e.g., 'levels.3'). */
355
+ getLevelKey,
356
+ /** Get localized level title using a translation function. */
357
+ getLocalizedLevelTitle,
358
+ /** Get i18n key for a technique name (e.g., 'techniques.full-house.title'). */
359
+ getTechniqueKey,
360
+ /** Get localized technique name using a translation function. */
361
+ getLocalizedTechniqueName, } from './utils';
362
+ /** Digit display format conversion. */
363
+ export {
364
+ /** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */
365
+ displayDigit, } from './utils';
366
+ export {
367
+ /** Fetch a single difficulty level by number. */
368
+ useLevel,
369
+ /** Fetch all difficulty levels with sorting and filtering utilities. */
370
+ useLevels,
371
+ /** Fetch a single solving technique by number. */
372
+ useTechnique,
373
+ /** Fetch all solving techniques with grouping utilities. */
374
+ useTechniques,
375
+ /** Fetch learning materials with filtering by technique and language. */
376
+ useLearning,
377
+ /** Fetch a single learning item by UUID. */
378
+ useLearningItem,
379
+ /**
380
+ * @deprecated Use `useSudoku` instead. `useGame` uses a legacy 2D array board
381
+ * representation, while `useSudoku` uses a flat 81-cell array consistent with
382
+ * the Kotlin renderable layer and the rest of the codebase.
383
+ */
384
+ useGame,
385
+ /** Primary game state hook with flat 81-cell board, pencil mode, and scrambling. */
386
+ useSudoku,
387
+ /** Teaching/hint integration with the solver API (legacy GameHint format). */
388
+ useGameTeaching,
389
+ /** Fetch a random board for a specific level with auth/subscription handling. */
390
+ useLevelGame,
391
+ /** Fetch today's daily puzzle with auth/subscription handling. */
392
+ useDailyGame,
393
+ /** Game timer using refs to avoid re-renders every second. */
394
+ useGameTimer,
395
+ /** Persist individual game progress to localStorage. */
396
+ useGamePersistence,
397
+ /** Auto-save game state with debouncing. */
398
+ useAutoSave,
399
+ /** Generic typed localStorage hook with SSR safety. */
400
+ useLocalStorage,
401
+ /** Solver hint integration matching Kotlin HintInteractor behavior. */
402
+ useHint,
403
+ /** Current game management with Zustand store (daily/play slots). */
404
+ useGamePlay,
405
+ /** Manual puzzle entry mode with solver validation. */
406
+ useBoardEntry,
407
+ /** Server-side game session management for gamification (points, badges). */
408
+ useGameSession, } from './hooks';
409
+ export type {
410
+ /** Options for useLevel hook. */
411
+ UseLevelOptions,
412
+ /** Result type for useLevel hook. */
413
+ UseLevelResult,
414
+ /** Options for useLevels hook. */
415
+ UseLevelsOptions,
416
+ /** Result type for useLevels hook. */
417
+ UseLevelsResult,
418
+ /** Options for useTechnique hook. */
419
+ UseTechniqueOptions,
420
+ /** Result type for useTechnique hook. */
421
+ UseTechniqueResult,
422
+ /** Options for useTechniques hook. */
423
+ UseTechniquesOptions,
424
+ /** Result type for useTechniques hook. */
425
+ UseTechniquesResult,
426
+ /** Options for useLearningItem hook. */
427
+ UseLearningItemOptions,
428
+ /** Result type for useLearningItem hook. */
429
+ UseLearningItemResult,
430
+ /** Options for useLearning hook. */
431
+ UseLearningOptions,
432
+ /** Result type for useLearning hook. */
433
+ UseLearningResult,
434
+ /** @deprecated Options for legacy useGame hook. Use UseSudokuOptions instead. */
435
+ UseGameOptions,
436
+ /** @deprecated Result type for legacy useGame hook. Use UseSudokuResult instead. */
437
+ UseGameResult,
438
+ /** Options for useSudoku hook (initial app settings). */
439
+ UseSudokuOptions,
440
+ /** Result type for useSudoku hook (state, computed values, actions, utilities). */
441
+ UseSudokuResult,
442
+ /** Options for useGameTeaching hook (network client, URL, token). */
443
+ UseGameTeachingOptions,
444
+ /** Result type for useGameTeaching hook (teaching state, hint actions). */
445
+ UseGameTeachingResult,
446
+ /** Options for useLevelGame hook (network, auth, level number). */
447
+ UseLevelGameOptions,
448
+ /** Result type for useLevelGame hook (board data, fetch status). */
449
+ UseLevelGameResult,
450
+ /** Options for useDailyGame hook (network, auth). */
451
+ UseDailyGameOptions,
452
+ /** Result type for useDailyGame hook (daily data, fetch status). */
453
+ UseDailyGameResult,
454
+ /** Status of a game fetch: 'loading' | 'success' | 'auth_required' | 'subscription_required' | 'error'. */
455
+ GameFetchStatus,
456
+ /** Options for useGameTimer hook (autoStart, initialTime). */
457
+ UseGameTimerOptions,
458
+ /** Result type for useGameTimer hook (elapsedRef, controls). */
459
+ UseGameTimerResult,
460
+ /** Options for useGamePersistence hook (puzzleKey, autoSave). */
461
+ UseGamePersistenceOptions,
462
+ /** Result type for useGamePersistence hook (load, save, clear, hasSaved). */
463
+ UseGamePersistenceResult,
464
+ /** Options for useHint hook (network, puzzle state, technique filter). */
465
+ UseHintOptions,
466
+ /** Result type for useHint hook (hint steps, navigation, apply). */
467
+ UseHintResult,
468
+ /** Board data returned when applying a hint (user input, pencilmarks). */
469
+ HintBoardData,
470
+ /** Data passed to onHintReceived callback (hint, board data, technique info). */
471
+ HintReceivedData,
472
+ /** Access denied error info when hint level exceeds subscription tier. */
473
+ HintAccessError,
474
+ /** Options for useGamePlay hook (slot selection, auto-save delay). */
475
+ UseGamePlayOptions,
476
+ /** Result type for useGamePlay hook (current game, start, update, clear). */
477
+ UseGamePlayResult,
478
+ /** Options for useBoardEntry hook (network client, URL, token). */
479
+ UseBoardEntryOptions,
480
+ /** Result type for useBoardEntry hook (cells, validation, actions). */
481
+ UseBoardEntryReturn,
482
+ /** Validated puzzle data from solver (puzzle + solution strings). */
483
+ ValidatedPuzzle,
484
+ /** Options for useGameSession hook (network, auth, userId). */
485
+ UseGameSessionOptions,
486
+ /** Result of starting a game session (sessionStarted, sessionId). */
487
+ GameSessionResult,
488
+ /** Result of finishing a game session (leveledUp, badges, points). */
489
+ GameFinishResult, } from './hooks';
490
+ /** Zustand store for current game state with daily/play slots and localStorage persistence. */
45
491
  export { useGamePlayStore } from './stores/gamePlayStore';
492
+ /** State shape for the game play Zustand store. */
46
493
  export type { GamePlayState } from './stores/gamePlayStore';
47
- export type { AuthProviderType, AuthProvidersConfig } from './config';
494
+ /** Authentication provider configuration types. */
495
+ export type {
496
+ /** Available auth provider types: 'google' | 'apple' | 'email'. */
497
+ AuthProviderType,
498
+ /** Configuration for which auth providers are enabled. */
499
+ AuthProvidersConfig, } from './config';
500
+ /** Default auth providers configuration (Google + Email, anonymous fallback). */
48
501
  export { DEFAULT_AUTH_PROVIDERS } from './config';
49
502
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,YAAY,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,YAAY,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EAEd,QAAQ,EACR,WAAW,EACX,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AACrD,mBAAmB;AACnB,oEAAoE;AACpE,kBAAkB;AAClB,2GAA2G;AAC3G,eAAe;AAGf,8DAA8D;AAC9D,mBAAmB;AACnB,gEAAgE;AAChE,kBAAkB;AAGlB,iEAAiE;AACjE,yBAAyB;AACzB,6EAA6E;AAC7E,wBAAwB;AAGxB,0EAA0E;AAC1E,cAAc;AACd,oEAAoE;AACpE,aAAa;AACb,0EAA0E;AAC1E,aAAa;AACb,iFAAiF;AACjF,gBAAgB;AAChB,0EAA0E;AAC1E,eAAe;AAGf,sEAAsE;AACtE,kBAAkB;AAClB,6EAA6E;AAC7E,iBAAiB;AAGjB,mEAAmE;AACnE,oBAAoB;AACpB,uEAAuE;AACvE,mBAAmB;AACnB,qEAAqE;AACrE,eAAe;AAGf,+DAA+D;AAC/D,qBAAqB;AACrB,qEAAqE;AACrE,iBAAiB;AACjB,sEAAsE;AACtE,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAMjB,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,mDAAmD;AACnD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM5D,mDAAmD;AACnD,YAAY;AACV,mEAAmE;AACnE,gBAAgB;AAChB,0DAA0D;AAC1D,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,iFAAiF;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -8,69 +8,337 @@
8
8
  * - Level, technique, and learning data hooks
9
9
  * - Teaching/hint integration with solver
10
10
  * - Legacy useGame hook for backward compatibility
11
+ *
12
+ * ## Hook Architecture
13
+ *
14
+ * The hooks form a layered composition pattern:
15
+ *
16
+ * **Data hooks** (fetch and cache server data):
17
+ * - `useLevels` / `useLevel` - Difficulty level data
18
+ * - `useTechniques` / `useTechnique` - Solving technique data
19
+ * - `useLearning` / `useLearningItem` - Learning material data
20
+ *
21
+ * **Game fetching hooks** (handle auth, subscription, and puzzle loading):
22
+ * - `useLevelGame` - Fetch a random board for a specific level
23
+ * - `useDailyGame` - Fetch today's daily puzzle
24
+ *
25
+ * **Game state hooks** (manage board state and user interaction):
26
+ * - `useSudoku` - Primary game state (flat 81-cell array, modern API)
27
+ * - `useGame` - Legacy game state (2D array, deprecated)
28
+ * - `useBoardEntry` - Manual puzzle entry mode
29
+ *
30
+ * **Feature hooks** (provide specific game features):
31
+ * - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)
32
+ * - `useGameTeaching` - Step-by-step teaching with solver
33
+ * - `useGameTimer` - Elapsed time tracking via ref (no re-renders)
34
+ * - `useGamePersistence` / `useAutoSave` - localStorage game save/restore
35
+ * - `useLocalStorage` - Generic typed localStorage hook
36
+ *
37
+ * **Orchestration hooks** (combine multiple hooks for app-level features):
38
+ * - `useGamePlay` - Current game management with Zustand store (daily/play slots)
39
+ * - `useGameSession` - Server-side gamification (start/finish, points, badges)
40
+ *
41
+ * ## Migration Guide
42
+ *
43
+ * Legacy exports (prefixed with "Legacy" comments) use the 2D `GameBoard` type
44
+ * from `useGame`. New code should use `useSudoku` with its flat 81-cell
45
+ * `SudokuBoard` type. See `@deprecated` tags on legacy exports.
11
46
  */
47
+ /** @deprecated Use `DEFAULT_APP_SETTINGS` / `DEFAULT_PLAY_SETTINGS` instead. */
12
48
  export { DEFAULT_GAME_SETTINGS } from './types';
13
- export { DEFAULT_PLAY_SETTINGS, DEFAULT_APP_SETTINGS, createEmptyCell, createEmptyBoard, cellHasError, rowOf, columnOf, blockOf, cellIndex, getRowIndices, getColumnIndices, getBlockIndices, getRelatedIndices, } from './types';
49
+ /** Default settings and cell/board helper functions for the modern Sudoku API. */
50
+ export {
51
+ /** Default session play settings (pencilmarking off, auto-pencilmarks off). */
52
+ DEFAULT_PLAY_SETTINGS,
53
+ /** Default app settings (showErrors on, animations on, numeric display). */
54
+ DEFAULT_APP_SETTINGS,
55
+ /** Create an empty SudokuCell at the given index. */
56
+ createEmptyCell,
57
+ /** Create an empty 81-cell SudokuBoard. */
58
+ createEmptyBoard,
59
+ /** Check if a cell has an error (input does not match solution). */
60
+ cellHasError,
61
+ /** Get row index (0-8) from cell index (0-80). */
62
+ rowOf,
63
+ /** Get column index (0-8) from cell index (0-80). */
64
+ columnOf,
65
+ /** Get block index (0-8) from cell index (0-80). */
66
+ blockOf,
67
+ /** Get cell index (0-80) from row and column. */
68
+ cellIndex,
69
+ /** Get all cell indices in the same row as the given index. */
70
+ getRowIndices,
71
+ /** Get all cell indices in the same column as the given index. */
72
+ getColumnIndices,
73
+ /** Get all cell indices in the same block as the given index. */
74
+ getBlockIndices,
75
+ /** Get all related cell indices (same row, column, or block) excluding the cell itself. */
76
+ getRelatedIndices, } from './types';
77
+ /** Theme and color enums plus predefined light/dark palettes. */
14
78
  export { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';
15
- export { DEFAULT_PROGRESS, PROGRESS_STORAGE_KEY } from './types';
16
- export { DEFAULT_SETTINGS, SETTINGS_STORAGE_KEY } from './types';
79
+ export {
80
+ /** Default empty user progress state. */
81
+ DEFAULT_PROGRESS,
82
+ /** localStorage key for progress data ('sudojo-progress'). */
83
+ PROGRESS_STORAGE_KEY, } from './types';
84
+ export {
85
+ /** Default application settings. */
86
+ DEFAULT_SETTINGS,
87
+ /** localStorage key for settings ('sudojo-settings'). */
88
+ SETTINGS_STORAGE_KEY, } from './types';
89
+ /** Default inactive subscription state. */
17
90
  export { DEFAULT_SUBSCRIPTION } from './types';
18
- export { GAME_STORAGE_PREFIX, getGameStorageKey } from './types';
91
+ export {
92
+ /** localStorage key prefix for game saves ('sudojo_game_'). */
93
+ GAME_STORAGE_PREFIX,
94
+ /** Generate a localStorage key from a GamePersistenceKey. */
95
+ getGameStorageKey, } from './types';
96
+ // ============================================================================
19
97
  // Legacy Utilities (useGame hook)
98
+ // ============================================================================
99
+ /**
100
+ * @deprecated These utilities work with the legacy 2D `GameBoard` type.
101
+ * For new code, use `useSudoku` with its flat 81-cell board and the
102
+ * scrambler/presenter utilities below.
103
+ */
104
+ export {
105
+ /** @deprecated Clone a 2D GameBoard. Use useSudoku's immutable state instead. */
106
+ cloneBoard,
107
+ /** @deprecated Count filled cells in a 2D GameBoard. */
108
+ countFilledCells,
109
+ /** @deprecated Create a 2D GameBoard from puzzle/solution strings. */
110
+ createGameBoard,
111
+ /** @deprecated Get cells in a block by block index (2D API). */
112
+ getBlockCells,
113
+ /** @deprecated Get block index from row/col (2D API). Use blockOf() instead. */
114
+ getBlockIndex,
115
+ /** @deprecated Get 2D board state as string. Use cellsToStateString() instead. */
116
+ getBoardStateString,
117
+ /** @deprecated Get cells in a column (2D API). Use getColumnIndices() instead. */
118
+ getColumnCells,
119
+ /** @deprecated Get empty cells from a 2D GameBoard. */
120
+ getEmptyCells,
121
+ /** @deprecated Get pencilmarks string from 2D GameBoard. Use cellsToPencilmarksString() instead. */
122
+ getPencilmarksString,
123
+ /** @deprecated Get related cells (2D API). Use getRelatedIndices() instead. */
124
+ getRelatedCells,
125
+ /** @deprecated Get cells in a row (2D API). Use getRowIndices() instead. */
126
+ getRowCells,
127
+ /** @deprecated Check if placement is valid (2D API). */
128
+ isValidPlacement,
129
+ /** @deprecated Auto-remove pencilmarks (2D API). useSudoku handles this internally. */
130
+ autoRemovePencilmarks,
131
+ /** @deprecated Clear highlights (2D API). useSudoku handles this via presentBoard(). */
132
+ clearHighlights,
133
+ /** @deprecated Count mistakes (2D API). Use useSudoku's errorCount instead. */
134
+ countMistakes,
135
+ /** @deprecated Get incorrect cells (2D API). Use useSudoku's errorCells instead. */
136
+ getIncorrectCells,
137
+ /** @deprecated Get progress percentage (2D API). Use useSudoku's progress instead. */
138
+ getProgressPercentage,
139
+ /** @deprecated Check if board is filled (2D API). */
140
+ isBoardFilled,
141
+ /** @deprecated Check if cell is correct (2D API). Use cellHasError() instead. */
142
+ isCellCorrect,
143
+ /** @deprecated Check if game is complete (2D API). Use useSudoku's isCompleted instead. */
144
+ isGameComplete,
145
+ /** @deprecated Check if value is correct (2D API). */
146
+ isValueCorrect,
147
+ /** @deprecated Update cell errors (2D API). useSudoku handles this automatically. */
148
+ updateCellErrors,
149
+ /** @deprecated Update cell highlights (2D API). Use presentBoard() instead. */
150
+ updateCellHighlights,
151
+ /** @deprecated Validate entire game state (2D API). */
152
+ validateGameState, } from './utils';
153
+ /** Board scrambling and puzzle string conversion utilities. */
20
154
  export {
21
- // Board utilities
22
- cloneBoard, countFilledCells, createGameBoard, getBlockCells, getBlockIndex, getBoardStateString, getColumnCells, getEmptyCells, getPencilmarksString, getRelatedCells, getRowCells, isValidPlacement,
23
- // Validation utilities
24
- autoRemovePencilmarks, clearHighlights, countMistakes, getIncorrectCells, getProgressPercentage, isBoardFilled, isCellCorrect, isGameComplete, isValueCorrect, updateCellErrors, updateCellHighlights, validateGameState, } from './utils';
25
- export { Scrambler, NonScrambler, scrambleSudokuBoard, parsePuzzleString, cellsToPuzzleString, cellsToStateString, cellsToInputString, cellsToPencilmarksString, } from './utils';
26
- export { presentBoard, calculateCellHints, themeColorToCSS, getColorPalette, getCellsWithDigit, getSelectedDigit, computeSelectedDigitCells, convertSolverLink, convertSolverCellGroup, sudokuColorToTheme, } from './utils';
155
+ /** Scrambler that permutes rows, columns, and digits to create unique puzzles. */
156
+ Scrambler,
157
+ /** Identity scrambler that returns the board unchanged. */
158
+ NonScrambler,
159
+ /** Scramble a board using a ScramblerProtocol implementation. */
160
+ scrambleSudokuBoard,
161
+ /** Parse an 81-character puzzle string into SudokuCell array. */
162
+ parsePuzzleString,
163
+ /** Convert SudokuCell array to puzzle string (given values only). */
164
+ cellsToPuzzleString,
165
+ /** Convert SudokuCell array to state string (given + input values). */
166
+ cellsToStateString,
167
+ /** Convert SudokuCell array to input-only string. */
168
+ cellsToInputString,
169
+ /** Convert SudokuCell array to comma-separated pencilmarks string. */
170
+ cellsToPencilmarksString, } from './utils';
171
+ /** Board presentation and color utilities matching the Kotlin renderable layer. */
172
+ export {
173
+ /** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */
174
+ presentBoard,
175
+ /** Process hint step areas and cells into a map of cell hints by index. */
176
+ calculateCellHints,
177
+ /** Convert a ThemeColor to an actual CSS color string using a palette. */
178
+ themeColorToCSS,
179
+ /** Get the UIColorPalette for light or dark mode. */
180
+ getColorPalette,
181
+ /** Get indices of cells containing a specific digit (given or input). */
182
+ getCellsWithDigit,
183
+ /** Get the digit to highlight based on the selected cell (given or correct input). */
184
+ getSelectedDigit,
185
+ /** Compute the set of cell indices with the same digit as the selected cell. */
186
+ computeSelectedDigitCells,
187
+ /** Convert a solver link (row/col pairs) to display format (flat indices). */
188
+ convertSolverLink,
189
+ /** Convert a solver cell group to display format with ThemeColor. */
190
+ convertSolverCellGroup,
191
+ /** Convert SudokuColor enum to ThemeColor enum. */
192
+ sudokuColorToTheme, } from './utils';
193
+ // ============================================================================
27
194
  // Time Utilities
28
- export { formatTime, parseTime } from './utils';
195
+ // ============================================================================
196
+ /** Time formatting and parsing utilities. */
197
+ export {
198
+ /** Format seconds into MM:SS or HH:MM:SS string. */
199
+ formatTime,
200
+ /** Parse a MM:SS or HH:MM:SS string back to total seconds. */
201
+ parseTime, } from './utils';
202
+ // ============================================================================
29
203
  // Progress Utilities
30
- export { calculateStats, calculateStreak, isPuzzleCompleted, getCompletedLevelIds, getCompletedDailyDates, } from './utils';
31
- export { THEME_STORAGE_KEY, getSystemTheme, resolveTheme, isValidThemePreference, } from './utils';
204
+ // ============================================================================
205
+ /** User progress calculation utilities. */
206
+ export {
207
+ /** Calculate game statistics (best times, averages) from completed puzzles. */
208
+ calculateStats,
209
+ /** Calculate current daily streak from completion history. */
210
+ calculateStreak,
211
+ /** Check if a specific puzzle (by type and id) has been completed. */
212
+ isPuzzleCompleted,
213
+ /** Get all completed level IDs from completion history. */
214
+ getCompletedLevelIds,
215
+ /** Get all completed daily dates (YYYY-MM-DD) from completion history. */
216
+ getCompletedDailyDates, } from './utils';
217
+ /** Theme detection and resolution utilities. */
218
+ export {
219
+ /** localStorage key for theme preference ('sudojo-theme'). */
220
+ THEME_STORAGE_KEY,
221
+ /** Detect the system color scheme preference (light/dark). */
222
+ getSystemTheme,
223
+ /** Resolve a ThemePreference to an actual theme using the system theme. */
224
+ resolveTheme,
225
+ /** Type guard: check if a value is a valid ThemePreference. */
226
+ isValidThemePreference, } from './utils';
227
+ // ============================================================================
32
228
  // Subscription Utilities
33
- export { convertPackageToProduct, parseCustomerInfo, getPeriodDisplayName, isBestValuePlan, getRevenueCatErrorMessage, } from './utils';
229
+ // ============================================================================
230
+ /** RevenueCat subscription conversion and display utilities. */
231
+ export {
232
+ /** Convert a RevenueCat package to a Product domain model. */
233
+ convertPackageToProduct,
234
+ /** Parse RevenueCat CustomerInfo into a Subscription domain model. */
235
+ parseCustomerInfo,
236
+ /** Get human-readable name for an ISO 8601 subscription period (e.g., 'P1M' -> 'Monthly'). */
237
+ getPeriodDisplayName,
238
+ /** Check if a subscription period is the "best value" option (annual plans). */
239
+ isBestValuePlan,
240
+ /** Get a user-friendly error message for a RevenueCat error code. */
241
+ getRevenueCatErrorMessage, } from './utils';
242
+ // ============================================================================
34
243
  // Technique Utilities
35
- export { getTechniqueIconUrl } from './utils';
244
+ // ============================================================================
245
+ /** Technique display utilities. */
246
+ export {
247
+ /** Get the icon URL for a solving technique by its path slug. */
248
+ getTechniqueIconUrl, } from './utils';
249
+ // ============================================================================
36
250
  // Hint Explanation Utilities
37
- export { generateDetailedExplanation, getHintActionSummary } from './utils';
38
- export { getLocalizedHintText } from './utils';
251
+ // ============================================================================
252
+ /** Hint explanation generation utilities for teaching users solving techniques. */
253
+ export {
254
+ /** Generate a detailed explanation for a hint step based on the technique. */
255
+ generateDetailedExplanation,
256
+ /** Get a short action summary for a hint step (e.g., 'Place 5 in R1C3'). */
257
+ getHintActionSummary, } from './utils';
258
+ /** Hint localization utilities. */
259
+ export {
260
+ /** Get localized text for a hint step using a translation function. */
261
+ getLocalizedHintText, } from './utils';
262
+ // ============================================================================
39
263
  // i18n Key Utilities
40
- export { getBeltKey, getLocalizedBeltName, getBeltLabelKey, getLocalizedBeltLabel, getLevelKey, getLocalizedLevelTitle, getTechniqueKey, getLocalizedTechniqueName, } from './utils';
264
+ // ============================================================================
265
+ /** Internationalization key generation and localization utilities. */
266
+ export {
267
+ /** Get i18n key for a belt name (e.g., 'belts.1.name'). */
268
+ getBeltKey,
269
+ /** Get localized belt name using a translation function. */
270
+ getLocalizedBeltName,
271
+ /** Get i18n key for a belt label (e.g., 'belts.1.label'). */
272
+ getBeltLabelKey,
273
+ /** Get localized belt label (e.g., 'White Belt'). */
274
+ getLocalizedBeltLabel,
275
+ /** Get i18n key for a level title (e.g., 'levels.3'). */
276
+ getLevelKey,
277
+ /** Get localized level title using a translation function. */
278
+ getLocalizedLevelTitle,
279
+ /** Get i18n key for a technique name (e.g., 'techniques.full-house.title'). */
280
+ getTechniqueKey,
281
+ /** Get localized technique name using a translation function. */
282
+ getLocalizedTechniqueName, } from './utils';
283
+ // ============================================================================
41
284
  // Digit Display Utilities
42
- export { displayDigit } from './utils';
285
+ // ============================================================================
286
+ /** Digit display format conversion. */
287
+ export {
288
+ /** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */
289
+ displayDigit, } from './utils';
290
+ // ============================================================================
43
291
  // Hooks
292
+ // ============================================================================
44
293
  export {
45
- // Levels
46
- useLevel, useLevels,
47
- // Techniques
48
- useTechnique, useTechniques,
49
- // Learning
50
- useLearning, useLearningItem,
51
- // Game (legacy)
294
+ // Data hooks
295
+ /** Fetch a single difficulty level by number. */
296
+ useLevel,
297
+ /** Fetch all difficulty levels with sorting and filtering utilities. */
298
+ useLevels,
299
+ /** Fetch a single solving technique by number. */
300
+ useTechnique,
301
+ /** Fetch all solving techniques with grouping utilities. */
302
+ useTechniques,
303
+ /** Fetch learning materials with filtering by technique and language. */
304
+ useLearning,
305
+ /** Fetch a single learning item by UUID. */
306
+ useLearningItem,
307
+ /**
308
+ * @deprecated Use `useSudoku` instead. `useGame` uses a legacy 2D array board
309
+ * representation, while `useSudoku` uses a flat 81-cell array consistent with
310
+ * the Kotlin renderable layer and the rest of the codebase.
311
+ */
52
312
  useGame,
53
- // Sudoku (ported from renderable)
313
+ /** Primary game state hook with flat 81-cell board, pencil mode, and scrambling. */
54
314
  useSudoku,
55
- // Teaching
315
+ /** Teaching/hint integration with the solver API (legacy GameHint format). */
56
316
  useGameTeaching,
57
- // Game fetching (with auth/subscription handling)
58
- useLevelGame, useDailyGame,
59
- // Game timer
317
+ /** Fetch a random board for a specific level with auth/subscription handling. */
318
+ useLevelGame,
319
+ /** Fetch today's daily puzzle with auth/subscription handling. */
320
+ useDailyGame,
321
+ /** Game timer using refs to avoid re-renders every second. */
60
322
  useGameTimer,
61
- // Game persistence
62
- useGamePersistence, useAutoSave,
63
- // Local storage
323
+ /** Persist individual game progress to localStorage. */
324
+ useGamePersistence,
325
+ /** Auto-save game state with debouncing. */
326
+ useAutoSave,
327
+ /** Generic typed localStorage hook with SSR safety. */
64
328
  useLocalStorage,
65
- // Hint
329
+ /** Solver hint integration matching Kotlin HintInteractor behavior. */
66
330
  useHint,
67
- // Game play (current game management)
331
+ /** Current game management with Zustand store (daily/play slots). */
68
332
  useGamePlay,
69
- // Board entry
333
+ /** Manual puzzle entry mode with solver validation. */
70
334
  useBoardEntry,
71
- // Game session
335
+ /** Server-side game session management for gamification (points, badges). */
72
336
  useGameSession, } from './hooks';
337
+ // ============================================================================
73
338
  // Stores
339
+ // ============================================================================
340
+ /** Zustand store for current game state with daily/play slots and localStorage persistence. */
74
341
  export { useGamePlayStore } from './stores/gamePlayStore';
342
+ /** Default auth providers configuration (Google + Email, anonymous fallback). */
75
343
  export { DEFAULT_AUTH_PROVIDERS } from './config';
76
344
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,OAAO,EAAE,qBAAq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,eAAe;AACf,cAAc,GACf,MAAM,SAAS,CAAC;AA0DjB,SAAS;AACT,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/**\n * @sudobility/sudojo_lib - Business logic library for Sudojo app\n *\n * This library provides:\n * - Game state management with useSudoku hook (ported from renderable)\n * - Board scrambling utilities\n * - Game validation (mistakes, completion)\n * - Level, technique, and learning data hooks\n * - Teaching/hint integration with solver\n * - Legacy useGame hook for backward compatibility\n */\n\n// Legacy Types (useGame hook)\nexport type {\n CellPosition,\n CellState,\n GameBoard,\n GameHint,\n GameMove,\n GameSettings,\n GameState,\n GameStatus,\n TeachingState,\n} from './types';\n\nexport { DEFAULT_GAME_SETTINGS } from './types';\n\n// Sudoku Types (useSudoku hook - ported from renderable)\nexport type {\n SudokuCell,\n SudokuBoard,\n SudokuPlay,\n SudokuPlaySettings,\n SudokuAppSettings,\n SudokuGameState,\n SudokuDisplay,\n PlayingSource,\n} from './types';\n\nexport {\n DEFAULT_PLAY_SETTINGS,\n DEFAULT_APP_SETTINGS,\n createEmptyCell,\n createEmptyBoard,\n cellHasError,\n rowOf,\n columnOf,\n blockOf,\n cellIndex,\n getRowIndices,\n getColumnIndices,\n getBlockIndices,\n getRelatedIndices,\n} from './types';\n\n// Display types (for rendering - matches Kotlin renderable)\nexport type {\n HintArea,\n HintCell,\n HintCellActions,\n DisplayHintStep,\n CellDisplayState,\n PencilmarkDisplayState,\n UIColorPalette,\n // Link and group types for chain visualization\n LinkType,\n DisplayLink,\n DisplayCellGroup,\n} from './types';\n\nexport { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';\n\n// Progress Types (for user progress tracking)\nexport type { CompletedPuzzle, GameStats, UserProgress } from './types';\nexport { DEFAULT_PROGRESS, PROGRESS_STORAGE_KEY } from './types';\n\n// Settings Types (for app settings)\nexport type { DigitDisplay, AppSettings } from './types';\nexport { DEFAULT_SETTINGS, SETTINGS_STORAGE_KEY } from './types';\n\n// Subscription Types (for subscription management)\nexport type { Product, Subscription } from './types';\nexport { DEFAULT_SUBSCRIPTION } from './types';\n\n// Game Persistence Types (for saving/loading game state)\nexport type { SavedGameState, GamePersistenceKey } from './types';\nexport { GAME_STORAGE_PREFIX, getGameStorageKey } from './types';\n\n// Current Game Types (for current game feature)\nexport type {\n GameSource,\n CurrentGameMeta,\n CurrentGame,\n GameSlot,\n} from './types';\n\n// Legacy Utilities (useGame hook)\nexport {\n // Board utilities\n cloneBoard,\n countFilledCells,\n createGameBoard,\n getBlockCells,\n getBlockIndex,\n getBoardStateString,\n getColumnCells,\n getEmptyCells,\n getPencilmarksString,\n getRelatedCells,\n getRowCells,\n isValidPlacement,\n // Validation utilities\n autoRemovePencilmarks,\n clearHighlights,\n countMistakes,\n getIncorrectCells,\n getProgressPercentage,\n isBoardFilled,\n isCellCorrect,\n isGameComplete,\n isValueCorrect,\n updateCellErrors,\n updateCellHighlights,\n validateGameState,\n} from './utils';\n\n// Sudoku Utilities (useSudoku hook - ported from renderable)\nexport type { ScramblerProtocol, SudokuScrambleResult } from './utils';\nexport {\n Scrambler,\n NonScrambler,\n scrambleSudokuBoard,\n parsePuzzleString,\n cellsToPuzzleString,\n cellsToStateString,\n cellsToInputString,\n cellsToPencilmarksString,\n} from './utils';\n\n// Presenter utilities (for rendering - matches Kotlin renderable)\nexport type { PresentBoardOptions } from './utils';\nexport {\n presentBoard,\n calculateCellHints,\n themeColorToCSS,\n getColorPalette,\n getCellsWithDigit,\n getSelectedDigit,\n computeSelectedDigitCells,\n convertSolverLink,\n convertSolverCellGroup,\n sudokuColorToTheme,\n} from './utils';\n\n// Time Utilities\nexport { formatTime, parseTime } from './utils';\n\n// Progress Utilities\nexport {\n calculateStats,\n calculateStreak,\n isPuzzleCompleted,\n getCompletedLevelIds,\n getCompletedDailyDates,\n} from './utils';\n\n// Theme Utilities\nexport type { ThemePreference, ResolvedTheme } from './utils';\nexport {\n THEME_STORAGE_KEY,\n getSystemTheme,\n resolveTheme,\n isValidThemePreference,\n} from './utils';\n\n// Subscription Utilities\nexport {\n convertPackageToProduct,\n parseCustomerInfo,\n getPeriodDisplayName,\n isBestValuePlan,\n getRevenueCatErrorMessage,\n} from './utils';\n\n// Technique Utilities\nexport { getTechniqueIconUrl } from './utils';\n\n// Hint Explanation Utilities\nexport { generateDetailedExplanation, getHintActionSummary } from './utils';\n\n// Localized Hint Utilities\nexport type { TranslateFunction } from './utils';\nexport { getLocalizedHintText } from './utils';\n\n// i18n Key Utilities\nexport {\n getBeltKey,\n getLocalizedBeltName,\n getBeltLabelKey,\n getLocalizedBeltLabel,\n getLevelKey,\n getLocalizedLevelTitle,\n getTechniqueKey,\n getLocalizedTechniqueName,\n} from './utils';\n\n// Digit Display Utilities\nexport { displayDigit } from './utils';\n\n// Hooks\nexport {\n // Levels\n useLevel,\n useLevels,\n // Techniques\n useTechnique,\n useTechniques,\n // Learning\n useLearning,\n useLearningItem,\n // Game (legacy)\n useGame,\n // Sudoku (ported from renderable)\n useSudoku,\n // Teaching\n useGameTeaching,\n // Game fetching (with auth/subscription handling)\n useLevelGame,\n useDailyGame,\n // Game timer\n useGameTimer,\n // Game persistence\n useGamePersistence,\n useAutoSave,\n // Local storage\n useLocalStorage,\n // Hint\n useHint,\n // Game play (current game management)\n useGamePlay,\n // Board entry\n useBoardEntry,\n // Game session\n useGameSession,\n} from './hooks';\n\nexport type {\n // Levels\n UseLevelOptions,\n UseLevelResult,\n UseLevelsOptions,\n UseLevelsResult,\n // Techniques\n UseTechniqueOptions,\n UseTechniqueResult,\n UseTechniquesOptions,\n UseTechniquesResult,\n // Learning\n UseLearningItemOptions,\n UseLearningItemResult,\n UseLearningOptions,\n UseLearningResult,\n // Game (legacy)\n UseGameOptions,\n UseGameResult,\n // Sudoku (ported from renderable)\n UseSudokuOptions,\n UseSudokuResult,\n // Teaching\n UseGameTeachingOptions,\n UseGameTeachingResult,\n // Game fetching (with auth/subscription handling)\n UseLevelGameOptions,\n UseLevelGameResult,\n UseDailyGameOptions,\n UseDailyGameResult,\n GameFetchStatus,\n // Game timer\n UseGameTimerOptions,\n UseGameTimerResult,\n // Game persistence\n UseGamePersistenceOptions,\n UseGamePersistenceResult,\n // Hint\n UseHintOptions,\n UseHintResult,\n HintBoardData,\n HintReceivedData,\n HintAccessError,\n // Game play (current game management)\n UseGamePlayOptions,\n UseGamePlayResult,\n // Board entry\n UseBoardEntryOptions,\n UseBoardEntryReturn,\n ValidatedPuzzle,\n // Game session\n UseGameSessionOptions,\n GameSessionResult,\n GameFinishResult,\n} from './hooks';\n\n// Stores\nexport { useGamePlayStore } from './stores/gamePlayStore';\nexport type { GamePlayState } from './stores/gamePlayStore';\n\n// Config\nexport type { AuthProviderType, AuthProvidersConfig } from './config';\nexport { DEFAULT_AUTH_PROVIDERS } from './config';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAqBH,gFAAgF;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA0BhD,kFAAkF;AAClF,OAAO;AACL,+EAA+E;AAC/E,qBAAqB;AACrB,4EAA4E;AAC5E,oBAAoB;AACpB,qDAAqD;AACrD,eAAe;AACf,2CAA2C;AAC3C,gBAAgB;AAChB,oEAAoE;AACpE,YAAY;AACZ,kDAAkD;AAClD,KAAK;AACL,qDAAqD;AACrD,QAAQ;AACR,oDAAoD;AACpD,OAAO;AACP,iDAAiD;AACjD,SAAS;AACT,+DAA+D;AAC/D,aAAa;AACb,kEAAkE;AAClE,gBAAgB;AAChB,iEAAiE;AACjE,eAAe;AACf,2FAA2F;AAC3F,iBAAiB,GAClB,MAAM,SAAS,CAAC;AA8BjB,iEAAiE;AACjE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS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,YAAY;AAEZ,wDAAwD;AACxD,kBAAkB;AAClB,4CAA4C;AAC5C,WAAW;AAEX,uDAAuD;AACvD,eAAe;AAEf,uEAAuE;AACvE,OAAO;AAEP,qEAAqE;AACrE,WAAW;AAEX,uDAAuD;AACvD,aAAa;AAEb,6EAA6E;AAC7E,cAAc,GACf,MAAM,SAAS,CAAC;AA0GjB,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,+FAA+F;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAgB1D,iFAAiF;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/**\n * @sudobility/sudojo_lib - Business logic library for Sudojo app\n *\n * This library provides:\n * - Game state management with useSudoku hook (ported from renderable)\n * - Board scrambling utilities\n * - Game validation (mistakes, completion)\n * - Level, technique, and learning data hooks\n * - Teaching/hint integration with solver\n * - Legacy useGame hook for backward compatibility\n *\n * ## Hook Architecture\n *\n * The hooks form a layered composition pattern:\n *\n * **Data hooks** (fetch and cache server data):\n * - `useLevels` / `useLevel` - Difficulty level data\n * - `useTechniques` / `useTechnique` - Solving technique data\n * - `useLearning` / `useLearningItem` - Learning material data\n *\n * **Game fetching hooks** (handle auth, subscription, and puzzle loading):\n * - `useLevelGame` - Fetch a random board for a specific level\n * - `useDailyGame` - Fetch today's daily puzzle\n *\n * **Game state hooks** (manage board state and user interaction):\n * - `useSudoku` - Primary game state (flat 81-cell array, modern API)\n * - `useGame` - Legacy game state (2D array, deprecated)\n * - `useBoardEntry` - Manual puzzle entry mode\n *\n * **Feature hooks** (provide specific game features):\n * - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)\n * - `useGameTeaching` - Step-by-step teaching with solver\n * - `useGameTimer` - Elapsed time tracking via ref (no re-renders)\n * - `useGamePersistence` / `useAutoSave` - localStorage game save/restore\n * - `useLocalStorage` - Generic typed localStorage hook\n *\n * **Orchestration hooks** (combine multiple hooks for app-level features):\n * - `useGamePlay` - Current game management with Zustand store (daily/play slots)\n * - `useGameSession` - Server-side gamification (start/finish, points, badges)\n *\n * ## Migration Guide\n *\n * Legacy exports (prefixed with \"Legacy\" comments) use the 2D `GameBoard` type\n * from `useGame`. New code should use `useSudoku` with its flat 81-cell\n * `SudokuBoard` type. See `@deprecated` tags on legacy exports.\n */\n\n// ============================================================================\n// Legacy Types (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated Use `SudokuCell` instead. Part of the legacy `useGame` 2D board API.\n */\nexport type {\n CellPosition,\n CellState,\n GameBoard,\n GameHint,\n GameMove,\n GameSettings,\n GameState,\n GameStatus,\n TeachingState,\n} from './types';\n\n/** @deprecated Use `DEFAULT_APP_SETTINGS` / `DEFAULT_PLAY_SETTINGS` instead. */\nexport { DEFAULT_GAME_SETTINGS } from './types';\n\n// ============================================================================\n// Sudoku Types (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Core Sudoku cell and board types using flat 81-cell array representation. */\nexport type {\n /** A single cell in the Sudoku board (indexed 0-80). */\n SudokuCell,\n /** The Sudoku board containing all 81 cells. */\n SudokuBoard,\n /** Current play state including board, settings, and selection. */\n SudokuPlay,\n /** Session settings that can change during play (pencilmarking, auto-pencilmarks). */\n SudokuPlaySettings,\n /** App-level settings persisted across sessions (showErrors, display format). */\n SudokuAppSettings,\n /** Full game state including source, history, and digit mapping. */\n SudokuGameState,\n /** Display modes for Sudoku digits ('NUMERIC' | 'KANJI' | 'COLORS' | 'EMOJIS'). */\n SudokuDisplay,\n /** Source of the puzzle ('DAILY' | 'CHALLENGE' | 'LEVEL' | 'ENTERED'). */\n PlayingSource,\n} from './types';\n\n/** Default settings and cell/board helper functions for the modern Sudoku API. */\nexport {\n /** Default session play settings (pencilmarking off, auto-pencilmarks off). */\n DEFAULT_PLAY_SETTINGS,\n /** Default app settings (showErrors on, animations on, numeric display). */\n DEFAULT_APP_SETTINGS,\n /** Create an empty SudokuCell at the given index. */\n createEmptyCell,\n /** Create an empty 81-cell SudokuBoard. */\n createEmptyBoard,\n /** Check if a cell has an error (input does not match solution). */\n cellHasError,\n /** Get row index (0-8) from cell index (0-80). */\n rowOf,\n /** Get column index (0-8) from cell index (0-80). */\n columnOf,\n /** Get block index (0-8) from cell index (0-80). */\n blockOf,\n /** Get cell index (0-80) from row and column. */\n cellIndex,\n /** Get all cell indices in the same row as the given index. */\n getRowIndices,\n /** Get all cell indices in the same column as the given index. */\n getColumnIndices,\n /** Get all cell indices in the same block as the given index. */\n getBlockIndices,\n /** Get all related cell indices (same row, column, or block) excluding the cell itself. */\n getRelatedIndices,\n} from './types';\n\n// ============================================================================\n// Display types (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Display and hint visualization types matching the Kotlin renderable layer. */\nexport type {\n /** Highlighted area in a hint (row, column, or block). */\n HintArea,\n /** Cell display information in a hint step. */\n HintCell,\n /** Actions to perform on a cell during hint visualization. */\n HintCellActions,\n /** A single hint step with title, text, areas, cells, links, and groups. */\n DisplayHintStep,\n /** Complete display state for a single cell (colors, digit, pencilmarks). */\n CellDisplayState,\n /** Display state for a single pencilmark (digit and color). */\n PencilmarkDisplayState,\n /** UI color palette with system colors for light or dark mode. */\n UIColorPalette,\n /** Link type for chain visualization ('strong' | 'weak'). */\n LinkType,\n /** A link between two cells in a chain (display format). */\n DisplayLink,\n /** A group of cells for pattern visualization (display format). */\n DisplayCellGroup,\n} from './types';\n\n/** Theme and color enums plus predefined light/dark palettes. */\nexport { ThemeColor, SudokuColor, UIColorLight, UIColorDark } from './types';\n\n// ============================================================================\n// Progress Types (for user progress tracking)\n// ============================================================================\n\n/** Types for tracking user puzzle completion and statistics. */\nexport type {\n /** Record of a completed puzzle (id, type, time). */\n CompletedPuzzle,\n /** Computed game statistics (best times, averages). */\n GameStats,\n /** Full user progress data (completed puzzles, streak, stats). */\n UserProgress,\n} from './types';\n\nexport {\n /** Default empty user progress state. */\n DEFAULT_PROGRESS,\n /** localStorage key for progress data ('sudojo-progress'). */\n PROGRESS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Settings Types (for app settings)\n// ============================================================================\n\n/** Types for application settings. */\nexport type {\n /** Digit display format ('numeric' | 'kanji' | 'emojis'). */\n DigitDisplay,\n /** Application settings (showErrors, symmetrical, display). */\n AppSettings,\n} from './types';\n\nexport {\n /** Default application settings. */\n DEFAULT_SETTINGS,\n /** localStorage key for settings ('sudojo-settings'). */\n SETTINGS_STORAGE_KEY,\n} from './types';\n\n// ============================================================================\n// Subscription Types (for subscription management)\n// ============================================================================\n\n/** Types for RevenueCat subscription management. */\nexport type {\n /** Subscription product information (price, period, trial). */\n Product,\n /** User subscription status (active, expiration, renewal). */\n Subscription,\n} from './types';\n\n/** Default inactive subscription state. */\nexport { DEFAULT_SUBSCRIPTION } from './types';\n\n// ============================================================================\n// Game Persistence Types (for saving/loading game state)\n// ============================================================================\n\n/** Types for saving and restoring game progress to localStorage. */\nexport type {\n /** Saved game state (input, pencilmarks, mode, timestamp). */\n SavedGameState,\n /** Key identifying a game to persist (type + id). */\n GamePersistenceKey,\n} from './types';\n\nexport {\n /** localStorage key prefix for game saves ('sudojo_game_'). */\n GAME_STORAGE_PREFIX,\n /** Generate a localStorage key from a GamePersistenceKey. */\n getGameStorageKey,\n} from './types';\n\n// ============================================================================\n// Current Game Types (for current game feature)\n// ============================================================================\n\n/** Types for the Zustand-backed current game store. */\nexport type {\n /** Source of the current game ('daily' | 'level' | 'entered'). */\n GameSource,\n /** Navigation metadata for resuming a game (date, level, board info). */\n CurrentGameMeta,\n /** Full current game state stored in Zustand (puzzle, progress, timing). */\n CurrentGame,\n /** Which store slot a game lives in ('daily' | 'play'). */\n GameSlot,\n} from './types';\n\n// ============================================================================\n// Legacy Utilities (useGame hook)\n// ============================================================================\n\n/**\n * @deprecated These utilities work with the legacy 2D `GameBoard` type.\n * For new code, use `useSudoku` with its flat 81-cell board and the\n * scrambler/presenter utilities below.\n */\nexport {\n /** @deprecated Clone a 2D GameBoard. Use useSudoku's immutable state instead. */\n cloneBoard,\n /** @deprecated Count filled cells in a 2D GameBoard. */\n countFilledCells,\n /** @deprecated Create a 2D GameBoard from puzzle/solution strings. */\n createGameBoard,\n /** @deprecated Get cells in a block by block index (2D API). */\n getBlockCells,\n /** @deprecated Get block index from row/col (2D API). Use blockOf() instead. */\n getBlockIndex,\n /** @deprecated Get 2D board state as string. Use cellsToStateString() instead. */\n getBoardStateString,\n /** @deprecated Get cells in a column (2D API). Use getColumnIndices() instead. */\n getColumnCells,\n /** @deprecated Get empty cells from a 2D GameBoard. */\n getEmptyCells,\n /** @deprecated Get pencilmarks string from 2D GameBoard. Use cellsToPencilmarksString() instead. */\n getPencilmarksString,\n /** @deprecated Get related cells (2D API). Use getRelatedIndices() instead. */\n getRelatedCells,\n /** @deprecated Get cells in a row (2D API). Use getRowIndices() instead. */\n getRowCells,\n /** @deprecated Check if placement is valid (2D API). */\n isValidPlacement,\n /** @deprecated Auto-remove pencilmarks (2D API). useSudoku handles this internally. */\n autoRemovePencilmarks,\n /** @deprecated Clear highlights (2D API). useSudoku handles this via presentBoard(). */\n clearHighlights,\n /** @deprecated Count mistakes (2D API). Use useSudoku's errorCount instead. */\n countMistakes,\n /** @deprecated Get incorrect cells (2D API). Use useSudoku's errorCells instead. */\n getIncorrectCells,\n /** @deprecated Get progress percentage (2D API). Use useSudoku's progress instead. */\n getProgressPercentage,\n /** @deprecated Check if board is filled (2D API). */\n isBoardFilled,\n /** @deprecated Check if cell is correct (2D API). Use cellHasError() instead. */\n isCellCorrect,\n /** @deprecated Check if game is complete (2D API). Use useSudoku's isCompleted instead. */\n isGameComplete,\n /** @deprecated Check if value is correct (2D API). */\n isValueCorrect,\n /** @deprecated Update cell errors (2D API). useSudoku handles this automatically. */\n updateCellErrors,\n /** @deprecated Update cell highlights (2D API). Use presentBoard() instead. */\n updateCellHighlights,\n /** @deprecated Validate entire game state (2D API). */\n validateGameState,\n} from './utils';\n\n// ============================================================================\n// Sudoku Utilities (useSudoku hook - ported from renderable)\n// ============================================================================\n\n/** Types for board scrambling. */\nexport type {\n /** Protocol for board scramblers (Scrambler and NonScrambler implement this). */\n ScramblerProtocol,\n /** Result of scrambling a board (cells + digit mappings). */\n SudokuScrambleResult,\n} from './utils';\n\n/** Board scrambling and puzzle string conversion utilities. */\nexport {\n /** Scrambler that permutes rows, columns, and digits to create unique puzzles. */\n Scrambler,\n /** Identity scrambler that returns the board unchanged. */\n NonScrambler,\n /** Scramble a board using a ScramblerProtocol implementation. */\n scrambleSudokuBoard,\n /** Parse an 81-character puzzle string into SudokuCell array. */\n parsePuzzleString,\n /** Convert SudokuCell array to puzzle string (given values only). */\n cellsToPuzzleString,\n /** Convert SudokuCell array to state string (given + input values). */\n cellsToStateString,\n /** Convert SudokuCell array to input-only string. */\n cellsToInputString,\n /** Convert SudokuCell array to comma-separated pencilmarks string. */\n cellsToPencilmarksString,\n} from './utils';\n\n// ============================================================================\n// Presenter utilities (for rendering - matches Kotlin renderable)\n// ============================================================================\n\n/** Options type for the presentBoard function. */\nexport type {\n /** Options for generating cell display states (cells, selection, errors, hints). */\n PresentBoardOptions,\n} from './utils';\n\n/** Board presentation and color utilities matching the Kotlin renderable layer. */\nexport {\n /** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */\n presentBoard,\n /** Process hint step areas and cells into a map of cell hints by index. */\n calculateCellHints,\n /** Convert a ThemeColor to an actual CSS color string using a palette. */\n themeColorToCSS,\n /** Get the UIColorPalette for light or dark mode. */\n getColorPalette,\n /** Get indices of cells containing a specific digit (given or input). */\n getCellsWithDigit,\n /** Get the digit to highlight based on the selected cell (given or correct input). */\n getSelectedDigit,\n /** Compute the set of cell indices with the same digit as the selected cell. */\n computeSelectedDigitCells,\n /** Convert a solver link (row/col pairs) to display format (flat indices). */\n convertSolverLink,\n /** Convert a solver cell group to display format with ThemeColor. */\n convertSolverCellGroup,\n /** Convert SudokuColor enum to ThemeColor enum. */\n sudokuColorToTheme,\n} from './utils';\n\n// ============================================================================\n// Time Utilities\n// ============================================================================\n\n/** Time formatting and parsing utilities. */\nexport {\n /** Format seconds into MM:SS or HH:MM:SS string. */\n formatTime,\n /** Parse a MM:SS or HH:MM:SS string back to total seconds. */\n parseTime,\n} from './utils';\n\n// ============================================================================\n// Progress Utilities\n// ============================================================================\n\n/** User progress calculation utilities. */\nexport {\n /** Calculate game statistics (best times, averages) from completed puzzles. */\n calculateStats,\n /** Calculate current daily streak from completion history. */\n calculateStreak,\n /** Check if a specific puzzle (by type and id) has been completed. */\n isPuzzleCompleted,\n /** Get all completed level IDs from completion history. */\n getCompletedLevelIds,\n /** Get all completed daily dates (YYYY-MM-DD) from completion history. */\n getCompletedDailyDates,\n} from './utils';\n\n// ============================================================================\n// Theme Utilities\n// ============================================================================\n\n/** Types for theme preference management. */\nexport type {\n /** Theme preference: 'light' | 'dark' | 'system'. */\n ThemePreference,\n /** Resolved theme without system option: 'light' | 'dark'. */\n ResolvedTheme,\n} from './utils';\n\n/** Theme detection and resolution utilities. */\nexport {\n /** localStorage key for theme preference ('sudojo-theme'). */\n THEME_STORAGE_KEY,\n /** Detect the system color scheme preference (light/dark). */\n getSystemTheme,\n /** Resolve a ThemePreference to an actual theme using the system theme. */\n resolveTheme,\n /** Type guard: check if a value is a valid ThemePreference. */\n isValidThemePreference,\n} from './utils';\n\n// ============================================================================\n// Subscription Utilities\n// ============================================================================\n\n/** RevenueCat subscription conversion and display utilities. */\nexport {\n /** Convert a RevenueCat package to a Product domain model. */\n convertPackageToProduct,\n /** Parse RevenueCat CustomerInfo into a Subscription domain model. */\n parseCustomerInfo,\n /** Get human-readable name for an ISO 8601 subscription period (e.g., 'P1M' -> 'Monthly'). */\n getPeriodDisplayName,\n /** Check if a subscription period is the \"best value\" option (annual plans). */\n isBestValuePlan,\n /** Get a user-friendly error message for a RevenueCat error code. */\n getRevenueCatErrorMessage,\n} from './utils';\n\n// ============================================================================\n// Technique Utilities\n// ============================================================================\n\n/** Technique display utilities. */\nexport {\n /** Get the icon URL for a solving technique by its path slug. */\n getTechniqueIconUrl,\n} from './utils';\n\n// ============================================================================\n// Hint Explanation Utilities\n// ============================================================================\n\n/** Hint explanation generation utilities for teaching users solving techniques. */\nexport {\n /** Generate a detailed explanation for a hint step based on the technique. */\n generateDetailedExplanation,\n /** Get a short action summary for a hint step (e.g., 'Place 5 in R1C3'). */\n getHintActionSummary,\n} from './utils';\n\n// ============================================================================\n// Localized Hint Utilities\n// ============================================================================\n\n/** Types for hint text localization. */\nexport type {\n /** Translation function compatible with i18next's `t` function. */\n TranslateFunction,\n} from './utils';\n\n/** Hint localization utilities. */\nexport {\n /** Get localized text for a hint step using a translation function. */\n getLocalizedHintText,\n} from './utils';\n\n// ============================================================================\n// i18n Key Utilities\n// ============================================================================\n\n/** Internationalization key generation and localization utilities. */\nexport {\n /** Get i18n key for a belt name (e.g., 'belts.1.name'). */\n getBeltKey,\n /** Get localized belt name using a translation function. */\n getLocalizedBeltName,\n /** Get i18n key for a belt label (e.g., 'belts.1.label'). */\n getBeltLabelKey,\n /** Get localized belt label (e.g., 'White Belt'). */\n getLocalizedBeltLabel,\n /** Get i18n key for a level title (e.g., 'levels.3'). */\n getLevelKey,\n /** Get localized level title using a translation function. */\n getLocalizedLevelTitle,\n /** Get i18n key for a technique name (e.g., 'techniques.full-house.title'). */\n getTechniqueKey,\n /** Get localized technique name using a translation function. */\n getLocalizedTechniqueName,\n} from './utils';\n\n// ============================================================================\n// Digit Display Utilities\n// ============================================================================\n\n/** Digit display format conversion. */\nexport {\n /** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */\n displayDigit,\n} from './utils';\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport {\n // Data hooks\n /** Fetch a single difficulty level by number. */\n useLevel,\n /** Fetch all difficulty levels with sorting and filtering utilities. */\n useLevels,\n /** Fetch a single solving technique by number. */\n useTechnique,\n /** Fetch all solving techniques with grouping utilities. */\n useTechniques,\n /** Fetch learning materials with filtering by technique and language. */\n useLearning,\n /** Fetch a single learning item by UUID. */\n useLearningItem,\n\n /**\n * @deprecated Use `useSudoku` instead. `useGame` uses a legacy 2D array board\n * representation, while `useSudoku` uses a flat 81-cell array consistent with\n * the Kotlin renderable layer and the rest of the codebase.\n */\n useGame,\n\n /** Primary game state hook with flat 81-cell board, pencil mode, and scrambling. */\n useSudoku,\n\n /** Teaching/hint integration with the solver API (legacy GameHint format). */\n useGameTeaching,\n\n /** Fetch a random board for a specific level with auth/subscription handling. */\n useLevelGame,\n /** Fetch today's daily puzzle with auth/subscription handling. */\n useDailyGame,\n\n /** Game timer using refs to avoid re-renders every second. */\n useGameTimer,\n\n /** Persist individual game progress to localStorage. */\n useGamePersistence,\n /** Auto-save game state with debouncing. */\n useAutoSave,\n\n /** Generic typed localStorage hook with SSR safety. */\n useLocalStorage,\n\n /** Solver hint integration matching Kotlin HintInteractor behavior. */\n useHint,\n\n /** Current game management with Zustand store (daily/play slots). */\n useGamePlay,\n\n /** Manual puzzle entry mode with solver validation. */\n useBoardEntry,\n\n /** Server-side game session management for gamification (points, badges). */\n useGameSession,\n} from './hooks';\n\nexport type {\n // Data hook types\n /** Options for useLevel hook. */\n UseLevelOptions,\n /** Result type for useLevel hook. */\n UseLevelResult,\n /** Options for useLevels hook. */\n UseLevelsOptions,\n /** Result type for useLevels hook. */\n UseLevelsResult,\n /** Options for useTechnique hook. */\n UseTechniqueOptions,\n /** Result type for useTechnique hook. */\n UseTechniqueResult,\n /** Options for useTechniques hook. */\n UseTechniquesOptions,\n /** Result type for useTechniques hook. */\n UseTechniquesResult,\n /** Options for useLearningItem hook. */\n UseLearningItemOptions,\n /** Result type for useLearningItem hook. */\n UseLearningItemResult,\n /** Options for useLearning hook. */\n UseLearningOptions,\n /** Result type for useLearning hook. */\n UseLearningResult,\n\n // Game hook types (legacy)\n /** @deprecated Options for legacy useGame hook. Use UseSudokuOptions instead. */\n UseGameOptions,\n /** @deprecated Result type for legacy useGame hook. Use UseSudokuResult instead. */\n UseGameResult,\n\n // Sudoku hook types\n /** Options for useSudoku hook (initial app settings). */\n UseSudokuOptions,\n /** Result type for useSudoku hook (state, computed values, actions, utilities). */\n UseSudokuResult,\n\n // Teaching hook types\n /** Options for useGameTeaching hook (network client, URL, token). */\n UseGameTeachingOptions,\n /** Result type for useGameTeaching hook (teaching state, hint actions). */\n UseGameTeachingResult,\n\n // Game fetching hook types\n /** Options for useLevelGame hook (network, auth, level number). */\n UseLevelGameOptions,\n /** Result type for useLevelGame hook (board data, fetch status). */\n UseLevelGameResult,\n /** Options for useDailyGame hook (network, auth). */\n UseDailyGameOptions,\n /** Result type for useDailyGame hook (daily data, fetch status). */\n UseDailyGameResult,\n /** Status of a game fetch: 'loading' | 'success' | 'auth_required' | 'subscription_required' | 'error'. */\n GameFetchStatus,\n\n // Timer hook types\n /** Options for useGameTimer hook (autoStart, initialTime). */\n UseGameTimerOptions,\n /** Result type for useGameTimer hook (elapsedRef, controls). */\n UseGameTimerResult,\n\n // Persistence hook types\n /** Options for useGamePersistence hook (puzzleKey, autoSave). */\n UseGamePersistenceOptions,\n /** Result type for useGamePersistence hook (load, save, clear, hasSaved). */\n UseGamePersistenceResult,\n\n // Hint hook types\n /** Options for useHint hook (network, puzzle state, technique filter). */\n UseHintOptions,\n /** Result type for useHint hook (hint steps, navigation, apply). */\n UseHintResult,\n /** Board data returned when applying a hint (user input, pencilmarks). */\n HintBoardData,\n /** Data passed to onHintReceived callback (hint, board data, technique info). */\n HintReceivedData,\n /** Access denied error info when hint level exceeds subscription tier. */\n HintAccessError,\n\n // Game play hook types\n /** Options for useGamePlay hook (slot selection, auto-save delay). */\n UseGamePlayOptions,\n /** Result type for useGamePlay hook (current game, start, update, clear). */\n UseGamePlayResult,\n\n // Board entry hook types\n /** Options for useBoardEntry hook (network client, URL, token). */\n UseBoardEntryOptions,\n /** Result type for useBoardEntry hook (cells, validation, actions). */\n UseBoardEntryReturn,\n /** Validated puzzle data from solver (puzzle + solution strings). */\n ValidatedPuzzle,\n\n // Game session hook types\n /** Options for useGameSession hook (network, auth, userId). */\n UseGameSessionOptions,\n /** Result of starting a game session (sessionStarted, sessionId). */\n GameSessionResult,\n /** Result of finishing a game session (leveledUp, badges, points). */\n GameFinishResult,\n} from './hooks';\n\n// ============================================================================\n// Stores\n// ============================================================================\n\n/** Zustand store for current game state with daily/play slots and localStorage persistence. */\nexport { useGamePlayStore } from './stores/gamePlayStore';\n/** State shape for the game play Zustand store. */\nexport type { GamePlayState } from './stores/gamePlayStore';\n\n// ============================================================================\n// Config\n// ============================================================================\n\n/** Authentication provider configuration types. */\nexport type {\n /** Available auth provider types: 'google' | 'apple' | 'email'. */\n AuthProviderType,\n /** Configuration for which auth providers are enabled. */\n AuthProvidersConfig,\n} from './config';\n\n/** Default auth providers configuration (Google + Email, anonymous fallback). */\nexport { DEFAULT_AUTH_PROVIDERS } from './config';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/sudojo_lib",
3
- "version": "0.0.94",
3
+ "version": "0.0.96",
4
4
  "description": "Business logic library for Sudojo app",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",