@uimaxbai/am-lyrics 1.0.2 → 1.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/src/AmLyrics.d.ts.map +1 -1
- package/dist/src/am-lyrics.js +65 -31
- package/dist/src/am-lyrics.js.map +1 -1
- package/dist/src/react.js +65 -31
- package/dist/src/react.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/AmLyrics.ts +46 -10
package/dist/src/react.js
CHANGED
|
@@ -35,32 +35,32 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
35
35
|
* Copyright 2019 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
37
|
*/
|
|
38
|
-
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((
|
|
38
|
+
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;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2017 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/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(
|
|
44
|
+
*/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$1={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$1){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$1}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;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$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.2");
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2017 Google LLC
|
|
49
49
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
50
|
*/
|
|
51
|
-
const t=globalThis,i$1=t
|
|
51
|
+
const t=globalThis,i$1=t=>t,s$1=t.trustedTypes,e$2=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",o$2=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$2,r$2=`<${n$1}>`,l=document,c=()=>l.createComment(""),a=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,d=t=>u(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l.createTreeWalker(l,129);function V(t,i){if(!u(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$2?e$2.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?"!--"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p):void 0!==u[3]&&(c=p):c===p?">"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith("/>")?" ":"";l+=c===v?s+r$2:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o$2+x):s+o$2+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o$2),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z:H}),r.removeAttribute(t);}else t.startsWith(o$2)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$2),i=t.length-1;if(i>0){r.textContent=s$1?s$1.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$2,t+1));)d.push({type:7,index:l}),t+=o$2.length-1;}l++;}}static createElement(t,i){const s=l.createElement("template");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a(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=M(t,h._$AS(t,i.values),h,e)),i}class R{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??l).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l,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 k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,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=M(this,t,i),a(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(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!==A&&a(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.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=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u(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 k(this.O(c()),this.O(c()),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,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$1(t).nextSibling;i$1(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,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=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M(this,t,i,0),o=!a(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||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){M(this,t);}}const B=t.litHtmlPolyfillSupport;B?.(S,k),(t.litHtmlVersions??=[]).push("3.3.2");const D=(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 k(i.insertBefore(c(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright 2017 Google LLC
|
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
-
*/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=
|
|
57
|
+
*/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=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o$1=s.litElementPolyfillSupport;o$1?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.2");
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2017 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/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)}
|
|
63
|
+
*/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,true,r);},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,true,r);}}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)}
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
@@ -313,7 +313,7 @@ class GoogleService {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
const VERSION = '1.0.
|
|
316
|
+
const VERSION = '1.0.3';
|
|
317
317
|
const INSTRUMENTAL_THRESHOLD_MS = 7000; // Show dots for gaps >= 7s
|
|
318
318
|
const KPOE_SERVERS = [
|
|
319
319
|
'https://lyricsplus.binimum.org',
|
|
@@ -711,7 +711,8 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
711
711
|
}
|
|
712
712
|
const sanitizedEntries = rawLyrics.filter((item) => Boolean(item));
|
|
713
713
|
const lines = [];
|
|
714
|
-
|
|
714
|
+
// If type is 'Line', we revert to line-by-line highlighting by skipping syllabus parsing
|
|
715
|
+
const isLineType = payload.type === 'Line' || payload.type === 'line';
|
|
715
716
|
// Convert metadata.agents to alignment map
|
|
716
717
|
const agents = payload.metadata?.agents ?? {};
|
|
717
718
|
const agentEntries = Object.entries(agents);
|
|
@@ -785,6 +786,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
785
786
|
part: false,
|
|
786
787
|
timestamp: lineStart,
|
|
787
788
|
endtime: lineEnd || lineStart,
|
|
789
|
+
lineSynced: isLineType, // Mark as line-synced
|
|
788
790
|
});
|
|
789
791
|
}
|
|
790
792
|
const hasWordSync = mainSyllables.length > 0 || backgroundSyllables.length > 0;
|
|
@@ -1748,6 +1750,11 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
1748
1750
|
else {
|
|
1749
1751
|
wipeAnimation = isRTL ? 'wipe-rtl' : 'wipe';
|
|
1750
1752
|
}
|
|
1753
|
+
if (syllable.classList.contains('line-synced')) {
|
|
1754
|
+
// If line-synced, just add the class for CSS animation, or ensure valid state
|
|
1755
|
+
// The CSS rule .lyrics-syllable.line-synced handles the fade
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1751
1758
|
const currentWipeAnimation = isGap ? 'fade-gap' : wipeAnimation;
|
|
1752
1759
|
const syllableAnimation = `${currentWipeAnimation} ${visualDuration}ms ${isGap ? 'ease-out' : 'linear'} forwards`;
|
|
1753
1760
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -2117,7 +2124,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2117
2124
|
const renderContent = () => {
|
|
2118
2125
|
if (this.isLoading) {
|
|
2119
2126
|
// Render stylized skeleton lines
|
|
2120
|
-
return
|
|
2127
|
+
return b `
|
|
2121
2128
|
<div class="skeleton-line"></div>
|
|
2122
2129
|
<div class="skeleton-line"></div>
|
|
2123
2130
|
<div class="skeleton-line"></div>
|
|
@@ -2128,7 +2135,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2128
2135
|
`;
|
|
2129
2136
|
}
|
|
2130
2137
|
if (!this.lyrics || this.lyrics.length === 0) {
|
|
2131
|
-
return
|
|
2138
|
+
return b `<div class="no-lyrics">No lyrics found.</div>`;
|
|
2132
2139
|
}
|
|
2133
2140
|
// Build a lookup map of ALL gaps so they are always in the DOM
|
|
2134
2141
|
const allGaps = this.findAllInstrumentalGaps();
|
|
@@ -2149,15 +2156,17 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2149
2156
|
(isLineActive || bgIsPlayingNow);
|
|
2150
2157
|
// Create background vocals container
|
|
2151
2158
|
const backgroundVocalElement = shouldShowBackground
|
|
2152
|
-
?
|
|
2159
|
+
? b `<p class="background-vocal-container">
|
|
2153
2160
|
${line.backgroundText.map((syllable, syllableIndex) => {
|
|
2154
2161
|
const startTimeMs = syllable.timestamp;
|
|
2155
2162
|
const endTimeMs = syllable.endtime;
|
|
2156
2163
|
const durationMs = endTimeMs - startTimeMs;
|
|
2157
|
-
return
|
|
2164
|
+
return b `<span class="lyrics-word">
|
|
2158
2165
|
<span class="lyrics-syllable-wrap">
|
|
2159
2166
|
<span
|
|
2160
|
-
class="lyrics-syllable
|
|
2167
|
+
class="lyrics-syllable ${syllable.lineSynced
|
|
2168
|
+
? 'line-synced'
|
|
2169
|
+
: ''}"
|
|
2161
2170
|
data-start-time="${startTimeMs}"
|
|
2162
2171
|
data-end-time="${endTimeMs}"
|
|
2163
2172
|
data-duration="${durationMs}"
|
|
@@ -2170,7 +2179,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2170
2179
|
</p>`
|
|
2171
2180
|
: '';
|
|
2172
2181
|
// Create main vocals using YouLyPlus syllable structure
|
|
2173
|
-
const mainVocalElement =
|
|
2182
|
+
const mainVocalElement = b `<p class="main-vocal-container">
|
|
2174
2183
|
${line.text.map(syllable => {
|
|
2175
2184
|
const startTimeMs = syllable.timestamp;
|
|
2176
2185
|
const endTimeMs = syllable.endtime;
|
|
@@ -2190,19 +2199,21 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2190
2199
|
durationMs >= trimmedText.length * 300;
|
|
2191
2200
|
// Optional romanization per syllable
|
|
2192
2201
|
const romanizedText = this.showRomanization && syllable.romanizedText
|
|
2193
|
-
?
|
|
2194
|
-
class="lyrics-syllable transliteration
|
|
2202
|
+
? b `<span
|
|
2203
|
+
class="lyrics-syllable transliteration ${syllable.lineSynced
|
|
2204
|
+
? 'line-synced'
|
|
2205
|
+
: ''}"
|
|
2195
2206
|
data-start-time="${startTimeMs}"
|
|
2196
2207
|
data-end-time="${endTimeMs}"
|
|
2197
2208
|
data-duration="${durationMs}"
|
|
2198
2209
|
data-syllable-index="0"
|
|
2199
|
-
data-wipe-ratio="
|
|
2210
|
+
data-wipe-ratio="0"
|
|
2200
2211
|
>${syllable.romanizedText}</span
|
|
2201
2212
|
>`
|
|
2202
2213
|
: '';
|
|
2203
2214
|
// For growable words, wrap each character in a span with YouLyPlus applyGrowthStyles
|
|
2204
2215
|
const syllableContent = isGrowable
|
|
2205
|
-
?
|
|
2216
|
+
? b `${text.split('').map((char, charIndex) => {
|
|
2206
2217
|
if (char === ' ') {
|
|
2207
2218
|
return ' ';
|
|
2208
2219
|
}
|
|
@@ -2240,7 +2251,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2240
2251
|
const position = (charIndex + 0.5) / numChars;
|
|
2241
2252
|
const horizontalOffset = (position - 0.5) * 2 * ((charMaxScale - 1.0) * 25);
|
|
2242
2253
|
// MOVED TO DATA ATTRIBUTES and removed style attribute to avoid Lit conflict
|
|
2243
|
-
return
|
|
2254
|
+
return b `<span
|
|
2244
2255
|
class="char"
|
|
2245
2256
|
data-char-index="${charIndex}"
|
|
2246
2257
|
data-syllable-char-index="${charIndex}"
|
|
@@ -2254,12 +2265,14 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2254
2265
|
>`;
|
|
2255
2266
|
})}`
|
|
2256
2267
|
: text;
|
|
2257
|
-
return
|
|
2268
|
+
return b `<span
|
|
2258
2269
|
class="lyrics-word ${isGrowable ? 'growable' : ''}"
|
|
2259
2270
|
>
|
|
2260
2271
|
<span class="lyrics-syllable-wrap">
|
|
2261
2272
|
<span
|
|
2262
|
-
class="lyrics-syllable
|
|
2273
|
+
class="lyrics-syllable ${syllable.lineSynced
|
|
2274
|
+
? 'line-synced'
|
|
2275
|
+
: ''}"
|
|
2263
2276
|
data-start-time="${startTimeMs}"
|
|
2264
2277
|
data-end-time="${endTimeMs}"
|
|
2265
2278
|
data-duration="${durationMs}"
|
|
@@ -2274,7 +2287,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2274
2287
|
</p>`;
|
|
2275
2288
|
// Translation container (if enabled)
|
|
2276
2289
|
const translationElement = this.showTranslation && line.translation
|
|
2277
|
-
?
|
|
2290
|
+
? b `<div class="lyrics-translation-container">
|
|
2278
2291
|
${line.translation}
|
|
2279
2292
|
</div>`
|
|
2280
2293
|
: '';
|
|
@@ -2282,7 +2295,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2282
2295
|
const lineRomanizationElement = this.showRomanization &&
|
|
2283
2296
|
line.romanizedText &&
|
|
2284
2297
|
!line.text.some(s => s.romanizedText)
|
|
2285
|
-
?
|
|
2298
|
+
? b `<div class="lyrics-romanization-container">
|
|
2286
2299
|
${line.romanizedText}
|
|
2287
2300
|
</div>`
|
|
2288
2301
|
: '';
|
|
@@ -2293,7 +2306,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2293
2306
|
// Calculate dot timing for fill-up animation (3 dots)
|
|
2294
2307
|
const dotDuration = (gapForLine.gapEnd - gapForLine.gapStart) / 3;
|
|
2295
2308
|
// Gap starts without 'active' — _onTimeChanged toggles it imperatively
|
|
2296
|
-
maybeInstrumentalBlock =
|
|
2309
|
+
maybeInstrumentalBlock = b `<div
|
|
2297
2310
|
id="gap-${lineIndex}"
|
|
2298
2311
|
class="lyrics-line lyrics-gap"
|
|
2299
2312
|
data-start-time="${gapForLine.gapStart}"
|
|
@@ -2337,7 +2350,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2337
2350
|
</div>
|
|
2338
2351
|
</div>`;
|
|
2339
2352
|
}
|
|
2340
|
-
return
|
|
2353
|
+
return b `
|
|
2341
2354
|
${maybeInstrumentalBlock}
|
|
2342
2355
|
<div
|
|
2343
2356
|
id="${lineId}"
|
|
@@ -2364,14 +2377,14 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2364
2377
|
`;
|
|
2365
2378
|
});
|
|
2366
2379
|
};
|
|
2367
|
-
return
|
|
2380
|
+
return b `
|
|
2368
2381
|
<div
|
|
2369
2382
|
class="lyrics-container blur-inactive-enabled ${this.isUserScrolling
|
|
2370
2383
|
? 'user-scrolling'
|
|
2371
2384
|
: ''}"
|
|
2372
2385
|
>
|
|
2373
2386
|
${!this.isLoading && this.lyrics && this.lyrics.length > 0
|
|
2374
|
-
?
|
|
2387
|
+
? b `
|
|
2375
2388
|
<div class="lyrics-header">
|
|
2376
2389
|
<div class="header-controls">
|
|
2377
2390
|
<button
|
|
@@ -2470,7 +2483,7 @@ let AmLyrics$1 = class AmLyrics extends i {
|
|
|
2470
2483
|
: ''}
|
|
2471
2484
|
${renderContent()}
|
|
2472
2485
|
${!this.isLoading
|
|
2473
|
-
?
|
|
2486
|
+
? b `
|
|
2474
2487
|
<footer class="lyrics-footer">
|
|
2475
2488
|
<div class="footer-content">
|
|
2476
2489
|
<span class="source-info">Source: ${sourceLabel}</span>
|
|
@@ -2516,8 +2529,8 @@ AmLyrics$1.styles = i$3 `
|
|
|
2516
2529
|
--lyplus-gap-dot-size: 0.4em;
|
|
2517
2530
|
--lyplus-gap-dot-margin: 0.08em;
|
|
2518
2531
|
|
|
2519
|
-
--lyplus-font-size-base:
|
|
2520
|
-
--lyplus-font-size-base-grow:
|
|
2532
|
+
--lyplus-font-size-base: 32px;
|
|
2533
|
+
--lyplus-font-size-base-grow: 30;
|
|
2521
2534
|
--lyplus-font-size-subtext: 0.6em;
|
|
2522
2535
|
|
|
2523
2536
|
--lyplus-blur-amount: 0.07em;
|
|
@@ -3016,9 +3029,30 @@ AmLyrics$1.styles = i$3 `
|
|
|
3016
3029
|
display: inline-block;
|
|
3017
3030
|
width: var(--lyplus-gap-dot-size);
|
|
3018
3031
|
height: var(--lyplus-gap-dot-size);
|
|
3032
|
+
background-color: var(--lyplus-text-primary);
|
|
3033
|
+
border-radius: 50%;
|
|
3019
3034
|
margin: 0 var(--lyplus-gap-dot-margin);
|
|
3020
|
-
|
|
3021
|
-
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
/* Line-synced lyrics should fade in instantly/quickly instead of wiping */
|
|
3038
|
+
.lyrics-syllable.line-synced {
|
|
3039
|
+
animation: fade-in-line 0.2s ease-out forwards !important;
|
|
3040
|
+
background: transparent !important;
|
|
3041
|
+
color: var(--lyplus-text-primary) !important;
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
@keyframes fade-in-line {
|
|
3045
|
+
from {
|
|
3046
|
+
opacity: 0.5;
|
|
3047
|
+
color: var(--lyplus-text-secondary);
|
|
3048
|
+
}
|
|
3049
|
+
to {
|
|
3050
|
+
opacity: 1;
|
|
3051
|
+
color: var(--lyplus-lyrics-palette);
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
.lyrics-gap .lyrics-syllable {
|
|
3022
3056
|
background-color: var(--lyplus-text-secondary);
|
|
3023
3057
|
background-clip: unset;
|
|
3024
3058
|
}
|