@airalogy/aimd-editor 1.7.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 +59 -0
- package/README.zh-CN.md +43 -0
- package/dist/AimdEditorTopBar.vue_vue_type_script_setup_true_lang-gbfMDZSh.js +1131 -0
- package/dist/AimdSourceEditor.vue_vue_type_script_setup_true_lang-t_sUoXky.js +274 -0
- package/dist/AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-B8o1VbUH.js +25012 -0
- package/dist/aimd-editor.css +1 -0
- package/dist/embedded.js +11 -0
- package/dist/index.js +44 -0
- package/dist/monaco.js +16 -0
- package/dist/theme-B8dCnOx-.js +583 -0
- package/dist/vue.js +30 -0
- package/dist/wysiwyg.js +9 -0
- package/package.json +90 -0
- package/src/__tests__/editor.test.ts +296 -0
- package/src/embedded.ts +18 -0
- package/src/index.ts +10 -0
- package/src/language-config.ts +152 -0
- package/src/monaco.ts +19 -0
- package/src/theme.ts +166 -0
- package/src/tokens.ts +120 -0
- package/src/vue/AimdEditor.vue +715 -0
- package/src/vue/AimdEditorToolbar.vue +83 -0
- package/src/vue/AimdEditorTopBar.vue +39 -0
- package/src/vue/AimdFieldDialog.vue +1102 -0
- package/src/vue/AimdSourceEditor.vue +330 -0
- package/src/vue/AimdWysiwygEditor.vue +569 -0
- package/src/vue/aimdInlineMarkdownNormalization.ts +10 -0
- package/src/vue/comparableAimdMarkdown.ts +6 -0
- package/src/vue/env.d.ts +7 -0
- package/src/vue/index.ts +45 -0
- package/src/vue/locales.ts +667 -0
- package/src/vue/milkdown-aimd-plugin.ts +378 -0
- package/src/vue/programmaticMarkdownSyncGuard.ts +66 -0
- package/src/vue/types.ts +449 -0
- package/src/vue/useEditorContent.ts +252 -0
- package/src/wysiwyg.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror td:not([data-colwidth]):not(.column-resize-dragging),.ProseMirror th:not([data-colwidth]):not(.column-resize-dragging){min-width:var(--default-cell-min-width)}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:"";inset:0;background:#c8c8ff66;pointer-events:none}.aimd-dialog-overlay{position:fixed;inset:0;background:#00000059;display:flex;align-items:center;justify-content:center;z-index:10000;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.aimd-dialog{background:#fff;border-radius:12px;box-shadow:0 20px 60px #0003;width:520px;max-width:90vw;max-height:85vh;display:flex;flex-direction:column;overflow:hidden}.aimd-dialog-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #f0f0f0}.aimd-dialog-title{font-size:16px;font-weight:600;color:#1a1a2e;display:flex;align-items:center;gap:8px}.aimd-dialog-icon{display:flex;align-items:center}.aimd-dialog-icon svg{width:20px;height:20px}.aimd-dialog-close{width:32px;height:32px;border:none;background:transparent;cursor:pointer;font-size:22px;color:#999;border-radius:6px;display:flex;align-items:center;justify-content:center}.aimd-dialog-close:hover{background:#f0f2f5;color:#333}.aimd-dialog-type-tabs{display:flex;flex-wrap:wrap;align-items:center;border-bottom:1px solid #f0f0f0;padding:10px 12px;gap:8px}.aimd-type-tab{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #e5e7eb;border-radius:999px;background:#fff;cursor:pointer;font-size:12px;color:#6b7280;white-space:nowrap;transition:all .15s}.aimd-type-tab:hover{color:#374151;border-color:#d1d5db;background:#f8fafc}.aimd-type-tab-icon{display:inline-flex;align-items:center;vertical-align:middle}.aimd-type-tab-icon svg{width:14px;height:14px}.aimd-type-tab.active{font-weight:600}.aimd-dialog-body{padding:20px;display:flex;flex-direction:column;gap:14px;overflow-y:auto}.aimd-field-row{display:flex;flex-direction:column;gap:4px}.aimd-field-label{font-size:13px;font-weight:500;color:#444}.aimd-field-label em{color:#dc2626;font-style:normal}.aimd-field-input{padding:8px 12px;border:1px solid #e0e0e0;border-radius:6px;font-size:14px;outline:none;transition:border-color .2s;font-family:inherit}.aimd-field-input:focus{border-color:#1a73e8;box-shadow:0 0 0 2px #1a73e81a}.aimd-field-textarea{min-height:72px;resize:vertical}.aimd-field-hint{font-size:11px;color:#999}.aimd-var-type-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}.aimd-var-type-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;cursor:pointer;text-align:left;transition:border-color .15s,box-shadow .15s,background .15s,transform .15s}.aimd-var-type-card:hover{border-color:#93c5fd;background:#f8fbff;transform:translateY(-1px)}.aimd-var-type-card:focus-visible{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb26}.aimd-var-type-card.active{border-color:#2563eb;background:#eff6ff;box-shadow:0 0 0 2px #2563eb1f}.aimd-var-type-card-title{font-size:13px;font-weight:600;color:#1f2937}.aimd-var-type-card-desc{font-size:12px;line-height:1.4;color:#6b7280}.aimd-collection-editor{display:flex;flex-direction:column;gap:8px}.aimd-collection-row{display:grid;grid-template-columns:90px 1fr auto;gap:8px;align-items:center}.aimd-option-row{grid-template-columns:26px 96px 90px 1fr auto}.aimd-option-row-dragover{background:#eff6ff;border-radius:6px}.aimd-option-answer-toggle{display:flex;align-items:center;gap:6px;color:#4b5563;font-size:12px;-webkit-user-select:none;user-select:none}.aimd-option-answer-toggle input{margin:0}.aimd-drag-handle{color:#9ca3af;cursor:grab;-webkit-user-select:none;user-select:none;text-align:center;font-size:14px;line-height:1}.aimd-drag-handle:active{cursor:grabbing}.aimd-mini-btn{border:1px solid #d8dee8;background:#fff;color:#4b5563;border-radius:6px;padding:6px 10px;font-size:12px;cursor:pointer}.aimd-mini-btn:hover{background:#f8fafc}.aimd-mini-btn:disabled{opacity:.5;cursor:not-allowed}.aimd-mini-btn-add{align-self:flex-start}.aimd-dialog-preview{padding:12px 14px;background:#f8f9fa;border-radius:6px;border:1px solid #e8e8e8;display:flex;flex-direction:column;align-items:stretch;gap:10px}.aimd-preview-header{display:block;font-size:12px;color:#6b7280;font-weight:600;letter-spacing:.04em}.aimd-preview-panel{display:block;width:100%;margin:0;padding:10px 12px;border-radius:6px;border:1px solid #dbe3ef;background:#fff;overflow:auto;max-height:280px;line-height:1.5}.aimd-preview-code{display:block;font-family:SF Mono,Fira Code,monospace;font-size:13px;color:#2563eb;word-break:break-word;white-space:pre-wrap}.aimd-dialog-error{padding:10px 12px;border:1px solid #fecaca;background:#fef2f2;color:#b91c1c;border-radius:6px;font-size:12px;line-height:1.5}.aimd-dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid #f0f0f0}.aimd-btn{padding:8px 20px;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .15s}.aimd-btn-cancel{border:1px solid #e0e0e0;background:#fff;color:#666}.aimd-btn-cancel:hover{background:#f5f5f5}.aimd-btn-primary{border:none;background:#1a73e8;color:#fff}.aimd-btn-primary:hover{background:#1557b0}.aimd-editor{display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;border:1px solid #e0e0e0;border-radius:8px;overflow:hidden}.aimd-editor-toolbar{display:flex;align-items:center;gap:2px;padding:4px 8px;background:#fafbfc;border-bottom:1px solid #e0e0e0;overflow-x:auto;flex-wrap:wrap}.aimd-editor-mode-switch{display:flex;background:#eceef1;border-radius:5px;padding:2px;gap:1px;flex-shrink:0}.aimd-editor-mode-btn{display:flex;align-items:center;gap:4px;padding:4px 10px;border:none;border-radius:4px;background:transparent;cursor:pointer;font-size:12px;font-weight:500;color:#777;transition:all .15s;white-space:nowrap}.aimd-editor-mode-btn:hover{color:#444;background:#ffffff80}.aimd-editor-mode-btn.active{background:#fff;color:#1a73e8;box-shadow:0 1px 2px #00000014}.aimd-editor-mode-icon{display:flex;align-items:center}.aimd-editor-toolbar-sep{width:1px;height:20px;background:#ddd;margin:0 4px;flex-shrink:0}.aimd-editor-toolbar-divider{width:1px;height:22px;background:#ccc;margin:0 6px;flex-shrink:0}.aimd-editor-fmt-btn{width:28px;height:28px;border:1px solid transparent;border-radius:4px;background:transparent;cursor:pointer;color:#555;display:flex;align-items:center;justify-content:center;transition:all .12s;padding:0;flex-shrink:0}.aimd-editor-fmt-btn:hover{background:#eceef1;color:#222}.aimd-editor-fmt-btn:active{background:#dfe1e5}.aimd-editor-fmt-btn svg{width:16px;height:16px;display:block}.aimd-editor-aimd-btn{width:auto;gap:3px;padding:0 7px;border:1px solid color-mix(in srgb,var(--aimd-color, #2563eb) 18%,transparent);background:color-mix(in srgb,var(--aimd-color, #2563eb) 4%,transparent);border-radius:4px}.aimd-editor-aimd-btn:hover{background:color-mix(in srgb,var(--aimd-color, #2563eb) 12%,transparent);border-color:color-mix(in srgb,var(--aimd-color, #2563eb) 35%,transparent);color:var(--aimd-color, #2563eb)}.aimd-editor-aimd-btn-icon{display:flex;align-items:center}.aimd-editor-aimd-btn-icon svg{width:13px;height:13px}.aimd-editor-aimd-btn-label{font-size:11px;font-weight:500}.aimd-editor-panel{background:#fff;overflow:hidden}.aimd-editor-source-mode{overflow:hidden}.aimd-editor-container{height:100%}.aimd-editor-loading{padding:40px;text-align:center;color:#888}.aimd-editor-wysiwyg-mode .milkdown{height:100%}.aimd-editor-wysiwyg-mode .milkdown-editor-content{padding:0 20px 6px;min-height:100%;outline:none;font-size:15px;line-height:1.8}.aimd-editor-wysiwyg-mode .milkdown-editor-content .ProseMirror{outline:none}.aimd-editor-wysiwyg-mode h1{font-size:1.8em;margin:.6em 0 .3em;font-weight:700}.aimd-editor-wysiwyg-mode h2{font-size:1.4em;margin:.5em 0 .3em;color:#333;font-weight:600;border-bottom:1px solid #eee;padding-bottom:.2em}.aimd-editor-wysiwyg-mode h3{font-size:1.2em;margin:.4em 0 .2em;font-weight:600}.aimd-editor-wysiwyg-mode p{margin:.5em 0}.aimd-editor-wysiwyg-mode blockquote{border-left:4px solid #dfe2e5;padding:8px 16px;margin:8px 0;color:#666;background:#fafafa;border-radius:0 4px 4px 0}.aimd-editor-wysiwyg-mode ul,.aimd-editor-wysiwyg-mode ol{padding-left:24px;margin:4px 0}.aimd-editor-wysiwyg-mode code{background:#f0f2f5;padding:2px 6px;border-radius:3px;font-size:.9em;font-family:SF Mono,Fira Code,monospace}.aimd-editor-wysiwyg-mode pre{background:#1e1e2e;color:#cdd6f4;padding:16px;border-radius:8px;overflow-x:auto}.aimd-editor-wysiwyg-mode pre code{background:none;padding:0;color:inherit}.aimd-editor-wysiwyg-mode hr{border:none;border-top:2px solid #e8e8e8;margin:16px 0}.aimd-editor-wysiwyg-mode img{max-width:100%;border-radius:4px}.aimd-editor-wysiwyg-mode a{color:#1a73e8;text-decoration:none}.aimd-editor-wysiwyg-mode a:hover{text-decoration:underline}.aimd-editor-wysiwyg-mode li{margin:2px 0}.aimd-editor-wysiwyg-mode .tableWrapper{overflow-x:auto;margin:12px 0}.aimd-block-handle{position:absolute;z-index:10;transition:top .15s ease,left .15s ease}.aimd-block-handle[data-show=false]{opacity:0;pointer-events:none}.aimd-block-handle-btn{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:4px;background:#fff;border:1px solid #e0e0e0;color:#aaa;cursor:pointer;transition:all .15s;box-shadow:0 1px 2px #0000000d}.aimd-block-handle-btn:hover{background:#f0f2f5;border-color:silver;color:#555}.aimd-block-add-menu{position:fixed;z-index:10000;background:#fff;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 4px 16px #0000001f;padding:4px;min-width:200px;max-height:400px;overflow-y:auto}.aimd-block-add-menu-group-label{padding:6px 12px 2px;font-size:11px;font-weight:600;color:#999;text-transform:uppercase;letter-spacing:.5px}.aimd-block-add-menu-divider{height:1px;background:#eee;margin:4px 8px}.aimd-block-add-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px 12px;border:none;background:none;border-radius:5px;cursor:pointer;font-size:13px;color:#333;text-align:left;transition:background .1s}.aimd-block-add-menu-item:hover{background:#f0f2f5}.aimd-block-add-menu-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:4px;background:#f0f2f5;color:#666;flex-shrink:0}.aimd-block-add-menu-icon svg{width:14px;height:14px}.milkdown-table-block{display:block;margin:4px 0}.milkdown-table-block table{margin:0!important;border-radius:0!important}.milkdown-table-block .handle{position:absolute;z-index:50;cursor:grab;font-size:14px}.milkdown-table-block .cell-handle{left:-999px;top:-999px;z-index:100;height:24px;transition:opacity .2s ease .2s;background-color:#a8d4ff;padding:0 8px;border-radius:8px;position:absolute}.milkdown-table-block .cell-handle[data-role=col-drag-handle]{transform:translateY(50%)}.milkdown-table-block .cell-handle[data-role=row-drag-handle]{transform:translate(50%)}.milkdown-table-block .cell-handle[data-show=false],.milkdown-table-block .line-handle[data-show=false]{opacity:0}.milkdown-table-block .handle:hover{opacity:1}.milkdown-table-block .cell-handle .button-group{position:absolute;height:30px;top:-32px;display:flex;transform:translate(-50%);left:50%;background-color:#fff;border:1px solid #ccc;border-radius:4px}.milkdown-table-block .cell-handle .button-group[data-show=false]{display:none}.milkdown-table-block .cell-handle .button-group button{padding-left:8px;padding-right:8px;width:max-content;border:none;background:none;cursor:pointer}.milkdown-table-block .cell-handle .button-group button:hover{background-color:#f0f0f0}.milkdown-table-block .line-handle{background-color:#a8d4ff;transition:opacity .2s ease-in-out}.milkdown-table-block .line-handle[data-role=x-line-drag-handle]{height:2px}.milkdown-table-block .line-handle[data-role=y-line-drag-handle]{width:2px}.milkdown-table-block .line-handle .add-button{color:#1a73e8;border:1px solid #a8d4ff;padding:0 4px;border-radius:8px;width:max-content;background:#fff;cursor:pointer}.milkdown-table-block .line-handle[data-role=x-line-drag-handle] .add-button{position:absolute;transform:translate(-100%);top:-12px;height:24px}.milkdown-table-block .line-handle[data-role=y-line-drag-handle] .add-button{position:absolute;transform:translate(-50%);top:-24px;height:24px}.milkdown-table-block .line-handle[data-display-type=indicator] .add-button{display:none}.milkdown-table-block .drag-preview{position:absolute;z-index:100;border:1px solid #ccc;opacity:.5;display:flex;flex-direction:column}.milkdown-table-block .drag-preview table{margin:0}.milkdown-table-block .drag-preview[data-show=false]{display:none}.aimd-editor-wysiwyg-mode th,.aimd-editor-wysiwyg-mode td{border:1px solid #ddd;padding:4px 16px;position:relative}.aimd-editor-wysiwyg-mode th{background:#f5f7fa;font-weight:600}.aimd-editor-wysiwyg-mode .ProseMirror-selectednode{outline:none!important}.milkdown-table-block .ProseMirror-selectednode{outline:none!important;background-color:transparent!important}.aimd-editor-wysiwyg-mode td:has(.ProseMirror-selectednode),.aimd-editor-wysiwyg-mode th:has(.ProseMirror-selectednode){outline:1px solid #a8a8a8;outline-offset:-1px}.aimd-editor-wysiwyg-mode .selectedCell{position:relative}.aimd-editor-wysiwyg-mode .selectedCell:after{content:"";position:absolute;inset:0;background-color:#d5d5d5;opacity:.4;pointer-events:none}.aimd-editor-wysiwyg-mode .selectedCell::selection{background:transparent}.milkdown-table-block .cell-handle .button-group button svg{width:18px;height:18px;fill:currentColor}.milkdown-table-block .cell-handle svg{width:14px;height:14px;fill:currentColor}.milkdown-table-block .line-handle .add-button svg{width:16px;height:16px;fill:currentColor}.aimd-placeholder{position:relative}.aimd-placeholder:before{content:attr(data-placeholder);position:absolute;color:#aaa;pointer-events:none;font-style:italic}.aimd-editor-wysiwyg-mode aimd-field{display:inline-flex;align-items:center;gap:3px;padding:1px 8px 1px 6px;border-radius:4px;font-size:13px;font-family:SF Mono,Fira Code,Consolas,monospace;line-height:1.6;vertical-align:baseline;border:1px solid rgba(37,99,235,.2);background:#2563eb0d;color:#2563eb}
|
package/dist/embedded.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { _ as s } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-t_sUoXky.js";
|
|
2
|
+
import { _ as i, D as d, i as o, j as t, k as A, r as m } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-B8o1VbUH.js";
|
|
3
|
+
export {
|
|
4
|
+
s as AimdSourceEditor,
|
|
5
|
+
i as AimdWysiwygEditor,
|
|
6
|
+
d as DEFAULT_AIMD_EDITOR_LOCALE,
|
|
7
|
+
o as createAimdEditorMessages,
|
|
8
|
+
t as createAimdFieldTypes,
|
|
9
|
+
A as createAimdVarTypePresets,
|
|
10
|
+
m as resolveAimdEditorLocale
|
|
11
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { A as i, a as s, b as d, D as o, K as m, M as r, c as t, d as A, e as n, f as l, g as D, l as E, s as T } from "./theme-B8dCnOx-.js";
|
|
2
|
+
import { _, a as c, b as f, c as u, u as M } from "./AimdEditorTopBar.vue_vue_type_script_setup_true_lang-gbfMDZSh.js";
|
|
3
|
+
import { _ as p } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-t_sUoXky.js";
|
|
4
|
+
import { A as k, a as x, _ as L, D as O, M as S, b as y, c as b, d as N, e as P, f as R, g as w, h, i as B, j as C, k as v, l as K, m as V, n as Y, r as j } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-B8o1VbUH.js";
|
|
5
|
+
export {
|
|
6
|
+
k as AIMD_FIELD_TYPES,
|
|
7
|
+
x as AIMD_FIELD_TYPE_DEFINITIONS,
|
|
8
|
+
_ as AimdEditor,
|
|
9
|
+
c as AimdEditorToolbar,
|
|
10
|
+
f as AimdEditorTopBar,
|
|
11
|
+
u as AimdFieldDialog,
|
|
12
|
+
p as AimdSourceEditor,
|
|
13
|
+
i as AimdSuffix,
|
|
14
|
+
s as AimdToken,
|
|
15
|
+
d as AimdTokenDefinition,
|
|
16
|
+
L as AimdWysiwygEditor,
|
|
17
|
+
O as DEFAULT_AIMD_EDITOR_LOCALE,
|
|
18
|
+
o as DelimiterDefinition,
|
|
19
|
+
m as KeywordDefinition,
|
|
20
|
+
S as MD_TOOLBAR_ITEMS,
|
|
21
|
+
y as MD_TOOLBAR_ITEM_DEFINITIONS,
|
|
22
|
+
r as MarkupDefinition,
|
|
23
|
+
b as aimdFieldInputRule,
|
|
24
|
+
N as aimdFieldNode,
|
|
25
|
+
P as aimdFieldView,
|
|
26
|
+
R as aimdMilkdownPlugins,
|
|
27
|
+
w as aimdRemarkPlugin,
|
|
28
|
+
t as aimdTheme,
|
|
29
|
+
A as aimdTokenColors,
|
|
30
|
+
h as buildAimdSyntax,
|
|
31
|
+
n as completionItemProvider,
|
|
32
|
+
l as conf,
|
|
33
|
+
B as createAimdEditorMessages,
|
|
34
|
+
D as createAimdExtendedTheme,
|
|
35
|
+
C as createAimdFieldTypes,
|
|
36
|
+
v as createAimdVarTypePresets,
|
|
37
|
+
K as createMdToolbarItems,
|
|
38
|
+
V as getDefaultAimdFields,
|
|
39
|
+
Y as getQuickAimdSyntax,
|
|
40
|
+
E as language,
|
|
41
|
+
j as resolveAimdEditorLocale,
|
|
42
|
+
T as scopeName,
|
|
43
|
+
M as useEditorContent
|
|
44
|
+
};
|
package/dist/monaco.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { A as a, a as o, b as s, D as n, K as m, M as d, c as t, d as f, e as r, f as D, g as c, l, s as A } from "./theme-B8dCnOx-.js";
|
|
2
|
+
export {
|
|
3
|
+
a as AimdSuffix,
|
|
4
|
+
o as AimdToken,
|
|
5
|
+
s as AimdTokenDefinition,
|
|
6
|
+
n as DelimiterDefinition,
|
|
7
|
+
m as KeywordDefinition,
|
|
8
|
+
d as MarkupDefinition,
|
|
9
|
+
t as aimdTheme,
|
|
10
|
+
f as aimdTokenColors,
|
|
11
|
+
r as completionItemProvider,
|
|
12
|
+
D as conf,
|
|
13
|
+
c as createAimdExtendedTheme,
|
|
14
|
+
l as language,
|
|
15
|
+
A as scopeName
|
|
16
|
+
};
|
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
import { languages as l } from "@codingame/monaco-vscode-editor-api";
|
|
2
|
+
var _ = {
|
|
3
|
+
comments: {
|
|
4
|
+
blockComment: ["<!--", "-->"]
|
|
5
|
+
},
|
|
6
|
+
brackets: [
|
|
7
|
+
["{", "}"],
|
|
8
|
+
["[", "]"],
|
|
9
|
+
["(", ")"]
|
|
10
|
+
],
|
|
11
|
+
autoClosingPairs: [
|
|
12
|
+
{ open: "{", close: "}" },
|
|
13
|
+
{ open: "[", close: "]" },
|
|
14
|
+
{ open: "(", close: ")" },
|
|
15
|
+
{ open: "<", close: ">", notIn: ["string"] }
|
|
16
|
+
],
|
|
17
|
+
surroundingPairs: [
|
|
18
|
+
{ open: "(", close: ")" },
|
|
19
|
+
{ open: "[", close: "]" },
|
|
20
|
+
{ open: "`", close: "`" }
|
|
21
|
+
],
|
|
22
|
+
folding: {
|
|
23
|
+
markers: {
|
|
24
|
+
start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
|
|
25
|
+
end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, d = {
|
|
29
|
+
defaultToken: "",
|
|
30
|
+
tokenPostfix: ".md",
|
|
31
|
+
// escape codes
|
|
32
|
+
control: /[\\`*_\[\]{}()#+\-\.!]/,
|
|
33
|
+
noncontrol: /[^\\`*_\[\]{}()#+\-\.!]/,
|
|
34
|
+
escapes: /\\(?:@control)/,
|
|
35
|
+
// escape codes for javascript/CSS strings
|
|
36
|
+
jsescapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,
|
|
37
|
+
// non matched elements
|
|
38
|
+
empty: [
|
|
39
|
+
"area",
|
|
40
|
+
"base",
|
|
41
|
+
"basefont",
|
|
42
|
+
"br",
|
|
43
|
+
"col",
|
|
44
|
+
"frame",
|
|
45
|
+
"hr",
|
|
46
|
+
"img",
|
|
47
|
+
"input",
|
|
48
|
+
"isindex",
|
|
49
|
+
"link",
|
|
50
|
+
"meta",
|
|
51
|
+
"param"
|
|
52
|
+
],
|
|
53
|
+
tokenizer: {
|
|
54
|
+
root: [
|
|
55
|
+
// markdown tables
|
|
56
|
+
[/^\s*\|/, "@rematch", "@table_header"],
|
|
57
|
+
// headers (with #)
|
|
58
|
+
[/^(\s{0,3})(#+)((?:[^\\#]|@escapes)+)((?:#+)?)/, ["white", "keyword", "keyword", "keyword"]],
|
|
59
|
+
// headers (with =)
|
|
60
|
+
[/^\s*(=+|\-+)\s*$/, "keyword"],
|
|
61
|
+
// headers (with ***)
|
|
62
|
+
[/^\s*((\*[ ]?)+)\s*$/, "meta.separator"],
|
|
63
|
+
// quote
|
|
64
|
+
[/^\s*>+/, "comment"],
|
|
65
|
+
// list (starting with * or number)
|
|
66
|
+
[/^\s*([\*\-+:]|\d+\.)\s/, "keyword"],
|
|
67
|
+
// code block (4 spaces indent)
|
|
68
|
+
[/^(\t|[ ]{4})[^ ].*$/, "string"],
|
|
69
|
+
// code block (3 tilde)
|
|
70
|
+
[/^\s*~~~\s*((?:\w|[\/\-#])+)?\s*$/, { token: "string", next: "@codeblock" }],
|
|
71
|
+
// github style code blocks (with backticks and language)
|
|
72
|
+
[
|
|
73
|
+
/^\s*```\s*((?:\w|[\/\-#])+).*$/,
|
|
74
|
+
{ token: "string", next: "@codeblockgh", nextEmbedded: "$1" }
|
|
75
|
+
],
|
|
76
|
+
// github style code blocks (with backticks but no language)
|
|
77
|
+
[/^\s*```\s*$/, { token: "string", next: "@codeblock" }],
|
|
78
|
+
// markup within lines
|
|
79
|
+
{ include: "@linecontent" }
|
|
80
|
+
],
|
|
81
|
+
table_header: [
|
|
82
|
+
{ include: "@table_common" },
|
|
83
|
+
[/[^\|]+/, "keyword.table.header"]
|
|
84
|
+
// table header
|
|
85
|
+
],
|
|
86
|
+
table_body: [{ include: "@table_common" }, { include: "@linecontent" }],
|
|
87
|
+
table_common: [
|
|
88
|
+
[/\s*[\-:]+\s*/, { token: "keyword", switchTo: "table_body" }],
|
|
89
|
+
// header-divider
|
|
90
|
+
[/^\s*\|/, "keyword.table.left"],
|
|
91
|
+
// opening |
|
|
92
|
+
[/^\s*[^\|]/, "@rematch", "@pop"],
|
|
93
|
+
// exiting
|
|
94
|
+
[/^\s*$/, "@rematch", "@pop"],
|
|
95
|
+
// exiting
|
|
96
|
+
[
|
|
97
|
+
/\|/,
|
|
98
|
+
{
|
|
99
|
+
cases: {
|
|
100
|
+
"@eos": "keyword.table.right",
|
|
101
|
+
// closing |
|
|
102
|
+
"@default": "keyword.table.middle"
|
|
103
|
+
// inner |
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
],
|
|
108
|
+
codeblock: [
|
|
109
|
+
[/^\s*~~~\s*$/, { token: "string", next: "@pop" }],
|
|
110
|
+
[/^\s*```\s*$/, { token: "string", next: "@pop" }],
|
|
111
|
+
[/.*$/, "variable.source"]
|
|
112
|
+
],
|
|
113
|
+
// github style code blocks
|
|
114
|
+
codeblockgh: [
|
|
115
|
+
[/```\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
|
|
116
|
+
[/[^`]+/, "variable.source"]
|
|
117
|
+
],
|
|
118
|
+
linecontent: [
|
|
119
|
+
// escapes
|
|
120
|
+
[/&\w+;/, "string.escape"],
|
|
121
|
+
[/@escapes/, "escape"],
|
|
122
|
+
// various markup
|
|
123
|
+
[/\b__([^\\_]|@escapes|_(?!_))+__\b/, "strong"],
|
|
124
|
+
[/\*\*([^\\*]|@escapes|\*(?!\*))+\*\*/, "strong"],
|
|
125
|
+
[/\b_[^_]+_\b/, "emphasis"],
|
|
126
|
+
[/\*([^\\*]|@escapes)+\*/, "emphasis"],
|
|
127
|
+
[/`([^\\`]|@escapes)+`/, "variable"],
|
|
128
|
+
// links
|
|
129
|
+
[/\{+[^}]+\}+/, "string.target"],
|
|
130
|
+
[/(!?\[)((?:[^\]\\]|@escapes)*)(\]\([^\)]+\))/, ["string.link", "", "string.link"]],
|
|
131
|
+
[/(!?\[)((?:[^\]\\]|@escapes)*)(\])/, "string.link"],
|
|
132
|
+
// or html
|
|
133
|
+
{ include: "html" }
|
|
134
|
+
],
|
|
135
|
+
// Note: it is tempting to rather switch to the real HTML mode instead of building our own here
|
|
136
|
+
// but currently there is a limitation in Monarch that prevents us from doing it: The opening
|
|
137
|
+
// '<' would start the HTML mode, however there is no way to jump 1 character back to let the
|
|
138
|
+
// HTML mode also tokenize the opening angle bracket. Thus, even though we could jump to HTML,
|
|
139
|
+
// we cannot correctly tokenize it in that mode yet.
|
|
140
|
+
html: [
|
|
141
|
+
// html tags
|
|
142
|
+
[/<(\w+)\/>/, "tag"],
|
|
143
|
+
[
|
|
144
|
+
/<(\w+)(\-|\w)*/,
|
|
145
|
+
{
|
|
146
|
+
cases: {
|
|
147
|
+
"@empty": { token: "tag", next: "@tag.$1" },
|
|
148
|
+
"@default": { token: "tag", next: "@tag.$1" }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
[/<\/(\w+)(\-|\w)*\s*>/, { token: "tag" }],
|
|
153
|
+
[/<!--/, "comment", "@comment"]
|
|
154
|
+
],
|
|
155
|
+
comment: [
|
|
156
|
+
[/[^<\-]+/, "comment.content"],
|
|
157
|
+
[/-->/, "comment", "@pop"],
|
|
158
|
+
[/<!--/, "comment.content.invalid"],
|
|
159
|
+
[/[<\-]/, "comment.content"]
|
|
160
|
+
],
|
|
161
|
+
// Almost full HTML tag matching, complete with embedded scripts & styles
|
|
162
|
+
tag: [
|
|
163
|
+
[/[ \t\r\n]+/, "white"],
|
|
164
|
+
[
|
|
165
|
+
/(type)(\s*=\s*)(")([^"]+)(")/,
|
|
166
|
+
[
|
|
167
|
+
"attribute.name.html",
|
|
168
|
+
"delimiter.html",
|
|
169
|
+
"string.html",
|
|
170
|
+
{ token: "string.html", switchTo: "@tag.$S2.$4" },
|
|
171
|
+
"string.html"
|
|
172
|
+
]
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
/(type)(\s*=\s*)(')([^']+)(')/,
|
|
176
|
+
[
|
|
177
|
+
"attribute.name.html",
|
|
178
|
+
"delimiter.html",
|
|
179
|
+
"string.html",
|
|
180
|
+
{ token: "string.html", switchTo: "@tag.$S2.$4" },
|
|
181
|
+
"string.html"
|
|
182
|
+
]
|
|
183
|
+
],
|
|
184
|
+
[/(\w+)(\s*=\s*)("[^"]*"|'[^']*')/, ["attribute.name.html", "delimiter.html", "string.html"]],
|
|
185
|
+
[/\w+/, "attribute.name.html"],
|
|
186
|
+
[/\/>/, "tag", "@pop"],
|
|
187
|
+
[
|
|
188
|
+
/>/,
|
|
189
|
+
{
|
|
190
|
+
cases: {
|
|
191
|
+
"$S2==style": {
|
|
192
|
+
token: "tag",
|
|
193
|
+
switchTo: "embeddedStyle",
|
|
194
|
+
nextEmbedded: "text/css"
|
|
195
|
+
},
|
|
196
|
+
"$S2==script": {
|
|
197
|
+
cases: {
|
|
198
|
+
$S3: {
|
|
199
|
+
token: "tag",
|
|
200
|
+
switchTo: "embeddedScript",
|
|
201
|
+
nextEmbedded: "$S3"
|
|
202
|
+
},
|
|
203
|
+
"@default": {
|
|
204
|
+
token: "tag",
|
|
205
|
+
switchTo: "embeddedScript",
|
|
206
|
+
nextEmbedded: "text/javascript"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"@default": { token: "tag", next: "@pop" }
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
],
|
|
215
|
+
embeddedStyle: [
|
|
216
|
+
[/[^<]+/, ""],
|
|
217
|
+
[/<\/style\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
|
|
218
|
+
[/</, ""]
|
|
219
|
+
],
|
|
220
|
+
embeddedScript: [
|
|
221
|
+
[/[^<]+/, ""],
|
|
222
|
+
[/<\/script\s*>/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
|
|
223
|
+
[/</, ""]
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const t = "aimd";
|
|
228
|
+
function n(...o) {
|
|
229
|
+
const s = o.map((c) => c.toUpperCase().replace(/-/g, "_").replace(/\./g, "_")).join("_"), a = o.join(".");
|
|
230
|
+
return { [s]: a };
|
|
231
|
+
}
|
|
232
|
+
function r(o) {
|
|
233
|
+
return n("markup", t, o);
|
|
234
|
+
}
|
|
235
|
+
function i(o) {
|
|
236
|
+
return n("keyword", o, t);
|
|
237
|
+
}
|
|
238
|
+
const m = {
|
|
239
|
+
...r("variable"),
|
|
240
|
+
...r("variable-table"),
|
|
241
|
+
...r("checkpoint"),
|
|
242
|
+
...r("step"),
|
|
243
|
+
...r("reference.step"),
|
|
244
|
+
...r("reference.variable")
|
|
245
|
+
}, A = {
|
|
246
|
+
...i("variable"),
|
|
247
|
+
...i("variable-table"),
|
|
248
|
+
...i("checkpoint"),
|
|
249
|
+
...i("step"),
|
|
250
|
+
...i("reference.step"),
|
|
251
|
+
...i("reference.variable")
|
|
252
|
+
}, g = {
|
|
253
|
+
...n("delimiter", "pipe", t),
|
|
254
|
+
...n("delimiter", "parameter", t),
|
|
255
|
+
...n("delimiter", "colon", t),
|
|
256
|
+
...n("delimiter", "bracket", t)
|
|
257
|
+
}, k = {
|
|
258
|
+
...n("keyword", "control", t),
|
|
259
|
+
...n("variable", "parameter", t),
|
|
260
|
+
...n("metatag", "link", t),
|
|
261
|
+
...n("string", "link", "description", t),
|
|
262
|
+
...n("string", "link", "url", t),
|
|
263
|
+
...n("metatag", "image", t),
|
|
264
|
+
// Type syntax tokens - using standard TextMate scopes for better theme compatibility
|
|
265
|
+
...n("support", "type", t),
|
|
266
|
+
// Types like str, int, list[Student] - usually colored as types
|
|
267
|
+
...n("constant", "numeric", t),
|
|
268
|
+
// Numbers like 18, 3.14
|
|
269
|
+
...n("string", "quoted", t),
|
|
270
|
+
// Strings like "Alice"
|
|
271
|
+
...n("constant", "language", t),
|
|
272
|
+
// true, false, null
|
|
273
|
+
...n("variable", "other", t),
|
|
274
|
+
// Variable names like name, age
|
|
275
|
+
...n("keyword", "other", "subvars", t)
|
|
276
|
+
// subvars keyword
|
|
277
|
+
}, e = {
|
|
278
|
+
...n("punctuation", "definition", "begin", t),
|
|
279
|
+
...n("punctuation", "definition", "end", t),
|
|
280
|
+
...m,
|
|
281
|
+
...A,
|
|
282
|
+
...g,
|
|
283
|
+
...k
|
|
284
|
+
}, u = "text.html.markdown.aimd", p = [
|
|
285
|
+
..._.autoClosingPairs || []
|
|
286
|
+
], D = p;
|
|
287
|
+
function b(o, s = "|") {
|
|
288
|
+
return o.split(s);
|
|
289
|
+
}
|
|
290
|
+
const I = b("var|var_table|check|step|ref_step|ref_var|ref_table|table_link"), R = {
|
|
291
|
+
...d,
|
|
292
|
+
tokenPostfix: ".aimd",
|
|
293
|
+
keywords: I,
|
|
294
|
+
tokenizer: {
|
|
295
|
+
...d.tokenizer,
|
|
296
|
+
root: [
|
|
297
|
+
[/^\s*(```|~~~)\s*quiz(?:\s+.*)?\s*$/, {
|
|
298
|
+
token: "string",
|
|
299
|
+
next: "@quizCodeblock",
|
|
300
|
+
nextEmbedded: "yaml"
|
|
301
|
+
}],
|
|
302
|
+
[/^\s*(```|~~~)\s*assigner(?:\s+.*\bruntime\s*=\s*(?:"client"|'client'|client)\b.*)\s*$/, {
|
|
303
|
+
token: "string",
|
|
304
|
+
next: "@assignerCodeblock",
|
|
305
|
+
nextEmbedded: "javascript"
|
|
306
|
+
}],
|
|
307
|
+
[/^\s*(```|~~~)\s*assigner(?:\s+.*)?\s*$/, {
|
|
308
|
+
token: "string",
|
|
309
|
+
next: "@assignerCodeblock",
|
|
310
|
+
nextEmbedded: "python"
|
|
311
|
+
}],
|
|
312
|
+
...d.tokenizer.root,
|
|
313
|
+
{ include: "@aimd" }
|
|
314
|
+
],
|
|
315
|
+
table_body: [...d.tokenizer.table_body, { include: "@aimd" }],
|
|
316
|
+
assignerCodeblock: [
|
|
317
|
+
[/^\s*(```|~~~)\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
|
|
318
|
+
[/.*$/, ""]
|
|
319
|
+
],
|
|
320
|
+
quizCodeblock: [
|
|
321
|
+
[/^\s*(```|~~~)\s*$/, { token: "string", next: "@pop", nextEmbedded: "@pop" }],
|
|
322
|
+
[/.*$/, ""]
|
|
323
|
+
],
|
|
324
|
+
aimd: [
|
|
325
|
+
// 1. AIMD Protocol Fields: {{keyword|content}}
|
|
326
|
+
// This rule finds the opening '{{' and switches to the 'protocol' state
|
|
327
|
+
// to handle the special syntax. This has the highest priority.
|
|
328
|
+
[/\{\{/, {
|
|
329
|
+
token: e.PUNCTUATION_DEFINITION_BEGIN_AIMD,
|
|
330
|
+
bracket: "@open",
|
|
331
|
+
next: "@protocol"
|
|
332
|
+
}],
|
|
333
|
+
// Links: [text](url)
|
|
334
|
+
[/\[([^\]]+)\]\s*\(([^)]+)\)/, [
|
|
335
|
+
{ token: e.METATAG_LINK_AIMD },
|
|
336
|
+
// [
|
|
337
|
+
{ token: e.STRING_LINK_DESCRIPTION_AIMD },
|
|
338
|
+
// text
|
|
339
|
+
{ token: e.METATAG_LINK_AIMD },
|
|
340
|
+
// ](
|
|
341
|
+
{ token: e.STRING_LINK_URL_AIMD },
|
|
342
|
+
// url
|
|
343
|
+
{ token: e.METATAG_LINK_AIMD }
|
|
344
|
+
// )
|
|
345
|
+
]],
|
|
346
|
+
// Images: 
|
|
347
|
+
[/!\[([^\]]+)\]\s*\(([^)]+)\)/, [
|
|
348
|
+
{ token: e.METATAG_IMAGE_AIMD },
|
|
349
|
+
// 
|
|
358
|
+
]]
|
|
359
|
+
],
|
|
360
|
+
// This state is active inside {{ ... }}
|
|
361
|
+
protocol: [
|
|
362
|
+
// Match the keywords from your regexes
|
|
363
|
+
// [/(var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)/, AimdToken.KEYWORD_CONTROL_AIMD],
|
|
364
|
+
[/var(\s*\|)/, e.KEYWORD_VARIABLE_AIMD],
|
|
365
|
+
[/var_table(\s*\|)/, e.KEYWORD_VARIABLE_TABLE_AIMD],
|
|
366
|
+
[/step(\s*\|)/, e.KEYWORD_STEP_AIMD],
|
|
367
|
+
[/check(\s*\|)/, e.KEYWORD_CHECKPOINT_AIMD],
|
|
368
|
+
[/ref_var(\s*\|)/, e.KEYWORD_REFERENCE_VARIABLE_AIMD],
|
|
369
|
+
[/ref_step(\s*\|)/, e.KEYWORD_REFERENCE_STEP_AIMD],
|
|
370
|
+
// Match the pipe delimiter
|
|
371
|
+
[/\|/, { token: e.DELIMITER_PIPE_AIMD, next: "@protocolContent" }],
|
|
372
|
+
// Match the closing '}}' and pop back to the root state
|
|
373
|
+
[/\}\}/, { token: e.PUNCTUATION_DEFINITION_END_AIMD, bracket: "@close", next: "@pop" }]
|
|
374
|
+
],
|
|
375
|
+
// Content inside protocol after the pipe delimiter - supports type syntax
|
|
376
|
+
protocolContent: [
|
|
377
|
+
// Match the closing '}}' and pop back to the root state
|
|
378
|
+
[/\}\}/, { token: e.PUNCTUATION_DEFINITION_END_AIMD, bracket: "@close", next: "@popall" }],
|
|
379
|
+
// Match subvars keyword
|
|
380
|
+
[/\bsubvars\b/, e.KEYWORD_OTHER_SUBVARS_AIMD],
|
|
381
|
+
// Match var keyword (for nested var() calls in subvars)
|
|
382
|
+
[/\bvar\b/, e.KEYWORD_VARIABLE_AIMD],
|
|
383
|
+
// Match type annotations after colon (e.g., : str, : int, : list[Student])
|
|
384
|
+
[/:/, { token: e.DELIMITER_COLON_AIMD, next: "@typeAnnotation" }],
|
|
385
|
+
// Match string literals (double or single quoted)
|
|
386
|
+
[/"([^"\\]|\\.)*"/, e.STRING_QUOTED_AIMD],
|
|
387
|
+
[/'([^'\\]|\\.)*'/, e.STRING_QUOTED_AIMD],
|
|
388
|
+
// Match numbers (integer and float)
|
|
389
|
+
[/-?\d+\.?\d*/, e.CONSTANT_NUMERIC_AIMD],
|
|
390
|
+
// Match boolean/null literals
|
|
391
|
+
[/\b(true|false|True|False|null|None)\b/, e.CONSTANT_LANGUAGE_AIMD],
|
|
392
|
+
// Match equals signs and commas used for parameters
|
|
393
|
+
[/=/, e.DELIMITER_PARAMETER_AIMD],
|
|
394
|
+
[/,/, e.DELIMITER_PARAMETER_AIMD],
|
|
395
|
+
// Match brackets for subvars and type params
|
|
396
|
+
[/[[\]()]/, e.DELIMITER_BRACKET_AIMD],
|
|
397
|
+
// Match variable name (identifier at start)
|
|
398
|
+
[/\b\w+\b/, e.VARIABLE_OTHER_AIMD],
|
|
399
|
+
// Skip whitespace
|
|
400
|
+
[/\s+/, ""]
|
|
401
|
+
],
|
|
402
|
+
// Type annotation state (after colon)
|
|
403
|
+
typeAnnotation: [
|
|
404
|
+
// Match type with generic params like list[Student]
|
|
405
|
+
[/\w+(?:\[[\w,\s]+\])?/, { token: e.SUPPORT_TYPE_AIMD, next: "@pop" }],
|
|
406
|
+
// Skip whitespace
|
|
407
|
+
[/\s+/, ""],
|
|
408
|
+
// Pop on other characters
|
|
409
|
+
[/./, { token: "@rematch", next: "@pop" }]
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
}, M = {
|
|
413
|
+
..._,
|
|
414
|
+
autoClosingPairs: p,
|
|
415
|
+
surroundingPairs: D
|
|
416
|
+
}, N = {
|
|
417
|
+
provideCompletionItems: (o, s) => ({ suggestions: I.map((c) => ({
|
|
418
|
+
label: c,
|
|
419
|
+
kind: l.CompletionItemKind.Keyword,
|
|
420
|
+
insertText: c,
|
|
421
|
+
insertTextRules: l.CompletionItemInsertTextRule.InsertAsSnippet
|
|
422
|
+
})) })
|
|
423
|
+
}, E = [
|
|
424
|
+
// {{ and }} brackets - green
|
|
425
|
+
{
|
|
426
|
+
scope: [
|
|
427
|
+
e.PUNCTUATION_DEFINITION_BEGIN_AIMD,
|
|
428
|
+
e.PUNCTUATION_DEFINITION_END_AIMD
|
|
429
|
+
],
|
|
430
|
+
settings: {
|
|
431
|
+
foreground: "#059669"
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
// var keyword - blue italic
|
|
435
|
+
{
|
|
436
|
+
scope: [
|
|
437
|
+
e.KEYWORD_VARIABLE_AIMD
|
|
438
|
+
],
|
|
439
|
+
settings: {
|
|
440
|
+
foreground: "#2563EB",
|
|
441
|
+
fontStyle: "italic"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
// var_table keyword - green italic
|
|
445
|
+
{
|
|
446
|
+
scope: [e.KEYWORD_VARIABLE_TABLE_AIMD],
|
|
447
|
+
settings: {
|
|
448
|
+
foreground: "#059669",
|
|
449
|
+
fontStyle: "italic"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
// step, check keywords - orange italic
|
|
453
|
+
{
|
|
454
|
+
scope: [
|
|
455
|
+
e.KEYWORD_STEP_AIMD,
|
|
456
|
+
e.KEYWORD_CHECKPOINT_AIMD,
|
|
457
|
+
e.KEYWORD_CONTROL_AIMD
|
|
458
|
+
],
|
|
459
|
+
settings: {
|
|
460
|
+
foreground: "#D97706",
|
|
461
|
+
fontStyle: "italic"
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
// ref_var, ref_step reference keywords - cyan italic
|
|
465
|
+
{
|
|
466
|
+
scope: [
|
|
467
|
+
e.KEYWORD_REFERENCE_VARIABLE_AIMD,
|
|
468
|
+
e.KEYWORD_REFERENCE_STEP_AIMD
|
|
469
|
+
],
|
|
470
|
+
settings: {
|
|
471
|
+
foreground: "#0891B2",
|
|
472
|
+
fontStyle: "italic"
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
// Variable names (title, name, age etc) - purple
|
|
476
|
+
{
|
|
477
|
+
scope: [e.VARIABLE_OTHER_AIMD],
|
|
478
|
+
settings: {
|
|
479
|
+
foreground: "#7C3AED"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
// Types (str, int, list[Student] etc) - dark purple italic
|
|
483
|
+
{
|
|
484
|
+
scope: [e.SUPPORT_TYPE_AIMD],
|
|
485
|
+
settings: {
|
|
486
|
+
foreground: "#6D28D9",
|
|
487
|
+
fontStyle: "italic"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
// Parameter variables - purple bold
|
|
491
|
+
{
|
|
492
|
+
scope: [e.VARIABLE_PARAMETER_AIMD],
|
|
493
|
+
settings: {
|
|
494
|
+
foreground: "#7C3AED",
|
|
495
|
+
fontStyle: "bold"
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
// | pipe delimiter - gray
|
|
499
|
+
{
|
|
500
|
+
scope: [e.DELIMITER_PIPE_AIMD],
|
|
501
|
+
settings: {
|
|
502
|
+
foreground: "#6B7280"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
// : colon - gray
|
|
506
|
+
{
|
|
507
|
+
scope: [e.DELIMITER_COLON_AIMD],
|
|
508
|
+
settings: {
|
|
509
|
+
foreground: "#9CA3AF"
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
// = , and other delimiters - gray
|
|
513
|
+
{
|
|
514
|
+
scope: [e.DELIMITER_PARAMETER_AIMD],
|
|
515
|
+
settings: {
|
|
516
|
+
foreground: "#9CA3AF"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
// Strings - green
|
|
520
|
+
{
|
|
521
|
+
scope: [e.STRING_QUOTED_AIMD],
|
|
522
|
+
settings: {
|
|
523
|
+
foreground: "#059669"
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
// Numbers - teal
|
|
527
|
+
{
|
|
528
|
+
scope: [e.CONSTANT_NUMERIC_AIMD],
|
|
529
|
+
settings: {
|
|
530
|
+
foreground: "#0D9488"
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
// Boolean/null - blue
|
|
534
|
+
{
|
|
535
|
+
scope: [e.CONSTANT_LANGUAGE_AIMD],
|
|
536
|
+
settings: {
|
|
537
|
+
foreground: "#1D4ED8"
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
// subvars keyword - dark purple bold
|
|
541
|
+
{
|
|
542
|
+
scope: [e.KEYWORD_OTHER_SUBVARS_AIMD],
|
|
543
|
+
settings: {
|
|
544
|
+
foreground: "#5B21B6",
|
|
545
|
+
fontStyle: "bold"
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
// Brackets [] () - gray
|
|
549
|
+
{
|
|
550
|
+
scope: [e.DELIMITER_BRACKET_AIMD],
|
|
551
|
+
settings: {
|
|
552
|
+
foreground: "#6B7280"
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
], f = {
|
|
556
|
+
name: "aimd-theme",
|
|
557
|
+
type: "light",
|
|
558
|
+
settings: E,
|
|
559
|
+
colors: {}
|
|
560
|
+
};
|
|
561
|
+
function x(o, s = "aimd-extended") {
|
|
562
|
+
const a = o.settings || o.tokenColors || [];
|
|
563
|
+
return {
|
|
564
|
+
...o,
|
|
565
|
+
name: s,
|
|
566
|
+
settings: [...a, ...E]
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
export {
|
|
570
|
+
t as A,
|
|
571
|
+
g as D,
|
|
572
|
+
A as K,
|
|
573
|
+
m as M,
|
|
574
|
+
e as a,
|
|
575
|
+
k as b,
|
|
576
|
+
f as c,
|
|
577
|
+
E as d,
|
|
578
|
+
N as e,
|
|
579
|
+
M as f,
|
|
580
|
+
x as g,
|
|
581
|
+
R as l,
|
|
582
|
+
u as s
|
|
583
|
+
};
|