@ddict/bubble 0.0.2 → 0.0.5
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 +11 -11
- package/dist/bubble.umd.js +1 -1
- package/package.json +1 -1
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-4{width:1rem!important}.ddict-w-
|
|
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-base{font-size:1rem!important;line-height:1.5rem!important}.ddict-text-sm{font-size:.875rem!important;line-height:1.25rem!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-slate-500{--tw-text-opacity: 1 !important;color:rgb(100 116 139 / var(--tw-text-opacity))!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}.ddict-body[data-v-d6b9be04]{padding:.7rem!important}
|
package/dist/bubble.es.js
CHANGED
|
@@ -32,7 +32,7 @@ const _sfc_main$4 = {
|
|
|
32
32
|
name: "Translit",
|
|
33
33
|
props: ["translits"]
|
|
34
34
|
};
|
|
35
|
-
const _hoisted_1$4 = { class: "ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0 ddict-w-
|
|
35
|
+
const _hoisted_1$4 = { class: "ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0 ddict-w-2/3" };
|
|
36
36
|
const _hoisted_2$3 = { class: "ddict-text-slate-500" };
|
|
37
37
|
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
38
38
|
return openBlock(), createElementBlock("p", _hoisted_1$4, [
|
|
@@ -142,9 +142,9 @@ const _hoisted_1$1 = { class: "ddict-mt-1" };
|
|
|
142
142
|
const _hoisted_2$1 = { class: "ddict-text-base ddict-italic ddict-text-slate-400 ddict-capitalize ddict-p-0 ddict-m-0" };
|
|
143
143
|
const _hoisted_3$1 = { class: "ddict-text-sm ddict-p-0 ddict-m-0" };
|
|
144
144
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
145
|
-
return openBlock(), createElementBlock("
|
|
145
|
+
return openBlock(), createElementBlock("section", _hoisted_1$1, [
|
|
146
146
|
(openBlock(true), createElementBlock(Fragment, null, renderList($props.dicts, (d) => {
|
|
147
|
-
return openBlock(), createElementBlock("
|
|
147
|
+
return openBlock(), createElementBlock("section", null, [
|
|
148
148
|
createElementVNode("p", _hoisted_2$1, toDisplayString(d.pos), 1),
|
|
149
149
|
createElementVNode("p", _hoisted_3$1, toDisplayString(d.terms), 1)
|
|
150
150
|
]);
|
|
@@ -153,9 +153,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
153
153
|
}
|
|
154
154
|
var Dict = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
|
155
155
|
var Bubble_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
156
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
157
|
-
const _hoisted_1 = { class: "ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white" };
|
|
158
|
-
const _hoisted_2 = { class: "ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2" };
|
|
156
|
+
const _withScopeId = (n) => (pushScopeId("data-v-d6b9be04"), n = n(), popScopeId(), n);
|
|
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 = { class: "ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2 ddict-w-auto" };
|
|
159
159
|
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
|
|
160
160
|
xmlns: "http://www.w3.org/2000/svg",
|
|
161
161
|
class: "ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",
|
|
@@ -195,7 +195,7 @@ const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElem
|
|
|
195
195
|
const _hoisted_6 = [
|
|
196
196
|
_hoisted_5
|
|
197
197
|
];
|
|
198
|
-
const _hoisted_7 = { class: "body" };
|
|
198
|
+
const _hoisted_7 = { class: "ddict-body" };
|
|
199
199
|
const __default__ = {
|
|
200
200
|
name: "Bubble",
|
|
201
201
|
props: ["google", "tts"],
|
|
@@ -212,8 +212,8 @@ const __default__ = {
|
|
|
212
212
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
213
213
|
setup(__props) {
|
|
214
214
|
return (_ctx, _cache) => {
|
|
215
|
-
return openBlock(), createElementBlock("
|
|
216
|
-
createElementVNode("
|
|
215
|
+
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
216
|
+
createElementVNode("section", _hoisted_2, [
|
|
217
217
|
__props.tts ? (openBlock(), createBlock(Player, {
|
|
218
218
|
key: 0,
|
|
219
219
|
tts: __props.tts
|
|
@@ -225,7 +225,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
225
225
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
226
226
|
}, _hoisted_6)
|
|
227
227
|
]),
|
|
228
|
-
createElementVNode("
|
|
228
|
+
createElementVNode("section", _hoisted_7, [
|
|
229
229
|
createVNode(Translit, {
|
|
230
230
|
translits: _ctx.data.translits
|
|
231
231
|
}, null, 8, ["translits"]),
|
|
@@ -240,5 +240,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
243
|
+
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d6b9be04"]]);
|
|
244
244
|
export { Bubble as default };
|
package/dist/bubble.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.Bubble={},i.Vue))})(this,function(i,t){"use strict";var p={revise:_};function _(e){const o=e.sentences.filter(n=>n.trans).map(n=>n.trans),s=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:o,translits:s,dicts:c}}var A="",r=(e,o)=>{const s=e.__vccOpts||e;for(const[c,n]of o)s[c]=n;return s};const m={name:"Translit",props:["translits"]},h={class:"ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0 ddict-w-2/3"},k={class:"ddict-text-slate-500"};function f(e,o,s,c,n,l){return t.openBlock(),t.createElementBlock("p",h,[t.createElementVNode("span",k,t.toDisplayString(s.translits?`/${s.translits}/`:"\u200B"),1)])}var g=r(m,[["render",f]]);const u={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}}},w={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"},$=[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)],y={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 E(e,o,s,c,n,l){return n.err?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,onClick:o[0]||(o[0]=(...d)=>l.play&&l.play(...d))},[n.playing?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",w,$)),n.playing?(t.openBlock(),t.createElementBlock("svg",y,B)):t.createCommentVNode("",!0)]))}var V=r(u,[["render",E]]);const N={name:"Sentences",props:["sentences"]},b={class:"ddict-text-base ddict-leading-tight ddict-p-0 ddict-m-0"};function x(e,o,s,c,n,l){return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.sentences,d=>(t.openBlock(),t.createElementBlock("p",b,t.toDisplayString(d),1))),256)}var C=r(N,[["render",x]]);const j={name:"Dict",props:["dicts"]},S={class:"ddict-mt-1"},M={class:"ddict-text-base ddict-italic ddict-text-slate-400 ddict-capitalize ddict-p-0 ddict-m-0"},z={class:"ddict-text-sm ddict-p-0 ddict-m-0"};function D(e,o,s,c,n,l){return t.openBlock(),t.createElementBlock("section",S,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.dicts,d=>(t.openBlock(),t.createElementBlock("section",null,[t.createElementVNode("p",M,t.toDisplayString(d.pos),1),t.createElementVNode("p",z,t.toDisplayString(d.terms),1)]))),256))])}var T=r(j,[["render",D]]),K="";const a=e=>(t.pushScopeId("data-v-d6b9be04"),e=e(),t.popScopeId(),e),I={class:"ddict-wrapper ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white"},L={class:"ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2 ddict-w-auto"},O=[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))],P=[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))],F={class:"ddict-body"};var q=r(Object.assign({name:"Bubble",props:["google","tts"],emits:["settings","close"],data(){return{data:null}},created(){this.data=p.revise(this.google)}},{setup(e){return(o,s)=>(t.openBlock(),t.createElementBlock("section",I,[t.createElementVNode("section",L,[e.tts?(t.openBlock(),t.createBlock(V,{key:0,tts:e.tts},null,8,["tts"])):t.createCommentVNode("",!0),t.createElementVNode("span",{onClick:s[0]||(s[0]=c=>o.$emit("settings"))},O),t.createElementVNode("span",{onClick:s[1]||(s[1]=c=>o.$emit("close"))},P)]),t.createElementVNode("section",F,[t.createVNode(g,{translits:o.data.translits},null,8,["translits"]),t.createVNode(C,{sentences:o.data.sentences},null,8,["sentences"]),t.createVNode(T,{dicts:o.data.dicts},null,8,["dicts"])])]))}}),[["__scopeId","data-v-d6b9be04"]]);i.default=q,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|