vue3-math-editor 0.1.1 → 0.2.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/LICENSE +14 -0
- package/README.md +4 -0
- package/dist/style.css +1 -1
- package/dist/types/components/EquationWorkbench.vue.d.ts +13 -3
- package/dist/types/editor/mathmlImport.d.ts +1 -0
- package/dist/types/editor/parse.d.ts +1 -0
- package/dist/types/editor/toolbar.d.ts +18 -0
- package/dist/types/editor/units.d.ts +4 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/vue3-math-editor.js +1515 -1389
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright 2026 University of Auckland
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
package/README.md
CHANGED
package/dist/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.math-field[data-v-5fff49cc]{cursor:text;border-radius:6px;outline:none;align-items:center;min-height:3.4rem;padding:.55rem .8rem;font-size:1.35rem;display:flex;position:relative;overflow-x:auto}.math-field.focused[data-v-5fff49cc]{box-shadow:0 0 0 2px #2563eb59}.math-content[data-v-5fff49cc]{z-index:1;min-width:0;position:relative}.selection[data-v-5fff49cc]{z-index:0;pointer-events:none;background:#94a3b84d;border-radius:3px;position:absolute}.row-tint[data-v-5fff49cc]{z-index:0;pointer-events:none;background:#2563eb12;border-radius:3px;position:absolute;box-shadow:inset 0 0 0 1px #2563eb2e}.math-field.focused .selection[data-v-5fff49cc]{background:#2563eb33}.mark[data-v-5fff49cc]{z-index:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3'%3E%3Cpath d='M0 2.5 L1.5 0.5 L3 2.5 L4.5 0.5 L6 2.5' fill='none' stroke='%23dc2626' stroke-width='1'/%3E%3C/svg%3E") 0 100%/6px 3px repeat-x,#dc262614;border-radius:2px;position:absolute}.mark-units[data-v-5fff49cc]{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3'%3E%3Cpath d='M0 2.5 L1.5 0.5 L3 2.5 L4.5 0.5 L6 2.5' fill='none' stroke='%23d97706' stroke-width='1'/%3E%3C/svg%3E") 0 100%/6px 3px repeat-x,#d977061a}.math-field[data-v-5fff49cc] .me-units{color:#60a5fa}.math-field[data-v-5fff49cc] .me-ph.me-units-ph{color:#60a5fa;border:1px dashed #60a5fa;border-radius:3px;padding:0 .15em}.math-field.focused[data-v-5fff49cc] .me-units-ph.me-ph-active{color:#3b82f6;background:#60a5fa1f}.math-field[data-v-5fff49cc] .me-units-flag{width:0;height:0;display:inline-block;position:relative}.math-field[data-v-5fff49cc] .me-units-flag:after{content:"";border-top:.22em solid #60a5fa;border-left:.22em solid #0000;position:absolute;bottom:.52em;right:-.05em}.mark-tip[data-v-5fff49cc]{z-index:10;color:#f8fafc;white-space:normal;pointer-events:none;background:#1e293b;border-radius:.35rem;width:max-content;max-width:24rem;padding:.25rem .5rem;font-size:.75rem;line-height:1.3;position:fixed}.caret[data-v-5fff49cc]{z-index:2;pointer-events:none;background:#2563eb;width:2px;margin-left:-1px;animation:1.1s step-end infinite math-field-blink-5fff49cc;position:absolute}.math-field[data-v-5fff49cc] .katex-display{text-align:left;margin:0}.math-field[data-v-5fff49cc] .katex-display>.katex{text-align:left}.math-field[data-v-5fff49cc] .me-ph{color:#94a3b8}.math-field.focused[data-v-5fff49cc] .me-ph-active{color:#2563eb;background:#2563eb1f;border-radius:2px}@keyframes math-field-blink-5fff49cc{50%{opacity:0}}.editor-grid[data-v-f254c309]{--me-accent:var(--math-editor-accent,#2563eb);--me-surface:var(--p-content-background,#fff);--me-subtle:var(--p-content-hover-background,#f1f5f9);--me-border:var(--p-content-border-color,#e2e8f0);--me-border-strong:var(--p-form-field-border-color,#cbd5e1);--me-text:var(--p-text-color,#0f172a);--me-muted:var(--p-text-muted-color,#64748b);--me-warn:#d97706;--me-caution:#ea580c;outline:none;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);grid-template-areas:"editor outputs";align-items:start;gap:1rem;max-width:1240px;margin:0 auto;display:grid}.editor-grid.has-side[data-v-f254c309]{grid-template-rows:auto 1fr;grid-template-areas:"editor side""outputs side"}.editor-grid.no-outputs[data-v-f254c309]{grid-template-columns:minmax(0,1fr);grid-template-areas:"editor"}.editor-grid.no-outputs.has-side[data-v-f254c309]{grid-template:"editor side"/minmax(0,1.35fr) minmax(0,1fr)}.editor-card[data-v-f254c309]{grid-area:editor;min-width:0}.output-card[data-v-f254c309]{grid-area:outputs;min-width:0}.side-column[data-v-f254c309]{grid-area:side;align-self:start;min-width:0;position:sticky;top:1rem}.header-row[data-v-f254c309]{justify-content:space-between;align-items:center;gap:.5rem;display:flex}.preview-title-row[data-v-f254c309]{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.toolbar[data-v-f254c309]{flex-wrap:wrap;align-items:center;gap:.9rem;display:flex}.toolbar-group[data-v-f254c309]{flex-wrap:wrap;align-items:center;gap:.35rem;display:flex}.tool-button[data-v-f254c309]{border:1px solid var(--me-border-strong);background:var(--me-surface);min-width:2.6rem;height:2.6rem;color:var(--me-text);cursor:pointer;border-radius:.5rem;justify-content:center;align-items:center;padding:.25rem .5rem;font-size:.82rem;transition:border-color .12s,background .12s,box-shadow .12s;display:inline-flex}.tool-button[data-v-f254c309]:hover{border-color:var(--me-accent);background:color-mix(in srgb, var(--me-accent) 8%, var(--me-surface))}.tool-button[data-v-f254c309]:active{box-shadow:inset 0 1px 3px #0f172a26}.tool-button-op[data-v-f254c309]{min-width:2.2rem;height:2.2rem;font-size:.95rem}.equations-stack[data-v-f254c309]{flex-direction:column;gap:.6rem;display:flex}.equation-row[data-v-f254c309]{border:1px solid var(--me-border);background:var(--me-surface);color:var(--me-text);border-radius:.65rem;align-items:stretch;gap:.5rem;transition:border-color .12s,box-shadow .12s;display:flex}.equation-row.active[data-v-f254c309]{border-color:var(--me-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--me-accent) 12%, transparent)}.equation-label[data-v-f254c309]{color:var(--me-muted);font-variant-numeric:tabular-nums;border-right:1px solid var(--me-border);align-items:center;padding:0 .4rem 0 .65rem;font-size:.75rem;display:flex}.equation-field[data-v-f254c309]{flex:1;min-width:0}.equation-field.focused[data-v-f254c309]{box-shadow:none}.command-chip[data-v-f254c309]{color:#e2e8f0;background:#0f172a;border-radius:.45rem;align-items:center;margin-top:.75rem;padding:.25rem .6rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:.9rem;display:inline-flex}.command-slash[data-v-f254c309]{color:#7dd3fc}.command-caret[data-v-f254c309]{background:#e2e8f0;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite chip-blink-f254c309}@keyframes chip-blink-f254c309{50%{opacity:0}}.focus-meta[data-v-f254c309]{color:var(--me-muted);margin:.75rem 0 0;font-size:.8rem}.diagnostics[data-v-f254c309]{background:color-mix(in srgb, var(--me-warn) 16%, var(--me-surface));color:color-mix(in srgb, var(--me-warn) 55%, var(--me-text));border-radius:.45rem;margin:.5rem 0 0;padding:.4rem .6rem .4rem 1.6rem;font-size:.8rem}.import-notice[data-v-f254c309]{background:color-mix(in srgb, var(--me-accent) 8%, var(--me-surface));color:color-mix(in srgb, var(--me-accent) 45%, var(--me-text));border-radius:.5rem;margin:.5rem 0 0;padding:.35rem .6rem;font-size:.8rem}.import-notice-head[data-v-f254c309]{justify-content:space-between;align-items:center;gap:.5rem;display:flex}.import-notice ul[data-v-f254c309]{color:color-mix(in srgb, var(--me-caution) 55%, var(--me-text));margin:.2rem 0 .1rem;padding-left:1.1rem}.units-issues[data-v-f254c309]{background:color-mix(in srgb, var(--me-caution) 14%, var(--me-surface));color:color-mix(in srgb, var(--me-caution) 55%, var(--me-text))}.output-actions[data-v-f254c309]{justify-content:flex-end;margin-bottom:.25rem;display:flex}.tab-tag[data-v-f254c309]{margin-left:.4rem;padding:.05rem .35rem;font-size:.7rem}.key-help[data-v-f254c309]{margin-top:.75rem}.key-help summary[data-v-f254c309]{cursor:pointer;width:fit-content;color:var(--me-muted);font-size:.85rem}.key-hint[data-v-f254c309]{color:var(--me-muted);margin:.5rem 0 0;font-size:.8rem;line-height:1.5}.key-hint kbd[data-v-f254c309]{border:1px solid var(--me-border-strong);background:var(--me-subtle);border-bottom-width:2px;border-radius:.3rem;margin:0 .08rem;padding:0 .3rem;font-family:inherit;font-size:.72rem;display:inline-block}.key-hint code[data-v-f254c309]{background:var(--me-subtle);border-radius:.25rem;padding:.05rem .3rem}.output-card pre[data-v-f254c309]{color:#e2e8f0;background:#0f172a;border-radius:.55rem;max-height:28rem;margin:0;padding:.85rem;font-size:.83rem;line-height:1.35;overflow:auto}@media (width<=900px){.editor-grid[data-v-f254c309],.editor-grid.has-side[data-v-f254c309],.editor-grid.no-outputs.has-side[data-v-f254c309]{grid-template-rows:none;grid-template-columns:minmax(0,1fr);grid-template-areas:"editor""side""outputs"}.side-column[data-v-f254c309]{position:static}}.units-form[data-v-effe158e]{background:#f8fbff;border:1px solid #bfdbfe;border-radius:.5rem;margin-top:.5rem;padding:.6rem}.form-name[data-v-effe158e]{color:#334155;align-items:center;gap:.5rem;font-size:.85rem;display:flex}.form-name input[data-v-effe158e]{flex:1}input[data-v-effe158e],select[data-v-effe158e]{font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:.3rem;min-width:0;padding:.2rem .35rem;font-size:.85rem}input[data-v-effe158e]:focus,select[data-v-effe158e]:focus{outline-offset:0;border-color:#60a5fa;outline:2px solid #93c5fd}.form-parts[data-v-effe158e]{border-collapse:collapse;width:100%;margin-top:.5rem}.form-parts th[data-v-effe158e]{color:#64748b;text-align:left;padding:0 .25rem .15rem 0;font-size:.72rem;font-weight:600}.form-parts td[data-v-effe158e]{padding:.1rem .25rem .1rem 0}.form-parts td input[data-v-effe158e],.form-parts td select[data-v-effe158e]{width:100%}.form-parts .number[data-v-effe158e]{width:4.5rem}.form-problems[data-v-effe158e]{color:#b91c1c;margin:.4rem 0 0;padding-left:1.1rem;font-size:.82rem}.form-actions[data-v-effe158e]{align-items:center;gap:.25rem;margin-top:.4rem;display:flex}.spacer[data-v-effe158e]{flex:1}.visually-hidden[data-v-effe158e]{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.units-title[data-v-ada663af]{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.units-section+.units-section[data-v-ada663af]{margin-top:1.25rem}.section-head[data-v-ada663af]{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;display:flex}.section-head h3[data-v-ada663af]{color:#0f172a;margin:0;font-size:.95rem;font-weight:600}.section-actions[data-v-ada663af]{align-items:center;gap:.25rem;display:flex}.hint[data-v-ada663af]{color:#64748b;margin:.4rem 0 0;font-size:.875rem}.files[data-v-ada663af]{gap:.5rem;margin:.5rem 0 0;padding:0;list-style:none;display:grid}.files>li[data-v-ada663af]{background:#fff;border:1px solid #e2e8f0;border-radius:.5rem;padding:.4rem .6rem}.file-head[data-v-ada663af]{align-items:center;gap:.5rem;display:flex}.file-name[data-v-ada663af]{color:#0f172a;overflow-wrap:anywhere;font-weight:600}.file-count[data-v-ada663af]{color:#64748b;flex:1;font-size:.8rem}.units-names[data-v-ada663af]{flex-wrap:wrap;gap:.25rem;margin-top:.25rem;display:flex}.units-names code[data-v-ada663af]{color:#334155;background:#f1f5f9;border-radius:.25rem;padding:.05rem .35rem;font-size:.78rem}.problems[data-v-ada663af]{color:#92400e;margin:.4rem 0 .1rem;padding-left:1.1rem;font-size:.82rem}.new-units[data-v-ada663af]{gap:.25rem;margin:.5rem 0 0;padding:0;list-style:none;display:grid}.new-units-row[data-v-ada663af]{align-items:center;gap:.4rem;display:flex}.new-units-name[data-v-ada663af]{color:#1d4ed8;background:#eff6ff;border-radius:.25rem;padding:.05rem .35rem;font-size:.85rem}.new-units-definition[data-v-ada663af]{color:#334155;overflow-wrap:anywhere;flex:1;font-size:.85rem}.missing-count[data-v-ada663af]{color:#b45309;font-size:.82rem}.variables[data-v-ada663af]{border-collapse:collapse;width:100%;margin-top:.5rem}.variables th[data-v-ada663af],.variables td[data-v-ada663af]{text-align:left;vertical-align:middle;padding:.2rem .5rem .2rem 0}.variables th[data-v-ada663af]{width:1%;padding-right:1rem}.variables td[data-v-ada663af]:nth-child(2){width:16rem}.variable-name[data-v-ada663af]{white-space:nowrap;color:#0f172a;font-family:KaTeX_Math,Times New Roman,serif;font-size:1.05rem;font-style:italic;font-weight:400}.units-input[data-v-ada663af]{width:100%;min-width:8rem;max-width:16rem;font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:.375rem;padding:.25rem .45rem;font-size:.9rem}.units-input[data-v-ada663af]:focus{outline-offset:0;border-color:#60a5fa;outline:2px solid #93c5fd}.state-missing .units-input[data-v-ada663af],.state-unknown .units-input[data-v-ada663af]{background:#fffbeb;border-color:#f59e0b}.variable-state[data-v-ada663af]{white-space:nowrap;color:#b45309;font-size:.8rem}.unused .variable-name[data-v-ada663af],.unused .variable-state[data-v-ada663af]{color:#94a3b8}
|
|
1
|
+
.math-field[data-v-12da93b7]{font-size:var(--me-line-font-size,1.05rem);cursor:text;border-radius:6px;outline:none;align-items:center;min-height:2.6rem;padding:.45rem .7rem;display:flex;position:relative;overflow-x:auto}.math-field.focused[data-v-12da93b7]{box-shadow:0 0 0 2px #2563eb59}.math-content[data-v-12da93b7]{z-index:1;min-width:0;position:relative}.selection[data-v-12da93b7]{z-index:0;pointer-events:none;background:#94a3b84d;border-radius:3px;position:absolute}.row-tint[data-v-12da93b7]{z-index:0;pointer-events:none;background:#2563eb12;border-radius:3px;position:absolute;box-shadow:inset 0 0 0 1px #2563eb2e}.math-field.focused .selection[data-v-12da93b7]{background:#2563eb33}.mark[data-v-12da93b7]{z-index:0;pointer-events:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3'%3E%3Cpath d='M0 2.5 L1.5 0.5 L3 2.5 L4.5 0.5 L6 2.5' fill='none' stroke='%23dc2626' stroke-width='1'/%3E%3C/svg%3E") 0 100%/6px 3px repeat-x,#dc262614;border-radius:2px;position:absolute}.mark-units[data-v-12da93b7]{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3'%3E%3Cpath d='M0 2.5 L1.5 0.5 L3 2.5 L4.5 0.5 L6 2.5' fill='none' stroke='%23d97706' stroke-width='1'/%3E%3C/svg%3E") 0 100%/6px 3px repeat-x,#d977061a}.math-field[data-v-12da93b7] .me-units{color:#60a5fa}.math-field[data-v-12da93b7] .me-ph.me-units-ph{color:#60a5fa;border:1px dashed #60a5fa;border-radius:3px;padding:0 .15em}.math-field.focused[data-v-12da93b7] .me-units-ph.me-ph-active{color:#3b82f6;background:#60a5fa1f}.math-field[data-v-12da93b7] .me-units-flag{width:0;height:0;display:inline-block;position:relative}.math-field[data-v-12da93b7] .me-units-flag:after{content:"";border-top:.22em solid #60a5fa;border-left:.22em solid #0000;position:absolute;bottom:.52em;right:-.05em}.mark-tip[data-v-12da93b7]{z-index:10;color:#f8fafc;white-space:normal;pointer-events:none;background:#1e293b;border-radius:.35rem;width:max-content;max-width:24rem;padding:.25rem .5rem;font-size:.75rem;line-height:1.3;position:fixed}.caret[data-v-12da93b7]{z-index:2;pointer-events:none;background:#2563eb;width:2px;margin-left:-1px;animation:1.1s step-end infinite math-field-blink-12da93b7;position:absolute}.math-field[data-v-12da93b7] .katex-display{text-align:left;margin:0}.math-field[data-v-12da93b7] .katex-display>.katex{text-align:left}.math-field[data-v-12da93b7] .me-ph{color:#94a3b8}.math-field.focused[data-v-12da93b7] .me-ph-active{color:#2563eb;background:#2563eb1f;border-radius:2px}@keyframes math-field-blink-12da93b7{50%{opacity:0}}.editor-grid[data-v-5c897b39],.gallery[data-v-5c897b39]{--me-accent:var(--math-editor-accent,#2563eb);--me-surface:var(--p-content-background,#fff);--me-subtle:var(--p-content-hover-background,#f1f5f9);--me-border:var(--p-content-border-color,#e2e8f0);--me-border-strong:var(--p-form-field-border-color,#cbd5e1);--me-text:var(--p-text-color,#0f172a);--me-muted:var(--p-text-muted-color,#64748b);--me-warn:#d97706;--me-caution:#ea580c;--me-danger:#dc2626;outline:none;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);grid-template-areas:"editor outputs";align-items:start;gap:1rem;max-width:1240px;margin:0 auto;display:grid}.editor-grid.has-side[data-v-5c897b39]{grid-template-rows:auto 1fr;grid-template-areas:"editor side""outputs side"}.editor-grid.no-outputs[data-v-5c897b39]{grid-template-columns:minmax(0,1fr);grid-template-areas:"editor"}.editor-grid.no-outputs.has-side[data-v-5c897b39]{grid-template:"editor side"/minmax(0,1.35fr) minmax(0,1fr)}.editor-panel[data-v-5c897b39]{border:1px solid var(--me-border);background:var(--me-surface);min-width:0;color:var(--me-text);border-radius:.75rem;grid-area:editor;padding:0 1rem .85rem}.output-card[data-v-5c897b39]{grid-area:outputs;min-width:0}.side-column[data-v-5c897b39]{grid-area:side;align-self:start;min-width:0;position:sticky;top:1rem}.toolbar[data-v-5c897b39]{top:var(--me-toolbar-top,0);z-index:2;border-bottom:1px solid var(--me-border);background:var(--me-surface);flex-wrap:wrap;align-items:center;gap:.35rem .75rem;margin:0 0 .6rem;padding:.5rem 0;display:flex;position:sticky}.toolbar-group[data-v-5c897b39]{flex-wrap:wrap;align-items:center;gap:.25rem;display:flex}.toolbar-lines[data-v-5c897b39] .p-button{width:2rem;height:2rem;padding:0}.tool-button[data-v-5c897b39]{border:1px solid var(--me-border-strong);background:var(--me-surface);min-width:2rem;height:2rem;color:var(--me-text);cursor:pointer;border-radius:.45rem;justify-content:center;align-items:center;padding:0 .35rem;font-size:.72rem;transition:border-color .12s,background .12s,box-shadow .12s;display:inline-flex}.tool-button[data-v-5c897b39]:disabled{opacity:.45;cursor:default}.tool-chevron[data-v-5c897b39]{color:var(--me-muted);margin-left:.2rem;font-size:.55rem}.tool-button[data-v-5c897b39]:hover:not(:disabled){border-color:var(--me-accent);background:color-mix(in srgb, var(--me-accent) 8%, var(--me-surface))}.tool-button[data-v-5c897b39]:active{box-shadow:inset 0 1px 3px #0f172a26}.gallery[data-v-5c897b39]{flex-direction:column;gap:.5rem;max-width:22rem;display:flex}.gallery-label[data-v-5c897b39]{color:var(--me-muted);margin-bottom:.25rem;font-size:.72rem}.gallery-items[data-v-5c897b39]{flex-wrap:wrap;gap:.25rem;display:flex}.gallery .tool-button[data-v-5c897b39]{min-width:2.4rem;font-size:.8rem}.equations-stack[data-v-5c897b39]{flex-direction:column;gap:.6rem;display:flex}.equation-row[data-v-5c897b39]{border:1px solid var(--me-border);background:var(--me-surface);color:var(--me-text);border-radius:.65rem;align-items:stretch;gap:.5rem;transition:border-color .12s,box-shadow .12s;display:flex}.equation-row.active[data-v-5c897b39]{border-color:var(--me-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--me-accent) 12%, transparent)}.equation-row.has-error[data-v-5c897b39]{border-color:var(--me-danger)}.equation-row.has-units-issue[data-v-5c897b39]{border-color:var(--me-warn)}.equation-row.active.has-error[data-v-5c897b39]{box-shadow:0 0 0 3px color-mix(in srgb, var(--me-danger) 14%, transparent)}.equation-row.active.has-units-issue[data-v-5c897b39]{box-shadow:0 0 0 3px color-mix(in srgb, var(--me-warn) 16%, transparent)}.equation-label[data-v-5c897b39]{color:var(--me-muted);font-variant-numeric:tabular-nums;border-right:1px solid var(--me-border);align-items:center;padding:0 .4rem 0 .65rem;font-size:.75rem;display:flex}.equation-field[data-v-5c897b39]{flex:1;min-width:0}.equation-field.focused[data-v-5c897b39]{box-shadow:none}.status-bar[data-v-5c897b39]{white-space:nowrap;border-radius:.45rem;align-items:center;gap:.5rem;height:1.75rem;margin-top:.5rem;padding:0 .6rem;font-size:.8rem;display:flex;overflow:hidden}.status-text[data-v-5c897b39]{text-overflow:ellipsis;min-width:0;overflow:hidden}.status-more[data-v-5c897b39]{opacity:.75;flex:none}.status-error[data-v-5c897b39],.status-units[data-v-5c897b39]{cursor:pointer}.status-error[data-v-5c897b39]{background:color-mix(in srgb, var(--me-danger) 12%, var(--me-surface));color:color-mix(in srgb, var(--me-danger) 55%, var(--me-text))}.status-units[data-v-5c897b39]{background:color-mix(in srgb, var(--me-caution) 14%, var(--me-surface));color:color-mix(in srgb, var(--me-caution) 55%, var(--me-text))}.status-info[data-v-5c897b39]{background:color-mix(in srgb, var(--me-accent) 8%, var(--me-surface));color:color-mix(in srgb, var(--me-accent) 45%, var(--me-text))}.status-command[data-v-5c897b39]{padding:0}.command-chip[data-v-5c897b39]{color:#e2e8f0;background:#0f172a;border-radius:.45rem;align-items:center;height:100%;padding:0 .6rem;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:.9rem;display:inline-flex}.command-slash[data-v-5c897b39]{color:#7dd3fc}.command-caret[data-v-5c897b39]{background:#e2e8f0;width:2px;height:1em;margin-left:2px;animation:1s step-end infinite chip-blink-5c897b39}@keyframes chip-blink-5c897b39{50%{opacity:0}}.focus-meta[data-v-5c897b39]{color:var(--me-muted);margin:.75rem 0 0;font-size:.8rem}.output-actions[data-v-5c897b39]{justify-content:flex-end;margin-bottom:.25rem;display:flex}.tab-tag[data-v-5c897b39]{margin-left:.4rem;padding:.05rem .35rem;font-size:.7rem}.key-help[data-v-5c897b39]{margin-top:.75rem}.key-help summary[data-v-5c897b39]{cursor:pointer;width:fit-content;color:var(--me-muted);font-size:.85rem}.key-hint[data-v-5c897b39]{color:var(--me-muted);margin:.5rem 0 0;font-size:.8rem;line-height:1.5}.key-hint kbd[data-v-5c897b39]{border:1px solid var(--me-border-strong);background:var(--me-subtle);border-bottom-width:2px;border-radius:.3rem;margin:0 .08rem;padding:0 .3rem;font-family:inherit;font-size:.72rem;display:inline-block}.key-hint code[data-v-5c897b39]{background:var(--me-subtle);border-radius:.25rem;padding:.05rem .3rem}.output-card pre[data-v-5c897b39]{color:#e2e8f0;background:#0f172a;border-radius:.55rem;max-height:28rem;margin:0;padding:.85rem;font-size:.83rem;line-height:1.35;overflow:auto}@media (width<=900px){.editor-grid[data-v-5c897b39],.editor-grid.has-side[data-v-5c897b39],.editor-grid.no-outputs.has-side[data-v-5c897b39]{grid-template-rows:none;grid-template-columns:minmax(0,1fr);grid-template-areas:"editor""side""outputs"}.side-column[data-v-5c897b39]{position:static}}.units-form[data-v-effe158e]{background:#f8fbff;border:1px solid #bfdbfe;border-radius:.5rem;margin-top:.5rem;padding:.6rem}.form-name[data-v-effe158e]{color:#334155;align-items:center;gap:.5rem;font-size:.85rem;display:flex}.form-name input[data-v-effe158e]{flex:1}input[data-v-effe158e],select[data-v-effe158e]{font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:.3rem;min-width:0;padding:.2rem .35rem;font-size:.85rem}input[data-v-effe158e]:focus,select[data-v-effe158e]:focus{outline-offset:0;border-color:#60a5fa;outline:2px solid #93c5fd}.form-parts[data-v-effe158e]{border-collapse:collapse;width:100%;margin-top:.5rem}.form-parts th[data-v-effe158e]{color:#64748b;text-align:left;padding:0 .25rem .15rem 0;font-size:.72rem;font-weight:600}.form-parts td[data-v-effe158e]{padding:.1rem .25rem .1rem 0}.form-parts td input[data-v-effe158e],.form-parts td select[data-v-effe158e]{width:100%}.form-parts .number[data-v-effe158e]{width:4.5rem}.form-problems[data-v-effe158e]{color:#b91c1c;margin:.4rem 0 0;padding-left:1.1rem;font-size:.82rem}.form-actions[data-v-effe158e]{align-items:center;gap:.25rem;margin-top:.4rem;display:flex}.spacer[data-v-effe158e]{flex:1}.visually-hidden[data-v-effe158e]{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.units-title[data-v-ada663af]{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.units-section+.units-section[data-v-ada663af]{margin-top:1.25rem}.section-head[data-v-ada663af]{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;display:flex}.section-head h3[data-v-ada663af]{color:#0f172a;margin:0;font-size:.95rem;font-weight:600}.section-actions[data-v-ada663af]{align-items:center;gap:.25rem;display:flex}.hint[data-v-ada663af]{color:#64748b;margin:.4rem 0 0;font-size:.875rem}.files[data-v-ada663af]{gap:.5rem;margin:.5rem 0 0;padding:0;list-style:none;display:grid}.files>li[data-v-ada663af]{background:#fff;border:1px solid #e2e8f0;border-radius:.5rem;padding:.4rem .6rem}.file-head[data-v-ada663af]{align-items:center;gap:.5rem;display:flex}.file-name[data-v-ada663af]{color:#0f172a;overflow-wrap:anywhere;font-weight:600}.file-count[data-v-ada663af]{color:#64748b;flex:1;font-size:.8rem}.units-names[data-v-ada663af]{flex-wrap:wrap;gap:.25rem;margin-top:.25rem;display:flex}.units-names code[data-v-ada663af]{color:#334155;background:#f1f5f9;border-radius:.25rem;padding:.05rem .35rem;font-size:.78rem}.problems[data-v-ada663af]{color:#92400e;margin:.4rem 0 .1rem;padding-left:1.1rem;font-size:.82rem}.new-units[data-v-ada663af]{gap:.25rem;margin:.5rem 0 0;padding:0;list-style:none;display:grid}.new-units-row[data-v-ada663af]{align-items:center;gap:.4rem;display:flex}.new-units-name[data-v-ada663af]{color:#1d4ed8;background:#eff6ff;border-radius:.25rem;padding:.05rem .35rem;font-size:.85rem}.new-units-definition[data-v-ada663af]{color:#334155;overflow-wrap:anywhere;flex:1;font-size:.85rem}.missing-count[data-v-ada663af]{color:#b45309;font-size:.82rem}.variables[data-v-ada663af]{border-collapse:collapse;width:100%;margin-top:.5rem}.variables th[data-v-ada663af],.variables td[data-v-ada663af]{text-align:left;vertical-align:middle;padding:.2rem .5rem .2rem 0}.variables th[data-v-ada663af]{width:1%;padding-right:1rem}.variables td[data-v-ada663af]:nth-child(2){width:16rem}.variable-name[data-v-ada663af]{white-space:nowrap;color:#0f172a;font-family:KaTeX_Math,Times New Roman,serif;font-size:1.05rem;font-style:italic;font-weight:400}.units-input[data-v-ada663af]{width:100%;min-width:8rem;max-width:16rem;font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:.375rem;padding:.25rem .45rem;font-size:.9rem}.units-input[data-v-ada663af]:focus{outline-offset:0;border-color:#60a5fa;outline:2px solid #93c5fd}.state-missing .units-input[data-v-ada663af],.state-unknown .units-input[data-v-ada663af]{background:#fffbeb;border-color:#f59e0b}.variable-state[data-v-ada663af]{white-space:nowrap;color:#b45309;font-size:.8rem}.unused .variable-name[data-v-ada663af],.unused .variable-state[data-v-ada663af]{color:#94a3b8}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EquationLine, type EquationsChangeInfo, type UnitsIssue, type VariableUnits } from '../editor/units';
|
|
1
|
+
import { type EquationLine, type EquationsChangeInfo, type LineCommitInfo, type UnitsIssue, type VariableUnits } from '../editor/units';
|
|
2
2
|
import { type MathMLImport } from '../editor/mathmlImport';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
cellml?: boolean;
|
|
@@ -7,27 +7,37 @@ type __VLS_Props = {
|
|
|
7
7
|
greekNames?: boolean;
|
|
8
8
|
outputs?: boolean;
|
|
9
9
|
history?: boolean;
|
|
10
|
+
validate?: 'input' | 'commit';
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
autofocus?: boolean;
|
|
13
|
+
debug?: boolean;
|
|
10
14
|
};
|
|
11
15
|
declare function focusActive(): void;
|
|
12
16
|
declare function setMathML(xml: string): MathMLImport;
|
|
13
|
-
declare var
|
|
17
|
+
declare var __VLS_65: {};
|
|
14
18
|
type __VLS_Slots = {} & {
|
|
15
|
-
side?: (props: typeof
|
|
19
|
+
side?: (props: typeof __VLS_65) => any;
|
|
16
20
|
};
|
|
17
21
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
18
22
|
setMathML: typeof setMathML;
|
|
19
23
|
focus: typeof focusActive;
|
|
20
24
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
25
|
"equations-change": (lines: EquationLine[], info: EquationsChangeInfo) => any;
|
|
26
|
+
"line-commit": (line: EquationLine, info: LineCommitInfo) => any;
|
|
22
27
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
28
|
"onEquations-change"?: ((lines: EquationLine[], info: EquationsChangeInfo) => any) | undefined;
|
|
29
|
+
"onLine-commit"?: ((line: EquationLine, info: LineCommitInfo) => any) | undefined;
|
|
24
30
|
}>, {
|
|
31
|
+
autofocus: boolean;
|
|
32
|
+
readonly: boolean;
|
|
25
33
|
history: boolean;
|
|
26
34
|
cellml: boolean;
|
|
27
35
|
greekNames: boolean;
|
|
28
36
|
issues: readonly UnitsIssue[];
|
|
29
37
|
variableUnits: VariableUnits;
|
|
30
38
|
outputs: boolean;
|
|
39
|
+
validate: "input" | "commit";
|
|
40
|
+
debug: boolean;
|
|
31
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
42
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
43
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,6 +2,7 @@ import { type Row } from './layout';
|
|
|
2
2
|
export interface MathMLImport {
|
|
3
3
|
equations: Row[];
|
|
4
4
|
problems: string[];
|
|
5
|
+
lineProblems: string[][];
|
|
5
6
|
}
|
|
6
7
|
export declare function looksLikeContentMathML(text: string): boolean;
|
|
7
8
|
export declare function importContentMathML(text: string): MathMLImport | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Command } from './commands';
|
|
2
|
+
export interface ToolButton {
|
|
3
|
+
latex: string;
|
|
4
|
+
title: string;
|
|
5
|
+
command: Command;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolSection {
|
|
8
|
+
label?: string;
|
|
9
|
+
items: ToolButton[];
|
|
10
|
+
}
|
|
11
|
+
export interface ToolGroup {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
latex: string;
|
|
15
|
+
command?: Command;
|
|
16
|
+
sections?: ToolSection[];
|
|
17
|
+
}
|
|
18
|
+
export declare const TOOLBAR: readonly ToolGroup[];
|
|
@@ -11,6 +11,9 @@ export interface EquationLine {
|
|
|
11
11
|
export interface EquationsChangeInfo {
|
|
12
12
|
source: 'load' | 'edit';
|
|
13
13
|
}
|
|
14
|
+
export interface LineCommitInfo {
|
|
15
|
+
reason: 'enter' | 'new-line' | 'navigate' | 'blur' | 'paste';
|
|
16
|
+
}
|
|
14
17
|
export interface UnitsIssue {
|
|
15
18
|
lineId: string;
|
|
16
19
|
message: string;
|
|
@@ -19,6 +22,6 @@ export interface UnitsIssue {
|
|
|
19
22
|
units?: readonly string[];
|
|
20
23
|
}
|
|
21
24
|
export type VariableUnits = Readonly<Record<string, string>>;
|
|
22
|
-
export declare function equationLine(id: string, root: Row, parsed: ParseResult | null): EquationLine;
|
|
25
|
+
export declare function equationLine(id: string, root: Row, parsed: ParseResult | null, otherProblems?: number): EquationLine;
|
|
23
26
|
export declare function unitsIssueMarks(root: Row, issues: readonly UnitsIssue[]): Mark[];
|
|
24
27
|
export declare function unitsHintMarks(root: Row, variableUnits: VariableUnits | null): Mark[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as EquationWorkbench } from './components/EquationWorkbench.vue';
|
|
2
2
|
export { default as UnitsPanel } from './units/UnitsPanel.vue';
|
|
3
3
|
export { importContentMathML, type MathMLImport } from './editor/mathmlImport';
|
|
4
|
-
export type { EquationLine, EquationsChangeInfo, UnitsIssue, VariableUnits } from './editor/units';
|
|
4
|
+
export type { EquationLine, EquationsChangeInfo, LineCommitInfo, UnitsIssue, VariableUnits, } from './editor/units';
|
|
5
5
|
export { LIBCELLML_KEY, type ProvidedLibCellML, type UnitsCheckerOptions, type UnitsCheckerStatus, useUnitsChecker, } from './units/useUnitsChecker';
|
|
6
6
|
export type { UnitsDefinition, UnitsPart } from './units/definitions';
|
|
7
7
|
export type { UnitsSource, UnitsLibraryProblem } from './units/library';
|