@airalogy/aimd-recorder 1.17.0 → 1.18.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.
Files changed (106) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3922 -3829
  6. package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
  7. package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
  8. package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
  9. package/dist/aimd-recorder.css +1 -1
  10. package/dist/arc-DS_ocYoe.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
  14. package/dist/channel-CtXnYrAk.js +5 -0
  15. package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
  16. package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
  17. package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
  18. package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
  21. package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
  25. package/dist/components.js +3279 -2216
  26. package/dist/composables.js +92 -68
  27. package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
  32. package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
  34. package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
  35. package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
  40. package/dist/graph-DdlKE625.js +1510 -0
  41. package/dist/index.js +104 -80
  42. package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-DDt0fz-M.js +1703 -0
  49. package/dist/linear-C-IAFdOt.js +259 -0
  50. package/dist/mermaid.core-CuZ3nINf.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
  55. package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
  56. package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
  57. package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
  58. package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
  59. package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
  60. package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
  61. package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-qA6gj4vz.js} +3035 -2254
  62. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  63. package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
  64. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  65. package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
  66. package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
  67. package/package.json +9 -8
  68. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  69. package/src/__tests__/markdown-field.test.ts +150 -1
  70. package/src/__tests__/markdown-note-field.test.ts +86 -3
  71. package/src/__tests__/recorder-assigner-control.test.ts +844 -0
  72. package/src/__tests__/recorder-editor.test.ts +17 -0
  73. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  74. package/src/__tests__/step-field.test.ts +47 -1
  75. package/src/__tests__/type-plugins.test.ts +1 -0
  76. package/src/__tests__/var-field-render.test.ts +741 -1
  77. package/src/components/AimdCodeField.vue +24 -5
  78. package/src/components/AimdMarkdownField.vue +548 -11
  79. package/src/components/AimdMarkdownNoteField.vue +241 -30
  80. package/src/components/AimdRecorder.vue +1521 -95
  81. package/src/components/AimdRecorderEditor.vue +276 -8
  82. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  83. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  84. package/src/components/AimdStepCheckField.vue +82 -18
  85. package/src/components/AimdVarField.vue +694 -25
  86. package/src/components/AimdVarTableField.vue +283 -110
  87. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  88. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  89. package/src/components/recorderMilkdownPlugin.ts +14 -0
  90. package/src/composables/__tests__/useRecordState.test.ts +86 -0
  91. package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
  92. package/src/composables/index.ts +27 -1
  93. package/src/composables/useAssignerRunner.ts +376 -0
  94. package/src/composables/useCodeBlockRendering.ts +51 -0
  95. package/src/composables/useFieldRendering.ts +32 -4
  96. package/src/composables/useMonacoAutoHeight.ts +127 -0
  97. package/src/composables/useRecordState.ts +22 -3
  98. package/src/composables/useVarHelpers.ts +377 -9
  99. package/src/index.ts +13 -0
  100. package/src/locales.ts +45 -0
  101. package/src/styles/aimd.css +151 -1
  102. package/src/type-plugins.ts +7 -0
  103. package/src/types.ts +93 -2
  104. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  105. package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
  106. 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 detailChildren = []
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 timerDetailChildren = []
213
+ const timerBadgeChildren: VNodeChild[] = []
196
214
 
197
215
  if (countdownEnabled.value && countdownLabel.value) {
198
- timerDetailChildren.push(
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
- timerDetailChildren.push(
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
- detailChildren.push(
244
+ timerDetailChildren.push(
227
245
  h("span", {
228
246
  class: "aimd-step-field__detail aimd-step-field__detail--timer",
229
247
  }, [
230
- ...timerDetailChildren,
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
- detailChildren.push(
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
- showDetailRow.value
368
- ? h("div", { class: "aimd-step-field__details" }, detailChildren)
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
  }