@airalogy/aimd-recorder 1.23.0 → 1.24.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 +19 -0
- package/README.zh-CN.md +19 -0
- package/dist/{AimdCodeField-BN_0UQMx.js → AimdCodeField-CPjcXY4D.js} +1 -1
- package/dist/{AimdDnaSequenceField-JzxsGmRf.js → AimdDnaSequenceField-Dz-IONoA.js} +5 -4
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-v82TdP_I.js → AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js} +23 -3
- package/dist/{AimdEntityRefField-O0FwJDC0.js → AimdEntityRefField-BE0s2o5T.js} +10 -10
- package/dist/{AimdMarkdownField-Dd6M3zOI.js → AimdMarkdownField-BeD2t9JY.js} +19 -19
- package/dist/{AimdMarkdownNoteField-DCkJg80X.js → AimdMarkdownNoteField-DIgGEYpj.js} +13 -13
- package/dist/{_commonjsHelpers-B5RozER-.js → _commonjsHelpers-ByX85dGu.js} +12 -19
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-Bw7VOW6S.js → arc-CLJJdrm0.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-B4RdL02h.js → architectureDiagram-3BPJPVTR-BizrFPnS.js} +3 -3
- package/dist/{blockDiagram-GPEHLZMM-B5skMgx6.js → blockDiagram-GPEHLZMM-IHDih8JW.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-DDxL4a7C.js → c4Diagram-AAUBKEIU-BQtg8m_M.js} +2 -2
- package/dist/{channel-CQ1fnqoz.js → channel-D8q7AX1Z.js} +1 -1
- package/dist/{chunk-2J33WTMH-B08Yr5NK.js → chunk-2J33WTMH-C24lbKon.js} +1 -1
- package/dist/{chunk-4BX2VUAB-CyCffaPa.js → chunk-4BX2VUAB-1m_lB_xe.js} +1 -1
- package/dist/{chunk-55IACEB6-CztHyBOI.js → chunk-55IACEB6-BE5Nj-sd.js} +1 -1
- package/dist/{chunk-727SXJPM-CEVNkjmn.js → chunk-727SXJPM-Cg-Xw_d_.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-C9t9hFOg.js → chunk-AQP2D5EJ-BvRpPCiY.js} +3 -3
- package/dist/{chunk-FMBD7UC4-ulCTg3qb.js → chunk-FMBD7UC4-D_44MTsg.js} +1 -1
- package/dist/{chunk-ND2GUHAM-D4Cbj52r.js → chunk-ND2GUHAM-tVBIo4LA.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Rpw3UPGi.js → chunk-QZHKN3VN-B91HYLks.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-D8dNLFoj.js → classDiagram-4FO5ZUOK-CkejvTAN.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-D8dNLFoj.js → classDiagram-v2-Q7XG4LA2-CkejvTAN.js} +2 -2
- package/dist/components.js +3662 -3465
- package/dist/composables.js +104 -103
- package/dist/{cose-bilkent-S5V4N54A-CzjADqxr.js → cose-bilkent-S5V4N54A-CNcuriOF.js} +2 -2
- package/dist/{dagre-BM42HDAG-C79MwQe7.js → dagre-BM42HDAG-DMqFGafq.js} +3 -3
- package/dist/{diagram-2AECGRRQ-DaQ7DMBK.js → diagram-2AECGRRQ-Cksd3pP3.js} +2 -2
- package/dist/{diagram-5GNKFQAL-BpWKnfL3.js → diagram-5GNKFQAL-SVjLnDJG.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CedxET4p.js → diagram-KO2AKTUF-DfNIAG6w.js} +2 -2
- package/dist/{diagram-LMA3HP47-FKe9tb0g.js → diagram-LMA3HP47-DPOyCMGB.js} +2 -2
- package/dist/{diagram-OG6HWLK6-Bmb8IKvp.js → diagram-OG6HWLK6-BDURmT37.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-Chalz_c9.js → erDiagram-TEJ5UH35-N991qII9.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DPelWotf.js → flowDiagram-I6XJVG4X-BABRFuk-.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-o_Jm8a5l.js → ganttDiagram-6RSMTGT7-BMDnK96S.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-BiwDVfiM.js → gitGraphDiagram-PVQCEYII-cEvL7Dss.js} +3 -3
- package/dist/{graph-_GsibXVP.js → graph-BA09aCvZ.js} +1 -1
- package/dist/index.js +118 -112
- package/dist/{infoDiagram-5YYISTIA-CaVHW6oJ.js → infoDiagram-5YYISTIA-DpC1Zthd.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH--qCCMUuo.js → ishikawaDiagram-YF4QCWOH-CMEt_f-x.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-BsT-p1ex.js → journeyDiagram-JHISSGLW-C0Qw169C.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-oCTOaobR.js → kanban-definition-UN3LZRKU-caROmSUy.js} +2 -2
- package/dist/{layout-CAhsv4x8.js → layout-CH65__O4.js} +2 -2
- package/dist/{linear-CumggsyF.js → linear-B1VXpcsy.js} +1 -1
- package/dist/{mermaid.core-D4wVfZ2X.js → mermaid.core-Cbmwvfvk.js} +35 -35
- package/dist/{mindmap-definition-RKZ34NQL-NTgweVec.js → mindmap-definition-RKZ34NQL-DpTR5ilS.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-C1UJkrIn.js → pieDiagram-4H26LBE5-Cb_KrmWC.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-rCJc8QbP.js → quadrantDiagram-W4KKPZXB-B5_NswmK.js} +2 -2
- package/dist/record.js +77 -72
- package/dist/{requirementDiagram-4Y6WPE33-BzHGaPaB.js → requirementDiagram-4Y6WPE33-OFwfat5D.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-B--uus9e.js → sankeyDiagram-5OEKKPKP-BaawdZEE.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-D7javnYQ.js → sequenceDiagram-3UESZ5HK-DLv8X8ef.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-DPsstQ8f.js → stateDiagram-AJRCARHV-B6F3wrsd.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-BhhRcq6R.js → stateDiagram-v2-BHNVJYJU-BcNEoshv.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DgnJrK74.js → timeline-definition-PNZ67QCA-CvdHJ4eQ.js} +2 -2
- package/dist/useCodeBlockRendering-D2viVPtA.js +3158 -0
- package/dist/useFieldRendering-Co4DOOvL.js +1120 -0
- package/dist/{index-CGb0O6x4.js → useVarHelpers-Du2obGza.js} +1663 -849
- package/dist/validation-oyqyD7Jp.js +5601 -0
- package/dist/{vennDiagram-CIIHVFJN-D1Q51ENl.js → vennDiagram-CIIHVFJN-U0GlQDjX.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-DMfLoeaa.js → wardleyDiagram-YWT4CUSO-CzF_KMcn.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DzF8t-UA.js → xychartDiagram-2RQKCTM6-Cljki2Vk.js} +2 -2
- package/package.json +5 -3
- package/src/__tests__/record-validation.test.ts +378 -0
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +26 -0
- package/src/components/AimdRecorder.vue +176 -5
- package/src/components/AimdRecorderEditor.vue +28 -1
- package/src/components/AimdRecorderWysiwygFieldHost.vue +4 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +135 -4
- package/src/components/AimdVarTableField.vue +38 -21
- package/src/components/recorderMilkdownPlugin.ts +7 -0
- package/src/index.ts +12 -0
- package/src/locales.ts +30 -0
- package/src/record/index.ts +14 -0
- package/src/record/validation.ts +772 -0
- package/src/styles/recorder.css +32 -0
- package/src/types.ts +41 -0
- package/dist/useCodeBlockRendering-f5pBgZ96.js +0 -5083
package/README.md
CHANGED
|
@@ -142,6 +142,25 @@ Client assigners also use these constraints for dependency readiness, so an assi
|
|
|
142
142
|
Use `locale` to switch built-in recorder labels (`en-US` / `zh-CN`).
|
|
143
143
|
`AimdProtocolRecorder` is still available as a deprecated compatibility alias, but new code should use `AimdRecorder`.
|
|
144
144
|
|
|
145
|
+
## Record Validation
|
|
146
|
+
|
|
147
|
+
Pass the Pydantic JSON Schema returned by protocol parsing to make the Python model the single validation contract:
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<AimdRecorder
|
|
151
|
+
ref="recorderRef"
|
|
152
|
+
v-model="record"
|
|
153
|
+
:content="content"
|
|
154
|
+
:validation-schema="parseResult.data?.json_schema"
|
|
155
|
+
/>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The schema contract supports the engine's `vars` / `steps` / `checks` keys and the legacy `research_variable` / `research_step` / `research_check` aliases. It covers required, type, format, pattern, enum, numeric, array, object, and built-in-type constraints. Schema-required recorder inputs reject empty strings and empty arrays even though the property already exists in the in-memory Record. Structured recorder values such as uploaded files are normalized before schema validation. When no schema is supplied, Recorder falls back to AIMD declarations, treats fields without a default as required, and honors `fieldMeta` overrides.
|
|
159
|
+
|
|
160
|
+
Validation runs for the changed or blurred field by default, so correcting one field preserves unrelated errors. Configure this with `validationTriggers` (`change` and `blur`). `var_table` issues use exact keys such as `var_table:samples:0:concentration`, render beside the affected cell, and focus that cell.
|
|
161
|
+
|
|
162
|
+
`AimdRecorder` and `AimdRecorderEditor` expose `validate()`, `validateField(fieldKey)`, `clearValidation(fieldKey?)`, and `focusFirstInvalidField()` through their component refs. `validate()` is the submit gate and returns `{ valid, issues, fieldState }`; run authoritative server-side Pydantic validation afterward. Hosts can merge server errors through the existing `fieldState` prop.
|
|
163
|
+
|
|
145
164
|
## Assigner Graph
|
|
146
165
|
|
|
147
166
|
Use `AimdAssignerGraph` to render protocol `assigner_graph` data without depending on an app-specific store or UI framework.
|
package/README.zh-CN.md
CHANGED
|
@@ -142,6 +142,25 @@ client assigner 也会用这些约束判断依赖是否就绪,因此依赖的
|
|
|
142
142
|
通过 `locale` 可以切换 recorder 内建标签(`en-US` / `zh-CN`)。
|
|
143
143
|
`AimdProtocolRecorder` 仍保留为已废弃的兼容别名,但新的代码建议直接使用 `AimdRecorder`。
|
|
144
144
|
|
|
145
|
+
## Record 校验
|
|
146
|
+
|
|
147
|
+
把 Protocol 解析返回的 Pydantic JSON Schema 传给 Recorder,即可让 Python 模型成为唯一的校验契约:
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<AimdRecorder
|
|
151
|
+
ref="recorderRef"
|
|
152
|
+
v-model="record"
|
|
153
|
+
:content="content"
|
|
154
|
+
:validation-schema="parseResult.data?.json_schema"
|
|
155
|
+
/>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Schema 契约同时支持 engine 的 `vars` / `steps` / `checks` 键和兼容用的 `research_variable` / `research_step` / `research_check` 别名,覆盖必填、类型、格式、pattern、枚举、数值边界、数组、对象及内建类型约束。对 Schema 标记为 required 的 Recorder 输入,即使内存 Record 中已有该属性,空字符串和空数组仍会判为未填。Recorder 会先归一化上传文件等结构化值,再执行 Schema 校验。没有传 Schema 时,Recorder 回退到 AIMD 声明,把没有默认值的字段视为必填,并接受 `fieldMeta` 覆盖。
|
|
159
|
+
|
|
160
|
+
默认在当前字段 `change` 和 `blur` 时即时校验,修正某个字段不会清除其他错误;可通过 `validationTriggers` 调整。`var_table` 错误使用 `var_table:samples:0:concentration` 这样的精确行列 key,错误展示和聚焦也会落到对应单元格。
|
|
161
|
+
|
|
162
|
+
`AimdRecorder` 和 `AimdRecorderEditor` 都会通过组件 ref 暴露 `validate()`、`validateField(fieldKey)`、`clearValidation(fieldKey?)` 和 `focusFirstInvalidField()`。提交前使用 `validate()` 作为前端拦截,它返回 `{ valid, issues, fieldState }`;通过后仍应执行服务端 Pydantic 校验。服务端错误可通过现有 `fieldState` 属性合并回填。
|
|
163
|
+
|
|
145
164
|
## Assigner 拓扑图
|
|
146
165
|
|
|
147
166
|
使用 `AimdAssignerGraph` 可以直接渲染协议中的 `assigner_graph` 数据,不需要绑定宿主应用自己的 store 或 UI 框架。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as V, ref as c, computed as L, onMounted as D, onBeforeUnmount as z, watch as h, openBlock as m, createElementBlock as f, normalizeStyle as F, normalizeClass as S, createElementVNode as b, Fragment as $, createCommentVNode as x, nextTick as P } from "vue";
|
|
2
2
|
import { c as T } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
3
|
-
import { _ as A } from "./
|
|
3
|
+
import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
function I(o) {
|
|
5
5
|
return new Worker(
|
|
6
6
|
"/assets/editor.worker-CpuX8TSY.js",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent as Om, openBlock as wi, createElementBlock as Ji, Fragment as qg, createElementVNode as wt, toDisplayString as ln, normalizeClass as q0, createCommentVNode as _y, ref as lg, computed as uh, watch as $T, onMounted as NA, onBeforeUnmount as zA, createVNode as eS, unref as dE, renderList as HT, normalizeStyle as DA, createBlock as hE, nextTick as BA } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { a as GA, c as bE, g as IA
|
|
2
|
+
import { aa as HA, aU as kT, s as kA, X as gE, d as UA, g as vE, v as yE, k as mE, j as LA, i as pE } from "./useVarHelpers-Du2obGza.js";
|
|
3
|
+
import { a as GA, c as bE, g as IA } from "./_commonjsHelpers-ByX85dGu.js";
|
|
4
|
+
import { _ as FA } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
5
|
const tC = "dna_annotation";
|
|
5
6
|
function nC(Me, Ze) {
|
|
6
7
|
return `${tC}:${Me}:${Ze}`;
|
|
@@ -59151,7 +59152,7 @@ const nR = /* @__PURE__ */ IA(tR), lR = /* @__PURE__ */ Om({
|
|
|
59151
59152
|
])
|
|
59152
59153
|
], 64));
|
|
59153
59154
|
}
|
|
59154
|
-
}), sx = { class: "aimd-rec-inline aimd-rec-inline--var-dna aimd-field-wrapper aimd-field-wrapper--dna" }, fx = { class: "aimd-field aimd-field--no-style aimd-field__label" }, dx = { class: "aimd-field__scope aimd-field__scope--var" }, hx = { class: "aimd-field__id" }, gx = { class: "aimd-dna-field" }, vx = { class: "aimd-dna-field__metadata-grid" }, yx = { class: "aimd-dna-field__annotation-field aimd-dna-field__annotation-field--metadata" }, mx = ["disabled", "placeholder", "value"],
|
|
59155
|
+
}), sx = { class: "aimd-rec-inline aimd-rec-inline--var-dna aimd-field-wrapper aimd-field-wrapper--dna" }, fx = { class: "aimd-field aimd-field--no-style aimd-field__label" }, dx = { class: "aimd-field__scope aimd-field__scope--var" }, hx = { class: "aimd-field__id" }, gx = { class: "aimd-dna-field" }, vx = { class: "aimd-dna-field__metadata-grid" }, yx = { class: "aimd-dna-field__annotation-field aimd-dna-field__annotation-field--metadata" }, mx = ["disabled", "placeholder", "value"], Ex = /* @__PURE__ */ Om({
|
|
59155
59156
|
__name: "AimdDnaSequenceField",
|
|
59156
59157
|
props: {
|
|
59157
59158
|
modelValue: { default: void 0 },
|
|
@@ -59462,5 +59463,5 @@ const nR = /* @__PURE__ */ IA(tR), lR = /* @__PURE__ */ Om({
|
|
|
59462
59463
|
}
|
|
59463
59464
|
});
|
|
59464
59465
|
export {
|
|
59465
|
-
|
|
59466
|
+
Ex as default
|
|
59466
59467
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getAimdRendererQuizTypeLabel as Ab, parseAndExtract as Eb } from "@airalogy/aimd-renderer";
|
|
2
2
|
import { defineComponent as qn, computed as Xe, ref as ye, watch as Pe, openBlock as Z, createBlock as Wc, Teleport as Jp, createElementBlock as ie, withModifiers as ys, createElementVNode as _, normalizeStyle as jr, createTextVNode as fn, toDisplayString as K, Fragment as We, renderList as zn, normalizeClass as ao, withDirectives as Ae, vModelText as qe, createCommentVNode as De, vModelSelect as jl, vModelRadio as Ib, vModelCheckbox as Nb, onMounted as ul, onBeforeUnmount as Gp, inject as jc, createVNode as Lr, provide as Ob, onUnmounted as Yp, h as Se, shallowRef as pi, createApp as Rb, toRef as Db, nextTick as hi, unref as mn, withCtx as _b, vShow as yf } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import "./useCodeBlockRendering-
|
|
3
|
+
import { bg as Lb } from "./useVarHelpers-Du2obGza.js";
|
|
4
|
+
import "./useCodeBlockRendering-D2viVPtA.js";
|
|
5
5
|
import { restoreAimdInlineTemplates as Uc, protectAimdInlineTemplates as Qp } from "@airalogy/aimd-core";
|
|
6
|
-
import { g as Pb } from "./_commonjsHelpers-
|
|
6
|
+
import { g as Pb } from "./_commonjsHelpers-ByX85dGu.js";
|
|
7
7
|
const zb = "en-US";
|
|
8
8
|
function Bb() {
|
|
9
9
|
if (typeof document < "u") {
|
|
@@ -167,6 +167,16 @@ const Fb = {
|
|
|
167
167
|
noMatches: "No matches",
|
|
168
168
|
matchCount: (t, e) => `${t} / ${e}`
|
|
169
169
|
},
|
|
170
|
+
validation: {
|
|
171
|
+
required: (t) => `${t} is required.`,
|
|
172
|
+
pattern: (t) => `${t} has an invalid format.`,
|
|
173
|
+
enum: (t) => `${t} must use one of the allowed values.`,
|
|
174
|
+
numeric: (t, e) => `${t}: ${e}`,
|
|
175
|
+
type: (t, e) => `${t} must be ${e}.`,
|
|
176
|
+
format: (t, e) => `${t} must use ${e} format.`,
|
|
177
|
+
schema: (t, e) => `${t}: ${e}`,
|
|
178
|
+
tableCell: (t, e) => `Row ${t}, ${e}`
|
|
179
|
+
},
|
|
170
180
|
dna: {
|
|
171
181
|
editMode: "Edit mode",
|
|
172
182
|
interactiveMode: "Interactive",
|
|
@@ -391,6 +401,16 @@ const Fb = {
|
|
|
391
401
|
noMatches: "无匹配",
|
|
392
402
|
matchCount: (t, e) => `${t} / ${e}`
|
|
393
403
|
},
|
|
404
|
+
validation: {
|
|
405
|
+
required: (t) => `${t}为必填项。`,
|
|
406
|
+
pattern: (t) => `${t}格式不正确。`,
|
|
407
|
+
enum: (t) => `${t}必须使用允许的选项。`,
|
|
408
|
+
numeric: (t, e) => `${t}:${e}`,
|
|
409
|
+
type: (t, e) => `${t}必须是${e}类型。`,
|
|
410
|
+
format: (t, e) => `${t}必须使用 ${e} 格式。`,
|
|
411
|
+
schema: (t, e) => `${t}:${e}`,
|
|
412
|
+
tableCell: (t, e) => `第 ${t} 行,${e}`
|
|
413
|
+
},
|
|
394
414
|
dna: {
|
|
395
415
|
editMode: "编辑模式",
|
|
396
416
|
interactiveMode: "交互式",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as P, ref as w, computed as p, watch as Q, openBlock as a, createElementBlock as r, Fragment as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as P, ref as w, computed as p, watch as Q, openBlock as a, createElementBlock as r, Fragment as N, renderList as x, createElementVNode as y, toDisplayString as l, createCommentVNode as f, withDirectives as j, withKeys as U, withModifiers as G, vModelText as H } from "vue";
|
|
2
|
+
import { a4 as J } from "./useVarHelpers-Du2obGza.js";
|
|
3
3
|
const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "aimd-rec-entity-ref__selected"
|
|
@@ -140,7 +140,7 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
140
140
|
o.value = "", m.value = [];
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function V() {
|
|
144
144
|
const e = o.value.trim();
|
|
145
145
|
e && B(e);
|
|
146
146
|
}
|
|
@@ -151,7 +151,7 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
151
151
|
function L() {
|
|
152
152
|
$([]);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function q(e) {
|
|
155
155
|
return `${e.source ?? ""}:${e.entity}:${e.id}`;
|
|
156
156
|
}
|
|
157
157
|
function K(e) {
|
|
@@ -159,7 +159,7 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
159
159
|
}
|
|
160
160
|
return (e, n) => (a(), r("span", O, [
|
|
161
161
|
v.value.length ? (a(), r("span", W, [
|
|
162
|
-
(a(!0), r(
|
|
162
|
+
(a(!0), r(N, null, x(v.value, (t, d) => (a(), r("span", {
|
|
163
163
|
key: `${t.source ?? ""}:${t.entity}:${t.id}:${d}`,
|
|
164
164
|
class: "aimd-rec-entity-ref__chip"
|
|
165
165
|
}, [
|
|
@@ -189,7 +189,7 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
189
189
|
class: "aimd-rec-inline__value-control aimd-rec-inline__input aimd-rec-inline__input--stacked aimd-rec-entity-ref__input",
|
|
190
190
|
disabled: s.disabled,
|
|
191
191
|
placeholder: z.value ? s.messages.entityRef.searchPlaceholder(S.value) : s.messages.entityRef.manualIdPlaceholder,
|
|
192
|
-
onKeydown: U(G(
|
|
192
|
+
onKeydown: U(G(V, ["prevent"]), ["enter"]),
|
|
193
193
|
onBlur: n[1] || (n[1] = (t) => M("blur"))
|
|
194
194
|
}, null, 40, ne), [
|
|
195
195
|
[H, o.value]
|
|
@@ -198,7 +198,7 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
198
198
|
key: 0,
|
|
199
199
|
type: "button",
|
|
200
200
|
class: "aimd-rec-entity-ref__action",
|
|
201
|
-
onClick:
|
|
201
|
+
onClick: V
|
|
202
202
|
}, l(s.entityConfig.multiple ? s.messages.entityRef.add : s.messages.entityRef.select), 1)) : f("", !0),
|
|
203
203
|
!s.entityConfig.multiple && v.value.length && !s.disabled ? (a(), r("button", {
|
|
204
204
|
key: 1,
|
|
@@ -209,11 +209,11 @@ const O = { class: "aimd-rec-entity-ref" }, W = {
|
|
|
209
209
|
]),
|
|
210
210
|
z.value ? k.value ? (a(), r("span", se, l(k.value), 1)) : o.value.trim() && !C.value && m.value.length === 0 ? (a(), r("span", ae, l(s.messages.entityRef.noMatches), 1)) : f("", !0) : (a(), r("span", ie, l(s.messages.entityRef.noResolver), 1)),
|
|
211
211
|
m.value.length ? (a(), r("span", re, [
|
|
212
|
-
(a(!0), r(
|
|
213
|
-
key:
|
|
212
|
+
(a(!0), r(N, null, x(m.value, (t) => (a(), r("button", {
|
|
213
|
+
key: q(t),
|
|
214
214
|
type: "button",
|
|
215
215
|
class: "aimd-rec-entity-ref__option",
|
|
216
|
-
disabled: s.disabled || t.disabled || A.value.has(
|
|
216
|
+
disabled: s.disabled || t.disabled || A.value.has(q(t)),
|
|
217
217
|
onClick: (d) => B(t)
|
|
218
218
|
}, [
|
|
219
219
|
y("span", oe, l(K(t)), 1),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as p, ref as m, watch as V, h as x, computed as l, shallowRef as te, onBeforeUnmount as oe, openBlock as r, createElementBlock as n, normalizeStyle as ie, normalizeClass as C, createElementVNode as s, toDisplayString as c, unref as v, createVNode as E, createCommentVNode as g, createBlock as re } from "vue";
|
|
2
|
-
import { g as ne, _ as de } from "./AimdEditor.vue_vue_type_style_index_0_lang-
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
2
|
+
import { g as ne, _ as de } from "./AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js";
|
|
3
|
+
import "./useVarHelpers-Du2obGza.js";
|
|
4
|
+
import { u as le, c as se } from "./useCodeBlockRendering-D2viVPtA.js";
|
|
5
5
|
import "@airalogy/aimd-core";
|
|
6
6
|
import { renderToVue as ce, createMermaidRenderer as ue } from "@airalogy/aimd-renderer";
|
|
7
7
|
import { c as me } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
8
|
-
import { _ as ve } from "./
|
|
8
|
+
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we = { class: "aimd-field__scope aimd-field__scope--var" }, he = { class: "aimd-field__id" }, ke = { class: "aimd-markdown-field__header-actions" }, _e = ["aria-label"], pe = ["aria-pressed"], ge = ["aria-pressed"], be = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "aimd-markdown-field__assigner-actions"
|
|
@@ -60,14 +60,14 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
60
60
|
setup(e) {
|
|
61
61
|
const t = m(""), i = m(!1);
|
|
62
62
|
let M = 0;
|
|
63
|
-
async function
|
|
63
|
+
async function Y() {
|
|
64
64
|
const A = e.code.trim(), q = ++M;
|
|
65
65
|
if (!A) {
|
|
66
66
|
t.value = "", i.value = !1;
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
|
-
const T = (await import("./mermaid.core-
|
|
70
|
+
const T = (await import("./mermaid.core-Cbmwvfvk.js").then((ae) => ae.bm)).default;
|
|
71
71
|
T.initialize({
|
|
72
72
|
startOnLoad: !1,
|
|
73
73
|
securityLevel: "strict"
|
|
@@ -83,7 +83,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
return V(() => e.code, () => {
|
|
86
|
-
|
|
86
|
+
Y();
|
|
87
87
|
}, { immediate: !0 }), () => i.value ? x("pre", { class: "aimd-markdown-field__mermaid-fallback" }, e.code) : x("div", {
|
|
88
88
|
class: "aimd-markdown-field__mermaid",
|
|
89
89
|
innerHTML: t.value
|
|
@@ -118,7 +118,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
118
118
|
setup(e) {
|
|
119
119
|
return () => e.nodes;
|
|
120
120
|
}
|
|
121
|
-
}), I = l(() => !!o.value.trim()), f = l(() => h.value === "preview"), D = l(() => w(d.locale) ? "预览" : "Preview"), U = l(() => w(d.locale) ? "源码" : "Source"), j = l(() => w(d.locale) ? "暂无内容" : "No content"), W = l(() => w(d.locale) ? "Markdown 显示模式" : "Markdown view mode"),
|
|
121
|
+
}), I = l(() => !!o.value.trim()), f = l(() => h.value === "preview"), D = l(() => w(d.locale) ? "预览" : "Preview"), U = l(() => w(d.locale) ? "源码" : "Source"), j = l(() => w(d.locale) ? "暂无内容" : "No content"), W = l(() => w(d.locale) ? "Markdown 显示模式" : "Markdown view mode"), Z = l(() => ({
|
|
122
122
|
minimap: { enabled: !1 },
|
|
123
123
|
lineHeight: u.lineHeight,
|
|
124
124
|
padding: { top: 12, bottom: 12 },
|
|
@@ -150,19 +150,19 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
150
150
|
k.value = [], _.value = !0;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function G() {
|
|
154
154
|
h.value = "preview", R();
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function J() {
|
|
157
157
|
h.value = "source";
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function K(e) {
|
|
160
160
|
u.syncEstimatedEditorHeight(e), e !== o.value && (o.value = e, S("update:modelValue", e));
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Q(e) {
|
|
163
163
|
e.monaco && u.attachEditor(e.monaco);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function X(e) {
|
|
166
166
|
const t = b.value, i = e.relatedTarget;
|
|
167
167
|
!t || i && t.contains(i) || S("blur");
|
|
168
168
|
}
|
|
@@ -188,7 +188,7 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
188
188
|
"aimd-markdown-field--has-assigner-control": a.assignerControl || a.assignerStatus
|
|
189
189
|
}]),
|
|
190
190
|
style: ie(O.value),
|
|
191
|
-
onFocusout:
|
|
191
|
+
onFocusout: X
|
|
192
192
|
}, [
|
|
193
193
|
s("span", fe, [
|
|
194
194
|
s("span", we, c(v(ne)("var", a.messages)), 1),
|
|
@@ -202,13 +202,13 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
202
202
|
type: "button",
|
|
203
203
|
class: C(["aimd-markdown-field__view-btn", { "aimd-markdown-field__view-btn--active": f.value }]),
|
|
204
204
|
"aria-pressed": f.value,
|
|
205
|
-
onClick:
|
|
205
|
+
onClick: G
|
|
206
206
|
}, c(D.value), 11, pe),
|
|
207
207
|
s("button", {
|
|
208
208
|
type: "button",
|
|
209
209
|
class: C(["aimd-markdown-field__view-btn", { "aimd-markdown-field__view-btn--active": !f.value }]),
|
|
210
210
|
"aria-pressed": !f.value,
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: J
|
|
212
212
|
}, c(U.value), 11, ge)
|
|
213
213
|
], 8, _e),
|
|
214
214
|
a.assignerControl || a.assignerStatus ? (r(), n("span", be, [
|
|
@@ -242,9 +242,9 @@ const fe = { class: "aimd-field aimd-field--no-style aimd-field__label" }, we =
|
|
|
242
242
|
"keep-inactive-editors-mounted": !1,
|
|
243
243
|
"min-height": v(B),
|
|
244
244
|
readonly: a.disabled,
|
|
245
|
-
"monaco-options":
|
|
246
|
-
"onUpdate:modelValue":
|
|
247
|
-
onReady:
|
|
245
|
+
"monaco-options": Z.value,
|
|
246
|
+
"onUpdate:modelValue": K,
|
|
247
|
+
onReady: Q
|
|
248
248
|
}, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "min-height", "readonly", "monaco-options"]))
|
|
249
249
|
])
|
|
250
250
|
], 38));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as K, ref as h, computed as a, shallowRef as re, watch as R, onBeforeUnmount as se, openBlock as r, createElementBlock as m, normalizeStyle as ue, normalizeClass as U, createElementVNode as l, toDisplayString as s, createCommentVNode as ce, createBlock as me, unref as M, createVNode as fe, nextTick as ve } from "vue";
|
|
2
|
-
import { _ as we } from "./AimdEditor.vue_vue_type_style_index_0_lang-
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
2
|
+
import { _ as we } from "./AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js";
|
|
3
|
+
import "./useVarHelpers-Du2obGza.js";
|
|
4
|
+
import { u as he } from "./useCodeBlockRendering-D2viVPtA.js";
|
|
5
5
|
import "@airalogy/aimd-core";
|
|
6
6
|
import { renderToVue as be } from "@airalogy/aimd-renderer";
|
|
7
7
|
import { c as _e } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
8
|
-
import { _ as pe } from "./
|
|
8
|
+
import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const ke = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "aimd-markdown-note-field__preview-shell"
|
|
@@ -55,14 +55,14 @@ const ke = {
|
|
|
55
55
|
"--aimd-markdown-note-editor-height": `${B.value}px`
|
|
56
56
|
})), d = h(!1), _ = re([]), p = h(!1);
|
|
57
57
|
let C = 0, v = null, w = null, k = !1, F = !1;
|
|
58
|
-
const { preRenderer:
|
|
58
|
+
const { preRenderer: Z } = he(() => {
|
|
59
59
|
H();
|
|
60
|
-
}), c = a(() => !!n.value.trim()), S = a(() => c.value && !d.value), y = a(() => !t.disabled && (!c.value || d.value)),
|
|
60
|
+
}), c = a(() => !!n.value.trim()), S = a(() => c.value && !d.value), y = a(() => !t.disabled && (!c.value || d.value)), j = a(() => !S.value && !y.value), J = a(() => f(t.locale) ? "关闭备注" : "Close note"), Q = a(() => f(t.locale) ? "暂无备注" : "No notes"), L = a(() => f(t.locale) ? "预览" : "Preview"), A = a(() => f(t.locale) ? "源码" : "Source"), I = a(() => f(t.locale) ? "备注显示模式" : "Note view mode"), X = a(() => ({
|
|
61
61
|
minimap: { enabled: !1 },
|
|
62
62
|
lineHeight: u.lineHeight,
|
|
63
63
|
padding: { top: 12, bottom: 12 },
|
|
64
64
|
scrollbar: { vertical: "auto", horizontal: "auto" }
|
|
65
|
-
})),
|
|
65
|
+
})), Y = K({
|
|
66
66
|
name: "AimdMarkdownNotePreviewOutlet",
|
|
67
67
|
props: {
|
|
68
68
|
nodes: {
|
|
@@ -94,7 +94,7 @@ const ke = {
|
|
|
94
94
|
const E = await be(e, {
|
|
95
95
|
locale: t.locale,
|
|
96
96
|
elementRenderers: {
|
|
97
|
-
pre:
|
|
97
|
+
pre: Z
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
if (o !== C)
|
|
@@ -175,7 +175,7 @@ const ke = {
|
|
|
175
175
|
"aimd-markdown-note-field--disabled": i.disabled,
|
|
176
176
|
"aimd-markdown-note-field--preview": S.value,
|
|
177
177
|
"aimd-markdown-note-field--editor": y.value,
|
|
178
|
-
"aimd-markdown-note-field--empty":
|
|
178
|
+
"aimd-markdown-note-field--empty": j.value
|
|
179
179
|
}]),
|
|
180
180
|
style: ue(W.value),
|
|
181
181
|
onFocusin: le,
|
|
@@ -204,7 +204,7 @@ const ke = {
|
|
|
204
204
|
onClick: ae,
|
|
205
205
|
onKeydown: ie
|
|
206
206
|
}, [
|
|
207
|
-
p.value ? (r(), m("pre", Ve, s(n.value), 1)) : (r(), me(M(
|
|
207
|
+
p.value ? (r(), m("pre", Ve, s(n.value), 1)) : (r(), me(M(Y), {
|
|
208
208
|
key: 1,
|
|
209
209
|
nodes: _.value
|
|
210
210
|
}, null, 8, ["nodes"]))
|
|
@@ -229,7 +229,7 @@ const ke = {
|
|
|
229
229
|
type: "button",
|
|
230
230
|
class: "aimd-markdown-note-field__editor-close",
|
|
231
231
|
onClick: oe
|
|
232
|
-
}, s(
|
|
232
|
+
}, s(J.value), 1)
|
|
233
233
|
]),
|
|
234
234
|
fe(M(we), {
|
|
235
235
|
ref_key: "editorRef",
|
|
@@ -247,11 +247,11 @@ const ke = {
|
|
|
247
247
|
"keep-inactive-editors-mounted": !1,
|
|
248
248
|
"min-height": M(B),
|
|
249
249
|
readonly: i.disabled,
|
|
250
|
-
"monaco-options":
|
|
250
|
+
"monaco-options": X.value,
|
|
251
251
|
"onUpdate:modelValue": ee,
|
|
252
252
|
onReady: ne
|
|
253
253
|
}, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "min-height", "readonly", "monaco-options"])
|
|
254
|
-
])) : (r(), m("div", xe, s(
|
|
254
|
+
])) : (r(), m("div", xe, s(Q.value), 1))
|
|
255
255
|
], 38));
|
|
256
256
|
}
|
|
257
257
|
}), qe = /* @__PURE__ */ pe(Me, [["__scopeId", "data-v-21765085"]]);
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (const [o, r] of n)
|
|
4
|
-
t[o] = r;
|
|
5
|
-
return t;
|
|
6
|
-
};
|
|
7
|
-
var s = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
8
|
-
function c(e) {
|
|
1
|
+
var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function a(e) {
|
|
9
3
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
10
4
|
}
|
|
11
5
|
function f(e) {
|
|
12
6
|
if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
|
|
13
7
|
var n = e.default;
|
|
14
8
|
if (typeof n == "function") {
|
|
15
|
-
var t = function
|
|
16
|
-
var
|
|
9
|
+
var t = function r() {
|
|
10
|
+
var o = !1;
|
|
17
11
|
try {
|
|
18
|
-
|
|
12
|
+
o = this instanceof r;
|
|
19
13
|
} catch {
|
|
20
14
|
}
|
|
21
|
-
return
|
|
15
|
+
return o ? Reflect.construct(n, arguments, this.constructor) : n.apply(this, arguments);
|
|
22
16
|
};
|
|
23
17
|
t.prototype = n.prototype;
|
|
24
18
|
} else t = {};
|
|
25
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(
|
|
26
|
-
var
|
|
27
|
-
Object.defineProperty(t,
|
|
19
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
|
|
20
|
+
var o = Object.getOwnPropertyDescriptor(e, r);
|
|
21
|
+
Object.defineProperty(t, r, o.get ? o : {
|
|
28
22
|
enumerable: !0,
|
|
29
23
|
get: function() {
|
|
30
|
-
return e[
|
|
24
|
+
return e[r];
|
|
31
25
|
}
|
|
32
26
|
});
|
|
33
27
|
}), t;
|
|
34
28
|
}
|
|
35
29
|
export {
|
|
36
|
-
a as _,
|
|
37
30
|
f as a,
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
u as c,
|
|
32
|
+
a as g
|
|
40
33
|
};
|