@airalogy/aimd-recorder 1.20.0 → 1.22.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 +5 -0
- package/README.zh-CN.md +5 -0
- package/dist/{AimdCodeField-BQUuM-EF.js → AimdCodeField-BN_0UQMx.js} +34 -32
- package/dist/{AimdDnaSequenceField-Cp0cgBYl.js → AimdDnaSequenceField-Bhj28fP8.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-DTdcoNs1.js → AimdEditor.vue_vue_type_style_index_0_lang-D7c01UqN.js} +1040 -976
- package/dist/{AimdMarkdownField-D4AEz_mB.js → AimdMarkdownField-GS15pv4z.js} +4 -4
- package/dist/{AimdMarkdownNoteField-CSGaShKi.js → AimdMarkdownNoteField-H9WP8tR6.js} +15 -15
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-jL17V0L2.js → arc-B50G9-kH.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-CijadmFI.js → architectureDiagram-3BPJPVTR-D9mBEbpY.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-BPqvb85_.js → blockDiagram-GPEHLZMM-Cs4swgto.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-i4fqlMXu.js → c4Diagram-AAUBKEIU-C12HKS3r.js} +2 -2
- package/dist/{channel-DnnUQTdl.js → channel-D69VnjVz.js} +1 -1
- package/dist/{chunk-2J33WTMH-DKKEpdr1.js → chunk-2J33WTMH-oc-89G5c.js} +1 -1
- package/dist/{chunk-4BX2VUAB-WvuuiYYH.js → chunk-4BX2VUAB-BDJS9G3r.js} +1 -1
- package/dist/{chunk-55IACEB6-B_UkHTnd.js → chunk-55IACEB6-BPl3uHcA.js} +1 -1
- package/dist/{chunk-727SXJPM-CR6Pb04P.js → chunk-727SXJPM-pWe-vDGf.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-B68Ie417.js → chunk-AQP2D5EJ-D-R5sIr1.js} +3 -3
- package/dist/{chunk-FMBD7UC4-CeCGT6rb.js → chunk-FMBD7UC4-bo6Qyom1.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BYN-eC_q.js → chunk-ND2GUHAM-DQMvtYV7.js} +1 -1
- package/dist/{chunk-QZHKN3VN-BNSp120j.js → chunk-QZHKN3VN-DlCn3HON.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-Cgbn4w3f.js → classDiagram-4FO5ZUOK-DzUwWFwr.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-Cgbn4w3f.js → classDiagram-v2-Q7XG4LA2-DzUwWFwr.js} +2 -2
- package/dist/components.js +3757 -2910
- package/dist/composables.js +84 -80
- package/dist/{cose-bilkent-S5V4N54A-TfrsQ2c3.js → cose-bilkent-S5V4N54A-BXLMzfpO.js} +1 -1
- package/dist/{dagre-BM42HDAG-BAyvB_JI.js → dagre-BM42HDAG-DHnofIh9.js} +3 -3
- package/dist/{diagram-2AECGRRQ-Bijq8bHO.js → diagram-2AECGRRQ-BqTTVPsm.js} +2 -2
- package/dist/{diagram-5GNKFQAL-B3ZuTuxm.js → diagram-5GNKFQAL-D5p1UVbw.js} +3 -3
- package/dist/{diagram-KO2AKTUF-DrqLeGCI.js → diagram-KO2AKTUF-Uuoz9cFn.js} +2 -2
- package/dist/{diagram-LMA3HP47-CCSQH8O0.js → diagram-LMA3HP47-W001U31X.js} +2 -2
- package/dist/{diagram-OG6HWLK6-DM5cUEjW.js → diagram-OG6HWLK6-DL516LDr.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-DQhmDdAF.js → erDiagram-TEJ5UH35-CCxgMb67.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DrqiPSHI.js → flowDiagram-I6XJVG4X-nXGdmC0O.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-DpX_Y2vA.js → ganttDiagram-6RSMTGT7-Bi9Ro7_Z.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-3isOhIyZ.js → gitGraphDiagram-PVQCEYII-w1kNAy4E.js} +3 -3
- package/dist/{graph-C30SJlSk.js → graph-CpOkL_eZ.js} +1 -1
- package/dist/{index-Dtvv88SS.js → index-Dkrf2LJl.js} +51 -51
- package/dist/index.js +62 -58
- package/dist/{infoDiagram-5YYISTIA-Cr_MlPvz.js → infoDiagram-5YYISTIA-Bde_w9T1.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-DydyFn3h.js → ishikawaDiagram-YF4QCWOH-x5M1KR0l.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-V_5MmeOu.js → journeyDiagram-JHISSGLW-CIDQP8Zm.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-C_XXCuvp.js → kanban-definition-UN3LZRKU-CKgO7sG8.js} +2 -2
- package/dist/{layout-85j-z7Lr.js → layout-BZYprqYR.js} +2 -2
- package/dist/{linear-DMtodz-6.js → linear-ClSH2F_v.js} +1 -1
- package/dist/{mermaid.core-CkanUCyS.js → mermaid.core-CcRV6K2R.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-CyikmuF2.js → mindmap-definition-RKZ34NQL-s3h6uszV.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-CesqzEGg.js → pieDiagram-4H26LBE5-CgiazyWv.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BsPKPfNd.js → quadrantDiagram-W4KKPZXB-DCPVgHoW.js} +2 -2
- package/dist/record.js +19 -19
- package/dist/{requirementDiagram-4Y6WPE33-BwB1tQvi.js → requirementDiagram-4Y6WPE33-DE6F9oSB.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-CfSNbWMY.js → sankeyDiagram-5OEKKPKP-DZZoFFr-.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-DZZlUNys.js → sequenceDiagram-3UESZ5HK-DaYEOl60.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-DNJmz_op.js → stateDiagram-AJRCARHV-BmgpHJlH.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-DVfDNM6l.js → stateDiagram-v2-BHNVJYJU-D49CHQD6.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DEUCAg_N.js → timeline-definition-PNZ67QCA-DdVLoCkC.js} +2 -2
- package/dist/{useCodeBlockRendering-DF6zm7nf.js → useCodeBlockRendering-CCuoP52e.js} +1241 -1074
- package/dist/{vennDiagram-CIIHVFJN-DVDP__od.js → vennDiagram-CIIHVFJN-CCcMKcd7.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-sEtxBd33.js → wardleyDiagram-YWT4CUSO-R4UGgGWY.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DM8QeR5M.js → xychartDiagram-2RQKCTM6-DyFhCubk.js} +2 -2
- package/package.json +3 -3
- package/src/__tests__/record-search-render.test.ts +108 -0
- package/src/__tests__/recorder-assigner-control.test.ts +4 -1
- package/src/__tests__/var-field-render.test.ts +556 -43
- package/src/components/AimdCodeField.vue +11 -3
- package/src/components/AimdQuizRecorder.vue +3 -1
- package/src/components/AimdRecorder.vue +52 -1882
- package/src/components/AimdRecorderSearchToolbar.vue +258 -0
- package/src/components/AimdVarField.vue +589 -17
- package/src/components/AimdVarTableField.vue +12 -6
- package/src/components/index.ts +1 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +214 -7
- package/src/composables/index.ts +6 -0
- package/src/composables/useFieldRendering.ts +28 -0
- package/src/composables/useRecordSearch.ts +299 -0
- package/src/composables/useVarHelpers.ts +285 -14
- package/src/locales.ts +96 -0
- package/src/styles/recorder-surface.css +2374 -0
- package/src/styles/recorder.css +1 -0
- package/src/types.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-
|
|
1
|
+
import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-CcRV6K2R.js";
|
|
2
2
|
const kt = (t, n) => Gt(t, "a", -n), _t = 1e-10;
|
|
3
3
|
function st(t, n) {
|
|
4
4
|
const s = ae(t), e = s.filter((c) => re(c, t));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-
|
|
2
|
-
import { p as Bt } from "./chunk-4BX2VUAB-
|
|
1
|
+
import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-CcRV6K2R.js";
|
|
2
|
+
import { p as Bt } from "./chunk-4BX2VUAB-BDJS9G3r.js";
|
|
3
3
|
import { p as Rt } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
4
4
|
var G = /* @__PURE__ */ u((o, r) => {
|
|
5
5
|
const e = o <= 1 ? o * 100 : o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-
|
|
1
|
+
import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-CcRV6K2R.js";
|
|
2
2
|
import { i as _i } from "./init-DjUOC4st.js";
|
|
3
3
|
import { o as ki } from "./ordinal-B6-f3MAq.js";
|
|
4
|
-
import { l as zt } from "./linear-
|
|
4
|
+
import { l as zt } from "./linear-ClSH2F_v.js";
|
|
5
5
|
function Ri(e, t, i) {
|
|
6
6
|
e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
|
|
7
7
|
for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airalogy/aimd-recorder",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.22.0",
|
|
5
5
|
"description": "AIMD (Airalogy Markdown) recorder Vue components and UI",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react": "^19.2.4",
|
|
64
64
|
"react-dom": "^19.2.4",
|
|
65
65
|
"seqviz": "^3.10.18",
|
|
66
|
-
"@airalogy/aimd-core": "^2.
|
|
67
|
-
"@airalogy/aimd-renderer": "^2.
|
|
66
|
+
"@airalogy/aimd-core": "^2.13.0",
|
|
67
|
+
"@airalogy/aimd-renderer": "^2.10.0",
|
|
68
68
|
"@airalogy/aimd-editor": "^1.10.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs'
|
|
2
|
+
import { dirname, resolve } from 'node:path'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import { flushPromises, mount } from '@vue/test-utils'
|
|
5
|
+
import { describe, expect, it, vi } from 'vitest'
|
|
6
|
+
|
|
7
|
+
import AimdRecorder from '../components/AimdRecorder.vue'
|
|
8
|
+
|
|
9
|
+
vi.mock('../components/AimdCodeField.vue', () => ({
|
|
10
|
+
__esModule: true,
|
|
11
|
+
default: {
|
|
12
|
+
name: 'AimdCodeField',
|
|
13
|
+
props: ['modelValue', 'language', 'disabled', 'compact'],
|
|
14
|
+
emits: ['update:modelValue', 'blur'],
|
|
15
|
+
template: '<textarea class="aimd-code-field-stub" :value="modelValue" :disabled="disabled" @input="$emit(\'update:modelValue\', $event.target.value)" @blur="$emit(\'blur\')" />',
|
|
16
|
+
},
|
|
17
|
+
}))
|
|
18
|
+
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
20
|
+
const __dirname = dirname(__filename)
|
|
21
|
+
const recorderSource = readFileSync(resolve(__dirname, '../components/AimdRecorder.vue'), 'utf8')
|
|
22
|
+
const searchToolbarSource = readFileSync(resolve(__dirname, '../components/AimdRecorderSearchToolbar.vue'), 'utf8')
|
|
23
|
+
const recordSearchSource = readFileSync(resolve(__dirname, '../composables/useRecordSearch.ts'), 'utf8')
|
|
24
|
+
const recorderSurfaceStyles = readFileSync(resolve(__dirname, '../styles/recorder-surface.css'), 'utf8')
|
|
25
|
+
|
|
26
|
+
describe('AimdRecorder record search', () => {
|
|
27
|
+
it('keeps search state and toolbar rendering outside the main recorder component', () => {
|
|
28
|
+
expect(recorderSource).toContain('useRecordSearch')
|
|
29
|
+
expect(recorderSource).toContain('<AimdRecorderSearchToolbar')
|
|
30
|
+
expect(recordSearchSource).toContain('searchAimdRecordFields')
|
|
31
|
+
expect(recordSearchSource).toContain('collectAimdRecordFieldRefs')
|
|
32
|
+
expect(recordSearchSource).toContain('setSelectionRange')
|
|
33
|
+
expect(searchToolbarSource).toContain('data-rec-search-toggle')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('keeps the sticky search toolbar flush with recorder gutters', () => {
|
|
37
|
+
expect(recorderSurfaceStyles).toMatch(/\.aimd-protocol-recorder \{[\s\S]*?--aimd-recorder-gutter-x: 0px;[\s\S]*?padding: 0 var\(--aimd-recorder-gutter-x\) var\(--aimd-recorder-gutter-bottom\);/)
|
|
38
|
+
expect(searchToolbarSource).toContain('position: sticky;')
|
|
39
|
+
expect(searchToolbarSource).toContain('--aimd-recorder-search-sticky-top')
|
|
40
|
+
expect(searchToolbarSource).toMatch(/\.aimd-protocol-recorder__search-shell \{[\s\S]*?margin-inline: calc\(-1 \* var\(--aimd-recorder-gutter-x\)\);[\s\S]*?background: transparent;[\s\S]*?pointer-events: none;/)
|
|
41
|
+
expect(searchToolbarSource).toMatch(/\.aimd-protocol-recorder__search-shell--expanded \{[\s\S]*?padding-inline: var\(--aimd-recorder-gutter-x\);[\s\S]*?background: #f8fbff;[\s\S]*?pointer-events: auto;/)
|
|
42
|
+
expect(searchToolbarSource).toMatch(/\.aimd-protocol-recorder__search \{[\s\S]*?border: 0;[\s\S]*?box-shadow: none;/)
|
|
43
|
+
expect(recorderSurfaceStyles).toContain('aimd-field--record-search-pulse')
|
|
44
|
+
expect(recorderSurfaceStyles).toContain('@keyframes aimd-rec-record-search-pulse')
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('searches the current record and highlights matching fields in AimdRecorder', async () => {
|
|
48
|
+
const wrapper = mount(AimdRecorder, {
|
|
49
|
+
props: {
|
|
50
|
+
content: 'Reaction: {{var|reaction_note: str}} Other: {{var|other_note: str}}',
|
|
51
|
+
locale: 'en-US',
|
|
52
|
+
modelValue: {
|
|
53
|
+
var: {
|
|
54
|
+
reaction_note: 'heated sample',
|
|
55
|
+
other_note: 'cold sample',
|
|
56
|
+
},
|
|
57
|
+
step: {},
|
|
58
|
+
check: {},
|
|
59
|
+
quiz: {},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
await flushPromises()
|
|
65
|
+
await wrapper.vm.$nextTick()
|
|
66
|
+
await vi.dynamicImportSettled()
|
|
67
|
+
await wrapper.vm.$nextTick()
|
|
68
|
+
|
|
69
|
+
expect(wrapper.find('input[type="search"]').exists()).toBe(false)
|
|
70
|
+
expect(wrapper.find('.aimd-protocol-recorder__search-shell').exists()).toBe(true)
|
|
71
|
+
|
|
72
|
+
const toggle = wrapper.find('[data-rec-search-toggle]')
|
|
73
|
+
expect(toggle.exists()).toBe(true)
|
|
74
|
+
await toggle.trigger('click')
|
|
75
|
+
await wrapper.vm.$nextTick()
|
|
76
|
+
|
|
77
|
+
const input = wrapper.find('input[type="search"]')
|
|
78
|
+
expect(input.exists()).toBe(true)
|
|
79
|
+
|
|
80
|
+
await input.setValue('heated')
|
|
81
|
+
await flushPromises()
|
|
82
|
+
await wrapper.vm.$nextTick()
|
|
83
|
+
|
|
84
|
+
expect(wrapper.text()).toContain('1 / 1')
|
|
85
|
+
expect(wrapper.find('.aimd-field--record-search-match').exists()).toBe(true)
|
|
86
|
+
expect(wrapper.find('.aimd-field--record-search-active').exists()).toBe(true)
|
|
87
|
+
|
|
88
|
+
await input.trigger('keydown.enter')
|
|
89
|
+
await flushPromises()
|
|
90
|
+
await wrapper.vm.$nextTick()
|
|
91
|
+
await flushPromises()
|
|
92
|
+
await wrapper.vm.$nextTick()
|
|
93
|
+
|
|
94
|
+
const matchedControl = wrapper.find('[data-rec-focus-key="var:reaction_note"]')
|
|
95
|
+
expect(matchedControl.exists()).toBe(true)
|
|
96
|
+
expect((matchedControl.element as HTMLInputElement | HTMLTextAreaElement).selectionStart).toBe(0)
|
|
97
|
+
expect((matchedControl.element as HTMLInputElement | HTMLTextAreaElement).selectionEnd).toBe('heated'.length)
|
|
98
|
+
expect(wrapper.find('.aimd-field--record-search-pulse').exists()).toBe(true)
|
|
99
|
+
|
|
100
|
+
const fieldSelect = wrapper.find('.aimd-protocol-recorder__search-field')
|
|
101
|
+
await fieldSelect.setValue('var:other_note')
|
|
102
|
+
await flushPromises()
|
|
103
|
+
await wrapper.vm.$nextTick()
|
|
104
|
+
|
|
105
|
+
expect(wrapper.text()).toContain('No matches')
|
|
106
|
+
expect(wrapper.find('.aimd-field--record-search-match').exists()).toBe(false)
|
|
107
|
+
})
|
|
108
|
+
})
|
|
@@ -283,7 +283,10 @@ describe('AimdRecorder assigner controls', () => {
|
|
|
283
283
|
const latestRecord = updates[updates.length - 1]?.[0] as { var?: Record<string, unknown> } | undefined
|
|
284
284
|
expect(latestRecord?.var?.image_ids).toEqual(['airalogy.id.file.image-a.png', 'airalogy.id.file.image-b.png'])
|
|
285
285
|
expect(wrapper.find('.aimd-rec-assigner-field__button').exists()).toBe(true)
|
|
286
|
-
expect(
|
|
286
|
+
expect(wrapper.findAll<HTMLInputElement>('.aimd-rec-scalar-list__input').map(input => input.element.value)).toEqual([
|
|
287
|
+
'airalogy.id.file.image-a.png',
|
|
288
|
+
'airalogy.id.file.image-b.png',
|
|
289
|
+
])
|
|
287
290
|
})
|
|
288
291
|
|
|
289
292
|
it('runs auto host assigners when dependent fields become available', async () => {
|