@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.
- package/README.md +42 -10
- package/README.zh-CN.md +42 -10
- package/dist/AimdCodeField-BQUuM-EF.js +182 -0
- package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-TBKunqU_.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-tdh0dJNa.js} +3922 -3829
- package/dist/AimdMarkdownField-DmNX2g4j.js +254 -0
- package/dist/AimdMarkdownNoteField-B5ruzmwS.js +259 -0
- package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/arc-B-vsgEXF.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BwPNOtNH.js +4692 -0
- package/dist/blockDiagram-GPEHLZMM-CMUI4kKc.js +2425 -0
- package/dist/c4Diagram-AAUBKEIU-Cpmfsy_s.js +1577 -0
- package/dist/channel-DlMAXHQK.js +5 -0
- package/dist/chunk-2J33WTMH-DP9BS2ux.js +19 -0
- package/dist/chunk-4BX2VUAB-ncsOeLMb.js +8 -0
- package/dist/chunk-55IACEB6-C7wHk4B7.js +8 -0
- package/dist/chunk-727SXJPM-Caa5aVUO.js +1528 -0
- package/dist/chunk-AQP2D5EJ-CL8egKqD.js +1387 -0
- package/dist/chunk-FMBD7UC4-heVR6BSA.js +19 -0
- package/dist/chunk-ND2GUHAM-BYH-wC2J.js +68 -0
- package/dist/chunk-QZHKN3VN-Bx2K7vkq.js +15 -0
- package/dist/classDiagram-4FO5ZUOK-BLLfLYy0.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-BLLfLYy0.js +16 -0
- package/dist/components.js +3776 -2247
- package/dist/composables.js +96 -70
- package/dist/cose-bilkent-S5V4N54A-E1YmM_xr.js +2609 -0
- package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
- package/dist/dagre-BM42HDAG-BsXpQirH.js +445 -0
- package/dist/defaultLocale-BgPVtth8.js +171 -0
- package/dist/diagram-2AECGRRQ-CamqbWlY.js +217 -0
- package/dist/diagram-5GNKFQAL-DZyRFcOC.js +123 -0
- package/dist/diagram-KO2AKTUF-CmkGcy7R.js +461 -0
- package/dist/diagram-LMA3HP47-IdDwQPZ-.js +142 -0
- package/dist/diagram-OG6HWLK6-t0LBcUIU.js +528 -0
- package/dist/erDiagram-TEJ5UH35-DJBY2iZG.js +899 -0
- package/dist/flowDiagram-I6XJVG4X-DE4MzPPk.js +1628 -0
- package/dist/ganttDiagram-6RSMTGT7-CmAc35Yw.js +2707 -0
- package/dist/gitGraphDiagram-PVQCEYII-DDQZ5flw.js +815 -0
- package/dist/graph-BsJ8-1Pq.js +1510 -0
- package/dist/index.js +110 -83
- package/dist/infoDiagram-5YYISTIA-DSZjFR5g.js +24 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-DCO9dx2L.js +621 -0
- package/dist/journeyDiagram-JHISSGLW-b-PpuBqg.js +834 -0
- package/dist/kanban-definition-UN3LZRKU-BjclDuJZ.js +724 -0
- package/dist/katex-DNob3HGn.js +11690 -0
- package/dist/layout-D4wqKu72.js +1703 -0
- package/dist/linear-Voc3BJib.js +259 -0
- package/dist/mermaid.core-Dt_VbeGP.js +15940 -0
- package/dist/mindmap-definition-RKZ34NQL-B3vrXRVY.js +827 -0
- package/dist/ordinal-B6-f3MAq.js +61 -0
- package/dist/pieDiagram-4H26LBE5-DFpWxSxk.js +163 -0
- package/dist/quadrantDiagram-W4KKPZXB-BYHcrGoB.js +1024 -0
- package/dist/record.js +1199 -0
- package/dist/requirementDiagram-4Y6WPE33-C-FgWrRz.js +882 -0
- package/dist/sankeyDiagram-5OEKKPKP-IwN0Evji.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-_OnqhBO2.js +2891 -0
- package/dist/stateDiagram-AJRCARHV-BRLv0Zcw.js +263 -0
- package/dist/stateDiagram-v2-BHNVJYJU-BofX0AdS.js +16 -0
- package/dist/timeline-definition-PNZ67QCA-C-DpPLpw.js +1055 -0
- package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-DoTZaJTW.js} +1528 -1725
- package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
- package/dist/vennDiagram-CIIHVFJN-zTHQR9Oq.js +1557 -0
- package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
- package/dist/wardleyDiagram-YWT4CUSO-au5koizO.js +675 -0
- package/dist/xychartDiagram-2RQKCTM6-BNf12P8z.js +1342 -0
- package/package.json +13 -8
- package/src/__tests__/assigner-graph.test.ts +82 -0
- package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
- package/src/__tests__/markdown-field.test.ts +150 -1
- package/src/__tests__/markdown-note-field.test.ts +86 -3
- package/src/__tests__/recorder-assigner-control.test.ts +993 -0
- package/src/__tests__/recorder-editor.test.ts +17 -0
- package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
- package/src/__tests__/step-field.test.ts +47 -1
- package/src/__tests__/type-plugins.test.ts +1 -0
- package/src/__tests__/var-field-render.test.ts +806 -1
- package/src/components/AimdAssignerGraph.vue +816 -0
- package/src/components/AimdCodeField.vue +24 -5
- package/src/components/AimdMarkdownField.vue +556 -11
- package/src/components/AimdMarkdownNoteField.vue +241 -30
- package/src/components/AimdRecorder.vue +1619 -99
- package/src/components/AimdRecorderEditor.vue +276 -8
- package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
- package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
- package/src/components/AimdStepCheckField.vue +82 -18
- package/src/components/AimdVarField.vue +694 -25
- package/src/components/AimdVarTableField.vue +325 -138
- package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
- package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
- package/src/components/index.ts +9 -1
- package/src/components/recorderMilkdownPlugin.ts +14 -0
- package/src/composables/__tests__/useRecordState.test.ts +86 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +175 -0
- package/src/composables/index.ts +28 -1
- package/src/composables/useAssignerRunner.ts +376 -0
- package/src/composables/useCodeBlockRendering.ts +51 -0
- package/src/composables/useFieldRendering.ts +32 -4
- package/src/composables/useMonacoAutoHeight.ts +127 -0
- package/src/composables/useRecordState.ts +22 -3
- package/src/composables/useVarHelpers.ts +237 -32
- package/src/index.ts +20 -1
- package/src/locales.ts +45 -0
- package/src/record/index.ts +120 -0
- package/src/styles/aimd.css +216 -1
- package/src/type-plugins.ts +7 -0
- package/src/type-utils.ts +1 -3
- package/src/types.ts +130 -2
- package/dist/AimdCodeField-DC3DPvgc.js +0 -172
- package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
- package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
package/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# @airalogy/aimd-recorder
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@airalogy/aimd-recorder)
|
|
4
|
-
[](https://github.com/airalogy/
|
|
4
|
+
[](https://github.com/airalogy/airalogy/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
Reusable recording UI for AIMD (Airalogy Markdown), including inline protocol recorder, the combined `AimdRecorderEditor`, quiz answer components, and styles.
|
|
7
7
|
|
|
8
8
|
Built-in variable input types include `CurrentTime`, `UserName`, `AiralogyMarkdown`, and `DNASequence`.
|
|
9
|
-
`AiralogyMarkdown` now uses a full-width embedded AIMD/Markdown
|
|
9
|
+
`AiralogyMarkdown` now uses a full-width embedded AIMD/Markdown field in recorder mode with rendered preview and source-editing modes; source editing keeps the full top toolbar and still supports switching to `WYSIWYG` instead of a plain textarea.
|
|
10
10
|
In recorder/edit mode, `ref_var` references display current var values as readonly inline content when available.
|
|
11
|
+
`var` and `var_table` labels display AIMD `title`, keep canonical ids visible, and reveal `description` plus `example`/`examples` details only on hover or keyboard focus. Host `fieldMeta` can override the same display fields at runtime.
|
|
11
12
|
Frontend-only `assigner runtime=client` blocks are executed locally for pure var computations.
|
|
12
13
|
For simultaneous protocol restructuring and data entry, `AimdRecorderEditor` keeps the AIMD source editor and recorder bound to the same `content` + `record` state and can surface detached values after field IDs disappear from the current protocol.
|
|
13
14
|
|
|
@@ -33,10 +34,10 @@ import "@airalogy/aimd-recorder/styles"
|
|
|
33
34
|
|
|
34
35
|
const content = ref(`# Protocol
|
|
35
36
|
|
|
36
|
-
Sample: {{var|sample_name: str}}
|
|
37
|
+
Sample: {{var|sample_name: str, title="Sample name", description="Human-readable sample label", examples=["S-001"]}}
|
|
37
38
|
Operator: {{var|operator: UserName}}
|
|
38
39
|
Record Time: {{var|current_time: CurrentTime}}
|
|
39
|
-
Temperature: {{var|temperature: float = 25.0}}
|
|
40
|
+
Temperature: {{var|temperature: float = 25.0, title="Temperature (C)", description="Ambient temperature in Celsius", examples=[25.0, 37.0]}}
|
|
40
41
|
Notes: {{var|notes: AiralogyMarkdown}}
|
|
41
42
|
Plasmid: {{var|plasmid: DNASequence}}`)
|
|
42
43
|
const record = ref<AimdProtocolRecordData>(createEmptyProtocolRecordData())
|
|
@@ -52,7 +53,7 @@ const record = ref<AimdProtocolRecordData>(createEmptyProtocolRecordData())
|
|
|
52
53
|
</template>
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
`AiralogyMarkdown` fields render a full-width embedded AIMD/Markdown
|
|
56
|
+
`AiralogyMarkdown` fields render a full-width embedded AIMD/Markdown area with `Preview` and `Source` modes; preview uses the AIMD renderer and renders Mermaid code blocks. Source editing keeps the full top toolbar and still supports switching to `WYSIWYG`. Even when the field is authored mid-sentence, recorder lifts it into its own block row instead of keeping it as a tiny inline control.
|
|
56
57
|
|
|
57
58
|
Numeric `var` inputs honor Pydantic-style constraints such as `gt`, `ge`, `lt`, `le`, and `multiple_of`; these constraints apply to `int`, `integer`, `float`, and `number` var types.
|
|
58
59
|
Client assigners also use these constraints for dependency readiness, so an assigner will not run while a dependent numeric field violates its declared bounds.
|
|
@@ -73,6 +74,37 @@ Client assigners also use these constraints for dependency readiness, so an assi
|
|
|
73
74
|
Use `locale` to switch built-in recorder labels (`en-US` / `zh-CN`).
|
|
74
75
|
`AimdProtocolRecorder` is still available as a deprecated compatibility alias, but new code should use `AimdRecorder`.
|
|
75
76
|
|
|
77
|
+
## Assigner Graph
|
|
78
|
+
|
|
79
|
+
Use `AimdAssignerGraph` to render protocol `assigner_graph` data without depending on an app-specific store or UI framework.
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<script setup lang="ts">
|
|
83
|
+
import { AimdAssignerGraph } from "@airalogy/aimd-recorder"
|
|
84
|
+
import "@airalogy/aimd-recorder/styles"
|
|
85
|
+
|
|
86
|
+
const assignerGraph = {
|
|
87
|
+
nodes: [
|
|
88
|
+
{ name: "seconds", type: "dependent_field" },
|
|
89
|
+
{ name: "calculate_duration", type: "assigner" },
|
|
90
|
+
{ name: "duration", type: "assigned_field" },
|
|
91
|
+
],
|
|
92
|
+
edges: [
|
|
93
|
+
["seconds", "calculate_duration"],
|
|
94
|
+
["calculate_duration", "duration"],
|
|
95
|
+
],
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<AimdAssignerGraph
|
|
101
|
+
:assigner-graph="assignerGraph"
|
|
102
|
+
:node-schema-map="{ duration: { title: 'Duration' } }"
|
|
103
|
+
height="520px"
|
|
104
|
+
/>
|
|
105
|
+
</template>
|
|
106
|
+
```
|
|
107
|
+
|
|
76
108
|
## Recorder Editor
|
|
77
109
|
|
|
78
110
|
Use `AimdRecorderEditor` when users need to edit the AIMD protocol structure and fill recorder values in the same screen.
|
|
@@ -189,11 +221,11 @@ Pass `fieldAdapters` to `AimdRecorder` when the host app needs to replace or wra
|
|
|
189
221
|
|
|
190
222
|
If the host app needs per-type behavior instead, use `typePlugins`. A type plugin can define the initial value, normalization, display/parsing hooks, and even a dedicated widget for one specific AIMD type token.
|
|
191
223
|
|
|
192
|
-
The built-in `AiralogyMarkdown`
|
|
224
|
+
The built-in `AiralogyMarkdown` field uses this same extension path, so a host plugin can still replace it when it needs a different preview/source workflow.
|
|
193
225
|
|
|
194
226
|
See:
|
|
195
227
|
|
|
196
|
-
- `aimd/
|
|
228
|
+
- `docs/aimd/en/packages/type-plugins.md`
|
|
197
229
|
|
|
198
230
|
### Quiz Recorder Only
|
|
199
231
|
|
|
@@ -227,9 +259,9 @@ If a choice option defines `followups`, the recorder renders those inputs after
|
|
|
227
259
|
|
|
228
260
|
## Documentation
|
|
229
261
|
|
|
230
|
-
- EN: <https://airalogy.github.io/aimd/en/packages/aimd-recorder>
|
|
231
|
-
- 中文: <https://airalogy.github.io/aimd/zh/packages/aimd-recorder>
|
|
232
|
-
- Source docs: `aimd/
|
|
262
|
+
- EN: <https://airalogy.github.io/airalogy/aimd/en/packages/aimd-recorder>
|
|
263
|
+
- 中文: <https://airalogy.github.io/airalogy/aimd/zh/packages/aimd-recorder>
|
|
264
|
+
- Source docs: `docs/aimd/en/packages/aimd-recorder.md`, `docs/aimd/zh/packages/aimd-recorder.md`
|
|
233
265
|
|
|
234
266
|
## Citation
|
|
235
267
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# @airalogy/aimd-recorder
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@airalogy/aimd-recorder)
|
|
4
|
-
[](https://github.com/airalogy/
|
|
4
|
+
[](https://github.com/airalogy/airalogy/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
AIMD(Airalogy Markdown)记录 UI 组件与样式集合,包含协议内联录入组件、组合式 `AimdRecorderEditor` 与可复用题目作答控件。
|
|
7
7
|
|
|
8
8
|
内置变量控件支持 `CurrentTime`、`UserName`、`AiralogyMarkdown` 和 `DNASequence`。
|
|
9
|
-
`AiralogyMarkdown` 现在会在 recorder 中以横铺内嵌 AIMD/Markdown
|
|
9
|
+
`AiralogyMarkdown` 现在会在 recorder 中以横铺内嵌 AIMD/Markdown 字段呈现,可在渲染预览和源码编辑之间切换;源码编辑保留完整顶部工具栏,并继续支持切换到 `所见即所得`,而不是普通 textarea。
|
|
10
10
|
在 recorder/edit 模式下,`ref_var` 如果已经有记录值,会优先以只读内联内容显示该值。
|
|
11
|
+
`var` 和 `var_table` 标签会显示 AIMD 的 `title`,保留规范 id,并且只在 hover 或键盘 focus 时展示 `description` 与 `example`/`examples` 详情;宿主也可以通过 `fieldMeta` 在运行时覆盖这些显示字段。
|
|
11
12
|
前端受限的 `assigner runtime=client` 代码块会在 recorder 中本地执行,用于纯 `var` 计算。
|
|
12
13
|
如果需要一边改 Protocol 结构、一边继续填写字段数据,可以使用 `AimdRecorderEditor`,它会把源码编辑器和 recorder 绑定到同一份 `content` 与 `record`,并在字段 id 从当前 protocol 里消失后单独展示旧数据。
|
|
13
14
|
|
|
@@ -33,10 +34,10 @@ import "@airalogy/aimd-recorder/styles"
|
|
|
33
34
|
|
|
34
35
|
const content = ref(`# Protocol
|
|
35
36
|
|
|
36
|
-
样本名:{{var|sample_name: str}}
|
|
37
|
+
样本名:{{var|sample_name: str, title="样本名", description="样本的人类可读标签", examples=["S-001"]}}
|
|
37
38
|
记录者:{{var|operator: UserName}}
|
|
38
39
|
记录时间:{{var|current_time: CurrentTime}}
|
|
39
|
-
温度设置:{{var|temperature: float = 25.0}}
|
|
40
|
+
温度设置:{{var|temperature: float = 25.0, title="温度 (C)", description="环境温度,单位为摄氏度", examples=[25.0, 37.0]}}
|
|
40
41
|
实验摘要:{{var|summary: AiralogyMarkdown}}
|
|
41
42
|
质粒:{{var|plasmid: DNASequence}}`)
|
|
42
43
|
const record = ref<AimdProtocolRecordData>(createEmptyProtocolRecordData())
|
|
@@ -52,7 +53,7 @@ const record = ref<AimdProtocolRecordData>(createEmptyProtocolRecordData())
|
|
|
52
53
|
</template>
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
`AiralogyMarkdown` 字段会渲染一个横铺内嵌的 AIMD/Markdown
|
|
56
|
+
`AiralogyMarkdown` 字段会渲染一个横铺内嵌的 AIMD/Markdown 区域,可在 `预览` 和 `源码` 之间切换;预览会通过 AIMD renderer 输出 Markdown,并渲染 Mermaid 代码块。源码编辑保留完整顶部工具栏,同时支持切换到 `所见即所得`。即使它写在一行文字中间,recorder 也会把这个字段提升成下一行的块级编辑区,而不是继续当成段内小控件。
|
|
56
57
|
|
|
57
58
|
数值 `var` 输入会识别 `gt`、`ge`、`lt`、`le`、`multiple_of` 这类 Pydantic 风格约束;这些约束只对 `int`、`integer`、`float`、`number` 类型生效。
|
|
58
59
|
client assigner 也会用这些约束判断依赖是否就绪,因此依赖的数值字段违反声明边界时,assigner 不会执行。
|
|
@@ -73,6 +74,37 @@ client assigner 也会用这些约束判断依赖是否就绪,因此依赖的
|
|
|
73
74
|
通过 `locale` 可以切换 recorder 内建标签(`en-US` / `zh-CN`)。
|
|
74
75
|
`AimdProtocolRecorder` 仍保留为已废弃的兼容别名,但新的代码建议直接使用 `AimdRecorder`。
|
|
75
76
|
|
|
77
|
+
## Assigner 拓扑图
|
|
78
|
+
|
|
79
|
+
使用 `AimdAssignerGraph` 可以直接渲染协议中的 `assigner_graph` 数据,不需要绑定宿主应用自己的 store 或 UI 框架。
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<script setup lang="ts">
|
|
83
|
+
import { AimdAssignerGraph } from "@airalogy/aimd-recorder"
|
|
84
|
+
import "@airalogy/aimd-recorder/styles"
|
|
85
|
+
|
|
86
|
+
const assignerGraph = {
|
|
87
|
+
nodes: [
|
|
88
|
+
{ name: "seconds", type: "dependent_field" },
|
|
89
|
+
{ name: "calculate_duration", type: "assigner" },
|
|
90
|
+
{ name: "duration", type: "assigned_field" },
|
|
91
|
+
],
|
|
92
|
+
edges: [
|
|
93
|
+
["seconds", "calculate_duration"],
|
|
94
|
+
["calculate_duration", "duration"],
|
|
95
|
+
],
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<AimdAssignerGraph
|
|
101
|
+
:assigner-graph="assignerGraph"
|
|
102
|
+
:node-schema-map="{ duration: { title: '时长' } }"
|
|
103
|
+
height="520px"
|
|
104
|
+
/>
|
|
105
|
+
</template>
|
|
106
|
+
```
|
|
107
|
+
|
|
76
108
|
## Recorder Editor
|
|
77
109
|
|
|
78
110
|
当用户需要在同一个界面里同时修改 AIMD Protocol 结构并继续填写 recorder 数据时,使用 `AimdRecorderEditor`。
|
|
@@ -189,11 +221,11 @@ const fieldAdapters = {
|
|
|
189
221
|
|
|
190
222
|
如果宿主应用需要的是某个具体类型的行为扩展,而不是整体替换某类字段 UI,则应该使用 `typePlugins`。type plugin 可以为单个 AIMD 类型定义初始值、归一化、显示/解析钩子,甚至完整的专用 widget。
|
|
191
223
|
|
|
192
|
-
内建的 `AiralogyMarkdown`
|
|
224
|
+
内建的 `AiralogyMarkdown` 字段也是沿用这条扩展路径实现的,因此宿主应用如果需要不同的预览/源码工作流,仍然可以覆盖它。
|
|
193
225
|
|
|
194
226
|
参见:
|
|
195
227
|
|
|
196
|
-
- `aimd/
|
|
228
|
+
- `docs/aimd/zh/packages/type-plugins.md`
|
|
197
229
|
|
|
198
230
|
### 仅题目控件
|
|
199
231
|
|
|
@@ -227,6 +259,6 @@ const quiz = {
|
|
|
227
259
|
|
|
228
260
|
## 文档
|
|
229
261
|
|
|
230
|
-
- EN: <https://airalogy.github.io/aimd/en/packages/aimd-recorder>
|
|
231
|
-
- 中文: <https://airalogy.github.io/aimd/zh/packages/aimd-recorder>
|
|
232
|
-
- 文档源码:`aimd/
|
|
262
|
+
- EN: <https://airalogy.github.io/airalogy/aimd/en/packages/aimd-recorder>
|
|
263
|
+
- 中文: <https://airalogy.github.io/airalogy/aimd/zh/packages/aimd-recorder>
|
|
264
|
+
- 文档源码:`docs/aimd/en/packages/aimd-recorder.md`、`docs/aimd/zh/packages/aimd-recorder.md`
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { defineComponent as B, ref as c, computed as L, onMounted as D, onBeforeUnmount as z, watch as h, openBlock as m, createElementBlock as f, normalizeStyle as F, normalizeClass as S, createElementVNode as _, Fragment as $, createCommentVNode as x, nextTick as T } from "vue";
|
|
2
|
+
import { c as A } from "./useMonacoAutoHeight-D4T-El3J.js";
|
|
3
|
+
import { _ as I } from "./_commonjsHelpers-B5RozER-.js";
|
|
4
|
+
function P(o) {
|
|
5
|
+
return new Worker(
|
|
6
|
+
"/assets/editor.worker-CpuX8TSY.js",
|
|
7
|
+
{
|
|
8
|
+
name: o?.name
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
function N(o) {
|
|
13
|
+
return new Worker(
|
|
14
|
+
"/assets/css.worker-Dmf38jDD.js",
|
|
15
|
+
{
|
|
16
|
+
name: o?.name
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function O(o) {
|
|
21
|
+
return new Worker(
|
|
22
|
+
"/assets/html.worker-DotaEs7v.js",
|
|
23
|
+
{
|
|
24
|
+
name: o?.name
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function q(o) {
|
|
29
|
+
return new Worker(
|
|
30
|
+
"/assets/json.worker-B4VHhH6h.js",
|
|
31
|
+
{
|
|
32
|
+
name: o?.name
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function U(o) {
|
|
37
|
+
return new Worker(
|
|
38
|
+
"/assets/ts.worker-sl17zBDo.js",
|
|
39
|
+
{
|
|
40
|
+
name: o?.name
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const X = {
|
|
45
|
+
css: () => import("./monaco.contribution-b5xkgQ-s.js"),
|
|
46
|
+
scss: () => import("./monaco.contribution-b5xkgQ-s.js"),
|
|
47
|
+
less: () => import("./monaco.contribution-b5xkgQ-s.js"),
|
|
48
|
+
html: () => import("./monaco.contribution-C-bQhUTI.js"),
|
|
49
|
+
javascript: () => import("./monaco.contribution-Col-f0XR.js"),
|
|
50
|
+
typescript: () => import("./monaco.contribution-Col-f0XR.js"),
|
|
51
|
+
json: () => import("./monaco.contribution-CCVvl3Jx.js"),
|
|
52
|
+
ini: () => import("./ini.contribution-DyWtiacL.js"),
|
|
53
|
+
markdown: () => import("./markdown.contribution-DYYk6zUU.js"),
|
|
54
|
+
python: () => import("./python.contribution-CcKs2Ktm.js"),
|
|
55
|
+
shell: () => import("./shell.contribution-B80NZ3iO.js"),
|
|
56
|
+
sql: () => import("./sql.contribution-DQy36aE5.js"),
|
|
57
|
+
xml: () => import("./xml.contribution-XMOaon8i.js"),
|
|
58
|
+
yaml: () => import("./yaml.contribution-DRRVhJmJ.js")
|
|
59
|
+
}, b = /* @__PURE__ */ new Map();
|
|
60
|
+
function Y() {
|
|
61
|
+
typeof globalThis > "u" || typeof globalThis.MonacoEnvironment?.getWorker == "function" || (globalThis.MonacoEnvironment = {
|
|
62
|
+
getWorker(s, t) {
|
|
63
|
+
return t === "json" ? new q() : t === "css" || t === "scss" || t === "less" ? new N() : t === "html" || t === "handlebars" || t === "razor" ? new O() : t === "typescript" || t === "javascript" ? new U() : new P();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async function E(o) {
|
|
68
|
+
const s = X[o];
|
|
69
|
+
if (!s)
|
|
70
|
+
return;
|
|
71
|
+
const t = b.get(o);
|
|
72
|
+
if (t)
|
|
73
|
+
return t;
|
|
74
|
+
const i = Promise.resolve(s()).then(() => {
|
|
75
|
+
});
|
|
76
|
+
return b.set(o, i), i;
|
|
77
|
+
}
|
|
78
|
+
const G = {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "aimd-code-field__fallback-shell"
|
|
81
|
+
}, J = ["value", "disabled"], K = {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: "aimd-code-field__loading"
|
|
84
|
+
}, Q = /* @__PURE__ */ B({
|
|
85
|
+
__name: "AimdCodeField",
|
|
86
|
+
props: {
|
|
87
|
+
modelValue: { default: "" },
|
|
88
|
+
language: {},
|
|
89
|
+
disabled: { type: Boolean, default: !1 }
|
|
90
|
+
},
|
|
91
|
+
emits: ["update:modelValue", "blur"],
|
|
92
|
+
setup(o, { emit: s }) {
|
|
93
|
+
const t = o, i = s, l = c(null), p = c(!0), g = c(null), a = c(y(t.modelValue)), n = A({
|
|
94
|
+
getInitialValue: () => a.value,
|
|
95
|
+
getLayoutElement: () => l.value,
|
|
96
|
+
maxHeight: 520
|
|
97
|
+
}), W = n.editorHeight, M = L(() => ({
|
|
98
|
+
"--aimd-code-field-editor-height": `${W.value}px`
|
|
99
|
+
}));
|
|
100
|
+
let d = null, r = null, u = null, v = !1;
|
|
101
|
+
function y(e) {
|
|
102
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
|
|
103
|
+
}
|
|
104
|
+
function k(e) {
|
|
105
|
+
n.syncEstimatedEditorHeight(e), e !== a.value && (a.value = e, i("update:modelValue", e));
|
|
106
|
+
}
|
|
107
|
+
async function C(e) {
|
|
108
|
+
!d || !u || (await E(e), d.editor.setModelLanguage(u, e));
|
|
109
|
+
}
|
|
110
|
+
async function H() {
|
|
111
|
+
if (!(!l.value || r)) {
|
|
112
|
+
p.value = !0, g.value = null;
|
|
113
|
+
try {
|
|
114
|
+
Y(), d = await import("./editor.main-Du02abDl.js"), await E(t.language), r = d.editor.create(l.value, {
|
|
115
|
+
value: a.value,
|
|
116
|
+
language: t.language,
|
|
117
|
+
theme: "vs",
|
|
118
|
+
minimap: { enabled: !1 },
|
|
119
|
+
scrollBeyondLastLine: !1,
|
|
120
|
+
automaticLayout: !0,
|
|
121
|
+
lineNumbers: "on",
|
|
122
|
+
wordWrap: "on",
|
|
123
|
+
lineHeight: n.lineHeight,
|
|
124
|
+
tabSize: 2,
|
|
125
|
+
padding: { top: 12, bottom: 12 },
|
|
126
|
+
scrollbar: { vertical: "auto", horizontal: "auto" },
|
|
127
|
+
readOnly: t.disabled
|
|
128
|
+
}), u = r.getModel(), r.onDidChangeModelContent(() => {
|
|
129
|
+
v || !r || k(r.getValue());
|
|
130
|
+
}), r.onDidBlurEditorWidget(() => {
|
|
131
|
+
i("blur");
|
|
132
|
+
}), n.attachEditor(r);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
g.value = e instanceof Error ? e.message : "Failed to load Monaco editor.";
|
|
135
|
+
} finally {
|
|
136
|
+
p.value = !1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function j(e) {
|
|
141
|
+
a.value = e, n.syncEstimatedEditorHeight(e), !(!r || e === r.getValue()) && (v = !0, r.setValue(e), v = !1, T(n.syncMeasuredEditorHeight));
|
|
142
|
+
}
|
|
143
|
+
function V(e) {
|
|
144
|
+
k(e.target.value);
|
|
145
|
+
}
|
|
146
|
+
return D(() => {
|
|
147
|
+
H();
|
|
148
|
+
}), z(() => {
|
|
149
|
+
n.dispose(), r?.dispose(), u?.dispose();
|
|
150
|
+
}), h(() => t.modelValue, (e) => {
|
|
151
|
+
j(y(e));
|
|
152
|
+
}), h(() => t.disabled, (e) => {
|
|
153
|
+
r?.updateOptions({ readOnly: e });
|
|
154
|
+
}), h(() => t.language, async (e) => {
|
|
155
|
+
r && await C(e);
|
|
156
|
+
}), (e, w) => (m(), f("div", {
|
|
157
|
+
class: S(["aimd-code-field", { "aimd-code-field--disabled": o.disabled }]),
|
|
158
|
+
style: F(M.value)
|
|
159
|
+
}, [
|
|
160
|
+
g.value ? (m(), f("div", G, [
|
|
161
|
+
_("textarea", {
|
|
162
|
+
class: "aimd-code-field__fallback",
|
|
163
|
+
value: a.value,
|
|
164
|
+
disabled: o.disabled,
|
|
165
|
+
spellcheck: "false",
|
|
166
|
+
onInput: V,
|
|
167
|
+
onBlur: w[0] || (w[0] = (R) => i("blur"))
|
|
168
|
+
}, null, 40, J)
|
|
169
|
+
])) : (m(), f($, { key: 1 }, [
|
|
170
|
+
p.value ? (m(), f("div", K, "Loading code editor…")) : x("", !0),
|
|
171
|
+
_("div", {
|
|
172
|
+
ref_key: "editorContainer",
|
|
173
|
+
ref: l,
|
|
174
|
+
class: "aimd-code-field__editor"
|
|
175
|
+
}, null, 512)
|
|
176
|
+
], 64))
|
|
177
|
+
], 6));
|
|
178
|
+
}
|
|
179
|
+
}), oe = /* @__PURE__ */ I(Q, [["__scopeId", "data-v-1e42ae17"]]);
|
|
180
|
+
export {
|
|
181
|
+
oe as default
|
|
182
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Om, openBlock as wi, createElementBlock as Ji, Fragment as qg, createElementVNode as wt, toDisplayString as ln, normalizeClass as q0, createCommentVNode as _y, ref as lg, computed as uh, watch as $T, onMounted as NA, onBeforeUnmount as zA, createVNode as eS, unref as dE, renderList as HT, normalizeStyle as DA, createBlock as hE, nextTick as BA } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { serializeDnaSequenceToGenBank as HA, normalizeDnaSequenceName as kT, getDnaSequenceSegmentIssue as kA, normalizeDnaSequenceValue as gE, calculateDnaSequenceGcPercent as UA, collectInvalidDnaSequenceCharacters as vE, getNextDnaSequenceAnnotationId as yE, createEmptyDnaSequenceSegment as mE, createEmptyDnaSequenceQualifier as LA, createEmptyDnaSequenceAnnotation as pE } from "./record.js";
|
|
3
|
+
import { a as GA, c as bE, g as IA, _ as FA } from "./_commonjsHelpers-B5RozER-.js";
|
|
4
4
|
const tC = "dna_annotation";
|
|
5
5
|
function nC(Me, Ze) {
|
|
6
6
|
return `${tC}:${Me}:${Ze}`;
|