@airalogy/aimd-recorder 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -10
- package/README.zh-CN.md +42 -10
- package/dist/AimdCodeField-BQUuM-EF.js +182 -0
- package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-TBKunqU_.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js} +3922 -3829
- package/dist/AimdMarkdownField-DmNX2g4j.js +254 -0
- package/dist/AimdMarkdownNoteField-B5ruzmwS.js +259 -0
- package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/arc-B-vsgEXF.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BwPNOtNH.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-CMUI4kKc.js +2425 -0
- package/dist/c4Diagram-AAUBKEIU-Cpmfsy_s.js +1577 -0
- package/dist/channel-DlMAXHQK.js +5 -0
- package/dist/chunk-2J33WTMH-DP9BS2ux.js +19 -0
- package/dist/chunk-4BX2VUAB-ncsOeLMb.js +8 -0
- package/dist/chunk-55IACEB6-C7wHk4B7.js +8 -0
- package/dist/chunk-727SXJPM-Caa5aVUO.js +1528 -0
- package/dist/chunk-AQP2D5EJ-CL8egKqD.js +1387 -0
- package/dist/chunk-FMBD7UC4-heVR6BSA.js +19 -0
- package/dist/chunk-ND2GUHAM-BYH-wC2J.js +68 -0
- package/dist/chunk-QZHKN3VN-Bx2K7vkq.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-BLLfLYy0.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-BLLfLYy0.js +16 -0
- package/dist/components.js +3776 -2247
- package/dist/composables.js +96 -70
- package/dist/cose-bilkent-S5V4N54A-E1YmM_xr.js +2609 -0
- package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
- package/dist/dagre-BM42HDAG-BsXpQirH.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-CamqbWlY.js +217 -0
- package/dist/diagram-5GNKFQAL-DZyRFcOC.js +123 -0
- package/dist/diagram-KO2AKTUF-CmkGcy7R.js +461 -0
- package/dist/diagram-LMA3HP47-IdDwQPZ-.js +142 -0
- package/dist/diagram-OG6HWLK6-t0LBcUIU.js +528 -0
- package/dist/erDiagram-TEJ5UH35-DJBY2iZG.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-DE4MzPPk.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-CmAc35Yw.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-DDQZ5flw.js +815 -0
- package/dist/graph-BsJ8-1Pq.js +1510 -0
- package/dist/index.js +110 -83
- package/dist/infoDiagram-5YYISTIA-DSZjFR5g.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-DCO9dx2L.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-b-PpuBqg.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-BjclDuJZ.js +724 -0
- package/dist/katex-DNob3HGn.js +11690 -0
- package/dist/layout-D4wqKu72.js +1703 -0
- package/dist/linear-Voc3BJib.js +259 -0
- package/dist/mermaid.core-Dt_VbeGP.js +15940 -0
- package/dist/mindmap-definition-RKZ34NQL-B3vrXRVY.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-DFpWxSxk.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-BYHcrGoB.js +1024 -0
- package/dist/record.js +1199 -0
- package/dist/requirementDiagram-4Y6WPE33-C-FgWrRz.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-IwN0Evji.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-_OnqhBO2.js +2891 -0
- package/dist/stateDiagram-AJRCARHV-BRLv0Zcw.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-BofX0AdS.js +16 -0
- package/dist/timeline-definition-PNZ67QCA-C-DpPLpw.js +1055 -0
- package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-DoTZaJTW.js} +1528 -1725
- package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
- package/dist/vennDiagram-CIIHVFJN-zTHQR9Oq.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-au5koizO.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-BNf12P8z.js +1342 -0
- package/package.json +13 -8
- package/src/__tests__/assigner-graph.test.ts +82 -0
- package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
- package/src/__tests__/markdown-field.test.ts +150 -1
- package/src/__tests__/markdown-note-field.test.ts +86 -3
- package/src/__tests__/recorder-assigner-control.test.ts +993 -0
- package/src/__tests__/recorder-editor.test.ts +17 -0
- package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
- package/src/__tests__/step-field.test.ts +47 -1
- package/src/__tests__/type-plugins.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +806 -1
- package/src/components/AimdAssignerGraph.vue +816 -0
- package/src/components/AimdCodeField.vue +24 -5
- package/src/components/AimdMarkdownField.vue +556 -11
- package/src/components/AimdMarkdownNoteField.vue +241 -30
- package/src/components/AimdRecorder.vue +1619 -99
- package/src/components/AimdRecorderEditor.vue +276 -8
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
- package/src/components/AimdStepCheckField.vue +82 -18
- package/src/components/AimdVarField.vue +694 -25
- package/src/components/AimdVarTableField.vue +325 -138
- package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
- package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
- package/src/components/index.ts +9 -1
- package/src/components/recorderMilkdownPlugin.ts +14 -0
- package/src/composables/__tests__/useRecordState.test.ts +86 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +175 -0
- package/src/composables/index.ts +28 -1
- package/src/composables/useAssignerRunner.ts +376 -0
- package/src/composables/useCodeBlockRendering.ts +51 -0
- package/src/composables/useFieldRendering.ts +32 -4
- package/src/composables/useMonacoAutoHeight.ts +127 -0
- package/src/composables/useRecordState.ts +22 -3
- package/src/composables/useVarHelpers.ts +237 -32
- package/src/index.ts +20 -1
- package/src/locales.ts +45 -0
- package/src/record/index.ts +120 -0
- package/src/styles/aimd.css +216 -1
- package/src/type-plugins.ts +7 -0
- package/src/type-utils.ts +1 -3
- package/src/types.ts +130 -2
- package/dist/AimdCodeField-DC3DPvgc.js +0 -172
- package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
- package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import { computed, defineComponent, h, nextTick, onBeforeUnmount, ref, shallowRef, watch, type VNode } from 'vue'
|
|
3
3
|
import { AimdEditor } from '@airalogy/aimd-editor/vue'
|
|
4
4
|
import { renderToVue } from '@airalogy/aimd-renderer'
|
|
5
|
+
import { useCodeBlockRendering } from '../composables/useCodeBlockRendering'
|
|
6
|
+
import { createMonacoAutoHeight, type MonacoAutoHeightEditor } from '../composables/useMonacoAutoHeight'
|
|
5
7
|
|
|
6
8
|
type AimdEditorExpose = {
|
|
7
|
-
getMonacoEditor?: () =>
|
|
9
|
+
getMonacoEditor?: () => NoteMonacoEditor | null
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type NoteMonacoEditor = MonacoAutoHeightEditor & {
|
|
13
|
+
focus?: () => void
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
const props = withDefaults(defineProps<{
|
|
@@ -16,7 +22,6 @@ const props = withDefaults(defineProps<{
|
|
|
16
22
|
modelValue: undefined,
|
|
17
23
|
disabled: false,
|
|
18
24
|
locale: undefined,
|
|
19
|
-
minHeight: 220,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
const emit = defineEmits<{
|
|
@@ -44,19 +49,43 @@ function isZhLocale(locale?: string): boolean {
|
|
|
44
49
|
const fieldRootRef = ref<HTMLElement | null>(null)
|
|
45
50
|
const editorRef = ref<AimdEditorExpose | null>(null)
|
|
46
51
|
const draftValue = ref(normalizeMarkdownModelValue(props.modelValue))
|
|
52
|
+
const noteAutoHeight = createMonacoAutoHeight({
|
|
53
|
+
getInitialValue: () => draftValue.value,
|
|
54
|
+
getLayoutElement: () => fieldRootRef.value?.querySelector('.aimd-editor-container') as HTMLElement | null,
|
|
55
|
+
minHeight: props.minHeight,
|
|
56
|
+
maxHeight: 420,
|
|
57
|
+
})
|
|
58
|
+
const noteEditorHeight = noteAutoHeight.editorHeight
|
|
59
|
+
const noteFieldStyle = computed(() => ({
|
|
60
|
+
'--aimd-markdown-note-editor-height': `${noteEditorHeight.value}px`,
|
|
61
|
+
}))
|
|
47
62
|
const editing = ref(false)
|
|
48
63
|
const previewNodes = shallowRef<VNode[]>([])
|
|
49
64
|
const previewRenderFailed = ref(false)
|
|
50
65
|
let previewRenderRequestId = 0
|
|
51
66
|
let focusOutCheckTimer: ReturnType<typeof setTimeout> | null = null
|
|
67
|
+
let modeSwitchFocusGuardTimer: ReturnType<typeof setTimeout> | null = null
|
|
68
|
+
let modeSwitchFocusGuardActive = false
|
|
69
|
+
let pendingEditorFocus = false
|
|
70
|
+
const { preRenderer: codeBlockPreRenderer } = useCodeBlockRendering(() => {
|
|
71
|
+
void renderPreview()
|
|
72
|
+
})
|
|
52
73
|
|
|
53
74
|
const hasValue = computed(() => Boolean(draftValue.value.trim()))
|
|
54
75
|
const showPreview = computed(() => hasValue.value && !editing.value)
|
|
55
76
|
const showEditor = computed(() => !props.disabled && (!hasValue.value || editing.value))
|
|
56
77
|
const showEmptyState = computed(() => !showPreview.value && !showEditor.value)
|
|
57
|
-
const editLabel = computed(() => (isZhLocale(props.locale) ? '编辑备注' : 'Edit note'))
|
|
58
78
|
const closeLabel = computed(() => (isZhLocale(props.locale) ? '关闭备注' : 'Close note'))
|
|
59
79
|
const emptyLabel = computed(() => (isZhLocale(props.locale) ? '暂无备注' : 'No notes'))
|
|
80
|
+
const previewLabel = computed(() => (isZhLocale(props.locale) ? '预览' : 'Preview'))
|
|
81
|
+
const sourceLabel = computed(() => (isZhLocale(props.locale) ? '源码' : 'Source'))
|
|
82
|
+
const viewSwitchLabel = computed(() => (isZhLocale(props.locale) ? '备注显示模式' : 'Note view mode'))
|
|
83
|
+
const noteMonacoOptions = computed(() => ({
|
|
84
|
+
minimap: { enabled: false },
|
|
85
|
+
lineHeight: noteAutoHeight.lineHeight,
|
|
86
|
+
padding: { top: 12, bottom: 12 },
|
|
87
|
+
scrollbar: { vertical: 'auto', horizontal: 'auto' },
|
|
88
|
+
}))
|
|
60
89
|
|
|
61
90
|
const PreviewOutlet = defineComponent({
|
|
62
91
|
name: 'AimdMarkdownNotePreviewOutlet',
|
|
@@ -83,6 +112,7 @@ function syncEditingState() {
|
|
|
83
112
|
}
|
|
84
113
|
|
|
85
114
|
function emitDraftValue(markdown: string) {
|
|
115
|
+
noteAutoHeight.syncEstimatedEditorHeight(markdown)
|
|
86
116
|
if (markdown === draftValue.value) {
|
|
87
117
|
return
|
|
88
118
|
}
|
|
@@ -104,6 +134,9 @@ async function renderPreview() {
|
|
|
104
134
|
try {
|
|
105
135
|
const rendered = await renderToVue(currentContent, {
|
|
106
136
|
locale: props.locale,
|
|
137
|
+
elementRenderers: {
|
|
138
|
+
pre: codeBlockPreRenderer,
|
|
139
|
+
},
|
|
107
140
|
})
|
|
108
141
|
|
|
109
142
|
if (requestId !== previewRenderRequestId) {
|
|
@@ -127,12 +160,23 @@ async function beginEditing() {
|
|
|
127
160
|
return
|
|
128
161
|
}
|
|
129
162
|
|
|
163
|
+
guardModeSwitchFocus()
|
|
130
164
|
editing.value = true
|
|
131
|
-
await
|
|
132
|
-
|
|
165
|
+
await focusEditorAfterMount()
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function switchToPreview() {
|
|
169
|
+
if (!hasValue.value) {
|
|
170
|
+
return
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
guardModeSwitchFocus()
|
|
174
|
+
editing.value = false
|
|
175
|
+
void renderPreview()
|
|
133
176
|
}
|
|
134
177
|
|
|
135
178
|
function closeEditor() {
|
|
179
|
+
clearModeSwitchFocusGuard()
|
|
136
180
|
clearPendingFocusOutCheck()
|
|
137
181
|
editing.value = false
|
|
138
182
|
emit('close')
|
|
@@ -171,6 +215,50 @@ function clearPendingFocusOutCheck() {
|
|
|
171
215
|
}
|
|
172
216
|
}
|
|
173
217
|
|
|
218
|
+
function clearModeSwitchFocusGuard() {
|
|
219
|
+
if (modeSwitchFocusGuardTimer) {
|
|
220
|
+
clearTimeout(modeSwitchFocusGuardTimer)
|
|
221
|
+
modeSwitchFocusGuardTimer = null
|
|
222
|
+
}
|
|
223
|
+
modeSwitchFocusGuardActive = false
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function guardModeSwitchFocus() {
|
|
227
|
+
clearModeSwitchFocusGuard()
|
|
228
|
+
modeSwitchFocusGuardActive = true
|
|
229
|
+
modeSwitchFocusGuardTimer = setTimeout(() => {
|
|
230
|
+
modeSwitchFocusGuardTimer = null
|
|
231
|
+
modeSwitchFocusGuardActive = false
|
|
232
|
+
}, 80)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function focusCurrentEditor(): boolean {
|
|
236
|
+
const editor = editorRef.value?.getMonacoEditor?.()
|
|
237
|
+
if (!editor?.focus) {
|
|
238
|
+
pendingEditorFocus = true
|
|
239
|
+
return false
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
pendingEditorFocus = false
|
|
243
|
+
editor.focus()
|
|
244
|
+
return true
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
async function focusEditorAfterMount() {
|
|
248
|
+
await nextTick()
|
|
249
|
+
focusCurrentEditor()
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function handleEditorReady(editor: { monaco?: NoteMonacoEditor }) {
|
|
253
|
+
if (editor.monaco) {
|
|
254
|
+
noteAutoHeight.attachEditor(editor.monaco)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (pendingEditorFocus) {
|
|
258
|
+
focusCurrentEditor()
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
174
262
|
function handleFocusIn() {
|
|
175
263
|
clearPendingFocusOutCheck()
|
|
176
264
|
}
|
|
@@ -182,6 +270,10 @@ function emitBlurIfLeavingField(event: FocusEvent) {
|
|
|
182
270
|
return
|
|
183
271
|
}
|
|
184
272
|
|
|
273
|
+
if (modeSwitchFocusGuardActive) {
|
|
274
|
+
return
|
|
275
|
+
}
|
|
276
|
+
|
|
185
277
|
clearPendingFocusOutCheck()
|
|
186
278
|
focusOutCheckTimer = setTimeout(() => {
|
|
187
279
|
focusOutCheckTimer = null
|
|
@@ -205,6 +297,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
205
297
|
}
|
|
206
298
|
|
|
207
299
|
draftValue.value = nextValue
|
|
300
|
+
noteAutoHeight.syncEstimatedEditorHeight(nextValue)
|
|
208
301
|
})
|
|
209
302
|
|
|
210
303
|
watch(
|
|
@@ -220,8 +313,16 @@ watch(() => props.disabled, () => {
|
|
|
220
313
|
syncEditingState()
|
|
221
314
|
})
|
|
222
315
|
|
|
316
|
+
watch(showEditor, (visible) => {
|
|
317
|
+
if (visible && !props.disabled) {
|
|
318
|
+
void focusEditorAfterMount()
|
|
319
|
+
}
|
|
320
|
+
}, { immediate: true })
|
|
321
|
+
|
|
223
322
|
onBeforeUnmount(() => {
|
|
224
323
|
clearPendingFocusOutCheck()
|
|
324
|
+
clearModeSwitchFocusGuard()
|
|
325
|
+
noteAutoHeight.dispose()
|
|
225
326
|
})
|
|
226
327
|
</script>
|
|
227
328
|
|
|
@@ -229,6 +330,7 @@ onBeforeUnmount(() => {
|
|
|
229
330
|
<div
|
|
230
331
|
ref="fieldRootRef"
|
|
231
332
|
class="aimd-markdown-note-field"
|
|
333
|
+
:style="noteFieldStyle"
|
|
232
334
|
:class="{
|
|
233
335
|
'aimd-markdown-note-field--disabled': disabled,
|
|
234
336
|
'aimd-markdown-note-field--preview': showPreview,
|
|
@@ -240,13 +342,23 @@ onBeforeUnmount(() => {
|
|
|
240
342
|
>
|
|
241
343
|
<div v-if="showPreview" class="aimd-markdown-note-field__preview-shell">
|
|
242
344
|
<div v-if="!disabled" class="aimd-markdown-note-field__preview-actions">
|
|
243
|
-
<
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
345
|
+
<span class="aimd-markdown-note-field__view-switch" role="group" :aria-label="viewSwitchLabel">
|
|
346
|
+
<button
|
|
347
|
+
type="button"
|
|
348
|
+
class="aimd-markdown-note-field__view-btn aimd-markdown-note-field__view-btn--active"
|
|
349
|
+
aria-pressed="true"
|
|
350
|
+
>
|
|
351
|
+
{{ previewLabel }}
|
|
352
|
+
</button>
|
|
353
|
+
<button
|
|
354
|
+
type="button"
|
|
355
|
+
class="aimd-markdown-note-field__view-btn aimd-markdown-note-field__view-btn--source"
|
|
356
|
+
aria-pressed="false"
|
|
357
|
+
@click="beginEditing"
|
|
358
|
+
>
|
|
359
|
+
{{ sourceLabel }}
|
|
360
|
+
</button>
|
|
361
|
+
</span>
|
|
250
362
|
</div>
|
|
251
363
|
<div
|
|
252
364
|
class="aimd-markdown-note-field__preview"
|
|
@@ -266,6 +378,24 @@ onBeforeUnmount(() => {
|
|
|
266
378
|
|
|
267
379
|
<div v-else-if="showEditor" class="aimd-markdown-note-field__editor-shell">
|
|
268
380
|
<div class="aimd-markdown-note-field__editor-actions">
|
|
381
|
+
<span class="aimd-markdown-note-field__view-switch" role="group" :aria-label="viewSwitchLabel">
|
|
382
|
+
<button
|
|
383
|
+
type="button"
|
|
384
|
+
class="aimd-markdown-note-field__view-btn aimd-markdown-note-field__view-btn--preview"
|
|
385
|
+
:disabled="!hasValue"
|
|
386
|
+
aria-pressed="false"
|
|
387
|
+
@click="switchToPreview"
|
|
388
|
+
>
|
|
389
|
+
{{ previewLabel }}
|
|
390
|
+
</button>
|
|
391
|
+
<button
|
|
392
|
+
type="button"
|
|
393
|
+
class="aimd-markdown-note-field__view-btn aimd-markdown-note-field__view-btn--active"
|
|
394
|
+
aria-pressed="true"
|
|
395
|
+
>
|
|
396
|
+
{{ sourceLabel }}
|
|
397
|
+
</button>
|
|
398
|
+
</span>
|
|
269
399
|
<button
|
|
270
400
|
type="button"
|
|
271
401
|
class="aimd-markdown-note-field__editor-close"
|
|
@@ -287,10 +417,11 @@ onBeforeUnmount(() => {
|
|
|
287
417
|
:show-aimd-toolbar="true"
|
|
288
418
|
:enable-block-handle="!disabled"
|
|
289
419
|
:keep-inactive-editors-mounted="false"
|
|
290
|
-
:min-height="
|
|
420
|
+
:min-height="noteEditorHeight"
|
|
291
421
|
:readonly="disabled"
|
|
292
|
-
:monaco-options="
|
|
422
|
+
:monaco-options="noteMonacoOptions"
|
|
293
423
|
@update:model-value="emitDraftValue"
|
|
424
|
+
@ready="handleEditorReady"
|
|
294
425
|
/>
|
|
295
426
|
</div>
|
|
296
427
|
|
|
@@ -322,38 +453,62 @@ onBeforeUnmount(() => {
|
|
|
322
453
|
|
|
323
454
|
.aimd-markdown-note-field__preview-actions {
|
|
324
455
|
display: flex;
|
|
456
|
+
align-items: center;
|
|
325
457
|
justify-content: flex-end;
|
|
458
|
+
gap: 8px;
|
|
459
|
+
padding: 8px 8px 0;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.aimd-markdown-note-field__editor-shell {
|
|
463
|
+
min-width: 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.aimd-markdown-note-field__editor-actions {
|
|
467
|
+
display: flex;
|
|
468
|
+
align-items: center;
|
|
469
|
+
justify-content: space-between;
|
|
470
|
+
gap: 8px;
|
|
326
471
|
padding: 8px 8px 0;
|
|
472
|
+
background: #fff;
|
|
327
473
|
}
|
|
328
474
|
|
|
329
|
-
.aimd-markdown-note-
|
|
475
|
+
.aimd-markdown-note-field__view-switch {
|
|
476
|
+
display: inline-flex;
|
|
477
|
+
min-height: 26px;
|
|
478
|
+
align-items: center;
|
|
479
|
+
overflow: hidden;
|
|
330
480
|
border: 1px solid #d1d9e6;
|
|
331
481
|
border-radius: 999px;
|
|
332
|
-
|
|
482
|
+
background: #f8fbff;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.aimd-markdown-note-field__view-btn {
|
|
486
|
+
min-height: 24px;
|
|
333
487
|
padding: 0 10px;
|
|
334
|
-
|
|
335
|
-
|
|
488
|
+
border: 0 none;
|
|
489
|
+
border-radius: 999px;
|
|
490
|
+
background: transparent;
|
|
491
|
+
color: #64748b;
|
|
336
492
|
font-size: 12px;
|
|
337
493
|
font-weight: 600;
|
|
338
494
|
cursor: pointer;
|
|
339
|
-
transition: border-color 0.2s, background-color 0.2s, color 0.2s;
|
|
340
495
|
}
|
|
341
496
|
|
|
342
|
-
.aimd-markdown-note-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
color: #1f4f8f;
|
|
497
|
+
.aimd-markdown-note-field__view-btn:hover:not(:disabled):not(.aimd-markdown-note-field__view-btn--active) {
|
|
498
|
+
background: #eef5ff;
|
|
499
|
+
color: #334155;
|
|
346
500
|
}
|
|
347
501
|
|
|
348
|
-
.aimd-markdown-note-
|
|
349
|
-
|
|
502
|
+
.aimd-markdown-note-field__view-btn--active {
|
|
503
|
+
background: #ffffff;
|
|
504
|
+
color: #1f4f8f;
|
|
505
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
|
|
506
|
+
cursor: default;
|
|
350
507
|
}
|
|
351
508
|
|
|
352
|
-
.aimd-markdown-note-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
padding: 8px 8px 0;
|
|
356
|
-
background: #fff;
|
|
509
|
+
.aimd-markdown-note-field__view-btn:disabled {
|
|
510
|
+
cursor: not-allowed;
|
|
511
|
+
opacity: 0.48;
|
|
357
512
|
}
|
|
358
513
|
|
|
359
514
|
.aimd-markdown-note-field__editor-close {
|
|
@@ -403,6 +558,54 @@ onBeforeUnmount(() => {
|
|
|
403
558
|
color: inherit;
|
|
404
559
|
}
|
|
405
560
|
|
|
561
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block) {
|
|
562
|
+
max-width: 100%;
|
|
563
|
+
overflow: hidden;
|
|
564
|
+
margin: 0.8em 0;
|
|
565
|
+
padding: 0;
|
|
566
|
+
border: 1px solid #d8e1ee;
|
|
567
|
+
border-radius: 8px;
|
|
568
|
+
background: #f8fafc;
|
|
569
|
+
color: #0f172a;
|
|
570
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
571
|
+
font-size: 13px;
|
|
572
|
+
line-height: 1.58;
|
|
573
|
+
white-space: normal;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block__code) {
|
|
577
|
+
display: block;
|
|
578
|
+
padding: 10px 0;
|
|
579
|
+
border-radius: 0;
|
|
580
|
+
background: transparent;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block__line) {
|
|
584
|
+
display: grid;
|
|
585
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
586
|
+
column-gap: 12px;
|
|
587
|
+
padding-right: 12px;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block__line-number) {
|
|
591
|
+
min-width: 3ch;
|
|
592
|
+
padding-left: 12px;
|
|
593
|
+
color: #94a3b8;
|
|
594
|
+
text-align: right;
|
|
595
|
+
user-select: none;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block__line-code) {
|
|
599
|
+
min-width: 0;
|
|
600
|
+
white-space: pre-wrap;
|
|
601
|
+
overflow-wrap: anywhere;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.aimd-markdown-note-field__preview :deep(.aimd-code-block--wrap .aimd-code-block__line-code) {
|
|
605
|
+
padding-left: var(--aimd-code-wrap-indent, 0ch);
|
|
606
|
+
text-indent: calc(-1 * var(--aimd-code-wrap-indent, 0ch));
|
|
607
|
+
}
|
|
608
|
+
|
|
406
609
|
.aimd-markdown-note-field__empty {
|
|
407
610
|
padding: 12px 14px;
|
|
408
611
|
color: #94a3b8;
|
|
@@ -423,12 +626,20 @@ onBeforeUnmount(() => {
|
|
|
423
626
|
|
|
424
627
|
.aimd-markdown-note-field :deep(.aimd-editor-panel) {
|
|
425
628
|
min-width: 0;
|
|
629
|
+
min-height: var(--aimd-markdown-note-editor-height) !important;
|
|
426
630
|
}
|
|
427
631
|
|
|
428
632
|
.aimd-markdown-note-field :deep(.aimd-editor-source-mode) {
|
|
633
|
+
height: var(--aimd-markdown-note-editor-height) !important;
|
|
634
|
+
min-height: var(--aimd-markdown-note-editor-height);
|
|
429
635
|
background: #fff;
|
|
430
636
|
}
|
|
431
637
|
|
|
638
|
+
.aimd-markdown-note-field :deep(.aimd-editor-container) {
|
|
639
|
+
height: var(--aimd-markdown-note-editor-height);
|
|
640
|
+
min-height: var(--aimd-markdown-note-editor-height);
|
|
641
|
+
}
|
|
642
|
+
|
|
432
643
|
.aimd-markdown-note-field :deep(.aimd-editor-wysiwyg-mode) {
|
|
433
644
|
height: auto !important;
|
|
434
645
|
overflow-y: visible !important;
|