@rimori/client 2.4.0 → 2.5.0-next.1
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/cli/scripts/init/dev-registration.js +4 -2
- package/dist/cli/scripts/init/main.js +1 -0
- package/dist/cli/scripts/release/release.js +0 -0
- package/dist/controller/SettingsController.d.ts +1 -1
- package/dist/controller/SharedContentController.d.ts +1 -1
- package/dist/fromRimori/EventBus.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/plugin/CommunicationHandler.d.ts +13 -8
- package/dist/plugin/CommunicationHandler.js +44 -59
- package/dist/plugin/RimoriClient.d.ts +11 -195
- package/dist/plugin/RimoriClient.js +16 -298
- package/dist/plugin/StandaloneClient.d.ts +1 -1
- package/dist/plugin/StandaloneClient.js +3 -2
- package/dist/plugin/module/AIModule.d.ts +49 -0
- package/dist/plugin/module/AIModule.js +81 -0
- package/dist/plugin/module/DbModule.d.ts +30 -0
- package/dist/plugin/module/DbModule.js +51 -0
- package/dist/plugin/module/EventModule.d.ts +99 -0
- package/dist/plugin/module/EventModule.js +162 -0
- package/dist/{controller/ExerciseController.d.ts → plugin/module/ExerciseModule.d.ts} +20 -16
- package/dist/{controller/ExerciseController.js → plugin/module/ExerciseModule.js} +27 -20
- package/dist/plugin/module/PluginModule.d.ts +76 -0
- package/dist/plugin/module/PluginModule.js +88 -0
- package/package.json +8 -3
- package/.github/workflows/pre-release.yml +0 -126
- package/.prettierignore +0 -35
- package/eslint.config.js +0 -53
- package/example/docs/devdocs.md +0 -241
- package/example/docs/overview.md +0 -29
- package/example/docs/userdocs.md +0 -126
- package/example/rimori.config.ts +0 -91
- package/example/worker/vite.config.ts +0 -26
- package/example/worker/worker.ts +0 -11
- package/prettier.config.js +0 -8
- package/src/cli/scripts/init/dev-registration.ts +0 -189
- package/src/cli/scripts/init/env-setup.ts +0 -44
- package/src/cli/scripts/init/file-operations.ts +0 -58
- package/src/cli/scripts/init/html-cleaner.ts +0 -45
- package/src/cli/scripts/init/main.ts +0 -175
- package/src/cli/scripts/init/package-setup.ts +0 -113
- package/src/cli/scripts/init/router-transformer.ts +0 -332
- package/src/cli/scripts/init/tailwind-config.ts +0 -66
- package/src/cli/scripts/init/vite-config.ts +0 -73
- package/src/cli/scripts/release/detect-translation-languages.ts +0 -37
- package/src/cli/scripts/release/release-config-upload.ts +0 -119
- package/src/cli/scripts/release/release-db-update.ts +0 -97
- package/src/cli/scripts/release/release-file-upload.ts +0 -138
- package/src/cli/scripts/release/release.ts +0 -85
- package/src/cli/types/DatabaseTypes.ts +0 -125
- package/src/controller/AIController.ts +0 -295
- package/src/controller/AccomplishmentController.ts +0 -188
- package/src/controller/AudioController.ts +0 -64
- package/src/controller/ExerciseController.ts +0 -117
- package/src/controller/ObjectController.ts +0 -120
- package/src/controller/SettingsController.ts +0 -186
- package/src/controller/SharedContentController.ts +0 -365
- package/src/controller/TranslationController.ts +0 -136
- package/src/controller/VoiceController.ts +0 -33
- package/src/fromRimori/EventBus.ts +0 -382
- package/src/fromRimori/PluginTypes.ts +0 -214
- package/src/fromRimori/readme.md +0 -2
- package/src/index.ts +0 -19
- package/src/plugin/CommunicationHandler.ts +0 -310
- package/src/plugin/Logger.ts +0 -394
- package/src/plugin/RimoriClient.ts +0 -530
- package/src/plugin/StandaloneClient.ts +0 -125
- package/src/utils/difficultyConverter.ts +0 -15
- package/src/utils/endpoint.ts +0 -3
- package/src/worker/WorkerSetup.ts +0 -35
- package/tsconfig.json +0 -17
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
name: Pre-Release Rimori Client
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [dev]
|
|
6
|
-
paths:
|
|
7
|
-
- '**'
|
|
8
|
-
- '!.github/workflows/**'
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
pre-release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write
|
|
15
|
-
id-token: write
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout repository
|
|
19
|
-
uses: actions/checkout@v4
|
|
20
|
-
with:
|
|
21
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
-
fetch-depth: 0
|
|
23
|
-
|
|
24
|
-
- name: Setup Node.js
|
|
25
|
-
uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: '20'
|
|
28
|
-
registry-url: 'https://registry.npmjs.org'
|
|
29
|
-
cache: 'yarn'
|
|
30
|
-
cache-dependency-path: yarn.lock
|
|
31
|
-
|
|
32
|
-
- name: Update npm
|
|
33
|
-
run: npm install -g npm@latest
|
|
34
|
-
|
|
35
|
-
- name: Install dependencies
|
|
36
|
-
run: yarn install --frozen-lockfile
|
|
37
|
-
|
|
38
|
-
- name: Build rimori-client (TypeScript verification)
|
|
39
|
-
run: yarn build
|
|
40
|
-
|
|
41
|
-
- name: Calculate next pre-release version
|
|
42
|
-
id: version
|
|
43
|
-
run: |
|
|
44
|
-
# Read current version from package.json (may be base or pre-release)
|
|
45
|
-
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
46
|
-
|
|
47
|
-
# Extract base version (strip any pre-release suffix)
|
|
48
|
-
# Examples: "2.2.0" -> "2.2.0", "2.2.0-next.5" -> "2.2.0"
|
|
49
|
-
if [[ "$CURRENT_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
|
50
|
-
BASE_VERSION="${BASH_REMATCH[1]}"
|
|
51
|
-
else
|
|
52
|
-
BASE_VERSION="$CURRENT_VERSION"
|
|
53
|
-
fi
|
|
54
|
-
|
|
55
|
-
# Try to get latest next version from npm
|
|
56
|
-
LATEST_NEXT=$(npm view @rimori/client@next version 2>/dev/null || echo "none")
|
|
57
|
-
|
|
58
|
-
if [ "$LATEST_NEXT" != "none" ]; then
|
|
59
|
-
# Extract base version and pre-release number from latest next version
|
|
60
|
-
# Example: "2.2.0-next.5" -> extract "2.2.0" and "5"
|
|
61
|
-
if [[ "$LATEST_NEXT" =~ ^([0-9]+\.[0-9]+\.[0-9]+)-next\.([0-9]+)$ ]]; then
|
|
62
|
-
LATEST_BASE="${BASH_REMATCH[1]}"
|
|
63
|
-
PRERELEASE_NUM="${BASH_REMATCH[2]}"
|
|
64
|
-
|
|
65
|
-
# If base version changed, reset to 1, otherwise increment
|
|
66
|
-
if [ "$LATEST_BASE" != "$BASE_VERSION" ]; then
|
|
67
|
-
NEW_NUM=1
|
|
68
|
-
else
|
|
69
|
-
NEW_NUM=$((PRERELEASE_NUM + 1))
|
|
70
|
-
fi
|
|
71
|
-
else
|
|
72
|
-
# Fallback: if format doesn't match, start at 1
|
|
73
|
-
NEW_NUM=1
|
|
74
|
-
fi
|
|
75
|
-
else
|
|
76
|
-
# First pre-release
|
|
77
|
-
NEW_NUM=1
|
|
78
|
-
fi
|
|
79
|
-
|
|
80
|
-
NEW_VERSION="${BASE_VERSION}-next.${NEW_NUM}"
|
|
81
|
-
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
82
|
-
echo "Base version: $BASE_VERSION"
|
|
83
|
-
echo "Calculated next version: $NEW_VERSION"
|
|
84
|
-
|
|
85
|
-
- name: Update package.json version
|
|
86
|
-
run: |
|
|
87
|
-
# Use node to update version directly (yarn version creates git tags)
|
|
88
|
-
node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json')); pkg.version = '${{ steps.version.outputs.new_version }}'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');"
|
|
89
|
-
|
|
90
|
-
- name: Publish to npm
|
|
91
|
-
run: npm publish --tag next --access public
|
|
92
|
-
# Uses OIDC token automatically (no NODE_AUTH_TOKEN needed)
|
|
93
|
-
# Requires npm 11.5.1+ and id-token: write permission (already set)
|
|
94
|
-
|
|
95
|
-
- name: Output published version
|
|
96
|
-
run: |
|
|
97
|
-
echo "✅ Published @rimori/client@${{ steps.version.outputs.new_version }} to npm with @next tag"
|
|
98
|
-
|
|
99
|
-
- name: Create git tag
|
|
100
|
-
run: |
|
|
101
|
-
git config --local user.email "action@github.com"
|
|
102
|
-
git config --local user.name "GitHub Action"
|
|
103
|
-
git tag "v${{ steps.version.outputs.new_version }}" -m "Pre-release v${{ steps.version.outputs.new_version }}"
|
|
104
|
-
git push origin "v${{ steps.version.outputs.new_version }}"
|
|
105
|
-
echo "🏷️ Created and pushed tag v${{ steps.version.outputs.new_version }}"
|
|
106
|
-
|
|
107
|
-
- name: Notify Slack
|
|
108
|
-
if: always()
|
|
109
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
110
|
-
with:
|
|
111
|
-
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
|
|
112
|
-
payload: |
|
|
113
|
-
{
|
|
114
|
-
"text": "Pre-Release Pipeline Status",
|
|
115
|
-
"blocks": [
|
|
116
|
-
{
|
|
117
|
-
"type": "section",
|
|
118
|
-
"text": {
|
|
119
|
-
"type": "mrkdwn",
|
|
120
|
-
"text": "📦 *@rimori/client Pre-Release*\n\n*Branch:* ${{ github.ref_name }}\n*Version:* ${{ steps.version.outputs.new_version }}\n*Author:* ${{ github.actor }}\n*Pipeline:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>\n\n${{ job.status == 'success' && '✅ Successfully published to npm with @next tag!' || '❌ Pipeline failed. Check the logs for details.' }}"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
env:
|
|
126
|
-
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
package/.prettierignore
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Dependencies
|
|
2
|
-
node_modules/
|
|
3
|
-
yarn.lock
|
|
4
|
-
package-lock.json
|
|
5
|
-
bun.lockb
|
|
6
|
-
|
|
7
|
-
# Build outputs
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
*.tsbuildinfo
|
|
11
|
-
|
|
12
|
-
# Generated files
|
|
13
|
-
*.d.ts
|
|
14
|
-
*.js.map
|
|
15
|
-
|
|
16
|
-
# IDE files
|
|
17
|
-
.vscode/
|
|
18
|
-
.idea/
|
|
19
|
-
|
|
20
|
-
# OS files
|
|
21
|
-
.DS_Store
|
|
22
|
-
Thumbs.db
|
|
23
|
-
|
|
24
|
-
# Logs
|
|
25
|
-
*.log
|
|
26
|
-
npm-debug.log*
|
|
27
|
-
yarn-debug.log*
|
|
28
|
-
yarn-error.log*
|
|
29
|
-
|
|
30
|
-
# Coverage
|
|
31
|
-
coverage/
|
|
32
|
-
|
|
33
|
-
# Temporary files
|
|
34
|
-
*.tmp
|
|
35
|
-
*.temp
|
package/eslint.config.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
5
|
-
import tseslint from 'typescript-eslint';
|
|
6
|
-
import prettier from 'eslint-plugin-prettier';
|
|
7
|
-
import prettierConfig from 'eslint-config-prettier';
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{ ignores: ['dist', 'node_modules', 'build', '*.js'] },
|
|
11
|
-
js.configs.recommended,
|
|
12
|
-
...tseslint.configs.recommended,
|
|
13
|
-
prettierConfig,
|
|
14
|
-
{
|
|
15
|
-
files: ['**/*.{ts,tsx,js,jsx}'],
|
|
16
|
-
languageOptions: {
|
|
17
|
-
ecmaVersion: 2020,
|
|
18
|
-
globals: {
|
|
19
|
-
...globals.browser,
|
|
20
|
-
...globals.node,
|
|
21
|
-
...globals.jest,
|
|
22
|
-
},
|
|
23
|
-
sourceType: 'module',
|
|
24
|
-
parserOptions: {
|
|
25
|
-
projectService: true,
|
|
26
|
-
tsconfigRootDir: import.meta.dirname,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
plugins: {
|
|
30
|
-
'react-hooks': reactHooks,
|
|
31
|
-
'react-refresh': reactRefresh,
|
|
32
|
-
prettier: prettier,
|
|
33
|
-
},
|
|
34
|
-
rules: {
|
|
35
|
-
...reactHooks.configs.recommended.rules,
|
|
36
|
-
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
|
37
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
38
|
-
'@typescript-eslint/no-explicit-any': 'warn',
|
|
39
|
-
'@typescript-eslint/no-floating-promises': 'warn',
|
|
40
|
-
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
41
|
-
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
42
|
-
'@typescript-eslint/explicit-module-boundary-types': 'warn',
|
|
43
|
-
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
44
|
-
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
45
|
-
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
46
|
-
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
47
|
-
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
48
|
-
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
49
|
-
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
50
|
-
'prettier/prettier': 'error',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
];
|
package/example/docs/devdocs.md
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
# Simple Flashcards - Developer Guide
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The Simple Flashcards plugin provides spaced repetition learning through an event-based API. Other plugins can create flashcards, request lookups, and trigger training sessions.
|
|
6
|
-
|
|
7
|
-
**Plugin ID:** `pl123456789`
|
|
8
|
-
|
|
9
|
-
## Event-based Integration
|
|
10
|
-
|
|
11
|
-
All communication uses the Rimori event bus with the pattern: `<plugin_id>.<area>.<action>`
|
|
12
|
-
|
|
13
|
-
### 1. Create Flashcards
|
|
14
|
-
|
|
15
|
-
#### Basic Creation
|
|
16
|
-
|
|
17
|
-
```javascript
|
|
18
|
-
// Create a simple flashcard
|
|
19
|
-
plugin.event.emit('pl123456789.flashcard.create', {
|
|
20
|
-
front: 'Hello',
|
|
21
|
-
back: 'Hola',
|
|
22
|
-
deckId: 'deck-123', // optional, uses default deck if omitted
|
|
23
|
-
frontTags: ['lang:en'],
|
|
24
|
-
backTags: ['lang:es'],
|
|
25
|
-
});
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
#### Language-based Creation
|
|
29
|
-
|
|
30
|
-
```javascript
|
|
31
|
-
// Create flashcard with automatic lookup
|
|
32
|
-
plugin.event.emit('pl123456789.flashcard.createLangCard', {
|
|
33
|
-
word: 'perro',
|
|
34
|
-
language: 'es', // optional, uses user's mother tongue if omitted
|
|
35
|
-
deckId: 'spanish-nouns', // optional
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 2. Lookup Requests
|
|
40
|
-
|
|
41
|
-
#### Basic Translation
|
|
42
|
-
|
|
43
|
-
```javascript
|
|
44
|
-
// Request word translation
|
|
45
|
-
const translation = await plugin.event.request('pl123456789.lookup.request', {
|
|
46
|
-
word: 'laufen',
|
|
47
|
-
language: 'de', // optional
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Returns:
|
|
51
|
-
// {
|
|
52
|
-
// input: "laufen",
|
|
53
|
-
// language: "de",
|
|
54
|
-
// type: "verb",
|
|
55
|
-
// swedish_translation: "att springa",
|
|
56
|
-
// translation: "to run"
|
|
57
|
-
// }
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
#### Advanced Lookup
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
// Get detailed word information
|
|
64
|
-
const details = await plugin.event.request('pl123456789.lookup.request', {
|
|
65
|
-
word: 'laufen',
|
|
66
|
-
language: 'de',
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// Returns extended object with grammar, examples, tenses, etc.
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 3. Deck Management
|
|
73
|
-
|
|
74
|
-
#### Get Available Decks
|
|
75
|
-
|
|
76
|
-
```javascript
|
|
77
|
-
const decks = await plugin.event.request('pl123456789.deck.requestOpenToday');
|
|
78
|
-
|
|
79
|
-
// Returns:
|
|
80
|
-
// [
|
|
81
|
-
// {
|
|
82
|
-
// id: "deck-123",
|
|
83
|
-
// name: "Spanish Vocabulary",
|
|
84
|
-
// total_new: 5,
|
|
85
|
-
// total_learning: 12,
|
|
86
|
-
// total_review: 8
|
|
87
|
-
// }
|
|
88
|
-
// ]
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### Create New Deck
|
|
92
|
-
|
|
93
|
-
```javascript
|
|
94
|
-
const newDeck = await plugin.event.request('pl123456789.deck.create', {
|
|
95
|
-
name: 'German Verbs',
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// Returns: { id: "deck-456", name: "German Verbs", last_used: "2025-01-06T..." }
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 4. Trigger Training
|
|
102
|
-
|
|
103
|
-
#### Open Flashcard Training
|
|
104
|
-
|
|
105
|
-
```javascript
|
|
106
|
-
// Open training in main panel
|
|
107
|
-
plugin.event.emit('global.mainPanel.triggerAction', {
|
|
108
|
-
pluginId: 'pl123456789',
|
|
109
|
-
actionKey: 'flashcards',
|
|
110
|
-
deck: 'latest', // or "random", "oldest", "mix", deck ID
|
|
111
|
-
total_amount: 20, // or "default"
|
|
112
|
-
});
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Worker Function Example
|
|
116
|
-
|
|
117
|
-
### Background Deck Sync
|
|
118
|
-
|
|
119
|
-
```javascript
|
|
120
|
-
// worker/listeners/deck-sync.ts
|
|
121
|
-
import { WorkerEventListener } from '@rimori/client';
|
|
122
|
-
|
|
123
|
-
export const deckSyncListener: WorkerEventListener = {
|
|
124
|
-
eventName: 'pl123456789.deck.syncProgress',
|
|
125
|
-
|
|
126
|
-
async handler(data: { userId: string; deckId: string }) {
|
|
127
|
-
const { userId, deckId } = data;
|
|
128
|
-
|
|
129
|
-
// Calculate learning statistics
|
|
130
|
-
const stats = await calculateDeckProgress(deckId, userId);
|
|
131
|
-
|
|
132
|
-
// Update user's learning streak
|
|
133
|
-
await updateLearningStreak(userId, stats);
|
|
134
|
-
|
|
135
|
-
// Send progress update to main thread
|
|
136
|
-
self.postMessage({
|
|
137
|
-
type: 'progress-updated',
|
|
138
|
-
deckId,
|
|
139
|
-
stats: {
|
|
140
|
-
cardsReviewed: stats.reviewed,
|
|
141
|
-
accuracy: stats.accuracy,
|
|
142
|
-
streak: stats.streak
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
async function calculateDeckProgress(deckId: string, userId: string) {
|
|
149
|
-
// Database queries to calculate progress
|
|
150
|
-
const cards = await db.from('flashcards')
|
|
151
|
-
.select('*')
|
|
152
|
-
.eq('deck_id', deckId)
|
|
153
|
-
.eq('user_id', userId);
|
|
154
|
-
|
|
155
|
-
const reviewed = cards.filter(c => c.last_review_date >= getTodayStart());
|
|
156
|
-
const accuracy = reviewed.reduce((acc, c) => acc + c.ease_factor, 0) / reviewed.length;
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
reviewed: reviewed.length,
|
|
160
|
-
accuracy: Math.round(accuracy * 100),
|
|
161
|
-
streak: await calculateStreak(userId)
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Database Schema Pattern
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
// Example table structure
|
|
170
|
-
interface Flashcard {
|
|
171
|
-
id: string;
|
|
172
|
-
user_id: string;
|
|
173
|
-
deck_id: string;
|
|
174
|
-
front: string;
|
|
175
|
-
back: string;
|
|
176
|
-
front_tags: string[];
|
|
177
|
-
back_tags: string[];
|
|
178
|
-
ease_factor: number;
|
|
179
|
-
interval: number;
|
|
180
|
-
due_date: string;
|
|
181
|
-
last_review_date?: string;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
interface Deck {
|
|
185
|
-
id: string;
|
|
186
|
-
user_id: string;
|
|
187
|
-
name: string;
|
|
188
|
-
last_used: string;
|
|
189
|
-
created_at: string;
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## Integration Examples
|
|
194
|
-
|
|
195
|
-
### Dictionary Plugin → Flashcards
|
|
196
|
-
|
|
197
|
-
```javascript
|
|
198
|
-
// When user looks up a word in dictionary
|
|
199
|
-
function onWordLookup(word: string, translation: string) {
|
|
200
|
-
// Automatically create flashcard
|
|
201
|
-
plugin.event.emit("pl123456789.flashcard.create", {
|
|
202
|
-
front: word,
|
|
203
|
-
back: translation,
|
|
204
|
-
frontTags: ["lang:sv"],
|
|
205
|
-
backTags: ["lang:en", "dictionary-lookup"]
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Study Planner → Flashcards
|
|
211
|
-
|
|
212
|
-
```javascript
|
|
213
|
-
// Trigger daily flashcard session
|
|
214
|
-
function scheduleDailyReview() {
|
|
215
|
-
plugin.event.emit('global.mainPanel.triggerAction', {
|
|
216
|
-
pluginId: 'pl123456789',
|
|
217
|
-
actionKey: 'flashcards',
|
|
218
|
-
deck: 'mix',
|
|
219
|
-
total_amount: 30,
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## Error Handling
|
|
225
|
-
|
|
226
|
-
```javascript
|
|
227
|
-
try {
|
|
228
|
-
await plugin.event.request('pl123456789.flashcard.create', cardData);
|
|
229
|
-
} catch (error) {
|
|
230
|
-
console.error('Failed to create flashcard:', error);
|
|
231
|
-
// Handle error appropriately
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Best Practices
|
|
236
|
-
|
|
237
|
-
- Always provide meaningful error messages
|
|
238
|
-
- Use consistent tagging for language features
|
|
239
|
-
- Batch operations when creating multiple cards
|
|
240
|
-
- Respect user's daily review limits
|
|
241
|
-
- Include proper TypeScript types for payloads
|
package/example/docs/overview.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Simple Flashcards - Spaced Repetition Learning
|
|
2
|
-
|
|
3
|
-
**Transform your vocabulary learning with intelligent flashcards that adapt to your memory**
|
|
4
|
-
|
|
5
|
-
## ✨ What it does
|
|
6
|
-
|
|
7
|
-
Simple Flashcards uses proven spaced repetition algorithms to help you memorize vocabulary, facts, and concepts efficiently. The plugin schedules your reviews at optimal intervals, showing cards just before you're likely to forget them.
|
|
8
|
-
|
|
9
|
-
## 🎯 Perfect for
|
|
10
|
-
|
|
11
|
-
- **Language learners** building vocabulary with audio pronunciation
|
|
12
|
-
- **Students** memorizing facts, formulas, and definitions
|
|
13
|
-
- **Professionals** learning technical terms and concepts
|
|
14
|
-
- **Anyone** who wants to remember information long-term
|
|
15
|
-
|
|
16
|
-
## 🔥 Key Features
|
|
17
|
-
|
|
18
|
-
- **Smart scheduling** - Cards appear when you need to review them most
|
|
19
|
-
- **Audio support** - Hear correct pronunciation for language learning
|
|
20
|
-
- **Multiple decks** - Organize cards by topic, subject, or difficulty
|
|
21
|
-
- **Simple rating** - Just rate how well you remembered (Again, Hard, Good, Easy)
|
|
22
|
-
- **Progress tracking** - See your learning streak and daily progress
|
|
23
|
-
- **Cross-plugin integration** - Other plugins can add cards automatically
|
|
24
|
-
|
|
25
|
-
## 🚀 Get Started in 30 seconds
|
|
26
|
-
|
|
27
|
-
1. Create your first deck
|
|
28
|
-
2. Add some flashcards (front/back)
|
|
29
|
-
3. Start reviewing - the algorithm handles the rest!
|
package/example/docs/userdocs.md
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# Simple Flashcards - User Guide
|
|
2
|
-
|
|
3
|
-
## Getting Started
|
|
4
|
-
|
|
5
|
-
Simple Flashcards uses spaced repetition to help you learn and retain information efficiently. The plugin automatically schedules your reviews at optimal intervals, showing cards just before you're likely to forget them.
|
|
6
|
-
|
|
7
|
-
### Create Your First Deck
|
|
8
|
-
|
|
9
|
-
Before you can start learning, you'll need to create a deck to organize your flashcards. To create your first deck:
|
|
10
|
-
|
|
11
|
-
1. Navigate to the main flashcards page where you'll see your deck overview
|
|
12
|
-
2. Click the "Add deck" button located at the bottom of the page
|
|
13
|
-
3. Enter a descriptive name for your deck (e.g., "Spanish Vocabulary" or "Biology Terms")
|
|
14
|
-
4. Click save to create your new deck
|
|
15
|
-
|
|
16
|
-
Your new deck will appear in the deck overview, ready for you to add flashcards.
|
|
17
|
-
|
|
18
|
-
### Adding Flashcards
|
|
19
|
-
|
|
20
|
-
Once you have a deck, you can start adding flashcards to build your learning material. To add new flashcards:
|
|
21
|
-
|
|
22
|
-
1. Click on your deck name to enter the deck and access its training interface
|
|
23
|
-
2. Click the "+" button to open the flashcard creation form
|
|
24
|
-
3. Enter your question, word, or prompt on the **front** of the card
|
|
25
|
-
4. Enter the corresponding answer, translation, or explanation on the **back**
|
|
26
|
-
5. Optionally add tags like `lang:es` to enable features such as Spanish audio pronunciation
|
|
27
|
-
6. Click the save icon to create your flashcard
|
|
28
|
-
|
|
29
|
-
The new card will be added to your deck and will appear in your learning session when you start reviewing.
|
|
30
|
-
|
|
31
|
-
### Learning with Flashcards
|
|
32
|
-
|
|
33
|
-
The learning process follows a simple but effective pattern designed to maximize retention:
|
|
34
|
-
|
|
35
|
-
1. **Start a session** by clicking on a deck name from the overview page
|
|
36
|
-
2. **Study the front** of each card carefully and try to recall the answer from memory
|
|
37
|
-
3. **Reveal the answer** by pressing the spacebar or clicking the "Show answer" button
|
|
38
|
-
4. **Rate your recall** honestly using one of four options:
|
|
39
|
-
- **Again (1)** - You didn't remember or got it wrong; the card will reappear soon
|
|
40
|
-
- **Hard (2)** - You remembered but with significant difficulty; shorter interval before next review
|
|
41
|
-
- **Good (3)** - You remembered correctly with some effort; optimal spaced interval
|
|
42
|
-
- **Easy (4)** - You remembered effortlessly; longer interval before next review
|
|
43
|
-
|
|
44
|
-
Your ratings help the algorithm determine the best time to show each card again, optimizing your learning efficiency.
|
|
45
|
-
|
|
46
|
-
## Key Features
|
|
47
|
-
|
|
48
|
-
### Audio Pronunciation Support
|
|
49
|
-
|
|
50
|
-
For language learning, audio pronunciation is essential. The plugin supports text-to-speech functionality:
|
|
51
|
-
|
|
52
|
-
- **Enable audio** by adding language tags such as `lang` for generic audio or `lang:es` for Spanish-specific pronunciation
|
|
53
|
-
- **Play audio** by clicking the speaker icon that appears on cards with language tags
|
|
54
|
-
- **Keyboard shortcuts** for audio: press **5** to play the front audio or **h** to play the back audio
|
|
55
|
-
|
|
56
|
-
The audio feature helps you learn correct pronunciation while building vocabulary, making it especially valuable for language learners.
|
|
57
|
-
|
|
58
|
-
### Efficient Keyboard Navigation
|
|
59
|
-
|
|
60
|
-
Speed up your review sessions with keyboard shortcuts that eliminate the need for mouse clicking:
|
|
61
|
-
|
|
62
|
-
- **Spacebar** - Reveal the answer when studying the front of a card
|
|
63
|
-
- **Number keys 1-4** - Rate your recall (Again, Hard, Good, Easy respectively)
|
|
64
|
-
- **5 key** - Play audio for the front of the card (if language tags are present)
|
|
65
|
-
- **h key** - Play audio for the back of the card (if language tags are present)
|
|
66
|
-
- **v key** - Edit the current flashcard during review
|
|
67
|
-
|
|
68
|
-
These shortcuts allow you to maintain focus and rhythm during your learning sessions.
|
|
69
|
-
|
|
70
|
-
### Deck Organization and Progress Tracking
|
|
71
|
-
|
|
72
|
-
The deck overview provides clear visual indicators of your progress:
|
|
73
|
-
|
|
74
|
-
- **Orange numbers** next to deck names show cards you're actively learning (new or recently difficult cards)
|
|
75
|
-
- **Green numbers** indicate cards that are due for review today based on the spaced repetition schedule
|
|
76
|
-
- **Deck names** can be clicked to immediately start a study session with that deck
|
|
77
|
-
|
|
78
|
-
This system helps you quickly identify which decks need attention and track your daily progress.
|
|
79
|
-
|
|
80
|
-
### Tagging System for Organization
|
|
81
|
-
|
|
82
|
-
Tags provide a flexible way to categorize and enhance your flashcards:
|
|
83
|
-
|
|
84
|
-
- **Organizational tags** like `grammar`, `verbs`, or `beginner` help you categorize content by topic or difficulty
|
|
85
|
-
- **Language tags** such as `lang:de` for German enable specific features like pronunciation
|
|
86
|
-
- **Multiple tags** can be applied to each card for comprehensive organization
|
|
87
|
-
|
|
88
|
-
Tags make it easier to manage large collections of flashcards and enable special features like audio playback.
|
|
89
|
-
|
|
90
|
-
## Settings and Customization
|
|
91
|
-
|
|
92
|
-
The plugin offers several settings to personalize your learning experience:
|
|
93
|
-
|
|
94
|
-
- **Auto-play new cards** - When enabled, automatically plays audio pronunciation for new cards that have appropriate language tags, helping you learn pronunciation from the first encounter
|
|
95
|
-
- **Auto-add lookups** - Automatically creates flashcards from words you look up in other parts of the Rimori workspace, streamlining the process of building your vocabulary deck
|
|
96
|
-
|
|
97
|
-
These settings help integrate the flashcard system with your broader learning workflow.
|
|
98
|
-
|
|
99
|
-
## Best Practices and Tips
|
|
100
|
-
|
|
101
|
-
To get the most out of your flashcard learning:
|
|
102
|
-
|
|
103
|
-
- **Keep cards simple** - Focus on one concept, word, or fact per card for optimal retention
|
|
104
|
-
- **Review consistently** - Even a brief 10-minute daily session is more effective than longer, infrequent sessions
|
|
105
|
-
- **Use audio features** - Take advantage of pronunciation features for language learning
|
|
106
|
-
- **Edit problematic cards** - If you consistently struggle with a card, rewrite it to be clearer or break it into smaller pieces
|
|
107
|
-
- **Be honest with ratings** - Accurate self-assessment helps the algorithm schedule reviews optimally
|
|
108
|
-
|
|
109
|
-
## Troubleshooting Common Issues
|
|
110
|
-
|
|
111
|
-
**Audio not playing when expected?**
|
|
112
|
-
|
|
113
|
-
- Verify that your device volume is turned up and not muted
|
|
114
|
-
- Check that the flashcard has proper language tags (e.g., `lang:en` for English)
|
|
115
|
-
- Try refreshing the page if audio features seem unresponsive
|
|
116
|
-
|
|
117
|
-
**Flashcards not saving properly?**
|
|
118
|
-
|
|
119
|
-
- Ensure you have a stable internet connection for data synchronization
|
|
120
|
-
- Verify you clicked the save icon after entering card content
|
|
121
|
-
- Try creating the card again if the first attempt failed
|
|
122
|
-
|
|
123
|
-
**Progress not updating correctly?**
|
|
124
|
-
|
|
125
|
-
- Refresh the page to ensure you're seeing the latest data
|
|
126
|
-
- Check that you're rating cards rather than just viewing them
|