@airalogy/aimd-recorder 1.17.0 → 1.19.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 +42 -10
- package/README.zh-CN.md +42 -10
- package/dist/AimdCodeField-BQUuM-EF.js +182 -0
- package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-TBKunqU_.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js} +3922 -3829
- package/dist/AimdMarkdownField-DmNX2g4j.js +254 -0
- package/dist/AimdMarkdownNoteField-B5ruzmwS.js +259 -0
- package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/arc-B-vsgEXF.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BwPNOtNH.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-CMUI4kKc.js +2425 -0
- package/dist/c4Diagram-AAUBKEIU-Cpmfsy_s.js +1577 -0
- package/dist/channel-DlMAXHQK.js +5 -0
- package/dist/chunk-2J33WTMH-DP9BS2ux.js +19 -0
- package/dist/chunk-4BX2VUAB-ncsOeLMb.js +8 -0
- package/dist/chunk-55IACEB6-C7wHk4B7.js +8 -0
- package/dist/chunk-727SXJPM-Caa5aVUO.js +1528 -0
- package/dist/chunk-AQP2D5EJ-CL8egKqD.js +1387 -0
- package/dist/chunk-FMBD7UC4-heVR6BSA.js +19 -0
- package/dist/chunk-ND2GUHAM-BYH-wC2J.js +68 -0
- package/dist/chunk-QZHKN3VN-Bx2K7vkq.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-BLLfLYy0.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-BLLfLYy0.js +16 -0
- package/dist/components.js +3776 -2247
- package/dist/composables.js +96 -70
- package/dist/cose-bilkent-S5V4N54A-E1YmM_xr.js +2609 -0
- package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
- package/dist/dagre-BM42HDAG-BsXpQirH.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-CamqbWlY.js +217 -0
- package/dist/diagram-5GNKFQAL-DZyRFcOC.js +123 -0
- package/dist/diagram-KO2AKTUF-CmkGcy7R.js +461 -0
- package/dist/diagram-LMA3HP47-IdDwQPZ-.js +142 -0
- package/dist/diagram-OG6HWLK6-t0LBcUIU.js +528 -0
- package/dist/erDiagram-TEJ5UH35-DJBY2iZG.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-DE4MzPPk.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-CmAc35Yw.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-DDQZ5flw.js +815 -0
- package/dist/graph-BsJ8-1Pq.js +1510 -0
- package/dist/index.js +110 -83
- package/dist/infoDiagram-5YYISTIA-DSZjFR5g.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-DCO9dx2L.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-b-PpuBqg.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-BjclDuJZ.js +724 -0
- package/dist/katex-DNob3HGn.js +11690 -0
- package/dist/layout-D4wqKu72.js +1703 -0
- package/dist/linear-Voc3BJib.js +259 -0
- package/dist/mermaid.core-Dt_VbeGP.js +15940 -0
- package/dist/mindmap-definition-RKZ34NQL-B3vrXRVY.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-DFpWxSxk.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-BYHcrGoB.js +1024 -0
- package/dist/record.js +1199 -0
- package/dist/requirementDiagram-4Y6WPE33-C-FgWrRz.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-IwN0Evji.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-_OnqhBO2.js +2891 -0
- package/dist/stateDiagram-AJRCARHV-BRLv0Zcw.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-BofX0AdS.js +16 -0
- package/dist/timeline-definition-PNZ67QCA-C-DpPLpw.js +1055 -0
- package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-DoTZaJTW.js} +1528 -1725
- package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
- package/dist/vennDiagram-CIIHVFJN-zTHQR9Oq.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-au5koizO.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-BNf12P8z.js +1342 -0
- package/package.json +13 -8
- package/src/__tests__/assigner-graph.test.ts +82 -0
- package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
- package/src/__tests__/markdown-field.test.ts +150 -1
- package/src/__tests__/markdown-note-field.test.ts +86 -3
- package/src/__tests__/recorder-assigner-control.test.ts +993 -0
- package/src/__tests__/recorder-editor.test.ts +17 -0
- package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
- package/src/__tests__/step-field.test.ts +47 -1
- package/src/__tests__/type-plugins.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +806 -1
- package/src/components/AimdAssignerGraph.vue +816 -0
- package/src/components/AimdCodeField.vue +24 -5
- package/src/components/AimdMarkdownField.vue +556 -11
- package/src/components/AimdMarkdownNoteField.vue +241 -30
- package/src/components/AimdRecorder.vue +1619 -99
- package/src/components/AimdRecorderEditor.vue +276 -8
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
- package/src/components/AimdStepCheckField.vue +82 -18
- package/src/components/AimdVarField.vue +694 -25
- package/src/components/AimdVarTableField.vue +325 -138
- package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
- package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
- package/src/components/index.ts +9 -1
- package/src/components/recorderMilkdownPlugin.ts +14 -0
- package/src/composables/__tests__/useRecordState.test.ts +86 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +175 -0
- package/src/composables/index.ts +28 -1
- package/src/composables/useAssignerRunner.ts +376 -0
- package/src/composables/useCodeBlockRendering.ts +51 -0
- package/src/composables/useFieldRendering.ts +32 -4
- package/src/composables/useMonacoAutoHeight.ts +127 -0
- package/src/composables/useRecordState.ts +22 -3
- package/src/composables/useVarHelpers.ts +237 -32
- package/src/index.ts +20 -1
- package/src/locales.ts +45 -0
- package/src/record/index.ts +120 -0
- package/src/styles/aimd.css +216 -1
- package/src/type-plugins.ts +7 -0
- package/src/type-utils.ts +1 -3
- package/src/types.ts +130 -2
- package/dist/AimdCodeField-DC3DPvgc.js +0 -172
- package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
- package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
package/src/styles/aimd.css
CHANGED
|
@@ -46,6 +46,200 @@
|
|
|
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
|
+
|
|
178
|
+
.aimd-critic {
|
|
179
|
+
border-radius: 4px;
|
|
180
|
+
padding: 0 0.14em;
|
|
181
|
+
box-decoration-break: clone;
|
|
182
|
+
-webkit-box-decoration-break: clone;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.aimd-critic--addition {
|
|
186
|
+
background: rgba(22, 163, 74, 0.13);
|
|
187
|
+
color: #166534;
|
|
188
|
+
text-decoration: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.aimd-critic--deletion {
|
|
192
|
+
background: rgba(220, 38, 38, 0.1);
|
|
193
|
+
color: #991b1b;
|
|
194
|
+
text-decoration-line: line-through;
|
|
195
|
+
text-decoration-thickness: 0.08em;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.aimd-critic--highlight {
|
|
199
|
+
background: rgba(250, 204, 21, 0.36);
|
|
200
|
+
color: inherit;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.aimd-critic--substitution {
|
|
204
|
+
background: rgba(99, 102, 241, 0.08);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.aimd-critic--substitution .aimd-critic {
|
|
208
|
+
margin-inline: 0.04em;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.aimd-critic__replacement-arrow {
|
|
212
|
+
color: #64748b;
|
|
213
|
+
font-size: 0.86em;
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.aimd-critic--comment {
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
align-items: baseline;
|
|
220
|
+
gap: 0.34em;
|
|
221
|
+
padding: 0.03em 0.44em;
|
|
222
|
+
border: 1px solid rgba(37, 99, 235, 0.22);
|
|
223
|
+
border-radius: 999px;
|
|
224
|
+
background: rgba(37, 99, 235, 0.09);
|
|
225
|
+
color: #1e3a8a;
|
|
226
|
+
font-size: 0.92em;
|
|
227
|
+
line-height: 1.5;
|
|
228
|
+
vertical-align: baseline;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.aimd-critic__comment-label {
|
|
232
|
+
color: #2563eb;
|
|
233
|
+
font-size: 0.78em;
|
|
234
|
+
font-weight: 700;
|
|
235
|
+
letter-spacing: 0.02em;
|
|
236
|
+
text-transform: uppercase;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.aimd-critic__comment-body {
|
|
240
|
+
color: inherit;
|
|
241
|
+
}
|
|
242
|
+
|
|
49
243
|
.aimd-field--var .aimd-field__type {
|
|
50
244
|
font-size: 12px;
|
|
51
245
|
color: #7b1fa2;
|
|
@@ -92,7 +286,7 @@
|
|
|
92
286
|
border-collapse: collapse;
|
|
93
287
|
font-size: 12px;
|
|
94
288
|
border-radius: 4px;
|
|
95
|
-
overflow:
|
|
289
|
+
overflow: visible;
|
|
96
290
|
}
|
|
97
291
|
|
|
98
292
|
.aimd-field--var-table .aimd-field__table-preview th,
|
|
@@ -103,11 +297,19 @@
|
|
|
103
297
|
}
|
|
104
298
|
|
|
105
299
|
.aimd-field--var-table .aimd-field__table-preview th {
|
|
300
|
+
position: relative;
|
|
301
|
+
overflow: visible;
|
|
106
302
|
background: #cfeed0;
|
|
107
303
|
font-weight: 600;
|
|
108
304
|
color: #2e7d32;
|
|
109
305
|
}
|
|
110
306
|
|
|
307
|
+
.aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:hover),
|
|
308
|
+
.aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus),
|
|
309
|
+
.aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus-within) {
|
|
310
|
+
z-index: 95;
|
|
311
|
+
}
|
|
312
|
+
|
|
111
313
|
.aimd-field--var-table .aimd-field__table-preview td {
|
|
112
314
|
color: #666;
|
|
113
315
|
font-style: italic;
|
|
@@ -508,6 +710,10 @@
|
|
|
508
710
|
min-height: 28px;
|
|
509
711
|
}
|
|
510
712
|
|
|
713
|
+
.aimd-field--no-style.aimd-field__label.aimd-field__label--has-metadata {
|
|
714
|
+
overflow: visible;
|
|
715
|
+
}
|
|
716
|
+
|
|
511
717
|
/* Default scope color for edit mode labels (var type - blue, matches preview) */
|
|
512
718
|
.aimd-field--no-style.aimd-field__label .aimd-field__scope {
|
|
513
719
|
border-radius: 6px 0 0 0;
|
|
@@ -530,6 +736,15 @@
|
|
|
530
736
|
align-items: center;
|
|
531
737
|
}
|
|
532
738
|
|
|
739
|
+
.aimd-field--no-style.aimd-field__label .aimd-field__name--with-metadata {
|
|
740
|
+
align-items: flex-start;
|
|
741
|
+
justify-content: center;
|
|
742
|
+
gap: 2px;
|
|
743
|
+
min-width: 0;
|
|
744
|
+
padding-top: 5px;
|
|
745
|
+
padding-bottom: 5px;
|
|
746
|
+
}
|
|
747
|
+
|
|
533
748
|
/* Edit mode label scope colors - step type (orange) */
|
|
534
749
|
.aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--step"]),
|
|
535
750
|
.aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--rns"]),
|
package/src/type-plugins.ts
CHANGED
|
@@ -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/type-utils.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -59,10 +59,66 @@ export interface AimdProtocolRecordData {
|
|
|
59
59
|
quiz: Record<string, unknown>
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export
|
|
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
|
-
|
|
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,67 @@ 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 type AimdAssignerGraphNodeType = "dependent_field" | "assigner" | "assigned_field"
|
|
167
|
+
|
|
168
|
+
export interface AimdAssignerGraphNode {
|
|
169
|
+
name: string
|
|
170
|
+
type: AimdAssignerGraphNodeType
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type AimdAssignerGraphEdge = [string, string]
|
|
174
|
+
|
|
175
|
+
export interface AimdAssignerGraphData {
|
|
176
|
+
nodes: AimdAssignerGraphNode[]
|
|
177
|
+
edges: AimdAssignerGraphEdge[]
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface AimdAssignerNodeSchemaInfo {
|
|
181
|
+
title?: string
|
|
182
|
+
type?: string
|
|
183
|
+
format?: string
|
|
184
|
+
description?: string
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface AimdAssignerGraphLabels {
|
|
188
|
+
zoomIn: string
|
|
189
|
+
zoomOut: string
|
|
190
|
+
fitView: string
|
|
191
|
+
fullscreen: string
|
|
192
|
+
close: string
|
|
193
|
+
showTitle: string
|
|
194
|
+
showName: string
|
|
195
|
+
dependentField: string
|
|
196
|
+
assigner: string
|
|
197
|
+
assignedField: string
|
|
198
|
+
empty: string
|
|
199
|
+
loading: string
|
|
200
|
+
fullscreenTitle: string
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface AimdServerAssignerRunnerRequest {
|
|
204
|
+
section: Exclude<AimdRecorderFieldType, "quiz">
|
|
205
|
+
fieldKey: string
|
|
206
|
+
assignedField: string
|
|
207
|
+
dependentData: Record<string, unknown>
|
|
208
|
+
record: AimdProtocolRecordData
|
|
209
|
+
assigner: AimdAssignerDefinition
|
|
210
|
+
signal?: AbortSignal
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export type AimdAssignerRunnerRequest = AimdServerAssignerRunnerRequest
|
|
214
|
+
|
|
215
|
+
export type AimdServerAssignerRunner = (
|
|
216
|
+
request: AimdServerAssignerRunnerRequest,
|
|
217
|
+
) => unknown | Promise<unknown>
|
|
218
|
+
|
|
219
|
+
export type AimdAssignerRunner = AimdServerAssignerRunner
|
|
220
|
+
|
|
100
221
|
/** Field event payload */
|
|
101
222
|
export interface FieldEventPayload {
|
|
102
223
|
section: 'var' | 'step' | 'check' | 'quiz' | 'var_table'
|
|
@@ -153,6 +274,12 @@ export interface AimdTypePluginRenderContext extends AimdTypePluginValueContext
|
|
|
153
274
|
extraClasses: string[]
|
|
154
275
|
placeholder?: string
|
|
155
276
|
fieldState?: AimdFieldState
|
|
277
|
+
assignerControl?: VNode
|
|
278
|
+
assignerStatus?: VNode
|
|
279
|
+
assignerError?: string
|
|
280
|
+
uploadFile?: AimdFileUploadHandler
|
|
281
|
+
resolveFile?: (src: string) => string | null
|
|
282
|
+
resolveFileInfo?: AimdFileInfoResolver
|
|
156
283
|
emitChange: (value: unknown) => void
|
|
157
284
|
emitBlur: () => void
|
|
158
285
|
}
|
|
@@ -161,6 +288,7 @@ export interface AimdTypePlugin {
|
|
|
161
288
|
type: string
|
|
162
289
|
aliases?: string[]
|
|
163
290
|
inputKind?: AimdVarInputKind
|
|
291
|
+
supportsInlineAssignerControl?: boolean
|
|
164
292
|
getInitialValue?: (context: AimdTypePluginInitContext) => unknown
|
|
165
293
|
normalizeValue?: (context: AimdTypePluginValueContext) => unknown
|
|
166
294
|
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
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, ref as m, watch as h, openBlock as v, createElementBlock as g, normalizeClass as k, createElementVNode as d, toDisplayString as c, unref as u, createVNode as w } from "vue";
|
|
2
|
-
import { g as V, _ as y } from "./AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js";
|
|
3
|
-
import "./useFieldRendering-xLajJhyA.js";
|
|
4
|
-
import "@airalogy/aimd-core";
|
|
5
|
-
import "@airalogy/aimd-renderer";
|
|
6
|
-
import { _ as x } from "./_commonjsHelpers-CZXJ37nu.js";
|
|
7
|
-
const R = { class: "aimd-field aimd-field--no-style aimd-field__label" }, B = { class: "aimd-field__scope aimd-field__scope--var" }, F = { class: "aimd-field__id" }, I = { class: "aimd-markdown-field__editor-shell" }, M = /* @__PURE__ */ p({
|
|
8
|
-
__name: "AimdMarkdownField",
|
|
9
|
-
props: {
|
|
10
|
-
modelValue: { default: void 0 },
|
|
11
|
-
varId: {},
|
|
12
|
-
disabled: { type: Boolean, default: !1 },
|
|
13
|
-
locale: { default: void 0 },
|
|
14
|
-
messages: {}
|
|
15
|
-
},
|
|
16
|
-
emits: ["update:modelValue", "blur"],
|
|
17
|
-
setup(a, { emit: f }) {
|
|
18
|
-
const i = a, t = f;
|
|
19
|
-
function n(e) {
|
|
20
|
-
return typeof e == "string" ? e : e == null ? "" : String(e);
|
|
21
|
-
}
|
|
22
|
-
const r = m(null), o = m(n(i.modelValue));
|
|
23
|
-
function b(e) {
|
|
24
|
-
e !== o.value && (o.value = e, t("update:modelValue", e));
|
|
25
|
-
}
|
|
26
|
-
function _(e) {
|
|
27
|
-
const l = r.value, s = e.relatedTarget;
|
|
28
|
-
!l || s && l.contains(s) || t("blur");
|
|
29
|
-
}
|
|
30
|
-
return h(() => i.modelValue, (e) => {
|
|
31
|
-
const l = n(e);
|
|
32
|
-
l !== o.value && (o.value = l);
|
|
33
|
-
}), (e, l) => (v(), g("div", {
|
|
34
|
-
ref_key: "fieldRootRef",
|
|
35
|
-
ref: r,
|
|
36
|
-
class: k(["aimd-rec-inline aimd-rec-inline--var-stacked aimd-rec-inline--var-markdown aimd-field-wrapper aimd-markdown-field", { "aimd-markdown-field--disabled": a.disabled }]),
|
|
37
|
-
onFocusout: _
|
|
38
|
-
}, [
|
|
39
|
-
d("span", R, [
|
|
40
|
-
d("span", B, c(u(V)("var", a.messages)), 1),
|
|
41
|
-
d("span", F, c(a.varId), 1)
|
|
42
|
-
]),
|
|
43
|
-
d("div", I, [
|
|
44
|
-
w(u(y), {
|
|
45
|
-
class: "aimd-markdown-field__editor",
|
|
46
|
-
"model-value": o.value,
|
|
47
|
-
locale: a.locale,
|
|
48
|
-
mode: "source",
|
|
49
|
-
theme: "aimd-light",
|
|
50
|
-
"show-top-bar": !0,
|
|
51
|
-
"show-toolbar": !a.disabled,
|
|
52
|
-
"show-md-toolbar": !0,
|
|
53
|
-
"show-aimd-toolbar": !0,
|
|
54
|
-
"enable-block-handle": !a.disabled,
|
|
55
|
-
"keep-inactive-editors-mounted": !1,
|
|
56
|
-
"min-height": 360,
|
|
57
|
-
readonly: a.disabled,
|
|
58
|
-
"monaco-options": { minimap: { enabled: !1 } },
|
|
59
|
-
"onUpdate:modelValue": b
|
|
60
|
-
}, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "readonly"])
|
|
61
|
-
])
|
|
62
|
-
], 34));
|
|
63
|
-
}
|
|
64
|
-
}), E = /* @__PURE__ */ x(M, [["__scopeId", "data-v-7fbda7f4"]]);
|
|
65
|
-
export {
|
|
66
|
-
E as default
|
|
67
|
-
};
|