@ovnonvo/abc-editor 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -18
- package/dist/abc-editor.cjs.js +15 -13
- package/dist/abc-editor.es.js +562 -447
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/src/components/AbcEditor.d.ts.map +1 -1
- package/package.json +1 -3
package/dist/abc-editor.es.js
CHANGED
|
@@ -1,64 +1,63 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode('@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-600:oklch(54.6% .245 262.881);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-950:oklch(12.9% .042 264.695);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}}@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.block{display:block}.flex{display:flex}.inline{display:inline}.table{display:table}.h-1\\/3{height:33.3333%}.h-2\\/3{height:66.6667%}.h-full{height:100%}.h-screen{height:100vh}.w-full{width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.bg-blue-600{background-color:var(--color-blue-600)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-950{background-color:var(--color-slate-950)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-3{padding-right:calc(var(--spacing)*3)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-slate-200{color:var(--color-slate-200)}.text-slate-500{color:var(--color-slate-500)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-75{opacity:.75}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[foo\\:bar\\]{foo:bar}.last\\:mb-0:last-child{margin-bottom:calc(var(--spacing)*0)}@media(hover:hover){.hover\\:bg-slate-700:hover{background-color:var(--color-slate-700)}}@media(min-width:48rem){.md\\:h-full{height:100%}.md\\:w-1\\/2{width:50%}.md\\:flex-row{flex-direction:row}}}*{box-sizing:border-box}body{margin:0;padding:0}:root{--abc-ink:#1a1a1a;--abc-key:#06c;--abc-value:#996300;--abc-lyrics-key:#c06;--abc-lyrics-value:#b30059;--abc-note:#000;--abc-octave-high:#00994d;--abc-octave-low:#60c;--abc-rest:#666;--abc-rest-muted:#999;--abc-accidental:#b35900;--abc-duration-long:#cc5200;--abc-duration-short:#09c;--abc-duration-fraction:#c90;--abc-broken:#00b359;--abc-bar:#0080cc;--abc-bar-double:#06c;--abc-chord:#c09;--abc-slur-0:#cc004d;--abc-slur-1:#cc8000;--abc-slur-2:#0080cc;--abc-slur-3:#00b359;--abc-slur-4:#70c;--abc-tuplet:#00b359;--abc-tie:#c06;--abc-tie-dotted:#cc0080;--abc-ornament:#56c;--abc-chord-symbol:#00997a;--abc-annotation:#c80;--abc-decoration:#86c;--abc-grace:#66b300;--abc-volta:#c60;--abc-inline-bracket:#666;--abc-inline-key:#06c;--abc-inline-value:#960;--abc-comment:#999}[data-theme=dark]{--abc-ink:#e8f1ff;--abc-key:#7ad7ff;--abc-value:#ffd48a;--abc-lyrics-key:#ff7ba1;--abc-lyrics-value:#ffc8d8;--abc-note:#f8fbff;--abc-octave-high:#73f8c4;--abc-octave-low:#c7b3ff;--abc-rest:#8ca3b8;--abc-rest-muted:#596779;--abc-accidental:#f2c079;--abc-duration-long:#ffa25f;--abc-duration-short:#6edff6;--abc-duration-fraction:#ffe38f;--abc-broken:#7be495;--abc-bar:#79cfff;--abc-bar-double:#4aafff;--abc-chord:#ff8ccf;--abc-slur-0:#ff92b2;--abc-slur-1:#ffd77a;--abc-slur-2:#7ed4ff;--abc-slur-3:#92f3c6;--abc-slur-4:#c6a9ff;--abc-tuplet:#82f0a2;--abc-tie:#f07fb3;--abc-tie-dotted:#ff9ecf;--abc-ornament:#9fb0ff;--abc-chord-symbol:#63f5d3;--abc-annotation:#ffd88a;--abc-decoration:#d1a6ff;--abc-grace:#a4f28f;--abc-volta:#f9a15a;--abc-inline-bracket:#8ca7c0;--abc-inline-key:#7ad7ff;--abc-inline-value:#ffdcb2;--abc-comment:#7b8797}.abc-preview svg text{fill:#000!important}.abc-preview[data-theme=dark] svg text{fill:#fff!important}textarea::placeholder{color:#999;opacity:1}[data-theme=dark] textarea::placeholder{color:#64748b}.abc-meta-key{color:var(--abc-key);font-weight:600}.abc-meta-value{color:var(--abc-value)}.abc-lyrics-key{color:var(--abc-lyrics-key);font-weight:600}.abc-lyrics-value{color:var(--abc-lyrics-value)}.abc-note{color:var(--abc-note)}.abc-octave-high{color:var(--abc-octave-high);font-weight:600}.abc-octave-low{color:var(--abc-octave-low);font-weight:600}.abc-rest{color:var(--abc-rest)}.abc-rest-invisible{color:var(--abc-rest-muted);opacity:.5}.abc-accidental{color:var(--abc-accidental)}.abc-duration{font-weight:600}.abc-duration-long{color:var(--abc-duration-long)}.abc-duration-short{color:var(--abc-duration-short)}.abc-duration-fraction{color:var(--abc-duration-fraction)}.abc-broken-rhythm{color:var(--abc-broken);font-weight:700}.abc-bar{color:var(--abc-bar);font-weight:600}.abc-bar-double{color:var(--abc-bar-double);font-weight:900}.abc-chord{color:var(--abc-chord)}.abc-slur{font-weight:700}.abc-slur-level-0{color:var(--abc-slur-0)}.abc-slur-level-1{color:var(--abc-slur-1)}.abc-slur-level-2{color:var(--abc-slur-2)}.abc-slur-level-3{color:var(--abc-slur-3)}.abc-slur-level-4{color:var(--abc-slur-4)}.abc-tuplet{color:var(--abc-tuplet);font-weight:700}.abc-tie{color:var(--abc-tie);font-weight:600}.abc-tie-dotted{color:var(--abc-tie-dotted)}.abc-ornament{color:var(--abc-ornament);font-weight:700}.abc-chord-symbol{color:var(--abc-chord-symbol);font-weight:700}.abc-annotation{color:var(--abc-annotation);font-style:italic;font-weight:600}.abc-decoration{color:var(--abc-decoration);font-weight:700}.abc-grace-note{color:var(--abc-grace);font-weight:600}.abc-volta-bracket{color:var(--abc-volta);font-weight:700}.abc-inline-field-bracket{color:var(--abc-inline-bracket)}.abc-inline-field-key{color:var(--abc-inline-key);font-weight:600}.abc-inline-field-value{color:var(--abc-inline-value)}.abc-comment{color:var(--abc-comment);font-style:italic}.abc-text{color:var(--abc-ink)}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import j from "abcjs";
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode('@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-ease:initial}}}@layer theme{:root,:host{--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-600:oklch(54.6% .245 262.881);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-950:oklch(12.9% .042 264.695);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1)}}@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.block{display:block}.flex{display:flex}.inline{display:inline}.table{display:table}.h-full{height:100%}.h-screen{height:100vh}.w-full{width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.bg-blue-600{background-color:var(--color-blue-600)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-950{background-color:var(--color-slate-950)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-0\\.5{padding-block:calc(var(--spacing)*.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.pr-3{padding-right:calc(var(--spacing)*3)}.pl-1{padding-left:calc(var(--spacing)*1)}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-slate-200{color:var(--color-slate-200)}.text-slate-500{color:var(--color-slate-500)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[foo\\:bar\\]{foo:bar}@media(hover:hover){.hover\\:bg-slate-700:hover{background-color:var(--color-slate-700)}}}*{box-sizing:border-box}body{margin:0;padding:0}:root{--abc-ink:#1a1a1a;--abc-key:#06c;--abc-value:#996300;--abc-lyrics-key:#c06;--abc-lyrics-value:#b30059;--abc-note:#000;--abc-octave-high:#00994d;--abc-octave-low:#60c;--abc-rest:#666;--abc-rest-muted:#999;--abc-accidental:#b35900;--abc-duration-long:#cc5200;--abc-duration-short:#09c;--abc-duration-fraction:#c90;--abc-broken:#00b359;--abc-bar:#0080cc;--abc-bar-double:#06c;--abc-chord:#c09;--abc-slur-0:#cc004d;--abc-slur-1:#cc8000;--abc-slur-2:#0080cc;--abc-slur-3:#00b359;--abc-slur-4:#70c;--abc-tuplet:#00b359;--abc-tie:#c06;--abc-tie-dotted:#cc0080;--abc-ornament:#56c;--abc-chord-symbol:#00997a;--abc-annotation:#c80;--abc-decoration:#86c;--abc-grace:#66b300;--abc-volta:#c60;--abc-inline-bracket:#666;--abc-inline-key:#06c;--abc-inline-value:#960;--abc-comment:#999}[data-theme=dark]{--abc-ink:#e8f1ff;--abc-key:#7ad7ff;--abc-value:#ffd48a;--abc-lyrics-key:#ff7ba1;--abc-lyrics-value:#ffc8d8;--abc-note:#f8fbff;--abc-octave-high:#73f8c4;--abc-octave-low:#c7b3ff;--abc-rest:#8ca3b8;--abc-rest-muted:#596779;--abc-accidental:#f2c079;--abc-duration-long:#ffa25f;--abc-duration-short:#6edff6;--abc-duration-fraction:#ffe38f;--abc-broken:#7be495;--abc-bar:#79cfff;--abc-bar-double:#4aafff;--abc-chord:#ff8ccf;--abc-slur-0:#ff92b2;--abc-slur-1:#ffd77a;--abc-slur-2:#7ed4ff;--abc-slur-3:#92f3c6;--abc-slur-4:#c6a9ff;--abc-tuplet:#82f0a2;--abc-tie:#f07fb3;--abc-tie-dotted:#ff9ecf;--abc-ornament:#9fb0ff;--abc-chord-symbol:#63f5d3;--abc-annotation:#ffd88a;--abc-decoration:#d1a6ff;--abc-grace:#a4f28f;--abc-volta:#f9a15a;--abc-inline-bracket:#8ca7c0;--abc-inline-key:#7ad7ff;--abc-inline-value:#ffdcb2;--abc-comment:#7b8797}.abc-preview svg text{fill:#000!important}.abc-preview[data-theme=dark] svg text{fill:#fff!important}textarea::placeholder{color:#999;opacity:1}[data-theme=dark] textarea::placeholder{color:#64748b}.abc-meta-key{color:var(--abc-key);font-weight:600}.abc-meta-value{color:var(--abc-value)}.abc-lyrics-key{color:var(--abc-lyrics-key);font-weight:600}.abc-lyrics-value{color:var(--abc-lyrics-value)}.abc-note{color:var(--abc-note)}.abc-octave-high{color:var(--abc-octave-high);font-weight:600}.abc-octave-low{color:var(--abc-octave-low);font-weight:600}.abc-rest{color:var(--abc-rest)}.abc-rest-invisible{color:var(--abc-rest-muted);opacity:.5}.abc-accidental{color:var(--abc-accidental)}.abc-duration{font-weight:600}.abc-duration-long{color:var(--abc-duration-long)}.abc-duration-short{color:var(--abc-duration-short)}.abc-duration-fraction{color:var(--abc-duration-fraction)}.abc-broken-rhythm{color:var(--abc-broken);font-weight:700}.abc-bar{color:var(--abc-bar);font-weight:600}.abc-bar-double{color:var(--abc-bar-double);font-weight:900}.abc-chord{color:var(--abc-chord)}.abc-slur{font-weight:700}.abc-slur-level-0{color:var(--abc-slur-0)}.abc-slur-level-1{color:var(--abc-slur-1)}.abc-slur-level-2{color:var(--abc-slur-2)}.abc-slur-level-3{color:var(--abc-slur-3)}.abc-slur-level-4{color:var(--abc-slur-4)}.abc-tuplet{color:var(--abc-tuplet);font-weight:700}.abc-tie{color:var(--abc-tie);font-weight:600}.abc-tie-dotted{color:var(--abc-tie-dotted)}.abc-ornament{color:var(--abc-ornament);font-weight:700}.abc-chord-symbol{color:var(--abc-chord-symbol);font-weight:700}.abc-annotation{color:var(--abc-annotation);font-style:italic;font-weight:600}.abc-decoration{color:var(--abc-decoration);font-weight:700}.abc-grace-note{color:var(--abc-grace);font-weight:600}.abc-volta-bracket{color:var(--abc-volta);font-weight:700}.abc-inline-field-bracket{color:var(--abc-inline-bracket)}.abc-inline-field-key{color:var(--abc-inline-key);font-weight:600}.abc-inline-field-value{color:var(--abc-inline-value)}.abc-comment{color:var(--abc-comment);font-style:italic}.abc-text{color:var(--abc-ink)}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ease{syntax:"*";inherits:false}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { jsx as u, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import { useState as M, useCallback as A, useEffect as P, useRef as C, useMemo as K } from "react";
|
|
5
4
|
const V = (e) => e.split(`
|
|
6
|
-
`).map((
|
|
7
|
-
`),
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
5
|
+
`).map((r, n) => n + 1).join(`
|
|
6
|
+
`), w = /^([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]:)(.*)$/, E = /[A-Ga-g]/, G = /[\^_=]/, Q = /[',]/, z = /\|[:|\]]?|:?\|/, X = /[\\[\]]/, Y = /[()]/, J = /^\(\d+$/, R = /^\/?\d+(\/\d+)?$/, O = /[zZx]/, $ = /^\.?-$/, Z = /[.~HLMOPSTuv]/, q = /^"[^"]*"$/, D = /^"[\^_<>@][^"]*"$/, ee = /^![^!]+!$/, te = /^\{[^}]+\}$/, ne = /^\[\d+$/, re = /^\[([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]):([^\]]*)\]$/, se = /^[<>]+$/, le = /^%.*$/, p = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), oe = (e, t) => {
|
|
7
|
+
const r = e[t];
|
|
8
|
+
if (r !== "|" && r !== ":")
|
|
10
9
|
return null;
|
|
11
|
-
let
|
|
10
|
+
let n = r, l = t + 1;
|
|
12
11
|
for (; l < e.length && (e[l] === "|" || e[l] === ":" || e[l] === "]"); )
|
|
13
|
-
|
|
14
|
-
return z.test(
|
|
15
|
-
html: `<span class="${
|
|
12
|
+
n += e[l], l++;
|
|
13
|
+
return z.test(n) ? {
|
|
14
|
+
html: `<span class="${n === "||" ? "abc-bar-double" : "abc-bar"}">${p(n)}</span>`,
|
|
16
15
|
nextIndex: l
|
|
17
16
|
} : null;
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
return G.test(
|
|
21
|
-
html: `<span class="abc-accidental">${
|
|
17
|
+
}, ae = (e, t) => {
|
|
18
|
+
const r = e[t];
|
|
19
|
+
return G.test(r) ? {
|
|
20
|
+
html: `<span class="abc-accidental">${p(r)}</span>`,
|
|
22
21
|
nextIndex: t + 1
|
|
23
22
|
} : null;
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
23
|
+
}, ie = (e, t, r) => {
|
|
24
|
+
const n = e[t];
|
|
25
|
+
if (!Y.test(n))
|
|
27
26
|
return null;
|
|
28
|
-
if (
|
|
27
|
+
if (n === "(") {
|
|
29
28
|
if (t + 1 < e.length && /\d/.test(e[t + 1])) {
|
|
30
|
-
let l =
|
|
31
|
-
for (;
|
|
32
|
-
l += e[
|
|
33
|
-
if (
|
|
29
|
+
let l = n, s = t + 1;
|
|
30
|
+
for (; s < e.length && /\d/.test(e[s]); )
|
|
31
|
+
l += e[s], s++;
|
|
32
|
+
if (J.test(l))
|
|
34
33
|
return {
|
|
35
|
-
html: `<span class="abc-tuplet">${
|
|
36
|
-
nextIndex:
|
|
34
|
+
html: `<span class="abc-tuplet">${p(l)}</span>`,
|
|
35
|
+
nextIndex: s,
|
|
37
36
|
slurLevelDelta: 0
|
|
38
37
|
};
|
|
39
38
|
}
|
|
40
39
|
return {
|
|
41
|
-
html: `<span class="abc-slur abc-slur-level-${
|
|
40
|
+
html: `<span class="abc-slur abc-slur-level-${r % 5}">${p(n)}</span>`,
|
|
42
41
|
nextIndex: t + 1,
|
|
43
42
|
slurLevelDelta: 1
|
|
44
43
|
};
|
|
45
|
-
} else if (
|
|
44
|
+
} else if (n === ")")
|
|
46
45
|
return {
|
|
47
|
-
html: `<span class="abc-slur abc-slur-level-${Math.max(0,
|
|
46
|
+
html: `<span class="abc-slur abc-slur-level-${Math.max(0, r - 1) % 5}">${p(n)}</span>`,
|
|
48
47
|
nextIndex: t + 1,
|
|
49
48
|
slurLevelDelta: -1
|
|
50
49
|
};
|
|
51
50
|
return null;
|
|
52
|
-
},
|
|
53
|
-
const
|
|
54
|
-
if (!E.test(
|
|
51
|
+
}, ce = (e, t) => {
|
|
52
|
+
const r = e[t];
|
|
53
|
+
if (!E.test(r))
|
|
55
54
|
return null;
|
|
56
|
-
let
|
|
55
|
+
let n = `<span class="abc-note">${p(r)}</span>`, l = t + 1, s = "";
|
|
57
56
|
for (; l < e.length && Q.test(e[l]); )
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
|
|
57
|
+
s += e[l], l++;
|
|
58
|
+
if (s) {
|
|
59
|
+
const i = s[0] === "'" ? "abc-octave-high" : "abc-octave-low";
|
|
60
|
+
n += `<span class="${i}">${p(s)}</span>`;
|
|
62
61
|
}
|
|
63
62
|
let a = "";
|
|
64
63
|
if (l < e.length && (e[l] === "/" || /\d/.test(e[l]))) {
|
|
@@ -67,238 +66,238 @@ const V = (e) => e.split(`
|
|
|
67
66
|
if (l < e.length && e[l] === "/")
|
|
68
67
|
for (a += e[l], l++; l < e.length && /\d/.test(e[l]); )
|
|
69
68
|
a += e[l], l++;
|
|
70
|
-
if (a &&
|
|
71
|
-
let
|
|
72
|
-
a.startsWith("/") ?
|
|
69
|
+
if (a && R.test(a)) {
|
|
70
|
+
let i = "abc-duration";
|
|
71
|
+
a.startsWith("/") ? i += " abc-duration-short" : a.includes("/") ? i += " abc-duration-fraction" : i += " abc-duration-long", n += `<span class="${i}">${p(a)}</span>`;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
76
|
-
html:
|
|
75
|
+
html: n,
|
|
77
76
|
nextIndex: l
|
|
78
77
|
};
|
|
79
78
|
}, ue = (e, t) => {
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
html: `<span class="abc-chord">${
|
|
79
|
+
const r = e[t];
|
|
80
|
+
return X.test(r) ? {
|
|
81
|
+
html: `<span class="abc-chord">${p(r)}</span>`,
|
|
83
82
|
nextIndex: t + 1
|
|
84
83
|
} : null;
|
|
85
84
|
}, de = (e, t) => {
|
|
86
|
-
const
|
|
87
|
-
if (!O.test(
|
|
85
|
+
const r = e[t];
|
|
86
|
+
if (!O.test(r))
|
|
88
87
|
return null;
|
|
89
|
-
let l = `<span class="${
|
|
90
|
-
if (
|
|
91
|
-
for (e[
|
|
92
|
-
a += e[
|
|
93
|
-
if (
|
|
94
|
-
for (a += e[
|
|
95
|
-
a += e[
|
|
96
|
-
if (a &&
|
|
97
|
-
let
|
|
98
|
-
a.startsWith("/") ?
|
|
88
|
+
let l = `<span class="${r === "x" ? "abc-rest-invisible" : "abc-rest"}">${p(r)}</span>`, s = t + 1, a = "";
|
|
89
|
+
if (s < e.length && (e[s] === "/" || /\d/.test(e[s]))) {
|
|
90
|
+
for (e[s] === "/" && (a += e[s], s++); s < e.length && /\d/.test(e[s]); )
|
|
91
|
+
a += e[s], s++;
|
|
92
|
+
if (s < e.length && e[s] === "/")
|
|
93
|
+
for (a += e[s], s++; s < e.length && /\d/.test(e[s]); )
|
|
94
|
+
a += e[s], s++;
|
|
95
|
+
if (a && R.test(a)) {
|
|
96
|
+
let i = "abc-duration";
|
|
97
|
+
a.startsWith("/") ? i += " abc-duration-short" : a.includes("/") ? i += " abc-duration-fraction" : i += " abc-duration-long", l += `<span class="${i}">${p(a)}</span>`;
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
return {
|
|
102
101
|
html: l,
|
|
103
|
-
nextIndex:
|
|
102
|
+
nextIndex: s
|
|
104
103
|
};
|
|
105
104
|
}, pe = (e, t) => {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
html: `<span class="abc-tie abc-tie-dotted">${
|
|
105
|
+
const r = e[t];
|
|
106
|
+
return r === "." && t + 1 < e.length && e[t + 1] === "-" && $.test(".-") ? {
|
|
107
|
+
html: `<span class="abc-tie abc-tie-dotted">${p(".-")}</span>`,
|
|
109
108
|
nextIndex: t + 2
|
|
110
|
-
} :
|
|
111
|
-
html: `<span class="abc-tie">${
|
|
109
|
+
} : r === "-" && $.test(r) ? {
|
|
110
|
+
html: `<span class="abc-tie">${p(r)}</span>`,
|
|
112
111
|
nextIndex: t + 1
|
|
113
112
|
} : null;
|
|
114
113
|
}, he = (e, t) => {
|
|
115
|
-
const
|
|
116
|
-
return !Z.test(
|
|
117
|
-
html: `<span class="abc-ornament">${
|
|
114
|
+
const r = e[t];
|
|
115
|
+
return !Z.test(r) || r === "." && t + 1 < e.length && e[t + 1] === "-" ? null : {
|
|
116
|
+
html: `<span class="abc-ornament">${p(r)}</span>`,
|
|
118
117
|
nextIndex: t + 1
|
|
119
118
|
};
|
|
120
119
|
}, fe = (e, t) => {
|
|
121
120
|
if (e[t] !== '"')
|
|
122
121
|
return null;
|
|
123
|
-
let
|
|
124
|
-
for (;
|
|
125
|
-
|
|
126
|
-
if (
|
|
122
|
+
let n = t + 1;
|
|
123
|
+
for (; n < e.length && e[n] !== '"'; )
|
|
124
|
+
n++;
|
|
125
|
+
if (n >= e.length)
|
|
127
126
|
return null;
|
|
128
|
-
const l = e.substring(t,
|
|
129
|
-
return
|
|
130
|
-
html: `<span class="abc-annotation">${
|
|
131
|
-
nextIndex:
|
|
127
|
+
const l = e.substring(t, n + 1);
|
|
128
|
+
return D.test(l) ? {
|
|
129
|
+
html: `<span class="abc-annotation">${p(l)}</span>`,
|
|
130
|
+
nextIndex: n + 1
|
|
132
131
|
} : null;
|
|
133
|
-
},
|
|
132
|
+
}, ge = (e, t) => {
|
|
134
133
|
if (e[t] !== '"')
|
|
135
134
|
return null;
|
|
136
|
-
let
|
|
137
|
-
for (;
|
|
138
|
-
|
|
139
|
-
if (
|
|
135
|
+
let n = t + 1;
|
|
136
|
+
for (; n < e.length && e[n] !== '"'; )
|
|
137
|
+
n++;
|
|
138
|
+
if (n >= e.length)
|
|
140
139
|
return null;
|
|
141
|
-
const l = e.substring(t,
|
|
142
|
-
return
|
|
143
|
-
html: `<span class="abc-chord-symbol">${
|
|
144
|
-
nextIndex:
|
|
140
|
+
const l = e.substring(t, n + 1);
|
|
141
|
+
return D.test(l) || !q.test(l) ? null : {
|
|
142
|
+
html: `<span class="abc-chord-symbol">${p(l)}</span>`,
|
|
143
|
+
nextIndex: n + 1
|
|
145
144
|
};
|
|
146
|
-
},
|
|
145
|
+
}, me = (e, t) => {
|
|
147
146
|
if (e[t] !== "!")
|
|
148
147
|
return null;
|
|
149
|
-
let
|
|
150
|
-
for (;
|
|
151
|
-
|
|
152
|
-
if (
|
|
148
|
+
let n = t + 1;
|
|
149
|
+
for (; n < e.length && e[n] !== "!"; )
|
|
150
|
+
n++;
|
|
151
|
+
if (n >= e.length)
|
|
153
152
|
return null;
|
|
154
|
-
const l = e.substring(t,
|
|
153
|
+
const l = e.substring(t, n + 1);
|
|
155
154
|
return ee.test(l) ? {
|
|
156
|
-
html: `<span class="abc-decoration">${
|
|
157
|
-
nextIndex:
|
|
155
|
+
html: `<span class="abc-decoration">${p(l)}</span>`,
|
|
156
|
+
nextIndex: n + 1
|
|
158
157
|
} : null;
|
|
159
158
|
}, be = (e, t) => {
|
|
160
159
|
if (e[t] !== "{")
|
|
161
160
|
return null;
|
|
162
|
-
let
|
|
163
|
-
for (;
|
|
164
|
-
|
|
165
|
-
if (
|
|
161
|
+
let n = t + 1;
|
|
162
|
+
for (; n < e.length && e[n] !== "}"; )
|
|
163
|
+
n++;
|
|
164
|
+
if (n >= e.length)
|
|
166
165
|
return null;
|
|
167
|
-
const l = e.substring(t,
|
|
166
|
+
const l = e.substring(t, n + 1);
|
|
168
167
|
return te.test(l) ? {
|
|
169
|
-
html: `<span class="abc-grace-note">${
|
|
170
|
-
nextIndex:
|
|
168
|
+
html: `<span class="abc-grace-note">${p(l)}</span>`,
|
|
169
|
+
nextIndex: n + 1
|
|
171
170
|
} : null;
|
|
172
171
|
}, ve = (e, t) => {
|
|
173
172
|
if (e[t] !== "[")
|
|
174
173
|
return null;
|
|
175
|
-
let
|
|
176
|
-
for (;
|
|
177
|
-
|
|
178
|
-
if (
|
|
174
|
+
let n = t + 1;
|
|
175
|
+
for (; n < e.length && e[n] !== "]"; )
|
|
176
|
+
n++;
|
|
177
|
+
if (n >= e.length)
|
|
179
178
|
return null;
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
179
|
+
const s = e.substring(t, n + 1).match(re);
|
|
180
|
+
if (!s)
|
|
182
181
|
return null;
|
|
183
|
-
const [, a,
|
|
182
|
+
const [, a, i] = s;
|
|
184
183
|
return {
|
|
185
|
-
html: `<span class="abc-inline-field-bracket">[</span><span class="abc-inline-field-key">${
|
|
186
|
-
nextIndex:
|
|
184
|
+
html: `<span class="abc-inline-field-bracket">[</span><span class="abc-inline-field-key">${p(a)}:</span><span class="abc-inline-field-value">${p(i)}</span><span class="abc-inline-field-bracket">]</span>`,
|
|
185
|
+
nextIndex: n + 1
|
|
187
186
|
};
|
|
188
187
|
}, xe = (e, t) => {
|
|
189
188
|
if (e[t] !== "[" || t + 1 >= e.length || !/\d/.test(e[t + 1]))
|
|
190
189
|
return null;
|
|
191
|
-
let
|
|
192
|
-
for (;
|
|
193
|
-
|
|
194
|
-
const l = e.substring(t,
|
|
190
|
+
let n = t + 1;
|
|
191
|
+
for (; n < e.length && /\d/.test(e[n]); )
|
|
192
|
+
n++;
|
|
193
|
+
const l = e.substring(t, n);
|
|
195
194
|
return ne.test(l) ? {
|
|
196
|
-
html: `<span class="abc-volta-bracket">${
|
|
197
|
-
nextIndex:
|
|
195
|
+
html: `<span class="abc-volta-bracket">${p(l)}</span>`,
|
|
196
|
+
nextIndex: n
|
|
198
197
|
} : null;
|
|
199
|
-
},
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
198
|
+
}, ye = (e, t) => {
|
|
199
|
+
const r = e[t];
|
|
200
|
+
if (r !== ">" && r !== "<")
|
|
202
201
|
return null;
|
|
203
|
-
let
|
|
204
|
-
for (;
|
|
205
|
-
|
|
206
|
-
const l = e.substring(t,
|
|
207
|
-
return
|
|
208
|
-
html: `<span class="abc-broken-rhythm">${
|
|
209
|
-
nextIndex:
|
|
202
|
+
let n = t + 1;
|
|
203
|
+
for (; n < e.length && e[n] === r; )
|
|
204
|
+
n++;
|
|
205
|
+
const l = e.substring(t, n);
|
|
206
|
+
return se.test(l) ? {
|
|
207
|
+
html: `<span class="abc-broken-rhythm">${p(l)}</span>`,
|
|
208
|
+
nextIndex: n
|
|
210
209
|
} : null;
|
|
211
|
-
},
|
|
212
|
-
let t = "",
|
|
213
|
-
for (;
|
|
214
|
-
const l =
|
|
210
|
+
}, Be = (e) => {
|
|
211
|
+
let t = "", r = 0, n = 0;
|
|
212
|
+
for (; r < e.length; ) {
|
|
213
|
+
const l = oe(e, r);
|
|
215
214
|
if (l) {
|
|
216
|
-
t += l.html,
|
|
215
|
+
t += l.html, r = l.nextIndex;
|
|
217
216
|
continue;
|
|
218
217
|
}
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
221
|
-
t +=
|
|
218
|
+
const s = me(e, r);
|
|
219
|
+
if (s) {
|
|
220
|
+
t += s.html, r = s.nextIndex;
|
|
222
221
|
continue;
|
|
223
222
|
}
|
|
224
|
-
const a = be(e,
|
|
223
|
+
const a = be(e, r);
|
|
225
224
|
if (a) {
|
|
226
|
-
t += a.html,
|
|
225
|
+
t += a.html, r = a.nextIndex;
|
|
227
226
|
continue;
|
|
228
227
|
}
|
|
229
|
-
const
|
|
230
|
-
if (
|
|
231
|
-
t +=
|
|
228
|
+
const i = ae(e, r);
|
|
229
|
+
if (i) {
|
|
230
|
+
t += i.html, r = i.nextIndex;
|
|
232
231
|
continue;
|
|
233
232
|
}
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
t +=
|
|
233
|
+
const x = he(e, r);
|
|
234
|
+
if (x) {
|
|
235
|
+
t += x.html, r = x.nextIndex;
|
|
237
236
|
continue;
|
|
238
237
|
}
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
t +=
|
|
238
|
+
const g = fe(e, r);
|
|
239
|
+
if (g) {
|
|
240
|
+
t += g.html, r = g.nextIndex;
|
|
242
241
|
continue;
|
|
243
242
|
}
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
t +=
|
|
243
|
+
const c = ge(e, r);
|
|
244
|
+
if (c) {
|
|
245
|
+
t += c.html, r = c.nextIndex;
|
|
247
246
|
continue;
|
|
248
247
|
}
|
|
249
|
-
const o =
|
|
248
|
+
const o = ie(e, r, n);
|
|
250
249
|
if (o) {
|
|
251
|
-
t += o.html,
|
|
250
|
+
t += o.html, r = o.nextIndex, o.slurLevelDelta && (n += o.slurLevelDelta);
|
|
252
251
|
continue;
|
|
253
252
|
}
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
t +=
|
|
253
|
+
const d = de(e, r);
|
|
254
|
+
if (d) {
|
|
255
|
+
t += d.html, r = d.nextIndex;
|
|
257
256
|
continue;
|
|
258
257
|
}
|
|
259
|
-
const
|
|
260
|
-
if (
|
|
261
|
-
t +=
|
|
258
|
+
const h = ce(e, r);
|
|
259
|
+
if (h) {
|
|
260
|
+
t += h.html, r = h.nextIndex;
|
|
262
261
|
continue;
|
|
263
262
|
}
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
t +=
|
|
263
|
+
const y = ye(e, r);
|
|
264
|
+
if (y) {
|
|
265
|
+
t += y.html, r = y.nextIndex;
|
|
267
266
|
continue;
|
|
268
267
|
}
|
|
269
|
-
const m = ve(e,
|
|
268
|
+
const m = ve(e, r);
|
|
270
269
|
if (m) {
|
|
271
|
-
t += m.html,
|
|
270
|
+
t += m.html, r = m.nextIndex;
|
|
272
271
|
continue;
|
|
273
272
|
}
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
t +=
|
|
273
|
+
const b = xe(e, r);
|
|
274
|
+
if (b) {
|
|
275
|
+
t += b.html, r = b.nextIndex;
|
|
277
276
|
continue;
|
|
278
277
|
}
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
t +=
|
|
278
|
+
const B = ue(e, r);
|
|
279
|
+
if (B) {
|
|
280
|
+
t += B.html, r = B.nextIndex;
|
|
282
281
|
continue;
|
|
283
282
|
}
|
|
284
|
-
const N = pe(e,
|
|
283
|
+
const N = pe(e, r);
|
|
285
284
|
if (N) {
|
|
286
|
-
t += N.html,
|
|
285
|
+
t += N.html, r = N.nextIndex;
|
|
287
286
|
continue;
|
|
288
287
|
}
|
|
289
|
-
t += `<span class="abc-text">${
|
|
288
|
+
t += `<span class="abc-text">${p(e[r])}</span>`, r++;
|
|
290
289
|
}
|
|
291
290
|
return t;
|
|
292
|
-
},
|
|
293
|
-
`).map((
|
|
294
|
-
if (le.test(
|
|
295
|
-
return `<span class="abc-comment">${
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
const [, l,
|
|
299
|
-
return l === "w:" || l === "W:" ? `<span class="abc-lyrics-key">${
|
|
291
|
+
}, S = (e) => e.split(`
|
|
292
|
+
`).map((r) => {
|
|
293
|
+
if (le.test(r))
|
|
294
|
+
return `<span class="abc-comment">${p(r)}</span>`;
|
|
295
|
+
const n = r.match(w);
|
|
296
|
+
if (n) {
|
|
297
|
+
const [, l, s] = n;
|
|
298
|
+
return l === "w:" || l === "W:" ? `<span class="abc-lyrics-key">${p(l)}</span><span class="abc-lyrics-value">${p(s)}</span>` : `<span class="abc-meta-key">${p(l)}</span><span class="abc-meta-value">${p(s)}</span>`;
|
|
300
299
|
}
|
|
301
|
-
return
|
|
300
|
+
return Be(r);
|
|
302
301
|
}).join(`
|
|
303
302
|
`), Ne = {
|
|
304
303
|
"X:": [
|
|
@@ -446,7 +445,7 @@ const V = (e) => e.split(`
|
|
|
446
445
|
{ value: "Your Name", description: "Transcriber name" },
|
|
447
446
|
{ value: "ABC transcription", description: "Transcription note" }
|
|
448
447
|
]
|
|
449
|
-
},
|
|
448
|
+
}, Te = (e) => Ne[e] || [], Ae = [
|
|
450
449
|
{
|
|
451
450
|
value: "/header",
|
|
452
451
|
description: "Insert basic ABC header template",
|
|
@@ -457,14 +456,14 @@ L:1/4
|
|
|
457
456
|
K:C
|
|
458
457
|
`
|
|
459
458
|
}
|
|
460
|
-
],
|
|
459
|
+
], Ie = (e) => e.startsWith("/") ? Ae.filter(
|
|
461
460
|
(t) => t.value.toLowerCase().startsWith(e.toLowerCase())
|
|
462
|
-
) : [],
|
|
461
|
+
) : [], Ce = ({
|
|
463
462
|
value: e,
|
|
464
463
|
textareaRef: t,
|
|
465
|
-
onChange:
|
|
464
|
+
onChange: r
|
|
466
465
|
}) => {
|
|
467
|
-
const [
|
|
466
|
+
const [n, l] = M({
|
|
468
467
|
isOpen: !1,
|
|
469
468
|
suggestions: [],
|
|
470
469
|
selectedIndex: 0,
|
|
@@ -472,478 +471,594 @@ K:C
|
|
|
472
471
|
fieldKey: null,
|
|
473
472
|
inputValue: "",
|
|
474
473
|
isCommand: !1
|
|
475
|
-
}),
|
|
474
|
+
}), s = A(() => {
|
|
476
475
|
if (!t.current)
|
|
477
476
|
return null;
|
|
478
|
-
const
|
|
479
|
-
`),
|
|
480
|
-
if (
|
|
477
|
+
const c = t.current.selectionStart, o = e.substring(0, c).split(`
|
|
478
|
+
`), d = o[o.length - 1];
|
|
479
|
+
if (d.startsWith("/"))
|
|
481
480
|
return {
|
|
482
481
|
fieldKey: null,
|
|
483
|
-
inputValue:
|
|
484
|
-
line:
|
|
485
|
-
lineStartPos:
|
|
482
|
+
inputValue: d,
|
|
483
|
+
line: d,
|
|
484
|
+
lineStartPos: c - d.length,
|
|
486
485
|
isCommand: !0
|
|
487
486
|
};
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
const [,
|
|
487
|
+
const h = d.match(w);
|
|
488
|
+
if (h) {
|
|
489
|
+
const [, y, m] = h;
|
|
491
490
|
return {
|
|
492
|
-
fieldKey:
|
|
491
|
+
fieldKey: y,
|
|
493
492
|
inputValue: m,
|
|
494
|
-
line:
|
|
495
|
-
lineStartPos:
|
|
493
|
+
line: d,
|
|
494
|
+
lineStartPos: c - d.length,
|
|
496
495
|
isCommand: !1
|
|
497
496
|
};
|
|
498
497
|
}
|
|
499
498
|
return null;
|
|
500
|
-
}, [e, t]), a =
|
|
499
|
+
}, [e, t]), a = A(() => {
|
|
501
500
|
if (!t.current)
|
|
502
501
|
return { top: 0, left: 0 };
|
|
503
|
-
const
|
|
504
|
-
`).length - 1,
|
|
505
|
-
return { top: (parseFloat(getComputedStyle(
|
|
502
|
+
const c = t.current, o = c.selectionStart, h = e.substring(0, o).split(`
|
|
503
|
+
`).length - 1, y = parseFloat(getComputedStyle(c).lineHeight) || 24;
|
|
504
|
+
return { top: (parseFloat(getComputedStyle(c).paddingTop) || 16) + (h + 1) * y - c.scrollTop, left: 60 };
|
|
506
505
|
}, [e, t]);
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
if (!
|
|
510
|
-
l((
|
|
506
|
+
P(() => {
|
|
507
|
+
const c = s();
|
|
508
|
+
if (!c) {
|
|
509
|
+
l((d) => ({ ...d, isOpen: !1 }));
|
|
511
510
|
return;
|
|
512
511
|
}
|
|
513
512
|
let o = [];
|
|
514
|
-
if (
|
|
515
|
-
(
|
|
513
|
+
if (c.isCommand ? o = Ie(c.inputValue) : c.fieldKey && (o = Te(c.fieldKey).filter(
|
|
514
|
+
(h) => h.value.toLowerCase().startsWith(c.inputValue.toLowerCase())
|
|
516
515
|
)), o.length > 0) {
|
|
517
|
-
const
|
|
516
|
+
const d = a();
|
|
518
517
|
l({
|
|
519
518
|
isOpen: !0,
|
|
520
519
|
suggestions: o,
|
|
521
520
|
selectedIndex: 0,
|
|
522
|
-
position:
|
|
523
|
-
fieldKey:
|
|
524
|
-
inputValue:
|
|
525
|
-
isCommand:
|
|
521
|
+
position: d,
|
|
522
|
+
fieldKey: c.fieldKey,
|
|
523
|
+
inputValue: c.inputValue,
|
|
524
|
+
isCommand: c.isCommand
|
|
526
525
|
});
|
|
527
526
|
} else
|
|
528
|
-
l((
|
|
529
|
-
}, [e,
|
|
530
|
-
const
|
|
531
|
-
(
|
|
527
|
+
l((d) => ({ ...d, isOpen: !1 }));
|
|
528
|
+
}, [e, s, a]);
|
|
529
|
+
const i = A(
|
|
530
|
+
(c) => {
|
|
532
531
|
if (!t.current)
|
|
533
532
|
return;
|
|
534
|
-
const o = t.current.selectionStart,
|
|
535
|
-
`),
|
|
536
|
-
let
|
|
537
|
-
if (
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
} else if (
|
|
541
|
-
const
|
|
542
|
-
|
|
533
|
+
const o = t.current.selectionStart, d = e.substring(0, o).split(`
|
|
534
|
+
`), h = d[d.length - 1];
|
|
535
|
+
let y, m;
|
|
536
|
+
if (n.isCommand && c.template) {
|
|
537
|
+
const b = e.substring(0, o - h.length), B = e.substring(o);
|
|
538
|
+
y = b + c.template + B, m = b.length + c.template.length;
|
|
539
|
+
} else if (n.fieldKey) {
|
|
540
|
+
const b = n.fieldKey + c.value, B = e.substring(0, o - h.length), N = e.substring(o);
|
|
541
|
+
y = B + b + N, m = B.length + b.length;
|
|
543
542
|
} else
|
|
544
543
|
return;
|
|
545
|
-
|
|
544
|
+
r(y), setTimeout(() => {
|
|
546
545
|
t.current && (t.current.selectionStart = m, t.current.selectionEnd = m, t.current.focus());
|
|
547
|
-
}, 0), l((
|
|
546
|
+
}, 0), l((b) => ({ ...b, isOpen: !1 }));
|
|
548
547
|
},
|
|
549
|
-
[t,
|
|
550
|
-
),
|
|
551
|
-
(
|
|
552
|
-
if (
|
|
553
|
-
switch (
|
|
548
|
+
[t, n.fieldKey, n.isCommand, e, r]
|
|
549
|
+
), x = A(
|
|
550
|
+
(c) => {
|
|
551
|
+
if (n.isOpen)
|
|
552
|
+
switch (c.key) {
|
|
554
553
|
case "ArrowDown":
|
|
555
|
-
|
|
554
|
+
c.preventDefault(), l((o) => ({
|
|
556
555
|
...o,
|
|
557
556
|
selectedIndex: Math.min(o.selectedIndex + 1, o.suggestions.length - 1)
|
|
558
557
|
}));
|
|
559
558
|
break;
|
|
560
559
|
case "ArrowUp":
|
|
561
|
-
|
|
560
|
+
c.preventDefault(), l((o) => ({
|
|
562
561
|
...o,
|
|
563
562
|
selectedIndex: Math.max(o.selectedIndex - 1, 0)
|
|
564
563
|
}));
|
|
565
564
|
break;
|
|
566
565
|
case "Enter":
|
|
567
|
-
|
|
566
|
+
n.suggestions.length > 0 && (c.preventDefault(), i(n.suggestions[n.selectedIndex]));
|
|
568
567
|
break;
|
|
569
568
|
case "Escape":
|
|
570
|
-
|
|
569
|
+
c.preventDefault(), l((o) => ({ ...o, isOpen: !1 }));
|
|
571
570
|
break;
|
|
572
571
|
}
|
|
573
572
|
},
|
|
574
|
-
[
|
|
575
|
-
),
|
|
576
|
-
l((o) => ({ ...o, selectedIndex:
|
|
573
|
+
[n.isOpen, n.suggestions, n.selectedIndex, i]
|
|
574
|
+
), g = A((c) => {
|
|
575
|
+
l((o) => ({ ...o, selectedIndex: c }));
|
|
577
576
|
}, []);
|
|
578
577
|
return {
|
|
579
|
-
isOpen:
|
|
580
|
-
suggestions:
|
|
581
|
-
selectedIndex:
|
|
582
|
-
position:
|
|
583
|
-
handleKeyDown:
|
|
584
|
-
selectSuggestion:
|
|
585
|
-
handleMouseEnter:
|
|
578
|
+
isOpen: n.isOpen,
|
|
579
|
+
suggestions: n.suggestions,
|
|
580
|
+
selectedIndex: n.selectedIndex,
|
|
581
|
+
position: n.position,
|
|
582
|
+
handleKeyDown: x,
|
|
583
|
+
selectSuggestion: i,
|
|
584
|
+
handleMouseEnter: g
|
|
586
585
|
};
|
|
587
586
|
}, we = ({
|
|
588
587
|
suggestions: e,
|
|
589
588
|
selectedIndex: t,
|
|
590
|
-
position:
|
|
591
|
-
onSelect:
|
|
589
|
+
position: r,
|
|
590
|
+
onSelect: n,
|
|
592
591
|
onMouseEnter: l
|
|
593
592
|
}) => {
|
|
594
|
-
const
|
|
595
|
-
return
|
|
596
|
-
|
|
593
|
+
const s = C(null);
|
|
594
|
+
return P(() => {
|
|
595
|
+
s.current?.scrollIntoView({
|
|
597
596
|
block: "nearest",
|
|
598
597
|
behavior: "smooth"
|
|
599
598
|
});
|
|
600
|
-
}, [t]), e.length === 0 ? null : /* @__PURE__ */
|
|
599
|
+
}, [t]), e.length === 0 ? null : /* @__PURE__ */ u(
|
|
601
600
|
"div",
|
|
602
601
|
{
|
|
603
602
|
className: "absolute z-50 bg-slate-800 rounded-md shadow-xl overflow-hidden",
|
|
604
603
|
style: {
|
|
605
|
-
top: `${
|
|
606
|
-
left: `${
|
|
604
|
+
top: `${r.top}px`,
|
|
605
|
+
left: `${r.left}px`,
|
|
607
606
|
minWidth: "200px",
|
|
608
607
|
maxWidth: "400px",
|
|
609
608
|
maxHeight: "300px",
|
|
610
609
|
overflowY: "auto"
|
|
611
610
|
},
|
|
612
|
-
children: e.map((a,
|
|
611
|
+
children: e.map((a, i) => /* @__PURE__ */ v(
|
|
613
612
|
"div",
|
|
614
613
|
{
|
|
615
|
-
ref:
|
|
616
|
-
className: `px-3 py-2 cursor-pointer ${
|
|
617
|
-
onClick: () =>
|
|
618
|
-
onMouseEnter: () => l(
|
|
614
|
+
ref: i === t ? s : null,
|
|
615
|
+
className: `px-3 py-2 cursor-pointer ${i === t ? "bg-blue-600 text-white" : "text-slate-200 hover:bg-slate-700"}`,
|
|
616
|
+
onClick: () => n(a),
|
|
617
|
+
onMouseEnter: () => l(i),
|
|
619
618
|
children: [
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
a.description && /* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ u("div", { className: "font-mono text-sm", children: a.value }),
|
|
620
|
+
a.description && /* @__PURE__ */ u("div", { className: "text-xs opacity-75 mt-1", children: a.description })
|
|
622
621
|
]
|
|
623
622
|
},
|
|
624
|
-
`${a.value}-${
|
|
623
|
+
`${a.value}-${i}`
|
|
625
624
|
))
|
|
626
625
|
}
|
|
627
626
|
);
|
|
628
|
-
},
|
|
627
|
+
}, ke = (e) => {
|
|
629
628
|
const t = e.trim();
|
|
630
629
|
if (t === "C")
|
|
631
630
|
return { beatsPerMeasure: 4, beatUnit: 4 };
|
|
632
631
|
if (t === "C|")
|
|
633
632
|
return { beatsPerMeasure: 2, beatUnit: 2 };
|
|
634
|
-
const
|
|
635
|
-
return
|
|
636
|
-
beatsPerMeasure: parseInt(
|
|
637
|
-
beatUnit: parseInt(
|
|
633
|
+
const r = t.match(/^(\d+)\/(\d+)$/);
|
|
634
|
+
return r ? {
|
|
635
|
+
beatsPerMeasure: parseInt(r[1], 10),
|
|
636
|
+
beatUnit: parseInt(r[2], 10)
|
|
638
637
|
} : { beatsPerMeasure: 4, beatUnit: 4 };
|
|
639
638
|
}, Le = (e) => {
|
|
640
|
-
const
|
|
641
|
-
return
|
|
642
|
-
},
|
|
639
|
+
const r = e.trim().match(/^(\d+)\/(\d+)$/);
|
|
640
|
+
return r ? parseInt(r[1], 10) / parseInt(r[2], 10) : 1 / 8;
|
|
641
|
+
}, Ee = (e) => {
|
|
643
642
|
const t = e.split(`
|
|
644
643
|
`);
|
|
645
|
-
let
|
|
644
|
+
let r = { beatsPerMeasure: 4, beatUnit: 4 }, n = 1 / 8;
|
|
646
645
|
for (const l of t) {
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
const [, a,
|
|
650
|
-
a === "M:" ?
|
|
646
|
+
const s = l.match(w);
|
|
647
|
+
if (s) {
|
|
648
|
+
const [, a, i] = s;
|
|
649
|
+
a === "M:" ? r = ke(i) : a === "L:" && (n = Le(i));
|
|
651
650
|
}
|
|
652
651
|
}
|
|
653
|
-
return { meter:
|
|
654
|
-
},
|
|
652
|
+
return { meter: r, unitNoteLength: n };
|
|
653
|
+
}, _ = (e) => {
|
|
655
654
|
if (!e)
|
|
656
655
|
return 1;
|
|
657
656
|
if (e.startsWith("/"))
|
|
658
657
|
return 1 / parseInt(e.substring(1), 10);
|
|
659
658
|
if (e.includes("/")) {
|
|
660
|
-
const [t,
|
|
661
|
-
return parseInt(t, 10) / parseInt(
|
|
659
|
+
const [t, r] = e.split("/");
|
|
660
|
+
return parseInt(t, 10) / parseInt(r, 10);
|
|
662
661
|
}
|
|
663
662
|
return parseInt(e, 10);
|
|
664
663
|
}, $e = (e, t) => {
|
|
665
|
-
let
|
|
666
|
-
for (;
|
|
667
|
-
const l = e[
|
|
664
|
+
let r = 0, n = 0;
|
|
665
|
+
for (; n < e.length; ) {
|
|
666
|
+
const l = e[n];
|
|
668
667
|
if (E.test(l) || O.test(l)) {
|
|
669
|
-
let
|
|
670
|
-
for (;
|
|
671
|
-
|
|
668
|
+
let s = n + 1;
|
|
669
|
+
for (; s < e.length && (e[s] === "'" || e[s] === ","); )
|
|
670
|
+
s++;
|
|
672
671
|
let a = "";
|
|
673
|
-
if (
|
|
674
|
-
const o =
|
|
675
|
-
for (e[
|
|
676
|
-
|
|
677
|
-
if (
|
|
678
|
-
for (
|
|
679
|
-
|
|
680
|
-
a = e.substring(o,
|
|
672
|
+
if (s < e.length && (e[s] === "/" || /\d/.test(e[s]))) {
|
|
673
|
+
const o = s;
|
|
674
|
+
for (e[s] === "/" && s++; s < e.length && /\d/.test(e[s]); )
|
|
675
|
+
s++;
|
|
676
|
+
if (s < e.length && e[s] === "/")
|
|
677
|
+
for (s++; s < e.length && /\d/.test(e[s]); )
|
|
678
|
+
s++;
|
|
679
|
+
a = e.substring(o, s);
|
|
681
680
|
}
|
|
682
|
-
const
|
|
683
|
-
|
|
681
|
+
const i = _(a), x = t.unitNoteLength * i, g = 1 / t.meter.beatUnit, c = x / g;
|
|
682
|
+
r += c, n = s;
|
|
684
683
|
} else if (l === "[") {
|
|
685
|
-
let
|
|
686
|
-
for (;
|
|
687
|
-
const a = e[
|
|
684
|
+
let s = n + 1;
|
|
685
|
+
for (; s < e.length && e[s] !== "]"; ) {
|
|
686
|
+
const a = e[s];
|
|
688
687
|
if (E.test(a)) {
|
|
689
|
-
let
|
|
690
|
-
for (;
|
|
691
|
-
|
|
692
|
-
|
|
688
|
+
let i = s + 1;
|
|
689
|
+
for (; i < e.length && (e[i] === "'" || e[i] === ","); )
|
|
690
|
+
i++;
|
|
691
|
+
s = i;
|
|
693
692
|
} else
|
|
694
|
-
|
|
693
|
+
s++;
|
|
695
694
|
}
|
|
696
|
-
if (
|
|
697
|
-
|
|
695
|
+
if (s < e.length && e[s] === "]") {
|
|
696
|
+
s++;
|
|
698
697
|
let a = "";
|
|
699
|
-
if (
|
|
700
|
-
const o =
|
|
701
|
-
for (e[
|
|
702
|
-
|
|
703
|
-
if (
|
|
704
|
-
for (
|
|
705
|
-
|
|
706
|
-
a = e.substring(o,
|
|
698
|
+
if (s < e.length && (e[s] === "/" || /\d/.test(e[s]))) {
|
|
699
|
+
const o = s;
|
|
700
|
+
for (e[s] === "/" && s++; s < e.length && /\d/.test(e[s]); )
|
|
701
|
+
s++;
|
|
702
|
+
if (s < e.length && e[s] === "/")
|
|
703
|
+
for (s++; s < e.length && /\d/.test(e[s]); )
|
|
704
|
+
s++;
|
|
705
|
+
a = e.substring(o, s);
|
|
707
706
|
}
|
|
708
|
-
const
|
|
709
|
-
|
|
707
|
+
const i = _(a), x = t.unitNoteLength * i, g = 1 / t.meter.beatUnit, c = x / g;
|
|
708
|
+
r += c;
|
|
710
709
|
}
|
|
711
|
-
|
|
710
|
+
n = s;
|
|
712
711
|
} else
|
|
713
|
-
|
|
712
|
+
n++;
|
|
714
713
|
}
|
|
715
|
-
return
|
|
716
|
-
},
|
|
717
|
-
const t = [],
|
|
718
|
-
`),
|
|
719
|
-
return
|
|
720
|
-
if (!(l.trim().startsWith("%") ||
|
|
714
|
+
return r;
|
|
715
|
+
}, Se = (e) => {
|
|
716
|
+
const t = [], r = e.split(`
|
|
717
|
+
`), n = Ee(e);
|
|
718
|
+
return r.forEach((l, s) => {
|
|
719
|
+
if (!(l.trim().startsWith("%") || w.test(l)) && l.includes("|")) {
|
|
721
720
|
let a = 0;
|
|
722
|
-
const
|
|
723
|
-
let
|
|
724
|
-
|
|
725
|
-
if (
|
|
721
|
+
const i = l.split("|");
|
|
722
|
+
let x = 0;
|
|
723
|
+
i.forEach((g, c) => {
|
|
724
|
+
if (c === i.length - 1 && g.trim() === "")
|
|
726
725
|
return;
|
|
727
|
-
const o =
|
|
726
|
+
const o = g.trim();
|
|
728
727
|
if (o.startsWith(":") || o.startsWith("[") || o === "") {
|
|
729
|
-
a +=
|
|
728
|
+
a += g.length + 1;
|
|
730
729
|
return;
|
|
731
730
|
}
|
|
732
|
-
const
|
|
733
|
-
if (Math.abs(
|
|
734
|
-
const m = l.indexOf(o, a),
|
|
731
|
+
const d = $e(o, n), h = n.meter.beatsPerMeasure;
|
|
732
|
+
if (Math.abs(d - h) > 0.01) {
|
|
733
|
+
const m = l.indexOf(o, a), b = m + o.length;
|
|
735
734
|
t.push({
|
|
736
|
-
line:
|
|
737
|
-
measureIndex:
|
|
735
|
+
line: s,
|
|
736
|
+
measureIndex: x,
|
|
738
737
|
startCol: m,
|
|
739
|
-
endCol:
|
|
740
|
-
expected:
|
|
741
|
-
actual:
|
|
742
|
-
message: `Expected ${
|
|
738
|
+
endCol: b,
|
|
739
|
+
expected: h,
|
|
740
|
+
actual: d,
|
|
741
|
+
message: `Expected ${h} beats, got ${d.toFixed(2)}`
|
|
743
742
|
});
|
|
744
743
|
}
|
|
745
|
-
|
|
744
|
+
x++, a += g.length + 1;
|
|
746
745
|
});
|
|
747
746
|
}
|
|
748
747
|
}), t;
|
|
749
|
-
},
|
|
750
|
-
const
|
|
748
|
+
}, Pe = ({ value: e, onChange: t, theme: r = "light" }) => {
|
|
749
|
+
const n = C(null), l = C(null), s = C(null), [a, i] = M(null), x = V(e), g = S(e), c = K(() => Se(e), [e]), o = r === "dark" ? {
|
|
751
750
|
bg: "#1a1a1a",
|
|
752
751
|
editorBg: "#262626",
|
|
753
752
|
lineNumBg: "#0f0f0f",
|
|
753
|
+
lineNumBorder: "#2d2d2d",
|
|
754
754
|
caretColor: "#fff",
|
|
755
|
-
|
|
755
|
+
errorBg: "#1a1a1a",
|
|
756
|
+
errorBorder: "#2d2d2d",
|
|
757
|
+
errorHeader: "#ffffff",
|
|
758
|
+
errorBadgeBg: "#dc2626",
|
|
759
|
+
errorBadgeText: "#ffffff",
|
|
756
760
|
errorIcon: "#f59e0b",
|
|
757
761
|
errorLocation: "#22d3ee",
|
|
758
|
-
errorMessage: "#
|
|
759
|
-
errorHighlight: "rgba(245, 158, 11, 0.2)"
|
|
762
|
+
errorMessage: "#e5e7eb",
|
|
763
|
+
errorHighlight: "rgba(245, 158, 11, 0.2)",
|
|
764
|
+
errorHoverBg: "rgba(51, 65, 85, 0.4)",
|
|
765
|
+
errorItemBorder: "rgba(255, 255, 255, 0.05)"
|
|
760
766
|
} : {
|
|
761
767
|
bg: "#f8f9fa",
|
|
762
768
|
editorBg: "#ffffff",
|
|
763
|
-
lineNumBg: "#
|
|
769
|
+
lineNumBg: "#ffffff",
|
|
770
|
+
lineNumBorder: "#e5e7eb",
|
|
764
771
|
caretColor: "#000",
|
|
765
|
-
|
|
766
|
-
|
|
772
|
+
errorBg: "#ffffff",
|
|
773
|
+
errorBorder: "#e5e7eb",
|
|
774
|
+
errorHeader: "#1f2937",
|
|
775
|
+
errorBadgeBg: "#dc2626",
|
|
776
|
+
errorBadgeText: "#ffffff",
|
|
777
|
+
errorIcon: "#dc2626",
|
|
767
778
|
errorLocation: "#0891b2",
|
|
768
|
-
errorMessage: "#
|
|
769
|
-
errorHighlight: "#fde047"
|
|
779
|
+
errorMessage: "#1f2937",
|
|
780
|
+
errorHighlight: "#fde047",
|
|
781
|
+
errorHoverBg: "rgba(254, 202, 202, 0.4)",
|
|
782
|
+
errorItemBorder: "rgba(220, 38, 38, 0.1)"
|
|
770
783
|
}, {
|
|
771
|
-
isOpen:
|
|
772
|
-
suggestions:
|
|
773
|
-
selectedIndex:
|
|
784
|
+
isOpen: d,
|
|
785
|
+
suggestions: h,
|
|
786
|
+
selectedIndex: y,
|
|
774
787
|
position: m,
|
|
775
|
-
handleKeyDown:
|
|
776
|
-
selectSuggestion:
|
|
788
|
+
handleKeyDown: b,
|
|
789
|
+
selectSuggestion: B,
|
|
777
790
|
handleMouseEnter: N
|
|
778
|
-
} =
|
|
779
|
-
|
|
791
|
+
} = Ce({ value: e, textareaRef: n, onChange: t }), H = () => {
|
|
792
|
+
n.current && l.current && s.current && (l.current.scrollTop = n.current.scrollTop, s.current.scrollTop = n.current.scrollTop);
|
|
793
|
+
}, W = (f) => {
|
|
794
|
+
if (n.current) {
|
|
795
|
+
const T = e.split(`
|
|
796
|
+
`), I = T.slice(0, f.line).join(`
|
|
797
|
+
`).length + (f.line > 0 ? 1 : 0);
|
|
798
|
+
n.current.focus(), n.current.setSelectionRange(I, I), n.current.scrollTop = n.current.scrollHeight * (f.line / T.length);
|
|
799
|
+
}
|
|
780
800
|
};
|
|
781
|
-
return /* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ u("div", { className: "w-full h-full flex flex-col p-4", "data-theme": r, style: { backgroundColor: o.bg }, children: /* @__PURE__ */ v("div", { className: "w-full flex-1 flex flex-col rounded-lg overflow-hidden shadow-lg", style: { backgroundColor: o.editorBg }, children: [
|
|
802
|
+
/* @__PURE__ */ v("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
803
|
+
/* @__PURE__ */ u(
|
|
784
804
|
"div",
|
|
785
805
|
{
|
|
786
806
|
ref: l,
|
|
787
807
|
className: "overflow-hidden text-right text-sm font-mono leading-relaxed text-slate-500 select-none",
|
|
788
|
-
style: {
|
|
789
|
-
|
|
808
|
+
style: {
|
|
809
|
+
backgroundColor: o.lineNumBg,
|
|
810
|
+
minWidth: "2.5rem",
|
|
811
|
+
borderRight: `1px solid ${o.lineNumBorder}`
|
|
812
|
+
},
|
|
813
|
+
children: /* @__PURE__ */ u("pre", { className: "m-0 pl-1 pr-3 py-4", children: x })
|
|
790
814
|
}
|
|
791
815
|
),
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ v("div", { className: "flex-1 relative", children: [
|
|
817
|
+
/* @__PURE__ */ u(
|
|
794
818
|
"div",
|
|
795
819
|
{
|
|
796
|
-
ref:
|
|
820
|
+
ref: s,
|
|
797
821
|
className: "absolute inset-0 overflow-hidden px-4 py-4 text-sm font-mono leading-relaxed pointer-events-none",
|
|
798
822
|
style: {
|
|
799
823
|
backgroundColor: o.editorBg,
|
|
800
824
|
opacity: a ? 0.3 : 1,
|
|
801
825
|
transition: "opacity 0.2s"
|
|
802
826
|
},
|
|
803
|
-
children: /* @__PURE__ */
|
|
827
|
+
children: /* @__PURE__ */ u(
|
|
804
828
|
"pre",
|
|
805
829
|
{
|
|
806
830
|
className: "m-0",
|
|
807
|
-
dangerouslySetInnerHTML: { __html:
|
|
831
|
+
dangerouslySetInnerHTML: { __html: g }
|
|
808
832
|
}
|
|
809
833
|
)
|
|
810
834
|
}
|
|
811
835
|
),
|
|
812
836
|
a && (() => {
|
|
813
|
-
const
|
|
814
|
-
`),
|
|
815
|
-
return /* @__PURE__ */
|
|
837
|
+
const f = e.split(`
|
|
838
|
+
`), I = (f[a.line] || "").substring(a.startCol, a.endCol), U = S(I);
|
|
839
|
+
return /* @__PURE__ */ u(
|
|
816
840
|
"div",
|
|
817
841
|
{
|
|
818
842
|
className: "absolute inset-0 overflow-hidden px-4 py-4 text-sm font-mono leading-relaxed pointer-events-none",
|
|
819
843
|
style: { backgroundColor: "transparent" },
|
|
820
|
-
children: /* @__PURE__ */
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
844
|
+
children: /* @__PURE__ */ u("pre", { className: "m-0", children: f.map((k, L) => {
|
|
845
|
+
if (L === a.line) {
|
|
846
|
+
const j = k.substring(0, a.startCol), F = k.substring(a.endCol);
|
|
847
|
+
return /* @__PURE__ */ v("div", { children: [
|
|
848
|
+
/* @__PURE__ */ u("span", { style: { opacity: 0 }, children: j }),
|
|
849
|
+
/* @__PURE__ */ u(
|
|
826
850
|
"span",
|
|
827
851
|
{
|
|
828
852
|
className: "px-1 rounded",
|
|
829
853
|
style: { backgroundColor: o.errorHighlight },
|
|
830
|
-
dangerouslySetInnerHTML: { __html:
|
|
854
|
+
dangerouslySetInnerHTML: { __html: U }
|
|
831
855
|
}
|
|
832
856
|
),
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
] },
|
|
857
|
+
/* @__PURE__ */ u("span", { style: { opacity: 0 }, children: F })
|
|
858
|
+
] }, L);
|
|
835
859
|
}
|
|
836
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ u("div", { style: { opacity: 0 }, children: k }, L);
|
|
837
861
|
}) })
|
|
838
862
|
}
|
|
839
863
|
);
|
|
840
864
|
})(),
|
|
841
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ u(
|
|
842
866
|
"textarea",
|
|
843
867
|
{
|
|
844
|
-
ref:
|
|
868
|
+
ref: n,
|
|
845
869
|
className: "absolute inset-0 w-full h-full resize-none px-4 py-4 text-sm font-mono leading-relaxed outline-none border-0",
|
|
846
870
|
style: { backgroundColor: "transparent", color: "transparent", caretColor: o.caretColor },
|
|
847
871
|
value: e,
|
|
848
|
-
onChange: (
|
|
849
|
-
onScroll:
|
|
850
|
-
onKeyDown:
|
|
872
|
+
onChange: (f) => t(f.target.value),
|
|
873
|
+
onScroll: H,
|
|
874
|
+
onKeyDown: b,
|
|
851
875
|
spellCheck: !1,
|
|
852
876
|
placeholder: "Type /header to insert template..."
|
|
853
877
|
}
|
|
854
878
|
),
|
|
855
|
-
|
|
879
|
+
d && /* @__PURE__ */ u(
|
|
856
880
|
we,
|
|
857
881
|
{
|
|
858
|
-
suggestions:
|
|
859
|
-
selectedIndex:
|
|
882
|
+
suggestions: h,
|
|
883
|
+
selectedIndex: y,
|
|
860
884
|
position: m,
|
|
861
|
-
onSelect:
|
|
885
|
+
onSelect: B,
|
|
862
886
|
onMouseEnter: N
|
|
863
887
|
}
|
|
864
888
|
)
|
|
865
889
|
] })
|
|
866
890
|
] }),
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
891
|
+
c.length > 0 && /* @__PURE__ */ v("div", { className: "flex", children: [
|
|
892
|
+
/* @__PURE__ */ u(
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
style: {
|
|
896
|
+
backgroundColor: o.lineNumBg,
|
|
897
|
+
minWidth: "2.5rem",
|
|
898
|
+
borderRight: `1px solid ${o.lineNumBorder}`
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
),
|
|
902
|
+
/* @__PURE__ */ v(
|
|
903
|
+
"div",
|
|
904
|
+
{
|
|
905
|
+
className: "flex-1 px-4 py-3 text-xs font-mono overflow-auto border-t",
|
|
906
|
+
style: {
|
|
907
|
+
backgroundColor: o.errorBg,
|
|
908
|
+
borderColor: o.errorBorder,
|
|
909
|
+
maxHeight: "12rem",
|
|
910
|
+
scrollbarWidth: "thin",
|
|
911
|
+
scrollbarColor: `${o.errorIcon} transparent`
|
|
912
|
+
},
|
|
913
|
+
children: [
|
|
914
|
+
/* @__PURE__ */ v("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
915
|
+
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
916
|
+
/* @__PURE__ */ v(
|
|
917
|
+
"svg",
|
|
918
|
+
{
|
|
919
|
+
width: "14",
|
|
920
|
+
height: "14",
|
|
921
|
+
viewBox: "0 0 24 24",
|
|
922
|
+
fill: "none",
|
|
923
|
+
stroke: "currentColor",
|
|
924
|
+
strokeWidth: "2",
|
|
925
|
+
strokeLinecap: "round",
|
|
926
|
+
strokeLinejoin: "round",
|
|
927
|
+
style: { color: o.errorIcon },
|
|
928
|
+
children: [
|
|
929
|
+
/* @__PURE__ */ u("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
930
|
+
/* @__PURE__ */ u("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
931
|
+
/* @__PURE__ */ u("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
932
|
+
]
|
|
933
|
+
}
|
|
934
|
+
),
|
|
935
|
+
/* @__PURE__ */ u("span", { className: "text-[11px] font-semibold uppercase tracking-wide", style: { color: o.errorHeader }, children: "Validation Issues" })
|
|
936
|
+
] }),
|
|
937
|
+
/* @__PURE__ */ u(
|
|
938
|
+
"div",
|
|
939
|
+
{
|
|
940
|
+
className: "px-2 py-0.5 rounded-full text-[10px] font-bold",
|
|
941
|
+
style: {
|
|
942
|
+
backgroundColor: o.errorBadgeBg,
|
|
943
|
+
color: o.errorBadgeText
|
|
944
|
+
},
|
|
945
|
+
children: c.length
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
] }),
|
|
949
|
+
/* @__PURE__ */ u("div", { className: "space-y-1", children: c.map((f, T) => /* @__PURE__ */ v(
|
|
950
|
+
"div",
|
|
951
|
+
{
|
|
952
|
+
className: "flex items-start gap-3 px-3 py-2 rounded-md border cursor-pointer",
|
|
953
|
+
style: {
|
|
954
|
+
backgroundColor: a === f ? o.errorHoverBg : "transparent",
|
|
955
|
+
borderColor: a === f ? o.errorIcon : o.errorItemBorder,
|
|
956
|
+
transition: "all 0.15s ease-in-out",
|
|
957
|
+
transform: a === f ? "translateX(2px)" : "translateX(0)"
|
|
958
|
+
},
|
|
959
|
+
onMouseEnter: () => i(f),
|
|
960
|
+
onMouseLeave: () => i(null),
|
|
961
|
+
onClick: () => W(f),
|
|
962
|
+
children: [
|
|
963
|
+
/* @__PURE__ */ v(
|
|
964
|
+
"svg",
|
|
965
|
+
{
|
|
966
|
+
width: "16",
|
|
967
|
+
height: "16",
|
|
968
|
+
viewBox: "0 0 24 24",
|
|
969
|
+
fill: "none",
|
|
970
|
+
stroke: "currentColor",
|
|
971
|
+
strokeWidth: "2",
|
|
972
|
+
strokeLinecap: "round",
|
|
973
|
+
strokeLinejoin: "round",
|
|
974
|
+
className: "shrink-0 mt-0.5",
|
|
975
|
+
style: { color: o.errorIcon },
|
|
976
|
+
children: [
|
|
977
|
+
/* @__PURE__ */ u("circle", { cx: "12", cy: "12", r: "10" }),
|
|
978
|
+
/* @__PURE__ */ u("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
979
|
+
/* @__PURE__ */ u("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
980
|
+
]
|
|
981
|
+
}
|
|
982
|
+
),
|
|
983
|
+
/* @__PURE__ */ v("div", { className: "flex-1 flex flex-col gap-1", children: [
|
|
984
|
+
/* @__PURE__ */ u("div", { className: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ v(
|
|
985
|
+
"span",
|
|
986
|
+
{
|
|
987
|
+
className: "font-semibold text-[11px] px-1.5 py-0.5 rounded",
|
|
988
|
+
style: {
|
|
989
|
+
color: o.errorLocation,
|
|
990
|
+
backgroundColor: r === "dark" ? "rgba(34, 211, 238, 0.1)" : "rgba(8, 145, 178, 0.1)"
|
|
991
|
+
},
|
|
992
|
+
children: [
|
|
993
|
+
"Line ",
|
|
994
|
+
f.line + 1,
|
|
995
|
+
", Measure ",
|
|
996
|
+
f.measureIndex + 1
|
|
997
|
+
]
|
|
998
|
+
}
|
|
999
|
+
) }),
|
|
1000
|
+
/* @__PURE__ */ u("span", { className: "text-[11px] leading-relaxed", style: { color: o.errorMessage }, children: f.message })
|
|
896
1001
|
] }),
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
1002
|
+
/* @__PURE__ */ v(
|
|
1003
|
+
"svg",
|
|
1004
|
+
{
|
|
1005
|
+
width: "14",
|
|
1006
|
+
height: "14",
|
|
1007
|
+
viewBox: "0 0 24 24",
|
|
1008
|
+
fill: "none",
|
|
1009
|
+
stroke: "currentColor",
|
|
1010
|
+
strokeWidth: "2",
|
|
1011
|
+
strokeLinecap: "round",
|
|
1012
|
+
strokeLinejoin: "round",
|
|
1013
|
+
className: "shrink-0 mt-1 opacity-50",
|
|
1014
|
+
style: {
|
|
1015
|
+
color: o.errorIcon,
|
|
1016
|
+
opacity: a === f ? 1 : 0.3,
|
|
1017
|
+
transition: "opacity 0.15s ease-in-out"
|
|
1018
|
+
},
|
|
1019
|
+
children: [
|
|
1020
|
+
/* @__PURE__ */ u("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1021
|
+
/* @__PURE__ */ u("polyline", { points: "12 5 19 12 12 19" })
|
|
1022
|
+
]
|
|
1023
|
+
}
|
|
1024
|
+
)
|
|
1025
|
+
]
|
|
1026
|
+
},
|
|
1027
|
+
T
|
|
1028
|
+
)) })
|
|
1029
|
+
]
|
|
1030
|
+
}
|
|
1031
|
+
)
|
|
1032
|
+
] })
|
|
906
1033
|
] }) });
|
|
907
|
-
}, Re = ({ value: e, theme: t = "light" }) => {
|
|
908
|
-
const n = y(null);
|
|
909
|
-
return L(() => {
|
|
910
|
-
n.current && j.renderAbc(n.current, e, {
|
|
911
|
-
responsive: "resize",
|
|
912
|
-
foregroundColor: t === "dark" ? "#ffffff" : "#000000",
|
|
913
|
-
format: {
|
|
914
|
-
titlefont: "serif 20"
|
|
915
|
-
}
|
|
916
|
-
});
|
|
917
|
-
}, [e, t]), /* @__PURE__ */ h("div", { ref: n, className: "w-full abc-preview", "data-theme": t });
|
|
918
1034
|
};
|
|
919
1035
|
export {
|
|
920
1036
|
G as ABC_ACCIDENTAL_PATTERN,
|
|
921
|
-
|
|
1037
|
+
D as ABC_ANNOTATION_PATTERN,
|
|
922
1038
|
z as ABC_BAR_PATTERN,
|
|
923
|
-
|
|
924
|
-
|
|
1039
|
+
se as ABC_BROKEN_RHYTHM_PATTERN,
|
|
1040
|
+
X as ABC_CHORD_BRACKET_PATTERN,
|
|
925
1041
|
q as ABC_CHORD_SYMBOL_PATTERN,
|
|
926
|
-
|
|
1042
|
+
Ae as ABC_COMMANDS,
|
|
927
1043
|
le as ABC_COMMENT_PATTERN,
|
|
928
1044
|
ee as ABC_DECORATION_PATTERN,
|
|
929
|
-
|
|
930
|
-
|
|
1045
|
+
R as ABC_DURATION_PATTERN,
|
|
1046
|
+
w as ABC_FIELD_PATTERN,
|
|
931
1047
|
te as ABC_GRACE_NOTE_PATTERN,
|
|
932
|
-
|
|
1048
|
+
re as ABC_INLINE_FIELD_PATTERN,
|
|
933
1049
|
E as ABC_NOTE_PATTERN,
|
|
934
1050
|
Q as ABC_OCTAVE_PATTERN,
|
|
935
1051
|
Z as ABC_ORNAMENT_PATTERN,
|
|
936
1052
|
O as ABC_REST_PATTERN,
|
|
937
|
-
|
|
1053
|
+
Y as ABC_SLUR_PATTERN,
|
|
938
1054
|
Ne as ABC_SUGGESTIONS,
|
|
939
1055
|
$ as ABC_TIE_PATTERN,
|
|
940
|
-
|
|
1056
|
+
J as ABC_TUPLET_PATTERN,
|
|
941
1057
|
ne as ABC_VOLTA_BRACKET_PATTERN,
|
|
942
|
-
|
|
943
|
-
Re as AbcPreview,
|
|
1058
|
+
Pe as AbcEditor,
|
|
944
1059
|
we as SuggestionList,
|
|
945
|
-
|
|
946
|
-
|
|
1060
|
+
S as highlightAbc,
|
|
1061
|
+
Ce as useAbcAutoComplete,
|
|
947
1062
|
V as useLineNumbers,
|
|
948
|
-
|
|
1063
|
+
Se as validateAbc
|
|
949
1064
|
};
|