@ddict/bubble 0.0.2 → 0.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/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-5\/6{width:83.333333%!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}.body[data-v-25583db8]{padding:.7rem!important}
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-5\/6{width:83.333333%!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-wrapper *[data-v-163020e2]{margin:0!important;border:0!important;font:inherit;line-height:1!important;background:none;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;box-shadow:none}.ddict-wrapper[data-v-163020e2]{z-index:2147483647;border:0;outline:0;text-decoration:none;vertical-align:baseline;text-align:left;margin:0;min-width:90px;width:auto}.ddict-body[data-v-163020e2]{padding:.7rem!important}
package/dist/bubble.es.js CHANGED
@@ -153,8 +153,8 @@ 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-25583db8"), n = n(), popScopeId(), n);
157
- const _hoisted_1 = { class: "ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white" };
156
+ const _withScopeId = (n) => (pushScopeId("data-v-163020e2"), 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
158
  const _hoisted_2 = { class: "ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2" };
159
159
  const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
160
160
  xmlns: "http://www.w3.org/2000/svg",
@@ -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"],
@@ -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-25583db8"]]);
243
+ var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-163020e2"]]);
244
244
  export { Bubble as default };
@@ -1 +1 @@
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 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-5/6"},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}}},$={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"},w=[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]=(...i)=>l.play&&l.play(...i))},[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"]},x={class:"ddict-text-base ddict-leading-tight ddict-p-0 ddict-m-0"};function b(e,o,s,c,n,l){return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.sentences,i=>(t.openBlock(),t.createElementBlock("p",x,t.toDisplayString(i),1))),256)}var C=r(N,[["render",b]]);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("div",S,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.dicts,i=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("p",M,t.toDisplayString(i.pos),1),t.createElementVNode("p",z,t.toDisplayString(i.terms),1)]))),256))])}var T=r(j,[["render",D]]),K="";const a=e=>(t.pushScopeId("data-v-25583db8"),e=e(),t.popScopeId(),e),I={class:"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"},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:"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("div",I,[t.createElementVNode("div",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("div",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-25583db8"]]);d.default=q,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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 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-5/6"},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]=(...i)=>l.play&&l.play(...i))},[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"]},x={class:"ddict-text-base ddict-leading-tight ddict-p-0 ddict-m-0"};function b(e,o,s,c,n,l){return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.sentences,i=>(t.openBlock(),t.createElementBlock("p",x,t.toDisplayString(i),1))),256)}var C=r(N,[["render",b]]);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("div",S,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.dicts,i=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("p",M,t.toDisplayString(i.pos),1),t.createElementVNode("p",z,t.toDisplayString(i.terms),1)]))),256))])}var T=r(j,[["render",D]]),K="";const a=e=>(t.pushScopeId("data-v-163020e2"),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"},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("div",I,[t.createElementVNode("div",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("div",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-163020e2"]]);d.default=q,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddict/bubble",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "files": [
5
5
  "dist"
6
6
  ],