@airalogy/aimd-recorder 1.24.4 → 1.25.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 +13 -1
- package/README.zh-CN.md +13 -1
- package/dist/{AimdDnaSequenceField-Opgy07Gt.js → AimdDnaSequenceField-BHV1_c2o.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-DHckC0bq.js → AimdEditor.vue_vue_type_style_index_0_lang-phvUVTHV.js} +643 -605
- package/dist/AimdEntityRefField-COzwbHwr.js +4 -0
- package/dist/{AimdEntityRefField-GA6-mhGU.js → AimdEntityRefField.vue_vue_type_script_setup_true_lang-BIvUuZFV.js} +2 -2
- package/dist/{AimdMarkdownField-jagZIbKc.js → AimdMarkdownField-t8hqazDv.js} +3 -3
- package/dist/{AimdMarkdownNoteField-BUq4fRcZ.js → AimdMarkdownNoteField-BGjkSXEY.js} +2 -2
- package/dist/AimdResourceRefField-BBaRSLcL.js +264 -0
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-CR1cpc2k.js → arc-CsBMJYPv.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-B8OoiHF6.js → architectureDiagram-3BPJPVTR-BeKUSqHO.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-Ddq40SrW.js → blockDiagram-GPEHLZMM-CJeAC_1p.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-Cf3cjJMq.js → c4Diagram-AAUBKEIU-LoQMp4kW.js} +2 -2
- package/dist/{channel-C8Vd7nOK.js → channel-BoLQO6Dk.js} +1 -1
- package/dist/{chunk-2J33WTMH-Ck31ftjD.js → chunk-2J33WTMH-D1vw38h5.js} +1 -1
- package/dist/{chunk-4BX2VUAB-BJOkbq4i.js → chunk-4BX2VUAB-BFSVnsyi.js} +1 -1
- package/dist/{chunk-55IACEB6-lNZxrJyO.js → chunk-55IACEB6-D13UaCP1.js} +1 -1
- package/dist/{chunk-727SXJPM-mEDRtdd4.js → chunk-727SXJPM-BCcz4POX.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-C1MU-m_K.js → chunk-AQP2D5EJ-DTOfpg2m.js} +3 -3
- package/dist/{chunk-FMBD7UC4-Pmfg_1nq.js → chunk-FMBD7UC4-XGRN-sFg.js} +1 -1
- package/dist/{chunk-ND2GUHAM-CipPchY0.js → chunk-ND2GUHAM-DSgp1I9F.js} +1 -1
- package/dist/{chunk-QZHKN3VN-BvE9EC7r.js → chunk-QZHKN3VN-DQl3-kKo.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-BM5OaktU.js → classDiagram-4FO5ZUOK-CI-4bhme.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-BM5OaktU.js → classDiagram-v2-Q7XG4LA2-CI-4bhme.js} +2 -2
- package/dist/components.js +2222 -2110
- package/dist/composables.js +2 -2
- package/dist/{cose-bilkent-S5V4N54A-nmO7LFhz.js → cose-bilkent-S5V4N54A-CU1K-fx3.js} +1 -1
- package/dist/{dagre-BM42HDAG-D3xhjRxX.js → dagre-BM42HDAG-HIHsvvPF.js} +3 -3
- package/dist/{diagram-2AECGRRQ-kCJcuZOT.js → diagram-2AECGRRQ-XlYRVMia.js} +2 -2
- package/dist/{diagram-5GNKFQAL-Bdr1oGkv.js → diagram-5GNKFQAL-BeA9dVE2.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CeBpcrbw.js → diagram-KO2AKTUF-D501LuyG.js} +2 -2
- package/dist/{diagram-LMA3HP47-C5oYYzCp.js → diagram-LMA3HP47-ClkmdOf_.js} +2 -2
- package/dist/{diagram-OG6HWLK6-CNzZuxZL.js → diagram-OG6HWLK6-30O5epks.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-MWNh4yWB.js → erDiagram-TEJ5UH35-Dk5azNFu.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DcREbXha.js → flowDiagram-I6XJVG4X-C4K9bB2d.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-DGZUsfa4.js → ganttDiagram-6RSMTGT7-sFuSkRH3.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-DhpcTOAS.js → gitGraphDiagram-PVQCEYII-CC4Kf_0S.js} +3 -3
- package/dist/{graph-CXU7Rv38.js → graph-BBr12s4M.js} +1 -1
- package/dist/index.js +124 -122
- package/dist/{infoDiagram-5YYISTIA-CVZBlZ8R.js → infoDiagram-5YYISTIA-PObcwLKW.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-Bjyc47Lv.js → ishikawaDiagram-YF4QCWOH-B93dpm60.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-e2G_PVGF.js → journeyDiagram-JHISSGLW-Z0_jIQ5z.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-CKOBjcK9.js → kanban-definition-UN3LZRKU-BicW7pfZ.js} +2 -2
- package/dist/{layout-CBS27QDo.js → layout-jm5q2dTB.js} +2 -2
- package/dist/{linear-UyXZcrYY.js → linear-Bv4EbUf4.js} +1 -1
- package/dist/{mermaid.core-BeKK51C9.js → mermaid.core-BN0BM26i.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-T6_bnhal.js → mindmap-definition-RKZ34NQL-Ba85mo62.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-GGANuPvf.js → pieDiagram-4H26LBE5-CfU3ahlI.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BAtVKEgW.js → quadrantDiagram-W4KKPZXB-BPTjR1PA.js} +2 -2
- package/dist/record.js +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-C2oozBsJ.js → requirementDiagram-4Y6WPE33-DVfyUAUL.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-Bfc4Y-JM.js → sankeyDiagram-5OEKKPKP-B_9c0VJt.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-e9yMBU3K.js → sequenceDiagram-3UESZ5HK-BFSDCMig.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-D1vciiPs.js → stateDiagram-AJRCARHV-DNCya3UT.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-DMXm3rUm.js → stateDiagram-v2-BHNVJYJU-BlmsFnk2.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-Cg7TL_0Q.js → timeline-definition-PNZ67QCA-B297WQKg.js} +2 -2
- package/dist/{useFieldRendering-JFnqNEWH.js → useFieldRendering-DQN_MbSg.js} +1 -1
- package/dist/{useVarHelpers-CQQ-zhL0.js → useVarHelpers-D00Za8e6.js} +978 -932
- package/dist/validation-Dn_j1py1.js +5712 -0
- package/dist/{vennDiagram-CIIHVFJN-BEJdgPK5.js → vennDiagram-CIIHVFJN-gDmDgx6K.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-DLxpx6Lm.js → wardleyDiagram-YWT4CUSO-ek5B-FUl.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-CG-K6knD.js → xychartDiagram-2RQKCTM6-DRtlxacH.js} +2 -2
- package/package.json +4 -4
- package/src/__tests__/record-validation.test.ts +121 -0
- package/src/__tests__/required-marker.test.ts +14 -0
- package/src/__tests__/resource-form.test.ts +20 -0
- package/src/__tests__/resource-ref-field.test.ts +125 -0
- package/src/__tests__/var-field-render.test.ts +87 -1
- package/src/components/AimdRecorder.vue +11 -1
- package/src/components/AimdRecorderEditor.vue +5 -0
- package/src/components/AimdRecorderWysiwygFieldHost.vue +1 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +5 -0
- package/src/components/AimdResourceForm.vue +129 -0
- package/src/components/AimdResourceRefField.vue +393 -0
- package/src/components/AimdVarField.vue +41 -3
- package/src/components/index.ts +4 -0
- package/src/components/recorderMilkdownPlugin.ts +2 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +96 -0
- package/src/composables/useVarHelpers.ts +91 -4
- package/src/index.ts +12 -1
- package/src/locales.ts +57 -0
- package/src/record/validation.ts +145 -11
- package/src/styles/recorder.css +8 -0
- package/src/types.ts +30 -1
- package/dist/validation-DSn_Ttx_.js +0 -5629
package/README.md
CHANGED
|
@@ -97,6 +97,18 @@ const entityResolvers = {
|
|
|
97
97
|
|
|
98
98
|
The selected value is stored as an object like `{ entity, source, id, label? }`; `list[EntityRef]` stores an array of those objects. `id` is the stable key, while `label` is an optional display cache and the recorder falls back to `id` when it is absent. The recorder does not fetch AIMD `connectors` descriptors by itself, so hosts remain in control of network access and authentication even when they use the `aimd-core` connector helper.
|
|
99
99
|
|
|
100
|
+
`ResourceRef[T]` uses a separate `resourceResolvers` host contract. In addition to search/resolve, a resolver can expose `getAvailability()` for lots, containers, balances, and equipment slots, plus `prepareOutput()` for a client-generated output resource payload. The component never changes inventory itself:
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<AimdRecorder
|
|
104
|
+
v-model="record"
|
|
105
|
+
:content="'Input: {{var|source: ResourceRef[\"plasmid\"], resource_role=\"input\", container_required=True}}'"
|
|
106
|
+
:resource-resolvers="resourceResolvers"
|
|
107
|
+
/>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Selected values may contain `lot_id`, `container_id`, `quantity`, `unit`, `reservation_id`, and `booking_id`. Required container/booking metadata participates in normal change, blur, and submit validation. The host must validate the reference again and atomically save the Record plus inventory events.
|
|
111
|
+
|
|
100
112
|
Collector providers follow the same host-binding boundary. The Protocol declares a `kind: data_source` connector, a `collectors` block, and an `Observation[T]` field; the host injects a provider by connector id:
|
|
101
113
|
|
|
102
114
|
```ts
|
|
@@ -155,7 +167,7 @@ Pass the Pydantic JSON Schema returned by protocol parsing to make the Python mo
|
|
|
155
167
|
/>
|
|
156
168
|
```
|
|
157
169
|
|
|
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
|
|
170
|
+
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 non-nullable recorder inputs reject empty strings and empty arrays even though the property already exists in the in-memory Record; nullable properties accept `null` and do not show a required marker. 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 unless their type includes `None` or uses `Optional[...]`, and honors explicit `required` overrides from AIMD or `fieldMeta`.
|
|
159
171
|
|
|
160
172
|
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
173
|
|
package/README.zh-CN.md
CHANGED
|
@@ -97,6 +97,18 @@ const entityResolvers = {
|
|
|
97
97
|
|
|
98
98
|
选择结果会保存为 `{ entity, source, id, label? }` 这样的对象;`list[EntityRef]` 会保存为这些对象组成的数组。`id` 是稳定关联键,`label` 是可选显示缓存,缺失时 recorder 会回退显示 `id`。recorder 不会自己去拉取 AIMD `connectors` descriptor,因此即使使用 `aimd-core` connector helper,网络访问和认证仍由宿主应用控制。
|
|
99
99
|
|
|
100
|
+
`ResourceRef[T]` 使用独立的宿主 `resourceResolvers` 契约。除了 search/resolve,resolver 还可用 `getAvailability()` 提供批次、容器、余额与设备时段,并用 `prepareOutput()` 准备带客户端稳定 ID 的产出资源载荷。控件本身不会修改库存:
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<AimdRecorder
|
|
104
|
+
v-model="record"
|
|
105
|
+
:content="'输入:{{var|source: ResourceRef[\"plasmid\"], resource_role=\"input\", container_required=True}}'"
|
|
106
|
+
:resource-resolvers="resourceResolvers"
|
|
107
|
+
/>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
选择值可以包含 `lot_id`、`container_id`、`quantity`、`unit`、`reservation_id` 和 `booking_id`。必选容器/预约 metadata 会参与正常的 change、blur 与 submit 校验。宿主仍需重新校验资源引用,并原子化保存 Record 与库存事件。
|
|
111
|
+
|
|
100
112
|
Collector provider 使用同样的宿主绑定边界。Protocol 声明 `kind: data_source` connector、`collectors` 代码块和 `Observation[T]` 字段,宿主按 connector id 注入 provider:
|
|
101
113
|
|
|
102
114
|
```ts
|
|
@@ -155,7 +167,7 @@ client assigner 也会用这些约束判断依赖是否就绪,因此依赖的
|
|
|
155
167
|
/>
|
|
156
168
|
```
|
|
157
169
|
|
|
158
|
-
Schema 契约同时支持 engine 的 `vars` / `steps` / `checks` 键和兼容用的 `research_variable` / `research_step` / `research_check` 别名,覆盖必填、类型、格式、pattern、枚举、数值边界、数组、对象及内建类型约束。对 Schema 标记为 required
|
|
170
|
+
Schema 契约同时支持 engine 的 `vars` / `steps` / `checks` 键和兼容用的 `research_variable` / `research_step` / `research_check` 别名,覆盖必填、类型、格式、pattern、枚举、数值边界、数组、对象及内建类型约束。对 Schema 标记为 required 且不可为空的 Recorder 输入,即使内存 Record 中已有该属性,空字符串和空数组仍会判为未填;可为空的属性接受 `null`,也不显示必填标记。Recorder 会先归一化上传文件等结构化值,再执行 Schema 校验。没有传 Schema 时,Recorder 回退到 AIMD 声明:没有默认值的字段视为必填,但类型包含 `None` 或使用 `Optional[...]` 的字段除外;AIMD 或 `fieldMeta` 中显式的 `required` 设置仍会生效。
|
|
159
171
|
|
|
160
172
|
默认在当前字段 `change` 和 `blur` 时即时校验,修正某个字段不会清除其他错误;可通过 `validationTriggers` 调整。`var_table` 错误使用 `var_table:samples:0:concentration` 这样的精确行列 key,错误展示和聚焦也会落到对应单元格。
|
|
161
173
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Om, openBlock as bi, createElementBlock as Ji, Fragment as qg, createElementVNode as wt, toDisplayString as ln, normalizeClass as q0, createCommentVNode as Iv, ref as lg, computed as uh, watch as eS, onMounted as NA, onBeforeUnmount as zA, createVNode as tS, unref as hE, renderList as kT, normalizeStyle as DA, createBlock as HT, nextTick as BA } from "vue";
|
|
2
|
-
import { aa as kA, aU as UT, s as HA, X as gE, d as UA, g as vE, v as yE, k as mE, j as LA, i as pE } from "./useVarHelpers-
|
|
2
|
+
import { aa as kA, aU as UT, s as HA, X as gE, d as UA, g as vE, v as yE, k as mE, j as LA, i as pE } from "./useVarHelpers-D00Za8e6.js";
|
|
3
3
|
import { a as GA, c as bE, g as IA } from "./_commonjsHelpers-ByX85dGu.js";
|
|
4
4
|
import { a as FA, _ as YA } from "./AimdRequiredMarker.vue_vue_type_script_setup_true_lang-B5qDiOZn.js";
|
|
5
5
|
const tC = "dna_annotation";
|