@airalogy/aimd-editor 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +59 -0
  2. package/README.zh-CN.md +43 -0
  3. package/dist/AimdEditorTopBar.vue_vue_type_script_setup_true_lang-gbfMDZSh.js +1131 -0
  4. package/dist/AimdSourceEditor.vue_vue_type_script_setup_true_lang-t_sUoXky.js +274 -0
  5. package/dist/AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-B8o1VbUH.js +25012 -0
  6. package/dist/aimd-editor.css +1 -0
  7. package/dist/embedded.js +11 -0
  8. package/dist/index.js +44 -0
  9. package/dist/monaco.js +16 -0
  10. package/dist/theme-B8dCnOx-.js +583 -0
  11. package/dist/vue.js +30 -0
  12. package/dist/wysiwyg.js +9 -0
  13. package/package.json +90 -0
  14. package/src/__tests__/editor.test.ts +296 -0
  15. package/src/embedded.ts +18 -0
  16. package/src/index.ts +10 -0
  17. package/src/language-config.ts +152 -0
  18. package/src/monaco.ts +19 -0
  19. package/src/theme.ts +166 -0
  20. package/src/tokens.ts +120 -0
  21. package/src/vue/AimdEditor.vue +715 -0
  22. package/src/vue/AimdEditorToolbar.vue +83 -0
  23. package/src/vue/AimdEditorTopBar.vue +39 -0
  24. package/src/vue/AimdFieldDialog.vue +1102 -0
  25. package/src/vue/AimdSourceEditor.vue +330 -0
  26. package/src/vue/AimdWysiwygEditor.vue +569 -0
  27. package/src/vue/aimdInlineMarkdownNormalization.ts +10 -0
  28. package/src/vue/comparableAimdMarkdown.ts +6 -0
  29. package/src/vue/env.d.ts +7 -0
  30. package/src/vue/index.ts +45 -0
  31. package/src/vue/locales.ts +667 -0
  32. package/src/vue/milkdown-aimd-plugin.ts +378 -0
  33. package/src/vue/programmaticMarkdownSyncGuard.ts +66 -0
  34. package/src/vue/types.ts +449 -0
  35. package/src/vue/useEditorContent.ts +252 -0
  36. package/src/wysiwyg.ts +17 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # @airalogy/aimd-editor
2
+
3
+ AIMD authoring toolkit for Monaco + Vue (WYSIWYG/source workflows).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @airalogy/aimd-editor monaco-editor
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```ts
14
+ import * as monaco from "monaco-editor"
15
+ import { language, conf, completionItemProvider } from "@airalogy/aimd-editor/monaco"
16
+
17
+ monaco.languages.register({ id: "aimd" })
18
+ monaco.languages.setMonarchTokensProvider("aimd", language)
19
+ monaco.languages.setLanguageConfiguration("aimd", conf)
20
+ monaco.languages.registerCompletionItemProvider("aimd", completionItemProvider)
21
+ ```
22
+
23
+ ## Vue Editor i18n
24
+
25
+ ```vue
26
+ <script setup lang="ts">
27
+ import { AimdEditor } from "@airalogy/aimd-editor"
28
+ </script>
29
+
30
+ <template>
31
+ <AimdEditor locale="zh-CN" />
32
+ </template>
33
+ ```
34
+
35
+ Use `messages` to override built-in copy per locale.
36
+
37
+ For advanced embedding, the low-level `AimdWysiwygEditor` now accepts a custom Milkdown plugin chain, and `AimdFieldDialog` can be limited to a focused subset of AIMD field kinds with `allowedTypes`.
38
+
39
+ ## Documentation
40
+
41
+ - EN: <https://airalogy.github.io/aimd/en/packages/aimd-editor>
42
+ - 中文: <https://airalogy.github.io/aimd/zh/packages/aimd-editor>
43
+ - Source docs: `aimd/docs/en/packages/aimd-editor.md`, `aimd/docs/zh/packages/aimd-editor.md`
44
+
45
+ ## Citation
46
+
47
+ If `@airalogy/aimd-editor` is useful in your work, please cite the Airalogy paper:
48
+
49
+ ```bibtex
50
+ @misc{yang2025airalogyaiempowereduniversaldata,
51
+ title={Airalogy: AI-empowered universal data digitization for research automation},
52
+ author={Zijie Yang and Qiji Zhou and Fang Guo and Sijie Zhang and Yexun Xi and Jinglei Nie and Yudian Zhu and Liping Huang and Chou Wu and Yonghe Xia and Xiaoyu Ma and Yingming Pu and Panzhong Lu and Junshu Pan and Mingtao Chen and Tiannan Guo and Yanmei Dou and Hongyu Chen and Anping Zeng and Jiaxing Huang and Tian Xu and Yue Zhang},
53
+ year={2025},
54
+ eprint={2506.18586},
55
+ archivePrefix={arXiv},
56
+ primaryClass={cs.AI},
57
+ url={https://arxiv.org/abs/2506.18586},
58
+ }
59
+ ```
@@ -0,0 +1,43 @@
1
+ # @airalogy/aimd-editor
2
+
3
+ 面向 AIMD 的编辑工具包(Monaco + Vue,可视化/源码双模式)。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pnpm add @airalogy/aimd-editor monaco-editor
9
+ ```
10
+
11
+ ## 快速开始
12
+
13
+ ```ts
14
+ import * as monaco from "monaco-editor"
15
+ import { language, conf, completionItemProvider } from "@airalogy/aimd-editor/monaco"
16
+
17
+ monaco.languages.register({ id: "aimd" })
18
+ monaco.languages.setMonarchTokensProvider("aimd", language)
19
+ monaco.languages.setLanguageConfiguration("aimd", conf)
20
+ monaco.languages.registerCompletionItemProvider("aimd", completionItemProvider)
21
+ ```
22
+
23
+ ## Vue 编辑器 i18n
24
+
25
+ ```vue
26
+ <script setup lang="ts">
27
+ import { AimdEditor } from "@airalogy/aimd-editor"
28
+ </script>
29
+
30
+ <template>
31
+ <AimdEditor locale="zh-CN" />
32
+ </template>
33
+ ```
34
+
35
+ 也可以通过 `messages` 覆盖内建文案。
36
+
37
+ 如果要做更底层的嵌入式集成,`AimdWysiwygEditor` 现在支持注入自定义 Milkdown plugin 链,`AimdFieldDialog` 也支持通过 `allowedTypes` 限定可插入的 AIMD 字段类型。
38
+
39
+ ## 文档
40
+
41
+ - EN: <https://airalogy.github.io/aimd/en/packages/aimd-editor>
42
+ - 中文: <https://airalogy.github.io/aimd/zh/packages/aimd-editor>
43
+ - 文档源码:`aimd/docs/en/packages/aimd-editor.md`、`aimd/docs/zh/packages/aimd-editor.md`