@ovnonvo/abc-editor 0.3.5 → 0.4.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 +16 -11
- package/dist/abc-editor.cjs.js +11 -16
- package/dist/abc-editor.es.js +1104 -1120
- package/dist/src/components/AbcEditor.d.ts.map +1 -1
- package/dist/src/utils/chamberAbc.d.ts +3 -0
- package/dist/src/utils/chamberAbc.d.ts.map +1 -0
- package/dist/src/utils/highlightAbc.d.ts +1 -21
- package/dist/src/utils/highlightAbc.d.ts.map +1 -1
- package/dist/src/utils/validateAbc.d.ts +4 -4
- package/dist/src/utils/validateAbc.d.ts.map +1 -1
- package/package.json +7 -3
- package/dist/src/components/AbcPreview.d.ts +0 -8
- package/dist/src/components/AbcPreview.d.ts.map +0 -1
package/dist/abc-editor.es.js
CHANGED
|
@@ -1,1164 +1,1148 @@
|
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for (; s < e.length && (e[s] === "|" || e[s] === ":" || e[s] === "]"); )
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
nextIndex: s
|
|
16
|
-
} : null;
|
|
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
|
-
} : null;
|
|
23
|
-
}, ce = (e, n, t) => {
|
|
24
|
-
const r = e[n];
|
|
25
|
-
if (!Y.test(r))
|
|
26
|
-
return null;
|
|
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
|
-
return {
|
|
34
|
-
html: `<span class="abc-tuplet">${p(s)}</span>`,
|
|
35
|
-
nextIndex: o,
|
|
36
|
-
slurLevelDelta: 0
|
|
37
|
-
};
|
|
1
|
+
import { jsx as a, jsxs as p, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useCallback as y, useEffect as k, useRef as N, useMemo as O } from "react";
|
|
3
|
+
import D, { tokenize as W, parse as F, analyze as K, format_default as H } from "chamber-abc";
|
|
4
|
+
let ne, ge, ie, Ce, le, me, Q, Te, fe, ce, z, he, ve, re, oe, pe, de, se, G, ue, ae, be, ye, X, V, J, $, Z;
|
|
5
|
+
let __tla = (async () => {
|
|
6
|
+
(function() {
|
|
7
|
+
"use strict";
|
|
8
|
+
try {
|
|
9
|
+
if (typeof document < "u") {
|
|
10
|
+
var a2 = document.createElement("style");
|
|
11
|
+
a2.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}.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}.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)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-70{opacity:.7}.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))}.transition-opacity{transition-property:opacity;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}@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(a2);
|
|
12
|
+
}
|
|
13
|
+
} catch (t) {
|
|
14
|
+
console.error("vite-plugin-css-injected-by-js", t);
|
|
38
15
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const t = e[n];
|
|
82
|
-
return X.test(t) ? {
|
|
83
|
-
html: `<span class="abc-chord">${p(t)}</span>`,
|
|
84
|
-
nextIndex: n + 1
|
|
85
|
-
} : null;
|
|
86
|
-
}, pe = (e, n) => {
|
|
87
|
-
const t = e[n];
|
|
88
|
-
if (!D.test(t))
|
|
89
|
-
return null;
|
|
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;
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
html: s,
|
|
106
|
-
nextIndex: o
|
|
107
|
-
};
|
|
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
|
|
116
|
-
} : null;
|
|
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
|
|
16
|
+
})();
|
|
17
|
+
$ = (r) => r.split(`
|
|
18
|
+
`).map((i, e) => e + 1).join(`
|
|
19
|
+
`);
|
|
20
|
+
await D();
|
|
21
|
+
let U, B, j, Y, L, S;
|
|
22
|
+
U = {
|
|
23
|
+
FieldLabel: "abc-meta-key",
|
|
24
|
+
Colon: "abc-meta-key",
|
|
25
|
+
Note: "abc-note",
|
|
26
|
+
Rest: "abc-rest",
|
|
27
|
+
OctaveUp: "abc-octave-high",
|
|
28
|
+
OctaveDown: "abc-octave-low",
|
|
29
|
+
NoteLength: "abc-duration",
|
|
30
|
+
Sharp: "abc-accidental",
|
|
31
|
+
Natural: "abc-accidental",
|
|
32
|
+
Flat: "abc-accidental",
|
|
33
|
+
Bar: "abc-bar",
|
|
34
|
+
DoubleBar: "abc-bar-double",
|
|
35
|
+
RepeatStart: "abc-bar",
|
|
36
|
+
RepeatEnd: "abc-bar",
|
|
37
|
+
ThinThickBar: "abc-bar-double",
|
|
38
|
+
ThickThinBar: "abc-bar-double",
|
|
39
|
+
LeftBracket: "abc-chord",
|
|
40
|
+
RightBracket: "abc-chord",
|
|
41
|
+
LeftParen: "abc-slur",
|
|
42
|
+
RightParen: "abc-slur",
|
|
43
|
+
LeftBrace: "abc-grace-note",
|
|
44
|
+
RightBrace: "abc-grace-note",
|
|
45
|
+
Tie: "abc-tie",
|
|
46
|
+
BrokenRhythm: "abc-broken-rhythm",
|
|
47
|
+
Tuplet: "abc-tuplet",
|
|
48
|
+
Decoration: "abc-decoration",
|
|
49
|
+
Text: "abc-meta-value",
|
|
50
|
+
Number: "abc-duration",
|
|
51
|
+
Slash: "abc-duration",
|
|
52
|
+
Whitespace: "",
|
|
53
|
+
Newline: "",
|
|
54
|
+
Comment: "abc-comment",
|
|
55
|
+
LineContinuation: "abc-text",
|
|
56
|
+
Eof: "",
|
|
57
|
+
Error: "abc-error"
|
|
122
58
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
} : null;
|
|
136
|
-
}, me = (e, n) => {
|
|
137
|
-
if (e[n] !== '"')
|
|
138
|
-
return null;
|
|
139
|
-
let r = n + 1;
|
|
140
|
-
for (; r < e.length && e[r] !== '"'; )
|
|
141
|
-
r++;
|
|
142
|
-
if (r >= e.length)
|
|
143
|
-
return null;
|
|
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
|
|
59
|
+
B = (r) => r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
60
|
+
V = (r) => {
|
|
61
|
+
const n = W(r);
|
|
62
|
+
if (!n || !Array.isArray(n)) return B(r);
|
|
63
|
+
let i = "", e = 0;
|
|
64
|
+
for (const l of n) {
|
|
65
|
+
const d = l.range.start, m = l.range.end;
|
|
66
|
+
d > e && (i += B(r.slice(e, d)));
|
|
67
|
+
const g = r.slice(d, m), C = U[l.kind];
|
|
68
|
+
C ? i += `<span class="${C}">${B(g)}</span>` : i += B(g), e = m;
|
|
69
|
+
}
|
|
70
|
+
return e < r.length && (i += B(r.slice(e))), i;
|
|
148
71
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
72
|
+
z = /^([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]:)(.*)$/;
|
|
73
|
+
re = /[A-Ga-g]/;
|
|
74
|
+
ne = /[\^_=]/;
|
|
75
|
+
oe = /[',]/;
|
|
76
|
+
ie = /\|[:|\]]?|:?\|/;
|
|
77
|
+
le = /[\\[\]]/;
|
|
78
|
+
se = /[()]/;
|
|
79
|
+
ae = /^\(\d+$/;
|
|
80
|
+
ce = /^(\/+|\d+(\/\d+)?|\/?\d+(\/\d+)?)$/;
|
|
81
|
+
de = /[zZx]/;
|
|
82
|
+
ue = /^\.?-$/;
|
|
83
|
+
pe = /[.~HLMOPSTuv]/;
|
|
84
|
+
me = /^"[^"]*"$/;
|
|
85
|
+
ge = /^"[\^_<>@][^"]*"$/;
|
|
86
|
+
fe = /^![^!]+!$/;
|
|
87
|
+
he = /^\{[^}]+\}$/;
|
|
88
|
+
be = /^\[\d+$/;
|
|
89
|
+
ve = /^\[([ABCDFGHIKLMmNOPQRrSsTUVWwXZ]):([^\]]*)\]$/;
|
|
90
|
+
Ce = /^[<>]+$/;
|
|
91
|
+
Te = /^%.*$/;
|
|
92
|
+
G = {
|
|
93
|
+
"X:": [
|
|
94
|
+
{
|
|
95
|
+
value: "1",
|
|
96
|
+
description: "Reference number 1"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: "2",
|
|
100
|
+
description: "Reference number 2"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"T:": [
|
|
104
|
+
{
|
|
105
|
+
value: "\u30BF\u30A4\u30C8\u30EB",
|
|
106
|
+
description: "Japanese title template"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
value: "Untitled",
|
|
110
|
+
description: "Default title"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"M:": [
|
|
114
|
+
{
|
|
115
|
+
value: "4/4",
|
|
116
|
+
description: "Common time"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
value: "3/4",
|
|
120
|
+
description: "Waltz time"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
value: "2/4",
|
|
124
|
+
description: "March time"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
value: "6/8",
|
|
128
|
+
description: "Compound duple"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
value: "9/8",
|
|
132
|
+
description: "Compound triple"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: "12/8",
|
|
136
|
+
description: "Compound quadruple"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: "5/4",
|
|
140
|
+
description: "Quintuple meter"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: "7/8",
|
|
144
|
+
description: "Septuple meter"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
value: "C",
|
|
148
|
+
description: "Common time (4/4)"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: "C|",
|
|
152
|
+
description: "Cut time (2/2)"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"L:": [
|
|
156
|
+
{
|
|
157
|
+
value: "1/4",
|
|
158
|
+
description: "Quarter note"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
value: "1/8",
|
|
162
|
+
description: "Eighth note"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
value: "1/16",
|
|
166
|
+
description: "Sixteenth note"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"Q:": [
|
|
170
|
+
{
|
|
171
|
+
value: "1/4=120",
|
|
172
|
+
description: "Quarter note = 120 BPM"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
value: "1/4=100",
|
|
176
|
+
description: "Quarter note = 100 BPM"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
value: "1/4=80",
|
|
180
|
+
description: "Quarter note = 80 BPM"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
value: "1/8=180",
|
|
184
|
+
description: "Eighth note = 180 BPM"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"K:": [
|
|
188
|
+
{
|
|
189
|
+
value: "C"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
value: "G"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
value: "D"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
value: "A"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
value: "E"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
value: "B"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
value: "F#"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
value: "C#"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
value: "F"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
value: "Bb"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
value: "Eb"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
value: "Ab"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
value: "Db"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
value: "Gb"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
value: "Cb"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
value: "Am"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
value: "Em"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
value: "Bm"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
value: "F#m"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
value: "C#m"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
value: "G#m"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
value: "D#m"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
value: "Dm"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
value: "Gm"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
value: "Cm"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
value: "Fm"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
value: "Bbm"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
value: "Ebm"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
value: "Abm"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"C:": [
|
|
277
|
+
{
|
|
278
|
+
value: "Traditional",
|
|
279
|
+
description: "Traditional composer"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
value: "Unknown",
|
|
283
|
+
description: "Unknown composer"
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"R:": [
|
|
287
|
+
{
|
|
288
|
+
value: "reel",
|
|
289
|
+
description: "Reel rhythm"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
value: "jig",
|
|
293
|
+
description: "Jig rhythm"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
value: "hornpipe",
|
|
297
|
+
description: "Hornpipe rhythm"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
value: "waltz",
|
|
301
|
+
description: "Waltz rhythm"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
value: "march",
|
|
305
|
+
description: "March rhythm"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"A:": [
|
|
309
|
+
{
|
|
310
|
+
value: "Ireland",
|
|
311
|
+
description: "Area: Ireland"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
value: "Scotland",
|
|
315
|
+
description: "Area: Scotland"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
value: "England",
|
|
319
|
+
description: "Area: England"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
value: "USA",
|
|
323
|
+
description: "Area: USA"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
value: "Japan",
|
|
327
|
+
description: "Area: Japan"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"B:": [
|
|
331
|
+
{
|
|
332
|
+
value: "The Session",
|
|
333
|
+
description: "Book: The Session"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
value: "O'Neill's Music of Ireland",
|
|
337
|
+
description: "Book: O'Neill's Music of Ireland"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"D:": [
|
|
341
|
+
{
|
|
342
|
+
value: "Album Name (Year)",
|
|
343
|
+
description: "Discography template"
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
"F:": [
|
|
347
|
+
{
|
|
348
|
+
value: "https://thesession.org/",
|
|
349
|
+
description: "File URL template"
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"G:": [
|
|
353
|
+
{
|
|
354
|
+
value: "Group name",
|
|
355
|
+
description: "Group template"
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"H:": [
|
|
359
|
+
{
|
|
360
|
+
value: "History note",
|
|
361
|
+
description: "History template"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"I:": [
|
|
365
|
+
{
|
|
366
|
+
value: "abc-charset utf-8",
|
|
367
|
+
description: "Character set: UTF-8"
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
"m:": [
|
|
371
|
+
{
|
|
372
|
+
value: "~g2 = {a}g{f}g",
|
|
373
|
+
description: "Macro definition template"
|
|
374
|
+
}
|
|
375
|
+
],
|
|
376
|
+
"N:": [
|
|
377
|
+
{
|
|
378
|
+
value: "Note text",
|
|
379
|
+
description: "Notes template"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
382
|
+
"O:": [
|
|
383
|
+
{
|
|
384
|
+
value: "Traditional",
|
|
385
|
+
description: "Origin: Traditional"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
value: "Ireland",
|
|
389
|
+
description: "Origin: Ireland"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
value: "Scotland",
|
|
393
|
+
description: "Origin: Scotland"
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
"P:": [
|
|
397
|
+
{
|
|
398
|
+
value: "AABB",
|
|
399
|
+
description: "Parts: AABB"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
value: "ABCD",
|
|
403
|
+
description: "Parts: ABCD"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
value: "A",
|
|
407
|
+
description: "Part: A"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
value: "B",
|
|
411
|
+
description: "Part: B"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"r:": [
|
|
415
|
+
{
|
|
416
|
+
value: "Remark text",
|
|
417
|
+
description: "Remark template"
|
|
418
|
+
}
|
|
419
|
+
],
|
|
420
|
+
"S:": [
|
|
421
|
+
{
|
|
422
|
+
value: "Session tune",
|
|
423
|
+
description: "Source: Session"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
value: "Traditional",
|
|
427
|
+
description: "Source: Traditional"
|
|
428
|
+
}
|
|
429
|
+
],
|
|
430
|
+
"s:": [
|
|
431
|
+
{
|
|
432
|
+
value: "Symbol line",
|
|
433
|
+
description: "Symbol line template"
|
|
434
|
+
}
|
|
435
|
+
],
|
|
436
|
+
"U:": [
|
|
437
|
+
{
|
|
438
|
+
value: "u = !trill!",
|
|
439
|
+
description: "User defined: trill"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"V:": [
|
|
443
|
+
{
|
|
444
|
+
value: "1",
|
|
445
|
+
description: "Voice 1"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
value: "2",
|
|
449
|
+
description: "Voice 2"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
value: "T",
|
|
453
|
+
description: "Tenor voice"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
value: "B",
|
|
457
|
+
description: "Bass voice"
|
|
458
|
+
}
|
|
459
|
+
],
|
|
460
|
+
"W:": [
|
|
461
|
+
{
|
|
462
|
+
value: "Lyrics line",
|
|
463
|
+
description: "Words (multi-line)"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"w:": [
|
|
467
|
+
{
|
|
468
|
+
value: "Lyrics for this line",
|
|
469
|
+
description: "Words (aligned)"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"Z:": [
|
|
473
|
+
{
|
|
474
|
+
value: "Your Name",
|
|
475
|
+
description: "Transcriber name"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
value: "ABC transcription",
|
|
479
|
+
description: "Transcription note"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
190
482
|
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
|
201
|
-
} : null;
|
|
202
|
-
}, Be = (e, n) => {
|
|
203
|
-
const t = e[n];
|
|
204
|
-
if (t !== ">" && t !== "<")
|
|
205
|
-
return null;
|
|
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
|
|
213
|
-
} : null;
|
|
214
|
-
}, Te = (e) => {
|
|
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;
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
const o = be(e, t);
|
|
223
|
-
if (o) {
|
|
224
|
-
n += o.html, t = o.nextIndex;
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
const l = ve(e, t);
|
|
228
|
-
if (l) {
|
|
229
|
-
n += l.html, t = l.nextIndex;
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
const c = ie(e, t);
|
|
233
|
-
if (c) {
|
|
234
|
-
n += c.html, t = c.nextIndex;
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
const u = fe(e, t);
|
|
238
|
-
if (u) {
|
|
239
|
-
n += u.html, t = u.nextIndex;
|
|
240
|
-
continue;
|
|
241
|
-
}
|
|
242
|
-
const f = ge(e, t);
|
|
243
|
-
if (f) {
|
|
244
|
-
n += f.html, t = f.nextIndex;
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
const i = me(e, t);
|
|
248
|
-
if (i) {
|
|
249
|
-
n += i.html, t = i.nextIndex;
|
|
250
|
-
continue;
|
|
251
|
-
}
|
|
252
|
-
const a = ce(e, t, r);
|
|
253
|
-
if (a) {
|
|
254
|
-
n += a.html, t = a.nextIndex, a.slurLevelDelta && (r += a.slurLevelDelta);
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
const d = pe(e, t);
|
|
258
|
-
if (d) {
|
|
259
|
-
n += d.html, t = d.nextIndex;
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
const m = ue(e, t);
|
|
263
|
-
if (m) {
|
|
264
|
-
n += m.html, t = m.nextIndex;
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
const y = Be(e, t);
|
|
268
|
-
if (y) {
|
|
269
|
-
n += y.html, t = y.nextIndex;
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
const b = xe(e, t);
|
|
273
|
-
if (b) {
|
|
274
|
-
n += b.html, t = b.nextIndex;
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
const v = ye(e, t);
|
|
278
|
-
if (v) {
|
|
279
|
-
n += v.html, t = v.nextIndex;
|
|
280
|
-
continue;
|
|
281
|
-
}
|
|
282
|
-
const B = de(e, t);
|
|
283
|
-
if (B) {
|
|
284
|
-
n += B.html, t = B.nextIndex;
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
const T = he(e, t);
|
|
288
|
-
if (T) {
|
|
289
|
-
n += T.html, t = T.nextIndex;
|
|
290
|
-
continue;
|
|
291
|
-
}
|
|
292
|
-
n += `<span class="abc-text">${p(e[t])}</span>`, t++;
|
|
293
|
-
}
|
|
294
|
-
return n;
|
|
295
|
-
}, $ = (e) => e.split(`
|
|
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>`;
|
|
303
|
-
}
|
|
304
|
-
return Te(t);
|
|
305
|
-
}).join(`
|
|
306
|
-
`), Ae = {
|
|
307
|
-
"X:": [
|
|
308
|
-
{ value: "1", description: "Reference number 1" },
|
|
309
|
-
{ value: "2", description: "Reference number 2" }
|
|
310
|
-
],
|
|
311
|
-
"T:": [
|
|
312
|
-
{ value: "タイトル", description: "Japanese title template" },
|
|
313
|
-
{ value: "Untitled", description: "Default title" }
|
|
314
|
-
],
|
|
315
|
-
"M:": [
|
|
316
|
-
{ value: "4/4", description: "Common time" },
|
|
317
|
-
{ value: "3/4", description: "Waltz time" },
|
|
318
|
-
{ value: "2/4", description: "March time" },
|
|
319
|
-
{ value: "6/8", description: "Compound duple" },
|
|
320
|
-
{ value: "9/8", description: "Compound triple" },
|
|
321
|
-
{ value: "12/8", description: "Compound quadruple" },
|
|
322
|
-
{ value: "5/4", description: "Quintuple meter" },
|
|
323
|
-
{ value: "7/8", description: "Septuple meter" },
|
|
324
|
-
{ value: "C", description: "Common time (4/4)" },
|
|
325
|
-
{ value: "C|", description: "Cut time (2/2)" }
|
|
326
|
-
],
|
|
327
|
-
"L:": [
|
|
328
|
-
{ value: "1/4", description: "Quarter note" },
|
|
329
|
-
{ value: "1/8", description: "Eighth note" },
|
|
330
|
-
{ value: "1/16", description: "Sixteenth note" }
|
|
331
|
-
],
|
|
332
|
-
"Q:": [
|
|
333
|
-
{ value: "1/4=120", description: "Quarter note = 120 BPM" },
|
|
334
|
-
{ value: "1/4=100", description: "Quarter note = 100 BPM" },
|
|
335
|
-
{ value: "1/4=80", description: "Quarter note = 80 BPM" },
|
|
336
|
-
{ value: "1/8=180", description: "Eighth note = 180 BPM" }
|
|
337
|
-
],
|
|
338
|
-
"K:": [
|
|
339
|
-
{ value: "C" },
|
|
340
|
-
{ value: "G" },
|
|
341
|
-
{ value: "D" },
|
|
342
|
-
{ value: "A" },
|
|
343
|
-
{ value: "E" },
|
|
344
|
-
{ value: "B" },
|
|
345
|
-
{ value: "F#" },
|
|
346
|
-
{ value: "C#" },
|
|
347
|
-
{ value: "F" },
|
|
348
|
-
{ value: "Bb" },
|
|
349
|
-
{ value: "Eb" },
|
|
350
|
-
{ value: "Ab" },
|
|
351
|
-
{ value: "Db" },
|
|
352
|
-
{ value: "Gb" },
|
|
353
|
-
{ value: "Cb" },
|
|
354
|
-
{ value: "Am" },
|
|
355
|
-
{ value: "Em" },
|
|
356
|
-
{ value: "Bm" },
|
|
357
|
-
{ value: "F#m" },
|
|
358
|
-
{ value: "C#m" },
|
|
359
|
-
{ value: "G#m" },
|
|
360
|
-
{ value: "D#m" },
|
|
361
|
-
{ value: "Dm" },
|
|
362
|
-
{ value: "Gm" },
|
|
363
|
-
{ value: "Cm" },
|
|
364
|
-
{ value: "Fm" },
|
|
365
|
-
{ value: "Bbm" },
|
|
366
|
-
{ value: "Ebm" },
|
|
367
|
-
{ value: "Abm" }
|
|
368
|
-
],
|
|
369
|
-
"C:": [
|
|
370
|
-
{ value: "Traditional", description: "Traditional composer" },
|
|
371
|
-
{ value: "Unknown", description: "Unknown composer" }
|
|
372
|
-
],
|
|
373
|
-
"R:": [
|
|
374
|
-
{ value: "reel", description: "Reel rhythm" },
|
|
375
|
-
{ value: "jig", description: "Jig rhythm" },
|
|
376
|
-
{ value: "hornpipe", description: "Hornpipe rhythm" },
|
|
377
|
-
{ value: "waltz", description: "Waltz rhythm" },
|
|
378
|
-
{ value: "march", description: "March rhythm" }
|
|
379
|
-
],
|
|
380
|
-
"A:": [
|
|
381
|
-
{ value: "Ireland", description: "Area: Ireland" },
|
|
382
|
-
{ value: "Scotland", description: "Area: Scotland" },
|
|
383
|
-
{ value: "England", description: "Area: England" },
|
|
384
|
-
{ value: "USA", description: "Area: USA" },
|
|
385
|
-
{ value: "Japan", description: "Area: Japan" }
|
|
386
|
-
],
|
|
387
|
-
"B:": [
|
|
388
|
-
{ value: "The Session", description: "Book: The Session" },
|
|
389
|
-
{ value: "O'Neill's Music of Ireland", description: "Book: O'Neill's Music of Ireland" }
|
|
390
|
-
],
|
|
391
|
-
"D:": [
|
|
392
|
-
{ value: "Album Name (Year)", description: "Discography template" }
|
|
393
|
-
],
|
|
394
|
-
"F:": [
|
|
395
|
-
{ value: "https://thesession.org/", description: "File URL template" }
|
|
396
|
-
],
|
|
397
|
-
"G:": [
|
|
398
|
-
{ value: "Group name", description: "Group template" }
|
|
399
|
-
],
|
|
400
|
-
"H:": [
|
|
401
|
-
{ value: "History note", description: "History template" }
|
|
402
|
-
],
|
|
403
|
-
"I:": [
|
|
404
|
-
{ value: "abc-charset utf-8", description: "Character set: UTF-8" }
|
|
405
|
-
],
|
|
406
|
-
"m:": [
|
|
407
|
-
{ value: "~g2 = {a}g{f}g", description: "Macro definition template" }
|
|
408
|
-
],
|
|
409
|
-
"N:": [
|
|
410
|
-
{ value: "Note text", description: "Notes template" }
|
|
411
|
-
],
|
|
412
|
-
"O:": [
|
|
413
|
-
{ value: "Traditional", description: "Origin: Traditional" },
|
|
414
|
-
{ value: "Ireland", description: "Origin: Ireland" },
|
|
415
|
-
{ value: "Scotland", description: "Origin: Scotland" }
|
|
416
|
-
],
|
|
417
|
-
"P:": [
|
|
418
|
-
{ value: "AABB", description: "Parts: AABB" },
|
|
419
|
-
{ value: "ABCD", description: "Parts: ABCD" },
|
|
420
|
-
{ value: "A", description: "Part: A" },
|
|
421
|
-
{ value: "B", description: "Part: B" }
|
|
422
|
-
],
|
|
423
|
-
"r:": [
|
|
424
|
-
{ value: "Remark text", description: "Remark template" }
|
|
425
|
-
],
|
|
426
|
-
"S:": [
|
|
427
|
-
{ value: "Session tune", description: "Source: Session" },
|
|
428
|
-
{ value: "Traditional", description: "Source: Traditional" }
|
|
429
|
-
],
|
|
430
|
-
"s:": [
|
|
431
|
-
{ value: "Symbol line", description: "Symbol line template" }
|
|
432
|
-
],
|
|
433
|
-
"U:": [
|
|
434
|
-
{ value: "u = !trill!", description: "User defined: trill" }
|
|
435
|
-
],
|
|
436
|
-
"V:": [
|
|
437
|
-
{ value: "1", description: "Voice 1" },
|
|
438
|
-
{ value: "2", description: "Voice 2" },
|
|
439
|
-
{ value: "T", description: "Tenor voice" },
|
|
440
|
-
{ value: "B", description: "Bass voice" }
|
|
441
|
-
],
|
|
442
|
-
"W:": [
|
|
443
|
-
{ value: "Lyrics line", description: "Words (multi-line)" }
|
|
444
|
-
],
|
|
445
|
-
"w:": [
|
|
446
|
-
{ value: "Lyrics for this line", description: "Words (aligned)" }
|
|
447
|
-
],
|
|
448
|
-
"Z:": [
|
|
449
|
-
{ value: "Your Name", description: "Transcriber name" },
|
|
450
|
-
{ value: "ABC transcription", description: "Transcription note" }
|
|
451
|
-
]
|
|
452
|
-
}, Ie = (e) => Ae[e] || [], Ne = [
|
|
453
|
-
{
|
|
454
|
-
value: "/header",
|
|
455
|
-
description: "Insert basic ABC header template",
|
|
456
|
-
template: `X:1
|
|
483
|
+
j = (r) => G[r] || [];
|
|
484
|
+
Q = [
|
|
485
|
+
{
|
|
486
|
+
value: "/header",
|
|
487
|
+
description: "Insert basic ABC header template",
|
|
488
|
+
template: `X:1
|
|
457
489
|
T:Untitled
|
|
458
490
|
M:4/4
|
|
459
491
|
L:1/4
|
|
460
492
|
K:C
|
|
461
493
|
`
|
|
462
|
-
|
|
463
|
-
]
|
|
464
|
-
(n) => n.value.toLowerCase().startsWith(
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
`), d = a[a.length - 1];
|
|
483
|
-
if (d.startsWith("/"))
|
|
484
|
-
return {
|
|
494
|
+
}
|
|
495
|
+
];
|
|
496
|
+
Y = (r) => r.startsWith("/") ? Q.filter((n) => n.value.toLowerCase().startsWith(r.toLowerCase())) : [];
|
|
497
|
+
J = ({ value: r, textareaRef: n, onChange: i }) => {
|
|
498
|
+
const [e, l] = _({
|
|
499
|
+
isOpen: false,
|
|
500
|
+
suggestions: [],
|
|
501
|
+
selectedIndex: 0,
|
|
502
|
+
position: {
|
|
503
|
+
top: 0,
|
|
504
|
+
left: 0
|
|
505
|
+
},
|
|
506
|
+
fieldKey: null,
|
|
507
|
+
inputValue: "",
|
|
508
|
+
isCommand: false
|
|
509
|
+
}), d = y(() => {
|
|
510
|
+
if (!n.current) return null;
|
|
511
|
+
const o = n.current.selectionStart, t = r.substring(0, o).split(`
|
|
512
|
+
`), c = t[t.length - 1];
|
|
513
|
+
if (c.startsWith("/")) return {
|
|
485
514
|
fieldKey: null,
|
|
486
|
-
inputValue:
|
|
487
|
-
line:
|
|
488
|
-
lineStartPos:
|
|
489
|
-
isCommand:
|
|
515
|
+
inputValue: c,
|
|
516
|
+
line: c,
|
|
517
|
+
lineStartPos: o - c.length,
|
|
518
|
+
isCommand: true
|
|
490
519
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
520
|
+
const f = c.match(z);
|
|
521
|
+
if (f) {
|
|
522
|
+
const [, b, v] = f;
|
|
523
|
+
return {
|
|
524
|
+
fieldKey: b,
|
|
525
|
+
inputValue: v,
|
|
526
|
+
line: c,
|
|
527
|
+
lineStartPos: o - c.length,
|
|
528
|
+
isCommand: false
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
return null;
|
|
532
|
+
}, [
|
|
533
|
+
r,
|
|
534
|
+
n
|
|
535
|
+
]), m = y(() => {
|
|
536
|
+
if (!n.current) return {
|
|
537
|
+
top: 0,
|
|
538
|
+
left: 0
|
|
539
|
+
};
|
|
540
|
+
const o = n.current, t = o.selectionStart, f = r.substring(0, t).split(`
|
|
541
|
+
`).length - 1, b = parseFloat(getComputedStyle(o).lineHeight) || 24;
|
|
494
542
|
return {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
line: d,
|
|
498
|
-
lineStartPos: i - d.length,
|
|
499
|
-
isCommand: !1
|
|
543
|
+
top: (parseFloat(getComputedStyle(o).paddingTop) || 16) + (f + 1) * b - o.scrollTop,
|
|
544
|
+
left: 60
|
|
500
545
|
};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
if (!i) {
|
|
513
|
-
s((d) => ({ ...d, isOpen: !1 }));
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
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({
|
|
522
|
-
isOpen: !0,
|
|
523
|
-
suggestions: a,
|
|
524
|
-
selectedIndex: 0,
|
|
525
|
-
position: d,
|
|
526
|
-
fieldKey: i.fieldKey,
|
|
527
|
-
inputValue: i.inputValue,
|
|
528
|
-
isCommand: i.isCommand
|
|
529
|
-
});
|
|
530
|
-
} else
|
|
531
|
-
s((d) => ({ ...d, isOpen: !1 }));
|
|
532
|
-
}, [e, o, l]);
|
|
533
|
-
const c = I(
|
|
534
|
-
(i) => {
|
|
535
|
-
if (!n.current)
|
|
546
|
+
}, [
|
|
547
|
+
r,
|
|
548
|
+
n
|
|
549
|
+
]);
|
|
550
|
+
k(() => {
|
|
551
|
+
const o = d();
|
|
552
|
+
if (!o) {
|
|
553
|
+
l((c) => ({
|
|
554
|
+
...c,
|
|
555
|
+
isOpen: false
|
|
556
|
+
}));
|
|
536
557
|
return;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
558
|
+
}
|
|
559
|
+
let t = [];
|
|
560
|
+
if (o.isCommand ? t = Y(o.inputValue) : o.fieldKey && (t = j(o.fieldKey).filter((f) => f.value.toLowerCase().startsWith(o.inputValue.toLowerCase()))), t.length > 0) {
|
|
561
|
+
const c = m();
|
|
562
|
+
l({
|
|
563
|
+
isOpen: true,
|
|
564
|
+
suggestions: t,
|
|
565
|
+
selectedIndex: 0,
|
|
566
|
+
position: c,
|
|
567
|
+
fieldKey: o.fieldKey,
|
|
568
|
+
inputValue: o.inputValue,
|
|
569
|
+
isCommand: o.isCommand
|
|
570
|
+
});
|
|
571
|
+
} else l((c) => ({
|
|
572
|
+
...c,
|
|
573
|
+
isOpen: false
|
|
574
|
+
}));
|
|
575
|
+
}, [
|
|
576
|
+
r,
|
|
577
|
+
d,
|
|
578
|
+
m
|
|
579
|
+
]);
|
|
580
|
+
const g = y((o) => {
|
|
581
|
+
if (!n.current) return;
|
|
582
|
+
const t = n.current.selectionStart, c = r.substring(0, t).split(`
|
|
583
|
+
`), f = c[c.length - 1];
|
|
584
|
+
let b, v;
|
|
585
|
+
if (e.isCommand && o.template) {
|
|
586
|
+
const h = r.substring(0, t - f.length), T = r.substring(t);
|
|
587
|
+
b = h + o.template + T, v = h.length + o.template.length;
|
|
588
|
+
} else if (e.fieldKey) {
|
|
589
|
+
const h = e.fieldKey + o.value, T = r.substring(0, t - f.length), w = r.substring(t);
|
|
590
|
+
b = T + h + w, v = T.length + h.length;
|
|
591
|
+
} else return;
|
|
592
|
+
i(b), setTimeout(() => {
|
|
593
|
+
n.current && (n.current.selectionStart = v, n.current.selectionEnd = v, n.current.focus());
|
|
594
|
+
}, 0), l((h) => ({
|
|
595
|
+
...h,
|
|
596
|
+
isOpen: false
|
|
597
|
+
}));
|
|
598
|
+
}, [
|
|
599
|
+
n,
|
|
600
|
+
e.fieldKey,
|
|
601
|
+
e.isCommand,
|
|
602
|
+
r,
|
|
603
|
+
i
|
|
604
|
+
]), C = y((o) => {
|
|
605
|
+
if (e.isOpen) switch (o.key) {
|
|
606
|
+
case "ArrowDown":
|
|
607
|
+
o.preventDefault(), l((t) => ({
|
|
608
|
+
...t,
|
|
609
|
+
selectedIndex: Math.min(t.selectedIndex + 1, t.suggestions.length - 1)
|
|
610
|
+
}));
|
|
611
|
+
break;
|
|
612
|
+
case "ArrowUp":
|
|
613
|
+
o.preventDefault(), l((t) => ({
|
|
614
|
+
...t,
|
|
615
|
+
selectedIndex: Math.max(t.selectedIndex - 1, 0)
|
|
616
|
+
}));
|
|
617
|
+
break;
|
|
618
|
+
case "Enter":
|
|
619
|
+
e.suggestions.length > 0 && (o.preventDefault(), g(e.suggestions[e.selectedIndex]));
|
|
620
|
+
break;
|
|
621
|
+
case "Escape":
|
|
622
|
+
o.preventDefault(), l((t) => ({
|
|
623
|
+
...t,
|
|
624
|
+
isOpen: false
|
|
625
|
+
}));
|
|
626
|
+
break;
|
|
627
|
+
}
|
|
628
|
+
}, [
|
|
629
|
+
e.isOpen,
|
|
630
|
+
e.suggestions,
|
|
631
|
+
e.selectedIndex,
|
|
632
|
+
g
|
|
633
|
+
]), A = y((o) => {
|
|
634
|
+
l((t) => ({
|
|
635
|
+
...t,
|
|
636
|
+
selectedIndex: o
|
|
637
|
+
}));
|
|
638
|
+
}, []);
|
|
639
|
+
return {
|
|
640
|
+
isOpen: e.isOpen,
|
|
641
|
+
suggestions: e.suggestions,
|
|
642
|
+
selectedIndex: e.selectedIndex,
|
|
643
|
+
position: e.position,
|
|
644
|
+
handleKeyDown: C,
|
|
645
|
+
selectSuggestion: g,
|
|
646
|
+
handleMouseEnter: A
|
|
647
|
+
};
|
|
589
648
|
};
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
behavior: "smooth"
|
|
602
|
-
});
|
|
603
|
-
}, [n]), e.length === 0 ? null : /* @__PURE__ */ h(
|
|
604
|
-
"div",
|
|
605
|
-
{
|
|
649
|
+
X = ({ suggestions: r, selectedIndex: n, position: i, onSelect: e, onMouseEnter: l }) => {
|
|
650
|
+
const d = N(null);
|
|
651
|
+
return k(() => {
|
|
652
|
+
var _a;
|
|
653
|
+
(_a = d.current) == null ? void 0 : _a.scrollIntoView({
|
|
654
|
+
block: "nearest",
|
|
655
|
+
behavior: "smooth"
|
|
656
|
+
});
|
|
657
|
+
}, [
|
|
658
|
+
n
|
|
659
|
+
]), r.length === 0 ? null : a("div", {
|
|
606
660
|
className: "absolute z-50 bg-slate-800 rounded-md shadow-xl overflow-hidden",
|
|
607
661
|
style: {
|
|
608
|
-
top: `${
|
|
609
|
-
left: `${
|
|
662
|
+
top: `${i.top}px`,
|
|
663
|
+
left: `${i.left}px`,
|
|
610
664
|
minWidth: "200px",
|
|
611
665
|
maxWidth: "400px",
|
|
612
666
|
maxHeight: "300px",
|
|
613
667
|
overflowY: "auto"
|
|
614
668
|
},
|
|
615
|
-
children:
|
|
616
|
-
|
|
617
|
-
{
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
632
|
-
const n = e.trim();
|
|
633
|
-
if (n === "C")
|
|
634
|
-
return { beatsPerMeasure: 4, beatUnit: 4 };
|
|
635
|
-
if (n === "C|")
|
|
636
|
-
return { beatsPerMeasure: 2, beatUnit: 2 };
|
|
637
|
-
const t = n.match(/^(\d+)\/(\d+)$/);
|
|
638
|
-
return t ? {
|
|
639
|
-
beatsPerMeasure: parseInt(t[1], 10),
|
|
640
|
-
beatUnit: parseInt(t[2], 10)
|
|
641
|
-
} : { beatsPerMeasure: 4, beatUnit: 4 };
|
|
642
|
-
}, Le = (e) => {
|
|
643
|
-
const t = e.trim().match(/^(\d+)\/(\d+)$/);
|
|
644
|
-
return t ? parseInt(t[1], 10) / parseInt(t[2], 10) : 1 / 8;
|
|
645
|
-
}, Ee = (e) => {
|
|
646
|
-
const n = e.split(`
|
|
647
|
-
`);
|
|
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));
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
return { meter: t, unitNoteLength: r };
|
|
657
|
-
}, _ = (e) => {
|
|
658
|
-
if (!e)
|
|
659
|
-
return 1;
|
|
660
|
-
if (/^\/+$/.test(e))
|
|
661
|
-
return 1 / Math.pow(2, e.length);
|
|
662
|
-
if (e.startsWith("/"))
|
|
663
|
-
return 1 / parseInt(e.substring(1), 10);
|
|
664
|
-
if (e.includes("/")) {
|
|
665
|
-
const [n, t] = e.split("/");
|
|
666
|
-
return parseInt(n, 10) / parseInt(t, 10);
|
|
667
|
-
}
|
|
668
|
-
return parseInt(e, 10);
|
|
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
|
|
669
|
+
children: r.map((m, g) => p("div", {
|
|
670
|
+
ref: g === n ? d : null,
|
|
671
|
+
className: `px-3 py-2 cursor-pointer ${g === n ? "bg-blue-600 text-white" : "text-slate-200 hover:bg-slate-700"}`,
|
|
672
|
+
onClick: () => e(m),
|
|
673
|
+
onMouseEnter: () => l(g),
|
|
674
|
+
children: [
|
|
675
|
+
a("div", {
|
|
676
|
+
className: "font-mono text-sm",
|
|
677
|
+
children: m.value
|
|
678
|
+
}),
|
|
679
|
+
m.description && a("div", {
|
|
680
|
+
className: "text-xs opacity-75 mt-1",
|
|
681
|
+
children: m.description
|
|
682
|
+
})
|
|
683
|
+
]
|
|
684
|
+
}, `${m.value}-${g}`))
|
|
685
|
+
});
|
|
696
686
|
};
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
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;
|
|
687
|
+
L = (r, n) => {
|
|
688
|
+
let i = 0, e = 0, l = 0;
|
|
689
|
+
for (const d of r) {
|
|
690
|
+
if (l >= n) break;
|
|
691
|
+
d === `
|
|
692
|
+
` ? (i++, e = 0) : e++, l++;
|
|
713
693
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
t += a, r = l;
|
|
735
|
-
} else if (o === "[") {
|
|
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;
|
|
744
|
-
} else
|
|
745
|
-
l++;
|
|
746
|
-
}
|
|
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);
|
|
760
|
-
}
|
|
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;
|
|
694
|
+
return {
|
|
695
|
+
line: i,
|
|
696
|
+
col: e
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
Z = (r) => {
|
|
700
|
+
const n = [];
|
|
701
|
+
try {
|
|
702
|
+
const i = F(r);
|
|
703
|
+
if (i && i.diagnostics) for (const e of i.diagnostics) {
|
|
704
|
+
const l = L(r, e.range.start);
|
|
705
|
+
n.push({
|
|
706
|
+
line: l.line,
|
|
707
|
+
column: l.col,
|
|
708
|
+
startCol: e.range.start,
|
|
709
|
+
endCol: e.range.end,
|
|
710
|
+
severity: e.severity.toLowerCase(),
|
|
711
|
+
code: e.code,
|
|
712
|
+
message: e.message
|
|
713
|
+
});
|
|
766
714
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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() === "")
|
|
782
|
-
return;
|
|
783
|
-
const a = f.trim();
|
|
784
|
-
if (a.startsWith(":") || a.startsWith("[") || a === "") {
|
|
785
|
-
l += f.length + 1;
|
|
786
|
-
return;
|
|
787
|
-
}
|
|
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;
|
|
715
|
+
if (i && i.tune) {
|
|
716
|
+
const e = K(i.tune);
|
|
717
|
+
if (e && e.diagnostics) for (const l of e.diagnostics) {
|
|
718
|
+
const d = L(r, l.range.start);
|
|
791
719
|
n.push({
|
|
792
|
-
line:
|
|
793
|
-
|
|
794
|
-
startCol:
|
|
795
|
-
endCol:
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
message:
|
|
720
|
+
line: d.line,
|
|
721
|
+
column: d.col,
|
|
722
|
+
startCol: l.range.start,
|
|
723
|
+
endCol: l.range.end,
|
|
724
|
+
severity: l.severity.toLowerCase(),
|
|
725
|
+
code: l.code,
|
|
726
|
+
message: l.message
|
|
799
727
|
});
|
|
800
728
|
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
}), n;
|
|
805
|
-
}, C = {
|
|
806
|
-
margin: 0,
|
|
807
|
-
padding: "16px",
|
|
808
|
-
border: "none",
|
|
809
|
-
outline: "none",
|
|
810
|
-
fontSize: "14px",
|
|
811
|
-
fontFamily: 'SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
812
|
-
fontWeight: 400,
|
|
813
|
-
fontStyle: "normal",
|
|
814
|
-
fontVariant: "normal",
|
|
815
|
-
fontStretch: "normal",
|
|
816
|
-
lineHeight: "24px",
|
|
817
|
-
letterSpacing: "normal",
|
|
818
|
-
wordSpacing: "normal",
|
|
819
|
-
textAlign: "left",
|
|
820
|
-
textIndent: 0,
|
|
821
|
-
textTransform: "none",
|
|
822
|
-
whiteSpace: "pre-wrap",
|
|
823
|
-
wordBreak: "break-all",
|
|
824
|
-
wordWrap: "break-word",
|
|
825
|
-
overflowWrap: "break-word",
|
|
826
|
-
tabSize: 4,
|
|
827
|
-
boxSizing: "border-box",
|
|
828
|
-
WebkitFontSmoothing: "antialiased",
|
|
829
|
-
MozOsxFontSmoothing: "grayscale"
|
|
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" ? {
|
|
832
|
-
editorBg: "#262626",
|
|
833
|
-
lineNumBg: "#0f0f0f",
|
|
834
|
-
lineNumBorder: "#2d2d2d",
|
|
835
|
-
caretColor: "#fff",
|
|
836
|
-
errorBg: "#1a1a1a",
|
|
837
|
-
errorBorder: "#2d2d2d",
|
|
838
|
-
errorHeader: "#ffffff",
|
|
839
|
-
errorBadgeBg: "#dc2626",
|
|
840
|
-
errorBadgeText: "#ffffff",
|
|
841
|
-
errorIcon: "#f59e0b",
|
|
842
|
-
errorLocation: "#22d3ee",
|
|
843
|
-
errorMessage: "#e5e7eb",
|
|
844
|
-
errorHighlight: "rgba(245, 158, 11, 0.2)",
|
|
845
|
-
errorHoverBg: "rgba(51, 65, 85, 0.4)",
|
|
846
|
-
errorItemBorder: "rgba(255, 255, 255, 0.05)"
|
|
847
|
-
} : {
|
|
848
|
-
editorBg: "#ffffff",
|
|
849
|
-
lineNumBg: "#ffffff",
|
|
850
|
-
lineNumBorder: "#e5e7eb",
|
|
851
|
-
caretColor: "#000",
|
|
852
|
-
errorBg: "#ffffff",
|
|
853
|
-
errorBorder: "#e5e7eb",
|
|
854
|
-
errorHeader: "#1f2937",
|
|
855
|
-
errorBadgeBg: "#dc2626",
|
|
856
|
-
errorBadgeText: "#ffffff",
|
|
857
|
-
errorIcon: "#dc2626",
|
|
858
|
-
errorLocation: "#0891b2",
|
|
859
|
-
errorMessage: "#1f2937",
|
|
860
|
-
errorHighlight: "#fde047",
|
|
861
|
-
errorHoverBg: "rgba(254, 202, 202, 0.4)",
|
|
862
|
-
errorItemBorder: "rgba(220, 38, 38, 0.1)"
|
|
863
|
-
}, {
|
|
864
|
-
isOpen: d,
|
|
865
|
-
suggestions: m,
|
|
866
|
-
selectedIndex: y,
|
|
867
|
-
position: b,
|
|
868
|
-
handleKeyDown: v,
|
|
869
|
-
selectSuggestion: B,
|
|
870
|
-
handleMouseEnter: T
|
|
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) {
|
|
875
|
-
const A = e.split(`
|
|
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);
|
|
729
|
+
}
|
|
730
|
+
} catch (i) {
|
|
731
|
+
console.warn("validateAbc error:", i);
|
|
879
732
|
}
|
|
733
|
+
return n.sort((i, e) => i.startCol - e.startCol), n;
|
|
880
734
|
};
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
735
|
+
S = {
|
|
736
|
+
margin: 0,
|
|
737
|
+
padding: "16px",
|
|
738
|
+
border: "none",
|
|
739
|
+
outline: "none",
|
|
740
|
+
fontSize: "14px",
|
|
741
|
+
fontFamily: 'SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
|
742
|
+
fontWeight: 400,
|
|
743
|
+
fontStyle: "normal",
|
|
744
|
+
fontVariant: "normal",
|
|
745
|
+
fontStretch: "normal",
|
|
746
|
+
lineHeight: "24px",
|
|
747
|
+
letterSpacing: "normal",
|
|
748
|
+
wordSpacing: "normal",
|
|
749
|
+
textAlign: "left",
|
|
750
|
+
textIndent: 0,
|
|
751
|
+
textTransform: "none",
|
|
752
|
+
whiteSpace: "pre-wrap",
|
|
753
|
+
wordBreak: "break-all",
|
|
754
|
+
wordWrap: "break-word",
|
|
755
|
+
overflowWrap: "break-word",
|
|
756
|
+
tabSize: 4,
|
|
757
|
+
boxSizing: "border-box",
|
|
758
|
+
WebkitFontSmoothing: "antialiased",
|
|
759
|
+
MozOsxFontSmoothing: "grayscale"
|
|
760
|
+
};
|
|
761
|
+
ye = ({ value: r, onChange: n, theme: i = "light" }) => {
|
|
762
|
+
const e = N(null), l = N(null), d = N(null), m = $(r), g = V(r), C = O(() => Z(r), [
|
|
763
|
+
r
|
|
764
|
+
]), [A, o] = _(null), t = i === "dark" ? {
|
|
765
|
+
editorBg: "#262626",
|
|
766
|
+
lineNumBg: "#0f0f0f",
|
|
767
|
+
lineNumBorder: "#2d2d2d",
|
|
768
|
+
caretColor: "#fff",
|
|
769
|
+
errorBg: "#1a1a1a",
|
|
770
|
+
errorBorder: "#2d2d2d",
|
|
771
|
+
errorHeader: "#ffffff",
|
|
772
|
+
errorBadgeBg: "#dc2626",
|
|
773
|
+
errorBadgeText: "#ffffff",
|
|
774
|
+
errorIcon: "#f59e0b",
|
|
775
|
+
errorLocation: "#22d3ee",
|
|
776
|
+
errorMessage: "#e5e7eb",
|
|
777
|
+
warningIcon: "#fbbf24",
|
|
778
|
+
infoIcon: "#60a5fa"
|
|
779
|
+
} : {
|
|
780
|
+
editorBg: "#ffffff",
|
|
781
|
+
lineNumBg: "#ffffff",
|
|
782
|
+
lineNumBorder: "#e5e7eb",
|
|
783
|
+
caretColor: "#000",
|
|
784
|
+
errorBg: "#ffffff",
|
|
785
|
+
errorBorder: "#e5e7eb",
|
|
786
|
+
errorHeader: "#1f2937",
|
|
787
|
+
errorBadgeBg: "#dc2626",
|
|
788
|
+
errorBadgeText: "#ffffff",
|
|
789
|
+
errorIcon: "#dc2626",
|
|
790
|
+
errorLocation: "#0891b2",
|
|
791
|
+
errorMessage: "#1f2937",
|
|
792
|
+
warningIcon: "#d97706",
|
|
793
|
+
infoIcon: "#2563eb"
|
|
794
|
+
}, { isOpen: c, suggestions: f, selectedIndex: b, position: v, handleKeyDown: h, selectSuggestion: T, handleMouseEnter: w } = J({
|
|
795
|
+
value: r,
|
|
796
|
+
textareaRef: e,
|
|
797
|
+
onChange: n
|
|
798
|
+
}), R = () => {
|
|
799
|
+
e.current && l.current && d.current && (l.current.scrollTop = e.current.scrollTop, d.current.scrollTop = e.current.scrollTop);
|
|
800
|
+
}, I = (s) => {
|
|
801
|
+
if (e.current) {
|
|
802
|
+
const u = r.split(`
|
|
803
|
+
`), x = u.slice(0, s).join(`
|
|
804
|
+
`).length + (s > 0 ? 1 : 0);
|
|
805
|
+
e.current.focus(), e.current.setSelectionRange(x, x), e.current.scrollTop = e.current.scrollHeight * (s / u.length);
|
|
806
|
+
}
|
|
807
|
+
}, E = y(() => {
|
|
808
|
+
try {
|
|
809
|
+
const s = H(r);
|
|
810
|
+
s !== r && n(s);
|
|
811
|
+
} catch (s) {
|
|
812
|
+
console.warn("Format error:", s);
|
|
813
|
+
}
|
|
814
|
+
}, [
|
|
815
|
+
r,
|
|
816
|
+
n
|
|
817
|
+
]);
|
|
818
|
+
k(() => {
|
|
819
|
+
const s = (u) => {
|
|
820
|
+
(u.metaKey || u.ctrlKey) && u.key === "s" && (u.preventDefault(), E());
|
|
821
|
+
};
|
|
822
|
+
return window.addEventListener("keydown", s), () => window.removeEventListener("keydown", s);
|
|
823
|
+
}, [
|
|
824
|
+
E
|
|
825
|
+
]);
|
|
826
|
+
const P = (s) => {
|
|
827
|
+
switch (s) {
|
|
828
|
+
case "error":
|
|
829
|
+
return t.errorIcon;
|
|
830
|
+
case "warning":
|
|
831
|
+
return t.warningIcon;
|
|
832
|
+
case "info":
|
|
833
|
+
return t.infoIcon;
|
|
834
|
+
default:
|
|
835
|
+
return t.errorIcon;
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
return p("div", {
|
|
839
|
+
className: "w-full h-full flex flex-col rounded-lg overflow-hidden shadow-lg",
|
|
840
|
+
"data-theme": i,
|
|
841
|
+
style: {
|
|
842
|
+
backgroundColor: t.editorBg
|
|
843
|
+
},
|
|
844
|
+
children: [
|
|
845
|
+
p("div", {
|
|
846
|
+
className: "flex-1 flex overflow-hidden",
|
|
847
|
+
children: [
|
|
848
|
+
a("div", {
|
|
849
|
+
ref: l,
|
|
850
|
+
className: "overflow-hidden select-none",
|
|
924
851
|
style: {
|
|
925
|
-
...
|
|
926
|
-
backgroundColor:
|
|
852
|
+
...S,
|
|
853
|
+
backgroundColor: t.lineNumBg,
|
|
854
|
+
minWidth: "3rem",
|
|
855
|
+
padding: "16px 8px 16px 8px",
|
|
856
|
+
color: "#6b7280",
|
|
857
|
+
borderRightColor: t.lineNumBorder,
|
|
858
|
+
borderRightStyle: "solid",
|
|
859
|
+
borderRightWidth: "1px"
|
|
927
860
|
},
|
|
928
|
-
children:
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
})
|
|
949
|
-
}
|
|
950
|
-
);
|
|
951
|
-
})(),
|
|
952
|
-
/* @__PURE__ */ h(
|
|
953
|
-
"textarea",
|
|
954
|
-
{
|
|
955
|
-
ref: r,
|
|
956
|
-
className: "absolute inset-0 w-full h-full resize-none",
|
|
957
|
-
style: {
|
|
958
|
-
...C,
|
|
959
|
-
backgroundColor: "transparent",
|
|
960
|
-
color: "transparent",
|
|
961
|
-
caretColor: a.caretColor,
|
|
962
|
-
// ブラウザ固有のスタイルをリセット
|
|
963
|
-
WebkitAppearance: "none",
|
|
964
|
-
appearance: "none"
|
|
965
|
-
},
|
|
966
|
-
value: e,
|
|
967
|
-
onChange: (g) => n(g.target.value),
|
|
968
|
-
onScroll: H,
|
|
969
|
-
onKeyDown: v,
|
|
970
|
-
spellCheck: !1,
|
|
971
|
-
autoCapitalize: "off",
|
|
972
|
-
autoComplete: "off",
|
|
973
|
-
autoCorrect: "off",
|
|
974
|
-
placeholder: "Type /header to insert template..."
|
|
975
|
-
}
|
|
976
|
-
),
|
|
977
|
-
d && /* @__PURE__ */ h(
|
|
978
|
-
Se,
|
|
979
|
-
{
|
|
980
|
-
suggestions: m,
|
|
981
|
-
selectedIndex: y,
|
|
982
|
-
position: b,
|
|
983
|
-
onSelect: B,
|
|
984
|
-
onMouseEnter: T
|
|
985
|
-
}
|
|
986
|
-
)
|
|
987
|
-
] })
|
|
988
|
-
] }),
|
|
989
|
-
i.length > 0 && /* @__PURE__ */ x("div", { className: "flex", children: [
|
|
990
|
-
/* @__PURE__ */ h(
|
|
991
|
-
"div",
|
|
992
|
-
{
|
|
993
|
-
style: {
|
|
994
|
-
backgroundColor: a.lineNumBg,
|
|
995
|
-
minWidth: "3rem",
|
|
996
|
-
borderRightColor: a.lineNumBorder,
|
|
997
|
-
borderRightStyle: "solid",
|
|
998
|
-
borderRightWidth: "1px"
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
),
|
|
1002
|
-
/* @__PURE__ */ x(
|
|
1003
|
-
"div",
|
|
1004
|
-
{
|
|
1005
|
-
className: "flex-1 px-4 py-3 text-xs font-mono overflow-auto border-t",
|
|
1006
|
-
style: {
|
|
1007
|
-
backgroundColor: a.errorBg,
|
|
1008
|
-
borderColor: a.errorBorder,
|
|
1009
|
-
maxHeight: "12rem",
|
|
1010
|
-
scrollbarWidth: "thin",
|
|
1011
|
-
scrollbarColor: `${a.errorIcon} transparent`
|
|
1012
|
-
},
|
|
1013
|
-
children: [
|
|
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(
|
|
1017
|
-
"svg",
|
|
1018
|
-
{
|
|
1019
|
-
width: "14",
|
|
1020
|
-
height: "14",
|
|
1021
|
-
viewBox: "0 0 24 24",
|
|
1022
|
-
fill: "none",
|
|
1023
|
-
stroke: "currentColor",
|
|
1024
|
-
strokeWidth: "2",
|
|
1025
|
-
strokeLinecap: "round",
|
|
1026
|
-
strokeLinejoin: "round",
|
|
1027
|
-
style: { color: a.errorIcon },
|
|
1028
|
-
children: [
|
|
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" })
|
|
1032
|
-
]
|
|
861
|
+
children: m.split(`
|
|
862
|
+
`).map((s, u) => a("div", {
|
|
863
|
+
style: {
|
|
864
|
+
textAlign: "center"
|
|
865
|
+
},
|
|
866
|
+
children: s
|
|
867
|
+
}, u))
|
|
868
|
+
}),
|
|
869
|
+
p("div", {
|
|
870
|
+
className: "flex-1 relative",
|
|
871
|
+
children: [
|
|
872
|
+
a("div", {
|
|
873
|
+
ref: d,
|
|
874
|
+
className: "absolute inset-0 overflow-hidden pointer-events-none",
|
|
875
|
+
style: {
|
|
876
|
+
...S,
|
|
877
|
+
backgroundColor: t.editorBg
|
|
878
|
+
},
|
|
879
|
+
dangerouslySetInnerHTML: {
|
|
880
|
+
__html: g
|
|
1033
881
|
}
|
|
1034
|
-
),
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
"div",
|
|
1039
|
-
{
|
|
1040
|
-
className: "px-2 py-0.5 rounded-full text-[10px] font-bold",
|
|
882
|
+
}),
|
|
883
|
+
a("textarea", {
|
|
884
|
+
ref: e,
|
|
885
|
+
className: "absolute inset-0 w-full h-full resize-none",
|
|
1041
886
|
style: {
|
|
1042
|
-
|
|
1043
|
-
|
|
887
|
+
...S,
|
|
888
|
+
backgroundColor: "transparent",
|
|
889
|
+
color: "transparent",
|
|
890
|
+
caretColor: t.caretColor,
|
|
891
|
+
WebkitAppearance: "none",
|
|
892
|
+
appearance: "none"
|
|
1044
893
|
},
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
894
|
+
value: r,
|
|
895
|
+
onChange: (s) => n(s.target.value),
|
|
896
|
+
onScroll: R,
|
|
897
|
+
onKeyDown: h,
|
|
898
|
+
spellCheck: false,
|
|
899
|
+
autoCapitalize: "off",
|
|
900
|
+
autoComplete: "off",
|
|
901
|
+
autoCorrect: "off",
|
|
902
|
+
placeholder: "Type /header to insert template..."
|
|
903
|
+
}),
|
|
904
|
+
c && a(X, {
|
|
905
|
+
suggestions: f,
|
|
906
|
+
selectedIndex: b,
|
|
907
|
+
position: v,
|
|
908
|
+
onSelect: T,
|
|
909
|
+
onMouseEnter: w
|
|
910
|
+
})
|
|
911
|
+
]
|
|
912
|
+
})
|
|
913
|
+
]
|
|
914
|
+
}),
|
|
915
|
+
C.length > 0 && p("div", {
|
|
916
|
+
className: "flex",
|
|
917
|
+
children: [
|
|
918
|
+
a("div", {
|
|
919
|
+
style: {
|
|
920
|
+
backgroundColor: t.lineNumBg,
|
|
921
|
+
minWidth: "3rem",
|
|
922
|
+
borderRightColor: t.lineNumBorder,
|
|
923
|
+
borderRightStyle: "solid",
|
|
924
|
+
borderRightWidth: "1px"
|
|
925
|
+
}
|
|
926
|
+
}),
|
|
927
|
+
p("div", {
|
|
928
|
+
className: "flex-1 px-4 py-3 text-xs font-mono overflow-auto border-t",
|
|
929
|
+
style: {
|
|
930
|
+
backgroundColor: t.errorBg,
|
|
931
|
+
borderColor: t.errorBorder,
|
|
932
|
+
maxHeight: "12rem",
|
|
933
|
+
scrollbarWidth: "thin",
|
|
934
|
+
scrollbarColor: `${t.errorIcon} transparent`
|
|
935
|
+
},
|
|
936
|
+
children: [
|
|
937
|
+
p("div", {
|
|
938
|
+
className: "flex items-center gap-2 mb-3",
|
|
939
|
+
children: [
|
|
940
|
+
p("div", {
|
|
941
|
+
className: "flex items-center gap-2",
|
|
1076
942
|
children: [
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
943
|
+
p("svg", {
|
|
944
|
+
width: "14",
|
|
945
|
+
height: "14",
|
|
946
|
+
viewBox: "0 0 24 24",
|
|
947
|
+
fill: "none",
|
|
948
|
+
stroke: "currentColor",
|
|
949
|
+
strokeWidth: "2",
|
|
950
|
+
strokeLinecap: "round",
|
|
951
|
+
strokeLinejoin: "round",
|
|
952
|
+
style: {
|
|
953
|
+
color: t.errorIcon
|
|
954
|
+
},
|
|
955
|
+
children: [
|
|
956
|
+
a("path", {
|
|
957
|
+
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"
|
|
958
|
+
}),
|
|
959
|
+
a("line", {
|
|
960
|
+
x1: "12",
|
|
961
|
+
y1: "9",
|
|
962
|
+
x2: "12",
|
|
963
|
+
y2: "13"
|
|
964
|
+
}),
|
|
965
|
+
a("line", {
|
|
966
|
+
x1: "12",
|
|
967
|
+
y1: "17",
|
|
968
|
+
x2: "12.01",
|
|
969
|
+
y2: "17"
|
|
970
|
+
})
|
|
971
|
+
]
|
|
972
|
+
}),
|
|
973
|
+
a("span", {
|
|
974
|
+
className: "text-[11px] font-semibold uppercase tracking-wide",
|
|
975
|
+
style: {
|
|
976
|
+
color: t.errorHeader
|
|
977
|
+
},
|
|
978
|
+
children: "Diagnostics"
|
|
979
|
+
})
|
|
1080
980
|
]
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
981
|
+
}),
|
|
982
|
+
a("div", {
|
|
983
|
+
className: "px-2 py-0.5 rounded-full text-[10px] font-bold",
|
|
984
|
+
style: {
|
|
985
|
+
backgroundColor: t.errorBadgeBg,
|
|
986
|
+
color: t.errorBadgeText
|
|
987
|
+
},
|
|
988
|
+
children: C.length
|
|
989
|
+
})
|
|
990
|
+
]
|
|
991
|
+
}),
|
|
992
|
+
a("div", {
|
|
993
|
+
className: "space-y-1",
|
|
994
|
+
children: C.map((s, u) => p("div", {
|
|
995
|
+
className: "flex items-start gap-3 px-3 py-2 rounded-md border cursor-pointer hover:bg-opacity-50",
|
|
996
|
+
style: {
|
|
997
|
+
borderColor: "transparent",
|
|
998
|
+
transition: "all 0.15s ease-in-out"
|
|
999
|
+
},
|
|
1000
|
+
onClick: () => I(s.line),
|
|
1001
|
+
children: [
|
|
1002
|
+
p("svg", {
|
|
1003
|
+
width: "16",
|
|
1004
|
+
height: "16",
|
|
1005
|
+
viewBox: "0 0 24 24",
|
|
1006
|
+
fill: "none",
|
|
1007
|
+
stroke: "currentColor",
|
|
1008
|
+
strokeWidth: "2",
|
|
1009
|
+
strokeLinecap: "round",
|
|
1010
|
+
strokeLinejoin: "round",
|
|
1011
|
+
className: "shrink-0 mt-0.5",
|
|
1088
1012
|
style: {
|
|
1089
|
-
color:
|
|
1090
|
-
backgroundColor: t === "dark" ? "rgba(34, 211, 238, 0.1)" : "rgba(8, 145, 178, 0.1)"
|
|
1013
|
+
color: P(s.severity)
|
|
1091
1014
|
},
|
|
1092
1015
|
children: [
|
|
1093
|
-
"
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1016
|
+
a("circle", {
|
|
1017
|
+
cx: "12",
|
|
1018
|
+
cy: "12",
|
|
1019
|
+
r: "10"
|
|
1020
|
+
}),
|
|
1021
|
+
a("line", {
|
|
1022
|
+
x1: "12",
|
|
1023
|
+
y1: "8",
|
|
1024
|
+
x2: "12",
|
|
1025
|
+
y2: "12"
|
|
1026
|
+
}),
|
|
1027
|
+
a("line", {
|
|
1028
|
+
x1: "12",
|
|
1029
|
+
y1: "16",
|
|
1030
|
+
x2: "12.01",
|
|
1031
|
+
y2: "16"
|
|
1032
|
+
})
|
|
1097
1033
|
]
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1034
|
+
}),
|
|
1035
|
+
p("div", {
|
|
1036
|
+
className: "flex-1 flex flex-col gap-1",
|
|
1037
|
+
children: [
|
|
1038
|
+
p("div", {
|
|
1039
|
+
className: "flex items-baseline gap-2 flex-wrap",
|
|
1040
|
+
children: [
|
|
1041
|
+
p("span", {
|
|
1042
|
+
className: "font-semibold text-[11px] px-1.5 py-0.5 rounded",
|
|
1043
|
+
style: {
|
|
1044
|
+
color: t.errorLocation,
|
|
1045
|
+
backgroundColor: i === "dark" ? "rgba(34, 211, 238, 0.1)" : "rgba(8, 145, 178, 0.1)"
|
|
1046
|
+
},
|
|
1047
|
+
children: [
|
|
1048
|
+
"Line ",
|
|
1049
|
+
s.line + 1,
|
|
1050
|
+
":",
|
|
1051
|
+
s.column + 1
|
|
1052
|
+
]
|
|
1053
|
+
}),
|
|
1054
|
+
a("span", {
|
|
1055
|
+
className: "text-[10px] px-1.5 py-0.5 rounded opacity-70",
|
|
1056
|
+
style: {
|
|
1057
|
+
backgroundColor: i === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)"
|
|
1058
|
+
},
|
|
1059
|
+
children: s.code
|
|
1060
|
+
})
|
|
1061
|
+
]
|
|
1062
|
+
}),
|
|
1063
|
+
a("span", {
|
|
1064
|
+
className: "text-[11px] leading-relaxed",
|
|
1065
|
+
style: {
|
|
1066
|
+
color: t.errorMessage
|
|
1067
|
+
},
|
|
1068
|
+
children: s.message
|
|
1069
|
+
})
|
|
1070
|
+
]
|
|
1071
|
+
}),
|
|
1072
|
+
a("svg", {
|
|
1073
|
+
width: "14",
|
|
1074
|
+
height: "14",
|
|
1075
|
+
viewBox: "0 0 24 24",
|
|
1076
|
+
fill: "none",
|
|
1077
|
+
stroke: "currentColor",
|
|
1078
|
+
strokeWidth: "2",
|
|
1079
|
+
strokeLinecap: "round",
|
|
1080
|
+
strokeLinejoin: "round",
|
|
1081
|
+
className: "shrink-0 mt-1 cursor-pointer transition-opacity",
|
|
1082
|
+
style: {
|
|
1083
|
+
color: A === u ? "#22c55e" : t.errorMessage,
|
|
1084
|
+
opacity: A === u ? 1 : 0.3
|
|
1085
|
+
},
|
|
1086
|
+
onClick: (x) => {
|
|
1087
|
+
x.stopPropagation(), navigator.clipboard.writeText(s.message), o(u), setTimeout(() => o(null), 2e3);
|
|
1088
|
+
},
|
|
1089
|
+
children: A === u ? a("polyline", {
|
|
1090
|
+
points: "20 6 9 17 4 12"
|
|
1091
|
+
}) : p(M, {
|
|
1092
|
+
children: [
|
|
1093
|
+
a("rect", {
|
|
1094
|
+
x: "9",
|
|
1095
|
+
y: "9",
|
|
1096
|
+
width: "13",
|
|
1097
|
+
height: "13",
|
|
1098
|
+
rx: "2",
|
|
1099
|
+
ry: "2"
|
|
1100
|
+
}),
|
|
1101
|
+
a("path", {
|
|
1102
|
+
d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
|
|
1103
|
+
})
|
|
1104
|
+
]
|
|
1105
|
+
})
|
|
1106
|
+
})
|
|
1107
|
+
]
|
|
1108
|
+
}, u))
|
|
1109
|
+
})
|
|
1110
|
+
]
|
|
1111
|
+
})
|
|
1129
1112
|
]
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
};
|
|
1113
|
+
})
|
|
1114
|
+
]
|
|
1115
|
+
});
|
|
1116
|
+
};
|
|
1117
|
+
})();
|
|
1135
1118
|
export {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1119
|
+
ne as ABC_ACCIDENTAL_PATTERN,
|
|
1120
|
+
ge as ABC_ANNOTATION_PATTERN,
|
|
1121
|
+
ie as ABC_BAR_PATTERN,
|
|
1122
|
+
Ce as ABC_BROKEN_RHYTHM_PATTERN,
|
|
1123
|
+
le as ABC_CHORD_BRACKET_PATTERN,
|
|
1124
|
+
me as ABC_CHORD_SYMBOL_PATTERN,
|
|
1125
|
+
Q as ABC_COMMANDS,
|
|
1126
|
+
Te as ABC_COMMENT_PATTERN,
|
|
1127
|
+
fe as ABC_DECORATION_PATTERN,
|
|
1128
|
+
ce as ABC_DURATION_PATTERN,
|
|
1129
|
+
z as ABC_FIELD_PATTERN,
|
|
1130
|
+
he as ABC_GRACE_NOTE_PATTERN,
|
|
1131
|
+
ve as ABC_INLINE_FIELD_PATTERN,
|
|
1132
|
+
re as ABC_NOTE_PATTERN,
|
|
1133
|
+
oe as ABC_OCTAVE_PATTERN,
|
|
1134
|
+
pe as ABC_ORNAMENT_PATTERN,
|
|
1135
|
+
de as ABC_REST_PATTERN,
|
|
1136
|
+
se as ABC_SLUR_PATTERN,
|
|
1137
|
+
G as ABC_SUGGESTIONS,
|
|
1138
|
+
ue as ABC_TIE_PATTERN,
|
|
1139
|
+
ae as ABC_TUPLET_PATTERN,
|
|
1140
|
+
be as ABC_VOLTA_BRACKET_PATTERN,
|
|
1141
|
+
ye as AbcEditor,
|
|
1142
|
+
X as SuggestionList,
|
|
1143
|
+
__tla,
|
|
1144
|
+
V as highlightAbc,
|
|
1145
|
+
J as useAbcAutoComplete,
|
|
1146
|
+
$ as useLineNumbers,
|
|
1147
|
+
Z as validateAbc
|
|
1164
1148
|
};
|