@uimaxbai/am-lyrics 1.0.3 → 1.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/demo/index.html +1 -1
- package/dist/src/AmLyrics.d.ts +1 -0
- package/dist/src/AmLyrics.d.ts.map +1 -1
- package/dist/src/am-lyrics.js +63 -39
- package/dist/src/am-lyrics.js.map +1 -1
- package/dist/src/react.js +63 -39
- package/dist/src/react.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/AmLyrics.ts +45 -25
package/demo/index.html
CHANGED
package/dist/src/AmLyrics.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare class AmLyrics extends LitElement {
|
|
|
51
51
|
private animatingLines;
|
|
52
52
|
private scrollUnlockTimeout?;
|
|
53
53
|
private scrollAnimationTimeout?;
|
|
54
|
+
private consecutiveOverlapCount;
|
|
54
55
|
private lastActiveIndex;
|
|
55
56
|
private visibleLineIds;
|
|
56
57
|
connectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmLyrics.d.ts","sourceRoot":"","sources":["../../src/AmLyrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AA6E5C,qBAAa,QAAS,SAAQ,UAAU;IACtC,MAAM,CAAC,MAAM,0BAinCX;IAGF,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,OAAO,CAAC,cAAc,CAAmC;IAGzD,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,cAAc,SAAa;IAG3B,oBAAoB,SAA+B;IAGnD,UAAU,CAAC,EAAE,MAAM,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AsB;IAuErC,OAAO,CAAC,eAAe;IA4HvB,OAAO,CAAC,WAAW;IAyBnB,OAAO,CAAC,YAAY;IA2DpB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAUjC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAYlC,OAAO,CAAC,cAAc;IAuCtB,MAAM;CAgcP"}
|
package/dist/src/am-lyrics.js
CHANGED
|
@@ -32,32 +32,32 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
32
32
|
* Copyright 2019 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
34
|
*/
|
|
35
|
-
const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$2)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
|
|
35
|
+
const t$1=globalThis,e$4=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$4=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$4.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$4.set(s,t));}return t}toString(){return this.cssText}};const r$4=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),i$3=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$3(o,t,s$2)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$1.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$4(e)})(t):t;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @license
|
|
39
39
|
* Copyright 2017 Google LLC
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/const{is:i$2,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$2(t,s),b
|
|
41
|
+
*/const{is:i$2,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$3,getOwnPropertySymbols:o$3,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$2(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$3(t),...o$3(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.0");
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const t=globalThis,i$1=t
|
|
48
|
+
const t=globalThis,i$1=t.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$2="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$2="?"+h,n$1=`<${o$2}>`,r$2=document,l=()=>r$2.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$2.createTreeWalker(r$2,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e$2+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$2)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H:"?"===e[1]?I:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$2)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$2.createElement("template");return s.innerHTML=t,s}}function S(t,i,s=t,e){if(i===T)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S(t,h._$AS(t,i.values),h,e)),i}class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$2).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r$2,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$2.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S(this,e[s+n],i,n),r===T&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}}class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}}class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S(this,t,i,0)??E)===T)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t);}}const j=t.litHtmlPolyfillSupport;j?.(N,R),(t.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2017 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/const s=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=
|
|
54
|
+
*/const s=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o$1=s.litElementPolyfillSupport;o$1?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.0");
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* @license
|
|
58
58
|
* Copyright 2017 Google LLC
|
|
59
59
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
-
*/const o={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$1=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t
|
|
60
|
+
*/const o={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r$1=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r$1(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* @license
|
|
@@ -310,7 +310,7 @@ class GoogleService {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const VERSION = '1.0.
|
|
313
|
+
const VERSION = '1.0.5';
|
|
314
314
|
const INSTRUMENTAL_THRESHOLD_MS = 7000; // Show dots for gaps >= 7s
|
|
315
315
|
const KPOE_SERVERS = [
|
|
316
316
|
'https://lyricsplus.binimum.org',
|
|
@@ -354,6 +354,8 @@ class AmLyrics extends i {
|
|
|
354
354
|
this.scrollAnimationState = null;
|
|
355
355
|
this.currentScrollOffset = 0;
|
|
356
356
|
this.animatingLines = [];
|
|
357
|
+
// Overlap scroll tracking: scroll every 2 lines when lines overlap consecutively
|
|
358
|
+
this.consecutiveOverlapCount = 0;
|
|
357
359
|
// Syllable animation tracking
|
|
358
360
|
this.lastActiveIndex = 0;
|
|
359
361
|
this.visibleLineIds = new Set();
|
|
@@ -939,7 +941,7 @@ class AmLyrics extends i {
|
|
|
939
941
|
!this.isUserScrolling &&
|
|
940
942
|
!this.isClickSeeking &&
|
|
941
943
|
this.lyrics) {
|
|
942
|
-
const preScrollLeadMs =
|
|
944
|
+
const preScrollLeadMs = 500; // 500ms lead time
|
|
943
945
|
// Condition: ONLY pre-scroll if no other lyric is currently playing.
|
|
944
946
|
// If a lyric is playing, we must wait for it to finish (handled by updated()).
|
|
945
947
|
if (this.activeLineIndices.length === 0) {
|
|
@@ -1018,10 +1020,26 @@ class AmLyrics extends i {
|
|
|
1018
1020
|
// Use YouLyPlus-style scroll if we have a current primary line
|
|
1019
1021
|
if (this.currentPrimaryActiveLine) {
|
|
1020
1022
|
if (!wasAlreadyActive) {
|
|
1023
|
+
// No overlap — scroll normally and reset counter
|
|
1024
|
+
this.consecutiveOverlapCount = 0;
|
|
1021
1025
|
this.scrollToActiveLineYouLy(this.currentPrimaryActiveLine);
|
|
1022
1026
|
}
|
|
1027
|
+
else {
|
|
1028
|
+
// Overlapping line: increment counter and scroll every 2nd overlap
|
|
1029
|
+
this.consecutiveOverlapCount += 1;
|
|
1030
|
+
if (this.consecutiveOverlapCount >= 2) {
|
|
1031
|
+
// Scroll to the latest (newest) active line
|
|
1032
|
+
const latestIndex = this.activeLineIndices[this.activeLineIndices.length - 1];
|
|
1033
|
+
const latestLine = this.lyricsContainer?.querySelector(`#lyrics-line-${latestIndex}`);
|
|
1034
|
+
if (latestLine) {
|
|
1035
|
+
this.scrollToActiveLineYouLy(latestLine);
|
|
1036
|
+
}
|
|
1037
|
+
this.consecutiveOverlapCount = 0;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1023
1040
|
}
|
|
1024
1041
|
else {
|
|
1042
|
+
this.consecutiveOverlapCount = 0;
|
|
1025
1043
|
this.scrollToActiveLine();
|
|
1026
1044
|
}
|
|
1027
1045
|
}
|
|
@@ -2121,7 +2139,7 @@ class AmLyrics extends i {
|
|
|
2121
2139
|
const renderContent = () => {
|
|
2122
2140
|
if (this.isLoading) {
|
|
2123
2141
|
// Render stylized skeleton lines
|
|
2124
|
-
return
|
|
2142
|
+
return x `
|
|
2125
2143
|
<div class="skeleton-line"></div>
|
|
2126
2144
|
<div class="skeleton-line"></div>
|
|
2127
2145
|
<div class="skeleton-line"></div>
|
|
@@ -2132,7 +2150,7 @@ class AmLyrics extends i {
|
|
|
2132
2150
|
`;
|
|
2133
2151
|
}
|
|
2134
2152
|
if (!this.lyrics || this.lyrics.length === 0) {
|
|
2135
|
-
return
|
|
2153
|
+
return x `<div class="no-lyrics">No lyrics found.</div>`;
|
|
2136
2154
|
}
|
|
2137
2155
|
// Build a lookup map of ALL gaps so they are always in the DOM
|
|
2138
2156
|
const allGaps = this.findAllInstrumentalGaps();
|
|
@@ -2143,22 +2161,17 @@ class AmLyrics extends i {
|
|
|
2143
2161
|
// Calculate line timing
|
|
2144
2162
|
const lineStartTime = line.text[0]?.timestamp || 0;
|
|
2145
2163
|
const lineEndTime = line.text[line.text.length - 1]?.endtime || 0;
|
|
2146
|
-
//
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
this.currentTime <= syl.endtime)
|
|
2150
|
-
: false;
|
|
2151
|
-
const shouldShowBackground = line.backgroundText &&
|
|
2152
|
-
line.backgroundText.length > 0 &&
|
|
2153
|
-
(isLineActive || bgIsPlayingNow);
|
|
2164
|
+
// Always render background vocals in the DOM so the syllable cache
|
|
2165
|
+
// includes them and the wipe effect applies correctly.
|
|
2166
|
+
const hasBackground = line.backgroundText && line.backgroundText.length > 0;
|
|
2154
2167
|
// Create background vocals container
|
|
2155
|
-
const backgroundVocalElement =
|
|
2156
|
-
?
|
|
2168
|
+
const backgroundVocalElement = hasBackground
|
|
2169
|
+
? x `<p class="background-vocal-container">
|
|
2157
2170
|
${line.backgroundText.map((syllable, syllableIndex) => {
|
|
2158
2171
|
const startTimeMs = syllable.timestamp;
|
|
2159
2172
|
const endTimeMs = syllable.endtime;
|
|
2160
2173
|
const durationMs = endTimeMs - startTimeMs;
|
|
2161
|
-
return
|
|
2174
|
+
return x `<span class="lyrics-word">
|
|
2162
2175
|
<span class="lyrics-syllable-wrap">
|
|
2163
2176
|
<span
|
|
2164
2177
|
class="lyrics-syllable ${syllable.lineSynced
|
|
@@ -2176,7 +2189,7 @@ class AmLyrics extends i {
|
|
|
2176
2189
|
</p>`
|
|
2177
2190
|
: '';
|
|
2178
2191
|
// Create main vocals using YouLyPlus syllable structure
|
|
2179
|
-
const mainVocalElement =
|
|
2192
|
+
const mainVocalElement = x `<p class="main-vocal-container">
|
|
2180
2193
|
${line.text.map(syllable => {
|
|
2181
2194
|
const startTimeMs = syllable.timestamp;
|
|
2182
2195
|
const endTimeMs = syllable.endtime;
|
|
@@ -2193,10 +2206,12 @@ class AmLyrics extends i {
|
|
|
2193
2206
|
trimmedText.length <= 7 &&
|
|
2194
2207
|
trimmedText.length > 0 &&
|
|
2195
2208
|
durationMs >= 700 &&
|
|
2196
|
-
durationMs >= trimmedText.length *
|
|
2197
|
-
// Optional romanization per syllable
|
|
2198
|
-
const romanizedText = this.showRomanization &&
|
|
2199
|
-
|
|
2209
|
+
durationMs >= trimmedText.length * 400;
|
|
2210
|
+
// Optional romanization per syllable (hide if same as the original text)
|
|
2211
|
+
const romanizedText = this.showRomanization &&
|
|
2212
|
+
syllable.romanizedText &&
|
|
2213
|
+
syllable.romanizedText.trim() !== syllable.text.trim()
|
|
2214
|
+
? x `<span
|
|
2200
2215
|
class="lyrics-syllable transliteration ${syllable.lineSynced
|
|
2201
2216
|
? 'line-synced'
|
|
2202
2217
|
: ''}"
|
|
@@ -2204,13 +2219,13 @@ class AmLyrics extends i {
|
|
|
2204
2219
|
data-end-time="${endTimeMs}"
|
|
2205
2220
|
data-duration="${durationMs}"
|
|
2206
2221
|
data-syllable-index="0"
|
|
2207
|
-
data-wipe-ratio="
|
|
2222
|
+
data-wipe-ratio="1"
|
|
2208
2223
|
>${syllable.romanizedText}</span
|
|
2209
2224
|
>`
|
|
2210
2225
|
: '';
|
|
2211
2226
|
// For growable words, wrap each character in a span with YouLyPlus applyGrowthStyles
|
|
2212
2227
|
const syllableContent = isGrowable
|
|
2213
|
-
?
|
|
2228
|
+
? x `${text.split('').map((char, charIndex) => {
|
|
2214
2229
|
if (char === ' ') {
|
|
2215
2230
|
return ' ';
|
|
2216
2231
|
}
|
|
@@ -2248,7 +2263,7 @@ class AmLyrics extends i {
|
|
|
2248
2263
|
const position = (charIndex + 0.5) / numChars;
|
|
2249
2264
|
const horizontalOffset = (position - 0.5) * 2 * ((charMaxScale - 1.0) * 25);
|
|
2250
2265
|
// MOVED TO DATA ATTRIBUTES and removed style attribute to avoid Lit conflict
|
|
2251
|
-
return
|
|
2266
|
+
return x `<span
|
|
2252
2267
|
class="char"
|
|
2253
2268
|
data-char-index="${charIndex}"
|
|
2254
2269
|
data-syllable-char-index="${charIndex}"
|
|
@@ -2262,7 +2277,7 @@ class AmLyrics extends i {
|
|
|
2262
2277
|
>`;
|
|
2263
2278
|
})}`
|
|
2264
2279
|
: text;
|
|
2265
|
-
return
|
|
2280
|
+
return x `<span
|
|
2266
2281
|
class="lyrics-word ${isGrowable ? 'growable' : ''}"
|
|
2267
2282
|
>
|
|
2268
2283
|
<span class="lyrics-syllable-wrap">
|
|
@@ -2283,16 +2298,25 @@ class AmLyrics extends i {
|
|
|
2283
2298
|
})}
|
|
2284
2299
|
</p>`;
|
|
2285
2300
|
// Translation container (if enabled)
|
|
2286
|
-
|
|
2287
|
-
|
|
2301
|
+
// Hide translation if it matches the original line text
|
|
2302
|
+
const fullLineText = line.text
|
|
2303
|
+
.map(s => s.text)
|
|
2304
|
+
.join('')
|
|
2305
|
+
.trim();
|
|
2306
|
+
const translationElement = this.showTranslation &&
|
|
2307
|
+
line.translation &&
|
|
2308
|
+
line.translation.trim() !== fullLineText
|
|
2309
|
+
? x `<div class="lyrics-translation-container">
|
|
2288
2310
|
${line.translation}
|
|
2289
2311
|
</div>`
|
|
2290
2312
|
: '';
|
|
2291
2313
|
// Line-synced romanization (fallback if no word-level romanization)
|
|
2314
|
+
// Hide if the romanized text matches the original line text
|
|
2292
2315
|
const lineRomanizationElement = this.showRomanization &&
|
|
2293
2316
|
line.romanizedText &&
|
|
2294
|
-
!line.text.some(s => s.romanizedText)
|
|
2295
|
-
|
|
2317
|
+
!line.text.some(s => s.romanizedText) &&
|
|
2318
|
+
line.romanizedText.trim() !== fullLineText
|
|
2319
|
+
? x `<div class="lyrics-romanization-container">
|
|
2296
2320
|
${line.romanizedText}
|
|
2297
2321
|
</div>`
|
|
2298
2322
|
: '';
|
|
@@ -2303,7 +2327,7 @@ class AmLyrics extends i {
|
|
|
2303
2327
|
// Calculate dot timing for fill-up animation (3 dots)
|
|
2304
2328
|
const dotDuration = (gapForLine.gapEnd - gapForLine.gapStart) / 3;
|
|
2305
2329
|
// Gap starts without 'active' — _onTimeChanged toggles it imperatively
|
|
2306
|
-
maybeInstrumentalBlock =
|
|
2330
|
+
maybeInstrumentalBlock = x `<div
|
|
2307
2331
|
id="gap-${lineIndex}"
|
|
2308
2332
|
class="lyrics-line lyrics-gap"
|
|
2309
2333
|
data-start-time="${gapForLine.gapStart}"
|
|
@@ -2347,7 +2371,7 @@ class AmLyrics extends i {
|
|
|
2347
2371
|
</div>
|
|
2348
2372
|
</div>`;
|
|
2349
2373
|
}
|
|
2350
|
-
return
|
|
2374
|
+
return x `
|
|
2351
2375
|
${maybeInstrumentalBlock}
|
|
2352
2376
|
<div
|
|
2353
2377
|
id="${lineId}"
|
|
@@ -2374,14 +2398,14 @@ class AmLyrics extends i {
|
|
|
2374
2398
|
`;
|
|
2375
2399
|
});
|
|
2376
2400
|
};
|
|
2377
|
-
return
|
|
2401
|
+
return x `
|
|
2378
2402
|
<div
|
|
2379
2403
|
class="lyrics-container blur-inactive-enabled ${this.isUserScrolling
|
|
2380
2404
|
? 'user-scrolling'
|
|
2381
2405
|
: ''}"
|
|
2382
2406
|
>
|
|
2383
2407
|
${!this.isLoading && this.lyrics && this.lyrics.length > 0
|
|
2384
|
-
?
|
|
2408
|
+
? x `
|
|
2385
2409
|
<div class="lyrics-header">
|
|
2386
2410
|
<div class="header-controls">
|
|
2387
2411
|
<button
|
|
@@ -2480,7 +2504,7 @@ class AmLyrics extends i {
|
|
|
2480
2504
|
: ''}
|
|
2481
2505
|
${renderContent()}
|
|
2482
2506
|
${!this.isLoading
|
|
2483
|
-
?
|
|
2507
|
+
? x `
|
|
2484
2508
|
<footer class="lyrics-footer">
|
|
2485
2509
|
<div class="footer-content">
|
|
2486
2510
|
<span class="source-info">Source: ${sourceLabel}</span>
|
|
@@ -2527,7 +2551,7 @@ AmLyrics.styles = i$3 `
|
|
|
2527
2551
|
--lyplus-gap-dot-margin: 0.08em;
|
|
2528
2552
|
|
|
2529
2553
|
--lyplus-font-size-base: 32px;
|
|
2530
|
-
--lyplus-font-size-base-grow:
|
|
2554
|
+
--lyplus-font-size-base-grow: 24.5;
|
|
2531
2555
|
--lyplus-font-size-subtext: 0.6em;
|
|
2532
2556
|
|
|
2533
2557
|
--lyplus-blur-amount: 0.07em;
|