@airalogy/aimd-recorder 1.18.0 → 1.19.1
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 +44 -0
- package/README.zh-CN.md +44 -0
- package/dist/{AimdDnaSequenceField-KZU2Zj3E.js → AimdDnaSequenceField-TBKunqU_.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js → AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js} +1 -1
- package/dist/{AimdMarkdownField-t2d8uOeU.js → AimdMarkdownField-DmNX2g4j.js} +19 -19
- package/dist/{AimdMarkdownNoteField-_h1oZSwH.js → AimdMarkdownNoteField-B5ruzmwS.js} +19 -19
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-DS_ocYoe.js → arc-B-vsgEXF.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-Dq2W8_tb.js → architectureDiagram-3BPJPVTR-BwPNOtNH.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-B4hnSAF_.js → blockDiagram-GPEHLZMM-CMUI4kKc.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-CbffqNLY.js → c4Diagram-AAUBKEIU-Cpmfsy_s.js} +2 -2
- package/dist/{channel-CtXnYrAk.js → channel-DlMAXHQK.js} +1 -1
- package/dist/{chunk-2J33WTMH-CROScrt5.js → chunk-2J33WTMH-DP9BS2ux.js} +1 -1
- package/dist/{chunk-4BX2VUAB-DTmsQu5_.js → chunk-4BX2VUAB-ncsOeLMb.js} +1 -1
- package/dist/{chunk-55IACEB6-B5wDJzeX.js → chunk-55IACEB6-C7wHk4B7.js} +1 -1
- package/dist/{chunk-727SXJPM-CfyltY6o.js → chunk-727SXJPM-Caa5aVUO.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-B8274EYy.js → chunk-AQP2D5EJ-CL8egKqD.js} +3 -3
- package/dist/{chunk-FMBD7UC4-CT_FK-SH.js → chunk-FMBD7UC4-heVR6BSA.js} +1 -1
- package/dist/{chunk-ND2GUHAM-g9GulPi-.js → chunk-ND2GUHAM-BYH-wC2J.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Di5HEktz.js → chunk-QZHKN3VN-Bx2K7vkq.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-BVUr246k.js → classDiagram-4FO5ZUOK-BLLfLYy0.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-BVUr246k.js → classDiagram-v2-Q7XG4LA2-BLLfLYy0.js} +2 -2
- package/dist/components.js +2821 -2320
- package/dist/composables.js +95 -93
- package/dist/{cose-bilkent-S5V4N54A-GJ4IOO6v.js → cose-bilkent-S5V4N54A-E1YmM_xr.js} +1 -1
- package/dist/{dagre-BM42HDAG-oL7Br44o.js → dagre-BM42HDAG-BsXpQirH.js} +3 -3
- package/dist/{diagram-2AECGRRQ-DtoCG_N4.js → diagram-2AECGRRQ-CamqbWlY.js} +2 -2
- package/dist/{diagram-5GNKFQAL-f8QNdS7L.js → diagram-5GNKFQAL-DZyRFcOC.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CsJOW_AX.js → diagram-KO2AKTUF-CmkGcy7R.js} +2 -2
- package/dist/{diagram-LMA3HP47-xmEKNZ7y.js → diagram-LMA3HP47-IdDwQPZ-.js} +2 -2
- package/dist/{diagram-OG6HWLK6-unpC7vo8.js → diagram-OG6HWLK6-t0LBcUIU.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-BGzFnCJD.js → erDiagram-TEJ5UH35-DJBY2iZG.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-LBFhDnOs.js → flowDiagram-I6XJVG4X-DE4MzPPk.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-CFBc-jPD.js → ganttDiagram-6RSMTGT7-CmAc35Yw.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-BLduh-Rb.js → gitGraphDiagram-PVQCEYII-DDQZ5flw.js} +3 -3
- package/dist/{graph-DdlKE625.js → graph-BsJ8-1Pq.js} +1 -1
- package/dist/index.js +112 -109
- package/dist/{infoDiagram-5YYISTIA-CLQQI6zM.js → infoDiagram-5YYISTIA-DSZjFR5g.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-CStdYBmW.js → ishikawaDiagram-YF4QCWOH-DCO9dx2L.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-B6mRTzoE.js → journeyDiagram-JHISSGLW-b-PpuBqg.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-C-vnN5v4.js → kanban-definition-UN3LZRKU-BjclDuJZ.js} +2 -2
- package/dist/{layout-DDt0fz-M.js → layout-D4wqKu72.js} +2 -2
- package/dist/{linear-C-IAFdOt.js → linear-Voc3BJib.js} +1 -1
- package/dist/{mermaid.core-CuZ3nINf.js → mermaid.core-Dt_VbeGP.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-TSZ1Vb3z.js → mindmap-definition-RKZ34NQL-B3vrXRVY.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-DYok-1-k.js → pieDiagram-4H26LBE5-DFpWxSxk.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-Cg856sbH.js → quadrantDiagram-W4KKPZXB-BYHcrGoB.js} +2 -2
- package/dist/record.js +1199 -0
- package/dist/{requirementDiagram-4Y6WPE33-BN9fGdlJ.js → requirementDiagram-4Y6WPE33-C-FgWrRz.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-CDqTgonY.js → sankeyDiagram-5OEKKPKP-IwN0Evji.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-Chjrc0-W.js → sequenceDiagram-3UESZ5HK-_OnqhBO2.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-DRyLHrdr.js → stateDiagram-AJRCARHV-BRLv0Zcw.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-CZTIDHid.js → stateDiagram-v2-BHNVJYJU-BofX0AdS.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-Bc3D9AAG.js → timeline-definition-PNZ67QCA-C-DpPLpw.js} +2 -2
- package/dist/{useCodeBlockRendering-qA6gj4vz.js → useCodeBlockRendering-DoTZaJTW.js} +2170 -3148
- package/dist/{vennDiagram-CIIHVFJN-CYAul48m.js → vennDiagram-CIIHVFJN-zTHQR9Oq.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-B7Tg0MG9.js → wardleyDiagram-YWT4CUSO-au5koizO.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-xWYVEqth.js → xychartDiagram-2RQKCTM6-BNf12P8z.js} +2 -2
- package/package.json +7 -3
- package/src/__tests__/assigner-graph.test.ts +82 -0
- package/src/__tests__/recorder-assigner-control.test.ts +150 -1
- package/src/__tests__/recorder-editor.test.ts +34 -1
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +3 -0
- package/src/__tests__/var-field-render.test.ts +87 -0
- package/src/components/AimdAssignerGraph.vue +816 -0
- package/src/components/AimdMarkdownField.vue +8 -0
- package/src/components/AimdRecorder.vue +137 -42
- package/src/components/AimdRecorderEditor.vue +116 -10
- package/src/components/AimdRecorderWysiwygFieldHost.vue +4 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +19 -1
- package/src/components/AimdVarTableField.vue +42 -28
- package/src/components/index.ts +9 -1
- package/src/components/recorderMilkdownPlugin.ts +7 -1
- package/src/composables/__tests__/useVarHelpers.test.ts +42 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useVarHelpers.ts +87 -250
- package/src/index.ts +7 -1
- package/src/record/index.ts +120 -0
- package/src/styles/aimd.css +230 -3
- package/src/type-utils.ts +1 -3
- package/src/types.ts +37 -0
|
@@ -437,6 +437,14 @@ watch(
|
|
|
437
437
|
font-size: 16px;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
+
.aimd-markdown-field__assigner-state :deep(.aimd-rec-assigner-field__status--done) {
|
|
441
|
+
color: #16a34a;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.aimd-markdown-field__assigner-state :deep(.aimd-rec-assigner-field__status--error) {
|
|
445
|
+
color: #dc2626;
|
|
446
|
+
}
|
|
447
|
+
|
|
440
448
|
.aimd-markdown-field__assigner-error {
|
|
441
449
|
margin: 0;
|
|
442
450
|
border-top: 1px solid #fecaca;
|
|
@@ -324,6 +324,7 @@ interface ResolvedAssignerControl {
|
|
|
324
324
|
payloadFieldKey: string
|
|
325
325
|
clientAssigner?: AimdClientAssignerField
|
|
326
326
|
serverAssigner?: AimdResolvedAssigner
|
|
327
|
+
serverRunKey?: string
|
|
327
328
|
state?: AimdFieldState
|
|
328
329
|
loading: boolean
|
|
329
330
|
disabled: boolean
|
|
@@ -347,8 +348,15 @@ function resolveAssignerControl(
|
|
|
347
348
|
}
|
|
348
349
|
|
|
349
350
|
const state = effectiveFieldState.value[fieldKey]
|
|
350
|
-
const
|
|
351
|
-
const
|
|
351
|
+
const serverRunKey = serverAssigner ? getServerAssignerRunKey(serverAssigner) : undefined
|
|
352
|
+
const serverGroupLoading = Boolean(serverRunKey && serverAssignerAbortControllers.has(serverRunKey))
|
|
353
|
+
const loading = state?.loading === true || serverGroupLoading
|
|
354
|
+
const canCancelServerRun = Boolean(
|
|
355
|
+
serverAssigner
|
|
356
|
+
&& resolvedRunServerAssigner.value
|
|
357
|
+
&& serverRunKey
|
|
358
|
+
&& serverAssignerAbortControllers.has(serverRunKey),
|
|
359
|
+
)
|
|
352
360
|
const disabled = (loading && !canCancelServerRun) || state?.disabled === true
|
|
353
361
|
const label = canCancelServerRun
|
|
354
362
|
? resolvedMessages.value.assigner.cancel
|
|
@@ -363,6 +371,7 @@ function resolveAssignerControl(
|
|
|
363
371
|
payloadFieldKey,
|
|
364
372
|
clientAssigner,
|
|
365
373
|
serverAssigner,
|
|
374
|
+
serverRunKey,
|
|
366
375
|
state,
|
|
367
376
|
loading,
|
|
368
377
|
disabled,
|
|
@@ -382,7 +391,7 @@ function renderAssignerButton(control: ResolvedAssignerControl, value: unknown):
|
|
|
382
391
|
event.stopPropagation()
|
|
383
392
|
if (control.loading) {
|
|
384
393
|
if (control.serverAssigner && resolvedRunServerAssigner.value) {
|
|
385
|
-
cancelServerAssigner(control.fieldKey)
|
|
394
|
+
cancelServerAssigner(control.serverRunKey ?? control.fieldKey)
|
|
386
395
|
} else {
|
|
387
396
|
emit("assigner-cancel", {
|
|
388
397
|
section: control.fieldType,
|
|
@@ -753,6 +762,10 @@ function getAutoServerAssignerGroupKey(assigner: AimdResolvedAssigner): string {
|
|
|
753
762
|
})
|
|
754
763
|
}
|
|
755
764
|
|
|
765
|
+
function getServerAssignerRunKey(assigner: AimdResolvedAssigner): string {
|
|
766
|
+
return getAutoServerAssignerGroupKey(assigner)
|
|
767
|
+
}
|
|
768
|
+
|
|
756
769
|
function scheduleAutoServerAssigners() {
|
|
757
770
|
if (autoServerAssignerScheduled) {
|
|
758
771
|
return
|
|
@@ -774,15 +787,15 @@ async function runAutoServerAssigners() {
|
|
|
774
787
|
if (!isAutoServerAssignerMode(assigner.mode)) {
|
|
775
788
|
continue
|
|
776
789
|
}
|
|
777
|
-
if (serverAssignerAbortControllers.has(assigner.fieldKey)) {
|
|
778
|
-
continue
|
|
779
|
-
}
|
|
780
790
|
|
|
781
|
-
const groupKey =
|
|
791
|
+
const groupKey = getServerAssignerRunKey(assigner)
|
|
782
792
|
if (visitedGroups.has(groupKey)) {
|
|
783
793
|
continue
|
|
784
794
|
}
|
|
785
795
|
visitedGroups.add(groupKey)
|
|
796
|
+
if (serverAssignerAbortControllers.has(groupKey)) {
|
|
797
|
+
continue
|
|
798
|
+
}
|
|
786
799
|
|
|
787
800
|
if (!shouldRunAutoFirstServerAssigner(assigner)) {
|
|
788
801
|
continue
|
|
@@ -840,6 +853,21 @@ function getDeclaredServerAssignerStateKeys(assigner: AimdResolvedAssigner, fall
|
|
|
840
853
|
return [...stateKeys]
|
|
841
854
|
}
|
|
842
855
|
|
|
856
|
+
function getServerAssignerGroupStateKeys(assigner: AimdResolvedAssigner, fallbackFieldKey: string): string[] {
|
|
857
|
+
const groupKey = getServerAssignerRunKey(assigner)
|
|
858
|
+
const stateKeys = new Set<string>(getDeclaredServerAssignerStateKeys(assigner, fallbackFieldKey))
|
|
859
|
+
for (const entry of protocolAssignerEntries.value) {
|
|
860
|
+
if (getServerAssignerRunKey(entry) !== groupKey) {
|
|
861
|
+
continue
|
|
862
|
+
}
|
|
863
|
+
stateKeys.add(entry.fieldKey)
|
|
864
|
+
for (const stateKey of getDeclaredServerAssignerStateKeys(entry, entry.fieldKey)) {
|
|
865
|
+
stateKeys.add(stateKey)
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return [...stateKeys]
|
|
869
|
+
}
|
|
870
|
+
|
|
843
871
|
function getReturnedServerAssignerStateKeys(
|
|
844
872
|
assignedFields: Record<string, unknown>,
|
|
845
873
|
fallbackFieldKey: string,
|
|
@@ -862,10 +890,12 @@ async function runServerAssigner(
|
|
|
862
890
|
const runner = resolvedRunServerAssigner.value
|
|
863
891
|
if (!runner) return
|
|
864
892
|
|
|
865
|
-
|
|
893
|
+
const runKey = getServerAssignerRunKey(assigner)
|
|
894
|
+
const groupStateKeys = getServerAssignerGroupStateKeys(assigner, fieldKey)
|
|
895
|
+
serverAssignerAbortControllers.get(runKey)?.abort()
|
|
866
896
|
const abortController = new AbortController()
|
|
867
|
-
serverAssignerAbortControllers.set(
|
|
868
|
-
setInternalAssignerStates(
|
|
897
|
+
serverAssignerAbortControllers.set(runKey, abortController)
|
|
898
|
+
setInternalAssignerStates(groupStateKeys, { loading: true, error: undefined })
|
|
869
899
|
|
|
870
900
|
try {
|
|
871
901
|
const result = await runner({
|
|
@@ -883,27 +913,28 @@ async function runServerAssigner(
|
|
|
883
913
|
}
|
|
884
914
|
const assignedFields = extractAimdAssignedFields(result)
|
|
885
915
|
const returnedStateKeys = getReturnedServerAssignerStateKeys(assignedFields, fieldKey)
|
|
916
|
+
const completedStateKeys = [...new Set([...groupStateKeys, ...returnedStateKeys])]
|
|
886
917
|
if (Object.keys(assignedFields).length > 0) {
|
|
887
918
|
applyAimdAssignedFieldsToRecord(localRecord, assignedFields)
|
|
888
919
|
markRecordChanged({ rebuild: true, runClientAssigners: true })
|
|
889
920
|
} else {
|
|
890
921
|
emitRecordUpdate()
|
|
891
922
|
}
|
|
892
|
-
if (serverAssignerAbortControllers.get(
|
|
893
|
-
setInternalAssignerStates(
|
|
923
|
+
if (serverAssignerAbortControllers.get(runKey) === abortController) {
|
|
924
|
+
setInternalAssignerStates(completedStateKeys, { loading: false, error: undefined })
|
|
894
925
|
}
|
|
895
926
|
} catch (error) {
|
|
896
927
|
if (abortController.signal.aborted) {
|
|
897
|
-
if (serverAssignerAbortControllers.get(
|
|
898
|
-
setInternalAssignerStates(
|
|
928
|
+
if (serverAssignerAbortControllers.get(runKey) === abortController) {
|
|
929
|
+
setInternalAssignerStates(groupStateKeys, { loading: false, error: undefined })
|
|
899
930
|
}
|
|
900
931
|
return
|
|
901
932
|
}
|
|
902
933
|
const message = error instanceof Error ? error.message : String(error)
|
|
903
|
-
setInternalAssignerStates(
|
|
934
|
+
setInternalAssignerStates(groupStateKeys, { loading: false, error: message })
|
|
904
935
|
} finally {
|
|
905
|
-
if (serverAssignerAbortControllers.get(
|
|
906
|
-
serverAssignerAbortControllers.delete(
|
|
936
|
+
if (serverAssignerAbortControllers.get(runKey) === abortController) {
|
|
937
|
+
serverAssignerAbortControllers.delete(runKey)
|
|
907
938
|
}
|
|
908
939
|
}
|
|
909
940
|
}
|
|
@@ -1516,6 +1547,7 @@ async function rebuildInlineNodes(
|
|
|
1516
1547
|
value: localRecord as Record<string, Record<string, unknown>>,
|
|
1517
1548
|
},
|
|
1518
1549
|
blockVarTypes: ["AiralogyMarkdown"],
|
|
1550
|
+
resolveAssetUrl: props.resolveFile,
|
|
1519
1551
|
elementRenderers: {
|
|
1520
1552
|
pre: codeBlockPreRenderer,
|
|
1521
1553
|
},
|
|
@@ -3115,7 +3147,7 @@ defineExpose({
|
|
|
3115
3147
|
}
|
|
3116
3148
|
|
|
3117
3149
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__drag-col) {
|
|
3118
|
-
width:
|
|
3150
|
+
width: 58px;
|
|
3119
3151
|
}
|
|
3120
3152
|
|
|
3121
3153
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__action-col) {
|
|
@@ -3124,13 +3156,19 @@ defineExpose({
|
|
|
3124
3156
|
|
|
3125
3157
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__drag-head),
|
|
3126
3158
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__drag-cell) {
|
|
3127
|
-
width:
|
|
3159
|
+
width: 50px;
|
|
3128
3160
|
text-align: center;
|
|
3129
3161
|
vertical-align: middle;
|
|
3130
3162
|
padding-left: 0;
|
|
3131
3163
|
padding-right: 0;
|
|
3132
3164
|
}
|
|
3133
3165
|
|
|
3166
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__row-head-label) {
|
|
3167
|
+
color: #94a3b8;
|
|
3168
|
+
font-size: 11px;
|
|
3169
|
+
font-weight: 700;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3134
3172
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__action-head),
|
|
3135
3173
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__action-cell) {
|
|
3136
3174
|
width: 40px;
|
|
@@ -3326,6 +3364,32 @@ defineExpose({
|
|
|
3326
3364
|
transform: scale(0.92);
|
|
3327
3365
|
}
|
|
3328
3366
|
|
|
3367
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__row-control),
|
|
3368
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card__row-meta) {
|
|
3369
|
+
display: inline-flex;
|
|
3370
|
+
align-items: center;
|
|
3371
|
+
gap: 5px;
|
|
3372
|
+
min-width: 0;
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline-table__row-number) {
|
|
3376
|
+
display: inline-flex;
|
|
3377
|
+
align-items: center;
|
|
3378
|
+
justify-content: center;
|
|
3379
|
+
min-width: 16px;
|
|
3380
|
+
height: 16px;
|
|
3381
|
+
padding: 0 2px;
|
|
3382
|
+
border-radius: 0;
|
|
3383
|
+
background: transparent;
|
|
3384
|
+
color: #94a3b8;
|
|
3385
|
+
font-size: 11px;
|
|
3386
|
+
font-style: normal;
|
|
3387
|
+
font-weight: 600;
|
|
3388
|
+
line-height: 1;
|
|
3389
|
+
font-variant-numeric: tabular-nums;
|
|
3390
|
+
box-sizing: border-box;
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3329
3393
|
.aimd-protocol-recorder__content :deep(.aimd-rec-table-cell-input) {
|
|
3330
3394
|
width: 100%;
|
|
3331
3395
|
height: 34px;
|
|
@@ -3385,36 +3449,39 @@ defineExpose({
|
|
|
3385
3449
|
|
|
3386
3450
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card-list) {
|
|
3387
3451
|
display: grid;
|
|
3388
|
-
gap:
|
|
3452
|
+
gap: 8px;
|
|
3389
3453
|
}
|
|
3390
3454
|
|
|
3391
3455
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card) {
|
|
3392
3456
|
position: relative;
|
|
3393
|
-
padding: 10px
|
|
3457
|
+
padding: 7px 10px 9px;
|
|
3394
3458
|
border: 1px solid #dbe4ec;
|
|
3395
|
-
border-radius:
|
|
3459
|
+
border-radius: 10px;
|
|
3396
3460
|
background: rgba(255, 255, 255, 0.94);
|
|
3397
|
-
box-shadow: 0
|
|
3461
|
+
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.035);
|
|
3398
3462
|
}
|
|
3399
3463
|
|
|
3400
3464
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card__toolbar) {
|
|
3401
3465
|
display: flex;
|
|
3402
3466
|
align-items: center;
|
|
3403
3467
|
justify-content: space-between;
|
|
3404
|
-
gap:
|
|
3468
|
+
gap: 6px;
|
|
3469
|
+
min-height: 20px;
|
|
3470
|
+
margin-bottom: -2px;
|
|
3405
3471
|
}
|
|
3406
3472
|
|
|
3407
3473
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card__field) {
|
|
3408
3474
|
display: grid;
|
|
3409
|
-
gap:
|
|
3475
|
+
gap: 3px;
|
|
3410
3476
|
min-width: 0;
|
|
3411
|
-
padding-top:
|
|
3412
|
-
margin-top:
|
|
3477
|
+
padding-top: 6px;
|
|
3478
|
+
margin-top: 6px;
|
|
3413
3479
|
border-top: 1px solid #eef2f7;
|
|
3414
3480
|
}
|
|
3415
3481
|
|
|
3416
3482
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card__field--title) {
|
|
3417
3483
|
margin-top: 0;
|
|
3484
|
+
padding-top: 4px;
|
|
3418
3485
|
border-top: 0;
|
|
3419
3486
|
}
|
|
3420
3487
|
|
|
@@ -3423,25 +3490,25 @@ defineExpose({
|
|
|
3423
3490
|
gap: 0;
|
|
3424
3491
|
}
|
|
3425
3492
|
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3493
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card__label) {
|
|
3494
|
+
display: inline-flex;
|
|
3495
|
+
flex-direction: column;
|
|
3496
|
+
align-items: flex-start;
|
|
3497
|
+
gap: 1px;
|
|
3498
|
+
color: #64748b;
|
|
3499
|
+
font-size: 11px;
|
|
3500
|
+
font-weight: 700;
|
|
3501
|
+
letter-spacing: 0;
|
|
3502
|
+
line-height: 1.15;
|
|
3503
|
+
text-transform: none;
|
|
3504
|
+
}
|
|
3438
3505
|
|
|
3439
3506
|
.aimd-protocol-recorder__content :deep(.aimd-rec-card__input) {
|
|
3440
3507
|
width: 100%;
|
|
3441
|
-
height:
|
|
3442
|
-
padding: 0
|
|
3508
|
+
height: 30px;
|
|
3509
|
+
padding: 0 8px;
|
|
3443
3510
|
border: 1px solid #d7e0ea;
|
|
3444
|
-
border-radius:
|
|
3511
|
+
border-radius: 8px;
|
|
3445
3512
|
background: #f8fafc;
|
|
3446
3513
|
color: var(--rec-text);
|
|
3447
3514
|
font-size: 13px;
|
|
@@ -3468,6 +3535,34 @@ defineExpose({
|
|
|
3468
3535
|
border-color: var(--rec-error);
|
|
3469
3536
|
}
|
|
3470
3537
|
|
|
3538
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card .aimd-rec-inline-table__drag-handle) {
|
|
3539
|
+
grid-template-columns: repeat(2, 2.5px);
|
|
3540
|
+
grid-auto-rows: 2.5px;
|
|
3541
|
+
gap: 2px;
|
|
3542
|
+
padding: 3px 5px;
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card .aimd-rec-inline-table__row-number) {
|
|
3546
|
+
min-width: 18px;
|
|
3547
|
+
height: 18px;
|
|
3548
|
+
color: #8aa193;
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card .aimd-rec-inline-table__drag-dot) {
|
|
3552
|
+
width: 2.5px;
|
|
3553
|
+
height: 2.5px;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card .aimd-rec-inline-table__icon-btn) {
|
|
3557
|
+
width: 20px;
|
|
3558
|
+
height: 20px;
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-card .aimd-rec-inline-table__icon-btn svg) {
|
|
3562
|
+
width: 12px;
|
|
3563
|
+
height: 12px;
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3471
3566
|
@keyframes aimd-rec-inline-table-row-settle {
|
|
3472
3567
|
0% {
|
|
3473
3568
|
background-color: #deebff;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, h, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
|
-
import type { ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
3
|
+
import type { AimdQuizGradeResult, ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
4
4
|
import { AimdEditor } from '@airalogy/aimd-editor/vue'
|
|
5
5
|
import type { AimdEditorProps } from '@airalogy/aimd-editor/vue'
|
|
6
6
|
import type { AimdComponentRenderer } from '@airalogy/aimd-renderer'
|
|
@@ -8,6 +8,7 @@ import type { AimdRecorderMessagesInput } from '../locales'
|
|
|
8
8
|
import type {
|
|
9
9
|
AimdAssignerMap,
|
|
10
10
|
AimdAssignerRunner,
|
|
11
|
+
AimdChoiceOptionExplanationMode,
|
|
11
12
|
AimdServerAssignerMap,
|
|
12
13
|
AimdServerAssignerRunner,
|
|
13
14
|
AimdFileInfoResolver,
|
|
@@ -16,6 +17,7 @@ import type {
|
|
|
16
17
|
AimdFieldState,
|
|
17
18
|
AimdProtocolRecordData,
|
|
18
19
|
AimdRecorderFieldAdapters,
|
|
20
|
+
AimdScaleGradeDisplayMode,
|
|
19
21
|
AimdStepDetailDisplay,
|
|
20
22
|
AimdTypePlugin,
|
|
21
23
|
FieldEventPayload,
|
|
@@ -58,6 +60,10 @@ const props = withDefaults(defineProps<{
|
|
|
58
60
|
currentUserName?: string
|
|
59
61
|
now?: Date | string | number
|
|
60
62
|
messages?: AimdRecorderMessagesInput
|
|
63
|
+
quizGrades?: Record<string, AimdQuizGradeResult | null | undefined>
|
|
64
|
+
submitted?: boolean
|
|
65
|
+
choiceOptionExplanationMode?: AimdChoiceOptionExplanationMode
|
|
66
|
+
scaleGradeDisplayMode?: AimdScaleGradeDisplayMode
|
|
61
67
|
stepDetailDisplay?: AimdStepDetailDisplay
|
|
62
68
|
fieldMeta?: Record<string, AimdFieldMeta>
|
|
63
69
|
serverAssigners?: AimdServerAssignerMap
|
|
@@ -90,6 +96,7 @@ const props = withDefaults(defineProps<{
|
|
|
90
96
|
showRecordData?: boolean
|
|
91
97
|
showDetachedData?: boolean
|
|
92
98
|
fitViewport?: boolean
|
|
99
|
+
fillParent?: boolean
|
|
93
100
|
viewportOffset?: number
|
|
94
101
|
editorMinHeight?: number
|
|
95
102
|
recorderMinHeight?: number
|
|
@@ -101,6 +108,10 @@ const props = withDefaults(defineProps<{
|
|
|
101
108
|
currentUserName: undefined,
|
|
102
109
|
now: undefined,
|
|
103
110
|
messages: undefined,
|
|
111
|
+
quizGrades: undefined,
|
|
112
|
+
submitted: false,
|
|
113
|
+
choiceOptionExplanationMode: 'hidden',
|
|
114
|
+
scaleGradeDisplayMode: 'hidden',
|
|
104
115
|
stepDetailDisplay: 'auto',
|
|
105
116
|
fieldMeta: undefined,
|
|
106
117
|
serverAssigners: undefined,
|
|
@@ -131,6 +142,7 @@ const props = withDefaults(defineProps<{
|
|
|
131
142
|
showRecordData: false,
|
|
132
143
|
showDetachedData: true,
|
|
133
144
|
fitViewport: true,
|
|
145
|
+
fillParent: false,
|
|
134
146
|
viewportOffset: 24,
|
|
135
147
|
editorMinHeight: 560,
|
|
136
148
|
recorderMinHeight: 560,
|
|
@@ -189,6 +201,7 @@ const isPanelResizing = ref(false)
|
|
|
189
201
|
const viewportEditorMinHeight = ref(props.editorMinHeight)
|
|
190
202
|
const viewportSideBodyHeight = ref(props.recorderMinHeight)
|
|
191
203
|
const viewportVisualEditorMinHeight = ref(Math.max(320, props.recorderMinHeight))
|
|
204
|
+
const viewportWorkbenchMainHeight = ref<number | null>(null)
|
|
192
205
|
const activeFieldEditor = ref<AimdWorkbenchFieldDescriptor | null>(null)
|
|
193
206
|
const fieldEditorRawDraft = ref('')
|
|
194
207
|
const fieldInsertMenuIndex = ref<number | null>(null)
|
|
@@ -475,9 +488,19 @@ function getElementHeight(element: Element | null | undefined) {
|
|
|
475
488
|
}
|
|
476
489
|
|
|
477
490
|
function updateViewportPanelHeights() {
|
|
491
|
+
if (props.fillParent) {
|
|
492
|
+
viewportEditorMinHeight.value = 0
|
|
493
|
+
viewportSideBodyHeight.value = 0
|
|
494
|
+
viewportVisualEditorMinHeight.value = 0
|
|
495
|
+
viewportWorkbenchMainHeight.value = null
|
|
496
|
+
return
|
|
497
|
+
}
|
|
498
|
+
|
|
478
499
|
if (!props.fitViewport || typeof window === 'undefined') {
|
|
479
500
|
viewportEditorMinHeight.value = props.editorMinHeight
|
|
480
501
|
viewportSideBodyHeight.value = props.recorderMinHeight
|
|
502
|
+
viewportVisualEditorMinHeight.value = Math.max(320, props.recorderMinHeight)
|
|
503
|
+
viewportWorkbenchMainHeight.value = null
|
|
481
504
|
return
|
|
482
505
|
}
|
|
483
506
|
|
|
@@ -502,6 +525,10 @@ function updateViewportPanelHeights() {
|
|
|
502
525
|
320,
|
|
503
526
|
Math.floor(sideBodyHeight - recorderToolbarHeight - visualEditorToolbarHeight),
|
|
504
527
|
)
|
|
528
|
+
viewportWorkbenchMainHeight.value = Math.max(
|
|
529
|
+
sideHeaderHeight + sideBodyHeight,
|
|
530
|
+
editorHeaderHeight + editorToolbarHeight + viewportEditorMinHeight.value,
|
|
531
|
+
)
|
|
505
532
|
}
|
|
506
533
|
|
|
507
534
|
function scheduleViewportPanelHeights() {
|
|
@@ -527,7 +554,7 @@ const editorBindings = computed(() => {
|
|
|
527
554
|
modelValue: contentDraft.value,
|
|
528
555
|
mode: props.editorMode,
|
|
529
556
|
locale: editorProps.locale ?? props.locale,
|
|
530
|
-
minHeight: editorProps.minHeight ?? viewportEditorMinHeight.value,
|
|
557
|
+
minHeight: editorProps.minHeight ?? (props.fillParent ? 0 : viewportEditorMinHeight.value),
|
|
531
558
|
readonly: props.readonly || editorProps.readonly === true,
|
|
532
559
|
}
|
|
533
560
|
})
|
|
@@ -625,13 +652,21 @@ const hasDetachedData = computed(() => detachedEntryCount.value > 0)
|
|
|
625
652
|
const recordJson = computed(() => JSON.stringify(recordSnapshot.value, null, 2))
|
|
626
653
|
const detachedRecordJson = computed(() => JSON.stringify(detachedRecord.value, null, 2))
|
|
627
654
|
const workbenchMainStyle = computed(() => (
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
655
|
+
{
|
|
656
|
+
...(sourcePanelCollapsed.value
|
|
657
|
+
? {}
|
|
658
|
+
: { '--aimd-recorder-source-panel-width': `${sourcePanelWidthPercent.value}%` }),
|
|
659
|
+
...(viewportWorkbenchMainHeight.value === null
|
|
660
|
+
? {}
|
|
661
|
+
: { '--aimd-recorder-workbench-main-height': `${viewportWorkbenchMainHeight.value}px` }),
|
|
662
|
+
}
|
|
663
|
+
))
|
|
664
|
+
const sidePanelBodyStyle = computed(() => (
|
|
665
|
+
props.fillParent ? {} : { height: `${viewportSideBodyHeight.value}px` }
|
|
666
|
+
))
|
|
667
|
+
const visualEditorMinHeight = computed(() => (
|
|
668
|
+
props.fillParent ? 0 : viewportVisualEditorMinHeight.value
|
|
631
669
|
))
|
|
632
|
-
const sidePanelBodyStyle = computed(() => ({
|
|
633
|
-
height: `${viewportSideBodyHeight.value}px`,
|
|
634
|
-
}))
|
|
635
670
|
const sideTabs = computed(() => {
|
|
636
671
|
const tabs: Array<{ key: WorkbenchSideTab, label: string, badge?: number }> = [
|
|
637
672
|
{ key: 'recorder', label: recorderTitleLabel.value },
|
|
@@ -695,6 +730,7 @@ watch(
|
|
|
695
730
|
visualEditMode,
|
|
696
731
|
hasDetachedData,
|
|
697
732
|
() => props.fitViewport,
|
|
733
|
+
() => props.fillParent,
|
|
698
734
|
() => props.viewportOffset,
|
|
699
735
|
() => props.editorMinHeight,
|
|
700
736
|
() => props.recorderMinHeight,
|
|
@@ -1226,7 +1262,11 @@ defineExpose({
|
|
|
1226
1262
|
</script>
|
|
1227
1263
|
|
|
1228
1264
|
<template>
|
|
1229
|
-
<div
|
|
1265
|
+
<div
|
|
1266
|
+
ref="workbenchRef"
|
|
1267
|
+
class="aimd-recorder-workbench"
|
|
1268
|
+
:class="{ 'aimd-recorder-workbench--fill-parent': fillParent }"
|
|
1269
|
+
>
|
|
1230
1270
|
<div
|
|
1231
1271
|
ref="workbenchMainRef"
|
|
1232
1272
|
class="aimd-recorder-workbench__main"
|
|
@@ -1393,12 +1433,16 @@ defineExpose({
|
|
|
1393
1433
|
v-if="visualEditMode"
|
|
1394
1434
|
:content="visualContentDraft"
|
|
1395
1435
|
:model-value="recordSnapshot"
|
|
1396
|
-
:min-height="
|
|
1436
|
+
:min-height="visualEditorMinHeight"
|
|
1397
1437
|
:locale="locale"
|
|
1398
1438
|
:readonly="readonly"
|
|
1399
1439
|
:current-user-name="currentUserName"
|
|
1400
1440
|
:now="now"
|
|
1401
1441
|
:messages="messages"
|
|
1442
|
+
:quiz-grades="quizGrades"
|
|
1443
|
+
:submitted="submitted"
|
|
1444
|
+
:choice-option-explanation-mode="choiceOptionExplanationMode"
|
|
1445
|
+
:scale-grade-display-mode="scaleGradeDisplayMode"
|
|
1402
1446
|
:step-detail-display="stepDetailDisplay"
|
|
1403
1447
|
:field-meta="fieldMeta"
|
|
1404
1448
|
:server-assigners="serverAssigners"
|
|
@@ -1439,6 +1483,10 @@ defineExpose({
|
|
|
1439
1483
|
:now="now"
|
|
1440
1484
|
:locale="locale"
|
|
1441
1485
|
:messages="messages"
|
|
1486
|
+
:quiz-grades="quizGrades"
|
|
1487
|
+
:submitted="submitted"
|
|
1488
|
+
:choice-option-explanation-mode="choiceOptionExplanationMode"
|
|
1489
|
+
:scale-grade-display-mode="scaleGradeDisplayMode"
|
|
1442
1490
|
:step-detail-display="stepDetailDisplay"
|
|
1443
1491
|
:field-meta="fieldMeta"
|
|
1444
1492
|
:server-assigners="serverAssigners"
|
|
@@ -1696,11 +1744,25 @@ defineExpose({
|
|
|
1696
1744
|
gap: 16px;
|
|
1697
1745
|
}
|
|
1698
1746
|
|
|
1747
|
+
.aimd-recorder-workbench--fill-parent {
|
|
1748
|
+
height: 100%;
|
|
1749
|
+
min-height: 0;
|
|
1750
|
+
overflow: hidden;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1699
1753
|
.aimd-recorder-workbench__main {
|
|
1700
1754
|
display: grid;
|
|
1701
1755
|
grid-template-columns: minmax(260px, var(--aimd-recorder-source-panel-width, 50%)) 12px minmax(0, 1fr);
|
|
1702
1756
|
gap: 0;
|
|
1703
1757
|
align-items: stretch;
|
|
1758
|
+
height: var(--aimd-recorder-workbench-main-height, auto);
|
|
1759
|
+
min-height: 0;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__main {
|
|
1763
|
+
flex: 1 1 0;
|
|
1764
|
+
height: 100%;
|
|
1765
|
+
max-height: 100%;
|
|
1704
1766
|
}
|
|
1705
1767
|
|
|
1706
1768
|
.aimd-recorder-workbench__main--source-collapsed {
|
|
@@ -1713,7 +1775,10 @@ defineExpose({
|
|
|
1713
1775
|
}
|
|
1714
1776
|
|
|
1715
1777
|
.aimd-recorder-workbench__panel {
|
|
1778
|
+
display: flex;
|
|
1779
|
+
flex-direction: column;
|
|
1716
1780
|
min-width: 0;
|
|
1781
|
+
min-height: 0;
|
|
1717
1782
|
overflow: hidden;
|
|
1718
1783
|
border: 1px solid #dbe4ef;
|
|
1719
1784
|
border-radius: 14px;
|
|
@@ -1721,6 +1786,10 @@ defineExpose({
|
|
|
1721
1786
|
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
|
|
1722
1787
|
}
|
|
1723
1788
|
|
|
1789
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel {
|
|
1790
|
+
height: 100%;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1724
1793
|
.aimd-recorder-workbench__panel--source {
|
|
1725
1794
|
min-width: 0;
|
|
1726
1795
|
}
|
|
@@ -1735,6 +1804,7 @@ defineExpose({
|
|
|
1735
1804
|
}
|
|
1736
1805
|
|
|
1737
1806
|
.aimd-recorder-workbench__panel-head {
|
|
1807
|
+
flex: 0 0 auto;
|
|
1738
1808
|
padding: 12px 16px;
|
|
1739
1809
|
border-bottom: 1px solid #e7edf5;
|
|
1740
1810
|
background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
|
|
@@ -1835,7 +1905,18 @@ defineExpose({
|
|
|
1835
1905
|
}
|
|
1836
1906
|
|
|
1837
1907
|
.aimd-recorder-workbench__panel-body {
|
|
1908
|
+
flex: 1 1 auto;
|
|
1838
1909
|
min-width: 0;
|
|
1910
|
+
min-height: 0;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body {
|
|
1914
|
+
flex: 1 1 0;
|
|
1915
|
+
height: auto !important;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.aimd-recorder-workbench__panel-body--editor {
|
|
1919
|
+
overflow: hidden;
|
|
1839
1920
|
}
|
|
1840
1921
|
|
|
1841
1922
|
.aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor) {
|
|
@@ -1843,6 +1924,30 @@ defineExpose({
|
|
|
1843
1924
|
border-radius: 0;
|
|
1844
1925
|
}
|
|
1845
1926
|
|
|
1927
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor),
|
|
1928
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor-panel),
|
|
1929
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor-source-mode) {
|
|
1930
|
+
height: 100% !important;
|
|
1931
|
+
min-height: 0 !important;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor-panel) {
|
|
1935
|
+
display: flex;
|
|
1936
|
+
flex: 1 1 0;
|
|
1937
|
+
flex-direction: column;
|
|
1938
|
+
overflow: hidden;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor-panel > div) {
|
|
1942
|
+
flex: 1 1 0;
|
|
1943
|
+
height: 100%;
|
|
1944
|
+
min-height: 0;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
.aimd-recorder-workbench--fill-parent .aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor-source-mode) {
|
|
1948
|
+
flex: 1 1 0;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1846
1951
|
.aimd-recorder-workbench__panel-body--recorder {
|
|
1847
1952
|
padding: 18px;
|
|
1848
1953
|
box-sizing: border-box;
|
|
@@ -2513,6 +2618,7 @@ defineExpose({
|
|
|
2513
2618
|
.aimd-recorder-workbench__main {
|
|
2514
2619
|
grid-template-columns: minmax(0, 1fr);
|
|
2515
2620
|
gap: 16px;
|
|
2621
|
+
height: auto;
|
|
2516
2622
|
}
|
|
2517
2623
|
|
|
2518
2624
|
.aimd-recorder-workbench__splitter {
|
|
@@ -29,6 +29,10 @@ const renderedContent = computed(() => (
|
|
|
29
29
|
:now="surfaceState.now"
|
|
30
30
|
:locale="surfaceState.locale"
|
|
31
31
|
:messages="surfaceState.messages"
|
|
32
|
+
:quiz-grades="surfaceState.quizGrades"
|
|
33
|
+
:submitted="surfaceState.submitted"
|
|
34
|
+
:choice-option-explanation-mode="surfaceState.choiceOptionExplanationMode"
|
|
35
|
+
:scale-grade-display-mode="surfaceState.scaleGradeDisplayMode"
|
|
32
36
|
:step-detail-display="surfaceState.stepDetailDisplay"
|
|
33
37
|
:field-meta="surfaceState.fieldMeta"
|
|
34
38
|
:server-assigners="surfaceState.serverAssigners"
|