@airalogy/aimd-recorder 1.19.0 → 1.19.2
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 +13 -0
- package/README.zh-CN.md +13 -0
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js → AimdEditor.vue_vue_type_style_index_0_lang-gTySIxvX.js} +3446 -3351
- package/dist/{AimdMarkdownField-DmNX2g4j.js → AimdMarkdownField-DGV5KFUs.js} +5 -5
- package/dist/{AimdMarkdownNoteField-B5ruzmwS.js → AimdMarkdownNoteField-C78KHCBA.js} +4 -4
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-B-vsgEXF.js → arc-BMhAnOm7.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-BwPNOtNH.js → architectureDiagram-3BPJPVTR-DXuPTBR3.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-CMUI4kKc.js → blockDiagram-GPEHLZMM-HKz9kQ49.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-Cpmfsy_s.js → c4Diagram-AAUBKEIU-B2a8Aupm.js} +2 -2
- package/dist/{channel-DlMAXHQK.js → channel-CQnbPm6T.js} +1 -1
- package/dist/{chunk-2J33WTMH-DP9BS2ux.js → chunk-2J33WTMH-CPwhDANL.js} +1 -1
- package/dist/{chunk-4BX2VUAB-ncsOeLMb.js → chunk-4BX2VUAB-BJV0R8-Z.js} +1 -1
- package/dist/{chunk-55IACEB6-C7wHk4B7.js → chunk-55IACEB6-CSqUgTVA.js} +1 -1
- package/dist/{chunk-727SXJPM-Caa5aVUO.js → chunk-727SXJPM-C3LCZWaC.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-CL8egKqD.js → chunk-AQP2D5EJ-BC5kHyik.js} +3 -3
- package/dist/{chunk-FMBD7UC4-heVR6BSA.js → chunk-FMBD7UC4-lv-SQuSa.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BYH-wC2J.js → chunk-ND2GUHAM-BnnHbOOp.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Bx2K7vkq.js → chunk-QZHKN3VN-DE1_5lrn.js} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-BLLfLYy0.js → classDiagram-4FO5ZUOK-32SrXsR3.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-BLLfLYy0.js → classDiagram-v2-Q7XG4LA2-32SrXsR3.js} +2 -2
- package/dist/components.js +2537 -2502
- package/dist/composables.js +1 -1
- package/dist/{cose-bilkent-S5V4N54A-E1YmM_xr.js → cose-bilkent-S5V4N54A-BKyR6PrF.js} +1 -1
- package/dist/{dagre-BM42HDAG-BsXpQirH.js → dagre-BM42HDAG-D8Nwouf2.js} +3 -3
- package/dist/{diagram-2AECGRRQ-CamqbWlY.js → diagram-2AECGRRQ-DfoNEchZ.js} +2 -2
- package/dist/{diagram-5GNKFQAL-DZyRFcOC.js → diagram-5GNKFQAL-Dlpl3XO8.js} +3 -3
- package/dist/{diagram-KO2AKTUF-CmkGcy7R.js → diagram-KO2AKTUF-CgwROod_.js} +2 -2
- package/dist/{diagram-LMA3HP47-IdDwQPZ-.js → diagram-LMA3HP47-UiiviX43.js} +2 -2
- package/dist/{diagram-OG6HWLK6-t0LBcUIU.js → diagram-OG6HWLK6-BPuH-4Wa.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-DJBY2iZG.js → erDiagram-TEJ5UH35-B19WKSiS.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-DE4MzPPk.js → flowDiagram-I6XJVG4X-SsfO1IYz.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-CmAc35Yw.js → ganttDiagram-6RSMTGT7-8BCxW9SC.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-DDQZ5flw.js → gitGraphDiagram-PVQCEYII-D-jzaXKg.js} +3 -3
- package/dist/{graph-BsJ8-1Pq.js → graph-Dd8Vx0lj.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{infoDiagram-5YYISTIA-DSZjFR5g.js → infoDiagram-5YYISTIA-B_XwkyXw.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-DCO9dx2L.js → ishikawaDiagram-YF4QCWOH-nevqOMkV.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-b-PpuBqg.js → journeyDiagram-JHISSGLW-DKQOkZNx.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-BjclDuJZ.js → kanban-definition-UN3LZRKU-BYvizbN0.js} +2 -2
- package/dist/{layout-D4wqKu72.js → layout-BiHDh2wu.js} +2 -2
- package/dist/{linear-Voc3BJib.js → linear-BcUgIsNC.js} +1 -1
- package/dist/{mermaid.core-Dt_VbeGP.js → mermaid.core-DPv1ut6K.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-B3vrXRVY.js → mindmap-definition-RKZ34NQL-CiT97EC2.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-DFpWxSxk.js → pieDiagram-4H26LBE5-BHcFVpCC.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-BYHcrGoB.js → quadrantDiagram-W4KKPZXB-BFBAb3Zx.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-C-FgWrRz.js → requirementDiagram-4Y6WPE33-CUS2OOyE.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-IwN0Evji.js → sankeyDiagram-5OEKKPKP-IuhX4tCb.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-_OnqhBO2.js → sequenceDiagram-3UESZ5HK-DWHcFiUF.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-BRLv0Zcw.js → stateDiagram-AJRCARHV-J49Kafj_.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-BofX0AdS.js → stateDiagram-v2-BHNVJYJU-DL2VCR5X.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-C-DpPLpw.js → timeline-definition-PNZ67QCA-l9xSQ_pX.js} +2 -2
- package/dist/{useCodeBlockRendering-DoTZaJTW.js → useCodeBlockRendering-CY70U0Xm.js} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-zTHQR9Oq.js → vennDiagram-CIIHVFJN-BQjdmOkd.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-au5koizO.js → wardleyDiagram-YWT4CUSO-CmVdsV9b.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-BNf12P8z.js → xychartDiagram-2RQKCTM6-F-cC_Igm.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 +34 -1
- package/src/__tests__/recorder-wysiwyg-field-host.test.ts +3 -0
- package/src/__tests__/var-field-render.test.ts +64 -7
- package/src/components/AimdMarkdownField.vue +1 -19
- package/src/components/AimdMarkdownNoteField.vue +1 -2
- package/src/components/AimdRecorder.vue +56 -16
- package/src/components/AimdRecorderEditor.vue +116 -10
- package/src/components/AimdRecorderWysiwygFieldHost.vue +4 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +19 -1
- package/src/components/recorderMilkdownPlugin.ts +7 -1
- package/src/composables/__tests__/useVarHelpers.test.ts +41 -0
- package/src/index.ts +1 -1
- package/src/styles/{aimd.css → recorder.css} +6 -620
|
@@ -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-DPv1ut6K.js";
|
|
2
|
+
import { p as Bt } from "./chunk-4BX2VUAB-BJV0R8-Z.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-DPv1ut6K.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-BcUgIsNC.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.19.
|
|
4
|
+
"version": "1.19.2",
|
|
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-
|
|
67
|
-
"@airalogy/aimd-
|
|
68
|
-
"@airalogy/aimd-
|
|
66
|
+
"@airalogy/aimd-renderer": "^2.9.0",
|
|
67
|
+
"@airalogy/aimd-editor": "^1.10.0",
|
|
68
|
+
"@airalogy/aimd-core": "^2.11.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
|
})
|
|
@@ -7,6 +7,7 @@ const __filename = fileURLToPath(import.meta.url)
|
|
|
7
7
|
const __dirname = dirname(__filename)
|
|
8
8
|
const source = readFileSync(resolve(__dirname, '../components/AimdRecorderEditor.vue'), 'utf8')
|
|
9
9
|
const wysiwygSurfaceSource = readFileSync(resolve(__dirname, '../components/AimdRecorderWysiwygSurface.vue'), 'utf8')
|
|
10
|
+
const wysiwygFieldHostSource = readFileSync(resolve(__dirname, '../components/AimdRecorderWysiwygFieldHost.vue'), 'utf8')
|
|
10
11
|
const recorderMilkdownSource = readFileSync(resolve(__dirname, '../components/recorderMilkdownPlugin.ts'), 'utf8')
|
|
11
12
|
const componentExports = readFileSync(resolve(__dirname, '../components/index.ts'), 'utf8')
|
|
12
13
|
const rootExports = readFileSync(resolve(__dirname, '../index.ts'), 'utf8')
|
|
@@ -63,7 +64,7 @@ describe('AimdRecorderEditor', () => {
|
|
|
63
64
|
expect(source).toMatch(/type WorkbenchSideTab = 'recorder' \| 'structure' \| 'record' \| 'detached'/)
|
|
64
65
|
expect(source).toMatch(/const activeSideTab = ref<WorkbenchSideTab>\('recorder'\)/)
|
|
65
66
|
expect(source).toMatch(/const sideTabs = computed\(\(\) =>/)
|
|
66
|
-
expect(source).toMatch(/const sidePanelBodyStyle = computed\(\(\) => \(
|
|
67
|
+
expect(source).toMatch(/const sidePanelBodyStyle = computed\(\(\) => \(/)
|
|
67
68
|
expect(source).toMatch(/aimd-recorder-workbench__side-tabs/)
|
|
68
69
|
expect(source).toMatch(/aimd-recorder-workbench__side-tab--active/)
|
|
69
70
|
expect(source).toMatch(/aimd-recorder-workbench__panel-body--recorder \{[\s\S]*overflow: auto;/)
|
|
@@ -88,19 +89,51 @@ describe('AimdRecorderEditor', () => {
|
|
|
88
89
|
|
|
89
90
|
it('can fit both columns to the remaining viewport height while still exposing a fixed-height opt-out', () => {
|
|
90
91
|
expect(source).toMatch(/fitViewport\?: boolean/)
|
|
92
|
+
expect(source).toMatch(/fillParent\?: boolean/)
|
|
91
93
|
expect(source).toMatch(/viewportOffset\?: number/)
|
|
92
94
|
expect(source).toMatch(/fitViewport: true/)
|
|
95
|
+
expect(source).toMatch(/fillParent: false/)
|
|
93
96
|
expect(source).toMatch(/viewportOffset: 24/)
|
|
97
|
+
expect(source).toMatch(/if \(props\.fillParent\) \{[\s\S]*viewportWorkbenchMainHeight\.value = null[\s\S]*return/)
|
|
98
|
+
expect(source).toMatch(/minHeight: editorProps\.minHeight \?\? \(props\.fillParent \? 0 : viewportEditorMinHeight\.value\)/)
|
|
99
|
+
expect(source).toMatch(/const sidePanelBodyStyle = computed\(\(\) => \([\s\S]*props\.fillParent \? \{\} : \{ height: `\$\{viewportSideBodyHeight\.value\}px` \}[\s\S]*\)\)/)
|
|
100
|
+
expect(source).toMatch(/const visualEditorMinHeight = computed\(\(\) => \([\s\S]*props\.fillParent \? 0 : viewportVisualEditorMinHeight\.value[\s\S]*\)\)/)
|
|
101
|
+
expect(source).toMatch(/'aimd-recorder-workbench--fill-parent': fillParent/)
|
|
102
|
+
expect(source).toMatch(/aimd-recorder-workbench--fill-parent \{[\s\S]*height: 100%;[\s\S]*overflow: hidden;/)
|
|
103
|
+
expect(source).toMatch(/aimd-recorder-workbench--fill-parent \.aimd-recorder-workbench__main \{[\s\S]*flex: 1 1 0;[\s\S]*height: 100%;/)
|
|
104
|
+
expect(source).toMatch(/aimd-recorder-workbench--fill-parent \.aimd-recorder-workbench__panel-body \{[\s\S]*flex: 1 1 0;[\s\S]*height: auto !important;/)
|
|
105
|
+
expect(source).toMatch(/aimd-recorder-workbench--fill-parent \.aimd-recorder-workbench__panel-body--editor :deep\(\.aimd-editor-panel > div\) \{[\s\S]*height: 100%;[\s\S]*min-height: 0;/)
|
|
94
106
|
expect(source).toMatch(/function getViewportHeight\(\)/)
|
|
95
107
|
expect(source).toMatch(/return window\.visualViewport\?\.height \?\? window\.innerHeight/)
|
|
96
108
|
expect(source).toMatch(/function updateViewportPanelHeights\(/)
|
|
97
109
|
expect(source).toMatch(/const viewportVisualEditorMinHeight = ref/)
|
|
110
|
+
expect(source).toMatch(/const viewportWorkbenchMainHeight = ref<number \| null>\(null\)/)
|
|
98
111
|
expect(source).toMatch(/const recorderToolbarHeight = getElementHeight\(recorderToolbarRef\.value\)/)
|
|
99
112
|
expect(source).toMatch(/const visualEditorToolbarHeight = getElementHeight\(sidePanelBodyRef\.value\?\.querySelector\('\.aimd-editor-toolbar'\)\)/)
|
|
113
|
+
expect(source).toMatch(/--aimd-recorder-workbench-main-height/)
|
|
114
|
+
expect(source).toMatch(/height: var\(--aimd-recorder-workbench-main-height, auto\);/)
|
|
115
|
+
expect(source).toMatch(/aimd-recorder-workbench__panel \{[\s\S]*display: flex;[\s\S]*min-height: 0;/)
|
|
100
116
|
expect(source).toMatch(/workbenchRef\.value\?\.getBoundingClientRect\(\)\.top/)
|
|
101
117
|
expect(source).toMatch(/window\.addEventListener\('resize', scheduleViewportPanelHeights/)
|
|
102
118
|
})
|
|
103
119
|
|
|
120
|
+
it('passes quiz grading display state through the combined editor and visual recorder surface', () => {
|
|
121
|
+
expect(source).toMatch(/quizGrades\?: Record<string, AimdQuizGradeResult \| null \| undefined>/)
|
|
122
|
+
expect(source).toMatch(/submitted\?: boolean/)
|
|
123
|
+
expect(source).toMatch(/choiceOptionExplanationMode\?: AimdChoiceOptionExplanationMode/)
|
|
124
|
+
expect(source).toMatch(/scaleGradeDisplayMode\?: AimdScaleGradeDisplayMode/)
|
|
125
|
+
expect(source).toMatch(/:quiz-grades="quizGrades"/)
|
|
126
|
+
expect(source).toMatch(/:submitted="submitted"/)
|
|
127
|
+
expect(source).toMatch(/:choice-option-explanation-mode="choiceOptionExplanationMode"/)
|
|
128
|
+
expect(source).toMatch(/:scale-grade-display-mode="scaleGradeDisplayMode"/)
|
|
129
|
+
expect(wysiwygSurfaceSource).toMatch(/quizGrades\?: Record<string, AimdQuizGradeResult \| null \| undefined>/)
|
|
130
|
+
expect(wysiwygSurfaceSource).toMatch(/surfaceState\.quizGrades = props\.quizGrades/)
|
|
131
|
+
expect(recorderMilkdownSource).toMatch(/quizGrades\?: Record<string, AimdQuizGradeResult \| null \| undefined>/)
|
|
132
|
+
expect(recorderMilkdownSource).toMatch(/choiceOptionExplanationMode: AimdChoiceOptionExplanationMode/)
|
|
133
|
+
expect(wysiwygFieldHostSource).toMatch(/:quiz-grades="surfaceState\.quizGrades"/)
|
|
134
|
+
expect(wysiwygFieldHostSource).toMatch(/:choice-option-explanation-mode="surfaceState\.choiceOptionExplanationMode"/)
|
|
135
|
+
})
|
|
136
|
+
|
|
104
137
|
it('supports recorder-side visual editing so field controls can be changed around live recorder widgets', () => {
|
|
105
138
|
expect(source).toMatch(/visualEditMode/)
|
|
106
139
|
expect(source).toMatch(/import AimdRecorderWysiwygSurface from '\.\/AimdRecorderWysiwygSurface\.vue'/)
|
|
@@ -8,6 +8,9 @@ function createSurfaceState(): RecorderMilkdownSurfaceState {
|
|
|
8
8
|
return {
|
|
9
9
|
record: createEmptyProtocolRecordData(),
|
|
10
10
|
readonly: false,
|
|
11
|
+
submitted: false,
|
|
12
|
+
choiceOptionExplanationMode: 'hidden',
|
|
13
|
+
scaleGradeDisplayMode: 'hidden',
|
|
11
14
|
stepDetailDisplay: 'auto',
|
|
12
15
|
onUpdateRecord: () => {},
|
|
13
16
|
}
|
|
@@ -15,10 +15,13 @@ const __filename = fileURLToPath(import.meta.url)
|
|
|
15
15
|
const __dirname = dirname(__filename)
|
|
16
16
|
const source = readFileSync(resolve(__dirname, '../components/AimdVarField.vue'), 'utf8')
|
|
17
17
|
const codeFieldSource = readFileSync(resolve(__dirname, '../components/AimdCodeField.vue'), 'utf8')
|
|
18
|
+
const markdownFieldSource = readFileSync(resolve(__dirname, '../components/AimdMarkdownField.vue'), 'utf8')
|
|
18
19
|
const varTableSource = readFileSync(resolve(__dirname, '../components/AimdVarTableField.vue'), 'utf8')
|
|
19
20
|
const recorderSource = readFileSync(resolve(__dirname, '../components/AimdRecorder.vue'), 'utf8')
|
|
21
|
+
const markdownNoteSource = readFileSync(resolve(__dirname, '../components/AimdMarkdownNoteField.vue'), 'utf8')
|
|
20
22
|
const varHelpersSource = readFileSync(resolve(__dirname, '../composables/useVarHelpers.ts'), 'utf8')
|
|
21
|
-
const
|
|
23
|
+
const recorderStyles = readFileSync(resolve(__dirname, '../styles/recorder.css'), 'utf8')
|
|
24
|
+
const rendererStyles = readFileSync(resolve(__dirname, '../../../aimd-renderer/src/styles/renderer.css'), 'utf8')
|
|
22
25
|
|
|
23
26
|
describe('AimdVarField render behavior', () => {
|
|
24
27
|
afterEach(() => {
|
|
@@ -55,10 +58,47 @@ describe('AimdVarField render behavior', () => {
|
|
|
55
58
|
expect(codeFieldSource).not.toContain('min-height: 240px;')
|
|
56
59
|
})
|
|
57
60
|
|
|
61
|
+
it('layers recorder styles on top of renderer styles', () => {
|
|
62
|
+
expect(recorderStyles).toContain('@import "@airalogy/aimd-renderer/styles";')
|
|
63
|
+
expect(recorderSource).toContain('class="aimd-protocol-recorder__content aimd-renderer"')
|
|
64
|
+
expect(markdownFieldSource).toContain('class="aimd-markdown-field__preview aimd-renderer"')
|
|
65
|
+
expect(markdownNoteSource).toContain('class="aimd-markdown-note-field__preview aimd-renderer"')
|
|
66
|
+
expect(recorderStyles).toContain('.aimd-field--editable')
|
|
67
|
+
expect(recorderStyles).toContain('.aimd-field--no-style')
|
|
68
|
+
expect(recorderStyles).toContain('.aimd-field-wrapper--inline')
|
|
69
|
+
expect(recorderStyles).not.toContain('.aimd-figure {')
|
|
70
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(h[1-3]\)/)
|
|
71
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(p\)/)
|
|
72
|
+
expect(recorderSource).not.toMatch(/\.aimd-protocol-recorder__content :deep\(ul\),\n\.aimd-protocol-recorder__content :deep\(ol\)/)
|
|
73
|
+
expect(markdownFieldSource).not.toMatch(/\.aimd-markdown-field__preview :deep\(ul\),\n\.aimd-markdown-field__preview :deep\(ol\)/)
|
|
74
|
+
})
|
|
75
|
+
|
|
58
76
|
it('keeps table metadata popovers from being clipped by table bounds', () => {
|
|
59
|
-
expect(
|
|
60
|
-
expect(
|
|
61
|
-
expect(
|
|
77
|
+
expect(rendererStyles).toMatch(/\.aimd-field--var-table \.aimd-field__table-preview \{[\s\S]*?overflow: visible;/)
|
|
78
|
+
expect(rendererStyles).toMatch(/\.aimd-field--var-table \.aimd-field__table-preview th \{[\s\S]*?overflow: visible;/)
|
|
79
|
+
expect(rendererStyles).toContain('.aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:hover)')
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('keeps figure images and captions visually attached without card elevation', () => {
|
|
83
|
+
expect(rendererStyles).toMatch(/\.aimd-figure \{[\s\S]*?width: fit-content;/)
|
|
84
|
+
expect(rendererStyles).toMatch(/\.aimd-figure \{[\s\S]*?overflow: hidden;/)
|
|
85
|
+
expect(rendererStyles).not.toContain('box-shadow: 0 10px 28px')
|
|
86
|
+
expect(rendererStyles).toMatch(/\.aimd-figure__caption \{[\s\S]*?border-top: 1px solid #d8e2ef;/)
|
|
87
|
+
expect(rendererStyles).toMatch(/\.aimd-figure__legend \{[\s\S]*?margin: 4px 0 0;/)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('uses selectable citation popovers instead of pseudo-element tooltips', () => {
|
|
91
|
+
expect(rendererStyles).toContain('.aimd-cite__popover')
|
|
92
|
+
expect(rendererStyles).not.toContain('.aimd-cite__ref::after')
|
|
93
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover \{[\s\S]*?pointer-events: none;/)
|
|
94
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover \{[\s\S]*?user-select: text;/)
|
|
95
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__popover::before \{[\s\S]*?height: 10px;/)
|
|
96
|
+
expect(rendererStyles).toMatch(/\.aimd-cite__ref:hover \.aimd-cite__popover,[\s\S]*?pointer-events: auto;/)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('marks internal references as focusable route-safe targets', () => {
|
|
100
|
+
expect(rendererStyles).toMatch(/\.aimd-ref\[data-aimd-ref-target\] \{[\s\S]*?cursor: pointer;/)
|
|
101
|
+
expect(rendererStyles).toMatch(/\.aimd-ref\[data-aimd-ref-target\]:focus-visible \{[\s\S]*?outline: 2px solid rgba\(25, 118, 210, 0\.36\);/)
|
|
62
102
|
})
|
|
63
103
|
|
|
64
104
|
it('renders editable table cell values without inherited italic preview styling', () => {
|
|
@@ -88,6 +128,14 @@ describe('AimdVarField render behavior', () => {
|
|
|
88
128
|
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--has-assigner-control\) \{[\s\S]*?overflow: hidden;/)
|
|
89
129
|
})
|
|
90
130
|
|
|
131
|
+
it('lets stacked var fields widen before wrapping long metadata keys', () => {
|
|
132
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-rec-inline--var-stacked\) \{[\s\S]*?width: max-content;/)
|
|
133
|
+
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;/)
|
|
134
|
+
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;/)
|
|
135
|
+
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;/)
|
|
136
|
+
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;/)
|
|
137
|
+
})
|
|
138
|
+
|
|
91
139
|
it('normalizes stacked var value typography across native control types', () => {
|
|
92
140
|
expect(recorderSource).toContain('--rec-body-font-size: 14px;')
|
|
93
141
|
expect(recorderSource).toContain('--rec-var-value-font-size: var(--rec-body-font-size);')
|
|
@@ -114,6 +162,15 @@ describe('AimdVarField render behavior', () => {
|
|
|
114
162
|
expect(recorderSource).not.toContain('width: min(100%, 1040px);')
|
|
115
163
|
})
|
|
116
164
|
|
|
165
|
+
it('keeps step body content inside the step card width', () => {
|
|
166
|
+
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;/)
|
|
167
|
+
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%;/)
|
|
168
|
+
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;/)
|
|
169
|
+
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%;/)
|
|
170
|
+
expect(recorderSource).toMatch(/\.aimd-protocol-recorder__content :deep\(\.aimd-step-field__body \.aimd-field--var-table\) \{[\s\S]*?overflow-x: auto;/)
|
|
171
|
+
expect(recorderSource).not.toContain('line-height: 1.72;')
|
|
172
|
+
})
|
|
173
|
+
|
|
117
174
|
it('renders file-like vars with a native file picker control', async () => {
|
|
118
175
|
const node: AimdVarNode = {
|
|
119
176
|
type: 'aimd',
|
|
@@ -386,9 +443,9 @@ describe('AimdVarField render behavior', () => {
|
|
|
386
443
|
})
|
|
387
444
|
|
|
388
445
|
it('styles metadata examples as distinct chips', () => {
|
|
389
|
-
expect(
|
|
390
|
-
expect(
|
|
391
|
-
expect(
|
|
446
|
+
expect(rendererStyles).toContain('.aimd-field__metadata-examples')
|
|
447
|
+
expect(rendererStyles).toContain('.aimd-field__metadata-example')
|
|
448
|
+
expect(rendererStyles).toMatch(/\.aimd-field__metadata-example \{[\s\S]*?border: 1px solid rgba\(248, 250, 252, 0\.18\);/)
|
|
392
449
|
})
|
|
393
450
|
|
|
394
451
|
it('renders AIMD var metadata and uses examples as placeholders', () => {
|
|
@@ -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 {
|
|
@@ -1547,6 +1547,7 @@ async function rebuildInlineNodes(
|
|
|
1547
1547
|
value: localRecord as Record<string, Record<string, unknown>>,
|
|
1548
1548
|
},
|
|
1549
1549
|
blockVarTypes: ["AiralogyMarkdown"],
|
|
1550
|
+
resolveAssetUrl: props.resolveFile,
|
|
1550
1551
|
elementRenderers: {
|
|
1551
1552
|
pre: codeBlockPreRenderer,
|
|
1552
1553
|
},
|
|
@@ -1739,7 +1740,7 @@ defineExpose({
|
|
|
1739
1740
|
</span>
|
|
1740
1741
|
</div>
|
|
1741
1742
|
|
|
1742
|
-
<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">
|
|
1743
1744
|
<InlineNodesOutlet :nodes="inlineNodes" />
|
|
1744
1745
|
</div>
|
|
1745
1746
|
|
|
@@ -1806,7 +1807,6 @@ defineExpose({
|
|
|
1806
1807
|
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
|
1807
1808
|
color: var(--rec-text);
|
|
1808
1809
|
font-size: var(--rec-body-font-size);
|
|
1809
|
-
line-height: 1.7;
|
|
1810
1810
|
}
|
|
1811
1811
|
|
|
1812
1812
|
.aimd-protocol-recorder__empty {
|
|
@@ -1817,13 +1817,6 @@ defineExpose({
|
|
|
1817
1817
|
text-align: center;
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
1820
|
-
/* ── Typography ─────────────────────────────────────────────────────────── */
|
|
1821
|
-
.aimd-protocol-recorder__content :deep(h1) { margin: 0.45em 0 0.5em; font-size: 1.7em; line-height: 1.25; }
|
|
1822
|
-
.aimd-protocol-recorder__content :deep(h2) { margin: 0.8em 0 0.45em; font-size: 1.35em; line-height: 1.3; }
|
|
1823
|
-
.aimd-protocol-recorder__content :deep(h3) { margin: 0.7em 0 0.4em; font-size: 1.15em; }
|
|
1824
|
-
.aimd-protocol-recorder__content :deep(p) { margin: 0.45em 0; color: var(--rec-text); }
|
|
1825
|
-
.aimd-protocol-recorder__content :deep(ul),
|
|
1826
|
-
.aimd-protocol-recorder__content :deep(ol) { margin: 0.35em 0; padding-left: 22px; }
|
|
1827
1820
|
.aimd-protocol-recorder__content :deep(table) { border-collapse: collapse; margin: 10px 0; font-size: 14px; }
|
|
1828
1821
|
.aimd-protocol-recorder__content :deep(th),
|
|
1829
1822
|
.aimd-protocol-recorder__content :deep(td) { border: 1px solid #e2e8f0; padding: 6px 10px; text-align: left; }
|
|
@@ -2097,7 +2090,7 @@ defineExpose({
|
|
|
2097
2090
|
align-items: stretch;
|
|
2098
2091
|
gap: 0;
|
|
2099
2092
|
margin: 5px 3px;
|
|
2100
|
-
width:
|
|
2093
|
+
width: max-content;
|
|
2101
2094
|
min-width: 0;
|
|
2102
2095
|
max-width: 100%;
|
|
2103
2096
|
border: 1px solid var(--aimd-border-color, #90caf9);
|
|
@@ -2117,13 +2110,28 @@ defineExpose({
|
|
|
2117
2110
|
box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.14);
|
|
2118
2111
|
}
|
|
2119
2112
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field) { margin: 0; box-shadow: none; }
|
|
2120
|
-
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field--no-style.aimd-field__label) {
|
|
2121
|
-
|
|
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
|
+
}
|
|
2122
2130
|
.aimd-protocol-recorder__content :deep(.aimd-rec-inline--var-stacked .aimd-field__name) {
|
|
2123
2131
|
display: flex;
|
|
2124
|
-
flex:
|
|
2132
|
+
flex: 0 0 auto;
|
|
2125
2133
|
align-items: center;
|
|
2126
|
-
min-width:
|
|
2134
|
+
min-width: max-content;
|
|
2127
2135
|
padding: 4px 10px 4px 6px;
|
|
2128
2136
|
font-size: 13px;
|
|
2129
2137
|
font-weight: 600;
|
|
@@ -2135,7 +2143,14 @@ defineExpose({
|
|
|
2135
2143
|
justify-content: center;
|
|
2136
2144
|
gap: 2px;
|
|
2137
2145
|
min-height: 34px;
|
|
2138
|
-
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;
|
|
2139
2154
|
}
|
|
2140
2155
|
.aimd-protocol-recorder__content :deep(.aimd-field__key) {
|
|
2141
2156
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
@@ -2847,18 +2862,43 @@ defineExpose({
|
|
|
2847
2862
|
gap: 6px;
|
|
2848
2863
|
}
|
|
2849
2864
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body) {
|
|
2865
|
+
width: 100%;
|
|
2850
2866
|
min-width: 0;
|
|
2867
|
+
max-width: 100%;
|
|
2851
2868
|
color: var(--rec-text);
|
|
2852
2869
|
font-size: 15px;
|
|
2853
|
-
|
|
2870
|
+
box-sizing: border-box;
|
|
2871
|
+
overflow-wrap: anywhere;
|
|
2854
2872
|
}
|
|
2855
2873
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body .aimd-step-body) {
|
|
2856
2874
|
display: flex;
|
|
2857
2875
|
flex-direction: column;
|
|
2858
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;
|
|
2859
2887
|
}
|
|
2860
2888
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body p) {
|
|
2861
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;
|
|
2862
2902
|
}
|
|
2863
2903
|
.aimd-protocol-recorder__content :deep(.aimd-step-field__body-actions) {
|
|
2864
2904
|
display: flex;
|