ebt-vue3 2.3.6 → 2.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ebt-vue3",
3
- "version": "2.3.6",
3
+ "version": "2.4.1",
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.110.354",
40
+ "scv-esm": "^1.110.356",
41
41
  "serve-favicon": "^2.5.0",
42
42
  "uuid": "^9.0.0",
43
43
  "vite-plugin-vuetify": "^2.0.3",
@@ -357,6 +357,32 @@ code {
357
357
  outline: 1pt solid green;
358
358
  }
359
359
 
360
+ .dpd-grammar {
361
+ color: white;
362
+ border-left: solid 1px gray;
363
+ border-top: solid 1px gray;
364
+ background: linear-gradient(1600deg,
365
+ rgba(255,255,255,0.3),
366
+ rgba(255,255,255,0.1)
367
+ ) !important;
368
+ border-radius: 4px;
369
+ margin-left: 5px;
370
+ padding-top: 1px;
371
+ padding-left: 3px;
372
+ padding-right: 4px;
373
+ margin-right: 2px;
374
+ }
375
+
376
+ div[title]:hover::before {
377
+ content: attr(title);
378
+ background-color: #000000;
379
+ color: #ffffff;
380
+ padding: 5px;
381
+ border-radius: 5px;
382
+ position: absolute;
383
+ z-index: 1;
384
+ }
385
+
360
386
  /******************** CORE CSS (END) ********************/
361
387
 
362
388
  /**************** Search Results (BEGIN) ***************/
@@ -633,11 +659,14 @@ code {
633
659
  }
634
660
  .pli-summary {
635
661
  padding: 0.5em;
636
- padding-top: 0em;
662
+ padding-top: 3px;
637
663
  padding-left: 1em;
638
664
  min-height: 3em;
639
665
  width: 340px;
640
666
  background-color: rgb(var(--v-theme-currentbg));
667
+ border-bottom-left-radius: 1em;
668
+ border-bottom-right-radius: 1em;
669
+ border-bottom: 1px solid rgba(var(--v-theme-focus), 0.8);
641
670
  }
642
671
 
643
672
  /************** SegmentView (END) ***************/
@@ -46,10 +46,7 @@
46
46
  ></audio>
47
47
  <table v-if="volatile.dictionary">
48
48
  <tr v-for="(def,i) in groupDefinitions(group)">
49
- <td v-html="lemmaHtml(def,i)"
50
- ></td>
51
- <td :title="grammarTitle(def.pos)"
52
- v-html="grammarHtml(def,i)"
49
+ <td v-html="dpdCartoucheHtml(def,i)"
53
50
  ></td>
54
51
  <td title="Meaning" v-html="meaningHtml(def)"
55
52
  ></td>
@@ -171,26 +168,9 @@
171
168
  this.playGroup = group;
172
169
  dbg && console.log(msg, word, urlPlay, paliGuid, urlPaliAudio);
173
170
  },
174
- grammarHtml(def, i) {
175
- let num = String.fromCharCode(0x2460+i);
176
- let { pos, } = def; // part of speech
177
- let { volatile } = this;
178
- let { dictionary } = volatile;
179
- let info = dictionary.abbreviationInfo(pos);
180
- let abbr = info && info.abbreviation ||
181
- `<span style="opacity:0.5">${pos}?</span>`;
182
- return `${abbr}`
183
- },
184
- lemmaHtml(def, i) {
185
- let num = String.fromCharCode(0x2460+i);
186
- let {
187
- pos,
188
- lemma_1='<span style="opacity:0.5">lemma_1?</span>'
189
- } = def; // part of speech
171
+ dpdCartoucheHtml(def, i) {
190
172
  let { volatile } = this;
191
- let { dictionary } = volatile;
192
- let info = dictionary.abbreviationInfo(pos);
193
- return `${num}&nbsp;${lemma_1}`
173
+ return volatile.dpdCartoucheHtml(def,i, {showLemma:true});
194
174
  },
195
175
  meaningHtml(def) {
196
176
  const msg = "PaliView.meaningHtml()";
@@ -343,16 +323,6 @@
343
323
  d.construction===group.construction;
344
324
  });
345
325
  },
346
- grammarTitle(pos) {
347
- let { settings, volatile } = this;
348
- let { docLang } = settings;
349
- let { dictionary } = volatile;
350
- let info = dictionary.abbreviationInfo(pos) || {};
351
- let { meaning=pos, explanation } = info;
352
- return explanation
353
- ? `${docLang} ${meaning}: ${explanation}`
354
- : meaning;
355
- },
356
326
  },
357
327
  async mounted() {
358
328
  const msg = 'PaliView.mounted()';
@@ -372,12 +372,15 @@
372
372
  ...definition.map((d,i)=>{
373
373
  let def = dictionary.parseDefinition(d);
374
374
  let { type, meaning, literal, construction } = def;
375
- //let [ type, meaning, literal, construction ] = d.split('|');
376
- let code = '①'.charCodeAt(0) + i;
377
375
  literal = literal ? `; <i>lit. ${literal}</i>` : '';
378
- return `${String.fromCharCode(code)}\u202f${meaning}${literal}`
376
+ let cartouche = volatile.dpdCartoucheHtml(def,i);
377
+ return [
378
+ cartouche,
379
+ meaning,
380
+ literal,
381
+ ].join("");
379
382
  }),
380
- ].join(' ');
383
+ ].join('');
381
384
  },
382
385
  },
383
386
  }
@@ -704,5 +704,52 @@ export const useVolatileStore = defineStore('volatile', {
704
704
 
705
705
  return segment;
706
706
  },
707
+ dpdCartoucheHtml(def, i, opts={}) {
708
+ let { showLemma=false } = opts;
709
+ let bullet = this.dpdBullet(i);
710
+ let grammar = this.dpdGrammarHtml(def);
711
+ let lemma = showLemma
712
+ ? `${this.dpdLemmaHtml(def)}&nbsp;`
713
+ : bullet;
714
+ let title = this.dpdCartoucheTitle(def);
715
+ return [
716
+ `<span title="${title}" class="dpd-grammar">`,
717
+ lemma,
718
+ grammar,
719
+ '</span>',
720
+ ].join('');
721
+ },
722
+ dpdBullet(i) {
723
+ return String.fromCharCode(0x2460+i);
724
+ },
725
+ dpdCartoucheTitle(def) {
726
+ const msg = "volatile.dpdCartoucheTitle";
727
+ let { dictionary } = this;
728
+ let info = dictionary.abbreviationInfo(def.pos) || {};
729
+ let { meaning=pos, explanation='' } = info;
730
+ console.log(msg, info);
731
+ return explanation.length
732
+ ? `${meaning}: ${explanation}`
733
+ : meaning;
734
+ },
735
+ dpdGrammarHtml(def) {
736
+ let { dictionary }= this;
737
+ if (dictionary == null) {
738
+ return "(loading)";
739
+ }
740
+ let { pos, } = def; // part of speech
741
+ let info = dictionary.abbreviationInfo(pos);
742
+ return info && info.abbreviation || pos || "abbr/pos?";
743
+ },
744
+ dpdLemmaHtml(def, i) {
745
+ let { dictionary }= this;
746
+ if (dictionary == null) {
747
+ return "(loading)";
748
+ }
749
+ let {
750
+ lemma_1='<span style="opacity:0.5">lemma_1?</span>'
751
+ } = def; // part of speech
752
+ return lemma_1;
753
+ },
707
754
  },
708
755
  })