Socket
Socket
Sign inDemoInstall

@ddict/bubble

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ddict/bubble - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

74

dist/bubble.es.js

@@ -1,2 +0,2 @@

import { openBlock, createElementBlock, renderSlot, toDisplayString, createCommentVNode, createElementVNode, Fragment, renderList, createVNode, withCtx, createBlock, pushScopeId, popScopeId } from "vue";
import { openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, createVNode, pushScopeId, popScopeId } from "vue";
var Google = {

@@ -23,2 +23,3 @@ revise

}
var index = "";
var _export_sfc = (sfc, props) => {

@@ -35,8 +36,7 @@ const target = sfc.__vccOpts || sfc;

};
const _hoisted_1$4 = { class: "text-xs truncate w-5/6" };
const _hoisted_2$2 = { key: 0 };
const _hoisted_1$4 = { class: "ddict-text-sm ddict-truncate ddict-p-0 ddict-m-0 ddict-w-5/6" };
const _hoisted_2$3 = { class: "ddict-text-slate-500" };
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("p", _hoisted_1$4, [
renderSlot(_ctx.$slots, "default"),
$props.translits ? (openBlock(), createElementBlock("span", _hoisted_2$2, " /" + toDisplayString($props.translits) + "/ ", 1)) : createCommentVNode("", true)
createElementVNode("span", _hoisted_2$3, toDisplayString($props.translits ? `/${$props.translits}/` : "\u200B"), 1)
]);

@@ -81,3 +81,3 @@ }

xmlns: "http://www.w3.org/2000/svg",
class: "h-4 w-4 inline",
class: "ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",
fill: "none",

@@ -88,3 +88,3 @@ viewBox: "0 0 24 24",

};
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("path", {
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
"stroke-linecap": "round",

@@ -94,4 +94,4 @@ "stroke-linejoin": "round",

}, null, -1);
const _hoisted_3$1 = [
_hoisted_2$1
const _hoisted_3$2 = [
_hoisted_2$2
];

@@ -101,3 +101,3 @@ const _hoisted_4$1 = {

xmlns: "http://www.w3.org/2000/svg",
class: "h-4 w-4 inline",
class: "ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",
fill: "none",

@@ -127,3 +127,3 @@ viewBox: "0 0 24 24",

}, [
!$data.playing ? (openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$1)) : createCommentVNode("", true),
!$data.playing ? (openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$2)) : createCommentVNode("", true),
$data.playing ? (openBlock(), createElementBlock("svg", _hoisted_4$1, _hoisted_7$1)) : createCommentVNode("", true)

@@ -137,3 +137,3 @@ ])) : createCommentVNode("", true);

};
const _hoisted_1$2 = { class: "text-base leading-tight" };
const _hoisted_1$2 = { class: "ddict-text-base ddict-leading-tight ddict-p-0 ddict-m-0" };
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {

@@ -149,19 +149,23 @@ return openBlock(true), createElementBlock(Fragment, null, renderList($props.sentences, (s) => {

};
const _hoisted_1$1 = { class: "text-info font-bold italic capitalize" };
const _hoisted_1$1 = { class: "ddict-mt-1" };
const _hoisted_2$1 = { class: "ddict-text-base ddict-italic ddict-text-slate-400 ddict-capitalize ddict-p-0 ddict-m-0" };
const _hoisted_3$1 = { class: "ddict-text-sm ddict-p-0 ddict-m-0" };
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(true), createElementBlock(Fragment, null, renderList($props.dicts, (d) => {
return openBlock(), createElementBlock("div", null, [
createElementVNode("h3", _hoisted_1$1, toDisplayString(d.pos), 1),
createElementVNode("p", null, toDisplayString(d.terms), 1)
]);
}), 256);
return openBlock(), createElementBlock("div", _hoisted_1$1, [
(openBlock(true), createElementBlock(Fragment, null, renderList($props.dicts, (d) => {
return openBlock(), createElementBlock("div", null, [
createElementVNode("p", _hoisted_2$1, toDisplayString(d.pos), 1),
createElementVNode("p", _hoisted_3$1, toDisplayString(d.terms), 1)
]);
}), 256))
]);
}
var Dict = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
var Bubble_vue_vue_type_style_index_0_scoped_true_lang = "";
const _withScopeId = (n) => (pushScopeId("data-v-2b1f4ed3"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "absolute card bg-base-100 shadow-xl compact" };
const _hoisted_2 = { class: "absolute top-0 right-0 p-1.5" };
const _withScopeId = (n) => (pushScopeId("data-v-25583db8"), n = n(), popScopeId(), n);
const _hoisted_1 = { class: "ddict-absolute ddict-shadow-2xl ddict-rounded-lg ddict-text-slate-900 ddict-bg-white" };
const _hoisted_2 = { class: "ddict-absolute ddict-top-0 ddict-right-0 ddict-p-2" };
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("svg", {
xmlns: "http://www.w3.org/2000/svg",
class: "h-4 w-4 inline",
class: "ddict-h-4 ddict-w-4 ddict-inline ddict-mr-1",
fill: "none",

@@ -188,3 +192,3 @@ viewBox: "0 0 24 24",

xmlns: "http://www.w3.org/2000/svg",
class: "h-4 w-4 inline",
class: "ddict-h-4 ddict-w-4 ddict-inline",
fill: "none",

@@ -204,3 +208,3 @@ viewBox: "0 0 24 24",

];
const _hoisted_7 = { class: "card-body body" };
const _hoisted_7 = { class: "body" };
const __default__ = {

@@ -224,6 +228,10 @@ name: "Bubble",

createElementVNode("div", _hoisted_2, [
createElementVNode("button", {
__props.tts ? (openBlock(), createBlock(Player, {
key: 0,
tts: __props.tts
}, null, 8, ["tts"])) : createCommentVNode("", true),
createElementVNode("span", {
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("settings"))
}, _hoisted_4),
createElementVNode("button", {
createElementVNode("span", {
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))

@@ -235,11 +243,3 @@ }, _hoisted_6)

translits: _ctx.data.translits
}, {
default: withCtx(() => [
__props.tts ? (openBlock(), createBlock(Player, {
key: 0,
tts: __props.tts
}, null, 8, ["tts"])) : createCommentVNode("", true)
]),
_: 1
}, 8, ["translits"]),
}, null, 8, ["translits"]),
createVNode(Sentences, {

@@ -256,3 +256,3 @@ sentences: _ctx.data.sentences

});
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2b1f4ed3"]]);
var Bubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-25583db8"]]);
export { Bubble as default };

@@ -1,1 +0,1 @@

(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.Bubble={},l.Vue))})(this,function(l,e){"use strict";var p={revise:_};function _(t){const s=t.sentences.filter(n=>n.trans).map(n=>n.trans),o=t.sentences.filter(n=>n.src_translit).map(n=>n.src_translit).join();let r;return t.dict&&(r=t.dict.map(n=>({pos:n.pos,terms:n.terms.join(", ")}))),{sentences:s,translits:o,dicts:r}}var c=(t,s)=>{const o=t.__vccOpts||t;for(const[r,n]of s)o[r]=n;return o};const h={name:"Translit",props:["translits"]},m={class:"text-xs truncate w-5/6"},k={key:0};function f(t,s,o,r,n,i){return e.openBlock(),e.createElementBlock("p",m,[e.renderSlot(t.$slots,"default"),o.translits?(e.openBlock(),e.createElementBlock("span",k," /"+e.toDisplayString(o.translits)+"/ ",1)):e.createCommentVNode("",!0)])}var g=c(h,[["render",f]]);const u={name:"Player",props:["tts"],data(){return{playing:!1,player:new Audio(this.tts),err:null}},watch:{playing(t){if(!t){this.player.pause();return}this.player.play()}},created(){this.player.onended=()=>{this.playing=!1},this.player.onerror=t=>{this.err=t}},methods:{play(){this.playing=!this.playing}}},y={key:0,xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 inline",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},w=[e.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)],$={key:1,xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 inline",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},B=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),e.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(t,s,o,r,n,i){return n.err?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,onClick:s[0]||(s[0]=(...a)=>i.play&&i.play(...a))},[n.playing?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",y,w)),n.playing?(e.openBlock(),e.createElementBlock("svg",$,B)):e.createCommentVNode("",!0)]))}var b=c(u,[["render",E]]);const V={name:"Sentences",props:["sentences"]},N={class:"text-base leading-tight"};function x(t,s,o,r,n,i){return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.sentences,a=>(e.openBlock(),e.createElementBlock("p",N,e.toDisplayString(a),1))),256)}var C=c(V,[["render",x]]);const S={name:"Dict",props:["dicts"]},j={class:"text-info font-bold italic capitalize"};function M(t,s,o,r,n,i){return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dicts,a=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("h3",j,e.toDisplayString(a.pos),1),e.createElementVNode("p",null,e.toDisplayString(a.terms),1)]))),256)}var z=c(S,[["render",M]]),G="";const d=t=>(e.pushScopeId("data-v-2b1f4ed3"),t=t(),e.popScopeId(),t),D={class:"absolute card bg-base-100 shadow-xl compact"},T={class:"absolute top-0 right-0 p-1.5"},I=[d(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 inline",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.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"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1))],L=[d(()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-4 w-4 inline",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1))],O={class:"card-body body"};var P=c(Object.assign({name:"Bubble",props:["google","tts"],emits:["settings","close"],data(){return{data:null}},created(){this.data=p.revise(this.google)}},{setup(t){return(s,o)=>(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",T,[e.createElementVNode("button",{onClick:o[0]||(o[0]=r=>s.$emit("settings"))},I),e.createElementVNode("button",{onClick:o[1]||(o[1]=r=>s.$emit("close"))},L)]),e.createElementVNode("div",O,[e.createVNode(g,{translits:s.data.translits},{default:e.withCtx(()=>[t.tts?(e.openBlock(),e.createBlock(b,{key:0,tts:t.tts},null,8,["tts"])):e.createCommentVNode("",!0)]),_:1},8,["translits"]),e.createVNode(C,{sentences:s.data.sentences},null,8,["sentences"]),e.createVNode(z,{dicts:s.data.dicts},null,8,["dicts"])])]))}}),[["__scopeId","data-v-2b1f4ed3"]]);l.default=P,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(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"}})});
{
"name": "@ddict/bubble",
"version": "0.0.1",
"files": ["dist"],
"version": "0.0.2",
"files": [
"dist"
],
"main": "./dist/bubble.umd.js",

@@ -13,3 +15,2 @@ "module": "./dist/bubble.es.js",

"dependencies": {
"daisyui": "^2.8.0",
"vue": "^3.2.25"

@@ -16,0 +17,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc