@airalogy/aimd-recorder 1.19.0 → 1.19.2
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 +13 -0
- package/README.zh-CN.md +13 -0
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js → AimdEditor.vue_vue_type_style_index_0_lang-gTySIxvX.js} +3446 -3351
- package/dist/{AimdMarkdownField-DmNX2g4j.js → AimdMarkdownField-DGV5KFUs.js} +5 -5
- package/dist/{AimdMarkdownNoteField-B5ruzmwS.js → AimdMarkdownNoteField-C78KHCBA.js} +4 -4
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-B-vsgEXF.js → arc-BMhAnOm7.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-BwPNOtNH.js → architectureDiagram-3BPJPVTR-DXuPTBR3.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-CMUI4kKc.js → blockDiagram-GPEHLZMM-HKz9kQ49.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-Cpmfsy_s.js → c4Diagram-AAUBKEIU-B2a8Aupm.js} +2 -2
- package/dist/{channel-DlMAXHQK.js → channel-CQnbPm6T.js} +1 -1
- package/dist/{chunk-2J33WTMH-DP9BS2ux.js → chunk-2J33WTMH-CPwhDANL.js} +1 -1
- package/dist/{chunk-4BX2VUAB-ncsOeLMb.js → chunk-4BX2VUAB-BJV0R8-Z.js} +1 -1
- package/dist/{chunk-55IACEB6-C7wHk4B7.js → chunk-55IACEB6-CSqUgTVA.js} +1 -1
- package/dist/{chunk-727SXJPM-Caa5aVUO.js → chunk-727SXJPM-C3LCZWaC.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-CL8egKqD.js → chunk-AQP2D5EJ-BC5kHyik.js} +3 -3
- package/dist/{chunk-FMBD7UC4-heVR6BSA.js → chunk-FMBD7UC4-lv-SQuSa.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BYH-wC2J.js → chunk-ND2GUHAM-BnnHbOOp.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Bx2K7vkq.js → chunk-QZHKN3VN-DE1_5lrn.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-BLLfLYy0.js → classDiagram-4FO5ZUOK-32SrXsR3.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-BLLfLYy0.js → classDiagram-v2-Q7XG4LA2-32SrXsR3.js} +2 -2
- package/dist/components.js +2537 -2502
- package/dist/composables.js +1 -1
- package/dist/{cose-bilkent-S5V4N54A-E1YmM_xr.js → cose-bilkent-S5V4N54A-BKyR6PrF.js} +1 -1
- package/dist/{dagre-BM42HDAG-BsXpQirH.js → dagre-BM42HDAG-D8Nwouf2.js} +3 -3
- package/dist/{diagram-2AECGRRQ-CamqbWlY.js → diagram-2AECGRRQ-DfoNEchZ.js} +2 -2
- package/dist/{diagram-5GNKFQAL-DZyRFcOC.js → diagram-5GNKFQAL-Dlpl3XO8.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CmkGcy7R.js → diagram-KO2AKTUF-CgwROod_.js} +2 -2
- package/dist/{diagram-LMA3HP47-IdDwQPZ-.js → diagram-LMA3HP47-UiiviX43.js} +2 -2
- package/dist/{diagram-OG6HWLK6-t0LBcUIU.js → diagram-OG6HWLK6-BPuH-4Wa.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-DJBY2iZG.js → erDiagram-TEJ5UH35-B19WKSiS.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DE4MzPPk.js → flowDiagram-I6XJVG4X-SsfO1IYz.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-CmAc35Yw.js → ganttDiagram-6RSMTGT7-8BCxW9SC.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-DDQZ5flw.js → gitGraphDiagram-PVQCEYII-D-jzaXKg.js} +3 -3
- package/dist/{graph-BsJ8-1Pq.js → graph-Dd8Vx0lj.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{infoDiagram-5YYISTIA-DSZjFR5g.js → infoDiagram-5YYISTIA-B_XwkyXw.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-DCO9dx2L.js → ishikawaDiagram-YF4QCWOH-nevqOMkV.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-b-PpuBqg.js → journeyDiagram-JHISSGLW-DKQOkZNx.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-BjclDuJZ.js → kanban-definition-UN3LZRKU-BYvizbN0.js} +2 -2
- package/dist/{layout-D4wqKu72.js → layout-BiHDh2wu.js} +2 -2
- package/dist/{linear-Voc3BJib.js → linear-BcUgIsNC.js} +1 -1
- package/dist/{mermaid.core-Dt_VbeGP.js → mermaid.core-DPv1ut6K.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-B3vrXRVY.js → mindmap-definition-RKZ34NQL-CiT97EC2.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-DFpWxSxk.js → pieDiagram-4H26LBE5-BHcFVpCC.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BYHcrGoB.js → quadrantDiagram-W4KKPZXB-BFBAb3Zx.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-C-FgWrRz.js → requirementDiagram-4Y6WPE33-CUS2OOyE.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-IwN0Evji.js → sankeyDiagram-5OEKKPKP-IuhX4tCb.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-_OnqhBO2.js → sequenceDiagram-3UESZ5HK-DWHcFiUF.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-BRLv0Zcw.js → stateDiagram-AJRCARHV-J49Kafj_.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-BofX0AdS.js → stateDiagram-v2-BHNVJYJU-DL2VCR5X.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-C-DpPLpw.js → timeline-definition-PNZ67QCA-l9xSQ_pX.js} +2 -2
- package/dist/{useCodeBlockRendering-DoTZaJTW.js → useCodeBlockRendering-CY70U0Xm.js} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-zTHQR9Oq.js → vennDiagram-CIIHVFJN-BQjdmOkd.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-au5koizO.js → wardleyDiagram-YWT4CUSO-CmVdsV9b.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-BNf12P8z.js → xychartDiagram-2RQKCTM6-F-cC_Igm.js} +2 -2
- package/package.json +6 -6
- package/src/__tests__/markdown-field.test.ts +1 -0
- package/src/__tests__/markdown-note-field.test.ts +1 -0
- 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 +64 -7
- package/src/components/AimdMarkdownField.vue +1 -19
- package/src/components/AimdMarkdownNoteField.vue +1 -2
- package/src/components/AimdRecorder.vue +56 -16
- package/src/components/AimdRecorderEditor.vue +116 -10
- package/src/components/AimdRecorderWysiwygFieldHost.vue +4 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +19 -1
- package/src/components/recorderMilkdownPlugin.ts +7 -1
- package/src/composables/__tests__/useVarHelpers.test.ts +41 -0
- package/src/index.ts +1 -1
- package/src/styles/{aimd.css → recorder.css} +6 -620
|
@@ -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"
|
|
@@ -12,12 +12,13 @@ import {
|
|
|
12
12
|
useEditorContent,
|
|
13
13
|
} from '@airalogy/aimd-editor/vue'
|
|
14
14
|
import type { AimdVarTypePresetOption } from '@airalogy/aimd-editor/vue'
|
|
15
|
-
import type { ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
15
|
+
import type { AimdQuizGradeResult, ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
16
16
|
import type { AimdComponentRenderer } from '@airalogy/aimd-renderer'
|
|
17
17
|
import type { AimdRecorderMessagesInput } from '../locales'
|
|
18
18
|
import type {
|
|
19
19
|
AimdAssignerMap,
|
|
20
20
|
AimdAssignerRunner,
|
|
21
|
+
AimdChoiceOptionExplanationMode,
|
|
21
22
|
AimdServerAssignerMap,
|
|
22
23
|
AimdServerAssignerRunner,
|
|
23
24
|
AimdFileInfoResolver,
|
|
@@ -26,6 +27,7 @@ import type {
|
|
|
26
27
|
AimdFieldState,
|
|
27
28
|
AimdProtocolRecordData,
|
|
28
29
|
AimdRecorderFieldAdapters,
|
|
30
|
+
AimdScaleGradeDisplayMode,
|
|
29
31
|
AimdStepDetailDisplay,
|
|
30
32
|
AimdTypePlugin,
|
|
31
33
|
FieldEventPayload,
|
|
@@ -57,6 +59,10 @@ const props = withDefaults(defineProps<{
|
|
|
57
59
|
currentUserName?: string
|
|
58
60
|
now?: Date | string | number
|
|
59
61
|
messages?: AimdRecorderMessagesInput
|
|
62
|
+
quizGrades?: Record<string, AimdQuizGradeResult | null | undefined>
|
|
63
|
+
submitted?: boolean
|
|
64
|
+
choiceOptionExplanationMode?: AimdChoiceOptionExplanationMode
|
|
65
|
+
scaleGradeDisplayMode?: AimdScaleGradeDisplayMode
|
|
60
66
|
stepDetailDisplay?: AimdStepDetailDisplay
|
|
61
67
|
fieldMeta?: Record<string, AimdFieldMeta>
|
|
62
68
|
serverAssigners?: AimdServerAssignerMap
|
|
@@ -82,6 +88,10 @@ const props = withDefaults(defineProps<{
|
|
|
82
88
|
currentUserName: undefined,
|
|
83
89
|
now: undefined,
|
|
84
90
|
messages: undefined,
|
|
91
|
+
quizGrades: undefined,
|
|
92
|
+
submitted: false,
|
|
93
|
+
choiceOptionExplanationMode: 'hidden',
|
|
94
|
+
scaleGradeDisplayMode: 'hidden',
|
|
85
95
|
stepDetailDisplay: 'auto',
|
|
86
96
|
fieldMeta: undefined,
|
|
87
97
|
serverAssigners: undefined,
|
|
@@ -184,6 +194,10 @@ const surfaceState = reactive<RecorderMilkdownSurfaceState>({
|
|
|
184
194
|
now: props.now,
|
|
185
195
|
locale: props.locale,
|
|
186
196
|
messages: props.messages,
|
|
197
|
+
quizGrades: props.quizGrades,
|
|
198
|
+
submitted: props.submitted,
|
|
199
|
+
choiceOptionExplanationMode: props.choiceOptionExplanationMode,
|
|
200
|
+
scaleGradeDisplayMode: props.scaleGradeDisplayMode,
|
|
187
201
|
stepDetailDisplay: props.stepDetailDisplay,
|
|
188
202
|
fieldMeta: props.fieldMeta,
|
|
189
203
|
serverAssigners: props.serverAssigners,
|
|
@@ -214,6 +228,10 @@ watchEffect(() => {
|
|
|
214
228
|
surfaceState.now = props.now
|
|
215
229
|
surfaceState.locale = props.locale
|
|
216
230
|
surfaceState.messages = props.messages
|
|
231
|
+
surfaceState.quizGrades = props.quizGrades
|
|
232
|
+
surfaceState.submitted = props.submitted
|
|
233
|
+
surfaceState.choiceOptionExplanationMode = props.choiceOptionExplanationMode
|
|
234
|
+
surfaceState.scaleGradeDisplayMode = props.scaleGradeDisplayMode
|
|
217
235
|
surfaceState.stepDetailDisplay = props.stepDetailDisplay
|
|
218
236
|
surfaceState.fieldMeta = props.fieldMeta
|
|
219
237
|
surfaceState.serverAssigners = props.serverAssigners
|
|
@@ -7,7 +7,7 @@ import type { EditorView, NodeView } from '@milkdown/kit/prose/view'
|
|
|
7
7
|
import { NodeSelection } from '@milkdown/kit/prose/state'
|
|
8
8
|
import { hardbreakAttr, hardbreakSchema } from '@milkdown/kit/preset/commonmark'
|
|
9
9
|
import { $node, $prose, $remark, $view } from '@milkdown/kit/utils'
|
|
10
|
-
import type { ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
10
|
+
import type { AimdQuizGradeResult, ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
11
11
|
import {
|
|
12
12
|
aimdFieldInputRule,
|
|
13
13
|
aimdFieldNode,
|
|
@@ -18,6 +18,7 @@ import type { AimdRecorderMessagesInput } from '../locales'
|
|
|
18
18
|
import type {
|
|
19
19
|
AimdAssignerMap,
|
|
20
20
|
AimdAssignerRunner,
|
|
21
|
+
AimdChoiceOptionExplanationMode,
|
|
21
22
|
AimdServerAssignerMap,
|
|
22
23
|
AimdServerAssignerRunner,
|
|
23
24
|
AimdFileInfoResolver,
|
|
@@ -26,6 +27,7 @@ import type {
|
|
|
26
27
|
AimdFieldState,
|
|
27
28
|
AimdProtocolRecordData,
|
|
28
29
|
AimdRecorderFieldAdapters,
|
|
30
|
+
AimdScaleGradeDisplayMode,
|
|
29
31
|
AimdStepDetailDisplay,
|
|
30
32
|
AimdTypePlugin,
|
|
31
33
|
FieldEventPayload,
|
|
@@ -48,6 +50,10 @@ export interface RecorderMilkdownSurfaceState {
|
|
|
48
50
|
now?: Date | string | number
|
|
49
51
|
locale?: string
|
|
50
52
|
messages?: AimdRecorderMessagesInput
|
|
53
|
+
quizGrades?: Record<string, AimdQuizGradeResult | null | undefined>
|
|
54
|
+
submitted: boolean
|
|
55
|
+
choiceOptionExplanationMode: AimdChoiceOptionExplanationMode
|
|
56
|
+
scaleGradeDisplayMode: AimdScaleGradeDisplayMode
|
|
51
57
|
stepDetailDisplay: AimdStepDetailDisplay
|
|
52
58
|
fieldMeta?: Record<string, AimdFieldMeta>
|
|
53
59
|
serverAssigners?: AimdServerAssignerMap
|
|
@@ -587,6 +587,47 @@ describe('measureVarLabelWidth', () => {
|
|
|
587
587
|
|
|
588
588
|
expect(measureVarLabelWidth(wrapper)).toBeLessThan(240)
|
|
589
589
|
})
|
|
590
|
+
|
|
591
|
+
it('includes long metadata keys when sizing stacked var labels', () => {
|
|
592
|
+
vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockImplementation(() => ({
|
|
593
|
+
measureText: (text: string) => ({ width: text.length * 8 }),
|
|
594
|
+
} as unknown as CanvasRenderingContext2D))
|
|
595
|
+
vi.spyOn(window, 'getComputedStyle').mockImplementation((element: Element) => {
|
|
596
|
+
const classList = (element as HTMLElement).classList
|
|
597
|
+
const horizontalPadding = classList.contains('aimd-field__name')
|
|
598
|
+
? '16px'
|
|
599
|
+
: classList.contains('aimd-field__scope--var')
|
|
600
|
+
? '14px'
|
|
601
|
+
: '0px'
|
|
602
|
+
return {
|
|
603
|
+
fontSize: '14px',
|
|
604
|
+
fontFamily: 'sans-serif',
|
|
605
|
+
fontWeight: '500',
|
|
606
|
+
fontStyle: 'normal',
|
|
607
|
+
paddingLeft: horizontalPadding,
|
|
608
|
+
paddingRight: '0px',
|
|
609
|
+
borderLeftWidth: '0px',
|
|
610
|
+
borderRightWidth: '0px',
|
|
611
|
+
marginLeft: '0px',
|
|
612
|
+
marginRight: '0px',
|
|
613
|
+
} as CSSStyleDeclaration
|
|
614
|
+
})
|
|
615
|
+
|
|
616
|
+
const wrapper = document.createElement('span')
|
|
617
|
+
wrapper.className = 'aimd-rec-inline--var-stacked'
|
|
618
|
+
wrapper.innerHTML = `
|
|
619
|
+
<span class="aimd-field__label">
|
|
620
|
+
<span class="aimd-field__scope aimd-field__scope--var">var</span>
|
|
621
|
+
<span class="aimd-field__name">
|
|
622
|
+
<span class="aimd-field__title">岸带完整性评分</span>
|
|
623
|
+
<span class="aimd-field__key">riparian_integrity_score</span>
|
|
624
|
+
</span>
|
|
625
|
+
</span>
|
|
626
|
+
`
|
|
627
|
+
document.body.appendChild(wrapper)
|
|
628
|
+
|
|
629
|
+
expect(measureVarLabelWidth(wrapper)).toBeGreaterThan(220)
|
|
630
|
+
})
|
|
590
631
|
})
|
|
591
632
|
|
|
592
633
|
// ---------------------------------------------------------------------------
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
// Re-export styles
|
|
10
|
-
import './styles/
|
|
10
|
+
import './styles/recorder.css'
|
|
11
11
|
import { AimdProtocolRecorder as DeprecatedAimdProtocolRecorder } from './components'
|
|
12
12
|
|
|
13
13
|
export { AimdAssignerGraph, AimdRecorder, AimdRecorderEditor, AimdQuizRecorder } from './components'
|