@airalogy/aimd-editor 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,6 +23,19 @@ monaco.languages.setLanguageConfiguration("aimd", conf)
23
23
  monaco.languages.registerCompletionItemProvider("aimd", completionItemProvider)
24
24
  ```
25
25
 
26
+ ## Figure Authoring And Formal Output
27
+
28
+ The reusable authoring entry keeps draft editing permissive while making explicit save and export operations strict. `prepareAimdForFormalOutput()` generates missing IDs for closed `fig` blocks that already have `src`, preserves existing IDs, rejects duplicate IDs or missing sources, and returns the AIMD source that must be written back before downloading `.aimd` or packaging `.aira`. When `generated` is non-empty, hosts should show a non-blocking notice that IDs were generated and written into the source.
29
+
30
+ ```ts
31
+ import { prepareAimdForFormalOutput } from "@airalogy/aimd-editor/authoring"
32
+
33
+ const prepared = prepareAimdForFormalOutput(source)
34
+ source = prepared.content
35
+ ```
36
+
37
+ Do not call this normalizer from automatic draft saving. `AimdSourceEditor` separately diagnoses closed figures with missing IDs and offers a generate-ID quick fix without rewriting incomplete input.
38
+
26
39
  ## Vue Editor i18n
27
40
 
28
41
  ```vue
@@ -37,7 +50,7 @@ import { AimdEditor } from "@airalogy/aimd-editor"
37
50
 
38
51
  Use `messages` to override built-in copy per locale.
39
52
 
40
- The Vue source editor surfaces parser-level semantic warnings for AIMD var definitions, including default/type mismatches and numeric constraint kwargs used on non-numeric types.
53
+ The Vue source editor surfaces parser-level semantic warnings for AIMD var definitions, including default/type mismatches and numeric constraint kwargs used on non-numeric types. It also reports missing or duplicate figure IDs and missing figure sources.
41
54
 
42
55
  For advanced embedding, the low-level `AimdWysiwygEditor` now accepts a custom Milkdown plugin chain, and `AimdFieldDialog` can be limited to a focused subset of AIMD field kinds with `allowedTypes`.
43
56
 
package/README.zh-CN.md CHANGED
@@ -23,6 +23,19 @@ monaco.languages.setLanguageConfiguration("aimd", conf)
23
23
  monaco.languages.registerCompletionItemProvider("aimd", completionItemProvider)
24
24
  ```
25
25
 
26
+ ## 图片编辑与正式输出
27
+
28
+ 可复用的 authoring 入口会保持草稿编辑宽松,同时使显式保存和导出操作保持严格。`prepareAimdForFormalOutput()` 会为已闭合且已有 `src` 的 `fig` 块生成缺失的 ID,保留已有 ID,拒绝重复 ID 或缺失图片源,并返回必须在下载 `.aimd` 或打包 `.aira` 前写回编辑器的 AIMD 源文本。当 `generated` 非空时,宿主应给出非阻塞提示,明确说明 ID 已生成并写入源文本。
29
+
30
+ ```ts
31
+ import { prepareAimdForFormalOutput } from "@airalogy/aimd-editor/authoring"
32
+
33
+ const prepared = prepareAimdForFormalOutput(source)
34
+ source = prepared.content
35
+ ```
36
+
37
+ 不要在自动草稿保存中调用这个规范化函数。`AimdSourceEditor` 会单独诊断已闭合且缺失 ID 的图片,并提供生成 ID 的快速修复,不会改写未完成的输入。
38
+
26
39
  ## Vue 编辑器 i18n
27
40
 
28
41
  ```vue
@@ -37,7 +50,7 @@ import { AimdEditor } from "@airalogy/aimd-editor"
37
50
 
38
51
  也可以通过 `messages` 覆盖内建文案。
39
52
 
40
- Vue 源码编辑器会显示 parser 级语义 warning,包括 AIMD var 默认值与类型不匹配,以及数值约束 kwargs 被用在非数值类型上。
53
+ Vue 源码编辑器会显示 parser 级语义 warning,包括 AIMD var 默认值与类型不匹配,以及数值约束 kwargs 被用在非数值类型上。它还会报告图片 ID 缺失、ID 重复和图片源缺失问题。
41
54
 
42
55
  如果要做更底层的嵌入式集成,`AimdWysiwygEditor` 现在支持注入自定义 Milkdown plugin 链,`AimdFieldDialog` 也支持通过 `allowedTypes` 限定可插入的 AIMD 字段类型。
43
56
 
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as ve, computed as $, ref as B, watch as E, openBlock as u, createBlock as Be, Teleport as Ue, createElementBlock as v, withModifiers as ue, createElementVNode as l, normalizeStyle as me, createTextVNode as N, toDisplayString as i, Fragment as q, renderList as j, normalizeClass as W, withDirectives as b, vModelText as x, createCommentVNode as z, vModelSelect as ke, vModelRadio as Le, vModelCheckbox as He, shallowRef as _e, nextTick as ze, unref as K, createVNode as Me, vShow as Ie } from "vue";
2
2
  import { callCommand as De, insert as Te, replaceAll as ce, getMarkdown as xe } from "@milkdown/kit/utils";
3
3
  import "@milkdown/theme-nord/style.css";
4
- import { j as Ve, m as ie, k as Pe, h as $e, o as Re, i as Ne, l as Fe, _ as Oe, n as Ke } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-DPs--N5C.js";
5
- import { _ as Qe } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-DCbNbka1.js";
4
+ import { j as Ve, m as ie, k as Pe, h as $e, o as Re, i as Ne, l as Fe, _ as Oe, n as Ke } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-Dme3UQEf.js";
5
+ import { _ as Qe } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-CJJTlVZ7.js";
6
6
  import { protectAimdInlineTemplates as je, restoreAimdInlineTemplates as We } from "@airalogy/aimd-core";
7
7
  import { parseAndExtract as Ge } from "@airalogy/aimd-renderer";
8
8
  import { insertTableCommand as Je } from "@milkdown/kit/preset/gfm";
@@ -751,7 +751,7 @@ function at(c) {
751
751
  return G(I) ? m : I;
752
752
  }
753
753
  function J(n) {
754
- return /\{\{(?:var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)\|/.test(n) || /```(?:quiz|fig|assigner)\b/.test(n);
754
+ return /\{\{(?:var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)\|/.test(n) || /```(?:quiz|fig|assigner|connectors)\b/.test(n);
755
755
  }
756
756
  function X() {
757
757
  if (h.value)
@@ -0,0 +1,422 @@
1
+ import { defineComponent as Q, ref as N, onMounted as Y, onBeforeUnmount as J, watch as O, openBlock as T, createElementBlock as $, normalizeStyle as X, toDisplayString as ee, createCommentVNode as te, createElementVNode as ne } from "vue";
2
+ import { v as oe, d as ie, e as se, f as re, s as de, n as ae } from "./index-BqB8Xukp.js";
3
+ const le = /\{\{\s*(var_table|var)\s*\|([\s\S]*?)\}\}/g, ce = /^[ \t]*(```|~~~)[ \t]*media(?:[^\n]*)?\r?\n([\s\S]*?)^[ \t]*\1[ \t]*$/gm, ue = {
4
+ figureMissingId: "This figure is missing the required ID. Generate or enter a unique ID.",
5
+ figureMissingSrc: "This figure is missing the required src field.",
6
+ figureDuplicateId: (a) => `Figure ID "${a}" is already used in this document.`,
7
+ generateFigureId: "Generate figure ID"
8
+ };
9
+ function D(a, p = ue) {
10
+ const c = [];
11
+ for (const o of a.matchAll(le)) {
12
+ const r = o.index ?? 0, f = o[0], u = o[2] ?? "";
13
+ try {
14
+ const g = oe(ie(u));
15
+ g.length > 0 && c.push({
16
+ message: g.join(`
17
+ `),
18
+ severity: "warning",
19
+ startOffset: r,
20
+ endOffset: r + f.length
21
+ });
22
+ } catch {
23
+ }
24
+ }
25
+ for (const o of a.matchAll(ce)) {
26
+ const r = o.index ?? 0, f = o[0], u = o[2] ?? "";
27
+ try {
28
+ const g = se(re(u));
29
+ g.length > 0 && c.push({
30
+ message: g.join(`
31
+ `),
32
+ severity: "error",
33
+ startOffset: r,
34
+ endOffset: r + f.length
35
+ });
36
+ } catch {
37
+ }
38
+ }
39
+ const s = de(a), b = new Map(
40
+ ae(a).generated.map((o) => [o.blockStartOffset, o])
41
+ ), v = /* @__PURE__ */ new Set();
42
+ for (const o of s) {
43
+ const r = o.id?.value ?? "", f = o.src?.value ?? "";
44
+ if (!r) {
45
+ const u = b.get(o.startOffset);
46
+ c.push({
47
+ code: "fig-missing-id",
48
+ message: p.figureMissingId,
49
+ severity: "error",
50
+ startOffset: o.startOffset,
51
+ endOffset: o.endOffset,
52
+ ...u ? {
53
+ quickFix: {
54
+ title: p.generateFigureId,
55
+ edit: u.edit
56
+ }
57
+ } : {}
58
+ });
59
+ }
60
+ f || c.push({
61
+ code: "fig-missing-src",
62
+ message: p.figureMissingSrc,
63
+ severity: "error",
64
+ startOffset: o.startOffset,
65
+ endOffset: o.endOffset
66
+ }), r && (v.has(r) && c.push({
67
+ code: "fig-duplicate-id",
68
+ message: p.figureDuplicateId(r),
69
+ severity: "error",
70
+ startOffset: o.startOffset,
71
+ endOffset: o.endOffset
72
+ }), v.add(r));
73
+ }
74
+ return c;
75
+ }
76
+ const fe = {
77
+ key: 0,
78
+ class: "aimd-editor-loading"
79
+ }, w = "airalogy-aimd", pe = /* @__PURE__ */ Q({
80
+ __name: "AimdSourceEditor",
81
+ props: {
82
+ content: {},
83
+ theme: {},
84
+ minHeight: {},
85
+ readonly: { type: Boolean },
86
+ monacoOptions: {},
87
+ resolvedMessages: {}
88
+ },
89
+ emits: ["content-change", "ready", "monaco-loaded"],
90
+ setup(a, { expose: p, emit: c }) {
91
+ const s = a, b = c, v = /^\s*(```|~~~)\s*assigner(?:\s+.*\bruntime\s*=\s*(?:"client"|'client'|client)\b.*)\s*$/, o = /^\s*(```|~~~)\s*assigner(?:\s+.*)?\s*$/, r = /^\s*(```|~~~)\s*quiz(?:\s+.*)?\s*$/, f = /^\s*(```|~~~)\s*connectors(?:\s+.*)?\s*$/, u = /^\s*(```|~~~)\s*((?:\w|[/#-])+)(?:\s+.*)?\s*$/, g = /^\s*(```|~~~)\s*$/, C = N(null);
92
+ let t = null, l = null, x = null, y = !1;
93
+ const h = N(!0);
94
+ function F(e) {
95
+ const n = s.resolvedMessages;
96
+ e.languages.getLanguages().some((d) => d.id === "aimd") || (e.languages.register({
97
+ id: "aimd",
98
+ extensions: [".aimd"],
99
+ aliases: ["AIMD", "aimd"],
100
+ mimetypes: ["text/x-aimd"]
101
+ }), e.languages.setLanguageConfiguration("aimd", {
102
+ brackets: [
103
+ ["{", "}"],
104
+ ["[", "]"],
105
+ ["(", ")"]
106
+ ],
107
+ autoClosingPairs: [
108
+ { open: "{", close: "}" },
109
+ { open: "[", close: "]" },
110
+ { open: "(", close: ")" },
111
+ { open: '"', close: '"' },
112
+ { open: "'", close: "'" },
113
+ { open: "`", close: "`" },
114
+ { open: "{{", close: "}}" }
115
+ ],
116
+ surroundingPairs: [
117
+ { open: "{", close: "}" },
118
+ { open: "[", close: "]" },
119
+ { open: "(", close: ")" },
120
+ { open: '"', close: '"' },
121
+ { open: "'", close: "'" },
122
+ { open: "`", close: "`" }
123
+ ]
124
+ }), e.languages.setMonarchTokensProvider("aimd", {
125
+ defaultToken: "",
126
+ tokenPostfix: ".aimd",
127
+ tokenizer: {
128
+ root: [
129
+ [/\{\{/, { token: "delimiter.bracket.aimd", next: "@aimdField" }],
130
+ [/^#{1,6}\s.*$/, "keyword.md"],
131
+ [r, { token: "string.code", next: "@embeddedCodeblock", nextEmbedded: "yaml" }],
132
+ [f, { token: "string.code", next: "@embeddedCodeblock", nextEmbedded: "yaml" }],
133
+ [v, { token: "string.code", next: "@embeddedCodeblock", nextEmbedded: "javascript" }],
134
+ [o, { token: "string.code", next: "@embeddedCodeblock", nextEmbedded: "python" }],
135
+ [u, { token: "string.code", next: "@embeddedCodeblock", nextEmbedded: "$2" }],
136
+ [g, { token: "string.code", next: "@codeblock" }],
137
+ [/`[^`]+`/, "string.code"],
138
+ [/\*\*[^*]+\*\*/, "strong"],
139
+ [/__[^_]+__/, "strong"],
140
+ [/\*[^*]+\*/, "emphasis"],
141
+ [/_[^_]+_/, "emphasis"],
142
+ [/\[[^\]]+\]\([^)]+\)/, "string.link"],
143
+ [/!\[[^\]]*\]\([^)]+\)/, "string.link"],
144
+ [/^>.*$/, "comment.quote"],
145
+ [/^\s*[-*+]\s/, "keyword.list"],
146
+ [/^\s*\d+\.\s/, "keyword.list"],
147
+ [/^[-*_]{3,}\s*$/, "keyword.hr"],
148
+ [/<\/?[\w-][^>]*>/, "tag"]
149
+ ],
150
+ aimdField: [
151
+ [/\}\}/, { token: "delimiter.bracket.aimd", next: "@pop" }],
152
+ [/\b(var_table|var|step|check|ref_step|ref_var|ref_fig|cite)\b/, "keyword.aimd"],
153
+ [/\|/, "delimiter.aimd"],
154
+ [/:/, "delimiter"],
155
+ [/\b(str|int|float|bool|list|dict|any)\b/, "type.aimd"],
156
+ [/\b[A-Z][A-Za-z0-9_]*(?:\[[A-Za-z0-9_,\s]+\])?\b/, "type.aimd"],
157
+ [/[[\]()]/, "delimiter.bracket"],
158
+ [/=/, "delimiter"],
159
+ [/"[^"]*"/, "string"],
160
+ [/'[^']*'/, "string"],
161
+ [/-?\d+\.?\d*/, "number"],
162
+ [/\b(true|false|True|False|null|None)\b/, "constant"],
163
+ [/\bsubvars\b/, "keyword"],
164
+ [/,/, "delimiter"],
165
+ [/[A-Za-z_]\w*/, "variable.aimd"],
166
+ [/\s+/, ""]
167
+ ],
168
+ codeblock: [
169
+ [/^```\s*$/, { token: "string.code", next: "@pop" }],
170
+ [/^~~~\s*$/, { token: "string.code", next: "@pop" }],
171
+ [/.*$/, "string.code"]
172
+ ],
173
+ embeddedCodeblock: [
174
+ [/^```\s*$/, { token: "string.code", next: "@pop", nextEmbedded: "@pop" }],
175
+ [/^~~~\s*$/, { token: "string.code", next: "@pop", nextEmbedded: "@pop" }],
176
+ [/.*$/, ""]
177
+ ]
178
+ }
179
+ }), e.languages.registerCompletionItemProvider("aimd", {
180
+ provideCompletionItems: () => {
181
+ const d = ["var", "var_table", "step", "check", "ref_step", "ref_var", "ref_fig", "cite"], k = {
182
+ var: "var_id",
183
+ var_table: "table_id",
184
+ step: "step_id",
185
+ check: "check_id",
186
+ ref_step: "step_id",
187
+ ref_var: "var_id",
188
+ ref_fig: "fig_id",
189
+ cite: "ref_id"
190
+ }, E = d.map((_) => ({
191
+ label: `{{${_}|}}`,
192
+ kind: e.languages.CompletionItemKind.Snippet,
193
+ insertText: `{{${_}|\${1:${k[_] ?? "id"}}}}`,
194
+ insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
195
+ documentation: n.completions.insertAimdField(_)
196
+ }));
197
+ return E.push({
198
+ label: n.completions.quizBlockLabel,
199
+ kind: e.languages.CompletionItemKind.Snippet,
200
+ insertText: [
201
+ "```quiz",
202
+ "id: ${1:quiz_choice_1}",
203
+ "type: choice",
204
+ "mode: single",
205
+ "stem: |",
206
+ ` \${2:${n.defaults.questionStem}}`,
207
+ "options:",
208
+ " - key: A",
209
+ ` text: ${n.defaults.optionText("A")}`,
210
+ " - key: B",
211
+ ` text: ${n.defaults.optionText("B")}`,
212
+ "answer: A",
213
+ "```"
214
+ ].join(`
215
+ `),
216
+ insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet,
217
+ documentation: n.completions.quizBlock
218
+ }), { suggestions: E };
219
+ }
220
+ }), e.editor.defineTheme("aimd-light", {
221
+ base: "vs",
222
+ inherit: !0,
223
+ rules: [
224
+ { token: "delimiter.bracket.aimd", foreground: "2563eb" },
225
+ { token: "keyword.aimd", foreground: "2563eb", fontStyle: "bold" },
226
+ { token: "delimiter.aimd", foreground: "6b7280" },
227
+ { token: "type.aimd", foreground: "7c3aed" },
228
+ { token: "variable.aimd", foreground: "059669" },
229
+ { token: "keyword.md", foreground: "1e40af" },
230
+ { token: "string.code", foreground: "be185d" },
231
+ { token: "strong", fontStyle: "bold" },
232
+ { token: "emphasis", fontStyle: "italic" },
233
+ { token: "string.link", foreground: "2563eb" },
234
+ { token: "comment.quote", foreground: "6b7280", fontStyle: "italic" }
235
+ ],
236
+ colors: {}
237
+ }), e.editor.defineTheme("aimd-dark", {
238
+ base: "vs-dark",
239
+ inherit: !0,
240
+ rules: [
241
+ { token: "delimiter.bracket.aimd", foreground: "60a5fa" },
242
+ { token: "keyword.aimd", foreground: "60a5fa", fontStyle: "bold" },
243
+ { token: "delimiter.aimd", foreground: "9ca3af" },
244
+ { token: "type.aimd", foreground: "a78bfa" },
245
+ { token: "variable.aimd", foreground: "34d399" },
246
+ { token: "keyword.md", foreground: "93c5fd" },
247
+ { token: "string.code", foreground: "f472b6" },
248
+ { token: "strong", fontStyle: "bold" },
249
+ { token: "emphasis", fontStyle: "italic" },
250
+ { token: "string.link", foreground: "60a5fa" },
251
+ { token: "comment.quote", foreground: "9ca3af", fontStyle: "italic" }
252
+ ],
253
+ colors: {}
254
+ }));
255
+ }
256
+ function S() {
257
+ if (!l || !t) return;
258
+ const e = t.getModel();
259
+ if (!e) return;
260
+ const n = D(e.getValue(), s.resolvedMessages.diagnostics).map((i) => {
261
+ const d = e.getPositionAt(i.startOffset), k = e.getPositionAt(i.endOffset);
262
+ return {
263
+ severity: i.severity === "error" ? l.MarkerSeverity.Error : l.MarkerSeverity.Warning,
264
+ message: i.message,
265
+ code: i.code,
266
+ source: "AIMD",
267
+ startLineNumber: d.lineNumber,
268
+ startColumn: d.column,
269
+ endLineNumber: k.lineNumber,
270
+ endColumn: k.column
271
+ };
272
+ });
273
+ l.editor.setModelMarkers(e, w, n);
274
+ }
275
+ function L(e, n, i, d) {
276
+ return e <= d && n >= i;
277
+ }
278
+ function P(e) {
279
+ x?.dispose(), x = e.languages.registerCodeActionProvider("aimd", {
280
+ provideCodeActions(n, i, d) {
281
+ if (s.readonly || n !== t?.getModel())
282
+ return { actions: [], dispose() {
283
+ } };
284
+ const k = n.getOffsetAt({
285
+ lineNumber: i.startLineNumber,
286
+ column: i.startColumn
287
+ }), E = n.getOffsetAt({
288
+ lineNumber: i.endLineNumber,
289
+ column: i.endColumn
290
+ });
291
+ return { actions: D(n.getValue(), s.resolvedMessages.diagnostics).filter((m) => m.quickFix && L(
292
+ m.startOffset,
293
+ m.endOffset,
294
+ k,
295
+ E
296
+ )).map((m) => {
297
+ const A = m.quickFix.edit, I = n.getPositionAt(A.startOffset), M = n.getPositionAt(A.endOffset);
298
+ return {
299
+ title: m.quickFix.title,
300
+ kind: "quickfix",
301
+ isPreferred: !0,
302
+ diagnostics: d.markers.filter((W) => W.code === m.code),
303
+ edit: {
304
+ edits: [{
305
+ resource: n.uri,
306
+ textEdit: {
307
+ range: {
308
+ startLineNumber: I.lineNumber,
309
+ startColumn: I.column,
310
+ endLineNumber: M.lineNumber,
311
+ endColumn: M.column
312
+ },
313
+ text: A.text
314
+ },
315
+ versionId: n.getVersionId()
316
+ }]
317
+ }
318
+ };
319
+ }), dispose() {
320
+ } };
321
+ }
322
+ });
323
+ }
324
+ function q() {
325
+ if (!l || !t) return;
326
+ const e = t.getModel();
327
+ e && l.editor.setModelMarkers(e, w, []);
328
+ }
329
+ function V(e) {
330
+ if (!C.value || t) return;
331
+ const n = /* @__PURE__ */ new Set(["value", "language", "model"]), i = Object.fromEntries(
332
+ Object.entries(s.monacoOptions).filter(([d]) => !n.has(d))
333
+ );
334
+ t = e.editor.create(C.value, {
335
+ value: s.content,
336
+ language: "aimd",
337
+ theme: s.theme,
338
+ minimap: { enabled: !1 },
339
+ fontSize: 14,
340
+ lineNumbers: "on",
341
+ wordWrap: "on",
342
+ scrollBeyondLastLine: !1,
343
+ automaticLayout: !0,
344
+ tabSize: 2,
345
+ padding: { top: 12 },
346
+ readOnly: s.readonly,
347
+ ...i
348
+ }), P(e), t.onDidChangeModelContent(() => {
349
+ S(), y || b("content-change", t.getValue());
350
+ }), S(), b("ready", t), b("monaco-loaded", e, t);
351
+ }
352
+ Y(async () => {
353
+ try {
354
+ h.value = !0;
355
+ const e = await import("monaco-editor");
356
+ l = e, F(e), V(e);
357
+ } finally {
358
+ h.value = !1;
359
+ }
360
+ }), J(() => {
361
+ q(), x?.dispose(), t?.dispose();
362
+ }), O(() => s.content, (e) => {
363
+ !t || e === t.getValue() || (y = !0, t.setValue(e), y = !1);
364
+ }), O(() => s.theme, (e) => {
365
+ l && l.editor.setTheme(e);
366
+ }), O(() => s.readonly, (e) => {
367
+ t?.updateOptions({ readOnly: e });
368
+ });
369
+ function B() {
370
+ return t;
371
+ }
372
+ function R() {
373
+ return l;
374
+ }
375
+ function z(e) {
376
+ t && (y = !0, t.setValue(e), y = !1);
377
+ }
378
+ function G() {
379
+ return t?.getSelection();
380
+ }
381
+ function j(e, n) {
382
+ t?.executeEdits(e, n);
383
+ }
384
+ function K() {
385
+ t?.focus();
386
+ }
387
+ function Z() {
388
+ return t?.getModel();
389
+ }
390
+ function H() {
391
+ return t?.getPosition();
392
+ }
393
+ function U() {
394
+ return t?.getValue();
395
+ }
396
+ return p({
397
+ getEditor: B,
398
+ getMonaco: R,
399
+ setValue: z,
400
+ getSelection: G,
401
+ executeEdits: j,
402
+ focus: K,
403
+ getModel: Z,
404
+ getPosition: H,
405
+ getValue: U,
406
+ loading: h
407
+ }), (e, n) => (T(), $("div", {
408
+ class: "aimd-editor-source-mode",
409
+ style: X({ minHeight: a.minHeight + "px" })
410
+ }, [
411
+ h.value ? (T(), $("div", fe, ee(a.resolvedMessages.common.loadingEditor), 1)) : te("", !0),
412
+ ne("div", {
413
+ ref_key: "editorContainer",
414
+ ref: C,
415
+ class: "aimd-editor-container"
416
+ }, null, 512)
417
+ ], 4));
418
+ }
419
+ });
420
+ export {
421
+ pe as _
422
+ };