@airalogy/aimd-recorder 1.14.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 +240 -0
- package/README.zh-CN.md +224 -0
- package/dist/AimdCodeField-DC3DPvgc.js +172 -0
- package/dist/AimdDnaSequenceField-__jdnFS9.js +59466 -0
- package/dist/AimdEditor.vue_vue_type_style_index_0_lang-Bq79rKNw.js +28370 -0
- package/dist/AimdMarkdownField-98ImHGbc.js +66 -0
- package/dist/AimdMarkdownNoteField-CuUJZkgT.js +185 -0
- package/dist/_.contribution-IP0cDNhs.js +38 -0
- package/dist/_commonjsHelpers-CZXJ37nu.js +40 -0
- package/dist/abap-Bs8kvjsq.js +1398 -0
- package/dist/aimd-recorder.css +1 -0
- package/dist/apex-Dspwrl5m.js +326 -0
- package/dist/assets/css.worker-Dmf38jDD.js +79 -0
- package/dist/assets/editor.worker-CpuX8TSY.js +12 -0
- package/dist/assets/html.worker-DotaEs7v.js +456 -0
- package/dist/assets/json.worker-B4VHhH6h.js +44 -0
- package/dist/assets/ts.worker-sl17zBDo.js +51316 -0
- package/dist/azcli-k1BiOau1.js +68 -0
- package/dist/bat-BIP72KWc.js +100 -0
- package/dist/bicep-VhQeYhS3.js +102 -0
- package/dist/cameligo-DnuAXtHg.js +174 -0
- package/dist/clojure-BAuDPsal.js +761 -0
- package/dist/coffee-BV06qSnj.js +232 -0
- package/dist/components.js +3595 -0
- package/dist/composables.js +72 -0
- package/dist/cpp-Cz8Jeyrf.js +389 -0
- package/dist/csharp-F6hhlXFb.js +326 -0
- package/dist/csp-KzlEHCyI.js +53 -0
- package/dist/css-e4FKntZ3.js +187 -0
- package/dist/cssMode-uz9U6SUU.js +1571 -0
- package/dist/cypher-CpvDGKRr.js +263 -0
- package/dist/dart-DdHeFWR0.js +281 -0
- package/dist/dockerfile-aoNXDcio.js +130 -0
- package/dist/ecl-C4Q0DYuA.js +456 -0
- package/dist/editor.api-CgD9w0gG.js +77091 -0
- package/dist/editor.main-Du02abDl.js +33783 -0
- package/dist/elixir-C9X42b0T.js +569 -0
- package/dist/flow9-Bff42pfB.js +142 -0
- package/dist/freemarker2-DFLX4iQ-.js +989 -0
- package/dist/fsharp-C6vPAsHG.js +217 -0
- package/dist/go-DEr8zx9f.js +218 -0
- package/dist/graphql-BiNBBRFh.js +151 -0
- package/dist/handlebars-aiZbIuWY.js +419 -0
- package/dist/hcl-2T9lKuFg.js +183 -0
- package/dist/html-phzTMObN.js +308 -0
- package/dist/htmlMode-BF7wMi3N.js +1581 -0
- package/dist/index.js +89 -0
- package/dist/ini-CZGtssYM.js +71 -0
- package/dist/ini.contribution-DyWtiacL.js +8 -0
- package/dist/java-B260NeH3.js +232 -0
- package/dist/javascript-BKKOItMi.js +70 -0
- package/dist/jsonMode-CDYK4B5l.js +1996 -0
- package/dist/julia-kuNLM9c5.js +511 -0
- package/dist/kotlin-Bz6kAefA.js +253 -0
- package/dist/less-AZUtS89I.js +162 -0
- package/dist/lexon-BcmgnyRb.js +157 -0
- package/dist/liquid-B2eRz5SA.js +240 -0
- package/dist/lua-Dz1RbATg.js +162 -0
- package/dist/m3-CIMooLFn.js +210 -0
- package/dist/markdown-C1BsCK9P.js +229 -0
- package/dist/markdown.contribution-DYYk6zUU.js +7 -0
- package/dist/mdx-BfV1HDRG.js +165 -0
- package/dist/mips-BovsnfLQ.js +198 -0
- package/dist/monaco.contribution-C-bQhUTI.js +114 -0
- package/dist/monaco.contribution-CCVvl3Jx.js +72 -0
- package/dist/monaco.contribution-Col-f0XR.js +164 -0
- package/dist/monaco.contribution-b5xkgQ-s.js +112 -0
- package/dist/msdax-CiRB2ZB-.js +375 -0
- package/dist/mysql-BwdpPE19.js +878 -0
- package/dist/objective-c-D4nfHfso.js +183 -0
- package/dist/pascal--j5-PYtz.js +251 -0
- package/dist/pascaligo-C7TcJxNL.js +164 -0
- package/dist/perl-BzEWqUb5.js +626 -0
- package/dist/pgsql-B_KZ0mGX.js +851 -0
- package/dist/php-A19QHzQV.js +500 -0
- package/dist/pla-COeKY1hA.js +137 -0
- package/dist/postiats-BfMp7zJL.js +907 -0
- package/dist/powerquery-B0TS_5Gb.js +890 -0
- package/dist/powershell-5jSbKdYB.js +239 -0
- package/dist/protobuf-YgnOutn3.js +420 -0
- package/dist/pug-DLej6kn5.js +402 -0
- package/dist/python-CQrZx9mR.js +301 -0
- package/dist/python.contribution-CcKs2Ktm.js +8 -0
- package/dist/qsharp-AhjqtSHB.js +301 -0
- package/dist/r-D-F4P80w.js +243 -0
- package/dist/razor-DWmpHMcx.js +550 -0
- package/dist/redis-hwwIlMnV.js +302 -0
- package/dist/redshift-Bcm_kjEG.js +809 -0
- package/dist/restructuredtext-CrdzfPP-.js +174 -0
- package/dist/ruby-QC2UNm1s.js +511 -0
- package/dist/rust-5aqiQ3L5.js +343 -0
- package/dist/sb-B1g1ZfLJ.js +115 -0
- package/dist/scala-C2U4R5Gb.js +370 -0
- package/dist/scheme-DeFRbslr.js +108 -0
- package/dist/scss-RSTCiCmI.js +262 -0
- package/dist/shell-BpF-iNu8.js +221 -0
- package/dist/shell.contribution-B80NZ3iO.js +7 -0
- package/dist/solidity-C00r2mbQ.js +1367 -0
- package/dist/sophia-DVW5ZKDB.js +199 -0
- package/dist/sparql-B0nmpxeX.js +201 -0
- package/dist/sql-CJwKPERn.js +853 -0
- package/dist/sql.contribution-DQy36aE5.js +7 -0
- package/dist/st-DPlKG5DT.js +416 -0
- package/dist/swift-YZBAbVHV.js +309 -0
- package/dist/systemverilog-CDQSaH63.js +576 -0
- package/dist/tcl-Dlu8sp6Q.js +232 -0
- package/dist/tsMode-Bh-v12OL.js +887 -0
- package/dist/twig-C5TO7-kw.js +392 -0
- package/dist/typescript-c7y6IZVP.js +343 -0
- package/dist/typespec-BsmjDEu7.js +117 -0
- package/dist/useFieldRendering-BIqeE3qo.js +6083 -0
- package/dist/vb-ChHvIDrk.js +372 -0
- package/dist/wgsl-XEp1ju8c.js +439 -0
- package/dist/xml-MAEprTnF.js +95 -0
- package/dist/xml.contribution-XMOaon8i.js +27 -0
- package/dist/yaml-C1p8rXG7.js +206 -0
- package/dist/yaml.contribution-DRRVhJmJ.js +8 -0
- package/package.json +88 -0
- package/src/__tests__/client-assigner.test.ts +341 -0
- package/src/__tests__/code-types.test.ts +30 -0
- package/src/__tests__/markdown-field.test.ts +34 -0
- package/src/__tests__/markdown-note-field.test.ts +135 -0
- package/src/__tests__/quiz-recorder.test.ts +195 -0
- package/src/__tests__/recorder-editor-content-sync.test.ts +172 -0
- package/src/__tests__/recorder-editor.test.ts +143 -0
- package/src/__tests__/recorder-render.test.ts +57 -0
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +33 -0
- package/src/__tests__/step-field.test.ts +270 -0
- package/src/__tests__/type-plugins.test.ts +59 -0
- package/src/__tests__/var-field-render.test.ts +26 -0
- package/src/client-assigner.ts +269 -0
- package/src/code-types.ts +94 -0
- package/src/components/AimdCodeField.vue +228 -0
- package/src/components/AimdDnaSequenceField.vue +983 -0
- package/src/components/AimdMarkdownField.vue +168 -0
- package/src/components/AimdMarkdownNoteField.vue +457 -0
- package/src/components/AimdQuizRecorder.vue +792 -0
- package/src/components/AimdRecorder.vue +1959 -0
- package/src/components/AimdRecorderEditor.vue +2281 -0
- package/src/components/AimdRecorderWysiwygFieldHost.vue +93 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +487 -0
- package/src/components/AimdSeqVizViewer.vue +122 -0
- package/src/components/AimdStepCheckField.vue +453 -0
- package/src/components/AimdVarField.vue +213 -0
- package/src/components/AimdVarTableField.vue +516 -0
- package/src/components/DnaAnnotationEditor.vue +477 -0
- package/src/components/DnaSequenceEditor.vue +44 -0
- package/src/components/DnaSequenceToolbar.vue +98 -0
- package/src/components/DnaSequenceViewer.vue +162 -0
- package/src/components/index.ts +21 -0
- package/src/components/recorderMilkdownPlugin.ts +632 -0
- package/src/composables/__tests__/useDnaSequence.test.ts +467 -0
- package/src/composables/__tests__/useFieldAdapters.test.ts +115 -0
- package/src/composables/__tests__/useFocusManagement.test.ts +66 -0
- package/src/composables/__tests__/useRecordState.test.ts +586 -0
- package/src/composables/__tests__/useStepTimers.test.ts +64 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +424 -0
- package/src/composables/__tests__/workbenchFieldEditing.test.ts +97 -0
- package/src/composables/index.ts +94 -0
- package/src/composables/useClientAssignerRunner.ts +74 -0
- package/src/composables/useDnaSequence.ts +400 -0
- package/src/composables/useDnaSequenceField.ts +316 -0
- package/src/composables/useFieldAdapters.ts +61 -0
- package/src/composables/useFieldRendering.ts +269 -0
- package/src/composables/useFocusManagement.ts +144 -0
- package/src/composables/useRecordState.ts +429 -0
- package/src/composables/useStepTimers.ts +243 -0
- package/src/composables/useVarHelpers.ts +545 -0
- package/src/composables/useVarTableDragDrop.ts +236 -0
- package/src/composables/workbenchFieldEditing.ts +705 -0
- package/src/css.d.ts +9 -0
- package/src/index.ts +65 -0
- package/src/locales.ts +559 -0
- package/src/monaco-code.ts +75 -0
- package/src/styles/aimd.css +994 -0
- package/src/type-plugins.ts +132 -0
- package/src/type-utils.ts +3 -0
- package/src/types.ts +191 -0
|
@@ -0,0 +1,2281 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, h, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
|
3
|
+
import type { ExtractedAimdFields } from '@airalogy/aimd-core/types'
|
|
4
|
+
import { AimdEditor } from '@airalogy/aimd-editor/vue'
|
|
5
|
+
import type { AimdEditorProps } from '@airalogy/aimd-editor/vue'
|
|
6
|
+
import type { AimdComponentRenderer } from '@airalogy/aimd-renderer'
|
|
7
|
+
import type { AimdRecorderMessagesInput } from '../locales'
|
|
8
|
+
import type {
|
|
9
|
+
AimdFieldMeta,
|
|
10
|
+
AimdFieldState,
|
|
11
|
+
AimdProtocolRecordData,
|
|
12
|
+
AimdRecorderFieldAdapters,
|
|
13
|
+
AimdStepDetailDisplay,
|
|
14
|
+
AimdTypePlugin,
|
|
15
|
+
FieldEventPayload,
|
|
16
|
+
TableEventPayload,
|
|
17
|
+
} from '../types'
|
|
18
|
+
import { createEmptyProtocolRecordData } from '../types'
|
|
19
|
+
import {
|
|
20
|
+
getRecordDataSignature,
|
|
21
|
+
normalizeCheckFields,
|
|
22
|
+
normalizeIncomingRecord,
|
|
23
|
+
normalizeQuizFields,
|
|
24
|
+
normalizeStepFields,
|
|
25
|
+
normalizeVarTableFields,
|
|
26
|
+
} from '../composables/useRecordState'
|
|
27
|
+
import type { AimdWorkbenchFieldDescriptor, AimdWorkbenchFieldType } from '../composables/workbenchFieldEditing'
|
|
28
|
+
import {
|
|
29
|
+
appendWorkbenchField,
|
|
30
|
+
deleteWorkbenchField,
|
|
31
|
+
generateNextWorkbenchFieldId,
|
|
32
|
+
insertWorkbenchField,
|
|
33
|
+
moveWorkbenchField,
|
|
34
|
+
scanWorkbenchFields,
|
|
35
|
+
updateWorkbenchFieldRaw,
|
|
36
|
+
updateWorkbenchFieldId,
|
|
37
|
+
updateWorkbenchFieldKind,
|
|
38
|
+
updateWorkbenchVarValueType,
|
|
39
|
+
} from '../composables/workbenchFieldEditing'
|
|
40
|
+
import AimdRecorder from './AimdRecorder.vue'
|
|
41
|
+
import AimdRecorderWysiwygSurface from './AimdRecorderWysiwygSurface.vue'
|
|
42
|
+
import type { RecorderMilkdownFieldIdentity } from './recorderMilkdownPlugin'
|
|
43
|
+
|
|
44
|
+
type WorkbenchEditorProps = Partial<Omit<AimdEditorProps, 'modelValue' | 'mode'>>
|
|
45
|
+
type WorkbenchSideTab = 'recorder' | 'structure' | 'record' | 'detached'
|
|
46
|
+
|
|
47
|
+
const props = withDefaults(defineProps<{
|
|
48
|
+
content?: string
|
|
49
|
+
modelValue?: Partial<AimdProtocolRecordData>
|
|
50
|
+
locale?: string
|
|
51
|
+
readonly?: boolean
|
|
52
|
+
currentUserName?: string
|
|
53
|
+
now?: Date | string | number
|
|
54
|
+
messages?: AimdRecorderMessagesInput
|
|
55
|
+
stepDetailDisplay?: AimdStepDetailDisplay
|
|
56
|
+
fieldMeta?: Record<string, AimdFieldMeta>
|
|
57
|
+
fieldState?: Record<string, AimdFieldState>
|
|
58
|
+
wrapField?: (fieldKey: string, fieldType: string, defaultVNode: any) => any
|
|
59
|
+
customRenderers?: Partial<Record<string, AimdComponentRenderer>>
|
|
60
|
+
fieldAdapters?: AimdRecorderFieldAdapters
|
|
61
|
+
resolveFile?: (src: string) => string | null
|
|
62
|
+
typePlugins?: AimdTypePlugin[]
|
|
63
|
+
editorMode?: 'source' | 'wysiwyg'
|
|
64
|
+
editorProps?: WorkbenchEditorProps
|
|
65
|
+
editorTitle?: string
|
|
66
|
+
recorderTitle?: string
|
|
67
|
+
recordDataTitle?: string
|
|
68
|
+
detachedDataTitle?: string
|
|
69
|
+
detachedDataDescription?: string
|
|
70
|
+
fieldStructureTitle?: string
|
|
71
|
+
fieldStructureDescription?: string
|
|
72
|
+
showFieldStructure?: boolean
|
|
73
|
+
showVisualEditToggle?: boolean
|
|
74
|
+
initialVisualEditMode?: boolean
|
|
75
|
+
allowRawFieldSourceEditing?: boolean
|
|
76
|
+
showRecordData?: boolean
|
|
77
|
+
showDetachedData?: boolean
|
|
78
|
+
fitViewport?: boolean
|
|
79
|
+
viewportOffset?: number
|
|
80
|
+
editorMinHeight?: number
|
|
81
|
+
recorderMinHeight?: number
|
|
82
|
+
}>(), {
|
|
83
|
+
content: '',
|
|
84
|
+
modelValue: undefined,
|
|
85
|
+
locale: undefined,
|
|
86
|
+
readonly: false,
|
|
87
|
+
currentUserName: undefined,
|
|
88
|
+
now: undefined,
|
|
89
|
+
messages: undefined,
|
|
90
|
+
stepDetailDisplay: 'auto',
|
|
91
|
+
fieldMeta: undefined,
|
|
92
|
+
fieldState: undefined,
|
|
93
|
+
wrapField: undefined,
|
|
94
|
+
customRenderers: undefined,
|
|
95
|
+
fieldAdapters: undefined,
|
|
96
|
+
resolveFile: undefined,
|
|
97
|
+
typePlugins: undefined,
|
|
98
|
+
editorMode: 'source',
|
|
99
|
+
editorProps: undefined,
|
|
100
|
+
editorTitle: undefined,
|
|
101
|
+
recorderTitle: undefined,
|
|
102
|
+
recordDataTitle: undefined,
|
|
103
|
+
detachedDataTitle: undefined,
|
|
104
|
+
detachedDataDescription: undefined,
|
|
105
|
+
fieldStructureTitle: undefined,
|
|
106
|
+
fieldStructureDescription: undefined,
|
|
107
|
+
showFieldStructure: false,
|
|
108
|
+
showVisualEditToggle: true,
|
|
109
|
+
initialVisualEditMode: false,
|
|
110
|
+
allowRawFieldSourceEditing: true,
|
|
111
|
+
showRecordData: false,
|
|
112
|
+
showDetachedData: true,
|
|
113
|
+
fitViewport: true,
|
|
114
|
+
viewportOffset: 24,
|
|
115
|
+
editorMinHeight: 560,
|
|
116
|
+
recorderMinHeight: 560,
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const emit = defineEmits<{
|
|
120
|
+
(e: 'update:content', value: string): void
|
|
121
|
+
(e: 'update:modelValue', value: AimdProtocolRecordData): void
|
|
122
|
+
(e: 'update:editorMode', mode: 'source' | 'wysiwyg'): void
|
|
123
|
+
(e: 'editor-ready', editor: { monaco?: any, milkdown?: any }): void
|
|
124
|
+
(e: 'fields-change', fields: ExtractedAimdFields): void
|
|
125
|
+
(e: 'error', message: string): void
|
|
126
|
+
(e: 'field-change', payload: FieldEventPayload): void
|
|
127
|
+
(e: 'field-blur', payload: FieldEventPayload): void
|
|
128
|
+
(e: 'assigner-request', payload: FieldEventPayload): void
|
|
129
|
+
(e: 'assigner-cancel', payload: FieldEventPayload): void
|
|
130
|
+
(e: 'table-add-row', payload: TableEventPayload): void
|
|
131
|
+
(e: 'table-remove-row', payload: TableEventPayload): void
|
|
132
|
+
}>()
|
|
133
|
+
|
|
134
|
+
const EMPTY_FIELDS: ExtractedAimdFields = {
|
|
135
|
+
var: [],
|
|
136
|
+
var_table: [],
|
|
137
|
+
client_assigner: [],
|
|
138
|
+
quiz: [],
|
|
139
|
+
step: [],
|
|
140
|
+
check: [],
|
|
141
|
+
ref_step: [],
|
|
142
|
+
ref_var: [],
|
|
143
|
+
ref_fig: [],
|
|
144
|
+
cite: [],
|
|
145
|
+
fig: [],
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const editorRef = ref<InstanceType<typeof AimdEditor> | null>(null)
|
|
149
|
+
const recorderRef = ref<InstanceType<typeof AimdRecorder> | null>(null)
|
|
150
|
+
const workbenchRef = ref<HTMLElement | null>(null)
|
|
151
|
+
const editorPanelHeadRef = ref<HTMLElement | null>(null)
|
|
152
|
+
const sidePanelHeadRef = ref<HTMLElement | null>(null)
|
|
153
|
+
const editorPanelBodyRef = ref<HTMLElement | null>(null)
|
|
154
|
+
const sidePanelBodyRef = ref<HTMLElement | null>(null)
|
|
155
|
+
const recorderToolbarRef = ref<HTMLElement | null>(null)
|
|
156
|
+
const extractedFields = ref<ExtractedAimdFields>(EMPTY_FIELDS)
|
|
157
|
+
const contentDraft = ref(props.content || '')
|
|
158
|
+
const visualContentDraft = ref(props.content || '')
|
|
159
|
+
const recordSnapshot = ref<AimdProtocolRecordData>(normalizeIncomingRecord(props.modelValue))
|
|
160
|
+
const draggedFieldUid = ref<string | null>(null)
|
|
161
|
+
const visualEditMode = ref(props.initialVisualEditMode)
|
|
162
|
+
const activeContentSurface = ref<'source' | 'visual' | null>(null)
|
|
163
|
+
const activeSideTab = ref<WorkbenchSideTab>('recorder')
|
|
164
|
+
const viewportEditorMinHeight = ref(props.editorMinHeight)
|
|
165
|
+
const viewportSideBodyHeight = ref(props.recorderMinHeight)
|
|
166
|
+
const viewportVisualEditorMinHeight = ref(Math.max(320, props.recorderMinHeight))
|
|
167
|
+
const activeFieldEditor = ref<AimdWorkbenchFieldDescriptor | null>(null)
|
|
168
|
+
const fieldEditorRawDraft = ref('')
|
|
169
|
+
const fieldInsertMenuIndex = ref<number | null>(null)
|
|
170
|
+
let viewportLayoutFrame = 0
|
|
171
|
+
let visualContentSyncTimer: ReturnType<typeof setTimeout> | null = null
|
|
172
|
+
let pendingContentEchoes: string[] = []
|
|
173
|
+
let recentSourceDraftCleanupTimers = new Map<string, ReturnType<typeof setTimeout>>()
|
|
174
|
+
let recentVisualProgrammaticCleanupTimers = new Map<string, ReturnType<typeof setTimeout>>()
|
|
175
|
+
const recentSourceDraftValues = new Set<string>()
|
|
176
|
+
const recentVisualProgrammaticValues = new Set<string>()
|
|
177
|
+
const VISUAL_CONTENT_SYNC_DELAY_MS = 120
|
|
178
|
+
const RECENT_SOURCE_DRAFT_RETENTION_MS = 1600
|
|
179
|
+
const RECENT_VISUAL_PROGRAMMATIC_RETENTION_MS = 2000
|
|
180
|
+
|
|
181
|
+
function normalizeIncomingContent(value: string | undefined) {
|
|
182
|
+
return value ?? ''
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function trackPendingContentEcho(value: string) {
|
|
186
|
+
if (pendingContentEchoes[pendingContentEchoes.length - 1] === value) {
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
pendingContentEchoes.push(value)
|
|
191
|
+
if (pendingContentEchoes.length > 16) {
|
|
192
|
+
pendingContentEchoes = pendingContentEchoes.slice(-16)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function clearVisualContentSyncTimer() {
|
|
197
|
+
if (visualContentSyncTimer !== null) {
|
|
198
|
+
clearTimeout(visualContentSyncTimer)
|
|
199
|
+
visualContentSyncTimer = null
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function trackRecentValue(
|
|
204
|
+
target: Set<string>,
|
|
205
|
+
timers: Map<string, ReturnType<typeof setTimeout>>,
|
|
206
|
+
value: string,
|
|
207
|
+
retentionMs: number,
|
|
208
|
+
) {
|
|
209
|
+
target.add(value)
|
|
210
|
+
const existingTimer = timers.get(value)
|
|
211
|
+
if (existingTimer) {
|
|
212
|
+
clearTimeout(existingTimer)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
timers.set(value, setTimeout(() => {
|
|
216
|
+
target.delete(value)
|
|
217
|
+
timers.delete(value)
|
|
218
|
+
}, retentionMs))
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function clearTrackedRecentValues(
|
|
222
|
+
target: Set<string>,
|
|
223
|
+
timers: Map<string, ReturnType<typeof setTimeout>>,
|
|
224
|
+
) {
|
|
225
|
+
for (const timer of timers.values()) {
|
|
226
|
+
clearTimeout(timer)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
target.clear()
|
|
230
|
+
timers.clear()
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function trackRecentSourceDraft(value: string) {
|
|
234
|
+
trackRecentValue(
|
|
235
|
+
recentSourceDraftValues,
|
|
236
|
+
recentSourceDraftCleanupTimers,
|
|
237
|
+
value,
|
|
238
|
+
RECENT_SOURCE_DRAFT_RETENTION_MS,
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function trackRecentVisualProgrammaticValue(value: string) {
|
|
243
|
+
trackRecentValue(
|
|
244
|
+
recentVisualProgrammaticValues,
|
|
245
|
+
recentVisualProgrammaticCleanupTimers,
|
|
246
|
+
value,
|
|
247
|
+
RECENT_VISUAL_PROGRAMMATIC_RETENTION_MS,
|
|
248
|
+
)
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function syncVisualContentNow(value: string) {
|
|
252
|
+
clearVisualContentSyncTimer()
|
|
253
|
+
trackRecentVisualProgrammaticValue(value)
|
|
254
|
+
visualContentDraft.value = value
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function scheduleVisualContentSync(value: string) {
|
|
258
|
+
clearVisualContentSyncTimer()
|
|
259
|
+
visualContentSyncTimer = setTimeout(() => {
|
|
260
|
+
visualContentSyncTimer = null
|
|
261
|
+
trackRecentVisualProgrammaticValue(value)
|
|
262
|
+
visualContentDraft.value = value
|
|
263
|
+
}, VISUAL_CONTENT_SYNC_DELAY_MS)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function syncContentDraftFromProp(value: string | undefined) {
|
|
267
|
+
const normalized = normalizeIncomingContent(value)
|
|
268
|
+
const pendingIndex = pendingContentEchoes.indexOf(normalized)
|
|
269
|
+
if (pendingIndex !== -1) {
|
|
270
|
+
pendingContentEchoes = pendingContentEchoes.slice(pendingIndex + 1)
|
|
271
|
+
return
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (normalized === contentDraft.value) {
|
|
275
|
+
syncVisualContentNow(normalized)
|
|
276
|
+
return
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
pendingContentEchoes = []
|
|
280
|
+
contentDraft.value = normalized
|
|
281
|
+
syncVisualContentNow(normalized)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function applyLocalContentUpdate(nextContent: string) {
|
|
285
|
+
if (nextContent === contentDraft.value) {
|
|
286
|
+
return false
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
contentDraft.value = nextContent
|
|
290
|
+
trackPendingContentEcho(nextContent)
|
|
291
|
+
return true
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
watch(() => props.initialVisualEditMode, (value) => {
|
|
295
|
+
visualEditMode.value = value
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
watch(() => props.content, (value) => {
|
|
299
|
+
syncContentDraftFromProp(value)
|
|
300
|
+
}, { immediate: true })
|
|
301
|
+
|
|
302
|
+
watch(visualEditMode, (enabled) => {
|
|
303
|
+
if (enabled) {
|
|
304
|
+
syncVisualContentNow(contentDraft.value)
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
watch(() => props.modelValue, (value) => {
|
|
309
|
+
const normalized = normalizeIncomingRecord(value)
|
|
310
|
+
if (getRecordDataSignature(normalized) === getRecordDataSignature(recordSnapshot.value)) {
|
|
311
|
+
return
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
recordSnapshot.value = normalized
|
|
315
|
+
}, { deep: true, immediate: true })
|
|
316
|
+
|
|
317
|
+
const isZhLocale = computed(() => {
|
|
318
|
+
const locale = `${props.editorProps?.locale ?? props.locale ?? ''}`.trim().toLowerCase()
|
|
319
|
+
return locale.startsWith('zh')
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
const editorTitleLabel = computed(() => (
|
|
323
|
+
props.editorTitle
|
|
324
|
+
?? (isZhLocale.value ? 'Protocol 源码' : 'Protocol Source')
|
|
325
|
+
))
|
|
326
|
+
|
|
327
|
+
const recorderTitleLabel = computed(() => (
|
|
328
|
+
props.recorderTitle
|
|
329
|
+
?? (isZhLocale.value ? 'Recorder 录入' : 'Recorder')
|
|
330
|
+
))
|
|
331
|
+
|
|
332
|
+
const recordDataTitleLabel = computed(() => (
|
|
333
|
+
props.recordDataTitle
|
|
334
|
+
?? (isZhLocale.value ? 'Record 数据' : 'Record Data')
|
|
335
|
+
))
|
|
336
|
+
|
|
337
|
+
const detachedDataTitleLabel = computed(() => (
|
|
338
|
+
props.detachedDataTitle
|
|
339
|
+
?? (isZhLocale.value ? '脱离当前 Protocol 的旧数据' : 'Detached Data')
|
|
340
|
+
))
|
|
341
|
+
|
|
342
|
+
const detachedDataDescriptionLabel = computed(() => (
|
|
343
|
+
props.detachedDataDescription
|
|
344
|
+
?? (isZhLocale.value
|
|
345
|
+
? '这些值对应的字段 id 已不在当前 protocol 结构里。改结构、重命名或删字段之后,可以从这里把旧值搬到新 field。'
|
|
346
|
+
: 'These values belong to field ids that are no longer present in the current protocol. After restructuring, renaming, or removing fields, copy them into newly created fields here.')
|
|
347
|
+
))
|
|
348
|
+
|
|
349
|
+
const fieldStructureTitleLabel = computed(() => (
|
|
350
|
+
props.fieldStructureTitle
|
|
351
|
+
?? (isZhLocale.value ? 'Field 结构编辑' : 'Field Structure')
|
|
352
|
+
))
|
|
353
|
+
|
|
354
|
+
const fieldStructureDescriptionLabel = computed(() => (
|
|
355
|
+
props.fieldStructureDescription
|
|
356
|
+
?? (isZhLocale.value
|
|
357
|
+
? '这里可以直接改 recorder field 的 kind、id 和顺序,也可以新增或删除 field。按住每个字段顶部的“拖动排序”即可重排。拖拽当前是按源码片段重排;如果 field 嵌在句子里,周围 prose 仍可在左侧源码里继续微调。'
|
|
358
|
+
: 'Edit recorder field kind, id, and order here, and add or remove fields without leaving the editor. Grab the “Drag to reorder” handle at the top of each field to move it. Dragging currently reorders source fragments; if a field is embedded inside prose, you can fine-tune the surrounding text in the source editor.')
|
|
359
|
+
))
|
|
360
|
+
|
|
361
|
+
const visualEditSummaryLabel = computed(() => (
|
|
362
|
+
isZhLocale.value
|
|
363
|
+
? '右侧切到 recorder-aware 所见即所得编辑器,字段会直接显示为可交互 recorder widget'
|
|
364
|
+
: 'Switch the right side into a recorder-aware WYSIWYG editor with real recorder widgets and full caret-based Markdown editing'
|
|
365
|
+
))
|
|
366
|
+
|
|
367
|
+
const workbenchUi = computed(() => (
|
|
368
|
+
isZhLocale.value
|
|
369
|
+
? {
|
|
370
|
+
visualEditOn: '可视化编辑开',
|
|
371
|
+
visualEditOff: '可视化编辑关',
|
|
372
|
+
kind: '字段类型',
|
|
373
|
+
id: '字段 ID',
|
|
374
|
+
valueType: '值类型',
|
|
375
|
+
empty: '当前 protocol 里还没有可录入 field。可以先从下面新增一个。',
|
|
376
|
+
delete: '删除',
|
|
377
|
+
edit: '编辑字段',
|
|
378
|
+
close: '关闭',
|
|
379
|
+
drag: '拖动排序',
|
|
380
|
+
dropHere: '拖到这里',
|
|
381
|
+
source: 'Field AIMD 片段',
|
|
382
|
+
sourceHint: '高级:如果这个 field 还有更复杂的内容,可以直接改它的 AIMD 片段。',
|
|
383
|
+
applySource: '应用片段',
|
|
384
|
+
visualDialogTitle: '编辑字段',
|
|
385
|
+
visualDialogSummary: '直接在 recorder 主界面里修改字段结构。',
|
|
386
|
+
addVar: '新增 Var',
|
|
387
|
+
addTable: '新增 Table',
|
|
388
|
+
addStep: '新增 Step',
|
|
389
|
+
addCheck: '新增 Check',
|
|
390
|
+
addQuiz: '新增 Quiz',
|
|
391
|
+
addEndHint: '可视化编辑开启后,右侧会切到 recorder-aware 所见即所得编辑器,可以在任意光标位置补充标题、Markdown,并直接编辑真实的 recorder field widget。',
|
|
392
|
+
typeLabels: {
|
|
393
|
+
var: 'Var',
|
|
394
|
+
var_table: 'Var Table',
|
|
395
|
+
step: 'Step',
|
|
396
|
+
check: 'Check',
|
|
397
|
+
quiz: 'Quiz',
|
|
398
|
+
} as Record<AimdWorkbenchFieldType, string>,
|
|
399
|
+
}
|
|
400
|
+
: {
|
|
401
|
+
visualEditOn: 'Visual Edit On',
|
|
402
|
+
visualEditOff: 'Visual Edit Off',
|
|
403
|
+
kind: 'Field Kind',
|
|
404
|
+
id: 'Field ID',
|
|
405
|
+
valueType: 'Value Type',
|
|
406
|
+
empty: 'There are no recorder-editable fields in the current protocol yet. Add one below to start filling data immediately.',
|
|
407
|
+
delete: 'Delete',
|
|
408
|
+
edit: 'Edit Field',
|
|
409
|
+
close: 'Close',
|
|
410
|
+
drag: 'Drag to reorder',
|
|
411
|
+
dropHere: 'Drop here',
|
|
412
|
+
source: 'Field AIMD',
|
|
413
|
+
sourceHint: 'Advanced: edit the raw AIMD snippet when this field needs more than the basic controls.',
|
|
414
|
+
applySource: 'Apply Snippet',
|
|
415
|
+
visualDialogTitle: 'Edit Field',
|
|
416
|
+
visualDialogSummary: 'Adjust the field structure directly inside the recorder.',
|
|
417
|
+
addVar: 'Add Var',
|
|
418
|
+
addTable: 'Add Table',
|
|
419
|
+
addStep: 'Add Step',
|
|
420
|
+
addCheck: 'Add Check',
|
|
421
|
+
addQuiz: 'Add Quiz',
|
|
422
|
+
addEndHint: 'When visual editing is on, the right side becomes a recorder-aware WYSIWYG editor so users can add headings, Markdown, and real recorder field widgets anywhere the caret can land.',
|
|
423
|
+
typeLabels: {
|
|
424
|
+
var: 'Var',
|
|
425
|
+
var_table: 'Var Table',
|
|
426
|
+
step: 'Step',
|
|
427
|
+
check: 'Check',
|
|
428
|
+
quiz: 'Quiz',
|
|
429
|
+
} as Record<AimdWorkbenchFieldType, string>,
|
|
430
|
+
}
|
|
431
|
+
))
|
|
432
|
+
|
|
433
|
+
function getViewportHeight() {
|
|
434
|
+
if (typeof window === 'undefined') {
|
|
435
|
+
return 0
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return window.visualViewport?.height ?? window.innerHeight
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function getElementHeight(element: Element | null | undefined) {
|
|
442
|
+
return element?.getBoundingClientRect().height ?? 0
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function updateViewportPanelHeights() {
|
|
446
|
+
if (!props.fitViewport || typeof window === 'undefined') {
|
|
447
|
+
viewportEditorMinHeight.value = props.editorMinHeight
|
|
448
|
+
viewportSideBodyHeight.value = props.recorderMinHeight
|
|
449
|
+
return
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const workbenchTop = Math.max(workbenchRef.value?.getBoundingClientRect().top ?? 0, 0)
|
|
453
|
+
const availableViewportHeight = Math.max(0, Math.floor(getViewportHeight() - workbenchTop - props.viewportOffset))
|
|
454
|
+
const editorToolbarHeight = getElementHeight(editorPanelBodyRef.value?.querySelector('.aimd-editor-toolbar'))
|
|
455
|
+
const editorHeaderHeight = getElementHeight(editorPanelHeadRef.value)
|
|
456
|
+
const sideHeaderHeight = getElementHeight(sidePanelHeadRef.value)
|
|
457
|
+
const sideBodyHeight = Math.max(
|
|
458
|
+
props.recorderMinHeight,
|
|
459
|
+
Math.floor(availableViewportHeight - sideHeaderHeight),
|
|
460
|
+
)
|
|
461
|
+
const recorderToolbarHeight = getElementHeight(recorderToolbarRef.value)
|
|
462
|
+
const visualEditorToolbarHeight = getElementHeight(sidePanelBodyRef.value?.querySelector('.aimd-editor-toolbar'))
|
|
463
|
+
|
|
464
|
+
viewportEditorMinHeight.value = Math.max(
|
|
465
|
+
props.editorMinHeight,
|
|
466
|
+
Math.floor(availableViewportHeight - editorHeaderHeight - editorToolbarHeight),
|
|
467
|
+
)
|
|
468
|
+
viewportSideBodyHeight.value = sideBodyHeight
|
|
469
|
+
viewportVisualEditorMinHeight.value = Math.max(
|
|
470
|
+
320,
|
|
471
|
+
Math.floor(sideBodyHeight - recorderToolbarHeight - visualEditorToolbarHeight),
|
|
472
|
+
)
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
function scheduleViewportPanelHeights() {
|
|
476
|
+
if (typeof window === 'undefined') {
|
|
477
|
+
return
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (viewportLayoutFrame) {
|
|
481
|
+
window.cancelAnimationFrame(viewportLayoutFrame)
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
viewportLayoutFrame = window.requestAnimationFrame(() => {
|
|
485
|
+
viewportLayoutFrame = 0
|
|
486
|
+
updateViewportPanelHeights()
|
|
487
|
+
})
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const editorBindings = computed(() => {
|
|
491
|
+
const editorProps = props.editorProps ?? {}
|
|
492
|
+
|
|
493
|
+
return {
|
|
494
|
+
...editorProps,
|
|
495
|
+
modelValue: contentDraft.value,
|
|
496
|
+
mode: props.editorMode,
|
|
497
|
+
locale: editorProps.locale ?? props.locale,
|
|
498
|
+
minHeight: editorProps.minHeight ?? viewportEditorMinHeight.value,
|
|
499
|
+
readonly: props.readonly || editorProps.readonly === true,
|
|
500
|
+
}
|
|
501
|
+
})
|
|
502
|
+
|
|
503
|
+
const editableFields = computed(() => scanWorkbenchFields(contentDraft.value))
|
|
504
|
+
const editableFieldMap = computed(() => {
|
|
505
|
+
const map = new Map<string, AimdWorkbenchFieldDescriptor>()
|
|
506
|
+
for (const field of editableFields.value) {
|
|
507
|
+
map.set(`${field.fieldType}:${field.id}`, field)
|
|
508
|
+
}
|
|
509
|
+
return map
|
|
510
|
+
})
|
|
511
|
+
const editableFieldIndexByUid = computed(() => {
|
|
512
|
+
const map = new Map<string, number>()
|
|
513
|
+
editableFields.value.forEach((field, index) => {
|
|
514
|
+
map.set(field.uid, index)
|
|
515
|
+
})
|
|
516
|
+
return map
|
|
517
|
+
})
|
|
518
|
+
|
|
519
|
+
function matchEditableField(
|
|
520
|
+
fields: AimdWorkbenchFieldDescriptor[],
|
|
521
|
+
field: AimdWorkbenchFieldDescriptor,
|
|
522
|
+
expected?: { fieldType: AimdWorkbenchFieldType, id: string },
|
|
523
|
+
) {
|
|
524
|
+
if (expected) {
|
|
525
|
+
const byIdentity = fields.find(candidate => candidate.fieldType === expected.fieldType && candidate.id === expected.id)
|
|
526
|
+
if (byIdentity) {
|
|
527
|
+
return byIdentity
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return (
|
|
532
|
+
fields.find(candidate => candidate.start === field.start)
|
|
533
|
+
?? fields.find(candidate => candidate.uid === field.uid)
|
|
534
|
+
?? fields.find(candidate => candidate.fieldType === field.fieldType && candidate.id === field.id)
|
|
535
|
+
?? null
|
|
536
|
+
)
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function collectDetachedRecordData(
|
|
540
|
+
record: AimdProtocolRecordData,
|
|
541
|
+
fields: ExtractedAimdFields,
|
|
542
|
+
): AimdProtocolRecordData {
|
|
543
|
+
const detached = createEmptyProtocolRecordData()
|
|
544
|
+
const activeVarIds = new Set<string>(fields.var)
|
|
545
|
+
const activeStepIds = new Set(normalizeStepFields(fields.step).map(step => step.name))
|
|
546
|
+
const activeCheckIds = new Set(normalizeCheckFields(fields.check).map(check => check.name))
|
|
547
|
+
const activeQuizIds = new Set(normalizeQuizFields(fields.quiz).map(quiz => quiz.id))
|
|
548
|
+
|
|
549
|
+
for (const table of normalizeVarTableFields(fields.var_table)) {
|
|
550
|
+
activeVarIds.add(table.id)
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
for (const [key, value] of Object.entries(record.var)) {
|
|
554
|
+
if (!activeVarIds.has(key)) {
|
|
555
|
+
detached.var[key] = value
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
for (const [key, value] of Object.entries(record.step)) {
|
|
560
|
+
if (!activeStepIds.has(key)) {
|
|
561
|
+
detached.step[key] = value
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
for (const [key, value] of Object.entries(record.check)) {
|
|
566
|
+
if (!activeCheckIds.has(key)) {
|
|
567
|
+
detached.check[key] = value
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
for (const [key, value] of Object.entries(record.quiz)) {
|
|
572
|
+
if (!activeQuizIds.has(key)) {
|
|
573
|
+
detached.quiz[key] = value
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
return detached
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function countRecordEntries(record: AimdProtocolRecordData): number {
|
|
581
|
+
return (
|
|
582
|
+
Object.keys(record.var).length
|
|
583
|
+
+ Object.keys(record.step).length
|
|
584
|
+
+ Object.keys(record.check).length
|
|
585
|
+
+ Object.keys(record.quiz).length
|
|
586
|
+
)
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
const detachedRecord = computed(() => collectDetachedRecordData(recordSnapshot.value, extractedFields.value))
|
|
590
|
+
const detachedEntryCount = computed(() => countRecordEntries(detachedRecord.value))
|
|
591
|
+
const hasDetachedData = computed(() => detachedEntryCount.value > 0)
|
|
592
|
+
|
|
593
|
+
const recordJson = computed(() => JSON.stringify(recordSnapshot.value, null, 2))
|
|
594
|
+
const detachedRecordJson = computed(() => JSON.stringify(detachedRecord.value, null, 2))
|
|
595
|
+
const sidePanelBodyStyle = computed(() => ({
|
|
596
|
+
height: `${viewportSideBodyHeight.value}px`,
|
|
597
|
+
}))
|
|
598
|
+
const sideTabs = computed(() => {
|
|
599
|
+
const tabs: Array<{ key: WorkbenchSideTab, label: string, badge?: number }> = [
|
|
600
|
+
{ key: 'recorder', label: recorderTitleLabel.value },
|
|
601
|
+
]
|
|
602
|
+
|
|
603
|
+
if (props.showFieldStructure) {
|
|
604
|
+
tabs.push({ key: 'structure', label: fieldStructureTitleLabel.value })
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if (props.showRecordData) {
|
|
608
|
+
tabs.push({ key: 'record', label: recordDataTitleLabel.value })
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (props.showDetachedData && hasDetachedData.value) {
|
|
612
|
+
tabs.push({
|
|
613
|
+
key: 'detached',
|
|
614
|
+
label: detachedDataTitleLabel.value,
|
|
615
|
+
badge: detachedEntryCount.value,
|
|
616
|
+
})
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return tabs
|
|
620
|
+
})
|
|
621
|
+
const showSideTabs = computed(() => sideTabs.value.length > 1)
|
|
622
|
+
const activeSideTabConfig = computed(() => (
|
|
623
|
+
sideTabs.value.find(tab => tab.key === activeSideTab.value) ?? sideTabs.value[0]
|
|
624
|
+
))
|
|
625
|
+
const activeSideTitleLabel = computed(() => activeSideTabConfig.value?.label ?? recorderTitleLabel.value)
|
|
626
|
+
|
|
627
|
+
watch(sideTabs, (tabs) => {
|
|
628
|
+
if (!tabs.some(tab => tab.key === activeSideTab.value)) {
|
|
629
|
+
activeSideTab.value = 'recorder'
|
|
630
|
+
}
|
|
631
|
+
}, { immediate: true })
|
|
632
|
+
|
|
633
|
+
watch([visualEditMode, activeSideTab], ([isVisualEditEnabled, sideTab]) => {
|
|
634
|
+
if (!isVisualEditEnabled || sideTab !== 'recorder') {
|
|
635
|
+
closeFieldEditor()
|
|
636
|
+
fieldInsertMenuIndex.value = null
|
|
637
|
+
}
|
|
638
|
+
})
|
|
639
|
+
|
|
640
|
+
watch(editableFields, (fields) => {
|
|
641
|
+
if (!activeFieldEditor.value) {
|
|
642
|
+
return
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const refreshed = matchEditableField(fields, activeFieldEditor.value)
|
|
646
|
+
if (!refreshed) {
|
|
647
|
+
closeFieldEditor()
|
|
648
|
+
return
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
activeFieldEditor.value = refreshed
|
|
652
|
+
fieldEditorRawDraft.value = refreshed.raw
|
|
653
|
+
})
|
|
654
|
+
|
|
655
|
+
watch(
|
|
656
|
+
[
|
|
657
|
+
activeSideTab,
|
|
658
|
+
visualEditMode,
|
|
659
|
+
hasDetachedData,
|
|
660
|
+
() => props.fitViewport,
|
|
661
|
+
() => props.viewportOffset,
|
|
662
|
+
() => props.editorMinHeight,
|
|
663
|
+
() => props.recorderMinHeight,
|
|
664
|
+
() => props.editorMode,
|
|
665
|
+
],
|
|
666
|
+
async () => {
|
|
667
|
+
await nextTick()
|
|
668
|
+
scheduleViewportPanelHeights()
|
|
669
|
+
},
|
|
670
|
+
{ immediate: true },
|
|
671
|
+
)
|
|
672
|
+
|
|
673
|
+
onMounted(async () => {
|
|
674
|
+
await nextTick()
|
|
675
|
+
scheduleViewportPanelHeights()
|
|
676
|
+
|
|
677
|
+
if (typeof window !== 'undefined') {
|
|
678
|
+
window.addEventListener('resize', scheduleViewportPanelHeights, { passive: true })
|
|
679
|
+
window.addEventListener('scroll', scheduleViewportPanelHeights, { passive: true })
|
|
680
|
+
window.visualViewport?.addEventListener('resize', scheduleViewportPanelHeights)
|
|
681
|
+
window.visualViewport?.addEventListener('scroll', scheduleViewportPanelHeights)
|
|
682
|
+
}
|
|
683
|
+
})
|
|
684
|
+
|
|
685
|
+
onBeforeUnmount(() => {
|
|
686
|
+
if (typeof window !== 'undefined') {
|
|
687
|
+
window.removeEventListener('resize', scheduleViewportPanelHeights)
|
|
688
|
+
window.removeEventListener('scroll', scheduleViewportPanelHeights)
|
|
689
|
+
window.visualViewport?.removeEventListener('resize', scheduleViewportPanelHeights)
|
|
690
|
+
window.visualViewport?.removeEventListener('scroll', scheduleViewportPanelHeights)
|
|
691
|
+
|
|
692
|
+
if (viewportLayoutFrame) {
|
|
693
|
+
window.cancelAnimationFrame(viewportLayoutFrame)
|
|
694
|
+
viewportLayoutFrame = 0
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
clearVisualContentSyncTimer()
|
|
699
|
+
clearTrackedRecentValues(recentSourceDraftValues, recentSourceDraftCleanupTimers)
|
|
700
|
+
clearTrackedRecentValues(recentVisualProgrammaticValues, recentVisualProgrammaticCleanupTimers)
|
|
701
|
+
})
|
|
702
|
+
|
|
703
|
+
function emitContentIfChanged(nextContent: string, visualSync: 'immediate' | 'debounced' = 'immediate') {
|
|
704
|
+
if (!applyLocalContentUpdate(nextContent)) {
|
|
705
|
+
return
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (visualSync === 'debounced') {
|
|
709
|
+
scheduleVisualContentSync(nextContent)
|
|
710
|
+
} else {
|
|
711
|
+
syncVisualContentNow(nextContent)
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
emit('update:content', nextContent)
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
function emitWorkbenchContentChange(
|
|
718
|
+
nextContent: string,
|
|
719
|
+
currentField?: AimdWorkbenchFieldDescriptor,
|
|
720
|
+
expectedField?: { fieldType: AimdWorkbenchFieldType, id: string },
|
|
721
|
+
) {
|
|
722
|
+
if (!applyLocalContentUpdate(nextContent)) {
|
|
723
|
+
return
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
syncVisualContentNow(nextContent)
|
|
727
|
+
|
|
728
|
+
if (currentField || expectedField) {
|
|
729
|
+
const nextFields = scanWorkbenchFields(nextContent)
|
|
730
|
+
const nextField = currentField
|
|
731
|
+
? matchEditableField(nextFields, currentField, expectedField)
|
|
732
|
+
: nextFields.find(field => field.fieldType === expectedField?.fieldType && field.id === expectedField?.id) ?? null
|
|
733
|
+
if (nextField) {
|
|
734
|
+
activeFieldEditor.value = nextField
|
|
735
|
+
fieldEditorRawDraft.value = nextField.raw
|
|
736
|
+
} else if (currentField && activeFieldEditor.value?.uid === currentField.uid) {
|
|
737
|
+
closeFieldEditor()
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
emit('update:content', nextContent)
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function handleEditorContentUpdate(value: string) {
|
|
745
|
+
activeContentSurface.value = 'source'
|
|
746
|
+
trackRecentSourceDraft(value)
|
|
747
|
+
emitContentIfChanged(value, 'debounced')
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function handleVisualContentUpdate(value: string) {
|
|
751
|
+
if (recentVisualProgrammaticValues.has(value)) {
|
|
752
|
+
return
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if (activeContentSurface.value === 'source' && recentSourceDraftValues.has(value)) {
|
|
756
|
+
return
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
activeContentSurface.value = 'visual'
|
|
760
|
+
emitContentIfChanged(value, 'immediate')
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
function handleSourceSurfaceFocusIn() {
|
|
764
|
+
activeContentSurface.value = 'source'
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
function handleVisualSurfaceFocusIn() {
|
|
768
|
+
activeContentSurface.value = 'visual'
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function handleContentSurfaceFocusOut(
|
|
772
|
+
surface: 'source' | 'visual',
|
|
773
|
+
event: FocusEvent,
|
|
774
|
+
) {
|
|
775
|
+
const currentTarget = event.currentTarget
|
|
776
|
+
const relatedTarget = event.relatedTarget
|
|
777
|
+
if (currentTarget instanceof Node && relatedTarget instanceof Node && currentTarget.contains(relatedTarget)) {
|
|
778
|
+
return
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (activeContentSurface.value === surface) {
|
|
782
|
+
activeContentSurface.value = null
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function handleRecordUpdate(value: AimdProtocolRecordData) {
|
|
787
|
+
recordSnapshot.value = normalizeIncomingRecord(value)
|
|
788
|
+
emit('update:modelValue', value)
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
function handleFieldsChange(fields: ExtractedAimdFields) {
|
|
792
|
+
extractedFields.value = fields
|
|
793
|
+
emit('fields-change', fields)
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function handleAddField(fieldType: AimdWorkbenchFieldType) {
|
|
797
|
+
const nextId = generateNextWorkbenchFieldId(editableFields.value, fieldType)
|
|
798
|
+
emitWorkbenchContentChange(appendWorkbenchField(contentDraft.value, fieldType, {
|
|
799
|
+
id: nextId,
|
|
800
|
+
valueType: fieldType === 'var' ? 'str' : undefined,
|
|
801
|
+
}), undefined, {
|
|
802
|
+
fieldType,
|
|
803
|
+
id: nextId,
|
|
804
|
+
})
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function handleDeleteField(field: AimdWorkbenchFieldDescriptor) {
|
|
808
|
+
if (activeFieldEditor.value?.uid === field.uid) {
|
|
809
|
+
closeFieldEditor()
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
emitContentIfChanged(deleteWorkbenchField(contentDraft.value, field))
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
function commitFieldId(field: AimdWorkbenchFieldDescriptor, nextId: string) {
|
|
816
|
+
const normalizedId = nextId.trim()
|
|
817
|
+
if (!normalizedId) {
|
|
818
|
+
return
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
emitWorkbenchContentChange(updateWorkbenchFieldId(contentDraft.value, field, normalizedId), field, {
|
|
822
|
+
fieldType: field.fieldType,
|
|
823
|
+
id: normalizedId,
|
|
824
|
+
})
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function handleFieldIdCommit(field: AimdWorkbenchFieldDescriptor, event: Event) {
|
|
828
|
+
commitFieldId(field, (event.target as HTMLInputElement).value)
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
function commitFieldKind(field: AimdWorkbenchFieldDescriptor, nextFieldType: AimdWorkbenchFieldType) {
|
|
832
|
+
emitWorkbenchContentChange(updateWorkbenchFieldKind(contentDraft.value, field, nextFieldType), field, {
|
|
833
|
+
fieldType: nextFieldType,
|
|
834
|
+
id: field.id,
|
|
835
|
+
})
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function handleFieldKindCommit(field: AimdWorkbenchFieldDescriptor, event: Event) {
|
|
839
|
+
commitFieldKind(field, (event.target as HTMLSelectElement).value as AimdWorkbenchFieldType)
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
function commitVarValueType(field: AimdWorkbenchFieldDescriptor, nextValueType: string) {
|
|
843
|
+
emitWorkbenchContentChange(updateWorkbenchVarValueType(contentDraft.value, field, nextValueType), field)
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
function handleVarValueTypeCommit(field: AimdWorkbenchFieldDescriptor, event: Event) {
|
|
847
|
+
commitVarValueType(field, (event.target as HTMLInputElement).value)
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
function openFieldEditor(field: AimdWorkbenchFieldDescriptor) {
|
|
851
|
+
activeFieldEditor.value = field
|
|
852
|
+
fieldEditorRawDraft.value = field.raw
|
|
853
|
+
fieldInsertMenuIndex.value = null
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function closeFieldEditor() {
|
|
857
|
+
activeFieldEditor.value = null
|
|
858
|
+
fieldEditorRawDraft.value = ''
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
function toggleFieldInsertMenu(insertionIndex: number) {
|
|
862
|
+
if (props.readonly) {
|
|
863
|
+
return
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
fieldInsertMenuIndex.value = fieldInsertMenuIndex.value === insertionIndex ? null : insertionIndex
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
function handleInsertField(fieldType: AimdWorkbenchFieldType, insertionIndex: number) {
|
|
870
|
+
const nextId = generateNextWorkbenchFieldId(editableFields.value, fieldType)
|
|
871
|
+
fieldInsertMenuIndex.value = null
|
|
872
|
+
emitWorkbenchContentChange(insertWorkbenchField(
|
|
873
|
+
contentDraft.value,
|
|
874
|
+
editableFields.value,
|
|
875
|
+
insertionIndex,
|
|
876
|
+
fieldType,
|
|
877
|
+
{
|
|
878
|
+
id: nextId,
|
|
879
|
+
valueType: fieldType === 'var' ? 'str' : undefined,
|
|
880
|
+
},
|
|
881
|
+
), undefined, {
|
|
882
|
+
fieldType,
|
|
883
|
+
id: nextId,
|
|
884
|
+
})
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
function handleFieldRawApply() {
|
|
888
|
+
if (!props.allowRawFieldSourceEditing || !activeFieldEditor.value) {
|
|
889
|
+
return
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
emitWorkbenchContentChange(updateWorkbenchFieldRaw(
|
|
893
|
+
contentDraft.value,
|
|
894
|
+
activeFieldEditor.value,
|
|
895
|
+
fieldEditorRawDraft.value,
|
|
896
|
+
), activeFieldEditor.value)
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
function resolveVisualField(field: RecorderMilkdownFieldIdentity) {
|
|
900
|
+
return editableFields.value.find(candidate => (
|
|
901
|
+
candidate.fieldType === field.fieldType
|
|
902
|
+
&& candidate.id === field.id
|
|
903
|
+
)) ?? editableFields.value.find(candidate => candidate.raw === field.raw) ?? null
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
function handleVisualFieldEdit(field: RecorderMilkdownFieldIdentity) {
|
|
907
|
+
const matchedField = resolveVisualField(field)
|
|
908
|
+
if (!matchedField) {
|
|
909
|
+
return
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
openFieldEditor(matchedField)
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
function handleVisualFieldDelete(field: RecorderMilkdownFieldIdentity) {
|
|
916
|
+
const matchedField = resolveVisualField(field)
|
|
917
|
+
if (!matchedField) {
|
|
918
|
+
return
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
handleDeleteField(matchedField)
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
function handleFieldDragStart(field: AimdWorkbenchFieldDescriptor, event: DragEvent) {
|
|
925
|
+
if (props.readonly) {
|
|
926
|
+
event.preventDefault()
|
|
927
|
+
return
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
draggedFieldUid.value = field.uid
|
|
931
|
+
fieldInsertMenuIndex.value = null
|
|
932
|
+
event.dataTransfer?.setData('text/plain', field.uid)
|
|
933
|
+
if (event.dataTransfer) {
|
|
934
|
+
event.dataTransfer.effectAllowed = 'move'
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
function handleFieldDragEnd() {
|
|
939
|
+
draggedFieldUid.value = null
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
function handleStructureDragOver(event: DragEvent) {
|
|
943
|
+
if (props.readonly) {
|
|
944
|
+
return
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
event.preventDefault()
|
|
948
|
+
if (event.dataTransfer) {
|
|
949
|
+
event.dataTransfer.dropEffect = 'move'
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function handleFieldDrop(insertionIndex: number) {
|
|
954
|
+
if (props.readonly || !draggedFieldUid.value) {
|
|
955
|
+
return
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
const movedField = editableFields.value.find(field => field.uid === draggedFieldUid.value)
|
|
959
|
+
const nextContent = moveWorkbenchField(
|
|
960
|
+
contentDraft.value,
|
|
961
|
+
editableFields.value,
|
|
962
|
+
draggedFieldUid.value,
|
|
963
|
+
insertionIndex,
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
draggedFieldUid.value = null
|
|
967
|
+
emitWorkbenchContentChange(nextContent, movedField)
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
function renderVisualInsertEntry(insertionIndex: number) {
|
|
971
|
+
if (draggedFieldUid.value) {
|
|
972
|
+
return [
|
|
973
|
+
h('span', { class: 'aimd-recorder-workbench__drop-zone-label' }, workbenchUi.value.dropHere),
|
|
974
|
+
]
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
if (props.readonly) {
|
|
978
|
+
return undefined
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const isOpen = fieldInsertMenuIndex.value === insertionIndex
|
|
982
|
+
|
|
983
|
+
return [
|
|
984
|
+
h('span', { class: 'aimd-recorder-workbench__visual-insert-wrap' }, [
|
|
985
|
+
h('button', {
|
|
986
|
+
type: 'button',
|
|
987
|
+
class: [
|
|
988
|
+
'aimd-recorder-workbench__visual-insert-trigger',
|
|
989
|
+
isOpen ? 'aimd-recorder-workbench__visual-insert-trigger--active' : '',
|
|
990
|
+
],
|
|
991
|
+
onClick: (event: MouseEvent) => {
|
|
992
|
+
event.preventDefault()
|
|
993
|
+
event.stopPropagation()
|
|
994
|
+
toggleFieldInsertMenu(insertionIndex)
|
|
995
|
+
},
|
|
996
|
+
}, '+'),
|
|
997
|
+
isOpen
|
|
998
|
+
? h('span', { class: 'aimd-recorder-workbench__visual-insert-menu' }, [
|
|
999
|
+
h('button', {
|
|
1000
|
+
type: 'button',
|
|
1001
|
+
class: 'aimd-recorder-workbench__visual-insert-option',
|
|
1002
|
+
onClick: () => handleInsertField('var', insertionIndex),
|
|
1003
|
+
}, workbenchUi.value.addVar),
|
|
1004
|
+
h('button', {
|
|
1005
|
+
type: 'button',
|
|
1006
|
+
class: 'aimd-recorder-workbench__visual-insert-option',
|
|
1007
|
+
onClick: () => handleInsertField('var_table', insertionIndex),
|
|
1008
|
+
}, workbenchUi.value.addTable),
|
|
1009
|
+
h('button', {
|
|
1010
|
+
type: 'button',
|
|
1011
|
+
class: 'aimd-recorder-workbench__visual-insert-option',
|
|
1012
|
+
onClick: () => handleInsertField('step', insertionIndex),
|
|
1013
|
+
}, workbenchUi.value.addStep),
|
|
1014
|
+
h('button', {
|
|
1015
|
+
type: 'button',
|
|
1016
|
+
class: 'aimd-recorder-workbench__visual-insert-option',
|
|
1017
|
+
onClick: () => handleInsertField('check', insertionIndex),
|
|
1018
|
+
}, workbenchUi.value.addCheck),
|
|
1019
|
+
h('button', {
|
|
1020
|
+
type: 'button',
|
|
1021
|
+
class: 'aimd-recorder-workbench__visual-insert-option',
|
|
1022
|
+
onClick: () => handleInsertField('quiz', insertionIndex),
|
|
1023
|
+
}, workbenchUi.value.addQuiz),
|
|
1024
|
+
])
|
|
1025
|
+
: null,
|
|
1026
|
+
]),
|
|
1027
|
+
]
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function renderVisualDropZone(insertionIndex: number) {
|
|
1031
|
+
return h('span', {
|
|
1032
|
+
class: [
|
|
1033
|
+
'aimd-recorder-workbench__visual-drop-zone',
|
|
1034
|
+
draggedFieldUid.value ? 'aimd-recorder-workbench__visual-drop-zone--active' : '',
|
|
1035
|
+
],
|
|
1036
|
+
onDragover: handleStructureDragOver,
|
|
1037
|
+
onDrop: (event: DragEvent) => {
|
|
1038
|
+
event.preventDefault()
|
|
1039
|
+
handleFieldDrop(insertionIndex)
|
|
1040
|
+
},
|
|
1041
|
+
}, renderVisualInsertEntry(insertionIndex))
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
function renderVisualEditWrapper(fieldKey: string, fieldType: string, defaultVNode: any) {
|
|
1045
|
+
if (!visualEditMode.value) {
|
|
1046
|
+
return props.wrapField ? props.wrapField(fieldKey, fieldType, defaultVNode) : defaultVNode
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const descriptor = editableFieldMap.value.get(fieldKey)
|
|
1050
|
+
if (!descriptor) {
|
|
1051
|
+
return props.wrapField ? props.wrapField(fieldKey, fieldType, defaultVNode) : defaultVNode
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
const index = editableFieldIndexByUid.value.get(descriptor.uid) ?? 0
|
|
1055
|
+
const visualWrapped = h('span', {
|
|
1056
|
+
class: [
|
|
1057
|
+
'aimd-recorder-workbench__visual-field',
|
|
1058
|
+
descriptor.sourceKind === 'block'
|
|
1059
|
+
? 'aimd-recorder-workbench__visual-field--block'
|
|
1060
|
+
: 'aimd-recorder-workbench__visual-field--inline',
|
|
1061
|
+
draggedFieldUid.value === descriptor.uid
|
|
1062
|
+
? 'aimd-recorder-workbench__visual-field--dragging'
|
|
1063
|
+
: '',
|
|
1064
|
+
],
|
|
1065
|
+
}, [
|
|
1066
|
+
renderVisualDropZone(index),
|
|
1067
|
+
h('span', { class: 'aimd-recorder-workbench__visual-header' }, [
|
|
1068
|
+
h('span', { class: 'aimd-recorder-workbench__visual-summary' }, [
|
|
1069
|
+
h('span', { class: 'aimd-recorder-workbench__visual-badge' }, workbenchUi.value.typeLabels[descriptor.fieldType]),
|
|
1070
|
+
h('span', { class: 'aimd-recorder-workbench__visual-field-id' }, descriptor.id),
|
|
1071
|
+
]),
|
|
1072
|
+
h('span', { class: 'aimd-recorder-workbench__visual-actions' }, [
|
|
1073
|
+
h('button', {
|
|
1074
|
+
type: 'button',
|
|
1075
|
+
class: 'aimd-recorder-workbench__visual-open-dialog',
|
|
1076
|
+
disabled: props.readonly,
|
|
1077
|
+
onClick: () => openFieldEditor(descriptor),
|
|
1078
|
+
}, workbenchUi.value.edit),
|
|
1079
|
+
h('span', {
|
|
1080
|
+
class: 'aimd-recorder-workbench__visual-drag-handle',
|
|
1081
|
+
draggable: !props.readonly,
|
|
1082
|
+
title: workbenchUi.value.drag,
|
|
1083
|
+
onDragstart: (event: DragEvent) => handleFieldDragStart(descriptor, event),
|
|
1084
|
+
onDragend: handleFieldDragEnd,
|
|
1085
|
+
}, `:: ${workbenchUi.value.drag}`),
|
|
1086
|
+
]),
|
|
1087
|
+
]),
|
|
1088
|
+
h('span', { class: 'aimd-recorder-workbench__visual-body' }, [defaultVNode]),
|
|
1089
|
+
renderVisualDropZone(index + 1),
|
|
1090
|
+
])
|
|
1091
|
+
|
|
1092
|
+
return props.wrapField ? props.wrapField(fieldKey, fieldType, visualWrapped) : visualWrapped
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
defineExpose({
|
|
1096
|
+
getEditor: () => editorRef.value,
|
|
1097
|
+
getRecorder: () => recorderRef.value,
|
|
1098
|
+
runClientAssigner: (id: string) => recorderRef.value?.runClientAssigner(id),
|
|
1099
|
+
runManualClientAssigners: () => recorderRef.value?.runManualClientAssigners(),
|
|
1100
|
+
})
|
|
1101
|
+
</script>
|
|
1102
|
+
|
|
1103
|
+
<template>
|
|
1104
|
+
<div ref="workbenchRef" class="aimd-recorder-workbench">
|
|
1105
|
+
<div class="aimd-recorder-workbench__main">
|
|
1106
|
+
<section class="aimd-recorder-workbench__panel">
|
|
1107
|
+
<header ref="editorPanelHeadRef" class="aimd-recorder-workbench__panel-head">
|
|
1108
|
+
<h3 class="aimd-recorder-workbench__panel-title">{{ editorTitleLabel }}</h3>
|
|
1109
|
+
</header>
|
|
1110
|
+
|
|
1111
|
+
<div
|
|
1112
|
+
ref="editorPanelBodyRef"
|
|
1113
|
+
class="aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--editor"
|
|
1114
|
+
@focusin.capture="handleSourceSurfaceFocusIn"
|
|
1115
|
+
@focusout.capture="handleContentSurfaceFocusOut('source', $event)"
|
|
1116
|
+
>
|
|
1117
|
+
<AimdEditor
|
|
1118
|
+
ref="editorRef"
|
|
1119
|
+
v-bind="editorBindings"
|
|
1120
|
+
class="aimd-recorder-workbench__editor"
|
|
1121
|
+
@update:model-value="handleEditorContentUpdate"
|
|
1122
|
+
@update:mode="emit('update:editorMode', $event)"
|
|
1123
|
+
@ready="emit('editor-ready', $event)"
|
|
1124
|
+
/>
|
|
1125
|
+
</div>
|
|
1126
|
+
</section>
|
|
1127
|
+
|
|
1128
|
+
<section
|
|
1129
|
+
class="aimd-recorder-workbench__panel"
|
|
1130
|
+
:class="{
|
|
1131
|
+
'aimd-recorder-workbench__panel--structure': activeSideTab === 'structure',
|
|
1132
|
+
'aimd-recorder-workbench__panel--detached': activeSideTab === 'detached',
|
|
1133
|
+
}"
|
|
1134
|
+
>
|
|
1135
|
+
<header ref="sidePanelHeadRef" class="aimd-recorder-workbench__panel-head">
|
|
1136
|
+
<div class="aimd-recorder-workbench__panel-head-row">
|
|
1137
|
+
<div class="aimd-recorder-workbench__panel-head-copy">
|
|
1138
|
+
<h3 class="aimd-recorder-workbench__panel-title">
|
|
1139
|
+
{{ activeSideTitleLabel }}
|
|
1140
|
+
<span
|
|
1141
|
+
v-if="activeSideTab === 'detached'"
|
|
1142
|
+
class="aimd-recorder-workbench__panel-title-count"
|
|
1143
|
+
>
|
|
1144
|
+
({{ detachedEntryCount }})
|
|
1145
|
+
</span>
|
|
1146
|
+
</h3>
|
|
1147
|
+
<p
|
|
1148
|
+
v-if="showVisualEditToggle && activeSideTab === 'recorder'"
|
|
1149
|
+
class="aimd-recorder-workbench__panel-head-note"
|
|
1150
|
+
>
|
|
1151
|
+
{{ visualEditSummaryLabel }}
|
|
1152
|
+
</p>
|
|
1153
|
+
</div>
|
|
1154
|
+
|
|
1155
|
+
<div
|
|
1156
|
+
v-if="showVisualEditToggle && activeSideTab === 'recorder'"
|
|
1157
|
+
class="aimd-recorder-workbench__visual-toggle-wrap"
|
|
1158
|
+
>
|
|
1159
|
+
<button
|
|
1160
|
+
class="aimd-recorder-workbench__visual-toggle"
|
|
1161
|
+
:class="{ 'aimd-recorder-workbench__visual-toggle--active': visualEditMode }"
|
|
1162
|
+
type="button"
|
|
1163
|
+
@click="visualEditMode = !visualEditMode"
|
|
1164
|
+
>
|
|
1165
|
+
{{ visualEditMode ? workbenchUi.visualEditOn : workbenchUi.visualEditOff }}
|
|
1166
|
+
</button>
|
|
1167
|
+
</div>
|
|
1168
|
+
</div>
|
|
1169
|
+
|
|
1170
|
+
<nav
|
|
1171
|
+
v-if="showSideTabs"
|
|
1172
|
+
class="aimd-recorder-workbench__side-tabs"
|
|
1173
|
+
:aria-label="isZhLocale ? '编辑器面板切换' : 'Editor panels'"
|
|
1174
|
+
>
|
|
1175
|
+
<button
|
|
1176
|
+
v-for="tab in sideTabs"
|
|
1177
|
+
:key="tab.key"
|
|
1178
|
+
class="aimd-recorder-workbench__side-tab"
|
|
1179
|
+
:class="{ 'aimd-recorder-workbench__side-tab--active': activeSideTab === tab.key }"
|
|
1180
|
+
type="button"
|
|
1181
|
+
@click="activeSideTab = tab.key"
|
|
1182
|
+
>
|
|
1183
|
+
<span>{{ tab.label }}</span>
|
|
1184
|
+
<span
|
|
1185
|
+
v-if="typeof tab.badge === 'number'"
|
|
1186
|
+
class="aimd-recorder-workbench__side-tab-badge"
|
|
1187
|
+
>
|
|
1188
|
+
{{ tab.badge }}
|
|
1189
|
+
</span>
|
|
1190
|
+
</button>
|
|
1191
|
+
</nav>
|
|
1192
|
+
</header>
|
|
1193
|
+
|
|
1194
|
+
<div
|
|
1195
|
+
v-if="activeSideTab === 'recorder'"
|
|
1196
|
+
ref="sidePanelBodyRef"
|
|
1197
|
+
class="aimd-recorder-workbench__panel-body"
|
|
1198
|
+
:class="visualEditMode ? 'aimd-recorder-workbench__panel-body--visual-editor' : 'aimd-recorder-workbench__panel-body--recorder'"
|
|
1199
|
+
:style="sidePanelBodyStyle"
|
|
1200
|
+
@focusin.capture="visualEditMode && handleVisualSurfaceFocusIn()"
|
|
1201
|
+
@focusout.capture="visualEditMode && handleContentSurfaceFocusOut('visual', $event)"
|
|
1202
|
+
>
|
|
1203
|
+
<div
|
|
1204
|
+
v-if="visualEditMode"
|
|
1205
|
+
ref="recorderToolbarRef"
|
|
1206
|
+
class="aimd-recorder-workbench__recorder-toolbar"
|
|
1207
|
+
>
|
|
1208
|
+
<p class="aimd-recorder-workbench__recorder-toolbar-note">
|
|
1209
|
+
{{ workbenchUi.addEndHint }}
|
|
1210
|
+
</p>
|
|
1211
|
+
</div>
|
|
1212
|
+
|
|
1213
|
+
<AimdRecorderWysiwygSurface
|
|
1214
|
+
v-if="visualEditMode"
|
|
1215
|
+
:content="visualContentDraft"
|
|
1216
|
+
:model-value="recordSnapshot"
|
|
1217
|
+
:min-height="viewportVisualEditorMinHeight"
|
|
1218
|
+
:locale="locale"
|
|
1219
|
+
:readonly="readonly"
|
|
1220
|
+
:current-user-name="currentUserName"
|
|
1221
|
+
:now="now"
|
|
1222
|
+
:messages="messages"
|
|
1223
|
+
:step-detail-display="stepDetailDisplay"
|
|
1224
|
+
:field-meta="fieldMeta"
|
|
1225
|
+
:field-state="fieldState"
|
|
1226
|
+
:wrap-field="wrapField"
|
|
1227
|
+
:custom-renderers="customRenderers"
|
|
1228
|
+
:field-adapters="fieldAdapters"
|
|
1229
|
+
:resolve-file="resolveFile"
|
|
1230
|
+
:type-plugins="typePlugins"
|
|
1231
|
+
:enable-block-handle="editorProps?.enableBlockHandle ?? true"
|
|
1232
|
+
class="aimd-recorder-workbench__visual-editor"
|
|
1233
|
+
@update:content="handleVisualContentUpdate"
|
|
1234
|
+
@update:model-value="handleRecordUpdate"
|
|
1235
|
+
@fields-change="handleFieldsChange"
|
|
1236
|
+
@error="emit('error', $event)"
|
|
1237
|
+
@field-change="emit('field-change', $event)"
|
|
1238
|
+
@field-blur="emit('field-blur', $event)"
|
|
1239
|
+
@assigner-request="emit('assigner-request', $event)"
|
|
1240
|
+
@assigner-cancel="emit('assigner-cancel', $event)"
|
|
1241
|
+
@table-add-row="emit('table-add-row', $event)"
|
|
1242
|
+
@table-remove-row="emit('table-remove-row', $event)"
|
|
1243
|
+
@edit-field="handleVisualFieldEdit"
|
|
1244
|
+
@delete-field="handleVisualFieldDelete"
|
|
1245
|
+
/>
|
|
1246
|
+
|
|
1247
|
+
<AimdRecorder
|
|
1248
|
+
v-else
|
|
1249
|
+
ref="recorderRef"
|
|
1250
|
+
:content="contentDraft"
|
|
1251
|
+
:model-value="recordSnapshot"
|
|
1252
|
+
:readonly="readonly"
|
|
1253
|
+
:current-user-name="currentUserName"
|
|
1254
|
+
:now="now"
|
|
1255
|
+
:locale="locale"
|
|
1256
|
+
:messages="messages"
|
|
1257
|
+
:step-detail-display="stepDetailDisplay"
|
|
1258
|
+
:field-meta="fieldMeta"
|
|
1259
|
+
:field-state="fieldState"
|
|
1260
|
+
:wrap-field="renderVisualEditWrapper"
|
|
1261
|
+
:custom-renderers="customRenderers"
|
|
1262
|
+
:field-adapters="fieldAdapters"
|
|
1263
|
+
:resolve-file="resolveFile"
|
|
1264
|
+
:type-plugins="typePlugins"
|
|
1265
|
+
@update:model-value="handleRecordUpdate"
|
|
1266
|
+
@fields-change="handleFieldsChange"
|
|
1267
|
+
@error="emit('error', $event)"
|
|
1268
|
+
@field-change="emit('field-change', $event)"
|
|
1269
|
+
@field-blur="emit('field-blur', $event)"
|
|
1270
|
+
@assigner-request="emit('assigner-request', $event)"
|
|
1271
|
+
@assigner-cancel="emit('assigner-cancel', $event)"
|
|
1272
|
+
@table-add-row="emit('table-add-row', $event)"
|
|
1273
|
+
@table-remove-row="emit('table-remove-row', $event)"
|
|
1274
|
+
/>
|
|
1275
|
+
</div>
|
|
1276
|
+
<div
|
|
1277
|
+
v-else-if="activeSideTab === 'structure'"
|
|
1278
|
+
class="aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--side"
|
|
1279
|
+
:style="sidePanelBodyStyle"
|
|
1280
|
+
>
|
|
1281
|
+
<div class="aimd-recorder-workbench__structure">
|
|
1282
|
+
<p class="aimd-recorder-workbench__structure-description">
|
|
1283
|
+
{{ fieldStructureDescriptionLabel }}
|
|
1284
|
+
</p>
|
|
1285
|
+
|
|
1286
|
+
<div class="aimd-recorder-workbench__structure-toolbar">
|
|
1287
|
+
<button class="aimd-recorder-workbench__add-btn" :disabled="readonly" @click="handleAddField('var')">
|
|
1288
|
+
{{ workbenchUi.addVar }}
|
|
1289
|
+
</button>
|
|
1290
|
+
<button class="aimd-recorder-workbench__add-btn" :disabled="readonly" @click="handleAddField('var_table')">
|
|
1291
|
+
{{ workbenchUi.addTable }}
|
|
1292
|
+
</button>
|
|
1293
|
+
<button class="aimd-recorder-workbench__add-btn" :disabled="readonly" @click="handleAddField('step')">
|
|
1294
|
+
{{ workbenchUi.addStep }}
|
|
1295
|
+
</button>
|
|
1296
|
+
<button class="aimd-recorder-workbench__add-btn" :disabled="readonly" @click="handleAddField('check')">
|
|
1297
|
+
{{ workbenchUi.addCheck }}
|
|
1298
|
+
</button>
|
|
1299
|
+
<button class="aimd-recorder-workbench__add-btn" :disabled="readonly" @click="handleAddField('quiz')">
|
|
1300
|
+
{{ workbenchUi.addQuiz }}
|
|
1301
|
+
</button>
|
|
1302
|
+
</div>
|
|
1303
|
+
|
|
1304
|
+
<div v-if="editableFields.length" class="aimd-recorder-workbench__field-list">
|
|
1305
|
+
<div
|
|
1306
|
+
class="aimd-recorder-workbench__drop-zone"
|
|
1307
|
+
:class="{ 'aimd-recorder-workbench__drop-zone--active': !!draggedFieldUid }"
|
|
1308
|
+
@dragover="handleStructureDragOver"
|
|
1309
|
+
@drop.prevent="handleFieldDrop(0)"
|
|
1310
|
+
>
|
|
1311
|
+
<span v-if="draggedFieldUid" class="aimd-recorder-workbench__drop-zone-label">
|
|
1312
|
+
{{ workbenchUi.dropHere }}
|
|
1313
|
+
</span>
|
|
1314
|
+
</div>
|
|
1315
|
+
|
|
1316
|
+
<template v-for="(field, index) in editableFields" :key="field.uid">
|
|
1317
|
+
<article
|
|
1318
|
+
class="aimd-recorder-workbench__field-item"
|
|
1319
|
+
:class="{ 'aimd-recorder-workbench__field-item--dragging': draggedFieldUid === field.uid }"
|
|
1320
|
+
:draggable="!readonly"
|
|
1321
|
+
@dragstart="handleFieldDragStart(field, $event)"
|
|
1322
|
+
@dragend="handleFieldDragEnd"
|
|
1323
|
+
>
|
|
1324
|
+
<div class="aimd-recorder-workbench__field-item-top">
|
|
1325
|
+
<span class="aimd-recorder-workbench__drag-handle" :title="workbenchUi.drag">
|
|
1326
|
+
:: {{ workbenchUi.drag }}
|
|
1327
|
+
</span>
|
|
1328
|
+
<span class="aimd-recorder-workbench__field-badge">
|
|
1329
|
+
{{ workbenchUi.typeLabels[field.fieldType] }}
|
|
1330
|
+
</span>
|
|
1331
|
+
<button
|
|
1332
|
+
class="aimd-recorder-workbench__delete-btn"
|
|
1333
|
+
:disabled="readonly"
|
|
1334
|
+
@click="handleDeleteField(field)"
|
|
1335
|
+
>
|
|
1336
|
+
{{ workbenchUi.delete }}
|
|
1337
|
+
</button>
|
|
1338
|
+
</div>
|
|
1339
|
+
|
|
1340
|
+
<div class="aimd-recorder-workbench__field-grid">
|
|
1341
|
+
<label class="aimd-recorder-workbench__field-label">
|
|
1342
|
+
<span>{{ workbenchUi.kind }}</span>
|
|
1343
|
+
<select :value="field.fieldType" :disabled="readonly" @change="handleFieldKindCommit(field, $event)">
|
|
1344
|
+
<option value="var">{{ workbenchUi.typeLabels.var }}</option>
|
|
1345
|
+
<option value="var_table">{{ workbenchUi.typeLabels.var_table }}</option>
|
|
1346
|
+
<option value="step">{{ workbenchUi.typeLabels.step }}</option>
|
|
1347
|
+
<option value="check">{{ workbenchUi.typeLabels.check }}</option>
|
|
1348
|
+
<option value="quiz">{{ workbenchUi.typeLabels.quiz }}</option>
|
|
1349
|
+
</select>
|
|
1350
|
+
</label>
|
|
1351
|
+
|
|
1352
|
+
<label class="aimd-recorder-workbench__field-label">
|
|
1353
|
+
<span>{{ workbenchUi.id }}</span>
|
|
1354
|
+
<input :value="field.id" :disabled="readonly" @change="handleFieldIdCommit(field, $event)">
|
|
1355
|
+
</label>
|
|
1356
|
+
|
|
1357
|
+
<label
|
|
1358
|
+
v-if="field.fieldType === 'var'"
|
|
1359
|
+
class="aimd-recorder-workbench__field-label"
|
|
1360
|
+
>
|
|
1361
|
+
<span>{{ workbenchUi.valueType }}</span>
|
|
1362
|
+
<input
|
|
1363
|
+
:value="field.valueType || 'str'"
|
|
1364
|
+
:disabled="readonly"
|
|
1365
|
+
@change="handleVarValueTypeCommit(field, $event)"
|
|
1366
|
+
>
|
|
1367
|
+
</label>
|
|
1368
|
+
</div>
|
|
1369
|
+
</article>
|
|
1370
|
+
|
|
1371
|
+
<div
|
|
1372
|
+
class="aimd-recorder-workbench__drop-zone"
|
|
1373
|
+
:class="{ 'aimd-recorder-workbench__drop-zone--active': !!draggedFieldUid }"
|
|
1374
|
+
@dragover="handleStructureDragOver"
|
|
1375
|
+
@drop.prevent="handleFieldDrop(index + 1)"
|
|
1376
|
+
>
|
|
1377
|
+
<span v-if="draggedFieldUid" class="aimd-recorder-workbench__drop-zone-label">
|
|
1378
|
+
{{ workbenchUi.dropHere }}
|
|
1379
|
+
</span>
|
|
1380
|
+
</div>
|
|
1381
|
+
</template>
|
|
1382
|
+
</div>
|
|
1383
|
+
|
|
1384
|
+
<p v-else class="aimd-recorder-workbench__structure-empty">
|
|
1385
|
+
{{ workbenchUi.empty }}
|
|
1386
|
+
</p>
|
|
1387
|
+
</div>
|
|
1388
|
+
</div>
|
|
1389
|
+
|
|
1390
|
+
<div
|
|
1391
|
+
v-else-if="activeSideTab === 'record'"
|
|
1392
|
+
class="aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--code"
|
|
1393
|
+
:style="sidePanelBodyStyle"
|
|
1394
|
+
>
|
|
1395
|
+
<pre class="aimd-recorder-workbench__code">{{ recordJson }}</pre>
|
|
1396
|
+
</div>
|
|
1397
|
+
|
|
1398
|
+
<div
|
|
1399
|
+
v-else-if="activeSideTab === 'detached'"
|
|
1400
|
+
class="aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--code"
|
|
1401
|
+
:style="sidePanelBodyStyle"
|
|
1402
|
+
>
|
|
1403
|
+
<p class="aimd-recorder-workbench__detached-description">
|
|
1404
|
+
{{ detachedDataDescriptionLabel }}
|
|
1405
|
+
</p>
|
|
1406
|
+
<pre class="aimd-recorder-workbench__code aimd-recorder-workbench__code--detached">
|
|
1407
|
+
{{ detachedRecordJson }}
|
|
1408
|
+
</pre>
|
|
1409
|
+
</div>
|
|
1410
|
+
</section>
|
|
1411
|
+
</div>
|
|
1412
|
+
|
|
1413
|
+
<div
|
|
1414
|
+
v-if="activeFieldEditor"
|
|
1415
|
+
class="aimd-recorder-workbench__dialog-backdrop"
|
|
1416
|
+
@click.self="closeFieldEditor"
|
|
1417
|
+
>
|
|
1418
|
+
<section class="aimd-recorder-workbench__dialog" :aria-label="workbenchUi.visualDialogTitle" role="dialog" aria-modal="true">
|
|
1419
|
+
<header class="aimd-recorder-workbench__dialog-head">
|
|
1420
|
+
<div>
|
|
1421
|
+
<h4 class="aimd-recorder-workbench__dialog-title">{{ workbenchUi.visualDialogTitle }}</h4>
|
|
1422
|
+
<p class="aimd-recorder-workbench__dialog-summary">{{ workbenchUi.visualDialogSummary }}</p>
|
|
1423
|
+
</div>
|
|
1424
|
+
<button class="aimd-recorder-workbench__dialog-close" type="button" @click="closeFieldEditor">
|
|
1425
|
+
{{ workbenchUi.close }}
|
|
1426
|
+
</button>
|
|
1427
|
+
</header>
|
|
1428
|
+
|
|
1429
|
+
<div class="aimd-recorder-workbench__dialog-body">
|
|
1430
|
+
<label class="aimd-recorder-workbench__dialog-label">
|
|
1431
|
+
<span>{{ workbenchUi.kind }}</span>
|
|
1432
|
+
<select
|
|
1433
|
+
:value="activeFieldEditor.fieldType"
|
|
1434
|
+
:disabled="readonly"
|
|
1435
|
+
@change="handleFieldKindCommit(activeFieldEditor, $event)"
|
|
1436
|
+
>
|
|
1437
|
+
<option value="var">{{ workbenchUi.typeLabels.var }}</option>
|
|
1438
|
+
<option value="var_table">{{ workbenchUi.typeLabels.var_table }}</option>
|
|
1439
|
+
<option value="step">{{ workbenchUi.typeLabels.step }}</option>
|
|
1440
|
+
<option value="check">{{ workbenchUi.typeLabels.check }}</option>
|
|
1441
|
+
<option value="quiz">{{ workbenchUi.typeLabels.quiz }}</option>
|
|
1442
|
+
</select>
|
|
1443
|
+
</label>
|
|
1444
|
+
|
|
1445
|
+
<label class="aimd-recorder-workbench__dialog-label">
|
|
1446
|
+
<span>{{ workbenchUi.id }}</span>
|
|
1447
|
+
<input
|
|
1448
|
+
:value="activeFieldEditor.id"
|
|
1449
|
+
:disabled="readonly"
|
|
1450
|
+
@change="handleFieldIdCommit(activeFieldEditor, $event)"
|
|
1451
|
+
>
|
|
1452
|
+
</label>
|
|
1453
|
+
|
|
1454
|
+
<label
|
|
1455
|
+
v-if="activeFieldEditor.fieldType === 'var'"
|
|
1456
|
+
class="aimd-recorder-workbench__dialog-label"
|
|
1457
|
+
>
|
|
1458
|
+
<span>{{ workbenchUi.valueType }}</span>
|
|
1459
|
+
<input
|
|
1460
|
+
:value="activeFieldEditor.valueType || 'str'"
|
|
1461
|
+
:disabled="readonly"
|
|
1462
|
+
@change="handleVarValueTypeCommit(activeFieldEditor, $event)"
|
|
1463
|
+
>
|
|
1464
|
+
</label>
|
|
1465
|
+
|
|
1466
|
+
<label
|
|
1467
|
+
v-if="allowRawFieldSourceEditing"
|
|
1468
|
+
class="aimd-recorder-workbench__dialog-label aimd-recorder-workbench__dialog-label--wide"
|
|
1469
|
+
>
|
|
1470
|
+
<span>{{ workbenchUi.source }}</span>
|
|
1471
|
+
<textarea
|
|
1472
|
+
v-model="fieldEditorRawDraft"
|
|
1473
|
+
class="aimd-recorder-workbench__dialog-textarea"
|
|
1474
|
+
:disabled="readonly"
|
|
1475
|
+
/>
|
|
1476
|
+
</label>
|
|
1477
|
+
</div>
|
|
1478
|
+
|
|
1479
|
+
<footer class="aimd-recorder-workbench__dialog-foot">
|
|
1480
|
+
<p v-if="allowRawFieldSourceEditing" class="aimd-recorder-workbench__dialog-hint">{{ workbenchUi.sourceHint }}</p>
|
|
1481
|
+
<div class="aimd-recorder-workbench__dialog-actions">
|
|
1482
|
+
<button class="aimd-recorder-workbench__dialog-delete" type="button" :disabled="readonly" @click="handleDeleteField(activeFieldEditor)">
|
|
1483
|
+
{{ workbenchUi.delete }}
|
|
1484
|
+
</button>
|
|
1485
|
+
<button
|
|
1486
|
+
v-if="allowRawFieldSourceEditing"
|
|
1487
|
+
class="aimd-recorder-workbench__dialog-apply"
|
|
1488
|
+
type="button"
|
|
1489
|
+
:disabled="readonly"
|
|
1490
|
+
@click="handleFieldRawApply"
|
|
1491
|
+
>
|
|
1492
|
+
{{ workbenchUi.applySource }}
|
|
1493
|
+
</button>
|
|
1494
|
+
</div>
|
|
1495
|
+
</footer>
|
|
1496
|
+
</section>
|
|
1497
|
+
</div>
|
|
1498
|
+
</div>
|
|
1499
|
+
</template>
|
|
1500
|
+
|
|
1501
|
+
<style scoped>
|
|
1502
|
+
.aimd-recorder-workbench {
|
|
1503
|
+
display: flex;
|
|
1504
|
+
flex-direction: column;
|
|
1505
|
+
gap: 16px;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
.aimd-recorder-workbench__main {
|
|
1509
|
+
display: grid;
|
|
1510
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1511
|
+
gap: 16px;
|
|
1512
|
+
align-items: start;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.aimd-recorder-workbench__panel {
|
|
1516
|
+
min-width: 0;
|
|
1517
|
+
overflow: hidden;
|
|
1518
|
+
border: 1px solid #dbe4ef;
|
|
1519
|
+
border-radius: 14px;
|
|
1520
|
+
background: #fff;
|
|
1521
|
+
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
.aimd-recorder-workbench__panel--detached {
|
|
1525
|
+
border-color: #f0d5a8;
|
|
1526
|
+
background: #fffdfa;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
.aimd-recorder-workbench__panel--structure {
|
|
1530
|
+
border-color: #d6e1f5;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
.aimd-recorder-workbench__panel-head {
|
|
1534
|
+
padding: 12px 16px;
|
|
1535
|
+
border-bottom: 1px solid #e7edf5;
|
|
1536
|
+
background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.aimd-recorder-workbench__panel-head-row {
|
|
1540
|
+
display: flex;
|
|
1541
|
+
align-items: center;
|
|
1542
|
+
justify-content: space-between;
|
|
1543
|
+
gap: 12px;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.aimd-recorder-workbench__panel-head-copy {
|
|
1547
|
+
min-width: 0;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
.aimd-recorder-workbench__panel--detached .aimd-recorder-workbench__panel-head {
|
|
1551
|
+
border-bottom-color: #f0dfbf;
|
|
1552
|
+
background: linear-gradient(180deg, #fffdf8 0%, #fff7ea 100%);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
.aimd-recorder-workbench__panel-title {
|
|
1556
|
+
margin: 0;
|
|
1557
|
+
font-size: 14px;
|
|
1558
|
+
font-weight: 700;
|
|
1559
|
+
color: #233042;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.aimd-recorder-workbench__panel-title-count {
|
|
1563
|
+
color: #7a6140;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.aimd-recorder-workbench__panel-head-note {
|
|
1567
|
+
margin: 4px 0 0;
|
|
1568
|
+
color: #5e6f85;
|
|
1569
|
+
font-size: 12px;
|
|
1570
|
+
line-height: 1.5;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
.aimd-recorder-workbench__panel-body {
|
|
1574
|
+
min-width: 0;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.aimd-recorder-workbench__panel-body--editor :deep(.aimd-editor) {
|
|
1578
|
+
border: 0 none;
|
|
1579
|
+
border-radius: 0;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
.aimd-recorder-workbench__panel-body--recorder {
|
|
1583
|
+
padding: 18px;
|
|
1584
|
+
box-sizing: border-box;
|
|
1585
|
+
background: #f8fbff;
|
|
1586
|
+
overflow: auto;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.aimd-recorder-workbench__panel-body--visual-editor {
|
|
1590
|
+
display: flex;
|
|
1591
|
+
flex-direction: column;
|
|
1592
|
+
box-sizing: border-box;
|
|
1593
|
+
background: #f8fbff;
|
|
1594
|
+
overflow: hidden;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
.aimd-recorder-workbench__panel-body--side,
|
|
1598
|
+
.aimd-recorder-workbench__panel-body--code {
|
|
1599
|
+
box-sizing: border-box;
|
|
1600
|
+
background: #f8fbff;
|
|
1601
|
+
overflow: auto;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
.aimd-recorder-workbench__panel-body--code {
|
|
1605
|
+
display: flex;
|
|
1606
|
+
flex-direction: column;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.aimd-recorder-workbench__panel-body--recorder :deep(.aimd-protocol-recorder) {
|
|
1610
|
+
min-width: 0;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.aimd-recorder-workbench__panel-body--visual-editor :deep(.aimd-editor) {
|
|
1614
|
+
border: 0 none;
|
|
1615
|
+
border-radius: 0;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
.aimd-recorder-workbench__side-tabs {
|
|
1619
|
+
display: flex;
|
|
1620
|
+
flex-wrap: wrap;
|
|
1621
|
+
gap: 8px;
|
|
1622
|
+
margin-top: 12px;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
.aimd-recorder-workbench__side-tab {
|
|
1626
|
+
appearance: none;
|
|
1627
|
+
display: inline-flex;
|
|
1628
|
+
align-items: center;
|
|
1629
|
+
gap: 6px;
|
|
1630
|
+
border: 1px solid #d6deea;
|
|
1631
|
+
border-radius: 999px;
|
|
1632
|
+
background: rgba(255, 255, 255, 0.92);
|
|
1633
|
+
color: #415165;
|
|
1634
|
+
cursor: pointer;
|
|
1635
|
+
padding: 7px 12px;
|
|
1636
|
+
font-size: 12px;
|
|
1637
|
+
font-weight: 700;
|
|
1638
|
+
line-height: 1;
|
|
1639
|
+
transition: all 0.2s ease;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.aimd-recorder-workbench__side-tab:hover {
|
|
1643
|
+
border-color: #8ba8d8;
|
|
1644
|
+
box-shadow: 0 6px 16px rgba(47, 111, 237, 0.08);
|
|
1645
|
+
transform: translateY(-1px);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
.aimd-recorder-workbench__side-tab--active {
|
|
1649
|
+
border-color: #5f8dea;
|
|
1650
|
+
background: #edf4ff;
|
|
1651
|
+
color: #2454b5;
|
|
1652
|
+
box-shadow: 0 6px 18px rgba(47, 111, 237, 0.14);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
.aimd-recorder-workbench__side-tab-badge {
|
|
1656
|
+
display: inline-flex;
|
|
1657
|
+
align-items: center;
|
|
1658
|
+
justify-content: center;
|
|
1659
|
+
min-width: 18px;
|
|
1660
|
+
height: 18px;
|
|
1661
|
+
padding: 0 5px;
|
|
1662
|
+
border-radius: 999px;
|
|
1663
|
+
background: rgba(36, 84, 181, 0.12);
|
|
1664
|
+
color: inherit;
|
|
1665
|
+
font-size: 11px;
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
.aimd-recorder-workbench__visual-toggle {
|
|
1669
|
+
appearance: none;
|
|
1670
|
+
border: 1px solid #d4deed;
|
|
1671
|
+
border-radius: 999px;
|
|
1672
|
+
background: #fff;
|
|
1673
|
+
color: #28415f;
|
|
1674
|
+
cursor: pointer;
|
|
1675
|
+
padding: 8px 12px;
|
|
1676
|
+
font-size: 12px;
|
|
1677
|
+
font-weight: 700;
|
|
1678
|
+
line-height: 1;
|
|
1679
|
+
transition: all 0.2s ease;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
.aimd-recorder-workbench__visual-toggle--active {
|
|
1683
|
+
border-color: #5f8dea;
|
|
1684
|
+
background: #edf4ff;
|
|
1685
|
+
color: #2454b5;
|
|
1686
|
+
box-shadow: 0 6px 18px rgba(47, 111, 237, 0.14);
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.aimd-recorder-workbench__recorder-toolbar {
|
|
1690
|
+
display: flex;
|
|
1691
|
+
flex-direction: column;
|
|
1692
|
+
gap: 10px;
|
|
1693
|
+
flex: 0 0 auto;
|
|
1694
|
+
padding: 12px;
|
|
1695
|
+
border: 1px solid #d8e3f5;
|
|
1696
|
+
border-radius: 14px;
|
|
1697
|
+
background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
.aimd-recorder-workbench__recorder-toolbar-note {
|
|
1701
|
+
margin: 0;
|
|
1702
|
+
color: #5a6d86;
|
|
1703
|
+
font-size: 12px;
|
|
1704
|
+
line-height: 1.6;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
.aimd-recorder-workbench__structure {
|
|
1708
|
+
display: flex;
|
|
1709
|
+
flex-direction: column;
|
|
1710
|
+
gap: 14px;
|
|
1711
|
+
padding: 16px;
|
|
1712
|
+
min-height: 100%;
|
|
1713
|
+
box-sizing: border-box;
|
|
1714
|
+
background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
.aimd-recorder-workbench__structure-description,
|
|
1718
|
+
.aimd-recorder-workbench__detached-description {
|
|
1719
|
+
margin: 0;
|
|
1720
|
+
font-size: 13px;
|
|
1721
|
+
line-height: 1.55;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
.aimd-recorder-workbench__structure-description {
|
|
1725
|
+
color: #56657a;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
.aimd-recorder-workbench__detached-description {
|
|
1729
|
+
padding: 14px 16px 0;
|
|
1730
|
+
color: #62533a;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
.aimd-recorder-workbench__structure-toolbar {
|
|
1734
|
+
display: flex;
|
|
1735
|
+
flex-wrap: wrap;
|
|
1736
|
+
gap: 8px;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
.aimd-recorder-workbench__add-btn,
|
|
1740
|
+
.aimd-recorder-workbench__delete-btn {
|
|
1741
|
+
appearance: none;
|
|
1742
|
+
border: 1px solid #d6deea;
|
|
1743
|
+
border-radius: 999px;
|
|
1744
|
+
background: #fff;
|
|
1745
|
+
color: #223041;
|
|
1746
|
+
cursor: pointer;
|
|
1747
|
+
font-size: 12px;
|
|
1748
|
+
font-weight: 600;
|
|
1749
|
+
line-height: 1;
|
|
1750
|
+
transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
.aimd-recorder-workbench__add-btn {
|
|
1754
|
+
padding: 8px 12px;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.aimd-recorder-workbench__delete-btn {
|
|
1758
|
+
padding: 7px 11px;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
.aimd-recorder-workbench__add-btn:hover:not(:disabled),
|
|
1762
|
+
.aimd-recorder-workbench__delete-btn:hover:not(:disabled) {
|
|
1763
|
+
border-color: #8ba8d8;
|
|
1764
|
+
box-shadow: 0 6px 18px rgba(47, 111, 237, 0.1);
|
|
1765
|
+
transform: translateY(-1px);
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
.aimd-recorder-workbench__add-btn:disabled,
|
|
1769
|
+
.aimd-recorder-workbench__delete-btn:disabled {
|
|
1770
|
+
opacity: 0.55;
|
|
1771
|
+
cursor: default;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
.aimd-recorder-workbench__field-list {
|
|
1775
|
+
display: flex;
|
|
1776
|
+
flex-direction: column;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
.aimd-recorder-workbench__drop-zone {
|
|
1780
|
+
display: flex;
|
|
1781
|
+
align-items: center;
|
|
1782
|
+
justify-content: center;
|
|
1783
|
+
min-height: 14px;
|
|
1784
|
+
border-radius: 999px;
|
|
1785
|
+
border: 1px dashed transparent;
|
|
1786
|
+
background: rgba(47, 111, 237, 0.03);
|
|
1787
|
+
transition: background 0.2s ease, border-color 0.2s ease, min-height 0.2s ease;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.aimd-recorder-workbench__drop-zone--active {
|
|
1791
|
+
min-height: 28px;
|
|
1792
|
+
border-color: rgba(95, 141, 234, 0.45);
|
|
1793
|
+
background: rgba(47, 111, 237, 0.08);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
.aimd-recorder-workbench__drop-zone--active:hover {
|
|
1797
|
+
border-color: #5f8dea;
|
|
1798
|
+
background: rgba(47, 111, 237, 0.18);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.aimd-recorder-workbench__field-item {
|
|
1802
|
+
display: flex;
|
|
1803
|
+
flex-direction: column;
|
|
1804
|
+
gap: 14px;
|
|
1805
|
+
padding: 14px;
|
|
1806
|
+
border: 1px solid #dbe5f2;
|
|
1807
|
+
border-radius: 14px;
|
|
1808
|
+
background: #fff;
|
|
1809
|
+
box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
.aimd-recorder-workbench__field-item--dragging {
|
|
1813
|
+
opacity: 0.65;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
.aimd-recorder-workbench__field-item-top {
|
|
1817
|
+
display: flex;
|
|
1818
|
+
align-items: center;
|
|
1819
|
+
gap: 10px;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
.aimd-recorder-workbench__drag-handle {
|
|
1823
|
+
display: inline-flex;
|
|
1824
|
+
align-items: center;
|
|
1825
|
+
justify-content: center;
|
|
1826
|
+
padding: 6px 10px;
|
|
1827
|
+
border-radius: 999px;
|
|
1828
|
+
background: #eef4ff;
|
|
1829
|
+
color: #2f5db7;
|
|
1830
|
+
font-size: 11px;
|
|
1831
|
+
font-weight: 700;
|
|
1832
|
+
letter-spacing: 0.02em;
|
|
1833
|
+
text-transform: uppercase;
|
|
1834
|
+
cursor: grab;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
.aimd-recorder-workbench__field-badge {
|
|
1838
|
+
display: inline-flex;
|
|
1839
|
+
align-items: center;
|
|
1840
|
+
justify-content: center;
|
|
1841
|
+
padding: 6px 10px;
|
|
1842
|
+
border-radius: 999px;
|
|
1843
|
+
background: #f2f5fa;
|
|
1844
|
+
color: #445366;
|
|
1845
|
+
font-size: 11px;
|
|
1846
|
+
font-weight: 700;
|
|
1847
|
+
text-transform: uppercase;
|
|
1848
|
+
letter-spacing: 0.03em;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
.aimd-recorder-workbench__delete-btn {
|
|
1852
|
+
margin-left: auto;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
.aimd-recorder-workbench__field-grid {
|
|
1856
|
+
display: grid;
|
|
1857
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
1858
|
+
gap: 12px;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.aimd-recorder-workbench__field-label {
|
|
1862
|
+
display: flex;
|
|
1863
|
+
flex-direction: column;
|
|
1864
|
+
gap: 6px;
|
|
1865
|
+
min-width: 0;
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
.aimd-recorder-workbench__field-label > span {
|
|
1869
|
+
font-size: 12px;
|
|
1870
|
+
font-weight: 600;
|
|
1871
|
+
color: #5b6778;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
.aimd-recorder-workbench__field-label > input,
|
|
1875
|
+
.aimd-recorder-workbench__field-label > select {
|
|
1876
|
+
width: 100%;
|
|
1877
|
+
min-width: 0;
|
|
1878
|
+
box-sizing: border-box;
|
|
1879
|
+
padding: 9px 10px;
|
|
1880
|
+
border: 1px solid #d4dcea;
|
|
1881
|
+
border-radius: 10px;
|
|
1882
|
+
background: #fff;
|
|
1883
|
+
color: #223041;
|
|
1884
|
+
font-size: 13px;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
.aimd-recorder-workbench__field-label > input:focus,
|
|
1888
|
+
.aimd-recorder-workbench__field-label > select:focus {
|
|
1889
|
+
outline: none;
|
|
1890
|
+
border-color: #6d95e8;
|
|
1891
|
+
box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.aimd-recorder-workbench__structure-empty {
|
|
1895
|
+
margin: 0;
|
|
1896
|
+
padding: 14px 16px;
|
|
1897
|
+
border: 1px dashed #cad7ec;
|
|
1898
|
+
border-radius: 14px;
|
|
1899
|
+
background: rgba(255, 255, 255, 0.7);
|
|
1900
|
+
color: #5c6d84;
|
|
1901
|
+
font-size: 13px;
|
|
1902
|
+
line-height: 1.6;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
.aimd-recorder-workbench__visual-field {
|
|
1906
|
+
margin: 14px 0;
|
|
1907
|
+
padding: 10px 12px 12px;
|
|
1908
|
+
border: 1px solid #d7e1ef;
|
|
1909
|
+
border-radius: 14px;
|
|
1910
|
+
background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 251, 255, 0.96) 100%);
|
|
1911
|
+
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
.aimd-recorder-workbench__visual-field--block {
|
|
1915
|
+
display: block;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.aimd-recorder-workbench__visual-field--inline {
|
|
1919
|
+
display: inline-flex;
|
|
1920
|
+
flex-direction: column;
|
|
1921
|
+
vertical-align: top;
|
|
1922
|
+
max-width: min(100%, 720px);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
.aimd-recorder-workbench__visual-field--dragging {
|
|
1926
|
+
opacity: 0.68;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
.aimd-recorder-workbench__visual-header {
|
|
1930
|
+
display: flex;
|
|
1931
|
+
flex-wrap: wrap;
|
|
1932
|
+
align-items: center;
|
|
1933
|
+
justify-content: space-between;
|
|
1934
|
+
gap: 10px;
|
|
1935
|
+
margin-bottom: 10px;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
.aimd-recorder-workbench__visual-summary,
|
|
1939
|
+
.aimd-recorder-workbench__visual-actions {
|
|
1940
|
+
display: inline-flex;
|
|
1941
|
+
align-items: center;
|
|
1942
|
+
gap: 8px;
|
|
1943
|
+
flex-wrap: wrap;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
.aimd-recorder-workbench__visual-badge,
|
|
1947
|
+
.aimd-recorder-workbench__visual-field-id {
|
|
1948
|
+
display: inline-flex;
|
|
1949
|
+
align-items: center;
|
|
1950
|
+
justify-content: center;
|
|
1951
|
+
border-radius: 999px;
|
|
1952
|
+
font-size: 11px;
|
|
1953
|
+
font-weight: 700;
|
|
1954
|
+
letter-spacing: 0.03em;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
.aimd-recorder-workbench__visual-badge {
|
|
1958
|
+
padding: 6px 10px;
|
|
1959
|
+
background: #edf4ff;
|
|
1960
|
+
color: #2f5db7;
|
|
1961
|
+
text-transform: uppercase;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
.aimd-recorder-workbench__visual-field-id {
|
|
1965
|
+
padding: 6px 10px;
|
|
1966
|
+
background: #f3f6fa;
|
|
1967
|
+
color: #445366;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.aimd-recorder-workbench__visual-open-dialog,
|
|
1971
|
+
.aimd-recorder-workbench__visual-drag-handle,
|
|
1972
|
+
.aimd-recorder-workbench__visual-insert-trigger,
|
|
1973
|
+
.aimd-recorder-workbench__visual-insert-option,
|
|
1974
|
+
.aimd-recorder-workbench__dialog-close,
|
|
1975
|
+
.aimd-recorder-workbench__dialog-apply,
|
|
1976
|
+
.aimd-recorder-workbench__dialog-delete {
|
|
1977
|
+
appearance: none;
|
|
1978
|
+
display: inline-flex;
|
|
1979
|
+
align-items: center;
|
|
1980
|
+
justify-content: center;
|
|
1981
|
+
border: 1px solid #d6deea;
|
|
1982
|
+
border-radius: 999px;
|
|
1983
|
+
background: #fff;
|
|
1984
|
+
color: #28415f;
|
|
1985
|
+
cursor: pointer;
|
|
1986
|
+
padding: 7px 11px;
|
|
1987
|
+
font-size: 12px;
|
|
1988
|
+
font-weight: 700;
|
|
1989
|
+
line-height: 1;
|
|
1990
|
+
transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
.aimd-recorder-workbench__visual-open-dialog:hover:not(:disabled),
|
|
1994
|
+
.aimd-recorder-workbench__visual-drag-handle:hover,
|
|
1995
|
+
.aimd-recorder-workbench__visual-insert-trigger:hover:not(:disabled),
|
|
1996
|
+
.aimd-recorder-workbench__visual-insert-option:hover:not(:disabled),
|
|
1997
|
+
.aimd-recorder-workbench__dialog-close:hover:not(:disabled),
|
|
1998
|
+
.aimd-recorder-workbench__dialog-apply:hover:not(:disabled),
|
|
1999
|
+
.aimd-recorder-workbench__dialog-delete:hover:not(:disabled) {
|
|
2000
|
+
border-color: #8ba8d8;
|
|
2001
|
+
box-shadow: 0 6px 18px rgba(47, 111, 237, 0.1);
|
|
2002
|
+
transform: translateY(-1px);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
.aimd-recorder-workbench__visual-open-dialog:disabled,
|
|
2006
|
+
.aimd-recorder-workbench__dialog-close:disabled,
|
|
2007
|
+
.aimd-recorder-workbench__dialog-apply:disabled,
|
|
2008
|
+
.aimd-recorder-workbench__dialog-delete:disabled {
|
|
2009
|
+
opacity: 0.55;
|
|
2010
|
+
cursor: default;
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
.aimd-recorder-workbench__visual-drag-handle {
|
|
2014
|
+
background: #eef4ff;
|
|
2015
|
+
color: #2f5db7;
|
|
2016
|
+
cursor: grab;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
.aimd-recorder-workbench__visual-body {
|
|
2020
|
+
display: block;
|
|
2021
|
+
min-width: 0;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
.aimd-recorder-workbench__visual-drop-zone {
|
|
2025
|
+
display: flex;
|
|
2026
|
+
align-items: center;
|
|
2027
|
+
justify-content: center;
|
|
2028
|
+
position: relative;
|
|
2029
|
+
min-height: 18px;
|
|
2030
|
+
border-radius: 999px;
|
|
2031
|
+
border: 1px dashed transparent;
|
|
2032
|
+
background: rgba(47, 111, 237, 0.03);
|
|
2033
|
+
transition: background 0.2s ease, border-color 0.2s ease, min-height 0.2s ease;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
.aimd-recorder-workbench__visual-drop-zone--active {
|
|
2037
|
+
min-height: 24px;
|
|
2038
|
+
border-color: rgba(95, 141, 234, 0.45);
|
|
2039
|
+
background: rgba(47, 111, 237, 0.08);
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
.aimd-recorder-workbench__visual-drop-zone--active:hover {
|
|
2043
|
+
border-color: #5f8dea;
|
|
2044
|
+
background: rgba(47, 111, 237, 0.18);
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
.aimd-recorder-workbench__drop-zone-label {
|
|
2048
|
+
pointer-events: none;
|
|
2049
|
+
color: #315daf;
|
|
2050
|
+
font-size: 11px;
|
|
2051
|
+
font-weight: 700;
|
|
2052
|
+
letter-spacing: 0.02em;
|
|
2053
|
+
text-transform: uppercase;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
.aimd-recorder-workbench__visual-insert-wrap {
|
|
2057
|
+
position: relative;
|
|
2058
|
+
display: inline-flex;
|
|
2059
|
+
justify-content: center;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
.aimd-recorder-workbench__visual-insert-trigger {
|
|
2063
|
+
min-width: 28px;
|
|
2064
|
+
min-height: 28px;
|
|
2065
|
+
padding: 0;
|
|
2066
|
+
background: #edf4ff;
|
|
2067
|
+
color: #2454b5;
|
|
2068
|
+
font-size: 18px;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
.aimd-recorder-workbench__visual-insert-trigger--active {
|
|
2072
|
+
border-color: #5f8dea;
|
|
2073
|
+
background: #dfeaff;
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
.aimd-recorder-workbench__visual-insert-menu {
|
|
2077
|
+
position: absolute;
|
|
2078
|
+
top: calc(100% + 8px);
|
|
2079
|
+
z-index: 2;
|
|
2080
|
+
display: flex;
|
|
2081
|
+
flex-wrap: wrap;
|
|
2082
|
+
justify-content: center;
|
|
2083
|
+
gap: 8px;
|
|
2084
|
+
min-width: min(100vw - 48px, 420px);
|
|
2085
|
+
padding: 10px;
|
|
2086
|
+
border: 1px solid #d8e3f5;
|
|
2087
|
+
border-radius: 14px;
|
|
2088
|
+
background: #fff;
|
|
2089
|
+
box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
.aimd-recorder-workbench__visual-insert-option {
|
|
2093
|
+
font-size: 11px;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
.aimd-recorder-workbench__visual-editor {
|
|
2097
|
+
flex: 1 1 auto;
|
|
2098
|
+
min-height: 0;
|
|
2099
|
+
overflow: hidden;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
.aimd-recorder-workbench__dialog-backdrop {
|
|
2103
|
+
position: fixed;
|
|
2104
|
+
inset: 0;
|
|
2105
|
+
z-index: 60;
|
|
2106
|
+
display: flex;
|
|
2107
|
+
align-items: center;
|
|
2108
|
+
justify-content: center;
|
|
2109
|
+
padding: 24px;
|
|
2110
|
+
background: rgba(15, 23, 42, 0.24);
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
.aimd-recorder-workbench__dialog {
|
|
2114
|
+
width: min(720px, 100%);
|
|
2115
|
+
max-height: min(80vh, 900px);
|
|
2116
|
+
display: flex;
|
|
2117
|
+
flex-direction: column;
|
|
2118
|
+
overflow: hidden;
|
|
2119
|
+
border: 1px solid #dbe4ef;
|
|
2120
|
+
border-radius: 18px;
|
|
2121
|
+
background: #fff;
|
|
2122
|
+
box-shadow: 0 28px 56px rgba(15, 23, 42, 0.22);
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
.aimd-recorder-workbench__dialog-head,
|
|
2126
|
+
.aimd-recorder-workbench__dialog-foot {
|
|
2127
|
+
display: flex;
|
|
2128
|
+
align-items: flex-start;
|
|
2129
|
+
justify-content: space-between;
|
|
2130
|
+
gap: 16px;
|
|
2131
|
+
padding: 18px 20px;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
.aimd-recorder-workbench__dialog-head {
|
|
2135
|
+
border-bottom: 1px solid #e7edf5;
|
|
2136
|
+
background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
.aimd-recorder-workbench__dialog-foot {
|
|
2140
|
+
border-top: 1px solid #e7edf5;
|
|
2141
|
+
background: #fbfdff;
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
.aimd-recorder-workbench__dialog-title {
|
|
2145
|
+
margin: 0;
|
|
2146
|
+
font-size: 16px;
|
|
2147
|
+
font-weight: 700;
|
|
2148
|
+
color: #223041;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
.aimd-recorder-workbench__dialog-summary,
|
|
2152
|
+
.aimd-recorder-workbench__dialog-hint {
|
|
2153
|
+
margin: 6px 0 0;
|
|
2154
|
+
color: #5c6d84;
|
|
2155
|
+
font-size: 13px;
|
|
2156
|
+
line-height: 1.55;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
.aimd-recorder-workbench__dialog-body {
|
|
2160
|
+
display: grid;
|
|
2161
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
2162
|
+
gap: 14px;
|
|
2163
|
+
padding: 20px;
|
|
2164
|
+
overflow: auto;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
.aimd-recorder-workbench__dialog-label {
|
|
2168
|
+
display: flex;
|
|
2169
|
+
flex-direction: column;
|
|
2170
|
+
gap: 6px;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
.aimd-recorder-workbench__dialog-label--wide {
|
|
2174
|
+
grid-column: 1 / -1;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
.aimd-recorder-workbench__dialog-label > span {
|
|
2178
|
+
font-size: 12px;
|
|
2179
|
+
font-weight: 700;
|
|
2180
|
+
color: #5b6778;
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
.aimd-recorder-workbench__dialog-label > input,
|
|
2184
|
+
.aimd-recorder-workbench__dialog-label > select,
|
|
2185
|
+
.aimd-recorder-workbench__dialog-textarea {
|
|
2186
|
+
width: 100%;
|
|
2187
|
+
min-width: 0;
|
|
2188
|
+
box-sizing: border-box;
|
|
2189
|
+
padding: 10px 12px;
|
|
2190
|
+
border: 1px solid #d4dcea;
|
|
2191
|
+
border-radius: 12px;
|
|
2192
|
+
background: #fff;
|
|
2193
|
+
color: #223041;
|
|
2194
|
+
font-size: 13px;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
.aimd-recorder-workbench__dialog-textarea {
|
|
2198
|
+
min-height: 180px;
|
|
2199
|
+
resize: vertical;
|
|
2200
|
+
font-family: 'SFMono-Regular', 'SF Mono', 'Fira Code', 'Menlo', monospace;
|
|
2201
|
+
line-height: 1.55;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
.aimd-recorder-workbench__dialog-label > input:focus,
|
|
2205
|
+
.aimd-recorder-workbench__dialog-label > select:focus,
|
|
2206
|
+
.aimd-recorder-workbench__dialog-textarea:focus {
|
|
2207
|
+
outline: none;
|
|
2208
|
+
border-color: #6d95e8;
|
|
2209
|
+
box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
.aimd-recorder-workbench__dialog-actions {
|
|
2213
|
+
display: inline-flex;
|
|
2214
|
+
align-items: center;
|
|
2215
|
+
gap: 10px;
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
.aimd-recorder-workbench__dialog-apply {
|
|
2219
|
+
background: #edf4ff;
|
|
2220
|
+
color: #2454b5;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
.aimd-recorder-workbench__dialog-delete {
|
|
2224
|
+
border-color: #e7c8d2;
|
|
2225
|
+
background: #fff7f8;
|
|
2226
|
+
color: #b23b58;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
.aimd-recorder-workbench__code {
|
|
2230
|
+
margin: 0;
|
|
2231
|
+
padding: 16px;
|
|
2232
|
+
flex: 1 1 auto;
|
|
2233
|
+
box-sizing: border-box;
|
|
2234
|
+
overflow: auto;
|
|
2235
|
+
background: #fbfcfe;
|
|
2236
|
+
color: #223041;
|
|
2237
|
+
font-size: 12px;
|
|
2238
|
+
line-height: 1.6;
|
|
2239
|
+
white-space: pre-wrap;
|
|
2240
|
+
word-break: break-word;
|
|
2241
|
+
font-family: 'SFMono-Regular', 'SF Mono', 'Fira Code', 'Menlo', monospace;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
.aimd-recorder-workbench__code--detached {
|
|
2245
|
+
border-top: 1px solid #edf2f7;
|
|
2246
|
+
}
|
|
2247
|
+
|
|
2248
|
+
@media (max-width: 1080px) {
|
|
2249
|
+
.aimd-recorder-workbench__main {
|
|
2250
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
.aimd-recorder-workbench__panel-head-row {
|
|
2254
|
+
flex-direction: column;
|
|
2255
|
+
align-items: stretch;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
.aimd-recorder-workbench__visual-toggle-wrap {
|
|
2259
|
+
align-self: flex-start;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
.aimd-recorder-workbench__dialog-backdrop {
|
|
2263
|
+
padding: 16px;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
.aimd-recorder-workbench__dialog-head,
|
|
2267
|
+
.aimd-recorder-workbench__dialog-foot,
|
|
2268
|
+
.aimd-recorder-workbench__visual-header {
|
|
2269
|
+
flex-direction: column;
|
|
2270
|
+
align-items: stretch;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
.aimd-recorder-workbench__dialog-body {
|
|
2274
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
.aimd-recorder-workbench__field-grid {
|
|
2278
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
</style>
|