ebt-vue3 1.504.185 → 2.0.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/package.json +2 -2
- package/src/App.vue +1 -2
- package/src/assets/main.css +17 -1
- package/src/components/PaliView.vue +6 -6
- package/src/components/SegmentView.vue +7 -17
- package/src/defines.mjs +1 -0
- package/src/stores/volatile.mjs +1 -4
- package/test/idb-audio.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ebt-vue3",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vue3 Library for SuttaCentral Voice EBT-Sites",
|
|
5
5
|
"author": "Karl Lew",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"module": "index.mjs",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@mdi/font": "7.0.96",
|
|
33
|
-
"@sc-voice/
|
|
33
|
+
"@sc-voice/ms-dpd": "^2.22.0",
|
|
34
34
|
"compression": "^1.7.4",
|
|
35
35
|
"idb-keyval": "^6.2.0",
|
|
36
36
|
"log-instance": "^1.6.0",
|
package/src/App.vue
CHANGED
|
@@ -256,8 +256,7 @@
|
|
|
256
256
|
import { useAudioStore } from './stores/audio.mjs';
|
|
257
257
|
import {
|
|
258
258
|
Dictionary,
|
|
259
|
-
|
|
260
|
-
} from "@sc-voice/pali";
|
|
259
|
+
} from "@sc-voice/ms-dpd";
|
|
261
260
|
import { logger } from "log-instance/index.mjs";
|
|
262
261
|
import { nextTick, ref } from "vue";
|
|
263
262
|
|
package/src/assets/main.css
CHANGED
|
@@ -623,8 +623,24 @@ code {
|
|
|
623
623
|
.seg-body:focus {
|
|
624
624
|
border: 2px dotted rgba(var(--v-theme-matched), 1);
|
|
625
625
|
}
|
|
626
|
+
.segment-menu {
|
|
627
|
+
display: flex;
|
|
628
|
+
justify-content: flex-end;
|
|
629
|
+
align-items: flex-end;
|
|
630
|
+
}
|
|
631
|
+
.pli-word:hover {
|
|
632
|
+
color: rgb(var(--v-theme-link));
|
|
633
|
+
}
|
|
634
|
+
.pli-summary {
|
|
635
|
+
padding: 0.5em;
|
|
636
|
+
padding-top: 0em;
|
|
637
|
+
padding-left: 1em;
|
|
638
|
+
min-height: 3em;
|
|
639
|
+
width: 340px;
|
|
640
|
+
background-color: rgb(var(--v-theme-currentbg));
|
|
641
|
+
}
|
|
626
642
|
|
|
627
|
-
/************** SegmentView (
|
|
643
|
+
/************** SegmentView (END) ***************/
|
|
628
644
|
|
|
629
645
|
/************** SuttaView (BEGIN) ***************/
|
|
630
646
|
.sutta {
|
|
@@ -64,10 +64,7 @@
|
|
|
64
64
|
import { ref, nextTick } from "vue";
|
|
65
65
|
import { DBG, } from '../defines.mjs';
|
|
66
66
|
import { default as EbtCard } from '../ebt-card.mjs';
|
|
67
|
-
import {
|
|
68
|
-
Dictionary,
|
|
69
|
-
Pali,
|
|
70
|
-
} from "@sc-voice/pali";
|
|
67
|
+
import { Dictionary } from "@sc-voice/ms-dpd";
|
|
71
68
|
const MAX_HISTORY = 100;
|
|
72
69
|
const MAX_DEFINITIONS = 100;
|
|
73
70
|
const history = [];
|
|
@@ -319,7 +316,8 @@
|
|
|
319
316
|
});
|
|
320
317
|
},
|
|
321
318
|
typeTitle(type) {
|
|
322
|
-
let
|
|
319
|
+
let { dict } = this;
|
|
320
|
+
let info = dict.abbreviationInfo(type);
|
|
323
321
|
return info && info.meaning || type;
|
|
324
322
|
},
|
|
325
323
|
},
|
|
@@ -378,6 +376,7 @@
|
|
|
378
376
|
let { definition, findResult } = this;
|
|
379
377
|
let { data } = findResult;
|
|
380
378
|
let dPrev = null;
|
|
379
|
+
console.log(msg);
|
|
381
380
|
|
|
382
381
|
return data.reduce((a,d) => {
|
|
383
382
|
let { word, construction } = d;
|
|
@@ -393,13 +392,14 @@
|
|
|
393
392
|
}, []);
|
|
394
393
|
},
|
|
395
394
|
definition() {
|
|
395
|
+
const msg = "PaliView.definition";
|
|
396
396
|
let { card, dict } = this;
|
|
397
397
|
if (dict == null) {
|
|
398
398
|
return [ '...', '...', '...', '...' ];
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
let word = card.location[0].toLowerCase();
|
|
402
|
-
let entry = dict.entryOf(word);
|
|
402
|
+
let entry = dict.entryOf(msg, word);
|
|
403
403
|
let res = dict.find(word);
|
|
404
404
|
let definitions = ['nothing'];
|
|
405
405
|
if (entry) {
|
|
@@ -357,17 +357,22 @@
|
|
|
357
357
|
return dictionary && cardScid===segment.scid && paliWord;
|
|
358
358
|
},
|
|
359
359
|
paliDefinition(ctx) {
|
|
360
|
+
const msg = "SegmentView.paliDefinition";
|
|
361
|
+
let dbg = DBG.PALI_DEFINITION;
|
|
360
362
|
let { volatile, cardScid, paliWord, segment } = this;
|
|
361
363
|
let { dictionary } = volatile;
|
|
362
364
|
let entry = dictionary.entryOf(paliWord);
|
|
365
|
+
dbg && console.log(msg, `[1]${paliWord}`, entry);
|
|
363
366
|
let { definition=['?|?||'] } = entry || {};
|
|
364
367
|
let paliLink = entry && entry.definition
|
|
365
|
-
? `<a href="#/pali/${paliWord}">${
|
|
368
|
+
? `<a href="#/pali/${paliWord}">${entry.word}</a>`
|
|
366
369
|
: `<b>${paliWord}</b>`;
|
|
367
370
|
return [
|
|
368
371
|
paliLink,
|
|
369
372
|
...definition.map((d,i)=>{
|
|
370
|
-
let
|
|
373
|
+
let def = dictionary.parseDefinition(d);
|
|
374
|
+
let { type, meaning, literal, construction } = def;
|
|
375
|
+
//let [ type, meaning, literal, construction ] = d.split('|');
|
|
371
376
|
let code = '①'.charCodeAt(0) + i;
|
|
372
377
|
literal = literal ? `; <i>lit. ${literal}</i>` : '';
|
|
373
378
|
return `${String.fromCharCode(code)}\u202f${meaning}${literal}`
|
|
@@ -379,20 +384,5 @@
|
|
|
379
384
|
</script>
|
|
380
385
|
|
|
381
386
|
<style >
|
|
382
|
-
.segment-menu {
|
|
383
|
-
display: flex;
|
|
384
|
-
justify-content: flex-end;
|
|
385
|
-
align-items: flex-end;
|
|
386
|
-
}
|
|
387
|
-
.pli-word:hover {
|
|
388
|
-
color: rgb(var(--v-theme-link));
|
|
389
|
-
}
|
|
390
|
-
.pli-summary {
|
|
391
|
-
padding: 0.5em;
|
|
392
|
-
padding-top: 0em;
|
|
393
|
-
padding-left: 1em;
|
|
394
|
-
min-height: 3em;
|
|
395
|
-
background-color: rgb(var(--v-theme-currentbg));
|
|
396
|
-
}
|
|
397
387
|
</style>
|
|
398
388
|
|
package/src/defines.mjs
CHANGED
package/src/stores/volatile.mjs
CHANGED
|
@@ -3,10 +3,7 @@ import { SuttaRef } from "scv-esm/main.mjs";
|
|
|
3
3
|
import { default as EbtCard } from "../ebt-card.mjs";
|
|
4
4
|
import { default as CardFactory } from "../card-factory.mjs";
|
|
5
5
|
import { default as EbtSettings } from "../ebt-settings.mjs";
|
|
6
|
-
import {
|
|
7
|
-
Pali,
|
|
8
|
-
Dictionary,
|
|
9
|
-
} from "@sc-voice/pali/main.mjs";
|
|
6
|
+
import { Dictionary } from "@sc-voice/ms-dpd/main.mjs";
|
|
10
7
|
import { logger } from "log-instance/index.mjs";
|
|
11
8
|
import { ref, nextTick } from "vue";
|
|
12
9
|
import { useSettingsStore } from "./settings.mjs";
|
package/test/idb-audio.mjs
CHANGED
|
@@ -235,7 +235,7 @@ global.AudioContext = MockAudioContext; // NodeJs has no AudioContext
|
|
|
235
235
|
should(audio.currentTime).above(playTime);
|
|
236
236
|
|
|
237
237
|
let abuf = result; // unspecified in Web Api
|
|
238
|
-
should(abuf.byteLength).above(
|
|
238
|
+
should(abuf.byteLength).above(150000).below(320000);
|
|
239
239
|
should(abuf).instanceOf(ArrayBuffer);
|
|
240
240
|
});
|
|
241
241
|
it("clear()", async()=>{
|