music-lyric-kit 0.11.2 → 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"),x=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"),i=require("@music-lyric-kit/core");function n(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,c.get?c:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const E=n(u),f=n(x),g=n(b),p=n(y),a=n(_),h=n(T),d=n(w),o=n(k),m=n(C),O=Object.freeze(Object.defineProperty({__proto__:null,Lrc:f,Ttml:g},Symbol.toStringTag,{value:"Module"})),S=Object.freeze(Object.defineProperty({__proto__:null,Agent:h,Background:a,Interlude:p,Pure:o,Space:d,Stress:m},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null,Formats:O,Transforms:S},Symbol.toStringTag,{value:"Module"})),l=[new f.Parser,new g.AmllParser],r={agent:{extract:new h.ExtractPlugin},background:{extract:new a.ExtractPlugin,clean:new a.CleanPlugin},pure:{extract:new o.ExtractCreatorPlugin,clean:new o.CleanPlugin},space:{insert:new d.InsertPlugin},interlude:{insert:new p.InsertPlugin},stress:{mark:new m.MarkPlugin}};class P{context;format;input;done;constructor(e){this.done=!1,this.input=e,this.format=this.input.format||"";const t=new u.Info;this.context=new i.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 A=s=>new P(s);exports.Lyric=E;Object.defineProperty(exports,"Generator",{enumerable:!0,get:()=>i.Generator});Object.defineProperty(exports,"GeneratorContext",{enumerable:!0,get:()=>i.GeneratorContext});Object.defineProperty(exports,"Parser",{enumerable:!0,get:()=>i.Parser});Object.defineProperty(exports,"ParserContext",{enumerable:!0,get:()=>i.ParserContext});exports.ParserPipeline=P;exports.Plugins=j;exports.createParserPipeline=A;
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 { Info } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Formats, Transforms } 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: Info\n}\n\nconst BuiltInFormats = [new Formats.Lrc.Parser(), new Formats.Ttml.AmllParser()]\n\nconst BuiltInPlugins = {\n agent: {\n extract: new Transforms.Agent.ExtractPlugin(),\n },\n background: {\n extract: new Transforms.Background.ExtractPlugin(),\n clean: new Transforms.Background.CleanPlugin(),\n },\n pure: {\n extract: new Transforms.Pure.ExtractCreatorPlugin(),\n clean: new Transforms.Pure.CleanPlugin(),\n },\n space: {\n insert: new Transforms.Space.InsertPlugin(),\n },\n interlude: {\n insert: new Transforms.Interlude.InsertPlugin(),\n },\n stress: {\n mark: new Transforms.Stress.MarkPlugin(),\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 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?: Transforms.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?: Transforms.Agent.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.agent.extract, options)\n this.handleExecPlugin(BuiltInPlugins.agent.extract)\n return this\n }\n\n pureExtract(options?: Transforms.Pure.ExtractCreatorConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.extract, options)\n this.handleExecPlugin(BuiltInPlugins.pure.extract)\n return this\n }\n\n pureClean(options?: Transforms.Pure.CleanConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.clean, options)\n this.handleExecPlugin(BuiltInPlugins.pure.clean)\n return this\n }\n\n interludeInsert(options?: Transforms.Interlude.InsertConfig): this {\n this.handleApplyConfig(BuiltInPlugins.interlude.insert, options)\n this.handleExecPlugin(BuiltInPlugins.interlude.insert)\n return this\n }\n\n spaceInsert(options?: Transforms.Space.SpaceConfig): this {\n this.handleApplyConfig(BuiltInPlugins.space.insert, options)\n this.handleExecPlugin(BuiltInPlugins.space.insert)\n return this\n }\n\n stressMark(options?: Transforms.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","Formats.Lrc","Formats.Ttml","BuiltInPlugins","Transforms.Agent","Transforms.Background","Transforms.Pure","Transforms.Space","Transforms.Interlude","Transforms.Stress","ParserPipeline","input","init","Info","ParserContext","plugin","options","e","parser","item","createParserPipeline"],"mappings":"2wCAkBMA,EAAiB,CAAC,IAAIC,EAAY,OAAU,IAAIC,EAAa,UAAY,EAEzEC,EAAiB,CACrB,MAAO,CACL,QAAS,IAAIC,EAAiB,aAAc,EAE9C,WAAY,CACV,QAAS,IAAIC,EAAsB,cACnC,MAAO,IAAIA,EAAsB,WAAY,EAE/C,KAAM,CACJ,QAAS,IAAIC,EAAgB,qBAC7B,MAAO,IAAIA,EAAgB,WAAY,EAEzC,MAAO,CACL,OAAQ,IAAIC,EAAiB,YAAa,EAE5C,UAAW,CACT,OAAQ,IAAIC,EAAqB,YAAa,EAEhD,OAAQ,CACN,KAAM,IAAIC,EAAkB,UAAW,CAE3C,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,OACjB,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,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ACzD,KAAK,iBAAiBb,EAAe,KAAK,KAAK,EACxC,IACT,CAEA,gBAAgBa,EAAmD,CACjE,YAAK,kBAAkBb,EAAe,UAAU,OAAQa,CAAO,EAC/D,KAAK,iBAAiBb,EAAe,UAAU,MAAM,EAC9C,IACT,CAEA,YAAYa,EAA8C,CACxD,YAAK,kBAAkBb,EAAe,MAAM,OAAQa,CAAO,EAC3D,KAAK,iBAAiBb,EAAe,MAAM,MAAM,EAC1C,IACT,CAEA,WAAWa,EAA8C,CACvD,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,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CAEF,OAAO,IACT,CAEA,OAAc,CACZ,GAAI,CAAC,KAAK,OACR,MAAM,IAAI,MAAM,mDAAmD,EAGrE,MAAME,EAASxB,EAAe,KAAMyB,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"}
@@ -5,28 +5,45 @@ import { GeneratorContext } from '@music-lyric-kit/core';
5
5
  import { GeneratorOptions } from '@music-lyric-kit/core';
6
6
  import { GeneratorParams } from '@music-lyric-kit/core';
7
7
  import { GeneratorResult } from '@music-lyric-kit/core';
8
- import { Info } from '@music-lyric-kit/lyric';
9
8
  import * as Interlude from '@music-lyric-kit/plugin-transform-interlude';
10
9
  import * as Lrc from '@music-lyric-kit/plugin-format-lrc';
11
- import * as Lyric from '@music-lyric-kit/lyric';
10
+ import { Lyric } from '@music-lyric-kit/lyric';
12
11
  import { Parser } from '@music-lyric-kit/core';
13
12
  import { ParserContext } from '@music-lyric-kit/core';
14
13
  import { ParserOptions } from '@music-lyric-kit/core';
15
14
  import { ParserParams } from '@music-lyric-kit/core';
15
+ import { ParserPlugin } from '@music-lyric-kit/core';
16
16
  import { ParserResult } from '@music-lyric-kit/core';
17
17
  import * as Pure from '@music-lyric-kit/plugin-transform-pure';
18
18
  import * as Space from '@music-lyric-kit/plugin-transform-space';
19
19
  import * as Stress from '@music-lyric-kit/plugin-transform-stress';
20
20
  import * as Ttml from '@music-lyric-kit/plugin-format-ttml';
21
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
+
22
38
  export declare const createParserPipeline: (input: ParserPipelineInput) => ParserPipeline;
23
39
 
24
- declare namespace Formats {
40
+ declare namespace Format {
25
41
  export {
26
42
  Lrc,
27
43
  Ttml
28
44
  }
29
45
  }
46
+ export { Format }
30
47
 
31
48
  export { Generator_2 as Generator }
32
49
 
@@ -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?: Transforms.Background.ExtractConfig): this;
62
- backgroundClean(): this;
63
- agentExtract(options?: Transforms.Agent.ExtractConfig): this;
64
- pureExtract(options?: Transforms.Pure.ExtractCreatorConfig): this;
65
- pureClean(options?: Transforms.Pure.CleanConfig): this;
66
- interludeInsert(options?: Transforms.Interlude.InsertConfig): this;
67
- spaceInsert(options?: Transforms.Space.SpaceConfig): this;
68
- stressMark(options?: Transforms.Stress.MarkConfig): this;
69
96
  final(): ParserPipelineResult;
70
97
  }
71
98
 
@@ -77,20 +104,35 @@ export declare interface ParserPipelineInput {
77
104
 
78
105
  export declare interface ParserPipelineResult {
79
106
  format: string;
80
- result: Info;
107
+ result: Lyric.Info;
81
108
  }
82
109
 
83
110
  export { ParserResult }
84
111
 
85
- declare namespace Plugins {
86
- export {
87
- Formats,
88
- Transforms
89
- }
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;
90
133
  }
91
- export { Plugins }
92
134
 
93
- declare namespace Transforms {
135
+ declare namespace Transform {
94
136
  export {
95
137
  Interlude,
96
138
  Background,
@@ -100,5 +142,6 @@ declare namespace Transforms {
100
142
  Stress
101
143
  }
102
144
  }
145
+ export { Transform }
103
146
 
104
147
  export { }
@@ -1,67 +1,110 @@
1
- import { Info as p } from "@music-lyric-kit/lyric";
2
- import * as y from "@music-lyric-kit/lyric";
3
- import * as a from "@music-lyric-kit/plugin-format-lrc";
1
+ import { Lyric as f } from "@music-lyric-kit/lyric";
2
+ import { Lyric as $ } from "@music-lyric-kit/lyric";
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 _ } from "@music-lyric-kit/core";
13
- const g = /* @__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
- Lrc: a,
15
+ Lrc: o,
16
16
  Ttml: c
17
- }, Symbol.toStringTag, { value: "Module" })), d = /* @__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" })), k = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26
- __proto__: null,
27
- Formats: g,
28
- Transforms: d
29
- }, Symbol.toStringTag, { value: "Module" })), o = [new a.Parser(), new c.AmllParser()], e = {
30
- agent: {
31
- extract: new u.ExtractPlugin()
32
- },
33
- background: {
34
- extract: new n.ExtractPlugin(),
35
- clean: new n.CleanPlugin()
36
- },
37
- pure: {
38
- extract: new i.ExtractCreatorPlugin(),
39
- clean: new i.CleanPlugin()
40
- },
41
- space: {
42
- insert: new h.InsertPlugin()
43
- },
44
- interlude: {
45
- insert: new l.InsertPlugin()
46
- },
47
- stress: {
48
- mark: new f.MarkPlugin()
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;
49
29
  }
50
- };
30
+ _extract = new l.Extract();
31
+ extract(t) {
32
+ return this.client.run(this._extract, t);
33
+ }
34
+ }
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
+ }
51
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 {
52
89
  context;
53
90
  format;
54
91
  input;
55
92
  done;
93
+ agent;
94
+ background;
95
+ pure;
96
+ interlude;
97
+ space;
98
+ stress;
56
99
  constructor(t) {
57
100
  this.done = !1, this.input = t, this.format = this.input.format || "";
58
- const r = new p();
59
- 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);
60
103
  }
61
- handleApplyConfig(t, r) {
104
+ applyConfig(t, r) {
62
105
  t.config && (t.config.reset(), r && t.config.update(r));
63
106
  }
64
- handleExecPlugin(t) {
107
+ exec(t) {
65
108
  this.done = !1;
66
109
  try {
67
110
  if (!t.check(this.context))
@@ -76,10 +119,17 @@ class x {
76
119
  console.warn(`plugin call failed id=${t.id} err=${r?.message}`);
77
120
  }
78
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
+ }
79
129
  infer() {
80
130
  if (this.format)
81
131
  return this;
82
- for (const t of o)
132
+ for (const t of i)
83
133
  try {
84
134
  if (t.check(this.context)) {
85
135
  this.format = t.format;
@@ -93,7 +143,7 @@ class x {
93
143
  parse() {
94
144
  if (!this.format)
95
145
  throw new Error("no format detected. call .infer() before .parse()");
96
- const t = o.find((r) => r.format === this.format);
146
+ const t = i.find((r) => r.format === this.format);
97
147
  if (!t)
98
148
  throw new Error(`parser plugin not found: "${this.format}"`);
99
149
  this.done = !1;
@@ -104,46 +154,23 @@ class x {
104
154
  }
105
155
  return this;
106
156
  }
107
- backgroundExtract(t) {
108
- return this.handleApplyConfig(e.background.extract, t), this.handleExecPlugin(e.background.extract), this;
109
- }
110
- backgroundClean() {
111
- return this.handleExecPlugin(e.background.clean), this;
112
- }
113
- agentExtract(t) {
114
- return this.handleApplyConfig(e.agent.extract, t), this.handleExecPlugin(e.agent.extract), this;
115
- }
116
- pureExtract(t) {
117
- return this.handleApplyConfig(e.pure.extract, t), this.handleExecPlugin(e.pure.extract), this;
118
- }
119
- pureClean(t) {
120
- return this.handleApplyConfig(e.pure.clean, t), this.handleExecPlugin(e.pure.clean), this;
121
- }
122
- interludeInsert(t) {
123
- return this.handleApplyConfig(e.interlude.insert, t), this.handleExecPlugin(e.interlude.insert), this;
124
- }
125
- spaceInsert(t) {
126
- return this.handleApplyConfig(e.space.insert, t), this.handleExecPlugin(e.space.insert), this;
127
- }
128
- stressMark(t) {
129
- return this.handleApplyConfig(e.stress.mark, t), this.handleExecPlugin(e.stress.mark), this;
130
- }
131
157
  final() {
132
- 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), {
133
159
  format: this.format,
134
160
  result: this.context.result
135
161
  };
136
162
  }
137
163
  }
138
- const b = (s) => new x(s);
164
+ const b = (e) => new k(e);
139
165
  export {
140
- T as Generator,
141
- A as GeneratorContext,
142
- y as Lyric,
143
- I as Parser,
144
- _ as ParserContext,
145
- x as ParserPipeline,
146
- k as Plugins,
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,
147
174
  b as createParserPipeline
148
175
  };
149
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 { Info } from '@music-lyric-kit/lyric'\nimport { ParserContext, ParserPlugin } from '@music-lyric-kit/core'\n\nimport { Formats, Transforms } 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: Info\n}\n\nconst BuiltInFormats = [new Formats.Lrc.Parser(), new Formats.Ttml.AmllParser()]\n\nconst BuiltInPlugins = {\n agent: {\n extract: new Transforms.Agent.ExtractPlugin(),\n },\n background: {\n extract: new Transforms.Background.ExtractPlugin(),\n clean: new Transforms.Background.CleanPlugin(),\n },\n pure: {\n extract: new Transforms.Pure.ExtractCreatorPlugin(),\n clean: new Transforms.Pure.CleanPlugin(),\n },\n space: {\n insert: new Transforms.Space.InsertPlugin(),\n },\n interlude: {\n insert: new Transforms.Interlude.InsertPlugin(),\n },\n stress: {\n mark: new Transforms.Stress.MarkPlugin(),\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 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?: Transforms.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?: Transforms.Agent.ExtractConfig): this {\n this.handleApplyConfig(BuiltInPlugins.agent.extract, options)\n this.handleExecPlugin(BuiltInPlugins.agent.extract)\n return this\n }\n\n pureExtract(options?: Transforms.Pure.ExtractCreatorConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.extract, options)\n this.handleExecPlugin(BuiltInPlugins.pure.extract)\n return this\n }\n\n pureClean(options?: Transforms.Pure.CleanConfig): this {\n this.handleApplyConfig(BuiltInPlugins.pure.clean, options)\n this.handleExecPlugin(BuiltInPlugins.pure.clean)\n return this\n }\n\n interludeInsert(options?: Transforms.Interlude.InsertConfig): this {\n this.handleApplyConfig(BuiltInPlugins.interlude.insert, options)\n this.handleExecPlugin(BuiltInPlugins.interlude.insert)\n return this\n }\n\n spaceInsert(options?: Transforms.Space.SpaceConfig): this {\n this.handleApplyConfig(BuiltInPlugins.space.insert, options)\n this.handleExecPlugin(BuiltInPlugins.space.insert)\n return this\n }\n\n stressMark(options?: Transforms.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","Formats.Lrc","Formats.Ttml","BuiltInPlugins","Transforms.Agent","Transforms.Background","Transforms.Pure","Transforms.Space","Transforms.Interlude","Transforms.Stress","ParserPipeline","input","init","Info","ParserContext","plugin","options","e","parser","item","createParserPipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAkBMA,IAAiB,CAAC,IAAIC,EAAY,OAAA,GAAU,IAAIC,EAAa,YAAY,GAEzEC,IAAiB;AAAA,EACrB,OAAO;AAAA,IACL,SAAS,IAAIC,EAAiB,cAAA;AAAA,EAAc;AAAA,EAE9C,YAAY;AAAA,IACV,SAAS,IAAIC,EAAsB,cAAA;AAAA,IACnC,OAAO,IAAIA,EAAsB,YAAA;AAAA,EAAY;AAAA,EAE/C,MAAM;AAAA,IACJ,SAAS,IAAIC,EAAgB,qBAAA;AAAA,IAC7B,OAAO,IAAIA,EAAgB,YAAA;AAAA,EAAY;AAAA,EAEzC,OAAO;AAAA,IACL,QAAQ,IAAIC,EAAiB,aAAA;AAAA,EAAa;AAAA,EAE5C,WAAW;AAAA,IACT,QAAQ,IAAIC,EAAqB,aAAA;AAAA,EAAa;AAAA,EAEhD,QAAQ;AAAA,IACN,MAAM,IAAIC,EAAkB,WAAA;AAAA,EAAW;AAE3C;AAEO,MAAMC,EAAe;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAYC,GAA4B;AACtC,SAAK,OAAO,IACZ,KAAK,QAAQA,GACb,KAAK,SAAS,KAAK,MAAM,UAAU;AAEnC,UAAMC,IAAO,IAAIC,EAAA;AACjB,SAAK,UAAU,IAAIC,EAAc,EAAE,SAAS,KAAK,MAAM,SAAS,WAAW,KAAK,MAAM,UA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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;AAEA,MAAMG,EAAK;AAAA,EAIT,YAAoBL,GAAwB;AAAxB,SAAA,SAAAA;AAAA,EAAyB;AAAA,EAHrC,kBAAkB,IAAIM,EAAe,eAAA;AAAA,EACrC,SAAS,IAAIA,EAAe,MAAA;AAAA,E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I,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.11.2",
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/lyric": "^0.4.0",
38
- "@music-lyric-kit/utils": "^0.5.0",
39
- "@music-lyric-kit/core": "^0.7.0",
40
- "@music-lyric-kit/plugin-format-lrc": "^0.5.1",
41
- "@music-lyric-kit/plugin-format-ttml": "^0.1.6",
42
- "@music-lyric-kit/plugin-transform-background": "^0.3.0",
43
- "@music-lyric-kit/plugin-transform-space": "^0.3.0",
44
- "@music-lyric-kit/plugin-transform-pure": "^0.5.0",
45
- "@music-lyric-kit/plugin-transform-interlude": "^0.3.5",
46
- "@music-lyric-kit/plugin-transform-agent": "^0.3.3",
47
- "@music-lyric-kit/plugin-transform-stress": "^0.1.4"
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"