@airalogy/aimd-recorder 1.20.0 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +4 -0
  2. package/README.zh-CN.md +4 -0
  3. package/dist/{AimdCodeField-BQUuM-EF.js → AimdCodeField-BN_0UQMx.js} +34 -32
  4. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-DTdcoNs1.js → AimdEditor.vue_vue_type_style_index_0_lang-Dj5y1p3U.js} +1015 -975
  5. package/dist/{AimdMarkdownField-D4AEz_mB.js → AimdMarkdownField-Vp72mf5d.js} +3 -3
  6. package/dist/{AimdMarkdownNoteField-CSGaShKi.js → AimdMarkdownNoteField-8AHO9zwW.js} +14 -14
  7. package/dist/aimd-recorder.css +1 -1
  8. package/dist/{arc-jL17V0L2.js → arc-YTgUVhxi.js} +1 -1
  9. package/dist/{architectureDiagram-3BPJPVTR-CijadmFI.js → architectureDiagram-3BPJPVTR-BFddgj3h.js} +2 -2
  10. package/dist/{blockDiagram-GPEHLZMM-BPqvb85_.js → blockDiagram-GPEHLZMM-BNFU64lo.js} +4 -4
  11. package/dist/{c4Diagram-AAUBKEIU-i4fqlMXu.js → c4Diagram-AAUBKEIU-DDg-ymRq.js} +2 -2
  12. package/dist/{channel-DnnUQTdl.js → channel-Cswcnlp1.js} +1 -1
  13. package/dist/{chunk-2J33WTMH-DKKEpdr1.js → chunk-2J33WTMH-CP2V6jff.js} +1 -1
  14. package/dist/{chunk-4BX2VUAB-WvuuiYYH.js → chunk-4BX2VUAB-CbWr2vv6.js} +1 -1
  15. package/dist/{chunk-55IACEB6-B_UkHTnd.js → chunk-55IACEB6-DQOKhaUL.js} +1 -1
  16. package/dist/{chunk-727SXJPM-CR6Pb04P.js → chunk-727SXJPM-4VuCu0m8.js} +5 -5
  17. package/dist/{chunk-AQP2D5EJ-B68Ie417.js → chunk-AQP2D5EJ-D7Pq-oug.js} +3 -3
  18. package/dist/{chunk-FMBD7UC4-CeCGT6rb.js → chunk-FMBD7UC4-slF0wbDn.js} +1 -1
  19. package/dist/{chunk-ND2GUHAM-BYN-eC_q.js → chunk-ND2GUHAM-BrNrmeyL.js} +1 -1
  20. package/dist/{chunk-QZHKN3VN-BNSp120j.js → chunk-QZHKN3VN-CII3oQmH.js} +1 -1
  21. package/dist/{classDiagram-v2-Q7XG4LA2-Cgbn4w3f.js → classDiagram-4FO5ZUOK-skT5SNaU.js} +2 -2
  22. package/dist/{classDiagram-4FO5ZUOK-Cgbn4w3f.js → classDiagram-v2-Q7XG4LA2-skT5SNaU.js} +2 -2
  23. package/dist/components.js +3193 -2847
  24. package/dist/composables.js +84 -80
  25. package/dist/{cose-bilkent-S5V4N54A-TfrsQ2c3.js → cose-bilkent-S5V4N54A-CiwUUHaz.js} +1 -1
  26. package/dist/{dagre-BM42HDAG-BAyvB_JI.js → dagre-BM42HDAG-BzaKejHz.js} +3 -3
  27. package/dist/{diagram-2AECGRRQ-Bijq8bHO.js → diagram-2AECGRRQ-B7jPt7Sf.js} +2 -2
  28. package/dist/{diagram-5GNKFQAL-B3ZuTuxm.js → diagram-5GNKFQAL-z6ygEwZY.js} +3 -3
  29. package/dist/{diagram-KO2AKTUF-DrqLeGCI.js → diagram-KO2AKTUF-BBQMMIgY.js} +2 -2
  30. package/dist/{diagram-LMA3HP47-CCSQH8O0.js → diagram-LMA3HP47-IFDVFs2m.js} +2 -2
  31. package/dist/{diagram-OG6HWLK6-DM5cUEjW.js → diagram-OG6HWLK6-DjEAxof0.js} +3 -3
  32. package/dist/{erDiagram-TEJ5UH35-DQhmDdAF.js → erDiagram-TEJ5UH35-DxMYC2Iw.js} +4 -4
  33. package/dist/{flowDiagram-I6XJVG4X-DrqiPSHI.js → flowDiagram-I6XJVG4X-EIHEHG32.js} +6 -6
  34. package/dist/{ganttDiagram-6RSMTGT7-DpX_Y2vA.js → ganttDiagram-6RSMTGT7-TEOWSxVA.js} +2 -2
  35. package/dist/{gitGraphDiagram-PVQCEYII-3isOhIyZ.js → gitGraphDiagram-PVQCEYII-Cwzy4bEc.js} +3 -3
  36. package/dist/{graph-C30SJlSk.js → graph-Cyx6ry93.js} +1 -1
  37. package/dist/index.js +62 -58
  38. package/dist/{infoDiagram-5YYISTIA-Cr_MlPvz.js → infoDiagram-5YYISTIA-DNv6Z1ol.js} +1 -1
  39. package/dist/{ishikawaDiagram-YF4QCWOH-DydyFn3h.js → ishikawaDiagram-YF4QCWOH-D3eaxgy9.js} +1 -1
  40. package/dist/{journeyDiagram-JHISSGLW-V_5MmeOu.js → journeyDiagram-JHISSGLW-D5g7q2RP.js} +4 -4
  41. package/dist/{kanban-definition-UN3LZRKU-C_XXCuvp.js → kanban-definition-UN3LZRKU-C0hUSCKH.js} +2 -2
  42. package/dist/{layout-85j-z7Lr.js → layout-CpB8OqeJ.js} +2 -2
  43. package/dist/{linear-DMtodz-6.js → linear-D55SCqYq.js} +1 -1
  44. package/dist/{mermaid.core-CkanUCyS.js → mermaid.core-wqUqC7-u.js} +34 -34
  45. package/dist/{mindmap-definition-RKZ34NQL-CyikmuF2.js → mindmap-definition-RKZ34NQL-tCWbcVMf.js} +3 -3
  46. package/dist/{pieDiagram-4H26LBE5-CesqzEGg.js → pieDiagram-4H26LBE5-JtTllP1a.js} +3 -3
  47. package/dist/{quadrantDiagram-W4KKPZXB-BsPKPfNd.js → quadrantDiagram-W4KKPZXB-CLL79FuD.js} +2 -2
  48. package/dist/{requirementDiagram-4Y6WPE33-BwB1tQvi.js → requirementDiagram-4Y6WPE33-3BVAevi9.js} +3 -3
  49. package/dist/{sankeyDiagram-5OEKKPKP-CfSNbWMY.js → sankeyDiagram-5OEKKPKP-BfUuX3gj.js} +1 -1
  50. package/dist/{sequenceDiagram-3UESZ5HK-DZZlUNys.js → sequenceDiagram-3UESZ5HK-vTd4YJPb.js} +3 -3
  51. package/dist/{stateDiagram-AJRCARHV-DNJmz_op.js → stateDiagram-AJRCARHV-BzlMdp-U.js} +4 -4
  52. package/dist/{stateDiagram-v2-BHNVJYJU-DVfDNM6l.js → stateDiagram-v2-BHNVJYJU-Ciwlhuza.js} +2 -2
  53. package/dist/{timeline-definition-PNZ67QCA-DEUCAg_N.js → timeline-definition-PNZ67QCA-CySiSuYS.js} +2 -2
  54. package/dist/{useCodeBlockRendering-DF6zm7nf.js → useCodeBlockRendering-DtcAJyK9.js} +1241 -1074
  55. package/dist/{vennDiagram-CIIHVFJN-DVDP__od.js → vennDiagram-CIIHVFJN-Bbf0BSAq.js} +1 -1
  56. package/dist/{wardleyDiagram-YWT4CUSO-sEtxBd33.js → wardleyDiagram-YWT4CUSO-J0jnd8EV.js} +2 -2
  57. package/dist/{xychartDiagram-2RQKCTM6-DM8QeR5M.js → xychartDiagram-2RQKCTM6-XCPLxT4O.js} +2 -2
  58. package/package.json +3 -3
  59. package/src/__tests__/recorder-assigner-control.test.ts +4 -1
  60. package/src/__tests__/var-field-render.test.ts +516 -5
  61. package/src/components/AimdCodeField.vue +11 -3
  62. package/src/components/AimdRecorder.vue +469 -7
  63. package/src/components/AimdVarField.vue +589 -17
  64. package/src/components/AimdVarTableField.vue +10 -5
  65. package/src/composables/__tests__/useVarHelpers.test.ts +214 -7
  66. package/src/composables/index.ts +6 -0
  67. package/src/composables/useFieldRendering.ts +28 -0
  68. package/src/composables/useVarHelpers.ts +285 -14
  69. package/src/locales.ts +60 -0
  70. package/src/types.ts +1 -1
package/README.md CHANGED
@@ -7,6 +7,8 @@ Reusable recording UI for AIMD (Airalogy Markdown), including inline protocol re
7
7
 
8
8
  Built-in variable input types include `CurrentTime`, `UserName`, `AiralogyMarkdown`, and `DNASequence`.
9
9
  Official named enum types such as `BloodType` render as select inputs using metadata generated from the Python `airalogy.types` registry.
10
+ Select-backed types combined with `None`, such as `bool | None`, `Literal[...] | None`, and `BloodType | None`, show a localized `Not set` option and store that selection as `null`; required selects omit this empty option.
11
+ Scalar list variables such as `list[str]`, `list[int]`, and `list[float]` render as full-row fields with repeatable drag-reorderable item inputs plus a JSON array mode, then store clean scalar arrays.
10
12
  `AiralogyMarkdown` now uses a full-width embedded AIMD/Markdown field in recorder mode with rendered preview and source-editing modes; source editing keeps the full top toolbar and still supports switching to `WYSIWYG` instead of a plain textarea.
11
13
  In recorder/edit mode, `ref_var` references display current var values as readonly inline content when available.
12
14
  `var` and `var_table` labels display AIMD `title`, keep canonical ids visible, and reveal `description` plus `example`/`examples` details only on hover or keyboard focus. Host `fieldMeta` can override the same display fields at runtime.
@@ -39,6 +41,8 @@ Sample: {{var|sample_name: str, title="Sample name", description="Human-readable
39
41
  Operator: {{var|operator: UserName}}
40
42
  Record Time: {{var|current_time: CurrentTime}}
41
43
  Blood Type: {{var|blood_type: BloodType | None}}
44
+ Tags: {{var|sample_tags: list[str]}}
45
+ Replicates: {{var|replicate_counts: list[int]}}
42
46
  Temperature: {{var|temperature: float = 25.0, title="Temperature (C)", description="Ambient temperature in Celsius", examples=[25.0, 37.0]}}
43
47
  Notes: {{var|notes: AiralogyMarkdown}}
44
48
  Plasmid: {{var|plasmid: DNASequence}}`)
package/README.zh-CN.md CHANGED
@@ -7,6 +7,8 @@ AIMD(Airalogy Markdown)记录 UI 组件与样式集合,包含协议内联
7
7
 
8
8
  内置变量控件支持 `CurrentTime`、`UserName`、`AiralogyMarkdown` 和 `DNASequence`。
9
9
  `BloodType` 这类官方命名枚举类型会使用从 Python `airalogy.types` 注册表生成的元数据渲染为下拉输入。
10
+ 和 `None` 组合的下拉型字段,例如 `bool | None`、`Literal[...] | None`、`BloodType | None`,会显示本地化的 `未填写` 选项,并把该选项保存为 `null`;必填下拉字段不会显示这个空值选项。
11
+ `list[str]`、`list[int]`、`list[float]` 这类标量列表变量会渲染为整行字段,支持可重复添加、可拖拽排序的逐项输入,并额外支持 JSON 数组模式,最终保存为干净的标量数组。
10
12
  `AiralogyMarkdown` 现在会在 recorder 中以横铺内嵌 AIMD/Markdown 字段呈现,可在渲染预览和源码编辑之间切换;源码编辑保留完整顶部工具栏,并继续支持切换到 `所见即所得`,而不是普通 textarea。
11
13
  在 recorder/edit 模式下,`ref_var` 如果已经有记录值,会优先以只读内联内容显示该值。
12
14
  `var` 和 `var_table` 标签会显示 AIMD 的 `title`,保留规范 id,并且只在 hover 或键盘 focus 时展示 `description` 与 `example`/`examples` 详情;宿主也可以通过 `fieldMeta` 在运行时覆盖这些显示字段。
@@ -39,6 +41,8 @@ const content = ref(`# Protocol
39
41
  记录者:{{var|operator: UserName}}
40
42
  记录时间:{{var|current_time: CurrentTime}}
41
43
  血型:{{var|blood_type: BloodType | None}}
44
+ 标签:{{var|sample_tags: list[str]}}
45
+ 重复数:{{var|replicate_counts: list[int]}}
42
46
  温度设置:{{var|temperature: float = 25.0, title="温度 (C)", description="环境温度,单位为摄氏度", examples=[25.0, 37.0]}}
43
47
  实验摘要:{{var|summary: AiralogyMarkdown}}
44
48
  质粒:{{var|plasmid: DNASequence}}`)
@@ -1,7 +1,7 @@
1
- import { defineComponent as B, 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 _, Fragment as $, createCommentVNode as x, nextTick as T } from "vue";
2
- import { c as A } from "./useMonacoAutoHeight-D4T-El3J.js";
3
- import { _ as I } from "./_commonjsHelpers-B5RozER-.js";
4
- function P(o) {
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
+ import { c as T } from "./useMonacoAutoHeight-D4T-El3J.js";
3
+ import { _ as A } from "./_commonjsHelpers-B5RozER-.js";
4
+ function I(o) {
5
5
  return new Worker(
6
6
  "/assets/editor.worker-CpuX8TSY.js",
7
7
  {
@@ -56,24 +56,24 @@ const X = {
56
56
  sql: () => import("./sql.contribution-DQy36aE5.js"),
57
57
  xml: () => import("./xml.contribution-XMOaon8i.js"),
58
58
  yaml: () => import("./yaml.contribution-DRRVhJmJ.js")
59
- }, b = /* @__PURE__ */ new Map();
59
+ }, E = /* @__PURE__ */ new Map();
60
60
  function Y() {
61
61
  typeof globalThis > "u" || typeof globalThis.MonacoEnvironment?.getWorker == "function" || (globalThis.MonacoEnvironment = {
62
62
  getWorker(s, t) {
63
- return t === "json" ? new q() : t === "css" || t === "scss" || t === "less" ? new N() : t === "html" || t === "handlebars" || t === "razor" ? new O() : t === "typescript" || t === "javascript" ? new U() : new P();
63
+ return t === "json" ? new q() : t === "css" || t === "scss" || t === "less" ? new N() : t === "html" || t === "handlebars" || t === "razor" ? new O() : t === "typescript" || t === "javascript" ? new U() : new I();
64
64
  }
65
65
  });
66
66
  }
67
- async function E(o) {
67
+ async function W(o) {
68
68
  const s = X[o];
69
69
  if (!s)
70
70
  return;
71
- const t = b.get(o);
71
+ const t = E.get(o);
72
72
  if (t)
73
73
  return t;
74
- const i = Promise.resolve(s()).then(() => {
74
+ const a = Promise.resolve(s()).then(() => {
75
75
  });
76
- return b.set(o, i), i;
76
+ return E.set(o, a), a;
77
77
  }
78
78
  const G = {
79
79
  key: 0,
@@ -81,38 +81,40 @@ const G = {
81
81
  }, J = ["value", "disabled"], K = {
82
82
  key: 0,
83
83
  class: "aimd-code-field__loading"
84
- }, Q = /* @__PURE__ */ B({
84
+ }, Q = /* @__PURE__ */ V({
85
85
  __name: "AimdCodeField",
86
86
  props: {
87
87
  modelValue: { default: "" },
88
88
  language: {},
89
- disabled: { type: Boolean, default: !1 }
89
+ disabled: { type: Boolean, default: !1 },
90
+ compact: { type: Boolean, default: !1 }
90
91
  },
91
92
  emits: ["update:modelValue", "blur"],
92
93
  setup(o, { emit: s }) {
93
- const t = o, i = s, l = c(null), p = c(!0), g = c(null), a = c(y(t.modelValue)), n = A({
94
- getInitialValue: () => a.value,
94
+ const t = o, a = s, l = c(null), p = c(!0), g = c(null), i = c(y(t.modelValue)), n = T({
95
+ getInitialValue: () => i.value,
95
96
  getLayoutElement: () => l.value,
96
- maxHeight: 520
97
- }), W = n.editorHeight, M = L(() => ({
98
- "--aimd-code-field-editor-height": `${W.value}px`
97
+ verticalPadding: t.compact ? 12 : 24,
98
+ maxHeight: t.compact ? 220 : 520
99
+ }), _ = n.editorHeight, M = L(() => ({
100
+ "--aimd-code-field-editor-height": `${_.value}px`
99
101
  }));
100
102
  let d = null, r = null, u = null, v = !1;
101
103
  function y(e) {
102
104
  return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
103
105
  }
104
106
  function k(e) {
105
- n.syncEstimatedEditorHeight(e), e !== a.value && (a.value = e, i("update:modelValue", e));
107
+ n.syncEstimatedEditorHeight(e), e !== i.value && (i.value = e, a("update:modelValue", e));
106
108
  }
107
109
  async function C(e) {
108
- !d || !u || (await E(e), d.editor.setModelLanguage(u, e));
110
+ !d || !u || (await W(e), d.editor.setModelLanguage(u, e));
109
111
  }
110
112
  async function H() {
111
113
  if (!(!l.value || r)) {
112
114
  p.value = !0, g.value = null;
113
115
  try {
114
- Y(), d = await import("./editor.main-Du02abDl.js"), await E(t.language), r = d.editor.create(l.value, {
115
- value: a.value,
116
+ Y(), d = await import("./editor.main-Du02abDl.js"), await W(t.language), r = d.editor.create(l.value, {
117
+ value: i.value,
116
118
  language: t.language,
117
119
  theme: "vs",
118
120
  minimap: { enabled: !1 },
@@ -122,13 +124,13 @@ const G = {
122
124
  wordWrap: "on",
123
125
  lineHeight: n.lineHeight,
124
126
  tabSize: 2,
125
- padding: { top: 12, bottom: 12 },
127
+ padding: t.compact ? { top: 6, bottom: 6 } : { top: 12, bottom: 12 },
126
128
  scrollbar: { vertical: "auto", horizontal: "auto" },
127
129
  readOnly: t.disabled
128
130
  }), u = r.getModel(), r.onDidChangeModelContent(() => {
129
131
  v || !r || k(r.getValue());
130
132
  }), r.onDidBlurEditorWidget(() => {
131
- i("blur");
133
+ a("blur");
132
134
  }), n.attachEditor(r);
133
135
  } catch (e) {
134
136
  g.value = e instanceof Error ? e.message : "Failed to load Monaco editor.";
@@ -138,9 +140,9 @@ const G = {
138
140
  }
139
141
  }
140
142
  function j(e) {
141
- a.value = e, n.syncEstimatedEditorHeight(e), !(!r || e === r.getValue()) && (v = !0, r.setValue(e), v = !1, T(n.syncMeasuredEditorHeight));
143
+ i.value = e, n.syncEstimatedEditorHeight(e), !(!r || e === r.getValue()) && (v = !0, r.setValue(e), v = !1, P(n.syncMeasuredEditorHeight));
142
144
  }
143
- function V(e) {
145
+ function B(e) {
144
146
  k(e.target.value);
145
147
  }
146
148
  return D(() => {
@@ -154,21 +156,21 @@ const G = {
154
156
  }), h(() => t.language, async (e) => {
155
157
  r && await C(e);
156
158
  }), (e, w) => (m(), f("div", {
157
- class: S(["aimd-code-field", { "aimd-code-field--disabled": o.disabled }]),
159
+ class: S(["aimd-code-field", { "aimd-code-field--disabled": o.disabled, "aimd-code-field--compact": o.compact }]),
158
160
  style: F(M.value)
159
161
  }, [
160
162
  g.value ? (m(), f("div", G, [
161
- _("textarea", {
163
+ b("textarea", {
162
164
  class: "aimd-code-field__fallback",
163
- value: a.value,
165
+ value: i.value,
164
166
  disabled: o.disabled,
165
167
  spellcheck: "false",
166
- onInput: V,
167
- onBlur: w[0] || (w[0] = (R) => i("blur"))
168
+ onInput: B,
169
+ onBlur: w[0] || (w[0] = (R) => a("blur"))
168
170
  }, null, 40, J)
169
171
  ])) : (m(), f($, { key: 1 }, [
170
172
  p.value ? (m(), f("div", K, "Loading code editor…")) : x("", !0),
171
- _("div", {
173
+ b("div", {
172
174
  ref_key: "editorContainer",
173
175
  ref: l,
174
176
  class: "aimd-code-field__editor"
@@ -176,7 +178,7 @@ const G = {
176
178
  ], 64))
177
179
  ], 6));
178
180
  }
179
- }), oe = /* @__PURE__ */ I(Q, [["__scopeId", "data-v-1e42ae17"]]);
181
+ }), oe = /* @__PURE__ */ A(Q, [["__scopeId", "data-v-7a8b434d"]]);
180
182
  export {
181
183
  oe as default
182
184
  };