@airalogy/aimd-recorder 1.28.0 → 1.29.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 (71) hide show
  1. package/README.md +4 -0
  2. package/README.zh-CN.md +4 -0
  3. package/dist/{AimdDnaSequenceField-DblYTIq0.js → AimdDnaSequenceField-CC07idJ1.js} +1 -1
  4. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-4uL-qHII.js → AimdEditor.vue_vue_type_style_index_0_lang-C9xOPWUf.js} +5 -1
  5. package/dist/{AimdEntityRefField-bRM3TRyz.js → AimdEntityRefField-Bc55EWW7.js} +1 -1
  6. package/dist/{AimdEntityRefField.vue_vue_type_script_setup_true_lang-BM5paTdk.js → AimdEntityRefField.vue_vue_type_script_setup_true_lang-B539YY-u.js} +1 -1
  7. package/dist/{AimdMarkdownField-qaWjbybB.js → AimdMarkdownField-DaYdXrEN.js} +3 -3
  8. package/dist/{AimdMarkdownNoteField-B8vZnU6s.js → AimdMarkdownNoteField-DE2eyIeG.js} +2 -2
  9. package/dist/{AimdResourceRefField-Bq2ASMTK.js → AimdResourceRefField-Dv1EfosL.js} +2 -2
  10. package/dist/aimd-recorder.css +1 -1
  11. package/dist/{arc-00d15h7D.js → arc-COg5ULhj.js} +1 -1
  12. package/dist/{architectureDiagram-3BPJPVTR-DKYLI713.js → architectureDiagram-3BPJPVTR-Cl6dfzfF.js} +2 -2
  13. package/dist/{blockDiagram-GPEHLZMM-dNWlyXPI.js → blockDiagram-GPEHLZMM-BACKnDKc.js} +4 -4
  14. package/dist/{c4Diagram-AAUBKEIU-CAqsYcIl.js → c4Diagram-AAUBKEIU-zq3HwKb_.js} +2 -2
  15. package/dist/{channel-4oJLrZcY.js → channel-BJlkYmQY.js} +1 -1
  16. package/dist/{chunk-2J33WTMH-DzoFraaP.js → chunk-2J33WTMH-B7oyQtnK.js} +1 -1
  17. package/dist/{chunk-4BX2VUAB-DXRnEJXi.js → chunk-4BX2VUAB-DVmdXl0Z.js} +1 -1
  18. package/dist/{chunk-55IACEB6-BfMMJ2bK.js → chunk-55IACEB6-C6G6r1Hs.js} +1 -1
  19. package/dist/{chunk-727SXJPM-BLnYDYYi.js → chunk-727SXJPM-DRauMxlM.js} +5 -5
  20. package/dist/{chunk-AQP2D5EJ-gckWU-r5.js → chunk-AQP2D5EJ-CFOFED2g.js} +3 -3
  21. package/dist/{chunk-FMBD7UC4-CQ5X8W3n.js → chunk-FMBD7UC4-D6pbxcrd.js} +1 -1
  22. package/dist/{chunk-ND2GUHAM-EKUg1pFy.js → chunk-ND2GUHAM-CTRvR7V6.js} +1 -1
  23. package/dist/{chunk-QZHKN3VN-C7rc4zcu.js → chunk-QZHKN3VN-JYLI2Fou.js} +1 -1
  24. package/dist/{classDiagram-v2-Q7XG4LA2-EfTWUW7K.js → classDiagram-4FO5ZUOK-CvWmPFSb.js} +2 -2
  25. package/dist/{classDiagram-4FO5ZUOK-EfTWUW7K.js → classDiagram-v2-Q7XG4LA2-CvWmPFSb.js} +2 -2
  26. package/dist/components.js +3388 -3343
  27. package/dist/composables.js +2 -2
  28. package/dist/{cose-bilkent-S5V4N54A-7OZaecIh.js → cose-bilkent-S5V4N54A-g5sJsJsO.js} +1 -1
  29. package/dist/{dagre-BM42HDAG-DTPFiUIQ.js → dagre-BM42HDAG-CgURX0XQ.js} +3 -3
  30. package/dist/{diagram-2AECGRRQ-BqkCMrTN.js → diagram-2AECGRRQ-DkDoyjIE.js} +2 -2
  31. package/dist/{diagram-5GNKFQAL-bzujL8bv.js → diagram-5GNKFQAL-CjmQeZ1p.js} +3 -3
  32. package/dist/{diagram-KO2AKTUF-zAvqbjMt.js → diagram-KO2AKTUF-xkwe4Z-T.js} +2 -2
  33. package/dist/{diagram-LMA3HP47-7i7fJxdU.js → diagram-LMA3HP47-B4XAB0Ul.js} +2 -2
  34. package/dist/{diagram-OG6HWLK6-GC2rMiZ5.js → diagram-OG6HWLK6-DIDrCkjk.js} +3 -3
  35. package/dist/{erDiagram-TEJ5UH35-D2U3IvMI.js → erDiagram-TEJ5UH35-HCGS4huB.js} +4 -4
  36. package/dist/{example-record-DJYZw-ON.js → example-record-6TUyxByY.js} +2 -2
  37. package/dist/{flowDiagram-I6XJVG4X-nieM9Hg0.js → flowDiagram-I6XJVG4X-DCR0zjVf.js} +6 -6
  38. package/dist/{ganttDiagram-6RSMTGT7-zNrnW3u3.js → ganttDiagram-6RSMTGT7-D0cqiqhS.js} +2 -2
  39. package/dist/{gitGraphDiagram-PVQCEYII-DA9UoINV.js → gitGraphDiagram-PVQCEYII-CjEJrOfY.js} +3 -3
  40. package/dist/{graph-CyckuBF1.js → graph-vXOGPp0B.js} +1 -1
  41. package/dist/index.js +5 -5
  42. package/dist/{infoDiagram-5YYISTIA-DUgRU8-y.js → infoDiagram-5YYISTIA-Cwa9CA9R.js} +1 -1
  43. package/dist/{ishikawaDiagram-YF4QCWOH-BaruYTNe.js → ishikawaDiagram-YF4QCWOH-Dtm2EQRM.js} +1 -1
  44. package/dist/{journeyDiagram-JHISSGLW-BHlST22D.js → journeyDiagram-JHISSGLW-Cwsyan_q.js} +4 -4
  45. package/dist/{kanban-definition-UN3LZRKU-BW6pDr5N.js → kanban-definition-UN3LZRKU-Cocu6oQX.js} +2 -2
  46. package/dist/{layout-DhpqmwBF.js → layout-BQZ5CVhn.js} +2 -2
  47. package/dist/{linear-BmZyP-ga.js → linear-Dl1Cl9MO.js} +1 -1
  48. package/dist/{mermaid.core-SBTvkVkQ.js → mermaid.core-CcTsVOub.js} +34 -34
  49. package/dist/{mindmap-definition-RKZ34NQL-C7mDnX8X.js → mindmap-definition-RKZ34NQL-CJD4ZSsv.js} +3 -3
  50. package/dist/{pieDiagram-4H26LBE5-Dax4XYix.js → pieDiagram-4H26LBE5-miM6t9w3.js} +3 -3
  51. package/dist/{quadrantDiagram-W4KKPZXB-tx0eF1c_.js → quadrantDiagram-W4KKPZXB-BbjEmdfP.js} +2 -2
  52. package/dist/record.js +3 -3
  53. package/dist/{requirementDiagram-4Y6WPE33-DoEeWHvY.js → requirementDiagram-4Y6WPE33-Btxs6bPP.js} +3 -3
  54. package/dist/{sankeyDiagram-5OEKKPKP-qUrDMgFF.js → sankeyDiagram-5OEKKPKP-BFlv9Za2.js} +1 -1
  55. package/dist/{sequenceDiagram-3UESZ5HK-DQy8q3qc.js → sequenceDiagram-3UESZ5HK-CzsCwM84.js} +3 -3
  56. package/dist/{stateDiagram-AJRCARHV-Ctcg2io0.js → stateDiagram-AJRCARHV-Cr-X25OO.js} +4 -4
  57. package/dist/{stateDiagram-v2-BHNVJYJU-B0bKxEaj.js → stateDiagram-v2-BHNVJYJU-BU8pS5zo.js} +2 -2
  58. package/dist/{timeline-definition-PNZ67QCA-BRvAr_Ti.js → timeline-definition-PNZ67QCA-CCxtC3I1.js} +2 -2
  59. package/dist/{useFieldRendering-FDuKoylb.js → useFieldRendering-fRL0kBSG.js} +1 -1
  60. package/dist/{useVarHelpers-CnOgtKri.js → useVarHelpers-CC6Jk-Vu.js} +1 -1
  61. package/dist/{validation-CK747BvO.js → validation-qjnL_HTT.js} +1 -1
  62. package/dist/{vennDiagram-CIIHVFJN-Co_TdJKN.js → vennDiagram-CIIHVFJN-DoQdCEMx.js} +1 -1
  63. package/dist/{wardleyDiagram-YWT4CUSO-BFW0djMX.js → wardleyDiagram-YWT4CUSO-3t148oYZ.js} +2 -2
  64. package/dist/{xychartDiagram-2RQKCTM6-DgT1Tjy1.js → xychartDiagram-2RQKCTM6-DCni6kCQ.js} +2 -2
  65. package/package.json +3 -3
  66. package/src/__tests__/field-panel.test.ts +45 -0
  67. package/src/components/AimdRecorder.vue +57 -12
  68. package/src/components/AimdVarField.vue +21 -5
  69. package/src/composables/useFieldPresentation.ts +2 -2
  70. package/src/locales.ts +6 -0
  71. package/src/styles/recorder-compact.css +17 -0
@@ -1,5 +1,5 @@
1
- import { s as a, b as t, a as r, S as s } from "./chunk-AQP2D5EJ-gckWU-r5.js";
2
- import { _ as i } from "./mermaid.core-SBTvkVkQ.js";
1
+ import { s as a, b as t, a as r, S as s } from "./chunk-AQP2D5EJ-CFOFED2g.js";
2
+ import { _ as i } from "./mermaid.core-CcTsVOub.js";
3
3
  var _ = {
4
4
  parser: r,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { _ as o, F as gt, ac as Rt, ad as Ct, ae as Wt, c as pt, l as E, L as Pt, a4 as Bt, af as ft, d as X, E as Vt, ag as Ft, A as zt } from "./mermaid.core-SBTvkVkQ.js";
2
- import { d as ot } from "./arc-00d15h7D.js";
1
+ import { _ as o, F as gt, ac as Rt, ad as Ct, ae as Wt, c as pt, l as E, L as Pt, a4 as Bt, af as ft, d as X, E as Vt, ag as Ft, A as zt } from "./mermaid.core-CcTsVOub.js";
2
+ import { d as ot } from "./arc-COg5ULhj.js";
3
3
  var tt = (function() {
4
4
  var e = /* @__PURE__ */ o(function(k, s, d, l) {
5
5
  for (d = d || {}, l = k.length; l--; d[k[l]] = s) ;
@@ -1,5 +1,5 @@
1
1
  import { reactive as z } from "vue";
2
- import { f as B, b6 as re, a2 as ne, T as oe, b7 as ie, b8 as se, b9 as ae, ba as ce, m as le, a5 as ue, bb as fe, bc as de, a6 as D, Z as L, bd as $, a0 as me, C as pe, B as ge, ag as ye, I as H, q as be, ai as we, H as he, b2 as Ae } from "./useVarHelpers-CnOgtKri.js";
2
+ import { f as B, b6 as re, a2 as ne, T as oe, b7 as ie, b8 as se, b9 as ae, ba as ce, m as le, a5 as ue, bb as fe, bc as de, a6 as D, Z as L, bd as $, a0 as me, C as pe, B as ge, ag as ye, I as H, q as be, ai as we, H as he, b2 as Ae } from "./useVarHelpers-CC6Jk-Vu.js";
3
3
  function x(e) {
4
4
  return typeof e == "string" && e.trim() ? e.trim() : void 0;
5
5
  }
@@ -6164,7 +6164,7 @@ function xu(e, t) {
6164
6164
  `)}
6165
6165
  `;
6166
6166
  }
6167
- const io = sr(() => import("./AimdDnaSequenceField-DblYTIq0.js")), ro = sr(() => import("./AimdMarkdownField-qaWjbybB.js")), no = Ma.map((e) => ({
6167
+ const io = sr(() => import("./AimdDnaSequenceField-CC07idJ1.js")), ro = sr(() => import("./AimdMarkdownField-DaYdXrEN.js")), no = Ma.map((e) => ({
6168
6168
  type: e,
6169
6169
  inputKind: "code"
6170
6170
  }));
@@ -1,4 +1,4 @@
1
- import { bd as Dt, bi as ba, ba as wa, z as Sa, b3 as Pa } from "./useVarHelpers-CnOgtKri.js";
1
+ import { bd as Dt, bi as ba, ba as wa, z as Sa, b3 as Pa } from "./useVarHelpers-CC6Jk-Vu.js";
2
2
  import { g as Bn } from "./_commonjsHelpers-ByX85dGu.js";
3
3
  var Ve = { exports: {} }, Qt = {}, ge = {}, we = {}, Xt = {}, xt = {}, er = {}, pr;
4
4
  function zt() {
@@ -1,4 +1,4 @@
1
- import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-SBTvkVkQ.js";
1
+ import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-CcTsVOub.js";
2
2
  const kt = (t, n) => Gt(t, "a", -n), _t = 1e-10;
3
3
  function st(t, n) {
4
4
  const s = ae(t), e = s.filter((c) => re(c, t));
@@ -1,5 +1,5 @@
1
- import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-SBTvkVkQ.js";
2
- import { p as Bt } from "./chunk-4BX2VUAB-DXRnEJXi.js";
1
+ import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-CcTsVOub.js";
2
+ import { p as Bt } from "./chunk-4BX2VUAB-DVmdXl0Z.js";
3
3
  import { p as Rt } from "./wardley-L42UT6IY-D7b2ujEZ.js";
4
4
  var G = /* @__PURE__ */ u((o, r) => {
5
5
  const e = o <= 1 ? o * 100 : o;
@@ -1,7 +1,7 @@
1
- import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-SBTvkVkQ.js";
1
+ import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-CcTsVOub.js";
2
2
  import { i as _i } from "./init-DjUOC4st.js";
3
3
  import { o as ki } from "./ordinal-B6-f3MAq.js";
4
- import { l as zt } from "./linear-BmZyP-ga.js";
4
+ import { l as zt } from "./linear-Dl1Cl9MO.js";
5
5
  function Ri(e, t, i) {
6
6
  e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
7
7
  for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@airalogy/aimd-recorder",
3
3
  "type": "module",
4
- "version": "1.28.0",
4
+ "version": "1.29.0",
5
5
  "description": "AIMD (Airalogy Markdown) recorder Vue components and UI",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -67,9 +67,9 @@
67
67
  "react": "^19.2.4",
68
68
  "react-dom": "^19.2.4",
69
69
  "seqviz": "^3.10.18",
70
- "@airalogy/aimd-core": "^2.18.1",
71
70
  "@airalogy/aimd-editor": "^1.14.0",
72
- "@airalogy/aimd-renderer": "^2.14.0"
71
+ "@airalogy/aimd-renderer": "^2.14.0",
72
+ "@airalogy/aimd-core": "^2.18.1"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/node": "^24.3.0",
@@ -0,0 +1,45 @@
1
+ import { flushPromises, mount } from '@vue/test-utils'
2
+ import { describe, expect, it, vi } from 'vitest'
3
+ import AimdRecorder from '../components/AimdRecorder.vue'
4
+
5
+ describe('standalone field panel', () => {
6
+ const content = [
7
+ 'Example: `{{var|ignored}}`',
8
+ '{{step|start, title="Prepare"}} {{var|sample: str, title="Label", placeholder="S-01"}}',
9
+ '{{var|photo: FileIdJPG | None = None, title="Label photo"}}',
10
+ '{{check|inspect, title="Inspect label"}} {{check|legacy}}',
11
+ ].join('\n\n')
12
+ it('uses unique titled fields, keeps authored hints, and navigates by stable keys', async () => {
13
+ const panel = mount(AimdRecorder, { props: { content, layout: 'field-panel', locale: 'en-US' } })
14
+ await flushPromises()
15
+ expect(panel.findAll('[data-panel-field]').map(f => f.attributes('data-panel-field'))).toEqual(['var:sample', 'var:photo'])
16
+ expect(panel.get('[data-rec-focus-key="var:sample"]').attributes('placeholder')).toBe('S-01')
17
+ expect(panel.get('[data-panel-field="var:photo"]').text()).toContain('Optional')
18
+ expect(panel.findAll('.aimd-panel-outline button').map(b => b.text())).toEqual(['Prepare', 'Inspect label', 'legacy'])
19
+ await panel.get('.aimd-panel-outline button').trigger('click')
20
+ expect(panel.emitted('navigate-field')).toEqual([['step:start']])
21
+ await panel.setProps({ panelVariables: ['extra', 'photo', 'photo'], fieldMeta: { 'var:extra': {title:'Additional field'} } })
22
+ await flushPromises()
23
+ expect(panel.findAll('[data-panel-field]').map(f => f.attributes('aria-label'))).toEqual(['Additional field', 'Label photo'])
24
+ })
25
+
26
+ it('shows upload progress, preserves a failed value and emits the confirmed reference on retry', async () => {
27
+ let reject!: (error: Error) => void
28
+ const uploadFile = vi.fn().mockImplementationOnce(() => new Promise((_, fail) => { reject = fail })).mockResolvedValue('airalogy.id.file.test.jpg')
29
+ const panel = mount(AimdRecorder, { props: { content, layout: 'field-panel', uploadFile, locale: 'zh-CN' } })
30
+ await flushPromises()
31
+ expect(panel.get('.aimd-panel-upload button').text()).toContain('JPG')
32
+ const input = panel.get('input[type=file]')
33
+ const file = new File(['photo'], 'label.jpg', {type:'image/jpeg'})
34
+ Object.defineProperty(input.element, 'files', { value: [file] })
35
+ await input.trigger('change')
36
+ expect(panel.get('[role=status]').text()).toBe('上传中…')
37
+ expect(panel.emitted('field-change')).toBeUndefined()
38
+ reject(new Error('offline'))
39
+ await flushPromises()
40
+ expect(panel.find('.aimd-rec-file-field__error').exists()).toBe(true)
41
+ await input.trigger('change')
42
+ await flushPromises()
43
+ expect(panel.emitted('field-change')?.[0]?.[0]).toMatchObject({ fieldKey:'photo', value:'airalogy.id.file.test.jpg' })
44
+ })
45
+ })
@@ -145,6 +145,10 @@ const props = withDefaults(defineProps<{
145
145
  searchDefaultExpanded?: boolean
146
146
  /** Compact hides field metadata while preserving controls, validation and accessible names. */
147
147
  fieldDisplay?: 'compact' | 'detailed'
148
+ /** A standalone form projection of this protocol, using the same record and adapters. */
149
+ layout?: 'protocol' | 'field-panel'
150
+ /** Optional explicit field order, including variables declared only in the host schema. */
151
+ panelVariables?: string[]
148
152
 
149
153
  // ── Extension props ──────────────────────────────────────────────────────
150
154
 
@@ -256,6 +260,7 @@ const props = withDefaults(defineProps<{
256
260
  showSearch: true,
257
261
  searchDefaultExpanded: false,
258
262
  fieldDisplay: 'detailed',
263
+ layout: 'protocol',
259
264
  fieldMeta: undefined,
260
265
  serverAssigners: undefined,
261
266
  assigners: undefined,
@@ -286,6 +291,7 @@ const emit = defineEmits<{
286
291
  (e: "fields-change", fields: ExtractedAimdFields): void
287
292
  /** Parse / render error */
288
293
  (e: "error", message: string): void
294
+ (e: "navigate-field", fieldKey: string): void
289
295
  /** Local record validation completed. */
290
296
  (e: "validation", result: AimdRecorderValidationResult): void
291
297
 
@@ -332,7 +338,8 @@ const autoServerAssignerSignatures = new Map<string, string>()
332
338
  let autoServerAssignerScheduled = false
333
339
 
334
340
  const resolvedLocale = computed(() => resolveAimdRecorderLocale(props.locale))
335
- provide(fieldDisplayKey, computed(() => props.fieldDisplay))
341
+ const inPanel = computed(() => props.layout === "field-panel")
342
+ provide(fieldDisplayKey, computed(() => inPanel.value ? "panel" : props.fieldDisplay))
336
343
  const resolvedMessages = computed(() => createAimdRecorderMessages(resolvedLocale.value, props.messages))
337
344
  const resolvedTypePlugins = computed(() => createAimdTypePlugins(props.typePlugins))
338
345
  const resolvedServerAssigners = computed(() => props.serverAssigners ?? props.assigners)
@@ -1841,12 +1848,42 @@ function renderInlineQuiz(node: AimdQuizNode): VNode {
1841
1848
  // Rebuild pipeline
1842
1849
  // ---------------------------------------------------------------------------
1843
1850
 
1851
+ function buildPanelFields(nodes: Map<string, AimdVarNode>): VNode[] {
1852
+ const vars = props.panelVariables ?? [...nodes.keys()]
1853
+ return [...new Set(vars)].map(id => {
1854
+ const node: AimdVarNode = nodes.get(id) ?? { type: "aimd", fieldType: "var", scope: "var", id, raw: "" }
1855
+ const key = `var:${id}`
1856
+ const title = effectiveFieldMeta.value[key]?.title || String(node.definition?.kwargs?.title || id)
1857
+ const required = requiredFieldKeys.value.has(key)
1858
+ return h("div", { key, class: "aimd-panel-field", role: "group", "aria-label": title, "data-panel-field": key }, [
1859
+ h("div", { class: "aimd-panel-label" }, [
1860
+ title, h("small", required ? resolvedMessages.value.common.required : resolvedMessages.value.common.optional),
1861
+ ]),
1862
+ renderInlineVar(node),
1863
+ ])
1864
+ })
1865
+ }
1866
+
1867
+ const panelOutline = computed(() => {
1868
+ const fields = extractedFields.value
1869
+ const steps = new Map(fields.step_hierarchy?.map(field => [field.id, field.title]))
1870
+ const checks = new Map(fields.check_definitions?.map(field => [field.id, field.title]))
1871
+ return [
1872
+ ...fields.var_table.map(field => ({ key: `var_table:${field.id}`, title: field.title || field.id })),
1873
+ ...fields.step.map(id => ({ key: `step:${id}`, title: steps.get(id) || id })),
1874
+ ...fields.check.map(id => ({ key: `check:${id}`, title: checks.get(id) || id })),
1875
+ ...fields.quiz.map(field => ({ key: `quiz:${field.id}`, title: field.title || field.id })),
1876
+ ]
1877
+ })
1878
+
1844
1879
  async function rebuildInlineNodes(
1845
1880
  expectedRequestId?: number,
1846
1881
  focusSnapshot?: FocusSnapshot | null,
1847
1882
  expectedInlineRequestId?: number,
1848
1883
  ) {
1849
1884
  recordInitializedDuringRender = false
1885
+ const panelNodes = new Map<string, AimdVarNode>()
1886
+ const panel = inPanel.value
1850
1887
  const rendered = await renderToVue(props.content || "", {
1851
1888
  locale: resolvedLocale.value,
1852
1889
  groupStepBodies: true,
@@ -1863,11 +1900,15 @@ async function rebuildInlineNodes(
1863
1900
  pre: codeBlockPreRenderer,
1864
1901
  },
1865
1902
  aimdRenderers: {
1866
- var: node => renderInlineVar(node as AimdVarNode),
1867
- var_table: node => renderInlineVarTable(node as AimdVarTableNode),
1868
- step: (node, _ctx, children) => renderInlineStep(node as AimdStepNode, children),
1869
- check: (node, _ctx, children) => renderInlineCheck(node as AimdCheckNode, children),
1870
- quiz: node => renderInlineQuiz(node as AimdQuizNode),
1903
+ var: node => {
1904
+ if (!panel) return renderInlineVar(node as AimdVarNode)
1905
+ if (!panelNodes.has(node.id)) panelNodes.set(node.id, node as AimdVarNode)
1906
+ return h("span")
1907
+ },
1908
+ var_table: node => panel ? h("span") : renderInlineVarTable(node as AimdVarTableNode),
1909
+ step: (node, _ctx, children) => panel ? h("span") : renderInlineStep(node as AimdStepNode, children),
1910
+ check: (node, _ctx, children) => panel ? h("span") : renderInlineCheck(node as AimdCheckNode, children),
1911
+ quiz: node => panel ? h("span") : renderInlineQuiz(node as AimdQuizNode),
1871
1912
  },
1872
1913
  })
1873
1914
 
@@ -1878,7 +1919,7 @@ async function rebuildInlineNodes(
1878
1919
  return
1879
1920
  }
1880
1921
 
1881
- inlineNodes.value = rendered.nodes
1922
+ inlineNodes.value = panel ? buildPanelFields(panelNodes) : rendered.nodes
1882
1923
  await nextTick()
1883
1924
  restoreFocusSnapshot(contentRoot.value, focusSnapshot ?? null)
1884
1925
 
@@ -2042,7 +2083,7 @@ watch(
2042
2083
  )
2043
2084
 
2044
2085
  watch(
2045
- () => props.fieldDisplay,
2086
+ () => [props.fieldDisplay, props.layout, props.panelVariables],
2046
2087
  () => {
2047
2088
  // Input events keep native controls current without rebuilding every keystroke.
2048
2089
  // Refresh their VNode props before switching the presentation of those controls.
@@ -2073,6 +2114,7 @@ defineExpose({
2073
2114
  validateField,
2074
2115
  clearValidation,
2075
2116
  focusFirstInvalidField,
2117
+ focusField: focusInvalidField,
2076
2118
  runClientAssigner: clientAssignerRunner.triggerClientAssigner,
2077
2119
  runManualClientAssigners: clientAssignerRunner.triggerManualClientAssigners,
2078
2120
  startCollector: collectorRuntime.start,
@@ -2081,12 +2123,12 @@ defineExpose({
2081
2123
  </script>
2082
2124
 
2083
2125
  <template>
2084
- <div class="aimd-protocol-recorder" :class="{ 'aimd-protocol-recorder--compact': fieldDisplay === 'compact' }">
2126
+ <div class="aimd-protocol-recorder" :class="{ 'aimd-protocol-recorder--compact': inPanel || fieldDisplay === 'compact', 'aimd-recorder-panel': inPanel }">
2085
2127
  <div v-if="renderError" class="aimd-protocol-recorder__error">{{ renderError }}</div>
2086
2128
 
2087
2129
  <template v-else>
2088
2130
  <AimdRecorderSearchToolbar
2089
- v-if="showRecordSearchToolbar"
2131
+ v-if="!inPanel && showRecordSearchToolbar"
2090
2132
  v-model:field-key="recordSearch.fieldKey.value"
2091
2133
  v-model:query="recordSearch.query.value"
2092
2134
  :field-refs="recordSearch.fieldRefs.value"
@@ -2101,7 +2143,7 @@ defineExpose({
2101
2143
  @previous="recordSearch.focusPreviousMatch"
2102
2144
  />
2103
2145
 
2104
- <div v-if="showProtocolTimingSummary" class="aimd-protocol-recorder__timing">
2146
+ <div v-if="!inPanel && showProtocolTimingSummary" class="aimd-protocol-recorder__timing">
2105
2147
  <span
2106
2148
  v-if="protocolEstimatedDurationMs > 0"
2107
2149
  class="aimd-protocol-recorder__timing-pill aimd-protocol-recorder__timing-pill--estimate"
@@ -2120,7 +2162,10 @@ defineExpose({
2120
2162
  <InlineNodesOutlet :nodes="inlineNodes" />
2121
2163
  </div>
2122
2164
 
2123
- <div v-else class="aimd-protocol-recorder__empty">{{ resolvedMessages.common.emptyContent }}</div>
2165
+ <div v-else-if="!inPanel || !panelOutline.length" class="aimd-protocol-recorder__empty">{{ resolvedMessages.common.emptyContent }}</div>
2166
+ <div v-if="inPanel && panelOutline.length" class="aimd-panel-outline">
2167
+ <button v-for="entry in panelOutline" :key="entry.key" type="button" @click="emit('navigate-field', entry.key)">{{ entry.title }}</button>
2168
+ </div>
2124
2169
  </template>
2125
2170
  </div>
2126
2171
  </template>
@@ -521,6 +521,7 @@ export default defineComponent({
521
521
  const checkboxValue = ref(toBooleanValue(props.value))
522
522
  watch(() => props.value, value => { checkboxValue.value = toBooleanValue(value) })
523
523
  const fileUploadError = ref("")
524
+ const uploading = ref(false)
524
525
  const csvPreview = ref<CsvPreviewState | null>(null)
525
526
  const resolvedFileInfo = ref<FileDisplayInfo | null>(null)
526
527
  const lastSelectedFileInfo = ref<FileDisplayInfo | null>(null)
@@ -713,11 +714,12 @@ export default defineComponent({
713
714
  const input = event.target as HTMLInputElement
714
715
  const file = input.files?.[0]
715
716
  input.value = ""
716
- if (!file) {
717
+ if (!file || uploading.value) {
717
718
  return
718
719
  }
719
720
 
720
721
  fileUploadError.value = ""
722
+ uploading.value = true
721
723
  const fileConfig = getFileInputConfig(type, node.definition?.kwargs, meta)
722
724
  try {
723
725
  const uploadedValue = props.uploadFile
@@ -747,6 +749,8 @@ export default defineComponent({
747
749
  })
748
750
  } catch {
749
751
  fileUploadError.value = props.messages.file.uploadFailed
752
+ } finally {
753
+ uploading.value = false
750
754
  }
751
755
  }
752
756
 
@@ -773,7 +777,7 @@ export default defineComponent({
773
777
  const optional = props.markOptional && !props.required
774
778
  ? h('span', { class: 'aimd-field__optional-marker' }, props.messages.common.optional)
775
779
  : null
776
- if (fieldDisplay.value === 'compact') {
780
+ if (fieldDisplay.value !== 'detailed') {
777
781
  const actions = renderHeaderAssignerActions(headerAction)
778
782
  return actions || optional ? h('span', { class: 'aimd-rec-inline__compact-actions' }, [optional, actions]) : null
779
783
  }
@@ -930,7 +934,7 @@ export default defineComponent({
930
934
  },
931
935
  onBlur: onVarBlur,
932
936
  }),
933
- fieldDisplay.value === 'compact'
937
+ fieldDisplay.value !== 'detailed'
934
938
  ? h('span', { class: 'aimd-rec-inline__boolean-state' }, checkboxValue.value ? props.messages.boolean.true : props.messages.boolean.false)
935
939
  : null,
936
940
  ]),
@@ -1055,6 +1059,11 @@ export default defineComponent({
1055
1059
  const displayInfo = resolvedFileInfo.value
1056
1060
  const fileName = displayInfo?.name || getFileDisplayName(props.value)
1057
1061
  const hasFileValue = Boolean(fileId || fileName)
1062
+ const panel = fieldDisplay.value === "panel"
1063
+ const chooseLabel = fileConfig.kind === "image" ? props.messages.file.uploadPhoto : props.messages.file.choose
1064
+ const extensions = fileConfig.accept?.split(",").map(part => part.trim()).filter(part => part.startsWith("."))
1065
+ const formats = extensions?.map(ext => ext.slice(1).toUpperCase()).join(" / ")
1066
+ const panelLabel = formats ? `${chooseLabel} (${formats})` : chooseLabel
1058
1067
  const displayName = fileName || (hasFileValue ? props.messages.file.selected : placeholder || props.messages.file.choose)
1059
1068
  const resolvedUrl = displayInfo?.url || (fileId && props.resolveFile
1060
1069
  ? props.resolveFile(fileId)
@@ -1068,7 +1077,7 @@ export default defineComponent({
1068
1077
  "aria-label": accessibleLabel,
1069
1078
  type: "file",
1070
1079
  accept: fileConfig.accept,
1071
- disabled,
1080
+ disabled: disabled || uploading.value,
1072
1081
  onChange: onFileChange,
1073
1082
  onBlur: onVarBlur,
1074
1083
  })
@@ -1204,7 +1213,13 @@ export default defineComponent({
1204
1213
  ])
1205
1214
  : null,
1206
1215
  ])
1207
- : h("label", {
1216
+ : panel ? h("span", { class: "aimd-panel-upload" }, [
1217
+ fileInput,
1218
+ h("button", {
1219
+ type: "button", disabled: disabled || uploading.value,
1220
+ onClick: (event: MouseEvent) => (event.currentTarget as HTMLElement).parentElement?.querySelector("input")?.click(),
1221
+ }, panelLabel),
1222
+ ]) : h("label", {
1208
1223
  class: [
1209
1224
  "aimd-rec-file-field__trigger",
1210
1225
  disabled ? "aimd-rec-file-field__trigger--disabled" : undefined,
@@ -1215,6 +1230,7 @@ export default defineComponent({
1215
1230
  fileBadge,
1216
1231
  fileTitle,
1217
1232
  ]),
1233
+ uploading.value ? h("span", { role: "status" }, props.messages.file.uploading) : null,
1218
1234
  fileUploadError.value
1219
1235
  ? h("span", { class: "aimd-rec-file-field__error" }, fileUploadError.value)
1220
1236
  : null,
@@ -1,7 +1,7 @@
1
1
  import { inject, ref, type InjectionKey, type Ref } from 'vue'
2
2
 
3
- export const fieldDisplayKey: InjectionKey<Readonly<Ref<'compact' | 'detailed'>>> = Symbol('aimd-field-display')
3
+ export const fieldDisplayKey: InjectionKey<Readonly<Ref<'compact' | 'detailed' | 'panel'>>> = Symbol('aimd-field-display')
4
4
 
5
5
  export function useFieldPresentation() {
6
- return inject(fieldDisplayKey, ref<'compact' | 'detailed'>('detailed'))
6
+ return inject(fieldDisplayKey, ref<'compact' | 'detailed' | 'panel'>('detailed'))
7
7
  }
package/src/locales.ts CHANGED
@@ -88,6 +88,8 @@ export interface AimdRecorderMessages {
88
88
  }
89
89
  file: {
90
90
  choose: string
91
+ uploadPhoto: string
92
+ uploading: string
91
93
  selected: string
92
94
  clear: string
93
95
  open: string
@@ -364,6 +366,8 @@ const EN_US_MESSAGES: AimdRecorderMessages = {
364
366
  },
365
367
  file: {
366
368
  choose: "Choose file",
369
+ uploadPhoto: "Upload photo",
370
+ uploading: "Uploading…",
367
371
  selected: "Selected file",
368
372
  clear: "Clear file",
369
373
  open: "Open file",
@@ -609,6 +613,8 @@ const ZH_CN_MESSAGES: AimdRecorderMessages = {
609
613
  },
610
614
  file: {
611
615
  choose: "选择文件",
616
+ uploadPhoto: "上传照片",
617
+ uploading: "上传中…",
612
618
  selected: "已选择文件",
613
619
  clear: "清除文件",
614
620
  open: "打开文件",
@@ -43,3 +43,20 @@
43
43
  background: #f8fafb;
44
44
  border-bottom-color: #e4e9ef;
45
45
  }
46
+
47
+ .aimd-recorder-panel .aimd-panel-field { min-width: 0; margin-bottom: 0.875rem; }
48
+ .aimd-panel-label { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin-bottom: 0.25rem; overflow-wrap: anywhere; }
49
+ .aimd-panel-label small { font-size: 0.8em; color: var(--aimd-text-muted, #586577); }
50
+ .aimd-recorder-panel .aimd-panel-field .aimd-rec-inline--var-stacked:not(.aimd-rec-inline--var-stacked--checkbox) {
51
+ min-width: 100%; margin-inline: 0; box-sizing: border-box;
52
+ }
53
+ .aimd-recorder-panel .aimd-panel-upload { display: inline-flex; }
54
+ .aimd-panel-upload button, .aimd-panel-outline button {
55
+ font: inherit; color: inherit; cursor: pointer; padding: 0.4em 0.7em; background: transparent;
56
+ border: 1px solid var(--aimd-border-color, #bdc7d2); border-radius: 5px; text-align: start;
57
+ }
58
+ .aimd-panel-upload button:disabled { opacity: 0.6; cursor: default; }
59
+ .aimd-panel-outline { display: grid; gap: 0.25rem; }
60
+ .aimd-panel-outline button { border: 0; justify-self: start; overflow-wrap: anywhere; max-width: 100%; }
61
+ .aimd-panel-outline button:hover { text-decoration: underline; }
62
+ .aimd-recorder-panel .aimd-rec-file-field__preview img { max-height: 120px; object-fit: contain; }