@ddict/bubble 0.0.5 → 0.0.6
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/bubble.css +1 -1
- package/dist/bubble.es.js +62 -37
- package/dist/bubble.umd.js +1 -1
- package/package.json +1 -1
- package/dist/.DS_Store +0 -0
package/dist/bubble.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ddict-absolute{position:absolute!important}.ddict-top-0{top:0px!important}.ddict-right-0{right:0px!important}.ddict-m-0{margin:0!important}.ddict-mr-1{margin-right:.25rem!important}.ddict-mt-1{margin-top:.25rem!important}.ddict-inline{display:inline!important}.ddict-h-4{height:1rem!important}.ddict-w-auto{width:auto!important}.ddict-w-4{width:1rem!important}.ddict-w-2\/3{width:66.666667%!important}.ddict-truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.ddict-rounded-lg{border-radius:.5rem!important}.ddict-bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.ddict-p-2{padding:.5rem!important}.ddict-p-0{padding:0!important}.ddict-text-
|
|
1
|
+
.ddict-absolute{position:absolute!important}.ddict-top-0{top:0px!important}.ddict-right-0{right:0px!important}.ddict-m-0{margin:0!important}.ddict-mr-1{margin-right:.25rem!important}.ddict-mt-1{margin-top:.25rem!important}.ddict-inline{display:inline!important}.ddict-h-4{height:1rem!important}.ddict-w-auto{width:auto!important}.ddict-w-4{width:1rem!important}.ddict-w-2\/3{width:66.666667%!important}.ddict-truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.ddict-rounded-lg{border-radius:.5rem!important}.ddict-rounded-bl-lg{border-bottom-left-radius:.5rem!important}.ddict-bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.ddict-bg-slate-50{--tw-bg-opacity: 1 !important;background-color:rgb(248 250 252 / var(--tw-bg-opacity))!important}.ddict-bg-blue-600{--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.ddict-p-2{padding:.5rem!important}.ddict-p-0{padding:0!important}.ddict-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.ddict-text-base{font-size:1rem!important;line-height:1.5rem!important}.ddict-capitalize{text-transform:capitalize!important}.ddict-italic{font-style:italic!important}.ddict-leading-tight{line-height:1.25!important}.ddict-text-slate-900{--tw-text-opacity: 1 !important;color:rgb(15 23 42 / var(--tw-text-opacity))!important}.ddict-text-slate-400{--tw-text-opacity: 1 !important;color:rgb(148 163 184 / var(--tw-text-opacity))!important}.ddict-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.ddict-text-slate-500{--tw-text-opacity: 1 !important;color:rgb(100 116 139 / var(--tw-text-opacity))!important}.ddict-opacity-0{opacity:0!important}.ddict-shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25) !important;--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.hover\:ddict-opacity-100:hover{opacity:1!important}.ddict-body[data-v-c7cd4228]{padding:.7rem!important}
|
package/dist/bubble.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock, createElementBlock,
|
|
1
|
+
import { openBlock, createElementBlock, toDisplayString, createElementVNode, createCommentVNode, Fragment, renderList, createBlock, createVNode, pushScopeId, popScopeId } from "vue";
|
|
2
2
|
var Google = {
|
|
3
3
|
revise
|
|
4
4
|
};
|
|
@@ -28,6 +28,27 @@ var _export_sfc = (sfc, props) => {
|
|
|
28
28
|
}
|
|
29
29
|
return target;
|
|
30
30
|
};
|
|
31
|
+
const _sfc_main$5 = {
|
|
32
|
+
name: "Loading",
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
index: 0,
|
|
36
|
+
texts: [".", "..", "..."],
|
|
37
|
+
text: "."
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
mounted() {
|
|
41
|
+
setInterval(() => {
|
|
42
|
+
this.index = (this.index + 1) % this.texts.length;
|
|
43
|
+
this.text = this.texts[this.index];
|
|
44
|
+
}, 500);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const _hoisted_1$5 = { class: "ddict-p-2 ddict-shadow-8xl ddict-rounded-lg ddict-text-white ddict-bg-blue-600 ddict-text-bold" };
|
|
48
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
49
|
+
return openBlock(), createElementBlock("section", _hoisted_1$5, " D" + toDisplayString(this.text), 1);
|
|
50
|
+
}
|
|
51
|
+
var Loading = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
|
|
31
52
|
const _sfc_main$4 = {
|
|
32
53
|
name: "Translit",
|
|
33
54
|
props: ["translits"]
|
|
@@ -36,7 +57,7 @@ const _hoisted_1$4 = { class: "ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0
|
|
|
36
57
|
const _hoisted_2$3 = { class: "ddict-text-slate-500" };
|
|
37
58
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
59
|
return openBlock(), createElementBlock("p", _hoisted_1$4, [
|
|
39
|
-
createElementVNode("span", _hoisted_2$3, toDisplayString($props.translits
|
|
60
|
+
createElementVNode("span", _hoisted_2$3, "/" + toDisplayString($props.translits) + "/", 1)
|
|
40
61
|
]);
|
|
41
62
|
}
|
|
42
63
|
var Translit = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
|
|
@@ -153,10 +174,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
153
174
|
}
|
|
154
175
|
var Dict = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
|
155
176
|
var Bubble_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
156
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
157
|
-
const _hoisted_1 = { class: "ddict-wrapper ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white" };
|
|
158
|
-
const _hoisted_2 = {
|
|
159
|
-
const _hoisted_3 =
|
|
177
|
+
const _withScopeId = (n) => (pushScopeId("data-v-c7cd4228"), n = n(), popScopeId(), n);
|
|
178
|
+
const _hoisted_1 = { class: "ddict-wrapper ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white ddict-text-sm" };
|
|
179
|
+
const _hoisted_2 = { key: 1 };
|
|
180
|
+
const _hoisted_3 = { class: "ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2 ddict-w-auto ddict-bg-slate-50 ddict-rounded-bl-lg ddict-opacity-0 hover:ddict-opacity-100" };
|
|
181
|
+
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
160
182
|
xmlns: "http://www.w3.org/2000/svg",
|
|
161
183
|
class: "ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",
|
|
162
184
|
fill: "none",
|
|
@@ -175,10 +197,10 @@ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElem
|
|
|
175
197
|
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
176
198
|
})
|
|
177
199
|
], -1));
|
|
178
|
-
const
|
|
179
|
-
|
|
200
|
+
const _hoisted_5 = [
|
|
201
|
+
_hoisted_4
|
|
180
202
|
];
|
|
181
|
-
const
|
|
203
|
+
const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
182
204
|
xmlns: "http://www.w3.org/2000/svg",
|
|
183
205
|
class: "ddict-h-4 ddict-w-4 ddict-inline",
|
|
184
206
|
fill: "none",
|
|
@@ -192,13 +214,13 @@ const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElem
|
|
|
192
214
|
d: "M6 18L18 6M6 6l12 12"
|
|
193
215
|
})
|
|
194
216
|
], -1));
|
|
195
|
-
const
|
|
196
|
-
|
|
217
|
+
const _hoisted_7 = [
|
|
218
|
+
_hoisted_6
|
|
197
219
|
];
|
|
198
|
-
const
|
|
220
|
+
const _hoisted_8 = { class: "ddict-body" };
|
|
199
221
|
const __default__ = {
|
|
200
222
|
name: "Bubble",
|
|
201
|
-
props: ["google", "tts"],
|
|
223
|
+
props: ["google", "tts", "isLoading"],
|
|
202
224
|
emits: ["settings", "close"],
|
|
203
225
|
data() {
|
|
204
226
|
return {
|
|
@@ -213,32 +235,35 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
213
235
|
setup(__props) {
|
|
214
236
|
return (_ctx, _cache) => {
|
|
215
237
|
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
__props.isLoading ? (openBlock(), createBlock(Loading, { key: 0 })) : (openBlock(), createElementBlock("section", _hoisted_2, [
|
|
239
|
+
createElementVNode("section", _hoisted_3, [
|
|
240
|
+
__props.tts ? (openBlock(), createBlock(Player, {
|
|
241
|
+
key: 0,
|
|
242
|
+
tts: __props.tts
|
|
243
|
+
}, null, 8, ["tts"])) : createCommentVNode("", true),
|
|
244
|
+
createElementVNode("span", {
|
|
245
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("settings"))
|
|
246
|
+
}, _hoisted_5),
|
|
247
|
+
createElementVNode("span", {
|
|
248
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
249
|
+
}, _hoisted_7)
|
|
250
|
+
]),
|
|
251
|
+
createElementVNode("section", _hoisted_8, [
|
|
252
|
+
_ctx.data.translits ? (openBlock(), createBlock(Translit, {
|
|
253
|
+
key: 0,
|
|
254
|
+
translits: _ctx.data.translits
|
|
255
|
+
}, null, 8, ["translits"])) : createCommentVNode("", true),
|
|
256
|
+
createVNode(Sentences, {
|
|
257
|
+
sentences: _ctx.data.sentences
|
|
258
|
+
}, null, 8, ["sentences"]),
|
|
259
|
+
createVNode(Dict, {
|
|
260
|
+
dicts: _ctx.data.dicts
|
|
261
|
+
}, null, 8, ["dicts"])
|
|
262
|
+
])
|
|
263
|
+
]))
|
|
239
264
|
]);
|
|
240
265
|
};
|
|
241
266
|
}
|
|
242
267
|
});
|
|
243
|
-
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
268
|
+
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c7cd4228"]]);
|
|
244
269
|
export { Bubble as default };
|
package/dist/bubble.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.Bubble={},d.Vue))})(this,function(d,t){"use strict";var p={revise:_};function _(e){const s=e.sentences.filter(n=>n.trans).map(n=>n.trans),o=e.sentences.filter(n=>n.src_translit).map(n=>n.src_translit).join();let c;return e.dict&&(c=e.dict.map(n=>({pos:n.pos,terms:n.terms.join(", ")}))),{sentences:s,translits:o,dicts:c}}var Q="",i=(e,s)=>{const o=e.__vccOpts||e;for(const[c,n]of s)o[c]=n;return o};const m={name:"Loading",data(){return{index:0,texts:[".","..","..."],text:"."}},mounted(){setInterval(()=>{this.index=(this.index+1)%this.texts.length,this.text=this.texts[this.index]},500)}},h={class:"ddict-p-2 ddict-shadow-8xl ddict-rounded-lg ddict-text-white ddict-bg-blue-600 ddict-text-bold"};function k(e,s,o,c,n,r){return t.openBlock(),t.createElementBlock("section",h," D"+t.toDisplayString(this.text),1)}var g=i(m,[["render",k]]);const f={name:"Translit",props:["translits"]},$={class:"ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0 ddict-w-2/3"},u={class:"ddict-text-slate-500"};function y(e,s,o,c,n,r){return t.openBlock(),t.createElementBlock("p",$,[t.createElementVNode("span",u,"/"+t.toDisplayString(o.translits)+"/",1)])}var w=i(f,[["render",y]]);const B={name:"Player",props:["tts"],data(){return{playing:!1,player:new Audio(this.tts),err:null}},watch:{playing(e){if(!e){this.player.pause();return}this.player.play()}},created(){this.player.onended=()=>{this.playing=!1},this.player.onerror=e=>{this.err=e}},methods:{play(){this.playing=!this.playing}}},x={key:0,xmlns:"http://www.w3.org/2000/svg",class:"ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},E=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",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"},null,-1)],V={key:1,xmlns:"http://www.w3.org/2000/svg",class:"ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},b=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"},null,-1)];function N(e,s,o,c,n,r){return n.err?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,onClick:s[0]||(s[0]=(...l)=>r.play&&r.play(...l))},[n.playing?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",x,E)),n.playing?(t.openBlock(),t.createElementBlock("svg",V,b)):t.createCommentVNode("",!0)]))}var C=i(B,[["render",N]]);const S={name:"Sentences",props:["sentences"]},j={class:"ddict-text-base ddict-leading-tight ddict-p-0 ddict-m-0"};function M(e,s,o,c,n,r){return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.sentences,l=>(t.openBlock(),t.createElementBlock("p",j,t.toDisplayString(l),1))),256)}var D=i(S,[["render",M]]);const L={name:"Dict",props:["dicts"]},z={class:"ddict-mt-1"},I={class:"ddict-text-base ddict-italic ddict-text-slate-400 ddict-capitalize ddict-p-0 ddict-m-0"},T={class:"ddict-text-sm ddict-p-0 ddict-m-0"};function O(e,s,o,c,n,r){return t.openBlock(),t.createElementBlock("section",z,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.dicts,l=>(t.openBlock(),t.createElementBlock("section",null,[t.createElementVNode("p",I,t.toDisplayString(l.pos),1),t.createElementVNode("p",T,t.toDisplayString(l.terms),1)]))),256))])}var P=i(L,[["render",O]]),X="";const a=e=>(t.pushScopeId("data-v-c7cd4228"),e=e(),t.popScopeId(),e),F={class:"ddict-wrapper ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white ddict-text-sm"},q={key:1},A={class:"ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2 ddict-w-auto ddict-bg-slate-50 ddict-rounded-bl-lg ddict-opacity-0 hover:ddict-opacity-100"},G=[a(()=>t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1))],H=[a(()=>t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"ddict-h-4 ddict-w-4 ddict-inline",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1))],J={class:"ddict-body"};var K=i(Object.assign({name:"Bubble",props:["google","tts","isLoading"],emits:["settings","close"],data(){return{data:null}},created(){this.data=p.revise(this.google)}},{setup(e){return(s,o)=>(t.openBlock(),t.createElementBlock("section",F,[e.isLoading?(t.openBlock(),t.createBlock(g,{key:0})):(t.openBlock(),t.createElementBlock("section",q,[t.createElementVNode("section",A,[e.tts?(t.openBlock(),t.createBlock(C,{key:0,tts:e.tts},null,8,["tts"])):t.createCommentVNode("",!0),t.createElementVNode("span",{onClick:o[0]||(o[0]=c=>s.$emit("settings"))},G),t.createElementVNode("span",{onClick:o[1]||(o[1]=c=>s.$emit("close"))},H)]),t.createElementVNode("section",J,[s.data.translits?(t.openBlock(),t.createBlock(w,{key:0,translits:s.data.translits},null,8,["translits"])):t.createCommentVNode("",!0),t.createVNode(D,{sentences:s.data.sentences},null,8,["sentences"]),t.createVNode(P,{dicts:s.data.dicts},null,8,["dicts"])])]))]))}}),[["__scopeId","data-v-c7cd4228"]]);d.default=K,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/dist/.DS_Store
DELETED
|
Binary file
|