@airalogy/aimd-recorder 1.22.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 +80 -0
- package/README.zh-CN.md +80 -0
- package/dist/{AimdCodeField-BN_0UQMx.js → AimdCodeField-CPjcXY4D.js} +1 -1
- package/dist/{AimdDnaSequenceField-Bhj28fP8.js → AimdDnaSequenceField-Dz-IONoA.js} +5 -4
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-D7c01UqN.js → AimdEditor.vue_vue_type_style_index_0_lang-JAD--qFs.js} +1999 -1900
- package/dist/AimdEntityRefField-BE0s2o5T.js +229 -0
- package/dist/{AimdMarkdownField-GS15pv4z.js → AimdMarkdownField-BeD2t9JY.js} +5 -5
- package/dist/{AimdMarkdownNoteField-H9WP8tR6.js → AimdMarkdownNoteField-DIgGEYpj.js} +16 -16
- 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-B50G9-kH.js → arc-CLJJdrm0.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-D9mBEbpY.js → architectureDiagram-3BPJPVTR-BizrFPnS.js} +3 -3
- package/dist/{blockDiagram-GPEHLZMM-Cs4swgto.js → blockDiagram-GPEHLZMM-IHDih8JW.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-C12HKS3r.js → c4Diagram-AAUBKEIU-BQtg8m_M.js} +2 -2
- package/dist/{channel-D69VnjVz.js → channel-D8q7AX1Z.js} +1 -1
- package/dist/{chunk-2J33WTMH-oc-89G5c.js → chunk-2J33WTMH-C24lbKon.js} +1 -1
- package/dist/{chunk-4BX2VUAB-BDJS9G3r.js → chunk-4BX2VUAB-1m_lB_xe.js} +1 -1
- package/dist/{chunk-55IACEB6-BPl3uHcA.js → chunk-55IACEB6-BE5Nj-sd.js} +1 -1
- package/dist/{chunk-727SXJPM-pWe-vDGf.js → chunk-727SXJPM-Cg-Xw_d_.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-D-R5sIr1.js → chunk-AQP2D5EJ-BvRpPCiY.js} +3 -3
- package/dist/{chunk-FMBD7UC4-bo6Qyom1.js → chunk-FMBD7UC4-D_44MTsg.js} +1 -1
- package/dist/{chunk-ND2GUHAM-DQMvtYV7.js → chunk-ND2GUHAM-tVBIo4LA.js} +1 -1
- package/dist/{chunk-QZHKN3VN-DlCn3HON.js → chunk-QZHKN3VN-B91HYLks.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-DzUwWFwr.js → classDiagram-4FO5ZUOK-CkejvTAN.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-DzUwWFwr.js → classDiagram-v2-Q7XG4LA2-CkejvTAN.js} +2 -2
- package/dist/components.js +3869 -3359
- package/dist/composables.js +98 -93
- package/dist/{cose-bilkent-S5V4N54A-BXLMzfpO.js → cose-bilkent-S5V4N54A-CNcuriOF.js} +2 -2
- package/dist/{dagre-BM42HDAG-DHnofIh9.js → dagre-BM42HDAG-DMqFGafq.js} +3 -3
- package/dist/{diagram-2AECGRRQ-BqTTVPsm.js → diagram-2AECGRRQ-Cksd3pP3.js} +2 -2
- package/dist/{diagram-5GNKFQAL-D5p1UVbw.js → diagram-5GNKFQAL-SVjLnDJG.js} +3 -3
- package/dist/{diagram-KO2AKTUF-Uuoz9cFn.js → diagram-KO2AKTUF-DfNIAG6w.js} +2 -2
- package/dist/{diagram-LMA3HP47-W001U31X.js → diagram-LMA3HP47-DPOyCMGB.js} +2 -2
- package/dist/{diagram-OG6HWLK6-DL516LDr.js → diagram-OG6HWLK6-BDURmT37.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-CCxgMb67.js → erDiagram-TEJ5UH35-N991qII9.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-nXGdmC0O.js → flowDiagram-I6XJVG4X-BABRFuk-.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-Bi9Ro7_Z.js → ganttDiagram-6RSMTGT7-BMDnK96S.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-w1kNAy4E.js → gitGraphDiagram-PVQCEYII-cEvL7Dss.js} +3 -3
- package/dist/{graph-CpOkL_eZ.js → graph-BA09aCvZ.js} +1 -1
- package/dist/index.js +125 -113
- package/dist/{infoDiagram-5YYISTIA-Bde_w9T1.js → infoDiagram-5YYISTIA-DpC1Zthd.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-x5M1KR0l.js → ishikawaDiagram-YF4QCWOH-CMEt_f-x.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-CIDQP8Zm.js → journeyDiagram-JHISSGLW-C0Qw169C.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-CKgO7sG8.js → kanban-definition-UN3LZRKU-caROmSUy.js} +2 -2
- package/dist/{layout-BZYprqYR.js → layout-CH65__O4.js} +2 -2
- package/dist/{linear-ClSH2F_v.js → linear-B1VXpcsy.js} +1 -1
- package/dist/{mermaid.core-CcRV6K2R.js → mermaid.core-Cbmwvfvk.js} +35 -35
- package/dist/{mindmap-definition-RKZ34NQL-s3h6uszV.js → mindmap-definition-RKZ34NQL-DpTR5ilS.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-CgiazyWv.js → pieDiagram-4H26LBE5-Cb_KrmWC.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-DCPVgHoW.js → quadrantDiagram-W4KKPZXB-B5_NswmK.js} +2 -2
- package/dist/record.js +77 -72
- package/dist/{requirementDiagram-4Y6WPE33-DE6F9oSB.js → requirementDiagram-4Y6WPE33-OFwfat5D.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-DZZoFFr-.js → sankeyDiagram-5OEKKPKP-BaawdZEE.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-DaYEOl60.js → sequenceDiagram-3UESZ5HK-DLv8X8ef.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-BmgpHJlH.js → stateDiagram-AJRCARHV-B6F3wrsd.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-D49CHQD6.js → stateDiagram-v2-BHNVJYJU-BcNEoshv.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DdVLoCkC.js → timeline-definition-PNZ67QCA-CvdHJ4eQ.js} +2 -2
- package/dist/useCodeBlockRendering-D2viVPtA.js +3158 -0
- package/dist/useFieldRendering-Co4DOOvL.js +1120 -0
- package/dist/useVarHelpers-Du2obGza.js +3474 -0
- package/dist/validation-oyqyD7Jp.js +5601 -0
- package/dist/{vennDiagram-CIIHVFJN-CCcMKcd7.js → vennDiagram-CIIHVFJN-U0GlQDjX.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-R4UGgGWY.js → wardleyDiagram-YWT4CUSO-CzF_KMcn.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DyFhCubk.js → xychartDiagram-2RQKCTM6-Cljki2Vk.js} +2 -2
- package/package.json +6 -4
- package/src/__tests__/collector-field.test.ts +269 -0
- package/src/__tests__/record-search-render.test.ts +1 -0
- package/src/__tests__/record-validation.test.ts +378 -0
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +26 -0
- package/src/__tests__/var-field-render.test.ts +64 -2
- package/src/components/AimdCollectorField.vue +233 -0
- package/src/components/AimdEntityRefField.vue +314 -0
- package/src/components/AimdRecorder.vue +285 -7
- package/src/components/AimdRecorderEditor.vue +51 -1
- package/src/components/AimdRecorderWysiwygFieldHost.vue +10 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +166 -4
- package/src/components/AimdVarField.vue +39 -2
- package/src/components/AimdVarTableField.vue +38 -21
- package/src/components/index.ts +4 -0
- package/src/components/recorderMilkdownPlugin.ts +16 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +32 -0
- package/src/composables/index.ts +12 -0
- package/src/composables/useCollectors.ts +399 -0
- package/src/composables/useVarHelpers.ts +130 -2
- package/src/index.ts +32 -2
- package/src/locales.ts +140 -2
- package/src/record/index.ts +14 -0
- package/src/record/validation.ts +772 -0
- package/src/styles/collector-field.css +281 -0
- package/src/styles/recorder-surface.css +163 -0
- package/src/styles/recorder.css +33 -0
- package/src/types.ts +168 -1
- package/dist/index-Dkrf2LJl.js +0 -1308
- package/dist/useCodeBlockRendering-CCuoP52e.js +0 -6103
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
.aimd-rec-collector {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: min(100%, 680px);
|
|
5
|
+
min-width: min(320px, 100%);
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
border: 1px solid var(--aimd-border-color, #90caf9);
|
|
10
|
+
border-radius: 6px;
|
|
11
|
+
background: #fff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.aimd-rec-collector__header {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: stretch;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
min-height: 30px;
|
|
19
|
+
border-bottom: 1px solid var(--aimd-border-color, #90caf9);
|
|
20
|
+
background: var(--aimd-var-bg, #e3f2fd);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.aimd-rec-collector__header > .aimd-field__scope {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex: 0 0 auto;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: 4px 8px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
color: #1565c0;
|
|
31
|
+
background: #bbdefb;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.aimd-rec-collector__identity {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
min-width: 0;
|
|
38
|
+
align-items: baseline;
|
|
39
|
+
gap: 6px;
|
|
40
|
+
padding: 4px 8px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.aimd-rec-collector__title,
|
|
44
|
+
.aimd-rec-collector__key {
|
|
45
|
+
overflow-wrap: anywhere;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.aimd-rec-collector__title {
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
color: #1565c0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.aimd-rec-collector__key,
|
|
54
|
+
.aimd-rec-collector__source,
|
|
55
|
+
.aimd-rec-collector__meta {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #64748b;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.aimd-rec-collector__source {
|
|
61
|
+
align-self: center;
|
|
62
|
+
max-width: 180px;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
padding: 2px 6px;
|
|
65
|
+
text-overflow: ellipsis;
|
|
66
|
+
white-space: nowrap;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.aimd-rec-collector__status {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
flex: 0 0 auto;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: 5px;
|
|
74
|
+
padding: 4px 8px;
|
|
75
|
+
border-left: 1px solid rgba(25, 118, 210, 0.18);
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
color: #475569;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.aimd-rec-collector__status-dot {
|
|
82
|
+
width: 7px;
|
|
83
|
+
height: 7px;
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
background: #94a3b8;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.aimd-rec-collector__status--connecting .aimd-rec-collector__status-dot,
|
|
89
|
+
.aimd-rec-collector__status--waiting_for_permission .aimd-rec-collector__status-dot,
|
|
90
|
+
.aimd-rec-collector__status--stopping .aimd-rec-collector__status-dot {
|
|
91
|
+
background: #f59e0b;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.aimd-rec-collector__status--collecting .aimd-rec-collector__status-dot {
|
|
95
|
+
background: #16a34a;
|
|
96
|
+
box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.aimd-rec-collector__status--error .aimd-rec-collector__status-dot,
|
|
100
|
+
.aimd-rec-collector__status--unsupported .aimd-rec-collector__status-dot {
|
|
101
|
+
background: #dc2626;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.aimd-rec-collector__body {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
align-items: center;
|
|
108
|
+
gap: 8px 12px;
|
|
109
|
+
min-height: 42px;
|
|
110
|
+
padding: 7px 8px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.aimd-rec-collector__reading {
|
|
114
|
+
display: inline-flex;
|
|
115
|
+
flex: 1 1 140px;
|
|
116
|
+
min-width: 0;
|
|
117
|
+
align-items: baseline;
|
|
118
|
+
gap: 5px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.aimd-rec-collector__value {
|
|
122
|
+
min-width: 0;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
color: #1e293b;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.aimd-rec-collector__unit,
|
|
132
|
+
.aimd-rec-collector__empty {
|
|
133
|
+
font-size: 13px;
|
|
134
|
+
color: #64748b;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.aimd-rec-collector__meta {
|
|
138
|
+
display: inline-flex;
|
|
139
|
+
flex: 0 1 auto;
|
|
140
|
+
flex-wrap: wrap;
|
|
141
|
+
gap: 4px 10px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.aimd-rec-collector__actions {
|
|
145
|
+
display: inline-flex;
|
|
146
|
+
flex: 0 0 auto;
|
|
147
|
+
gap: 6px;
|
|
148
|
+
margin-left: auto;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.aimd-rec-collector__button {
|
|
152
|
+
min-height: 30px;
|
|
153
|
+
padding: 4px 10px;
|
|
154
|
+
border: 1px solid #cbd5e1;
|
|
155
|
+
border-radius: 5px;
|
|
156
|
+
color: #334155;
|
|
157
|
+
background: #fff;
|
|
158
|
+
font: inherit;
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
font-weight: 600;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.aimd-rec-collector__button:hover:not(:disabled) {
|
|
165
|
+
border-color: #60a5fa;
|
|
166
|
+
background: #eff6ff;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.aimd-rec-collector__button:focus-visible,
|
|
170
|
+
.aimd-rec-collector__manual-value:focus,
|
|
171
|
+
.aimd-rec-collector__manual-reason:focus {
|
|
172
|
+
outline: 2px solid #60a5fa;
|
|
173
|
+
outline-offset: 1px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.aimd-rec-collector__button:disabled {
|
|
177
|
+
cursor: not-allowed;
|
|
178
|
+
opacity: 0.5;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.aimd-rec-collector__button--primary {
|
|
182
|
+
border-color: #1976d2;
|
|
183
|
+
color: #fff;
|
|
184
|
+
background: #1976d2;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.aimd-rec-collector__button--primary:hover:not(:disabled) {
|
|
188
|
+
border-color: #1565c0;
|
|
189
|
+
background: #1565c0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.aimd-rec-collector__button--danger {
|
|
193
|
+
border-color: #ef4444;
|
|
194
|
+
color: #b91c1c;
|
|
195
|
+
background: #fff;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.aimd-rec-collector__message {
|
|
199
|
+
display: block;
|
|
200
|
+
padding: 0 8px 7px;
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
color: #b45309;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.aimd-rec-collector__message--error,
|
|
206
|
+
.aimd-rec-collector--error .aimd-rec-collector__message {
|
|
207
|
+
color: #b91c1c;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.aimd-rec-collector__manual {
|
|
211
|
+
display: grid;
|
|
212
|
+
grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.4fr) auto;
|
|
213
|
+
gap: 6px;
|
|
214
|
+
padding: 8px;
|
|
215
|
+
border-top: 1px solid #dbeafe;
|
|
216
|
+
background: #f8fafc;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.aimd-rec-collector__manual-value,
|
|
220
|
+
.aimd-rec-collector__manual-reason {
|
|
221
|
+
box-sizing: border-box;
|
|
222
|
+
min-width: 0;
|
|
223
|
+
min-height: 30px;
|
|
224
|
+
padding: 5px 8px;
|
|
225
|
+
border: 1px solid #cbd5e1;
|
|
226
|
+
border-radius: 5px;
|
|
227
|
+
color: #1e293b;
|
|
228
|
+
background: #fff;
|
|
229
|
+
font: inherit;
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
resize: vertical;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.aimd-rec-collector__manual > .aimd-rec-collector__message {
|
|
235
|
+
grid-column: 1 / -1;
|
|
236
|
+
padding: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@media (max-width: 640px) {
|
|
240
|
+
.aimd-rec-collector {
|
|
241
|
+
width: 100%;
|
|
242
|
+
min-width: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.aimd-rec-collector__header {
|
|
246
|
+
flex-wrap: wrap;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.aimd-rec-collector__identity {
|
|
250
|
+
flex-basis: calc(100% - 54px);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.aimd-rec-collector__source {
|
|
254
|
+
max-width: 55%;
|
|
255
|
+
margin-left: 8px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.aimd-rec-collector__status {
|
|
259
|
+
margin-left: auto;
|
|
260
|
+
border-left: 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.aimd-rec-collector__actions {
|
|
264
|
+
width: 100%;
|
|
265
|
+
margin-left: 0;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.aimd-rec-collector__actions > .aimd-rec-collector__button {
|
|
269
|
+
flex: 1 1 auto;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.aimd-rec-collector__manual {
|
|
273
|
+
grid-template-columns: 1fr;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@media (prefers-reduced-motion: reduce) {
|
|
278
|
+
.aimd-rec-collector__status-dot {
|
|
279
|
+
box-shadow: none;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -452,6 +452,11 @@
|
|
|
452
452
|
vertical-align: top;
|
|
453
453
|
box-sizing: border-box;
|
|
454
454
|
}
|
|
455
|
+
.aimd-protocol-recorder__content .aimd-rec-inline--var-stacked--entity-ref {
|
|
456
|
+
display: inline-flex;
|
|
457
|
+
width: min(100%, 520px);
|
|
458
|
+
max-width: 100%;
|
|
459
|
+
}
|
|
455
460
|
.aimd-protocol-recorder__content .aimd-rec-inline--var-stacked:focus-within {
|
|
456
461
|
border-color: var(--aimd-border-color-focus, #4181fd);
|
|
457
462
|
box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.14);
|
|
@@ -1037,6 +1042,164 @@
|
|
|
1037
1042
|
white-space: nowrap;
|
|
1038
1043
|
}
|
|
1039
1044
|
|
|
1045
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref {
|
|
1046
|
+
display: flex;
|
|
1047
|
+
flex-direction: column;
|
|
1048
|
+
gap: 6px;
|
|
1049
|
+
width: 100%;
|
|
1050
|
+
min-width: 0;
|
|
1051
|
+
padding: 8px;
|
|
1052
|
+
border-top: 1px solid var(--aimd-border-color, #90caf9);
|
|
1053
|
+
background: #fff;
|
|
1054
|
+
box-sizing: border-box;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__selected,
|
|
1058
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__options {
|
|
1059
|
+
display: flex;
|
|
1060
|
+
flex-wrap: wrap;
|
|
1061
|
+
gap: 6px;
|
|
1062
|
+
min-width: 0;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__chip {
|
|
1066
|
+
display: inline-flex;
|
|
1067
|
+
align-items: center;
|
|
1068
|
+
max-width: 100%;
|
|
1069
|
+
min-height: 28px;
|
|
1070
|
+
overflow: hidden;
|
|
1071
|
+
border: 1px solid #b7d7ff;
|
|
1072
|
+
border-radius: 7px;
|
|
1073
|
+
background: #eef6ff;
|
|
1074
|
+
color: #1f3656;
|
|
1075
|
+
font-size: 13px;
|
|
1076
|
+
font-weight: 600;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__entity {
|
|
1080
|
+
align-self: stretch;
|
|
1081
|
+
display: inline-flex;
|
|
1082
|
+
align-items: center;
|
|
1083
|
+
padding: 0 7px;
|
|
1084
|
+
border-right: 1px solid #c8dcf1;
|
|
1085
|
+
background: #d8ebff;
|
|
1086
|
+
color: #075ebf;
|
|
1087
|
+
font-size: 12px;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__label {
|
|
1091
|
+
min-width: 0;
|
|
1092
|
+
max-width: min(34ch, 52vw);
|
|
1093
|
+
overflow: hidden;
|
|
1094
|
+
padding: 0 8px;
|
|
1095
|
+
text-overflow: ellipsis;
|
|
1096
|
+
white-space: nowrap;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__id {
|
|
1100
|
+
overflow: hidden;
|
|
1101
|
+
max-width: 22ch;
|
|
1102
|
+
padding: 0 8px 0 0;
|
|
1103
|
+
color: #667085;
|
|
1104
|
+
font-size: 12px;
|
|
1105
|
+
font-weight: 500;
|
|
1106
|
+
text-overflow: ellipsis;
|
|
1107
|
+
white-space: nowrap;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__chip-remove {
|
|
1111
|
+
align-self: stretch;
|
|
1112
|
+
width: 28px;
|
|
1113
|
+
border: 0;
|
|
1114
|
+
border-left: 1px solid #c8dcf1;
|
|
1115
|
+
background: #f8fbff;
|
|
1116
|
+
color: #56657a;
|
|
1117
|
+
font-size: 18px;
|
|
1118
|
+
line-height: 1;
|
|
1119
|
+
cursor: pointer;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__search-row {
|
|
1123
|
+
display: flex;
|
|
1124
|
+
align-items: center;
|
|
1125
|
+
gap: 6px;
|
|
1126
|
+
min-width: 0;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__input {
|
|
1130
|
+
flex: 1 1 180px;
|
|
1131
|
+
min-width: 120px;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__action,
|
|
1135
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option {
|
|
1136
|
+
min-height: 30px;
|
|
1137
|
+
border: 1px solid #bfd0e5;
|
|
1138
|
+
border-radius: 7px;
|
|
1139
|
+
background: #f8fbff;
|
|
1140
|
+
color: #075ebf;
|
|
1141
|
+
font-size: 13px;
|
|
1142
|
+
font-weight: 700;
|
|
1143
|
+
cursor: pointer;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__action {
|
|
1147
|
+
flex: 0 0 auto;
|
|
1148
|
+
padding: 0 10px;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__action--secondary {
|
|
1152
|
+
color: #4b5f7a;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__hint,
|
|
1156
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__error {
|
|
1157
|
+
color: #667085;
|
|
1158
|
+
font-size: 12px;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__error {
|
|
1162
|
+
color: var(--rec-error);
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option {
|
|
1166
|
+
display: inline-flex;
|
|
1167
|
+
flex-direction: column;
|
|
1168
|
+
align-items: flex-start;
|
|
1169
|
+
max-width: min(100%, 260px);
|
|
1170
|
+
padding: 6px 9px;
|
|
1171
|
+
text-align: left;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option:hover:not(:disabled),
|
|
1175
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__action:hover:not(:disabled),
|
|
1176
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__chip-remove:hover:not(:disabled) {
|
|
1177
|
+
border-color: #76b9ff;
|
|
1178
|
+
background: #edf6ff;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option:disabled,
|
|
1182
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__action:disabled {
|
|
1183
|
+
cursor: not-allowed;
|
|
1184
|
+
opacity: 0.6;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option-label,
|
|
1188
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option-id,
|
|
1189
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option-description {
|
|
1190
|
+
max-width: 100%;
|
|
1191
|
+
overflow: hidden;
|
|
1192
|
+
text-overflow: ellipsis;
|
|
1193
|
+
white-space: nowrap;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option-id,
|
|
1197
|
+
.aimd-protocol-recorder__content .aimd-rec-entity-ref__option-description {
|
|
1198
|
+
color: #667085;
|
|
1199
|
+
font-size: 12px;
|
|
1200
|
+
font-weight: 500;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1040
1203
|
.aimd-protocol-recorder__content .aimd-rec-inline__file-control {
|
|
1041
1204
|
display: flex;
|
|
1042
1205
|
flex-direction: column;
|
package/src/styles/recorder.css
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
@import "@airalogy/aimd-renderer/styles";
|
|
8
8
|
@import "./recorder-surface.css";
|
|
9
|
+
@import "./collector-field.css";
|
|
9
10
|
|
|
10
11
|
/* Recorder-specific reference wrappers */
|
|
11
12
|
.aimd-ref--step .research-step__sequence {
|
|
@@ -609,3 +610,35 @@ td .field__wrapper--tagged {
|
|
|
609
610
|
.chain__description ul li {
|
|
610
611
|
margin-bottom: 12px !important;
|
|
611
612
|
}
|
|
613
|
+
.aimd-rec-field-host {
|
|
614
|
+
display: contents;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.aimd-rec-field-host--invalid {
|
|
618
|
+
display: inline-flex;
|
|
619
|
+
flex-direction: column;
|
|
620
|
+
align-items: flex-start;
|
|
621
|
+
max-width: 100%;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.aimd-rec-validation-message {
|
|
625
|
+
display: block;
|
|
626
|
+
margin-top: 0.25rem;
|
|
627
|
+
color: #d03050;
|
|
628
|
+
font-size: 0.75rem;
|
|
629
|
+
line-height: 1.35;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.aimd-rec-table-cell-field {
|
|
633
|
+
min-width: 0;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.aimd-rec-table-cell-field--invalid {
|
|
637
|
+
display: flex;
|
|
638
|
+
flex-direction: column;
|
|
639
|
+
align-items: stretch;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.aimd-rec-table-cell-field .aimd-rec-validation-message {
|
|
643
|
+
white-space: normal;
|
|
644
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { VNode } from "vue"
|
|
2
2
|
import type {
|
|
3
|
+
AimdCollectorField,
|
|
4
|
+
AimdConnectorField,
|
|
3
5
|
AimdCheckNode,
|
|
4
6
|
AimdQuizNode,
|
|
5
7
|
AimdStepNode,
|
|
@@ -112,7 +114,128 @@ export type AimdFileInfoResolver = (
|
|
|
112
114
|
context: AimdFileResolveContext,
|
|
113
115
|
) => AimdResolvedFileInfo | string | null | undefined | Promise<AimdResolvedFileInfo | string | null | undefined>
|
|
114
116
|
|
|
115
|
-
export
|
|
117
|
+
export interface AimdEntityRefValue {
|
|
118
|
+
entity: string
|
|
119
|
+
id: string
|
|
120
|
+
source?: string
|
|
121
|
+
label?: string
|
|
122
|
+
version?: string | number
|
|
123
|
+
snapshot?: Record<string, unknown>
|
|
124
|
+
[key: string]: unknown
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface AimdEntityRefOption extends AimdEntityRefValue {
|
|
128
|
+
description?: string
|
|
129
|
+
disabled?: boolean
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface AimdEntityResolveContext {
|
|
133
|
+
type: string
|
|
134
|
+
normalizedType: string
|
|
135
|
+
fieldKey: string
|
|
136
|
+
node: AimdVarNode
|
|
137
|
+
fieldMeta?: AimdFieldMeta
|
|
138
|
+
entity?: string
|
|
139
|
+
source?: string
|
|
140
|
+
query: string
|
|
141
|
+
multiple: boolean
|
|
142
|
+
record: AimdProtocolRecordData
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type AimdEntitySearchHandler = (
|
|
146
|
+
query: string,
|
|
147
|
+
context: AimdEntityResolveContext,
|
|
148
|
+
) => AimdEntityRefOption[] | Promise<AimdEntityRefOption[]>
|
|
149
|
+
|
|
150
|
+
export interface AimdEntityResolver {
|
|
151
|
+
search: AimdEntitySearchHandler
|
|
152
|
+
resolve?: (
|
|
153
|
+
id: string,
|
|
154
|
+
context: AimdEntityResolveContext,
|
|
155
|
+
) => AimdEntityRefOption | null | undefined | Promise<AimdEntityRefOption | null | undefined>
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type AimdEntityResolverEntry = AimdEntityResolver | AimdEntitySearchHandler
|
|
159
|
+
export type AimdEntityResolverMap = Record<string, AimdEntityResolverEntry>
|
|
160
|
+
|
|
161
|
+
export type AimdCollectorRuntimeStatus =
|
|
162
|
+
| "idle"
|
|
163
|
+
| "waiting_for_permission"
|
|
164
|
+
| "connecting"
|
|
165
|
+
| "collecting"
|
|
166
|
+
| "stopping"
|
|
167
|
+
| "completed"
|
|
168
|
+
| "error"
|
|
169
|
+
| "unsupported"
|
|
170
|
+
|
|
171
|
+
export interface AimdCollectorRuntimeState {
|
|
172
|
+
status: AimdCollectorRuntimeStatus
|
|
173
|
+
error?: string
|
|
174
|
+
lastObservedAt?: string
|
|
175
|
+
sampleCount: number
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface AimdCollectorObservationSource {
|
|
179
|
+
kind: "collector" | "manual"
|
|
180
|
+
collector: string
|
|
181
|
+
connector?: string
|
|
182
|
+
device_id?: string
|
|
183
|
+
reason?: string
|
|
184
|
+
actor_id?: string
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface AimdCollectorObservation<T = unknown> {
|
|
188
|
+
value: T
|
|
189
|
+
observed_at: string
|
|
190
|
+
received_at: string
|
|
191
|
+
source: AimdCollectorObservationSource
|
|
192
|
+
unit?: string
|
|
193
|
+
quality?: string
|
|
194
|
+
sequence?: number
|
|
195
|
+
metadata?: Record<string, unknown>
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Optional structured envelope returned by a Collector provider. */
|
|
199
|
+
export interface AimdCollectorObservationInput<T = unknown> {
|
|
200
|
+
value: T
|
|
201
|
+
observed_at?: string
|
|
202
|
+
unit?: string
|
|
203
|
+
quality?: string
|
|
204
|
+
sequence?: number
|
|
205
|
+
metadata?: Record<string, unknown>
|
|
206
|
+
device_id?: string
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface AimdCollectorProviderRequest {
|
|
210
|
+
connector: AimdConnectorField
|
|
211
|
+
collector: AimdCollectorField
|
|
212
|
+
fieldKey: string
|
|
213
|
+
record: AimdProtocolRecordData
|
|
214
|
+
signal: AbortSignal
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface AimdDataSourceProvider {
|
|
218
|
+
/** Read one sample. A raw scalar or an observation envelope may be returned. */
|
|
219
|
+
read: (request: AimdCollectorProviderRequest) => unknown | Promise<unknown>
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Providers are keyed by connector id from the Protocol's `connectors` block. */
|
|
223
|
+
export type AimdCollectorProviderMap = Record<string, AimdDataSourceProvider>
|
|
224
|
+
|
|
225
|
+
export interface AimdCollectorPermissionRequest {
|
|
226
|
+
connector: AimdConnectorField
|
|
227
|
+
collector: AimdCollectorField
|
|
228
|
+
fieldKey: string
|
|
229
|
+
record: AimdProtocolRecordData
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** `record` remembers approval for the current Recorder record; `once` applies to one start. */
|
|
233
|
+
export type AimdCollectorPermissionDecision = "once" | "record" | boolean
|
|
234
|
+
export type AimdCollectorPermissionHandler = (
|
|
235
|
+
request: AimdCollectorPermissionRequest,
|
|
236
|
+
) => AimdCollectorPermissionDecision | Promise<AimdCollectorPermissionDecision>
|
|
237
|
+
|
|
238
|
+
export type AimdVarInputKind = "text" | "number" | "checkbox" | "boolean-select" | "textarea" | "scalar-list" | "entity-ref" | "date" | "datetime" | "time" | "dna" | "code" | "file"
|
|
116
239
|
export type AimdStepDetailDisplay = "auto" | "always"
|
|
117
240
|
export type AimdChoiceOptionExplanationMode = "hidden" | "selected" | "submitted" | "graded"
|
|
118
241
|
export type AimdScaleGradeDisplayMode = "hidden" | "completed" | "submitted" | "graded"
|
|
@@ -146,6 +269,8 @@ export interface AimdFieldMeta {
|
|
|
146
269
|
disabled?: boolean
|
|
147
270
|
placeholder?: string
|
|
148
271
|
accept?: string // native file input accept string for file-like vars
|
|
272
|
+
entity?: string // entity namespace for EntityRef fields
|
|
273
|
+
source?: string // connector id/source for EntityRef fields
|
|
149
274
|
assigner?: { mode: AimdAssignerMode }
|
|
150
275
|
}
|
|
151
276
|
|
|
@@ -157,6 +282,45 @@ export interface AimdFieldState {
|
|
|
157
282
|
disabled?: boolean // dynamic disable
|
|
158
283
|
}
|
|
159
284
|
|
|
285
|
+
export type AimdRecorderValidationCode =
|
|
286
|
+
| "required"
|
|
287
|
+
| "pattern"
|
|
288
|
+
| "enum"
|
|
289
|
+
| "numeric"
|
|
290
|
+
| "type"
|
|
291
|
+
| "format"
|
|
292
|
+
| "schema"
|
|
293
|
+
|
|
294
|
+
export type AimdRecorderValidationTrigger = "change" | "blur" | "submit"
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Pydantic-compatible JSON Schema contract returned by Airalogy protocol
|
|
298
|
+
* parsing. Both raw engine keys (`vars`, `steps`, `checks`) and platform keys
|
|
299
|
+
* (`research_variable`, `research_step`, `research_check`) are accepted.
|
|
300
|
+
*/
|
|
301
|
+
export type AimdRecordValidationSchema = Record<string, unknown>
|
|
302
|
+
|
|
303
|
+
export interface AimdRecorderValidationIssue {
|
|
304
|
+
fieldKey: string
|
|
305
|
+
section: AimdRecorderFieldType
|
|
306
|
+
code: AimdRecorderValidationCode
|
|
307
|
+
message: string
|
|
308
|
+
value?: unknown
|
|
309
|
+
rowIndex?: number
|
|
310
|
+
column?: string
|
|
311
|
+
keyword?: string
|
|
312
|
+
instancePath?: string
|
|
313
|
+
schemaPath?: string
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export interface AimdRecorderValidationResult {
|
|
317
|
+
valid: boolean
|
|
318
|
+
issues: AimdRecorderValidationIssue[]
|
|
319
|
+
fieldState: Record<string, AimdFieldState>
|
|
320
|
+
/** Present for field-scoped validation; omitted when the whole record was validated. */
|
|
321
|
+
validatedFieldKeys?: string[]
|
|
322
|
+
}
|
|
323
|
+
|
|
160
324
|
export interface AimdAssignerDefinition {
|
|
161
325
|
mode?: string
|
|
162
326
|
dependent_fields?: unknown
|
|
@@ -223,6 +387,8 @@ export interface FieldEventPayload {
|
|
|
223
387
|
section: 'var' | 'step' | 'check' | 'quiz' | 'var_table'
|
|
224
388
|
fieldKey: string
|
|
225
389
|
value?: unknown
|
|
390
|
+
rowIndex?: number
|
|
391
|
+
column?: string
|
|
226
392
|
}
|
|
227
393
|
|
|
228
394
|
/** Table event payload */
|
|
@@ -280,6 +446,7 @@ export interface AimdTypePluginRenderContext extends AimdTypePluginValueContext
|
|
|
280
446
|
uploadFile?: AimdFileUploadHandler
|
|
281
447
|
resolveFile?: (src: string) => string | null
|
|
282
448
|
resolveFileInfo?: AimdFileInfoResolver
|
|
449
|
+
entityResolvers?: AimdEntityResolverMap
|
|
283
450
|
emitChange: (value: unknown) => void
|
|
284
451
|
emitBlur: () => void
|
|
285
452
|
}
|