music-lyric-kit 0.12.0 → 0.12.1

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@music-lyric-kit/lyric"),P=require("@music-lyric-kit/plugin-format-lrc"),b=require("@music-lyric-kit/plugin-format-ttml"),y=require("@music-lyric-kit/plugin-transform-interlude"),_=require("@music-lyric-kit/plugin-transform-background"),T=require("@music-lyric-kit/plugin-transform-agent"),w=require("@music-lyric-kit/plugin-transform-space"),k=require("@music-lyric-kit/plugin-transform-pure"),C=require("@music-lyric-kit/plugin-transform-stress"),a=require("@music-lyric-kit/core");function s(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const f=s(P),p=s(b),h=s(y),i=s(_),g=s(T),d=s(w),o=s(k),m=s(C),E=Object.freeze(Object.defineProperty({__proto__:null,Lrc:f,Ttml:p},Symbol.toStringTag,{value:"Module"})),O=Object.freeze(Object.defineProperty({__proto__:null,Agent:g,Background:i,Interlude:h,Pure:o,Space:d,Stress:m},Symbol.toStringTag,{value:"Module"})),l=[new f.Parser,new p.AmllParser],r={agent:{extract:new g.Extract},background:{extract:new i.Extract,clean:new i.Clean},pure:{extract:new o.ExtractCreator,clean:new o.Clean},space:{insert:new d.Insert},interlude:{insert:new h.Insert},stress:{mark:new m.Mark}};class x{context;format;input;done;constructor(e){this.done=!1,this.input=e,this.format=this.input.format||"";const t=new u.Lyric.Info;this.context=new a.ParserContext({content:this.input.content,musicInfo:this.input.musicInfo},t)}handleApplyConfig(e,t){e.config&&(e.config.reset(),t&&e.config.update(t))}handleExecPlugin(e){this.done=!1;try{if(!e.check(this.context))return}catch(t){console.warn(`plugin check failed id=${e.id} err=${t?.message}`);return}try{e.exec(this.context)}catch(t){console.warn(`plugin call failed id=${e.id} err=${t?.message}`)}}infer(){if(this.format)return this;for(const e of l)try{if(e.check(this.context)){this.format=e.format;break}}catch{continue}return this}parse(){if(!this.format)throw new Error("no format detected. call .infer() before .parse()");const e=l.find(t=>t.format===this.format);if(!e)throw new Error(`parser plugin not found: "${this.format}"`);this.done=!1;try{e.exec(this.context)}catch(t){console.warn(`plugin call failed id=${e.id} err=${t?.message}`)}return this}backgroundExtract(e){return this.handleApplyConfig(r.background.extract,e),this.handleExecPlugin(r.background.extract),this}backgroundClean(){return this.handleExecPlugin(r.background.clean),this}agentExtract(e){return this.handleApplyConfig(r.agent.extract,e),this.handleExecPlugin(r.agent.extract),this}pureExtract(e){return this.handleApplyConfig(r.pure.extract,e),this.handleExecPlugin(r.pure.extract),this}pureClean(e){return this.handleApplyConfig(r.pure.clean,e),this.handleExecPlugin(r.pure.clean),this}interludeInsert(e){return this.handleApplyConfig(r.interlude.insert,e),this.handleExecPlugin(r.interlude.insert),this}spaceInsert(e){return this.handleApplyConfig(r.space.insert,e),this.handleExecPlugin(r.space.insert),this}stressMark(e){return this.handleApplyConfig(r.stress.mark,e),this.handleExecPlugin(r.stress.mark),this}final(){return this.done||(this.context.cleanWord(),this.context.calcAgentIndex(),this.context.syncLineTimeWithWord(),this.context.sort(),this.context.syncLineTimeWithBackground(),this.done=!0),{format:this.format,result:this.context.result}}}const j=n=>new x(n);Object.defineProperty(exports,"Lyric",{enumerable:!0,get:()=>u.Lyric});Object.defineProperty(exports,"Generator",{enumerable:!0,get:()=>a.Generator});Object.defineProperty(exports,"GeneratorContext",{enumerable:!0,get:()=>a.GeneratorContext});Object.defineProperty(exports,"Parser",{enumerable:!0,get:()=>a.Parser});Object.defineProperty(exports,"ParserContext",{enumerable:!0,get:()=>a.ParserContext});exports.Format=E;exports.ParserPipeline=x;exports.Transform=O;exports.createParserPipeline=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@music-lyric-kit/lyric"),_=require("@music-lyric-kit/plugin-format-lrc"),x=require("@music-lyric-kit/plugin-format-ttml"),P=require("@music-lyric-kit/plugin-transform-interlude"),b=require("@music-lyric-kit/plugin-transform-background"),w=require("@music-lyric-kit/plugin-transform-agent"),y=require("@music-lyric-kit/plugin-transform-space"),T=require("@music-lyric-kit/plugin-transform-pure"),k=require("@music-lyric-kit/plugin-transform-stress"),s=require("@music-lyric-kit/core");function n(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const l=n(_),h=n(x),f=n(P),i=n(b),m=n(w),p=n(y),c=n(T),g=n(k),S=Object.freeze(Object.defineProperty({__proto__:null,Lrc:l,Ttml:h},Symbol.toStringTag,{value:"Module"})),O=Object.freeze(Object.defineProperty({__proto__:null,Agent:m,Background:i,Interlude:f,Pure:c,Space:p,Stress:g},Symbol.toStringTag,{value:"Module"})),a=[new l.Parser,new h.AmllParser];class j{constructor(e){this.client=e}_extract=new m.Extract;extract(e){return this.client.run(this._extract,e)}}class C{constructor(e){this.client=e}_extract=new i.Extract;_clean=new i.Clean;extract(e){return this.client.run(this._extract,e)}clean(){return this.client.run(this._clean)}}class I{constructor(e){this.client=e}_extractCreator=new c.ExtractCreator;_clean=new c.Clean;extractCreator(e){return this.client.run(this._extractCreator,e)}clean(e){return this.client.run(this._clean,e)}}class q{constructor(e){this.client=e}_insert=new f.Insert;insert(e){return this.client.run(this._insert,e)}}class L{constructor(e){this.client=e}_insert=new p.Insert;insert(e){return this.client.run(this._insert,e)}}class ${constructor(e){this.client=e}_mark=new g.Mark;mark(e){return this.client.run(this._mark,e)}}class d{context;format;input;done;agent;background;pure;interlude;space;stress;constructor(e){this.done=!1,this.input=e,this.format=this.input.format||"";const t=new u.Lyric.Info;this.context=new s.ParserContext({content:this.input.content,musicInfo:this.input.musicInfo},t),this.agent=new j(this),this.background=new C(this),this.pure=new I(this),this.interlude=new q(this),this.space=new L(this),this.stress=new $(this)}applyConfig(e,t){e.config&&(e.config.reset(),t&&e.config.update(t))}exec(e){this.done=!1;try{if(!e.check(this.context))return}catch(t){console.warn(`plugin check failed id=${e.id} err=${t?.message}`);return}try{e.exec(this.context)}catch(t){console.warn(`plugin call failed id=${e.id} err=${t?.message}`)}}run(e,t){return this.applyConfig(e,t),this.exec(e),this}infer(){if(this.format)return this;for(const e of a)try{if(e.check(this.context)){this.format=e.format;break}}catch{continue}return this}parse(){if(!this.format)throw new Error("no format detected. call .infer() before .parse()");const e=a.find(t=>t.format===this.format);if(!e)throw new Error(`parser plugin not found: "${this.format}"`);this.done=!1;try{e.exec(this.context)}catch(t){console.warn(`plugin call failed id=${e.id} err=${t?.message}`)}return this}final(){return this.done||(this.context.cleanWord(),this.context.syncLineTimeWithWord(),this.context.sort(),this.context.calcAgentIndex(),this.context.syncLineTimeWithBackground(),this.done=!0),{format:this.format,result:this.context.result}}}const A=r=>new d(r);Object.defineProperty(exports,"Lyric",{enumerable:!0,get:()=>u.Lyric});Object.defineProperty(exports,"Generator",{enumerable:!0,get:()=>s.Generator});Object.defineProperty(exports,"GeneratorContext",{enumerable:!0,get:()=>s.GeneratorContext});Object.defineProperty(exports,"Parser",{enumerable:!0,get:()=>s.Parser});Object.defineProperty(exports,"ParserContext",{enumerable:!0,get:()=>s.ParserContext});exports.Format=S;exports.ParserPipeline=d;exports.Transform=O;exports.createParserPipeline=A;
2
2
  //# sourceMappingURL=index.comm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.comm.js","sources":["../src/parser/pipeline.ts"],"sourcesContent":["import type { ParserParams } from '@music-lyric-kit/core'\n\nimport { Lyric } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Format, Transform } from '@root/plugin'\n\nexport interface ParserPipelineInput {\n format?: string\n content: any\n musicInfo?: ParserParams['musicInfo']\n}\n\nexport interface ParserPipelineResult {\n format: string\n result: Lyric.Info\n}\n\nconst BuiltInFormats = [new Format.Lrc.Parser(), new Format.Ttml.AmllParser()]\n\nconst BuiltInPlugins = {\n agent: {\n extract: new Transform.Agent.Extract(),\n },\n background: {\n extract: new Transform.Background.Extract(),\n clean: new Transform.Background.Clean(),\n },\n pure: {\n extract: new Transform.Pure.ExtractCreator(),\n clean: new Transform.Pure.Clean(),\n },\n space: {\n insert: new Transform.Space.Insert(),\n },\n interlude: {\n insert: new Transform.Interlude.Insert(),\n },\n stress: {\n mark: new Transform.Stress.Mark(),\n },\n}\n\nexport class ParserPipeline {\n private context: ParserContext\n private format: string\n private input: ParserPipelineInput\n private done: boolean\n\n constructor(input: ParserPipelineInput) {\n this.done = false\n this.input = input\n this.format = this.input.format || ''\n\n const init = new Lyric.Info()\n this.context = new ParserContext({ content: this.input.content, musicInfo: this.input.musicInfo }, init)\n }\n\n private handleApplyConfig(plugin: ParserPlugin, options?: any) {\n if (!plugin.config) {\n return\n }\n\n // reset config first\n plugin.config.reset()\n\n if (options) {\n plugin.config.update(options)\n }\n }\n\n private handleExecPlugin(plugin: ParserPlugin) {\n this.done = false\n\n try {\n const result = plugin.check(this.context)\n if (!result) {\n return\n }\n } catch (e: any) {\n console.warn(`plugin check failed id=${plugin.id} err=${e?.message}`)\n return\n }\n\n try {\n plugin.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${plugin.id} err=${e?.message}`)\n }\n }\n\n infer(): this {\n if (this.format) {\n return this\n }\n for (const plugin of BuiltInFormats) {\n try {\n const result = plugin.check(this.context)\n if (result) {\n this.format = plugin.format\n break\n }\n } catch {\n continue\n }\n }\n return this\n }\n\n parse(): this {\n if (!this.format) {\n throw new Error('no format detected. call .infer() before .parse()')\n }\n\n const parser = BuiltInFormats.find((item) => item.format === this.format)\n if (!parser) {\n throw new Error(`parser plugin not found: \"${this.format}\"`)\n }\n\n this.done = false\n\n try {\n parser.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${parser.id} err=${e?.message}`)\n }\n\n return this\n }\n\n backgroundExtract(options?: Transform.Background.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.background.extract, options)\n this.handleExecPlugin(BuiltInPlugins.background.extract)\n return this\n }\n\n backgroundClean(): this {\n this.handleExecPlugin(BuiltInPlugins.background.clean)\n return this\n }\n\n agentExtract(options?: Transform.Agent.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.agent.extract, options)\n this.handleExecPlugin(BuiltInPlugins.agent.extract)\n return this\n }\n\n pureExtract(options?: Transform.Pure.ExtractCreatorConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.extract, options)\n this.handleExecPlugin(BuiltInPlugins.pure.extract)\n return this\n }\n\n pureClean(options?: Transform.Pure.CleanConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.clean, options)\n this.handleExecPlugin(BuiltInPlugins.pure.clean)\n return this\n }\n\n interludeInsert(options?: Transform.Interlude.InsertConfig): this {\n this.handleApplyConfig(BuiltInPlugins.interlude.insert, options)\n this.handleExecPlugin(BuiltInPlugins.interlude.insert)\n return this\n }\n\n spaceInsert(options?: Transform.Space.SpaceConfig): this {\n this.handleApplyConfig(BuiltInPlugins.space.insert, options)\n this.handleExecPlugin(BuiltInPlugins.space.insert)\n return this\n }\n\n stressMark(options?: Transform.Stress.MarkConfig): this {\n this.handleApplyConfig(BuiltInPlugins.stress.mark, options)\n this.handleExecPlugin(BuiltInPlugins.stress.mark)\n return this\n }\n\n final(): ParserPipelineResult {\n if (!this.done) {\n this.context.cleanWord()\n this.context.calcAgentIndex()\n this.context.syncLineTimeWithWord()\n this.context.sort()\n this.context.syncLineTimeWithBackground()\n this.done = true\n }\n\n return {\n format: this.format,\n result: this.context.result,\n }\n }\n}\n\nexport const createParserPipeline = (input: ParserPipelineInput) => {\n return new ParserPipeline(input)\n}\n"],"names":["BuiltInFormats","Format.Lrc","Format.Ttml","BuiltInPlugins","Transform.Agent","Transform.Background","Transform.Pure","Transform.Space","Transform.Interlude","Transform.Stress","ParserPipeline","input","init","Lyric","ParserContext","plugin","options","e","parser","item","createParserPipeline"],"mappings":"gpCAkBMA,EAAiB,CAAC,IAAIC,EAAW,OAAU,IAAIC,EAAY,UAAY,EAEvEC,EAAiB,CACrB,MAAO,CACL,QAAS,IAAIC,EAAgB,OAAQ,EAEvC,WAAY,CACV,QAAS,IAAIC,EAAqB,QAClC,MAAO,IAAIA,EAAqB,KAAM,EAExC,KAAM,CACJ,QAAS,IAAIC,EAAe,eAC5B,MAAO,IAAIA,EAAe,KAAM,EAElC,MAAO,CACL,OAAQ,IAAIC,EAAgB,MAAO,EAErC,UAAW,CACT,OAAQ,IAAIC,EAAoB,MAAO,EAEzC,OAAQ,CACN,KAAM,IAAIC,EAAiB,IAAK,CAEpC,EAEO,MAAMC,CAAe,CAClB,QACA,OACA,MACA,KAER,YAAYC,EAA4B,CACtC,KAAK,KAAO,GACZ,KAAK,MAAQA,EACb,KAAK,OAAS,KAAK,MAAM,QAAU,GAEnC,MAAMC,EAAO,IAAIC,EAAAA,MAAM,KACvB,KAAK,QAAU,IAAIC,EAAAA,cAAc,CAAE,QAAS,KAAK,MAAM,QAAS,UAAW,KAAK,MAAM,SAAA,EAAaF,CAAI,CACzG,CAEQ,kBAAkBG,EAAsBC,EAAe,CACxDD,EAAO,SAKZA,EAAO,OAAO,MAAA,EAEVC,GACFD,EAAO,OAAO,OAAOC,CAAO,EAEhC,CAEQ,iBAAiBD,EAAsB,CAC7C,KAAK,KAAO,GAEZ,GAAI,CAEF,GAAI,CADWA,EAAO,MAAM,KAAK,OAAO,EAEtC,MAEJ,OAASE,EAAQ,CACf,QAAQ,KAAK,0BAA0BF,EAAO,EAAE,QAAQE,GAAG,OAAO,EAAE,EACpE,MACF,CAEA,GAAI,CACFF,EAAO,KAAK,KAAK,OAAO,CAC1B,OAASE,EAAQ,CACf,QAAQ,KAA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EAC/D,KAAK,iBAAiBb,EAAe,UAAU,MAAM,EAC9C,IACT,CAEA,YAAYa,EAA6C,CACvD,YAAK,kBAAkBb,EAAe,MAAM,OAAQa,CAAO,EAC3D,KAAK,iBAAiBb,EAAe,MAAM,MAAM,EAC1C,IACT,CAEA,WAAWa,EAA6C,CACtD,YAAK,kBAAkBb,EAAe,OAAO,KAAMa,CAAO,EAC1D,KAAK,iBAAiBb,EAAe,OAAO,IAAI,EACzC,IACT,CAEA,OAA8B,CAC5B,OAAK,KAAK,OACR,KAAK,QAAQ,UAAA,EACb,KAAK,QAAQ,eAAA,EACb,KAAK,QAAQ,qBAAA,EACb,KAAK,QAAQ,KAAA,EACb,KAAK,QAAQ,2BAAA,EACb,KAAK,KAAO,IAGP,CACL,OAAQ,KAAK,OACb,OAAQ,KAAK,QAAQ,MAAA,CAEzB,CACF,CAEO,MAAMiB,EAAwBT,GAC5B,IAAID,EAAeC,CAAK"}
1
+ {"version":3,"file":"index.comm.js","sources":["../src/parser/pipeline.ts"],"sourcesContent":["import type { ParserParams } from '@music-lyric-kit/core'\n\nimport { Lyric } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Format, Transform } from '@root/plugin'\n\nexport interface ParserPipelineInput {\n format?: string\n content: any\n musicInfo?: ParserParams['musicInfo']\n}\n\nexport interface ParserPipelineResult {\n format: string\n result: Lyric.Info\n}\n\nconst BuiltInFormats = [new Format.Lrc.Parser(), new Format.Ttml.AmllParser()]\n\nclass Agent {\n private _extract = new Transform.Agent.Extract()\n\n constructor(private client: ParserPipeline) {}\n\n extract(options?: Transform.Agent.ExtractConfig) {\n return this.client.run(this._extract, options)\n }\n}\n\nclass Background {\n private _extract = new Transform.Background.Extract()\n private _clean = new Transform.Background.Clean()\n\n constructor(private client: ParserPipeline) {}\n\n extract(options?: Transform.Background.ExtractConfig) {\n return this.client.run(this._extract, options)\n }\n\n clean() {\n return this.client.run(this._clean)\n }\n}\n\nclass Pure {\n private _extractCreator = new Transform.Pure.ExtractCreator()\n private _clean = new Transform.Pure.Clean()\n\n constructor(private client: ParserPipeline) {}\n\n extractCreator(options?: Transform.Pure.ExtractCreatorConfig) {\n return this.client.run(this._extractCreator, options)\n }\n\n clean(options?: Transform.Pure.CleanConfig) {\n return this.client.run(this._clean, options)\n }\n}\n\nclass Interlude {\n private _insert = new Transform.Interlude.Insert()\n\n constructor(private client: ParserPipeline) {}\n\n insert(options?: Transform.Interlude.InsertConfig) {\n return this.client.run(this._insert, options)\n }\n}\n\nclass Space {\n private _insert = new Transform.Space.Insert()\n\n constructor(private client: ParserPipeline) {}\n\n insert(options?: Transform.Space.SpaceConfig) {\n return this.client.run(this._insert, options)\n }\n}\n\nclass Stress {\n private _mark = new Transform.Stress.Mark()\n\n constructor(private client: ParserPipeline) {}\n\n mark(options?: Transform.Stress.MarkConfig) {\n return this.client.run(this._mark, options)\n }\n}\n\nexport class ParserPipeline {\n private context: ParserContext\n private format: string\n private input: ParserPipelineInput\n private done: boolean\n\n readonly agent: Agent\n readonly background: Background\n readonly pure: Pure\n readonly interlude: Interlude\n readonly space: Space\n readonly stress: Stress\n\n constructor(input: ParserPipelineInput) {\n this.done = false\n this.input = input\n this.format = this.input.format || ''\n\n const init = new Lyric.Info()\n this.context = new ParserContext({ content: this.input.content, musicInfo: this.input.musicInfo }, init)\n\n this.agent = new Agent(this)\n this.background = new Background(this)\n this.pure = new Pure(this)\n this.interlude = new Interlude(this)\n this.space = new Space(this)\n this.stress = new Stress(this)\n }\n\n private applyConfig(plugin: ParserPlugin, options?: any) {\n if (!plugin.config) {\n return\n }\n\n // reset config first\n plugin.config.reset()\n\n if (options) {\n plugin.config.update(options)\n }\n }\n\n private exec(plugin: ParserPlugin) {\n this.done = false\n\n try {\n const result = plugin.check(this.context)\n if (!result) {\n return\n }\n } catch (e: any) {\n console.warn(`plugin check failed id=${plugin.id} err=${e?.message}`)\n return\n }\n\n try {\n plugin.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${plugin.id} err=${e?.message}`)\n }\n }\n\n /**\n * Apply optional config to a plugin and execute it against the current context.\n * Intended for use by the pipeline plugin scopes.\n */\n run(plugin: ParserPlugin, options?: any): this {\n this.applyConfig(plugin, options)\n this.exec(plugin)\n return this\n }\n\n infer(): this {\n if (this.format) {\n return this\n }\n for (const plugin of BuiltInFormats) {\n try {\n const result = plugin.check(this.context)\n if (result) {\n this.format = plugin.format\n break\n }\n } catch {\n continue\n }\n }\n return this\n }\n\n parse(): this {\n if (!this.format) {\n throw new Error('no format detected. call .infer() before .parse()')\n }\n\n const parser = BuiltInFormats.find((item) => item.format === this.format)\n if (!parser) {\n throw new Error(`parser plugin not found: \"${this.format}\"`)\n }\n\n this.done = false\n\n try {\n parser.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${parser.id} err=${e?.message}`)\n }\n\n return this\n }\n\n final(): ParserPipelineResult {\n if (!this.done) {\n this.context.cleanWord()\n this.context.syncLineTimeWithWord()\n this.context.sort()\n this.context.calcAgentIndex()\n this.context.syncLineTimeWithBackground()\n this.done = true\n }\n\n return {\n format: this.format,\n result: this.context.result,\n }\n }\n}\n\nexport const createParserPipeline = (input: ParserPipelineInput) => {\n return new ParserPipeline(input)\n}\n"],"names":["BuiltInFormats","Format.Lrc","Format.Ttml","Agent","client","Transform.Agent","options","Background","Transform.Background","Pure","Transform.Pure","Interlude","Transform.Interlude","Space","Transform.Space","Stress","Transform.Stress","ParserPipeline","input","init","Lyric","ParserContext","plugin","e","parser","item","createParserPipeline"],"mappings":"gpCAkBMA,EAAiB,CAAC,IAAIC,EAAW,OAAU,IAAIC,EAAY,UAAY,EAE7E,MAAMC,CAAM,CAGV,YAAoBC,EAAwB,CAAxB,KAAA,OAAAA,CAAyB,CAFrC,SAAW,IAAIC,EAAgB,QAIvC,QAAQC,EAAyC,CAC/C,OAAO,KAAK,OAAO,IAAI,KAAK,SAAUA,CAAO,CAC/C,CACF,CAEA,MAAMC,CAAW,C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GAASA,EAAK,SAAW,KAAK,MAAM,EACxE,GAAI,CAACD,EACH,MAAM,IAAI,MAAM,6BAA6B,KAAK,MAAM,GAAG,EAG7D,KAAK,KAAO,GAEZ,GAAI,CACFA,EAAO,KAAK,KAAK,OAAO,CAC1B,OAASD,EAAQ,CACf,QAAQ,KAAK,yBAAyBC,EAAO,EAAE,QAAQD,GAAG,OAAO,EAAE,CACrE,CAEA,OAAO,IACT,CAEA,OAA8B,CAC5B,OAAK,KAAK,OACR,KAAK,QAAQ,UAAA,EACb,KAAK,QAAQ,qBAAA,EACb,KAAK,QAAQ,KAAA,EACb,KAAK,QAAQ,eAAA,EACb,KAAK,QAAQ,2BAAA,EACb,KAAK,KAAO,IAGP,CACL,OAAQ,KAAK,OACb,OAAQ,KAAK,QAAQ,MAAA,CAEzB,CACF,CAEO,MAAMG,EAAwBR,GAC5B,IAAID,EAAeC,CAAK"}
@@ -12,12 +12,29 @@ import { Parser } from '@music-lyric-kit/core';
12
12
  import { ParserContext } from '@music-lyric-kit/core';
13
13
  import { ParserOptions } from '@music-lyric-kit/core';
14
14
  import { ParserParams } from '@music-lyric-kit/core';
15
+ import { ParserPlugin } from '@music-lyric-kit/core';
15
16
  import { ParserResult } from '@music-lyric-kit/core';
16
17
  import * as Pure from '@music-lyric-kit/plugin-transform-pure';
17
18
  import * as Space from '@music-lyric-kit/plugin-transform-space';
18
19
  import * as Stress from '@music-lyric-kit/plugin-transform-stress';
19
20
  import * as Ttml from '@music-lyric-kit/plugin-format-ttml';
20
21
 
22
+ declare class Agent_2 {
23
+ private client;
24
+ private _extract;
25
+ constructor(client: ParserPipeline);
26
+ extract(options?: Transform.Agent.ExtractConfig): ParserPipeline;
27
+ }
28
+
29
+ declare class Background_2 {
30
+ private client;
31
+ private _extract;
32
+ private _clean;
33
+ constructor(client: ParserPipeline);
34
+ extract(options?: Transform.Background.ExtractConfig): ParserPipeline;
35
+ clean(): ParserPipeline;
36
+ }
37
+
21
38
  export declare const createParserPipeline: (input: ParserPipelineInput) => ParserPipeline;
22
39
 
23
40
  declare namespace Format {
@@ -38,6 +55,13 @@ export { GeneratorParams }
38
55
 
39
56
  export { GeneratorResult }
40
57
 
58
+ declare class Interlude_2 {
59
+ private client;
60
+ private _insert;
61
+ constructor(client: ParserPipeline);
62
+ insert(options?: Transform.Interlude.InsertConfig): ParserPipeline;
63
+ }
64
+
41
65
  export { Lyric }
42
66
 
43
67
  export { Parser }
@@ -53,19 +77,22 @@ export declare class ParserPipeline {
53
77
  private format;
54
78
  private input;
55
79
  private done;
80
+ readonly agent: Agent_2;
81
+ readonly background: Background_2;
82
+ readonly pure: Pure_2;
83
+ readonly interlude: Interlude_2;
84
+ readonly space: Space_2;
85
+ readonly stress: Stress_2;
56
86
  constructor(input: ParserPipelineInput);
57
- private handleApplyConfig;
58
- private handleExecPlugin;
87
+ private applyConfig;
88
+ private exec;
89
+ /**
90
+ * Apply optional config to a plugin and execute it against the current context.
91
+ * Intended for use by the pipeline plugin scopes.
92
+ */
93
+ run(plugin: ParserPlugin, options?: any): this;
59
94
  infer(): this;
60
95
  parse(): this;
61
- backgroundExtract(options?: Transform.Background.ExtractConfig): this;
62
- backgroundClean(): this;
63
- agentExtract(options?: Transform.Agent.ExtractConfig): this;
64
- pureExtract(options?: Transform.Pure.ExtractCreatorConfig): this;
65
- pureClean(options?: Transform.Pure.CleanConfig): this;
66
- interludeInsert(options?: Transform.Interlude.InsertConfig): this;
67
- spaceInsert(options?: Transform.Space.SpaceConfig): this;
68
- stressMark(options?: Transform.Stress.MarkConfig): this;
69
96
  final(): ParserPipelineResult;
70
97
  }
71
98
 
@@ -82,6 +109,29 @@ export declare interface ParserPipelineResult {
82
109
 
83
110
  export { ParserResult }
84
111
 
112
+ declare class Pure_2 {
113
+ private client;
114
+ private _extractCreator;
115
+ private _clean;
116
+ constructor(client: ParserPipeline);
117
+ extractCreator(options?: Transform.Pure.ExtractCreatorConfig): ParserPipeline;
118
+ clean(options?: Transform.Pure.CleanConfig): ParserPipeline;
119
+ }
120
+
121
+ declare class Space_2 {
122
+ private client;
123
+ private _insert;
124
+ constructor(client: ParserPipeline);
125
+ insert(options?: Transform.Space.SpaceConfig): ParserPipeline;
126
+ }
127
+
128
+ declare class Stress_2 {
129
+ private client;
130
+ private _mark;
131
+ constructor(client: ParserPipeline);
132
+ mark(options?: Transform.Stress.MarkConfig): ParserPipeline;
133
+ }
134
+
85
135
  declare namespace Transform {
86
136
  export {
87
137
  Interlude,
@@ -1,63 +1,110 @@
1
- import { Lyric as p } from "@music-lyric-kit/lyric";
2
- import { Lyric as C } from "@music-lyric-kit/lyric";
1
+ import { Lyric as f } from "@music-lyric-kit/lyric";
2
+ import { Lyric as $ } from "@music-lyric-kit/lyric";
3
3
  import * as o from "@music-lyric-kit/plugin-format-lrc";
4
4
  import * as c from "@music-lyric-kit/plugin-format-ttml";
5
- import * as l from "@music-lyric-kit/plugin-transform-interlude";
5
+ import * as a from "@music-lyric-kit/plugin-transform-interlude";
6
6
  import * as n from "@music-lyric-kit/plugin-transform-background";
7
- import * as u from "@music-lyric-kit/plugin-transform-agent";
8
- import * as h from "@music-lyric-kit/plugin-transform-space";
9
- import * as i from "@music-lyric-kit/plugin-transform-pure";
10
- import * as f from "@music-lyric-kit/plugin-transform-stress";
7
+ import * as l from "@music-lyric-kit/plugin-transform-agent";
8
+ import * as u from "@music-lyric-kit/plugin-transform-space";
9
+ import * as s from "@music-lyric-kit/plugin-transform-pure";
10
+ import * as h from "@music-lyric-kit/plugin-transform-stress";
11
11
  import { ParserContext as m } from "@music-lyric-kit/core";
12
- import { Generator as T, GeneratorContext as A, Parser as I, ParserContext as S } from "@music-lyric-kit/core";
13
- const P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12
+ import { Generator as A, GeneratorContext as B, Parser as E, ParserContext as j } from "@music-lyric-kit/core";
13
+ const T = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14
14
  __proto__: null,
15
15
  Lrc: o,
16
16
  Ttml: c
17
- }, Symbol.toStringTag, { value: "Module" })), w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
17
+ }, Symbol.toStringTag, { value: "Module" })), C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
18
18
  __proto__: null,
19
- Agent: u,
19
+ Agent: l,
20
20
  Background: n,
21
- Interlude: l,
22
- Pure: i,
23
- Space: h,
24
- Stress: f
25
- }, Symbol.toStringTag, { value: "Module" })), a = [new o.Parser(), new c.AmllParser()], e = {
26
- agent: {
27
- extract: new u.Extract()
28
- },
29
- background: {
30
- extract: new n.Extract(),
31
- clean: new n.Clean()
32
- },
33
- pure: {
34
- extract: new i.ExtractCreator(),
35
- clean: new i.Clean()
36
- },
37
- space: {
38
- insert: new h.Insert()
39
- },
40
- interlude: {
41
- insert: new l.Insert()
42
- },
43
- stress: {
44
- mark: new f.Mark()
21
+ Interlude: a,
22
+ Pure: s,
23
+ Space: u,
24
+ Stress: h
25
+ }, Symbol.toStringTag, { value: "Module" })), i = [new o.Parser(), new c.AmllParser()];
26
+ class p {
27
+ constructor(t) {
28
+ this.client = t;
45
29
  }
46
- };
30
+ _extract = new l.Extract();
31
+ extract(t) {
32
+ return this.client.run(this._extract, t);
33
+ }
34
+ }
47
35
  class d {
36
+ constructor(t) {
37
+ this.client = t;
38
+ }
39
+ _extract = new n.Extract();
40
+ _clean = new n.Clean();
41
+ extract(t) {
42
+ return this.client.run(this._extract, t);
43
+ }
44
+ clean() {
45
+ return this.client.run(this._clean);
46
+ }
47
+ }
48
+ class x {
49
+ constructor(t) {
50
+ this.client = t;
51
+ }
52
+ _extractCreator = new s.ExtractCreator();
53
+ _clean = new s.Clean();
54
+ extractCreator(t) {
55
+ return this.client.run(this._extractCreator, t);
56
+ }
57
+ clean(t) {
58
+ return this.client.run(this._clean, t);
59
+ }
60
+ }
61
+ class g {
62
+ constructor(t) {
63
+ this.client = t;
64
+ }
65
+ _insert = new a.Insert();
66
+ insert(t) {
67
+ return this.client.run(this._insert, t);
68
+ }
69
+ }
70
+ class w {
71
+ constructor(t) {
72
+ this.client = t;
73
+ }
74
+ _insert = new u.Insert();
75
+ insert(t) {
76
+ return this.client.run(this._insert, t);
77
+ }
78
+ }
79
+ class _ {
80
+ constructor(t) {
81
+ this.client = t;
82
+ }
83
+ _mark = new h.Mark();
84
+ mark(t) {
85
+ return this.client.run(this._mark, t);
86
+ }
87
+ }
88
+ class k {
48
89
  context;
49
90
  format;
50
91
  input;
51
92
  done;
93
+ agent;
94
+ background;
95
+ pure;
96
+ interlude;
97
+ space;
98
+ stress;
52
99
  constructor(t) {
53
100
  this.done = !1, this.input = t, this.format = this.input.format || "";
54
- const r = new p.Info();
55
- this.context = new m({ content: this.input.content, musicInfo: this.input.musicInfo }, r);
101
+ const r = new f.Info();
102
+ this.context = new m({ content: this.input.content, musicInfo: this.input.musicInfo }, r), this.agent = new p(this), this.background = new d(this), this.pure = new x(this), this.interlude = new g(this), this.space = new w(this), this.stress = new _(this);
56
103
  }
57
- handleApplyConfig(t, r) {
104
+ applyConfig(t, r) {
58
105
  t.config && (t.config.reset(), r && t.config.update(r));
59
106
  }
60
- handleExecPlugin(t) {
107
+ exec(t) {
61
108
  this.done = !1;
62
109
  try {
63
110
  if (!t.check(this.context))
@@ -72,10 +119,17 @@ class d {
72
119
  console.warn(`plugin call failed id=${t.id} err=${r?.message}`);
73
120
  }
74
121
  }
122
+ /**
123
+ * Apply optional config to a plugin and execute it against the current context.
124
+ * Intended for use by the pipeline plugin scopes.
125
+ */
126
+ run(t, r) {
127
+ return this.applyConfig(t, r), this.exec(t), this;
128
+ }
75
129
  infer() {
76
130
  if (this.format)
77
131
  return this;
78
- for (const t of a)
132
+ for (const t of i)
79
133
  try {
80
134
  if (t.check(this.context)) {
81
135
  this.format = t.format;
@@ -89,7 +143,7 @@ class d {
89
143
  parse() {
90
144
  if (!this.format)
91
145
  throw new Error("no format detected. call .infer() before .parse()");
92
- const t = a.find((r) => r.format === this.format);
146
+ const t = i.find((r) => r.format === this.format);
93
147
  if (!t)
94
148
  throw new Error(`parser plugin not found: "${this.format}"`);
95
149
  this.done = !1;
@@ -100,47 +154,23 @@ class d {
100
154
  }
101
155
  return this;
102
156
  }
103
- backgroundExtract(t) {
104
- return this.handleApplyConfig(e.background.extract, t), this.handleExecPlugin(e.background.extract), this;
105
- }
106
- backgroundClean() {
107
- return this.handleExecPlugin(e.background.clean), this;
108
- }
109
- agentExtract(t) {
110
- return this.handleApplyConfig(e.agent.extract, t), this.handleExecPlugin(e.agent.extract), this;
111
- }
112
- pureExtract(t) {
113
- return this.handleApplyConfig(e.pure.extract, t), this.handleExecPlugin(e.pure.extract), this;
114
- }
115
- pureClean(t) {
116
- return this.handleApplyConfig(e.pure.clean, t), this.handleExecPlugin(e.pure.clean), this;
117
- }
118
- interludeInsert(t) {
119
- return this.handleApplyConfig(e.interlude.insert, t), this.handleExecPlugin(e.interlude.insert), this;
120
- }
121
- spaceInsert(t) {
122
- return this.handleApplyConfig(e.space.insert, t), this.handleExecPlugin(e.space.insert), this;
123
- }
124
- stressMark(t) {
125
- return this.handleApplyConfig(e.stress.mark, t), this.handleExecPlugin(e.stress.mark), this;
126
- }
127
157
  final() {
128
- return this.done || (this.context.cleanWord(), this.context.calcAgentIndex(), this.context.syncLineTimeWithWord(), this.context.sort(), this.context.syncLineTimeWithBackground(), this.done = !0), {
158
+ return this.done || (this.context.cleanWord(), this.context.syncLineTimeWithWord(), this.context.sort(), this.context.calcAgentIndex(), this.context.syncLineTimeWithBackground(), this.done = !0), {
129
159
  format: this.format,
130
160
  result: this.context.result
131
161
  };
132
162
  }
133
163
  }
134
- const y = (s) => new d(s);
164
+ const b = (e) => new k(e);
135
165
  export {
136
- P as Format,
137
- T as Generator,
138
- A as GeneratorContext,
139
- C as Lyric,
140
- I as Parser,
141
- S as ParserContext,
142
- d as ParserPipeline,
143
- w as Transform,
144
- y as createParserPipeline
166
+ T as Format,
167
+ A as Generator,
168
+ B as GeneratorContext,
169
+ $ as Lyric,
170
+ E as Parser,
171
+ j as ParserContext,
172
+ k as ParserPipeline,
173
+ C as Transform,
174
+ b as createParserPipeline
145
175
  };
146
176
  //# sourceMappingURL=index.ecma.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.ecma.js","sources":["../src/parser/pipeline.ts"],"sourcesContent":["import type { ParserParams } from '@music-lyric-kit/core'\n\nimport { Lyric } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Format, Transform } from '@root/plugin'\n\nexport interface ParserPipelineInput {\n format?: string\n content: any\n musicInfo?: ParserParams['musicInfo']\n}\n\nexport interface ParserPipelineResult {\n format: string\n result: Lyric.Info\n}\n\nconst BuiltInFormats = [new Format.Lrc.Parser(), new Format.Ttml.AmllParser()]\n\nconst BuiltInPlugins = {\n agent: {\n extract: new Transform.Agent.Extract(),\n },\n background: {\n extract: new Transform.Background.Extract(),\n clean: new Transform.Background.Clean(),\n },\n pure: {\n extract: new Transform.Pure.ExtractCreator(),\n clean: new Transform.Pure.Clean(),\n },\n space: {\n insert: new Transform.Space.Insert(),\n },\n interlude: {\n insert: new Transform.Interlude.Insert(),\n },\n stress: {\n mark: new Transform.Stress.Mark(),\n },\n}\n\nexport class ParserPipeline {\n private context: ParserContext\n private format: string\n private input: ParserPipelineInput\n private done: boolean\n\n constructor(input: ParserPipelineInput) {\n this.done = false\n this.input = input\n this.format = this.input.format || ''\n\n const init = new Lyric.Info()\n this.context = new ParserContext({ content: this.input.content, musicInfo: this.input.musicInfo }, init)\n }\n\n private handleApplyConfig(plugin: ParserPlugin, options?: any) {\n if (!plugin.config) {\n return\n }\n\n // reset config first\n plugin.config.reset()\n\n if (options) {\n plugin.config.update(options)\n }\n }\n\n private handleExecPlugin(plugin: ParserPlugin) {\n this.done = false\n\n try {\n const result = plugin.check(this.context)\n if (!result) {\n return\n }\n } catch (e: any) {\n console.warn(`plugin check failed id=${plugin.id} err=${e?.message}`)\n return\n }\n\n try {\n plugin.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${plugin.id} err=${e?.message}`)\n }\n }\n\n infer(): this {\n if (this.format) {\n return this\n }\n for (const plugin of BuiltInFormats) {\n try {\n const result = plugin.check(this.context)\n if (result) {\n this.format = plugin.format\n break\n }\n } catch {\n continue\n }\n }\n return this\n }\n\n parse(): this {\n if (!this.format) {\n throw new Error('no format detected. call .infer() before .parse()')\n }\n\n const parser = BuiltInFormats.find((item) => item.format === this.format)\n if (!parser) {\n throw new Error(`parser plugin not found: \"${this.format}\"`)\n }\n\n this.done = false\n\n try {\n parser.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${parser.id} err=${e?.message}`)\n }\n\n return this\n }\n\n backgroundExtract(options?: Transform.Background.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.background.extract, options)\n this.handleExecPlugin(BuiltInPlugins.background.extract)\n return this\n }\n\n backgroundClean(): this {\n this.handleExecPlugin(BuiltInPlugins.background.clean)\n return this\n }\n\n agentExtract(options?: Transform.Agent.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.agent.extract, options)\n this.handleExecPlugin(BuiltInPlugins.agent.extract)\n return this\n }\n\n pureExtract(options?: Transform.Pure.ExtractCreatorConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.extract, options)\n this.handleExecPlugin(BuiltInPlugins.pure.extract)\n return this\n }\n\n pureClean(options?: Transform.Pure.CleanConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.clean, options)\n this.handleExecPlugin(BuiltInPlugins.pure.clean)\n return this\n }\n\n interludeInsert(options?: Transform.Interlude.InsertConfig): this {\n this.handleApplyConfig(BuiltInPlugins.interlude.insert, options)\n this.handleExecPlugin(BuiltInPlugins.interlude.insert)\n return this\n }\n\n spaceInsert(options?: Transform.Space.SpaceConfig): this {\n this.handleApplyConfig(BuiltInPlugins.space.insert, options)\n this.handleExecPlugin(BuiltInPlugins.space.insert)\n return this\n }\n\n stressMark(options?: Transform.Stress.MarkConfig): this {\n this.handleApplyConfig(BuiltInPlugins.stress.mark, options)\n this.handleExecPlugin(BuiltInPlugins.stress.mark)\n return this\n }\n\n final(): ParserPipelineResult {\n if (!this.done) {\n this.context.cleanWord()\n this.context.calcAgentIndex()\n this.context.syncLineTimeWithWord()\n this.context.sort()\n this.context.syncLineTimeWithBackground()\n this.done = true\n }\n\n return {\n format: this.format,\n result: this.context.result,\n }\n }\n}\n\nexport const createParserPipeline = (input: ParserPipelineInput) => {\n return new ParserPipeline(input)\n}\n"],"names":["BuiltInFormats","Format.Lrc","Format.Ttml","BuiltInPlugins","Transform.Agent","Transform.Background","Transform.Pure","Transform.Space","Transform.Interlude","Transform.Stress","ParserPipeline","input","init","Lyric","ParserContext","plugin","options","e","parser","item","createParserPipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;8CAkBMA,IAAiB,CAAC,IAAIC,EAAW,OAAA,GAAU,IAAIC,EAAY,YAAY,GAEvEC,IAAiB;AAAA,EACrB,OAAO;AAAA,IACL,SAAS,IAAIC,EAAgB,QAAA;AAAA,EAAQ;AAAA,EAEvC,YAAY;AAAA,IACV,SAAS,IAAIC,EAAqB,QAAA;AAAA,IAClC,OAAO,IAAIA,EAAqB,MAAA;AAAA,EAAM;AAAA,EAExC,MAAM;AAAA,IACJ,SAAS,IAAIC,EAAe,eAAA;AAAA,IAC5B,OAAO,IAAIA,EAAe,MAAA;AAAA,EAAM;AAAA,EAElC,OAAO;AAAA,IACL,QAAQ,IAAIC,EAAgB,OAAA;AAAA,EAAO;AAAA,EAErC,WAAW;AAAA,IACT,QAAQ,IAAIC,EAAoB,OAAA;AAAA,EAAO;AAAA,EAEzC,QAAQ;AAAA,IACN,MAAM,IAAIC,EAAiB,KAAA;AAAA,EAAK;AAEpC;AAEO,MAAMC,EAAe;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAYC,GAA4B;AACtC,SAAK,OAAO,IACZ,KAAK,QA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,QAAQ,KAAA,GACb,KAAK,QAAQ,2BAAA,GACb,KAAK,OAAO,KAGP;AAAA,MACL,QAAQ,KAAK;AAAA,MACb,QAAQ,KAAK,QAAQ;AAAA,IAAA;AAAA,EAEzB;AACF;AAEO,MAAMiB,IAAuB,CAACT,MAC5B,IAAID,EAAeC,CAAK;"}
1
+ {"version":3,"file":"index.ecma.js","sources":["../src/parser/pipeline.ts"],"sourcesContent":["import type { ParserParams } from '@music-lyric-kit/core'\n\nimport { Lyric } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Format, Transform } from '@root/plugin'\n\nexport interface ParserPipelineInput {\n format?: string\n content: any\n musicInfo?: ParserParams['musicInfo']\n}\n\nexport interface ParserPipelineResult {\n format: string\n result: Lyric.Info\n}\n\nconst BuiltInFormats = [new Format.Lrc.Parser(), new Format.Ttml.AmllParser()]\n\nclass Agent {\n private _extract = new Transform.Agent.Extract()\n\n constructor(private client: ParserPipeline) {}\n\n extract(options?: Transform.Agent.ExtractConfig) {\n return this.client.run(this._extract, options)\n }\n}\n\nclass Background {\n private _extract = new Transform.Background.Extract()\n private _clean = new Transform.Background.Clean()\n\n constructor(private client: ParserPipeline) {}\n\n extract(options?: Transform.Background.ExtractConfig) {\n return this.client.run(this._extract, options)\n }\n\n clean() {\n return this.client.run(this._clean)\n }\n}\n\nclass Pure {\n private _extractCreator = new Transform.Pure.ExtractCreator()\n private _clean = new Transform.Pure.Clean()\n\n constructor(private client: ParserPipeline) {}\n\n extractCreator(options?: Transform.Pure.ExtractCreatorConfig) {\n return this.client.run(this._extractCreator, options)\n }\n\n clean(options?: Transform.Pure.CleanConfig) {\n return this.client.run(this._clean, options)\n }\n}\n\nclass Interlude {\n private _insert = new Transform.Interlude.Insert()\n\n constructor(private client: ParserPipeline) {}\n\n insert(options?: Transform.Interlude.InsertConfig) {\n return this.client.run(this._insert, options)\n }\n}\n\nclass Space {\n private _insert = new Transform.Space.Insert()\n\n constructor(private client: ParserPipeline) {}\n\n insert(options?: Transform.Space.SpaceConfig) {\n return this.client.run(this._insert, options)\n }\n}\n\nclass Stress {\n private _mark = new Transform.Stress.Mark()\n\n constructor(private client: ParserPipeline) {}\n\n mark(options?: Transform.Stress.MarkConfig) {\n return this.client.run(this._mark, options)\n }\n}\n\nexport class ParserPipeline {\n private context: ParserContext\n private format: string\n private input: ParserPipelineInput\n private done: boolean\n\n readonly agent: Agent\n readonly background: Background\n readonly pure: Pure\n readonly interlude: Interlude\n readonly space: Space\n readonly stress: Stress\n\n constructor(input: ParserPipelineInput) {\n this.done = false\n this.input = input\n this.format = this.input.format || ''\n\n const init = new Lyric.Info()\n this.context = new ParserContext({ content: this.input.content, musicInfo: this.input.musicInfo }, init)\n\n this.agent = new Agent(this)\n this.background = new Background(this)\n this.pure = new Pure(this)\n this.interlude = new Interlude(this)\n this.space = new Space(this)\n this.stress = new Stress(this)\n }\n\n private applyConfig(plugin: ParserPlugin, options?: any) {\n if (!plugin.config) {\n return\n }\n\n // reset config first\n plugin.config.reset()\n\n if (options) {\n plugin.config.update(options)\n }\n }\n\n private exec(plugin: ParserPlugin) {\n this.done = false\n\n try {\n const result = plugin.check(this.context)\n if (!result) {\n return\n }\n } catch (e: any) {\n console.warn(`plugin check failed id=${plugin.id} err=${e?.message}`)\n return\n }\n\n try {\n plugin.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${plugin.id} err=${e?.message}`)\n }\n }\n\n /**\n * Apply optional config to a plugin and execute it against the current context.\n * Intended for use by the pipeline plugin scopes.\n */\n run(plugin: ParserPlugin, options?: any): this {\n this.applyConfig(plugin, options)\n this.exec(plugin)\n return this\n }\n\n infer(): this {\n if (this.format) {\n return this\n }\n for (const plugin of BuiltInFormats) {\n try {\n const result = plugin.check(this.context)\n if (result) {\n this.format = plugin.format\n break\n }\n } catch {\n continue\n }\n }\n return this\n }\n\n parse(): this {\n if (!this.format) {\n throw new Error('no format detected. call .infer() before .parse()')\n }\n\n const parser = BuiltInFormats.find((item) => item.format === this.format)\n if (!parser) {\n throw new Error(`parser plugin not found: \"${this.format}\"`)\n }\n\n this.done = false\n\n try {\n parser.exec(this.context)\n } catch (e: any) {\n console.warn(`plugin call failed id=${parser.id} err=${e?.message}`)\n }\n\n return this\n }\n\n final(): ParserPipelineResult {\n if (!this.done) {\n this.context.cleanWord()\n this.context.syncLineTimeWithWord()\n this.context.sort()\n this.context.calcAgentIndex()\n this.context.syncLineTimeWithBackground()\n this.done = true\n }\n\n return {\n format: this.format,\n result: this.context.result,\n }\n }\n}\n\nexport const createParserPipeline = (input: ParserPipelineInput) => {\n return new ParserPipeline(input)\n}\n"],"names":["BuiltInFormats","Format.Lrc","Format.Ttml","Agent","client","Transform.Agent","options","Background","Transform.Background","Pure","Transform.Pure","Interlude","Transform.Interlude","Space","Transform.Space","Stress","Transform.Stress","ParserPipeline","input","init","Lyric","ParserContext","plugin","e","parser","item","createParserPipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;8CAkBMA,IAAiB,CAAC,IAAIC,EAAW,OAAA,GAAU,IAAIC,EAAY,YAAY;AAE7E,MAAMC,EAAM;AAAA,EAGV,YAAoBC,GAAwB;AAAxB,SAAA,SAAAA;AAAA,EAAyB;AAAA,EAFrC,WAAW,IAAIC,EAAgB,QAAA;AAAA,EAIvC,QAAQC,GAAyC;AAC/C,WAAO,KAAK,OAAO,IAAI,KAAK,UAAUA,CAAO;AAAA,EAC/C;AACF;AAEA,MAAMC,EAAW;AAAA,EAIf,YAAoBH,GAAwB;AAAxB,SAAA,SAAAA;AAAA,EAAyB;AAAA,EAHrC,WAAW,IAAII,EAAqB,QAAA;AAAA,EACpC,SAAS,IAAIA,EAAqB,MAAA;AAAA,EAI1C,QAAQF,GAA8C;AACpD,WAAO,KAAK,OAAO,IAAI,KAAK,UAAUA,CAAO;AAAA,EAC/C;AAAA,EAEA,QAAQ;AACN,WAAO,KAAK,OAAO,IAAI,KAAK,MAAM;AAAA,EACpC;AACF;AAE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AAA,EACT;AAAA,EAEA,QAAc;AACZ,QAAI,CAAC,KAAK;AACR,YAAM,IAAI,MAAM,mDAAmD;AAGrE,UAAME,IAASxB,EAAe,KAAK,CAACyB,MAASA,EAAK,WAAW,KAAK,MAAM;AACxE,QAAI,CAACD;AACH,YAAM,IAAI,MAAM,6BAA6B,KAAK,MAAM,GAAG;AAG7D,SAAK,OAAO;AAEZ,QAAI;AACF,MAAAA,EAAO,KAAK,KAAK,OAAO;AAAA,IAC1B,SAASD,GAAQ;AACf,cAAQ,KAAK,yBAAyBC,EAAO,EAAE,QAAQD,GAAG,OAAO,EAAE;AAAA,IACrE;AAEA,WAAO;AAAA,EACT;AAAA,EAEA,QAA8B;AAC5B,WAAK,KAAK,SACR,KAAK,QAAQ,UAAA,GACb,KAAK,QAAQ,qBAAA,GACb,KAAK,QAAQ,KAAA,GACb,KAAK,QAAQ,eAAA,GACb,KAAK,QAAQ,2BAAA,GACb,KAAK,OAAO,KAGP;AAAA,MACL,QAAQ,KAAK;AAAA,MACb,QAAQ,KAAK,QAAQ;AAAA,IAAA;AAAA,EAEzB;AACF;AAEO,MAAMG,IAAuB,CAACR,MAC5B,IAAID,EAAeC,CAAK;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "music-lyric-kit",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "author": "folltoshe",
5
5
  "type": "module",
6
6
  "description": "Music Lyric Kit",
@@ -34,17 +34,17 @@
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@music-lyric-kit/core": "0.12.0",
38
- "@music-lyric-kit/lyric": "0.12.0",
39
- "@music-lyric-kit/plugin-format-lrc": "0.12.0",
40
- "@music-lyric-kit/plugin-format-ttml": "0.12.0",
41
- "@music-lyric-kit/utils": "0.12.0",
42
- "@music-lyric-kit/plugin-transform-interlude": "0.12.0",
43
- "@music-lyric-kit/plugin-transform-pure": "0.12.0",
44
- "@music-lyric-kit/plugin-transform-agent": "0.12.0",
45
- "@music-lyric-kit/plugin-transform-stress": "0.12.0",
46
- "@music-lyric-kit/plugin-transform-space": "0.12.0",
47
- "@music-lyric-kit/plugin-transform-background": "0.12.0"
37
+ "@music-lyric-kit/core": "0.12.1",
38
+ "@music-lyric-kit/lyric": "0.12.1",
39
+ "@music-lyric-kit/utils": "0.12.1",
40
+ "@music-lyric-kit/plugin-format-ttml": "0.12.1",
41
+ "@music-lyric-kit/plugin-format-lrc": "0.12.1",
42
+ "@music-lyric-kit/plugin-transform-interlude": "0.12.1",
43
+ "@music-lyric-kit/plugin-transform-background": "0.12.1",
44
+ "@music-lyric-kit/plugin-transform-space": "0.12.1",
45
+ "@music-lyric-kit/plugin-transform-agent": "0.12.1",
46
+ "@music-lyric-kit/plugin-transform-pure": "0.12.1",
47
+ "@music-lyric-kit/plugin-transform-stress": "0.12.1"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "vite build"