@airalogy/aimd-recorder 1.16.0 → 1.18.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 (110) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-CPyMqIVh.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-lyHIpch9.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3924 -3831
  6. package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
  7. package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
  8. package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
  9. package/dist/aimd-recorder.css +1 -1
  10. package/dist/arc-DS_ocYoe.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
  14. package/dist/channel-CtXnYrAk.js +5 -0
  15. package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
  16. package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
  17. package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
  18. package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
  21. package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
  25. package/dist/components.js +3365 -2216
  26. package/dist/composables.js +92 -68
  27. package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
  32. package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
  34. package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
  35. package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
  40. package/dist/graph-DdlKE625.js +1510 -0
  41. package/dist/index.js +104 -80
  42. package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-DDt0fz-M.js +1703 -0
  49. package/dist/linear-C-IAFdOt.js +259 -0
  50. package/dist/mermaid.core-CuZ3nINf.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
  55. package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
  56. package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
  57. package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
  58. package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
  59. package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
  60. package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
  61. package/dist/{useFieldRendering-Dh6Kib_0.js → useCodeBlockRendering-qA6gj4vz.js} +3041 -2255
  62. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  63. package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
  64. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  65. package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
  66. package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
  67. package/package.json +8 -7
  68. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  69. package/src/__tests__/markdown-field.test.ts +150 -1
  70. package/src/__tests__/markdown-note-field.test.ts +86 -3
  71. package/src/__tests__/quiz-recorder.test.ts +47 -0
  72. package/src/__tests__/recorder-assigner-control.test.ts +844 -0
  73. package/src/__tests__/recorder-check-field.test.ts +103 -0
  74. package/src/__tests__/recorder-editor.test.ts +17 -0
  75. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  76. package/src/__tests__/step-field.test.ts +87 -4
  77. package/src/__tests__/type-plugins.test.ts +1 -0
  78. package/src/__tests__/var-field-render.test.ts +741 -1
  79. package/src/components/AimdCodeField.vue +24 -5
  80. package/src/components/AimdMarkdownField.vue +548 -11
  81. package/src/components/AimdMarkdownNoteField.vue +241 -30
  82. package/src/components/AimdQuizOptionFollowups.vue +121 -0
  83. package/src/components/AimdQuizRecorder.vue +79 -148
  84. package/src/components/AimdRecorder.vue +1620 -98
  85. package/src/components/AimdRecorderEditor.vue +276 -8
  86. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  87. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  88. package/src/components/AimdStepCheckField.vue +205 -51
  89. package/src/components/AimdVarField.vue +694 -25
  90. package/src/components/AimdVarTableField.vue +283 -110
  91. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  92. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  93. package/src/components/recorderMilkdownPlugin.ts +14 -0
  94. package/src/composables/__tests__/useRecordState.test.ts +114 -0
  95. package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
  96. package/src/composables/index.ts +27 -1
  97. package/src/composables/useAssignerRunner.ts +376 -0
  98. package/src/composables/useCodeBlockRendering.ts +51 -0
  99. package/src/composables/useFieldRendering.ts +32 -4
  100. package/src/composables/useMonacoAutoHeight.ts +127 -0
  101. package/src/composables/useRecordState.ts +40 -14
  102. package/src/composables/useVarHelpers.ts +377 -9
  103. package/src/index.ts +13 -0
  104. package/src/locales.ts +47 -2
  105. package/src/styles/aimd.css +171 -6
  106. package/src/type-plugins.ts +7 -0
  107. package/src/types.ts +93 -2
  108. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  109. package/dist/AimdMarkdownField-CX71bOdX.js +0 -67
  110. package/dist/AimdMarkdownNoteField--ssNIQfG.js +0 -186
package/src/locales.ts CHANGED
@@ -80,6 +80,21 @@ export interface AimdRecorderMessages {
80
80
  deleteRow: string
81
81
  addRow: string
82
82
  }
83
+ assigner: {
84
+ run: string
85
+ running: string
86
+ cancel: string
87
+ }
88
+ file: {
89
+ choose: string
90
+ selected: string
91
+ clear: string
92
+ open: string
93
+ download: string
94
+ preview: string
95
+ replace: string
96
+ uploadFailed: string
97
+ }
83
98
  dna: {
84
99
  editMode: string
85
100
  interactiveMode: string
@@ -240,7 +255,7 @@ const EN_US_MESSAGES: AimdRecorderMessages = {
240
255
  resetTimer: "Reset",
241
256
  },
242
257
  check: {
243
- annotationPlaceholder: "Check notes",
258
+ annotationPlaceholder: "Notes",
244
259
  },
245
260
  table: {
246
261
  actionColumn: "Actions",
@@ -249,6 +264,21 @@ const EN_US_MESSAGES: AimdRecorderMessages = {
249
264
  deleteRow: "Delete",
250
265
  addRow: "Add row",
251
266
  },
267
+ assigner: {
268
+ run: "Run Assigner",
269
+ running: "Running",
270
+ cancel: "Cancel",
271
+ },
272
+ file: {
273
+ choose: "Choose file",
274
+ selected: "Selected file",
275
+ clear: "Clear file",
276
+ open: "Open file",
277
+ download: "Download",
278
+ preview: "Preview",
279
+ replace: "Replace file",
280
+ uploadFailed: "File upload failed.",
281
+ },
252
282
  dna: {
253
283
  editMode: "Edit mode",
254
284
  interactiveMode: "Interactive",
@@ -382,7 +412,7 @@ const ZH_CN_MESSAGES: AimdRecorderMessages = {
382
412
  resetTimer: "重置",
383
413
  },
384
414
  check: {
385
- annotationPlaceholder: "检查备注",
415
+ annotationPlaceholder: "备注",
386
416
  },
387
417
  table: {
388
418
  actionColumn: "操作",
@@ -391,6 +421,21 @@ const ZH_CN_MESSAGES: AimdRecorderMessages = {
391
421
  deleteRow: "删除",
392
422
  addRow: "添加行",
393
423
  },
424
+ assigner: {
425
+ run: "运行赋值器",
426
+ running: "运行中",
427
+ cancel: "取消",
428
+ },
429
+ file: {
430
+ choose: "选择文件",
431
+ selected: "已选择文件",
432
+ clear: "清除文件",
433
+ open: "打开文件",
434
+ download: "下载",
435
+ preview: "预览",
436
+ replace: "替换文件",
437
+ uploadFailed: "文件上传失败。",
438
+ },
394
439
  dna: {
395
440
  editMode: "编辑模式",
396
441
  interactiveMode: "交互式",
@@ -46,6 +46,135 @@
46
46
  font-weight: 500;
47
47
  }
48
48
 
49
+ .aimd-field__name--with-metadata {
50
+ display: inline-flex;
51
+ flex-direction: column;
52
+ align-items: flex-start;
53
+ gap: 1px;
54
+ line-height: 1.25;
55
+ }
56
+
57
+ .aimd-field__metadata-host {
58
+ position: relative;
59
+ cursor: help;
60
+ outline: none;
61
+ }
62
+
63
+ .aimd-field__metadata-host:hover,
64
+ .aimd-field__metadata-host:focus,
65
+ .aimd-field__metadata-host:focus-within {
66
+ z-index: 90;
67
+ }
68
+
69
+ .aimd-field__metadata-host:focus-visible {
70
+ border-radius: 4px;
71
+ box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.24);
72
+ }
73
+
74
+ .aimd-field__metadata-host .aimd-field__title {
75
+ text-decoration-line: underline;
76
+ text-decoration-style: dotted;
77
+ text-decoration-color: rgba(15, 23, 42, 0.36);
78
+ text-underline-offset: 3px;
79
+ }
80
+
81
+ .aimd-field__title {
82
+ font-weight: inherit;
83
+ }
84
+
85
+ .aimd-field__key {
86
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
87
+ font-size: 11px;
88
+ font-weight: 500;
89
+ line-height: 1.2;
90
+ color: rgba(15, 23, 42, 0.55);
91
+ }
92
+
93
+ .aimd-field__metadata-popover {
94
+ position: absolute;
95
+ z-index: 80;
96
+ inset-inline-start: 0;
97
+ top: calc(100% + 7px);
98
+ display: inline-flex;
99
+ flex-direction: column;
100
+ gap: 4px;
101
+ width: max-content;
102
+ min-width: 220px;
103
+ max-width: min(360px, 82vw);
104
+ padding: 8px 10px;
105
+ border-radius: 8px;
106
+ background: rgba(15, 23, 42, 0.96);
107
+ color: #f8fafc;
108
+ box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
109
+ font-size: 12px;
110
+ font-weight: 500;
111
+ line-height: 1.45;
112
+ letter-spacing: 0;
113
+ text-align: left;
114
+ text-transform: none;
115
+ white-space: normal;
116
+ pointer-events: none;
117
+ opacity: 0;
118
+ visibility: hidden;
119
+ transform: translateY(-2px);
120
+ transition:
121
+ opacity 120ms ease,
122
+ transform 120ms ease,
123
+ visibility 120ms ease;
124
+ }
125
+
126
+ .aimd-field__metadata-popover::before {
127
+ content: "";
128
+ position: absolute;
129
+ inset-inline-start: 14px;
130
+ top: -5px;
131
+ width: 10px;
132
+ height: 10px;
133
+ background: rgba(15, 23, 42, 0.96);
134
+ transform: rotate(45deg);
135
+ }
136
+
137
+ .aimd-field__metadata-popover-line {
138
+ display: block;
139
+ color: inherit;
140
+ }
141
+
142
+ .aimd-field__metadata-examples {
143
+ display: flex;
144
+ flex-wrap: wrap;
145
+ align-items: center;
146
+ gap: 4px;
147
+ padding-top: 1px;
148
+ }
149
+
150
+ .aimd-field__metadata-examples-label {
151
+ color: rgba(226, 232, 240, 0.78);
152
+ }
153
+
154
+ .aimd-field__metadata-example {
155
+ display: inline-flex;
156
+ align-items: center;
157
+ max-width: 100%;
158
+ padding: 1px 6px;
159
+ border: 1px solid rgba(248, 250, 252, 0.18);
160
+ border-radius: 5px;
161
+ background: rgba(248, 250, 252, 0.1);
162
+ color: #f8fafc;
163
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
164
+ font-size: 11px;
165
+ font-weight: 600;
166
+ line-height: 1.45;
167
+ overflow-wrap: anywhere;
168
+ }
169
+
170
+ .aimd-field__metadata-host:hover > .aimd-field__metadata-popover,
171
+ .aimd-field__metadata-host:focus > .aimd-field__metadata-popover,
172
+ .aimd-field__metadata-host:focus-within > .aimd-field__metadata-popover {
173
+ opacity: 1;
174
+ visibility: visible;
175
+ transform: translateY(0);
176
+ }
177
+
49
178
  .aimd-field--var .aimd-field__type {
50
179
  font-size: 12px;
51
180
  color: #7b1fa2;
@@ -92,7 +221,7 @@
92
221
  border-collapse: collapse;
93
222
  font-size: 12px;
94
223
  border-radius: 4px;
95
- overflow: hidden;
224
+ overflow: visible;
96
225
  }
97
226
 
98
227
  .aimd-field--var-table .aimd-field__table-preview th,
@@ -103,11 +232,19 @@
103
232
  }
104
233
 
105
234
  .aimd-field--var-table .aimd-field__table-preview th {
235
+ position: relative;
236
+ overflow: visible;
106
237
  background: #cfeed0;
107
238
  font-weight: 600;
108
239
  color: #2e7d32;
109
240
  }
110
241
 
242
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:hover),
243
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus),
244
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus-within) {
245
+ z-index: 95;
246
+ }
247
+
111
248
  .aimd-field--var-table .aimd-field__table-preview td {
112
249
  color: #666;
113
250
  font-style: italic;
@@ -285,8 +422,8 @@
285
422
  align-items: center;
286
423
  gap: 8px;
287
424
  padding: 4px 8px;
288
- background-color: #f0f0f0;
289
- border: 1px solid #d0d0d0;
425
+ background-color: #fffafa;
426
+ border: 1px solid rgba(185, 28, 28, 0.2);
290
427
  border-radius: 4px;
291
428
  color: #333;
292
429
  cursor: pointer;
@@ -294,8 +431,19 @@
294
431
  }
295
432
 
296
433
  .aimd-field--check:hover {
297
- background-color: #e8e8e8;
298
- border-color: #b0b0b0;
434
+ background-color: #fff5f5;
435
+ border-color: rgba(185, 28, 28, 0.32);
436
+ }
437
+
438
+ .aimd-field--check.aimd-rec-inline--check-passed {
439
+ background-color: #f6fdf9;
440
+ border-color: rgba(22, 101, 52, 0.22);
441
+ color: #1f3d2a;
442
+ }
443
+
444
+ .aimd-field--check.aimd-rec-inline--check-passed:hover {
445
+ background-color: #effcf4;
446
+ border-color: rgba(22, 101, 52, 0.34);
299
447
  }
300
448
 
301
449
  .aimd-field--check .aimd-checkbox {
@@ -303,7 +451,11 @@
303
451
  cursor: pointer;
304
452
  width: 16px;
305
453
  height: 16px;
306
- accent-color: #4181fd;
454
+ accent-color: #dc2626;
455
+ }
456
+
457
+ .aimd-field--check.aimd-rec-inline--check-passed .aimd-checkbox {
458
+ accent-color: #16a34a;
307
459
  }
308
460
 
309
461
  .aimd-field--check .aimd-field__label,
@@ -493,6 +645,10 @@
493
645
  min-height: 28px;
494
646
  }
495
647
 
648
+ .aimd-field--no-style.aimd-field__label.aimd-field__label--has-metadata {
649
+ overflow: visible;
650
+ }
651
+
496
652
  /* Default scope color for edit mode labels (var type - blue, matches preview) */
497
653
  .aimd-field--no-style.aimd-field__label .aimd-field__scope {
498
654
  border-radius: 6px 0 0 0;
@@ -515,6 +671,15 @@
515
671
  align-items: center;
516
672
  }
517
673
 
674
+ .aimd-field--no-style.aimd-field__label .aimd-field__name--with-metadata {
675
+ align-items: flex-start;
676
+ justify-content: center;
677
+ gap: 2px;
678
+ min-width: 0;
679
+ padding-top: 5px;
680
+ padding-bottom: 5px;
681
+ }
682
+
518
683
  /* Edit mode label scope colors - step type (orange) */
519
684
  .aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--step"]),
520
685
  .aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--rns"]),
@@ -62,6 +62,7 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
62
62
  {
63
63
  type: 'AiralogyMarkdown',
64
64
  inputKind: 'textarea',
65
+ supportsInlineAssignerControl: true,
65
66
  renderField: ({
66
67
  node,
67
68
  value,
@@ -69,6 +70,9 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
69
70
  locale,
70
71
  messages,
71
72
  extraClasses,
73
+ assignerControl,
74
+ assignerStatus,
75
+ assignerError,
72
76
  emitChange,
73
77
  emitBlur,
74
78
  }) => h(AimdMarkdownField, {
@@ -78,6 +82,9 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
78
82
  disabled,
79
83
  locale,
80
84
  messages,
85
+ assignerControl,
86
+ assignerStatus,
87
+ assignerError,
81
88
  'onUpdate:modelValue': (nextValue: string) => emitChange(nextValue),
82
89
  onBlur: emitBlur,
83
90
  }),
package/src/types.ts CHANGED
@@ -59,10 +59,66 @@ export interface AimdProtocolRecordData {
59
59
  quiz: Record<string, unknown>
60
60
  }
61
61
 
62
- export type AimdVarInputKind = "text" | "number" | "checkbox" | "textarea" | "date" | "datetime" | "time" | "dna" | "code"
62
+ export interface AimdSelectedFileValue {
63
+ format: "airalogy_selected_file_v1"
64
+ name: string
65
+ type: string
66
+ size: number
67
+ lastModified: number
68
+ }
69
+
70
+ export interface AimdResolvedFileInfo {
71
+ id?: string
72
+ name?: string
73
+ fileName?: string
74
+ file_name?: string
75
+ filename?: string
76
+ url?: string
77
+ src?: string
78
+ downloadUrl?: string
79
+ thumbnailUrl?: string
80
+ type?: string
81
+ contentType?: string
82
+ content_type?: string
83
+ mimeType?: string
84
+ size?: number
85
+ }
86
+
87
+ export interface AimdFileUploadContext {
88
+ type: string
89
+ normalizedType: string
90
+ fieldKey: string
91
+ node: AimdVarNode
92
+ fieldMeta?: AimdFieldMeta
93
+ accept?: string
94
+ }
95
+
96
+ export type AimdFileUploadHandler = (
97
+ file: File,
98
+ context: AimdFileUploadContext,
99
+ ) => unknown | Promise<unknown>
100
+
101
+ export interface AimdFileResolveContext {
102
+ type: string
103
+ normalizedType: string
104
+ fieldKey: string
105
+ node: AimdVarNode
106
+ fieldMeta?: AimdFieldMeta
107
+ kind: string
108
+ }
109
+
110
+ export type AimdFileInfoResolver = (
111
+ src: string,
112
+ context: AimdFileResolveContext,
113
+ ) => AimdResolvedFileInfo | string | null | undefined | Promise<AimdResolvedFileInfo | string | null | undefined>
114
+
115
+ export type AimdVarInputKind = "text" | "number" | "checkbox" | "textarea" | "date" | "datetime" | "time" | "dna" | "code" | "file"
63
116
  export type AimdStepDetailDisplay = "auto" | "always"
64
117
  export type AimdChoiceOptionExplanationMode = "hidden" | "selected" | "submitted" | "graded"
65
118
  export type AimdScaleGradeDisplayMode = "hidden" | "completed" | "submitted" | "graded"
119
+ export type AimdAssignerMode = "auto" | "auto_first" | "auto_force" | "manual" | "manual_readonly" | "auto_readonly"
120
+ export type AimdServerAssignerMap = Record<string, AimdAssignerDefinition | unknown>
121
+ export type AimdAssignerMap = AimdServerAssignerMap
66
122
 
67
123
  export function createEmptyProtocolRecordData(): AimdProtocolRecordData {
68
124
  return {
@@ -79,6 +135,9 @@ export function createEmptyProtocolRecordData(): AimdProtocolRecordData {
79
135
 
80
136
  /** Field metadata — app passes via prop to describe extra field info */
81
137
  export interface AimdFieldMeta {
138
+ title?: string // display title override
139
+ description?: string // helper text override
140
+ examples?: unknown[] // example values used for helper text and placeholders
82
141
  inputType?: string // override built-in input kind or a host-defined custom type mapping
83
142
  codeLanguage?: string // Monaco language id for code-like fields (e.g. "python", "json")
84
143
  required?: boolean
@@ -86,7 +145,8 @@ export interface AimdFieldMeta {
86
145
  enumOptions?: Array<{ label: string; value: unknown }>
87
146
  disabled?: boolean
88
147
  placeholder?: string
89
- assigner?: { mode: 'manual' | 'auto_first' | 'auto_force' }
148
+ accept?: string // native file input accept string for file-like vars
149
+ assigner?: { mode: AimdAssignerMode }
90
150
  }
91
151
 
92
152
  /** Field runtime state — app updates dynamically via prop */
@@ -97,6 +157,30 @@ export interface AimdFieldState {
97
157
  disabled?: boolean // dynamic disable
98
158
  }
99
159
 
160
+ export interface AimdAssignerDefinition {
161
+ mode?: string
162
+ dependent_fields?: unknown
163
+ [key: string]: unknown
164
+ }
165
+
166
+ export interface AimdServerAssignerRunnerRequest {
167
+ section: Exclude<AimdRecorderFieldType, "quiz">
168
+ fieldKey: string
169
+ assignedField: string
170
+ dependentData: Record<string, unknown>
171
+ record: AimdProtocolRecordData
172
+ assigner: AimdAssignerDefinition
173
+ signal?: AbortSignal
174
+ }
175
+
176
+ export type AimdAssignerRunnerRequest = AimdServerAssignerRunnerRequest
177
+
178
+ export type AimdServerAssignerRunner = (
179
+ request: AimdServerAssignerRunnerRequest,
180
+ ) => unknown | Promise<unknown>
181
+
182
+ export type AimdAssignerRunner = AimdServerAssignerRunner
183
+
100
184
  /** Field event payload */
101
185
  export interface FieldEventPayload {
102
186
  section: 'var' | 'step' | 'check' | 'quiz' | 'var_table'
@@ -153,6 +237,12 @@ export interface AimdTypePluginRenderContext extends AimdTypePluginValueContext
153
237
  extraClasses: string[]
154
238
  placeholder?: string
155
239
  fieldState?: AimdFieldState
240
+ assignerControl?: VNode
241
+ assignerStatus?: VNode
242
+ assignerError?: string
243
+ uploadFile?: AimdFileUploadHandler
244
+ resolveFile?: (src: string) => string | null
245
+ resolveFileInfo?: AimdFileInfoResolver
156
246
  emitChange: (value: unknown) => void
157
247
  emitBlur: () => void
158
248
  }
@@ -161,6 +251,7 @@ export interface AimdTypePlugin {
161
251
  type: string
162
252
  aliases?: string[]
163
253
  inputKind?: AimdVarInputKind
254
+ supportsInlineAssignerControl?: boolean
164
255
  getInitialValue?: (context: AimdTypePluginInitContext) => unknown
165
256
  normalizeValue?: (context: AimdTypePluginValueContext) => unknown
166
257
  getDisplayValue?: (context: AimdTypePluginValueContext) => string | number
@@ -1,172 +0,0 @@
1
- import { defineComponent as j, ref as d, onMounted as V, onBeforeUnmount as B, watch as v, openBlock as u, createElementBlock as c, normalizeClass as D, createElementVNode as _, Fragment as L, createCommentVNode as F } from "vue";
2
- import { _ as z } from "./_commonjsHelpers-CZXJ37nu.js";
3
- function $(n) {
4
- return new Worker(
5
- "/assets/editor.worker-CpuX8TSY.js",
6
- {
7
- name: n?.name
8
- }
9
- );
10
- }
11
- function x(n) {
12
- return new Worker(
13
- "/assets/css.worker-Dmf38jDD.js",
14
- {
15
- name: n?.name
16
- }
17
- );
18
- }
19
- function P(n) {
20
- return new Worker(
21
- "/assets/html.worker-DotaEs7v.js",
22
- {
23
- name: n?.name
24
- }
25
- );
26
- }
27
- function S(n) {
28
- return new Worker(
29
- "/assets/json.worker-B4VHhH6h.js",
30
- {
31
- name: n?.name
32
- }
33
- );
34
- }
35
- function T(n) {
36
- return new Worker(
37
- "/assets/ts.worker-sl17zBDo.js",
38
- {
39
- name: n?.name
40
- }
41
- );
42
- }
43
- const I = {
44
- css: () => import("./monaco.contribution-b5xkgQ-s.js"),
45
- scss: () => import("./monaco.contribution-b5xkgQ-s.js"),
46
- less: () => import("./monaco.contribution-b5xkgQ-s.js"),
47
- html: () => import("./monaco.contribution-C-bQhUTI.js"),
48
- javascript: () => import("./monaco.contribution-Col-f0XR.js"),
49
- typescript: () => import("./monaco.contribution-Col-f0XR.js"),
50
- json: () => import("./monaco.contribution-CCVvl3Jx.js"),
51
- ini: () => import("./ini.contribution-DyWtiacL.js"),
52
- markdown: () => import("./markdown.contribution-DYYk6zUU.js"),
53
- python: () => import("./python.contribution-CcKs2Ktm.js"),
54
- shell: () => import("./shell.contribution-B80NZ3iO.js"),
55
- sql: () => import("./sql.contribution-DQy36aE5.js"),
56
- xml: () => import("./xml.contribution-XMOaon8i.js"),
57
- yaml: () => import("./yaml.contribution-DRRVhJmJ.js")
58
- }, b = /* @__PURE__ */ new Map();
59
- function N() {
60
- typeof globalThis > "u" || typeof globalThis.MonacoEnvironment?.getWorker == "function" || (globalThis.MonacoEnvironment = {
61
- getWorker(a, o) {
62
- return o === "json" ? new S() : o === "css" || o === "scss" || o === "less" ? new x() : o === "html" || o === "handlebars" || o === "razor" ? new P() : o === "typescript" || o === "javascript" ? new T() : new $();
63
- }
64
- });
65
- }
66
- async function h(n) {
67
- const a = I[n];
68
- if (!a)
69
- return;
70
- const o = b.get(n);
71
- if (o)
72
- return o;
73
- const r = Promise.resolve(a()).then(() => {
74
- });
75
- return b.set(n, r), r;
76
- }
77
- const O = {
78
- key: 0,
79
- class: "aimd-code-field__fallback-shell"
80
- }, A = ["value", "disabled"], H = {
81
- key: 0,
82
- class: "aimd-code-field__loading"
83
- }, q = /* @__PURE__ */ j({
84
- __name: "AimdCodeField",
85
- props: {
86
- modelValue: { default: "" },
87
- language: {},
88
- disabled: { type: Boolean, default: !1 }
89
- },
90
- emits: ["update:modelValue", "blur"],
91
- setup(n, { emit: a }) {
92
- const o = n, r = a, m = d(null), f = d(!0), p = d(null), i = d(k(o.modelValue));
93
- let s = null, t = null, l = null, g = !1;
94
- function k(e) {
95
- return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
96
- }
97
- function y(e) {
98
- e !== i.value && (i.value = e, r("update:modelValue", e));
99
- }
100
- async function W(e) {
101
- !s || !l || (await h(e), s.editor.setModelLanguage(l, e));
102
- }
103
- async function C() {
104
- if (!(!m.value || t)) {
105
- f.value = !0, p.value = null;
106
- try {
107
- N(), s = await import("./editor.main-Du02abDl.js"), await h(o.language), t = s.editor.create(m.value, {
108
- value: i.value,
109
- language: o.language,
110
- theme: "vs",
111
- minimap: { enabled: !1 },
112
- scrollBeyondLastLine: !1,
113
- automaticLayout: !0,
114
- lineNumbers: "on",
115
- wordWrap: "on",
116
- tabSize: 2,
117
- padding: { top: 12, bottom: 12 },
118
- readOnly: o.disabled
119
- }), l = t.getModel(), t.onDidChangeModelContent(() => {
120
- g || !t || y(t.getValue());
121
- }), t.onDidBlurEditorWidget(() => {
122
- r("blur");
123
- });
124
- } catch (e) {
125
- p.value = e instanceof Error ? e.message : "Failed to load Monaco editor.";
126
- } finally {
127
- f.value = !1;
128
- }
129
- }
130
- }
131
- function E(e) {
132
- i.value = e, !(!t || e === t.getValue()) && (g = !0, t.setValue(e), g = !1);
133
- }
134
- function M(e) {
135
- y(e.target.value);
136
- }
137
- return V(() => {
138
- C();
139
- }), B(() => {
140
- t?.dispose(), l?.dispose();
141
- }), v(() => o.modelValue, (e) => {
142
- E(k(e));
143
- }), v(() => o.disabled, (e) => {
144
- t?.updateOptions({ readOnly: e });
145
- }), v(() => o.language, async (e) => {
146
- t && await W(e);
147
- }), (e, w) => (u(), c("div", {
148
- class: D(["aimd-code-field", { "aimd-code-field--disabled": n.disabled }])
149
- }, [
150
- p.value ? (u(), c("div", O, [
151
- _("textarea", {
152
- class: "aimd-code-field__fallback",
153
- value: i.value,
154
- disabled: n.disabled,
155
- spellcheck: "false",
156
- onInput: M,
157
- onBlur: w[0] || (w[0] = (U) => r("blur"))
158
- }, null, 40, A)
159
- ])) : (u(), c(L, { key: 1 }, [
160
- f.value ? (u(), c("div", H, "Loading code editor…")) : F("", !0),
161
- _("div", {
162
- ref_key: "editorContainer",
163
- ref: m,
164
- class: "aimd-code-field__editor"
165
- }, null, 512)
166
- ], 64))
167
- ], 2));
168
- }
169
- }), G = /* @__PURE__ */ z(q, [["__scopeId", "data-v-b814be63"]]);
170
- export {
171
- G as default
172
- };