@ovnonvo/abc-editor 0.3.2 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abc-editor.cjs.js +16 -15
- package/dist/abc-editor.es.js +577 -517
- package/dist/src/components/AbcEditor.d.ts.map +1 -1
- package/dist/src/types/abc.d.ts.map +1 -1
- package/dist/src/utils/highlightAbc.d.ts.map +1 -1
- package/dist/src/utils/validateAbc.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/abc-editor.es.js
CHANGED
|
@@ -1,303 +1,307 @@
|
|
|
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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-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}}.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}.hidden{display:none}.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-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\\.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)}.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)}.break-all{word-break:break-all}.text-slate-200{color:var(--color-slate-200)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.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)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-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)}.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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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
|
|
3
|
-
import { useState as
|
|
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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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-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}}.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}.hidden{display:none}.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-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)}.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)}.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)}.break-all{word-break:break-all}.text-slate-200{color:var(--color-slate-200)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.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)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-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)}.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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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 h, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import { useState as R, useCallback as I, useEffect as P, useRef as w, useMemo as V } from "react";
|
|
4
4
|
const G = (e) => e.split(`
|
|
5
|
-
`).map((
|
|
6
|
-
`),
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
5
|
+
`).map((t, r) => r + 1).join(`
|
|
6
|
+
`), S = /^([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]:)(.*)$/, E = /[A-Ga-g]/, z = /[\^_=]/, Q = /[',]/, q = /\|[:|\]]?|:?\|/, X = /[\\[\]]/, Y = /[()]/, J = /^\(\d+$/, O = /^(\/+|\d+(\/\d+)?|\/?\d+(\/\d+)?)$/, D = /[zZx]/, M = /^\.?-$/, Z = /[.~HLMOPSTuv]/, ee = /^"[^"]*"$/, W = /^"[\^_<>@][^"]*"$/, te = /^![^!]+!$/, ne = /^\{[^}]+\}$/, re = /^\[\d+$/, se = /^\[([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]):([^\]]*)\]$/, le = /^[<>]+$/, oe = /^%.*$/, p = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), ae = (e, n) => {
|
|
7
|
+
const t = e[n];
|
|
8
|
+
if (t !== "|" && t !== ":")
|
|
9
9
|
return null;
|
|
10
|
-
let
|
|
11
|
-
for (;
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
html: `<span class="${
|
|
15
|
-
nextIndex:
|
|
10
|
+
let r = t, s = n + 1;
|
|
11
|
+
for (; s < e.length && (e[s] === "|" || e[s] === ":" || e[s] === "]"); )
|
|
12
|
+
r += e[s], s++;
|
|
13
|
+
return q.test(r) ? {
|
|
14
|
+
html: `<span class="${r === "||" ? "abc-bar-double" : "abc-bar"}">${p(r)}</span>`,
|
|
15
|
+
nextIndex: s
|
|
16
16
|
} : null;
|
|
17
|
-
}, ie = (e,
|
|
18
|
-
const
|
|
19
|
-
return z.test(
|
|
20
|
-
html: `<span class="abc-accidental">${
|
|
21
|
-
nextIndex:
|
|
17
|
+
}, ie = (e, n) => {
|
|
18
|
+
const t = e[n];
|
|
19
|
+
return z.test(t) ? {
|
|
20
|
+
html: `<span class="abc-accidental">${p(t)}</span>`,
|
|
21
|
+
nextIndex: n + 1
|
|
22
22
|
} : null;
|
|
23
|
-
}, ce = (e,
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
23
|
+
}, ce = (e, n, t) => {
|
|
24
|
+
const r = e[n];
|
|
25
|
+
if (!Y.test(r))
|
|
26
26
|
return null;
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
let
|
|
30
|
-
for (;
|
|
31
|
-
|
|
32
|
-
if (
|
|
27
|
+
if (r === "(") {
|
|
28
|
+
if (n + 1 < e.length && /\d/.test(e[n + 1])) {
|
|
29
|
+
let s = r, o = n + 1;
|
|
30
|
+
for (; o < e.length && /\d/.test(e[o]); )
|
|
31
|
+
s += e[o], o++;
|
|
32
|
+
if (J.test(s))
|
|
33
33
|
return {
|
|
34
|
-
html: `<span class="abc-tuplet">${
|
|
35
|
-
nextIndex:
|
|
34
|
+
html: `<span class="abc-tuplet">${p(s)}</span>`,
|
|
35
|
+
nextIndex: o,
|
|
36
36
|
slurLevelDelta: 0
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
|
-
html: `<span class="abc-slur abc-slur-level-${
|
|
41
|
-
nextIndex:
|
|
40
|
+
html: `<span class="abc-slur abc-slur-level-${t % 5}">${p(r)}</span>`,
|
|
41
|
+
nextIndex: n + 1,
|
|
42
42
|
slurLevelDelta: 1
|
|
43
43
|
};
|
|
44
|
-
} else if (
|
|
44
|
+
} else if (r === ")")
|
|
45
45
|
return {
|
|
46
|
-
html: `<span class="abc-slur abc-slur-level-${Math.max(0,
|
|
47
|
-
nextIndex:
|
|
46
|
+
html: `<span class="abc-slur abc-slur-level-${Math.max(0, t - 1) % 5}">${p(r)}</span>`,
|
|
47
|
+
nextIndex: n + 1,
|
|
48
48
|
slurLevelDelta: -1
|
|
49
49
|
};
|
|
50
50
|
return null;
|
|
51
|
-
}, ue = (e,
|
|
52
|
-
const
|
|
53
|
-
if (!E.test(
|
|
51
|
+
}, ue = (e, n) => {
|
|
52
|
+
const t = e[n];
|
|
53
|
+
if (!E.test(t))
|
|
54
54
|
return null;
|
|
55
|
-
let
|
|
56
|
-
for (;
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
55
|
+
let r = `<span class="abc-note">${p(t)}</span>`, s = n + 1, o = "";
|
|
56
|
+
for (; s < e.length && Q.test(e[s]); )
|
|
57
|
+
o += e[s], s++;
|
|
58
|
+
if (o) {
|
|
59
|
+
const u = o[0] === "'" ? "abc-octave-high" : "abc-octave-low";
|
|
60
|
+
r += `<span class="${u}">${p(o)}</span>`;
|
|
61
61
|
}
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
let l = "";
|
|
63
|
+
const c = s;
|
|
64
|
+
if (s < e.length && (e[s] === "/" || /\d/.test(e[s]))) {
|
|
65
|
+
for (e[s] === "/" && (l += e[s], s++); s < e.length && /\d/.test(e[s]); )
|
|
66
|
+
l += e[s], s++;
|
|
67
|
+
if (s < e.length && e[s] === "/")
|
|
68
|
+
for (l += e[s], s++; s < e.length && /\d/.test(e[s]); )
|
|
69
|
+
l += e[s], s++;
|
|
70
|
+
if (l && O.test(l)) {
|
|
71
|
+
let u = "abc-duration";
|
|
72
|
+
l.startsWith("/") ? u += " abc-duration-short" : l.includes("/") ? u += " abc-duration-fraction" : u += " abc-duration-long", r += `<span class="${u}">${p(l)}</span>`;
|
|
73
|
+
} else
|
|
74
|
+
s = c;
|
|
73
75
|
}
|
|
74
76
|
return {
|
|
75
|
-
html:
|
|
76
|
-
nextIndex:
|
|
77
|
+
html: r,
|
|
78
|
+
nextIndex: s
|
|
77
79
|
};
|
|
78
|
-
}, de = (e,
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
html: `<span class="abc-chord">${
|
|
82
|
-
nextIndex:
|
|
80
|
+
}, de = (e, n) => {
|
|
81
|
+
const t = e[n];
|
|
82
|
+
return X.test(t) ? {
|
|
83
|
+
html: `<span class="abc-chord">${p(t)}</span>`,
|
|
84
|
+
nextIndex: n + 1
|
|
83
85
|
} : null;
|
|
84
|
-
}, pe = (e,
|
|
85
|
-
const
|
|
86
|
-
if (!D.test(
|
|
86
|
+
}, pe = (e, n) => {
|
|
87
|
+
const t = e[n];
|
|
88
|
+
if (!D.test(t))
|
|
87
89
|
return null;
|
|
88
|
-
let
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
let s = `<span class="${t === "x" ? "abc-rest-invisible" : "abc-rest"}">${p(t)}</span>`, o = n + 1, l = "";
|
|
91
|
+
const c = o;
|
|
92
|
+
if (o < e.length && (e[o] === "/" || /\d/.test(e[o]))) {
|
|
93
|
+
for (e[o] === "/" && (l += e[o], o++); o < e.length && /\d/.test(e[o]); )
|
|
94
|
+
l += e[o], o++;
|
|
95
|
+
if (o < e.length && e[o] === "/")
|
|
96
|
+
for (l += e[o], o++; o < e.length && /\d/.test(e[o]); )
|
|
97
|
+
l += e[o], o++;
|
|
98
|
+
if (l && O.test(l)) {
|
|
99
|
+
let u = "abc-duration";
|
|
100
|
+
l.startsWith("/") ? u += " abc-duration-short" : l.includes("/") ? u += " abc-duration-fraction" : u += " abc-duration-long", s += `<span class="${u}">${p(l)}</span>`;
|
|
101
|
+
} else
|
|
102
|
+
o = c;
|
|
99
103
|
}
|
|
100
104
|
return {
|
|
101
|
-
html:
|
|
102
|
-
nextIndex:
|
|
105
|
+
html: s,
|
|
106
|
+
nextIndex: o
|
|
103
107
|
};
|
|
104
|
-
}, he = (e,
|
|
105
|
-
const
|
|
106
|
-
return
|
|
107
|
-
html: `<span class="abc-tie abc-tie-dotted">${
|
|
108
|
-
nextIndex:
|
|
109
|
-
} :
|
|
110
|
-
html: `<span class="abc-tie">${
|
|
111
|
-
nextIndex:
|
|
108
|
+
}, he = (e, n) => {
|
|
109
|
+
const t = e[n];
|
|
110
|
+
return t === "." && n + 1 < e.length && e[n + 1] === "-" && M.test(".-") ? {
|
|
111
|
+
html: `<span class="abc-tie abc-tie-dotted">${p(".-")}</span>`,
|
|
112
|
+
nextIndex: n + 2
|
|
113
|
+
} : t === "-" && M.test(t) ? {
|
|
114
|
+
html: `<span class="abc-tie">${p(t)}</span>`,
|
|
115
|
+
nextIndex: n + 1
|
|
112
116
|
} : null;
|
|
113
|
-
}, fe = (e,
|
|
114
|
-
const
|
|
115
|
-
return !
|
|
116
|
-
html: `<span class="abc-ornament">${
|
|
117
|
-
nextIndex:
|
|
117
|
+
}, fe = (e, n) => {
|
|
118
|
+
const t = e[n];
|
|
119
|
+
return !Z.test(t) || t === "." && n + 1 < e.length && e[n + 1] === "-" ? null : {
|
|
120
|
+
html: `<span class="abc-ornament">${p(t)}</span>`,
|
|
121
|
+
nextIndex: n + 1
|
|
118
122
|
};
|
|
119
|
-
}, ge = (e,
|
|
120
|
-
if (e[
|
|
123
|
+
}, ge = (e, n) => {
|
|
124
|
+
if (e[n] !== '"')
|
|
121
125
|
return null;
|
|
122
|
-
let
|
|
123
|
-
for (;
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
+
let r = n + 1;
|
|
127
|
+
for (; r < e.length && e[r] !== '"'; )
|
|
128
|
+
r++;
|
|
129
|
+
if (r >= e.length)
|
|
126
130
|
return null;
|
|
127
|
-
const
|
|
128
|
-
return W.test(
|
|
129
|
-
html: `<span class="abc-annotation">${
|
|
130
|
-
nextIndex:
|
|
131
|
+
const s = e.substring(n, r + 1);
|
|
132
|
+
return W.test(s) ? {
|
|
133
|
+
html: `<span class="abc-annotation">${p(s)}</span>`,
|
|
134
|
+
nextIndex: r + 1
|
|
131
135
|
} : null;
|
|
132
|
-
}, me = (e,
|
|
133
|
-
if (e[
|
|
136
|
+
}, me = (e, n) => {
|
|
137
|
+
if (e[n] !== '"')
|
|
134
138
|
return null;
|
|
135
|
-
let
|
|
136
|
-
for (;
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
+
let r = n + 1;
|
|
140
|
+
for (; r < e.length && e[r] !== '"'; )
|
|
141
|
+
r++;
|
|
142
|
+
if (r >= e.length)
|
|
139
143
|
return null;
|
|
140
|
-
const
|
|
141
|
-
return W.test(
|
|
142
|
-
html: `<span class="abc-chord-symbol">${
|
|
143
|
-
nextIndex:
|
|
144
|
+
const s = e.substring(n, r + 1);
|
|
145
|
+
return W.test(s) || !ee.test(s) ? null : {
|
|
146
|
+
html: `<span class="abc-chord-symbol">${p(s)}</span>`,
|
|
147
|
+
nextIndex: r + 1
|
|
144
148
|
};
|
|
145
|
-
}, be = (e,
|
|
146
|
-
if (e[
|
|
149
|
+
}, be = (e, n) => {
|
|
150
|
+
if (e[n] !== "!")
|
|
147
151
|
return null;
|
|
148
|
-
let
|
|
149
|
-
for (;
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
+
let r = n + 1;
|
|
153
|
+
for (; r < e.length && e[r] !== "!"; )
|
|
154
|
+
r++;
|
|
155
|
+
if (r >= e.length)
|
|
152
156
|
return null;
|
|
153
|
-
const
|
|
154
|
-
return te.test(
|
|
155
|
-
html: `<span class="abc-decoration">${
|
|
156
|
-
nextIndex:
|
|
157
|
+
const s = e.substring(n, r + 1);
|
|
158
|
+
return te.test(s) ? {
|
|
159
|
+
html: `<span class="abc-decoration">${p(s)}</span>`,
|
|
160
|
+
nextIndex: r + 1
|
|
157
161
|
} : null;
|
|
158
|
-
}, ve = (e,
|
|
159
|
-
if (e[
|
|
162
|
+
}, ve = (e, n) => {
|
|
163
|
+
if (e[n] !== "{")
|
|
160
164
|
return null;
|
|
161
|
-
let
|
|
162
|
-
for (;
|
|
163
|
-
|
|
164
|
-
if (
|
|
165
|
+
let r = n + 1;
|
|
166
|
+
for (; r < e.length && e[r] !== "}"; )
|
|
167
|
+
r++;
|
|
168
|
+
if (r >= e.length)
|
|
165
169
|
return null;
|
|
166
|
-
const
|
|
167
|
-
return ne.test(
|
|
168
|
-
html: `<span class="abc-grace-note">${
|
|
169
|
-
nextIndex:
|
|
170
|
+
const s = e.substring(n, r + 1);
|
|
171
|
+
return ne.test(s) ? {
|
|
172
|
+
html: `<span class="abc-grace-note">${p(s)}</span>`,
|
|
173
|
+
nextIndex: r + 1
|
|
170
174
|
} : null;
|
|
171
|
-
}, xe = (e,
|
|
172
|
-
if (e[
|
|
175
|
+
}, xe = (e, n) => {
|
|
176
|
+
if (e[n] !== "[")
|
|
173
177
|
return null;
|
|
174
|
-
let
|
|
175
|
-
for (;
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
+
let r = n + 1;
|
|
179
|
+
for (; r < e.length && e[r] !== "]"; )
|
|
180
|
+
r++;
|
|
181
|
+
if (r >= e.length)
|
|
178
182
|
return null;
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
183
|
+
const o = e.substring(n, r + 1).match(se);
|
|
184
|
+
if (!o)
|
|
181
185
|
return null;
|
|
182
|
-
const [,
|
|
186
|
+
const [, l, c] = o;
|
|
183
187
|
return {
|
|
184
|
-
html: `<span class="abc-inline-field-bracket">[</span><span class="abc-inline-field-key">${
|
|
185
|
-
nextIndex:
|
|
188
|
+
html: `<span class="abc-inline-field-bracket">[</span><span class="abc-inline-field-key">${p(l)}:</span><span class="abc-inline-field-value">${p(c)}</span><span class="abc-inline-field-bracket">]</span>`,
|
|
189
|
+
nextIndex: r + 1
|
|
186
190
|
};
|
|
187
|
-
}, ye = (e,
|
|
188
|
-
if (e[
|
|
191
|
+
}, ye = (e, n) => {
|
|
192
|
+
if (e[n] !== "[" || n + 1 >= e.length || !/\d/.test(e[n + 1]))
|
|
189
193
|
return null;
|
|
190
|
-
let
|
|
191
|
-
for (;
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
return re.test(
|
|
195
|
-
html: `<span class="abc-volta-bracket">${
|
|
196
|
-
nextIndex:
|
|
194
|
+
let r = n + 1;
|
|
195
|
+
for (; r < e.length && /\d/.test(e[r]); )
|
|
196
|
+
r++;
|
|
197
|
+
const s = e.substring(n, r);
|
|
198
|
+
return re.test(s) ? {
|
|
199
|
+
html: `<span class="abc-volta-bracket">${p(s)}</span>`,
|
|
200
|
+
nextIndex: r
|
|
197
201
|
} : null;
|
|
198
|
-
}, Be = (e,
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
202
|
+
}, Be = (e, n) => {
|
|
203
|
+
const t = e[n];
|
|
204
|
+
if (t !== ">" && t !== "<")
|
|
201
205
|
return null;
|
|
202
|
-
let
|
|
203
|
-
for (;
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
return
|
|
207
|
-
html: `<span class="abc-broken-rhythm">${
|
|
208
|
-
nextIndex:
|
|
206
|
+
let r = n + 1;
|
|
207
|
+
for (; r < e.length && e[r] === t; )
|
|
208
|
+
r++;
|
|
209
|
+
const s = e.substring(n, r);
|
|
210
|
+
return le.test(s) ? {
|
|
211
|
+
html: `<span class="abc-broken-rhythm">${p(s)}</span>`,
|
|
212
|
+
nextIndex: r
|
|
209
213
|
} : null;
|
|
210
214
|
}, Te = (e) => {
|
|
211
|
-
let
|
|
212
|
-
for (;
|
|
213
|
-
const
|
|
214
|
-
if (
|
|
215
|
-
|
|
215
|
+
let n = "", t = 0, r = 0;
|
|
216
|
+
for (; t < e.length; ) {
|
|
217
|
+
const s = ae(e, t);
|
|
218
|
+
if (s) {
|
|
219
|
+
n += s.html, t = s.nextIndex;
|
|
216
220
|
continue;
|
|
217
221
|
}
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
220
|
-
|
|
222
|
+
const o = be(e, t);
|
|
223
|
+
if (o) {
|
|
224
|
+
n += o.html, t = o.nextIndex;
|
|
221
225
|
continue;
|
|
222
226
|
}
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
|
|
227
|
+
const l = ve(e, t);
|
|
228
|
+
if (l) {
|
|
229
|
+
n += l.html, t = l.nextIndex;
|
|
226
230
|
continue;
|
|
227
231
|
}
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
|
|
232
|
+
const c = ie(e, t);
|
|
233
|
+
if (c) {
|
|
234
|
+
n += c.html, t = c.nextIndex;
|
|
231
235
|
continue;
|
|
232
236
|
}
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
|
|
237
|
+
const u = fe(e, t);
|
|
238
|
+
if (u) {
|
|
239
|
+
n += u.html, t = u.nextIndex;
|
|
236
240
|
continue;
|
|
237
241
|
}
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
|
|
242
|
+
const f = ge(e, t);
|
|
243
|
+
if (f) {
|
|
244
|
+
n += f.html, t = f.nextIndex;
|
|
241
245
|
continue;
|
|
242
246
|
}
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
|
|
247
|
+
const i = me(e, t);
|
|
248
|
+
if (i) {
|
|
249
|
+
n += i.html, t = i.nextIndex;
|
|
246
250
|
continue;
|
|
247
251
|
}
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
|
|
252
|
+
const a = ce(e, t, r);
|
|
253
|
+
if (a) {
|
|
254
|
+
n += a.html, t = a.nextIndex, a.slurLevelDelta && (r += a.slurLevelDelta);
|
|
251
255
|
continue;
|
|
252
256
|
}
|
|
253
|
-
const
|
|
254
|
-
if (
|
|
255
|
-
|
|
257
|
+
const d = pe(e, t);
|
|
258
|
+
if (d) {
|
|
259
|
+
n += d.html, t = d.nextIndex;
|
|
256
260
|
continue;
|
|
257
261
|
}
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
|
|
262
|
+
const m = ue(e, t);
|
|
263
|
+
if (m) {
|
|
264
|
+
n += m.html, t = m.nextIndex;
|
|
261
265
|
continue;
|
|
262
266
|
}
|
|
263
|
-
const y = Be(e,
|
|
267
|
+
const y = Be(e, t);
|
|
264
268
|
if (y) {
|
|
265
|
-
|
|
269
|
+
n += y.html, t = y.nextIndex;
|
|
266
270
|
continue;
|
|
267
271
|
}
|
|
268
|
-
const
|
|
269
|
-
if (
|
|
270
|
-
|
|
272
|
+
const b = xe(e, t);
|
|
273
|
+
if (b) {
|
|
274
|
+
n += b.html, t = b.nextIndex;
|
|
271
275
|
continue;
|
|
272
276
|
}
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
|
|
277
|
+
const v = ye(e, t);
|
|
278
|
+
if (v) {
|
|
279
|
+
n += v.html, t = v.nextIndex;
|
|
276
280
|
continue;
|
|
277
281
|
}
|
|
278
|
-
const B = de(e,
|
|
282
|
+
const B = de(e, t);
|
|
279
283
|
if (B) {
|
|
280
|
-
|
|
284
|
+
n += B.html, t = B.nextIndex;
|
|
281
285
|
continue;
|
|
282
286
|
}
|
|
283
|
-
const T = he(e,
|
|
287
|
+
const T = he(e, t);
|
|
284
288
|
if (T) {
|
|
285
|
-
|
|
289
|
+
n += T.html, t = T.nextIndex;
|
|
286
290
|
continue;
|
|
287
291
|
}
|
|
288
|
-
|
|
292
|
+
n += `<span class="abc-text">${p(e[t])}</span>`, t++;
|
|
289
293
|
}
|
|
290
|
-
return
|
|
294
|
+
return n;
|
|
291
295
|
}, $ = (e) => e.split(`
|
|
292
|
-
`).map((
|
|
293
|
-
if (
|
|
294
|
-
return `<span class="abc-comment">${
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const [,
|
|
298
|
-
return
|
|
296
|
+
`).map((t) => {
|
|
297
|
+
if (oe.test(t))
|
|
298
|
+
return `<span class="abc-comment">${p(t)}</span>`;
|
|
299
|
+
const r = t.match(S);
|
|
300
|
+
if (r) {
|
|
301
|
+
const [, s, o] = r;
|
|
302
|
+
return s === "w:" || s === "W:" ? `<span class="abc-lyrics-key">${p(s)}</span><span class="abc-lyrics-value">${p(o)}</span>` : `<span class="abc-meta-key">${p(s)}</span><span class="abc-meta-value">${p(o)}</span>`;
|
|
299
303
|
}
|
|
300
|
-
return Te(
|
|
304
|
+
return Te(t);
|
|
301
305
|
}).join(`
|
|
302
306
|
`), Ae = {
|
|
303
307
|
"X:": [
|
|
@@ -445,7 +449,7 @@ const G = (e) => e.split(`
|
|
|
445
449
|
{ value: "Your Name", description: "Transcriber name" },
|
|
446
450
|
{ value: "ABC transcription", description: "Transcription note" }
|
|
447
451
|
]
|
|
448
|
-
},
|
|
452
|
+
}, Ie = (e) => Ae[e] || [], Ne = [
|
|
449
453
|
{
|
|
450
454
|
value: "/header",
|
|
451
455
|
description: "Insert basic ABC header template",
|
|
@@ -456,14 +460,14 @@ L:1/4
|
|
|
456
460
|
K:C
|
|
457
461
|
`
|
|
458
462
|
}
|
|
459
|
-
],
|
|
460
|
-
(
|
|
463
|
+
], Ce = (e) => e.startsWith("/") ? Ne.filter(
|
|
464
|
+
(n) => n.value.toLowerCase().startsWith(e.toLowerCase())
|
|
461
465
|
) : [], we = ({
|
|
462
466
|
value: e,
|
|
463
|
-
textareaRef:
|
|
464
|
-
onChange:
|
|
467
|
+
textareaRef: n,
|
|
468
|
+
onChange: t
|
|
465
469
|
}) => {
|
|
466
|
-
const [
|
|
470
|
+
const [r, s] = R({
|
|
467
471
|
isOpen: !1,
|
|
468
472
|
suggestions: [],
|
|
469
473
|
selectedIndex: 0,
|
|
@@ -471,281 +475,334 @@ K:C
|
|
|
471
475
|
fieldKey: null,
|
|
472
476
|
inputValue: "",
|
|
473
477
|
isCommand: !1
|
|
474
|
-
}),
|
|
475
|
-
if (!
|
|
478
|
+
}), o = I(() => {
|
|
479
|
+
if (!n.current)
|
|
476
480
|
return null;
|
|
477
|
-
const
|
|
478
|
-
`),
|
|
479
|
-
if (
|
|
481
|
+
const i = n.current.selectionStart, a = e.substring(0, i).split(`
|
|
482
|
+
`), d = a[a.length - 1];
|
|
483
|
+
if (d.startsWith("/"))
|
|
480
484
|
return {
|
|
481
485
|
fieldKey: null,
|
|
482
|
-
inputValue:
|
|
483
|
-
line:
|
|
484
|
-
lineStartPos:
|
|
486
|
+
inputValue: d,
|
|
487
|
+
line: d,
|
|
488
|
+
lineStartPos: i - d.length,
|
|
485
489
|
isCommand: !0
|
|
486
490
|
};
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
const [, y,
|
|
491
|
+
const m = d.match(S);
|
|
492
|
+
if (m) {
|
|
493
|
+
const [, y, b] = m;
|
|
490
494
|
return {
|
|
491
495
|
fieldKey: y,
|
|
492
|
-
inputValue:
|
|
493
|
-
line:
|
|
494
|
-
lineStartPos:
|
|
496
|
+
inputValue: b,
|
|
497
|
+
line: d,
|
|
498
|
+
lineStartPos: i - d.length,
|
|
495
499
|
isCommand: !1
|
|
496
500
|
};
|
|
497
501
|
}
|
|
498
502
|
return null;
|
|
499
|
-
}, [e,
|
|
500
|
-
if (!
|
|
503
|
+
}, [e, n]), l = I(() => {
|
|
504
|
+
if (!n.current)
|
|
501
505
|
return { top: 0, left: 0 };
|
|
502
|
-
const
|
|
503
|
-
`).length - 1, y = parseFloat(getComputedStyle(
|
|
504
|
-
return { top: (parseFloat(getComputedStyle(
|
|
505
|
-
}, [e,
|
|
506
|
-
|
|
507
|
-
const
|
|
508
|
-
if (!
|
|
509
|
-
|
|
506
|
+
const i = n.current, a = i.selectionStart, m = e.substring(0, a).split(`
|
|
507
|
+
`).length - 1, y = parseFloat(getComputedStyle(i).lineHeight) || 24;
|
|
508
|
+
return { top: (parseFloat(getComputedStyle(i).paddingTop) || 16) + (m + 1) * y - i.scrollTop, left: 60 };
|
|
509
|
+
}, [e, n]);
|
|
510
|
+
P(() => {
|
|
511
|
+
const i = o();
|
|
512
|
+
if (!i) {
|
|
513
|
+
s((d) => ({ ...d, isOpen: !1 }));
|
|
510
514
|
return;
|
|
511
515
|
}
|
|
512
|
-
let
|
|
513
|
-
if (
|
|
514
|
-
(
|
|
515
|
-
)),
|
|
516
|
-
const
|
|
517
|
-
|
|
516
|
+
let a = [];
|
|
517
|
+
if (i.isCommand ? a = Ce(i.inputValue) : i.fieldKey && (a = Ie(i.fieldKey).filter(
|
|
518
|
+
(m) => m.value.toLowerCase().startsWith(i.inputValue.toLowerCase())
|
|
519
|
+
)), a.length > 0) {
|
|
520
|
+
const d = l();
|
|
521
|
+
s({
|
|
518
522
|
isOpen: !0,
|
|
519
|
-
suggestions:
|
|
523
|
+
suggestions: a,
|
|
520
524
|
selectedIndex: 0,
|
|
521
|
-
position:
|
|
522
|
-
fieldKey:
|
|
523
|
-
inputValue:
|
|
524
|
-
isCommand:
|
|
525
|
+
position: d,
|
|
526
|
+
fieldKey: i.fieldKey,
|
|
527
|
+
inputValue: i.inputValue,
|
|
528
|
+
isCommand: i.isCommand
|
|
525
529
|
});
|
|
526
530
|
} else
|
|
527
|
-
|
|
528
|
-
}, [e,
|
|
529
|
-
const
|
|
530
|
-
(
|
|
531
|
-
if (!
|
|
531
|
+
s((d) => ({ ...d, isOpen: !1 }));
|
|
532
|
+
}, [e, o, l]);
|
|
533
|
+
const c = I(
|
|
534
|
+
(i) => {
|
|
535
|
+
if (!n.current)
|
|
532
536
|
return;
|
|
533
|
-
const
|
|
534
|
-
`),
|
|
535
|
-
let y,
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
y =
|
|
539
|
-
} else if (
|
|
540
|
-
const
|
|
541
|
-
y = B +
|
|
537
|
+
const a = n.current.selectionStart, d = e.substring(0, a).split(`
|
|
538
|
+
`), m = d[d.length - 1];
|
|
539
|
+
let y, b;
|
|
540
|
+
if (r.isCommand && i.template) {
|
|
541
|
+
const v = e.substring(0, a - m.length), B = e.substring(a);
|
|
542
|
+
y = v + i.template + B, b = v.length + i.template.length;
|
|
543
|
+
} else if (r.fieldKey) {
|
|
544
|
+
const v = r.fieldKey + i.value, B = e.substring(0, a - m.length), T = e.substring(a);
|
|
545
|
+
y = B + v + T, b = B.length + v.length;
|
|
542
546
|
} else
|
|
543
547
|
return;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}, 0),
|
|
548
|
+
t(y), setTimeout(() => {
|
|
549
|
+
n.current && (n.current.selectionStart = b, n.current.selectionEnd = b, n.current.focus());
|
|
550
|
+
}, 0), s((v) => ({ ...v, isOpen: !1 }));
|
|
547
551
|
},
|
|
548
|
-
[
|
|
549
|
-
),
|
|
550
|
-
(
|
|
551
|
-
if (
|
|
552
|
-
switch (
|
|
552
|
+
[n, r.fieldKey, r.isCommand, e, t]
|
|
553
|
+
), u = I(
|
|
554
|
+
(i) => {
|
|
555
|
+
if (r.isOpen)
|
|
556
|
+
switch (i.key) {
|
|
553
557
|
case "ArrowDown":
|
|
554
|
-
|
|
555
|
-
...
|
|
556
|
-
selectedIndex: Math.min(
|
|
558
|
+
i.preventDefault(), s((a) => ({
|
|
559
|
+
...a,
|
|
560
|
+
selectedIndex: Math.min(a.selectedIndex + 1, a.suggestions.length - 1)
|
|
557
561
|
}));
|
|
558
562
|
break;
|
|
559
563
|
case "ArrowUp":
|
|
560
|
-
|
|
561
|
-
...
|
|
562
|
-
selectedIndex: Math.max(
|
|
564
|
+
i.preventDefault(), s((a) => ({
|
|
565
|
+
...a,
|
|
566
|
+
selectedIndex: Math.max(a.selectedIndex - 1, 0)
|
|
563
567
|
}));
|
|
564
568
|
break;
|
|
565
569
|
case "Enter":
|
|
566
|
-
|
|
570
|
+
r.suggestions.length > 0 && (i.preventDefault(), c(r.suggestions[r.selectedIndex]));
|
|
567
571
|
break;
|
|
568
572
|
case "Escape":
|
|
569
|
-
|
|
573
|
+
i.preventDefault(), s((a) => ({ ...a, isOpen: !1 }));
|
|
570
574
|
break;
|
|
571
575
|
}
|
|
572
576
|
},
|
|
573
|
-
[
|
|
574
|
-
),
|
|
575
|
-
|
|
577
|
+
[r.isOpen, r.suggestions, r.selectedIndex, c]
|
|
578
|
+
), f = I((i) => {
|
|
579
|
+
s((a) => ({ ...a, selectedIndex: i }));
|
|
576
580
|
}, []);
|
|
577
581
|
return {
|
|
578
|
-
isOpen:
|
|
579
|
-
suggestions:
|
|
580
|
-
selectedIndex:
|
|
581
|
-
position:
|
|
582
|
-
handleKeyDown:
|
|
583
|
-
selectSuggestion:
|
|
584
|
-
handleMouseEnter:
|
|
582
|
+
isOpen: r.isOpen,
|
|
583
|
+
suggestions: r.suggestions,
|
|
584
|
+
selectedIndex: r.selectedIndex,
|
|
585
|
+
position: r.position,
|
|
586
|
+
handleKeyDown: u,
|
|
587
|
+
selectSuggestion: c,
|
|
588
|
+
handleMouseEnter: f
|
|
585
589
|
};
|
|
586
|
-
},
|
|
590
|
+
}, Se = ({
|
|
587
591
|
suggestions: e,
|
|
588
|
-
selectedIndex:
|
|
589
|
-
position:
|
|
590
|
-
onSelect:
|
|
591
|
-
onMouseEnter:
|
|
592
|
+
selectedIndex: n,
|
|
593
|
+
position: t,
|
|
594
|
+
onSelect: r,
|
|
595
|
+
onMouseEnter: s
|
|
592
596
|
}) => {
|
|
593
|
-
const
|
|
594
|
-
return
|
|
595
|
-
|
|
597
|
+
const o = w(null);
|
|
598
|
+
return P(() => {
|
|
599
|
+
o.current?.scrollIntoView({
|
|
596
600
|
block: "nearest",
|
|
597
601
|
behavior: "smooth"
|
|
598
602
|
});
|
|
599
|
-
}, [
|
|
603
|
+
}, [n]), e.length === 0 ? null : /* @__PURE__ */ h(
|
|
600
604
|
"div",
|
|
601
605
|
{
|
|
602
606
|
className: "absolute z-50 bg-slate-800 rounded-md shadow-xl overflow-hidden",
|
|
603
607
|
style: {
|
|
604
|
-
top: `${
|
|
605
|
-
left: `${
|
|
608
|
+
top: `${t.top}px`,
|
|
609
|
+
left: `${t.left}px`,
|
|
606
610
|
minWidth: "200px",
|
|
607
611
|
maxWidth: "400px",
|
|
608
612
|
maxHeight: "300px",
|
|
609
613
|
overflowY: "auto"
|
|
610
614
|
},
|
|
611
|
-
children: e.map((
|
|
615
|
+
children: e.map((l, c) => /* @__PURE__ */ x(
|
|
612
616
|
"div",
|
|
613
617
|
{
|
|
614
|
-
ref:
|
|
615
|
-
className: `px-3 py-2 cursor-pointer ${
|
|
616
|
-
onClick: () =>
|
|
617
|
-
onMouseEnter: () =>
|
|
618
|
+
ref: c === n ? o : null,
|
|
619
|
+
className: `px-3 py-2 cursor-pointer ${c === n ? "bg-blue-600 text-white" : "text-slate-200 hover:bg-slate-700"}`,
|
|
620
|
+
onClick: () => r(l),
|
|
621
|
+
onMouseEnter: () => s(c),
|
|
618
622
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
|
|
623
|
+
/* @__PURE__ */ h("div", { className: "font-mono text-sm", children: l.value }),
|
|
624
|
+
l.description && /* @__PURE__ */ h("div", { className: "text-xs opacity-75 mt-1", children: l.description })
|
|
621
625
|
]
|
|
622
626
|
},
|
|
623
|
-
`${
|
|
627
|
+
`${l.value}-${c}`
|
|
624
628
|
))
|
|
625
629
|
}
|
|
626
630
|
);
|
|
627
|
-
},
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
631
|
+
}, ke = (e) => {
|
|
632
|
+
const n = e.trim();
|
|
633
|
+
if (n === "C")
|
|
630
634
|
return { beatsPerMeasure: 4, beatUnit: 4 };
|
|
631
|
-
if (
|
|
635
|
+
if (n === "C|")
|
|
632
636
|
return { beatsPerMeasure: 2, beatUnit: 2 };
|
|
633
|
-
const
|
|
634
|
-
return
|
|
635
|
-
beatsPerMeasure: parseInt(
|
|
636
|
-
beatUnit: parseInt(
|
|
637
|
+
const t = n.match(/^(\d+)\/(\d+)$/);
|
|
638
|
+
return t ? {
|
|
639
|
+
beatsPerMeasure: parseInt(t[1], 10),
|
|
640
|
+
beatUnit: parseInt(t[2], 10)
|
|
637
641
|
} : { beatsPerMeasure: 4, beatUnit: 4 };
|
|
638
642
|
}, Le = (e) => {
|
|
639
|
-
const
|
|
640
|
-
return
|
|
643
|
+
const t = e.trim().match(/^(\d+)\/(\d+)$/);
|
|
644
|
+
return t ? parseInt(t[1], 10) / parseInt(t[2], 10) : 1 / 8;
|
|
641
645
|
}, Ee = (e) => {
|
|
642
|
-
const
|
|
646
|
+
const n = e.split(`
|
|
643
647
|
`);
|
|
644
|
-
let
|
|
645
|
-
for (const
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
const [,
|
|
649
|
-
|
|
648
|
+
let t = { beatsPerMeasure: 4, beatUnit: 4 }, r = 1 / 8;
|
|
649
|
+
for (const s of n) {
|
|
650
|
+
const o = s.match(S);
|
|
651
|
+
if (o) {
|
|
652
|
+
const [, l, c] = o;
|
|
653
|
+
l === "M:" ? t = ke(c) : l === "L:" && (r = Le(c));
|
|
650
654
|
}
|
|
651
655
|
}
|
|
652
|
-
return { meter:
|
|
656
|
+
return { meter: t, unitNoteLength: r };
|
|
653
657
|
}, _ = (e) => {
|
|
654
658
|
if (!e)
|
|
655
659
|
return 1;
|
|
660
|
+
if (/^\/+$/.test(e))
|
|
661
|
+
return 1 / Math.pow(2, e.length);
|
|
656
662
|
if (e.startsWith("/"))
|
|
657
663
|
return 1 / parseInt(e.substring(1), 10);
|
|
658
664
|
if (e.includes("/")) {
|
|
659
|
-
const [
|
|
660
|
-
return parseInt(
|
|
665
|
+
const [n, t] = e.split("/");
|
|
666
|
+
return parseInt(n, 10) / parseInt(t, 10);
|
|
661
667
|
}
|
|
662
668
|
return parseInt(e, 10);
|
|
663
|
-
}, Me = (e,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
669
|
+
}, Me = (e, n) => {
|
|
670
|
+
if (e[n] !== "(") return null;
|
|
671
|
+
let t = n + 1;
|
|
672
|
+
if (t >= e.length || !/\d/.test(e[t])) return null;
|
|
673
|
+
let r = "";
|
|
674
|
+
for (; t < e.length && /\d/.test(e[t]); )
|
|
675
|
+
r += e[t], t++;
|
|
676
|
+
const s = parseInt(r, 10);
|
|
677
|
+
let o;
|
|
678
|
+
s === 2 || s === 4 || s === 8 ? o = 3 : o = 2;
|
|
679
|
+
let l = s;
|
|
680
|
+
if (t < e.length && e[t] === ":") {
|
|
681
|
+
t++;
|
|
682
|
+
let c = "";
|
|
683
|
+
for (; t < e.length && /\d/.test(e[t]); )
|
|
684
|
+
c += e[t], t++;
|
|
685
|
+
if (c && (o = parseInt(c, 10)), t < e.length && e[t] === ":") {
|
|
686
|
+
t++;
|
|
687
|
+
let u = "";
|
|
688
|
+
for (; t < e.length && /\d/.test(e[t]); )
|
|
689
|
+
u += e[t], t++;
|
|
690
|
+
u && (l = parseInt(u, 10));
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return {
|
|
694
|
+
info: { p: s, q: o, remaining: l },
|
|
695
|
+
nextIndex: t
|
|
696
|
+
};
|
|
697
|
+
}, $e = (e, n) => {
|
|
698
|
+
let t = 0, r = 0, s = null;
|
|
699
|
+
for (; r < e.length; ) {
|
|
700
|
+
const o = e[r];
|
|
701
|
+
if (o === "\\") {
|
|
702
|
+
r++;
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (o === "(") {
|
|
706
|
+
const l = Me(e, r);
|
|
707
|
+
if (l) {
|
|
708
|
+
s = l.info, r = l.nextIndex;
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
r++;
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
667
714
|
if (E.test(o) || D.test(o)) {
|
|
668
|
-
let
|
|
669
|
-
for (;
|
|
670
|
-
|
|
671
|
-
let
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
for (
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
715
|
+
let l = r + 1;
|
|
716
|
+
for (; l < e.length && (e[l] === "'" || e[l] === ","); )
|
|
717
|
+
l++;
|
|
718
|
+
let c = "";
|
|
719
|
+
if (l < e.length && (e[l] === "/" || /\d/.test(e[l]))) {
|
|
720
|
+
const d = l;
|
|
721
|
+
for (; l < e.length && e[l] === "/"; )
|
|
722
|
+
l++;
|
|
723
|
+
for (; l < e.length && /\d/.test(e[l]); )
|
|
724
|
+
l++;
|
|
725
|
+
if (l < e.length && e[l] === "/")
|
|
726
|
+
for (l++; l < e.length && /\d/.test(e[l]); )
|
|
727
|
+
l++;
|
|
728
|
+
c = e.substring(d, l);
|
|
680
729
|
}
|
|
681
|
-
const
|
|
682
|
-
|
|
730
|
+
const u = _(c);
|
|
731
|
+
let f = n.unitNoteLength * u;
|
|
732
|
+
s && (f = f * s.q / s.p, s.remaining--, s.remaining <= 0 && (s = null));
|
|
733
|
+
const i = 1 / n.meter.beatUnit, a = f / i;
|
|
734
|
+
t += a, r = l;
|
|
683
735
|
} else if (o === "[") {
|
|
684
|
-
let
|
|
685
|
-
for (;
|
|
686
|
-
const
|
|
687
|
-
if (E.test(
|
|
688
|
-
let
|
|
689
|
-
for (;
|
|
690
|
-
|
|
691
|
-
|
|
736
|
+
let l = r + 1;
|
|
737
|
+
for (; l < e.length && e[l] !== "]"; ) {
|
|
738
|
+
const c = e[l];
|
|
739
|
+
if (E.test(c)) {
|
|
740
|
+
let u = l + 1;
|
|
741
|
+
for (; u < e.length && (e[u] === "'" || e[u] === ","); )
|
|
742
|
+
u++;
|
|
743
|
+
l = u;
|
|
692
744
|
} else
|
|
693
|
-
|
|
745
|
+
l++;
|
|
694
746
|
}
|
|
695
|
-
if (
|
|
696
|
-
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
for (
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
747
|
+
if (l < e.length && e[l] === "]") {
|
|
748
|
+
l++;
|
|
749
|
+
let c = "";
|
|
750
|
+
if (l < e.length && (e[l] === "/" || /\d/.test(e[l]))) {
|
|
751
|
+
const d = l;
|
|
752
|
+
for (; l < e.length && e[l] === "/"; )
|
|
753
|
+
l++;
|
|
754
|
+
for (; l < e.length && /\d/.test(e[l]); )
|
|
755
|
+
l++;
|
|
756
|
+
if (l < e.length && e[l] === "/")
|
|
757
|
+
for (l++; l < e.length && /\d/.test(e[l]); )
|
|
758
|
+
l++;
|
|
759
|
+
c = e.substring(d, l);
|
|
706
760
|
}
|
|
707
|
-
const
|
|
708
|
-
|
|
761
|
+
const u = _(c);
|
|
762
|
+
let f = n.unitNoteLength * u;
|
|
763
|
+
s && (f = f * s.q / s.p, s.remaining--, s.remaining <= 0 && (s = null));
|
|
764
|
+
const i = 1 / n.meter.beatUnit, a = f / i;
|
|
765
|
+
t += a;
|
|
709
766
|
}
|
|
710
|
-
|
|
767
|
+
r = l;
|
|
711
768
|
} else
|
|
712
|
-
|
|
769
|
+
r++;
|
|
713
770
|
}
|
|
714
|
-
return
|
|
715
|
-
},
|
|
716
|
-
const
|
|
717
|
-
`),
|
|
718
|
-
return
|
|
719
|
-
if (!(
|
|
720
|
-
let
|
|
721
|
-
const
|
|
722
|
-
let
|
|
723
|
-
|
|
724
|
-
if (
|
|
771
|
+
return t;
|
|
772
|
+
}, _e = (e) => {
|
|
773
|
+
const n = [], t = e.split(`
|
|
774
|
+
`), r = Ee(e);
|
|
775
|
+
return t.forEach((s, o) => {
|
|
776
|
+
if (!(s.trim().startsWith("%") || S.test(s)) && s.includes("|")) {
|
|
777
|
+
let l = 0;
|
|
778
|
+
const c = s.split("|");
|
|
779
|
+
let u = 0;
|
|
780
|
+
c.forEach((f, i) => {
|
|
781
|
+
if (i === c.length - 1 && f.trim() === "")
|
|
725
782
|
return;
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
|
|
783
|
+
const a = f.trim();
|
|
784
|
+
if (a.startsWith(":") || a.startsWith("[") || a === "") {
|
|
785
|
+
l += f.length + 1;
|
|
729
786
|
return;
|
|
730
787
|
}
|
|
731
|
-
const
|
|
732
|
-
if (Math.abs(
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
line:
|
|
736
|
-
measureIndex:
|
|
737
|
-
startCol:
|
|
738
|
-
endCol:
|
|
739
|
-
expected:
|
|
740
|
-
actual:
|
|
741
|
-
message: `Expected ${
|
|
788
|
+
const d = $e(a, r), m = r.meter.beatsPerMeasure;
|
|
789
|
+
if (Math.abs(d - m) > 0.01) {
|
|
790
|
+
const b = s.indexOf(a, l), v = b + a.length;
|
|
791
|
+
n.push({
|
|
792
|
+
line: o,
|
|
793
|
+
measureIndex: u,
|
|
794
|
+
startCol: b,
|
|
795
|
+
endCol: v,
|
|
796
|
+
expected: m,
|
|
797
|
+
actual: d,
|
|
798
|
+
message: `Expected ${m} beats, got ${d.toFixed(2)}`
|
|
742
799
|
});
|
|
743
800
|
}
|
|
744
|
-
|
|
801
|
+
u++, l += f.length + 1;
|
|
745
802
|
});
|
|
746
803
|
}
|
|
747
|
-
}),
|
|
748
|
-
},
|
|
804
|
+
}), n;
|
|
805
|
+
}, C = {
|
|
749
806
|
margin: 0,
|
|
750
807
|
padding: "16px",
|
|
751
808
|
border: "none",
|
|
@@ -770,9 +827,8 @@ K:C
|
|
|
770
827
|
boxSizing: "border-box",
|
|
771
828
|
WebkitFontSmoothing: "antialiased",
|
|
772
829
|
MozOsxFontSmoothing: "grayscale"
|
|
773
|
-
},
|
|
774
|
-
const
|
|
775
|
-
bg: "#1a1a1a",
|
|
830
|
+
}, Oe = ({ value: e, onChange: n, theme: t = "light" }) => {
|
|
831
|
+
const r = w(null), s = w(null), o = w(null), [l, c] = R(null), u = G(e), f = $(e), i = V(() => _e(e), [e]), a = t === "dark" ? {
|
|
776
832
|
editorBg: "#262626",
|
|
777
833
|
lineNumBg: "#0f0f0f",
|
|
778
834
|
lineNumBorder: "#2d2d2d",
|
|
@@ -789,7 +845,6 @@ K:C
|
|
|
789
845
|
errorHoverBg: "rgba(51, 65, 85, 0.4)",
|
|
790
846
|
errorItemBorder: "rgba(255, 255, 255, 0.05)"
|
|
791
847
|
} : {
|
|
792
|
-
bg: "#f8f9fa",
|
|
793
848
|
editorBg: "#ffffff",
|
|
794
849
|
lineNumBg: "#ffffff",
|
|
795
850
|
lineNumBorder: "#e5e7eb",
|
|
@@ -806,109 +861,112 @@ K:C
|
|
|
806
861
|
errorHoverBg: "rgba(254, 202, 202, 0.4)",
|
|
807
862
|
errorItemBorder: "rgba(220, 38, 38, 0.1)"
|
|
808
863
|
}, {
|
|
809
|
-
isOpen:
|
|
810
|
-
suggestions:
|
|
864
|
+
isOpen: d,
|
|
865
|
+
suggestions: m,
|
|
811
866
|
selectedIndex: y,
|
|
812
|
-
position:
|
|
813
|
-
handleKeyDown:
|
|
867
|
+
position: b,
|
|
868
|
+
handleKeyDown: v,
|
|
814
869
|
selectSuggestion: B,
|
|
815
870
|
handleMouseEnter: T
|
|
816
|
-
} = we({ value: e, textareaRef:
|
|
817
|
-
|
|
818
|
-
}, U = (
|
|
819
|
-
if (
|
|
871
|
+
} = we({ value: e, textareaRef: r, onChange: n }), H = () => {
|
|
872
|
+
r.current && s.current && o.current && (s.current.scrollTop = r.current.scrollTop, o.current.scrollTop = r.current.scrollTop);
|
|
873
|
+
}, U = (g) => {
|
|
874
|
+
if (r.current) {
|
|
820
875
|
const A = e.split(`
|
|
821
|
-
`),
|
|
822
|
-
`).length + (
|
|
823
|
-
|
|
876
|
+
`), N = A.slice(0, g.line).join(`
|
|
877
|
+
`).length + (g.line > 0 ? 1 : 0);
|
|
878
|
+
r.current.focus(), r.current.setSelectionRange(N, N), r.current.scrollTop = r.current.scrollHeight * (g.line / A.length);
|
|
824
879
|
}
|
|
825
880
|
};
|
|
826
|
-
return /* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
828
|
-
/* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ x("div", { className: "w-full h-full flex flex-col rounded-lg overflow-hidden shadow-lg", "data-theme": t, style: { backgroundColor: a.editorBg }, children: [
|
|
882
|
+
/* @__PURE__ */ x("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
883
|
+
/* @__PURE__ */ h(
|
|
829
884
|
"div",
|
|
830
885
|
{
|
|
831
|
-
ref:
|
|
832
|
-
className: "overflow-hidden
|
|
886
|
+
ref: s,
|
|
887
|
+
className: "overflow-hidden select-none",
|
|
833
888
|
style: {
|
|
834
|
-
|
|
889
|
+
...C,
|
|
890
|
+
backgroundColor: a.lineNumBg,
|
|
835
891
|
minWidth: "3rem",
|
|
836
|
-
borderRight: `1px solid ${l.lineNumBorder}`,
|
|
837
|
-
...I,
|
|
838
892
|
padding: "16px 8px 16px 8px",
|
|
839
|
-
color: "#6b7280"
|
|
893
|
+
color: "#6b7280",
|
|
894
|
+
borderRightColor: a.lineNumBorder,
|
|
895
|
+
borderRightStyle: "solid",
|
|
896
|
+
borderRightWidth: "1px"
|
|
840
897
|
},
|
|
841
|
-
children:
|
|
898
|
+
children: u.split(`
|
|
899
|
+
`).map((g, A) => /* @__PURE__ */ h("div", { style: { textAlign: "center" }, children: g }, A))
|
|
842
900
|
}
|
|
843
901
|
),
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ x("div", { className: "flex-1 relative", children: [
|
|
903
|
+
/* @__PURE__ */ h(
|
|
846
904
|
"div",
|
|
847
905
|
{
|
|
848
|
-
ref:
|
|
906
|
+
ref: o,
|
|
849
907
|
className: "absolute inset-0 overflow-hidden pointer-events-none",
|
|
850
908
|
style: {
|
|
851
|
-
...
|
|
852
|
-
backgroundColor:
|
|
853
|
-
opacity:
|
|
909
|
+
...C,
|
|
910
|
+
backgroundColor: a.editorBg,
|
|
911
|
+
opacity: l ? 0.3 : 1,
|
|
854
912
|
transition: "opacity 0.2s"
|
|
855
913
|
},
|
|
856
|
-
dangerouslySetInnerHTML: { __html:
|
|
914
|
+
dangerouslySetInnerHTML: { __html: f }
|
|
857
915
|
}
|
|
858
916
|
),
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
`),
|
|
862
|
-
return /* @__PURE__ */
|
|
917
|
+
l && (() => {
|
|
918
|
+
const g = e.split(`
|
|
919
|
+
`), N = (g[l.line] || "").substring(l.startCol, l.endCol), F = $(N);
|
|
920
|
+
return /* @__PURE__ */ h(
|
|
863
921
|
"div",
|
|
864
922
|
{
|
|
865
923
|
className: "absolute inset-0 overflow-hidden pointer-events-none",
|
|
866
924
|
style: {
|
|
867
|
-
...
|
|
925
|
+
...C,
|
|
868
926
|
backgroundColor: "transparent"
|
|
869
927
|
},
|
|
870
|
-
children:
|
|
871
|
-
if (L ===
|
|
872
|
-
const j =
|
|
873
|
-
return /* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
928
|
+
children: g.map((k, L) => {
|
|
929
|
+
if (L === l.line) {
|
|
930
|
+
const j = k.substring(0, l.startCol), K = k.substring(l.endCol);
|
|
931
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
932
|
+
/* @__PURE__ */ h("span", { style: { visibility: "hidden" }, children: j }),
|
|
933
|
+
/* @__PURE__ */ h(
|
|
876
934
|
"span",
|
|
877
935
|
{
|
|
878
936
|
style: {
|
|
879
|
-
backgroundColor:
|
|
937
|
+
backgroundColor: a.errorHighlight,
|
|
880
938
|
borderRadius: "2px",
|
|
881
939
|
padding: "1px 2px"
|
|
882
940
|
},
|
|
883
941
|
dangerouslySetInnerHTML: { __html: F }
|
|
884
942
|
}
|
|
885
943
|
),
|
|
886
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ h("span", { style: { visibility: "hidden" }, children: K })
|
|
887
945
|
] }, L);
|
|
888
946
|
}
|
|
889
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ h("div", { style: { visibility: "hidden" }, children: k || "" }, L);
|
|
890
948
|
})
|
|
891
949
|
}
|
|
892
950
|
);
|
|
893
951
|
})(),
|
|
894
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ h(
|
|
895
953
|
"textarea",
|
|
896
954
|
{
|
|
897
|
-
ref:
|
|
955
|
+
ref: r,
|
|
898
956
|
className: "absolute inset-0 w-full h-full resize-none",
|
|
899
957
|
style: {
|
|
900
|
-
...
|
|
958
|
+
...C,
|
|
901
959
|
backgroundColor: "transparent",
|
|
902
960
|
color: "transparent",
|
|
903
|
-
caretColor:
|
|
961
|
+
caretColor: a.caretColor,
|
|
904
962
|
// ブラウザ固有のスタイルをリセット
|
|
905
963
|
WebkitAppearance: "none",
|
|
906
964
|
appearance: "none"
|
|
907
965
|
},
|
|
908
966
|
value: e,
|
|
909
|
-
onChange: (
|
|
967
|
+
onChange: (g) => n(g.target.value),
|
|
910
968
|
onScroll: H,
|
|
911
|
-
onKeyDown:
|
|
969
|
+
onKeyDown: v,
|
|
912
970
|
spellCheck: !1,
|
|
913
971
|
autoCapitalize: "off",
|
|
914
972
|
autoComplete: "off",
|
|
@@ -916,44 +974,46 @@ K:C
|
|
|
916
974
|
placeholder: "Type /header to insert template..."
|
|
917
975
|
}
|
|
918
976
|
),
|
|
919
|
-
|
|
920
|
-
|
|
977
|
+
d && /* @__PURE__ */ h(
|
|
978
|
+
Se,
|
|
921
979
|
{
|
|
922
|
-
suggestions:
|
|
980
|
+
suggestions: m,
|
|
923
981
|
selectedIndex: y,
|
|
924
|
-
position:
|
|
982
|
+
position: b,
|
|
925
983
|
onSelect: B,
|
|
926
984
|
onMouseEnter: T
|
|
927
985
|
}
|
|
928
986
|
)
|
|
929
987
|
] })
|
|
930
988
|
] }),
|
|
931
|
-
|
|
932
|
-
/* @__PURE__ */
|
|
989
|
+
i.length > 0 && /* @__PURE__ */ x("div", { className: "flex", children: [
|
|
990
|
+
/* @__PURE__ */ h(
|
|
933
991
|
"div",
|
|
934
992
|
{
|
|
935
993
|
style: {
|
|
936
|
-
backgroundColor:
|
|
994
|
+
backgroundColor: a.lineNumBg,
|
|
937
995
|
minWidth: "3rem",
|
|
938
|
-
|
|
996
|
+
borderRightColor: a.lineNumBorder,
|
|
997
|
+
borderRightStyle: "solid",
|
|
998
|
+
borderRightWidth: "1px"
|
|
939
999
|
}
|
|
940
1000
|
}
|
|
941
1001
|
),
|
|
942
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ x(
|
|
943
1003
|
"div",
|
|
944
1004
|
{
|
|
945
1005
|
className: "flex-1 px-4 py-3 text-xs font-mono overflow-auto border-t",
|
|
946
1006
|
style: {
|
|
947
|
-
backgroundColor:
|
|
948
|
-
borderColor:
|
|
1007
|
+
backgroundColor: a.errorBg,
|
|
1008
|
+
borderColor: a.errorBorder,
|
|
949
1009
|
maxHeight: "12rem",
|
|
950
1010
|
scrollbarWidth: "thin",
|
|
951
|
-
scrollbarColor: `${
|
|
1011
|
+
scrollbarColor: `${a.errorIcon} transparent`
|
|
952
1012
|
},
|
|
953
1013
|
children: [
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
1015
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
1016
|
+
/* @__PURE__ */ x(
|
|
957
1017
|
"svg",
|
|
958
1018
|
{
|
|
959
1019
|
width: "14",
|
|
@@ -964,43 +1024,43 @@ K:C
|
|
|
964
1024
|
strokeWidth: "2",
|
|
965
1025
|
strokeLinecap: "round",
|
|
966
1026
|
strokeLinejoin: "round",
|
|
967
|
-
style: { color:
|
|
1027
|
+
style: { color: a.errorIcon },
|
|
968
1028
|
children: [
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ h("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" }),
|
|
1030
|
+
/* @__PURE__ */ h("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
1031
|
+
/* @__PURE__ */ h("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
972
1032
|
]
|
|
973
1033
|
}
|
|
974
1034
|
),
|
|
975
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ h("span", { className: "text-[11px] font-semibold uppercase tracking-wide", style: { color: a.errorHeader }, children: "Validation Issues" })
|
|
976
1036
|
] }),
|
|
977
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ h(
|
|
978
1038
|
"div",
|
|
979
1039
|
{
|
|
980
1040
|
className: "px-2 py-0.5 rounded-full text-[10px] font-bold",
|
|
981
1041
|
style: {
|
|
982
|
-
backgroundColor:
|
|
983
|
-
color:
|
|
1042
|
+
backgroundColor: a.errorBadgeBg,
|
|
1043
|
+
color: a.errorBadgeText
|
|
984
1044
|
},
|
|
985
|
-
children:
|
|
1045
|
+
children: i.length
|
|
986
1046
|
}
|
|
987
1047
|
)
|
|
988
1048
|
] }),
|
|
989
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ h("div", { className: "space-y-1", children: i.map((g, A) => /* @__PURE__ */ x(
|
|
990
1050
|
"div",
|
|
991
1051
|
{
|
|
992
1052
|
className: "flex items-start gap-3 px-3 py-2 rounded-md border cursor-pointer",
|
|
993
1053
|
style: {
|
|
994
|
-
backgroundColor:
|
|
995
|
-
borderColor:
|
|
1054
|
+
backgroundColor: l === g ? a.errorHoverBg : "transparent",
|
|
1055
|
+
borderColor: l === g ? a.errorIcon : a.errorItemBorder,
|
|
996
1056
|
transition: "all 0.15s ease-in-out",
|
|
997
|
-
transform:
|
|
1057
|
+
transform: l === g ? "translateX(2px)" : "translateX(0)"
|
|
998
1058
|
},
|
|
999
|
-
onMouseEnter: () =>
|
|
1000
|
-
onMouseLeave: () =>
|
|
1001
|
-
onClick: () => U(
|
|
1059
|
+
onMouseEnter: () => c(g),
|
|
1060
|
+
onMouseLeave: () => c(null),
|
|
1061
|
+
onClick: () => U(g),
|
|
1002
1062
|
children: [
|
|
1003
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ x(
|
|
1004
1064
|
"svg",
|
|
1005
1065
|
{
|
|
1006
1066
|
width: "16",
|
|
@@ -1012,34 +1072,34 @@ K:C
|
|
|
1012
1072
|
strokeLinecap: "round",
|
|
1013
1073
|
strokeLinejoin: "round",
|
|
1014
1074
|
className: "shrink-0 mt-0.5",
|
|
1015
|
-
style: { color:
|
|
1075
|
+
style: { color: a.errorIcon },
|
|
1016
1076
|
children: [
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ h("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1078
|
+
/* @__PURE__ */ h("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
1079
|
+
/* @__PURE__ */ h("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
1020
1080
|
]
|
|
1021
1081
|
}
|
|
1022
1082
|
),
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ x("div", { className: "flex-1 flex flex-col gap-1", children: [
|
|
1084
|
+
/* @__PURE__ */ h("div", { className: "flex items-baseline gap-2 flex-wrap", children: /* @__PURE__ */ x(
|
|
1025
1085
|
"span",
|
|
1026
1086
|
{
|
|
1027
1087
|
className: "font-semibold text-[11px] px-1.5 py-0.5 rounded",
|
|
1028
1088
|
style: {
|
|
1029
|
-
color:
|
|
1030
|
-
backgroundColor:
|
|
1089
|
+
color: a.errorLocation,
|
|
1090
|
+
backgroundColor: t === "dark" ? "rgba(34, 211, 238, 0.1)" : "rgba(8, 145, 178, 0.1)"
|
|
1031
1091
|
},
|
|
1032
1092
|
children: [
|
|
1033
1093
|
"Line ",
|
|
1034
|
-
|
|
1094
|
+
g.line + 1,
|
|
1035
1095
|
", Measure ",
|
|
1036
|
-
|
|
1096
|
+
g.measureIndex + 1
|
|
1037
1097
|
]
|
|
1038
1098
|
}
|
|
1039
1099
|
) }),
|
|
1040
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ h("span", { className: "text-[11px] leading-relaxed", style: { color: a.errorMessage }, children: g.message })
|
|
1041
1101
|
] }),
|
|
1042
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ x(
|
|
1043
1103
|
"svg",
|
|
1044
1104
|
{
|
|
1045
1105
|
width: "14",
|
|
@@ -1052,13 +1112,13 @@ K:C
|
|
|
1052
1112
|
strokeLinejoin: "round",
|
|
1053
1113
|
className: "shrink-0 mt-1 opacity-50",
|
|
1054
1114
|
style: {
|
|
1055
|
-
color:
|
|
1056
|
-
opacity:
|
|
1115
|
+
color: a.errorIcon,
|
|
1116
|
+
opacity: l === g ? 1 : 0.3,
|
|
1057
1117
|
transition: "opacity 0.15s ease-in-out"
|
|
1058
1118
|
},
|
|
1059
1119
|
children: [
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ h("line", { x1: "5", y1: "12", x2: "19", y2: "12" }),
|
|
1121
|
+
/* @__PURE__ */ h("polyline", { points: "12 5 19 12 12 19" })
|
|
1062
1122
|
]
|
|
1063
1123
|
}
|
|
1064
1124
|
)
|
|
@@ -1070,35 +1130,35 @@ K:C
|
|
|
1070
1130
|
}
|
|
1071
1131
|
)
|
|
1072
1132
|
] })
|
|
1073
|
-
] })
|
|
1133
|
+
] });
|
|
1074
1134
|
};
|
|
1075
1135
|
export {
|
|
1076
1136
|
z as ABC_ACCIDENTAL_PATTERN,
|
|
1077
1137
|
W as ABC_ANNOTATION_PATTERN,
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1138
|
+
q as ABC_BAR_PATTERN,
|
|
1139
|
+
le as ABC_BROKEN_RHYTHM_PATTERN,
|
|
1140
|
+
X as ABC_CHORD_BRACKET_PATTERN,
|
|
1081
1141
|
ee as ABC_CHORD_SYMBOL_PATTERN,
|
|
1082
|
-
|
|
1083
|
-
|
|
1142
|
+
Ne as ABC_COMMANDS,
|
|
1143
|
+
oe as ABC_COMMENT_PATTERN,
|
|
1084
1144
|
te as ABC_DECORATION_PATTERN,
|
|
1085
1145
|
O as ABC_DURATION_PATTERN,
|
|
1086
|
-
|
|
1146
|
+
S as ABC_FIELD_PATTERN,
|
|
1087
1147
|
ne as ABC_GRACE_NOTE_PATTERN,
|
|
1088
1148
|
se as ABC_INLINE_FIELD_PATTERN,
|
|
1089
1149
|
E as ABC_NOTE_PATTERN,
|
|
1090
1150
|
Q as ABC_OCTAVE_PATTERN,
|
|
1091
|
-
|
|
1151
|
+
Z as ABC_ORNAMENT_PATTERN,
|
|
1092
1152
|
D as ABC_REST_PATTERN,
|
|
1093
|
-
|
|
1153
|
+
Y as ABC_SLUR_PATTERN,
|
|
1094
1154
|
Ae as ABC_SUGGESTIONS,
|
|
1095
1155
|
M as ABC_TIE_PATTERN,
|
|
1096
|
-
|
|
1156
|
+
J as ABC_TUPLET_PATTERN,
|
|
1097
1157
|
re as ABC_VOLTA_BRACKET_PATTERN,
|
|
1098
|
-
|
|
1099
|
-
|
|
1158
|
+
Oe as AbcEditor,
|
|
1159
|
+
Se as SuggestionList,
|
|
1100
1160
|
$ as highlightAbc,
|
|
1101
1161
|
we as useAbcAutoComplete,
|
|
1102
1162
|
G as useLineNumbers,
|
|
1103
|
-
|
|
1163
|
+
_e as validateAbc
|
|
1104
1164
|
};
|