@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.
Files changed (112) hide show
  1. package/README.md +42 -10
  2. package/README.zh-CN.md +42 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-TBKunqU_.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js} +3922 -3829
  6. package/dist/AimdMarkdownField-DmNX2g4j.js +254 -0
  7. package/dist/AimdMarkdownNoteField-B5ruzmwS.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-B-vsgEXF.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-BwPNOtNH.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-CMUI4kKc.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-Cpmfsy_s.js +1577 -0
  14. package/dist/channel-DlMAXHQK.js +5 -0
  15. package/dist/chunk-2J33WTMH-DP9BS2ux.js +19 -0
  16. package/dist/chunk-4BX2VUAB-ncsOeLMb.js +8 -0
  17. package/dist/chunk-55IACEB6-C7wHk4B7.js +8 -0
  18. package/dist/chunk-727SXJPM-Caa5aVUO.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-CL8egKqD.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-heVR6BSA.js +19 -0
  21. package/dist/chunk-ND2GUHAM-BYH-wC2J.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Bx2K7vkq.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BLLfLYy0.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BLLfLYy0.js +16 -0
  25. package/dist/components.js +3776 -2247
  26. package/dist/composables.js +96 -70
  27. package/dist/cose-bilkent-S5V4N54A-E1YmM_xr.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-BsXpQirH.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-CamqbWlY.js +217 -0
  32. package/dist/diagram-5GNKFQAL-DZyRFcOC.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CmkGcy7R.js +461 -0
  34. package/dist/diagram-LMA3HP47-IdDwQPZ-.js +142 -0
  35. package/dist/diagram-OG6HWLK6-t0LBcUIU.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-DJBY2iZG.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-DE4MzPPk.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CmAc35Yw.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-DDQZ5flw.js +815 -0
  40. package/dist/graph-BsJ8-1Pq.js +1510 -0
  41. package/dist/index.js +110 -83
  42. package/dist/infoDiagram-5YYISTIA-DSZjFR5g.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-DCO9dx2L.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-b-PpuBqg.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-BjclDuJZ.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-D4wqKu72.js +1703 -0
  49. package/dist/linear-Voc3BJib.js +259 -0
  50. package/dist/mermaid.core-Dt_VbeGP.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-B3vrXRVY.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DFpWxSxk.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-BYHcrGoB.js +1024 -0
  55. package/dist/record.js +1199 -0
  56. package/dist/requirementDiagram-4Y6WPE33-C-FgWrRz.js +882 -0
  57. package/dist/sankeyDiagram-5OEKKPKP-IwN0Evji.js +847 -0
  58. package/dist/sequenceDiagram-3UESZ5HK-_OnqhBO2.js +2891 -0
  59. package/dist/stateDiagram-AJRCARHV-BRLv0Zcw.js +263 -0
  60. package/dist/stateDiagram-v2-BHNVJYJU-BofX0AdS.js +16 -0
  61. package/dist/timeline-definition-PNZ67QCA-C-DpPLpw.js +1055 -0
  62. package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-DoTZaJTW.js} +1528 -1725
  63. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  64. package/dist/vennDiagram-CIIHVFJN-zTHQR9Oq.js +1557 -0
  65. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  66. package/dist/wardleyDiagram-YWT4CUSO-au5koizO.js +675 -0
  67. package/dist/xychartDiagram-2RQKCTM6-BNf12P8z.js +1342 -0
  68. package/package.json +13 -8
  69. package/src/__tests__/assigner-graph.test.ts +82 -0
  70. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  71. package/src/__tests__/markdown-field.test.ts +150 -1
  72. package/src/__tests__/markdown-note-field.test.ts +86 -3
  73. package/src/__tests__/recorder-assigner-control.test.ts +993 -0
  74. package/src/__tests__/recorder-editor.test.ts +17 -0
  75. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  76. package/src/__tests__/step-field.test.ts +47 -1
  77. package/src/__tests__/type-plugins.test.ts +1 -0
  78. package/src/__tests__/var-field-render.test.ts +806 -1
  79. package/src/components/AimdAssignerGraph.vue +816 -0
  80. package/src/components/AimdCodeField.vue +24 -5
  81. package/src/components/AimdMarkdownField.vue +556 -11
  82. package/src/components/AimdMarkdownNoteField.vue +241 -30
  83. package/src/components/AimdRecorder.vue +1619 -99
  84. package/src/components/AimdRecorderEditor.vue +276 -8
  85. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  86. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  87. package/src/components/AimdStepCheckField.vue +82 -18
  88. package/src/components/AimdVarField.vue +694 -25
  89. package/src/components/AimdVarTableField.vue +325 -138
  90. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  91. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  92. package/src/components/index.ts +9 -1
  93. package/src/components/recorderMilkdownPlugin.ts +14 -0
  94. package/src/composables/__tests__/useRecordState.test.ts +86 -0
  95. package/src/composables/__tests__/useVarHelpers.test.ts +175 -0
  96. package/src/composables/index.ts +28 -1
  97. package/src/composables/useAssignerRunner.ts +376 -0
  98. package/src/composables/useCodeBlockRendering.ts +51 -0
  99. package/src/composables/useFieldRendering.ts +32 -4
  100. package/src/composables/useMonacoAutoHeight.ts +127 -0
  101. package/src/composables/useRecordState.ts +22 -3
  102. package/src/composables/useVarHelpers.ts +237 -32
  103. package/src/index.ts +20 -1
  104. package/src/locales.ts +45 -0
  105. package/src/record/index.ts +120 -0
  106. package/src/styles/aimd.css +216 -1
  107. package/src/type-plugins.ts +7 -0
  108. package/src/type-utils.ts +1 -3
  109. package/src/types.ts +130 -2
  110. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  111. package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
  112. package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
@@ -69,6 +69,23 @@ describe('AimdRecorderEditor', () => {
69
69
  expect(source).toMatch(/aimd-recorder-workbench__panel-body--recorder \{[\s\S]*overflow: auto;/)
70
70
  })
71
71
 
72
+ it('lets users resize the source and recorder columns or collapse the source panel', () => {
73
+ expect(source).toMatch(/const sourcePanelCollapsed = ref\(false\)/)
74
+ expect(source).toMatch(/const sourcePanelWidthPercent = ref\(50\)/)
75
+ expect(source).toMatch(/const isPanelResizing = ref\(false\)/)
76
+ expect(source).toMatch(/const workbenchMainStyle = computed/)
77
+ expect(source).toMatch(/--aimd-recorder-source-panel-width/)
78
+ expect(source).toMatch(/function handlePanelResizePointerDown\(event: PointerEvent\)/)
79
+ expect(source).toMatch(/function handlePanelResizeKeydown\(event: KeyboardEvent\)/)
80
+ expect(source).toMatch(/function setSourcePanelCollapsed\(collapsed: boolean\)/)
81
+ expect(source).toMatch(/aimd-recorder-workbench__splitter/)
82
+ expect(source).toMatch(/aimd-recorder-workbench__main--source-collapsed/)
83
+ expect(source).toMatch(/aimd-recorder-workbench__main--resizing/)
84
+ expect(source).toMatch(/workbenchUi\.collapseSource/)
85
+ expect(source).toMatch(/workbenchUi\.expandSource/)
86
+ expect(source).toMatch(/grid-template-columns: minmax\(260px, var\(--aimd-recorder-source-panel-width, 50%\)\) 12px minmax\(0, 1fr\);/)
87
+ })
88
+
72
89
  it('can fit both columns to the remaining viewport height while still exposing a fixed-height opt-out', () => {
73
90
  expect(source).toMatch(/fitViewport\?: boolean/)
74
91
  expect(source).toMatch(/viewportOffset\?: number/)
@@ -0,0 +1,49 @@
1
+ import { flushPromises, mount } from '@vue/test-utils'
2
+ import { describe, expect, it, vi } from 'vitest'
3
+ import { defineComponent, h, nextTick } from 'vue'
4
+ import AimdRecorder from '../components/AimdRecorder.vue'
5
+
6
+ vi.mock('@airalogy/aimd-editor/vue', () => ({
7
+ AimdEditor: defineComponent({
8
+ name: 'AimdEditorMock',
9
+ props: {
10
+ modelValue: {
11
+ type: String,
12
+ default: '',
13
+ },
14
+ },
15
+ emits: ['update:modelValue'],
16
+ setup(props, { emit }) {
17
+ return () => h('textarea', {
18
+ class: 'aimd-editor-mock',
19
+ value: props.modelValue,
20
+ onInput: (event: Event) => emit('update:modelValue', (event.target as HTMLTextAreaElement).value),
21
+ })
22
+ },
23
+ }),
24
+ }))
25
+
26
+ describe('AimdRecorder markdown assigner integration', () => {
27
+ it('shows an auto server assigner button on parsed AiralogyMarkdown fields', async () => {
28
+ const wrapper = mount(AimdRecorder, {
29
+ props: {
30
+ content: '图生成状态:{{var|graph_generation_note: AiralogyMarkdown = "", title = "图生成状态"}}',
31
+ locale: 'zh-CN',
32
+ modelValue: { var: {}, step: {}, check: {}, quiz: {} },
33
+ serverAssigners: {
34
+ graph_generation_note: {
35
+ mode: 'auto',
36
+ dependent_fields: ['site_csv_file'],
37
+ },
38
+ },
39
+ },
40
+ })
41
+
42
+ await flushPromises()
43
+ await nextTick()
44
+ await vi.dynamicImportSettled()
45
+ await nextTick()
46
+
47
+ expect(wrapper.find('.aimd-markdown-field__assigner-action .aimd-rec-assigner-field__button').exists()).toBe(true)
48
+ })
49
+ })
@@ -31,10 +31,13 @@ vi.mock('@airalogy/aimd-editor/vue', async () => {
31
31
  }
32
32
  })
33
33
 
34
- vi.mock('@airalogy/aimd-renderer', async () => {
34
+ vi.mock('@airalogy/aimd-renderer', async (importOriginal) => {
35
+ const actual = await importOriginal<typeof import('@airalogy/aimd-renderer')>()
35
36
  const { h } = await import('vue')
36
37
 
37
38
  return {
39
+ ...actual,
40
+ loadShikiHighlighter: vi.fn(() => new Promise(() => {})),
38
41
  renderToVue: async (content: string) => ({
39
42
  nodes: [h('div', { class: 'aimd-rendered-note' }, content)],
40
43
  fields: {},
@@ -147,6 +150,49 @@ describe('AimdStepField', () => {
147
150
  wrapper.unmount()
148
151
  })
149
152
 
153
+ it('keeps a single step note entry at the end of long body content', async () => {
154
+ const state = reactive(createEmptyStepRecordItem())
155
+ const originalScrollIntoView = Element.prototype.scrollIntoView
156
+ const scrollIntoView = vi.fn()
157
+ Object.defineProperty(Element.prototype, 'scrollIntoView', {
158
+ configurable: true,
159
+ value: scrollIntoView,
160
+ })
161
+ const wrapper = mount(AimdStepField, {
162
+ props: {
163
+ ...createBaseProps(),
164
+ state,
165
+ bodyNodes: ['Long protocol step body'],
166
+ },
167
+ attachTo: document.body,
168
+ })
169
+
170
+ expect(wrapper.find('.aimd-step-field__main .aimd-step-field__toggle--annotation').exists()).toBe(false)
171
+ expect(wrapper.find('.aimd-step-field__body-action').exists()).toBe(true)
172
+
173
+ await wrapper.find('.aimd-step-field__body-action').trigger('click')
174
+ await flushStepFieldAsync()
175
+
176
+ const children = Array.from(wrapper.element.children)
177
+ const detailsSlotIndex = children.indexOf(wrapper.find('.aimd-step-field__details-slot--annotation').element)
178
+ const bodyIndex = children.indexOf(wrapper.find('.aimd-step-field__body').element)
179
+ expect(wrapper.find('.aimd-step-field__details').exists()).toBe(true)
180
+ expect(detailsSlotIndex).toBeGreaterThan(-1)
181
+ expect(bodyIndex).toBeGreaterThan(-1)
182
+ expect(detailsSlotIndex).toBeGreaterThan(bodyIndex)
183
+ expect(scrollIntoView).toHaveBeenCalledWith({
184
+ block: 'nearest',
185
+ inline: 'nearest',
186
+ behavior: 'smooth',
187
+ })
188
+
189
+ wrapper.unmount()
190
+ Object.defineProperty(Element.prototype, 'scrollIntoView', {
191
+ configurable: true,
192
+ value: originalScrollIntoView,
193
+ })
194
+ })
195
+
150
196
  it('opens timer controls on demand in auto mode', async () => {
151
197
  const state = reactive(createEmptyStepRecordItem())
152
198
  const wrapper = mount(AimdStepField, {
@@ -13,6 +13,7 @@ describe('type-plugins', () => {
13
13
  const markdownPlugin = resolveAimdTypePlugin('AiralogyMarkdown', BUILT_IN_AIMD_TYPE_PLUGINS)
14
14
  expect(markdownPlugin?.type).toBe('AiralogyMarkdown')
15
15
  expect(markdownPlugin?.inputKind).toBe('textarea')
16
+ expect(markdownPlugin?.supportsInlineAssignerControl).toBe(true)
16
17
 
17
18
  const pythonCodePlugin = resolveAimdTypePlugin('PyStr', BUILT_IN_AIMD_TYPE_PLUGINS)
18
19
  expect(pythonCodePlugin?.type).toBe('PyStr')