@airalogy/aimd-recorder 1.19.1 → 1.20.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 +2 -0
- package/README.zh-CN.md +2 -0
- package/dist/{AimdDnaSequenceField-TBKunqU_.js → AimdDnaSequenceField-Cp0cgBYl.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js → AimdEditor.vue_vue_type_style_index_0_lang-DTdcoNs1.js} +3451 -3352
- package/dist/{AimdMarkdownField-DmNX2g4j.js → AimdMarkdownField-D4AEz_mB.js} +19 -18
- package/dist/{AimdMarkdownNoteField-B5ruzmwS.js → AimdMarkdownNoteField-CSGaShKi.js} +6 -5
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-B-vsgEXF.js → arc-jL17V0L2.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-BwPNOtNH.js → architectureDiagram-3BPJPVTR-CijadmFI.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-CMUI4kKc.js → blockDiagram-GPEHLZMM-BPqvb85_.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-Cpmfsy_s.js → c4Diagram-AAUBKEIU-i4fqlMXu.js} +2 -2
- package/dist/{channel-DlMAXHQK.js → channel-DnnUQTdl.js} +1 -1
- package/dist/{chunk-2J33WTMH-DP9BS2ux.js → chunk-2J33WTMH-DKKEpdr1.js} +1 -1
- package/dist/{chunk-4BX2VUAB-ncsOeLMb.js → chunk-4BX2VUAB-WvuuiYYH.js} +1 -1
- package/dist/{chunk-55IACEB6-C7wHk4B7.js → chunk-55IACEB6-B_UkHTnd.js} +1 -1
- package/dist/{chunk-727SXJPM-Caa5aVUO.js → chunk-727SXJPM-CR6Pb04P.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-CL8egKqD.js → chunk-AQP2D5EJ-B68Ie417.js} +3 -3
- package/dist/{chunk-FMBD7UC4-heVR6BSA.js → chunk-FMBD7UC4-CeCGT6rb.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BYH-wC2J.js → chunk-ND2GUHAM-BYN-eC_q.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Bx2K7vkq.js → chunk-QZHKN3VN-BNSp120j.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-BLLfLYy0.js → classDiagram-4FO5ZUOK-Cgbn4w3f.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-BLLfLYy0.js → classDiagram-v2-Q7XG4LA2-Cgbn4w3f.js} +2 -2
- package/dist/components.js +92 -91
- package/dist/composables.js +22 -22
- package/dist/{cose-bilkent-S5V4N54A-E1YmM_xr.js → cose-bilkent-S5V4N54A-TfrsQ2c3.js} +1 -1
- package/dist/{dagre-BM42HDAG-BsXpQirH.js → dagre-BM42HDAG-BAyvB_JI.js} +3 -3
- package/dist/{diagram-2AECGRRQ-CamqbWlY.js → diagram-2AECGRRQ-Bijq8bHO.js} +2 -2
- package/dist/{diagram-5GNKFQAL-DZyRFcOC.js → diagram-5GNKFQAL-B3ZuTuxm.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CmkGcy7R.js → diagram-KO2AKTUF-DrqLeGCI.js} +2 -2
- package/dist/{diagram-LMA3HP47-IdDwQPZ-.js → diagram-LMA3HP47-CCSQH8O0.js} +2 -2
- package/dist/{diagram-OG6HWLK6-t0LBcUIU.js → diagram-OG6HWLK6-DM5cUEjW.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-DJBY2iZG.js → erDiagram-TEJ5UH35-DQhmDdAF.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DE4MzPPk.js → flowDiagram-I6XJVG4X-DrqiPSHI.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-CmAc35Yw.js → ganttDiagram-6RSMTGT7-DpX_Y2vA.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-DDQZ5flw.js → gitGraphDiagram-PVQCEYII-3isOhIyZ.js} +3 -3
- package/dist/{graph-BsJ8-1Pq.js → graph-C30SJlSk.js} +1 -1
- package/dist/index-Dtvv88SS.js +1308 -0
- package/dist/index.js +19 -19
- package/dist/{infoDiagram-5YYISTIA-DSZjFR5g.js → infoDiagram-5YYISTIA-Cr_MlPvz.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-DCO9dx2L.js → ishikawaDiagram-YF4QCWOH-DydyFn3h.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-b-PpuBqg.js → journeyDiagram-JHISSGLW-V_5MmeOu.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-BjclDuJZ.js → kanban-definition-UN3LZRKU-C_XXCuvp.js} +2 -2
- package/dist/{layout-D4wqKu72.js → layout-85j-z7Lr.js} +2 -2
- package/dist/{linear-Voc3BJib.js → linear-DMtodz-6.js} +1 -1
- package/dist/{mermaid.core-Dt_VbeGP.js → mermaid.core-CkanUCyS.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-B3vrXRVY.js → mindmap-definition-RKZ34NQL-CyikmuF2.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-DFpWxSxk.js → pieDiagram-4H26LBE5-CesqzEGg.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BYHcrGoB.js → quadrantDiagram-W4KKPZXB-BsPKPfNd.js} +2 -2
- package/dist/record.js +90 -1196
- package/dist/{requirementDiagram-4Y6WPE33-C-FgWrRz.js → requirementDiagram-4Y6WPE33-BwB1tQvi.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-IwN0Evji.js → sankeyDiagram-5OEKKPKP-CfSNbWMY.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-_OnqhBO2.js → sequenceDiagram-3UESZ5HK-DZZlUNys.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-BRLv0Zcw.js → stateDiagram-AJRCARHV-DNJmz_op.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-BofX0AdS.js → stateDiagram-v2-BHNVJYJU-DVfDNM6l.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-C-DpPLpw.js → timeline-definition-PNZ67QCA-DEUCAg_N.js} +2 -2
- package/dist/{useCodeBlockRendering-DoTZaJTW.js → useCodeBlockRendering-DF6zm7nf.js} +475 -526
- package/dist/{vennDiagram-CIIHVFJN-zTHQR9Oq.js → vennDiagram-CIIHVFJN-DVDP__od.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-au5koizO.js → wardleyDiagram-YWT4CUSO-sEtxBd33.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-BNf12P8z.js → xychartDiagram-2RQKCTM6-DM8QeR5M.js} +2 -2
- package/package.json +6 -6
- package/src/__tests__/markdown-field.test.ts +1 -0
- package/src/__tests__/markdown-note-field.test.ts +1 -0
- package/src/__tests__/recorder-editor.test.ts +3 -1
- package/src/__tests__/var-field-render.test.ts +88 -20
- package/src/components/AimdMarkdownField.vue +1 -19
- package/src/components/AimdMarkdownNoteField.vue +1 -2
- package/src/components/AimdRecorder.vue +55 -16
- package/src/components/AimdRecorderEditor.vue +3 -1
- package/src/composables/__tests__/useVarHelpers.test.ts +41 -0
- package/src/index.ts +1 -1
- package/src/styles/{aimd.css → recorder.css} +6 -782
|
@@ -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-CkanUCyS.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-CkanUCyS.js";
|
|
2
|
+
import { p as Bt } from "./chunk-4BX2VUAB-WvuuiYYH.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-CkanUCyS.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-DMtodz-6.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.20.0",
|
|
5
5
|
"description": "AIMD (Airalogy Markdown) recorder Vue components and UI",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"import": "./src/record/index.ts"
|
|
39
39
|
},
|
|
40
40
|
"./styles": {
|
|
41
|
-
"import": "./src/styles/
|
|
42
|
-
"default": "./src/styles/
|
|
41
|
+
"import": "./src/styles/recorder.css",
|
|
42
|
+
"default": "./src/styles/recorder.css"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"main": "./src/index.ts",
|
|
@@ -63,9 +63,9 @@
|
|
|
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.
|
|
68
|
-
"@airalogy/aimd-editor": "^1.
|
|
66
|
+
"@airalogy/aimd-core": "^2.12.0",
|
|
67
|
+
"@airalogy/aimd-renderer": "^2.9.1",
|
|
68
|
+
"@airalogy/aimd-editor": "^1.10.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^24.3.0",
|
|
@@ -154,6 +154,7 @@ describe('AimdMarkdownField', () => {
|
|
|
154
154
|
elementRenderers: { pre: expect.any(Function) },
|
|
155
155
|
}))
|
|
156
156
|
expect(wrapper.find('.aimd-markdown-field__preview').exists()).toBe(true)
|
|
157
|
+
expect(wrapper.find('.aimd-markdown-field__preview').classes()).toContain('aimd-renderer')
|
|
157
158
|
expect(wrapper.find('.aimd-rendered-markdown').text()).toContain('flowchart TD')
|
|
158
159
|
expect(wrapper.find('.aimd-editor-mock').exists()).toBe(false)
|
|
159
160
|
})
|
|
@@ -87,6 +87,7 @@ describe('AimdMarkdownNoteField', () => {
|
|
|
87
87
|
elementRenderers: { pre: expect.any(Function) },
|
|
88
88
|
}))
|
|
89
89
|
expect(wrapper.find('.aimd-markdown-note-field__preview').exists()).toBe(true)
|
|
90
|
+
expect(wrapper.find('.aimd-markdown-note-field__preview').classes()).toContain('aimd-renderer')
|
|
90
91
|
expect(wrapper.find('.aimd-rendered-note').text()).toContain('rendered:**keep cold**')
|
|
91
92
|
expect(wrapper.find('.aimd-editor-mock').exists()).toBe(false)
|
|
92
93
|
})
|
|
@@ -71,7 +71,9 @@ describe('AimdRecorderEditor', () => {
|
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
it('lets users resize the source and recorder columns or collapse the source panel', () => {
|
|
74
|
-
expect(source).toMatch(/
|
|
74
|
+
expect(source).toMatch(/initialSourceCollapsed\?: boolean/)
|
|
75
|
+
expect(source).toMatch(/initialSourceCollapsed: false/)
|
|
76
|
+
expect(source).toMatch(/const sourcePanelCollapsed = ref\(props\.initialSourceCollapsed\)/)
|
|
75
77
|
expect(source).toMatch(/const sourcePanelWidthPercent = ref\(50\)/)
|
|
76
78
|
expect(source).toMatch(/const isPanelResizing = ref\(false\)/)
|
|
77
79
|
expect(source).toMatch(/const workbenchMainStyle = computed/)
|
|
@@ -5,6 +5,7 @@ import { h } from 'vue'
|
|
|
5
5
|
import { flushPromises, mount } from '@vue/test-utils'
|
|
6
6
|
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
7
7
|
import type { AimdVarNode, AimdVarTableNode } from '@airalogy/aimd-core/types'
|
|
8
|
+
import { getAimdBuiltInTypeEnumValues } from '@airalogy/aimd-core/utils'
|
|
8
9
|
|
|
9
10
|
import AimdRecorder from '../components/AimdRecorder.vue'
|
|
10
11
|
import AimdVarField from '../components/AimdVarField.vue'
|
|
@@ -15,10 +16,13 @@ const __filename = fileURLToPath(import.meta.url)
|
|
|
15
16
|
const __dirname = dirname(__filename)
|
|
16
17
|
const source = readFileSync(resolve(__dirname, '../components/AimdVarField.vue'), 'utf8')
|
|
17
18
|
const codeFieldSource = readFileSync(resolve(__dirname, '../components/AimdCodeField.vue'), 'utf8')
|
|
19
|
+
const markdownFieldSource = readFileSync(resolve(__dirname, '../components/AimdMarkdownField.vue'), 'utf8')
|
|
18
20
|
const varTableSource = readFileSync(resolve(__dirname, '../components/AimdVarTableField.vue'), 'utf8')
|
|
19
21
|
const recorderSource = readFileSync(resolve(__dirname, '../components/AimdRecorder.vue'), 'utf8')
|
|
22
|
+
const markdownNoteSource = readFileSync(resolve(__dirname, '../components/AimdMarkdownNoteField.vue'), 'utf8')
|
|
20
23
|
const varHelpersSource = readFileSync(resolve(__dirname, '../composables/useVarHelpers.ts'), 'utf8')
|
|
21
|
-
const
|
|
24
|
+
const recorderStyles = readFileSync(resolve(__dirname, '../styles/recorder.css'), 'utf8')
|
|
25
|
+
const rendererStyles = readFileSync(resolve(__dirname, '../../../aimd-renderer/src/styles/renderer.css'), 'utf8')
|
|
22
26
|
|
|
23
27
|
describe('AimdVarField render behavior', () => {
|
|
24
28
|
afterEach(() => {
|
|
@@ -55,32 +59,47 @@ describe('AimdVarField render behavior', () => {
|
|
|
55
59
|
expect(codeFieldSource).not.toContain('min-height: 240px;')
|
|
56
60
|
})
|
|
57
61
|
|
|
62
|
+
it('layers recorder styles on top of renderer styles', () => {
|
|
63
|
+
expect(recorderStyles).toContain('@import "@airalogy/aimd-renderer/styles";')
|
|
64
|
+
expect(recorderSource).toContain('class="aimd-protocol-recorder__content aimd-renderer"')
|
|
65
|
+
expect(markdownFieldSource).toContain('class="aimd-markdown-field__preview aimd-renderer"')
|
|
66
|
+
expect(markdownNoteSource).toContain('class="aimd-markdown-note-field__preview aimd-renderer"')
|
|
67
|
+
expect(recorderStyles).toContain('.aimd-field--editable')
|
|
68
|
+
expect(recorderStyles).toContain('.aimd-field--no-style')
|
|
69
|
+
expect(recorderStyles).toContain('.aimd-field-wrapper--inline')
|
|
70
|
+
expect(recorderStyles).not.toContain('.aimd-figure {')
|
|
71
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(h[1-3]\)/)
|
|
72
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(p\)/)
|
|
73
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(ul\),\n\.aimd-protocol-recorder__content :deep\(ol\)/)
|
|
74
|
+
expect(markdownFieldSource).not.toMatch(/\.aimd-markdown-field__preview :deep\(ul\),\n\.aimd-markdown-field__preview :deep\(ol\)/)
|
|
75
|
+
})
|
|
76
|
+
|
|
58
77
|
it('keeps table metadata popovers from being clipped by table bounds', () => {
|
|
59
|
-
expect(
|
|
60
|
-
expect(
|
|
61
|
-
expect(
|
|
78
|
+
expect(rendererStyles).toMatch(/\.aimd-field--var-table \.aimd-field__table-preview \{[\s\S]*?overflow: visible;/)
|
|
79
|
+
expect(rendererStyles).toMatch(/\.aimd-field--var-table \.aimd-field__table-preview th \{[\s\S]*?overflow: visible;/)
|
|
80
|
+
expect(rendererStyles).toContain('.aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:hover)')
|
|
62
81
|
})
|
|
63
82
|
|
|
64
83
|
it('keeps figure images and captions visually attached without card elevation', () => {
|
|
65
|
-
expect(
|
|
66
|
-
expect(
|
|
67
|
-
expect(
|
|
68
|
-
expect(
|
|
69
|
-
expect(
|
|
84
|
+
expect(rendererStyles).toMatch(/\.aimd-figure \{[\s\S]*?width: fit-content;/)
|
|
85
|
+
expect(rendererStyles).toMatch(/\.aimd-figure \{[\s\S]*?overflow: hidden;/)
|
|
86
|
+
expect(rendererStyles).not.toContain('box-shadow: 0 10px 28px')
|
|
87
|
+
expect(rendererStyles).toMatch(/\.aimd-figure__caption \{[\s\S]*?border-top: 1px solid #d8e2ef;/)
|
|
88
|
+
expect(rendererStyles).toMatch(/\.aimd-figure__legend \{[\s\S]*?margin: 4px 0 0;/)
|
|
70
89
|
})
|
|
71
90
|
|
|
72
91
|
it('uses selectable citation popovers instead of pseudo-element tooltips', () => {
|
|
73
|
-
expect(
|
|
74
|
-
expect(
|
|
75
|
-
expect(
|
|
76
|
-
expect(
|
|
77
|
-
expect(
|
|
78
|
-
expect(
|
|
92
|
+
expect(rendererStyles).toContain('.aimd-cite__popover')
|
|
93
|
+
expect(rendererStyles).not.toContain('.aimd-cite__ref::after')
|
|
94
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover \{[\s\S]*?pointer-events: none;/)
|
|
95
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover \{[\s\S]*?user-select: text;/)
|
|
96
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover::before \{[\s\S]*?height: 10px;/)
|
|
97
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__ref:hover \.aimd-cite__popover,[\s\S]*?pointer-events: auto;/)
|
|
79
98
|
})
|
|
80
99
|
|
|
81
100
|
it('marks internal references as focusable route-safe targets', () => {
|
|
82
|
-
expect(
|
|
83
|
-
expect(
|
|
101
|
+
expect(rendererStyles).toMatch(/\.aimd-ref\[data-aimd-ref-target\] \{[\s\S]*?cursor: pointer;/)
|
|
102
|
+
expect(rendererStyles).toMatch(/\.aimd-ref\[data-aimd-ref-target\]:focus-visible \{[\s\S]*?outline: 2px solid rgba\(25, 118, 210, 0\.36\);/)
|
|
84
103
|
})
|
|
85
104
|
|
|
86
105
|
it('renders editable table cell values without inherited italic preview styling', () => {
|
|
@@ -110,6 +129,14 @@ describe('AimdVarField render behavior', () => {
|
|
|
110
129
|
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--has-assigner-control\) \{[\s\S]*?overflow: hidden;/)
|
|
111
130
|
})
|
|
112
131
|
|
|
132
|
+
it('lets stacked var fields widen before wrapping long metadata keys', () => {
|
|
133
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked\) \{[\s\S]*?width: max-content;/)
|
|
134
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked \.aimd-field--no-style\.aimd-field__label\) \{[\s\S]*?flex-wrap: nowrap;/)
|
|
135
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked \.aimd-field__scope\) \{[\s\S]*?flex: 0 0 auto;[\s\S]*?white-space: nowrap;/)
|
|
136
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked \.aimd-field__name\) \{[\s\S]*?flex: 0 0 auto;[\s\S]*?min-width: max-content;/)
|
|
137
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked \.aimd-field__key\) \{[\s\S]*?overflow: visible;[\s\S]*?white-space: nowrap;/)
|
|
138
|
+
})
|
|
139
|
+
|
|
113
140
|
it('normalizes stacked var value typography across native control types', () => {
|
|
114
141
|
expect(recorderSource).toContain('--rec-body-font-size: 14px;')
|
|
115
142
|
expect(recorderSource).toContain('--rec-var-value-font-size: var(--rec-body-font-size);')
|
|
@@ -136,6 +163,15 @@ describe('AimdVarField render behavior', () => {
|
|
|
136
163
|
expect(recorderSource).not.toContain('width: min(100%, 1040px);')
|
|
137
164
|
})
|
|
138
165
|
|
|
166
|
+
it('keeps step body content inside the step card width', () => {
|
|
167
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body\) \{[\s\S]*?width: 100%;[\s\S]*?max-width: 100%;[\s\S]*?overflow-wrap: anywhere;/)
|
|
168
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-step-body\) \{[\s\S]*?width: 100%;[\s\S]*?min-width: 0;[\s\S]*?max-width: 100%;/)
|
|
169
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-step-body > \*\) \{[\s\S]*?min-width: 0;[\s\S]*?max-width: 100%;[\s\S]*?overflow-wrap: anywhere;/)
|
|
170
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-rec-inline--var-markdown\),\n\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-field--var-table\) \{[\s\S]*?width: 100%;[\s\S]*?max-width: 100%;/)
|
|
171
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-field--var-table\) \{[\s\S]*?overflow-x: auto;/)
|
|
172
|
+
expect(recorderSource).not.toContain('line-height: 1.72;')
|
|
173
|
+
})
|
|
174
|
+
|
|
139
175
|
it('renders file-like vars with a native file picker control', async () => {
|
|
140
176
|
const node: AimdVarNode = {
|
|
141
177
|
type: 'aimd',
|
|
@@ -408,9 +444,9 @@ describe('AimdVarField render behavior', () => {
|
|
|
408
444
|
})
|
|
409
445
|
|
|
410
446
|
it('styles metadata examples as distinct chips', () => {
|
|
411
|
-
expect(
|
|
412
|
-
expect(
|
|
413
|
-
expect(
|
|
447
|
+
expect(rendererStyles).toContain('.aimd-field__metadata-examples')
|
|
448
|
+
expect(rendererStyles).toContain('.aimd-field__metadata-example')
|
|
449
|
+
expect(rendererStyles).toMatch(/\.aimd-field__metadata-example \{[\s\S]*?border: 1px solid rgba\(248, 250, 252, 0\.18\);/)
|
|
414
450
|
})
|
|
415
451
|
|
|
416
452
|
it('renders AIMD var metadata and uses examples as placeholders', () => {
|
|
@@ -560,6 +596,38 @@ describe('AimdVarField render behavior', () => {
|
|
|
560
596
|
expect(latest?.var?.review_type).toBe('quick')
|
|
561
597
|
})
|
|
562
598
|
|
|
599
|
+
it('renders official Airalogy built-in enum types as select fields in AimdRecorder', async () => {
|
|
600
|
+
const enumValues = getAimdBuiltInTypeEnumValues('BloodType | None')
|
|
601
|
+
expect(enumValues.length).toBeGreaterThan(0)
|
|
602
|
+
|
|
603
|
+
const wrapper = mount(AimdRecorder, {
|
|
604
|
+
props: {
|
|
605
|
+
content: 'Blood type: {{var|blood_type: BloodType | None, title = "Blood type"}}',
|
|
606
|
+
locale: 'en-US',
|
|
607
|
+
modelValue: { var: {}, step: {}, check: {}, quiz: {} },
|
|
608
|
+
},
|
|
609
|
+
})
|
|
610
|
+
|
|
611
|
+
await flushPromises()
|
|
612
|
+
await wrapper.vm.$nextTick()
|
|
613
|
+
await vi.dynamicImportSettled()
|
|
614
|
+
await wrapper.vm.$nextTick()
|
|
615
|
+
|
|
616
|
+
const select = wrapper.find('select[data-rec-focus-key="var:blood_type"]')
|
|
617
|
+
expect(select.exists()).toBe(true)
|
|
618
|
+
expect(select.findAll('option').map(option => option.text())).toEqual([
|
|
619
|
+
'',
|
|
620
|
+
...enumValues.map(value => String(value)),
|
|
621
|
+
])
|
|
622
|
+
|
|
623
|
+
await select.setValue('0')
|
|
624
|
+
await flushPromises()
|
|
625
|
+
|
|
626
|
+
const updates = wrapper.emitted('update:modelValue') ?? []
|
|
627
|
+
const latest = updates[updates.length - 1]?.[0] as { var?: Record<string, unknown> } | undefined
|
|
628
|
+
expect(latest?.var?.blood_type).toBe(enumValues[0])
|
|
629
|
+
})
|
|
630
|
+
|
|
563
631
|
it('renders AIMD var_table and column metadata', () => {
|
|
564
632
|
vi.stubGlobal('ResizeObserver', class {
|
|
565
633
|
observe() {}
|
|
@@ -327,7 +327,7 @@ watch(
|
|
|
327
327
|
v-else-if="previewRenderFailed"
|
|
328
328
|
class="aimd-markdown-field__preview-fallback"
|
|
329
329
|
>{{ draftValue }}</pre>
|
|
330
|
-
<div v-else class="aimd-markdown-field__preview">
|
|
330
|
+
<div v-else class="aimd-markdown-field__preview aimd-renderer">
|
|
331
331
|
<PreviewOutlet :nodes="previewNodes" />
|
|
332
332
|
</div>
|
|
333
333
|
</div>
|
|
@@ -527,24 +527,6 @@ watch(
|
|
|
527
527
|
height: auto;
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
.aimd-markdown-field__preview :deep(ul),
|
|
531
|
-
.aimd-markdown-field__preview :deep(ol) {
|
|
532
|
-
margin: 0.45em 0 0.75em;
|
|
533
|
-
padding-left: 1.6em;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
.aimd-markdown-field__preview :deep(ul) {
|
|
537
|
-
list-style: disc outside;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
.aimd-markdown-field__preview :deep(ol) {
|
|
541
|
-
list-style: decimal outside;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
.aimd-markdown-field__preview :deep(li + li) {
|
|
545
|
-
margin-top: 0.25em;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
530
|
.aimd-markdown-field__preview :deep(blockquote) {
|
|
549
531
|
margin: 0.8em 0;
|
|
550
532
|
padding: 0.25em 0 0.25em 0.9em;
|
|
@@ -361,7 +361,7 @@ onBeforeUnmount(() => {
|
|
|
361
361
|
</span>
|
|
362
362
|
</div>
|
|
363
363
|
<div
|
|
364
|
-
class="aimd-markdown-note-field__preview"
|
|
364
|
+
class="aimd-markdown-note-field__preview aimd-renderer"
|
|
365
365
|
:class="{ 'aimd-markdown-note-field__preview--interactive': !disabled }"
|
|
366
366
|
:tabindex="disabled ? undefined : 0"
|
|
367
367
|
:role="disabled ? undefined : 'button'"
|
|
@@ -534,7 +534,6 @@ onBeforeUnmount(() => {
|
|
|
534
534
|
min-width: 0;
|
|
535
535
|
padding: 6px 14px 14px;
|
|
536
536
|
color: #334155;
|
|
537
|
-
line-height: 1.65;
|
|
538
537
|
}
|
|
539
538
|
|
|
540
539
|
.aimd-markdown-note-field__preview--interactive {
|
|
@@ -1740,7 +1740,7 @@ defineExpose({
|
|
|
1740
1740
|
</span>
|
|
1741
1741
|
</div>
|
|
1742
1742
|
|
|
1743
|
-
<div v-if="inlineNodes.length" ref="contentRoot" class="aimd-protocol-recorder__content">
|
|
1743
|
+
<div v-if="inlineNodes.length" ref="contentRoot" class="aimd-protocol-recorder__content aimd-renderer">
|
|
1744
1744
|
<InlineNodesOutlet :nodes="inlineNodes" />
|
|
1745
1745
|
</div>
|
|
1746
1746
|
|
|
@@ -1807,7 +1807,6 @@ defineExpose({
|
|
|
1807
1807
|
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
|
1808
1808
|
color: var(--rec-text);
|
|
1809
1809
|
font-size: var(--rec-body-font-size);
|
|
1810
|
-
line-height: 1.7;
|
|
1811
1810
|
}
|
|
1812
1811
|
|
|
1813
1812
|
.aimd-protocol-recorder__empty {
|
|
@@ -1818,13 +1817,6 @@ defineExpose({
|
|
|
1818
1817
|
text-align: center;
|
|
1819
1818
|
}
|
|
1820
1819
|
|
|
1821
|
-
/* ── Typography ─────────────────────────────────────────────────────────── */
|
|
1822
|
-
.aimd-protocol-recorder__content :deep(h1) { margin: 0.45em 0 0.5em; font-size: 1.7em; line-height: 1.25; }
|
|
1823
|
-
.aimd-protocol-recorder__content :deep(h2) { margin: 0.8em 0 0.45em; font-size: 1.35em; line-height: 1.3; }
|
|
1824
|
-
.aimd-protocol-recorder__content :deep(h3) { margin: 0.7em 0 0.4em; font-size: 1.15em; }
|
|
1825
|
-
.aimd-protocol-recorder__content :deep(p) { margin: 0.45em 0; color: var(--rec-text); }
|
|
1826
|
-
.aimd-protocol-recorder__content :deep(ul),
|
|
1827
|
-
.aimd-protocol-recorder__content :deep(ol) { margin: 0.35em 0; padding-left: 22px; }
|
|
1828
1820
|
.aimd-protocol-recorder__content :deep(table) { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
|
|
1829
1821
|
.aimd-protocol-recorder__content :deep(th),
|
|
1830
1822
|
.aimd-protocol-recorder__content :deep(td) { border: 1px solid #e2e8f0; padding: 6px 10px; text-align: left; }
|
|
@@ -2098,7 +2090,7 @@ defineExpose({
|
|
|
2098
2090
|
align-items: stretch;
|
|
2099
2091
|
gap: 0;
|
|
2100
2092
|
margin: 5px 3px;
|
|
2101
|
-
width:
|
|
2093
|
+
width: max-content;
|
|
2102
2094
|
min-width: 0;
|
|
2103
2095
|
max-width: 100%;
|
|
2104
2096
|
border: 1px solid var(--aimd-border-color, #90caf9);
|
|
@@ -2118,13 +2110,28 @@ defineExpose({
|
|
|
2118
2110
|
box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.14);
|
|
2119
2111
|
}
|
|
2120
2112
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field) { margin: 0; box-shadow: none; }
|
|
2121
|
-
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field--no-style.aimd-field__label) {
|
|
2122
|
-
|
|
2113
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field--no-style.aimd-field__label) {
|
|
2114
|
+
flex-wrap: nowrap;
|
|
2115
|
+
min-height: 30px;
|
|
2116
|
+
border-radius: 6px 6px 0 0;
|
|
2117
|
+
}
|
|
2118
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field__scope) {
|
|
2119
|
+
flex: 0 0 auto;
|
|
2120
|
+
align-self: center;
|
|
2121
|
+
min-width: max-content;
|
|
2122
|
+
height: 22px;
|
|
2123
|
+
margin-left: 3px;
|
|
2124
|
+
padding: 0 7px;
|
|
2125
|
+
border-radius: 6px;
|
|
2126
|
+
overflow-wrap: normal;
|
|
2127
|
+
white-space: nowrap;
|
|
2128
|
+
word-break: normal;
|
|
2129
|
+
}
|
|
2123
2130
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field__name) {
|
|
2124
2131
|
display: flex;
|
|
2125
|
-
flex:
|
|
2132
|
+
flex: 0 0 auto;
|
|
2126
2133
|
align-items: center;
|
|
2127
|
-
min-width:
|
|
2134
|
+
min-width: max-content;
|
|
2128
2135
|
padding: 4px 10px 4px 6px;
|
|
2129
2136
|
font-size: 13px;
|
|
2130
2137
|
font-weight: 600;
|
|
@@ -2136,7 +2143,14 @@ defineExpose({
|
|
|
2136
2143
|
justify-content: center;
|
|
2137
2144
|
gap: 2px;
|
|
2138
2145
|
min-height: 34px;
|
|
2139
|
-
white-space:
|
|
2146
|
+
white-space: nowrap;
|
|
2147
|
+
}
|
|
2148
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field__title),
|
|
2149
|
+
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field__key) {
|
|
2150
|
+
overflow: visible;
|
|
2151
|
+
overflow-wrap: normal;
|
|
2152
|
+
white-space: nowrap;
|
|
2153
|
+
word-break: normal;
|
|
2140
2154
|
}
|
|
2141
2155
|
.aimd-protocol-recorder__content :deep(.aimd-field__key) {
|
|
2142
2156
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
@@ -2848,18 +2862,43 @@ defineExpose({
|
|
|
2848
2862
|
gap: 6px;
|
|
2849
2863
|
}
|
|
2850
2864
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body) {
|
|
2865
|
+
width: 100%;
|
|
2851
2866
|
min-width: 0;
|
|
2867
|
+
max-width: 100%;
|
|
2852
2868
|
color: var(--rec-text);
|
|
2853
2869
|
font-size: 15px;
|
|
2854
|
-
|
|
2870
|
+
box-sizing: border-box;
|
|
2871
|
+
overflow-wrap: anywhere;
|
|
2855
2872
|
}
|
|
2856
2873
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-step-body) {
|
|
2857
2874
|
display: flex;
|
|
2858
2875
|
flex-direction: column;
|
|
2859
2876
|
gap: 8px;
|
|
2877
|
+
width: 100%;
|
|
2878
|
+
min-width: 0;
|
|
2879
|
+
max-width: 100%;
|
|
2880
|
+
box-sizing: border-box;
|
|
2881
|
+
}
|
|
2882
|
+
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-step-body > *) {
|
|
2883
|
+
min-width: 0;
|
|
2884
|
+
max-width: 100%;
|
|
2885
|
+
box-sizing: border-box;
|
|
2886
|
+
overflow-wrap: anywhere;
|
|
2860
2887
|
}
|
|
2861
2888
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body p) {
|
|
2862
2889
|
margin: 0;
|
|
2890
|
+
min-width: 0;
|
|
2891
|
+
max-width: 100%;
|
|
2892
|
+
overflow-wrap: anywhere;
|
|
2893
|
+
}
|
|
2894
|
+
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-rec-inline--var-markdown),
|
|
2895
|
+
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-field--var-table) {
|
|
2896
|
+
width: 100%;
|
|
2897
|
+
min-width: 0;
|
|
2898
|
+
max-width: 100%;
|
|
2899
|
+
}
|
|
2900
|
+
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-field--var-table) {
|
|
2901
|
+
overflow-x: auto;
|
|
2863
2902
|
}
|
|
2864
2903
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body-actions) {
|
|
2865
2904
|
display: flex;
|
|
@@ -92,6 +92,7 @@ const props = withDefaults(defineProps<{
|
|
|
92
92
|
showFieldStructure?: boolean
|
|
93
93
|
showVisualEditToggle?: boolean
|
|
94
94
|
initialVisualEditMode?: boolean
|
|
95
|
+
initialSourceCollapsed?: boolean
|
|
95
96
|
allowRawFieldSourceEditing?: boolean
|
|
96
97
|
showRecordData?: boolean
|
|
97
98
|
showDetachedData?: boolean
|
|
@@ -138,6 +139,7 @@ const props = withDefaults(defineProps<{
|
|
|
138
139
|
showFieldStructure: false,
|
|
139
140
|
showVisualEditToggle: true,
|
|
140
141
|
initialVisualEditMode: false,
|
|
142
|
+
initialSourceCollapsed: false,
|
|
141
143
|
allowRawFieldSourceEditing: true,
|
|
142
144
|
showRecordData: false,
|
|
143
145
|
showDetachedData: true,
|
|
@@ -195,7 +197,7 @@ const draggedFieldUid = ref<string | null>(null)
|
|
|
195
197
|
const visualEditMode = ref(props.initialVisualEditMode)
|
|
196
198
|
const activeContentSurface = ref<'source' | 'visual' | null>(null)
|
|
197
199
|
const activeSideTab = ref<WorkbenchSideTab>('recorder')
|
|
198
|
-
const sourcePanelCollapsed = ref(
|
|
200
|
+
const sourcePanelCollapsed = ref(props.initialSourceCollapsed)
|
|
199
201
|
const sourcePanelWidthPercent = ref(50)
|
|
200
202
|
const isPanelResizing = ref(false)
|
|
201
203
|
const viewportEditorMinHeight = ref(props.editorMinHeight)
|
|
@@ -587,6 +587,47 @@ describe('measureVarLabelWidth', () => {
|
|
|
587
587
|
|
|
588
588
|
expect(measureVarLabelWidth(wrapper)).toBeLessThan(240)
|
|
589
589
|
})
|
|
590
|
+
|
|
591
|
+
it('includes long metadata keys when sizing stacked var labels', () => {
|
|
592
|
+
vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockImplementation(() => ({
|
|
593
|
+
measureText: (text: string) => ({ width: text.length * 8 }),
|
|
594
|
+
} as unknown as CanvasRenderingContext2D))
|
|
595
|
+
vi.spyOn(window, 'getComputedStyle').mockImplementation((element: Element) => {
|
|
596
|
+
const classList = (element as HTMLElement).classList
|
|
597
|
+
const horizontalPadding = classList.contains('aimd-field__name')
|
|
598
|
+
? '16px'
|
|
599
|
+
: classList.contains('aimd-field__scope--var')
|
|
600
|
+
? '14px'
|
|
601
|
+
: '0px'
|
|
602
|
+
return {
|
|
603
|
+
fontSize: '14px',
|
|
604
|
+
fontFamily: 'sans-serif',
|
|
605
|
+
fontWeight: '500',
|
|
606
|
+
fontStyle: 'normal',
|
|
607
|
+
paddingLeft: horizontalPadding,
|
|
608
|
+
paddingRight: '0px',
|
|
609
|
+
borderLeftWidth: '0px',
|
|
610
|
+
borderRightWidth: '0px',
|
|
611
|
+
marginLeft: '0px',
|
|
612
|
+
marginRight: '0px',
|
|
613
|
+
} as CSSStyleDeclaration
|
|
614
|
+
})
|
|
615
|
+
|
|
616
|
+
const wrapper = document.createElement('span')
|
|
617
|
+
wrapper.className = 'aimd-rec-inline--var-stacked'
|
|
618
|
+
wrapper.innerHTML = `
|
|
619
|
+
<span class="aimd-field__label">
|
|
620
|
+
<span class="aimd-field__scope aimd-field__scope--var">var</span>
|
|
621
|
+
<span class="aimd-field__name">
|
|
622
|
+
<span class="aimd-field__title">岸带完整性评分</span>
|
|
623
|
+
<span class="aimd-field__key">riparian_integrity_score</span>
|
|
624
|
+
</span>
|
|
625
|
+
</span>
|
|
626
|
+
`
|
|
627
|
+
document.body.appendChild(wrapper)
|
|
628
|
+
|
|
629
|
+
expect(measureVarLabelWidth(wrapper)).toBeGreaterThan(220)
|
|
630
|
+
})
|
|
590
631
|
})
|
|
591
632
|
|
|
592
633
|
// ---------------------------------------------------------------------------
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
// Re-export styles
|
|
10
|
-
import './styles/
|
|
10
|
+
import './styles/recorder.css'
|
|
11
11
|
import { AimdProtocolRecorder as DeprecatedAimdProtocolRecorder } from './components'
|
|
12
12
|
|
|
13
13
|
export { AimdAssignerGraph, AimdRecorder, AimdRecorderEditor, AimdQuizRecorder } from './components'
|