@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { computed, defineAsyncComponent, defineComponent, h, onBeforeUnmount, ref, watch, type PropType, type VNodeChild } from "vue"
|
|
2
|
+
import { computed, defineAsyncComponent, defineComponent, h, nextTick, onBeforeUnmount, ref, watch, type PropType, type VNodeChild } from "vue"
|
|
3
3
|
import type { AimdStepNode, AimdCheckNode, AimdStepTimerMode } from "@airalogy/aimd-core/types"
|
|
4
4
|
import type { AimdRecorderMessages } from "../locales"
|
|
5
5
|
import { getAimdRecorderScopeLabel } from "../locales"
|
|
@@ -32,6 +32,7 @@ export const AimdStepField = defineComponent({
|
|
|
32
32
|
setup(props, { emit }) {
|
|
33
33
|
const nowMs = ref(Date.now())
|
|
34
34
|
const rootEl = ref<HTMLElement | null>(null)
|
|
35
|
+
const annotationDetailsEl = ref<HTMLElement | null>(null)
|
|
35
36
|
const annotationExpanded = ref(false)
|
|
36
37
|
const timerExpanded = ref(false)
|
|
37
38
|
let liveTimer: ReturnType<typeof setInterval> | null = null
|
|
@@ -122,7 +123,6 @@ export const AimdStepField = defineComponent({
|
|
|
122
123
|
|| timerExpanded.value
|
|
123
124
|
))
|
|
124
125
|
const showTimerSummary = computed(() => !showTimerDetails.value && (timerRunning.value || hasRecordedDuration.value))
|
|
125
|
-
const showDetailRow = computed(() => showAnnotationEditor.value || showTimerDetails.value)
|
|
126
126
|
|
|
127
127
|
function clearPendingFocusOutCheck() {
|
|
128
128
|
if (focusOutCheckTimer) {
|
|
@@ -164,6 +164,7 @@ export const AimdStepField = defineComponent({
|
|
|
164
164
|
|
|
165
165
|
function openAnnotationDetail() {
|
|
166
166
|
annotationExpanded.value = true
|
|
167
|
+
scrollDetailsIntoView()
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
function openTimerDetail() {
|
|
@@ -175,27 +176,44 @@ export const AimdStepField = defineComponent({
|
|
|
175
176
|
event.preventDefault()
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
function scrollDetailsIntoView() {
|
|
180
|
+
void nextTick(() => {
|
|
181
|
+
const target = annotationDetailsEl.value
|
|
182
|
+
if (typeof target?.scrollIntoView !== "function") {
|
|
183
|
+
return
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
target.scrollIntoView({
|
|
187
|
+
block: "nearest",
|
|
188
|
+
inline: "nearest",
|
|
189
|
+
behavior: "smooth",
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
|
|
178
194
|
return () => {
|
|
179
195
|
const node = props.node
|
|
180
196
|
const id = node.id
|
|
181
197
|
const state = props.state
|
|
182
198
|
const stepNumber = node.step || "?"
|
|
183
199
|
const hasCheck = Boolean(node.check)
|
|
200
|
+
const hasBody = props.bodyNodes.length > 0
|
|
184
201
|
const disabled = props.disabled
|
|
185
202
|
const extraClasses = props.extraClasses
|
|
186
203
|
const canResetTimer = hasRecordedDuration.value || timerRunning.value
|
|
187
204
|
const startButtonLabel = timerRunning.value
|
|
188
205
|
? props.messages.step.pauseTimer
|
|
189
206
|
: (hasRecordedDuration.value ? props.messages.step.resumeTimer : props.messages.step.startTimer)
|
|
190
|
-
const
|
|
207
|
+
const timerDetailChildren: VNodeChild[] = []
|
|
208
|
+
const annotationDetailChildren: VNodeChild[] = []
|
|
191
209
|
const headerMetaChildren = []
|
|
192
210
|
const headerActionChildren = []
|
|
193
211
|
|
|
194
212
|
if (showTimerDetails.value) {
|
|
195
|
-
const
|
|
213
|
+
const timerBadgeChildren: VNodeChild[] = []
|
|
196
214
|
|
|
197
215
|
if (countdownEnabled.value && countdownLabel.value) {
|
|
198
|
-
|
|
216
|
+
timerBadgeChildren.push(
|
|
199
217
|
h("span", {
|
|
200
218
|
class: [
|
|
201
219
|
"aimd-step-timer__hero",
|
|
@@ -211,7 +229,7 @@ export const AimdStepField = defineComponent({
|
|
|
211
229
|
}
|
|
212
230
|
|
|
213
231
|
if (showElapsedDetail.value) {
|
|
214
|
-
|
|
232
|
+
timerBadgeChildren.push(
|
|
215
233
|
h("span", {
|
|
216
234
|
class: [
|
|
217
235
|
"aimd-step-timer__pill",
|
|
@@ -223,11 +241,11 @@ export const AimdStepField = defineComponent({
|
|
|
223
241
|
)
|
|
224
242
|
}
|
|
225
243
|
|
|
226
|
-
|
|
244
|
+
timerDetailChildren.push(
|
|
227
245
|
h("span", {
|
|
228
246
|
class: "aimd-step-field__detail aimd-step-field__detail--timer",
|
|
229
247
|
}, [
|
|
230
|
-
...
|
|
248
|
+
...timerBadgeChildren,
|
|
231
249
|
!disabled
|
|
232
250
|
? h("span", { class: "aimd-step-timer__controls" }, [
|
|
233
251
|
h("button", {
|
|
@@ -248,7 +266,7 @@ export const AimdStepField = defineComponent({
|
|
|
248
266
|
}
|
|
249
267
|
|
|
250
268
|
if (showAnnotationEditor.value) {
|
|
251
|
-
|
|
269
|
+
annotationDetailChildren.push(
|
|
252
270
|
h("span", {
|
|
253
271
|
class: "aimd-step-field__detail aimd-step-field__detail--annotation",
|
|
254
272
|
}, [
|
|
@@ -256,7 +274,6 @@ export const AimdStepField = defineComponent({
|
|
|
256
274
|
class: "aimd-step-field__annotation-editor",
|
|
257
275
|
disabled,
|
|
258
276
|
locale: props.locale,
|
|
259
|
-
minHeight: 220,
|
|
260
277
|
modelValue: state.annotation || "",
|
|
261
278
|
"onUpdate:modelValue": (value: string) => {
|
|
262
279
|
emit("annotation-change", {
|
|
@@ -319,7 +336,7 @@ export const AimdStepField = defineComponent({
|
|
|
319
336
|
)
|
|
320
337
|
}
|
|
321
338
|
|
|
322
|
-
if (!disabled && !showAnnotationEditor.value) {
|
|
339
|
+
if (!disabled && !hasBody && !showAnnotationEditor.value) {
|
|
323
340
|
headerActionChildren.push(
|
|
324
341
|
h("button", {
|
|
325
342
|
type: "button",
|
|
@@ -342,7 +359,37 @@ export const AimdStepField = defineComponent({
|
|
|
342
359
|
}
|
|
343
360
|
|
|
344
361
|
const bodyChildren = props.bodyNodes.length > 0
|
|
345
|
-
? h("div", { class: "aimd-step-field__body" }, props.bodyNodes)
|
|
362
|
+
? h("div", { key: "body", class: "aimd-step-field__body" }, props.bodyNodes.slice())
|
|
363
|
+
: null
|
|
364
|
+
const bodyAnnotationAction = hasBody && !disabled && !showAnnotationEditor.value
|
|
365
|
+
? h("div", {
|
|
366
|
+
key: "body-annotation-actions",
|
|
367
|
+
class: "aimd-step-field__body-actions",
|
|
368
|
+
}, [
|
|
369
|
+
h("button", {
|
|
370
|
+
type: "button",
|
|
371
|
+
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost aimd-step-field__toggle aimd-step-field__toggle--annotation aimd-step-field__body-action",
|
|
372
|
+
onMousedown: preventToggleFocus,
|
|
373
|
+
onClick: openAnnotationDetail,
|
|
374
|
+
}, props.messages.step.annotationToggle),
|
|
375
|
+
])
|
|
376
|
+
: null
|
|
377
|
+
const timerDetailSlot = timerDetailChildren.length > 0
|
|
378
|
+
? h("div", {
|
|
379
|
+
key: "timer-details-slot",
|
|
380
|
+
class: "aimd-step-field__details-slot aimd-step-field__details-slot--timer",
|
|
381
|
+
}, [
|
|
382
|
+
h("div", { class: "aimd-step-field__details" }, timerDetailChildren),
|
|
383
|
+
])
|
|
384
|
+
: null
|
|
385
|
+
const annotationDetailSlot = annotationDetailChildren.length > 0
|
|
386
|
+
? h("div", {
|
|
387
|
+
key: "annotation-details-slot",
|
|
388
|
+
ref: annotationDetailsEl,
|
|
389
|
+
class: "aimd-step-field__details-slot aimd-step-field__details-slot--annotation",
|
|
390
|
+
}, [
|
|
391
|
+
h("div", { class: "aimd-step-field__details" }, annotationDetailChildren),
|
|
392
|
+
])
|
|
346
393
|
: null
|
|
347
394
|
|
|
348
395
|
return h("div", {
|
|
@@ -352,6 +399,7 @@ export const AimdStepField = defineComponent({
|
|
|
352
399
|
onFocusout: handleFocusOut,
|
|
353
400
|
}, [
|
|
354
401
|
h("div", {
|
|
402
|
+
key: "main",
|
|
355
403
|
class: "aimd-step-field__main",
|
|
356
404
|
}, [
|
|
357
405
|
h("div", {
|
|
@@ -363,10 +411,10 @@ export const AimdStepField = defineComponent({
|
|
|
363
411
|
}, headerActionChildren)
|
|
364
412
|
: null,
|
|
365
413
|
]),
|
|
414
|
+
timerDetailSlot,
|
|
366
415
|
bodyChildren,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
: null,
|
|
416
|
+
bodyAnnotationAction,
|
|
417
|
+
annotationDetailSlot,
|
|
370
418
|
])
|
|
371
419
|
}
|
|
372
420
|
},
|
|
@@ -386,6 +434,7 @@ export const AimdCheckField = defineComponent({
|
|
|
386
434
|
emits: ["check-change", "annotation-change", "blur"],
|
|
387
435
|
setup(props, { emit }) {
|
|
388
436
|
const rootEl = ref<HTMLElement | null>(null)
|
|
437
|
+
const detailsEl = ref<HTMLElement | null>(null)
|
|
389
438
|
const annotationExpanded = ref(false)
|
|
390
439
|
let focusOutCheckTimer: ReturnType<typeof setTimeout> | null = null
|
|
391
440
|
|
|
@@ -429,12 +478,28 @@ export const AimdCheckField = defineComponent({
|
|
|
429
478
|
|
|
430
479
|
function openAnnotationDetail() {
|
|
431
480
|
annotationExpanded.value = true
|
|
481
|
+
scrollDetailsIntoView()
|
|
432
482
|
}
|
|
433
483
|
|
|
434
484
|
function preventToggleFocus(event: MouseEvent) {
|
|
435
485
|
event.preventDefault()
|
|
436
486
|
}
|
|
437
487
|
|
|
488
|
+
function scrollDetailsIntoView() {
|
|
489
|
+
void nextTick(() => {
|
|
490
|
+
const target = detailsEl.value
|
|
491
|
+
if (typeof target?.scrollIntoView !== "function") {
|
|
492
|
+
return
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
target.scrollIntoView({
|
|
496
|
+
block: "nearest",
|
|
497
|
+
inline: "nearest",
|
|
498
|
+
behavior: "smooth",
|
|
499
|
+
})
|
|
500
|
+
})
|
|
501
|
+
}
|
|
502
|
+
|
|
438
503
|
onBeforeUnmount(() => {
|
|
439
504
|
clearPendingFocusOutCheck()
|
|
440
505
|
})
|
|
@@ -469,7 +534,6 @@ export const AimdCheckField = defineComponent({
|
|
|
469
534
|
class: "aimd-check-field__annotation-editor",
|
|
470
535
|
disabled,
|
|
471
536
|
locale: props.locale,
|
|
472
|
-
minHeight: 220,
|
|
473
537
|
modelValue: state.annotation || "",
|
|
474
538
|
"onUpdate:modelValue": (value: string) => {
|
|
475
539
|
emit("annotation-change", {
|
|
@@ -525,14 +589,14 @@ export const AimdCheckField = defineComponent({
|
|
|
525
589
|
"aimd-check-field__body",
|
|
526
590
|
state.checked ? "aimd-check-field__body--checked" : "",
|
|
527
591
|
],
|
|
528
|
-
}, props.bodyNodes)
|
|
592
|
+
}, props.bodyNodes.slice())
|
|
529
593
|
: null,
|
|
530
594
|
]),
|
|
531
595
|
showCheckedMessage
|
|
532
596
|
? h("div", { class: "aimd-check-field__banner" }, node.checked_message)
|
|
533
597
|
: null,
|
|
534
598
|
detailChildren.length > 0
|
|
535
|
-
? h("div", { class: "aimd-check-field__details" }, detailChildren)
|
|
599
|
+
? h("div", { ref: detailsEl, class: "aimd-check-field__details" }, detailChildren)
|
|
536
600
|
: null,
|
|
537
601
|
])
|
|
538
602
|
}
|