cotutor 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +247 -21
- package/NOTICE +42 -0
- package/README.md +92 -20
- package/bin/cotutor.js +4 -4
- package/cards/canvas/card.css +8 -0
- package/cards/canvas/card.md +68 -0
- package/cards/choice/card.css +18 -0
- package/cards/choice/card.md +55 -0
- package/cards/code/card.css +5 -0
- package/cards/code/card.md +46 -0
- package/cards/dictation/card.css +10 -0
- package/cards/dictation/card.md +97 -0
- package/cards/image/card.css +10 -0
- package/cards/image/card.md +52 -0
- package/cards/lecture/card.css +9 -0
- package/cards/lecture/card.md +69 -0
- package/cards/paint/card.css +20 -0
- package/cards/paint/card.md +77 -0
- package/cards/photo/card.css +15 -0
- package/cards/photo/card.md +61 -0
- package/cards/read/card.css +6 -0
- package/cards/read/card.md +51 -0
- package/cards/text/card.css +3 -0
- package/cards/text/card.md +69 -0
- package/cards/tianzige/card.css +17 -0
- package/cards/tianzige/card.md +78 -0
- package/cards/tutor/card.css +66 -0
- package/cards/tutor/card.md +148 -0
- package/cards/word/card.css +24 -0
- package/cards/word/card.md +91 -0
- package/cards//346/235/277/344/271/246/346/200/216/344/271/210/345/206/231.md +159 -0
- package/dist/app/activity-eval-rules.d.ts +62 -0
- package/dist/app/activity-eval-rules.js +276 -0
- package/dist/app/activity-eval.d.ts +65 -0
- package/dist/app/activity-eval.js +158 -0
- package/dist/app/build.d.ts +11 -0
- package/dist/app/build.js +45 -0
- package/dist/app/cli/activities.d.ts +63 -0
- package/dist/app/cli/activities.js +158 -0
- package/dist/{cli → app/cli}/cert.js +3 -3
- package/dist/app/cli/chalk/bake.d.ts +10 -0
- package/dist/app/cli/chalk/bake.js +58 -0
- package/dist/app/cli/chalk/browser.d.ts +16 -0
- package/dist/app/cli/chalk/browser.js +142 -0
- package/dist/app/cli/chalk/build.d.ts +14 -0
- package/dist/app/cli/chalk/build.js +100 -0
- package/dist/app/cli/chalk/dub.d.ts +51 -0
- package/dist/app/cli/chalk/dub.js +106 -0
- package/dist/app/cli/chalk/load-scene.d.ts +34 -0
- package/dist/app/cli/chalk/load-scene.js +117 -0
- package/dist/app/cli/chalk/main.d.ts +7 -0
- package/dist/app/cli/chalk/main.js +198 -0
- package/dist/app/cli/chalk/serve.d.ts +4 -0
- package/dist/app/cli/chalk/serve.js +28 -0
- package/dist/app/cli/chalk/snap.d.ts +65 -0
- package/dist/app/cli/chalk/snap.js +103 -0
- package/dist/app/cli/chalk/typecheck.d.ts +7 -0
- package/dist/app/cli/chalk/typecheck.js +51 -0
- package/dist/{cli → app/cli}/doctor.d.ts +4 -3
- package/dist/app/cli/doctor.js +617 -0
- package/dist/app/cli/grades.d.ts +14 -0
- package/dist/app/cli/grades.js +44 -0
- package/dist/{cli → app/cli}/init.d.ts +3 -1
- package/dist/app/cli/init.js +155 -0
- package/dist/app/cli/main.js +715 -0
- package/dist/app/cli/migrate.d.ts +58 -0
- package/dist/app/cli/migrate.js +253 -0
- package/dist/{cli → app/cli}/serve.d.ts +12 -5
- package/dist/app/cli/serve.js +98 -0
- package/dist/app/cli/shipped.d.ts +30 -0
- package/dist/app/cli/shipped.js +47 -0
- package/dist/app/cli/skeleton.d.ts +38 -0
- package/dist/app/cli/skeleton.js +161 -0
- package/dist/app/cli/skills.d.ts +55 -0
- package/dist/app/cli/skills.js +189 -0
- package/dist/app/cli/themes.d.ts +52 -0
- package/dist/app/cli/themes.js +148 -0
- package/dist/{cli → app/cli}/tutors.d.ts +15 -26
- package/dist/{cli → app/cli}/tutors.js +86 -110
- package/dist/app/cli/usage.d.ts +2 -0
- package/dist/app/cli/usage.js +30 -0
- package/dist/app/dictation/recognize.d.ts +18 -0
- package/dist/app/dictation/recognize.js +6 -0
- package/dist/app/dictation/route.d.ts +52 -0
- package/dist/app/dictation/route.js +510 -0
- package/dist/app/diff.d.ts +11 -0
- package/dist/app/diff.js +71 -0
- package/dist/app/http/access.d.ts +62 -0
- package/dist/app/http/access.js +180 -0
- package/dist/app/http/app.d.ts +246 -0
- package/dist/app/http/app.js +1212 -0
- package/dist/app/http/dev-activities.d.ts +115 -0
- package/dist/app/http/dev-activities.js +193 -0
- package/dist/app/http/dev-overview.d.ts +108 -0
- package/dist/app/http/dev-overview.js +209 -0
- package/dist/app/http/dev-tutor-files.d.ts +80 -0
- package/dist/app/http/dev-tutor-files.js +151 -0
- package/dist/app/http/parent-home.d.ts +37 -0
- package/dist/app/http/parent-home.js +203 -0
- package/dist/app/http/range.d.ts +9 -0
- package/dist/app/http/range.js +19 -0
- package/dist/app/http/raw-view.d.ts +117 -0
- package/dist/app/http/raw-view.js +149 -0
- package/dist/app/http/send-file.d.ts +7 -0
- package/dist/app/http/send-file.js +29 -0
- package/dist/{server → app/http}/stage.d.ts +9 -0
- package/dist/{server → app/http}/stage.js +34 -6
- package/dist/app/http/theme.d.ts +13 -0
- package/dist/app/http/theme.js +41 -0
- package/dist/app/machine/bailian.d.ts +28 -0
- package/dist/app/machine/bailian.js +88 -0
- package/dist/app/mock/mock-live.d.ts +16 -0
- package/dist/app/mock/mock-live.js +140 -0
- package/dist/{server → app/mock}/mock.d.ts +36 -5
- package/dist/app/mock/mock.js +1117 -0
- package/dist/app/replay.d.ts +94 -0
- package/dist/app/replay.js +170 -0
- package/dist/app/skills/analyze-doc.d.ts +3 -0
- package/dist/app/skills/analyze-doc.js +47 -0
- package/dist/app/skills/home-doc.d.ts +5 -0
- package/dist/app/skills/home-doc.js +112 -0
- package/dist/app/skills/tune-doc.d.ts +3 -0
- package/dist/app/skills/tune-doc.js +80 -0
- package/dist/app/talk/list.d.ts +11 -0
- package/dist/app/talk/list.js +9 -0
- package/dist/app/talk/route.d.ts +16 -0
- package/dist/app/talk/route.js +142 -0
- package/dist/app/workspace.d.ts +58 -0
- package/dist/{cli → app}/workspace.js +77 -52
- package/dist/app/ws/route.d.ts +25 -0
- package/dist/app/ws/route.js +29 -0
- package/dist/app/ws/ws.d.ts +31 -0
- package/dist/app/ws/ws.js +169 -0
- package/dist/board/canvas-chat.d.ts +97 -0
- package/dist/board/canvas-chat.js +175 -0
- package/dist/board/card-guards.d.ts +15 -0
- package/dist/board/card-guards.js +38 -0
- package/dist/board/cards/canvas.d.ts +41 -0
- package/dist/board/cards/canvas.js +83 -0
- package/dist/{cards → board/cards}/choice.js +0 -12
- package/dist/{cards → board/cards}/code.js +0 -3
- package/dist/board/cards/dictation.d.ts +42 -0
- package/dist/board/cards/dictation.js +105 -0
- package/dist/board/cards/docs.d.ts +47 -0
- package/dist/board/cards/docs.js +152 -0
- package/dist/{cards → board/cards}/image.js +1 -10
- package/dist/board/cards/index.d.ts +62 -0
- package/dist/board/cards/index.js +144 -0
- package/dist/{cards → board/cards}/kind.d.ts +10 -4
- package/dist/board/cards/kind.js +9 -0
- package/dist/board/cards/lecture.d.ts +26 -0
- package/dist/board/cards/lecture.js +62 -0
- package/dist/board/cards/paint.d.ts +38 -0
- package/dist/board/cards/paint.js +85 -0
- package/dist/board/cards/photo.d.ts +15 -0
- package/dist/board/cards/photo.js +29 -0
- package/dist/{cards → board/cards}/read.js +1 -10
- package/dist/board/cards/text.d.ts +20 -0
- package/dist/board/cards/text.js +59 -0
- package/dist/board/cards/tianzige.d.ts +16 -0
- package/dist/board/cards/tianzige.js +64 -0
- package/dist/board/cards/tutor.d.ts +72 -0
- package/dist/board/cards/tutor.js +134 -0
- package/dist/board/cards/word.d.ts +20 -0
- package/dist/board/cards/word.js +76 -0
- package/dist/board/lecture.d.ts +100 -0
- package/dist/board/lecture.js +204 -0
- package/dist/board/paper.d.ts +20 -0
- package/dist/board/paper.js +76 -0
- package/dist/board/parse.d.ts +120 -0
- package/dist/board/parse.js +330 -0
- package/dist/board/presentation.d.ts +295 -0
- package/dist/board/presentation.js +615 -0
- package/dist/board/sections.d.ts +16 -0
- package/dist/board/sections.js +130 -0
- package/dist/brain/api-tools.d.ts +8 -0
- package/dist/brain/api-tools.js +190 -0
- package/dist/brain/api.d.ts +62 -0
- package/dist/brain/api.js +411 -0
- package/dist/brain/cli/adapters.d.ts +60 -0
- package/dist/brain/cli/adapters.js +91 -0
- package/dist/brain/cli/qwen.d.ts +11 -0
- package/dist/brain/cli/qwen.js +141 -0
- package/dist/brain/cli/run-plan.d.ts +59 -0
- package/dist/brain/cli/run-plan.js +71 -0
- package/dist/brain/cli/run.d.ts +35 -0
- package/dist/brain/cli/run.js +256 -0
- package/dist/brain/cli/stream-json.d.ts +18 -0
- package/dist/brain/cli/stream-json.js +86 -0
- package/dist/brain/cli/types.d.ts +144 -0
- package/dist/brain/cli/types.js +3 -0
- package/dist/brain/cli/warm.d.ts +53 -0
- package/dist/brain/cli/warm.js +103 -0
- package/dist/brain/index.d.ts +145 -0
- package/dist/brain/index.js +74 -0
- package/dist/brain/stream.d.ts +20 -0
- package/dist/brain/stream.js +70 -0
- package/dist/brain/transcript.d.ts +45 -0
- package/dist/brain/transcript.js +132 -0
- package/dist/chalk/actions.d.ts +37 -0
- package/dist/chalk/actions.js +69 -0
- package/dist/chalk/bundle.d.ts +26 -0
- package/dist/chalk/bundle.js +69 -0
- package/dist/chalk/check.d.ts +28 -0
- package/dist/chalk/check.js +291 -0
- package/dist/chalk/circle.d.ts +64 -0
- package/dist/chalk/circle.js +193 -0
- package/dist/chalk/clock.d.ts +84 -0
- package/dist/chalk/clock.js +84 -0
- package/dist/chalk/geometry.d.ts +44 -0
- package/dist/chalk/geometry.js +139 -0
- package/dist/chalk/glyphs/capitals.d.ts +12 -0
- package/dist/chalk/glyphs/capitals.js +264 -0
- package/dist/chalk/glyphs/index.d.ts +21 -0
- package/dist/chalk/glyphs/index.js +18 -0
- package/dist/chalk/glyphs/letters.d.ts +13 -0
- package/dist/chalk/glyphs/letters.js +280 -0
- package/dist/chalk/glyphs/metrics.d.ts +33 -0
- package/dist/chalk/glyphs/metrics.js +28 -0
- package/dist/chalk/glyphs/registry.d.ts +7 -0
- package/dist/chalk/glyphs/registry.js +8 -0
- package/dist/chalk/glyphs/sample.d.ts +32 -0
- package/dist/chalk/glyphs/sample.js +102 -0
- package/dist/chalk/glyphs/skeleton.d.ts +64 -0
- package/dist/chalk/glyphs/skeleton.js +126 -0
- package/dist/chalk/glyphs/types.d.ts +58 -0
- package/dist/chalk/glyphs/types.js +17 -0
- package/dist/chalk/index.d.ts +23 -0
- package/dist/chalk/index.js +15 -0
- package/dist/chalk/manifest.d.ts +41 -0
- package/dist/chalk/manifest.js +6 -0
- package/dist/chalk/paint.d.ts +180 -0
- package/dist/chalk/paint.js +210 -0
- package/dist/chalk/pointer.d.ts +8 -0
- package/dist/chalk/pointer.js +21 -0
- package/dist/chalk/prepare.d.ts +11 -0
- package/dist/chalk/prepare.js +15 -0
- package/dist/chalk/scene-schema.d.ts +199 -0
- package/dist/chalk/scene-schema.js +91 -0
- package/dist/chalk/seed.d.ts +3 -0
- package/dist/chalk/seed.js +10 -0
- package/dist/chalk/text-metrics.d.ts +8 -0
- package/dist/chalk/text-metrics.js +156 -0
- package/dist/chalk/timeline.d.ts +47 -0
- package/dist/chalk/timeline.js +84 -0
- package/dist/chalk/types.d.ts +150 -0
- package/dist/chalk/types.js +8 -0
- package/dist/lib/index.d.ts +14 -12
- package/dist/lib/index.js +14 -12
- package/dist/media/draw.d.ts +23 -0
- package/dist/media/draw.js +44 -0
- package/dist/media/mp3.d.ts +6 -0
- package/dist/media/mp3.js +58 -0
- package/dist/media/mp4.d.ts +1 -0
- package/dist/media/mp4.js +58 -0
- package/dist/media/tts-voices.d.ts +18 -0
- package/dist/media/tts-voices.js +606 -0
- package/dist/media/tts.d.ts +56 -0
- package/dist/media/tts.js +174 -0
- package/dist/media/vision.d.ts +25 -0
- package/dist/media/vision.js +71 -0
- package/dist/memory/commit.d.ts +67 -0
- package/dist/memory/commit.js +130 -0
- package/dist/memory/context.d.ts +86 -0
- package/dist/memory/context.js +97 -0
- package/dist/memory/diary.d.ts +84 -0
- package/dist/memory/diary.js +183 -0
- package/dist/memory/grade.d.ts +2 -0
- package/dist/memory/grade.js +7 -0
- package/dist/{lib → memory}/plan.d.ts +1 -1
- package/dist/{lib → memory}/plan.js +1 -1
- package/dist/memory/proposals.d.ts +11 -0
- package/dist/memory/proposals.js +43 -0
- package/dist/memory/retrieval.d.ts +44 -0
- package/dist/memory/retrieval.js +157 -0
- package/dist/{lib → memory}/timetable.d.ts +0 -3
- package/dist/{lib → memory}/timetable.js +0 -11
- package/dist/memory/vault-notes.d.ts +165 -0
- package/dist/memory/vault-notes.js +359 -0
- package/dist/memory/vault.d.ts +70 -0
- package/dist/memory/vault.js +169 -0
- package/dist/realtime/bailian.d.ts +120 -0
- package/dist/realtime/bailian.js +288 -0
- package/dist/realtime/cues.d.ts +51 -0
- package/dist/realtime/cues.js +94 -0
- package/dist/realtime/listen.d.ts +32 -0
- package/dist/realtime/listen.js +53 -0
- package/dist/realtime/preview.d.ts +23 -0
- package/dist/realtime/preview.js +38 -0
- package/dist/realtime/prompt.d.ts +8 -0
- package/dist/realtime/prompt.js +13 -0
- package/dist/realtime/voices.d.ts +19 -0
- package/dist/realtime/voices.js +71 -0
- package/dist/runtime/activities.d.ts +17 -0
- package/dist/runtime/activities.js +46 -0
- package/dist/runtime/activity-state.d.ts +22 -0
- package/dist/runtime/activity-state.js +83 -0
- package/dist/runtime/activity.d.ts +63 -0
- package/dist/runtime/activity.js +428 -0
- package/dist/runtime/agent-file.d.ts +24 -0
- package/dist/runtime/agent-file.js +59 -0
- package/dist/runtime/auto-bookkeep.d.ts +30 -0
- package/dist/runtime/auto-bookkeep.js +84 -0
- package/dist/{lib → runtime/context}/context-pack.d.ts +3 -3
- package/dist/runtime/context/context-pack.js +182 -0
- package/dist/runtime/context/thread-digest.d.ts +4 -0
- package/dist/runtime/context/thread-digest.js +35 -0
- package/dist/runtime/context/tutor-rules.d.ts +25 -0
- package/dist/runtime/context/tutor-rules.js +47 -0
- package/dist/runtime/delivery/delivery.d.ts +94 -0
- package/dist/runtime/delivery/delivery.js +145 -0
- package/dist/runtime/delivery/playback.d.ts +25 -0
- package/dist/runtime/delivery/playback.js +29 -0
- package/dist/runtime/delivery/player.d.ts +145 -0
- package/dist/runtime/delivery/player.js +221 -0
- package/dist/runtime/delivery/queue.d.ts +89 -0
- package/dist/runtime/delivery/queue.js +59 -0
- package/dist/runtime/home/edit.d.ts +39 -0
- package/dist/runtime/home/edit.js +132 -0
- package/dist/runtime/home/home.d.ts +180 -0
- package/dist/runtime/home/home.js +311 -0
- package/dist/runtime/home/store.d.ts +142 -0
- package/dist/runtime/home/store.js +440 -0
- package/dist/runtime/journal/conversation.d.ts +46 -0
- package/dist/runtime/journal/conversation.js +89 -0
- package/dist/runtime/journal/events.d.ts +27 -0
- package/dist/runtime/journal/events.js +136 -0
- package/dist/runtime/journal/kid-log.d.ts +105 -0
- package/dist/runtime/journal/kid-log.js +133 -0
- package/dist/runtime/journal/ledger.d.ts +17 -0
- package/dist/{lib → runtime/journal}/ledger.js +7 -40
- package/dist/runtime/journal/mix.d.ts +33 -0
- package/dist/runtime/journal/mix.js +88 -0
- package/dist/runtime/journal/mouth-index.d.ts +26 -0
- package/dist/runtime/journal/mouth-index.js +34 -0
- package/dist/runtime/journal/mouth.d.ts +54 -0
- package/dist/runtime/journal/mouth.js +102 -0
- package/dist/runtime/journal/recorder.d.ts +46 -0
- package/dist/runtime/journal/recorder.js +58 -0
- package/dist/runtime/journal/store.d.ts +123 -0
- package/dist/runtime/journal/store.js +316 -0
- package/dist/runtime/kid-input.d.ts +16 -0
- package/dist/runtime/kid-input.js +195 -0
- package/dist/runtime/kid-view.d.ts +124 -0
- package/dist/runtime/kid-view.js +157 -0
- package/dist/runtime/lecture.d.ts +86 -0
- package/dist/runtime/lecture.js +237 -0
- package/dist/runtime/live/call.d.ts +219 -0
- package/dist/runtime/live/call.js +1211 -0
- package/dist/runtime/live/turns.d.ts +48 -0
- package/dist/runtime/live/turns.js +102 -0
- package/dist/runtime/runner.d.ts +289 -0
- package/dist/runtime/runner.js +898 -0
- package/dist/runtime/talk-run.d.ts +21 -0
- package/dist/runtime/talk-run.js +34 -0
- package/dist/scenes/dictation/match.d.ts +57 -0
- package/dist/scenes/dictation/match.js +255 -0
- package/dist/scenes/dictation/recognize.d.ts +86 -0
- package/dist/scenes/dictation/recognize.js +163 -0
- package/dist/scenes/dictation/store.d.ts +112 -0
- package/dist/scenes/dictation/store.js +99 -0
- package/dist/scenes/look.d.ts +26 -0
- package/dist/scenes/look.js +1 -0
- package/dist/scenes/paint/painter.d.ts +84 -0
- package/dist/scenes/paint/painter.js +170 -0
- package/dist/scenes/paint/prompt.d.ts +23 -0
- package/dist/scenes/paint/prompt.js +36 -0
- package/dist/scenes/talk/en-words.d.ts +8 -0
- package/dist/scenes/talk/en-words.js +44 -0
- package/dist/scenes/talk/list.d.ts +44 -0
- package/dist/scenes/talk/list.js +88 -0
- package/dist/scenes/talk/store.d.ts +27 -0
- package/dist/scenes/talk/store.js +61 -0
- package/dist/scenes/talk/warmup.d.ts +16 -0
- package/dist/scenes/talk/warmup.js +39 -0
- package/dist/schema/activity.d.ts +149 -0
- package/dist/schema/activity.js +113 -0
- package/dist/schema/board.d.ts +143 -2
- package/dist/schema/board.js +15 -3
- package/dist/schema/config.d.ts +309 -94
- package/dist/schema/config.js +259 -72
- package/dist/schema/context-pack.d.ts +76 -14
- package/dist/schema/context-pack.js +91 -10
- package/dist/{lib/conversation.d.ts → schema/conversation-files.d.ts} +11 -33
- package/dist/schema/conversation-files.js +26 -0
- package/dist/schema/conversation.d.ts +385 -49
- package/dist/schema/conversation.js +135 -19
- package/dist/schema/events.d.ts +138 -0
- package/dist/schema/events.js +1 -0
- package/dist/schema/home.d.ts +46 -0
- package/dist/schema/home.js +30 -0
- package/dist/schema/index.d.ts +14 -3
- package/dist/schema/index.js +14 -3
- package/dist/schema/kid-device.d.ts +20 -0
- package/dist/schema/kid-device.js +32 -0
- package/dist/schema/ledger.d.ts +8 -63
- package/dist/schema/ledger.js +7 -31
- package/dist/schema/memory.d.ts +73 -0
- package/dist/schema/memory.js +47 -0
- package/dist/schema/plan.d.ts +2 -2
- package/dist/schema/plan.js +2 -2
- package/dist/schema/sections.d.ts +32 -25
- package/dist/schema/sections.js +21 -22
- package/dist/schema/theme.d.ts +25 -0
- package/dist/schema/theme.js +26 -0
- package/dist/schema/timetable.d.ts +2 -2
- package/dist/schema/timetable.js +2 -2
- package/dist/schema/workspace.d.ts +41 -0
- package/dist/schema/workspace.js +9 -0
- package/dist/shared/errors.d.ts +8 -0
- package/dist/shared/errors.js +13 -0
- package/dist/shared/home.d.ts +2 -0
- package/dist/shared/home.js +16 -0
- package/dist/shared/human-notes.d.ts +5 -0
- package/dist/shared/human-notes.js +7 -0
- package/dist/shared/qianwen.d.ts +50 -0
- package/dist/shared/qianwen.js +109 -0
- package/dist/shared/time.d.ts +9 -0
- package/dist/shared/time.js +22 -0
- package/dist/shared/tokens.d.ts +18 -0
- package/dist/shared/tokens.js +11 -0
- package/dist/shared/wav.d.ts +10 -0
- package/dist/shared/wav.js +50 -0
- package/dist/stage/chunk-226TNLQA.js +129 -0
- package/dist/stage/chunk-24LGQEKE.js +1 -0
- package/dist/stage/chunk-25XV6UY3.js +10 -0
- package/dist/stage/chunk-2AZI3NHJ.js +1 -0
- package/dist/stage/chunk-2BQZTTBE.js +1 -0
- package/dist/stage/chunk-2M7CGY3Y.js +11 -0
- package/dist/stage/chunk-2VR4WFQ7.js +10 -0
- package/dist/stage/chunk-2ZYXBUWG.js +9 -0
- package/dist/stage/chunk-32LAWMGY.js +1 -0
- package/dist/stage/chunk-3LEMTSOO.js +11 -0
- package/dist/stage/chunk-3QCKGZYE.js +32 -0
- package/dist/stage/chunk-44P66WFA.js +1 -0
- package/dist/stage/chunk-4AM6FRR6.js +7 -0
- package/dist/stage/chunk-4QDE4SUK.js +1 -0
- package/dist/stage/chunk-4QESHV3U.js +1 -0
- package/dist/stage/chunk-4SG5QPHB.js +2 -0
- package/dist/stage/chunk-4T4UVCOC.js +1 -0
- package/dist/stage/chunk-4WUEPPG3.js +34 -0
- package/dist/stage/chunk-4YCN6UZ5.js +99 -0
- package/dist/stage/chunk-5V7ZY2AP.js +1 -0
- package/dist/stage/chunk-5VS5Y2VJ.js +6 -0
- package/dist/stage/chunk-5W4NO2ZD.js +62 -0
- package/dist/stage/chunk-65CRNICM.js +1 -0
- package/dist/stage/chunk-66MULO7F.js +5 -0
- package/dist/stage/chunk-6COFQTBS.js +162 -0
- package/dist/stage/chunk-6VZG3M3I.js +8 -0
- package/dist/stage/chunk-7HVDH43T.js +1 -0
- package/dist/stage/chunk-7JLJN4EZ.js +8 -0
- package/dist/stage/chunk-7QDSP4LN.js +1 -0
- package/dist/stage/chunk-7R6OQAO3.js +1 -0
- package/dist/stage/chunk-7VTTHZKW.js +7 -0
- package/dist/stage/chunk-ATHR5KEN.js +10 -0
- package/dist/stage/chunk-B6R5LTP2.js +36 -0
- package/dist/stage/chunk-BD4WE264.js +1 -0
- package/dist/stage/chunk-BONANU47.js +206 -0
- package/dist/stage/chunk-BTVW7OFK.js +89 -0
- package/dist/stage/chunk-BUTJIDHG.js +8 -0
- package/dist/stage/chunk-C2IPYMML.js +84 -0
- package/dist/stage/chunk-C54FTPPV.js +9 -0
- package/dist/stage/chunk-C6LOUF2Z.js +90 -0
- package/dist/stage/chunk-CFF3PILO.js +339 -0
- package/dist/stage/chunk-CI2FQ2JY.js +9 -0
- package/dist/stage/chunk-CW5O4RV7.js +12 -0
- package/dist/stage/chunk-CYABNQYD.js +1 -0
- package/dist/stage/chunk-D7FFA4NS.js +15 -0
- package/dist/stage/chunk-DUNNXU6Z.js +8 -0
- package/dist/stage/chunk-E3E4Q6JF.js +6 -0
- package/dist/stage/chunk-EB3U3LH7.js +9 -0
- package/dist/stage/chunk-EGSZ736B.js +8 -0
- package/dist/stage/chunk-EOBXW5VQ.js +2 -0
- package/dist/stage/chunk-ERZC3B7Y.js +11 -0
- package/dist/stage/chunk-ESDOOBIH.js +11 -0
- package/dist/stage/chunk-EVU4QAL4.js +178 -0
- package/dist/stage/chunk-EVVZI2NY.js +39 -0
- package/dist/stage/chunk-FBKAZUKD.js +39 -0
- package/dist/stage/chunk-FDVKYQJN.js +1 -0
- package/dist/stage/chunk-FGPVYHVR.js +5 -0
- package/dist/stage/chunk-FHUD4AZC.js +1 -0
- package/dist/stage/chunk-FKUJ2DMY.js +96 -0
- package/dist/stage/chunk-FNZGVIJV.js +1 -0
- package/dist/stage/chunk-GBYSEGYM.js +78 -0
- package/dist/stage/chunk-GCO4TDHX.js +1 -0
- package/dist/stage/chunk-GKTML2LG.js +10 -0
- package/dist/stage/chunk-GMDIHHXQ.js +11 -0
- package/dist/stage/chunk-GOUNACI3.js +10 -0
- package/dist/stage/chunk-GXAYATPF.js +3 -0
- package/dist/stage/chunk-H2K2DDXV.js +8 -0
- package/dist/stage/chunk-H3UJI6ZY.js +13 -0
- package/dist/stage/chunk-H6PUGCME.js +7 -0
- package/dist/stage/chunk-HNBUIMIG.js +1 -0
- package/dist/stage/chunk-HRZY2BJQ.js +10 -0
- package/dist/stage/chunk-HSPJGALW.js +30 -0
- package/dist/stage/chunk-IBYORHIP.js +25 -0
- package/dist/stage/chunk-IHF4EWTY.js +1 -0
- package/dist/stage/chunk-ISBRPNKI.js +1 -0
- package/dist/stage/chunk-IZ3OI3C2.js +2 -0
- package/dist/stage/chunk-JEFZAC2R.js +1 -0
- package/dist/stage/chunk-JFIGRDPO.js +1 -0
- package/dist/stage/chunk-JFVYBOOC.js +9 -0
- package/dist/stage/chunk-JGD4TUTQ.js +1 -0
- package/dist/stage/chunk-JO4BEHDH.js +4 -0
- package/dist/stage/chunk-JOWBS42C.js +1 -0
- package/dist/stage/chunk-JP3TM2TG.js +1 -0
- package/dist/stage/chunk-JVK2C52O.js +1 -0
- package/dist/stage/chunk-K4I76XBX.js +14 -0
- package/dist/stage/chunk-KA6CZZ4M.js +1 -0
- package/dist/stage/chunk-KESSJ36M.js +1 -0
- package/dist/stage/chunk-LKATEVRU.js +1 -0
- package/dist/stage/chunk-LS4EJ2EI.js +1 -0
- package/dist/stage/chunk-LUKJQC2X.js +70 -0
- package/dist/stage/chunk-LWULR3SM.js +1 -0
- package/dist/stage/chunk-LWVRFMKX.js +2 -0
- package/dist/stage/chunk-LXC4ZBPZ.js +1 -0
- package/dist/stage/chunk-M2UP255H.js +1 -0
- package/dist/stage/chunk-MAPPXUZQ.js +231 -0
- package/dist/stage/chunk-MBMPW7Z5.js +1 -0
- package/dist/stage/chunk-MD3HMMTK.js +1 -0
- package/dist/stage/chunk-MLPCUIKR.js +17 -0
- package/dist/stage/chunk-MNQIRPDQ.js +8 -0
- package/dist/stage/chunk-MRG7MJVS.js +1 -0
- package/dist/stage/chunk-MU6EXW72.js +10 -0
- package/dist/stage/chunk-MVU2X6LU.js +4 -0
- package/dist/stage/chunk-N6UA5CZV.js +36 -0
- package/dist/stage/chunk-NLZIT2TJ.js +7 -0
- package/dist/stage/chunk-NOJR3J7M.js +1 -0
- package/dist/stage/chunk-NT7ARDOL.js +1 -0
- package/dist/stage/chunk-NWOGMPZH.js +1 -0
- package/dist/stage/chunk-NXE4KMG3.js +40 -0
- package/dist/stage/chunk-O4YCZXD2.js +257 -0
- package/dist/stage/chunk-OAJZ7HLK.js +1 -0
- package/dist/stage/chunk-OCFCFASO.js +1 -0
- package/dist/stage/chunk-ODGPG5RY.js +7 -0
- package/dist/stage/chunk-ODUEA52Q.js +3 -0
- package/dist/stage/chunk-OGDJ3FCI.js +1 -0
- package/dist/stage/chunk-OLDJ55TT.js +1 -0
- package/dist/stage/chunk-OOCL4ATI.js +2 -0
- package/dist/stage/chunk-OQEFDUDV.js +1 -0
- package/dist/stage/chunk-OQWVEWG7.js +4 -0
- package/dist/stage/chunk-OUIX6BGK.js +1 -0
- package/dist/stage/chunk-OV7OZYUO.js +7 -0
- package/dist/stage/chunk-PFGDY33O.js +1 -0
- package/dist/stage/chunk-PFJDUJB3.js +139 -0
- package/dist/stage/chunk-PGEW76ER.js +1 -0
- package/dist/stage/chunk-PP76TAQX.js +32 -0
- package/dist/stage/chunk-PTBOP4OT.js +2 -0
- package/dist/stage/chunk-PX2RVHCK.js +1 -0
- package/dist/stage/chunk-Q7K3PNAD.js +1 -0
- package/dist/stage/chunk-QDDPLZDB.js +1 -0
- package/dist/stage/chunk-QLGLZ77F.js +1 -0
- package/dist/stage/chunk-QOPFDFHI.js +1 -0
- package/dist/stage/chunk-QXT4KAEJ.js +1 -0
- package/dist/stage/chunk-R4YVZCIT.js +1 -0
- package/dist/stage/chunk-R6P6EHWA.js +62 -0
- package/dist/stage/chunk-RCH3OXBI.js +9 -0
- package/dist/stage/chunk-RHPE44I2.js +1 -0
- package/dist/stage/chunk-RJ2R4FVC.js +1 -0
- package/dist/stage/chunk-RJH2YVTD.js +1 -0
- package/dist/stage/chunk-RLWWW5OB.js +6 -0
- package/dist/stage/chunk-S3WO35Z7.js +120 -0
- package/dist/stage/chunk-S7ZGX6MW.js +1 -0
- package/dist/stage/chunk-SIAWX27B.js +1 -0
- package/dist/stage/chunk-SLG4X622.js +1 -0
- package/dist/stage/chunk-SLJRBC77.js +168 -0
- package/dist/stage/chunk-SRORWQJZ.js +1 -0
- package/dist/stage/chunk-STZTUIIF.js +2 -0
- package/dist/stage/chunk-SVQ6MWNV.js +9 -0
- package/dist/stage/chunk-TL3HLL2S.js +132 -0
- package/dist/stage/chunk-U3DOE6SF.js +24 -0
- package/dist/stage/chunk-UABQIZKW.js +6 -0
- package/dist/stage/chunk-UDK3R764.js +1 -0
- package/dist/stage/chunk-UFF4E54B.js +41 -0
- package/dist/stage/chunk-UFP5Q4AY.js +1 -0
- package/dist/stage/chunk-UMH2TSW2.js +72 -0
- package/dist/stage/chunk-UTASVNF5.js +10 -0
- package/dist/stage/chunk-UW7ML5ML.js +88 -0
- package/dist/stage/chunk-V3J7F6OP.js +1 -0
- package/dist/stage/chunk-VEHP5B5Q.js +5 -0
- package/dist/stage/chunk-VRXWB733.js +9 -0
- package/dist/stage/chunk-VVDHBBS5.js +5 -0
- package/dist/stage/chunk-VYFOH6FU.js +106 -0
- package/dist/stage/chunk-W3VZTLQS.js +3 -0
- package/dist/stage/chunk-W7WNRWTZ.js +8 -0
- package/dist/stage/chunk-WHUCV53C.js +1 -0
- package/dist/stage/chunk-WULMYHIF.js +1 -0
- package/dist/stage/chunk-X54EX7AW.js +9 -0
- package/dist/stage/chunk-X565ISZM.js +1 -0
- package/dist/stage/chunk-XGZMDECB.js +1 -0
- package/dist/stage/chunk-XHONC4RF.js +172 -0
- package/dist/stage/chunk-XIK4XQ6E.js +24 -0
- package/dist/stage/chunk-XJQQWFTE.js +1 -0
- package/dist/stage/chunk-XM4WOU3I.js +13 -0
- package/dist/stage/chunk-XM7Y5HP5.js +38 -0
- package/dist/stage/chunk-XNYYRGD5.js +292 -0
- package/dist/stage/chunk-XOYVR3SV.js +1 -0
- package/dist/stage/chunk-XQIW5HCE.js +1 -0
- package/dist/stage/chunk-YEWL7FUW.js +8 -0
- package/dist/stage/chunk-YI55PY3V.js +1 -0
- package/dist/stage/chunk-YM63HI6W.js +1 -0
- package/dist/stage/chunk-YNLGLU4P.js +9 -0
- package/dist/stage/chunk-YTNMNOWP.js +1 -0
- package/dist/stage/chunk-YV62XKTC.js +1 -0
- package/dist/stage/chunk-YVBA3QW6.js +1 -0
- package/dist/stage/chunk-Z2SY2HOC.js +1 -0
- package/dist/stage/chunk-ZBTCQEBK.js +10 -0
- package/dist/stage/chunk-ZCUFN74D.js +1 -0
- package/dist/stage/chunk-ZHOULXEJ.js +11 -0
- package/dist/stage/chunk-ZTRZIET2.js +1 -0
- package/dist/stage/index.html +1 -0
- package/dist/stage/stage.css +1 -1
- package/dist/stage/stage.js +1 -4383
- package/dist/ui/dev/dev-page.d.ts +1 -0
- package/dist/ui/dev/dev-page.js +2248 -0
- package/dist/ui/dev/dev-theme.d.ts +6 -0
- package/dist/ui/dev/dev-theme.js +67 -0
- package/dist/ui/dev/qr-page.d.ts +8 -0
- package/dist/ui/dev/qr-page.js +61 -0
- package/dist/ui/dev/voice-gallery-page.d.ts +1 -0
- package/dist/ui/dev/voice-gallery-page.js +121 -0
- package/dist/ui/dev/voice-scenes.d.ts +21 -0
- package/dist/ui/dev/voice-scenes.js +30 -0
- package/dist/ui/dictation/en-box.d.ts +2 -0
- package/dist/ui/dictation/en-box.js +86 -0
- package/dist/ui/dictation/en-page.d.ts +1 -0
- package/dist/ui/dictation/en-page.js +484 -0
- package/dist/ui/dictation/page.d.ts +1 -0
- package/dist/ui/dictation/page.js +1084 -0
- package/dist/ui/dictation/parent-page.d.ts +1 -0
- package/dist/ui/dictation/parent-page.js +234 -0
- package/dist/ui/dictation/reel-mode.d.ts +1 -0
- package/dist/ui/dictation/reel-mode.js +87 -0
- package/dist/ui/dictation/reel-page.d.ts +1 -0
- package/dist/ui/dictation/reel-page.js +62 -0
- package/dist/ui/dictation/reel.d.ts +163 -0
- package/dist/ui/dictation/reel.js +436 -0
- package/dist/ui/dictation/ui.d.ts +44 -0
- package/dist/ui/dictation/ui.js +80 -0
- package/dist/ui/dictation/unlock.d.ts +7 -0
- package/dist/ui/dictation/unlock.js +16 -0
- package/dist/ui/kid/audio-client.d.ts +11 -0
- package/dist/ui/kid/audio-client.js +74 -0
- package/dist/ui/kid/board-mark-art.d.ts +37 -0
- package/dist/ui/kid/board-mark-art.js +5 -0
- package/dist/ui/kid/board-mark.d.ts +24 -0
- package/dist/ui/kid/board-mark.js +58 -0
- package/dist/ui/kid/kid-log.d.ts +15 -0
- package/dist/ui/kid/kid-log.js +87 -0
- package/dist/ui/kid/kid-nav.d.ts +11 -0
- package/dist/ui/kid/kid-nav.js +22 -0
- package/dist/ui/kid/kid-page.d.ts +9 -0
- package/dist/ui/kid/kid-page.js +3719 -0
- package/dist/ui/kid/letters.d.ts +26 -0
- package/dist/ui/kid/letters.js +51 -0
- package/dist/ui/kid/photo-edit.d.ts +83 -0
- package/dist/ui/kid/photo-edit.js +106 -0
- package/dist/ui/kid/photo-ui.d.ts +23 -0
- package/dist/ui/kid/photo-ui.js +60 -0
- package/dist/ui/kid/reel.d.ts +419 -0
- package/dist/ui/kid/reel.js +648 -0
- package/dist/ui/kid/tianzige.d.ts +8 -0
- package/dist/ui/kid/tianzige.js +45 -0
- package/dist/ui/kid/tutor-face.d.ts +35 -0
- package/dist/ui/kid/tutor-face.js +84 -0
- package/dist/ui/kid/voice-ui.d.ts +70 -0
- package/dist/ui/kid/voice-ui.js +316 -0
- package/dist/ui/kid/voice-view.d.ts +71 -0
- package/dist/ui/kid/voice-view.js +75 -0
- package/dist/ui/kid/word-draw.d.ts +2 -0
- package/dist/ui/kid/word-draw.js +107 -0
- package/dist/ui/kid/word-emoji.d.ts +10 -0
- package/dist/ui/kid/word-emoji.js +66 -0
- package/dist/ui/kid/word-layout.d.ts +25 -0
- package/dist/ui/kid/word-layout.js +29 -0
- package/dist/ui/parent/parent-home-page.d.ts +1 -0
- package/dist/ui/parent/parent-home-page.js +414 -0
- package/dist/ui/parent/parent-page.d.ts +2 -0
- package/dist/ui/parent/parent-page.js +507 -0
- package/dist/ui/shared/brand.d.ts +36 -0
- package/dist/ui/shared/brand.js +51 -0
- package/dist/ui/shared/favicon.d.ts +12 -0
- package/dist/ui/shared/favicon.js +96 -0
- package/dist/ui/shared/icon.d.ts +9 -0
- package/dist/ui/shared/icon.js +35 -0
- package/dist/ui/shared/inline-lib.d.ts +1 -0
- package/dist/ui/shared/inline-lib.js +28 -0
- package/dist/ui/shared/logo.d.ts +31 -0
- package/dist/ui/shared/logo.js +43 -0
- package/dist/ui/shared/page-dom.d.ts +12 -0
- package/dist/ui/shared/page-dom.js +36 -0
- package/dist/ui/shared/png.d.ts +1 -0
- package/dist/ui/shared/png.js +45 -0
- package/dist/ui/shared/qr-svg.d.ts +3 -0
- package/dist/ui/shared/qr-svg.js +32 -0
- package/dist/ui/shared/qr.d.ts +14 -0
- package/dist/ui/shared/qr.js +281 -0
- package/dist/ui/shared/reel-dock.d.ts +22 -0
- package/dist/ui/shared/reel-dock.js +365 -0
- package/dist/ui/shared/tutor-color.d.ts +15 -0
- package/dist/ui/shared/tutor-color.js +47 -0
- package/dist/ui/talk/page.d.ts +6 -0
- package/dist/ui/talk/page.js +294 -0
- package/grades/grade-2/README.md +11 -0
- package/grades/grade-2/VALIDATION.md +41 -0
- package/grades/grade-2/agents/chinese-tutor/activities//344/275/240/350/257/264/346/210/221/347/224/273.md +157 -0
- package/grades/grade-2/agents/chinese-tutor/activities//344/275/240/350/257/264/346/210/221/347/224/273./344/276/213/345/255/220.md +78 -0
- package/grades/grade-2/agents/chinese-tutor/activities//344/276/213/345/255/220/345/233/276//345/200/237/344/274/236.jpg +0 -0
- package/grades/grade-2/agents/chinese-tutor/activities//344/276/213/345/255/220/345/233/276//345/260/217/347/214/264/346/221/230/346/241/203.jpg +0 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/206/231/350/257/235.md +64 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/206/231/350/257/235./344/276/213/345/255/220.md +31 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/220/254/345/206/231.md +48 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/244/215/344/271/240.md +79 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/244/215/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/chinese-tutor/activities//345/260/217/350/257/276/345/240/202.md +53 -0
- package/grades/grade-2/agents/chinese-tutor/activities//346/211/271/346/224/271.md +81 -0
- package/grades/grade-2/agents/chinese-tutor/activities//346/211/271/346/224/271./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/chinese-tutor/activities//347/234/213/345/233/276/350/257/264/350/257/235.md +94 -0
- package/grades/grade-2/agents/chinese-tutor/activities//347/234/213/345/233/276/350/257/264/350/257/235./344/276/213/345/255/220.md +63 -0
- package/grades/grade-2/agents/chinese-tutor/activities//351/242/204/344/271/240.md +82 -0
- package/grades/grade-2/agents/chinese-tutor/activities//351/242/204/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/chinese-tutor.md +59 -0
- package/grades/grade-2/agents/english-tutor/activities//345/217/243/350/257/255/350/257/276.md +149 -0
- package/grades/grade-2/agents/english-tutor/activities//345/217/243/350/257/255/350/257/276./344/276/213/345/255/220.md +13 -0
- package/grades/grade-2/agents/english-tutor/activities//345/220/254/345/206/231.md +47 -0
- package/grades/grade-2/agents/english-tutor/activities//345/244/215/344/271/240.md +78 -0
- package/grades/grade-2/agents/english-tutor/activities//345/244/215/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/english-tutor/activities//345/260/217/350/257/276/345/240/202.md +53 -0
- package/grades/grade-2/agents/english-tutor/activities//346/211/271/346/224/271.md +80 -0
- package/grades/grade-2/agents/english-tutor/activities//346/211/271/346/224/271./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/english-tutor/activities//351/242/204/344/271/240.md +86 -0
- package/grades/grade-2/agents/english-tutor/activities//351/242/204/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/english-tutor.md +57 -0
- package/grades/grade-2/agents/math-tutor/activities//345/244/215/344/271/240.md +78 -0
- package/grades/grade-2/agents/math-tutor/activities//345/244/215/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/math-tutor/activities//345/260/217/350/257/276/345/240/202.md +56 -0
- package/grades/grade-2/agents/math-tutor/activities//345/260/217/350/257/276/345/240/202./344/276/213/345/255/220.md +52 -0
- package/grades/grade-2/agents/math-tutor/activities//346/211/271/346/224/271.md +80 -0
- package/grades/grade-2/agents/math-tutor/activities//346/211/271/346/224/271./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/math-tutor/activities//351/242/204/344/271/240.md +81 -0
- package/grades/grade-2/agents/math-tutor/activities//351/242/204/344/271/240./344/276/213/345/255/220.md +35 -0
- package/grades/grade-2/agents/math-tutor.md +51 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/index.json +44 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/step-1.mp3 +0 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/step-2.mp3 +0 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/step-3.mp3 +0 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/step-4.mp3 +0 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/audio/step-5.mp3 +0 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/bake.json +1 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/manifest.json +63 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen/scene.json +247 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen.md +40 -0
- package/grades/grade-2/examples/2026-10-27-pingjunfen.ts +26 -0
- package/grades/grade-2/examples//345/271/263/345/235/207/345/210/206./344/276/213/345/255/220.md +24 -0
- package/grades/grade-2/examples//346/225/260/345/255/246/345/271/263/345/235/207/345/210/206.md +42 -0
- package/grades/grade-2/validation/2026-10-27.json +4410 -0
- package/package.json +26 -15
- package/skills/chalk-cli/SKILL.md +62 -0
- package/skills/chalk-scene/SKILL.md +91 -0
- package/skills/chalk-teaching/SKILL.md +82 -0
- package/skills/chalk-teaching/models//344/272/244/351/224/231/346/225/260/345/210/227/345/210/206/350/241/214.md +8 -0
- package/skills/chalk-teaching/models//345/207/221/345/215/201.md +7 -0
- package/skills/chalk-teaching/models//345/221/250/346/234/237/350/247/204/345/276/213.md +6 -0
- package/skills/chalk-teaching/models//345/256/236/347/211/251/345/233/276-/345/242/236/345/207/217.md +6 -0
- package/skills/chalk-teaching/models//345/256/236/347/211/251/345/233/276-/346/257/224/345/244/232/345/260/221-/346/261/202/345/244/247/346/225/260/346/261/202/345/260/217/346/225/260.md +7 -0
- package/skills/chalk-teaching/models//345/256/236/347/211/251/345/233/276-/346/257/224/345/244/232/345/260/221-/346/261/202/345/267/256.md +6 -0
- package/skills/chalk-teaching/models//345/260/217/346/243/222/350/277/233/344/275/215/345/212/240.md +7 -0
- package/skills/chalk-teaching/models//345/260/217/346/243/222/351/200/200/344/275/215/345/207/217.md +6 -0
- package/skills/chalk-teaching/models//346/216/222/351/230/237/347/202/271/351/230/265.md +7 -0
- package/skills/chalk-teaching/models//346/227/266/351/227/264/346/225/260/350/275/264.md +6 -0
- package/skills/chalk-teaching/models//346/245/274/345/261/202/351/227/264/351/232/224/345/233/276.md +7 -0
- package/skills/chalk-teaching/models//347/240/264/345/215/201.md +7 -0
- package/skills/chalk-teaching/models//347/253/226/345/274/217/351/200/200/344/275/215.md +6 -0
- package/skills/chalk-teaching/models//347/272/277/346/256/265/345/233/276.md +7 -0
- package/skills/chalk-teaching/models-index.md +24 -0
- package/skills/chalk-teaching/references//350/256/262/350/247/243/346/250/241/346/235/277/344/270/211/346/241/243.md +32 -0
- package/skills/chalk-teaching/references//350/257/264/346/230/216/346/226/207/344/273/266.md +102 -0
- package/skills/chalk-verify/SKILL.md +57 -0
- package/skills/chalk-verify/references//350/257/204/345/210/244/346/240/207/345/207/206.md +69 -0
- package/skills/cotutor-analyze/SKILL.md +106 -0
- package/skills/cotutor-analyze/references//345/221/275/344/273/244/344/270/216/346/226/207/344/273/266.md +31 -0
- package/skills/cotutor-board/SKILL.md +373 -0
- package/skills/cotutor-board/references/README.md +38 -0
- package/skills/cotutor-board/references/canvas.md +68 -0
- package/skills/cotutor-board/references/choice.md +55 -0
- package/skills/cotutor-board/references/code.md +46 -0
- package/skills/cotutor-board/references/image.md +52 -0
- package/skills/cotutor-board/references/lecture.md +69 -0
- package/skills/cotutor-board/references/paint.md +77 -0
- package/skills/cotutor-board/references/photo.md +61 -0
- package/skills/cotutor-board/references/read.md +51 -0
- package/skills/cotutor-board/references/text.md +69 -0
- package/skills/cotutor-board/references/tianzige.md +78 -0
- package/skills/cotutor-board/references/word.md +91 -0
- package/skills/cotutor-home/SKILL.md +169 -0
- package/skills/cotutor-home/references/dictation.md +97 -0
- package/skills/cotutor-home/references/tutor.md +148 -0
- package/skills/cotutor-home/references//345/221/275/344/273/244.md +21 -0
- package/skills/cotutor-home/references//351/246/226/351/241/265/350/257/255/346/263/225.md +142 -0
- package/skills/cotutor-tune/SKILL.md +147 -0
- package/skills/cotutor-tune/references//345/255/227/346/256/265.md +50 -0
- package/skills/cotutor-tutor/SKILL.md +261 -0
- package/skills/cotutor-tutor/references//344/270/212/344/270/213/346/226/207/345/214/205.md +78 -0
- package/themes/default/kid.css +86 -0
- package/themes/default/theme.json +26 -0
- package/agents/chinese-tutor.md +0 -67
- package/agents/homework-tutor.md +0 -17
- package/agents/math-tutor.md +0 -68
- package/agents/planner.md +0 -18
- package/agents/reading-tutor.md +0 -65
- package/agents/scene-maker.md +0 -41
- package/dist/cards/canvas.d.ts +0 -22
- package/dist/cards/canvas.js +0 -65
- package/dist/cards/fill.d.ts +0 -14
- package/dist/cards/fill.js +0 -64
- package/dist/cards/index.d.ts +0 -48
- package/dist/cards/index.js +0 -115
- package/dist/cards/kind.js +0 -7
- package/dist/cards/scene.d.ts +0 -24
- package/dist/cards/scene.js +0 -67
- package/dist/cards/text.d.ts +0 -18
- package/dist/cards/text.js +0 -41
- package/dist/cli/doctor.js +0 -355
- package/dist/cli/init.js +0 -116
- package/dist/cli/main.js +0 -243
- package/dist/cli/serve.js +0 -56
- package/dist/cli/skeleton.d.ts +0 -39
- package/dist/cli/skeleton.js +0 -184
- package/dist/cli/skills.d.ts +0 -40
- package/dist/cli/skills.js +0 -170
- package/dist/cli/workspace.d.ts +0 -69
- package/dist/lib/agent-file.d.ts +0 -10
- package/dist/lib/agent-file.js +0 -16
- package/dist/lib/board.d.ts +0 -15
- package/dist/lib/board.js +0 -107
- package/dist/lib/context-pack.js +0 -55
- package/dist/lib/conversation.js +0 -88
- package/dist/lib/kid-board.d.ts +0 -148
- package/dist/lib/kid-board.js +0 -294
- package/dist/lib/kid-view.d.ts +0 -63
- package/dist/lib/kid-view.js +0 -93
- package/dist/lib/ledger.d.ts +0 -29
- package/dist/lib/run-plan.d.ts +0 -30
- package/dist/lib/run-plan.js +0 -32
- package/dist/lib/sections.d.ts +0 -12
- package/dist/lib/sections.js +0 -151
- package/dist/lib/stream.d.ts +0 -15
- package/dist/lib/stream.js +0 -69
- package/dist/lib/transcript.d.ts +0 -36
- package/dist/lib/transcript.js +0 -95
- package/dist/server/app.d.ts +0 -74
- package/dist/server/app.js +0 -406
- package/dist/server/kid-page.d.ts +0 -1
- package/dist/server/kid-page.js +0 -768
- package/dist/server/mock.js +0 -403
- package/dist/server/parent-page.d.ts +0 -8
- package/dist/server/parent-page.js +0 -393
- package/dist/server/runner.d.ts +0 -64
- package/dist/server/runner.js +0 -277
- package/dist/server/scene-props.d.ts +0 -16
- package/dist/server/scene-props.js +0 -39
- package/dist/server/store.d.ts +0 -43
- package/dist/server/store.js +0 -210
- package/dist/server/tts.d.ts +0 -51
- package/dist/server/tts.js +0 -99
- /package/dist/{cli → app/cli}/cert.d.ts +0 -0
- /package/dist/{cli → app/cli}/main.d.ts +0 -0
- /package/dist/{cards → board/cards}/choice.d.ts +0 -0
- /package/dist/{cards → board/cards}/code.d.ts +0 -0
- /package/dist/{cards → board/cards}/image.d.ts +0 -0
- /package/dist/{cards → board/cards}/read.d.ts +0 -0
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 英文单词听写(/dictation?lang=en):老师念一个单词(念两遍),孩子在四线三格里写整个单词;
|
|
3
|
+
* 不会写点「给答案」,单词灰灰地打底,照着描一遍;全写完交卷,正确的单词淡淡叠在他写的上面,自己对——不逐字母比、不问「再写一遍?」,
|
|
4
|
+
* 想再写自己点。从首页英语老师卡上的「单词听写」进来(?home=&n=),或者「拍照听写」(?tutor=&lang=en,拍课本认单词)。
|
|
5
|
+
* 接口和汉字的一样(src/app/dictation/route.ts),会话带 lang = en、一个单词一格;笔迹的点记在 2048 × 512 的尺子上(en-box.ts)。
|
|
6
|
+
* 孩子端:没有对错、没有分数、没有报错的字。用 String.raw:脚本里不写反斜杠转义与反引号。
|
|
7
|
+
*/
|
|
8
|
+
import { LAYER_X, TUTOR_FACE_CSS, TUTOR_FACE_JS } from "../kid/tutor-face.js";
|
|
9
|
+
import { KID_NAV_JS } from "../kid/kid-nav.js";
|
|
10
|
+
import { KID_LOG_JS } from "../kid/kid-log.js";
|
|
11
|
+
import { EN_BOX_CSS, EN_BOX_JS } from "./en-box.js";
|
|
12
|
+
import { UNLOCK_JS } from "./unlock.js";
|
|
13
|
+
import { REEL_MODE_JS } from "./reel-mode.js";
|
|
14
|
+
import { SNAP_CSS, snapHtml } from "../kid/photo-ui.js";
|
|
15
|
+
import { faviconLinks } from "../shared/favicon.js";
|
|
16
|
+
import { BTN_CSS, BTN_JS, btn } from "./ui.js";
|
|
17
|
+
export const DICTATION_EN_PAGE = String.raw `<!doctype html>
|
|
18
|
+
<html lang="zh-CN"><head><meta charset="utf-8">
|
|
19
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover,user-scalable=no">
|
|
20
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
21
|
+
${faviconLinks()}
|
|
22
|
+
<title>单词听写</title>
|
|
23
|
+
<style>
|
|
24
|
+
:root { --ink:#2b2b2b; --dim:#66625b; --line:#e2dfd6; --paper:#faf9f4; --card:#ffffff; --accent:#e8743b;
|
|
25
|
+
/* 学科色:这次听写那位老师的颜色,页面读到老师后换(缺省英语绿);按钮、气泡、当前那格都跟它 */
|
|
26
|
+
--sc:#1f8a4c; --green:var(--sc); --tutor:color-mix(in srgb, var(--sc) 10%, #fff); --tutor-line:color-mix(in srgb, var(--sc) 32%, #fff); --tutor-ink:color-mix(in srgb, var(--sc) 62%, #000); --tutor-ink2:color-mix(in srgb, var(--sc) 78%, #000); }
|
|
27
|
+
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
|
|
28
|
+
[hidden] { display:none !important; }
|
|
29
|
+
html,body { margin:0; min-height:100%; background:var(--paper); color:var(--ink); font:17px/1.5 -apple-system,"PingFang SC","Hiragino Sans GB",sans-serif; overscroll-behavior:none; -webkit-user-select:none; user-select:none; }
|
|
30
|
+
button, input { font:inherit; color:inherit; }
|
|
31
|
+
button { cursor:pointer; }
|
|
32
|
+
.view { display:none; flex-direction:column; gap:18px; max-width:1000px; margin:0 auto; padding:calc(env(safe-area-inset-top) + 10px) 20px calc(env(safe-area-inset-bottom) + 28px); }
|
|
33
|
+
.view.on { display:flex; }
|
|
34
|
+
.bar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
|
|
35
|
+
/* 按钮两页同一份(ui.ts) */
|
|
36
|
+
${BTN_CSS}
|
|
37
|
+
.ttl { font-size:22px; font-weight:700; }
|
|
38
|
+
/* 写字屏:不限 1000 宽,四线格占满宽度(高度不够时按 16 : 7 收窄);听写本横排,一个单词一小条 */
|
|
39
|
+
#v-write { max-width:none; gap:12px; height:100vh; height:100dvh; padding-bottom:calc(env(safe-area-inset-bottom) + 16px); }
|
|
40
|
+
.wtop { flex-wrap:wrap; row-gap:8px; }
|
|
41
|
+
.wbook { flex:1; min-width:0; height:56px; box-sizing:border-box; display:flex; align-items:center; gap:8px; padding:0 10px; background:#fff; border:1px solid var(--line); border-radius:18px; overflow-x:auto; }
|
|
42
|
+
.wbook > b { flex:none; font-size:16px; padding-right:4px; }
|
|
43
|
+
.wbook .bk { flex:none; display:flex; flex-direction:column; align-items:center; gap:2px; }
|
|
44
|
+
.wbook .bk svg { width:92px; height:auto; aspect-ratio:16 / 7; display:block; background:#fff; border:1.5px solid var(--line); border-radius:6px; }
|
|
45
|
+
.wbook .bk .enl line { stroke-width:12; }
|
|
46
|
+
.wbook .bk .eni path { stroke-width:40; }
|
|
47
|
+
.wbook .bk.c svg { border-color:var(--tutor-line); box-shadow:0 0 0 3px var(--tutor-line); }
|
|
48
|
+
.wbook .bk.a { opacity:.55; }
|
|
49
|
+
.wbook .bk small { display:none; }
|
|
50
|
+
.wsay { flex:none; height:56px; box-sizing:border-box; padding:0 6px 0 14px; gap:10px; border-radius:28px; align-self:auto; }
|
|
51
|
+
.wsay svg { width:22px; height:22px; flex:none; color:var(--tutor-ink); }
|
|
52
|
+
.wsay b { font-size:16px; } .wsay small { font-size:13px; min-height:0; }
|
|
53
|
+
.wsay .tool { min-height:44px; padding:0 16px; border-color:var(--tutor-line); }
|
|
54
|
+
#v-write .model { flex:1; min-width:0; height:56px; display:flex; align-items:center; padding-left:6px; }
|
|
55
|
+
#v-write .model .enm { height:56px; width:auto; max-width:100%; display:block; }
|
|
56
|
+
/* 格子铺满剩下的高;看得到尺子的哪一段由 fitPad 按格子大小定 */
|
|
57
|
+
#v-write .pad { flex:1 1 0; min-height:0; width:100%; height:auto; aspect-ratio:auto; margin:auto 0; }
|
|
58
|
+
.wtools { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
|
|
59
|
+
.wtools .tools { justify-content:flex-start; }
|
|
60
|
+
.wtools .main { margin-left:auto; }
|
|
61
|
+
.bubble { display:flex; align-items:center; gap:14px; padding:14px 22px; background:var(--tutor); border-radius:22px; border-top-left-radius:6px; align-self:flex-start; }
|
|
62
|
+
.bubble b { display:block; font-size:22px; color:var(--tutor-ink); }
|
|
63
|
+
.bubble small { display:block; font-size:15px; color:var(--tutor-ink2); min-height:22px; }
|
|
64
|
+
.pad { width:100%; aspect-ratio:16 / 7; background:#fff; border:2px solid var(--line); border-radius:18px; touch-action:none; display:block; }
|
|
65
|
+
.tools { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
|
|
66
|
+
.center { display:flex; flex-direction:column; align-items:center; gap:18px; padding-top:40px; text-align:center; }
|
|
67
|
+
.center b { font-size:28px; }
|
|
68
|
+
.center span { color:var(--dim); }
|
|
69
|
+
/* 对一对:不限 1000 宽,一行两格(窄了一格);格子上下留白后变高,一列只看得到一个半 */
|
|
70
|
+
#v-check { max-width:none; }
|
|
71
|
+
.rows { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap:14px; }
|
|
72
|
+
.row { background:#fff; border:1.5px solid var(--line); border-radius:18px; padding:12px; display:flex; flex-direction:column; gap:8px; }
|
|
73
|
+
.row svg { width:100%; aspect-ratio:16 / 7; display:block; }
|
|
74
|
+
.row .ft { display:flex; align-items:center; justify-content:space-between; gap:10px; }
|
|
75
|
+
.row .ft small { color:var(--dim); font-size:14px; margin-right:auto; }
|
|
76
|
+
.row .ft .em { font-size:30px; line-height:1; }
|
|
77
|
+
.chips { display:flex; flex-wrap:wrap; gap:8px; }
|
|
78
|
+
.chip { min-height:44px; padding:0 16px; border-radius:22px; border:1.5px solid var(--line); background:#fff; font-size:18px; }
|
|
79
|
+
.chip.on { background:var(--tutor); border-color:var(--tutor-line); color:var(--tutor-ink); font-weight:600; }
|
|
80
|
+
.add { display:flex; gap:8px; }
|
|
81
|
+
.add input { flex:1; min-width:0; min-height:48px; padding:0 14px; border-radius:14px; border:1.5px solid var(--line); font-size:18px; -webkit-user-select:text; user-select:text; }
|
|
82
|
+
.tool svg { width:22px; height:22px; flex:none; }
|
|
83
|
+
/* 拍照屏同语文页(photo-ui.ts):中间老师的大头像、用途图、拍照 / 相册 */
|
|
84
|
+
#v-snap { max-width:none; height:100vh; height:100dvh; padding-bottom:calc(env(safe-area-inset-bottom) + 16px); }
|
|
85
|
+
${SNAP_CSS}
|
|
86
|
+
/* 选词屏同语文页:照片在左(框画在照片上,点框同点词),要写的单词在右,按钮在右下;竖着照片在上 */
|
|
87
|
+
#p-list { flex:1; min-height:0; display:flex; gap:20px; }
|
|
88
|
+
.shotwrap { flex:1; min-width:0; min-height:0; display:flex; align-items:center; justify-content:center; padding-top:48px; }
|
|
89
|
+
.shotin { position:relative; display:inline-block; max-width:100%; border-radius:12px; overflow:hidden; background:#2b2b2b; }
|
|
90
|
+
.shotin img { display:block; max-width:100%; max-height:calc(100vh - 100px); max-height:calc(100dvh - 100px); }
|
|
91
|
+
.pside { width:340px; flex:none; min-height:0; display:flex; flex-direction:column; gap:12px; }
|
|
92
|
+
.pscroll { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:12px; }
|
|
93
|
+
.pgo { display:flex; gap:10px; }
|
|
94
|
+
.pgo .main { flex:1; padding:0 16px; }
|
|
95
|
+
@media (orientation: portrait) {
|
|
96
|
+
#p-list { flex-direction:column; }
|
|
97
|
+
.shotwrap { flex:none; }
|
|
98
|
+
.shotin img { max-height:40vh; }
|
|
99
|
+
.pside { width:auto; flex:1; }
|
|
100
|
+
}
|
|
101
|
+
.ebx { position:absolute; border-radius:6px; border:3px dashed rgba(120,115,105,.85); background:transparent; padding:0; cursor:pointer; }
|
|
102
|
+
.ebx.on { border-style:solid; border-color:var(--green); background:color-mix(in srgb, var(--sc) 16%, transparent); }
|
|
103
|
+
.ebx.unsure.on { border-color:var(--accent); background:rgba(232,116,59,.18); }
|
|
104
|
+
.pgo { display:flex; justify-content:center; gap:12px; }
|
|
105
|
+
.muted { color:var(--dim); font-size:15px; }
|
|
106
|
+
#toast { position:fixed; left:50%; bottom:calc(env(safe-area-inset-bottom) + 24px); transform:translateX(-50%); padding:12px 18px; border-radius:16px; background:#2b2b2bee; color:#fff; font-size:16px; display:none; z-index:9; }
|
|
107
|
+
#toast.on { display:block; }
|
|
108
|
+
${EN_BOX_CSS}
|
|
109
|
+
${TUTOR_FACE_CSS}
|
|
110
|
+
</style></head><body>
|
|
111
|
+
<div class="view" id="v-start">
|
|
112
|
+
<div class="bar"><span class="bk-slot"></span></div>
|
|
113
|
+
<div class="center"><b id="s-title">单词听写</b><span id="s-sub">老师念,你来写</span>${btn('main', 'start', '开始', 'id="s-go"')}</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="view" id="v-snap">
|
|
116
|
+
${snapHtml({ kind: 'en', id: 'p-pick', cam: 'p-cam', lib: 'p-lib' })}
|
|
117
|
+
<div id="p-list" hidden>
|
|
118
|
+
<div class="shotwrap"><div class="shotin"><img id="p-img" alt="拍的照片"><div id="p-boxes"></div></div></div>
|
|
119
|
+
<div class="pside">
|
|
120
|
+
<div><div class="ttl" id="p-lesson">认一认</div><div class="muted" id="p-status">正在看照片…</div></div>
|
|
121
|
+
<div class="pscroll">
|
|
122
|
+
<div class="chips" id="p-chips"></div>
|
|
123
|
+
<div class="muted">照片上还有这些,点一下加进来:</div>
|
|
124
|
+
<div class="chips" id="p-more"></div>
|
|
125
|
+
<div class="add"><input id="p-add" placeholder="自己加单词,空格分开" autocomplete="off" autocapitalize="off" spellcheck="false">${btn('tool', 'add', '加', 'id="p-add-go"')}</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="pgo">${btn('tool', 'camera', '重拍', 'id="p-again"')}${btn('main', 'start', '开始听写', 'id="p-go" disabled')}</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="view" id="v-write">
|
|
132
|
+
<!-- 写字(iPad 实拍后放大):胶囊、听写本、气泡与再念并成一行,格子铺满中间,按钮一行 -->
|
|
133
|
+
<div class="bar wtop"><span class="bk-slot"></span><div class="wbook" id="w-book"></div><div class="model" id="w-model" hidden></div>
|
|
134
|
+
<div class="bubble wsay"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5L6 9H3v6h3l5 4V5z"></path><path d="M15.5 8.5a5 5 0 0 1 0 7"></path></svg><div><b id="w-who">老师在念</b><small id="w-status"></small></div>${btn('tool', 'again', '再念', 'id="w-again"')}</div>
|
|
135
|
+
<button class="layer-x" type="button" id="w-x" aria-label="回到对一对" hidden>${LAYER_X}</button></div>
|
|
136
|
+
<svg class="pad" id="w-pad" viewBox="0 -192 2048 896"></svg>
|
|
137
|
+
<div class="wtools">
|
|
138
|
+
<div class="tools">
|
|
139
|
+
${btn('tool', 'undo', '撤销', 'id="w-undo"')}
|
|
140
|
+
${btn('tool', 'clear', '擦掉', 'id="w-clear"')}
|
|
141
|
+
${btn('tool reveal', 'reveal', '不会写,给答案', 'id="w-reveal"')}
|
|
142
|
+
</div>
|
|
143
|
+
${btn('main', 'done', '写好了', 'id="w-done"')}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="view" id="v-check">
|
|
147
|
+
<div class="bar"><span class="bk-slot"></span><span class="ttl">对一对</span>${btn('tool', 'overlay', '拿开蓝字', 'id="c-hide"')}</div>
|
|
148
|
+
<div class="muted">蓝色的是书上的单词,看看你写的一样不一样。想再写哪个就点「再写一遍」。</div>
|
|
149
|
+
<div class="rows" id="c-rows"></div>
|
|
150
|
+
<div style="display:flex;justify-content:center">${btn('main', 'done', '对好了', 'id="c-done"')}</div>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="view" id="v-submit">
|
|
153
|
+
<div class="bar"><span class="bk-slot"></span></div>
|
|
154
|
+
<div class="center"><b>都写完了</b><span>交上去,看看书上的单词</span>${btn('main', 'send', '交上去', 'id="u-go"')}</div>
|
|
155
|
+
</div>
|
|
156
|
+
<div id="toast"></div>
|
|
157
|
+
<script>
|
|
158
|
+
// 孩子端的流水(kid-log.ts):最先装上出错的监听
|
|
159
|
+
${KID_LOG_JS}
|
|
160
|
+
(function () {
|
|
161
|
+
'use strict';
|
|
162
|
+
var $ = function (s) { return document.querySelector(s); };
|
|
163
|
+
var NS = 'http://www.w3.org/2000/svg';
|
|
164
|
+
var sv = function (tag, attrs) { var el = document.createElementNS(NS, tag); for (var k in (attrs || {})) el.setAttribute(k, String(attrs[k])); return el; };
|
|
165
|
+
var h = function (tag, attrs) { var el = document.createElement(tag); attrs = attrs || {}; for (var k in attrs) { if (k === 'on') { for (var ev in attrs.on) el.addEventListener(ev, attrs.on[ev]); } else if (k === 'text') el.textContent = attrs[k]; else if (attrs[k] !== null && attrs[k] !== undefined) el.setAttribute(k, attrs[k]); } for (var i = 2; i < arguments.length; i++) if (arguments[i]) el.append(arguments[i]); return el; };
|
|
166
|
+
${BTN_JS}
|
|
167
|
+
var api = function (method, path, body) { return fetch(path, { method: method, headers: body ? { 'content-type': 'application/json' } : {}, body: body ? JSON.stringify(body) : undefined }).then(function (r) { if (!r.ok) throw new Error(String(r.status)); return r.json(); }); };
|
|
168
|
+
var toastTimer = 0;
|
|
169
|
+
var toast = function (t) { var el = $('#toast'); el.textContent = t; el.classList.add('on'); clearTimeout(toastTimer); toastTimer = setTimeout(function () { el.classList.remove('on'); }, 2600); };
|
|
170
|
+
${EN_BOX_JS}
|
|
171
|
+
var pathD = function (pts) { var d = 'M' + pts[0][0] + ' ' + pts[0][1]; if (pts.length === 1) d += ' L' + (pts[0][0] + 1) + ' ' + pts[0][1]; for (var i = 1; i < pts.length; i++) d += ' L' + pts[i][0] + ' ' + pts[i][1]; return d; };
|
|
172
|
+
|
|
173
|
+
var q = new URLSearchParams(location.search);
|
|
174
|
+
var HOME = q.get('home'); var N = Number(q.get('n') || 0); var TUTOR = q.get('tutor');
|
|
175
|
+
/** 家长看录像时,这一页开在录像外壳的 iframe 里:只照记录画,不发事件、不念、点不动 */
|
|
176
|
+
var REEL_ID = q.get('reel');
|
|
177
|
+
// 录像里只记出错,不报打开
|
|
178
|
+
kidLog.start({ page: 'dictation-en', mode: REEL_ID ? 'reel' : 'kid', ctx: function () { return { tutor: TUTOR || null }; } });
|
|
179
|
+
var S = { v: null, base: Date.now(), i: 0, strokes: [], undos: 0, gone: [], revealed: false, word: null, sawPen: false, mode: 'first', hide: false, tok: 0, timer: 0 };
|
|
180
|
+
var now = function () { return Math.max(0, Date.now() - S.base); };
|
|
181
|
+
var setView = function (v) { var fresh = !S.v || S.v.id !== v.id; S.v = v; S.base = Date.parse(v.startedAt) || S.base; showFace(); if (fresh) { S.vw = 0; sendView(); } };
|
|
182
|
+
var show = function (name) { var vs = document.querySelectorAll('.view'); for (var i = 0; i < vs.length; i++) vs[i].classList.toggle('on', vs[i].id === 'v-' + name); BACK.el.hidden = name === 'write' && S.mode === 'rewrite'; if (name === 'write') fitPad(); window.scrollTo(0, 0); if (!REEL_ID) guard(); };
|
|
183
|
+
var event = function (kind, word, n, more) {
|
|
184
|
+
if (!S.v || REEL_ID) return;
|
|
185
|
+
var b = { kind: kind, word: word, t: now() }; if (n) b.n = n; if (more) { b.w = more.w; b.h = more.h; }
|
|
186
|
+
if (kind !== 'show' && kind !== 'say' && kind !== 'again' && kind !== 'self' && kind !== 'rewrite' && kind !== 'view' && kind !== 'away' && kind !== 'back') b.char = 0;
|
|
187
|
+
try { fetch('/api/dictation/' + S.v.id + '/events', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(b), keepalive: true }).catch(function () {}); } catch (e) {}
|
|
188
|
+
};
|
|
189
|
+
/** 录像要的:屏幕多大(进来、转屏,停手 300 毫秒,变了才记)、切到别处 / 回来;擦掉的笔连同擦的时刻 */
|
|
190
|
+
var viewTimer = 0;
|
|
191
|
+
var sendView = function () { if (!S.v || S.v.done) return; var w = window.innerWidth, hh = window.innerHeight; if (w === S.vw && hh === S.vh) return; S.vw = w; S.vh = hh; event('view', S.i || 0, 0, { w: w, h: hh }); };
|
|
192
|
+
window.addEventListener('resize', function () { clearTimeout(viewTimer); viewTimer = setTimeout(sendView, 300); });
|
|
193
|
+
document.addEventListener('visibilitychange', function () { if (S.v && !S.v.done) event(document.hidden ? 'away' : 'back', S.i || 0); });
|
|
194
|
+
var drop = function (pts) { if (S.gone.length < 200) S.gone.push({ t: now(), pts: pts }); };
|
|
195
|
+
// 孩子端不往浏览器历史里加东西(kid-nav.ts):回首页是替换当前页
|
|
196
|
+
${KID_NAV_JS}
|
|
197
|
+
var goHome = function () { stopSay(); kidGo('/'); };
|
|
198
|
+
// ---- 左上角「‹ logo」胶囊,同老师页;再写一遍是叠在对一对上的一层,右上角 × 回去 ----
|
|
199
|
+
${TUTOR_FACE_JS}
|
|
200
|
+
// 胶囊带上念的老师:服务端出页面时就按 ?tutor= 或首页那张卡的 reader 插进来(BACK_TUTOR),打开就是他的颜色和首字,不先浅底再变色;一位能念的老师都没有才是 null
|
|
201
|
+
var BACK_TUTOR = __BACK_TUTOR__;
|
|
202
|
+
var BACK = backCapsule(goHome); BACK.set(BACK_TUTOR); document.body.append(BACK.el);
|
|
203
|
+
var TUTORS = null;
|
|
204
|
+
var showFace = function () { var name = (S.v && S.v.tutorName) || TUTOR; if (!TUTORS || !name) return; var t = TUTORS.filter(function (x) { return x.name === name; })[0] || null; if (t) BACK.set(t); $('#snap-av').replaceChildren(t ? tutorAvatar(t) : ''); if (t && t.color) document.documentElement.style.setProperty('--sc', t.color); };
|
|
205
|
+
|
|
206
|
+
// ---------- 念:配了音色放音频;没有音色、合成失败直接提示叫家长,不念浏览器合成声 ----------
|
|
207
|
+
var audio = new Audio(); audio.preload = 'auto';
|
|
208
|
+
${UNLOCK_JS}
|
|
209
|
+
var stopSay = function () { clearTimeout(S.timer); S.tok++; try { audio.pause(); } catch (e) {} };
|
|
210
|
+
var NO_VOICE = '老师的声音还没配好 · 叫爸爸妈妈来看一下';
|
|
211
|
+
var status = function (t) { $('#w-status').textContent = t; };
|
|
212
|
+
var sayWord = function (i, times) {
|
|
213
|
+
stopSay();
|
|
214
|
+
if (S.v.voice === false) { status(NO_VOICE); return; }
|
|
215
|
+
var tok = S.tok; var left = times; var nth = 0;
|
|
216
|
+
var next = function () { if (tok !== S.tok) return; if (left <= 0) { status('听完了就写'); return; } left--; nth++; status('正在念 · 第 ' + nth + ' 遍'); event('say', i, nth); play(); };
|
|
217
|
+
var gap = function () { if (tok !== S.tok) return; status(left > 0 ? '再听一遍' : '听完了就写'); if (left > 0) S.timer = setTimeout(next, 1600); };
|
|
218
|
+
var mute = function () { if (tok === S.tok) status(NO_VOICE); };
|
|
219
|
+
var play = function () {
|
|
220
|
+
audio.onended = gap;
|
|
221
|
+
audio.onerror = mute;
|
|
222
|
+
audio.src = '/api/dictation/' + S.v.id + '/say/' + i;
|
|
223
|
+
var pr = audio.play(); if (pr && pr.catch) pr.catch(function (e) { if (tok !== S.tok) return; if (audio.error) mute(); else if (blocked(e)) status('点「再念」听老师念'); });
|
|
224
|
+
};
|
|
225
|
+
next();
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// ---------- 写:一个单词一格,四线三格 ----------
|
|
229
|
+
var pad = $('#w-pad');
|
|
230
|
+
var trace = sv('g', {}); var ink = sv('g', { 'class': 'eni' });
|
|
231
|
+
pad.append(enLines(sv), trace, ink);
|
|
232
|
+
var drawInk = function () { ink.replaceChildren.apply(ink, S.strokes.map(function (s) { return sv('path', { d: pathD(s) }); })); };
|
|
233
|
+
var cur = null;
|
|
234
|
+
/**
|
|
235
|
+
* 格子铺满:四条线占格子高的 62%,横着起码看得到尺子上 1300 宽(grandmother 写得下),以单词中间(x 1024)、四条线中间(y 260)为准。
|
|
236
|
+
* 只改看得到哪一段,尺子不变:存的点、对一对叠的字照旧对得上。PV = 现在的 viewBox
|
|
237
|
+
*/
|
|
238
|
+
var PV = { x: 0, y: EN_TOP, w: EN_W, h: EN_VH };
|
|
239
|
+
var fitPad = function () {
|
|
240
|
+
pad.style.maxHeight = '';
|
|
241
|
+
var b = pad.getBoundingClientRect(); if (!b.width || !b.height) return;
|
|
242
|
+
// 竖着(iPad 竖放、手机)宽度先不够:格子只要四条线占 62% 的那么高,居中,别空出一大片
|
|
243
|
+
if (b.width / 1300 < b.height * 0.62 / 360) { pad.style.maxHeight = Math.round(b.width / 1300 * 360 / 0.62) + 'px'; b = pad.getBoundingClientRect(); }
|
|
244
|
+
var s = Math.min(b.height * 0.62 / 360, b.width / 1300);
|
|
245
|
+
var w = Math.round(b.width / s), hh = Math.round(b.height / s);
|
|
246
|
+
PV = { x: Math.round(1024 - w / 2), y: Math.round(260 - hh / 2), w: w, h: hh };
|
|
247
|
+
pad.setAttribute('viewBox', [PV.x, PV.y, PV.w, PV.h].join(' '));
|
|
248
|
+
};
|
|
249
|
+
window.addEventListener('resize', function () { if ($('#v-write').classList.contains('on')) fitPad(); });
|
|
250
|
+
var at = function (e) { var b = pad.getBoundingClientRect(); return [Math.round(PV.x + (e.clientX - b.left) / b.width * PV.w), Math.round(PV.y + (e.clientY - b.top) / b.height * PV.h), now()]; };
|
|
251
|
+
pad.addEventListener('pointerdown', function (e) {
|
|
252
|
+
if (e.pointerType === 'pen') S.sawPen = true; else if (e.pointerType === 'touch' && S.sawPen) return; // 用过笔就不认手掌
|
|
253
|
+
e.preventDefault(); try { pad.setPointerCapture(e.pointerId); } catch (x) {}
|
|
254
|
+
cur = { id: e.pointerId, pts: [at(e)] }; S.strokes.push(cur.pts); drawInk();
|
|
255
|
+
});
|
|
256
|
+
pad.addEventListener('pointermove', function (e) { if (!cur || e.pointerId !== cur.id) return; e.preventDefault(); cur.pts.push(at(e)); var p = ink.lastChild; if (p) p.setAttribute('d', pathD(cur.pts)); });
|
|
257
|
+
var up = function (e) { if (cur && e.pointerId === cur.id) cur = null; };
|
|
258
|
+
pad.addEventListener('pointerup', up); pad.addEventListener('pointercancel', up);
|
|
259
|
+
$('#w-undo').addEventListener('click', function () { if (S.strokes.length) { drop(S.strokes.pop()); S.undos++; drawInk(); } });
|
|
260
|
+
$('#w-clear').addEventListener('click', function () { if (S.strokes.length) { S.strokes.forEach(drop); S.strokes = []; S.undos++; drawInk(); } });
|
|
261
|
+
$('#w-again').addEventListener('click', function () { event('again', S.i); sayWord(S.i, 1); });
|
|
262
|
+
$('#w-reveal').addEventListener('click', function () {
|
|
263
|
+
var i = S.i; var b = $('#w-reveal'); b.disabled = true;
|
|
264
|
+
api('POST', '/api/dictation/' + S.v.id + '/reveal/' + i, { char: 0, t: now() }).then(function (j) {
|
|
265
|
+
if (S.i !== i) return;
|
|
266
|
+
S.revealed = true; S.strokes.forEach(drop); S.strokes = []; drawInk();
|
|
267
|
+
trace.replaceChildren(enWord(sv, j.ch, 'enw trace', PV.w - 120));
|
|
268
|
+
status('照着灰色的单词写一遍');
|
|
269
|
+
}, function () { b.disabled = false; toast('没连上,再点一次'); });
|
|
270
|
+
});
|
|
271
|
+
/** 横排的听写本:一个单词一小条四线格,写过的画上孩子的笔,当前那条学科色描边;inkOf(k) 回写过的笔(没写回 null) */
|
|
272
|
+
var renderBook = function (cur, inkOf) {
|
|
273
|
+
var box = $('#w-book'); box.replaceChildren(h('b', {}, '听写本'));
|
|
274
|
+
var here = null;
|
|
275
|
+
for (var k = 0; k < S.v.sizes.length; k++) {
|
|
276
|
+
var ink = inkOf(k), svg = sv('svg', { viewBox: EN_VIEW }), g = sv('g', { 'class': 'eni' });
|
|
277
|
+
(ink || []).forEach(function (st) { if (st.length) g.append(sv('path', { d: pathD(st) })); });
|
|
278
|
+
svg.append(enLines(sv), g);
|
|
279
|
+
var el = h('div', { 'class': 'bk ' + (k === cur ? 'c' : ink ? 'd' : 'a') }, svg, h('small', {}, String(k + 1)));
|
|
280
|
+
if (k === cur) here = el;
|
|
281
|
+
box.append(el);
|
|
282
|
+
}
|
|
283
|
+
if (here && here.scrollIntoView) here.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
284
|
+
};
|
|
285
|
+
var mineOf = function (k) { var m = S.v.mine && S.v.mine[k]; return m && m[0] ? m[0].strokes : null; };
|
|
286
|
+
var openWord = function (i) {
|
|
287
|
+
S.i = i; S.strokes = []; S.undos = 0; S.gone = []; S.revealed = false; S.mode = 'first';
|
|
288
|
+
trace.replaceChildren(); drawInk(); $('#w-model').hidden = true;
|
|
289
|
+
$('#w-who').textContent = (S.v.tutor || '老师') + '念第 ' + (i + 1) + ' 个';
|
|
290
|
+
$('#w-reveal').disabled = false; $('#w-reveal').hidden = false; $('#w-done').disabled = false; $('#w-x').hidden = true;
|
|
291
|
+
$('#w-book').hidden = false; renderBook(i, mineOf); show('write'); event('show', i); sayWord(i, 2);
|
|
292
|
+
};
|
|
293
|
+
var nextWord = function () { for (var k = 0; k < S.v.written.length; k++) if (!S.v.written[k]) return openWord(k); stopSay(); show('submit'); };
|
|
294
|
+
$('#w-done').addEventListener('click', function () {
|
|
295
|
+
if (S.revealed && !S.strokes.length) { status('照着灰色的单词写一遍'); return; }
|
|
296
|
+
var i = S.i; var b = $('#w-done'); b.disabled = true;
|
|
297
|
+
var chars = [{ strokes: S.strokes, undos: S.undos, gone: S.gone.length ? S.gone : undefined, revealed: S.revealed || undefined }];
|
|
298
|
+
if (S.mode === 'rewrite') {
|
|
299
|
+
api('POST', '/api/dictation/' + S.v.id + '/rewrites/' + i, { chars: chars, self: true }).then(function (v) { setView(v); stopSay(); openCheck(); }, function () { b.disabled = false; toast('没连上,再点一次'); });
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
api('PUT', '/api/dictation/' + S.v.id + '/first/' + i, { chars: chars }).then(function () { event('done', i); S.v.written[i] = true; S.v.mine = S.v.mine || []; S.v.mine[i] = [{ strokes: S.strokes }]; nextWord(); }, function () { b.disabled = false; toast('没连上,再点一次'); });
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// ---------- 交卷、对一对 ----------
|
|
306
|
+
$('#u-go').addEventListener('click', function () { var b = $('#u-go'); b.disabled = true; api('POST', '/api/dictation/' + S.v.id + '/check').then(function (v) { setView(v); openCheck(); }, function () { b.disabled = false; toast('没连上,再点一次'); }); });
|
|
307
|
+
var openCheck = function () {
|
|
308
|
+
var rows = $('#c-rows'); rows.replaceChildren();
|
|
309
|
+
S.v.answers.forEach(function (a, i) {
|
|
310
|
+
var svg = sv('svg', { viewBox: EN_VIEW }); var g = sv('g', { 'class': 'eni' });
|
|
311
|
+
(a.ink[0] || []).forEach(function (s) { if (s.length) g.append(sv('path', { d: pathD(s) })); });
|
|
312
|
+
svg.append(enLines(sv), g); if (!S.hide) svg.append(enWord(sv, a.chars));
|
|
313
|
+
var again = h('button', { 'class': 'tool', type: 'button', on: { click: function () { rewrite(i); } } }, ico('write'), lbl('再写一遍'));
|
|
314
|
+
// emoji 只在对一对出:写的时候看不到,写完了当个提示放在这一行的左下
|
|
315
|
+
rows.append(h('div', { 'class': 'row' }, svg, h('div', { 'class': 'ft' }, a.emoji ? h('span', { 'class': 'em', text: a.emoji }) : null, h('small', { text: (i + 1) + (a.revealed ? ' · 看了答案,照着写的' : a.rewrote ? ' · 又写了一遍' : '') }), again)));
|
|
316
|
+
});
|
|
317
|
+
show('check');
|
|
318
|
+
};
|
|
319
|
+
$('#c-hide').addEventListener('click', function () { S.hide = !S.hide; $('#c-hide span').textContent = S.hide ? '叠上蓝字' : '拿开蓝字'; openCheck(); });
|
|
320
|
+
var rewrite = function (i) {
|
|
321
|
+
event('self', i);
|
|
322
|
+
S.i = i; S.strokes = []; S.undos = 0; S.gone = []; S.revealed = false; S.mode = 'rewrite';
|
|
323
|
+
trace.replaceChildren(); drawInk();
|
|
324
|
+
var m = $('#w-model'); m.replaceChildren(enModel(sv, S.v.answers[i].chars)); m.hidden = false;
|
|
325
|
+
$('#w-who').textContent = '再写一遍'; status('看着上面的单词写'); $('#w-reveal').hidden = true; $('#w-done').disabled = false;
|
|
326
|
+
$('#w-book').hidden = true; $('#w-x').hidden = false; show('write'); sayWord(i, 1);
|
|
327
|
+
};
|
|
328
|
+
$('#w-x').addEventListener('click', function () { event('close', S.i); stopSay(); S.mode = 'first'; openCheck(); });
|
|
329
|
+
$('#c-done').addEventListener('click', function () { api('POST', '/api/dictation/' + S.v.id + '/done').then(goHome, goHome); });
|
|
330
|
+
|
|
331
|
+
// ---------- 开始 ----------
|
|
332
|
+
var begin = function (v) {
|
|
333
|
+
setView(v);
|
|
334
|
+
if (v.checked) return openCheck();
|
|
335
|
+
$('#s-title').textContent = '单词听写 · ' + v.sizes.length + ' 个单词';
|
|
336
|
+
var wrote = v.written.filter(Boolean).length;
|
|
337
|
+
$('#s-sub').textContent = v.voice === false ? NO_VOICE : wrote ? '写到第 ' + (wrote + 1) + ' 个了' : (v.tutor || '老师') + '念,你来写';
|
|
338
|
+
$('#s-go span').textContent = wrote ? '接着写' : '开始';
|
|
339
|
+
$('#s-go').hidden = v.voice === false;
|
|
340
|
+
show('start');
|
|
341
|
+
};
|
|
342
|
+
$('#s-go').addEventListener('click', function () { nextWord(); });
|
|
343
|
+
|
|
344
|
+
// ---------- 拍照开始:拍 → 一项一项认出来 → 点选 → 开始 ----------
|
|
345
|
+
var P = { id: null, items: [], on: {}, extra: [], timer: 0, rec: null, url: null };
|
|
346
|
+
var shrink = function (file) {
|
|
347
|
+
return new Promise(function (resolve, reject) {
|
|
348
|
+
var url = URL.createObjectURL(file); var im = new Image();
|
|
349
|
+
im.onload = function () { var k = Math.min(1, 2000 / Math.max(im.naturalWidth, im.naturalHeight)); var c = document.createElement('canvas'); c.width = Math.round(im.naturalWidth * k); c.height = Math.round(im.naturalHeight * k); c.getContext('2d').drawImage(im, 0, 0, c.width, c.height); URL.revokeObjectURL(url); resolve(c.toDataURL('image/jpeg', 0.85)); };
|
|
350
|
+
im.onerror = function () { URL.revokeObjectURL(url); reject(new Error('x')); };
|
|
351
|
+
im.src = url;
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
var WORD = /^[A-Za-z][A-Za-z'-]*$/;
|
|
355
|
+
var chosen = function () { var out = []; P.items.forEach(function (it) { if (P.on[it.text]) out.push({ chars: it.text, say: it.say || undefined, emoji: it.emoji || undefined }); }); P.extra.forEach(function (w) { if (P.on[w] && !out.some(function (x) { return x.chars === w; })) out.push({ chars: w }); }); return out.slice(0, 20); };
|
|
356
|
+
var drawChips = function (rec) {
|
|
357
|
+
if (rec) P.rec = rec; else rec = P.rec;
|
|
358
|
+
drawBoxes();
|
|
359
|
+
var mk = function (w) { return h('button', { 'class': 'chip' + (P.on[w] ? ' on' : ''), type: 'button', on: { click: function () { P.on[w] = !P.on[w]; drawChips(rec); } } }, w); };
|
|
360
|
+
$('#p-chips').replaceChildren.apply($('#p-chips'), P.items.map(function (it) { return mk(it.text); }).concat(P.extra.map(mk)));
|
|
361
|
+
var seen = {}; P.items.forEach(function (it) { seen[it.text.toLowerCase()] = 1; }); P.extra.forEach(function (w) { seen[w.toLowerCase()] = 1; });
|
|
362
|
+
var more = []; (rec && rec.full || []).forEach(function (l) { l.split(' ').forEach(function (w) { if (WORD.test(w) && w.length > 1 && !seen[w.toLowerCase()]) { seen[w.toLowerCase()] = 1; more.push(w); } }); });
|
|
363
|
+
$('#p-more').replaceChildren.apply($('#p-more'), more.slice(0, 40).map(function (w) { return h('button', { 'class': 'chip', type: 'button', on: { click: function () { P.extra.push(w); P.on[w] = true; drawChips(rec); } } }, w); }));
|
|
364
|
+
var n = chosen().length; $('#p-go').disabled = !n; $('#p-go').textContent = n ? '开始听写 · ' + n + ' 个' : '开始听写';
|
|
365
|
+
};
|
|
366
|
+
var drawBoxes = function () {
|
|
367
|
+
var box = $('#p-boxes');
|
|
368
|
+
box.replaceChildren.apply(box, P.items.filter(function (it) { return it.box; }).map(function (it) {
|
|
369
|
+
var b = h('button', { 'class': 'ebx' + (P.on[it.text] ? ' on' : '') + (it.sure === false ? ' unsure' : ''), type: 'button', 'aria-label': it.text, on: { click: function () { P.on[it.text] = !P.on[it.text]; drawChips(null); } } });
|
|
370
|
+
b.style.left = it.box[0] / 10 + '%'; b.style.top = it.box[1] / 10 + '%'; b.style.width = (it.box[2] - it.box[0]) / 10 + '%'; b.style.height = (it.box[3] - it.box[1]) / 10 + '%';
|
|
371
|
+
return b;
|
|
372
|
+
}));
|
|
373
|
+
};
|
|
374
|
+
var poll = function () {
|
|
375
|
+
var id = P.id;
|
|
376
|
+
api('GET', '/api/dictation/photos/' + id).then(function (rec) {
|
|
377
|
+
if (P.id !== id) return;
|
|
378
|
+
rec.items.forEach(function (it) { if (!P.items.some(function (x) { return x.text === it.text; })) { P.items.push(it); P.on[it.text] = it.pick; } });
|
|
379
|
+
if (rec.lesson) $('#p-lesson').textContent = rec.lesson;
|
|
380
|
+
$('#p-status').textContent = rec.state === 'running' ? '正在看照片…' : P.items.length ? '点照片上的框或单词,选上或去掉' : '没认出单词,自己打上也行';
|
|
381
|
+
drawChips(rec);
|
|
382
|
+
if (rec.state === 'running') P.timer = setTimeout(poll, 700);
|
|
383
|
+
}, function () { if (P.id === id) P.timer = setTimeout(poll, 1500); });
|
|
384
|
+
};
|
|
385
|
+
var onFile = function (e) {
|
|
386
|
+
var f = e.target.files && e.target.files[0]; if (!f) return;
|
|
387
|
+
$('#p-pick').hidden = true; $('#p-list').hidden = false; showResume(null);
|
|
388
|
+
P.url = URL.createObjectURL(f); $('#p-img').src = P.url; $('#p-lesson').textContent = '认一认'; $('#p-status').textContent = '正在看照片…';
|
|
389
|
+
shrink(f).then(function (data) { return api('POST', '/api/dictation/photos', { image: data, lang: 'en' }); }).then(function (j) { P.id = j.id; poll(); }, function () { $('#p-status').textContent = '没看成,自己打上单词也行'; });
|
|
390
|
+
};
|
|
391
|
+
$('#p-cam').addEventListener('change', onFile); $('#p-lib').addEventListener('change', onFile);
|
|
392
|
+
$('#p-again').addEventListener('click', function () {
|
|
393
|
+
clearTimeout(P.timer); if (P.url) URL.revokeObjectURL(P.url);
|
|
394
|
+
P = { id: null, items: [], on: {}, extra: [], timer: 0, rec: null, url: null };
|
|
395
|
+
$('#p-cam').value = ''; $('#p-lib').value = ''; $('#p-img').removeAttribute('src'); $('#p-boxes').replaceChildren(); $('#p-chips').replaceChildren(); $('#p-more').replaceChildren();
|
|
396
|
+
$('#p-list').hidden = true; $('#p-pick').hidden = false; $('#p-go').disabled = true; $('#p-go').textContent = '开始听写'; findResume();
|
|
397
|
+
});
|
|
398
|
+
$('#p-add-go').addEventListener('click', function () { var inp = $('#p-add'); inp.value.split(/ +/).forEach(function (w) { w = w.trim(); if (WORD.test(w) && w.length <= 20 && P.extra.indexOf(w) < 0) { P.extra.push(w); P.on[w] = true; } }); inp.value = ''; drawChips(null); });
|
|
399
|
+
$('#p-go').addEventListener('click', function () {
|
|
400
|
+
var b = $('#p-go'); b.disabled = true; clearTimeout(P.timer);
|
|
401
|
+
var body = { photo: P.id, words: chosen(), lang: 'en' }; if (TUTOR) body.tutor = TUTOR;
|
|
402
|
+
if (!P.id) { toast('先拍一张'); b.disabled = false; return; }
|
|
403
|
+
api('POST', '/api/dictation', body).then(begin, function () { b.disabled = false; toast('没连上,再点一次'); });
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
api('GET', '/api/kid/home').then(function (j) { TUTORS = j.tutors || []; showFace(); }, function () {});
|
|
407
|
+
/** 今天这位老师没写完(没点「对好了」)的拍照听写,拍照屏最上面给「接着写」;会话先读好,点下去在手势里直接念 */
|
|
408
|
+
var ymdOf = function (d) { return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate(); };
|
|
409
|
+
var R = { v: null };
|
|
410
|
+
var showResume = function (v) {
|
|
411
|
+
R.v = v;
|
|
412
|
+
$('#snap-resume').hidden = !v;
|
|
413
|
+
$('#snap-cam-btn').classList.toggle('alt', Boolean(v));
|
|
414
|
+
if (!v) return;
|
|
415
|
+
var wrote = v.written.filter(Boolean).length;
|
|
416
|
+
$('#snap-resume-sub').textContent = v.checked || wrote === v.sizes.length ? '写完了,还没对一对' : '写到第 ' + (wrote + 1) + ' 个了 · 一共 ' + v.sizes.length + ' 个';
|
|
417
|
+
};
|
|
418
|
+
var findResume = function () {
|
|
419
|
+
var today = ymdOf(new Date());
|
|
420
|
+
api('GET', '/api/dictation').then(function (j) {
|
|
421
|
+
var x = (j.sessions || []).filter(function (s) { return s.photo && !s.done && s.lang === 'en' && (!TUTOR || s.tutor === TUTOR) && ymdOf(new Date(s.startedAt)) === today; })[0];
|
|
422
|
+
if (!x) return;
|
|
423
|
+
return api('GET', '/api/dictation/' + x.id + '/kid').then(function (v) { if ($('#v-snap').classList.contains('on') && !$('#p-pick').hidden) showResume(v); });
|
|
424
|
+
}).catch(function () {});
|
|
425
|
+
};
|
|
426
|
+
$('#snap-resume-go').addEventListener('click', function () { var v = R.v; if (!v) return; showResume(null); setView(v); if (v.checked) openCheck(); else nextWord(); });
|
|
427
|
+
|
|
428
|
+
// ---------- 录像(?reel=<id>):照记录用这一页的画法画;钟、把手、启动在 reel-mode.ts ----------
|
|
429
|
+
${REEL_MODE_JS}
|
|
430
|
+
/** 一组笔这一刻的样子:点数变了才重画 */
|
|
431
|
+
var reelPaths = function (o, g, strokes) {
|
|
432
|
+
var n = 0; strokes.forEach(function (x) { n += x.length; });
|
|
433
|
+
var sig = strokes.length + ':' + n;
|
|
434
|
+
if (o.sig === sig) return;
|
|
435
|
+
o.sig = sig;
|
|
436
|
+
g.replaceChildren.apply(g, strokes.filter(function (x) { return x.length; }).map(function (x) { return sv('path', { d: pathD(x) }); }));
|
|
437
|
+
};
|
|
438
|
+
var reelDraw = function (f) {
|
|
439
|
+
var R = RL.r;
|
|
440
|
+
var view = f.view === 'check' || f.view === 'order' ? 'check' : f.view === 'rewrite' && f.open ? 'rewrite' : f.allDone ? 'submit' : 'write';
|
|
441
|
+
var done = R.rewrites.filter(function (x) { return x.to <= RL.t; }).length;
|
|
442
|
+
var wi = view === 'rewrite' ? f.open.word : f.word;
|
|
443
|
+
var key = [view, wi, view === 'write' && f.mode !== 'write' ? 't' : '', view === 'check' ? done : 0, window.innerWidth, window.innerHeight].join('|');
|
|
444
|
+
var rebuild = key !== RL.key; RL.key = key;
|
|
445
|
+
if (view === 'submit') { if (rebuild) show('submit'); return; }
|
|
446
|
+
if (view === 'check') {
|
|
447
|
+
if (rebuild) {
|
|
448
|
+
var rows = $('#c-rows'); rows.replaceChildren();
|
|
449
|
+
RL.rows = R.chars.map(function (cs, i) {
|
|
450
|
+
var svg = sv('svg', { viewBox: EN_VIEW }); var g = sv('g', { 'class': 'eni' });
|
|
451
|
+
svg.append(enLines(sv), g, enWord(sv, cs[0]));
|
|
452
|
+
var a = RL.s.first[i]; var rv = Boolean(a && a.chars[0] && a.chars[0].revealed);
|
|
453
|
+
var rw = R.rewrites.some(function (x) { return x.word === i && x.to <= RL.t; });
|
|
454
|
+
rows.append(h('div', { 'class': 'row' }, svg, h('div', { 'class': 'ft' }, h('small', { text: (i + 1) + (rv ? ' · 看了答案,照着写的' : rw ? ' · 又写了一遍' : '') }), h('button', { 'class': 'tool', type: 'button' }, ico('write'), lbl('再写一遍')))));
|
|
455
|
+
return { g: g, sig: '' };
|
|
456
|
+
});
|
|
457
|
+
S.mode = 'first'; show('check');
|
|
458
|
+
}
|
|
459
|
+
RL.rows.forEach(function (o, i) { reelPaths(o, o.g, f.latest[i][0] || []); });
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
if (rebuild) {
|
|
463
|
+
S.mode = view === 'rewrite' ? 'rewrite' : 'first'; S.i = wi;
|
|
464
|
+
show('write');
|
|
465
|
+
trace.replaceChildren(); if (view === 'write' && f.mode !== 'write') trace.append(enWord(sv, R.chars[wi][0], 'enw trace', PV.w - 120));
|
|
466
|
+
var m = $('#w-model'); m.hidden = view !== 'rewrite'; if (view === 'rewrite') m.replaceChildren(enModel(sv, R.chars[wi][0])); else m.replaceChildren();
|
|
467
|
+
$('#w-who').textContent = view === 'rewrite' ? '再写一遍' : (S.v.tutor || '老师') + '念第 ' + (wi + 1) + ' 个';
|
|
468
|
+
$('#w-reveal').hidden = view === 'rewrite'; $('#w-reveal').disabled = view === 'write' && f.mode !== 'write';
|
|
469
|
+
$('#w-x').hidden = view !== 'rewrite';
|
|
470
|
+
$('#w-book').hidden = view !== 'write';
|
|
471
|
+
if (view === 'write') renderBook(wi, function (k) { var x = k < wi && f.ink[k] && f.ink[k][0]; return x && x.length ? x : null; });
|
|
472
|
+
RL.inkO = { sig: '' };
|
|
473
|
+
}
|
|
474
|
+
reelPaths(RL.inkO, ink, view === 'rewrite' ? (f.rewrite && f.rewrite[0]) || [] : f.ink[wi][0]);
|
|
475
|
+
status(view === 'rewrite' ? '看着上面的单词写' : f.mode !== 'write' ? '照着灰色的单词写一遍' : f.say ? '正在念 · 第 ' + f.say.n + ' 遍' : f.said === 1 ? '再听一遍' : f.said > 1 ? '听完了就写' : '');
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
if (REEL_ID) reelBoot();
|
|
479
|
+
else if (HOME) api('POST', '/api/dictation', { home: HOME, n: N }).then(begin, goHome);
|
|
480
|
+
else { show('snap'); $('#p-list').hidden = true; findResume(); }
|
|
481
|
+
})();
|
|
482
|
+
</script>
|
|
483
|
+
</body></html>
|
|
484
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DICTATION_PAGE: string;
|