@ddict/popup 0.3.19 → 1.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/dist/popup.es.js +589 -417
- package/dist/popup.umd.js +1 -2
- package/package.json +8 -4
- package/dist/popup.css +0 -1
package/dist/popup.es.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
1
|
+
import { openBlock, createElementBlock, Fragment, withDirectives, createElementVNode, renderList, toDisplayString, vModelSelect, createCommentVNode, normalizeStyle, vModelText, vModelCheckbox, createVNode } from "vue";
|
|
2
|
+
var helper = {
|
|
3
|
+
isRTL
|
|
4
|
+
};
|
|
5
|
+
function isRTL(locale) {
|
|
6
|
+
return ["ar", "fa", "iw", "yi", "ur", "pa"].indexOf(locale) > -1;
|
|
7
|
+
}
|
|
3
8
|
var _export_sfc = (sfc, props) => {
|
|
4
9
|
const target = sfc.__vccOpts || sfc;
|
|
5
10
|
for (const [key, val] of props) {
|
|
@@ -14,108 +19,174 @@ const _sfc_main$8 = {
|
|
|
14
19
|
default: null
|
|
15
20
|
}
|
|
16
21
|
},
|
|
22
|
+
emits: ["select"],
|
|
17
23
|
data() {
|
|
18
24
|
return {
|
|
19
25
|
src: "",
|
|
20
26
|
target: "",
|
|
21
|
-
|
|
27
|
+
recents: {
|
|
28
|
+
src: [],
|
|
29
|
+
target: []
|
|
30
|
+
}
|
|
22
31
|
};
|
|
23
32
|
},
|
|
24
33
|
watch: {
|
|
25
|
-
select() {
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
select(val) {
|
|
35
|
+
if (!val)
|
|
36
|
+
return;
|
|
37
|
+
this.src = val.src;
|
|
38
|
+
this.target = val.target;
|
|
39
|
+
this.loadRecents();
|
|
28
40
|
}
|
|
29
41
|
},
|
|
30
42
|
methods: {
|
|
31
|
-
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
onRecentSrc(src) {
|
|
44
|
+
this.src = src;
|
|
45
|
+
this.onSelect();
|
|
46
|
+
},
|
|
47
|
+
onRecentTarget(target) {
|
|
48
|
+
this.target = target;
|
|
49
|
+
this.onSelect();
|
|
36
50
|
},
|
|
37
51
|
swap() {
|
|
38
|
-
if (
|
|
39
|
-
|
|
52
|
+
if (this.src === "auto")
|
|
53
|
+
return;
|
|
54
|
+
if (!this.select.srcs[this.target] || !this.select.targets[this.src]) {
|
|
40
55
|
return;
|
|
41
56
|
}
|
|
42
57
|
const tmp = this.target;
|
|
43
58
|
this.target = this.src;
|
|
44
59
|
this.src = tmp;
|
|
45
|
-
this.
|
|
60
|
+
this.onSelect();
|
|
46
61
|
},
|
|
47
|
-
|
|
62
|
+
onSelect() {
|
|
48
63
|
const select = JSON.parse(JSON.stringify(this.select));
|
|
49
64
|
select.src = this.src;
|
|
50
65
|
select.target = this.target;
|
|
51
|
-
this.$emit("
|
|
66
|
+
this.$emit("select", select);
|
|
67
|
+
this.saveRecents(this.src, this.target);
|
|
68
|
+
},
|
|
69
|
+
loadRecents() {
|
|
70
|
+
const recents = JSON.parse(localStorage.getItem("recents"));
|
|
71
|
+
if (!recents)
|
|
72
|
+
return;
|
|
73
|
+
this.recents = recents;
|
|
74
|
+
},
|
|
75
|
+
saveRecents(src, target) {
|
|
76
|
+
if (!this.recents.src.includes(src)) {
|
|
77
|
+
this.recents.src.push(src);
|
|
78
|
+
}
|
|
79
|
+
if (!this.recents.target.includes(target))
|
|
80
|
+
this.recents.target.push(target);
|
|
81
|
+
if (this.recents.src.length > 3)
|
|
82
|
+
this.recents.src.shift();
|
|
83
|
+
if (this.recents.target.length > 3)
|
|
84
|
+
this.recents.target.shift();
|
|
85
|
+
localStorage.setItem("recents", JSON.stringify(this.recents));
|
|
52
86
|
}
|
|
53
87
|
}
|
|
54
88
|
};
|
|
55
89
|
const _hoisted_1$8 = {
|
|
56
90
|
key: 0,
|
|
57
|
-
class: "
|
|
91
|
+
class: "flex flex-row"
|
|
92
|
+
};
|
|
93
|
+
const _hoisted_2$8 = ["value"];
|
|
94
|
+
const _hoisted_3$8 = {
|
|
95
|
+
key: 0,
|
|
96
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
+
class: "h-6 w-6",
|
|
98
|
+
fill: "none",
|
|
99
|
+
viewBox: "0 0 24 24",
|
|
100
|
+
stroke: "currentColor"
|
|
58
101
|
};
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
102
|
+
const _hoisted_4$8 = /* @__PURE__ */ createElementVNode("path", {
|
|
103
|
+
"stroke-linecap": "round",
|
|
104
|
+
"stroke-linejoin": "round",
|
|
105
|
+
"stroke-width": "2",
|
|
106
|
+
d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"
|
|
107
|
+
}, null, -1);
|
|
108
|
+
const _hoisted_5$7 = [
|
|
109
|
+
_hoisted_4$8
|
|
110
|
+
];
|
|
111
|
+
const _hoisted_6$6 = {
|
|
112
|
+
key: 1,
|
|
113
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
114
|
+
class: "h-6 w-6",
|
|
115
|
+
fill: "none",
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
stroke: "currentColor"
|
|
65
118
|
};
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
119
|
+
const _hoisted_7$5 = /* @__PURE__ */ createElementVNode("path", {
|
|
120
|
+
"stroke-linecap": "round",
|
|
121
|
+
"stroke-linejoin": "round",
|
|
122
|
+
"stroke-width": "2",
|
|
123
|
+
d: "M13 7l5 5m0 0l-5 5m5-5H6"
|
|
124
|
+
}, null, -1);
|
|
125
|
+
const _hoisted_8$2 = [
|
|
126
|
+
_hoisted_7$5
|
|
127
|
+
];
|
|
128
|
+
const _hoisted_9$2 = ["value"];
|
|
129
|
+
const _hoisted_10$2 = { key: 1 };
|
|
130
|
+
const _hoisted_11$2 = ["onClick"];
|
|
131
|
+
const _hoisted_12$2 = ["onClick"];
|
|
132
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
134
|
+
$props.select ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
72
135
|
withDirectives(createElementVNode("select", {
|
|
73
136
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.src = $event),
|
|
74
|
-
class: "
|
|
75
|
-
onChange: _cache[1] || (_cache[1] = (...args) => $options.
|
|
137
|
+
class: "select select-bordered grow",
|
|
138
|
+
onChange: _cache[1] || (_cache[1] = (...args) => $options.onSelect && $options.onSelect(...args))
|
|
76
139
|
}, [
|
|
77
140
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.select.srcs, (value, key) => {
|
|
78
141
|
return openBlock(), createElementBlock("option", {
|
|
79
142
|
value: key,
|
|
80
143
|
key
|
|
81
|
-
}, toDisplayString(value), 9,
|
|
144
|
+
}, toDisplayString(value), 9, _hoisted_2$8);
|
|
82
145
|
}), 128))
|
|
83
146
|
], 544), [
|
|
84
147
|
[vModelSelect, $data.src]
|
|
85
|
-
])
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true),
|
|
94
|
-
$data.src == "auto" ? (openBlock(), createBlock(_component_b_icon, {
|
|
95
|
-
key: 1,
|
|
96
|
-
icon: "arrow-right"
|
|
97
|
-
})) : createCommentVNode("", true)
|
|
98
|
-
])
|
|
99
|
-
]),
|
|
100
|
-
createElementVNode("div", _hoisted_6$6, [
|
|
148
|
+
]),
|
|
149
|
+
createElementVNode("button", {
|
|
150
|
+
class: "grow-0 ml-2 mr-2",
|
|
151
|
+
onClick: _cache[2] || (_cache[2] = (...args) => $options.swap && $options.swap(...args))
|
|
152
|
+
}, [
|
|
153
|
+
$data.src != "auto" ? (openBlock(), createElementBlock("svg", _hoisted_3$8, _hoisted_5$7)) : createCommentVNode("", true),
|
|
154
|
+
$data.src == "auto" ? (openBlock(), createElementBlock("svg", _hoisted_6$6, _hoisted_8$2)) : createCommentVNode("", true)
|
|
155
|
+
]),
|
|
101
156
|
withDirectives(createElementVNode("select", {
|
|
102
|
-
"onUpdate:modelValue": _cache[
|
|
103
|
-
class: "
|
|
104
|
-
onChange: _cache[
|
|
157
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.target = $event),
|
|
158
|
+
class: "select select-bordered grow",
|
|
159
|
+
onChange: _cache[4] || (_cache[4] = (...args) => $options.onSelect && $options.onSelect(...args))
|
|
105
160
|
}, [
|
|
106
161
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.select.targets, (value, key) => {
|
|
107
162
|
return openBlock(), createElementBlock("option", {
|
|
108
163
|
value: key,
|
|
109
164
|
key
|
|
110
|
-
}, toDisplayString(value), 9,
|
|
165
|
+
}, toDisplayString(value), 9, _hoisted_9$2);
|
|
111
166
|
}), 128))
|
|
112
167
|
], 544), [
|
|
113
168
|
[vModelSelect, $data.target]
|
|
114
169
|
])
|
|
115
|
-
])
|
|
116
|
-
|
|
170
|
+
])) : createCommentVNode("", true),
|
|
171
|
+
$props.select && $data.src && $data.target && $data.recents ? (openBlock(), createElementBlock("p", _hoisted_10$2, [
|
|
172
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.recents.src, (src) => {
|
|
173
|
+
return openBlock(), createElementBlock("span", {
|
|
174
|
+
key: src,
|
|
175
|
+
onClick: ($event) => $options.onRecentSrc(src),
|
|
176
|
+
class: "badge badge-sm ml-1 badge-outline"
|
|
177
|
+
}, toDisplayString($props.select.srcs[src]), 9, _hoisted_11$2);
|
|
178
|
+
}), 128)),
|
|
179
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.recents.target, (target) => {
|
|
180
|
+
return openBlock(), createElementBlock("span", {
|
|
181
|
+
key: target,
|
|
182
|
+
onClick: ($event) => $options.onRecentTarget(target),
|
|
183
|
+
class: "badge badge-sm ml-1 float-right mt-1"
|
|
184
|
+
}, toDisplayString($props.select.targets[target]), 9, _hoisted_12$2);
|
|
185
|
+
}), 128))
|
|
186
|
+
])) : createCommentVNode("", true)
|
|
187
|
+
], 64);
|
|
117
188
|
}
|
|
118
|
-
var
|
|
189
|
+
var Selects = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
|
|
119
190
|
var config = {
|
|
120
191
|
INPUT_MAX_LENGTH: 5e3,
|
|
121
192
|
INPUT_DELAY: 1e3
|
|
@@ -156,12 +227,6 @@ function autoResize(el) {
|
|
|
156
227
|
function setHeigtht(el, height) {
|
|
157
228
|
el.style.height = `${height}px`;
|
|
158
229
|
}
|
|
159
|
-
var helper = {
|
|
160
|
-
isRTL
|
|
161
|
-
};
|
|
162
|
-
function isRTL(locale) {
|
|
163
|
-
return ["ar", "fa", "iw", "yi", "ur", "pa"].indexOf(locale) > -1;
|
|
164
|
-
}
|
|
165
230
|
const LABEL_AUTO_TRANSLATE = "auto_translate";
|
|
166
231
|
const _sfc_main$7 = {
|
|
167
232
|
props: {
|
|
@@ -276,91 +341,141 @@ const _sfc_main$7 = {
|
|
|
276
341
|
}
|
|
277
342
|
}
|
|
278
343
|
};
|
|
279
|
-
const _hoisted_1$7 = { class: "
|
|
280
|
-
const _hoisted_2$
|
|
344
|
+
const _hoisted_1$7 = { class: "relative indicator w-full" };
|
|
345
|
+
const _hoisted_2$7 = {
|
|
281
346
|
key: 0,
|
|
282
|
-
class: "
|
|
347
|
+
class: "absolute top-0 left-0 w-4/5 ml-2 text-sm truncate"
|
|
283
348
|
};
|
|
284
|
-
const _hoisted_3$
|
|
349
|
+
const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("svg", {
|
|
350
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
351
|
+
class: "h-4 w-4 inline",
|
|
352
|
+
fill: "none",
|
|
353
|
+
viewBox: "0 0 24 24",
|
|
354
|
+
stroke: "currentColor"
|
|
355
|
+
}, [
|
|
356
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
357
|
+
"stroke-linecap": "round",
|
|
358
|
+
"stroke-linejoin": "round",
|
|
359
|
+
"stroke-width": "2",
|
|
360
|
+
d: "M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
|
|
361
|
+
})
|
|
362
|
+
], -1);
|
|
363
|
+
const _hoisted_4$7 = [
|
|
364
|
+
_hoisted_3$7
|
|
365
|
+
];
|
|
366
|
+
const _hoisted_5$6 = /* @__PURE__ */ createElementVNode("svg", {
|
|
367
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
368
|
+
class: "h-4 w-4 inline",
|
|
369
|
+
fill: "none",
|
|
370
|
+
viewBox: "0 0 24 24",
|
|
371
|
+
stroke: "currentColor"
|
|
372
|
+
}, [
|
|
373
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
374
|
+
"stroke-linecap": "round",
|
|
375
|
+
"stroke-linejoin": "round",
|
|
376
|
+
"stroke-width": "2",
|
|
377
|
+
d: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
380
|
+
"stroke-linecap": "round",
|
|
381
|
+
"stroke-linejoin": "round",
|
|
382
|
+
"stroke-width": "2",
|
|
383
|
+
d: "M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"
|
|
384
|
+
})
|
|
385
|
+
], -1);
|
|
386
|
+
const _hoisted_6$5 = [
|
|
387
|
+
_hoisted_5$6
|
|
388
|
+
];
|
|
389
|
+
const _hoisted_7$4 = {
|
|
285
390
|
key: 2,
|
|
286
|
-
class: "
|
|
391
|
+
class: "ml-1"
|
|
287
392
|
};
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
|
|
393
|
+
const _hoisted_8$1 = { key: 0 };
|
|
394
|
+
const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("svg", {
|
|
395
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
396
|
+
class: "h-5 w-5",
|
|
397
|
+
fill: "none",
|
|
398
|
+
viewBox: "0 0 24 24",
|
|
399
|
+
stroke: "currentColor"
|
|
400
|
+
}, [
|
|
401
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
402
|
+
"stroke-linecap": "round",
|
|
403
|
+
"stroke-linejoin": "round",
|
|
404
|
+
"stroke-width": "2",
|
|
405
|
+
d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
406
|
+
})
|
|
407
|
+
], -1);
|
|
408
|
+
const _hoisted_10$1 = [
|
|
409
|
+
_hoisted_9$1
|
|
410
|
+
];
|
|
411
|
+
const _hoisted_11$1 = /* @__PURE__ */ createElementVNode("label", {
|
|
291
412
|
for: "auto_translate",
|
|
292
|
-
class: "
|
|
293
|
-
}, "Auto translate", -1);
|
|
294
|
-
const
|
|
413
|
+
class: "text-xs ml-1"
|
|
414
|
+
}, " Auto translate ", -1);
|
|
415
|
+
const _hoisted_12$1 = {
|
|
295
416
|
key: 0,
|
|
296
|
-
class: "float-
|
|
417
|
+
class: "float-right text-xs"
|
|
297
418
|
};
|
|
298
|
-
function _sfc_render$
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
419
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
420
|
+
return openBlock(), createElementBlock("div", null, [
|
|
421
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
422
|
+
$props.data ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
423
|
+
!$data.playing ? (openBlock(), createElementBlock("span", {
|
|
424
|
+
key: 0,
|
|
425
|
+
class: "pointer",
|
|
426
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
|
|
427
|
+
}, _hoisted_4$7)) : createCommentVNode("", true),
|
|
428
|
+
$data.playing ? (openBlock(), createElementBlock("span", {
|
|
429
|
+
key: 1,
|
|
430
|
+
class: "pointer",
|
|
431
|
+
onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
|
|
432
|
+
}, _hoisted_6$5)) : createCommentVNode("", true),
|
|
433
|
+
$props.data.ddictSrc ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString($props.data.ddictSrc), 1)) : createCommentVNode("", true),
|
|
434
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.sentences, (sentence, index) => {
|
|
435
|
+
return openBlock(), createElementBlock("span", {
|
|
436
|
+
key: `${sentence.src_translit}-${index}`,
|
|
437
|
+
class: "text-muted small"
|
|
438
|
+
}, [
|
|
439
|
+
sentence.src_translit ? (openBlock(), createElementBlock("span", _hoisted_8$1, " \u2015 " + toDisplayString(sentence.src_translit), 1)) : createCommentVNode("", true)
|
|
440
|
+
]);
|
|
441
|
+
}), 128))
|
|
308
442
|
])) : createCommentVNode("", true),
|
|
309
|
-
$data.
|
|
443
|
+
$data.input != "" ? (openBlock(), createElementBlock("div", {
|
|
310
444
|
key: 1,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
class: "small pointer position-absolute top-0 end-0",
|
|
330
|
-
onClick: _cache[2] || (_cache[2] = (...args) => $options.clear && $options.clear(...args))
|
|
331
|
-
}, [
|
|
332
|
-
createVNode(_component_b_icon, { icon: "x-circle" })
|
|
333
|
-
])) : createCommentVNode("", true),
|
|
334
|
-
withDirectives(createElementVNode("textarea", {
|
|
335
|
-
id: "input",
|
|
336
|
-
ref: "input",
|
|
337
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.input = $event),
|
|
338
|
-
class: "form-control textarea-src-target",
|
|
339
|
-
style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
|
|
340
|
-
autofocus: ""
|
|
341
|
-
}, "\n ", 4), [
|
|
342
|
-
[
|
|
343
|
-
vModelText,
|
|
344
|
-
$data.input,
|
|
345
|
-
void 0,
|
|
346
|
-
{ trim: true }
|
|
347
|
-
]
|
|
445
|
+
onClick: _cache[2] || (_cache[2] = (...args) => $options.clear && $options.clear(...args)),
|
|
446
|
+
class: "indicator-item m-3"
|
|
447
|
+
}, _hoisted_10$1)) : createCommentVNode("", true),
|
|
448
|
+
withDirectives(createElementVNode("textarea", {
|
|
449
|
+
id: "input",
|
|
450
|
+
ref: "input",
|
|
451
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.input = $event),
|
|
452
|
+
class: "text-lg textarea textarea-bordered w-full pt-5",
|
|
453
|
+
style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
|
|
454
|
+
autofocus: ""
|
|
455
|
+
}, null, 4), [
|
|
456
|
+
[
|
|
457
|
+
vModelText,
|
|
458
|
+
$data.input,
|
|
459
|
+
void 0,
|
|
460
|
+
{ trim: true }
|
|
461
|
+
]
|
|
462
|
+
])
|
|
348
463
|
]),
|
|
349
|
-
createElementVNode("p",
|
|
464
|
+
createElementVNode("p", null, [
|
|
350
465
|
withDirectives(createElementVNode("input", {
|
|
351
|
-
id: "auto_translate",
|
|
352
|
-
class: "form-check-input",
|
|
353
466
|
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.auto_translate = $event),
|
|
354
|
-
|
|
467
|
+
id: "auto_translate",
|
|
468
|
+
type: "checkbox",
|
|
469
|
+
class: "toggle toggle-xs"
|
|
355
470
|
}, null, 512), [
|
|
356
471
|
[vModelCheckbox, $data.auto_translate]
|
|
357
472
|
]),
|
|
358
|
-
|
|
359
|
-
$data.input != "" ? (openBlock(), createElementBlock("
|
|
473
|
+
_hoisted_11$1,
|
|
474
|
+
$data.input != "" ? (openBlock(), createElementBlock("span", _hoisted_12$1, toDisplayString($data.input.length) + " / " + toDisplayString($data.INPUT_MAX_LENGTH), 1)) : createCommentVNode("", true)
|
|
360
475
|
])
|
|
361
476
|
]);
|
|
362
477
|
}
|
|
363
|
-
var
|
|
478
|
+
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
|
|
364
479
|
const _sfc_main$6 = {
|
|
365
480
|
props: {
|
|
366
481
|
data: {
|
|
@@ -376,6 +491,7 @@ const _sfc_main$6 = {
|
|
|
376
491
|
return {
|
|
377
492
|
player: new Audio(),
|
|
378
493
|
playing: false,
|
|
494
|
+
copied: false,
|
|
379
495
|
ttsIndex: 0
|
|
380
496
|
};
|
|
381
497
|
},
|
|
@@ -427,57 +543,139 @@ const _sfc_main$6 = {
|
|
|
427
543
|
this.playing = false;
|
|
428
544
|
this.ttsIndex = 0;
|
|
429
545
|
this.player.pause();
|
|
546
|
+
},
|
|
547
|
+
copy() {
|
|
548
|
+
const val = this.$refs.input.value;
|
|
549
|
+
if (!val)
|
|
550
|
+
return;
|
|
551
|
+
navigator.clipboard.writeText(val);
|
|
552
|
+
this.copied = true;
|
|
553
|
+
setTimeout(() => {
|
|
554
|
+
this.copied = false;
|
|
555
|
+
}, 500);
|
|
430
556
|
}
|
|
431
557
|
}
|
|
432
558
|
};
|
|
433
|
-
const _hoisted_1$6 = { class: "
|
|
434
|
-
const _hoisted_2$
|
|
559
|
+
const _hoisted_1$6 = { class: "relative indicator w-full" };
|
|
560
|
+
const _hoisted_2$6 = {
|
|
435
561
|
key: 0,
|
|
436
|
-
class: "
|
|
562
|
+
class: "absolute top-0 left-0 w-2/3 ml-2 text-sm truncate"
|
|
437
563
|
};
|
|
438
|
-
const _hoisted_3$
|
|
564
|
+
const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("svg", {
|
|
565
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
566
|
+
class: "h-4 w-4 inline",
|
|
567
|
+
fill: "none",
|
|
568
|
+
viewBox: "0 0 24 24",
|
|
569
|
+
stroke: "currentColor"
|
|
570
|
+
}, [
|
|
571
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
572
|
+
"stroke-linecap": "round",
|
|
573
|
+
"stroke-linejoin": "round",
|
|
574
|
+
"stroke-width": "2",
|
|
575
|
+
d: "M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"
|
|
576
|
+
})
|
|
577
|
+
], -1);
|
|
578
|
+
const _hoisted_4$6 = [
|
|
579
|
+
_hoisted_3$6
|
|
580
|
+
];
|
|
581
|
+
const _hoisted_5$5 = /* @__PURE__ */ createElementVNode("svg", {
|
|
582
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
583
|
+
class: "h-4 w-4 inline",
|
|
584
|
+
fill: "none",
|
|
585
|
+
viewBox: "0 0 24 24",
|
|
586
|
+
stroke: "currentColor"
|
|
587
|
+
}, [
|
|
588
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
589
|
+
"stroke-linecap": "round",
|
|
590
|
+
"stroke-linejoin": "round",
|
|
591
|
+
"stroke-width": "2",
|
|
592
|
+
d: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
593
|
+
}),
|
|
594
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
595
|
+
"stroke-linecap": "round",
|
|
596
|
+
"stroke-linejoin": "round",
|
|
597
|
+
"stroke-width": "2",
|
|
598
|
+
d: "M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"
|
|
599
|
+
})
|
|
600
|
+
], -1);
|
|
601
|
+
const _hoisted_6$4 = [
|
|
602
|
+
_hoisted_5$5
|
|
603
|
+
];
|
|
604
|
+
const _hoisted_7$3 = {
|
|
439
605
|
key: 2,
|
|
440
|
-
class: "
|
|
606
|
+
class: "ml-1"
|
|
441
607
|
};
|
|
442
|
-
const
|
|
608
|
+
const _hoisted_8 = {
|
|
609
|
+
key: 0,
|
|
610
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
611
|
+
class: "h-5 w-5",
|
|
612
|
+
fill: "none",
|
|
613
|
+
viewBox: "0 0 24 24",
|
|
614
|
+
stroke: "currentColor"
|
|
615
|
+
};
|
|
616
|
+
const _hoisted_9 = /* @__PURE__ */ createElementVNode("path", {
|
|
617
|
+
"stroke-linecap": "round",
|
|
618
|
+
"stroke-linejoin": "round",
|
|
619
|
+
"stroke-width": "2",
|
|
620
|
+
d: "M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"
|
|
621
|
+
}, null, -1);
|
|
622
|
+
const _hoisted_10 = [
|
|
623
|
+
_hoisted_9
|
|
624
|
+
];
|
|
625
|
+
const _hoisted_11 = {
|
|
443
626
|
key: 1,
|
|
444
|
-
|
|
627
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
628
|
+
class: "h-5 w-5",
|
|
629
|
+
viewBox: "0 0 20 20",
|
|
630
|
+
fill: "currentColor"
|
|
445
631
|
};
|
|
446
|
-
const
|
|
447
|
-
const
|
|
448
|
-
|
|
632
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("path", { d: "M8 2a1 1 0 000 2h2a1 1 0 100-2H8z" }, null, -1);
|
|
633
|
+
const _hoisted_13 = /* @__PURE__ */ createElementVNode("path", { d: "M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z" }, null, -1);
|
|
634
|
+
const _hoisted_14 = [
|
|
635
|
+
_hoisted_12,
|
|
636
|
+
_hoisted_13
|
|
449
637
|
];
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
638
|
+
const _hoisted_15 = { key: 0 };
|
|
639
|
+
const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", { class: "float-right text-xs" }, "Powered by Google Translate", -1);
|
|
640
|
+
const _hoisted_17 = [
|
|
641
|
+
_hoisted_16
|
|
642
|
+
];
|
|
643
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
644
|
+
return openBlock(), createElementBlock("div", null, [
|
|
645
|
+
createElementVNode("div", _hoisted_1$6, [
|
|
646
|
+
$props.data ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
647
|
+
!$data.playing ? (openBlock(), createElementBlock("span", {
|
|
648
|
+
key: 0,
|
|
649
|
+
class: "pointer",
|
|
650
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
|
|
651
|
+
}, _hoisted_4$6)) : createCommentVNode("", true),
|
|
652
|
+
$data.playing ? (openBlock(), createElementBlock("span", {
|
|
653
|
+
key: 1,
|
|
654
|
+
class: "pointer",
|
|
655
|
+
onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
|
|
656
|
+
}, _hoisted_6$4)) : createCommentVNode("", true),
|
|
657
|
+
$props.data.ddictTarget ? (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString($props.data.ddictTarget), 1)) : createCommentVNode("", true)
|
|
460
658
|
])) : createCommentVNode("", true),
|
|
461
|
-
$data
|
|
659
|
+
$props.data != "" ? (openBlock(), createElementBlock("div", {
|
|
462
660
|
key: 1,
|
|
463
|
-
|
|
464
|
-
|
|
661
|
+
onClick: _cache[2] || (_cache[2] = (...args) => $options.copy && $options.copy(...args)),
|
|
662
|
+
class: "indicator-item m-3"
|
|
465
663
|
}, [
|
|
466
|
-
|
|
664
|
+
!$data.copied ? (openBlock(), createElementBlock("svg", _hoisted_8, _hoisted_10)) : createCommentVNode("", true),
|
|
665
|
+
$data.copied ? (openBlock(), createElementBlock("svg", _hoisted_11, _hoisted_14)) : createCommentVNode("", true)
|
|
467
666
|
])) : createCommentVNode("", true),
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
$props.data ? (openBlock(), createElementBlock("p", _hoisted_4$5, _hoisted_6$4)) : createCommentVNode("", true)
|
|
667
|
+
createElementVNode("textarea", {
|
|
668
|
+
ref: "input",
|
|
669
|
+
class: "text-lg textarea textarea-bordered w-full pt-5",
|
|
670
|
+
style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
|
|
671
|
+
readonly: "",
|
|
672
|
+
spellcheck: "false"
|
|
673
|
+
}, null, 4)
|
|
674
|
+
]),
|
|
675
|
+
$props.data ? (openBlock(), createElementBlock("p", _hoisted_15, _hoisted_17)) : createCommentVNode("", true)
|
|
478
676
|
]);
|
|
479
677
|
}
|
|
480
|
-
var
|
|
678
|
+
var Result = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
|
|
481
679
|
const _sfc_main$5 = {
|
|
482
680
|
props: {
|
|
483
681
|
data: {
|
|
@@ -491,40 +689,40 @@ const _sfc_main$5 = {
|
|
|
491
689
|
};
|
|
492
690
|
}
|
|
493
691
|
};
|
|
494
|
-
const _hoisted_1$5 = {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
};
|
|
498
|
-
const
|
|
499
|
-
const
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
692
|
+
const _hoisted_1$5 = { key: 0 };
|
|
693
|
+
const _hoisted_2$5 = { class: "card-body" };
|
|
694
|
+
const _hoisted_3$5 = { class: "card-title font-bold" };
|
|
695
|
+
const _hoisted_4$5 = { class: "list-group list-group-flush" };
|
|
696
|
+
const _hoisted_5$4 = { class: "capitalize font-bold" };
|
|
697
|
+
const _hoisted_6$3 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
|
|
698
|
+
const _hoisted_7$2 = { class: "italic" };
|
|
699
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
700
|
+
return $props.data.definitions ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
701
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
702
|
+
createElementVNode("h2", _hoisted_3$5, toDisplayString($data.name), 1),
|
|
703
|
+
createElementVNode("ul", _hoisted_4$5, [
|
|
704
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.definitions, (dict, index) => {
|
|
705
|
+
return openBlock(), createElementBlock("li", {
|
|
706
|
+
key: `${dict.pos}-${index}`,
|
|
707
|
+
class: "list-group-item mb-2"
|
|
708
|
+
}, [
|
|
709
|
+
createElementVNode("h5", _hoisted_5$4, toDisplayString(dict.pos), 1),
|
|
710
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
|
|
711
|
+
return openBlock(), createElementBlock("div", {
|
|
712
|
+
key: `${entry.definition_id}-${index2}`
|
|
713
|
+
}, [
|
|
714
|
+
createElementVNode("span", null, toDisplayString(entry.gloss), 1),
|
|
715
|
+
_hoisted_6$3,
|
|
716
|
+
createElementVNode("small", _hoisted_7$2, toDisplayString(entry.example), 1)
|
|
717
|
+
]);
|
|
718
|
+
}), 128))
|
|
719
|
+
]);
|
|
720
|
+
}), 128))
|
|
721
|
+
])
|
|
524
722
|
])
|
|
525
723
|
])) : createCommentVNode("", true);
|
|
526
724
|
}
|
|
527
|
-
var
|
|
725
|
+
var DictSrc = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
|
|
528
726
|
const _sfc_main$4 = {
|
|
529
727
|
props: {
|
|
530
728
|
data: {
|
|
@@ -543,42 +741,42 @@ const _sfc_main$4 = {
|
|
|
543
741
|
}
|
|
544
742
|
}
|
|
545
743
|
};
|
|
546
|
-
const _hoisted_1$4 = {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
};
|
|
550
|
-
const
|
|
551
|
-
const
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
744
|
+
const _hoisted_1$4 = { key: 0 };
|
|
745
|
+
const _hoisted_2$4 = { class: "card-body" };
|
|
746
|
+
const _hoisted_3$4 = { class: "card-title" };
|
|
747
|
+
const _hoisted_4$4 = { class: "list-group list-group-flush" };
|
|
748
|
+
const _hoisted_5$3 = { class: "capitalize font-bold" };
|
|
749
|
+
const _hoisted_6$2 = ["onClick"];
|
|
750
|
+
const _hoisted_7$1 = { class: "italic" };
|
|
751
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
752
|
+
return $props.data.dict ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
753
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
754
|
+
createElementVNode("h2", _hoisted_3$4, toDisplayString($data.name), 1),
|
|
755
|
+
createElementVNode("ul", _hoisted_4$4, [
|
|
756
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.dict, (dict, index) => {
|
|
757
|
+
return openBlock(), createElementBlock("li", {
|
|
758
|
+
key: `${dict.pos}-${index}`,
|
|
759
|
+
class: "list-group-item"
|
|
760
|
+
}, [
|
|
761
|
+
createElementVNode("h5", _hoisted_5$3, toDisplayString(dict.pos), 1),
|
|
762
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
|
|
763
|
+
return openBlock(), createElementBlock("div", {
|
|
764
|
+
key: `${entry.word}-${index2}`
|
|
765
|
+
}, [
|
|
766
|
+
createElementVNode("span", {
|
|
767
|
+
class: "badge bg-neutral",
|
|
768
|
+
onClick: ($event) => $options.translate(entry.word)
|
|
769
|
+
}, toDisplayString(entry.word), 9, _hoisted_6$2),
|
|
770
|
+
createElementVNode("small", _hoisted_7$1, " \u2015 " + toDisplayString(entry.reverse_translation.join(", ")), 1)
|
|
771
|
+
]);
|
|
772
|
+
}), 128))
|
|
773
|
+
]);
|
|
774
|
+
}), 128))
|
|
775
|
+
])
|
|
578
776
|
])
|
|
579
777
|
])) : createCommentVNode("", true);
|
|
580
778
|
}
|
|
581
|
-
var
|
|
779
|
+
var DictTarget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
|
|
582
780
|
const _sfc_main$3 = {
|
|
583
781
|
props: {
|
|
584
782
|
data: {
|
|
@@ -588,66 +786,32 @@ const _sfc_main$3 = {
|
|
|
588
786
|
},
|
|
589
787
|
data() {
|
|
590
788
|
return {
|
|
591
|
-
name: "Examples"
|
|
592
|
-
more: false
|
|
789
|
+
name: "Examples"
|
|
593
790
|
};
|
|
594
791
|
}
|
|
595
792
|
};
|
|
596
|
-
const _hoisted_1$3 = {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
};
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
style: { "float": "right" },
|
|
616
|
-
onClick: _cache[0] || (_cache[0] = ($event) => $data.more = true)
|
|
617
|
-
}, [
|
|
618
|
-
createVNode(_component_b_icon, { icon: "arrows-expand" })
|
|
619
|
-
])) : createCommentVNode("", true),
|
|
620
|
-
$props.data.examples.example.length > 1 && $data.more ? (openBlock(), createElementBlock("span", {
|
|
621
|
-
key: 1,
|
|
622
|
-
style: { "float": "right" },
|
|
623
|
-
onClick: _cache[1] || (_cache[1] = ($event) => $data.more = false)
|
|
624
|
-
}, [
|
|
625
|
-
createVNode(_component_b_icon, { icon: "arrows-collapse" })
|
|
626
|
-
])) : createCommentVNode("", true)
|
|
627
|
-
]),
|
|
628
|
-
createElementVNode("ul", _hoisted_3$2, [
|
|
629
|
-
createElementVNode("li", {
|
|
630
|
-
class: "list-group-item",
|
|
631
|
-
innerHTML: $props.data.examples.example[0].text
|
|
632
|
-
}, null, 8, _hoisted_4$2)
|
|
633
|
-
]),
|
|
634
|
-
createVNode(Transition, { name: "fade" }, {
|
|
635
|
-
default: withCtx(() => [
|
|
636
|
-
$data.more ? (openBlock(), createElementBlock("ul", _hoisted_5$2, [
|
|
637
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.examples.example.slice(1), (example2, index) => {
|
|
638
|
-
return openBlock(), createElementBlock("li", {
|
|
639
|
-
key: `${example2.definition_id}-${index}`,
|
|
640
|
-
class: "list-group-item",
|
|
641
|
-
innerHTML: example2.text
|
|
642
|
-
}, null, 8, _hoisted_6$1);
|
|
643
|
-
}), 128))
|
|
644
|
-
])) : createCommentVNode("", true)
|
|
645
|
-
]),
|
|
646
|
-
_: 1
|
|
647
|
-
})
|
|
793
|
+
const _hoisted_1$3 = { key: 0 };
|
|
794
|
+
const _hoisted_2$3 = { class: "card-body" };
|
|
795
|
+
const _hoisted_3$3 = { class: "card-title font-bold" };
|
|
796
|
+
const _hoisted_4$3 = { class: "list-disc" };
|
|
797
|
+
const _hoisted_5$2 = ["innerHTML"];
|
|
798
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
799
|
+
return $props.data.examples ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
800
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
801
|
+
createElementVNode("h2", _hoisted_3$3, toDisplayString($data.name), 1),
|
|
802
|
+
createElementVNode("ul", _hoisted_4$3, [
|
|
803
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.examples.example.slice(1), (example, index) => {
|
|
804
|
+
return openBlock(), createElementBlock("li", {
|
|
805
|
+
key: `${example.definition_id}-${index}`,
|
|
806
|
+
class: "mt-2 ml-2",
|
|
807
|
+
innerHTML: example.text
|
|
808
|
+
}, null, 8, _hoisted_5$2);
|
|
809
|
+
}), 128))
|
|
810
|
+
])
|
|
811
|
+
])
|
|
648
812
|
])) : createCommentVNode("", true);
|
|
649
813
|
}
|
|
650
|
-
var
|
|
814
|
+
var Example = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
|
|
651
815
|
const _sfc_main$2 = {
|
|
652
816
|
props: {
|
|
653
817
|
data: {
|
|
@@ -661,48 +825,48 @@ const _sfc_main$2 = {
|
|
|
661
825
|
};
|
|
662
826
|
}
|
|
663
827
|
};
|
|
664
|
-
const _hoisted_1$2 = {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
};
|
|
668
|
-
const
|
|
669
|
-
const
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
828
|
+
const _hoisted_1$2 = { key: 0 };
|
|
829
|
+
const _hoisted_2$2 = { class: "card-body" };
|
|
830
|
+
const _hoisted_3$2 = { class: "card-title font-bold" };
|
|
831
|
+
const _hoisted_4$2 = { class: "list-group list-group-flush" };
|
|
832
|
+
const _hoisted_5$1 = { class: "capitalize font-bold" };
|
|
833
|
+
const _hoisted_6$1 = ["onClick"];
|
|
834
|
+
const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
|
|
835
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
836
|
+
return $props.data.synsets ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
837
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
838
|
+
createElementVNode("h2", _hoisted_3$2, toDisplayString($data.name), 1),
|
|
839
|
+
createElementVNode("ul", _hoisted_4$2, [
|
|
840
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.synsets, (dict, index) => {
|
|
841
|
+
return openBlock(), createElementBlock("li", {
|
|
842
|
+
key: `${dict.pos}-${index}`,
|
|
843
|
+
class: "list-group-item"
|
|
844
|
+
}, [
|
|
845
|
+
createElementVNode("h5", _hoisted_5$1, toDisplayString(dict.pos), 1),
|
|
846
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
|
|
847
|
+
return openBlock(), createElementBlock("div", {
|
|
848
|
+
key: `${entry.definition_id}-${index2}`
|
|
849
|
+
}, [
|
|
850
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(entry.synonym, (synonym, index3) => {
|
|
851
|
+
return openBlock(), createElementBlock("span", {
|
|
852
|
+
key: `${synonym}-${index3}`
|
|
853
|
+
}, [
|
|
854
|
+
createElementVNode("span", {
|
|
855
|
+
class: "badge bg-neutral ml-1",
|
|
856
|
+
onClick: ($event) => _ctx.$emit("translate", synonym)
|
|
857
|
+
}, toDisplayString(synonym), 9, _hoisted_6$1),
|
|
858
|
+
_hoisted_7
|
|
859
|
+
]);
|
|
860
|
+
}), 128))
|
|
861
|
+
]);
|
|
862
|
+
}), 128))
|
|
863
|
+
]);
|
|
864
|
+
}), 128))
|
|
865
|
+
])
|
|
702
866
|
])
|
|
703
867
|
])) : createCommentVNode("", true);
|
|
704
868
|
}
|
|
705
|
-
var
|
|
869
|
+
var Syno = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
|
|
706
870
|
const _sfc_main$1 = {
|
|
707
871
|
props: {
|
|
708
872
|
data: {
|
|
@@ -716,45 +880,39 @@ const _sfc_main$1 = {
|
|
|
716
880
|
};
|
|
717
881
|
}
|
|
718
882
|
};
|
|
719
|
-
const _hoisted_1$1 = {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
};
|
|
723
|
-
const
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
883
|
+
const _hoisted_1$1 = { key: 0 };
|
|
884
|
+
const _hoisted_2$1 = { class: "card-body" };
|
|
885
|
+
const _hoisted_3$1 = { class: "card-title font-bold" };
|
|
886
|
+
const _hoisted_4$1 = { class: "card-body" };
|
|
887
|
+
const _hoisted_5 = ["onClick"];
|
|
888
|
+
const _hoisted_6 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
|
|
889
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
890
|
+
return $props.data.related_words && $props.data.related_words.word ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
891
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
892
|
+
createElementVNode("h2", _hoisted_3$1, toDisplayString($data.name), 1),
|
|
893
|
+
createElementVNode("div", _hoisted_4$1, [
|
|
894
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.data.related_words.word, (word, index) => {
|
|
895
|
+
return openBlock(), createElementBlock("span", {
|
|
896
|
+
key: `${word}-${index}`
|
|
897
|
+
}, [
|
|
898
|
+
createElementVNode("span", {
|
|
899
|
+
class: "badge bg-neutral",
|
|
900
|
+
onClick: ($event) => _ctx.$emit("translate", word)
|
|
901
|
+
}, toDisplayString(word), 9, _hoisted_5),
|
|
902
|
+
_hoisted_6
|
|
903
|
+
]);
|
|
904
|
+
}), 128))
|
|
905
|
+
])
|
|
742
906
|
])
|
|
743
907
|
])) : createCommentVNode("", true);
|
|
744
908
|
}
|
|
745
|
-
var
|
|
746
|
-
const
|
|
909
|
+
var More = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
|
910
|
+
const _hoisted_1 = { class: "p-1" };
|
|
911
|
+
const _hoisted_2 = { class: "mt-3 grid grid-cols-1 md:grid-cols-2" };
|
|
912
|
+
const _hoisted_3 = { class: "w-full pr-1" };
|
|
913
|
+
const _hoisted_4 = { class: "w-full pl-1" };
|
|
914
|
+
const __default__ = {
|
|
747
915
|
name: "Popup",
|
|
748
|
-
components: {
|
|
749
|
-
appSelects: selects,
|
|
750
|
-
appInput: input,
|
|
751
|
-
appResult: result,
|
|
752
|
-
appDictSrc: dictSrc,
|
|
753
|
-
appDictTarget: dictTarget,
|
|
754
|
-
appExample: example,
|
|
755
|
-
appSyno: syno,
|
|
756
|
-
appMore: more
|
|
757
|
-
},
|
|
758
916
|
props: {
|
|
759
917
|
export_data: {
|
|
760
918
|
type: Object,
|
|
@@ -802,13 +960,13 @@ const _sfc_main = {
|
|
|
802
960
|
this.data = null;
|
|
803
961
|
this.$emit("clear");
|
|
804
962
|
},
|
|
805
|
-
translateReplace(
|
|
806
|
-
return this.translate(
|
|
963
|
+
translateReplace(input) {
|
|
964
|
+
return this.translate(input, true);
|
|
807
965
|
},
|
|
808
|
-
translateSwap(
|
|
809
|
-
return this.translate(
|
|
966
|
+
translateSwap(input) {
|
|
967
|
+
return this.translate(input, true, true);
|
|
810
968
|
},
|
|
811
|
-
translate(
|
|
969
|
+
translate(input, is_replace, is_swap) {
|
|
812
970
|
if (is_swap) {
|
|
813
971
|
if (!this.data.src || this.data.src === "auto" || !this.data.target) {
|
|
814
972
|
return;
|
|
@@ -821,67 +979,81 @@ const _sfc_main = {
|
|
|
821
979
|
window.scrollTo(0, 0);
|
|
822
980
|
this.clear();
|
|
823
981
|
if (is_replace) {
|
|
824
|
-
this.replace =
|
|
982
|
+
this.replace = input;
|
|
825
983
|
}
|
|
826
|
-
this.$emit("translate",
|
|
984
|
+
this.$emit("translate", input);
|
|
827
985
|
},
|
|
828
|
-
|
|
986
|
+
onSelect(select) {
|
|
829
987
|
this.$emit("srctarget", select);
|
|
830
988
|
if (this.data) {
|
|
831
|
-
const
|
|
832
|
-
this.$emit("translate",
|
|
989
|
+
const input = this.data.sentences.map((sentence) => sentence.orig).join("");
|
|
990
|
+
this.$emit("translate", input);
|
|
833
991
|
}
|
|
834
992
|
}
|
|
835
993
|
}
|
|
836
994
|
};
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
|
|
995
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
996
|
+
setup(__props) {
|
|
997
|
+
return (_ctx, _cache) => {
|
|
998
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
999
|
+
createVNode(Selects, {
|
|
1000
|
+
select: _ctx.select,
|
|
1001
|
+
onSelect: _ctx.onSelect
|
|
1002
|
+
}, null, 8, ["select", "onSelect"]),
|
|
1003
|
+
createElementVNode("div", _hoisted_2, [
|
|
1004
|
+
createElementVNode("div", _hoisted_3, [
|
|
1005
|
+
createVNode(Input, {
|
|
1006
|
+
data: _ctx.data,
|
|
1007
|
+
tts: _ctx.tts,
|
|
1008
|
+
replace: _ctx.replace,
|
|
1009
|
+
onTranslate: _ctx.translate,
|
|
1010
|
+
onClear: _ctx.clear
|
|
1011
|
+
}, null, 8, ["data", "tts", "replace", "onTranslate", "onClear"])
|
|
1012
|
+
]),
|
|
1013
|
+
createElementVNode("div", _hoisted_4, [
|
|
1014
|
+
createVNode(Result, {
|
|
1015
|
+
data: _ctx.data,
|
|
1016
|
+
tts: _ctx.tts
|
|
1017
|
+
}, null, 8, ["data", "tts"])
|
|
1018
|
+
])
|
|
1019
|
+
]),
|
|
1020
|
+
_ctx.data ? (openBlock(), createElementBlock("div", {
|
|
1021
|
+
key: 0,
|
|
1022
|
+
class: "mt-3 grid grid-cols-1 md:grid-cols-3 gap-3",
|
|
1023
|
+
style: normalizeStyle({ "text-align": _ctx.rtl ? "right" : "left" })
|
|
1024
|
+
}, [
|
|
1025
|
+
createVNode(DictSrc, {
|
|
1026
|
+
class: "card border",
|
|
1027
|
+
data: _ctx.data
|
|
1028
|
+
}, null, 8, ["data"]),
|
|
1029
|
+
createVNode(DictTarget, {
|
|
1030
|
+
class: "card border",
|
|
1031
|
+
data: _ctx.data,
|
|
1032
|
+
onTranslate: _ctx.translateSwap
|
|
1033
|
+
}, null, 8, ["data", "onTranslate"]),
|
|
1034
|
+
createVNode(Syno, {
|
|
1035
|
+
class: "card border",
|
|
1036
|
+
data: _ctx.data,
|
|
1037
|
+
onTranslate: _ctx.translateReplace
|
|
1038
|
+
}, null, 8, ["data", "onTranslate"]),
|
|
1039
|
+
createVNode(More, {
|
|
1040
|
+
class: "card border",
|
|
1041
|
+
data: _ctx.data,
|
|
1042
|
+
onTranslate: _ctx.translateReplace
|
|
1043
|
+
}, null, 8, ["data", "onTranslate"])
|
|
1044
|
+
], 4)) : createCommentVNode("", true),
|
|
1045
|
+
_ctx.data ? (openBlock(), createElementBlock("div", {
|
|
1046
|
+
key: 1,
|
|
1047
|
+
class: "mt-5 grid grid-cols-1 gap-6",
|
|
1048
|
+
style: normalizeStyle({ "text-align": _ctx.rtl ? "right" : "left" })
|
|
1049
|
+
}, [
|
|
1050
|
+
createVNode(Example, {
|
|
1051
|
+
class: "card border",
|
|
1052
|
+
data: _ctx.data
|
|
1053
|
+
}, null, 8, ["data"])
|
|
1054
|
+
], 4)) : createCommentVNode("", true)
|
|
1055
|
+
]);
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
export { _sfc_main as default };
|