@ddict/popup 0.3.19 → 1.0.3

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,183 @@ 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$5 = {
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 = {
130
+ key: 1,
131
+ class: "flex flex-row"
132
+ };
133
+ const _hoisted_11$2 = { class: "grow" };
134
+ const _hoisted_12$2 = ["onClick"];
135
+ const _hoisted_13$1 = { class: "grow" };
136
+ const _hoisted_14$1 = ["onClick"];
137
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
138
+ return openBlock(), createElementBlock(Fragment, null, [
139
+ $props.select ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
72
140
  withDirectives(createElementVNode("select", {
73
141
  "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))
142
+ class: "select select-bordered grow",
143
+ onChange: _cache[1] || (_cache[1] = (...args) => $options.onSelect && $options.onSelect(...args))
76
144
  }, [
77
145
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.select.srcs, (value, key) => {
78
146
  return openBlock(), createElementBlock("option", {
79
147
  value: key,
80
148
  key
81
- }, toDisplayString(value), 9, _hoisted_3$7);
149
+ }, toDisplayString(value), 9, _hoisted_2$8);
82
150
  }), 128))
83
151
  ], 544), [
84
152
  [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, [
153
+ ]),
154
+ createElementVNode("button", {
155
+ class: "grow-0 ml-2 mr-2",
156
+ onClick: _cache[2] || (_cache[2] = (...args) => $options.swap && $options.swap(...args))
157
+ }, [
158
+ $data.src != "auto" ? (openBlock(), createElementBlock("svg", _hoisted_3$8, _hoisted_5$7)) : createCommentVNode("", true),
159
+ $data.src == "auto" ? (openBlock(), createElementBlock("svg", _hoisted_6$5, _hoisted_8$2)) : createCommentVNode("", true)
160
+ ]),
101
161
  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))
162
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.target = $event),
163
+ class: "select select-bordered grow",
164
+ onChange: _cache[4] || (_cache[4] = (...args) => $options.onSelect && $options.onSelect(...args))
105
165
  }, [
106
166
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.select.targets, (value, key) => {
107
167
  return openBlock(), createElementBlock("option", {
108
168
  value: key,
109
169
  key
110
- }, toDisplayString(value), 9, _hoisted_7$1);
170
+ }, toDisplayString(value), 9, _hoisted_9$2);
111
171
  }), 128))
112
172
  ], 544), [
113
173
  [vModelSelect, $data.target]
114
174
  ])
115
- ])
116
- ])) : createCommentVNode("", true);
175
+ ])) : createCommentVNode("", true),
176
+ $props.select && $data.src && $data.target && $data.recents ? (openBlock(), createElementBlock("div", _hoisted_10$2, [
177
+ createElementVNode("div", _hoisted_11$2, [
178
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.recents.src, (src) => {
179
+ return openBlock(), createElementBlock("span", {
180
+ key: src,
181
+ onClick: ($event) => $options.onRecentSrc(src),
182
+ class: "badge badge-sm ml-1 badge-outline"
183
+ }, toDisplayString($props.select.srcs[src]), 9, _hoisted_12$2);
184
+ }), 128))
185
+ ]),
186
+ createElementVNode("div", _hoisted_13$1, [
187
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.recents.target, (target) => {
188
+ return openBlock(), createElementBlock("span", {
189
+ key: target,
190
+ onClick: ($event) => $options.onRecentTarget(target),
191
+ class: "badge badge-sm ml-1 float-right mt-1"
192
+ }, toDisplayString($props.select.targets[target]), 9, _hoisted_14$1);
193
+ }), 128))
194
+ ])
195
+ ])) : createCommentVNode("", true)
196
+ ], 64);
117
197
  }
118
- var selects = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
198
+ var Selects = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
119
199
  var config = {
120
200
  INPUT_MAX_LENGTH: 5e3,
121
201
  INPUT_DELAY: 1e3
@@ -156,12 +236,6 @@ function autoResize(el) {
156
236
  function setHeigtht(el, height) {
157
237
  el.style.height = `${height}px`;
158
238
  }
159
- var helper = {
160
- isRTL
161
- };
162
- function isRTL(locale) {
163
- return ["ar", "fa", "iw", "yi", "ur", "pa"].indexOf(locale) > -1;
164
- }
165
239
  const LABEL_AUTO_TRANSLATE = "auto_translate";
166
240
  const _sfc_main$7 = {
167
241
  props: {
@@ -276,91 +350,133 @@ const _sfc_main$7 = {
276
350
  }
277
351
  }
278
352
  };
279
- const _hoisted_1$7 = { class: "col-sm-6 section position-relative" };
280
- const _hoisted_2$6 = {
353
+ const _hoisted_1$7 = { class: "relative indicator w-full" };
354
+ const _hoisted_2$7 = {
281
355
  key: 0,
282
- class: "textarea-src-target-header text-truncate position-absolute top-0 start-20 truncate"
356
+ class: "absolute top-0 left-0 w-4/5 ml-2 text-sm truncate"
283
357
  };
284
- const _hoisted_3$6 = {
358
+ const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("svg", {
359
+ xmlns: "http://www.w3.org/2000/svg",
360
+ class: "h-4 w-4 inline",
361
+ fill: "none",
362
+ viewBox: "0 0 24 24",
363
+ stroke: "currentColor"
364
+ }, [
365
+ /* @__PURE__ */ createElementVNode("path", {
366
+ "stroke-linecap": "round",
367
+ "stroke-linejoin": "round",
368
+ "stroke-width": "2",
369
+ 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"
370
+ })
371
+ ], -1);
372
+ const _hoisted_4$7 = [
373
+ _hoisted_3$7
374
+ ];
375
+ const _hoisted_5$6 = /* @__PURE__ */ createElementVNode("svg", {
376
+ xmlns: "http://www.w3.org/2000/svg",
377
+ class: "h-4 w-4 inline",
378
+ fill: "none",
379
+ viewBox: "0 0 24 24",
380
+ stroke: "currentColor"
381
+ }, [
382
+ /* @__PURE__ */ createElementVNode("path", {
383
+ "stroke-linecap": "round",
384
+ "stroke-linejoin": "round",
385
+ "stroke-width": "2",
386
+ d: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
387
+ }),
388
+ /* @__PURE__ */ createElementVNode("path", {
389
+ "stroke-linecap": "round",
390
+ "stroke-linejoin": "round",
391
+ "stroke-width": "2",
392
+ d: "M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"
393
+ })
394
+ ], -1);
395
+ const _hoisted_6$4 = [
396
+ _hoisted_5$6
397
+ ];
398
+ const _hoisted_7$4 = {
285
399
  key: 2,
286
- class: "text-muted small"
287
- };
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", {
291
- for: "auto_translate",
292
- class: "form-check-label small"
293
- }, "Auto translate", -1);
294
- const _hoisted_7 = {
295
- key: 0,
296
- class: "float-end"
400
+ class: "ml-1"
297
401
  };
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" })
402
+ const _hoisted_8$1 = { key: 0 };
403
+ const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("svg", {
404
+ xmlns: "http://www.w3.org/2000/svg",
405
+ class: "h-5 w-5",
406
+ fill: "none",
407
+ viewBox: "0 0 24 24",
408
+ stroke: "currentColor"
409
+ }, [
410
+ /* @__PURE__ */ createElementVNode("path", {
411
+ "stroke-linecap": "round",
412
+ "stroke-linejoin": "round",
413
+ "stroke-width": "2",
414
+ d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
415
+ })
416
+ ], -1);
417
+ const _hoisted_10$1 = [
418
+ _hoisted_9$1
419
+ ];
420
+ const _hoisted_11$1 = { class: "cursor-pointer label justify-start" };
421
+ const _hoisted_12$1 = /* @__PURE__ */ createElementVNode("span", { class: "ml-1 label-text text-xs" }, "Auto translate", -1);
422
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
423
+ return openBlock(), createElementBlock("div", null, [
424
+ createElementVNode("div", _hoisted_1$7, [
425
+ $props.data ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
426
+ !$data.playing ? (openBlock(), createElementBlock("span", {
427
+ key: 0,
428
+ class: "pointer",
429
+ onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
430
+ }, _hoisted_4$7)) : createCommentVNode("", true),
431
+ $data.playing ? (openBlock(), createElementBlock("span", {
432
+ key: 1,
433
+ class: "pointer",
434
+ onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
435
+ }, _hoisted_6$4)) : createCommentVNode("", true),
436
+ $props.data.ddictSrc ? (openBlock(), createElementBlock("span", _hoisted_7$4, toDisplayString($props.data.ddictSrc), 1)) : createCommentVNode("", true),
437
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.sentences, (sentence, index) => {
438
+ return openBlock(), createElementBlock("span", {
439
+ key: `${sentence.src_translit}-${index}`,
440
+ class: "italic"
441
+ }, [
442
+ sentence.src_translit ? (openBlock(), createElementBlock("span", _hoisted_8$1, " \u2015 " + toDisplayString(sentence.src_translit), 1)) : createCommentVNode("", true)
443
+ ]);
444
+ }), 128))
308
445
  ])) : createCommentVNode("", true),
309
- $data.playing ? (openBlock(), createElementBlock("span", {
446
+ $data.input != "" ? (openBlock(), createElementBlock("div", {
310
447
  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
- ]
448
+ onClick: _cache[2] || (_cache[2] = (...args) => $options.clear && $options.clear(...args)),
449
+ class: "indicator-item m-3"
450
+ }, _hoisted_10$1)) : createCommentVNode("", true),
451
+ withDirectives(createElementVNode("textarea", {
452
+ id: "input",
453
+ ref: "input",
454
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.input = $event),
455
+ class: "text-lg textarea textarea-bordered w-full pt-5",
456
+ style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
457
+ autofocus: ""
458
+ }, null, 4), [
459
+ [
460
+ vModelText,
461
+ $data.input,
462
+ void 0,
463
+ { trim: true }
464
+ ]
465
+ ])
348
466
  ]),
349
- createElementVNode("p", _hoisted_5$6, [
467
+ createElementVNode("label", _hoisted_11$1, [
350
468
  withDirectives(createElementVNode("input", {
351
- id: "auto_translate",
352
- class: "form-check-input",
353
469
  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.auto_translate = $event),
354
- type: "checkbox"
470
+ type: "checkbox",
471
+ class: "toggle toggle-xs"
355
472
  }, null, 512), [
356
473
  [vModelCheckbox, $data.auto_translate]
357
474
  ]),
358
- _hoisted_6$5,
359
- $data.input != "" ? (openBlock(), createElementBlock("small", _hoisted_7, toDisplayString($data.input.length) + " / " + toDisplayString($data.INPUT_MAX_LENGTH), 1)) : createCommentVNode("", true)
475
+ _hoisted_12$1
360
476
  ])
361
477
  ]);
362
478
  }
363
- var input = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
479
+ var Input = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
364
480
  const _sfc_main$6 = {
365
481
  props: {
366
482
  data: {
@@ -376,6 +492,7 @@ const _sfc_main$6 = {
376
492
  return {
377
493
  player: new Audio(),
378
494
  playing: false,
495
+ copied: false,
379
496
  ttsIndex: 0
380
497
  };
381
498
  },
@@ -427,57 +544,142 @@ const _sfc_main$6 = {
427
544
  this.playing = false;
428
545
  this.ttsIndex = 0;
429
546
  this.player.pause();
547
+ },
548
+ copy() {
549
+ const val = this.$refs.input.value;
550
+ if (!val)
551
+ return;
552
+ navigator.clipboard.writeText(val);
553
+ this.copied = true;
554
+ setTimeout(() => {
555
+ this.copied = false;
556
+ }, 500);
430
557
  }
431
558
  }
432
559
  };
433
- const _hoisted_1$6 = { class: "col-sm-6 section position-relative" };
434
- const _hoisted_2$5 = {
560
+ const _hoisted_1$6 = { class: "relative indicator w-full" };
561
+ const _hoisted_2$6 = {
435
562
  key: 0,
436
- class: "textarea-src-target-header text-truncate position-absolute top-0 start-20 truncate"
563
+ class: "absolute top-0 left-0 w-2/3 ml-2 text-sm truncate"
437
564
  };
438
- const _hoisted_3$5 = {
565
+ const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("svg", {
566
+ xmlns: "http://www.w3.org/2000/svg",
567
+ class: "h-4 w-4 inline",
568
+ fill: "none",
569
+ viewBox: "0 0 24 24",
570
+ stroke: "currentColor"
571
+ }, [
572
+ /* @__PURE__ */ createElementVNode("path", {
573
+ "stroke-linecap": "round",
574
+ "stroke-linejoin": "round",
575
+ "stroke-width": "2",
576
+ 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"
577
+ })
578
+ ], -1);
579
+ const _hoisted_4$6 = [
580
+ _hoisted_3$6
581
+ ];
582
+ const _hoisted_5$5 = /* @__PURE__ */ createElementVNode("svg", {
583
+ xmlns: "http://www.w3.org/2000/svg",
584
+ class: "h-4 w-4 inline",
585
+ fill: "none",
586
+ viewBox: "0 0 24 24",
587
+ stroke: "currentColor"
588
+ }, [
589
+ /* @__PURE__ */ createElementVNode("path", {
590
+ "stroke-linecap": "round",
591
+ "stroke-linejoin": "round",
592
+ "stroke-width": "2",
593
+ d: "M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
594
+ }),
595
+ /* @__PURE__ */ createElementVNode("path", {
596
+ "stroke-linecap": "round",
597
+ "stroke-linejoin": "round",
598
+ "stroke-width": "2",
599
+ d: "M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"
600
+ })
601
+ ], -1);
602
+ const _hoisted_6$3 = [
603
+ _hoisted_5$5
604
+ ];
605
+ const _hoisted_7$3 = {
439
606
  key: 2,
440
- class: "text-muted small"
607
+ class: "ml-1"
441
608
  };
442
- const _hoisted_4$5 = {
609
+ const _hoisted_8 = {
610
+ key: 0,
611
+ xmlns: "http://www.w3.org/2000/svg",
612
+ class: "h-5 w-5",
613
+ fill: "none",
614
+ viewBox: "0 0 24 24",
615
+ stroke: "currentColor"
616
+ };
617
+ const _hoisted_9 = /* @__PURE__ */ createElementVNode("path", {
618
+ "stroke-linecap": "round",
619
+ "stroke-linejoin": "round",
620
+ "stroke-width": "2",
621
+ 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"
622
+ }, null, -1);
623
+ const _hoisted_10 = [
624
+ _hoisted_9
625
+ ];
626
+ const _hoisted_11 = {
443
627
  key: 1,
444
- class: "small text-end text-muted textarea-footer"
628
+ xmlns: "http://www.w3.org/2000/svg",
629
+ class: "h-5 w-5",
630
+ viewBox: "0 0 20 20",
631
+ fill: "currentColor"
445
632
  };
446
- const _hoisted_5$5 = /* @__PURE__ */ createElementVNode("small", null, "Powered by Google Translate", -1);
447
- const _hoisted_6$4 = [
448
- _hoisted_5$5
633
+ const _hoisted_12 = /* @__PURE__ */ createElementVNode("path", { d: "M8 2a1 1 0 000 2h2a1 1 0 100-2H8z" }, null, -1);
634
+ 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);
635
+ const _hoisted_14 = [
636
+ _hoisted_12,
637
+ _hoisted_13
449
638
  ];
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" })
639
+ const _hoisted_15 = {
640
+ key: 0,
641
+ class: "label justify-end"
642
+ };
643
+ const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", { class: "text-xs" }, "Powered by Google Translate.", -1);
644
+ const _hoisted_17 = [
645
+ _hoisted_16
646
+ ];
647
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
648
+ return openBlock(), createElementBlock("div", null, [
649
+ createElementVNode("div", _hoisted_1$6, [
650
+ $props.data ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
651
+ !$data.playing ? (openBlock(), createElementBlock("span", {
652
+ key: 0,
653
+ class: "pointer",
654
+ onClick: _cache[0] || (_cache[0] = (...args) => $options.play && $options.play(...args))
655
+ }, _hoisted_4$6)) : createCommentVNode("", true),
656
+ $data.playing ? (openBlock(), createElementBlock("span", {
657
+ key: 1,
658
+ class: "pointer",
659
+ onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
660
+ }, _hoisted_6$3)) : createCommentVNode("", true),
661
+ $props.data.ddictTarget ? (openBlock(), createElementBlock("span", _hoisted_7$3, toDisplayString($props.data.ddictTarget), 1)) : createCommentVNode("", true)
460
662
  ])) : createCommentVNode("", true),
461
- $data.playing ? (openBlock(), createElementBlock("span", {
663
+ $props.data ? (openBlock(), createElementBlock("div", {
462
664
  key: 1,
463
- class: "pointer",
464
- onClick: _cache[1] || (_cache[1] = (...args) => $options.stop && $options.stop(...args))
665
+ onClick: _cache[2] || (_cache[2] = (...args) => $options.copy && $options.copy(...args)),
666
+ class: "indicator-item m-3"
465
667
  }, [
466
- createVNode(_component_b_icon, { icon: "volume-off" })
668
+ !$data.copied ? (openBlock(), createElementBlock("svg", _hoisted_8, _hoisted_10)) : createCommentVNode("", true),
669
+ $data.copied ? (openBlock(), createElementBlock("svg", _hoisted_11, _hoisted_14)) : createCommentVNode("", true)
467
670
  ])) : 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)
671
+ createElementVNode("textarea", {
672
+ ref: "input",
673
+ class: "text-lg textarea textarea-bordered w-full pt-5",
674
+ style: normalizeStyle({ "text-align": $options.rtl ? "right" : "left" }),
675
+ readonly: "",
676
+ spellcheck: "false"
677
+ }, null, 4)
678
+ ]),
679
+ $props.data ? (openBlock(), createElementBlock("p", _hoisted_15, _hoisted_17)) : createCommentVNode("", true)
478
680
  ]);
479
681
  }
480
- var result = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
682
+ var Result = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
481
683
  const _sfc_main$5 = {
482
684
  props: {
483
685
  data: {
@@ -491,40 +693,40 @@ const _sfc_main$5 = {
491
693
  };
492
694
  }
493
695
  };
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))
696
+ const _hoisted_1$5 = { key: 0 };
697
+ const _hoisted_2$5 = { class: "card-body p-4" };
698
+ const _hoisted_3$5 = { class: "card-title font-bold" };
699
+ const _hoisted_4$5 = { class: "list-group list-group-flush" };
700
+ const _hoisted_5$4 = { class: "capitalize font-bold" };
701
+ const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
702
+ const _hoisted_7$2 = { class: "italic" };
703
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
704
+ return $props.data.definitions ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
705
+ createElementVNode("div", _hoisted_2$5, [
706
+ createElementVNode("h2", _hoisted_3$5, toDisplayString($data.name), 1),
707
+ createElementVNode("ul", _hoisted_4$5, [
708
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.definitions, (dict, index) => {
709
+ return openBlock(), createElementBlock("li", {
710
+ key: `${dict.pos}-${index}`,
711
+ class: "list-group-item mb-2"
712
+ }, [
713
+ createElementVNode("h5", _hoisted_5$4, toDisplayString(dict.pos), 1),
714
+ (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
715
+ return openBlock(), createElementBlock("div", {
716
+ key: `${entry.definition_id}-${index2}`
717
+ }, [
718
+ createElementVNode("span", null, toDisplayString(entry.gloss), 1),
719
+ _hoisted_6$2,
720
+ createElementVNode("small", _hoisted_7$2, toDisplayString(entry.example), 1)
721
+ ]);
722
+ }), 128))
723
+ ]);
724
+ }), 128))
725
+ ])
524
726
  ])
525
727
  ])) : createCommentVNode("", true);
526
728
  }
527
- var dictSrc = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
729
+ var DictSrc = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
528
730
  const _sfc_main$4 = {
529
731
  props: {
530
732
  data: {
@@ -543,42 +745,42 @@ const _sfc_main$4 = {
543
745
  }
544
746
  }
545
747
  };
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))
748
+ const _hoisted_1$4 = { key: 0 };
749
+ const _hoisted_2$4 = { class: "card-body p-4" };
750
+ const _hoisted_3$4 = { class: "card-title" };
751
+ const _hoisted_4$4 = { class: "list-group list-group-flush" };
752
+ const _hoisted_5$3 = { class: "capitalize font-bold" };
753
+ const _hoisted_6$1 = ["onClick"];
754
+ const _hoisted_7$1 = { class: "italic" };
755
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
756
+ return $props.data.dict ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
757
+ createElementVNode("div", _hoisted_2$4, [
758
+ createElementVNode("h2", _hoisted_3$4, toDisplayString($data.name), 1),
759
+ createElementVNode("ul", _hoisted_4$4, [
760
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.dict, (dict, index) => {
761
+ return openBlock(), createElementBlock("li", {
762
+ key: `${dict.pos}-${index}`,
763
+ class: "list-group-item mb-2"
764
+ }, [
765
+ createElementVNode("h5", _hoisted_5$3, toDisplayString(dict.pos), 1),
766
+ (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
767
+ return openBlock(), createElementBlock("div", {
768
+ key: `${entry.word}-${index2}`
769
+ }, [
770
+ createElementVNode("span", {
771
+ class: "badge bg-neutral",
772
+ onClick: ($event) => $options.translate(entry.word)
773
+ }, toDisplayString(entry.word), 9, _hoisted_6$1),
774
+ createElementVNode("small", _hoisted_7$1, " \u2015 " + toDisplayString(entry.reverse_translation.join(", ")), 1)
775
+ ]);
776
+ }), 128))
777
+ ]);
778
+ }), 128))
779
+ ])
578
780
  ])
579
781
  ])) : createCommentVNode("", true);
580
782
  }
581
- var dictTarget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
783
+ var DictTarget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
582
784
  const _sfc_main$3 = {
583
785
  props: {
584
786
  data: {
@@ -588,66 +790,32 @@ const _sfc_main$3 = {
588
790
  },
589
791
  data() {
590
792
  return {
591
- name: "Examples",
592
- more: false
793
+ name: "Examples"
593
794
  };
594
795
  }
595
796
  };
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
- })
797
+ const _hoisted_1$3 = { key: 0 };
798
+ const _hoisted_2$3 = { class: "card-body p-4" };
799
+ const _hoisted_3$3 = { class: "card-title font-bold" };
800
+ const _hoisted_4$3 = { class: "list-disc" };
801
+ const _hoisted_5$2 = ["innerHTML"];
802
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
803
+ return $props.data.examples && $props.data.examples.example ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
804
+ createElementVNode("div", _hoisted_2$3, [
805
+ createElementVNode("h2", _hoisted_3$3, toDisplayString($data.name), 1),
806
+ createElementVNode("ul", _hoisted_4$3, [
807
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.examples.example, (example, index) => {
808
+ return openBlock(), createElementBlock("li", {
809
+ key: `${example.definition_id}-${index}`,
810
+ class: "mt-2 ml-2",
811
+ innerHTML: example.text
812
+ }, null, 8, _hoisted_5$2);
813
+ }), 128))
814
+ ])
815
+ ])
648
816
  ])) : createCommentVNode("", true);
649
817
  }
650
- var example = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
818
+ var Example = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
651
819
  const _sfc_main$2 = {
652
820
  props: {
653
821
  data: {
@@ -661,48 +829,48 @@ const _sfc_main$2 = {
661
829
  };
662
830
  }
663
831
  };
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))
832
+ const _hoisted_1$2 = { key: 0 };
833
+ const _hoisted_2$2 = { class: "card-body p-4" };
834
+ const _hoisted_3$2 = { class: "card-title font-bold" };
835
+ const _hoisted_4$2 = { class: "list-group list-group-flush" };
836
+ const _hoisted_5$1 = { class: "capitalize font-bold" };
837
+ const _hoisted_6 = ["onClick"];
838
+ const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
839
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
840
+ return $props.data.synsets ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
841
+ createElementVNode("div", _hoisted_2$2, [
842
+ createElementVNode("h2", _hoisted_3$2, toDisplayString($data.name), 1),
843
+ createElementVNode("ul", _hoisted_4$2, [
844
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.synsets, (dict, index) => {
845
+ return openBlock(), createElementBlock("li", {
846
+ key: `${dict.pos}-${index}`,
847
+ class: "list-group-item mb-2"
848
+ }, [
849
+ createElementVNode("h5", _hoisted_5$1, toDisplayString(dict.pos), 1),
850
+ (openBlock(true), createElementBlock(Fragment, null, renderList(dict.entry, (entry, index2) => {
851
+ return openBlock(), createElementBlock("div", {
852
+ key: `${entry.definition_id}-${index2}`
853
+ }, [
854
+ (openBlock(true), createElementBlock(Fragment, null, renderList(entry.synonym, (synonym, index3) => {
855
+ return openBlock(), createElementBlock("span", {
856
+ key: `${synonym}-${index3}`
857
+ }, [
858
+ createElementVNode("span", {
859
+ class: "badge bg-neutral ml-1",
860
+ onClick: ($event) => _ctx.$emit("translate", synonym)
861
+ }, toDisplayString(synonym), 9, _hoisted_6),
862
+ _hoisted_7
863
+ ]);
864
+ }), 128))
865
+ ]);
866
+ }), 128))
867
+ ]);
868
+ }), 128))
869
+ ])
702
870
  ])
703
871
  ])) : createCommentVNode("", true);
704
872
  }
705
- var syno = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
873
+ var Syno = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
706
874
  const _sfc_main$1 = {
707
875
  props: {
708
876
  data: {
@@ -716,45 +884,36 @@ const _sfc_main$1 = {
716
884
  };
717
885
  }
718
886
  };
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"];
887
+ const _hoisted_1$1 = { key: 0 };
888
+ const _hoisted_2$1 = { class: "card-body p-4" };
889
+ const _hoisted_3$1 = { class: "card-title font-bold" };
890
+ const _hoisted_4$1 = ["onClick"];
726
891
  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, [
892
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
893
+ return $props.data.related_words && $props.data.related_words.word ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
894
+ createElementVNode("div", _hoisted_2$1, [
895
+ createElementVNode("h2", _hoisted_3$1, toDisplayString($data.name), 1),
731
896
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.data.related_words.word, (word, index) => {
732
897
  return openBlock(), createElementBlock("span", {
733
898
  key: `${word}-${index}`
734
899
  }, [
735
900
  createElementVNode("span", {
736
- class: "badge bg-secondary clickable-badge",
901
+ class: "badge bg-neutral",
737
902
  onClick: ($event) => _ctx.$emit("translate", word)
738
- }, toDisplayString(word), 9, _hoisted_4),
903
+ }, toDisplayString(word), 9, _hoisted_4$1),
739
904
  _hoisted_5
740
905
  ]);
741
906
  }), 128))
742
907
  ])
743
908
  ])) : createCommentVNode("", true);
744
909
  }
745
- var more = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
746
- const _sfc_main = {
910
+ var More = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
911
+ const _hoisted_1 = { class: "p-1" };
912
+ const _hoisted_2 = { class: "mt-3 grid grid-cols-1 md:grid-cols-2 gap-3" };
913
+ const _hoisted_3 = { class: "w-full" };
914
+ const _hoisted_4 = { class: "w-full" };
915
+ const __default__ = {
747
916
  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
917
  props: {
759
918
  export_data: {
760
919
  type: Object,
@@ -802,13 +961,13 @@ const _sfc_main = {
802
961
  this.data = null;
803
962
  this.$emit("clear");
804
963
  },
805
- translateReplace(input2) {
806
- return this.translate(input2, true);
964
+ translateReplace(input) {
965
+ return this.translate(input, true);
807
966
  },
808
- translateSwap(input2) {
809
- return this.translate(input2, true, true);
967
+ translateSwap(input) {
968
+ return this.translate(input, true, true);
810
969
  },
811
- translate(input2, is_replace, is_swap) {
970
+ translate(input, is_replace, is_swap) {
812
971
  if (is_swap) {
813
972
  if (!this.data.src || this.data.src === "auto" || !this.data.target) {
814
973
  return;
@@ -821,67 +980,81 @@ const _sfc_main = {
821
980
  window.scrollTo(0, 0);
822
981
  this.clear();
823
982
  if (is_replace) {
824
- this.replace = input2;
983
+ this.replace = input;
825
984
  }
826
- this.$emit("translate", input2);
985
+ this.$emit("translate", input);
827
986
  },
828
- srctarget(select) {
987
+ onSelect(select) {
829
988
  this.$emit("srctarget", select);
830
989
  if (this.data) {
831
- const input2 = this.data.sentences.map((sentence) => sentence.orig).join("");
832
- this.$emit("translate", input2);
990
+ const input = this.data.sentences.map((sentence) => sentence.orig).join("");
991
+ this.$emit("translate", input);
833
992
  }
834
993
  }
835
994
  }
836
995
  };
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 };
996
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
997
+ setup(__props) {
998
+ return (_ctx, _cache) => {
999
+ return openBlock(), createElementBlock("div", _hoisted_1, [
1000
+ createVNode(Selects, {
1001
+ select: _ctx.select,
1002
+ onSelect: _ctx.onSelect
1003
+ }, null, 8, ["select", "onSelect"]),
1004
+ createElementVNode("div", _hoisted_2, [
1005
+ createElementVNode("div", _hoisted_3, [
1006
+ createVNode(Input, {
1007
+ data: _ctx.data,
1008
+ tts: _ctx.tts,
1009
+ replace: _ctx.replace,
1010
+ onTranslate: _ctx.translate,
1011
+ onClear: _ctx.clear
1012
+ }, null, 8, ["data", "tts", "replace", "onTranslate", "onClear"])
1013
+ ]),
1014
+ createElementVNode("div", _hoisted_4, [
1015
+ createVNode(Result, {
1016
+ data: _ctx.data,
1017
+ tts: _ctx.tts
1018
+ }, null, 8, ["data", "tts"])
1019
+ ])
1020
+ ]),
1021
+ _ctx.data ? (openBlock(), createElementBlock("div", {
1022
+ key: 0,
1023
+ class: "mt-3 grid grid-cols-1 md:grid-cols-3 gap-3",
1024
+ style: normalizeStyle({ "text-align": _ctx.rtl ? "right" : "left" })
1025
+ }, [
1026
+ createVNode(DictSrc, {
1027
+ class: "card border",
1028
+ data: _ctx.data
1029
+ }, null, 8, ["data"]),
1030
+ createVNode(DictTarget, {
1031
+ class: "card border",
1032
+ data: _ctx.data,
1033
+ onTranslate: _ctx.translateSwap
1034
+ }, null, 8, ["data", "onTranslate"]),
1035
+ createVNode(Syno, {
1036
+ class: "card border",
1037
+ data: _ctx.data,
1038
+ onTranslate: _ctx.translateReplace
1039
+ }, null, 8, ["data", "onTranslate"]),
1040
+ createVNode(More, {
1041
+ class: "card border",
1042
+ data: _ctx.data,
1043
+ onTranslate: _ctx.translateReplace
1044
+ }, null, 8, ["data", "onTranslate"])
1045
+ ], 4)) : createCommentVNode("", true),
1046
+ _ctx.data ? (openBlock(), createElementBlock("div", {
1047
+ key: 1,
1048
+ class: "mt-5 grid grid-cols-1 gap-6",
1049
+ style: normalizeStyle({ "text-align": _ctx.rtl ? "right" : "left" })
1050
+ }, [
1051
+ createVNode(Example, {
1052
+ class: "card border",
1053
+ data: _ctx.data
1054
+ }, null, 8, ["data"])
1055
+ ], 4)) : createCommentVNode("", true)
1056
+ ]);
1057
+ };
1058
+ }
1059
+ });
1060
+ export { _sfc_main as default };