ember-challenges
v0.7.0
Published
Reusable React Native challenge components for Ember wake-up flows.
Readme
ember-challenges
Reusable React Native challenge components for Ember wake-up flows.
Layout
index.js public API + EmberChallengeRunner (challenge type switch)
lib/math.js math problems (per difficulty) + MathChallenge
lib/tile.js sliding puzzle board logic + TileChallenge
lib/blackjack.js blackjack game state + BlackjackChallenge (exposes
rounds/roundOutcome in persisted state for host-side betting)
lib/cards.js deck primitives + animated playing-card views
lib/styles.js shared StyleSheet (overridable slots via stylesConfig)
lib/util.js shared helpers (randomInt)The public API is exactly { EmberChallengeRunner }; everything in lib/ is
internal and safe to reshape.
Exports
const { EmberChallengeRunner } = require('ember-challenges');EmberChallengeRunner renders one challenge at a time and calls onSolved(stats) when the current challenge is complete.
Challenge Types
Math
<EmberChallengeRunner type="math" difficulty="advanced" colors={colors} onSolved={onSolved} />Difficulties:
easyintermediateadvanced
Stats include type, attempts, durationMs, and difficulty.
Tile Puzzle
<EmberChallengeRunner type="tile" tileCount={8} colors={colors} onSolved={onSolved} />Tile sizes:
8= 3x3 puzzle with 8 numbered tiles and one blank space.15= 4x4 puzzle with 15 numbered tiles and one blank space.
The old 2x2 puzzle has been removed. Stats include type, moves, durationMs, and tileCount.
Packaging
This package is consumed by the mobile app as a local packed tarball. After editing:
npm packThen update the mobile app dependency/lockfile or reinstall so mobile/node_modules/ember-challenges receives the new package contents.
