@sudobility/sudojo_lib 0.0.201 → 0.0.204
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/admin/adminApi.d.ts +34 -0
- package/dist/admin/adminApi.d.ts.map +1 -0
- package/dist/admin/adminApi.js +59 -0
- package/dist/admin/adminApi.js.map +1 -0
- package/dist/admin/boardRules.d.ts +75 -0
- package/dist/admin/boardRules.d.ts.map +1 -0
- package/dist/admin/boardRules.js +127 -0
- package/dist/admin/boardRules.js.map +1 -0
- package/dist/admin/boardStrings.d.ts +55 -0
- package/dist/admin/boardStrings.d.ts.map +1 -0
- package/dist/admin/boardStrings.js +99 -0
- package/dist/admin/boardStrings.js.map +1 -0
- package/dist/admin/examples.d.ts +58 -0
- package/dist/admin/examples.d.ts.map +1 -0
- package/dist/admin/examples.js +104 -0
- package/dist/admin/examples.js.map +1 -0
- package/dist/admin/extraction.d.ts +87 -0
- package/dist/admin/extraction.d.ts.map +1 -0
- package/dist/admin/extraction.js +141 -0
- package/dist/admin/extraction.js.map +1 -0
- package/dist/admin/index.d.ts +32 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +22 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/jobs.d.ts +108 -0
- package/dist/admin/jobs.d.ts.map +1 -0
- package/dist/admin/jobs.js +435 -0
- package/dist/admin/jobs.js.map +1 -0
- package/dist/admin/regenerateHints.d.ts +16 -0
- package/dist/admin/regenerateHints.d.ts.map +1 -0
- package/dist/admin/regenerateHints.js +43 -0
- package/dist/admin/regenerateHints.js.map +1 -0
- package/dist/admin/types.d.ts +42 -0
- package/dist/admin/types.d.ts.map +1 -0
- package/dist/admin/types.js +21 -0
- package/dist/admin/types.js.map +1 -0
- package/dist/admin/useAdminJob.d.ts +28 -0
- package/dist/admin/useAdminJob.d.ts.map +1 -0
- package/dist/admin/useAdminJob.js +99 -0
- package/dist/admin/useAdminJob.js.map +1 -0
- package/dist/admin/useAdminStats.d.ts +46 -0
- package/dist/admin/useAdminStats.d.ts.map +1 -0
- package/dist/admin/useAdminStats.js +91 -0
- package/dist/admin/useAdminStats.js.map +1 -0
- package/dist/admin/useBoardGenerator.d.ts +29 -0
- package/dist/admin/useBoardGenerator.d.ts.map +1 -0
- package/dist/admin/useBoardGenerator.js +38 -0
- package/dist/admin/useBoardGenerator.js.map +1 -0
- package/dist/admin/useBoardTechniquesUpdater.d.ts +14 -0
- package/dist/admin/useBoardTechniquesUpdater.d.ts.map +1 -0
- package/dist/admin/useBoardTechniquesUpdater.js +28 -0
- package/dist/admin/useBoardTechniquesUpdater.js.map +1 -0
- package/dist/admin/useExampleCreator.d.ts +29 -0
- package/dist/admin/useExampleCreator.d.ts.map +1 -0
- package/dist/admin/useExampleCreator.js +58 -0
- package/dist/admin/useExampleCreator.js.map +1 -0
- package/dist/admin/useSingleBoardExtractor.d.ts +18 -0
- package/dist/admin/useSingleBoardExtractor.d.ts.map +1 -0
- package/dist/admin/useSingleBoardExtractor.js +19 -0
- package/dist/admin/useSingleBoardExtractor.js.map +1 -0
- package/dist/admin/useTechniqueExtractor.d.ts +26 -0
- package/dist/admin/useTechniqueExtractor.d.ts.map +1 -0
- package/dist/admin/useTechniqueExtractor.js +37 -0
- package/dist/admin/useTechniqueExtractor.js.map +1 -0
- package/dist/context/SudojoApiContext.d.ts +58 -0
- package/dist/context/SudojoApiContext.d.ts.map +1 -0
- package/dist/context/SudojoApiContext.js +52 -0
- package/dist/context/SudojoApiContext.js.map +1 -0
- package/dist/context/SudojoApiProvider.d.ts +21 -0
- package/dist/context/SudojoApiProvider.d.ts.map +1 -0
- package/dist/context/SudojoApiProvider.js +15 -0
- package/dist/context/SudojoApiProvider.js.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -1
- package/dist/hooks/index.d.ts +24 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useBoardEntry.d.ts +68 -5
- package/dist/hooks/useBoardEntry.d.ts.map +1 -1
- package/dist/hooks/useBoardEntry.js +113 -27
- package/dist/hooks/useBoardEntry.js.map +1 -1
- package/dist/hooks/useBoardScan.d.ts +27 -0
- package/dist/hooks/useBoardScan.d.ts.map +1 -0
- package/dist/hooks/useBoardScan.js +27 -0
- package/dist/hooks/useBoardScan.js.map +1 -0
- package/dist/hooks/useCommunities.d.ts +6 -4
- package/dist/hooks/useCommunities.d.ts.map +1 -1
- package/dist/hooks/useCommunities.js +6 -1
- package/dist/hooks/useCommunities.js.map +1 -1
- package/dist/hooks/useCompletionTrigger.d.ts +23 -0
- package/dist/hooks/useCompletionTrigger.d.ts.map +1 -0
- package/dist/hooks/useCompletionTrigger.js +39 -0
- package/dist/hooks/useCompletionTrigger.js.map +1 -0
- package/dist/hooks/useDailyGame.d.ts +11 -6
- package/dist/hooks/useDailyGame.d.ts.map +1 -1
- package/dist/hooks/useDailyGame.js +20 -61
- package/dist/hooks/useDailyGame.js.map +1 -1
- package/dist/hooks/useDeleteAccount.d.ts +72 -0
- package/dist/hooks/useDeleteAccount.d.ts.map +1 -0
- package/dist/hooks/useDeleteAccount.js +71 -0
- package/dist/hooks/useDeleteAccount.js.map +1 -0
- package/dist/hooks/useEnteredGameSession.d.ts +73 -0
- package/dist/hooks/useEnteredGameSession.d.ts.map +1 -0
- package/dist/hooks/useEnteredGameSession.js +155 -0
- package/dist/hooks/useEnteredGameSession.js.map +1 -0
- package/dist/hooks/useGameSession.d.ts +8 -4
- package/dist/hooks/useGameSession.d.ts.map +1 -1
- package/dist/hooks/useGameSession.js +4 -1
- package/dist/hooks/useGameSession.js.map +1 -1
- package/dist/hooks/useGameTeaching.d.ts.map +1 -1
- package/dist/hooks/useGameTeaching.js +11 -13
- package/dist/hooks/useGameTeaching.js.map +1 -1
- package/dist/hooks/useHint.d.ts +7 -7
- package/dist/hooks/useHint.d.ts.map +1 -1
- package/dist/hooks/useHint.js +18 -9
- package/dist/hooks/useHint.js.map +1 -1
- package/dist/hooks/useIsSiteAdmin.d.ts +39 -0
- package/dist/hooks/useIsSiteAdmin.d.ts.map +1 -0
- package/dist/hooks/useIsSiteAdmin.js +31 -0
- package/dist/hooks/useIsSiteAdmin.js.map +1 -0
- package/dist/hooks/useLearning.d.ts +8 -8
- package/dist/hooks/useLearning.d.ts.map +1 -1
- package/dist/hooks/useLearning.js +5 -2
- package/dist/hooks/useLearning.js.map +1 -1
- package/dist/hooks/useLevelGame.d.ts +7 -7
- package/dist/hooks/useLevelGame.d.ts.map +1 -1
- package/dist/hooks/useLevelGame.js +13 -49
- package/dist/hooks/useLevelGame.js.map +1 -1
- package/dist/hooks/useLevels.d.ts +8 -8
- package/dist/hooks/useLevels.d.ts.map +1 -1
- package/dist/hooks/useLevels.js +7 -3
- package/dist/hooks/useLevels.js.map +1 -1
- package/dist/hooks/usePracticeGame.d.ts +53 -0
- package/dist/hooks/usePracticeGame.d.ts.map +1 -0
- package/dist/hooks/usePracticeGame.js +72 -0
- package/dist/hooks/usePracticeGame.js.map +1 -0
- package/dist/hooks/usePuzzleDistribution.d.ts +2 -0
- package/dist/hooks/usePuzzleDistribution.d.ts.map +1 -1
- package/dist/hooks/usePuzzleDistribution.js +4 -14
- package/dist/hooks/usePuzzleDistribution.js.map +1 -1
- package/dist/hooks/usePuzzleProgress.d.ts +37 -0
- package/dist/hooks/usePuzzleProgress.d.ts.map +1 -0
- package/dist/hooks/usePuzzleProgress.js +48 -0
- package/dist/hooks/usePuzzleProgress.js.map +1 -0
- package/dist/hooks/usePuzzleSession.d.ts +215 -0
- package/dist/hooks/usePuzzleSession.d.ts.map +1 -0
- package/dist/hooks/usePuzzleSession.js +358 -0
- package/dist/hooks/usePuzzleSession.js.map +1 -0
- package/dist/hooks/useResumeGame.d.ts +70 -0
- package/dist/hooks/useResumeGame.d.ts.map +1 -0
- package/dist/hooks/useResumeGame.js +123 -0
- package/dist/hooks/useResumeGame.js.map +1 -0
- package/dist/hooks/useStrategies.d.ts +39 -0
- package/dist/hooks/useStrategies.d.ts.map +1 -0
- package/dist/hooks/useStrategies.js +34 -0
- package/dist/hooks/useStrategies.js.map +1 -0
- package/dist/hooks/useSudoku.d.ts +5 -0
- package/dist/hooks/useSudoku.d.ts.map +1 -1
- package/dist/hooks/useSudoku.js +7 -1
- package/dist/hooks/useSudoku.js.map +1 -1
- package/dist/hooks/useTechniqueByPath.d.ts +46 -0
- package/dist/hooks/useTechniqueByPath.d.ts.map +1 -0
- package/dist/hooks/useTechniqueByPath.js +47 -0
- package/dist/hooks/useTechniqueByPath.js.map +1 -0
- package/dist/hooks/useTechniqueExample.d.ts +60 -0
- package/dist/hooks/useTechniqueExample.d.ts.map +1 -0
- package/dist/hooks/useTechniqueExample.js +63 -0
- package/dist/hooks/useTechniqueExample.js.map +1 -0
- package/dist/hooks/useTechniques.d.ts +8 -8
- package/dist/hooks/useTechniques.d.ts.map +1 -1
- package/dist/hooks/useTechniques.js +9 -21
- package/dist/hooks/useTechniques.js.map +1 -1
- package/dist/index.d.ts +418 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +276 -10
- package/dist/index.js.map +1 -1
- package/dist/types/currentGame.d.ts +9 -1
- package/dist/types/currentGame.d.ts.map +1 -1
- package/dist/types/currentGame.js.map +1 -1
- package/dist/utils/auth.d.ts +6 -0
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +8 -0
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/community.d.ts +64 -0
- package/dist/utils/community.d.ts.map +1 -0
- package/dist/utils/community.js +66 -0
- package/dist/utils/community.js.map +1 -0
- package/dist/utils/date.d.ts +37 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +68 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/entityTranslate.d.ts +120 -0
- package/dist/utils/entityTranslate.d.ts.map +1 -0
- package/dist/utils/entityTranslate.js +146 -0
- package/dist/utils/entityTranslate.js.map +1 -0
- package/dist/utils/gameFetchStatus.d.ts +74 -0
- package/dist/utils/gameFetchStatus.d.ts.map +1 -0
- package/dist/utils/gameFetchStatus.js +118 -0
- package/dist/utils/gameFetchStatus.js.map +1 -0
- package/dist/utils/gamification.d.ts +36 -0
- package/dist/utils/gamification.d.ts.map +1 -0
- package/dist/utils/gamification.js +33 -0
- package/dist/utils/gamification.js.map +1 -0
- package/dist/utils/hintAccess.d.ts +64 -0
- package/dist/utils/hintAccess.d.ts.map +1 -0
- package/dist/utils/hintAccess.js +57 -0
- package/dist/utils/hintAccess.js.map +1 -0
- package/dist/utils/index.d.ts +31 -10
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +20 -9
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/language.d.ts +123 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +95 -0
- package/dist/utils/language.js.map +1 -0
- package/dist/utils/localizedHint.d.ts +60 -0
- package/dist/utils/localizedHint.d.ts.map +1 -1
- package/dist/utils/localizedHint.js +90 -0
- package/dist/utils/localizedHint.js.map +1 -1
- package/dist/utils/progress.d.ts +10 -1
- package/dist/utils/progress.d.ts.map +1 -1
- package/dist/utils/progress.js +24 -0
- package/dist/utils/progress.js.map +1 -1
- package/dist/utils/scannedBoard.d.ts +88 -0
- package/dist/utils/scannedBoard.d.ts.map +1 -0
- package/dist/utils/scannedBoard.js +101 -0
- package/dist/utils/scannedBoard.js.map +1 -0
- package/dist/utils/shareUrl.d.ts +38 -15
- package/dist/utils/shareUrl.d.ts.map +1 -1
- package/dist/utils/shareUrl.js +75 -26
- package/dist/utils/shareUrl.js.map +1 -1
- package/dist/utils/subscription.d.ts +118 -0
- package/dist/utils/subscription.d.ts.map +1 -1
- package/dist/utils/subscription.js +212 -0
- package/dist/utils/subscription.js.map +1 -1
- package/dist/utils/sudokuPresenter.d.ts +42 -0
- package/dist/utils/sudokuPresenter.d.ts.map +1 -1
- package/dist/utils/sudokuPresenter.js +114 -1
- package/dist/utils/sudokuPresenter.js.map +1 -1
- package/dist/utils/sudokuScrambler.d.ts +8 -0
- package/dist/utils/sudokuScrambler.d.ts.map +1 -1
- package/dist/utils/sudokuScrambler.js +12 -0
- package/dist/utils/sudokuScrambler.js.map +1 -1
- package/dist/utils/technique.d.ts +112 -1
- package/dist/utils/technique.d.ts.map +1 -1
- package/dist/utils/technique.js +293 -1
- package/dist/utils/technique.js.map +1 -1
- package/dist/utils/techniqueBitmask.d.ts +31 -0
- package/dist/utils/techniqueBitmask.d.ts.map +1 -0
- package/dist/utils/techniqueBitmask.js +53 -0
- package/dist/utils/techniqueBitmask.js.map +1 -0
- package/dist/utils/techniqueExample.d.ts +42 -0
- package/dist/utils/techniqueExample.d.ts.map +1 -0
- package/dist/utils/techniqueExample.js +57 -0
- package/dist/utils/techniqueExample.js.map +1 -0
- package/dist/utils/theme.d.ts +2 -0
- package/dist/utils/theme.d.ts.map +1 -1
- package/dist/utils/theme.js +2 -0
- package/dist/utils/theme.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* - `useSudoku` - Primary game state (flat 81-cell array, modern API)
|
|
27
27
|
* - `useGame` - Legacy game state (2D array, deprecated)
|
|
28
28
|
* - `useBoardEntry` - Manual puzzle entry mode
|
|
29
|
+
* - `useBoardScan` - Read givens, player digits and pencilmarks from a photo
|
|
29
30
|
*
|
|
30
31
|
* **Feature hooks** (provide specific game features):
|
|
31
32
|
* - `useHint` - Solver integration for hints (matches Kotlin HintInteractor)
|
|
@@ -167,7 +168,23 @@ cellsToStateString,
|
|
|
167
168
|
/** Convert SudokuCell array to input-only string. */
|
|
168
169
|
cellsToInputString,
|
|
169
170
|
/** Convert SudokuCell array to comma-separated pencilmarks string. */
|
|
170
|
-
cellsToPencilmarksString,
|
|
171
|
+
cellsToPencilmarksString,
|
|
172
|
+
/** Convert SudokuCell array to solution string ('0' where unknown). */
|
|
173
|
+
cellsToSolutionString,
|
|
174
|
+
/** Count the givens (clues) in a SudokuCell array. */
|
|
175
|
+
countClues, } from './utils';
|
|
176
|
+
/** Board and level constants from sudojo_types, re-exported for convenience. */
|
|
177
|
+
export {
|
|
178
|
+
/** Fewest givens a valid Sudoku can have (17). */
|
|
179
|
+
MIN_CLUES,
|
|
180
|
+
/** Lowest difficulty level (1). */
|
|
181
|
+
MIN_LEVEL,
|
|
182
|
+
/** Highest difficulty level (12). */
|
|
183
|
+
MAX_LEVEL,
|
|
184
|
+
/** Whether a value is an integer level in MIN_LEVEL..MAX_LEVEL. */
|
|
185
|
+
isValidLevel,
|
|
186
|
+
/** All levels, MIN_LEVEL..MAX_LEVEL. */
|
|
187
|
+
ALL_LEVELS, } from '@sudobility/sudojo_types';
|
|
171
188
|
/** Board presentation and color utilities matching the Kotlin renderable layer. */
|
|
172
189
|
export {
|
|
173
190
|
/** Generate display states for all 81 cells (colors, digits, pencilmarks, hints). */
|
|
@@ -189,7 +206,15 @@ convertSolverLink,
|
|
|
189
206
|
/** Convert a solver cell group to display format with ThemeColor. */
|
|
190
207
|
convertSolverCellGroup,
|
|
191
208
|
/** Convert SudokuColor enum to ThemeColor enum. */
|
|
192
|
-
sudokuColorToTheme,
|
|
209
|
+
sudokuColorToTheme,
|
|
210
|
+
/** Map a solver color string to SudokuColor (case-insensitive; unknown → null). */
|
|
211
|
+
solverColorToSudokuColor,
|
|
212
|
+
/** Parse a solver digit string ("125") into digits 1-9. */
|
|
213
|
+
parseHintDigits,
|
|
214
|
+
/** Convert a SolverHintStep into the DisplayHintStep presentBoard takes. */
|
|
215
|
+
convertSolverHintStep,
|
|
216
|
+
/** Whether a hint step is a conflict hint (has a 'conflict' link). */
|
|
217
|
+
isConflictHintStep, } from './utils';
|
|
193
218
|
// ============================================================================
|
|
194
219
|
// Time Utilities
|
|
195
220
|
// ============================================================================
|
|
@@ -213,11 +238,15 @@ isPuzzleCompleted,
|
|
|
213
238
|
/** Get all completed level IDs from completion history. */
|
|
214
239
|
getCompletedLevelIds,
|
|
215
240
|
/** Get all completed daily dates (YYYY-MM-DD) from completion history. */
|
|
216
|
-
getCompletedDailyDates,
|
|
241
|
+
getCompletedDailyDates,
|
|
242
|
+
/** Record a puzzle completion in UserProgress (pure markCompleted reducer). */
|
|
243
|
+
applyPuzzleCompletion, } from './utils';
|
|
217
244
|
/** Theme detection and resolution utilities. */
|
|
218
245
|
export {
|
|
219
246
|
/** localStorage key for theme preference ('sudojo-theme'). */
|
|
220
247
|
THEME_STORAGE_KEY,
|
|
248
|
+
/** localStorage key for font size preference ('sudojo-font-size'). */
|
|
249
|
+
FONT_SIZE_STORAGE_KEY,
|
|
221
250
|
/** Detect the system color scheme preference (light/dark). */
|
|
222
251
|
getSystemTheme,
|
|
223
252
|
/** Resolve a ThemePreference to an actual theme using the system theme. */
|
|
@@ -238,14 +267,76 @@ getPeriodDisplayName,
|
|
|
238
267
|
/** Check if a subscription period is the "best value" option (annual plans). */
|
|
239
268
|
isBestValuePlan,
|
|
240
269
|
/** Get a user-friendly error message for a RevenueCat error code. */
|
|
241
|
-
getRevenueCatErrorMessage,
|
|
270
|
+
getRevenueCatErrorMessage,
|
|
271
|
+
/** i18n key for a period's unit (e.g. 'P1M' -> 'periods.month'), or null. */
|
|
272
|
+
getPeriodLabelKey,
|
|
273
|
+
/** Localized price suffix for a period (e.g. '/month'), or ''. */
|
|
274
|
+
getPeriodLabel,
|
|
275
|
+
/** Whether a product is the best-value plan (annual period or annual/yearly id). */
|
|
276
|
+
isBestValueProduct,
|
|
277
|
+
/** Months in a subscription period (named or ISO 8601), or null. */
|
|
278
|
+
subscriptionPeriodToMonths,
|
|
279
|
+
/** Percent saved per month by one plan versus another, or null. */
|
|
280
|
+
calculateSavingsPercent,
|
|
281
|
+
/** Whether a subscription was bought on another platform than this client. */
|
|
282
|
+
isCrossPlatformSubscription,
|
|
283
|
+
/** Whether the account can be deleted now (signed in, not anonymous, no active subscription). */
|
|
284
|
+
canDeleteAccount,
|
|
285
|
+
/** Fraction (0-1) of puzzles an offer unlocks, from the levels' percentages. */
|
|
286
|
+
getPuzzleDistribution,
|
|
287
|
+
/** The plan the savings badge compares with (shortest known period), or null. */
|
|
288
|
+
selectSavingsBasePlan,
|
|
289
|
+
/** Percent a plan saves per month against the products' savings base plan, or null. */
|
|
290
|
+
getPlanSavingsPercent, } from './utils';
|
|
291
|
+
/** Technique and strategy utilities. */
|
|
292
|
+
export {
|
|
293
|
+
/** Get the icon URL for a solving technique by its path slug. */
|
|
294
|
+
getTechniqueIconUrl,
|
|
295
|
+
/** Public slug for a technique path ('3d-medusa' -> 'medusa-coloring'). */
|
|
296
|
+
toCanonicalTechniquePath,
|
|
297
|
+
/** API path for a technique slug ('medusa-coloring' -> '3d-medusa'). */
|
|
298
|
+
toApiTechniquePath,
|
|
299
|
+
/** Whether two technique paths name the same technique, aliases included. */
|
|
300
|
+
isSameTechniquePath,
|
|
301
|
+
/** Find a technique by API path or canonical slug. */
|
|
302
|
+
findTechniqueByPath,
|
|
303
|
+
/** Parse a comma-separated dependencies field into technique ids. */
|
|
304
|
+
parseTechniqueDependencies,
|
|
305
|
+
/** Techniques a technique depends on ("Requires"). */
|
|
306
|
+
getTechniqueDependencies,
|
|
307
|
+
/** Techniques that depend on a technique ("Learn after"). */
|
|
308
|
+
getDependentTechniques,
|
|
309
|
+
/** Sort techniques by level, then technique number. */
|
|
310
|
+
sortTechniquesByLevel,
|
|
311
|
+
/** Group techniques by level (Map, each group sorted by technique number). */
|
|
312
|
+
groupTechniquesByLevel,
|
|
313
|
+
/** Techniques of a strategy, sorted by technique number. */
|
|
314
|
+
getTechniquesForStrategy,
|
|
315
|
+
/** Find a strategy by its URL stub. */
|
|
316
|
+
findStrategyByStub,
|
|
317
|
+
/** Public slugs of all 60 techniques (footer / sitemap order). */
|
|
318
|
+
TECHNIQUE_SLUGS,
|
|
319
|
+
/** Stubs of the 17 strategies (difficulty order). */
|
|
320
|
+
STRATEGY_SLUGS,
|
|
321
|
+
/** Difficulty tier for a strategy's difficulty value. */
|
|
322
|
+
getStrategyDifficultyTier,
|
|
323
|
+
/** i18n key for a strategy's difficulty tier (e.g. 'strategy.expert'). */
|
|
324
|
+
getStrategyDifficultyKey,
|
|
325
|
+
/** Localized sections of a strategy from the strategies namespace. */
|
|
326
|
+
getStrategySections,
|
|
327
|
+
/** Localized overview, how-it-works steps and tips of a technique. */
|
|
328
|
+
parseTechniqueContent, } from './utils';
|
|
242
329
|
// ============================================================================
|
|
243
|
-
// Technique Utilities
|
|
330
|
+
// Technique Bitmask Utilities
|
|
244
331
|
// ============================================================================
|
|
245
|
-
/**
|
|
332
|
+
/** Exact (bigint) technique bitmasks for boards, dailies and game meta. */
|
|
246
333
|
export {
|
|
247
|
-
/**
|
|
248
|
-
|
|
334
|
+
/** Exact bitmask of a board/daily/meta; never throws (falls back to 0n). */
|
|
335
|
+
exactTechniqueBitmask,
|
|
336
|
+
/** Exact bitmask as the base-10 string API requests take. */
|
|
337
|
+
techniqueBitmaskString,
|
|
338
|
+
/** The techniques / techniques_bitmask pair to store on game meta. */
|
|
339
|
+
techniqueFieldsOf, } from './utils';
|
|
249
340
|
/** Shared logic for building step-by-step technique examples from practice data. */
|
|
250
341
|
export {
|
|
251
342
|
/** Parse a comma-delimited pencilmarks string into per-cell arrays. */
|
|
@@ -280,7 +371,35 @@ getLocalizedHintText,
|
|
|
280
371
|
/** Get localized title for a hint step using a translation function. */
|
|
281
372
|
getLocalizedHintTitle,
|
|
282
373
|
/** Resolve a localized API field, falling back to the raw value. */
|
|
283
|
-
localizedField,
|
|
374
|
+
localizedField,
|
|
375
|
+
/** Key prefix of the per-step heading tree ('headings.'). */
|
|
376
|
+
HINT_HEADING_KEY_PREFIX,
|
|
377
|
+
/** Heading localization (headings.<path>) for a hint step, or undefined. */
|
|
378
|
+
getStepHeadingLocalization,
|
|
379
|
+
/** Translated heading for a hint step, or ''. */
|
|
380
|
+
getLocalizedHintHeading,
|
|
381
|
+
/** Fill {{valueN}} placeholders from a values array. */
|
|
382
|
+
interpolateHintValues,
|
|
383
|
+
/** Heading for a hint step looked up in a heading tree (no i18n library). */
|
|
384
|
+
getStepHeadingFromTree,
|
|
385
|
+
/** Build the text/title/heading resolvers behind the apps' useLocalizedHint. */
|
|
386
|
+
createLocalizedHintHelpers, } from './utils';
|
|
387
|
+
/** Translation of API entities (levels, techniques, belts). */
|
|
388
|
+
export {
|
|
389
|
+
/** Route prefixed entity keys (levels.*, techniques.*) to their namespaces. */
|
|
390
|
+
createNamespacedTranslate,
|
|
391
|
+
/** Display title of a level (localization, levels namespace, raw title). */
|
|
392
|
+
getLevelDisplayTitle,
|
|
393
|
+
/** Display description of a level (localization, levels namespace, raw text). */
|
|
394
|
+
getLevelDisplayText,
|
|
395
|
+
/** Display title of a technique (localization, techniques namespace, raw title). */
|
|
396
|
+
getTechniqueDisplayTitle,
|
|
397
|
+
/** Localized belt name for a level ('belts' namespace `${level}.name`). */
|
|
398
|
+
getBeltDisplayName,
|
|
399
|
+
/** Localized belt label for a level ('belts' namespace `${level}.label`). */
|
|
400
|
+
getBeltDisplayLabel,
|
|
401
|
+
/** Display title of a strategy (localization, strategies namespace, raw title, stub). */
|
|
402
|
+
getStrategyDisplayTitle, } from './utils';
|
|
284
403
|
// ============================================================================
|
|
285
404
|
// i18n Key Utilities
|
|
286
405
|
// ============================================================================
|
|
@@ -309,6 +428,17 @@ getLocalizedTechniqueName, } from './utils';
|
|
|
309
428
|
export {
|
|
310
429
|
/** Convert a digit (1-9) to its display string based on the format (numeric, kanji, emojis). */
|
|
311
430
|
displayDigit, } from './utils';
|
|
431
|
+
export {
|
|
432
|
+
/** Fewest givens a scanned board needs (17). */
|
|
433
|
+
MIN_SCAN_CLUES,
|
|
434
|
+
/** Error thrown by scannedBoardFromResponse / useBoardScan, with a `code`. */
|
|
435
|
+
ScanBoardError,
|
|
436
|
+
/** Normalize an OCR API result into givens, player digits and pencilmarks. */
|
|
437
|
+
toScannedBoard,
|
|
438
|
+
/** Whether a scanned board carries any player digits. */
|
|
439
|
+
hasScannedInput,
|
|
440
|
+
/** Turn the OCR endpoint's response into a ScannedBoard (or throw why not). */
|
|
441
|
+
scannedBoardFromResponse, } from './utils';
|
|
312
442
|
/** Build a share URL from game state. */
|
|
313
443
|
export { buildShareUrl } from './utils';
|
|
314
444
|
/** Parse share URL query parameters into game state. */
|
|
@@ -317,6 +447,81 @@ export { parseShareParams } from './utils';
|
|
|
317
447
|
export { getWebUrl } from './utils';
|
|
318
448
|
/** Check if user-specific API calls should be enabled (non-anonymous, has token). */
|
|
319
449
|
export { isAuthenticatedUser } from './utils';
|
|
450
|
+
/** Whether a user is a real (signed-in, non-anonymous) account. */
|
|
451
|
+
export { isRealUser } from './utils';
|
|
452
|
+
/** Supported languages, locale resolution and language storage keys. */
|
|
453
|
+
export {
|
|
454
|
+
/** The 15 supported UI languages. */
|
|
455
|
+
SUPPORTED_LANGUAGES,
|
|
456
|
+
/** Codes of the supported languages. */
|
|
457
|
+
SUPPORTED_LANGUAGE_CODES,
|
|
458
|
+
/** Fallback language ('en'). */
|
|
459
|
+
DEFAULT_LANGUAGE,
|
|
460
|
+
/** Web localStorage key for the language preference ('language'). */
|
|
461
|
+
LANGUAGE_STORAGE_KEY,
|
|
462
|
+
/** RN AsyncStorage key for the language preference ('@sudojo/language'). */
|
|
463
|
+
NATIVE_LANGUAGE_STORAGE_KEY,
|
|
464
|
+
/** Whether a code is a supported language code. */
|
|
465
|
+
isSupportedLanguage,
|
|
466
|
+
/** Map a code or locale tag to a supported code (zh-TW/HK -> zh-hant), or null. */
|
|
467
|
+
normalizeLanguageCode,
|
|
468
|
+
/** Supported language for a locale tag, defaulting to 'en'. */
|
|
469
|
+
resolveLanguage,
|
|
470
|
+
/** BCP 47 casing of a code ('zh-hant' -> 'zh-Hant'). */
|
|
471
|
+
toLanguageTag,
|
|
472
|
+
/** Native name of a language, or undefined. */
|
|
473
|
+
getLanguageNativeName, } from './utils';
|
|
474
|
+
/** Community platform order and labels. */
|
|
475
|
+
export {
|
|
476
|
+
/** Known community platforms in display order. */
|
|
477
|
+
COMMUNITY_PLATFORMS,
|
|
478
|
+
/** Info for a platform id (case-insensitive), or undefined. */
|
|
479
|
+
getCommunityPlatform,
|
|
480
|
+
/** Sort platform ids into display order (unknown last). */
|
|
481
|
+
sortCommunityPlatforms, } from './utils';
|
|
482
|
+
/** Badge grouping for profile and statistics screens. */
|
|
483
|
+
export {
|
|
484
|
+
/** badgeType of level mastery badges ('level_mastery'). */
|
|
485
|
+
LEVEL_MASTERY_BADGE_TYPE,
|
|
486
|
+
/** badgeType of games-played badges ('games_played'). */
|
|
487
|
+
GAMES_PLAYED_BADGE_TYPE,
|
|
488
|
+
/** Split badge definitions into sorted level/game lists with isEarned. */
|
|
489
|
+
groupBadgeProgress, } from './utils';
|
|
490
|
+
/** Client-side hint gating helpers. */
|
|
491
|
+
export {
|
|
492
|
+
/** Hint steps visible without the level's entitlement (2). */
|
|
493
|
+
FREE_HINT_STEP_LIMIT,
|
|
494
|
+
/** Map a hint access state to the panel's action and message variant. */
|
|
495
|
+
getHintAccessAction,
|
|
496
|
+
/** i18n key suffixes for the hint access messages. */
|
|
497
|
+
HINT_ACCESS_KEY_SUFFIXES, } from './utils';
|
|
498
|
+
// ============================================================================
|
|
499
|
+
// Daily Date Utilities
|
|
500
|
+
// ============================================================================
|
|
501
|
+
/** Calendar-date helpers for daily puzzles (UTC "today", like the API). */
|
|
502
|
+
export {
|
|
503
|
+
/** UTC date of a Date (default now) as YYYY-MM-DD. */
|
|
504
|
+
getUtcDateString,
|
|
505
|
+
/** Normalize a daily date to YYYY-MM-DD without a timezone shift, or null. */
|
|
506
|
+
normalizeDailyDate,
|
|
507
|
+
/** Format a YYYY-MM-DD daily date as a local calendar date. */
|
|
508
|
+
formatDailyDate,
|
|
509
|
+
/** Whether a saved daily is not today's (UTC) daily. */
|
|
510
|
+
isStaleDaily, } from './utils';
|
|
511
|
+
/** Status derivation shared by useLevelGame and useDailyGame. */
|
|
512
|
+
export {
|
|
513
|
+
/** Whether a response/error says sign-in is required (legacy API signal). */
|
|
514
|
+
isAuthRequiredResponse,
|
|
515
|
+
/** Whether a response/error says a subscription is required (legacy API signal). */
|
|
516
|
+
isSubscriptionRequiredResponse,
|
|
517
|
+
/** Derive a GameFetchStatus from query state. */
|
|
518
|
+
getGameFetchStatus,
|
|
519
|
+
/** HTTP status carried by an error (NetworkError.status), or undefined. */
|
|
520
|
+
getErrorHttpStatus,
|
|
521
|
+
/** Derive a PracticeFetchStatus (401/402 aware) from query state. */
|
|
522
|
+
getPracticeFetchStatus, } from './utils';
|
|
523
|
+
/** Build walkthrough cards and headings for a stored technique example. */
|
|
524
|
+
export { buildTechniqueWalkthrough } from './utils';
|
|
320
525
|
// ============================================================================
|
|
321
526
|
// Hooks
|
|
322
527
|
// ============================================================================
|
|
@@ -366,6 +571,8 @@ useGamePlay,
|
|
|
366
571
|
useContinueGame,
|
|
367
572
|
/** Manual puzzle entry mode with solver validation. */
|
|
368
573
|
useBoardEntry,
|
|
574
|
+
/** Scan a board from an image: givens, player digits and pencilmarks. */
|
|
575
|
+
useBoardScan,
|
|
369
576
|
/** Server-side game session management for gamification (points, badges). */
|
|
370
577
|
useGameSession,
|
|
371
578
|
/** Check whether a level is enabled for the current user's entitlements. */
|
|
@@ -391,7 +598,35 @@ reportHintStatus,
|
|
|
391
598
|
/** Subscribe to hint status updates. */
|
|
392
599
|
onHintStatus,
|
|
393
600
|
/** Hook for SudokuGame to listen for external hint action events. */
|
|
394
|
-
useHintActionListener,
|
|
601
|
+
useHintActionListener,
|
|
602
|
+
/** Fire a callback once each time a puzzle becomes completed (re-arms on false). */
|
|
603
|
+
useCompletionTrigger,
|
|
604
|
+
/** Fetch strategies (unwrapped) with findStrategyByStub. */
|
|
605
|
+
useStrategies,
|
|
606
|
+
/** Fetch a random practice for a technique with auth/subscription/empty status. */
|
|
607
|
+
usePracticeGame,
|
|
608
|
+
/** Whether the user is a real (non-anonymous) account. */
|
|
609
|
+
useIsRealUser,
|
|
610
|
+
/** Whether the signed-in user is a site admin (GET /users/:uid siteAdmin). */
|
|
611
|
+
useIsSiteAdmin,
|
|
612
|
+
/** Look up a technique by path or alias (list first, then GET by path). */
|
|
613
|
+
useTechniqueByPath,
|
|
614
|
+
/** Fetch a technique's worked example and build its walkthrough. */
|
|
615
|
+
useTechniqueExample,
|
|
616
|
+
/** Build (memoized) the walkthrough for a stored technique example. */
|
|
617
|
+
useTechniqueWalkthrough,
|
|
618
|
+
/** Player's puzzle progress in localStorage (markCompleted, isCompleted, stats). */
|
|
619
|
+
usePuzzleProgress,
|
|
620
|
+
/** Account deletion rule and delete-then-sign-out sequence. */
|
|
621
|
+
useDeleteAccount,
|
|
622
|
+
/** Saved game to resume for a play screen (snapshot; clears stale dailies). */
|
|
623
|
+
useResumeGame,
|
|
624
|
+
/** The saved game a play screen should resume, or null (pure). */
|
|
625
|
+
getResumeGame,
|
|
626
|
+
/** Daily/Level play screen orchestration (resume, save, session, completion). */
|
|
627
|
+
usePuzzleSession,
|
|
628
|
+
/** Entered-puzzle save/resume after validation (no server session). */
|
|
629
|
+
useEnteredGameSession, } from './hooks';
|
|
395
630
|
// ============================================================================
|
|
396
631
|
// Stores
|
|
397
632
|
// ============================================================================
|
|
@@ -407,10 +642,41 @@ export { EntitlementProvider } from './context';
|
|
|
407
642
|
/** React context for entitlements (for advanced use). */
|
|
408
643
|
export { EntitlementContext, useEntitlementContext } from './context';
|
|
409
644
|
// ============================================================================
|
|
645
|
+
// Sudojo API Context
|
|
646
|
+
// ============================================================================
|
|
647
|
+
/** Optional provider of networkClient/baseUrl/token for sudojo_lib hooks. */
|
|
648
|
+
export { SudojoApiProvider } from './context';
|
|
649
|
+
/** API context, its hooks, and the option-over-context resolver. */
|
|
650
|
+
export {
|
|
651
|
+
/** React context holding the API connection (for advanced use). */
|
|
652
|
+
SudojoApiContext,
|
|
653
|
+
/** The provider's API connection (throws without a provider). */
|
|
654
|
+
useSudojoApi,
|
|
655
|
+
/** The provider's API connection, or null. */
|
|
656
|
+
useOptionalSudojoApi,
|
|
657
|
+
/** Merge explicit options over a context value (pure; throws if incomplete). */
|
|
658
|
+
resolveSudojoApi,
|
|
659
|
+
/** Resolve a hook's API connection from options, then the provider. */
|
|
660
|
+
useResolvedSudojoApi, } from './context';
|
|
661
|
+
// ============================================================================
|
|
410
662
|
// Entitlement Utilities (re-exported from sudojo_types)
|
|
411
663
|
// ============================================================================
|
|
412
664
|
/** Parse a comma-delimited entitlement string into an array. */
|
|
413
665
|
export { parseEntitlements } from '@sudobility/sudojo_types';
|
|
414
666
|
/** Check if a user has the required entitlement for a level. */
|
|
415
667
|
export { hasRequiredEntitlement } from '@sudobility/sudojo_types';
|
|
668
|
+
// ============================================================================
|
|
669
|
+
// Admin (batch jobs + stats; see src/admin/index.ts for the full list)
|
|
670
|
+
// ============================================================================
|
|
671
|
+
/**
|
|
672
|
+
* Admin module: board generation, technique extraction, example creation and
|
|
673
|
+
* admin stats as hooks (`useBoardGenerator`, `useTechniqueExtractor`,
|
|
674
|
+
* `useExampleCreator`, `useSingleBoardExtractor`, `useBoardTechniquesUpdater`,
|
|
675
|
+
* `useAdminStats`), the framework-agnostic jobs behind them
|
|
676
|
+
* (`runBoardGeneration`, `runTechniqueExtraction`, `runExampleCreation`) and
|
|
677
|
+
* their pure rules (`mergeBoardWithUserInput`, `adjustPracticeSolution`,
|
|
678
|
+
* `extractBoardTechniques`, `levelsToSearchForTechnique`, …). Network calls go
|
|
679
|
+
* only through sudojo_client hooks (`useAdminApi`).
|
|
680
|
+
*/
|
|
681
|
+
export * from './admin';
|
|
416
682
|
//# sourceMappingURL=index.js.map
|