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