@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 CHANGED
@@ -1,5 +1,10 @@
1
- import { resolveComponent, openBlock, createElementBlock, createElementVNode, withDirectives, Fragment, renderList, toDisplayString, vModelSelect, createBlock, createCommentVNode, createVNode, normalizeStyle, vModelText, vModelCheckbox, createTextVNode, Transition, withCtx } from "vue";
2
- var style = "";
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
- warning: false
27
+ recents: {
28
+ src: [],
29
+ target: []
30
+ }
22
31
  };
23
32
  },
24
33
  watch: {
25
- select() {
26
- this.src = this.select.src;
27
- this.target = this.select.target;
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
- warn() {
32
- this.warning = true;
33
- setTimeout(() => {
34
- this.warning = false;
35
- }, 2e3);
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 (!this.select.srcs.hasOwnProperty(this.target) || !this.select.targets.hasOwnProperty(this.src)) {
39
- this.warn();
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.srctarget();
60
+ this.onSelect();
46
61
  },
47
- srctarget() {
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("srctarget", select);
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: "row justify-content-center mb-2"
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 _hoisted_2$7 = { class: "col-5" };
60
- const _hoisted_3$7 = ["value"];
61
- const _hoisted_4$7 = { class: "col-auto text-center" };
62
- const _hoisted_5$7 = {
63
- id: "swap",
64
- class: "form-control bg-light pointer"
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 _hoisted_6$6 = { class: "col-5" };
67
- const _hoisted_7$1 = ["value"];
68
- function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
69
- const _component_b_icon = resolveComponent("b-icon");
70
- return $props.select ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
71
- createElementVNode("div", _hoisted_2$7, [
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: "form-select",
75
- onChange: _cache[1] || (_cache[1] = (...args) => $options.srctarget && $options.srctarget(...args))
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, _hoisted_3$7);
144
+ }, toDisplayString(value), 9, _hoisted_2$8);
82
145
  }), 128))
83
146
  ], 544), [
84
147
  [vModelSelect, $data.src]
85
- ])
86
- ]),
87
- createElementVNode("div", _hoisted_4$7, [
88
- createElementVNode("span", _hoisted_5$7, [
89
- $data.src != "auto" ? (openBlock(), createBlock(_component_b_icon, {
90
- key: 0,
91
- icon: "arrow-left-right",
92
- onClick: $options.swap
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[2] || (_cache[2] = ($event) => $data.target = $event),
103
- class: "form-select",
104
- onChange: _cache[3] || (_cache[3] = (...args) => $options.srctarget && $options.srctarget(...args))
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, _hoisted_7$1);
165
+ }, toDisplayString(value), 9, _hoisted_9$2);
111
166
  }), 128))
112
167
  ], 544), [
113
168
  [vModelSelect, $data.target]
114
169
  ])
115
- ])
116
- ])) : createCommentVNode("", true);
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 selects = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
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: "col-sm-6 section position-relative" };
280
- const _hoisted_2$6 = {
344
+ const _hoisted_1$7 = { class: "relative indicator w-full" };
345
+ const _hoisted_2$7 = {
281
346
  key: 0,
282
- class: "textarea-src-target-header text-truncate position-absolute top-0 start-20 truncate"
347
+ class: "absolute top-0 left-0 w-4/5 ml-2 text-sm truncate"
283
348
  };
284
- const _hoisted_3$6 = {
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: "text-muted small"
391
+ class: "ml-1"
287
392
  };
288
- const _hoisted_4$6 = { key: 0 };
289
- const _hoisted_5$6 = { class: "small form-check form-switch text-muted textarea-footer" };
290
- const _hoisted_6$5 = /* @__PURE__ */ createElementVNode("label", {
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: "form-check-label small"
293
- }, "Auto translate", -1);
294
- const _hoisted_7 = {
413
+ class: "text-xs ml-1"
414
+ }, " Auto translate ", -1);
415
+ const _hoisted_12$1 = {
295
416
  key: 0,
296
- class: "float-end"
417
+ class: "float-right text-xs"
297
418
  };
298
- function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
299
- const _component_b_icon = resolveComponent("b-icon");
300
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
301
- $props.data ? (openBlock(), createElementBlock("small", _hoisted_2$6, [
302
- !$data.playing ? (openBlock(), createElementBlock("span", {
303
- key: 0,
304
- class: "pointer",
305
- onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
306
- }, [
307
- createVNode(_component_b_icon, { icon: "volume-up" })
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.playing ? (openBlock(), createElementBlock("span", {
443
+ $data.input != "" ? (openBlock(), createElementBlock("div", {
310
444
  key: 1,
311
- class: "pointer",
312
- onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
313
- }, [
314
- createVNode(_component_b_icon, { icon: "volume-off" })
315
- ])) : createCommentVNode("", true),
316
- $props.data.ddictSrc ? (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString($props.data.ddictSrc), 1)) : createCommentVNode("", true),
317
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.sentences, (sentence, index) => {
318
- return openBlock(), createElementBlock("span", {
319
- key: `${sentence.src_translit}-${index}`,
320
- class: "text-muted small"
321
- }, [
322
- sentence.src_translit ? (openBlock(), createElementBlock("span", _hoisted_4$6, " \u2015 " + toDisplayString(sentence.src_translit), 1)) : createCommentVNode("", true)
323
- ]);
324
- }), 128))
325
- ])) : createCommentVNode("", true),
326
- $data.input != "" ? (openBlock(), createElementBlock("span", {
327
- key: 1,
328
- id: "clear",
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", _hoisted_5$6, [
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
- type: "checkbox"
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
- _hoisted_6$5,
359
- $data.input != "" ? (openBlock(), createElementBlock("small", _hoisted_7, toDisplayString($data.input.length) + " / " + toDisplayString($data.INPUT_MAX_LENGTH), 1)) : createCommentVNode("", true)
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 input = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
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: "col-sm-6 section position-relative" };
434
- const _hoisted_2$5 = {
559
+ const _hoisted_1$6 = { class: "relative indicator w-full" };
560
+ const _hoisted_2$6 = {
435
561
  key: 0,
436
- class: "textarea-src-target-header text-truncate position-absolute top-0 start-20 truncate"
562
+ class: "absolute top-0 left-0 w-2/3 ml-2 text-sm truncate"
437
563
  };
438
- const _hoisted_3$5 = {
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: "text-muted small"
606
+ class: "ml-1"
441
607
  };
442
- const _hoisted_4$5 = {
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
- class: "small text-end text-muted textarea-footer"
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 _hoisted_5$5 = /* @__PURE__ */ createElementVNode("small", null, "Powered by Google Translate", -1);
447
- const _hoisted_6$4 = [
448
- _hoisted_5$5
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
- function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
451
- const _component_b_icon = resolveComponent("b-icon");
452
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
453
- $props.data ? (openBlock(), createElementBlock("small", _hoisted_2$5, [
454
- !$data.playing ? (openBlock(), createElementBlock("span", {
455
- key: 0,
456
- class: "pointer",
457
- onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
458
- }, [
459
- createVNode(_component_b_icon, { icon: "volume-up" })
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.playing ? (openBlock(), createElementBlock("span", {
659
+ $props.data != "" ? (openBlock(), createElementBlock("div", {
462
660
  key: 1,
463
- class: "pointer",
464
- onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
661
+ onClick: _cache[2] || (_cache[2] = (...args) => $options.copy && $options.copy(...args)),
662
+ class: "indicator-item m-3"
465
663
  }, [
466
- createVNode(_component_b_icon, { icon: "volume-off" })
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
- $props.data.ddictTarget ? (openBlock(), createElementBlock("span", _hoisted_3$5, toDisplayString($props.data.ddictTarget), 1)) : createCommentVNode("", true)
469
- ])) : createCommentVNode("", true),
470
- createElementVNode("textarea", {
471
- ref: "input",
472
- class: "form-control textarea-src-target",
473
- style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
474
- readonly: "",
475
- spellcheck: "false"
476
- }, null, 4),
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 result = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
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
- key: 0,
496
- class: "card border-success text-success section"
497
- };
498
- const _hoisted_2$4 = { class: "card-header" };
499
- const _hoisted_3$4 = { class: "list-group list-group-flush" };
500
- const _hoisted_4$4 = { class: "card-title text-muted title" };
501
- const _hoisted_5$4 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
502
- const _hoisted_6$3 = { class: "text-muted" };
503
- function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
504
- return $props.data && $props.data.definitions ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
505
- createElementVNode("div", _hoisted_2$4, toDisplayString($data.name), 1),
506
- createElementVNode("ul", _hoisted_3$4, [
507
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.definitions, (dict, index) => {
508
- return openBlock(), createElementBlock("li", {
509
- key: `${dict.pos}-${index}`,
510
- class: "list-group-item"
511
- }, [
512
- createElementVNode("h5", _hoisted_4$4, toDisplayString(dict.pos), 1),
513
- (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
514
- return openBlock(), createElementBlock("div", {
515
- key: `${entry.definition_id}-${index2}`
516
- }, [
517
- createElementVNode("span", null, toDisplayString(entry.gloss), 1),
518
- _hoisted_5$4,
519
- createElementVNode("small", _hoisted_6$3, toDisplayString(entry.example), 1)
520
- ]);
521
- }), 128))
522
- ]);
523
- }), 128))
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 dictSrc = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
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
- key: 0,
548
- class: "card border-primary text-primary section"
549
- };
550
- const _hoisted_2$3 = { class: "card-header" };
551
- const _hoisted_3$3 = { class: "list-group list-group-flush" };
552
- const _hoisted_4$3 = { class: "card-title text-muted title" };
553
- const _hoisted_5$3 = ["onClick"];
554
- const _hoisted_6$2 = { class: "text-muted" };
555
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
556
- return $props.data && $props.data.dict ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
557
- createElementVNode("div", _hoisted_2$3, toDisplayString($data.name), 1),
558
- createElementVNode("ul", _hoisted_3$3, [
559
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.dict, (dict, index) => {
560
- return openBlock(), createElementBlock("li", {
561
- key: `${dict.pos}-${index}`,
562
- class: "list-group-item"
563
- }, [
564
- createElementVNode("h5", _hoisted_4$3, toDisplayString(dict.pos), 1),
565
- (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
566
- return openBlock(), createElementBlock("div", {
567
- key: `${entry.word}-${index2}`
568
- }, [
569
- createElementVNode("span", {
570
- class: "badge bg-primary",
571
- onClick: ($event) => $options.translate(entry.word)
572
- }, toDisplayString(entry.word), 9, _hoisted_5$3),
573
- createElementVNode("small", _hoisted_6$2, " \u2015 " + toDisplayString(entry.reverse_translation.join(", ")), 1)
574
- ]);
575
- }), 128))
576
- ]);
577
- }), 128))
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 dictTarget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
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
- key: 0,
598
- class: "card border-dark text-dark section"
599
- };
600
- const _hoisted_2$2 = { class: "card-header" };
601
- const _hoisted_3$2 = { class: "list-group list-group-flush" };
602
- const _hoisted_4$2 = ["innerHTML"];
603
- const _hoisted_5$2 = {
604
- key: 0,
605
- class: "list-group list-group-flush"
606
- };
607
- const _hoisted_6$1 = ["innerHTML"];
608
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
609
- const _component_b_icon = resolveComponent("b-icon");
610
- return $props.data && $props.data.examples ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
611
- createElementVNode("div", _hoisted_2$2, [
612
- createTextVNode(toDisplayString($data.name) + " ", 1),
613
- $props.data.examples.example.length > 1 && !$data.more ? (openBlock(), createElementBlock("span", {
614
- key: 0,
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 example = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
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
- key: 0,
666
- class: "card border-info text-info section"
667
- };
668
- const _hoisted_2$1 = { class: "card-header" };
669
- const _hoisted_3$1 = { class: "list-group list-group-flush" };
670
- const _hoisted_4$1 = { class: "card-title text-muted title" };
671
- const _hoisted_5$1 = ["onClick"];
672
- const _hoisted_6 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
673
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
674
- return $props.data && $props.data.synsets ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
675
- createElementVNode("div", _hoisted_2$1, toDisplayString($data.name), 1),
676
- createElementVNode("ul", _hoisted_3$1, [
677
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.synsets, (dict, index) => {
678
- return openBlock(), createElementBlock("li", {
679
- key: `${dict.pos}-${index}`,
680
- class: "list-group-item"
681
- }, [
682
- createElementVNode("h5", _hoisted_4$1, toDisplayString(dict.pos), 1),
683
- (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
684
- return openBlock(), createElementBlock("div", {
685
- key: `${entry.definition_id}-${index2}`
686
- }, [
687
- (openBlock(true), createElementBlock(Fragment, null, renderList(entry.synonym, (synonym, index3) => {
688
- return openBlock(), createElementBlock("span", {
689
- key: `${synonym}-${index3}`
690
- }, [
691
- createElementVNode("span", {
692
- class: "badge bg-info clickable-badge",
693
- onClick: ($event) => _ctx.$emit("translate", synonym)
694
- }, toDisplayString(synonym), 9, _hoisted_5$1),
695
- _hoisted_6
696
- ]);
697
- }), 128))
698
- ]);
699
- }), 128))
700
- ]);
701
- }), 128))
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 syno = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
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
- key: 0,
721
- class: "card border-secondary text-secondary section"
722
- };
723
- const _hoisted_2 = { class: "card-header" };
724
- const _hoisted_3 = { class: "card-body" };
725
- const _hoisted_4 = ["onClick"];
726
- const _hoisted_5 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
727
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
728
- return $props.data && $props.data.related_words && $props.data.related_words.word ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
729
- createElementVNode("div", _hoisted_2, toDisplayString($data.name), 1),
730
- createElementVNode("div", _hoisted_3, [
731
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.related_words.word, (word, index) => {
732
- return openBlock(), createElementBlock("span", {
733
- key: `${word}-${index}`
734
- }, [
735
- createElementVNode("span", {
736
- class: "badge bg-secondary clickable-badge",
737
- onClick: ($event) => _ctx.$emit("translate", word)
738
- }, toDisplayString(word), 9, _hoisted_4),
739
- _hoisted_5
740
- ]);
741
- }), 128))
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 more = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
746
- const _sfc_main = {
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(input2) {
806
- return this.translate(input2, true);
963
+ translateReplace(input) {
964
+ return this.translate(input, true);
807
965
  },
808
- translateSwap(input2) {
809
- return this.translate(input2, true, true);
966
+ translateSwap(input) {
967
+ return this.translate(input, true, true);
810
968
  },
811
- translate(input2, is_replace, is_swap) {
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 = input2;
982
+ this.replace = input;
825
983
  }
826
- this.$emit("translate", input2);
984
+ this.$emit("translate", input);
827
985
  },
828
- srctarget(select) {
986
+ onSelect(select) {
829
987
  this.$emit("srctarget", select);
830
988
  if (this.data) {
831
- const input2 = this.data.sentences.map((sentence) => sentence.orig).join("");
832
- this.$emit("translate", input2);
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 _hoisted_1 = { class: "row section" };
838
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
839
- const _component_app_selects = resolveComponent("app-selects");
840
- const _component_app_input = resolveComponent("app-input");
841
- const _component_app_result = resolveComponent("app-result");
842
- const _component_app_dict_target = resolveComponent("app-dict-target");
843
- const _component_app_dict_src = resolveComponent("app-dict-src");
844
- const _component_app_syno = resolveComponent("app-syno");
845
- const _component_app_more = resolveComponent("app-more");
846
- const _component_app_example = resolveComponent("app-example");
847
- return openBlock(), createElementBlock("div", null, [
848
- createVNode(_component_app_selects, {
849
- select: $data.select,
850
- onSrctarget: $options.srctarget
851
- }, null, 8, ["select", "onSrctarget"]),
852
- createElementVNode("div", _hoisted_1, [
853
- createVNode(_component_app_input, {
854
- data: $data.data,
855
- tts: $data.tts,
856
- replace: $data.replace,
857
- onTranslate: $options.translate,
858
- onClear: $options.clear
859
- }, null, 8, ["data", "tts", "replace", "onTranslate", "onClear"]),
860
- createVNode(_component_app_result, {
861
- data: $data.data,
862
- tts: $data.tts
863
- }, null, 8, ["data", "tts"])
864
- ]),
865
- createElementVNode("div", {
866
- class: "card-columns",
867
- style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" })
868
- }, [
869
- createVNode(_component_app_dict_target, {
870
- data: $data.data,
871
- onTranslate: $options.translateSwap
872
- }, null, 8, ["data", "onTranslate"]),
873
- createVNode(_component_app_dict_src, { data: $data.data }, null, 8, ["data"]),
874
- createVNode(_component_app_syno, {
875
- data: $data.data,
876
- onTranslate: $options.translateReplace
877
- }, null, 8, ["data", "onTranslate"]),
878
- createVNode(_component_app_more, {
879
- data: $data.data,
880
- onTranslate: $options.translateReplace
881
- }, null, 8, ["data", "onTranslate"]),
882
- createVNode(_component_app_example, { data: $data.data }, null, 8, ["data"])
883
- ], 4)
884
- ]);
885
- }
886
- var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
887
- export { Popup as default };
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 };