vue3-math-editor 0.1.0 → 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.
Files changed (113) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +4 -0
  3. package/dist/style.css +2 -0
  4. package/dist/types/components/EquationWorkbench.vue.d.ts +49 -0
  5. package/dist/types/components/MathField.vue.d.ts +39 -0
  6. package/dist/types/editor/caretGeometry.d.ts +38 -0
  7. package/dist/types/editor/clipboard.d.ts +9 -0
  8. package/dist/types/editor/commands.d.ts +37 -0
  9. package/dist/types/editor/constants.d.ts +13 -0
  10. package/dist/types/editor/cursor.d.ts +16 -0
  11. package/dist/types/editor/exports.d.ts +13 -0
  12. package/dist/types/editor/history.d.ts +34 -0
  13. package/dist/types/editor/identifiers.d.ts +33 -0
  14. package/dist/types/editor/keymap.d.ts +7 -0
  15. package/dist/types/editor/layout.d.ts +82 -0
  16. package/dist/types/editor/marks.d.ts +8 -0
  17. package/dist/types/editor/mathmlImport.d.ts +8 -0
  18. package/dist/types/editor/names.d.ts +15 -0
  19. package/dist/types/editor/numberUnits.d.ts +15 -0
  20. package/dist/types/editor/numbers.d.ts +11 -0
  21. package/dist/types/editor/operators.d.ts +28 -0
  22. package/dist/types/editor/parse.d.ts +12 -0
  23. package/dist/types/editor/selection.d.ts +22 -0
  24. package/dist/types/editor/toolbar.d.ts +18 -0
  25. package/dist/types/editor/units.d.ts +27 -0
  26. package/dist/types/index.d.ts +8 -0
  27. package/dist/types/registry/nodes.d.ts +21 -0
  28. package/dist/types/renderers/layoutLatex.d.ts +17 -0
  29. package/dist/types/renderers/mathjson.d.ts +6 -0
  30. package/dist/types/renderers/mathml.d.ts +6 -0
  31. package/dist/types/types/ast.d.ts +97 -0
  32. package/dist/types/units/UnitsDefinitionForm.vue.d.ts +16 -0
  33. package/dist/types/units/UnitsPanel.vue.d.ts +56 -0
  34. package/dist/types/units/check.d.ts +16 -0
  35. package/dist/types/units/definitions.d.ts +16 -0
  36. package/dist/types/units/libcellml.d.ts +81 -0
  37. package/dist/types/units/library.d.ts +29 -0
  38. package/dist/types/units/messages.d.ts +13 -0
  39. package/dist/types/units/panel.d.ts +11 -0
  40. package/dist/types/units/useUnitsChecker.d.ts +36 -0
  41. package/dist/vue3-math-editor.js +5641 -0
  42. package/package.json +4 -3
  43. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  44. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  45. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  46. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  47. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  48. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  49. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  50. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  51. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  52. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  53. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  54. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  55. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  56. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  57. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  58. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  59. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  60. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  61. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  62. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  63. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  64. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  65. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  66. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  67. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  68. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  69. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  70. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  71. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  72. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  73. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  74. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  75. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  76. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  77. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  78. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  79. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  80. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  81. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  82. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  83. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  84. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  85. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  86. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  87. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  88. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  89. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  90. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  91. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  92. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  93. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  94. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  95. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  96. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  97. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  98. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  99. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  100. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  101. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  102. package/dist/assets/__vite-browser-external-DRLrqNA5.js +0 -1
  103. package/dist/assets/index--yUMU8pB.js +0 -1685
  104. package/dist/assets/index-C7cJKUIb.css +0 -1
  105. package/dist/assets/libcellml-D9ZPw9_t.wasm +0 -0
  106. package/dist/assets/primeicons-C6QP2o4f.woff2 +0 -0
  107. package/dist/assets/primeicons-DMOk5skT.eot +0 -0
  108. package/dist/assets/primeicons-Dr5RGzOO.svg +0 -345
  109. package/dist/assets/primeicons-MpK4pl85.ttf +0 -0
  110. package/dist/assets/primeicons-WjwUDZjB.woff +0 -0
  111. package/dist/assets/vue3-libcellml-4ponBlEP.js +0 -8
  112. package/dist/favicon.ico +0 -0
  113. package/dist/index.html +0 -14
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
@@ -91,3 +91,7 @@ yarn test:e2e # browser tests (Playwright)
91
91
  ```sh
92
92
  yarn lint
93
93
  ```
94
+
95
+ ## License
96
+
97
+ [Apache-2.0](LICENSE)
package/dist/style.css ADDED
@@ -0,0 +1,2 @@
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
+ /*$vite$:1*/
@@ -0,0 +1,49 @@
1
+ import { type EquationLine, type EquationsChangeInfo, type LineCommitInfo, type UnitsIssue, type VariableUnits } from '../editor/units';
2
+ import { type MathMLImport } from '../editor/mathmlImport';
3
+ type __VLS_Props = {
4
+ cellml?: boolean;
5
+ issues?: readonly UnitsIssue[];
6
+ variableUnits?: VariableUnits;
7
+ greekNames?: boolean;
8
+ outputs?: boolean;
9
+ history?: boolean;
10
+ validate?: 'input' | 'commit';
11
+ readonly?: boolean;
12
+ autofocus?: boolean;
13
+ debug?: boolean;
14
+ };
15
+ declare function focusActive(): void;
16
+ declare function setMathML(xml: string): MathMLImport;
17
+ declare var __VLS_65: {};
18
+ type __VLS_Slots = {} & {
19
+ side?: (props: typeof __VLS_65) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
22
+ setMathML: typeof setMathML;
23
+ focus: typeof focusActive;
24
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "equations-change": (lines: EquationLine[], info: EquationsChangeInfo) => any;
26
+ "line-commit": (line: EquationLine, info: LineCommitInfo) => any;
27
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ "onEquations-change"?: ((lines: EquationLine[], info: EquationsChangeInfo) => any) | undefined;
29
+ "onLine-commit"?: ((line: EquationLine, info: LineCommitInfo) => any) | undefined;
30
+ }>, {
31
+ autofocus: boolean;
32
+ readonly: boolean;
33
+ history: boolean;
34
+ cellml: boolean;
35
+ greekNames: boolean;
36
+ issues: readonly UnitsIssue[];
37
+ variableUnits: VariableUnits;
38
+ outputs: boolean;
39
+ validate: "input" | "commit";
40
+ debug: boolean;
41
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,39 @@
1
+ import { type EditorState } from '../editor/commands';
2
+ import { type Cursor } from '../editor/cursor';
3
+ import { type EditInfo } from '../editor/history';
4
+ import { type MathMLImport } from '../editor/mathmlImport';
5
+ import { type Row } from '../editor/layout';
6
+ import { type Mark } from '../editor/marks';
7
+ export interface NavigationState {
8
+ cursor: Cursor;
9
+ anchor: Cursor | null;
10
+ }
11
+ export type { Mark, MarkKind } from '../editor/marks';
12
+ type __VLS_Props = {
13
+ modelValue: Row;
14
+ cursor: Cursor;
15
+ anchor?: Cursor | null;
16
+ active?: boolean;
17
+ readonly?: boolean;
18
+ marks?: readonly Mark[];
19
+ greekNames?: boolean;
20
+ };
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
22
+ focus: () => void | undefined;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ navigate: (state: NavigationState) => any;
25
+ import: (result: MathMLImport) => any;
26
+ edit: (state: EditorState, info: EditInfo) => any;
27
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
28
+ onNavigate?: ((state: NavigationState) => any) | undefined;
29
+ onImport?: ((result: MathMLImport) => any) | undefined;
30
+ onEdit?: ((state: EditorState, info: EditInfo) => any) | undefined;
31
+ }>, {
32
+ anchor: Cursor | null;
33
+ active: boolean;
34
+ readonly: boolean;
35
+ marks: readonly Mark[];
36
+ greekNames: boolean;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import type { Cursor } from './cursor';
2
+ import { type Row, type RowPath } from './layout';
3
+ export interface Bounds {
4
+ left: number;
5
+ top: number;
6
+ right: number;
7
+ bottom: number;
8
+ }
9
+ export declare function paintedBounds(target: Element): Bounds | null;
10
+ export interface GapGeometry {
11
+ x: number;
12
+ top: number;
13
+ bottom: number;
14
+ placeholder: boolean;
15
+ }
16
+ export declare function gapGeometry(container: Element, root: Row, path: RowPath, offset: number): GapGeometry | null;
17
+ export interface CaretBox {
18
+ left: number;
19
+ top: number;
20
+ height: number;
21
+ placeholder: boolean;
22
+ }
23
+ export declare function caretBox(container: HTMLElement, root: Row, cursor: Cursor): CaretBox | null;
24
+ export declare function nearestOffset(container: Element, root: Row, path: RowPath, clientX: number): number;
25
+ export declare function hitTest(container: Element, root: Row, clientX: number, clientY: number): Cursor;
26
+ export interface SelectionBox {
27
+ left: number;
28
+ top: number;
29
+ width: number;
30
+ height: number;
31
+ }
32
+ export declare function selectionBox(container: HTMLElement, root: Row, selection: {
33
+ path: RowPath;
34
+ start: number;
35
+ end: number;
36
+ }): SelectionBox | null;
37
+ export declare function atomsBox(container: HTMLElement, atomIds: readonly string[], pad?: number): SelectionBox | null;
38
+ export declare function rowBox(container: HTMLElement, path: RowPath, padX?: number, padY?: number): SelectionBox | null;
@@ -0,0 +1,9 @@
1
+ import { type Row } from './layout';
2
+ export declare const CLIPBOARD_MIME = "application/x-semantic-math+json";
3
+ export declare function serializeAtoms(atoms: Row): string;
4
+ export declare function deserializeAtoms(text: string | null | undefined): Row | null;
5
+ export interface LatexOptions {
6
+ greekNames?: boolean;
7
+ }
8
+ export declare function rowToLatexSource(row: Row, options?: LatexOptions): string;
9
+ export declare function latexToRow(text: string): Row;
@@ -0,0 +1,37 @@
1
+ import { type Cursor } from './cursor';
2
+ import { type Atom, type BranchName, type Row } from './layout';
3
+ export interface EditorState {
4
+ root: Row;
5
+ cursor: Cursor;
6
+ anchor?: Cursor | null;
7
+ }
8
+ export type Command = (state: EditorState) => EditorState;
9
+ export declare function emptyState(): EditorState;
10
+ export declare const newPiece: Command;
11
+ export declare const addOtherwise: Command;
12
+ export declare function insertAtoms(atoms: Row): Command;
13
+ export declare function insertSymbol(value: string): Command;
14
+ export declare const typeEquals: Command;
15
+ export declare const insertPiecewise: Command;
16
+ export declare function insertStructure(atom: Atom, branch: BranchName): Command;
17
+ export declare const fractionOfSelection: Command;
18
+ export declare const insertFraction: Command;
19
+ export declare const insertSuperscript: Command;
20
+ export declare const openParen: Command;
21
+ export declare const insertUnits: Command;
22
+ export declare function typeSymbol(value: string): Command;
23
+ export declare const closeUnits: Command;
24
+ export declare const insertFloor: Command;
25
+ export declare const insertCeiling: Command;
26
+ export declare const closeParen: Command;
27
+ export declare const absBar: Command;
28
+ export declare const exitStructure: Command;
29
+ export declare const deleteBackward: Command;
30
+ export declare const deleteForward: Command;
31
+ export declare function nextPlaceholder(direction: 'forward' | 'backward'): Command;
32
+ export declare function insertFunction(name: string): Command;
33
+ export declare const insertSquareRoot: Command;
34
+ export declare const insertNthRoot: Command;
35
+ export declare const insertAbs: Command;
36
+ export declare const insertDerivative: Command;
37
+ export declare function namedCommand(name: string): Command;
@@ -0,0 +1,13 @@
1
+ import type { MathJsonValue } from '../renderers/mathjson';
2
+ export interface Constant {
3
+ symbol: string;
4
+ latex: string;
5
+ mathml: string;
6
+ mathJson: MathJsonValue;
7
+ commands: readonly string[];
8
+ }
9
+ export declare const CONSTANTS: readonly Constant[];
10
+ export declare const constantForSymbol: (value: string) => Constant | undefined;
11
+ export declare const constantForCommand: (name: string) => Constant | undefined;
12
+ export declare const constantForLatexCommand: (name: string) => string | undefined;
13
+ export declare const constantForUprightText: (text: string) => string | undefined;
@@ -0,0 +1,16 @@
1
+ import { type Row, type RowPath } from './layout';
2
+ export interface Cursor {
3
+ path: RowPath;
4
+ offset: number;
5
+ }
6
+ export declare function cursorAtStart(): Cursor;
7
+ export declare function cursorAtEnd(root: Row): Cursor;
8
+ export declare function cursorsEqual(a: Cursor, b: Cursor): boolean;
9
+ export declare function describeCursor(cursor: Cursor): string;
10
+ export declare function isValidCursor(root: Row, cursor: Cursor): boolean;
11
+ export declare function allPositions(root: Row): Cursor[];
12
+ export declare function moveRight(root: Row, cursor: Cursor): Cursor | null;
13
+ export declare function moveLeft(root: Row, cursor: Cursor): Cursor | null;
14
+ export type PickOffset = (target: Row, targetPath: RowPath, from: Cursor) => number;
15
+ export declare function moveUp(root: Row, cursor: Cursor, pickOffset?: PickOffset): Cursor | null;
16
+ export declare function moveDown(root: Row, cursor: Cursor, pickOffset?: PickOffset): Cursor | null;
@@ -0,0 +1,13 @@
1
+ import { type LatexOptions } from './clipboard';
2
+ import type { Row } from './layout';
3
+ import { type ContentMathMLOptions } from '../renderers/mathml';
4
+ export type ExportFormat = 'latex' | 'mathjson' | 'mathml';
5
+ export declare const EXPORT_FORMATS: ReadonlyArray<{
6
+ format: ExportFormat;
7
+ label: string;
8
+ }>;
9
+ export declare const CELLML_NAMESPACE = "http://www.cellml.org/cellml/2.0#";
10
+ export type ExportOptions = ContentMathMLOptions & LatexOptions;
11
+ export declare function exportRow(row: Row, format: ExportFormat, options?: ExportOptions): string;
12
+ export declare function contentMathML(row: Row, options?: ExportOptions): string;
13
+ export declare function formatXml(xml: string, indent?: string): string;
@@ -0,0 +1,34 @@
1
+ export interface EditInfo {
2
+ kind: 'type' | 'deleteBackward' | 'deleteForward' | 'other';
3
+ text?: string;
4
+ replacedSelection?: boolean;
5
+ exponentSign?: boolean;
6
+ }
7
+ export declare const OTHER_EDIT: EditInfo;
8
+ export interface UndoGroup {
9
+ key: string | null;
10
+ fresh: boolean;
11
+ }
12
+ export declare function undoGroup(line: number, edit: EditInfo): UndoGroup;
13
+ export interface HistoryOptions {
14
+ limit?: number;
15
+ pauseMs?: number;
16
+ now?: () => number;
17
+ }
18
+ export declare class History<S> {
19
+ private undoStack;
20
+ private redoStack;
21
+ private openGroup;
22
+ private lastEditAt;
23
+ private readonly limit;
24
+ private readonly pauseMs;
25
+ private readonly now;
26
+ constructor(options?: HistoryOptions);
27
+ get canUndo(): boolean;
28
+ get canRedo(): boolean;
29
+ checkpoint(snapshot: () => S, group?: UndoGroup): void;
30
+ clear(): void;
31
+ breakGroup(): void;
32
+ undo(current: S): S | null;
33
+ redo(current: S): S | null;
34
+ }
@@ -0,0 +1,33 @@
1
+ import { type Atom, type GroupDelimiter, type PiecewiseAtom, type Row, type UnitsAtom } from './layout';
2
+ import { type NumberRun } from './numbers';
3
+ export declare const GREEK_NAMES: ReadonlySet<string>;
4
+ export declare function functionForSpelling(spelling: string): string | undefined;
5
+ export declare const isGreekAtom: (atom: Atom | undefined) => boolean;
6
+ export declare const startsName: (atom: Atom | undefined) => boolean;
7
+ export declare const continuesName: (atom: Atom | undefined) => boolean;
8
+ export declare function nameEnd(row: Row, start: number): number;
9
+ export declare function reservedConstant(name: string): string | undefined;
10
+ export interface NameRun {
11
+ start: number;
12
+ end: number;
13
+ name: string;
14
+ functionName: string | null;
15
+ }
16
+ export declare function nameRuns(row: Row): NameRun[];
17
+ export declare function numberRuns(row: Row): NumberRun[];
18
+ export declare const unitsName: (atom: UnitsAtom) => string;
19
+ export declare const DEFAULT_OTHERWISE = "0.0";
20
+ export declare function inheritedOtherwiseUnits(atom: PiecewiseAtom): string | null;
21
+ export declare function nameOccurrences(root: Row, name: string): string[][];
22
+ export interface NumberOccurrence {
23
+ value: number;
24
+ atomIds: string[];
25
+ digitIds: string[];
26
+ units: string | null;
27
+ inherited?: boolean;
28
+ }
29
+ export declare function numberOccurrences(root: Row): NumberOccurrence[];
30
+ export declare function bracketFunctionBefore(row: Row, offset: number): {
31
+ start: number;
32
+ open: GroupDelimiter;
33
+ } | null;
@@ -0,0 +1,7 @@
1
+ import { type Command } from './commands';
2
+ export interface KeyLike {
3
+ key: string;
4
+ shiftKey?: boolean;
5
+ }
6
+ export declare function typedText(event: KeyLike): string | null;
7
+ export declare function commandForKey(event: KeyLike): Command | null;
@@ -0,0 +1,82 @@
1
+ export type Row = Atom[];
2
+ export type BranchName = 'num' | 'den' | 'sup' | 'index' | 'body' | 'expr' | 'variable' | `value${number}` | `cond${number}` | 'otherwise' | 'units';
3
+ interface AtomBase {
4
+ id: string;
5
+ }
6
+ export interface SymbolAtom extends AtomBase {
7
+ kind: 'symbol';
8
+ value: string;
9
+ }
10
+ export interface FunctionAtom extends AtomBase {
11
+ kind: 'function';
12
+ name: string;
13
+ }
14
+ export interface FractionAtom extends AtomBase {
15
+ kind: 'fraction';
16
+ num: Row;
17
+ den: Row;
18
+ }
19
+ export interface SuperscriptAtom extends AtomBase {
20
+ kind: 'superscript';
21
+ sup: Row;
22
+ }
23
+ export interface RootAtom extends AtomBase {
24
+ kind: 'root';
25
+ index: Row | null;
26
+ body: Row;
27
+ }
28
+ export type GroupDelimiter = '(' | ')' | '|' | '⌊' | '⌋' | '⌈' | '⌉';
29
+ export declare const CLOSING_DELIMITER: Record<string, GroupDelimiter>;
30
+ export interface GroupAtom extends AtomBase {
31
+ kind: 'group';
32
+ open: GroupDelimiter;
33
+ close: GroupDelimiter;
34
+ body: Row;
35
+ }
36
+ export interface DerivativeAtom extends AtomBase {
37
+ kind: 'derivative';
38
+ expr: Row;
39
+ variable: Row;
40
+ }
41
+ export interface PiecewiseAtom extends AtomBase {
42
+ kind: 'piecewise';
43
+ pieces: Array<{
44
+ value: Row;
45
+ condition: Row;
46
+ }>;
47
+ otherwise: Row | null;
48
+ }
49
+ export interface UnitsAtom extends AtomBase {
50
+ kind: 'units';
51
+ units: Row;
52
+ }
53
+ export type StructureAtom = FractionAtom | SuperscriptAtom | RootAtom | GroupAtom | DerivativeAtom | PiecewiseAtom | UnitsAtom;
54
+ export type Atom = SymbolAtom | FunctionAtom | StructureAtom;
55
+ export interface RowPathSegment {
56
+ atom: number;
57
+ branch: BranchName;
58
+ }
59
+ export type RowPath = RowPathSegment[];
60
+ export declare function childRows(atom: Atom): Array<[BranchName, Row]>;
61
+ export declare function piecewiseBranch(branch: BranchName): {
62
+ part: 'value' | 'cond';
63
+ piece: number;
64
+ } | {
65
+ part: 'otherwise';
66
+ } | null;
67
+ export declare function setChildRow<A extends Atom>(atom: A, branch: BranchName, child: Row): A;
68
+ export declare function getChildRow(atom: Atom, branch: BranchName): Row | null;
69
+ export declare function getRow(root: Row, path: RowPath): Row | null;
70
+ export declare function rowPathsEqual(a: RowPath, b: RowPath): boolean;
71
+ export declare function newAtomId(): string;
72
+ export declare function symbol(value: string): SymbolAtom;
73
+ export declare function func(name: string): FunctionAtom;
74
+ export declare function fraction(num?: Row, den?: Row): FractionAtom;
75
+ export declare function superscript(sup?: Row): SuperscriptAtom;
76
+ export declare function root(body?: Row, index?: Row | null): RootAtom;
77
+ export declare function group(body?: Row, open?: GroupDelimiter, close?: GroupDelimiter): GroupAtom;
78
+ export declare function derivative(expr?: Row, variable?: Row): DerivativeAtom;
79
+ export declare function unitsAtom(units?: Row): UnitsAtom;
80
+ export declare function piecewise(pieces?: Array<[value: Row, condition: Row]>, otherwise?: Row | null): PiecewiseAtom;
81
+ export declare function row(...items: Array<string | Atom>): Row;
82
+ export {};
@@ -0,0 +1,8 @@
1
+ export type MarkKind = 'error' | 'units' | 'hint';
2
+ export interface Mark {
3
+ message: string;
4
+ atomIds: readonly string[];
5
+ kind?: MarkKind;
6
+ }
7
+ export declare const markKind: (mark: Mark) => MarkKind;
8
+ export declare const isProblem: (mark: Mark) => boolean;
@@ -0,0 +1,8 @@
1
+ import { type Row } from './layout';
2
+ export interface MathMLImport {
3
+ equations: Row[];
4
+ problems: string[];
5
+ lineProblems: string[][];
6
+ }
7
+ export declare function looksLikeContentMathML(text: string): boolean;
8
+ export declare function importContentMathML(text: string): MathMLImport | null;
@@ -0,0 +1,15 @@
1
+ import type { Cursor } from './cursor';
2
+ import { type Row } from './layout';
3
+ export interface NameOptions {
4
+ greekNames?: boolean;
5
+ cursorAway?: boolean;
6
+ }
7
+ interface EditorLike {
8
+ root: Row;
9
+ cursor: Cursor;
10
+ anchor?: Cursor | null;
11
+ }
12
+ export declare function greekWord(word: string): string | null;
13
+ export declare function nameAtoms(name: string, options?: NameOptions): Row;
14
+ export declare function settleNames<S extends EditorLike>(state: S, options?: NameOptions): S;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Cursor } from './cursor';
2
+ import { type Atom, type Row } from './layout';
3
+ export declare const isUnits: (atom: Atom | undefined) => boolean;
4
+ export declare const inUnits: (cursor: Cursor) => boolean;
5
+ export declare function openUnitsId(root: Row, cursor: Cursor): string | null;
6
+ export declare function followsNumber(row: Row, index: number): boolean;
7
+ export declare function continuesNumber(row: Row, unitsIndex: number, text: string): boolean;
8
+ export declare function settleCursor(root: Row, cursor: Cursor): Cursor;
9
+ interface EditorLike {
10
+ root: Row;
11
+ cursor: Cursor;
12
+ anchor?: Cursor | null;
13
+ }
14
+ export declare function settleState<S extends EditorLike>(state: S): S;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { Atom, Row } from './layout';
2
+ export interface NumberRun {
3
+ start: number;
4
+ end: number;
5
+ text: string;
6
+ mantissa: string;
7
+ exponent: string | null;
8
+ }
9
+ export declare const startsNumber: (atom: Atom | undefined) => boolean;
10
+ export declare function numberAt(row: Row, start: number): NumberRun | null;
11
+ export declare function isExponentSignPosition(row: Row, offset: number): boolean;
@@ -0,0 +1,28 @@
1
+ export type ComparisonType = 'Less' | 'Greater' | 'LessEqual' | 'GreaterEqual' | 'NotEqual';
2
+ export type LogicType = 'And' | 'Or' | 'Xor';
3
+ export interface ComparisonOperator {
4
+ role: 'comparison';
5
+ symbol: string;
6
+ type: ComparisonType;
7
+ }
8
+ export interface LogicOperator {
9
+ role: 'logic';
10
+ symbol: string;
11
+ type: LogicType;
12
+ }
13
+ export interface NotOperator {
14
+ role: 'not';
15
+ symbol: string;
16
+ type: 'Not';
17
+ }
18
+ export type ConditionOperator = (ComparisonOperator | LogicOperator | NotOperator) & {
19
+ latex: string;
20
+ mathml: string;
21
+ commands: readonly string[];
22
+ };
23
+ export declare const CONDITION_OPERATORS: readonly ConditionOperator[];
24
+ export declare const conditionOperator: (symbol: string) => ConditionOperator | undefined;
25
+ export declare const conditionOperatorOfType: (type: string) => ConditionOperator | undefined;
26
+ export declare const conditionOperatorForCommand: (name: string) => ConditionOperator | undefined;
27
+ export declare const combinedWithEquals: (symbol: string) => string | undefined;
28
+ export declare const KEY_SYMBOLS: Record<string, string>;
@@ -0,0 +1,12 @@
1
+ import type { AstNode } from '../types/ast';
2
+ import type { Row } from './layout';
3
+ export interface ParseDiagnostic {
4
+ message: string;
5
+ atomIds: string[];
6
+ incomplete?: true;
7
+ }
8
+ export interface ParseResult {
9
+ ast: AstNode;
10
+ diagnostics: ParseDiagnostic[];
11
+ }
12
+ export declare function parseRow(row: Row): ParseResult;
@@ -0,0 +1,22 @@
1
+ import { type Cursor, type PickOffset } from './cursor';
2
+ import { type Row, type RowPath } from './layout';
3
+ export interface SelectableState {
4
+ root: Row;
5
+ cursor: Cursor;
6
+ anchor?: Cursor | null;
7
+ }
8
+ export interface Selection {
9
+ path: RowPath;
10
+ start: number;
11
+ end: number;
12
+ }
13
+ export declare function selectionOf(state: SelectableState): Selection | null;
14
+ export declare function selectedAtoms(state: SelectableState): Row;
15
+ export declare function describeSelection(selection: Selection): string;
16
+ export declare function extendSelection<S extends SelectableState>(state: S, direction: 'forward' | 'backward'): S;
17
+ export declare function extendSelectionTo<S extends SelectableState>(state: S, edge: 'start' | 'end'): S;
18
+ export declare function selectAll<S extends SelectableState>(state: S): S;
19
+ export declare function selectBetween<S extends SelectableState>(state: S, anchor: Cursor, cursor: Cursor): S;
20
+ export declare function collapseSelection<S extends SelectableState>(state: S, to?: 'start' | 'end' | 'cursor'): S;
21
+ export declare function navigateHorizontal<S extends SelectableState>(state: S, direction: 'forward' | 'backward'): S | null;
22
+ export declare function navigateVertical<S extends SelectableState>(state: S, direction: 'up' | 'down', pickOffset?: PickOffset): S | 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[];
@@ -0,0 +1,27 @@
1
+ import { type Row } from './layout';
2
+ import type { Mark } from './marks';
3
+ import type { ParseResult } from './parse';
4
+ export interface EquationLine {
5
+ id: string;
6
+ mathml: string;
7
+ variables: string[];
8
+ units: string[];
9
+ complete: boolean;
10
+ }
11
+ export interface EquationsChangeInfo {
12
+ source: 'load' | 'edit';
13
+ }
14
+ export interface LineCommitInfo {
15
+ reason: 'enter' | 'new-line' | 'navigate' | 'blur' | 'paste';
16
+ }
17
+ export interface UnitsIssue {
18
+ lineId: string;
19
+ message: string;
20
+ variables?: readonly string[];
21
+ numbers?: readonly number[];
22
+ units?: readonly string[];
23
+ }
24
+ export type VariableUnits = Readonly<Record<string, string>>;
25
+ export declare function equationLine(id: string, root: Row, parsed: ParseResult | null, otherProblems?: number): EquationLine;
26
+ export declare function unitsIssueMarks(root: Row, issues: readonly UnitsIssue[]): Mark[];
27
+ export declare function unitsHintMarks(root: Row, variableUnits: VariableUnits | null): Mark[];
@@ -0,0 +1,8 @@
1
+ export { default as EquationWorkbench } from './components/EquationWorkbench.vue';
2
+ export { default as UnitsPanel } from './units/UnitsPanel.vue';
3
+ export { importContentMathML, type MathMLImport } from './editor/mathmlImport';
4
+ export type { EquationLine, EquationsChangeInfo, LineCommitInfo, UnitsIssue, VariableUnits, } from './editor/units';
5
+ export { LIBCELLML_KEY, type ProvidedLibCellML, type UnitsCheckerOptions, type UnitsCheckerStatus, useUnitsChecker, } from './units/useUnitsChecker';
6
+ export type { UnitsDefinition, UnitsPart } from './units/definitions';
7
+ export type { UnitsSource, UnitsLibraryProblem } from './units/library';
8
+ export type { LibCellML } from './units/libcellml';
@@ -0,0 +1,21 @@
1
+ export interface FunctionDefinition {
2
+ name: string;
3
+ latexName: string;
4
+ latexCommand: boolean;
5
+ mathMlTag: string;
6
+ mathJson: string;
7
+ aliases?: readonly string[];
8
+ }
9
+ export declare const FUNCTION_REGISTRY: Record<string, FunctionDefinition>;
10
+ export declare function getFunctionDefinition(name: string): FunctionDefinition | null;
11
+ export declare function functionLatex(name: string): string;
12
+ interface BracketFunction {
13
+ open: string;
14
+ close: string;
15
+ latexOpen: string;
16
+ latexClose: string;
17
+ }
18
+ export declare const bracketsForFunction: (name: string) => BracketFunction;
19
+ export declare function functionForBracket(open: string): string | undefined;
20
+ export declare function delimiterLatex(delimiter: string): string;
21
+ export {};