ebt-vue3 2.15.6 → 2.16.2
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/components/PaliView.vue +44 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ebt-vue3",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.2",
|
|
4
4
|
"description": "Vue3 Library for SuttaCentral Voice EBT-Sites",
|
|
5
5
|
"author": "Karl Lew",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"merkle-json": "^2.7.0",
|
|
38
38
|
"pinia": "^2.0.16",
|
|
39
39
|
"roboto-fontface": "*",
|
|
40
|
-
"scv-esm": "^1.111.
|
|
40
|
+
"scv-esm": "^1.111.95",
|
|
41
41
|
"serve-favicon": "^2.5.0",
|
|
42
42
|
"uuid": "^9.0.0",
|
|
43
43
|
"vite-plugin-vuetify": "^2.0.3",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<div v-if="dictResult && groups" class="dict" >
|
|
25
25
|
<v-expansion-panels v-model="panels"
|
|
26
26
|
variant="popout"
|
|
27
|
+
model-value="0"
|
|
27
28
|
@update:modelValue="onPanelUpdate"
|
|
28
29
|
>
|
|
29
30
|
<v-expansion-panel v-for="(group,ig) in groups" key="ig"
|
|
@@ -127,8 +128,27 @@
|
|
|
127
128
|
components: {
|
|
128
129
|
},
|
|
129
130
|
methods: {
|
|
131
|
+
findWord(aWord) {
|
|
132
|
+
const msg = "P6w.findWord:";
|
|
133
|
+
const dbg = DBG.PALI_SEARCH;
|
|
134
|
+
let { volatile } = this;
|
|
135
|
+
let { dictionary } = volatile;
|
|
136
|
+
let word = aWord.toLowerCase();
|
|
137
|
+
|
|
138
|
+
let dictResult = dictionary.find(word);
|
|
139
|
+
|
|
140
|
+
dbg && console.log(msg, '[3]find', word, dictResult);
|
|
141
|
+
this.dictResult = dictResult;
|
|
142
|
+
|
|
143
|
+
// Strange that "this" doesn't work here...
|
|
144
|
+
let that = this;
|
|
145
|
+
nextTick(()=>{
|
|
146
|
+
that.groups = dictResult && that.lemmaGroups();
|
|
147
|
+
});
|
|
148
|
+
return dictResult;
|
|
149
|
+
},
|
|
130
150
|
async onPanelUpdate(iPanel) {
|
|
131
|
-
const msg = "
|
|
151
|
+
const msg = "P6w.onPanelUpdate:";
|
|
132
152
|
let { groups } = this;
|
|
133
153
|
let group = groups[iPanel];
|
|
134
154
|
if (group) {
|
|
@@ -139,12 +159,12 @@
|
|
|
139
159
|
console.log(msg, '[2]audioUrl', group.audioUrl);
|
|
140
160
|
}
|
|
141
161
|
} else {
|
|
142
|
-
console.warn(msg, '[3]group?', iPanel);
|
|
162
|
+
console.warn(msg, '[3]group?', iPanel, groups);
|
|
143
163
|
}
|
|
144
164
|
},
|
|
145
|
-
|
|
146
|
-
const msg = "
|
|
147
|
-
let {
|
|
165
|
+
lemmaGroups() {
|
|
166
|
+
const msg = "P6w.lemmaGroups()";
|
|
167
|
+
let { dictResult } = this;
|
|
148
168
|
let { data } = dictResult;
|
|
149
169
|
let dPrev = null;
|
|
150
170
|
|
|
@@ -180,13 +200,13 @@
|
|
|
180
200
|
return link;
|
|
181
201
|
},
|
|
182
202
|
dpdUrl() {
|
|
183
|
-
const msg = "
|
|
203
|
+
const msg = "P6w.dpdUrl";
|
|
184
204
|
let ebtWord = this.card.location[0];
|
|
185
205
|
let link = this.dpdLink(ebtWord);
|
|
186
206
|
return link?.url;
|
|
187
207
|
},
|
|
188
208
|
customFilter(value, search, internal) {
|
|
189
|
-
const msg = "
|
|
209
|
+
const msg = "P6w.customFilter";
|
|
190
210
|
const dbg = DBG.PALI_SEARCH;
|
|
191
211
|
const dbgv = DBG.VERBOSE && dbg;
|
|
192
212
|
if (search == null || value==null) {
|
|
@@ -209,7 +229,7 @@
|
|
|
209
229
|
return false;
|
|
210
230
|
},
|
|
211
231
|
async groupAudioUrl(group) {
|
|
212
|
-
const msg = "
|
|
232
|
+
const msg = "P6w.groupAudioUrl()";
|
|
213
233
|
const dbg = DBG.PALI_VIEW;
|
|
214
234
|
let { settings } = this;
|
|
215
235
|
let { word, lemma } = group;
|
|
@@ -252,7 +272,7 @@
|
|
|
252
272
|
return volatile.dpdCartoucheHtml(def,i, {showLemma:false});
|
|
253
273
|
},
|
|
254
274
|
meaningHtml(def) {
|
|
255
|
-
const msg = "
|
|
275
|
+
const msg = "P6w.meaningHtml()";
|
|
256
276
|
const dbg = 0;
|
|
257
277
|
let { meaning_lit, meaning_1, meaning_raw } = def;
|
|
258
278
|
let { $t, dictResult } = this;
|
|
@@ -288,7 +308,7 @@
|
|
|
288
308
|
return result.join('; ');
|
|
289
309
|
},
|
|
290
310
|
runSearch(opts={}) {
|
|
291
|
-
const msg = "
|
|
311
|
+
const msg = "P6w.runSearch()";
|
|
292
312
|
const dbg = DBG.PALI_SEARCH;
|
|
293
313
|
let {
|
|
294
314
|
search=this.search?.value, openNew
|
|
@@ -339,7 +359,7 @@
|
|
|
339
359
|
window.location.hash = `#/${card.context}/${search}`;
|
|
340
360
|
},
|
|
341
361
|
updateModelValue(value) { // dropdown update
|
|
342
|
-
const msg = "
|
|
362
|
+
const msg = "P6w.updateModelValue()";
|
|
343
363
|
const dbg = DBG.PALI_SEARCH;
|
|
344
364
|
let { card, search, } = this;
|
|
345
365
|
|
|
@@ -358,11 +378,12 @@
|
|
|
358
378
|
}
|
|
359
379
|
},
|
|
360
380
|
updateSearch(search) { // keyboard update
|
|
361
|
-
const msg = "
|
|
381
|
+
const msg = "P6w.updateSearch()";
|
|
362
382
|
const dbg = DBG.PALI_SEARCH;
|
|
363
383
|
let { volatile } = this;
|
|
364
384
|
let { dictionary } = volatile;
|
|
365
385
|
this.search = search;
|
|
386
|
+
this.groups = undefined;
|
|
366
387
|
if (!search) {
|
|
367
388
|
this.setItems(history);
|
|
368
389
|
return;
|
|
@@ -374,7 +395,7 @@
|
|
|
374
395
|
}
|
|
375
396
|
},
|
|
376
397
|
setItems(strings) {
|
|
377
|
-
const msg = "
|
|
398
|
+
const msg = "P6w.setItems()";
|
|
378
399
|
const dbgv = DBG.VERBOSE && DBG.PALI_SEARCH;
|
|
379
400
|
let map = {};
|
|
380
401
|
let newItems = strings.reverse()
|
|
@@ -389,12 +410,13 @@
|
|
|
389
410
|
dbgv && console.log(msg, newItems);
|
|
390
411
|
items.value = newItems;
|
|
391
412
|
},
|
|
392
|
-
onEnter(evt) {
|
|
393
|
-
const msg = "
|
|
413
|
+
async onEnter(evt) {
|
|
414
|
+
const msg = "P6w.onEnter()";
|
|
394
415
|
const dbg = DBG.PALI_SEARCH;
|
|
395
416
|
let { card, search, volatile } = this;
|
|
396
417
|
let { dictionary } = volatile;
|
|
397
|
-
let res = search && dictionary && dictionary.find(search);
|
|
418
|
+
//let res = search && dictionary && dictionary.find(search);
|
|
419
|
+
let res = search && await this.findWord(search);
|
|
398
420
|
if (!res) {
|
|
399
421
|
dbg && console.log(msg, '[1]search?', search, evt);
|
|
400
422
|
this.dictResult = undefined;
|
|
@@ -412,7 +434,7 @@
|
|
|
412
434
|
volatile.paliSearchCard = null;
|
|
413
435
|
},
|
|
414
436
|
groupDefinitions(group) {
|
|
415
|
-
const msg = "
|
|
437
|
+
const msg = "P6w.groupDefinitions()";
|
|
416
438
|
let { word, construction, lemma } = group;
|
|
417
439
|
let { dictResult } = this;
|
|
418
440
|
let { method, pattern, data } = dictResult;
|
|
@@ -422,7 +444,7 @@
|
|
|
422
444
|
},
|
|
423
445
|
},
|
|
424
446
|
async mounted() {
|
|
425
|
-
const msg = '
|
|
447
|
+
const msg = 'P6w.mounted()';
|
|
426
448
|
let dbg = DBG.PALI_VIEW;
|
|
427
449
|
let { card, $route, settings, volatile} = this;
|
|
428
450
|
let { dictionary } = await volatile.verifyState();
|
|
@@ -430,12 +452,9 @@
|
|
|
430
452
|
dbg && console.log(msg, '[1]dictionary', !!dictionary);
|
|
431
453
|
let word = card.location[0] || '';
|
|
432
454
|
if (word) {
|
|
433
|
-
|
|
434
|
-
let res = dictionary.find(word);
|
|
435
|
-
dbg && console.log(msg, '[3]find', word);
|
|
436
|
-
this.dictResult = res;
|
|
455
|
+
this.findWord(word);
|
|
437
456
|
} else {
|
|
438
|
-
dbg && console.log(msg, '[
|
|
457
|
+
dbg && console.log(msg, '[2]search');
|
|
439
458
|
volatile.paliSearchCard = card;
|
|
440
459
|
}
|
|
441
460
|
|
|
@@ -447,13 +466,12 @@
|
|
|
447
466
|
history.push(ci.location[0]);
|
|
448
467
|
}
|
|
449
468
|
}
|
|
450
|
-
dbg && console.log(msg, '[
|
|
469
|
+
dbg && console.log(msg, '[3]history', history);
|
|
451
470
|
this.setItems(history);
|
|
452
471
|
} else {
|
|
453
|
-
dbg && console.log(msg, '[
|
|
472
|
+
dbg && console.log(msg, '[4]history!!!', history);
|
|
454
473
|
}
|
|
455
474
|
|
|
456
|
-
this.groups = await this.lemmaGroups();
|
|
457
475
|
card.onAfterMounted({settings, volatile});
|
|
458
476
|
},
|
|
459
477
|
computed: {
|
|
@@ -468,30 +486,6 @@
|
|
|
468
486
|
word() {
|
|
469
487
|
return this.card.location[0];
|
|
470
488
|
},
|
|
471
|
-
async definition() {
|
|
472
|
-
const msg = "PaliView.definition";
|
|
473
|
-
let { card, volatile } = this;
|
|
474
|
-
let { dictionary } = await volatile.verifyState();
|
|
475
|
-
if (dictionary == null) {
|
|
476
|
-
return [ '...', '...', '...', '...' ];
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
let word = card.location[0].toLowerCase();
|
|
480
|
-
let entry = dictionary.entryOf(msg, word);
|
|
481
|
-
let res = dictionary.find(word);
|
|
482
|
-
let definitions = ['nothing'];
|
|
483
|
-
if (entry) {
|
|
484
|
-
definitions = entry.definition;
|
|
485
|
-
definitions = entry.definition.map(def=>def.split('|'));
|
|
486
|
-
} else {
|
|
487
|
-
let type = '--';
|
|
488
|
-
let meaning_1 = `${word} not found`;
|
|
489
|
-
let literal = '--';
|
|
490
|
-
let construction = '--';
|
|
491
|
-
definitions = [ type, meaning_1, literal, construction ];
|
|
492
|
-
}
|
|
493
|
-
return definitions;
|
|
494
|
-
},
|
|
495
489
|
},
|
|
496
490
|
}
|
|
497
491
|
</script>
|